From: Magnus Jacobsson Date: Mon, 14 Sep 2020 21:34:49 +0000 (+0200) Subject: Fix lib/pack objs not included in lib/gvc dynamic lib for CMake builds X-Git-Tag: 2.46.0~20^2^2~68^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81b8e7a6bc08b885b79d5af73301fc1d41613172;p=graphviz Fix lib/pack objs not included in lib/gvc dynamic lib for CMake builds This is what the autotools builds do. For some reason this was not a problem on Windows. Without this, the rtest/test_examples.py gave errors like this for neatopack.c: neatopack.c:(.text+0x81): undefined reference to `ccomps' --- diff --git a/lib/gvc/CMakeLists.txt b/lib/gvc/CMakeLists.txt index ed4cbab2e..1db89a0ab 100644 --- a/lib/gvc/CMakeLists.txt +++ b/lib/gvc/CMakeLists.txt @@ -51,13 +51,13 @@ target_include_directories(gvc PRIVATE target_link_libraries(gvc PRIVATE $ + $ ) target_link_libraries(gvc PUBLIC cdt cgraph label - pack pathplan xdot ${EXPAT_LIBRARIES} diff --git a/lib/pack/CMakeLists.txt b/lib/pack/CMakeLists.txt index 54dc9523a..87d6d0cc8 100644 --- a/lib/pack/CMakeLists.txt +++ b/lib/pack/CMakeLists.txt @@ -1,6 +1,6 @@ add_definitions(-DGVC_EXPORTS) -add_library(pack STATIC +add_library(pack_obj OBJECT # Header files pack.h @@ -9,7 +9,7 @@ add_library(pack STATIC pack.c ) -target_include_directories(pack PRIVATE +target_include_directories(pack_obj PRIVATE ${GRAPHVIZ_LIB_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${GRAPHVIZ_LIB_DIR}/cdt @@ -20,6 +20,10 @@ target_include_directories(pack PRIVATE ${GRAPHVIZ_LIB_DIR}/pathplan ) +add_library(pack STATIC + $ +) + # Specify headers to be installed install( FILES pack.h