From 2c5667748cb7152e96f9d53b056e3ab66393b0d5 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Fri, 9 Oct 2020 13:35:49 +0300 Subject: [PATCH] Try to fix the need for LD_LIBRARY_PATH. Patch based on an earlier one by Mc and his rework of a second version. @shlomif puts all his changes under CC0 / MITL / LGPLv2+ / GPLv2+ . The problem is that we needes to set LD_LIBRARY_PATH to contain /opt/inkscape-trunk/lib/ or similar before running: /opt/inkscape-trunk/bin/inkscape ~/Download/Images/Art/Computer/test1.svg or similar. --- CMakeScripts/DefineDependsandFlags.cmake | 13 +++++++------ src/CMakeLists.txt | 3 ++- testfiles/CMakeLists.txt | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 864ea96f8a..a717eedc29 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 5cf1a2e8aa..5fafd26aa7 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 7d4627edaf..65287edb72 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}) -- GitLab