-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (51 loc) · 2.43 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required (VERSION 3.2)
message(STATUS "")
message(STATUS " == Text from Image thresholding configuration ==")
message(STATUS "")
# Project setup, versioning stuff here, change when changing the version
# Note: keep the project name lower case only for easy linux packaging support
project (zpo VERSION 0.0.1)
set(VERSION_TYPE "alpha" CACHE STRING "version type" FORCE)
site_name(VERSION_HOST)
set(VERSION_HOST "${VERSION_HOST}" CACHE STRING "host of build" FORCE)
# Be nice to visual studio
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Be nice and export compile commands by default, this is handy for clang-tidy
# and for other tools.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#-------------------------------------------------------------------------------
# Set default install location to dist folder in build dir
# we do not want to install to /usr by default
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/dist" CACHE PATH
"Install path prefix, prepended onto install directories." FORCE )
endif()
#------------------------------------------------------------------------------
# Custom Install target, used in run target in source/CMakeLists.txt
add_custom_target( Install_ COMMAND "${CMAKE_COMMAND}" --build . --target install
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
#------------------------------------------------------------------------------
# Included CMakeLists.txt
# Documentation build
add_subdirectory(doc)
# External resources/repositories are downloaded here
add_subdirectory(external)
# Images, databases and other data which needs to be installed for project
add_subdirectory(data)
# Testing
#enable_testing()
#add_subdirectory(test)
# Source code
add_subdirectory(source)
# Packaging stuff (deb, rpm, windows installer)
add_subdirectory(packaging)
#-------------------------------------------------------------------------------
# Wrap up of settings printed on build
message(STATUS "")
message(STATUS " == Final overview ==")
message(STATUS "Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} ${VERSION_TYPE} @ ${VERSION_HOST}")
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message(STATUS " possible options: Debug Release RelWithDebInfo MinSizeRel")
message(STATUS " set with ` cmake -DCMAKE_BUILD_TYPE=Debug .. `")
message(STATUS "")