diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b8462d..2fc9e4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) project(unboxing C) +option(UNBOXING_TESTS "Build tests" ${PROJECT_IS_TOP_LEVEL}) + if(WIN32) set(WARNINGS /MP) elseif(APPLE) @@ -118,11 +120,7 @@ set_target_properties(testutils unboxing PROPERTIES C_STANDARD_REQUIRED ON ) -if(PROJECT_IS_TOP_LEVEL) - set(BUILD_TESTING ON) -endif() - -if(BUILD_TESTING) +if(UNBOXING_TESTS) enable_testing() add_executable(static_unboxer tests/static_unboxer/main.c) @@ -183,6 +181,6 @@ if(BUILD_TESTING) COMMAND doxygen doxygen.dox DEPENDS doxygen.dox ) - add_custom_target(doxygen ALL DEPENDS doc/html/index.html) + add_custom_target(unboxing_doxygen ALL DEPENDS doc/html/index.html) endif() endif() diff --git a/README.md b/README.md index b93c5c2..4c71408 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ cmake --build build -j ctest -j4 --test-dir build ``` +Note: If don't want to compile with tests, run: `cmake -Bbuild -DBUILD_TESTING=OFF` in the configure stage. In this case `doxygen` is not needed as a dependency. + ## iVM The iVM virtual machine is a minimal execution environment for file format