From: Julian Andres Klode Date: Mon, 8 Aug 2016 12:35:09 +0000 (+0200) Subject: CMake: Allow building without dpkg X-Git-Tag: 1.3_rc1~9^2~10 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/3093c60f4995c4b37ace3901951b9f244b6d416c 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 --- 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 ") -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)