diff options
author | samelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-10 23:09:37 +0000 |
---|---|---|
committer | samelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-10 23:09:37 +0000 |
commit | 288a9224e58837c9a976c714a693ab61d9e14c00 (patch) | |
tree | c1099005654ab7cfd6b52abfd522cf4d7b5b3cfd /cmake/modules/TDEMacros.cmake | |
parent | a4caa4c79653d13faa5f362a4179a9f0e77a19e0 (diff) | |
download | other-288a9224e58837c9a976c714a693ab61d9e14c00.tar.gz other-288a9224e58837c9a976c714a693ab61d9e14c00.zip |
[kde-common/cmake] tde_add_library: do not add soversion for exported libraries without version
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kde-common@1213591 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'cmake/modules/TDEMacros.cmake')
-rw-r--r-- | cmake/modules/TDEMacros.cmake | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/cmake/modules/TDEMacros.cmake b/cmake/modules/TDEMacros.cmake index 08df111..6a8a669 100644 --- a/cmake/modules/TDEMacros.cmake +++ b/cmake/modules/TDEMacros.cmake @@ -585,24 +585,39 @@ macro( tde_add_library _arg_target ) add_dependencies( ${_target} ${_dependencies} ) endif( _dependencies ) - # set destination directory + # if destination directory is set if( _destination ) + + # we export only shared libs (no static, no modules); + # also, do not export targets marked as "NO_EXPORT" (usually for kdeinit) if( "SHARED" STREQUAL ${_type} AND NOT _no_export ) - # we export only shared libs (no static, no modules) - # also, do not export target marked as "NO_EXPORT" (usually for kdeinit) - install( TARGETS ${_target} DESTINATION ${_destination} ) + + # get target properties: output name, version, soversion get_target_property( _output ${_target} LOCATION ) get_filename_component( _output ${_output} NAME ) - set( _location "${_destination}/${_output}.${_version}" ) - set( _soname "${_output}.${_soversion}" ) + get_target_property( _version ${_target} VERSION ) + get_target_property( _soversion ${_target} SOVERSION ) + + if( _version ) + set( _location "${_destination}/${_output}.${_version}" ) + set( _soname "${_output}.${_soversion}" ) + else( ) + set( _location "${_destination}/${_output}" ) + set( _soname "${_output}" ) + endif( ) + configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_export_library.cmake "${PROJECT_BINARY_DIR}/export-${_target}.cmake" @ONLY ) - else( ) - install( TARGETS ${_target} DESTINATION ${_destination} ) endif( ) + + # install target + install( TARGETS ${_target} DESTINATION ${_destination} ) + + # install .la files for dynamic libraries if( NOT "STATIC" STREQUAL ${_type} AND NOT _no_libtool_file ) tde_install_libtool_file( ${_target} ${_destination} ) endif( ) - endif( ) + + endif( _destination ) endmacro( tde_add_library ) |