diff --git a/Installation/cmake/modules/CGAL_SetupGMP.cmake b/Installation/cmake/modules/CGAL_SetupGMP.cmake index ecd3fe59104..a4251aaa258 100644 --- a/Installation/cmake/modules/CGAL_SetupGMP.cmake +++ b/Installation/cmake/modules/CGAL_SetupGMP.cmake @@ -54,6 +54,11 @@ function(use_CGAL_GMP_support target) return() endif() - target_include_directories(${target} SYSTEM ${keyword} ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR} ${MPFR_INCLUDE_DIR}) - target_link_libraries(${target} ${keyword} ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} ${MPFR_LIBRARIES}) + target_include_directories(${target} SYSTEM ${keyword} ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR}) + target_link_libraries(${target} ${keyword} ${GMP_LIBRARIES} ${MPFR_LIBRARIES}) + if(WITH_GMPXX OR CGAL_WITH_GMPXX) + target_include_directories(${target} SYSTEM ${keyword} ${GMPXX_INCLUDE_DIR}) + target_link_libraries(${target} ${keyword} ${GMPXX_LIBRARIES}) + target_compile_definitions(${target} ${keyword} CGAL_USE_GMPXX=1) + endif() endfunction()