Upgrade to CXX-17 gtest-1.14 and cmake-3.14

Also change the TARGET from amd_smi_libraries to rocm_smi_libraries
This helps reduce confusion between rocm-smi and amd-smi

Change-Id: Ie54cedd831ba24bd9afc341ad15b7e8e20732059
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
This commit is contained in:
Galantsev, Dmitrii
2023-09-27 17:47:59 -05:00
والد 016dbf8aa3
کامیت cf6bcbbb27
2فایلهای تغییر یافته به همراه28 افزوده شده و 31 حذف شده
@@ -36,24 +36,13 @@ set(CMAKE_INSTALL_RPATH
${CMAKE_INSTALL_RPATH}
${RSMITST_RPATH})
# TODO: Try to find googletest
# DISABLED because we want to install gtest with rocm_smi_lib ourselves
#find_package(GTest 1.12.0)
# GTest_FOUND is set to TRUE if ANY version is found
# GTest_VERSION is set if 1.12.0 or newer version is found
if(NOT GTest_FOUND STREQUAL "TRUE" OR NOT DEFINED GTest_VERSION)
# Google Test wasn't found. Download and compile ourselves
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.0)
FetchContent_MakeAvailable(googletest)
install(TARGETS gtest gtest_main
DESTINATION ${SHARE_INSTALL_PREFIX}/rsmitst_tests
COMPONENT ${TESTS_COMPONENT})
endif()
# Download and compile googletest
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0)
FetchContent_MakeAvailable(googletest)
# Other source directories
aux_source_directory(${SRC_DIR}/functional functionalSources)
@@ -70,13 +59,13 @@ target_include_directories(${RSMITST} PUBLIC ${SRC_DIR}/..)
target_link_libraries(
${RSMITST}
PUBLIC ${ROCM_SMI_TARGET}
PUBLIC gtest
PUBLIC gtest_main
PUBLIC GTest::gtest_main
PUBLIC c
PUBLIC stdc++
PUBLIC pthread
PUBLIC dl)
# install tests
install(TARGETS ${RSMITST}
DESTINATION ${SHARE_INSTALL_PREFIX}/rsmitst_tests
COMPONENT ${TESTS_COMPONENT})
@@ -84,3 +73,9 @@ install(TARGETS ${RSMITST}
install(FILES rsmitst.exclude
DESTINATION ${SHARE_INSTALL_PREFIX}/rsmitst_tests
COMPONENT ${TESTS_COMPONENT})
# install googletest libraries with tests
install(TARGETS gtest gtest_main
DESTINATION ${SHARE_INSTALL_PREFIX}/rsmitst_tests
COMPONENT ${TESTS_COMPONENT})