I have been studying an example, by Ivan Onyshenko, which demonstrates how to use fixup_bundle
and how cmake and cpack can create, for macOS, a bundle and also copy .dylib
dependencies into that bundle.
That’s all fine. Now, in that CMakeLists.tx
file there’s some code like the following:
set(APPS "\${CMAKE_INSTALL_PREFIX}/${APP_NAME}.app")
# Directories to look for dependencies
set(DIRS "${CMAKE_BINARY_DIR}")
install(CODE "include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\")")
This works fine.
My question is: is it possible, in this case, to use bracket arguments in fixup_bundle
. I can’t seem to get it right.
I’ve tried to convert to the following without success:
install(CODE [[
include(BundleUtilities)
fixup_bundle("${APPS}" "" "${DIRS}")
]])
And then I read somewhere that only ${CMAKE_INSTALL_PREFIX}
and generator expressions work in bracketted code. But even in this case, it doesn’t work:
install(CODE [[
include(BundleUtilities)
fixup_bundle(
"${CMAKE_INSTALL_PREFIX}/PortableApp.app"
""
"${CMAKE_INSTALL_PREFIX}")
]])
So are bracket arguments usable in this context? If not, how to avoid all this escaping which I personally find tedious and error-prone?