summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-06-11 01:55:37 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-06-12 13:33:27 +0200
commite28a7be8ab798856462f9889a4e54027c0c1a9be (patch)
treebace780c44c1288f98cdc4624a24326d93eef174 /modules
parentaa52709a28f5528efee3e516561ca8d358a69abe (diff)
downloadtde-cmake-e28a7be8ab798856462f9889a4e54027c0c1a9be.tar.gz
tde-cmake-e28a7be8ab798856462f9889a4e54027c0c1a9be.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)
Diffstat (limited to 'modules')
-rw-r--r--modules/TDEMacros.cmake34
-rw-r--r--modules/template_dummy_cpp.cmake5
-rw-r--r--modules/template_export_library.cmake7
-rw-r--r--modules/template_kdeinit_executable.cmake2
-rw-r--r--modules/template_kdeinit_module.cmake3
-rw-r--r--modules/template_libtool_file.cmake35
6 files changed, 30 insertions, 56 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index f6dd338..a4f6320 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} )
@@ -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 )
diff --git a/modules/template_dummy_cpp.cmake b/modules/template_dummy_cpp.cmake
deleted file mode 100644
index 8e1f5ff..0000000
--- a/modules/template_dummy_cpp.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef _AIX
- namespace {
- void *not_empty_file;
- }
-#endif
diff --git a/modules/template_export_library.cmake b/modules/template_export_library.cmake
deleted file mode 100644
index 4d6cb3f..0000000
--- a/modules/template_export_library.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-add_library( @_target@ @_type@ IMPORTED )
-
-set_target_properties( @_target@ PROPERTIES
- IMPORTED_LINK_INTERFACE_LIBRARIES "@_shared_libs@"
- IMPORTED_LOCATION "@_location@"
- IMPORTED_SONAME "@_soname@" )
-
diff --git a/modules/template_kdeinit_executable.cmake b/modules/template_kdeinit_executable.cmake
deleted file mode 100644
index 3d480c4..0000000
--- a/modules/template_kdeinit_executable.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-extern "C" int kdemain(int argc, char* argv[]);
-int main(int argc, char* argv[]) { return kdemain(argc,argv); }
diff --git a/modules/template_kdeinit_module.cmake b/modules/template_kdeinit_module.cmake
deleted file mode 100644
index 68be1e7..0000000
--- a/modules/template_kdeinit_module.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <kdemacros.h>
-extern "C" int kdemain(int argc, char* argv[]);
-extern "C" KDE_EXPORT int kdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); }
diff --git a/modules/template_libtool_file.cmake b/modules/template_libtool_file.cmake
deleted file mode 100644
index fcd73d4..0000000
--- a/modules/template_libtool_file.cmake
+++ /dev/null
@@ -1,35 +0,0 @@
-# @_laname@ - a libtool library file
-# Generated by CMake - GNU libtool
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='@_library_name_2@'
-
-# Names of this library.
-library_names='@_library_name_1@ @_library_name_2@ @_library_name_3@'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=''
-
-# Version information for @_name@.
-current=@_version_current@
-age=@_version_age@
-revision=@_version_revision@
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=@_shouldnotlink@
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='@_libdir@'