-
Notifications
You must be signed in to change notification settings - Fork 123
/
CMakeLists.txt
27 lines (21 loc) · 750 Bytes
/
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
cmake_minimum_required(VERSION 3.0)
project(argparse VERSION 0.1.0 LANGUAGES C)
if(NOT CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "-O3")
endif()
if(NOT CMAKE_C_FLAGS_DEBUG)
set(CMAKE_C_FLAGS_DEBUG "-g -ggdb")
endif()
set(sources argparse.c)
option(ARGPARSE_SHARED "Build shared library" ON)
option(ARGPARSE_STATIC "Build static library" ON)
if(ARGPARSE_SHARED)
add_library(argparse_shared SHARED ${sources})
target_include_directories(argparse_shared PUBLIC .)
set_target_properties(argparse_shared PROPERTIES OUTPUT_NAME argparse)
endif()
if(ARGPARSE_STATIC)
add_library(argparse_static STATIC ${sources})
target_include_directories(argparse_static PUBLIC .)
set_target_properties(argparse_static PROPERTIES OUTPUT_NAME argparse_static)
endif()