Browse Source

Drop more CMake pre-3.1 compatibility.

pull/308/head
Vladimír Vondruš 7 years ago
parent
commit
f325507618
  1. 12
      doc/plugins.dox
  2. 12
      doc/snippets/CMakeLists.txt
  3. 7
      modules/FindMagnum.cmake
  4. 2
      src/MagnumPlugins/AnyAudioImporter/CMakeLists.txt
  5. 2
      src/MagnumPlugins/AnyImageConverter/CMakeLists.txt
  6. 2
      src/MagnumPlugins/AnyImageImporter/CMakeLists.txt
  7. 2
      src/MagnumPlugins/AnySceneImporter/CMakeLists.txt
  8. 2
      src/MagnumPlugins/MagnumFont/CMakeLists.txt
  9. 2
      src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt
  10. 2
      src/MagnumPlugins/ObjImporter/CMakeLists.txt
  11. 2
      src/MagnumPlugins/TgaImageConverter/CMakeLists.txt
  12. 2
      src/MagnumPlugins/TgaImporter/CMakeLists.txt
  13. 2
      src/MagnumPlugins/WavAudioImporter/CMakeLists.txt

12
doc/plugins.dox

@ -134,12 +134,12 @@ but there is no need to change the above code, as it will work for both dynamic
and static case.
The static plugin needs to be explicitly registered so the plugin manager is
aware it's there. If you use CMake 3.1 and newer it's done automatically.
Otherwise, you can achieve the same if you explicitly @cpp #include @ce the
static plugin import file (named `importStaticPlugin.cpp`, residing in plugin's
include directory) in a source file that gets compiled into your main
application. The static import file contains just a simple call to
@ref CORRADE_PLUGIN_IMPORT(), see its documentation for further information.
aware it's there. If you use CMake, it's done automatically. Otherwise, you can
achieve the same if you explicitly @cpp #include @ce the static plugin import
file (named `importStaticPlugin.cpp`, residing in plugin's include directory)
in a source file that gets compiled into your main application. The static
import file contains just a simple call to @ref CORRADE_PLUGIN_IMPORT(), see
its documentation for further information.
@snippet plugins.cpp static-import

12
doc/snippets/CMakeLists.txt

@ -165,13 +165,6 @@ if(WITH_SDL2APPLICATION)
getting-started-blue
snippets-MagnumPlatform
PROPERTIES FOLDER "Magnum/doc/snippets")
# Otherwise it's not linked correctly. I have no idea why, but whatever.
if(CMAKE_VERSION VERSION_LESS 3.0)
find_package(SDL2 REQUIRED)
target_link_libraries(getting-started PRIVATE SDL2::SDL2)
target_link_libraries(getting-started-blue PRIVATE SDL2::SDL2)
target_link_libraries(snippets-MagnumPlatform PRIVATE SDL2::SDL2)
endif()
endif()
if((NOT TARGET_GLES AND WITH_SDL2APPLICATION) OR (TARGET_GLES AND WITH_XEGLAPPLICATION))
@ -185,11 +178,6 @@ if((NOT TARGET_GLES AND WITH_SDL2APPLICATION) OR (TARGET_GLES AND WITH_XEGLAPPLI
set_target_properties(
snippets-MagnumPlatform-portability
PROPERTIES FOLDER "Magnum/doc/snippets")
# Otherwise it's not linked correctly. I have no idea why, but whatever.
if(CMAKE_VERSION VERSION_LESS 3.0)
find_package(SDL2 REQUIRED)
target_link_libraries(snippets-MagnumPlatform-portability PRIVATE SDL2::SDL2)
endif()
endif()
if(WITH_WINDOWLESSEGLAPPLICATION)

7
modules/FindMagnum.cmake

@ -889,10 +889,9 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
mark_as_advanced(_MAGNUM_${_COMPONENT}_INCLUDE_DIR)
endif()
# Automatic import of static plugins on CMake >= 3.1. Skip in case the
# include dir was not found -- that'll fail later with a proper
# message.
if(_component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS} AND NOT CMAKE_VERSION VERSION_LESS 3.1 AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR)
# Automatic import of static plugins. Skip in case the include dir was
# not found -- that'll fail later with a proper message.
if(_component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS} AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR)
# Automatic import of static plugins
file(READ ${_MAGNUM_${_COMPONENT}_INCLUDE_DIR}/configure.h _magnum${_component}Configure)
string(FIND "${_magnum${_component}Configure}" "#define MAGNUM_${_COMPONENT}_BUILD_STATIC" _magnum${_component}_BUILD_STATIC)

2
src/MagnumPlugins/AnyAudioImporter/CMakeLists.txt

@ -50,10 +50,8 @@ install(FILES AnyImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/AnyAudioImporter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(AnyAudioImporter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/AnyImageConverter/CMakeLists.txt

@ -50,10 +50,8 @@ install(FILES AnyImageConverter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/AnyImageConverter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(AnyImageConverter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/AnyImageImporter/CMakeLists.txt

@ -50,10 +50,8 @@ install(FILES AnyImageImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/AnyImageImporter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(AnyImageImporter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/AnySceneImporter/CMakeLists.txt

@ -50,10 +50,8 @@ install(FILES AnySceneImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/AnySceneImporter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(AnySceneImporter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/MagnumFont/CMakeLists.txt

@ -53,10 +53,8 @@ install(FILES MagnumFont.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFont)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(MagnumFont INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_GL_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt

@ -53,10 +53,8 @@ install(FILES MagnumFontConverter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFontConverter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(MagnumFontConverter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_GL_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/ObjImporter/CMakeLists.txt

@ -50,10 +50,8 @@ install(FILES ObjImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/ObjImporter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(ObjImporter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/TgaImageConverter/CMakeLists.txt

@ -50,10 +50,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGI
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(TgaImageConverter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/TgaImporter/CMakeLists.txt

@ -51,10 +51,8 @@ install(FILES TgaImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(TgaImporter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_TESTS)
add_subdirectory(Test)

2
src/MagnumPlugins/WavAudioImporter/CMakeLists.txt

@ -66,10 +66,8 @@ install(FILES WavImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
# Automatic static plugin import
if(BUILD_PLUGINS_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/WavAudioImporter)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
target_sources(WavAudioImporter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()
endif()
if(BUILD_TESTS)
add_subdirectory(Test)

Loading…
Cancel
Save