diff options
author | Brad King <brad.king@kitware.com> | 2018-05-11 15:34:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-11 15:34:27 (GMT) |
commit | 05d67d2545e3b3f9659dc615c72cc20e6d4781b7 (patch) | |
tree | f4dd44527b51e1d4968b28eb6c212474772a6f41 /Source/kwsys/CMakeLists.txt | |
parent | c9e995c9efdaa462ac2649f1c1ff4e511db7fcf5 (diff) | |
parent | 55efd14733a8ad6bfeebcd661f85d312eeaa409d (diff) | |
download | CMake-05d67d2545e3b3f9659dc615c72cc20e6d4781b7.zip CMake-05d67d2545e3b3f9659dc615c72cc20e6d4781b7.tar.gz CMake-05d67d2545e3b3f9659dc615c72cc20e6d4781b7.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2018-05-11 (46da6b14)
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 4fc176b..96088c8 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -196,6 +196,11 @@ IF(KWSYS_STANDALONE) ENDIF() ENDIF() +# Choose default shared/static build if not specified. +IF(NOT DEFINED KWSYS_BUILD_SHARED) + SET(KWSYS_BUILD_SHARED ${BUILD_SHARED_LIBS}) +ENDIF() + # Include helper macros. INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/kwsysPlatformTests.cmake) INCLUDE(CheckTypeSize) @@ -230,13 +235,14 @@ ENDIF() # Setup library install rules. SET(KWSYS_INSTALL_LIBRARY_RULE) +SET(KWSYS_INSTALL_NAMELINK_RULE) IF(KWSYS_INSTALL_LIB_DIR) IF(KWSYS_INSTALL_EXPORT_NAME) LIST(APPEND KWSYS_INSTALL_LIBRARY_RULE EXPORT ${KWSYS_INSTALL_EXPORT_NAME}) ENDIF() # Install the shared library to the lib directory. SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR} + LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR} NAMELINK_SKIP ) # Assign the shared library to the runtime component. IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) @@ -244,6 +250,17 @@ IF(KWSYS_INSTALL_LIB_DIR) COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} ) ENDIF() + IF(KWSYS_BUILD_SHARED) + SET(KWSYS_INSTALL_NAMELINK_RULE ${KWSYS_INSTALL_NAMELINK_RULE} + LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR} NAMELINK_ONLY + ) + # Assign the namelink to the development component. + IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) + SET(KWSYS_INSTALL_NAMELINK_RULE ${KWSYS_INSTALL_NAMELINK_RULE} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} + ) + ENDIF() + ENDIF() # Install the archive to the lib directory. SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} @@ -427,11 +444,6 @@ ELSE() SET(KWSYS_NAME_IS_KWSYS 0) ENDIF() -# Choose default shared/static build if not specified. -IF(KWSYS_BUILD_SHARED MATCHES "^KWSYS_BUILD_SHARED$") - SET(KWSYS_BUILD_SHARED ${BUILD_SHARED_LIBS}) -ENDIF() - IF(KWSYS_BUILD_SHARED) SET(KWSYS_BUILD_SHARED 1) SET(KWSYS_LIBRARY_TYPE SHARED) @@ -933,6 +945,9 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) IF(KWSYS_INSTALL_LIBRARY_RULE) INSTALL(TARGETS ${KWSYS_TARGET_INSTALL} ${KWSYS_INSTALL_LIBRARY_RULE}) ENDIF() + IF(KWSYS_INSTALL_NAMELINK_RULE) + INSTALL(TARGETS ${KWSYS_TARGET_INSTALL} ${KWSYS_INSTALL_NAMELINK_RULE}) + ENDIF() ENDIF() # Add a C-only library if requested. |