-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 1.2 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
cmake_minimum_required(VERSION 3.27)
project(levelizer)
# Variables
############################################################
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(LVL_SRC_DIR ${CMAKE_SOURCE_DIR}/src)
set(LVL_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/)
############################################################
# Project sources
############################################################
set(LVL_SOURCES
${LVL_SRC_DIR}/lexer.cpp
${LVL_SRC_DIR}/parser.cpp
${LVL_SRC_DIR}/level.cpp
${LVL_SRC_DIR}/entity.cpp
)
############################################################
# Compiling and linking
############################################################
add_library(${PROJECT_NAME} ${CMAKE_BUILD_TYPE} ${LVL_SOURCES})
target_compile_options(${PROJECT_NAME} PRIVATE -lm)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
target_include_directories(${PROJECT_NAME} BEFORE PUBLIC ${LVL_HEADER_DIR}/levelizer)
# Install the library in the correct place
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(DIRECTORY ${LVL_HEADER_DIR} DESTINATION include)
############################################################