-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
39 lines (26 loc) · 1.06 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
cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
project(simple-cpp-option-parser)
# This logger is written considering C++11
set (CMAKE_CXX_STANDARD 11)
# If Clang (Apple) disable extra-warnings about format security
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using regular Clang or AppleClang
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format-security")
endif()
# Options
add_definitions( -D CMDLINEPARSER_DEFAULT_FASCIST_MODE=1 )
# Include the header folder
include_directories(./include)
# Executable example
message("Setting up executable: OptionParserExample")
add_executable( OptionParserExample example/main.cpp )
# Extension: yaml-cpp
find_package( yaml-cpp )
if( yaml-cpp_FOUND )
message("yaml-cpp has been found! Compiling with extra features")
message(" -> include directory: ${YAML_CPP_INCLUDE_DIR}")
message(" -> lib name: ${YAML_CPP_LIBRARIES}")
include_directories( ${YAML_CPP_INCLUDE_DIR} )
target_link_libraries( OptionParserExample ${YAML_CPP_LIBRARIES} )
add_definitions( -D CMDLINEPARSER_YAML_CPP_ENABLED=1 )
endif()