File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,16 @@ LANGUAGES C Fortran
66
77enable_testing ()
88
9- message (STATUS "CMake ${CMAKE_VERSION} Generator ${CMAKE_GENERATOR} " )
9+ message (STATUS "CMake ${CMAKE_VERSION} Generator ${CMAKE_GENERATOR} Build type ${CMAKE_BUILD_TYPE} " )
1010
1111list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /cmake/Modules)
1212
1313# this has checks that can be reused in other projects as well
1414include (cmake/mpi.cmake)
1515
16+ include (cmake/print_target_props.cmake)
17+ print_target_props(MPI::MPI_Fortran)
18+
1619include (cmake/compilers.cmake)
1720
1821add_subdirectory (test )
Original file line number Diff line number Diff line change 11include (CheckSourceCompiles)
22
33set (MPI_DETERMINE_LIBRARY_VERSION true )
4+
45find_package (MPI REQUIRED COMPONENTS C Fortran)
6+
57message (STATUS "MPI Library Version: ${MPI_C_LIBRARY_VERSION_STRING} " )
68
79# Cray FindMPI.cmake has a bug where the plain CMake variables aren't defined, only imported target is
Original file line number Diff line number Diff line change 1+ execute_process (COMMAND ${CMAKE_COMMAND} --help-property-list
2+ OUTPUT_VARIABLE _props OUTPUT_STRIP_TRAILING_WHITESPACE
3+ )
4+
5+ STRING (REGEX REPLACE "\n " ";" _props "${_props} " )
6+
7+ list (REMOVE_DUPLICATES _props)
8+
9+ function (print_target_props tgt)
10+ if (NOT TARGET ${tgt} )
11+ message (WARNING "Target ${tgt} not found" )
12+ return ()
13+ endif ()
14+
15+ message (STATUS "Target: ${tgt} properties" )
16+ foreach (p IN LISTS _props)
17+ if (p MATCHES "<CONFIG>" AND NOT CMAKE_BUILD_TYPE )
18+ continue ()
19+ endif ()
20+
21+ string (REPLACE "<CONFIG>" "${CMAKE_BUILD_TYPE} " p "${p} " )
22+
23+ get_property (v TARGET ${tgt} PROPERTY "${p} " )
24+ if (v)
25+ message (STATUS "${tgt} ${p} = ${v} " )
26+ endif ()
27+ endforeach ()
28+ endfunction ()
You can’t perform that action at this time.
0 commit comments