c754483
diff --git a/openscad.pro b/openscad.pro
c754483
index a2eefe6..20b1864 100644
c754483
--- a/openscad.pro
c754483
+++ b/openscad.pro
c754483
@@ -440,8 +440,7 @@ SOURCES += src/version_check.cc \
c754483
            src/LibraryInfoDialog.cc
c754483
 
c754483
 # ClipperLib
c754483
-SOURCES += src/polyclipping/clipper.cpp
c754483
-HEADERS += src/polyclipping/clipper.hpp
c754483
+LIBS += -lpolyclipping
c754483
 
c754483
 # libtess2
c754483
 INCLUDEPATH += src/libtess2/Include
c754483
diff --git a/src/clipper-utils.h b/src/clipper-utils.h
c754483
index 0dc7cd0..c98cda0 100644
c754483
--- a/src/clipper-utils.h
c754483
+++ b/src/clipper-utils.h
c754483
@@ -1,6 +1,6 @@
c754483
 #pragma once
c754483
 
c754483
-#include "polyclipping/clipper.hpp"
c754483
+#include <polyclipping/clipper.hpp>
c754483
 #include "Polygon2d.h"
c754483
 
c754483
 namespace ClipperUtils {
c754483
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
c754483
index 93658a0..a852ef6 100644
c754483
--- a/tests/CMakeLists.txt
c754483
+++ b/tests/CMakeLists.txt
c754483
@@ -705,7 +705,6 @@ set(COMMON_SOURCES
c754483
   ../src/GeometryCache.cc 
c754483
   ../src/clipper-utils.cc 
c754483
   ../src/Tree.cc
c754483
-  ../src/polyclipping/clipper.cpp
c754483
   ../src/libtess2/Source/bucketalloc.c
c754483
   ../src/libtess2/Source/dict.c
c754483
   ../src/libtess2/Source/geom.c
c754483
@@ -786,14 +785,14 @@ target_link_libraries(csgtexttest tests-nocgal ${GLEW_LIBRARY} ${OPENCSG_LIBRARY
c754483
 #
c754483
 add_executable(cgalcachetest cgalcachetest.cc)
c754483
 set_target_properties(cgalcachetest PROPERTIES COMPILE_FLAGS "-DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
c754483
-target_link_libraries(cgalcachetest tests-cgal ${GLEW_LIBRARY} ${OPENCSG_LIBRARY} ${APP_SERVICES_LIBRARY})
c754483
+target_link_libraries(cgalcachetest tests-cgal -lpolyclipping ${GLEW_LIBRARY} ${OPENCSG_LIBRARY} ${APP_SERVICES_LIBRARY})
c754483
 
c754483
 #
c754483
 # openscad no-qt
c754483
 #
c754483
 add_executable(openscad_nogui ../src/openscad.cc)
c754483
 set_target_properties(openscad_nogui PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -DEIGEN_DONT_ALIGN ${ENABLE_OPENCSG_FLAG} -DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
c754483
-target_link_libraries(openscad_nogui tests-offscreen tests-cgal ${GLEW_LIBRARY} ${OPENCSG_LIBRARY} ${APP_SERVICES_LIBRARY})
c754483
+target_link_libraries(openscad_nogui tests-offscreen tests-cgal -lX11 -lpolyclipping ${GLEW_LIBRARY} ${OPENCSG_LIBRARY} ${APP_SERVICES_LIBRARY})
c754483
 
c754483
 # also run translation compilation to verify the files are without syntax errors
c754483
 add_custom_target(locale_files ALL COMMAND ${CMAKE_SOURCE_DIR}/../scripts/translation-make.sh)