diff options
author | Francois Andriot <francois.andriot@free.fr> | 2014-09-14 19:09:17 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2014-09-14 19:09:17 +0200 |
commit | 38a8a335c362b35f41603024bbf63b0d074b9a41 (patch) | |
tree | 58b6d6de0dcdf1f74be93ef4ba5b01ab02e5a9b6 /modules/TDEMacros.cmake | |
parent | f4055629928cc70c5d29f9e8c4386441b7717a16 (diff) | |
download | tde-cmake-38a8a335c362b35f41603024bbf63b0d074b9a41.tar.gz tde-cmake-38a8a335c362b35f41603024bbf63b0d074b9a41.zip |
Fix openbsd library naming convention
Fix setup architecture flags on openbsd
Diffstat (limited to 'modules/TDEMacros.cmake')
-rw-r--r-- | modules/TDEMacros.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 61aceb3..2afde45 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -732,7 +732,15 @@ macro( tde_add_library _arg_target ) # set version if( _version ) - string( REGEX MATCH "^[0-9]+" _soversion ${_version} ) + if( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) + # OpenBSD: _soversion and _version both contains only major and minor + string( REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" _dummy "${_version}" ) + set( _version "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" ) + set( _soversion "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" ) + else( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) + # General (Linux) case: _soversion contains only the major number of version + string( REGEX MATCH "^[0-9]+" _soversion ${_version} ) + endif( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) set_target_properties( ${_target} PROPERTIES VERSION ${_version} SOVERSION ${_soversion} ) endif( _version ) @@ -1513,7 +1521,7 @@ endif( ) macro( tde_setup_architecture_flags ) message( STATUS "Detected ${CMAKE_SYSTEM_PROCESSOR} CPU architecture" ) ## Immediate symbol binding is available only for gcc but not on ARM architectures - if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES arm* ) + if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES arm* AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) set( LINKER_IMMEDIATE_BINDING_FLAGS "-z\ now" CACHE INTERNAL "" FORCE ) else( ) set( LINKER_IMMEDIATE_BINDING_FLAGS "" CACHE INTERNAL "" FORCE ) |