diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2022-01-03 17:55:46 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2022-01-04 04:06:38 +0100 |
commit | 2971f209dbecd56266de42030d226b9085c6bf63 (patch) | |
tree | dadecfc99544e994f11c55a70e9957ae67d0e788 /CMakeLists.txt | |
parent | 27ea6ede3cc480e4680fcc56b29df6ea824f7877 (diff) | |
download | polkit-tqt-2971f209dbecd56266de42030d226b9085c6bf63.tar.gz polkit-tqt-2971f209dbecd56266de42030d226b9085c6bf63.zip |
CMake rules adjustments:
+ Use the usual TDESetupPaths macros.
+ Install libraries according to multi-arch rules.
+ Use `install( DIRECTORY ... )` for headers in CXX style.
+ Remove linking unused variables ${..._MOCS}.
+ Remove linking for indirectly used libraries.
+ Use private linking for exported CMake targets.
+ Add the installation of exported CMake targets.
+ Use keyword TEST for tde_add_check_executable.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 55 |
1 files changed, 16 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6525cf505..6e9bd716a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,10 +26,21 @@ cmake_minimum_required( VERSION 3.1 ) include( FindPkgConfig ) include( CheckCXXSourceCompiles ) include( CheckSymbolExists ) +include( GNUInstallDirs OPTIONAL ) include( TDEMacros ) enable_testing( ) +##### setup install paths ####################### + +if( CMAKE_INSTALL_LIBDIR ) + tde_setup_install_path( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" ) +endif( ) + +include( TDESetupPaths ) +tde_setup_paths( ) + + ##### optional stuff option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) @@ -48,21 +59,10 @@ option( BUILD_TESTS "Builds unit tests" ${BUILD_ALL} ) include( ConfigureChecks.cmake ) -##### install paths setup ####################### - -tde_setup_install_path( EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ) -tde_setup_install_path( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" ) -tde_setup_install_path( LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" ) -tde_setup_install_path( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}" ) -tde_setup_install_path( PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig" ) -tde_setup_install_path( SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" ) -tde_setup_install_path( DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" ) - - ##### write pkgconfig file ###################### string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} ) -string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} ) +string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR}/${CMAKE_PROJECT_NAME} ) string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} ) configure_file( polkit-tqt.pc.cmake polkit-tqt.pc @ONLY ) @@ -99,36 +99,13 @@ tde_conditional_add_subdirectory( BUILD_TESTS tests ) ##### install files #### ######################## install( - FILES - includes/PolkitTQt/Authority - includes/PolkitTQt/Details - includes/PolkitTQt/Identity - includes/PolkitTQt/Subject - includes/PolkitTQt/TemporaryAuthorization - includes/PolkitTQt/ActionDescription - DESTINATION - ${INCLUDE_INSTALL_DIR}/PolkitTQt -) - -install( - FILES - includes/PolkitTQt/Gui/Action - includes/PolkitTQt/Gui/ActionButton - includes/PolkitTQt/Gui/ActionButtons - DESTINATION - ${INCLUDE_INSTALL_DIR}/PolkitTQt/Gui -) - -install( - FILES - includes/PolkitTQt/Agent/Listener - includes/PolkitTQt/Agent/Session - DESTINATION - ${INCLUDE_INSTALL_DIR}/PolkitTQt/Agent + DIRECTORY includes/ + DESTINATION ${INCLUDE_INSTALL_DIR}/${CMAKE_PROJECT_NAME} ) install( FILES polkit-tqt-export.h - DESTINATION ${INCLUDE_INSTALL_DIR} + DESTINATION ${INCLUDE_INSTALL_DIR}/${CMAKE_PROJECT_NAME} ) +tde_install_export( ) |