From 79dd70c2f582facc7dd8d94a36faf7a687940ebc Mon Sep 17 00:00:00 2001 From: Patrick Brosi Date: Wed, 12 Oct 2022 12:22:16 +0200 Subject: [PATCH] set LIBZIP_LIBRARY to "" if libzip was not found --- cmake/FindLibZip.cmake | 2 ++ src/pfaedle/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/FindLibZip.cmake b/cmake/FindLibZip.cmake index 39b633d..0dc4c70 100644 --- a/cmake/FindLibZip.cmake +++ b/cmake/FindLibZip.cmake @@ -45,5 +45,7 @@ MARK_AS_ADVANCED(LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR LIBZIP_CONF_INCLUDE_DIR LIBZI IF (LIBZIP_FOUND) MESSAGE(STATUS "Found libzip: ${LIBZIP_LIBRARY}") ELSE (LIBZIP_FOUND) + SET(LIBZIP_LIBRARY "") + SET(LIBZIP_INCLUDE_DIRS "") MESSAGE(STATUS "Could not find libzip") ENDIF (LIBZIP_FOUND) diff --git a/src/pfaedle/CMakeLists.txt b/src/pfaedle/CMakeLists.txt index 8adb8d6..4d31bc1 100644 --- a/src/pfaedle/CMakeLists.txt +++ b/src/pfaedle/CMakeLists.txt @@ -17,6 +17,6 @@ add_executable(pfaedle ${pfaedle_main}) add_library(pfaedle_dep ${pfaedle_SRC}) include_directories(pfaedle_dep PUBLIC ${PROJECT_SOURCE_DIR}/src/cppgtfs/src) -target_link_libraries(pfaedle pfaedle_dep util configparser ad_cppgtfs -lpthread) +target_link_libraries(pfaedle pfaedle_dep util configparser ad_cppgtfs -lpthread ${LIBZIP_LIBRARY}) add_subdirectory(tests)