summaryrefslogtreecommitdiffstats
path: root/modules/TDEMacros.cmake
diff options
context:
space:
mode:
authorsamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-10 23:09:37 +0000
committersamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-10 23:09:37 +0000
commitcdf8d5f5ff680798060a83083a8083573a7f9bf0 (patch)
tree14bf97936cca8e35b5459b38a00e4a4141ce7474 /modules/TDEMacros.cmake
parent62d21a9e38ad3d535770e2f049b7f72c7b6b5d0e (diff)
downloadtde-cmake-cdf8d5f5ff680798060a83083a8083573a7f9bf0.tar.gz
tde-cmake-cdf8d5f5ff680798060a83083a8083573a7f9bf0.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/cmake@1213591 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'modules/TDEMacros.cmake')
-rw-r--r--modules/TDEMacros.cmake33
1 files changed, 24 insertions, 9 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index 08df111..6a8a669 100644
--- a/modules/TDEMacros.cmake
+++ b/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 )