From f149e00720e33fa625466133ad415671d09c6202 Mon Sep 17 00:00:00 2001 From: Carlos Goncalves Date: Wed, 24 Mar 2010 23:28:38 +0000 Subject: Do not build tests if explicitly wanted to. Default is to build. The majority of users don't need tests built. This will reduce build time significantly, and packagers will be thanked for it. To not build tests append -DBUILD_TESTS=False to cmake parameters. Reviewer: Anderson Lizardo Reviewer: Hugo Parente --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 969b6459f..e96dd2d45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 2.6) find_package(Qt4 4.5.0 REQUIRED) find_package(ApiExtractor REQUIRED) +option(BUILD_TESTS "Build tests." TRUE) + if (MSVC) set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /w /EHsc- /GS- /GR- /DGENRUNNER_BUILD -D_SCL_SECURE_NO_WARNINGS") else (MSVC) @@ -89,8 +91,13 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/GeneratorRunnerVersion.cmake" file(GLOB manpages "${CMAKE_CURRENT_SOURCE_DIR}/*.1") install(FILES ${manpages} DESTINATION share/man/man1) -enable_testing() +if (BUILD_TESTS) + enable_testing() +endif() add_subdirectory(generators) -add_subdirectory(tests) + +if (BUILD_TESTS) + add_subdirectory(tests) +endif() -- cgit v1.2.3