I have tried for a while to install a macosx bundle and it just does not seem to work at all.
Everything builds correctly and the macosx bundle in the build directory is all correct but the install directory is just the Info.plist file and nothing else. Whatever I try the actual binary does not get copied into the install directory. I did originally have it installing resources as well and they would also not be copied only the folders for the resources. Am I just using this wrong I can’t find much documentation on this that would suggest I am doing it wrong.
I’ve slimmed down things to the following example:
cmake_minimum_required(VERSION 4.2)
cmake_policy(VERSION 4.2)
project(openloco LANGUAGES CXX VERSION 26.01)
add_executable(OpenLoco MACOSX_BUNDLE "test.cpp")
install(TARGETS OpenLoco
BUNDLE DESTINATION "."
)
test.cpp is just a very basic int main(){return 0;}
You can see the output on Verbose · duncanspumpkin/OpenLoco@6ee6480 · GitHub
-- Installing: /Users/runner/work/OpenLoco/OpenLoco/./artifacts/./OpenLoco.app
-- Installing: /Users/runner/work/OpenLoco/OpenLoco/./artifacts/./OpenLoco.app/Contents
-- Installing: /Users/runner/work/OpenLoco/OpenLoco/./artifacts/./OpenLoco.app/Contents/MacOS
-- Installing: /Users/runner/work/OpenLoco/OpenLoco/./artifacts/./OpenLoco.app/Contents/Info.plist
The only file that is copied is the Info.plist. You can see in the build step though that OpenLoco.app/Contents/MacOS/OpenLoco was created.
I have tried setting all the various plist variables to sensible values as well the above example is just the super condensed version that is the minimal that shows the issue. I’ve also tried it with CMake minimum/policy 3.22.
I could just install the build directory but that would be a bit weird.