forked from Kitware/seal-tk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (77 loc) · 2.19 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# This file is part of SEAL-TK, and is distributed under the OSI-approved BSD
# 3-Clause License. See top-level LICENSE file or
# https://github.com/Kitware/seal-tk/blob/master/LICENSE for details.
cmake_minimum_required(VERSION 3.12)
project(sealtk
VERSION 0.1
LANGUAGES CXX
)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set(sealtk_BUILD_LIBDIR "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
list(APPEND CMAKE_MODULE_PATH
"${PROJECT_SOURCE_DIR}/cmake"
"${PROJECT_SOURCE_DIR}/cmake/thirdparty"
)
find_package(Qt5 REQUIRED COMPONENTS
Test
Widgets
Xml
)
find_package(qtExtensions REQUIRED)
find_package(kwiver REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Git)
find_package(Python3)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC 1)
set(CMAKE_AUTORCC 1)
set(CMAKE_AUTOUIC 1)
enable_testing()
if(TARGET Python3::Interpreter)
if(TARGET Git::Git)
set(git_args --git $<TARGET_FILE:Git::Git>)
endif()
add_test(
NAME SourceCheck
COMMAND Python3::Interpreter
"${PROJECT_SOURCE_DIR}/utilities/source_check.py" ${git_args}
)
endif()
add_subdirectory(sealtk)
export(EXPORT sealtk
NAMESPACE sealtk::
FILE "${sealtk_BUILD_LIBDIR}/cmake/sealtk/sealtk-targets.cmake"
)
install(EXPORT sealtk
NAMESPACE sealtk::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sealtk"
FILE "sealtk-targets.cmake"
COMPONENT Development
)
write_basic_package_version_file(
"${sealtk_BUILD_LIBDIR}/cmake/sealtk/sealtk-config-version.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/sealtk-config.cmake.in"
"${sealtk_BUILD_LIBDIR}/cmake/sealtk/sealtk-config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sealtk"
)
install(FILES
"${sealtk_BUILD_LIBDIR}/cmake/sealtk/sealtk-config.cmake"
"${sealtk_BUILD_LIBDIR}/cmake/sealtk/sealtk-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sealtk"
COMPONENT Development
)
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/setup_KWIVER.sh.in"
"${PROJECT_BINARY_DIR}/setup_KWIVER.sh"
@ONLY
)
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/setup_KWIVER.bat.in"
"${PROJECT_BINARY_DIR}/setup_KWIVER.bat"
@ONLY
)