-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
75 lines (59 loc) · 3.4 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
#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under contract, and is subject to the Rights in Data-General Clause #
# 52.227-14, Alt. IV (DEC 2007). #
# #
# Copyright 2023 The MITRE Corporation. All Rights Reserved. #
#############################################################################
#############################################################################
# Copyright 2023 The MITRE Corporation #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#############################################################################
cmake_minimum_required(VERSION 3.6)
project(openmpf-cpp-component-sdk)
set(CMAKE_CXX_STANDARD 17)
# Configure install location for SDK libs
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # prefix path not provided on command line
if(DEFINED ENV{MPF_SDK_INSTALL_PATH})
set(CMAKE_INSTALL_PREFIX "$ENV{MPF_SDK_INSTALL_PATH}" CACHE PATH "..." FORCE)
else()
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/mpf-sdk-install" CACHE PATH "..." FORCE)
endif()
endif()
function(export_mpf_lib targetName)
install(TARGETS ${targetName} EXPORT ${targetName}Config
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
install(DIRECTORY include/ DESTINATION include)
# Generate CMake config file that will install ${targetName}
export(TARGETS ${targetName} FILE ${targetName}Config.cmake EXPORT_LINK_INTERFACE_LIBRARIES)
# Make it so ${targetName} can be found with find_package
export(PACKAGE ${targetName})
# Copy CMake config file to install location so dependencies can find it.
install(EXPORT ${targetName}Config DESTINATION lib/cmake/${targetName} EXPORT_LINK_INTERFACE_LIBRARIES)
endfunction()
add_subdirectory(interface)
include_directories(interface/include)
add_subdirectory(detection/api)
include_directories(detection/api/include)
add_subdirectory(detection/utils)
include_directories(detection/utils/include)
add_subdirectory(detection/testUtils)
include_directories(detection/testUtils/include)
add_subdirectory(mpf-cmake-helpers)