project (listaller-gtk) cmake_minimum_required(VERSION 2.8) # # Base bits # set (PROJECT_NAME "listaller-gtk") set (LIGTK_MAJOR 0) set (LIGTK_MINOR 1) set (LIGTK_MICRO 2) set (LIGTK_VERSION "${LIGTK_MAJOR}.${LIGTK_MINOR}.${LIGTK_MICRO}") list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/data/cmake) # Don't allow in-tree building if(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR}) message(STATUS "Please do an out-of-tree build:") message(STATUS "rm -f CMakeCache.txt && mkdir build && cd build; cmake .. && make") message(FATAL_ERROR "In-tree-build detected!") endif(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR}) # # config.h # set (PREFIXDIR "${CMAKE_INSTALL_PREFIX}") set (DATADIR "${CMAKE_INSTALL_PREFIX}/share/listaller-gtk") set (GETTEXT_PACKAGE "listaller-gtk") set (LOCALEDIR "${DATADIR}/locale") set (PROJECT_VERSION "${LIGTK_VERSION}") set (BUILDDIR "${CMAKE_BINARY_DIR}") configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) add_definitions ("--include config.h") # # Options # option (ENABLE_NLS "Enable localisation" ON) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Listaller-GNOME default install prefix" FORCE) endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) add_definitions(-DCMAKE_INSTALL_PREFIX="\\\"${CMAKE_INSTALL_PREFIX}\\\"") set(XDG_APPS_INSTALL_DIR share/applications) # # i18n # find_package (Gettext REQUIRED) if (${GETTEXT_FOUND} STREQUAL "TRUE" AND (ENABLE_NLS)) set (BUILD_TRANSLATION true) endif (${GETTEXT_FOUND} STREQUAL "TRUE" AND (ENABLE_NLS)) # # src # find_package(PkgConfig REQUIRED) find_package(Vala REQUIRED) include(${VALA_USE_FILE}) ensure_vala_version("0.12" MINIMUM) add_subdirectory (src) add_subdirectory (data) if (BUILD_TRANSLATION) add_subdirectory (po) endif (BUILD_TRANSLATION)