CMakeLists.txt
author František Kučera <franta-hg@frantovo.cz>
Tue, 10 Dec 2019 19:37:43 +0100
branchv_0
changeset 44 3f7b5f3f3f84
parent 41 744b61559eb2
permissions -rw-r--r--
binary format change: encode numbers as ULEB128 instead of original uint8/16/32/64 format
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
# Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     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
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
#
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# This program is distributed in the hope that it will be useful,
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# GNU General Public License for more details.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
#
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    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
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
add_subdirectory (src)