-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
30 lines (19 loc) · 993 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
cmake_minimum_required(VERSION 3.17.3)
set(EXECUTABLE_NAME simple_example_application)
project(SFML_PROJ LANGUAGES CXX) #set the project name and to use C++
set(CMAKE_BUILD_TYPE Debug)
set(BUILD_SHARED_LIBS OFF)
set(SFML_STATIC_LIBRARIES ON)
set(MY_SOURCES src/main.cpp)
set(MY_RESOURCES resources)
if(WIN32) # This check detects windows even 64 bit, CMAKE just has a confusing name.
add_executable(${EXECUTABLE_NAME} WIN32 ${MY_SOURCES})
file(COPY ${PROJECT_SOURCE_DIR}/external_resources/SFML/extlibs/bin/x86/openal32.dll DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${MY_RESOURCES} DESTINATION ${CMAKE_BINARY_DIR})
elseif(APPLE)
add_executable(${EXECUTABLE_NAME} ${MY_SOURCES})
file(COPY ${MY_RESOURCES} DESTINATION ${CMAKE_BINARY_DIR})
endif()
add_subdirectory(${PROJECT_SOURCE_DIR}/external_resources/SFML)
include_directories(${PROJECT_SOURCE_DIR}/external_resources/SFML/include)
target_link_libraries(${EXECUTABLE_NAME} PRIVATE sfml-graphics sfml-audio)