diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-04-02 21:35:04 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-04-04 17:22:03 +0200 |
commit | 5da57962ef8ad8506acf2fe0176a5156f1a0ccb3 (patch) | |
tree | da2fb57cd46402ba24535d8d24c105d2b90ec30b | |
parent | c037f083c42a8304bf997ae21fc5b682db0716a0 (diff) | |
download | tdelibs-5da57962ef8ad8506acf2fe0176a5156f1a0ccb3.tar.gz tdelibs-5da57962ef8ad8506acf2fe0176a5156f1a0ccb3.zip |
Enable storing ELF metadata in a standard way using a common cmake module
for all libraries and binaries.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit c64685ad8d7b76b78a5342fc03e7b7cf245eec84)
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | tdelfeditor/CMakeLists.txt | 102 |
2 files changed, 10 insertions, 104 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b95cfa61..a68c3061d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1187,16 +1187,22 @@ configure_file( tdelibs.pc.cmake tdelibs.pc @ONLY ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/tdelibs.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} ) +##### read source metadata ###################### + +set( TDE_VERSION "${TDE_RELEASE_NUM}" ) +tde_read_src_metadata() + + ##### subdirectories ############################ +if( WITH_ELFICON ) + add_subdirectory( tdelfeditor ) +endif( WITH_ELFICON ) add_subdirectory( dcop ) add_subdirectory( libltdl ) add_subdirectory( kglib ) add_subdirectory( tdefx ) add_subdirectory( tdecore ) -if( WITH_ELFICON ) - add_subdirectory( tdelfeditor ) -endif( WITH_ELFICON ) add_subdirectory( tdeunittest ) add_subdirectory( tdeui ) add_subdirectory( tdesu ) diff --git a/tdelfeditor/CMakeLists.txt b/tdelfeditor/CMakeLists.txt index 07cd731d2..7d71943ff 100644 --- a/tdelfeditor/CMakeLists.txt +++ b/tdelfeditor/CMakeLists.txt @@ -32,104 +32,4 @@ tde_add_executable( tdelfeditor LINK ${TQT_LIBRARIES} ${LIBR_LIBRARIES} tdecore-shared ) - -##### embed scm data into important libraries #### - -# read source metadata -tde_read_src_metadata() -tde_curdatetime( scm_embed_metadata_datetime ) - -if( NOT "${TDE_SCM_MODULE_NAME}" STREQUAL "" ) - if( NOT "${TDE_SCM_MODULE_REVISION}" STREQUAL "" ) - get_target_property( scm_embed_metadata_version DCOP-shared VERSION ) - set( ELF_EMBEDDING_METADATA "\"DCOP-shared\" \"\" \"\" \"\" \"\" \"Trinity Desktop Environment\" \"\" \"${scm_embed_metadata_version}\" \"${scm_embed_metadata_datetime}\" \"x-sharedlib\" \"${TDE_SCM_MODULE_NAME}\" \"${TDE_SCM_MODULE_REVISION}\" \"\"" ) - separate_arguments( ELF_EMBEDDING_METADATA ) - add_custom_target( - # embed name and metadata - update_libDCOP_metadata ALL - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -m ${CMAKE_BINARY_DIR}/dcop/libDCOP.so.${scm_embed_metadata_version} ${ELF_EMBEDDING_METADATA} || true - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -e ${CMAKE_BINARY_DIR}/dcop/libDCOP.so.${scm_embed_metadata_version} || true - DEPENDS tdelfeditor - DEPENDS DCOP-shared - COMMENT "Storing SCM metadata in dcop/libDCOP.so" - ) - - get_target_property( scm_embed_metadata_version tdecore-shared VERSION ) - set( ELF_EMBEDDING_METADATA "\"tdecore-shared\" \"\" \"\" \"\" \"\" \"Trinity Desktop Environment\" \"\" \"${scm_embed_metadata_version}\" \"${scm_embed_metadata_datetime}\" \"x-sharedlib\" \"${TDE_SCM_MODULE_NAME}\" \"${TDE_SCM_MODULE_REVISION}\" \"\"" ) - separate_arguments( ELF_EMBEDDING_METADATA ) - add_custom_target( - # embed name and metadata - update_libtdecore_metadata ALL - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -m ${CMAKE_BINARY_DIR}/tdecore/libtdecore.so.${scm_embed_metadata_version} ${ELF_EMBEDDING_METADATA} || true - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -e ${CMAKE_BINARY_DIR}/tdecore/libtdecore.so.${scm_embed_metadata_version} || true - DEPENDS tdelfeditor - DEPENDS tdecore-shared - COMMENT "Storing SCM metadata in tdecore/libtdecore.so" - ) - - #get_target_property( scm_embed_metadata_version tdeio-shared VERSION ) - set( ELF_EMBEDDING_METADATA "\"tdeio-shared\" \"\" \"\" \"\" \"\" \"Trinity Desktop Environment\" \"\" \"${scm_embed_metadata_version}\" \"${scm_embed_metadata_datetime}\" \"x-sharedlib\" \"${TDE_SCM_MODULE_NAME}\" \"${TDE_SCM_MODULE_REVISION}\" \"\"" ) - separate_arguments( ELF_EMBEDDING_METADATA ) - add_custom_target( - # embed name and metadata - update_libtdeio_metadata ALL - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -m ${CMAKE_BINARY_DIR}/tdeio/libtdeio.so.${scm_embed_metadata_version} ${ELF_EMBEDDING_METADATA} || true - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -e ${CMAKE_BINARY_DIR}/tdeio/libtdeio.so.${scm_embed_metadata_version} || true - DEPENDS tdelfeditor - DEPENDS tdeio-shared - COMMENT "Storing SCM metadata in tdeui/libtdeio.so" - ) - - #get_target_property( scm_embed_metadata_version tdeui-shared VERSION ) - set( ELF_EMBEDDING_METADATA "\"tdeui-shared\" \"\" \"\" \"\" \"\" \"Trinity Desktop Environment\" \"\" \"${scm_embed_metadata_version}\" \"${scm_embed_metadata_datetime}\" \"x-sharedlib\" \"${TDE_SCM_MODULE_NAME}\" \"${TDE_SCM_MODULE_REVISION}\" \"\"" ) - separate_arguments( ELF_EMBEDDING_METADATA ) - add_custom_target( - # embed name and metadata - update_libtdeui_metadata ALL - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -m ${CMAKE_BINARY_DIR}/tdeui/libtdeui.so.${scm_embed_metadata_version} ${ELF_EMBEDDING_METADATA} || true - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -e ${CMAKE_BINARY_DIR}/tdeui/libtdeui.so.${scm_embed_metadata_version} || true - DEPENDS tdelfeditor - DEPENDS tdeui-shared - COMMENT "Storing SCM metadata in tdeui/libtdeui.so" - ) - - #get_target_property( scm_embed_metadata_version tdeutils-shared VERSION ) - set( ELF_EMBEDDING_METADATA "\"tdeutils-shared\" \"\" \"\" \"\" \"\" \"Trinity Desktop Environment\" \"\" \"${scm_embed_metadata_version}\" \"${scm_embed_metadata_datetime}\" \"x-sharedlib\" \"${TDE_SCM_MODULE_NAME}\" \"${TDE_SCM_MODULE_REVISION}\" \"\"" ) - separate_arguments( ELF_EMBEDDING_METADATA ) - add_custom_target( - # embed name and metadata - update_libtdeutils_metadata ALL - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -m ${CMAKE_BINARY_DIR}/tdeutils/libtdeutils.so.${scm_embed_metadata_version} ${ELF_EMBEDDING_METADATA} || true - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -e ${CMAKE_BINARY_DIR}/tdeutils/libtdeutils.so.${scm_embed_metadata_version} || true - DEPENDS tdelfeditor - DEPENDS tdeutils-shared - COMMENT "Storing SCM metadata in tdeutils/libtdeutils.so" - ) - - #get_target_property( scm_embed_metadata_version tdeprint-shared VERSION ) - set( ELF_EMBEDDING_METADATA "\"tdeprint-shared\" \"\" \"\" \"\" \"\" \"Trinity Desktop Environment\" \"\" \"${scm_embed_metadata_version}\" \"${scm_embed_metadata_datetime}\" \"x-sharedlib\" \"${TDE_SCM_MODULE_NAME}\" \"${TDE_SCM_MODULE_REVISION}\" \"\"" ) - separate_arguments( ELF_EMBEDDING_METADATA ) - add_custom_target( - # embed name and metadata - update_libtdeprint_metadata ALL - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -m ${CMAKE_BINARY_DIR}/tdeprint/libtdeprint.so.${scm_embed_metadata_version} ${ELF_EMBEDDING_METADATA} || true - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -e ${CMAKE_BINARY_DIR}/tdeprint/libtdeprint.so.${scm_embed_metadata_version} || true - DEPENDS tdelfeditor - DEPENDS tdeprint-shared - COMMENT "Storing SCM metadata in tdeprint/libtdeprint.so" - ) - - #get_target_property( scm_embed_metadata_version tdehtml-shared VERSION ) - set( ELF_EMBEDDING_METADATA "\"tdehtml-shared\" \"\" \"\" \"\" \"\" \"Trinity Desktop Environment\" \"\" \"${scm_embed_metadata_version}\" \"${scm_embed_metadata_datetime}\" \"x-sharedlib\" \"${TDE_SCM_MODULE_NAME}\" \"${TDE_SCM_MODULE_REVISION}\" \"\"" ) - separate_arguments( ELF_EMBEDDING_METADATA ) - add_custom_target( - # embed name and metadata - update_libtdehtml_metadata ALL - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -m ${CMAKE_BINARY_DIR}/tdehtml/libtdehtml.so.${scm_embed_metadata_version} ${ELF_EMBEDDING_METADATA} || true - COMMAND ${CMAKE_BINARY_DIR}/tdelfeditor/tdelfeditor -e ${CMAKE_BINARY_DIR}/tdehtml/libtdehtml.so.${scm_embed_metadata_version} || true - DEPENDS tdelfeditor - DEPENDS tdehtml-shared - COMMENT "Storing SCM metadata in tdehtml/libtdehtml.so" - ) - endif( ) -endif( ) +set( TDELFEDITOR_EXECUTABLE tdelfeditor CACHE INTERNAL "tdelfeditor target" ) |