Commit e76b7423 authored by Ghislain MARY's avatar Ghislain MARY

Fix CUnit symbols checking in CMake.

parent 15dcfa40
......@@ -55,7 +55,7 @@ cmake_dependent_option(ENABLE_ASSISTANT "Turn on assistant compiling." YES "ENAB
list(APPEND CMAKE_MODULE_PATH ${CMAKE_PREFIX_PATH}/share/cmake/Modules)
include(CheckIncludeFile)
include(CheckLibraryExists)
include(CheckSymbolExists)
if(MSVC)
list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_PREFIX_PATH}/include/MSVC)
......@@ -67,8 +67,12 @@ find_package(XML2 REQUIRED)
if(ENABLE_UNIT_TESTS)
find_package(CUnit)
if(CUNIT_FOUND)
check_library_exists("cunit" "CU_get_suite" "" HAVE_CU_GET_SUITE)
check_library_exists("cunit" "CU_curses_run_tests" "" HAVE_CU_CURSES)
cmake_push_check_state(RESET)
list(APPEND CMAKE_REQUIRED_INCLUDES ${CUNIT_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CUNIT_LIBRARIES})
check_symbol_exists("CU_get_suite" "CUnit/CUnit.h" HAVE_CU_GET_SUITE)
check_symbol_exists("CU_curses_run_tests" "CUnit/CUnit.h" HAVE_CU_CURSES)
cmake_pop_check_state()
else()
message(WARNING "Could not find the cunit library!")
set(ENABLE_UNIT_TESTS OFF CACHE BOOL "Enable compilation of unit tests." FORCE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment