Skip to content

Commit 320218d

Browse files
committedNov 7, 2023
Exclude SFML from the ALL build, which stops it being installed alongside the project
1 parent 1faab78 commit 320218d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
55
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
66

77
include(FetchContent)
8-
FetchContent_Declare(SFML
8+
FetchContent_Declare(sfml
99
GIT_REPOSITORY https://github.com/SFML/SFML.git
1010
GIT_TAG 2.6.x)
11-
FetchContent_MakeAvailable(SFML)
11+
if (NOT sfml_POPULATED)
12+
FetchContent_Populate(sfml)
13+
add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR} EXCLUDE_FROM_ALL)
14+
endif()
1215

1316
add_executable(CMakeSFMLProject src/main.cpp)
1417
target_link_libraries(CMakeSFMLProject PRIVATE sfml-graphics)

0 commit comments

Comments
 (0)