File: RunCMakeTest.cmake

package info (click to toggle)
cmake 4.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,456 kB
  • sloc: ansic: 403,896; cpp: 303,920; sh: 4,105; python: 3,583; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 111; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (44 lines) | stat: -rw-r--r-- 1,620 bytes parent folder | download | duplicates (6)
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
43
44
include(RunCMake)

macro(run_cmake_target test subtest target)
  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
  set(RunCMake_TEST_NO_CLEAN 1)
  run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})

  unset(RunCMake_TEST_BINARY_DIR)
  unset(RunCMake_TEST_NO_CLEAN)
endmacro()

run_cmake(empty_keyword_args)

if(RunCMake_GENERATOR MATCHES "(Ninja|Makefiles)" AND
    NOT RunCMake_GENERATOR MATCHES "(NMake|Borland)")
  set(RunCMake_TEST_OUTPUT_MERGE TRUE)
  if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
    set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
  endif()
  if (RunCMake_GENERATOR MATCHES "Ninja")
    set(VERBOSE -- -v)
  endif()

  run_cmake(genex_LINK_LANGUAGE)
  run_cmake_target(genex_LINK_LANGUAGE interface LinkDirs_exe_interface --config Release ${VERBOSE})
  run_cmake_target(genex_LINK_LANGUAGE basic LinkDirs_exe_c --config Release ${VERBOSE})
  run_cmake_target(genex_LINK_LANGUAGE LINKER_LANGUAGE LinkDirs_exe_cxx --config Release ${VERBOSE})

  run_cmake(genex_LINK_LANG_AND_ID)

  run_cmake_target(genex_LINK_LANG_AND_ID interface LinkDirs_exe_interface --config Release ${VERBOSE})
  run_cmake_target(genex_LINK_LANG_AND_ID basic LinkDirs_exe_c --config Release ${VERBOSE})
  run_cmake_target(genex_LINK_LANG_AND_ID LINKER_LANGUAGE LinkDirs_exe_cxx --config Release ${VERBOSE})


  run_cmake(CMP0099-NEW)
  run_cmake_target(CMP0099-NEW basic LinkDirs_exe ${VERBOSE})

  run_cmake(CMP0099-OLD)
  run_cmake_target(CMP0099-OLD basic LinkDirs_exe ${VERBOSE})

  unset(RunCMake_TEST_OPTIONS)
  unset(RunCMake_TEST_OUTPUT_MERGE)
endif()