diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fc9f9097..e56afae26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,16 +126,13 @@ add_subdirectory(${CCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/ccommon) include(FindPackageHandleStandardArgs) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") -find_package(Check) -if(NOT CHECK_FOUND) - message(WARNING "Check is required to build and run tests") -endif(NOT CHECK_FOUND) -if(CHECK_FOUND) - check_symbol_exists(ck_assert_int_eq check.h CHECK_WORKING) - if(NOT CHECK_WORKING) - message(WARNING "Check version too old to build tests") - endif(NOT CHECK_WORKING) -endif(CHECK_FOUND) +find_package(PkgConfig QUIET) + +if(PKG_CONFIG_FOUND) + pkg_check_modules(Check REQUIRED check>=0.10) +else() + find_package(Check REQUIRED 0.10) +endif() find_package(Threads) diff --git a/deps/ccommon/CMakeLists.txt b/deps/ccommon/CMakeLists.txt index cd8e95a4b..2eb1289d9 100644 --- a/deps/ccommon/CMakeLists.txt +++ b/deps/ccommon/CMakeLists.txt @@ -140,17 +140,6 @@ endif(COVERAGE) include(FindPackageHandleStandardArgs) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") -find_package(Check) -if(NOT CHECK_FOUND) - message(WARNING "Check is required to build and run tests") -endif(NOT CHECK_FOUND) -if(CHECK_FOUND) - check_symbol_exists(ck_assert_int_eq check.h CHECK_WORKING) - if(NOT CHECK_WORKING) - message(WARNING "Check version too old to build tests") - endif(NOT CHECK_WORKING) -endif(CHECK_FOUND) - find_package(Threads)