Component not set in macOS bundle
Hello, consider the following code :
cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
project(bug)
add_executable(foo MACOSX_BUNDLE foo.cpp)
install(
TARGETS foo
BUNDLE DESTINATION .
RUNTIME DESTINATION .
COMPONENT MyComponent
)
running cmake -DCOMPONENT=MyComponent -P cmake_install.cmake
does not install anything.
One can notice that in cmake_install.cmake, the component is set to Unspecified:
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/." TYPE DIRECTORY FILES "/Users/jcelerier/test-bundle/b/foo.app" USE_SOURCE_PERMISSIONS)
endif()
Removing the (useless in that case) RUNTIME DESTINATION .
fixes it, but maybe the install command should warn about that at least ?