-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (41 loc) · 1.03 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
cmake_minimum_required(VERSION 3.15)
set(targets
basic
positional
positional1
positional3
optional
optional1
optional2
complex
complex1
complex2
complex3
advanced
advanced1
conflicting
conflicting1
nohelp
undesired
nohandling
nohandling1
nohandling2
version
custom
custom1
custom2
types
string)
foreach(target ${targets})
add_executable(${target})
target_sources(${target} PRIVATE ${target}.cpp)
target_compile_features(${target} PRIVATE cxx_std_20)
target_compile_options(${target} PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wextra -Werror -pedantic-errors>
$<$<CXX_COMPILER_ID:MSVC>:
/W4 /WX /permissive->)
target_link_libraries(${target} PRIVATE cpp-argparse)
endforeach()
add_custom_target(tutorial)
add_dependencies(tutorial ${targets})