Closed olivier-stasse closed 10 months ago
Hi @olivier-stasse
Your suggested patch would disable the auto-uninstall feature in this scenario.
I suggest (not tried):
if(DEFINED CMAKE_CONFIGURATION_TYPES)
set(UNINSTALL_CONFIG_ARG "--config \${CMAKE_INSTALL_CONFIG_NAME}")
endif()
install(
CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${PROJECT_BINARY_DIR}\" ${UNINSTALL_CONFIG_ARG} --target uninstall)"
)
Since the --config
is only really necessary with multi-config generators (i.e. those that have CMAKE_CONFIGURATION_TYPES
defined) and can be omitted otherwise. In a multi-config generator I don't think it's possible to get an empty CMAKE_INSTALL_CONFIG_NAME
I will try and keep you posted.
Thanks this is working.
I'm closing since this is fixed in #618
Yes. Thx. sorry I should have close it.
Steps to reproduce the problem
Let us use a package using jrl-cmake modules as a cmake git submodule, for instance master_board_sdk, and a ros humble distro.
Compiling is ok, and the installation is going fine, but the output displays this :
Analysis
The error :
disappear if one comments the line
in
./build/master_board_sdk/cmake_install.cmake
It seems to be generated by the file
uninstall.cmake
and more specifically https://github.com/jrl-umi3218/jrl-cmakemodules/blob/47b924b4760b239a75474462c1d6d66f74ba42d8/uninstall.cmake#L55When not specifying a CMAKE_BUILD_TYPE this line fails.
I have a fix here: https://github.com/olivier-stasse/jrl-cmakemodules/blob/cf58b6616b8c28e337d1b55fd3a1e4708b6711d0/uninstall.cmake#L55
Basically if the configuration is empty, the line is not called. Maybe it would be better to not specify the
--config
option if the variable is empty.WDYT ?