From 30fcf4f242a1aa37378b86fd4ec89b6905c74aff Mon Sep 17 00:00:00 2001 From: Lauro Neto Date: Tue, 14 Dec 2010 16:33:49 -0300 Subject: Add option to install tests Reviewer: Marcelo Lira Reviewer: Luciano Wolf --- CMakeLists.txt | 5 +++++ tests/CMakeLists.txt | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe1ca6809..1cc8f843f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ find_package(Qt4 4.5.0 REQUIRED) find_package(ApiExtractor 0.9.0 REQUIRED) option(BUILD_TESTS "Build tests." TRUE) +option(INSTALL_TESTS "Install tests" FALSE) +option(TEST_INSTALL_DIR "Test install directory" FALSE) option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE) if(MSVC) @@ -102,6 +104,9 @@ install(FILES generator.h DESTINATION include/${GENERATORRUNNER_INC_DIR}) install(FILES generatorrunnermacros.h DESTINATION include/${GENERATORRUNNER_INC_DIR}) if (BUILD_TESTS) + if (NOT TEST_INSTALL_DIR) + set(TEST_INSTALL_DIR "share/generatorrunner/tests") + endif() enable_testing() endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 37c34ea3d..1f123bf72 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -19,4 +19,7 @@ if (NOT APIEXTRACTOR_DOCSTRINGS_DISABLED) genrunner) add_test("sphinxtable" sphinxtabletest) + if (INSTALL_TESTS) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/sphinxtabletest DESTINATION ${TEST_INSTALL_DIR}) + endif() endif() -- cgit v1.2.1