]> granicus.if.org Git - graphviz/commitdiff
CMake: [nfc] uppercase 'Cairo_*' variables
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 31 Jan 2022 06:57:50 +0000 (17:57 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 1 Feb 2022 04:28:49 +0000 (15:28 +1100)
Upcoming changes that introduce `cmake-format` checks complain that these
identifiers do not comply with `[A-Z][0-9A-Z_]+|_[0-9a-z_]+`.

CMakeLists.txt
cmake/FindCAIRO.cmake [new file with mode: 0644]
cmake/FindCairo.cmake [deleted file]
plugin/pango/CMakeLists.txt

index 52a0281aa337659fbc2cffff826427cf6b4aadf6..74d35cc6fb8651b797764467b25cfa2ea92cf5fa 100644 (file)
@@ -100,7 +100,7 @@ if(WIN32)
 endif()
 
 find_package(ANN)
-find_package(Cairo)
+find_package(CAIRO)
 
 if(with_expat)
   find_package(EXPAT)
diff --git a/cmake/FindCAIRO.cmake b/cmake/FindCAIRO.cmake
new file mode 100644 (file)
index 0000000..6c7ba9e
--- /dev/null
@@ -0,0 +1,51 @@
+include(FindPackageHandleStandardArgs)
+
+if(WIN32)
+    find_path(CAIRO_INCLUDE_DIR cairo/cairo.h)
+
+    find_library(CAIRO_LIBRARY NAMES cairo)
+
+    find_program(CAIRO_RUNTIME_LIBRARY NAMES cairo.dll libcairo-2.dll)
+    find_program(EXPAT_RUNTIME_LIBRARY NAMES expat.dll libexpat-1.dll)
+    find_program(FONTCONFIG_RUNTIME_LIBRARY NAMES fontconfig.dll libfontconfig-1.dll)
+    find_program(PIXMAN_RUNTIME_LIBRARY NAMES pixman-1.dll libpixman-1-0.dll)
+
+    find_package_handle_standard_args(CAIRO DEFAULT_MSG
+        CAIRO_INCLUDE_DIR
+
+        CAIRO_LIBRARY
+
+        CAIRO_RUNTIME_LIBRARY
+        EXPAT_RUNTIME_LIBRARY
+        FONTCONFIG_RUNTIME_LIBRARY
+        PIXMAN_RUNTIME_LIBRARY
+    )
+
+    set(CAIRO_INCLUDE_DIRS ${CAIRO_INCLUDE_DIR})
+
+    set(CAIRO_LIBRARIES ${CAIRO_LIBRARY})
+
+    set(CAIRO_LINK_LIBRARIES ${CAIRO_LIBRARY})
+
+    set(CAIRO_RUNTIME_LIBRARIES
+        ${CAIRO_RUNTIME_LIBRARY}
+        ${EXPAT_RUNTIME_LIBRARY}
+        ${FONTCONFIG_RUNTIME_LIBRARY}
+        ${PIXMAN_RUNTIME_LIBRARY}
+    )
+else()
+    find_package(PkgConfig)
+    pkg_check_modules(CAIRO cairo)
+
+    # prior to CMake 3.12, PkgConfig does not set *_LINK_LIBRARIES, so do it
+    # manually
+    if(${CMAKE_VERSION} VERSION_LESS 3.12)
+        find_library(CAIRO_LINK_LIBRARIES cairo PATHS ENV LIBRARY_PATH)
+    endif()
+
+    find_package_handle_standard_args(CAIRO DEFAULT_MSG
+        CAIRO_INCLUDE_DIRS
+        CAIRO_LIBRARIES
+        CAIRO_LINK_LIBRARIES
+    )
+endif()
diff --git a/cmake/FindCairo.cmake b/cmake/FindCairo.cmake
deleted file mode 100644 (file)
index b4cfd10..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-include(FindPackageHandleStandardArgs)
-
-if(WIN32)
-    find_path(Cairo_INCLUDE_DIR cairo/cairo.h)
-
-    find_library(Cairo_LIBRARY NAMES cairo)
-
-    find_program(Cairo_RUNTIME_LIBRARY NAMES cairo.dll libcairo-2.dll)
-    find_program(EXPAT_RUNTIME_LIBRARY NAMES expat.dll libexpat-1.dll)
-    find_program(FONTCONFIG_RUNTIME_LIBRARY NAMES fontconfig.dll libfontconfig-1.dll)
-    find_program(PIXMAN_RUNTIME_LIBRARY NAMES pixman-1.dll libpixman-1-0.dll)
-
-    find_package_handle_standard_args(Cairo DEFAULT_MSG
-        Cairo_INCLUDE_DIR
-
-        Cairo_LIBRARY
-
-        Cairo_RUNTIME_LIBRARY
-        EXPAT_RUNTIME_LIBRARY
-        FONTCONFIG_RUNTIME_LIBRARY
-        PIXMAN_RUNTIME_LIBRARY
-    )
-
-    set(Cairo_INCLUDE_DIRS ${Cairo_INCLUDE_DIR})
-
-    set(Cairo_LIBRARIES ${Cairo_LIBRARY})
-
-    set(Cairo_LINK_LIBRARIES ${Cairo_LIBRARY})
-
-    set(Cairo_RUNTIME_LIBRARIES
-        ${Cairo_RUNTIME_LIBRARY}
-        ${EXPAT_RUNTIME_LIBRARY}
-        ${FONTCONFIG_RUNTIME_LIBRARY}
-        ${PIXMAN_RUNTIME_LIBRARY}
-    )
-else()
-    find_package(PkgConfig)
-    pkg_check_modules(Cairo cairo)
-
-    # prior to CMake 3.12, PkgConfig does not set *_LINK_LIBRARIES, so do it
-    # manually
-    if(${CMAKE_VERSION} VERSION_LESS 3.12)
-        find_library(Cairo_LINK_LIBRARIES cairo PATHS ENV LIBRARY_PATH)
-    endif()
-
-    find_package_handle_standard_args(Cairo DEFAULT_MSG
-        Cairo_INCLUDE_DIRS
-        Cairo_LIBRARIES
-        Cairo_LINK_LIBRARIES
-    )
-endif()
index 59cc5c10a58fd5b87ca341c712dbbd0c60a9e83a..82012809e8924386a09b14cf388631711f642978 100644 (file)
@@ -1,4 +1,4 @@
-if(Cairo_FOUND AND PangoCairo_FOUND)
+if(CAIRO_FOUND AND PangoCairo_FOUND)
 
 add_library(gvplugin_pango SHARED
     # Header files
@@ -22,14 +22,14 @@ target_include_directories(gvplugin_pango PRIVATE
     ${GRAPHVIZ_LIB_DIR}/common
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Cairo_INCLUDE_DIRS}/cairo
+    ${CAIRO_INCLUDE_DIRS}/cairo
     ${PangoCairo_INCLUDE_DIRS}
 )
 
 target_link_libraries(gvplugin_pango
     cgraph
     gvc
-    ${Cairo_LINK_LIBRARIES}
+    ${CAIRO_LINK_LIBRARIES}
     ${PangoCairo_LINK_LIBRARIES}
 )
 
@@ -45,7 +45,7 @@ install(
 if(WIN32 AND install_win_dependency_dlls)
     install(
         FILES
-            ${Cairo_RUNTIME_LIBRARIES}
+            ${CAIRO_RUNTIME_LIBRARIES}
             ${PangoCairo_RUNTIME_LIBRARIES}
         DESTINATION ${BINARY_INSTALL_DIR}
     )