f3e7a1664a
* cmake-format + miscellaneous tweaks
* Formatted cmake in examples and tests
* Updated linux-ci.yml artifacts naming
* Updated clang-format
* Fixed submodule branches
[ROCm/rocprofiler-systems commit: 6c93674f92]
40 lines
1.2 KiB
CMake
40 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
|
|
|
project(hosttrace-transpose LANGUAGES CXX)
|
|
|
|
find_program(HIPCC_EXECUTABLE NAMES hipcc)
|
|
|
|
if(NOT HIPCC_EXECUTABLE)
|
|
message(AUTHOR_WARNING "hipcc could not be found. Cannot build transpose target")
|
|
return()
|
|
endif()
|
|
|
|
option(TRANSPOSE_USE_MPI "Enable MPI support in transpose exe" ${TIMEMORY_USE_MPI})
|
|
|
|
if(TRANSPOSE_USE_MPI)
|
|
find_package(MPI REQUIRED)
|
|
endif()
|
|
|
|
add_executable(transpose transpose.cpp)
|
|
|
|
if(CMAKE_CXX_COMPILER_IS_CLANG AND TARGET hosttrace::hosttrace-compile-options)
|
|
target_link_libraries(transpose PRIVATE hosttrace::hosttrace-compile-options)
|
|
else()
|
|
target_compile_options(transpose PRIVATE -W -Wall)
|
|
endif()
|
|
|
|
if(TRANSPOSE_USE_MPI)
|
|
target_compile_definitions(transpose PRIVATE USE_MPI)
|
|
target_link_libraries(transpose PRIVATE MPI::MPI_C)
|
|
endif()
|
|
|
|
if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
|
set_target_properties(transpose PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
${CMAKE_BINARY_DIR})
|
|
|
|
if(NOT CMAKE_CXX_COMPILER_IS_HIPCC AND HIPCC_EXECUTABLE)
|
|
# defined in MacroUtilities.cmake
|
|
hosttrace_custom_compilation(COMPILER ${HIPCC_EXECUTABLE} TARGET transpose)
|
|
endif()
|
|
endif()
|