Browse Source

Thorough CMakeLists cleanup.

* Explicitly installing header files instead of recursive glob (some
   header are internal, thus no need to install them).
 * Calling enable_testing() only in project root.
 * Using MAGNUM_LIBRARIES instead of specifying all dependencies
   explicitly.
 * Using CORRADE_CXX_FLAGS instead of our own (heavily outdated) set.
 * Removed FindMagnumPlugins.cmake, the module does essentially nothing.
 * Various reorganization and cleanup.
pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
193c03759a
  1. 24
      src/Plugins/TgaImporter/CMakeLists.txt

24
src/Plugins/TgaImporter/CMakeLists.txt

@ -1,16 +1,22 @@
add_library(TgaImporterObjects OBJECT TgaImporter.cpp)
set(TgaImporter_SRCS
TgaImporter.cpp)
set(TgaImporter_HEADERS
TgaImporter.h)
add_library(TgaImporterObjects OBJECT ${TgaImporter_SRCS})
set_target_properties(TgaImporterObjects PROPERTIES COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
corrade_add_plugin(TgaImporter ${MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR} TgaImporter.conf $<TARGET_OBJECTS:TgaImporterObjects> pluginRegistrationTgaImporter.cpp)
target_link_libraries(TgaImporter ${MAGNUM_LIBRARY})
corrade_add_plugin(TgaImporter ${MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR}
TgaImporter.conf
$<TARGET_OBJECTS:TgaImporterObjects>
pluginRegistrationTgaImporter.cpp)
target_link_libraries(TgaImporter ${MAGNUM_LIBRARIES})
install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter)
if(BUILD_TESTS)
add_library(TgaImporterTestLib $<TARGET_OBJECTS:TgaImporterObjects>)
target_link_libraries(TgaImporterTestLib ${MAGNUM_LIBRARY} ${CORRADE_UTILITY_LIBRARY} ${CORRADE_PLUGINMANAGER_LIBRARY})
enable_testing()
target_link_libraries(TgaImporterTestLib ${MAGNUM_LIBRARIES})
add_subdirectory(Test)
endif()
if(WIN32)
target_link_libraries(TgaImporter ${CORRADE_UTILITY_LIBRARY} ${CORRADE_PLUGINMANAGER_LIBRARY})
endif()

Loading…
Cancel
Save