-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
46 lines (35 loc) · 1.28 KB
/
CMakeLists.txt
File metadata and controls
46 lines (35 loc) · 1.28 KB
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
cmake_minimum_required(VERSION 3.24)
project(fastoml-cpp LANGUAGES C CXX)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(FASTOML_CPP_BUILD_EXAMPLES "Build fastoml-cpp examples" ON)
set(FASTOML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/fastoml")
if(NOT EXISTS "${FASTOML_DIR}/CMakeLists.txt")
message(FATAL_ERROR "fastoml submodule is missing. Run: git submodule update --init --recursive")
endif()
set(FASTOML_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(FASTOML_BENCH OFF CACHE BOOL "" FORCE)
add_subdirectory("${FASTOML_DIR}")
file(
GLOB FASTOML_CPP_HEADERS
CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp"
)
file(
GLOB_RECURSE FASTOML_CPP_SOURCES
CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.c"
)
add_library(fastoml-cpp ${FASTOML_CPP_HEADERS} ${FASTOML_CPP_SOURCES})
add_library(fastoml-cpp::fastoml-cpp ALIAS fastoml-cpp)
target_link_libraries(fastoml-cpp PUBLIC fastoml::fastoml)
target_include_directories(fastoml-cpp PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_compile_features(fastoml-cpp PUBLIC cxx_std_23)
if(FASTOML_CPP_BUILD_EXAMPLES)
add_subdirectory(example)
endif()