Move templates to a separate directory and rename to the tde_ prefix.

Create the TDE_CMAKE_ROOT and TDE_CMAKE_TEMPLATES variables.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 2a847be412)
v3.5.13-sru
Slávek Banko 4 years ago
parent aa52709a28
commit e28a7be8ab
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -18,6 +18,32 @@
include( CheckCXXCompilerFlag )
#################################################
#####
##### initialization...
if( NOT TDE_CMAKE_ROOT )
if( ${CMAKE_CURRENT_LIST_DIR} STREQUAL ${CMAKE_ROOT}/Modules )
# TDE CMake is installed in the system directory
set( TDE_CMAKE_ROOT ${CMAKE_ROOT}
CACHE FILEPATH "TDE CMake root" )
set( TDE_CMAKE_TEMPLATES ${TDE_CMAKE_ROOT}/Templates
CACHE FILEPATH "TDE CMake templates" )
else()
# TDE CMake is part of the source code
get_filename_component( TDE_CMAKE_ROOT ${CMAKE_CURRENT_LIST_DIR} PATH )
set( TDE_CMAKE_ROOT ${TDE_CMAKE_ROOT}
CACHE FILEPATH "TDE CMake root" )
set( TDE_CMAKE_TEMPLATES ${TDE_CMAKE_ROOT}/templates
CACHE FILEPATH "TDE CMake templates" )
endif()
endif()
#################################################
#####
##### tde_message_fatal
@ -701,7 +727,7 @@ macro( tde_install_libtool_file _target _destination )
set( _libdir "${CMAKE_INSTALL_PREFIX}/${_destination}" )
endif( IS_ABSOLUTE ${_destination} )
configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_libtool_file.cmake "${_laname}" @ONLY )
configure_file( ${TDE_CMAKE_TEMPLATES}/tde_libtool_file.cmake "${_laname}" @ONLY )
install( FILES "${CMAKE_CURRENT_BINARY_DIR}/${_laname}" DESTINATION ${_destination} )
@ -1006,7 +1032,7 @@ macro( tde_add_library _arg_target )
unset( _version )
endif( )
configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_export_library.cmake "${PROJECT_BINARY_DIR}/export-${_target}.cmake" @ONLY )
configure_file( ${TDE_CMAKE_TEMPLATES}/tde_export_library.cmake "${PROJECT_BINARY_DIR}/export-${_target}.cmake" @ONLY )
endif( )
# install target
@ -1322,8 +1348,8 @@ endmacro( tde_add_check_executable )
macro( tde_add_kdeinit_executable _target )
configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_kdeinit_executable.cmake ${_target}_kdeinit_executable.cpp COPYONLY )
configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_kdeinit_module.cmake ${_target}_kdeinit_module.cpp COPYONLY )
configure_file( ${TDE_CMAKE_TEMPLATES}/tde_kdeinit_executable.cmake ${_target}_kdeinit_executable.cpp COPYONLY )
configure_file( ${TDE_CMAKE_TEMPLATES}/tde_kdeinit_module.cmake ${_target}_kdeinit_module.cpp COPYONLY )
unset( _sources )
unset( _runtime_destination )

Loading…
Cancel
Save