Commit dbb21ad9 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Only search for cunit when tests are enabled.

parent 0de54fb7
......@@ -83,19 +83,25 @@ find_package(Antlr3)
if(${ENABLE_TLS})
find_package(PolarSSL)
set(HAVE_POLARSSL ${POLARSSL_FOUND})
if(POLARSSL_FOUND)
set(HAVE_POLARSSL 1)
endif(POLARSSL_FOUND)
endif(${ENABLE_TLS})
find_package(CUnit)
if(${CUNIT_FOUND})
check_library_exists(${CUNIT_LIBRARIES} "CU_add_suite" "" HAVE_CU_ADD_SUITE)
check_library_exists(${CUNIT_LIBRARIES} "CU_get_suite" "" HAVE_CU_GET_SUITE)
check_library_exists(${CUNIT_LIBRARIES} "CU_curses_run_tests" "" HAVE_CU_CURSES)
else(${CUNIT_FOUND})
message(WARNING "Could not find cunit framework, tests will not be compiled.")
set(ENABLE_TESTS OFF CACHE BOOL "Enable compilation of tests" FORCE)
endif(${CUNIT_FOUND})
if(${ENABLE_TESTS})
find_package(CUnit)
if(CUNIT_FOUND)
check_library_exists(${CUNIT_LIBRARIES} "CU_add_suite" "" HAVE_CU_ADD_SUITE)
check_library_exists(${CUNIT_LIBRARIES} "CU_get_suite" "" HAVE_CU_GET_SUITE)
check_library_exists(${CUNIT_LIBRARIES} "CU_curses_run_tests" "" HAVE_CU_CURSES)
else(CUNIT_FOUND)
message(WARNING "Could not find cunit framework, tests will not be compiled.")
set(ENABLE_TESTS OFF CACHE BOOL "Enable compilation of tests" FORCE)
endif(CUNIT_FOUND)
endif(${ENABLE_TESTS})
find_package(Tunnel)
set(HAVE_TUNNEL ${TUNNEL_FOUND})
if(TUNNEL_FOUND)
set(HAVE_TUNNEL 1)
endif(TUNNEL_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
......@@ -107,9 +113,9 @@ set(libdir ${prefix}/lib)
set(includedir ${prefix}/include)
get_filename_component(antlr3c_library_path "${ANTLR3C_LIBRARIES}" PATH)
set(LIBS_PRIVATE "-L${antlr3c_library_path} -lantlr3c")
if(${CUNIT_FOUND})
if(CUNIT_FOUND)
set(REQUIRES_PRIVATE "${REQUIRES_PRIVATE} cunit")
endif(${CUNIT_FOUND})
endif(CUNIT_FOUND)
if(HAVE_POLARSSL)
get_filename_component(polarssl_library_path "${POLARSSL_LIBRARIES}" PATH)
set(LIBS_PRIVATE "${LIBS_PRIVATE} -L${polarssl_library_path} -lpolarssl")
......
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