-
Notifications
You must be signed in to change notification settings - Fork 22
/
CMakeLists.txt
47 lines (37 loc) · 1.13 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
#----------------------- PROJECT CONFIGURATION --------------------------------
cmake_minimum_required(VERSION 3.10)
project(cpp-dotenv VERSION 1.0.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE RELEASE)
else()
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
endif()
message(STATUS "Building CPP-DOTENV in ${CMAKE_BUILD_TYPE} mode")
#------------------- SUBDIRECTORY ADDITION ------------------------------------
add_subdirectory(common)
add_subdirectory(src)
#----------------------- LIBRARY CONFIGURATION --------------------------------
set(CPP_DOTENV cpp_dotenv CACHE INTERNAL "")
set(CPP_DOTENV_SRC
src/dotenv.cpp
include/dotenv.h
)
add_library(${CPP_DOTENV} ${CPP_DOTENV_SRC})
target_link_libraries(${CPP_DOTENV}
${ENVIRON_LIB}
${PARSER_LIB}
)
target_include_directories(${CPP_DOTENV} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
target_compile_options(${CPP_DOTENV} PRIVATE
-g -Wall -O0
)
else()
target_compile_options(${CPP_DOTENV} PRIVATE
-O3
)
endif()