Skip to content

Commit

Permalink
Merge pull request #850 from jedwards4b/cmake_include_fix
Browse files Browse the repository at this point in the history
need this to use check_function_exists
  • Loading branch information
edhartnett authored Mar 8, 2017
2 parents 629fb4f + aec4eff commit 1ab3783
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions cmake/LibCheck.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include (CMakeParseArguments)

include (CheckFunctionExists)
#==============================================================================
#
# FUNCTIONS TO HELP WITH Check* MODULES
Expand All @@ -14,17 +14,17 @@ include (CMakeParseArguments)
# HINTS <path> <path> ...
# DEFINITIONS <definition1> <definition> ...
# COMMENT <string_comment>)
#
#
function (check_macro VARIABLE)

# Parse the input arguments
set (oneValueArgs COMMENT NAME)
set (multiValueArgs HINTS DEFINITIONS)
cmake_parse_arguments (${VARIABLE} "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
cmake_parse_arguments (${VARIABLE} "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

# If the return variable is defined, already, don't continue
if (NOT DEFINED ${VARIABLE})

message (STATUS "Checking ${${VARIABLE}_COMMENT}")
find_file (${VARIABLE}_TRY_FILE
NAMES ${${VARIABLE}_NAME}
Expand All @@ -40,17 +40,17 @@ function (check_macro VARIABLE)
else ()
message (STATUS "Checking ${${VARIABLE}_COMMENT} - no")
endif ()

set (${VARIABLE} ${COMPILE_RESULT}
CACHE BOOL "${${VARIABLE}_COMMENT}")

else ()
message (STATUS "Checking ${${VARIABLE}_COMMENT} - failed")
endif ()

unset (${VARIABLE}_TRY_FILE CACHE)
endif ()

endfunction ()

#______________________________________________________________________________
Expand All @@ -60,17 +60,17 @@ endfunction ()
# NAME <try_version_file>
# HINTS <path> <path> ...
# DEFINITIONS <definition1> <definition> ...)
#
#
function (check_version PKG)

# Parse the input arguments
set (oneValueArgs NAME MACRO_REGEX)
set (multiValueArgs HINTS)
cmake_parse_arguments (${PKG} "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
cmake_parse_arguments (${PKG} "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

# If the return variable is defined, already, don't continue
if (NOT DEFINED ${PKG}_VERSION)

message (STATUS "Checking ${PKG} version")
find_file (${PKG}_VERSION_HEADER
NAMES ${${PKG}_NAME}
Expand All @@ -96,9 +96,9 @@ function (check_version PKG)
else ()
message (STATUS "Checking ${PKG} version - failed")
endif ()

unset (${PKG}_VERSION_HEADER CACHE)

endif ()

endfunction ()

0 comments on commit 1ab3783

Please sign in to comment.