Unverified Commit f33e9bf6 authored by Kristin's avatar Kristin Committed by GitHub
Browse files

Update cmake for gtest again to successfully link against shared libraries (#3699)

* Update meta.yaml to rename conda package to isis from isis3

* Update gtests to link against all the non-isis3 shared libraries built by ISIS

* Update to work on macs

* Update CMakeLists for tests to grab all shared libraries on linux and mac successfully
parent 0bc4f2e1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3,13 +3,16 @@ cmake_minimum_required(VERSION 3.10)
add_dependencies(isis3 isis3)

file(GLOB test_source "${CMAKE_SOURCE_DIR}/tests/*.cpp")
file(GLOB isis_libs "${CMAKE_BINARY_DIR}/lib/lib*")

# Non-ideal temporary solution to link against other shared libraries for mission tests, etc
file(GLOB isis_libs "${CMAKE_BINARY_DIR}/lib/*.so")
file(GLOB isis_mac_libs "${CMAKE_BINARY_DIR}/lib/*.dylib")

# Link runISISTests with what we want to test and the GTest and pthread library
add_executable(runISISTests
               IsisTestMain.cpp
               ${test_source})

target_link_libraries(runISISTests isis3 ${isis_libs} ${ALLLIBS} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} Threads::Threads)
target_link_libraries(runISISTests isis3 ${isis_libs} ${isis_mac_libs} ${ALLLIBS} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} Threads::Threads)

gtest_discover_tests(runISISTests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)