diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 0f8f5b2c2..c145eded0 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -248,14 +248,16 @@ if (NOT TARGET ${_cgal_tgt}) set (_cgal_tgt CGAL::CGAL) endif () get_target_property(_opts ${_cgal_tgt} INTERFACE_COMPILE_OPTIONS) -set(_opts_bad "${_opts}") -set(_opts_good "${_opts}") -list(FILTER _opts_bad INCLUDE REGEX frounding-math) -list(FILTER _opts_good EXCLUDE REGEX frounding-math) -set_target_properties(${_cgal_tgt} PROPERTIES INTERFACE_COMPILE_OPTIONS "${_opts_good}") +if (_opts) + set(_opts_bad "${_opts}") + set(_opts_good "${_opts}") + list(FILTER _opts_bad INCLUDE REGEX frounding-math) + list(FILTER _opts_good EXCLUDE REGEX frounding-math) + set_target_properties(${_cgal_tgt} PROPERTIES INTERFACE_COMPILE_OPTIONS "${_opts_good}") + target_compile_options(libslic3r_cgal PRIVATE "${_opts_bad}") +endif() target_link_libraries(libslic3r_cgal PRIVATE ${_cgal_tgt} libigl) -target_compile_options(libslic3r_cgal PRIVATE "${_opts_bad}") encoding_check(libslic3r)