]> granicus.if.org Git - graphviz/commitdiff
CMake: fix: find the LTDL package only if the enable_ltdl option is ON
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Fri, 13 Aug 2021 13:32:22 +0000 (15:32 +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

There is another problem when the LTDL library is not available that
will be fixed in an upcoming commit, hence no changelog entry yet.

CMakeLists.txt

index 9d3a27af3b37feec27cde591d155eb5040714ac6..c7c393221cb387ad209ae79d84972b9485237b32 100644 (file)
@@ -87,7 +87,11 @@ find_package(ANN)
 find_package(Cairo)
 find_package(EXPAT)
 find_package(GD)
-find_package(LTDL)
+
+if(enable_ltdl)
+  find_package(LTDL)
+endif (enable_ltdl)
+
 find_package(PangoCairo)
 find_package(ZLIB)