From b13861fa687cf3a2af97a5beb0c0642d9bee8f8c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 10 Sep 2017 11:35:54 +0200 Subject: CMake: Properly handle Udev missing When udev is not available, the variables for libraries and include paths are set to NOTFOUND rather than an empty string and CMake exits with an error. Use a generator expression to only use these variables when UDEV_FOUND is true. --- apt-pkg/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/CMakeLists.txt') diff --git a/apt-pkg/CMakeLists.txt b/apt-pkg/CMakeLists.txt index 651e55c79..2f5ad3200 100644 --- a/apt-pkg/CMakeLists.txt +++ b/apt-pkg/CMakeLists.txt @@ -44,7 +44,7 @@ target_include_directories(apt-pkg ${BZIP2_INCLUDE_DIR} ${LZMA_INCLUDE_DIRS} ${LZ4_INCLUDE_DIRS} - ${UDEV_INCLUDE_DIRS} + $<$:${UDEV_INCLUDE_DIRS}> ${ICONV_INCLUDE_DIRS} ) @@ -55,7 +55,7 @@ target_link_libraries(apt-pkg ${BZIP2_LIBRARIES} ${LZMA_LIBRARIES} ${LZ4_LIBRARIES} - ${UDEV_LIBRARIES} + $<$:${UDEV_LIBRARIES}> ${ICONV_LIBRARIES} ) set_target_properties(apt-pkg PROPERTIES VERSION ${MAJOR}.${MINOR}) -- cgit v1.2.3