Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
bae9c0e4eThis file is pinned to the selected release. Download the original to open it in your design tool.
# Ignore subsequent calls (https://github.com/LibrePCB/LibrePCB/issues/1812)
if(TARGET polyclipping)
return()
endif()
# Find bundled submodule
set(POLYCLIPPING_SUBMODULE_BASEPATH "${PROJECT_SOURCE_DIR}/libs/polyclipping")
if(EXISTS "${POLYCLIPPING_SUBMODULE_BASEPATH}"
AND NOT UNBUNDLE_POLYCLIPPING
AND NOT UNBUNDLE_ALL
)
message(STATUS "Using vendored Polyclipping")
# Add library
add_subdirectory(
"${POLYCLIPPING_SUBMODULE_BASEPATH}"
"${CMAKE_BINARY_DIR}/libs/polyclipping" EXCLUDE_FROM_ALL
)
# Stop here, we're done
set(Polyclipping_FOUND TRUE)
return()
endif()
# Otherwise, try to find shared library on the system via pkg-config
find_package(PkgConfig QUIET)
if(PKGCONFIG_FOUND)
pkg_check_modules(Polyclipping GLOBAL IMPORTED_TARGET polyclipping)
endif()
if(Polyclipping_FOUND)
message(STATUS "Using system Polyclipping (via pkg-config)")
add_library(Polyclipping::Polyclipping ALIAS PkgConfig::Polyclipping)
return()
endif()
message(FATAL_ERROR "Did not find Polyclipping system library via pkg-config")