aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCarlos Goncalves <mail@cgoncalves.info>2010-03-24 23:16:47 +0000
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:09:59 -0300
commitc3e111369e3c4a60455fe5667d0adce341867dea (patch)
tree9850efccea6e61909461a938aa9dca92b660fe2b /CMakeLists.txt
parentd75aeacd396691d5b26af1ac2a9669e407639155 (diff)
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 <anderson.lizardo@openbossa.org> Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2cdbd61..00b98aad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,12 +7,16 @@ find_package(Qt4 4.5.0 REQUIRED)
find_package(LibXml2 2.6.32 REQUIRED)
find_package(LibXslt 1.1.19 REQUIRED)
+option(BUILD_TESTS "Build tests." TRUE)
+
if (MSVC)
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /w /EHsc- /GS- /GR- /DAPIEXTRACTOR_ENABLE_DUPLICATE_ENUM_VALUES /DAPIEXTRACTOR_BUILD -D_SCL_SECURE_NO_WARNINGS")
else (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -DAPIEXTRACTOR_ENABLE_DUPLICATE_ENUM_VALUES -fvisibility=hidden")
endif(MSVC)
-set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/tests)
+if (BUILD_TESTS)
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/tests)
+endif()
set(apiextractor_MAJOR_VERSION 0)
set(apiextractor_MINOR_VERSION 4)
@@ -112,8 +116,10 @@ docparser.h
qtdocparser.h
)
-enable_testing()
-add_subdirectory(tests)
+if (BUILD_TESTS)
+ enable_testing()
+ add_subdirectory(tests)
+endif()
install(FILES ${root_HEADERS} DESTINATION include/apiextractor)
install(TARGETS apiextractor EXPORT apiextractor