]> git.saurik.com Git - apt.git/commitdiff
CMake: Allow building without dpkg
authorJulian Andres Klode <jak@debian.org>
Mon, 8 Aug 2016 12:35:09 +0000 (14:35 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 10 Aug 2016 14:16:58 +0000 (16:16 +0200)
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

CMakeLists.txt

index 9082118fe693d8ade448bd52d940fc702e13805e..254e348693f30e07d774bb3933ed84bc174260db 100644 (file)
@@ -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)