From af200752331e30672af68b4c729127d7242e66c7 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R" Date: Wed, 5 May 2021 14:17:00 -0600 Subject: [PATCH] fixed clr testing --- gtest/CMakeLists.txt | 5 +++++ tests/CMakeLists.txt | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/gtest/CMakeLists.txt b/gtest/CMakeLists.txt index 53781187..c0bb3fab 100644 --- a/gtest/CMakeLists.txt +++ b/gtest/CMakeLists.txt @@ -16,6 +16,11 @@ gtest_discover_tests(TestIPhreeqcLib) add_executable(TestIPhreeqc TestIPhreeqc.cpp FileTest.cpp) target_link_libraries(TestIPhreeqc IPhreeqc gtest gtest_main) +if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS) + # Setup references for /CLR + set_target_properties(TestIPhreeqc PROPERTIES VS_DOTNET_REFERENCES "${CMAKE_CURRENT_SOURCE_DIR}/../src/phreeqcpp/ZedGraph.dll") +endif() + gtest_discover_tests(TestIPhreeqc) add_executable(TestSelectedOutput TestSelectedOutput.cpp) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 11898cd7..3e09e787 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -33,6 +33,11 @@ SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc) # link target_link_libraries(test_c ${EXTRA_LIBS}) +if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS) + # Setup references for /CLR + set_target_properties(test_c PROPERTIES VS_DOTNET_REFERENCES "${CMAKE_CURRENT_SOURCE_DIR}/../src/phreeqcpp/ZedGraph.dll") +endif() + # test compile and run add_test(TestCompileAndRunC test_c) @@ -63,6 +68,10 @@ SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc) # link target_link_libraries(test_cxx ${EXTRA_LIBS}) +if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS) + # Setup references for /CLR + set_target_properties(test_cxx PROPERTIES VS_DOTNET_REFERENCES "${CMAKE_CURRENT_SOURCE_DIR}/../src/phreeqcpp/ZedGraph.dll") +endif() # test compile and run add_test(TestCompileAndRunCXX test_cxx)