TARGET_BUNDLE_DIR_NAME has incorrect extension
Creating a library bundle correctly has the .bundle
extension, but if you use the TARGET_BUNDLE_DIR_NAME
generator has the incorrect .app
extension
Example:
cmake_minimum_required(VERSION 3.24)
project(bundle)
add_library(bundle MODULE main.cpp)
set_property(TARGET bundle PROPERTY BUNDLE TRUE)
add_custom_command(TARGET bundle POST_BUILD COMMAND echo $<TARGET_BUNDLE_DIR_NAME:bundle>)
Post build output is:
[ 50%] Building CXX object CMakeFiles/bundle.dir/main.cpp.o
[100%] Linking CXX CFBundle shared module bundle.bundle/Contents/MacOS/bundle
bundle.app
[100%] Built target bundle
TARGET_BUNDLE_DIR
has the correct extension so it's just this extra variable that has the issue