From 71d9047b87473b9f7a0bfb02492d989fb9c83852 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 28 Jun 2016 12:46:22 +0200 Subject: [PATCH] Move add_definition before collect cgal library (bugfix) --- CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt | 3 +-- GraphicsView/src/CGAL_Qt5/CMakeLists.txt | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt b/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt index 01e96863032..8194bfb22d1 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt +++ b/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt @@ -24,6 +24,7 @@ if (CGAL_HEADER_ONLY) else() include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} .) link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) + add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_ImageIO_3RD_PARTY_DEFINITIONS} ) endif() collect_cgal_library( CGAL_ImageIO "") @@ -32,8 +33,6 @@ if (NOT CGAL_HEADER_ONLY) add_dependencies( CGAL_ImageIO CGAL ) - add_definitions( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_ImageIO_3RD_PARTY_DEFINITIONS} ) - # CGAL_ImageIO only depends on CGAL in DEBUG, but we still link it # in both build types. target_link_libraries( CGAL_ImageIO CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ) diff --git a/GraphicsView/src/CGAL_Qt5/CMakeLists.txt b/GraphicsView/src/CGAL_Qt5/CMakeLists.txt index 6062f817cec..30ce0edd816 100644 --- a/GraphicsView/src/CGAL_Qt5/CMakeLists.txt +++ b/GraphicsView/src/CGAL_Qt5/CMakeLists.txt @@ -79,6 +79,8 @@ else(CGAL_HEADER_ONLY) include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS} ) link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) + + add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} ) endif(CGAL_HEADER_ONLY) collect_cgal_library( CGAL_Qt5 "${additional_files}") @@ -89,11 +91,9 @@ if (NOT CGAL_HEADER_ONLY) add_dependencies( CGAL_Qt5 CGAL ) - # CGAL_Qt5 only depends on CGAL in DEBUG, but we still link it in - # both build types. - target_link_libraries( CGAL_Qt5 CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt5_3RD_PARTY_LIBRARIES} ) - - add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} ) + # CGAL_Qt5 only depends on CGAL in DEBUG, but we still link it in + # both build types. + target_link_libraries( CGAL_Qt5 CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt5_3RD_PARTY_LIBRARIES} ) else()