summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake
blob: 06d48bfe226b0a40c4fa82c19e3eecf0057c3813 (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
32
33
34
35
36
37
38
39
40
41
42
include(RunCMake)

function(run_cmake_build name target)
  if(NOT BUILD_CONFIG)
    set(BUILD_CONFIG Debug)
  endif()
  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
  set(RunCMake_TEST_NO_CLEAN 1)
  run_cmake_command(${name}-${target}-${BUILD_CONFIG}-build ${CMAKE_COMMAND} --build . --config ${BUILD_CONFIG} --target ${target})
endfunction()

set(RunCMake_TEST_OPTIONS -DCMAKE_VERIFY_HEADER_SETS=ON)
if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
  list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
endif()
run_cmake(VerifyHeaderSets)
unset(RunCMake_TEST_OPTIONS)

run_cmake_build(VerifyHeaderSets static_verify_header_sets)
run_cmake_build(VerifyHeaderSets shared_verify_header_sets)
run_cmake_build(VerifyHeaderSets object_verify_header_sets)
run_cmake_build(VerifyHeaderSets interface_verify_header_sets)
run_cmake_build(VerifyHeaderSets exe_verify_header_sets)
run_cmake_build(VerifyHeaderSets export_exe_verify_header_sets)
run_cmake_build(VerifyHeaderSets none_verify_header_sets)
run_cmake_build(VerifyHeaderSets property_off_verify_header_sets)
run_cmake_build(VerifyHeaderSets private_verify_header_sets)
run_cmake_build(VerifyHeaderSets a_h_verify_header_sets)
run_cmake_build(VerifyHeaderSets dir_c_h_verify_header_sets)
run_cmake_build(VerifyHeaderSets dir_cxx_h_verify_header_sets)

if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
  run_cmake_build(VerifyHeaderSets config_verify_header_sets)
  if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
    set(BUILD_CONFIG Release)
    run_cmake_build(VerifyHeaderSets config_verify_header_sets)
    unset(BUILD_CONFIG)
  endif()
endif()

run_cmake_build(VerifyHeaderSets lang_test_c_verify_header_sets)
run_cmake_build(VerifyHeaderSets lang_test_cxx_verify_header_sets)