diff options
author | Brad King <brad.king@kitware.com> | 2023-03-29 16:33:54 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-29 17:18:30 -0400 |
commit | 0e87e6c1a40f8b5cce76599840c7aac23e183ac3 (patch) | |
tree | 0cad00d85c494746bec5301d1cecf69295667aea | |
parent | ee075a53c883775e8753e0fe6ba240eba9dcaae6 (diff) | |
download | cmake-0e87e6c1a40f8b5cce76599840c7aac23e183ac3.tar.gz |
Tests: Add FindMPI test environment modification option
Provide a way to configure an environment specific to this test.
Avoid setting the environment globally for it in CI jobs.
-rw-r--r-- | .gitlab/ci/configure_fedora37_makefiles.cmake | 1 | ||||
-rw-r--r-- | .gitlab/ci/env_fedora37_makefiles.cmake | 1 | ||||
-rw-r--r-- | Tests/FindMPI/CMakeLists.txt | 3 |
3 files changed, 4 insertions, 1 deletions
diff --git a/.gitlab/ci/configure_fedora37_makefiles.cmake b/.gitlab/ci/configure_fedora37_makefiles.cmake index f5676aa59f..2950eaa174 100644 --- a/.gitlab/ci/configure_fedora37_makefiles.cmake +++ b/.gitlab/ci/configure_fedora37_makefiles.cmake @@ -45,6 +45,7 @@ set(CMake_TEST_FindLibXslt "ON" CACHE BOOL "") set(CMake_TEST_FindMPI_C "ON" CACHE BOOL "") set(CMake_TEST_FindMPI_CXX "ON" CACHE BOOL "") set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "") +set(CMake_TEST_FindMPI_ENVMOD "PATH=path_list_prepend:/usr/lib64/mpich/bin;LD_LIBRARY_PATH=path_list_prepend:/usr/lib64/mpich/lib" CACHE STRING "") set(CMake_TEST_FindMPI "ON" CACHE BOOL "") set(CMake_TEST_FindODBC "ON" CACHE BOOL "") set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "") diff --git a/.gitlab/ci/env_fedora37_makefiles.cmake b/.gitlab/ci/env_fedora37_makefiles.cmake index 2bcb6d04cc..ef13cda7b5 100644 --- a/.gitlab/ci/env_fedora37_makefiles.cmake +++ b/.gitlab/ci/env_fedora37_makefiles.cmake @@ -1,2 +1 @@ set(ENV{MY_RUBY_HOME} "/usr/local/rvm/rubies/ruby-3.0.4") -set(ENV{PATH} "/usr/lib64/mpich/bin:$ENV{PATH}") diff --git a/Tests/FindMPI/CMakeLists.txt b/Tests/FindMPI/CMakeLists.txt index 121d978a80..1bc12c8154 100644 --- a/Tests/FindMPI/CMakeLists.txt +++ b/Tests/FindMPI/CMakeLists.txt @@ -19,3 +19,6 @@ add_test(NAME FindMPI.Test COMMAND -DMPI_TEST_Fortran=${CMake_TEST_FindMPI_FLAG_Fortran} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) +if(CMake_TEST_FindMPI_ENVMOD) + set_property(TEST FindMPI.Test PROPERTY ENVIRONMENT_MODIFICATION ${CMake_TEST_FindMPI_ENVMOD}) +endif() |