-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
29 lines (24 loc) · 903 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
cmake_minimum_required(VERSION 3.10)
project(Julia VERSION 1.0.0 LANGUAGES CXX)
# Default to release builds
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
find_package(SFML 2 REQUIRED COMPONENTS graphics system window)
find_package(Threads REQUIRED)
set(SFML_LIBS sfml-graphics sfml-system sfml-window)
file(GLOB SOURCES src/*.cpp)
add_executable(${PROJECT_NAME} ${WIN32_GUI} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE "include" "lib")
set(SFML_LIBS sfml-system sfml-window sfml-graphics)
target_link_libraries(${PROJECT_NAME} ${SFML_LIBS})
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
if (UNIX)
target_link_libraries(${PROJECT_NAME} pthread)
endif (UNIX)
if(MSVC)
foreach(lib ${SFML_LIBS})
get_target_property(lib_path ${lib} LOCATION)
file(COPY ${lib_path} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endforeach()
endif()