From 2ff522c23fa7e314e0769db4052388ad9f29bc68 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 22 Jun 2023 20:27:31 +1000 Subject: [PATCH] CMake: show install hint for ninja as well as make Use the absolute destination path in the message too as the path relative to the CMAKE_INSTALL_PREFIX isn't so meaningful. --- source/creator/CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 7a0c860acc9..f3ba78490fc 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -547,16 +547,24 @@ if(WIN32) endif() endif() -# Helpful tip when using make. +# Show helpful tip. +set(_install_cmd "") if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*") + set(_install_cmd "make install") +elseif("${CMAKE_GENERATOR}" MATCHES "Ninja") + set(_install_cmd "ninja install") +endif() +if(NOT ("${_install_cmd}" STREQUAL "")) # Message to display after building. + get_filename_component(_install_dst ${TARGETDIR_VER} ABSOLUTE BASE_DIR ${CMAKE_INSTALL_PREFIX}) add_custom_command( TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND - ${CMAKE_COMMAND} -E - echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}' + COMMAND ${CMAKE_COMMAND} -E echo + "Run: \\\"${_install_cmd}\\\" to copy runtime files and scripts to: ${_install_dst}" ) + unset(_install_dst) endif() +unset(_install_cmd) # macro to help install files without dragging in unnecessary data. macro(install_dir from to)