summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-08 14:35:09 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-10 16:16:58 +0200
commit3093c60f4995c4b37ace3901951b9f244b6d416c (patch)
tree5ace12b7fec271ad41e2915072eced300535ef28
parent4924e4686cd9f4839993620e1726995f732216e8 (diff)
CMake: Allow building without dpkg
It's not entirely clear if that is useful, but it cannot hurt. We need to check what is missing to build on foreign systems without dpkg. Gbp-Dch: ignore
-rw-r--r--CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9082118fe..254e34869 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,10 +113,14 @@ endif()
set(PACKAGE ${PROJECT_NAME})
set(PACKAGE_MAIL "APT Development Team <deity@lists.debian.org>")
-execute_process(COMMAND dpkg-parsechangelog -SVersion -l${PROJECT_SOURCE_DIR}/debian/changelog
- OUTPUT_VARIABLE PACKAGE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH
- OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
+if (NOT DEFINED PACKAGE_VERSION)
+ execute_process(COMMAND dpkg-parsechangelog -SVersion -l${PROJECT_SOURCE_DIR}/debian/changelog
+ OUTPUT_VARIABLE PACKAGE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+if (NOT DEFINED COMMON_ARCH)
+ execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH
+ OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
# Configure our configuration headers (config.h and apti18n.h)
configure_file(CMake/config.h.in ${PROJECT_BINARY_DIR}/include/config.h)