You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/09/03 12:51:35 UTC
[13/42] mesos git commit: CMake: Prioritized provided paths in
`FindPackageHelper`.
CMake: Prioritized provided paths in `FindPackageHelper`.
This ensure that the given paths are searched before the default paths,
required for finding the correct macOS packages.
Also normalized some whitespace in the file.
Review: https://reviews.apache.org/r/61336/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ea39e120
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ea39e120
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ea39e120
Branch: refs/heads/master
Commit: ea39e12050e2ae20d16d0affd9bb77bc56b129ad
Parents: 5c52e46
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 07:51:29 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/cmake/FindPackageHelper.cmake | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ea39e120/3rdparty/stout/cmake/FindPackageHelper.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/FindPackageHelper.cmake b/3rdparty/stout/cmake/FindPackageHelper.cmake
index 089edb0..2e6acdf 100644
--- a/3rdparty/stout/cmake/FindPackageHelper.cmake
+++ b/3rdparty/stout/cmake/FindPackageHelper.cmake
@@ -46,16 +46,16 @@ function(FIND_PACKAGE_HELPER PACKAGE_NAME HEADER_FILE)
find_path(
${PACKAGE_NAME}_INCLUDE_DIR
${HEADER_FILE}
- HINTS ${POSSIBLE_${PACKAGE_NAME}_INCLUDE_DIRS}
- )
+ HINTS ${POSSIBLE_${PACKAGE_NAME}_INCLUDE_DIRS})
# Check if the header file was found.
string(
COMPARE NOTEQUAL
"${PACKAGE_NAME}_INCLUDE_DIR-NOTFOUND"
${${PACKAGE_NAME}_INCLUDE_DIR}
- ${PACKAGE_NAME}_INCLUDE_DIR_FOUND # Output variable.
- )
+
+ # Output variable.
+ ${PACKAGE_NAME}_INCLUDE_DIR_FOUND)
# Error out if the header is not found.
if (NOT ${${PACKAGE_NAME}_INCLUDE_DIR_FOUND})
@@ -74,15 +74,23 @@ function(FIND_PACKAGE_HELPER PACKAGE_NAME HEADER_FILE)
${PACKAGE_NAME}_LIB_PATH
NAMES ${LIBRARY_NAME}
PATHS ${POSSIBLE_${PACKAGE_NAME}_LIB_DIRS}
- )
+ NO_DEFAULT_PATH)
+
+ # NOTE: We call this again to search the default paths,
+ # but it will only do so if it wasn't found above.
+ # This is recommended by the CMake documentation.
+ find_library(
+ ${PACKAGE_NAME}_LIB_PATH
+ NAMES ${LIBRARY_NAME})
# Check if the library was found.
string(
COMPARE NOTEQUAL
"${PACKAGE_NAME}_LIB_PATH-NOTFOUND"
${${PACKAGE_NAME}_LIB_PATH}
- ${PACKAGE_NAME}_LIB_PATH_FOUND # Output variable.
- )
+
+ # Output variable.
+ ${PACKAGE_NAME}_LIB_PATH_FOUND)
# Error out if any of the libraries are not found.
if (NOT ${${PACKAGE_NAME}_LIB_PATH_FOUND})