summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-02-14 16:25:39 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-02-14 23:31:26 +0900
commit8b6215c660c8b4def9c0e6849e78704ad215b7d7 (patch)
treee214ff6b47c5f79f33d008e4e33fa6c5871568b5
parent76ca9f74ef3db99e84e1e1fc0cba4dbd3a9dcc7d (diff)
downloadtde-cmake-8b6215c660c8b4def9c0e6849e78704ad215b7d7.tar.gz
tde-cmake-8b6215c660c8b4def9c0e6849e78704ad215b7d7.zip
Simplify code since cmake minimum version is now 3.5
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 14c59dd1b99f5fa68aa3344bc91fb3d7e6d37235)
-rw-r--r--modules/TDEMacros.cmake25
1 files changed, 7 insertions, 18 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index 56c9f7f..0392f9e 100644
--- a/modules/TDEMacros.cmake
+++ b/modules/TDEMacros.cmake
@@ -21,8 +21,8 @@
##### initialization...
if( NOT TDE_CMAKE_ROOT )
- if( "${CMAKE_VERSION}" VERSION_LESS "3.1" )
- message( FATAL_ERROR "CMake >= 3.1.0 required" )
+ if( "${CMAKE_VERSION}" VERSION_LESS "3.5" )
+ message( FATAL_ERROR "CMake >= 3.5.0 required" )
endif()
if( ${CMAKE_CURRENT_LIST_DIR} STREQUAL ${CMAKE_ROOT}/Modules )
@@ -1131,11 +1131,7 @@ macro( tde_add_library _arg_target )
# set -fPIC flag for static libraries
if( _static_pic )
- if( "${CMAKE_VERSION}" VERSION_LESS "2.8.9" )
- set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS -fPIC )
- else( )
- set_target_properties( ${_target} PROPERTIES POSITION_INDEPENDENT_CODE ON )
- endif( )
+ set_target_properties( ${_target} PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif( _static_pic )
# set version
@@ -1176,23 +1172,16 @@ macro( tde_add_library _arg_target )
# set private linked libraries
if( _link_private )
- if( NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12" )
- if( _link )
- list( INSERT _link 0 "PUBLIC" )
- endif()
- list( INSERT _link_private 0 "PRIVATE" )
+ if( _link )
+ list( INSERT _link 0 "PUBLIC" )
endif()
+ list( INSERT _link_private 0 "PRIVATE" )
list( INSERT _link 0 ${_link_private} )
endif( _link_private )
# set link libraries
if( _link )
- if( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" )
- # hack for broken CMake 2.8.12.0
- set_target_properties( ${_target} PROPERTIES LINK_LIBRARIES "${_link}" )
- else( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" )
- target_link_libraries( ${_target} ${_link} )
- endif( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" )
+ target_link_libraries( ${_target} ${_link} )
endif( )
if( _shared_libs )
string( TOUPPER "${CMAKE_BUILD_TYPE}" _build_type )