-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (41 loc) · 1.43 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
38
39
40
41
42
43
44
45
46
47
48
49
# Minimum CMake version is 3.19
cmake_minimum_required(VERSION 3.17)
# We are at v0.3.0, since v0.2 is Celerytest Legacy
project(celerytest VERSION 0.3.0.53)
# Configure this project
configure_file(include/${PROJECT_NAME}_cfg.in
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}_cfg.hpp)
# We will use OpenGL 4.3
set(GRAPHICS GRAPHICS_API_OPENGL_43)
# GLFW later than 3.3.8 is bugged and can't use Primus for now.
# Ubuntus bundle in 3.3.8
# TODO: Bundle in our own GLFW
set(USE_EXTERNAL_GLFW ON)
# Add raylib
add_subdirectory(submodules/raylib)
# Add CMake extras
include(cmake/FindLuaJIT.cmake)
# Find Doxygen
find_package(Doxygen)
# Find libpthread or the platform equivalent
find_package(Threads REQUIRED)
# Add the target
add_executable(${PROJECT_NAME}
src/${PROJECT_NAME}_con.cpp
src/${PROJECT_NAME}_draw.cpp
src/${PROJECT_NAME}.cpp)
# Generate docs if we have it
doxygen_add_docs(docs)
# MSVC doesn't like post-C99 extensions
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD_REQUIRED TRUE)
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99)
# Enable filthy C++17 extensions though
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED TRUE)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
# GLEW, Lua, SDL2 headers
target_include_directories(${PROJECT_NAME} PRIVATE include ${LUA_INCLUDE_DIR})
# Link!
target_link_libraries(${PROJECT_NAME} PRIVATE
${LUA_LIBRARY}
raylib
Threads::Threads)