1 cmake_minimum_required(VERSION 2.8)
2 project(${RunCMake_TEST} NONE)
3 include(${RunCMake_TEST}.cmake)
5 # This CMakeLists file is *sometimes expected* to result in a configure error.
7 # expect this to succeed:
8 # ../bin/Release/cmake -G Xcode
9 # ../../CMake/Tests/CMakeCommands/build_command
11 # expect this to fail:
12 # ../bin/Release/cmake -DTEST_ERROR_CONDITIONS:BOOL=ON -G Xcode
13 # ../../CMake/Tests/CMakeCommands/build_command
15 # This project exists merely to test the CMake command 'build_command'...
16 # ...even purposefully calling it with known-bad argument lists to cover
17 # error handling code.
24 if(TEST_ERROR_CONDITIONS)
25 # Test with no arguments (an error):
27 message("1. cmd='${cmd}'")
29 # Test with unknown arguments (also an error):
30 build_command(cmd BOGUS STUFF)
31 message("2. cmd='${cmd}'")
33 build_command(cmd STUFF BOGUS)
34 message("3. cmd='${cmd}'")
36 message("(skipping cases 1, 2 and 3 because TEST_ERROR_CONDITIONS is OFF)")
39 # Test the one arg signature with none of the optional KEYWORD arguments:
41 message("4. cmd='${cmd}'")
43 # Test the two-arg legacy signature:
44 build_command(legacy_cmd ${CMAKE_BUILD_TOOL})
45 message("5. legacy_cmd='${legacy_cmd}'")
46 message(" CMAKE_BUILD_TOOL='${CMAKE_BUILD_TOOL}'")
48 # Test the optional KEYWORDs:
49 build_command(cmd CONFIGURATION hoohaaConfig)
50 message("6. cmd='${cmd}'")
52 build_command(cmd PROJECT_NAME hoohaaProject)
53 message("7. cmd='${cmd}'")
55 build_command(cmd TARGET hoohaaTarget)
56 message("8. cmd='${cmd}'")
59 message("9. cmd='${cmd}'")