mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 21:36:13 +01:00
Merge pull request #37 from zsbzsb/link_dynamically
Added CMake option to link dynamically
This commit is contained in:
commit
8478569b4b
2 files changed
+7
-2
No files matched your search
@@ -33,6 +33,9 @@ csfml_set_option(BUILD_SHARED_LIBS TRUE BOOL "TRUE to build CSFML as shared libr
|
|||||||
# add an option for building the API documentation
|
# add an option for building the API documentation
|
||||||
csfml_set_option(CSFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
|
csfml_set_option(CSFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
|
||||||
|
|
||||||
|
# add an option for linking to sfml either statically or dynamically
|
||||||
|
csfml_set_option(CSFML_LINK_SFML_STATICALLY TRUE BOOL "TRUE to link to a static version of SFML, FALSE to link dynamically")
|
||||||
|
|
||||||
# disable the rpath stuff
|
# disable the rpath stuff
|
||||||
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ endif()
|
|||||||
|
|
||||||
# find SFML libraries (C++)
|
# find SFML libraries (C++)
|
||||||
if(SFML_OS_WINDOWS)
|
if(SFML_OS_WINDOWS)
|
||||||
set(SFML_STATIC_LIBRARIES TRUE)
|
if (CSFML_LINK_SFML_STATICALLY)
|
||||||
add_definitions(-DSFML_STATIC)
|
set(SFML_STATIC_LIBRARIES TRUE)
|
||||||
|
add_definitions(-DSFML_STATIC)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
find_package(SFML 2 COMPONENTS system window network graphics audio REQUIRED)
|
find_package(SFML 2 COMPONENTS system window network graphics audio REQUIRED)
|
||||||
include_directories(${SFML_INCLUDE_DIR})
|
include_directories(${SFML_INCLUDE_DIR})
|
||||||
|
|||||||
Reference in new issue
Block a user