Fix LEDA support with gcc

This commit is contained in:
Laurent Rineau 2018-04-26 12:42:06 +02:00
parent 4f14095cb8
commit c180c0678d
1 changed files with 10 additions and 1 deletions

View File

@ -41,7 +41,16 @@ function(use_CGAL_LEDA_support target)
message(FATAL_ERROR "use_CGAL_LEDA_support is use whereas LEDA_FOUND is false.")
return()
endif()
target_compile_options(${target} ${keyword} ${LEDA_CXX_FLAGS} ${LEDA_DEFINITIONS})
separate_arguments(LIST_LEDA_CXX_FLAGS UNIX_COMMAND "${LEDA_CXX_FLAGS}")
separate_arguments(LIST_LEDA_DEFINITIONS UNIX_COMMAND "${LEDA_DEFINITIONS}")
if(CMAKE_VERSION VERSION_LESS 3.3)
target_compile_options(${target} ${keyword} ${LIST_LEDA_CXX_FLAGS})
else()
target_compile_options(${target} ${keyword} $<$<COMPILE_LANGUAGE:CXX>:${LIST_LEDA_CXX_FLAGS}>)
endif()
target_compile_options(${target} ${keyword} ${LIST_LEDA_DEFINITIONS})
target_include_directories(${target} SYSTEM ${keyword} ${LEDA_INCLUDE_DIR})
target_link_libraries(${target} ${keyword} ${LEDA_LIBRARIES} ${LEDA_LINKER_FLAGS})
endfunction()