summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/TDEMacros.cmake40
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index 424b6c2..51be52a 100644
--- a/modules/TDEMacros.cmake
+++ b/modules/TDEMacros.cmake
@@ -23,6 +23,10 @@ include( CheckCXXCompilerFlag )
##### initialization...
if( NOT TDE_CMAKE_ROOT )
+ if( "${CMAKE_VERSION}" VERSION_LESS "3.1" )
+ message( FATAL_ERROR "CMake >= 3.1.0 required" )
+ endif()
+
if( ${CMAKE_CURRENT_LIST_DIR} STREQUAL ${CMAKE_ROOT}/Modules )
# TDE CMake is installed in the system directory
@@ -792,6 +796,8 @@ macro( tde_add_library _arg_target )
unset( _version )
unset( _release )
unset( _sources )
+ unset( _cxx_features )
+ unset( _cxx_features_private )
unset( _destination )
unset( _embed )
unset( _link )
@@ -878,6 +884,18 @@ macro( tde_add_library _arg_target )
set( _storage "_sources" )
endif( "+${_arg}" STREQUAL "+SOURCES" )
+ # found directive "CXX_FEATURES"
+ if( "+${_arg}" STREQUAL "+CXX_FEATURES" )
+ set( _skip_store 1 )
+ set( _storage "_cxx_features" )
+ endif( "+${_arg}" STREQUAL "+CXX_FEATURES" )
+
+ # found directive "CXX_FEATURES_PRIVATE"
+ if( "+${_arg}" STREQUAL "+CXX_FEATURES_PRIVATE" )
+ set( _skip_store 1 )
+ set( _storage "_cxx_features_private" )
+ endif( "+${_arg}" STREQUAL "+CXX_FEATURES_PRIVATE" )
+
# found directive "EMBED"
if( "+${_arg}" STREQUAL "+EMBED" )
set( _skip_store 1 )
@@ -997,6 +1015,15 @@ macro( tde_add_library _arg_target )
# add target
add_library( ${_target} ${_type} ${_exclude_from_all} ${_sources} )
+ # set cxx features
+ if( _cxx_features )
+ target_compile_features( ${_target} PUBLIC ${_cxx_features} )
+ endif( )
+ if( TDE_CXX_FEATURES OR PROJECT_CXX_FEATURES OR _cxx_features_private )
+ target_compile_features( ${_target} PRIVATE
+ ${TDE_CXX_FEATURES} ${PROJECT_CXX_FEATURES} ${_cxx_features_private} )
+ endif( )
+
# we assume that modules have no prefix and no version
# also, should not link
if( ${_type} STREQUAL "MODULE" )
@@ -1235,6 +1262,7 @@ macro( tde_add_executable _arg_target )
unset( _meta_includes )
unset( _setuid )
unset( _sources )
+ unset( _cxx_features )
unset( _destination )
unset( _link )
unset( _dependencies )
@@ -1289,6 +1317,12 @@ macro( tde_add_executable _arg_target )
set( _storage "_sources" )
endif( "+${_arg}" STREQUAL "+SOURCES" )
+ # found directive "CXX_FEATURES"
+ if( "+${_arg}" STREQUAL "+CXX_FEATURES" )
+ set( _skip_store 1 )
+ set( _storage "_cxx_features" )
+ endif( "+${_arg}" STREQUAL "+CXX_FEATURES" )
+
# found directive "LINK"
if( "+${_arg}" STREQUAL "+LINK" )
set( _skip_store 1 )
@@ -1372,6 +1406,12 @@ macro( tde_add_executable _arg_target )
# add target
add_executable( ${_target} ${_sources} )
+ # set cxx features
+ if( TDE_CXX_FEATURES OR PROJECT_CXX_FEATURES OR _cxx_features )
+ target_compile_features( ${_target} PRIVATE
+ ${TDE_CXX_FEATURES} ${PROJECT_CXX_FEATURES} ${_cxx_features} )
+ endif( )
+
# set link libraries
if( _link )
target_link_libraries( ${_target} ${_link} )