]> granicus.if.org Git - graphviz/commitdiff
gvc: CMake: fix: use the ltdl include dir only if we have it
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 16 Aug 2021 17:42:48 +0000 (19:42 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 23 Aug 2021 19:39:05 +0000 (21:39 +0200)
Fixes this error when we don't have ltdl:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
C:/Users/magja/graphviz/lib/gvc/LTDL_INCLUDE_DIR
   used as include directory in directory C:/Users/magja/graphviz/lib/gvc

On Windows, we currently only use the ltdl compatibility header
introduced in d70cdba7937724c19393d97bd280320cdf8c3c8f, not the link
library itself. Hence the WIN32 OR MINGW guard for the link library,
but not for the include directory.

There are other problems when the LTDL library is not available that
will be fixed in upcoming commits, hence no changelog entry yet.

lib/gvc/CMakeLists.txt

index c8d887f37992bd6d890a98346024c29172daa782..0b98780f1c05e8b5556458e0c5ac4ec3f87b6964 100644 (file)
@@ -45,7 +45,6 @@ target_include_directories(gvc PRIVATE
     ${GRAPHVIZ_LIB_DIR}/cgraph
     ${GRAPHVIZ_LIB_DIR}/common
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${LTDL_INCLUDE_DIRS}
 )
 
 target_link_libraries(gvc PRIVATE
@@ -66,6 +65,7 @@ target_link_libraries(gvc PUBLIC
 )
 
 if (LTDL_FOUND)
+    target_include_directories(gvc PRIVATE ${LTDL_INCLUDE_DIRS})
     if (NOT WIN32)
         target_link_libraries(gvc PUBLIC ${LTDL_LIBRARIES})
     endif()