-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
41 lines (31 loc) · 946 Bytes
/
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
cmake_minimum_required(VERSION 3.15)
project(smol-invaders)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 17)
# Define the installation directory
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)
# Add your libraries and include directories
add_subdirectory(include/raylib)
include_directories(
include
include/raylib/src
src
)
file(GLOB_RECURSE SRCS src/*.cpp)
set(PROJECT_NAME_LIB ${PROJECT_NAME}_lib)
add_library(${PROJECT_NAME_LIB} STATIC ${SRCS})
add_executable(${PROJECT_NAME} src/main.cpp)
target_include_directories(${PROJECT_NAME_LIB} PRIVATE
include
include/raylib/src
)
target_link_libraries(${PROJECT_NAME}
${PROJECT_NAME_LIB}
raylib
-static-libstdc++ # Statically link libstdc++
)
# Install the executable and libraries
install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME_LIB}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
)