Browse Source

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>
pull/52/head
Slávek Banko 3 months ago
parent
commit
2a847be412
No known key found for this signature in database GPG Key ID: 608F5293A04BE668
6 changed files with 30 additions and 4 deletions
  1. +30
    -4
      modules/TDEMacros.cmake
  2. +0
    -0
      templates/tde_dummy_cpp.cmake
  3. +0
    -0
      templates/tde_export_library.cmake
  4. +0
    -0
      templates/tde_libtool_file.cmake
  5. +0
    -0
      templates/tde_tdeinit_executable.cmake
  6. +0
    -0
      templates/tde_tdeinit_module.cmake

+ 30
- 4
modules/TDEMacros.cmake View File

@@ -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} )

@@ -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 )


modules/template_dummy_cpp.cmake → templates/tde_dummy_cpp.cmake View File


modules/template_export_library.cmake → templates/tde_export_library.cmake View File


modules/template_libtool_file.cmake → templates/tde_libtool_file.cmake View File


modules/template_tdeinit_executable.cmake → templates/tde_tdeinit_executable.cmake View File


modules/template_tdeinit_module.cmake → templates/tde_tdeinit_module.cmake View File


Loading…
Cancel
Save