-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f96df4
commit b0d3ef3
Showing
3 changed files
with
8 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,12 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
cmake_minimum_required(VERSION 3.22) | ||
project(CMakeSFMLProject 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_TAG master | ||
GIT_SHALLOW ON) | ||
FetchContent_MakeAvailable(SFML) | ||
|
||
add_executable(main src/main.cpp) | ||
target_link_libraries(main PRIVATE sfml-graphics) | ||
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() | ||
target_link_libraries(main PRIVATE SFML::Graphics) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters