From 511f103430e953e1e67ec0ae29dc671dd6a9303d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 10 Jun 2015 02:04:41 +0200 Subject: [PATCH] Make APPLICATION_LINK_TO_OPENSPACE actually include the libOpenSpace and Ghoul as well --- support/cmake/support_macros.cmake | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 6b703962a2..bf3a1d45c0 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -192,6 +192,29 @@ function (handle_applications) unset(APPLICATION_LINK_TO_OPENSPACE) include(${OPENSPACE_APPS_DIR}/${app}/CMakeLists.txt) set_compile_settings(${APPLICATION_NAME}) + + if (APPLICATION_LINK_TO_OPENSPACE) + get_property( + OPENSPACE_INCLUDE_DIR + TARGET libOpenSpace + PROPERTY INTERFACE_INCLUDE_DIRECTORIES + ) + target_include_directories(${APPLICATION_NAME} PUBLIC + "${OPENSPACE_BASE_DIR}" + ${OPENSPACE_INCLUDE_DIR} + ) + + get_property( + OPENSPACE_DEFINES + TARGET libOpenSpace + PROPERTY INTERFACE_COMPILE_DEFINITIONS + ) + target_compile_definitions(${APPLICATION_NAME} PUBLIC ${OPENSPACE_DEFINES}) + + target_link_libraries(${APPLICATION_NAME} Ghoul) + target_link_libraries(${APPLICATION_NAME} libOpenSpace) + endif () + list(APPEND applications ${APPLICATION_NAME}) list(APPEND applications_link_to_openspace ${APPLICATION_LINK_TO_OPENSPACE}) unset(APPLICATION_NAME) @@ -362,7 +385,7 @@ function (handle_internal_modules) list(GET OPENSPACE_APPLICATIONS ${val} val1) list(GET OPENSPACE_APPLICATIONS_LINK_REQUEST ${val} val2) if (${val2}) - target_link_libraries(${app} ${libraryName}) + target_link_libraries(${app} ${libraryName}) endif () endforeach()