From 4077d6d80cb446f5c4e3c8739ae05375c6e62540 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 1 Mar 2006 13:15:44 -0500 Subject: ENH: Install system libraries only if project requires them --- CMakeLists.txt | 3 +++ Modules/CPack.cmake | 30 ---------------------------- Modules/InstallRequiredSystemLibraries.cmake | 29 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 Modules/InstallRequiredSystemLibraries.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index cb22951..29afb11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,6 +224,9 @@ INCLUDE (${CMake_SOURCE_DIR}/Utilities/Release/Release.cmake) # If the cmake version includes cpack, use it IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") + IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") + INCLUDE(InstallRequiredSystemLibraries) + ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") SET(CPACK_PACKAGE_VENDOR "Kitware") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 41113d3..26b3c65 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -65,36 +65,6 @@ ENDIF(NOT CPACK_GENERATOR) # Set some other variables SET(CPACK_BINARY_DIR "${CMAKE_BINARY_DIR}") -# Hack for Visual Studio support -# Search for system runtime libraries based on the platform. This is -# not complete because it is used only for the release process by the -# developers. -IF(NOT CPACK_DISABLE_EXTRA_MSVC_LIBRARIES) - IF(MSVC) - STRING(REGEX REPLACE "\\\\" "/" SYSTEMROOT "$ENV{SYSTEMROOT}") - FOREACH(lib - "${SYSTEMROOT}/system32/mfc71.dll" - "${SYSTEMROOT}/system32/msvcp71.dll" - "${SYSTEMROOT}/system32/msvcr71.dll" - ) - IF(EXISTS ${lib}) - SET(CMake_INSTALL_SYSTEM_RUNTIME_LIBS - ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib}) - ENDIF(EXISTS ${lib}) - ENDFOREACH(lib) - ENDIF(MSVC) -ENDIF(NOT CPACK_DISABLE_EXTRA_MSVC_LIBRARIES) - -# Include system runtime libraries in the installation if any are -# specified by CMake_INSTALL_SYSTEM_RUNTIME_LIBS. -IF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS) - IF(WIN32) - INSTALL_PROGRAMS(/bin ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS}) - ELSE(WIN32) - INSTALL_PROGRAMS(/lib ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS}) - ENDIF(WIN32) -ENDIF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS) - SET(_CPACK_UNUSED_VARIABLES_) GET_CMAKE_PROPERTY(res VARIABLES) FOREACH(var ${res}) diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake new file mode 100644 index 0000000..071bb2b --- /dev/null +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -0,0 +1,29 @@ +# Hack for Visual Studio support +# Search for system runtime libraries based on the platform. This is +# not complete because it is used only for the release process by the +# developers. +IF(MSVC) + STRING(REGEX REPLACE "\\\\" "/" SYSTEMROOT "$ENV{SYSTEMROOT}") + FOREACH(lib + "${SYSTEMROOT}/system32/mfc71.dll" + "${SYSTEMROOT}/system32/msvcp71.dll" + "${SYSTEMROOT}/system32/msvcr71.dll" + ) + IF(EXISTS ${lib}) + SET(CMake_INSTALL_SYSTEM_RUNTIME_LIBS + ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib}) + ENDIF(EXISTS ${lib}) + ENDFOREACH(lib) +ENDIF(MSVC) + +# Include system runtime libraries in the installation if any are +# specified by CMake_INSTALL_SYSTEM_RUNTIME_LIBS. +IF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS) + IF(WIN32) + INSTALL_PROGRAMS(/bin ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS}) + ELSE(WIN32) + INSTALL_PROGRAMS(/lib ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS}) + ENDIF(WIN32) +ENDIF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS) + + -- cgit v0.12