-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
57 lines (48 loc) · 1.37 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
cmake_minimum_required(VERSION 3.6)
project(
workflow-polaris
VERSION 0.1.0
LANGUAGES CXX
)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(CMAKE_SKIP_RPATH TRUE)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
if(Workflow_DIR)
find_package(Workflow REQUIRED CONFIG HINTS ${Workflow_DIR})
else()
find_package(Workflow REQUIRED CONFIG)
endif()
message("Use workflow at " ${WORKFLOW_INCLUDE_DIR})
find_package(Yaml-cpp-static)
if(Yaml-cpp-static_FOUND)
message("Use yaml-cpp static library")
else()
find_package(Yaml-cpp REQUIRED)
message("Use yaml-cpp dynamic library")
endif()
set(LIBRARY_NAME workflow-polaris)
add_library(${LIBRARY_NAME} STATIC
src/PolarisClient.cc
src/PolarisConfig.cc
src/PolarisManager.cc
src/PolarisPolicy.cc
src/PolarisTask.cc
)
include_directories(
${WORKFLOW_INCLUDE_DIR}
${YAML_CPP_INCLUDE_DIR}
)
target_include_directories(${LIBRARY_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
add_subdirectory(example)
include(CMakePackageConfigHelpers)
set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(LIBRARIES_DIR ${CMAKE_CURRENT_BINARY_DIR})
configure_package_config_file(
${LIBRARY_NAME}-config.cmake.in
${PROJECT_SOURCE_DIR}/${LIBRARY_NAME}-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LIBRARY_NAME}
PATH_VARS INCLUDE_DIR LIBRARIES_DIR
)