Files
rocm-systems/projects/amdsmi/tests/rocm_smi_test/CMakeLists.txt
T
Galantsev, Dmitrii 5a234677fb SWDEV-340919 - Move examples and tests install dir
Previous install locations:
- /opt/rocm/share/example/amd-smi
- /opt/rocm/share/tests/amd-smi

New install locations:
- /opt/rocm/share/amd_smi/example
- /opt/rocm/share/amd_smi/tests

Change-Id: I305477b9f66bdc5963923efe6da1c01f87ea2085
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 6ee793ca03]
2023-01-20 09:49:56 -06:00

65 lines
1.9 KiB
CMake
Executable File

# Required Defines first:
option(INSTALL_GTEST "Install GTest (only useful if GTest is not already installed)" OFF)
# Try to find googletest
find_package(GTest 1.12.0)
# GTest_FOUND is set to TRUE if ANY version is found
# GTest_VERSION is set if 1.11.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)
endif()
enable_testing()
if(WIN32)
message("amd_smi library test suite is not supported on Windows platform")
return()
endif()
#
# Print out the build configuration being used:
#
# Build Src directory
# Build Binary directory
# Build Type: Debug Vs Release
# Compiler Version, etc
#
message("")
message("Build Configuration:")
message("-----------BuildType: " ${CMAKE_BUILD_TYPE})
message("------------Compiler: " ${CMAKE_CXX_COMPILER})
message("-------------Version: " ${CMAKE_CXX_COMPILER_VERSION})
message("--------Proj Src Dir: " ${PROJECT_SOURCE_DIR})
message("--------Proj Bld Dir: " ${PROJECT_BINARY_DIR})
message("--------Proj Lib Dir: " ${PROJECT_BINARY_DIR}/lib)
message("--------Proj Exe Dir: " ${PROJECT_BINARY_DIR}/bin)
message("")
# Other source directories
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/functional functionalSources)
set(TEST "rsmitst64")
# Source files
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} tstSources)
# Header file include path
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
# Build rules
add_executable(${TEST} ${tstSources} ${functionalSources})
target_link_libraries(${TEST} rocm_smi64 c stdc++ pthread GTest::gtest_main)
#install(
# TARGETS ${TEST}
# DESTINATION ${SHARE_INSTALL_PREFIX}/tests
# COMPONENT tests)