From 2d6ff0200fd52e4bb55b93b4e45f088b7143a00f Mon Sep 17 00:00:00 2001 From: Pascal Palenda <pascal.palenda@akustik.rwth-aachen.de> Date: Thu, 27 Apr 2023 09:59:01 +0200 Subject: [PATCH] Update README accordingly --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b8c495..e75cf65 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ FetchContent_MakeAvailable (IHTACMakeCommon) init_project () +option (PROJECT_WITH_UNIT_TESTS "Add unit tests for project" OFF) + project (AwesomeProjectName LANGUAGES CXX C VERSION 1.0.0 @@ -53,6 +55,7 @@ ihta_add_library ( OUT_TEST TEST_TARGET # The name of the unit test target will be stored in `TEST_TARGET`. Useful for adding dependencies to the target. See below. TEST_SOURCES test/test.cpp # This adds a unit test with the given source files. TEST_INTERNALS # With this option, the internals of the library can be unit tested as well. + ADD_UNIT_TEST ${PROJECT_WITH_UNIT_TESTS} # This option can enable or disable the unit tests. ) # Add external library link to library @@ -78,7 +81,10 @@ packageProject ( # Needed so the object library knows the location of the generated headers from packageProject. target_include_directories (${LIB_TARGET} PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/PackageProjectInclude>") -target_include_directories (${TEST_TARGET} PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/PackageProjectInclude>") + +if (PROJECT_WITH_UNIT_TESTS) + target_include_directories (${TEST_TARGET} PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/PackageProjectInclude>") +endif () build_doc ( ADD_DEV_SECTION OFF -- GitLab