Removed a copy of the sfml_add_example CMake macro, which was duplicated by accident in the big Android commit

This commit is contained in:
Laurent Gomila 2013-08-30 15:54:09 +02:00 committed by Jonathan De Wachter
parent cac645076f
commit 4bd1a66915

View File

@ -11,6 +11,7 @@ macro(sfml_add_library target)
cmake_parse_arguments(THIS "" "" "SOURCES;DEPENDS;EXTERNAL_LIBS" ${ARGN})
if(NOT ANDROID)
# create the target
add_library(${target} ${THIS_SOURCES})
@ -106,7 +107,9 @@ if(NOT ANDROID)
LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT bin
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT devel
FRAMEWORK DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX} COMPONENT bin)
else()
# create an empty target added to the default build
add_custom_target(${target} ALL)
@ -194,62 +197,7 @@ else()
endif()
endif()
endmacro()
# add a new target which is a SFML example
# ex: sfml_add_example(ftp
# SOURCES ftp.cpp ...
# DEPENDS sfml-network sfml-system)
macro(sfml_add_example target)
# parse the arguments
sfml_parse_arguments(THIS "SOURCES;DEPENDS" "GUI_APP" ${ARGN})
# set a source group for the source files
source_group("" FILES ${THIS_SOURCES})
# create the target
if(THIS_GUI_APP AND WINDOWS)
add_executable(${target} WIN32 ${THIS_SOURCES})
target_link_libraries(${target} sfml-main)
else()
add_executable(${target} ${THIS_SOURCES})
endif()
# set the debug suffix
set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d)
# set the target's folder (for IDEs that support it, e.g. Visual Studio)
set_target_properties(${target} PROPERTIES FOLDER "Examples")
# for gcc >= 4.0 on Windows, apply the SFML_USE_STATIC_STD_LIBS option if it is enabled
if(WINDOWS AND COMPILER_GCC AND SFML_USE_STATIC_STD_LIBS)
if(NOT GCC_VERSION VERSION_LESS "4")
set_target_properties(${target} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++")
endif()
endif()
# link the target to its SFML dependencies
if(THIS_DEPENDS)
target_link_libraries(${target} ${THIS_DEPENDS})
endif()
# add the install rule
install(TARGETS ${target}
RUNTIME DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples)
# install the example's source code
install(FILES ${THIS_SOURCES}
DESTINATION ${INSTALL_MISC_DIR}/examples/${target}
COMPONENT examples)
# install the example's resources as well
set(EXAMPLE_RESOURCES "${CMAKE_SOURCE_DIR}/examples/${target}/resources")
if(EXISTS ${EXAMPLE_RESOURCES})
install(DIRECTORY ${EXAMPLE_RESOURCES}
DESTINATION ${INSTALL_MISC_DIR}/examples/${target}
COMPONENT examples)
endif()
endmacro()
# add a new target which is a SFML example