-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
37 lines (28 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
# IMPORTANT!
# DO NOT CHANGE ANYTHING IN THIS FILE!
# CUSTOM CHANGES TO COMPILER OPTIONS BELONG IN src/CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
CMAKE_POLICY(SET CMP0012 NEW)
IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
MESSAGE(FATAL_ERROR "Do not build in-source. Please remove CMakeCache.txt and the CMakeFiles/ directory. Then build out-of-source.")
ENDIF()
SET(CMAKE_C_STANDARD 99)
SET(CMAKE_CXX_STANDARD 11)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
MESSAGE(STATUS "macOS detected")
SET(OS_SPECIFIC_C_FLAGS "-Wall -m64")
SET(OS_SPECIFIC_CXX_FLAGS "-Wall -m64")
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
MESSAGE(STATUS "Linux detected")
SET(OS_SPECIFIC_C_FLAGS "-Wall -m64")
SET(OS_SPECIFIC_CXX_FLAGS "-Wall -m64")
ELSE()
MESSAGE(FATAL_ERROR "Unsupported OS detected. Use macOS or Linux.")
ENDIF()
SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${OS_SPECIFIC_C_FLAGS})
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OS_SPECIFIC_CXX_FLAGS})
SET(CMAKE_INSTALL_PREFIX ${CMAKE_HOME_DIRECTORY})
SET(CLI11_INCLUDE_DIR ${CMAKE_HOME_DIRECTORY}/vendor/CLI11/)
ADD_LIBRARY(CLI11 INTERFACE)
TARGET_INCLUDE_DIRECTORIES(CLI11 INTERFACE ${CLI11_INCLUDE_DIR})
ADD_SUBDIRECTORY(src)