-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
74 lines (60 loc) · 1.61 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
cmake_minimum_required(VERSION 3.13)
# configure.ac: AC_INIT([cfd-core], [1.0]
set(PACKAGE_VERSION 1.0.0)
####################
# options
####################
include(./cmake/CfdCommonOption.cmake)
include(./cmake/CfdWallyOption.cmake)
####################
# common setting
####################
include(./cmake/CfdCommonSetting.cmake)
####################
# test
####################
project(cfdcore_all_test CXX)
if(ENABLE_TESTS)
enable_testing()
endif() # ENABLE_TESTS
####################
# subdirectories
####################
if(NOT CFD_SINGLE_BUILD)
add_subdirectory(external)
endif()
add_subdirectory(src/univalue)
add_subdirectory(src)
####################
# test subdirectories
####################
if(ENABLE_TESTS)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(CTest)
add_subdirectory(test)
endif() # ENABLE_TESTS
####################
# install & export
####################
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${prefix})
set(libdir ${exec_prefix}/lib)
set(includedir ${prefix}/include)
include(GNUInstallDirs)
configure_file(pc/cfd-core.pc.in cfd-core.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cfd-core.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
####################
# uninstall
####################
if(NOT TARGET uninstall)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/pc/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()