diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-11-27 01:35:15 -0500 |
---|---|---|
committer | Michael Hirsch, Ph.D <10931741+scivision@users.noreply.github.com> | 2019-12-09 11:15:58 -0500 |
commit | 98fd4e5557cb21affd2e2c124a132953b471a748 (patch) | |
tree | b350f0499b18795c89378790074a790488a3c351 /test cases | |
parent | 419a7a8f51fb68cdd40f7005394590a0963d3f32 (diff) | |
download | meson-98fd4e5557cb21affd2e2c124a132953b471a748.zip meson-98fd4e5557cb21affd2e2c124a132953b471a748.tar.gz meson-98fd4e5557cb21affd2e2c124a132953b471a748.tar.bz2 |
cmake: add project language to cmakelists.txt
cmake: get language from Meson project if not specified as depedency(..., langugage: ...)
deps: add threads method:cmake
dependency('threads', method: 'cmake') is useful for cmake unit tests
or those who just want to find threads using cmake.
cmake: project(... Fortran) generally also requires C language
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/cmake/14 fortran threads/meson.build | 9 | ||||
-rw-r--r-- | test cases/frameworks/1 boost/meson.build | 1 | ||||
-rw-r--r-- | test cases/frameworks/2 gtest/meson.build | 1 | ||||
-rw-r--r-- | test cases/linuxlike/13 cmake dependency/meson.build | 4 |
4 files changed, 14 insertions, 1 deletions
diff --git a/test cases/cmake/14 fortran threads/meson.build b/test cases/cmake/14 fortran threads/meson.build new file mode 100644 index 0000000..f160ca8 --- /dev/null +++ b/test cases/cmake/14 fortran threads/meson.build @@ -0,0 +1,9 @@ +project('FortranThreads') + +if not add_languages('fortran', required: false) + error('MESON_SKIP_TEST: Fortran language not available.') +endif + +# want to be sure that CMake can find dependencies where even if the +# project isn't C, the C language is required to find the library. +threads = dependency('threads', method: 'cmake', required: true) diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build index 8f45dc7..4526c30 100644 --- a/test cases/frameworks/1 boost/meson.build +++ b/test cases/frameworks/1 boost/meson.build @@ -1,3 +1,4 @@ +# this test requires the following on Ubuntu: libboost-{system,python,log,thread,test}-dev project('boosttest', 'cpp', default_options : ['cpp_std=c++11']) diff --git a/test cases/frameworks/2 gtest/meson.build b/test cases/frameworks/2 gtest/meson.build index 3f30215..2d93b52 100644 --- a/test cases/frameworks/2 gtest/meson.build +++ b/test cases/frameworks/2 gtest/meson.build @@ -1,3 +1,4 @@ +# on Ubuntu this test requires libgtest-dev project('gtest', 'cpp') gtest = dependency('gtest', main : true, required : false) diff --git a/test cases/linuxlike/13 cmake dependency/meson.build b/test cases/linuxlike/13 cmake dependency/meson.build index 682d6d8..7753550 100644 --- a/test cases/linuxlike/13 cmake dependency/meson.build +++ b/test cases/linuxlike/13 cmake dependency/meson.build @@ -1,3 +1,5 @@ +# this test can ONLY be run successfully from run_project_test.py +# due to use of setup_env.json project('external CMake dependency', 'c') if not find_program('cmake', required: false).found() @@ -37,7 +39,7 @@ depf2 = dependency('ZLIB', required : false, method : 'cmake', modules : 'dfggh: assert(depf2.found() == false, 'Invalid CMake targets should fail') # Try to find cmMesonTestDep in a custom prefix - +# setup_env.json is used by run_project_tests.py:_run_test to point to ./cmake_pref_env/ depPrefEnv = dependency('cmMesonTestDep', required : true, method : 'cmake') # Try to find a dependency with a custom CMake module |