-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (23 loc) · 1.1 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
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
# Set project name and version
project(shoot-the-aliens VERSION 0.1.0)
# Set C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
if(MSVC)
# Link statically when building on windows to help distribution of the software
set(SFML_STATIC_LIBRARIES TRUE)
# Hide the console window in visual studio projects
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()
# Find SFML shared libraries
find_package(SFML 2.5.1 COMPONENTS system window graphics audio REQUIRED)
# Compile executable
add_executable(shoot-the-aliens alien.cpp explosion.cpp fond.cpp gameengine.cpp jeu.cpp joueur.cpp main.cpp soundmanager.cpp tir.cpp vaisseau.cpp)
# Set include directory search paths
target_include_directories(shoot-the-aliens PRIVATE "${PROJECT_BINARY_DIR}")
# Link executable to required SFML libraries
target_link_libraries(shoot-the-aliens sfml-audio sfml-graphics sfml-window sfml-system)
# Install target
install(TARGETS shoot-the-aliens DESTINATION bin)