diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c8dc83e..f8a366b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,15 +10,23 @@ set (GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME}) option (enable_tests "Build the package's automatic tests." ON) option (enable_lcov "Generate lcov code coverage reports." ON) -find_package(PkgConfig REQUIRED) +## +## GNU standard installation directories +## include (GNUInstallDirs) -include (FindPkgConfig) -include (GdbusCodegen) -include (UseGSettings) +if (EXISTS "/etc/debian_version") # Workaround for libexecdir on debian + set (CMAKE_INSTALL_LIBEXECDIR "${CMAKE_INSTALL_LIBDIR}") + set (CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBDIR}") +endif () +set (CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") +set (CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") -add_definitions( -DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}" ) -add_definitions (-DGNOMELOCALEDIR=\"@CMAKE_INSTALL_PREFIX@/share/locale\") +## +## Check for prerequisites +## +find_package (PkgConfig REQUIRED) +include (FindPkgConfig) pkg_check_modules (SERVICE REQUIRED glib-2.0>=2.36 gio-unix-2.0>=2.36) @@ -26,8 +34,6 @@ include_directories (${SERVICE_INCLUDE_DIRS}) set (CC_WARNING_ARGS " -Wall -pedantic -Wextra -Wno-missing-field-initializers") - - set (ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}) add_custom_target (dist COMMAND bzr export --root=${ARCHIVE_NAME} ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz @@ -43,14 +49,6 @@ add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src) include_directories (${CMAKE_CURRENT_BINARY_DIR}/src) -# Workaround for libexecdir on debian -if (EXISTS "/etc/debian_version") - set (CMAKE_INSTALL_LIBEXECDIR "${CMAKE_INSTALL_LIBDIR}") - set (CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBDIR}") -endif () - -set (CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") -set (CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") add_subdirectory (src) add_subdirectory (data) |