1 cmake_minimum_required(VERSION 3.11)
6 DESCRIPTION "Library for maritime navigation."
9 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
10 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
11 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
14 set(CMAKE_CXX_STANDARD 11)
15 set(CMAKE_CXX_STANDARD_REQUIRED ON)
16 set(CMAKE_CXX_EXTENSIONS OFF)
17 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
20 option(ENABLE_STATIC "Enable static library" ON)
21 option(ENABLE_PROFILING "Enable Profiling" OFF)
22 option(ENABLE_BENCHMARK "Enable Benchmark" OFF)
23 option(ENABLE_SANITIZER "Enable Sanitizing (address, undefined)" OFF)
24 option(ENABLE_IO "Enable IO support" ON)
25 option(ENABLE_EXAMPLES "Enable Examples" ON)
26 option(ENABLE_TESTS "Enable Tests" ON)
27 option(ENABLE_TOOLS "Enable Tools" ON)
29 if(NOT DEFINED BUILD_SHARED_LIBS)
31 set(BUILD_SHARED_LIBS FALSE)
33 set(BUILD_SHARED_LIBS TRUE)
38 include(RepoInformation)
39 include(Documentation)
41 include(ExternalProject)
44 include(ExternCxxopts)
49 message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
51 ${CMAKE_CURRENT_BINARY_DIR}/doc
52 ${CMAKE_CURRENT_BINARY_DIR}/doc/coverage
53 ${CMAKE_CURRENT_BINARY_DIR}/local/include
60 message(STATUS "Build Examples: ${ENABLE_EXAMPLES}")
62 add_subdirectory(examples)
67 if(CTAGS_PATH AND CSCOPE_PATH)
68 setup_ctags_target("${CMAKE_CURRENT_SOURCE_DIR}/src/*.?pp;${CMAKE_CURRENT_SOURCE_DIR}/include/*.?pp")
72 message(STATUS "Build Tests: ${ENABLE_TESTS}")
75 include(ExternGoogletest)
76 include(ExternBenchmark)
77 add_subdirectory(test)
81 if(CMAKE_BUILD_TYPE MATCHES Coverage)
83 setup_target_for_coverage(coverage
89 set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
90 set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
91 set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
92 set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
93 set(CPACK_PACKAGE_NAME "marnav")
94 set(CPACK_PACKAGE_VENDOR "Mario Konrad")
95 set(CPACK_PACKAGE_CONTACT "Mario Konrad <mario.konrad@gmx.net>")
96 set(CPACK_PACAKGE_DESCRIPTION "Library for maritime navigation.")
97 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Library")
98 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
99 set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
100 set(CPACK_MONOLITHIC_INSTALL 1)
101 #set(CPACK_PACKAGE_EXECUTABLES "??" "??")
102 set(CPACK_STRIP_FILES true)
105 set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_DEBIAN_PACKAGE_NAME})
106 set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
107 set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACAKGE_DESCRIPTION})
108 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libstdc++6 (>= 4.9)")
109 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3)")
110 set(CPACK_DEBIAN_PACKAGE_SECTION "misc")
111 if (CMAKE_SIZEOF_VOID_P MATCHES "8")
112 set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
114 set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")