diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:55:58 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:55:58 +0100 |
commit | d1a8285f818eb7e5c3d6a05709ea21a808490b8c (patch) | |
tree | 326578f0505cbed07cfe60de530022822dc237ac /CMakeLists.txt | |
parent | 16e9630b79f0a7a90c6cedb6781175bb8b337dc1 (diff) |
New upstream version 5.1.0upstream/5.1.0
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 78 |
1 files changed, 56 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f0a9a9..0ec8908 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,27 +1,33 @@ PROJECT(XTrkCAD) enable_testing() +cmake_minimum_required(VERSION 3.0) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/app) + # additional CMake modules can be found here -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake") # Setup high-level build options ... -IF(UNIX AND NOT APPLE) - SET(XTRKCAD_USE_GTK_DEFAULT ON) - SET(XTRKCAD_USE_GETTEXT_DEFAULT ON) -ENDIF(UNIX AND NOT APPLE) - -IF(APPLE) - SET(XTRKCAD_USE_GTK_DEFAULT ON) +if(UNIX) + include(FindPkgConfig) + set(XTRKCAD_USE_GTK_DEFAULT ON) + if(APPLE) SET(XTRKCAD_USE_GETTEXT_DEFAULT OFF) -ENDIF(APPLE) + else() + set(XTRKCAD_USE_GETTEXT_DEFAULT ON) + add_compile_options("-std=gnu99") + PKG_CHECK_MODULES(GTK_WEBKIT "webkit-1.0") + if(GTK_WEBKIT_FOUND) + set(XTRKCAD_USE_BROWSER_DEFAULT OFF) + else() + set(XTRKCAD_USE_BROWSER_DEFAULT ON) + endif() + endif(APPLE) +endif(UNIX) IF(WIN32) - CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR) - SET(XTRKCAD_USE_GTK_DEFAULT OFF) - SET(XTRKCAD_USE_GETTEXT_DEFAULT OFF) + SET(XTRKCAD_USE_GETTEXT_DEFAULT ON) SET(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" CACHE STRING "Flags used by the compiler during debug builds" FORCE) SET(CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG" CACHE STRING "Flags used by the compiler during release minumum size builds" FORCE) @@ -40,9 +46,17 @@ if(COMMAND cmake_policy) endif(COMMAND cmake_policy) SET(XTRKCAD_USE_DOXYGEN_DEFAULT OFF) + OPTION(XTRKCAD_USE_GTK "Use GTK for the graphical user interface back-end" ${XTRKCAD_USE_GTK_DEFAULT}) OPTION(XTRKCAD_USE_GETTEXT "Use gettext for internationalization" ${XTRKCAD_USE_GETTEXT_DEFAULT}) OPTION(XTRKCAD_USE_DOXYGEN "Generate internals documentation using doxygen" ${XTRKCAD_USE_DOXYGEN_DEFAULT}) +if(UNIX AND NOT APPLE) + option(XTRKCAD_USE_BROWSER "Show help in default browser" ${XTRKCAD_USE_BROWSER_DEFAULT}) +endif() + +IF(UNIX) + PKG_CHECK_MODULES(GTK REQUIRED "gtk+-2.0") +ENDIF() IF(APPLE) OPTION(XTRKCAD_USE_PACKAGEMAKER "Generate an OSX PackageMaker package for distribution." OFF) @@ -62,12 +76,6 @@ IF(WIN32 AND NOT XTRKCAD_USE_GTK) FIND_PACKAGE(HTMLHelp REQUIRED) ENDIF(WIN32 AND NOT XTRKCAD_USE_GTK) -IF(XTRKCAD_USE_GTK) - INCLUDE(FindPkgConfig) - PKG_CHECK_MODULES(GTK REQUIRED "gtk+-2.0") - PKG_CHECK_MODULES(GTK_WEBKIT REQUIRED "webkit-1.0") -ENDIF(XTRKCAD_USE_GTK) - IF(XTRKCAD_USE_PACKAGEMAKER) IF(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr") MESSAGE(SEND_ERROR "XTRKCAD_USE_PACKAGEMAKER requires CMAKE_INSTALL_PREFIX set to /usr.") @@ -76,20 +84,23 @@ ENDIF(XTRKCAD_USE_PACKAGEMAKER) # Find unit testing framework find_package(CMocka) -if( CMOCKA_FOUND) +if(CMOCKA_FOUND) include_directories(${CMOCKA_INCLUDE_DIR}) set(LIBS ${LIBS} ${CMOCKA_LIBRARIES}) option( XTRKCAD_TESTING "Build unittests" ON) endif() +# Find document conversion tool +find_package(Pandoc) + # Test for headers and libraries for portability ... INCLUDE (CheckIncludeFiles) CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) # Setup some global options for installation ... -SET(XTRKCAD_MAJOR_VERSION "4") -SET(XTRKCAD_MINOR_VERSION "3") +SET(XTRKCAD_MAJOR_VERSION "5") +SET(XTRKCAD_MINOR_VERSION "1") SET(XTRKCAD_RELEASE_VERSION "0") SET(XTRKCAD_VERSION_MODIFIER "") SET(XTRKCAD_VERSION "${XTRKCAD_MAJOR_VERSION}.${XTRKCAD_MINOR_VERSION}.${XTRKCAD_RELEASE_VERSION}${XTRKCAD_VERSION_MODIFIER}") @@ -106,6 +117,29 @@ SET(XTRKCAD_SHARE_INSTALL_DIR "share/xtrkcad") ADD_DEFINITIONS(-DXTRKCAD_CMAKE_BUILD) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/xtrkcad-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/xtrkcad-config.h) +IF(XTRKCAD_USE_GETTEXT) + SET(GENHELP_OPTS "-bhi") + # + # Find the GnuWin32 installation directory, the gettext include should be located in subdir include + # + IF(WIN32) + if(MSVC) + # use supplied gettext library for Visual Studio + message( STATUS "Use simple_gettext module included with XTrackCAD" ) + ADD_DEFINITIONS(-DUSE_SIMPLE_GETTEXT ) + else() + # for mingw & co. find libintl.h and use it + find_path ( INTL_PATH libintl.h ) + if(INTL_PATH) + message( STATUS "Use installed gettext module" ) + INCLUDE_DIRECTORIES(${INTL_PATH}) + endif(INTL_PATH) + endif() + ENDIF(WIN32) +ELSE(XTRKCAD_USE_GETTEXT) + SET(GENHELP_OPTS "-bh") +ENDIF(XTRKCAD_USE_GETTEXT) + # Setup the rest of the build ... ADD_SUBDIRECTORY(app) ADD_SUBDIRECTORY(distribution) |