diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-07-01 21:00:17 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-07-01 21:00:17 -0500 |
commit | e875abf22fc02939185b6aa881865cff58fc1543 (patch) | |
tree | 69bd5d76cc20bb0556f751a32a4472de22a81bd1 /CMakeLists.txt | |
parent | cba24317a60a2670c0c917aaa637488b834da379 (diff) | |
download | ayatana-indicator-session-e875abf22fc02939185b6aa881865cff58fc1543.tar.gz ayatana-indicator-session-e875abf22fc02939185b6aa881865cff58fc1543.tar.bz2 ayatana-indicator-session-e875abf22fc02939185b6aa881865cff58fc1543.zip |
in cmake files, limit scopes by moving single-target properties out of the global variables to single-target ones and moving single-use includes into the directories where they're used
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) |