-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (27 loc) · 1007 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
31
32
cmake_minimum_required(VERSION 3.28)
project(CMakeSFMLProjectforphysicshyphennbody LANGUAGES CXX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x
GIT_SHALLOW ON
EXCLUDE_FROM_ALL
SYSTEM)
FetchContent_MakeAvailable(SFML)
find_package(Freetype)
find_package(benchmark)
if (Benchmark_FOUND)
target_link_libraries(main PRIVATE benchmark::benchmark)
endif()
add_executable(main src/main.cpp src/events.cpp src/calc.cpp)
target_link_libraries(main PRIVATE sfml-graphics Freetype)
target_compile_features(main PRIVATE cxx_std_17)
if(WIN32)
add_custom_command(
TARGET main
COMMENT "Copy OpenAL DLL"
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,x64,x86>/openal32.dll $<TARGET_FILE_DIR:main>
VERBATIM)
endif()