From 3c6c9bc47badaebb8e107ad3a5f5d6a871c20b4a Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sun, 22 Aug 2021 18:29:10 +0300 Subject: [PATCH] Deal with file name case sensitivity issue. --- vendor/ZMQ/CMakeLists.txt | 5 ++ .../builds/cmake/Modules2/Findsodium.cmake | 48 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 vendor/ZMQ/builds/cmake/Modules2/Findsodium.cmake diff --git a/vendor/ZMQ/CMakeLists.txt b/vendor/ZMQ/CMakeLists.txt index 0863c23f..67108c0c 100644 --- a/vendor/ZMQ/CMakeLists.txt +++ b/vendor/ZMQ/CMakeLists.txt @@ -24,6 +24,11 @@ include(CMakePackageConfigHelpers) list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}") set(ZMQ_CMAKE_MODULES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/Modules) list(APPEND CMAKE_MODULE_PATH ${ZMQ_CMAKE_MODULES_DIR}) +# This is tp deal with the fact that windows file names is case insensitive while linux isn't +# So linux has issues finding FindSodium.cmake because it looks for Findsodium.cmake +# Lazy workaround, if I can even call it that +set(ZMQ_CMAKE_MODULES_DIR2 ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/Modules) +list(APPEND CMAKE_MODULE_PATH ${ZMQ_CMAKE_MODULES_DIR2}) include(TestZMQVersion) include(ZMQSourceRunChecks) diff --git a/vendor/ZMQ/builds/cmake/Modules2/Findsodium.cmake b/vendor/ZMQ/builds/cmake/Modules2/Findsodium.cmake new file mode 100644 index 00000000..9ec36d1d --- /dev/null +++ b/vendor/ZMQ/builds/cmake/Modules2/Findsodium.cmake @@ -0,0 +1,48 @@ +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################ + +if (NOT MSVC) +find_package(PkgConfig REQUIRED) +pkg_check_modules(PC_SODIUM "libsodium") +if (PC_SODIUM_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libsodium") +endif() +if (NOT PC_SODIUM_FOUND) + pkg_check_modules(PC_SODIUM "sodium") + if (PC_SODIUM_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} sodium") + endif() +endif (NOT PC_SODIUM_FOUND) +if (PC_SODIUM_FOUND) + set(SODIUM_INCLUDE_HINTS ${PC_SODIUM_INCLUDE_DIRS} ${PC_SODIUM_INCLUDE_DIRS}/*) + set(SODIUM_LIBRARY_HINTS ${PC_SODIUM_LIBRARY_DIRS} ${PC_SODIUM_LIBRARY_DIRS}/*) +else() + set(pkg_config_libs_private "${pkg_config_libs_private} -lsodium") +endif() +endif (NOT MSVC) + +# some libraries install the headers is a subdirectory of the include dir +# returned by pkg-config, so use a wildcard match to improve chances of finding +# headers and libraries. +find_path( + SODIUM_INCLUDE_DIRS + NAMES sodium.h + HINTS ${SODIUM_INCLUDE_HINTS} +) + +find_library( + SODIUM_LIBRARIES + NAMES libsodium sodium + HINTS ${SODIUM_LIBRARY_HINTS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(sodium DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS) +mark_as_advanced(SODIUM_FOUND SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS) + +################################################################################ +# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # +# Please refer to the README for information about making permanent changes. # +################################################################################