diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 864ea96f8aad2f52e712c864fc0ec4a4d0ccc834..a717eedc29c3f76cce57f5e2b1503747411fcda6 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -164,18 +164,19 @@ add_definitions(${BOEHMGC_DEFINITIONS}) # Check for system-wide version of 2geom and fallback to internal copy if not found if(NOT WITH_INTERNAL_2GEOM) - find_package(2Geom 1.0.0 QUIET) - if(NOT 2Geom_FOUND) - pkg_check_modules(2Geom QUIET IMPORTED_TARGET GLOBAL 2geom>=1.0.0) - if(2Geom_FOUND) - add_library(2Geom::2geom ALIAS PkgConfig::2Geom) - endif() + pkg_check_modules(2Geom QUIET IMPORTED_TARGET GLOBAL 2geom>=1.0.0) + if(2Geom_FOUND) + add_library(2Geom::2geom ALIAS PkgConfig::2Geom) endif() if(NOT 2Geom_FOUND) set(WITH_INTERNAL_2GEOM ON CACHE BOOL "Prefer internal copy of lib2geom" FORCE) message(STATUS "lib2geom not found, using internal copy in src/3rdparty/2geom") endif() endif() +if(WITH_INTERNAL_2GEOM) + set(2Geom_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/2geom/include) +endif() + if(ENABLE_POPPLER) find_package(PopplerCairo) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5cf1a2e8aa057c85ff406892f07cf321cb6fc57a..5fafd26aa7ac15f948604b0849b372ebd9b1885f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -381,10 +381,11 @@ target_link_libraries(inkscape_base PUBLIC Boost::filesystem) target_link_libraries(inkscape_base PRIVATE ${INKSCAPE_TARGET_LIBS} - PUBLIC 2Geom::2geom + INTERFACE ${INKSCAPE_LIBS} ) +target_include_directories(inkscape_base INTERFACE ${2Geom_INCLUDE_DIRS}) # Link inkscape and inkview against inkscape_base target_link_libraries(inkscape inkscape_base) diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index 7d4627edaf3526e07b06625e9357a3eac3d2b5d5..65287edb7285c88cfd9e2a759548937c65283baf 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -85,7 +85,7 @@ foreach(test_source ${TEST_SOURCES}) string(REPLACE "-test" "" testname "test_${test_source}") add_executable(${testname} src/${test_source}.cpp) target_include_directories(${testname} SYSTEM PRIVATE ${GTEST_INCLUDE_DIRS}) - target_link_libraries(${testname} cpp_test_static_library) + target_link_libraries(${testname} cpp_test_static_library 2Geom::2geom) add_test(NAME ${testname} COMMAND ${testname}) set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${INKSCAPE_TEST_PROFILE_DIR_ENV}/${testname};${CMAKE_CTEST_ENV}") add_dependencies(tests ${testname})