-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
37 lines (28 loc) · 923 Bytes
/
CMakeLists.txt
File metadata and controls
37 lines (28 loc) · 923 Bytes
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
cmake_minimum_required(VERSION 3.10)
# Project metadata before adding subdirectories
project(StashEXE LANGUAGES CXX)
# Default to Release build if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build (Debug or Release)" FORCE)
endif()
# C++ standard
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Compiler flags
add_compile_options(-Wall)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") # Uncomment if needed
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
# Add the library
add_subdirectory(Stash)
# Main executable
add_executable(StashEXE main.cpp)
# Link executable with Stash library
target_link_libraries(StashEXE PRIVATE Stash)
# Set output name/path
set_target_properties(StashEXE PROPERTIES
OUTPUT_NAME "Stash"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Stash"
)