navid/veins / commit
d3323c6c3a9d
Navid M <navidmomtahen@gmail.com> · 2026-11-27
parents: 8f27ca4e7bfe
Browse files at this commit · Download source
--- a/veins-cpprewrite/CMakeLists.txt+++ b/veins-cpprewrite/CMakeLists.txt@@ -22,7 +22,8 @@ find_package(Threads REQUIRED) # ----------------------------------------------------------------------------# zstd: prefer an installed package, otherwise fetch a pinned release.+# zstd: prefer an installed package, otherwise a system library, otherwise+# fetch a pinned release. # --------------------------------------------------------------------------- find_package(zstd CONFIG QUIET) if(TARGET zstd::libzstd_static)@@ -34,6 +35,27 @@ elseif(TARGET libzstd) set(VN_ZSTD_TARGET libzstd) else()+ # Ubuntu/Debian's libzstd-dev ships zstd.h and libzstd.{a,so} but no CMake+ # config. Never pass "libzstd" to the linker: -llibzstd looks for+ # liblibzstd.*. Naming the archive explicitly prefers libzstd.a, which is+ # the equivalent of linking with -l:libzstd.a.+ find_library(VN_ZSTD_LIBRARY NAMES libzstd.a zstd)+ if(VN_ZSTD_LIBRARY)+ find_path(VN_ZSTD_INCLUDE_DIR NAMES zstd.h)+ add_library(vn_zstd UNKNOWN IMPORTED)+ set_target_properties(vn_zstd PROPERTIES+ IMPORTED_LOCATION "${VN_ZSTD_LIBRARY}"+ )+ if(VN_ZSTD_INCLUDE_DIR)+ set_target_properties(vn_zstd PROPERTIES+ INTERFACE_INCLUDE_DIRECTORIES "${VN_ZSTD_INCLUDE_DIR}"+ )+ endif()+ set(VN_ZSTD_TARGET vn_zstd)+ endif()+endif()++if(NOT VN_ZSTD_TARGET) set(ZSTD_BUILD_PROGRAMS OFF CACHE BOOL "" FORCE) set(ZSTD_BUILD_CONTRIB OFF CACHE BOOL "" FORCE) set(ZSTD_BUILD_TESTS OFF CACHE BOOL "" FORCE)