summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake
blob: c63ff2e7de9d76493027f08f57c16d91bfbd335c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
include(RunCMake)

function(run_SWIG test)
  cmake_parse_arguments(_SWIG_TEST "" "TARGET" "" ${ARGN})
  if (_SWIG_TEST_TARGET)
    list (INSERT _SWIG_TEST_TARGET 0 --target)
  endif()

  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
  set(RunCMake_TEST_NO_CLEAN 1)
  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
  run_cmake(${test})
  run_cmake_command(${test}-test ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR} ${_SWIG_TEST_TARGET})
endfunction()

run_SWIG(LegacyPython TARGET RunTest)
run_SWIG(LegacyPerl TARGET RunTest)

run_SWIG(BasicPython TARGET RunTest)
run_SWIG(BasicPerl TARGET RunTest)

run_SWIG(MultipleModules)