CMakeLists.txt
branchv_0
changeset 0 9000436424bb
child 11 56c84049698d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CMakeLists.txt	Sat Jan 05 19:03:47 2019 +0100
@@ -0,0 +1,34 @@
+# Relational pipes
+# Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+set(PROJECT_CODE         "relpipe-lib-xmlwriter")
+set(PROJECT_TITLE        "Relational pipes - lib - XMLWriter (C++)")
+set(PROJECT_DESCRIPTION  "C++ header-only library for writing XML streams")
+
+
+# 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:
+if(NOT DEFINED PROJECT_VERSION)
+	execute_process(
+		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.]+$'"
+		WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}        OUTPUT_VARIABLE PROJECT_VERSION        RESULT_VARIABLE VERSION_ERROR_CODE        OUTPUT_STRIP_TRAILING_WHITESPACE
+	)
+endif()
+
+cmake_policy(SET CMP0048 NEW)
+project (${PROJECT_CODE}.cpp VERSION ${PROJECT_VERSION})
+cmake_minimum_required(VERSION 3.7.2)
+add_subdirectory (src)