Commit 9a6c3979 authored by Jan Koniarik's avatar Jan Koniarik
Browse files

added config level option to enable tests

parent d489a6b3
Pipeline #106415 passed with stage
in 49 seconds
cmake_minimum_required(VERSION 3.16)
if(NOT DEFINED PROJECT_NAME) # detection for disabling test inspired by Catch2
set(NOT_SUBPROJECT ON)
else()
set(NOT_SUBPROJECT OFF)
endif()
option(EMLABCPP_TESTS_ENABLED "Decides whenever tests should be enabled" OFF)
project(emlabcpp)
add_library(emlabcpp INTERFACE)
target_include_directories(emlabcpp INTERFACE include/)
if(NOT_SUBPROJECT)
if(EMLABCPP_TESTS_ENABLED)
include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
......
......@@ -8,7 +8,7 @@ clean:
rm -rf ./build
build_test:
cmake -Bbuild $(EXTRAARGS) -DCMAKE_EXPORT_COMPILE_COMMANDS=1
cmake -Bbuild $(EXTRAARGS) -DEMLABCPP_TESTS_ENABLED=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1
make -Cbuild -j
exec_test: build_test
......
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