-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
68 lines (53 loc) · 1.88 KB
/
CMakeLists.txt
File metadata and controls
68 lines (53 loc) · 1.88 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.16.3)
set(CMAKE_CXX_STANDARD 20)
project(system)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
message("*** Build type not set. defaulting to Release")
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(
-g
-O0
-march=native
-Wall
-fPIE
)
else()
add_compile_options(
-O3
-march=native
-g
-Wall
-fPIE
)
endif()
option(WORKCONTRACT_BUILD_DEMO "Build the CLI demo" ON)
message("Build Type = ${CMAKE_BUILD_TYPE}")
###############################################################################
# Fetch the main bcpp scripts which allows us to fetch other dependencies more easily
###############################################################################
include(FetchContent)
if ("${_scripts_src_path}" STREQUAL "")
set(_scripts_src_path ${CMAKE_BINARY_DIR}/scripts-src CACHE STRING "")
message("Fetching Content: scripts.git")
FetchContent_Declare(
scripts
GIT_REPOSITORY https://github.com/buildingcpp/scripts.git
GIT_TAG main
SOURCE_DIR "${CMAKE_BINARY_DIR}/scripts-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/scripts-build"
INSTALL_DIR "${CMAKE_BINARY_DIR}"
INSTALL_COMMAND ""
)
FetchContent_MakeAvailable(scripts)
FetchContent_GetProperties(scripts)
endif()
include("${_scripts_src_path}/cmake/fetch_dependencies.cmake")
fetch_dependency("https://github.com/buildingcpp/include.git;main")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME})
set(_${PROJECT_NAME}_dir ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(src)