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'
target_link_libraries(gvc PRIVATE
$<TARGET_OBJECTS:common_obj>
+ $<TARGET_OBJECTS:pack_obj>
)
target_link_libraries(gvc PUBLIC
cdt
cgraph
label
- pack
pathplan
xdot
${EXPAT_LIBRARIES}
add_definitions(-DGVC_EXPORTS)
-add_library(pack STATIC
+add_library(pack_obj OBJECT
# Header files
pack.h
pack.c
)
-target_include_directories(pack PRIVATE
+target_include_directories(pack_obj PRIVATE
${GRAPHVIZ_LIB_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${GRAPHVIZ_LIB_DIR}/cdt
${GRAPHVIZ_LIB_DIR}/pathplan
)
+add_library(pack STATIC
+ $<TARGET_OBJECTS:pack_obj>
+)
+
# Specify headers to be installed
install(
FILES pack.h