blob: b6d5f318fdae4f0d66804975cbdcb4ec03333d54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
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)
|