diff options
author | Alex Neundorf <neundorf@kde.org> | 2012-05-12 22:17:06 +0200 |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2012-05-12 22:19:05 +0200 |
commit | 8a6b267febc287b17a498289ee0079de233186ef (patch) | |
tree | 36ddf8834c7f7a2f32916b09585a7b93c21ea9c5 | |
parent | f168a763c7716ad5bb04417a2bbc94f1aff024ae (diff) | |
download | extra-cmake-modules-8a6b267febc287b17a498289ee0079de233186ef.tar.gz extra-cmake-modules-8a6b267febc287b17a498289ee0079de233186ef.tar.bz2 |
remove LIBRARY_TYPE cmake variable
As discussed, remove the LIBRARY_TYPE cmake variable and
put BUILD_SHARED_LIBS instead into the cache, set to TRUE.
So if somebody wants to build a static library, and the project
allows it (by not explicitely using "STATIC" in add_library()), he
can switch this variable to FALSE in the cache.
Also, put the ARCHIVE library component into the Devel install component,
static libs and Windows lib files belong to the development package.
Use newer write_basic_package_version_file() instead of older write_basic_config_version_file(),
which are identical beside the name
Alex
-rw-r--r-- | kde-modules/KDECMakeSettings.cmake | 3 | ||||
-rw-r--r-- | modules/ECMQtFramework.cmake | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake index 2ff8e029..4f765ae8 100644 --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -78,6 +78,9 @@ if(NOT KDE_SKIP_BUILD_SETTINGS) # This will only have an effect in CMake 2.8.7 set(CMAKE_LINK_INTERFACE_LIBRARIES "") + # Default to shared libs for KDE, if no type is explicitely given to add_library(): + set(BUILD_SHARED_LIBS TRUE CACHE BOOL "If enabled, shared libs will be built by default, otherwise static libs") + # Enable automoc in cmake set(CMAKE_AUTOMOC ON) diff --git a/modules/ECMQtFramework.cmake b/modules/ECMQtFramework.cmake index fdbb6de9..ef31e03e 100644 --- a/modules/ECMQtFramework.cmake +++ b/modules/ECMQtFramework.cmake @@ -89,13 +89,11 @@ include(FeatureSummary) -set(LIBRARY_TYPE SHARED) - set(ECM_TARGET_DEFAULT_ARGS # EXPORT ${PROJECT_NAME}LibraryTargets RUNTIME DESTINATION "${BIN_INSTALL_DIR}" COMPONENT ${PROJECT_NAME} LIBRARY DESTINATION "${LIB_INSTALL_DIR}" COMPONENT ${PROJECT_NAME} - ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT ${PROJECT_NAME} + ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT Devel ) set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/${PROJECT_NAME}") @@ -109,9 +107,7 @@ configure_package_config_file( PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR CMAKE_INSTALL_PREFIX ) -include(WriteBasicConfigVersionFile) - -write_basic_config_version_file("${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" +write_basic_package_version_file("${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" VERSION ${ECM_VERSION_MAJOR}.${ECM_VERSION_MINOR}.${ECM_VERSION_PATCH} COMPATIBILITY AnyNewerVersion ) |