delegate handling of multi-config path to CMake (if version 3.20 or later)

This commit is contained in:
Axel Kohlmeyer
2025-01-31 22:50:13 -05:00
parent 52fcfcaab1
commit 3a58f9a5aa
2 changed files with 15 additions and 10 deletions

View File

@ -11,8 +11,17 @@ endif()
target_link_libraries(test_simple_commands PRIVATE lammps GTest::GMock)
add_test(NAME SimpleCommands COMMAND test_simple_commands)
set_tests_properties(SimpleCommands PROPERTIES
ENVIRONMENT "LAMMPS_PLUGIN_BIN_DIR=${CMAKE_BINARY_DIR}")
if(CMAKE_VERSION VERSION_LESS 3.20)
set_tests_properties(SimpleCommands PROPERTIES
ENVIRONMENT "LAMMPS_PLUGIN_DIR=${CMAKE_BINARY_DIR}")
else()
cmake_path(SET LAMMPS_PLUGIN_BIN_DIR NORMALIZE ${CMAKE_BINARY_DIR})
if(CMAKE_CONFIG_TYPE)
cmake_path(APPEND LAMMPS_PLUGIN_BIN_DIR ${CMAKE_CONFIG_TYPE})
endif()
set_tests_properties(SimpleCommands PROPERTIES
ENVIRONMENT "LAMMPS_PLUGIN_DIR=${LAMMPS_PLUGIN_BIN_DIR}")
endif()
add_executable(test_lattice_region test_lattice_region.cpp)
target_link_libraries(test_lattice_region PRIVATE lammps GTest::GMock)