qt5base-lts/tests/manual/cmake/CMakeLists.txt
Stephen Kelly a482487b9f Install CMake config files from Qt.
This includes a BSD licenced file Qt5CoreMacros.cmake which is
adapted from Qt4Macros.cmake in the CMake source tree.

Change-Id: I54326b808795535490a0489659b351a8da72cdbb
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-11-29 17:08:39 +01:00

32 lines
696 B
CMake

cmake_minimum_required(VERSION 2.8)
project(qmake_cmake_files)
macro(_do_build _dir)
try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/${_dir}
${CMAKE_CURRENT_SOURCE_DIR}/${_dir}
${_dir}
OUTPUT_VARIABLE Out
)
endmacro()
macro(expect_pass _dir)
_do_build(${_dir})
if (NOT Result)
message(SEND_ERROR "Build failed: ${Out}")
endif()
endmacro()
macro(expect_fail _dir)
_do_build(${_dir})
if (Result)
message(SEND_ERROR "Build should fail, but did not: ${Out}")
endif()
endmacro()
# Requires a patched cmake for the automoc stuff. Will uncomment when it is released.
# expect_pass(pass1)
expect_pass(pass2)
expect_pass(pass3)