-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
75 lines (57 loc) · 2.18 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
cmake_minimum_required(VERSION 3.11)
project(fmt_extension)
include(FetchContent)
####################################################################################################
# Catch2
FetchContent_Declare(
Catch2
GIT_REPOSITORY "https://github.com/catchorg/Catch2"
GIT_TAG "v2.2.2"
)
FetchContent_GetProperties(Catch2)
if(NOT Catch2_POPULATED)
FetchContent_Populate(Catch2)
message(STATUS "Catch2 source dir: ${catch2_SOURCE_DIR}")
add_subdirectory(${catch2_SOURCE_DIR} ${catch2_BINARY_DIR})
endif()
####################################################################################################
# {fmt}
FetchContent_Declare(
fmt5
GIT_REPOSITORY "https://github.com/Remotion/fmt"
GIT_TAG "5.0.0a"
)
FetchContent_GetProperties(fmt5)
if(NOT fmt5_POPULATED)
FetchContent_Populate(fmt5)
message(STATUS "{fmt} source dir: ${fmt5_SOURCE_DIR}")
add_subdirectory(${fmt5_SOURCE_DIR} ${fmt5_BINARY_DIR})
endif()
####################################################################################################
# gsl
FetchContent_Declare(
GSL
GIT_REPOSITORY "https://github.com/Microsoft/GSL"
GIT_TAG "v1.0.0"
)
FetchContent_GetProperties(GSL)
if(NOT gsl_POPULATED)
FetchContent_Populate(GSL)
message(STATUS "GSL source dir: ${GSL_SOURCE_DIR}")
add_subdirectory(${GSL_SOURCE_DIR} ${GSL_BINARY_DIR})
endif()
####################################################################################################
add_executable(fmt_extension
fmt_ext_test.cpp
)
target_link_libraries(fmt_extension Catch fmt GSL)
####################################################################################################
set_property(TARGET fmt_extension PROPERTY CXX_STANDARD 17)
set_property(TARGET fmt_extension PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET fmt_extension PROPERTY CXX_EXTENSIONS OFF)
if (CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
target_compile_options(fmt_extension PRIVATE -pipe -Wall -Wextra -Wshadow)
elseif(MSVC)
target_compile_options(fmt_extension PRIVATE /W4 /MP /permissive- /Zc:__cplusplus /GR- )
set_target_properties(fmt_extension PROPERTIES LINK_FLAGS "/DEBUG:FASTLINK")
endif ()