CMakeLists.txt: split ENABLE_TESTS in two options (needed on iOS / android)

parent b3a628c7
......@@ -37,12 +37,13 @@ set(PROJECT_VERSION_MINOR ${BCTOOLBOX_VERSION_MINOR})
set(PROJECT_VERSION_PATCH ${BCTOOLBOX_VERSION_PATCH})
set(PROJECT_VERSION "${BCTOOLBOX_VERSION}")
option(ENABLE_SHARED "Build shared library." YES)
option(ENABLE_STATIC "Build static library." YES)
option(ENABLE_SHARED "Build shared library." ON)
option(ENABLE_STATIC "Build static library." ON)
option(ENABLE_POLARSSL "Enable polarssl support" ON)
option(ENABLE_MBEDTLS "Enable mabedtls support" ON)
option(ENABLE_TESTS "Enable compilation of tests helper library" ON)
option(ENABLE_STRICT "Pass strict flags to the compiler" ON)
option(ENABLE_TESTS_COMPONENT "Enable compilation of tests helper library" ON)
option(ENABLE_TESTS "Enable compilation of tests" ON)
include(CheckLibraryExists)
include(CheckSymbolExists)
......@@ -110,7 +111,7 @@ if(POLARSSL_FOUND)
set(LIBS_PRIVATE "${LIBS_PRIVATE} -L${polarssl_library_path} -lpolarssl")
endif()
if(ENABLE_TESTS)
if(ENABLE_TESTS_COMPONENT)
find_package(CUnit)
if(CUNIT_FOUND)
cmake_push_check_state(RESET)
......@@ -130,7 +131,7 @@ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bctoolbox.pc.in ${CMAKE_CURRENT_BINARY_DIR}/bctoolbox.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bctoolbox.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if(ENABLE_TESTS AND CUNIT_FOUND)
if(ENABLE_TESTS_COMPONENT AND CUNIT_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bctoolbox-tester.pc.in ${CMAKE_CURRENT_BINARY_DIR}/bctoolbox-tester.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bctoolbox-tester.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
......@@ -200,7 +201,7 @@ check_library_exists("rt" "clock_gettime" "" HAVE_LIBRT)
add_subdirectory(include)
add_subdirectory(src)
if(ENABLE_TESTS AND CUNIT_FOUND)
if(ENABLE_TESTS AND ENABLE_TESTS_COMPONENT AND CUNIT_FOUND)
add_subdirectory(tester)
endif()
......
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