Changeset View
Changeset View
Standalone View
Standalone View
kde-modules/KDECMakeSettings.cmake
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | 180 | function(appstreamtest) | |||
---|---|---|---|---|---|
181 | if(APPSTREAMCLI AND NOT appstreamtest_added) | 181 | if(APPSTREAMCLI AND NOT appstreamtest_added) | ||
182 | set(appstreamtest_added TRUE PARENT_SCOPE) | 182 | set(appstreamtest_added TRUE PARENT_SCOPE) | ||
183 | add_test(NAME appstreamtest COMMAND ${CMAKE_COMMAND} -DAPPSTREAMCLI=${APPSTREAMCLI} -DINSTALL_FILES=${CMAKE_BINARY_DIR}/install_manifest.txt -P ${CMAKE_CURRENT_LIST_DIR}/appstreamtest.cmake) | 183 | add_test(NAME appstreamtest COMMAND ${CMAKE_COMMAND} -DAPPSTREAMCLI=${APPSTREAMCLI} -DINSTALL_FILES=${CMAKE_BINARY_DIR}/install_manifest.txt -P ${CMAKE_CURRENT_LIST_DIR}/appstreamtest.cmake) | ||
184 | else() | 184 | else() | ||
185 | message(STATUS "Could not set up the appstream test. appstreamcli is missing.") | 185 | message(STATUS "Could not set up the appstream test. appstreamcli is missing.") | ||
186 | endif() | 186 | endif() | ||
187 | endfunction() | 187 | endfunction() | ||
188 | 188 | | |||
189 | find_package(Python3 COMPONENTS Interpreter QUIET) | ||||
krop: FindPython3.cmake only exists in CMake >= 3.12.0 | |||||
Right, the feature is just silently ignored in older versions. We can probably switch that to PythonIterp if we want this for older versions as well. But let's first see if this approach actually works and if people will access getting that test forced upon them :) vkrause: Right, the feature is just silently ignored in older versions. We can probably switch that to… | |||||
PythonInterp is also not a solution :) See 6c1db934e in ki18n. CMake 3.5.0 was found acceptable for most frameworks, it would be nice to make it work with this version. krop: PythonInterp is also not a solution :) See 6c1db934e in ki18n.
CMake 3.5.0 was found… | |||||
ugh, I see... so how could we solve this here? run find_package in the ecm cmakelists.txt and configure_file the python exe path into a wrapper for the python script? vkrause: ugh, I see... so how could we solve this here? run find_package in the ecm cmakelists.txt and… | |||||
190 | function(httpcheck) | ||||
191 | if(TARGET Python3::Interpreter AND NOT httpcheck_added) | ||||
192 | set(httpcheck_added TRUE PARENT_SCOPE) | ||||
193 | add_test(NAME httpcheck COMMAND Python3::Interpreter ${CMAKE_CURRENT_LIST_DIR}/httpcheck.py ${CMAKE_SOURCE_DIR}) | ||||
194 | endif() | ||||
195 | endfunction() | ||||
196 | | ||||
189 | if(NOT KDE_SKIP_TEST_SETTINGS) | 197 | if(NOT KDE_SKIP_TEST_SETTINGS) | ||
190 | 198 | | |||
191 | # If there is a CTestConfig.cmake, include CTest. | 199 | # If there is a CTestConfig.cmake, include CTest. | ||
192 | # Otherwise, there will not be any useful settings, so just | 200 | # Otherwise, there will not be any useful settings, so just | ||
193 | # fake the functionality we care about from CTest. | 201 | # fake the functionality we care about from CTest. | ||
194 | 202 | | |||
195 | if (EXISTS ${CMAKE_SOURCE_DIR}/CTestConfig.cmake) | 203 | if (EXISTS ${CMAKE_SOURCE_DIR}/CTestConfig.cmake) | ||
196 | include(CTest) | 204 | include(CTest) | ||
197 | else() | 205 | else() | ||
198 | option(BUILD_TESTING "Build the testing tree." ON) | 206 | option(BUILD_TESTING "Build the testing tree." ON) | ||
199 | if(BUILD_TESTING) | 207 | if(BUILD_TESTING) | ||
200 | enable_testing() | 208 | enable_testing() | ||
201 | appstreamtest() | 209 | appstreamtest() | ||
210 | httpcheck() | ||||
202 | endif () | 211 | endif () | ||
203 | endif () | 212 | endif () | ||
204 | 213 | | |||
205 | endif() | 214 | endif() | ||
206 | 215 | | |||
207 | 216 | | |||
208 | 217 | | |||
209 | ################ Build-related settings ########################### | 218 | ################ Build-related settings ########################### | ||
▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines |
FindPython3.cmake only exists in CMake >= 3.12.0