From 81b8e7a6bc08b885b79d5af73301fc1d41613172 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Mon, 14 Sep 2020 23:34:49 +0200 Subject: [PATCH] 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' --- lib/gvc/CMakeLists.txt | 2 +- lib/pack/CMakeLists.txt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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 -- 2.40.0