diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-06-11 01:55:37 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-06-12 13:28:56 +0200 |
commit | be1fee9567b0feae736966468c8f1b480d01890c (patch) | |
tree | 37f2067ad083efcc9dfbb1306264fa7acb30383d | |
parent | 5715cbbaba6c7ee53ef9e3d049a434d8af1593c0 (diff) | |
download | tde-cmake-be1fee9567b0feae736966468c8f1b480d01890c.tar.gz tde-cmake-be1fee9567b0feae736966468c8f1b480d01890c.zip |
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 2a847be412bd1dc66e53ea4652cc42f24a412d0f)
-rw-r--r-- | modules/TDEMacros.cmake | 34 | ||||
-rw-r--r-- | templates/tde_dummy_cpp.cmake (renamed from modules/template_dummy_cpp.cmake) | 0 | ||||
-rw-r--r-- | templates/tde_export_library.cmake (renamed from modules/template_export_library.cmake) | 0 | ||||
-rw-r--r-- | templates/tde_libtool_file.cmake (renamed from modules/template_libtool_file.cmake) | 0 | ||||
-rw-r--r-- | templates/tde_tdeinit_executable.cmake (renamed from modules/template_tdeinit_executable.cmake) | 0 | ||||
-rw-r--r-- | templates/tde_tdeinit_module.cmake (renamed from modules/template_tdeinit_module.cmake) | 0 |
6 files changed, 30 insertions, 4 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 7886e39..6e940b0 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -20,6 +20,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 macro( 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} ) @@ -1059,7 +1085,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 @@ -1509,8 +1535,8 @@ endmacro( tde_add_check_executable ) macro( tde_add_tdeinit_executable _target ) - configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_tdeinit_executable.cmake ${_target}_tdeinit_executable.cpp COPYONLY ) - configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_tdeinit_module.cmake ${_target}_tdeinit_module.cpp COPYONLY ) + configure_file( ${TDE_CMAKE_TEMPLATES}/tde_tdeinit_executable.cmake ${_target}_tdeinit_executable.cpp COPYONLY ) + configure_file( ${TDE_CMAKE_TEMPLATES}/tde_tdeinit_module.cmake ${_target}_tdeinit_module.cpp COPYONLY ) unset( _sources ) unset( _runtime_destination ) diff --git a/modules/template_dummy_cpp.cmake b/templates/tde_dummy_cpp.cmake index 8e1f5ff..8e1f5ff 100644 --- a/modules/template_dummy_cpp.cmake +++ b/templates/tde_dummy_cpp.cmake diff --git a/modules/template_export_library.cmake b/templates/tde_export_library.cmake index 4d6cb3f..4d6cb3f 100644 --- a/modules/template_export_library.cmake +++ b/templates/tde_export_library.cmake diff --git a/modules/template_libtool_file.cmake b/templates/tde_libtool_file.cmake index fcd73d4..fcd73d4 100644 --- a/modules/template_libtool_file.cmake +++ b/templates/tde_libtool_file.cmake diff --git a/modules/template_tdeinit_executable.cmake b/templates/tde_tdeinit_executable.cmake index 3d480c4..3d480c4 100644 --- a/modules/template_tdeinit_executable.cmake +++ b/templates/tde_tdeinit_executable.cmake diff --git a/modules/template_tdeinit_module.cmake b/templates/tde_tdeinit_module.cmake index efd89d8..efd89d8 100644 --- a/modules/template_tdeinit_module.cmake +++ b/templates/tde_tdeinit_module.cmake |