File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,17 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
88
99project (Spiced)
1010
11+ if (MSVC OR MINGW)
12+ option (STATIC_SFML "Link SFML Statically" TRUE )
13+ else ()
14+ option (STATIC_SFML "Link SFML Statically" FALSE )
15+ endif ()
16+
17+
18+ if (STATIC_SFML)
19+ set (SFML_STATIC_LIBRARIES TRUE )
20+ endif ()
21+
1122find_package (SFML 2 REQUIRED system window graphics network audio main)
1223
1324
@@ -185,13 +196,17 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
185196set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS} " )
186197set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS} " )
187198
199+ if (STATIC_SFML)
200+ list (APPEND LIBS ${SFML_DEPENDENCIES} )
201+ endif ()
202+
188203add_executable (spiced WIN32 src/main.cpp src/game.cpp src/game_event.cpp src/map.cpp src/chaiscript_stdlib.cpp src/chaiscript_bindings.cpp src/chaiscript_creator.cpp)
189- target_link_libraries (spiced ${SFML_GRAPHICS} ${SFML_WINDOW} ${SFML_SYSTEM } ${LIBS} )
190- file (COPY sample_game DESTINATION ${CMAKE_BINARY_DIR } )
204+ target_link_libraries (spiced ${SFML_LIBRARIES } ${LIBS} )
205+ include_directories ( ${SFML_INCLUDE_DIR } )
191206
192207
193- include_directories ( ${SFML_INCLUDE_DIR } )
194- target_link_libraries (spiced ${SFML_LIBRARIES} )
208+ file (COPY sample_game DESTINATION ${CMAKE_BINARY_DIR } )
209+
195210
196211install (TARGETS spiced RUNTIME DESTINATION bin)
197212
You can’t perform that action at this time.
0 commit comments