Skip to content

Commit

Permalink
Remove extraneous Mac browser app aliases
Browse files Browse the repository at this point in the history
- Should handle Finder pref set to hide extensions (e.g. missing .app)
  • Loading branch information
dakcarto committed Oct 12, 2012
1 parent 6fcd937 commit f230f51
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions images/icons/mac/browser/CMakeLists.txt
Expand Up @@ -2,10 +2,8 @@
FILE (GLOB ICONS *.icns)
INSTALL (FILES ${ICONS}
DESTINATION "${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/QGIS Browser.app/Contents/Resources")
# create alias now, so alias file gets correct icon, delete first if it exists
# could be more than one alias if previous build failed
FILE (GLOB ALIASES "$ENV{DESTDIR}${QGIS_INSTALL_PREFIX}/QGIS Browser.app*")
FOREACH(browserAlias ${ALIASES})
FILE (REMOVE "${browserAlias}")
ENDFOREACH(browserAlias)
INSTALL (CODE "EXECUTE_PROCESS(COMMAND osascript -e \"tell application \\\"Finder\\\" to make alias file to POSIX file \\\"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/QGIS Browser.app\\\" at POSIX file \\\"$ENV{DESTDIR}${QGIS_INSTALL_PREFIX}/\\\"\")")

# create alias now, so alias file gets correct icon, delete first if any exist
SET (BROWSERNAME "QGIS Browser")
INSTALL (CODE "EXECUTE_PROCESS(COMMAND /usr/bin/find \"$ENV{DESTDIR}${QGIS_INSTALL_PREFIX}\" -name \"${BROWSERNAME}*\" -maxdepth 1 -type f -delete)")
INSTALL (CODE "EXECUTE_PROCESS(COMMAND /usr/bin/osascript -e \"tell application \\\"Finder\\\" to make alias file to POSIX file \\\"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/${BROWSERNAME}.app\\\" at POSIX file \\\"$ENV{DESTDIR}${QGIS_INSTALL_PREFIX}/\\\"\")")

0 comments on commit f230f51

Please sign in to comment.