From 193c03759af146c7b727ced149504cc5c5858c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Mar 2013 14:32:06 +0100 Subject: [PATCH] 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. --- src/Plugins/TgaImporter/CMakeLists.txt | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/Plugins/TgaImporter/CMakeLists.txt b/src/Plugins/TgaImporter/CMakeLists.txt index e0ccbebd4..cc3cef88c 100644 --- a/src/Plugins/TgaImporter/CMakeLists.txt +++ b/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 $ pluginRegistrationTgaImporter.cpp) -target_link_libraries(TgaImporter ${MAGNUM_LIBRARY}) +corrade_add_plugin(TgaImporter ${MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR} + TgaImporter.conf + $ + 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_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()