-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
37 lines (28 loc) · 1.03 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
cmake_minimum_required(VERSION 3.16.0)
project(dms VERSION 2.5.8 LANGUAGES CXX)
# Set the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Ensure optimization flags are applied only in Release mode
if (CMAKE_BUILD_TYPE MATCHES "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -march=native -flto=auto")
endif()
find_package(TBB REQUIRED CONFIG)
file(GLOB SOURCES "src/dsm/sources/*.cpp" "src/dsm/utility/*.cpp")
add_library(dsm STATIC ${SOURCES})
target_include_directories(dsm PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/headers>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(dsm PRIVATE TBB::tbb)
install(TARGETS dsm
EXPORT dsmConfig
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
install(EXPORT dsmConfig
FILE dsmConfig.cmake
NAMESPACE dsm::
DESTINATION lib/cmake/dsm)