Skip to content

Commit

Permalink
CMake: Fix using check on Debian Buster
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Aug 22, 2019
1 parent 9a80c83 commit 4386ba3
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions tools/cmake/FindCheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,22 @@ IF( NOT CHECK_FOUND )
MESSAGE ( STATUS "Using override CHECK_INSTALL_DIR to find check" )
SET ( CHECK_INCLUDE_DIR "${CHECK_INSTALL_DIR}/include" )
FIND_LIBRARY( CHECK_LIBRARY NAMES check PATHS "${CHECK_INSTALL_DIR}/lib" )
FIND_LIBRARY( COMPAT_LIBRARY NAMES compat PATHS "${CHECK_INSTALL_DIR}/lib" )
IF (WIN32)
FIND_LIBRARY( COMPAT_LIBRARY NAMES compat PATHS "${CHECK_INSTALL_DIR}/lib" )
ENDIF (WIN32)
ELSE ( CHECK_INSTALL_DIR )
FIND_PATH( CHECK_INCLUDE_DIR check.h )
FIND_LIBRARY( CHECK_LIBRARY NAMES check )
FIND_LIBRARY( COMPAT_LIBRARY NAMES compat )
IF (WIN32)
FIND_LIBRARY( COMPAT_LIBRARY NAMES compat )
ENDIF (WIN32)
ENDIF ( CHECK_INSTALL_DIR )

SET ( CHECK_LIBRARIES "${CHECK_LIBRARY}" "${COMPAT_LIBRARY}" )
IF (WIN32)
SET ( CHECK_LIBRARIES "${CHECK_LIBRARY}" "${COMPAT_LIBRARY}" )
ELSE ( WIN32)
SET ( CHECK_LIBRARIES "${CHECK_LIBRARY}" )
ENDIF (WIN32)

IF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES )
SET( CHECK_FOUND 1 )
Expand All @@ -54,4 +62,7 @@ IF( NOT CHECK_FOUND )
ENDIF( NOT CHECK_FOUND )

# Hide advanced variables from CMake GUIs
MARK_AS_ADVANCED( CHECK_INCLUDE_DIR CHECK_LIBRARIES CHECK_LIBRARY COMPAT_LIBRARY)
MARK_AS_ADVANCED( CHECK_INCLUDE_DIR CHECK_LIBRARIES CHECK_LIBRARY)
IF( WIN32 )
MARK_AS_ADVANCED( COMPAT_LIBRARY)
ENDIF()

0 comments on commit 4386ba3

Please sign in to comment.