From 4386ba3a7855fae19d3337017afaaf8270ff7ddd Mon Sep 17 00:00:00 2001 From: Julius Pfrommer Date: Wed, 21 Aug 2019 22:31:36 +0200 Subject: [PATCH] CMake: Fix using check on Debian Buster --- tools/cmake/FindCheck.cmake | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/cmake/FindCheck.cmake b/tools/cmake/FindCheck.cmake index a7c29cfc4f4..34a3be5bbaa 100644 --- a/tools/cmake/FindCheck.cmake +++ b/tools/cmake/FindCheck.cmake @@ -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 ) @@ -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) \ No newline at end of file +MARK_AS_ADVANCED( CHECK_INCLUDE_DIR CHECK_LIBRARIES CHECK_LIBRARY) +IF( WIN32 ) + MARK_AS_ADVANCED( COMPAT_LIBRARY) +ENDIF()