From: Magnus Jacobsson Date: Sun, 4 Oct 2020 08:51:02 +0000 (+0200) Subject: Refactor to use CMAKE_PREFIX_PATH X-Git-Tag: 2.46.0~20^2^2~47^2~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ec58621e03aae5d8a16502b85371d88363235c2;p=graphviz Refactor to use CMAKE_PREFIX_PATH --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a2e87e23..49476553a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,8 +71,7 @@ set(GVPLUGIN_CONFIG_FILE config${GRAPHVIZ_PLUGIN_VERSION}) # ============================ Library dependencies ============================ if (WIN32) - list(APPEND CMAKE_LIBRARY_PATH ${WINDOWS_DEPENDENCY_DIR}/lib) - list(APPEND CMAKE_INCLUDE_PATH ${WINDOWS_DEPENDENCY_DIR}/include ${WINDOWS_DEPENDENCY_DIR}/bin) + list(APPEND CMAKE_PREFIX_PATH ${WINDOWS_DEPENDENCY_DIR}) else() list(APPEND CMAKE_INCLUDE_PATH /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu) endif() @@ -94,9 +93,9 @@ if (WIN32) find_package(RxSpencer REQUIRED) # Find DLLs on Windows - find_file(EXPAT_RUNTIME_LIBRARIES NAMES libexpat.dll expat.dll) + find_program(EXPAT_RUNTIME_LIBRARIES NAMES libexpat.dll expat.dll) if (CMAKE_CL_64) - find_file(MSYS_RUNTIME_LIBRARIES NAMES msys-2.0.dll) + find_program(MSYS_RUNTIME_LIBRARIES NAMES msys-2.0.dll) endif() endif() diff --git a/cmake/FindANN.cmake b/cmake/FindANN.cmake index fa9dcf294..9c20ef97a 100644 --- a/cmake/FindANN.cmake +++ b/cmake/FindANN.cmake @@ -1,6 +1,6 @@ find_path(ANN_INCLUDE_DIR ANN/ANN.h) find_library(ANN_LIBRARY NAMES ANN ann libann) -find_file(ANN_RUNTIME_LIBRARY ANN.dll) +find_program(ANN_RUNTIME_LIBRARY ANN.dll) include(FindPackageHandleStandardArgs) if (WIN32) diff --git a/cmake/FindCairo.cmake b/cmake/FindCairo.cmake index 0cc48eff2..dce05ea96 100644 --- a/cmake/FindCairo.cmake +++ b/cmake/FindCairo.cmake @@ -5,10 +5,10 @@ if (WIN32) find_library(Cairo_LIBRARY NAMES cairo) - find_file(Cairo_RUNTIME_LIBRARY NAMES cairo.dll) - find_file(EXPAT_RUNTIME_LIBRARY NAMES expat.dll) - find_file(FONTCONFIG_RUNTIME_LIBRARY NAMES fontconfig.dll) - find_file(PIXMAN_RUNTIME_LIBRARY NAMES pixman-1.dll) + find_program(Cairo_RUNTIME_LIBRARY NAMES cairo.dll) + find_program(EXPAT_RUNTIME_LIBRARY NAMES expat.dll) + find_program(FONTCONFIG_RUNTIME_LIBRARY NAMES fontconfig.dll) + find_program(PIXMAN_RUNTIME_LIBRARY NAMES pixman-1.dll) find_package_handle_standard_args(Cairo DEFAULT_MSG Cairo_INCLUDE_DIR diff --git a/cmake/FindGD.cmake b/cmake/FindGD.cmake index efdf66ff1..67325ce2f 100644 --- a/cmake/FindGD.cmake +++ b/cmake/FindGD.cmake @@ -1,6 +1,6 @@ find_path(GD_INCLUDE_DIR gd.h) find_library(GD_LIBRARY NAMES gd libgd) -find_file(GD_RUNTIME_LIBRARY libgd.dll) +find_program(GD_RUNTIME_LIBRARY libgd.dll) include(FindPackageHandleStandardArgs) if (WIN32) diff --git a/cmake/FindPangoCairo.cmake b/cmake/FindPangoCairo.cmake index 7e9d3b362..0937e41ef 100644 --- a/cmake/FindPangoCairo.cmake +++ b/cmake/FindPangoCairo.cmake @@ -10,13 +10,13 @@ if (WIN32) find_library(PANGO_LIBRARY NAMES pango-1.0) find_library(PangoCairo_LIBRARY NAMES pangocairo-1.0) - find_file(GLIB_RUNTIME_LIBRARY NAMES glib-2.dll) - find_file(GOBJECT_RUNTIME_LIBRARY NAMES gobject-2.dll) - find_file(HARFBUZZ_RUNTIME_LIBRARY NAMES libharfbuzz-0.dll) - find_file(PANGO_RUNTIME_LIBRARY NAMES pango-1.dll) - find_file(PangoCairo_RUNTIME_LIBRARY NAMES pangocairo-1.dll) - find_file(PANGOFT_RUNTIME_LIBRARY NAMES pangoft2-1.dll) - find_file(PANGOWIN_RUNTIME_LIBRARY NAMES pangowin32-1.dll) + find_program(GLIB_RUNTIME_LIBRARY NAMES glib-2.dll) + find_program(GOBJECT_RUNTIME_LIBRARY NAMES gobject-2.dll) + find_program(HARFBUZZ_RUNTIME_LIBRARY NAMES libharfbuzz-0.dll) + find_program(PANGO_RUNTIME_LIBRARY NAMES pango-1.dll) + find_program(PangoCairo_RUNTIME_LIBRARY NAMES pangocairo-1.dll) + find_program(PANGOFT_RUNTIME_LIBRARY NAMES pangoft2-1.dll) + find_program(PANGOWIN_RUNTIME_LIBRARY NAMES pangowin32-1.dll) find_package_handle_standard_args(PangoCairo DEFAULT_MSG GLIB_INCLUDE_DIR