forked from guodong/nanobdd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (56 loc) · 2.04 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
cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(GNUInstallDirs)
project(nanobdd)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
add_library(${PROJECT_NAME}
src/Nanobdd.cpp
src/Bdd.cpp
src/Cache.cpp
src/NodeTable.cpp
)
target_link_libraries(${PROJECT_NAME}
tbb
)
target_include_directories(${PROJECT_NAME}
PRIVATE
# where the library itself will look for its internal headers
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/include
PUBLIC
# where top-level project will look for the library's public headers
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}>
# where external projects will look for the library's public headers
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
set(public_headers
include/nanobdd/nanobdd.h
include/nanobdd/Bdd.h
include/nanobdd/Node.h
)
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${public_headers}")
install(TARGETS ${PROJECT_NAME}
EXPORT "${PROJECT_NAME}Targets"
# these get default values from GNUInstallDirs, no need to set them
#RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} # lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} # lib
# except for public headers, as we want them to be inside a library folder
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} # include/SomeLibrary
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} # include
)
include(CMakePackageConfigHelpers)
install(
EXPORT ${PROJECT_NAME}Targets
FILE nanobddTargets.cmake
NAMESPACE nanobdd::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/nanobdd
)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nanobdd.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/nanobdd.pc" @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/nanobdd.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)