-
Notifications
You must be signed in to change notification settings - Fork 222
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
b2b94be
commit d18d285
Showing
4 changed files
with
7 additions
and
18 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,26 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.28) | ||
project(CMakeSFMLProject LANGUAGES CXX) | ||
project(CMakeSFMLProject) | ||
|
||
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 | ||
EXCLUDE_FROM_ALL | ||
SYSTEM) | ||
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
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