summaryrefslogtreecommitdiff
path: root/cmake/FindPkgLibraries.cmake
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-11-11 22:37:36 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2021-11-14 07:25:41 -0500
commitc3fec45645e6939b3604d2d233be6f97ff629f87 (patch)
tree8e600ad28fd9f41c67a170ce4ca01fa0ce62c2c8 /cmake/FindPkgLibraries.cmake
parentb608af6c3a2502ae61b94416a482c2e0672286a4 (diff)
downloadlibgit2-c3fec45645e6939b3604d2d233be6f97ff629f87.tar.gz
cmake: reformat modules
Apply the standard project cmake formatting to the modules.
Diffstat (limited to 'cmake/FindPkgLibraries.cmake')
-rw-r--r--cmake/FindPkgLibraries.cmake38
1 files changed, 19 insertions, 19 deletions
diff --git a/cmake/FindPkgLibraries.cmake b/cmake/FindPkgLibraries.cmake
index 49311c382..220bb2ce2 100644
--- a/cmake/FindPkgLibraries.cmake
+++ b/cmake/FindPkgLibraries.cmake
@@ -1,28 +1,28 @@
-INCLUDE(FindPkgConfig)
+include(FindPkgConfig)
# This function will find and set up a pkg-config based module.
# If a pc-file was found, it will resolve library paths to
# absolute paths. Furthermore, the function will automatically
# fall back to use static libraries in case no dynamic libraries
# were found.
-FUNCTION(FIND_PKGLIBRARIES prefix package)
- PKG_CHECK_MODULES(${prefix} ${package})
- IF(NOT ${prefix}_FOUND)
- RETURN()
- ENDIF()
+function(FIND_PKGLIBRARIES prefix package)
+ pkg_check_modules(${prefix} ${package})
+ if(NOT ${prefix}_FOUND)
+ return()
+ endif()
- FOREACH(LIBRARY ${${prefix}_LIBRARIES})
- FIND_LIBRARY(${LIBRARY}_RESOLVED ${LIBRARY} PATHS ${${prefix}_LIBRARY_DIRS})
- IF(${${LIBRARY}_RESOLVED} STREQUAL "${LIBRARY}_RESOLVED-NOTFOUND")
- MESSAGE(FATAL_ERROR "could not resolve ${LIBRARY}")
- ENDIF()
- LIST(APPEND RESOLVED_LIBRARIES ${${LIBRARY}_RESOLVED})
- ENDFOREACH(LIBRARY)
+ foreach(LIBRARY ${${prefix}_LIBRARIES})
+ find_library(${LIBRARY}_RESOLVED ${LIBRARY} PATHS ${${prefix}_LIBRARY_DIRS})
+ if(${${LIBRARY}_RESOLVED} STREQUAL "${LIBRARY}_RESOLVED-NOTFOUND")
+ message(FATAL_ERROR "could not resolve ${LIBRARY}")
+ endif()
+ list(APPEND RESOLVED_LIBRARIES ${${LIBRARY}_RESOLVED})
+ endforeach()
- SET(${prefix}_FOUND 1 PARENT_SCOPE)
- SET(${prefix}_LIBRARIES ${RESOLVED_LIBRARIES} PARENT_SCOPE)
- SET(${prefix}_INCLUDE_DIRS ${${prefix}_INCLUDE_DIRS} PARENT_SCOPE)
- SET(${prefix}_LDFLAGS ${${prefix}_LDFLAGS} PARENT_SCOPE)
+ set(${prefix}_FOUND 1 PARENT_SCOPE)
+ set(${prefix}_LIBRARIES ${RESOLVED_LIBRARIES} PARENT_SCOPE)
+ set(${prefix}_INCLUDE_DIRS ${${prefix}_INCLUDE_DIRS} PARENT_SCOPE)
+ set(${prefix}_LDFLAGS ${${prefix}_LDFLAGS} PARENT_SCOPE)
- MESSAGE(STATUS " Resolved libraries: ${RESOLVED_LIBRARIES}")
-ENDFUNCTION()
+ message(STATUS " Resolved libraries: ${RESOLVED_LIBRARIES}")
+endfunction()