-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (40 loc) · 1.49 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
cmake_minimum_required(VERSION 3.16)
project(impossible-rocket CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_subdirectory(external)
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Werror -Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(/W4 /WX /permissive-)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND CMAKE_BUILD_TYPE STREQUAL "Release")
add_executable(impossible-rocket WIN32)
target_link_libraries(impossible-rocket PRIVATE SFML::Main)
else()
add_executable(impossible-rocket)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_sources(impossible-rocket PRIVATE src/appicon.rc)
endif()
target_sources(impossible-rocket PRIVATE
src/Main.cpp
src/App.cpp
src/AssetHolder.cpp
src/BaseState.cpp
src/GameLevel.cpp
src/InputHandler.cpp
src/MenuState.cpp
src/ParticleEffect.cpp
src/PauseMenu.cpp
src/PhysicsWorld.cpp
src/PlayerRocket.cpp
src/PlayState.cpp
src/SoundCentral.cpp)
target_link_libraries(impossible-rocket PRIVATE SFML::Graphics SFML::Audio ImGui-SFML::ImGui-SFML spdlog)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(impossible-rocket PRIVATE IMPOSSIBLE_ROCKET_DEBUG)
endif()
add_custom_target(format
COMMAND clang-format -i `git ls-files *.hpp *.cpp`
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
add_custom_target(run COMMAND impossible-rocket WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")