From 746b4eb692ce4d07ece059c456d220f0d491f719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 28 Jul 2014 23:01:49 +0200 Subject: [PATCH] Platform: specify dependencies for Application libs on single place. --- CMakeLists.txt | 3 +-- src/Magnum/Platform/CMakeLists.txt | 8 ++++++-- src/Magnum/Text/CMakeLists.txt | 6 +++--- src/Magnum/TextureTools/CMakeLists.txt | 6 +++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34e71f6b3..cf29c4e72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,8 +168,7 @@ endif() if(BUILD_GL_TESTS) if(UNIX AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)) set(WITH_WINDOWLESSGLXAPPLICATION ON) - find_package(X11 REQUIRED) - set(GL_TEST_LIBRARIES Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES}) + set(GL_TEST_LIBRARIES Magnum MagnumWindowlessGlxApplication) else() message(FATAL_ERROR "Cannot run tests for OpenGL code on this platform. Set BUILD_GL_TESTS to OFF to skip building them.") endif() diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 09087aca0..30fa74ab2 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -108,6 +108,7 @@ if(WITH_WINDOWLESSNACLAPPLICATION) add_library(MagnumWindowlessNaClApplication STATIC WindowlessNaClApplication.cpp) set_target_properties(MagnumWindowlessNaClApplication PROPERTIES DEBUG_POSTFIX "-d") + target_link_libraries(MagnumWindowlessNaClApplication Magnum ppapi_cpp ppapi) install(FILES WindowlessNaClApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessNaClApplication RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -171,6 +172,7 @@ if(WITH_WINDOWLESSGLXAPPLICATION) set_target_properties(MagnumWindowlessGlxApplication PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast" DEBUG_POSTFIX "-d") + target_link_libraries(MagnumWindowlessGlxApplication Magnum ${X11_LIBRARIES}) install(FILES WindowlessGlxApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessGlxApplication RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -184,6 +186,7 @@ if(WITH_WINDOWLESSWGLAPPLICATION) set_target_properties(MagnumWindowlessWglApplication PROPERTIES COMPILE_FLAGS "-DUNICODE" DEBUG_POSTFIX "-d") + target_link_libraries(MagnumWindowlessWglApplication Magnum) install(FILES WindowlessWglApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessWglApplication RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -194,6 +197,7 @@ endif() # Windowless CGL application if(WITH_WINDOWLESSCGLAPPLICATION) add_library(MagnumWindowlessCglApplication STATIC WindowlessCglApplication.cpp) + target_link_libraries(MagnumWindowlessCglApplication Magnum) install(FILES WindowlessCglApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessCglApplication RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -235,9 +239,9 @@ if(WITH_MAGNUMINFO) if(CORRADE_TARGET_APPLE) target_link_libraries(magnum-info MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_NACL) - target_link_libraries(magnum-info MagnumWindowlessNaClApplication ppapi_cpp ppapi) + target_link_libraries(magnum-info MagnumWindowlessNaClApplication) elseif(CORRADE_TARGET_UNIX) - target_link_libraries(magnum-info MagnumWindowlessGlxApplication ${X11_LIBRARIES}) + target_link_libraries(magnum-info MagnumWindowlessGlxApplication) elseif(CORRADE_TARGET_WINDOWS) target_link_libraries(magnum-info MagnumWindowlessWglApplication) else() diff --git a/src/Magnum/Text/CMakeLists.txt b/src/Magnum/Text/CMakeLists.txt index 5513a8d5d..6b179a817 100644 --- a/src/Magnum/Text/CMakeLists.txt +++ b/src/Magnum/Text/CMakeLists.txt @@ -68,11 +68,11 @@ if(WITH_FONTCONVERTER) add_executable(magnum-fontconverter fontconverter.cpp) if(CORRADE_TARGET_APPLE) - target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessCglApplication) + target_link_libraries(magnum-fontconverter MagnumText MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_UNIX AND NOT TARGET_GLES) - target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES}) + target_link_libraries(magnum-fontconverter MagnumText MagnumWindowlessGlxApplication) elseif(CORRADE_TARGET_WINDOWS) - target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessWglApplication) + target_link_libraries(magnum-fontconverter MagnumText MagnumWindowlessWglApplication) else() message(FATAL_ERROR "magnum-fontconverter is not available on this platform. Set WITH_FONTCONVERTER to OFF to suppress this warning.") endif() diff --git a/src/Magnum/TextureTools/CMakeLists.txt b/src/Magnum/TextureTools/CMakeLists.txt index d5ad0a28d..a6ce5b75e 100644 --- a/src/Magnum/TextureTools/CMakeLists.txt +++ b/src/Magnum/TextureTools/CMakeLists.txt @@ -57,11 +57,11 @@ if(WITH_DISTANCEFIELDCONVERTER) add_executable(magnum-distancefieldconverter distancefieldconverter.cpp) if(CORRADE_TARGET_APPLE) - target_link_libraries(magnum-distancefieldconverter MagnumTextureTools MagnumWindowlessCglApplication Magnum) + target_link_libraries(magnum-distancefieldconverter MagnumTextureTools MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_UNIX AND NOT TARGET_GLES) - target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES}) + target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication) elseif(CORRADE_TARGET_WINDOWS) - target_link_libraries(magnum-distancefieldconverter MagnumTextureTools MagnumWindowlessWglApplication Magnum) + target_link_libraries(magnum-distancefieldconverter MagnumTextureTools MagnumWindowlessWglApplication) else() message(FATAL_ERROR "magnum-distancefieldconverter is not available on this platform. Set WITH_DISTANCEFIELDCONVERTER to OFF to suppress this warning.") endif()