Warning, /frameworks/extra-cmake-modules/tests/KDEPackageAppTemplatesTest/check.cmake.in is written in an unsupported language. File is not indexed.
0001 set(CMAKE_MODULE_PATH "@MODULES_DIR@/../kde-modules")
0002 set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
0003 set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
0004
0005
0006 ###########################################################
0007
0008 macro(check_exists file)
0009 message(STATUS "Checking for ${file}")
0010 if (NOT EXISTS ${file})
0011 message(FATAL_ERROR "File \"${file}\" does not exist")
0012 endif()
0013 endmacro()
0014
0015 message(STATUS "Test: the packaged template has been generated")
0016 check_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid.tar.bz2 )
0017
0018 message(STATUS "Extracting the packaged template")
0019 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid)
0020 execute_process(COMMAND ${CMAKE_COMMAND} -E tar "xvfj" ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid.tar.bz2
0021 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid
0022 RESULT_VARIABLE result
0023 ERROR_VARIABLE error
0024 )
0025
0026 if(NOT result EQUAL 0)
0027 message(FATAL_ERROR "Error extracting the template: ${error}")
0028 endif()
0029
0030 message(STATUS "Test: the packaged template has been correctly extracted")
0031 check_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid/qml-plasmoid.png )
0032 check_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid/qml-plasmoid.kdevtemplate )
0033 check_exists(${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid/package/metadata.desktop )
0034
0035 message(STATUS "Cleaning up generated files")
0036 file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid.tar.bz2 )
0037 file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/qml-plasmoid )