forked from Dobiasd/FunctionalPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (39 loc) · 1.42 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
cmake_minimum_required(VERSION 3.14)
project(FunctionalPlus VERSION 0.2.18)
# ---- Warning guard ----
# Protect dependents from this project's warnings if the guard isn't disabled
set(FunctionalPlus_warning_guard SYSTEM)
if(FunctionalPlus_INCLUDE_WITHOUT_SYSTEM)
set(FunctionalPlus_warning_guard "")
endif()
# ---- Declare library ----
add_library(fplus INTERFACE)
add_library(FunctionalPlus::fplus ALIAS fplus)
target_include_directories(
fplus
${FunctionalPlus_warning_guard}
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
)
target_compile_features(fplus INTERFACE cxx_std_14)
find_package(Threads REQUIRED)
target_link_libraries(fplus INTERFACE Threads::Threads)
# ---- Create auto-generated fwd and curried functions, and amalgamated library ----
find_package(Python COMPONENTS Interpreter QUIET)
if(Python_FOUND)
add_custom_target(
auto_generate
ALL
COMMAND
"${Python_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/generate/auto_generate.py"
BYPRODUCTS
"${PROJECT_SOURCE_DIR}/include/fplus/fwd_instances.autogenerated_defines"
"${PROJECT_SOURCE_DIR}/include/fplus/curry_instances.autogenerated_defines"
"${PROJECT_SOURCE_DIR}/include_all_in_one/include/fplus/fplus.hpp"
)
add_dependencies(fplus auto_generate)
else()
message(STATUS "Not adding the 'auto_generate' target (requires Python)")
endif()
# ---- Install ----
include(cmake/install-rules.cmake)