Compare commits

...

17 Commits

Author SHA1 Message Date
Slávek Banko 68452c7f2d
tde_import: Reducing the noise, more common listing of the result.
3 weeks ago
Michele Calgaro d9c415570a
Add support for relative paths in '_tde_internal_setup_path'
1 month ago
Michele Calgaro 9d38396777
Replace KDE_[NO_]EXPORT with TDE_[NO_]EXPORT
2 months ago
Michele Calgaro 9a81dc3923
Update version to R14.1.3~[DEVELOPMENT]
2 months ago
Michele Calgaro 1ec544251e
Update version to R14.1.2
2 months ago
Slávek Banko e6fdb4b58d
Fix incorrect backslash in tde_set_project_version macro
3 months ago
Michele Calgaro 4af11cf947
Set cmake minimum version in a centralized place
3 months ago
Alexander Golubev 10b0187669
Add support for multiline messages in tde_message_* macros
3 months ago
Michele Calgaro 8b6215c660
Simplify code since cmake minimum version is now 3.5
4 months ago
Slávek Banko 76ca9f74ef
Raise the minimum required version of CMake to 3.5.
8 months ago
Slávek Banko bb49d85437
Update version to R14.1.2~[DEVELOPMENT]
8 months ago
Michele Calgaro b4e46115c9
Update version to R14.1.1
8 months ago
Slávek Banko 3fedede7e6
Save and restore CMake policies so that it does not cause CMP0011
1 year ago
Slávek Banko 4e5ddd484f
Set CMake policy CMP0057 to NEW.
1 year ago
Denis Kozadaev 1af8cf3511
tde_setup_architecture_flags: Add test for liner flag -pie or -ztype=pie.
1 year ago
Michele Calgaro 570dbf6e74
Add macro to display a warning message for developers
1 year ago
Michele Calgaro 6ae3ce5bb6
Update version to R14.1.1~[DEVELOPMENT]
1 year ago

@ -14,7 +14,13 @@ if( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}" )
##### general package setup #####################
cmake_minimum_required( VERSION 3.1 )
# building tde-cmake requires reading the minimum required version
# from the source files, because there may be a different version
# of tde-cmake already installed in the system. Trying to build
# tde-cmake with a lower minimum version would not be allowed then.
include( ${CMAKE_SOURCE_DIR}/modules/TDEVersion.cmake )
cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
project( tde-cmake-rules )

@ -15,7 +15,11 @@
#
#################################################
include( CheckCXXCompilerFlag )
#################################################
#####
##### Need cmake minimum version
include( TDEVersion )
@ -24,8 +28,8 @@ include( TDEVersion )
##### initialization...
if( NOT TDE_CMAKE_ROOT )
if( "${CMAKE_VERSION}" VERSION_LESS "3.1" )
message( FATAL_ERROR "CMake >= 3.1.0 required" )
if( "${CMAKE_VERSION}" VERSION_LESS "${TDE_CMAKE_MINIMUM_VERSION}" )
message( FATAL_ERROR "CMake >= ${TDE_CMAKE_MINIMUM_VERSION} required" )
endif()
if( ${CMAKE_CURRENT_LIST_DIR} STREQUAL ${CMAKE_ROOT}/Modules )
@ -66,14 +70,63 @@ if( NOT TDE_CMAKE_ROOT )
endif()
#################################################
#####
##### set necessary CMake policies
cmake_policy( PUSH )
if( POLICY CMP0057 )
# necessary for CheckLinkerFlag
cmake_policy( SET CMP0057 NEW )
endif()
#################################################
#####
##### necessary includes
include( CheckCXXCompilerFlag )
include( CheckCXXSourceCompiles )
include( CheckLinkerFlag OPTIONAL )
include( CheckSymbolExists )
include( CheckTypeSize )
#################################################
#####
##### tde_concat_msg
macro( tde_concat_msg _msg )
unset( ${_msg} )
foreach( _arg ${ARGN} )
string( APPEND ${_msg} " ${_arg}\n" )
endforeach()
endmacro( tde_concat_msg )
#################################################
#####
##### tde_message_author_warning
function( tde_message_author_warning )
tde_concat_msg( _msg ${ARGV} )
message( AUTHOR_WARNING
"-------------------------------------------------\n"
"${_msg}"
"-------------------------------------------------" )
endfunction( tde_message_author_warning )
#################################################
#####
##### tde_message_fatal
macro( tde_message_fatal )
tde_concat_msg( _msg ${ARGV} )
message( FATAL_ERROR
"#################################################\n"
" ${ARGV}\n"
"${_msg}"
"#################################################" )
endmacro( tde_message_fatal )
@ -193,9 +246,15 @@ macro( tde_read_src_metadata )
endmacro( tde_read_src_metadata )
################################################
#####
##### finalization as a slave part
if( DEFINED MASTER_SOURCE_DIR )
cmake_policy( POP )
return( )
endif( )
########### slave part ends here ###############
@ -813,19 +872,23 @@ endfunction( )
macro( tde_import _library )
message( STATUS "checking for '${_library}'" )
string( TOUPPER "BUILD_${_library}" _build )
if( ${_build} )
message( STATUS " ok, activated for build" )
else()
if( EXISTS "${TDE_CMAKE_DIR}/${_library}.cmake" )
include( "${TDE_CMAKE_DIR}/${_library}.cmake" )
elseif( EXISTS "${TQT_CMAKE_DIR}/${_library}.cmake" )
include( "${TQT_CMAKE_DIR}/${_library}.cmake" )
if( NOT DEFINED TDE_IMPORT_${_library} )
message( STATUS "Checking for '${_library}'" )
string( TOUPPER "BUILD_${_library}" _build )
if( ${_build} )
message( STATUS "Checking for '${_library}' - ok, activated for build" )
set( TDE_IMPORT_${_library} "build" CACHE INTERNAL "Library ${_library} activated for build" )
else()
tde_message_fatal( "'${_library}' is required, but is not installed nor selected for build" )
if( EXISTS "${TDE_CMAKE_DIR}/${_library}.cmake" )
include( "${TDE_CMAKE_DIR}/${_library}.cmake" )
elseif( EXISTS "${TQT_CMAKE_DIR}/${_library}.cmake" )
include( "${TQT_CMAKE_DIR}/${_library}.cmake" )
else()
tde_message_fatal( "'${_library}' is required, but is not installed nor selected for build" )
endif()
message( STATUS "Checking for '${_library}' - ok, found import file" )
set( TDE_IMPORT_${_library} "import" CACHE INTERNAL "Library ${_library} imported" )
endif()
message( STATUS " ok, found import file" )
endif()
endmacro()
@ -1093,11 +1156,7 @@ macro( tde_add_library _arg_target )
# set -fPIC flag for static libraries
if( _static_pic )
if( "${CMAKE_VERSION}" VERSION_LESS "2.8.9" )
set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS -fPIC )
else( )
set_target_properties( ${_target} PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif( )
set_target_properties( ${_target} PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif( _static_pic )
# set version
@ -1138,23 +1197,16 @@ macro( tde_add_library _arg_target )
# set private linked libraries
if( _link_private )
if( NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12" )
if( _link )
list( INSERT _link 0 "PUBLIC" )
endif()
list( INSERT _link_private 0 "PRIVATE" )
if( _link )
list( INSERT _link 0 "PUBLIC" )
endif()
list( INSERT _link_private 0 "PRIVATE" )
list( INSERT _link 0 ${_link_private} )
endif( _link_private )
# set link libraries
if( _link )
if( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" )
# hack for broken CMake 2.8.12.0
set_target_properties( ${_target} PROPERTIES LINK_LIBRARIES "${_link}" )
else( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" )
target_link_libraries( ${_target} ${_link} )
endif( _embed AND ${CMAKE_VERSION} VERSION_EQUAL "2.8.12.0" )
target_link_libraries( ${_target} ${_link} )
endif( )
if( _shared_libs )
string( TOUPPER "${CMAKE_BUILD_TYPE}" _build_type )
@ -2831,7 +2883,29 @@ macro( tde_setup_architecture_flags )
check_cxx_compiler_flag( -fPIE HAVE_PIE_SUPPORT )
if( HAVE_PIE_SUPPORT )
set( TDE_PIE_CFLAGS -fPIE )
set( TDE_PIE_LDFLAGS -pie )
if( ${CMAKE_VERSION} VERSION_LESS "3.18" )
execute_process(COMMAND "${CMAKE_LINKER}" --help
OUTPUT_VARIABLE __linker_help
ERROR_VARIABLE __linker_help)
if( "${__linker_help}" MATCHES "-pie" )
set( LINKER_PIE_SUPPORT 1 )
elseif( "${__linker_help}" MATCHES "type=type.*pie" )
set( LINKER_ZTYPE_PIE_SUPPORT 1 )
endif( )
unset(__linker_help)
else( )
check_linker_flag(CXX -pie LINKER_PIE_SUPPORT)
if( NOT LINKER_PIE_SUPPORT )
check_linker_flag(CXX -ztype=pie LINKER_ZTYPE_PIE_SUPPORT)
endif()
endif()
if( LINKER_PIE_SUPPORT )
set( TDE_PIE_LDFLAGS -pie )
endif( LINKER_PIE_SUPPORT )
if( LINKER_ZTYPE_PIE_SUPPORT )
set( TDE_PIE_LDFLAGS -ztype=pie )
endif( LINKER_ZTYPE_PIE_SUPPORT )
endif( HAVE_PIE_SUPPORT )
set( _reproducible_cxxflags
@ -3164,3 +3238,13 @@ macro( tde_setup_polkit )
endif( )
endmacro( )
#################################################
#####
##### restore CMake policies
cmake_policy( POP )
#################################################

@ -15,10 +15,14 @@
macro( _tde_internal_setup_path _path _default _comment )
if( DEFINED ${_path} )
set( ${_path} "${${_path}}" CACHE PATH "${_comment}" )
else( DEFINED ${_path} )
if( IS_ABSOLUTE ${${_path}} )
set( ${_path} "${${_path}}" CACHE PATH "${_comment}" FORCE )
else( )
set( ${_path} "${CMAKE_INSTALL_PREFIX}/${${_path}}" CACHE PATH "${_comment}" FORCE )
endif( )
else( )
set( ${_path} "${_default}" )
endif( DEFINED ${_path} )
endif( )
endmacro( _tde_internal_setup_path )

@ -9,19 +9,24 @@
#
#################################################
# Centralized place where to set the minimum cmake version required in TDE
set( TDE_CMAKE_MINIMUM_VERSION 3.5 )
#################################################
#####
##### tde_set_project_version
macro( tde_set_project_version )
set( DEFAULT_VERSION "R14.1.0" )
set( DEFAULT_VERSION "R14.1.3~[DEVELOPMENT]" )
unset( VERSION )
if( EXISTS ${CMAKE_SOURCE_DIR}/.tdescminfo )
file( STRINGS ${CMAKE_SOURCE_DIR}/.tdescminfo VERSION_STRING REGEX "^Version:.+$" )
string( REGEX REPLACE "^Version: (R[0-9]+\.[0-9]+\.[0-9]+.*)$" "\\1" VERSION "${VERSION_STRING}" )
string( REGEX REPLACE "^Version: (R[0-9]+\\.[0-9]+\\.[0-9]+.*)$" "\\1" VERSION "${VERSION_STRING}" )
endif()
if( NOT VERSION )

@ -1,3 +1,3 @@
#include <kdemacros.h>
extern "C" int kdemain(int argc, char* argv[]);
extern "C" KDE_EXPORT int tdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); }
extern "C" TDE_EXPORT int tdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); }

Loading…
Cancel
Save