diff options
Diffstat (limited to 'meson/test cases/cmake/23 cmake toolchain')
5 files changed, 57 insertions, 0 deletions
diff --git a/meson/test cases/cmake/23 cmake toolchain/CMakeToolchain.cmake b/meson/test cases/cmake/23 cmake toolchain/CMakeToolchain.cmake new file mode 100644 index 000000000..ab5fbace1 --- /dev/null +++ b/meson/test cases/cmake/23 cmake toolchain/CMakeToolchain.cmake @@ -0,0 +1 @@ +set(MESON_TEST_VAR2 VAR2) diff --git a/meson/test cases/cmake/23 cmake toolchain/meson.build b/meson/test cases/cmake/23 cmake toolchain/meson.build new file mode 100644 index 000000000..8399597a5 --- /dev/null +++ b/meson/test cases/cmake/23 cmake toolchain/meson.build @@ -0,0 +1,13 @@ +project('cmake toolchain test', ['c']) + +if meson.is_cross_build() + error('MESON_SKIP_TEST: skip this on cross builds') +endif + +cm = import('cmake') + +sub_pro = cm.subproject('cmMod') + +add_languages('cpp') + +sub_pro = cm.subproject('cmModFortran') diff --git a/meson/test cases/cmake/23 cmake toolchain/nativefile.ini.in b/meson/test cases/cmake/23 cmake toolchain/nativefile.ini.in new file mode 100644 index 000000000..1f4037de3 --- /dev/null +++ b/meson/test cases/cmake/23 cmake toolchain/nativefile.ini.in @@ -0,0 +1,9 @@ +[properties] + +cmake_toolchain_file = '@MESON_TEST_ROOT@/CMakeToolchain.cmake' +cmake_skip_compiler_test = 'always' + +[cmake] + +MESON_TEST_VAR1 = 'VAR1 space' +MESON_TEST_VAR2 = 'VAR2 error' diff --git a/meson/test cases/cmake/23 cmake toolchain/subprojects/cmMod/CMakeLists.txt b/meson/test cases/cmake/23 cmake toolchain/subprojects/cmMod/CMakeLists.txt new file mode 100644 index 000000000..a00affaeb --- /dev/null +++ b/meson/test cases/cmake/23 cmake toolchain/subprojects/cmMod/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod NONE) + +if(NOT "${MESON_TEST_VAR1}" STREQUAL "VAR1 space") + message(FATAL_ERROR "MESON_TEST_VAR1 -- '${MESON_TEST_VAR1}' != 'VAR1 space'") +endif() + +if(NOT "${MESON_TEST_VAR2}" STREQUAL "VAR2") + message(FATAL_ERROR "MESON_TEST_VAR2 -- '${MESON_TEST_VAR2}' != 'VAR2'") +endif() + +if(NOT DEFINED CMAKE_C_COMPILER_VERSION) + message(FATAL_ERROR "CMAKE_C_COMPILER_VERSION was not defined") +endif() diff --git a/meson/test cases/cmake/23 cmake toolchain/subprojects/cmModFortran/CMakeLists.txt b/meson/test cases/cmake/23 cmake toolchain/subprojects/cmModFortran/CMakeLists.txt new file mode 100644 index 000000000..ecf1737fc --- /dev/null +++ b/meson/test cases/cmake/23 cmake toolchain/subprojects/cmModFortran/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod NONE) + +if(NOT "${MESON_TEST_VAR1}" STREQUAL "VAR1 space") + message(FATAL_ERROR "MESON_TEST_VAR1 -- '${MESON_TEST_VAR1}' != 'VAR1 space'") +endif() + +if(NOT "${MESON_TEST_VAR2}" STREQUAL "VAR2") + message(FATAL_ERROR "MESON_TEST_VAR2 -- '${MESON_TEST_VAR2}' != 'VAR2'") +endif() + +if(NOT DEFINED CMAKE_C_COMPILER_VERSION) + message(FATAL_ERROR "CMAKE_C_COMPILER_VERSION was not defined") +endif() + +if(NOT DEFINED CMAKE_CXX_COMPILER_VERSION) + message(FATAL_ERROR "CMAKE_CXX_COMPILER_VERSION was not defined") +endif() |