-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
49 lines (36 loc) · 1.3 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
cmake_minimum_required(VERSION 3.8)
project(std-fwd)
option(STDFWD_FORCE_INCLUDE "if true, force includes <stdfwd.hh> in every header depending on this library." OFF)
####################################################################
# Library version
get_directory_property(hasParent PARENT_DIRECTORY)
if(NOT ${hasParent})
add_library(std-fwd INTERFACE)
target_include_directories(std-fwd INTERFACE "include/")
if(STDFWD_FORCE_INCLUDE)
if (MSVC)
target_compile_options(${PROJECT_NAME} INTERFACE "/FIstdfwd.hh")
else()
target_compile_options(${PROJECT_NAME} INTERFACE "-includestdfwd.hh")
endif()
endif()
####################################################################
# Standalone version (for testing)
else()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
file(GLOB_RECURSE SOURCES "tests/*.*" "include/*")
add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PUBLIC "include/")
if(MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC
/MP
/FC
)
else()
target_compile_options(${PROJECT_NAME} PUBLIC
-Wall
)
target_link_libraries(${PROJECT_NAME} PUBLIC stdc++fs) # filesystem
endif()
endif()