Compare commits

...

1 commit

Author SHA1 Message Date
Lukas Dürrenberger a328e24536 Add CMake options to install examples and documentation separately. 2015-03-28 23:36:23 +01:00
4 changed files with 47 additions and 29 deletions

View file

@ -63,9 +63,21 @@ else()
set(SFML_BUILD_EXAMPLES FALSE)
endif()
# add options for installing the examples
if(SFML_BUILD_EXAMPLES)
sfml_set_option(SFML_INSTALL_EXAMPLES FALSE BOOL "TRUE to install the SFML examples, FALSE to leave them in the build directory")
sfml_set_option(SFML_INSTALL_EXAMPLES_PREFIX ${INSTALL_MISC_DIR} PATH "Install path prefix, prepended onto example install directory")
endif()
# add an option for building the API documentation
sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
# add option for installing the API documentation
if(SFML_BUILD_DOC)
sfml_set_option(SFML_INSTALL_DOC FALSE BOOL "TRUE to install the SFML API documentation, FALSE to leave them in the build directory")
sfml_set_option(SFML_INSTALL_DOC_PREFIX ${INSTALL_MISC_DIR} PATH "Install path prefix, prepended onto the documentation install directory")
endif()
# add an option for choosing the OpenGL implementation
sfml_set_option(SFML_OPENGL_ES ${OPENGL_ES} BOOL "TRUE to use an OpenGL ES implementation, FALSE to use a desktop OpenGL implementation")
@ -275,8 +287,8 @@ else()
COMPONENT devel)
endif()
install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR})
install(FILES readme.txt DESTINATION ${INSTALL_MISC_DIR})
install(FILES license.txt DESTINATION ./)
install(FILES readme.txt DESTINATION ./)
if(NOT SFML_OS_ANDROID)
install(FILES cmake/Modules/FindSFML.cmake DESTINATION ${INSTALL_MISC_DIR}/cmake/Modules)
endif()

View file

@ -157,22 +157,24 @@ macro(sfml_add_example target)
target_link_libraries(${target} ${THIS_DEPENDS})
endif()
# add the install rule
install(TARGETS ${target}
RUNTIME DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples
BUNDLE DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples)
if(SFML_INSTALL_EXAMPLES)
# add the install rule
install(TARGETS ${target}
RUNTIME DESTINATION ${SFML_INSTALL_EXAMPLES_PREFIX}/examples/${target} COMPONENT examples
BUNDLE DESTINATION ${SFML_INSTALL_EXAMPLES_PREFIX}/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}
# install the example's source code
install(FILES ${THIS_SOURCES}
DESTINATION ${SFML_INSTALL_EXAMPLES_PREFIX}/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 ${SFML_INSTALL_EXAMPLES_PREFIX}/examples/${target}
COMPONENT examples)
endif()
endif()
endmacro()

View file

@ -51,12 +51,14 @@ add_custom_target(doc ALL
COMMAND ${CMAKE_COMMAND} -E echo "Done."
WORKING_DIRECTORY ${DOXYGEN_INPUT_DIR})
# setup install rules
install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html
DESTINATION ${INSTALL_MISC_DIR}/doc
COMPONENT doc)
if(DOXYGEN_HHC_PROGRAM)
install(FILES ${DOXYGEN_OUTPUT_DIR}/sfml.chm
DESTINATION ${INSTALL_MISC_DIR}/doc
if(SFML_INSTALL_DOC)
# setup install rules
install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html
DESTINATION ${SFML_INSTALL_DOC_PREFIX}/doc
COMPONENT doc)
if(DOXYGEN_HHC_PROGRAM)
install(FILES ${DOXYGEN_OUTPUT_DIR}/sfml.chm
DESTINATION ${SFML_INSTALL_DOC_PREFIX}/doc
COMPONENT doc)
endif()
endif()

View file

@ -51,10 +51,12 @@ foreach(XIB ${XIBS})
# deactivated options: --warnings --notices
endforeach()
# add install rule
install(TARGETS cocoa
BUNDLE DESTINATION ${INSTALL_MISC_DIR}/examples/cocoa
COMPONENT examples)
if(SFML_INSTALL_EXAMPLES)
# add install rule
install(TARGETS cocoa
BUNDLE DESTINATION ${SFML_INSTALL_EXAMPLES_PREFIX}/examples/cocoa
COMPONENT examples)
endif()
#
# define the cocoa target