]> granicus.if.org Git - graphviz/commitdiff
CMake: [nfc] uppercase 'Getopt_*' variables
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 31 Jan 2022 11:15:38 +0000 (22:15 +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/FindGETOPT.cmake [new file with mode: 0644]
cmake/FindGetopt.cmake [deleted file]
cmd/tools/CMakeLists.txt
lib/gvpr/CMakeLists.txt

index 74d35cc6fb8651b797764467b25cfa2ea92cf5fa..684747250ee0470d44a902f4a60d3b9e73d44e30 100644 (file)
@@ -200,7 +200,7 @@ message(STATUS "Graphviz version: ${GRAPHVIZ_VERSION_FULL}")
 
 include(config_checks)
 if(NOT HAVE_GETOPT_H)
-    find_package(Getopt REQUIRED)
+    find_package(GETOPT REQUIRED)
 endif()
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
diff --git a/cmake/FindGETOPT.cmake b/cmake/FindGETOPT.cmake
new file mode 100644 (file)
index 0000000..3a9adb9
--- /dev/null
@@ -0,0 +1,23 @@
+include(FindPackageHandleStandardArgs)
+
+find_path(GETOPT_INCLUDE_DIR getopt.h)
+find_library(GETOPT_LIBRARY NAMES getopt)
+find_program(GETOPT_RUNTIME_LIBRARY NAMES getopt.dll)
+
+if(WIN32)
+    find_package_handle_standard_args(GETOPT DEFAULT_MSG
+        GETOPT_INCLUDE_DIR
+        GETOPT_LIBRARY
+        GETOPT_RUNTIME_LIBRARY
+    )
+else()
+    find_package_handle_standard_args(GETOPT DEFAULT_MSG
+        GETOPT_INCLUDE_DIR
+        GETOPT_LIBRARY
+    )
+endif()
+
+set(GETOPT_INCLUDE_DIRS ${GETOPT_INCLUDE_DIR})
+set(GETOPT_LIBRARIES ${GETOPT_LIBRARY})
+set(GETOPT_LINK_LIBRARIES ${GETOPT_LIBRARY})
+set(GETOPT_RUNTIME_LIBRARIES ${GETOPT_RUNTIME_LIBRARY})
diff --git a/cmake/FindGetopt.cmake b/cmake/FindGetopt.cmake
deleted file mode 100644 (file)
index 6e5b80d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-include(FindPackageHandleStandardArgs)
-
-find_path(Getopt_INCLUDE_DIR getopt.h)
-find_library(Getopt_LIBRARY NAMES getopt)
-find_program(Getopt_RUNTIME_LIBRARY NAMES getopt.dll)
-
-if(WIN32)
-    find_package_handle_standard_args(Getopt DEFAULT_MSG
-        Getopt_INCLUDE_DIR
-        Getopt_LIBRARY
-        Getopt_RUNTIME_LIBRARY
-    )
-else()
-    find_package_handle_standard_args(Getopt DEFAULT_MSG
-        Getopt_INCLUDE_DIR
-        Getopt_LIBRARY
-    )
-endif()
-
-set(Getopt_INCLUDE_DIRS ${Getopt_INCLUDE_DIR})
-set(Getopt_LIBRARIES ${Getopt_LIBRARY})
-set(Getopt_LINK_LIBRARIES ${Getopt_LIBRARY})
-set(Getopt_RUNTIME_LIBRARIES ${Getopt_RUNTIME_LIBRARY})
index 3be27f275f258268c925bfad5a1717975311beaf..88b3f1da5ae79c53e4eecd61bab1d25afeebad52 100644 (file)
@@ -4,7 +4,7 @@
 # - installation of manpage
 function(tool_defaults name)
     if(NOT HAVE_GETOPT_H)
-        target_link_libraries(${name} ${Getopt_LINK_LIBRARIES})
+        target_link_libraries(${name} ${GETOPT_LINK_LIBRARIES})
     endif()
 
     install(
@@ -48,7 +48,7 @@ function(add_simple_tool name)
         ${GRAPHVIZ_LIB_DIR}/gvc
         ${GRAPHVIZ_LIB_DIR}/pack
         ${GRAPHVIZ_LIB_DIR}/pathplan
-        ${Getopt_INCLUDE_DIRS}
+        ${GETOPT_INCLUDE_DIRS}
     )
 
     target_link_libraries(${name}
@@ -88,7 +88,7 @@ target_include_directories(dijkstra PRIVATE
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(dijkstra
@@ -122,7 +122,7 @@ target_include_directories(gml2gv PRIVATE
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(gml2gv
@@ -139,10 +139,10 @@ target_include_directories(gv2gml PRIVATE
     ${GRAPHVIZ_LIB_DIR}/common
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Getopt_INCLUDE_DIRS})
+    ${GETOPT_INCLUDE_DIRS})
 target_link_libraries(gv2gml cgraph gvc ingraphs)
 if(NOT HAVE_GETOPT_H)
-    target_link_libraries(gv2gml ${Getopt_LINK_LIBRARIES})
+    target_link_libraries(gv2gml ${GETOPT_LINK_LIBRARIES})
 endif()
 install(TARGETS gv2gml RUNTIME DESTINATION ${BINARY_INSTALL_DIR})
 
@@ -165,7 +165,7 @@ target_include_directories(graphml2gv PRIVATE
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
     ${EXPAT_INCLUDE_DIRS}
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(graphml2gv
@@ -197,7 +197,7 @@ target_include_directories(gvcolor PRIVATE
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(gvcolor
@@ -224,7 +224,7 @@ target_include_directories(gvgen PRIVATE
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(gvgen cgraph)
@@ -256,7 +256,7 @@ target_include_directories(gvpack PRIVATE
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(gvpack
@@ -289,7 +289,7 @@ target_include_directories(gxl2gv PRIVATE
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
     ${EXPAT_INCLUDE_DIRS}
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(gxl2gv
@@ -321,7 +321,7 @@ target_include_directories(mm2gv PRIVATE
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(mm2gv
@@ -348,7 +348,7 @@ target_include_directories(sccmap PRIVATE
     ${GRAPHVIZ_LIB_DIR}/gvc
     ${GRAPHVIZ_LIB_DIR}/pack
     ${GRAPHVIZ_LIB_DIR}/pathplan
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(sccmap
@@ -369,7 +369,7 @@ endif()
 
 if(WIN32 AND install_win_dependency_dlls)
     install(
-        FILES ${Getopt_RUNTIME_LIBRARIES}
+        FILES ${GETOPT_RUNTIME_LIBRARIES}
         DESTINATION ${BINARY_INSTALL_DIR}
     )
 endif()
index 3972918e40f6224f0d4928a122064f0f41913f68..5fe0c835e3b3a84df4ddff59f0fd5574889314d2 100644 (file)
@@ -31,7 +31,7 @@ target_include_directories(gvpr PRIVATE
     ${GRAPHVIZ_LIB_DIR}/cgraph
     ${GRAPHVIZ_LIB_DIR}/common
     ${GRAPHVIZ_LIB_DIR}/expr
-    ${Getopt_INCLUDE_DIRS}
+    ${GETOPT_INCLUDE_DIRS}
 )
 
 target_link_libraries(gvpr
@@ -45,5 +45,5 @@ target_link_libraries(gvpr
 )
 
 if(NOT HAVE_GETOPT_H)
-    target_link_libraries(gvpr ${Getopt_LINK_LIBRARIES})
+    target_link_libraries(gvpr ${GETOPT_LINK_LIBRARIES})
 endif()