author | František Kučera <franta-hg@frantovo.cz> |
Tue, 20 Oct 2020 23:48:51 +0200 | |
branch | v_0 |
changeset 26 | b6a8278c9064 |
parent 17 | 46151cd23815 |
permissions | -rw-r--r-- |
15
825c611933b3
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
1 |
# Relational pipes (library) |
5 | 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 |
|
15
825c611933b3
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
5 |
# it under the terms of the: |
825c611933b3
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
6 |
# - GNU Lesser General Public License as published by the Free Software Foundation; |
825c611933b3
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
7 |
# version 3 of the License or (at your option) |
825c611933b3
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
8 |
# - GNU General Public License as published by the Free Software Foundation; |
825c611933b3
fix license version: GNU LGPLv3 or GPLv2
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
9 |
# version 2 of the License. |
5 | 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 |
||
6
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
19 |
|
17
46151cd23815
relpipe-lib-protocol → relpipe-lib-common
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
20 |
set(PROJECT_CODE "relpipe-lib-common") |
46151cd23815
relpipe-lib-protocol → relpipe-lib-common
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
21 |
set(PROJECT_TITLE "Relational pipes - lib - Common (C++)") |
46151cd23815
relpipe-lib-protocol → relpipe-lib-common
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
22 |
set(PROJECT_DESCRIPTION "common constants, classes and functions") |
6
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
23 |
|
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
24 |
|
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
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: |
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
26 |
if(NOT DEFINED PROJECT_VERSION) |
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
27 |
execute_process( |
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
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.]+$'" |
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
29 |
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_VERSION RESULT_VARIABLE VERSION_ERROR_CODE OUTPUT_STRIP_TRAILING_WHITESPACE |
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
30 |
) |
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
31 |
endif() |
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
32 |
|
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
33 |
cmake_policy(SET CMP0048 NEW) |
22b0fd622175
cmake: generate pkg-config and install
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
34 |
project (${PROJECT_CODE}.cpp VERSION ${PROJECT_VERSION}) |
7
2f7365948a67
builds with cmake 3.7.2 (e.g. on Debian GNU/Linux 9.6)
František Kučera <franta-hg@frantovo.cz>
parents:
6
diff
changeset
|
35 |
cmake_minimum_required(VERSION 3.7.2) |
5 | 36 |
add_subdirectory (src) |