Changeset View
Changeset View
Standalone View
Standalone View
CMakeLists.txt
Show All 18 Lines | |||||
19 | 19 | | |||
20 | include(ECMGenerateExportHeader) | 20 | include(ECMGenerateExportHeader) | ||
21 | include(ECMMarkAsTest) | 21 | include(ECMMarkAsTest) | ||
22 | include(ECMSetupVersion) | 22 | include(ECMSetupVersion) | ||
23 | include(ECMGenerateHeaders) | 23 | include(ECMGenerateHeaders) | ||
24 | include(ECMAddQch) | 24 | include(ECMAddQch) | ||
25 | include(ECMMarkNonGuiExecutable) | 25 | include(ECMMarkNonGuiExecutable) | ||
26 | include(ECMQtDeclareLoggingCategory) | 26 | include(ECMQtDeclareLoggingCategory) | ||
27 | include(ECMSourceVersionControl) | ||||
27 | 28 | | |||
28 | ecm_setup_version( | 29 | ecm_setup_version( | ||
29 | PROJECT | 30 | PROJECT | ||
30 | VARIABLE_PREFIX KIO | 31 | VARIABLE_PREFIX KIO | ||
31 | VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/kio_version.h" | 32 | VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/kio_version.h" | ||
32 | PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KIOConfigVersion.cmake" | 33 | PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KIOConfigVersion.cmake" | ||
33 | SOVERSION 5) | 34 | SOVERSION 5) | ||
34 | 35 | | |||
35 | option(KIOCORE_ONLY "Only compile KIOCore, not KIOWidgets or anything that depends on it. This will disable support for cookies and passwordhandling (prompting and storing)." OFF) | 36 | option(KIOCORE_ONLY "Only compile KIOCore, not KIOWidgets or anything that depends on it. This will disable support for cookies and passwordhandling (prompting and storing)." OFF) | ||
36 | option(KIO_FORK_SLAVES "If set we start the slaves via QProcess. It's also possible to change this by setting the environment variable KDE_FORK_SLAVES." OFF) | 37 | option(KIO_FORK_SLAVES "If set we start the slaves via QProcess. It's also possible to change this by setting the environment variable KDE_FORK_SLAVES." OFF) | ||
37 | 38 | | |||
38 | # Enable state assertion by default on Jenkins. | 39 | # Enable state assertion by default on Jenkins and from-git builds. | ||
39 | # This option should eventually be dropped and always be enabled. | 40 | # This option should eventually be dropped and always be enabled. | ||
40 | set(ASSERT_SLAVE_STATES_DEFAULT OFF) | 41 | set(ASSERT_SLAVE_STATES_DEFAULT OFF) | ||
41 | if(DEFINED ENV{JENKINS_SERVER_COOKIE}) | 42 | if(DEFINED ENV{JENKINS_SERVER_COOKIE} OR ECM_SOURCE_UNDER_VERSION_CONTROL) | ||
42 | set(ASSERT_SLAVE_STATES_DEFAULT ON) | 43 | set(ASSERT_SLAVE_STATES_DEFAULT ON) | ||
43 | endif() | 44 | endif() | ||
44 | option(KIO_ASSERT_SLAVE_STATES | 45 | option(KIO_ASSERT_SLAVE_STATES | ||
45 | "Used to control whether slave state assertions are enabled. When not enabled only warnings are generated." | 46 | "Used to control whether slave state assertions are enabled. When not enabled only warnings are generated." | ||
46 | ${ASSERT_SLAVE_STATES_DEFAULT}) | 47 | ${ASSERT_SLAVE_STATES_DEFAULT}) | ||
47 | if(KIO_ASSERT_SLAVE_STATES AND NOT CMAKE_BUILD_TYPE MATCHES "[Dd]ebug$") | | |||
48 | message(FATAL_ERROR "KIO_ASSERT_SLAVE_STATES option enabled but not a Debug build. This makes no sense!") | | |||
49 | endif() | | |||
50 | 48 | | |||
dfaure: It does, but people can still pass -DCMAKE_BUILD_TYPE=Release, or RelWithDebInfo (as I do for… | |||||
Well, at that point you can choose to:
If you don't want that I'd actually get rid of the warning altogether. Determining what a given build type does isn't so reliably doable as users may have custom build types that define whatever, so the warning is more of a crutch than anything. sitter: Well, at that point you can choose to:
- explicitly -DASSERT_SLAVE_STATES_DEFAULT=OFF which… | |||||
Please kill the warning then. dfaure: Please kill the warning then.
I want things to be simple for new developers. Having to find out… | |||||
51 | option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) | 49 | option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) | ||
52 | add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") | 50 | add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") | ||
53 | 51 | | |||
54 | option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON) | 52 | option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON) | ||
55 | add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer") | 53 | add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer") | ||
56 | 54 | | |||
57 | find_package(KF5Archive ${KF5_DEP_VERSION} REQUIRED) | 55 | find_package(KF5Archive ${KF5_DEP_VERSION} REQUIRED) | ||
58 | find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) | 56 | find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) | ||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |
It does, but people can still pass -DCMAKE_BUILD_TYPE=Release, or RelWithDebInfo (as I do for profiling).
Won't this give them the warning below then, even if they don't set the KIO_ASSERT_SLAVE_STATES option)?
I would just set ASSERT_SLAVE_STATES_DEFAULT to OFF when the build type isn't Debug.
(i.e. checking for that as part of the condition on line 42)