Unverified Commit 0aa222d0 authored by Luca Boccassi's avatar Luca Boccassi Committed by GitHub

Merge pull request #3197 from justusranvier/master

Problem: build system does not play nicely as a cmake subproject
parents f4aad4d1 458f41e3
...@@ -1219,7 +1219,7 @@ endif () ...@@ -1219,7 +1219,7 @@ endif ()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# installer # installer
if (MSVC) if (MSVC AND (BUILD_SHARED OR BUILD_STATIC))
install (TARGETS ${target_outputs} install (TARGETS ${target_outputs}
EXPORT ${PROJECT_NAME}-targets EXPORT ${PROJECT_NAME}-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
...@@ -1238,7 +1238,7 @@ if (MSVC) ...@@ -1238,7 +1238,7 @@ if (MSVC)
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT Runtime) COMPONENT Runtime)
endif () endif ()
else () elseif (BUILD_SHARED OR BUILD_STATIC)
install (TARGETS ${target_outputs} install (TARGETS ${target_outputs}
EXPORT ${PROJECT_NAME}-targets EXPORT ${PROJECT_NAME}-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
...@@ -1281,7 +1281,7 @@ else() ...@@ -1281,7 +1281,7 @@ else()
set(ZEROMQ_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME}" CACHE STRING "install path for ZeroMQConfig.cmake") set(ZEROMQ_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME}" CACHE STRING "install path for ZeroMQConfig.cmake")
endif() endif()
if (NOT CMAKE_VERSION VERSION_LESS 3.0) if ((NOT CMAKE_VERSION VERSION_LESS 3.0) AND (BUILD_SHARED OR BUILD_STATIC))
export(EXPORT ${PROJECT_NAME}-targets export(EXPORT ${PROJECT_NAME}-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake") FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
endif() endif()
...@@ -1291,12 +1291,14 @@ configure_package_config_file(builds/cmake/${PROJECT_NAME}Config.cmake.in ...@@ -1291,12 +1291,14 @@ configure_package_config_file(builds/cmake/${PROJECT_NAME}Config.cmake.in
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH} VERSION ${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}
COMPATIBILITY AnyNewerVersion) COMPATIBILITY AnyNewerVersion)
install(EXPORT ${PROJECT_NAME}-targets if (BUILD_SHARED OR BUILD_STATIC)
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}Targets.cmake FILE ${PROJECT_NAME}Targets.cmake
DESTINATION ${ZEROMQ_CMAKECONFIG_INSTALL_DIR}) DESTINATION ${ZEROMQ_CMAKECONFIG_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${ZEROMQ_CMAKECONFIG_INSTALL_DIR}) DESTINATION ${ZEROMQ_CMAKECONFIG_INSTALL_DIR})
endif()
option(ENABLE_CPACK "Enables cpack rules" ON) option(ENABLE_CPACK "Enables cpack rules" ON)
if (MSVC AND ENABLE_CPACK) if (MSVC AND ENABLE_CPACK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment