mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 05:26:13 +01:00
Add options to select the modules to build
This commit is contained in:
1 parent
8c02b89a93
commit
2ec9764ac4
2 files changed
+34
-5
No files matched your search
@@ -23,6 +23,12 @@ include(GNUInstallDirs)
|
|||||||
# include the configuration file
|
# include the configuration file
|
||||||
include(${PROJECT_SOURCE_DIR}/cmake/Config.cmake)
|
include(${PROJECT_SOURCE_DIR}/cmake/Config.cmake)
|
||||||
|
|
||||||
|
# add options to select which modules to build
|
||||||
|
csfml_set_option(CSFML_BUILD_WINDOW TRUE BOOL "TRUE to build CSFML's Window module. This setting is ignored, if the graphics module is built.")
|
||||||
|
csfml_set_option(CSFML_BUILD_GRAPHICS TRUE BOOL "TRUE to build CSFML's Graphics module.")
|
||||||
|
csfml_set_option(CSFML_BUILD_AUDIO TRUE BOOL "TRUE to build CSFML's Audio module.")
|
||||||
|
csfml_set_option(CSFML_BUILD_NETWORK TRUE BOOL "TRUE to build CSFML's Network module.")
|
||||||
|
|
||||||
# add an option for choosing the build type (shared or static)
|
# add an option for choosing the build type (shared or static)
|
||||||
csfml_set_option(BUILD_SHARED_LIBS TRUE BOOL "TRUE to build CSFML as shared libraries, FALSE to build it as static libraries")
|
csfml_set_option(BUILD_SHARED_LIBS TRUE BOOL "TRUE to build CSFML as shared libraries, FALSE to build it as static libraries")
|
||||||
|
|
||||||
|
|||||||
+28
-5
@@ -21,14 +21,37 @@ if(CSFML_LINK_SFML_STATICALLY)
|
|||||||
set(SFML_STATIC_LIBRARIES TRUE)
|
set(SFML_STATIC_LIBRARIES TRUE)
|
||||||
add_definitions(-DSFML_STATIC)
|
add_definitions(-DSFML_STATIC)
|
||||||
endif()
|
endif()
|
||||||
find_package(SFML 2.6 COMPONENTS network graphics audio REQUIRED)
|
set(SFML_MODULES "system")
|
||||||
|
if(CSFML_BUILD_AUDIO)
|
||||||
|
list(PREPEND SFML_MODULES "audio")
|
||||||
|
endif()
|
||||||
|
if(CSFML_BUILD_GRAPHICS)
|
||||||
|
list(PREPEND SFML_MODULES "graphics")
|
||||||
|
endif()
|
||||||
|
if(CSFML_BUILD_NETWORK)
|
||||||
|
list(PREPEND SFML_MODULES "network")
|
||||||
|
endif()
|
||||||
|
find_package(SFML 2.6 COMPONENTS ${SFML_MODULES} REQUIRED)
|
||||||
|
|
||||||
# add the modules subdirectories
|
# add the modules subdirectories
|
||||||
add_subdirectory(System)
|
add_subdirectory(System)
|
||||||
add_subdirectory(Window)
|
|
||||||
add_subdirectory(Network)
|
if(CSFML_BUILD_WINDOW OR SFML_BUILD_GRAPHICS)
|
||||||
add_subdirectory(Graphics)
|
add_subdirectory(Window)
|
||||||
add_subdirectory(Audio)
|
endif()
|
||||||
|
|
||||||
|
if(CSFML_BUILD_NETWORK)
|
||||||
|
add_subdirectory(Network)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CSFML_BUILD_GRAPHICS)
|
||||||
|
add_subdirectory(Graphics)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CSFML_BUILD_AUDIO)
|
||||||
|
add_subdirectory(Audio)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(SFML_OS_WINDOWS)
|
if(SFML_OS_WINDOWS)
|
||||||
add_subdirectory(Main)
|
add_subdirectory(Main)
|
||||||
endif()
|
endif()
|
||||||
Reference in new issue
Block a user