From e614cd292f19f2e37dad7364f9a4ddf826a91b3a Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 26 Sep 2012 21:29:45 +0000 Subject: [PATCH] Why is this all so ugly? Bugfix: Only add a target library if there is one... git-svn-id: https://svn.dealii.org/branches/branch_cmake@26765 0785d39b-7218-0410-832d-ea1e28bc413d --- .../macros/macro_deal_ii_setup_target.cmake | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/deal.II/cmake/macros/macro_deal_ii_setup_target.cmake b/deal.II/cmake/macros/macro_deal_ii_setup_target.cmake index c917f38e67..022df90310 100644 --- a/deal.II/cmake/macros/macro_deal_ii_setup_target.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_setup_target.cmake @@ -30,16 +30,28 @@ MACRO(DEAL_II_SETUP_TARGET target) "${DEAL_II_USER_DEFINITIONS_RELEASE}" ) - TARGET_LINK_LIBRARIES(${target} - debug - ${DEAL_II_LIBRARIES_DEBUG} - ${DEAL_II_EXTERNAL_LIBRARIES_DEBUG} - optimized - ${DEAL_II_LIBRARIES_RELEASE} - ${DEAL_II_EXTERNAL_LIBRARIES_RELEASE} - general - ${DEAL_II_EXTERNAL_LIBRARIES} - ) + IF(NOT "${DEAL_II_LIBRARIES_DEBUG}${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}" STREQUAL "") + TARGET_LINK_LIBRARIES(${target} + debug + ${DEAL_II_LIBRARIES_DEBUG} + ${DEAL_II_EXTERNAL_LIBRARIES_DEBUG} + ) + ENDIF() + + IF(NOT "${DEAL_II_LIBRARIES_RELEASE}${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}" STREQUAL "") + TARGET_LINK_LIBRARIES(${target} + optimized + ${DEAL_II_LIBRARIES_RELEASE} + ${DEAL_II_EXTERNAL_LIBRARIES_RELEASE} + ) + ENDIF() + + IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES}" STREQUAL "") + TARGET_LINK_LIBRARIES(${target} + general + ${DEAL_II_EXTERNAL_LIBRARIES} + ) + ENDIF() ENDMACRO() -- 2.39.5