Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has anyone found a way of using this with CMake's CPack for DragNDrop, TGZ, or productbuild generators on MacOSX? (they seem to reset the icon on the directory) #12

Open
subatomicglue opened this issue Mar 23, 2018 · 3 comments
Labels

Comments

@subatomicglue
Copy link

subatomicglue commented Mar 23, 2018

(apologies for the cmake question, but since image related, perhaps someone here has experienced this)

Has anyone found a way of using this with CMake's CPack for DragNDrop, TGZ, or productbuild generators on MacOSX?

They seem to reset the icon on the directory:

Relevant lines from cmake:

# make
add_library(${PROJECT_NAME} MODULE ${SOURCES} ${RESOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES  BUNDLE true BUNDLE_EXTENSION "vst")
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
      COMMAND fileicon set ${PROJECT_NAME}.vst image.png
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
      COMMENT "..."
   )

# make install
install(DIRECTORY "${PROJECT_NAME}.vst" DESTINATION "install" COMPONENT vstplugin)
install( SCRIPT "PostInstall.cmake" COMPONENT vstplugin)

# make package
set(CPACK_GENERATOR "DragNDrop;TGZ;productbuild")

Here is PostInstall.cmake, which is required or else make install will strip off the icon from the bundle folder.

execute_process( COMMAND fileicon set install/MyPlugin.vst image.png )

So running make generates MyPlugin.vst directory with the image on it, (the add_custom_command step sets it), looks perfect.

Running make install copies the bundle folder with install( DIRECTORY, stripping the image, so I compensate with the PostInstall.cmake which reruns fileicon script from execute_process.

And then the CPack packager generates the .dmg, the .pkg, and the .tgz, which strips the folder image again from all...

Any ideas why CMake is stripping the image? (and how to get it to not do that)

@mklement0
Copy link
Owner

I'm not familiar CMake, but it sounds that it at least by default it ignores HFS (the macOS filesystem's) extended attributes, in which the icon information is stored.

However, there may be ways to opt in: https://cmake.org/cmake/help/v3.0/module/CPackDMG.html

@mklement0
Copy link
Owner

If you can confirm that there is a way to make this work, we can add a summary to the Wiki for this repo.

@subatomicglue
Copy link
Author

Tracking same topic over at cmake's issue tracker as well:
https://gitlab.kitware.com/cmake/cmake/issues/17847

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants