diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-10-28 15:35:47 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-04 15:48:30 +0000 |
commit | cd9813d2763adb715d1cf1a37b86439fea255172 (patch) | |
tree | d0c036f4f7828daa2d8fecdf180b329dac28d439 /cmake/QtSetup.cmake | |
parent | 56115dba42a4376fd6b24541dee023a675612ce9 (diff) |
Add support for benchmark conversion
Convert benchmark executables to add_qt_benchmark().
Currently add_qt_benchmark just calls add_qt_executable() and
ensures that it they build under CMAKE_CURRENT_BUILD_DIR and do not
install.
Add QT_BUILD_BENCHMARKS option to enable/disable building of benchmarks.
Change-Id: Id0bc676698d21d50048d97d9abef51d92ccb6638
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtSetup.cmake')
-rw-r--r-- | cmake/QtSetup.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 6f42e337da..837b81db4d 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -73,8 +73,16 @@ if(FEATURE_developer_build) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) endif() set(QT_BUILD_TESTING ON) + set(__build_benchmarks ON) + + # Disable benchmarks for single configuration generators which do not build + # with release configuration. + if (CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE STREQUAL Release) + set(__build_benchmarks OFF) + endif() else() set(QT_BUILD_TESTING OFF) + set(__build_benchmarks OFF) endif() ## Set up testing @@ -85,6 +93,9 @@ enable_testing() # Set up building of examples. option(BUILD_EXAMPLES "Build Qt examples" ON) +# Build Benchmarks +option(QT_BUILD_BENCHMARKS "Build Qt Benchmarks" ${__build_benchmarks}) + ## Android platform settings if(ANDROID) include(QtPlatformAndroid) |