-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
39 lines (29 loc) · 1.2 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
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
endif()
message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
cmake_minimum_required(VERSION 3.19)
project(ddim_scheduler_cpp)
set(CMAKE_CXX_STANDARD 17)
option(DDIM_SHARED_LIB "shared library support" OFF)
option(DDIM_INSTALL_LIB "install ddim_scheduler_cpp library and headers" ON)
option(DDIM_EXAMPLE "build example" OFF)
include_directories(source)
include_directories(${PROJECT_SOURCE_DIR}/3rdparty)
file(GLOB_RECURSE SOURCE_FILES source/*.cpp)
if(DDIM_SHARED_LIB)
add_library(ddim_scheduler_cpp SHARED ${SOURCE_FILES})
else()
add_library(ddim_scheduler_cpp STATIC ${SOURCE_FILES})
endif()
set_target_properties(ddim_scheduler_cpp PROPERTIES DEBUG_POSTFIX "d")
if(DDIM_INSTALL_LIB)
install(TARGETS ddim_scheduler_cpp EXPORT ddim_scheduler_cpp
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)
install(FILES ${PROJECT_SOURCE_DIR}/source/ddimscheduler.hpp DESTINATION ${CMAKE_INSTALL_PREFIX}/ddim_scheduler_cpp)
endif()
if(DDIM_EXAMPLE)
add_subdirectory(example)
endif()