From de5e7a39834500b924e156488aa63a5dbf874998 Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Wed, 6 Dec 2017 12:41:55 -0800 Subject: [PATCH] Problem: WIN32 CMAKECONFIG_INSTALL_DIR is broken Solution: set it to CMake instead of a subfolder of share. See cmake find_package documentation for further info. --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76599977..173d4b1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -965,8 +965,12 @@ endif () include(CMakePackageConfigHelpers) -# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share". -set(ZEROMQ_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME}" CACHE STRING "install path for ZeroMQConfig.cmake") +if (WIN32) + set(ZEROMQ_CMAKECONFIG_INSTALL_DIR "CMake" CACHE STRING "install path for ZeroMQConfig.cmake") +else() + # GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share". + set(ZEROMQ_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME}" CACHE STRING "install path for ZeroMQConfig.cmake") +endif() if (NOT CMAKE_VERSION VERSION_LESS 3.0) export(EXPORT ${PROJECT_NAME}-targets