author | František Kučera <franta-hg@frantovo.cz> |
Tue, 10 Dec 2019 19:37:43 +0100 | |
branch | v_0 |
changeset 44 | 3f7b5f3f3f84 |
parent 41 | 744b61559eb2 |
permissions | -rw-r--r-- |
41
744b61559eb2
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
33
diff
changeset
|
1 |
# Relational pipes (library) |
31 | 2 |
# Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info) |
3 |
# |
|
4 |
# This program is free software: you can redistribute it and/or modify |
|
41
744b61559eb2
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
33
diff
changeset
|
5 |
# it under the terms of the: |
744b61559eb2
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
33
diff
changeset
|
6 |
# - GNU Lesser General Public License as published by the Free Software Foundation; |
744b61559eb2
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
33
diff
changeset
|
7 |
# version 3 of the License or (at your option) |
744b61559eb2
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
33
diff
changeset
|
8 |
# - GNU General Public License as published by the Free Software Foundation; |
744b61559eb2
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
33
diff
changeset
|
9 |
# version 2 of the License. |
31 | 10 |
# |
11 |
# This program is distributed in the hope that it will be useful, |
|
12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
# GNU General Public License for more details. |
|
15 |
# |
|
16 |
# You should have received a copy of the GNU General Public License |
|
17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
18 |
||
32
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
19 |
|
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
20 |
set(PROJECT_CODE "relpipe-lib-writer") |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
21 |
set(PROJECT_TITLE "Relational pipes - lib - writer (C++)") |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
22 |
set(PROJECT_DESCRIPTION "C++ library for writing data in relpipe format") |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
23 |
|
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
24 |
|
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
25 |
# The project version should be specified as "cmake -DPROJECT_VERSION=x.y.z" or is derived from current mercurial tag. If current revision has no tag, default version is set: |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
26 |
if(NOT DEFINED PROJECT_VERSION) |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
27 |
execute_process( |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
28 |
COMMAND bash -c "hg log -r '.' --template '{latesttag}:{latesttagdistance}:{branch}\\n' | sed -E -e 's/v(.*):0:.*/\\1/g' -e 's/.*:.*:v_(.*)/\\1.9999/g' | grep -E '^[0-9.]+$'" |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
29 |
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_VERSION RESULT_VARIABLE VERSION_ERROR_CODE OUTPUT_STRIP_TRAILING_WHITESPACE |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
30 |
) |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
31 |
endif() |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
32 |
|
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
33 |
cmake_policy(SET CMP0048 NEW) |
b1c84aca28fb
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
31
diff
changeset
|
34 |
project (${PROJECT_CODE}.cpp VERSION ${PROJECT_VERSION}) |
33
c0e445dda2c5
builds with cmake 3.7.2 (e.g. on Debian GNU/Linux 9.6)
František Kučera <franta-hg@frantovo.cz>
parents:
32
diff
changeset
|
35 |
cmake_minimum_required(VERSION 3.7.2) |
31 | 36 |
add_subdirectory (src) |