commit e46ba5b3cdf17e501770d36a3a406b750f28b681
parent 866de4daf57ab6809770878464319e319500c1f3
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Fri, 24 Jan 2020 16:31:34 +0100
Make huge tests optional
Diffstat:
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -13,13 +13,19 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.1)
project(Star-Enclosures C)
enable_testing()
+include(CMakeDependentOption)
+
set(SENC_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src)
option(NO_TEST "Do not build tests" OFF)
+cmake_dependent_option(HUGE_ADDITIONAL_TESTS
+ "Build additional tests that involve millions of triangles" OFF
+ "NOT NO_TEST" OFF)
+
################################################################################
# Check dependencies
################################################################################
@@ -30,6 +36,9 @@ find_package(OpenMP 2.0 REQUIRED)
if(NOT NO_TEST)
find_package(StarSP 0.7 REQUIRED)
+endif()
+
+if(HUGE_ADDITIONAL_TESTS)
find_package(Star3DUT 0.3.1 REQUIRED)
endif()
@@ -50,7 +59,7 @@ else()
${Star3DUT_INCLUDE_DIR}
${StarSP_INCLUDE_DIR})
- if(ADDITIONAL_TESTS)
+ if(HUGE_ADDITIONAL_TESTS)
rcmake_append_runtime_dirs(_runtime_dirs RSys StarSP Star3DUT Star3D)
endif()
endif()
@@ -142,8 +151,6 @@ if(NOT NO_TEST)
new_test(test_senc_device)
new_test(test_senc_enclosure)
new_test(test_senc_inconsistant_cube)
- new_test(test_senc_many_enclosures)
- new_test(test_senc_many_triangles)
new_test(test_senc_sample_enclosure)
new_test(test_senc_scene)
new_test(test_senc_some_enclosures)
@@ -152,12 +159,19 @@ if(NOT NO_TEST)
target_link_libraries(test_senc_enclosure Star3D)
target_link_libraries(test_senc_sample_enclosure StarSP Star3D)
- target_link_libraries(test_senc_many_enclosures Star3DUT)
- target_link_libraries(test_senc_many_triangles Star3DUT)
rcmake_copy_runtime_libraries(test_senc_sample_enclosure)
- rcmake_copy_runtime_libraries(test_senc_many_enclosures)
- rcmake_copy_runtime_libraries(test_senc_many_triangles)
+
+ if(HUGE_ADDITIONAL_TESTS)
+ new_test(test_senc_many_enclosures)
+ new_test(test_senc_many_triangles)
+
+ target_link_libraries(test_senc_many_enclosures Star3DUT)
+ target_link_libraries(test_senc_many_triangles Star3DUT)
+
+ rcmake_copy_runtime_libraries(test_senc_many_enclosures)
+ rcmake_copy_runtime_libraries(test_senc_many_triangles)
+ endif()
endif()
################################################################################