diff --git a/CMakeLists.txt b/CMakeLists.txt index 871b431545..60aa7fc63a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,7 @@ file(RELATIVE_PATH relDir set(CMAKE_INSTALL_RPATH ${base} ${base}/${relDir}) include(BuildType) +include(BuildInfo) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git AND NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit) message(WARNING @@ -125,3 +126,5 @@ add_custom_target(Github SOURCES .github/workflows/package-windows-msys2.yml .github/workflows/clang-tidy.yml ) + +mrtrix_print_build_instructions() diff --git a/cmake/BuildInfo.cmake b/cmake/BuildInfo.cmake new file mode 100644 index 0000000000..8e6b061163 --- /dev/null +++ b/cmake/BuildInfo.cmake @@ -0,0 +1,15 @@ +function(mrtrix_print_build_instructions) + set(message_list "\n") + file(RELATIVE_PATH relative_build_path "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}") + list(APPEND message_list "MRtrix3 has been successfully configured for compilation.") + list(APPEND message_list "To build it, run 'cmake --build ${relative_build_path}'") + + list(APPEND message_list "To reconfigure the project, run CMake again with the same arguments.") + list(APPEND message_list "If reconfiguration fails, remove the CMakeCache.txt file in the build " + "directory or run CMake adding the --fresh flag.") + list(APPEND message_list "\n") + + # Remove ; from list and add two spaces to the beginning of each line + string(REPLACE ";" "\n " message_list "${message_list}") + message(STATUS "${message_list}") +endfunction()