-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
42 lines (32 loc) · 1.17 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
cmake_minimum_required (VERSION 3.19)
project(mkmcsv)
macro(mkmcsv_option OPTION_NAME OPTION_TEXT OPTION_DEFAULT)
option(${OPTION_NAME} ${OPTION_TEXT} ${OPTION_DEFAULT})
if(DEFINED ENV{${OPTION_NAME}})
# Allow overriding the option through an environment variable
set(${OPTION_NAME} $ENV{${OPTION_NAME}})
endif()
if(${OPTION_NAME})
add_definitions(-D${OPTION_NAME})
endif()
message(STATUS "${OPTION_NAME}: ${${OPTION_NAME}}")
endmacro()
mkmcsv_option(MKM_TEST "Enable test code (run with 'mkmcsv test')." OFF)
enable_testing()
include(FetchContent)
include(GNUInstallDirs)
FetchContent_Declare(sfc
GIT_REPOSITORY https://github.com/demogorgon1/scryfallcache.git
GIT_TAG 3ebf5bf696c1694f709b8049158fccb2742dc2b6
)
FetchContent_MakeAvailable(sfc)
# --------------------------------------------------------------------
if (MSVC)
# warning level 4 and all warnings as errors
add_compile_options(/W4 /WX)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
else()
# lots of warnings and all warnings as errors
add_compile_options(-Wall -Wextra -pedantic -Werror -Wno-unused-function)
endif()
add_subdirectory(src)