Skip to content

Commit

Permalink
Merge pull request #239 from GLVis/cmake-install-fix
Browse files Browse the repository at this point in the history
Fix installation with CMake on non-APPLE platforms
  • Loading branch information
tzanio authored Sep 8, 2022
2 parents 95d29b7 + 92bab4c commit c092dc8
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,27 +316,31 @@ if(NOT EMSCRIPTEN)
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif (MFEM_USE_GNUTLS)

set(GLVIS_APP_ICON ${CMAKE_CURRENT_SOURCE_DIR}/share/GLVis.icns)
set(GLVIS_APP_CREDITS ${CMAKE_CURRENT_SOURCE_DIR}/share/Credits.rtf)
set_source_files_properties(
${GLVIS_APP_ICON} ${GLVIS_APP_CREDITS}
PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")

add_executable(app MACOSX_BUNDLE glvis.cpp ${GLVIS_APP_ICON} ${GLVIS_APP_CREDITS})
set_target_properties(app
PROPERTIES
EXCLUDE_FROM_ALL TRUE
OUTPUT_NAME GLVis
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/share/Info.cmake.plist.in)
target_link_libraries(app PRIVATE glvis glvis_logo)
install(TARGETS app
RUNTIME DESTINATION .
BUNDLE DESTINATION .)
install(CODE [[
include (BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/GLVis.app" "" "")
]] COMPONENT RUNTIME)
if (APPLE)
set(GLVIS_APP_ICON ${CMAKE_CURRENT_SOURCE_DIR}/share/GLVis.icns)
set(GLVIS_APP_CREDITS ${CMAKE_CURRENT_SOURCE_DIR}/share/Credits.rtf)
set_source_files_properties(
${GLVIS_APP_ICON} ${GLVIS_APP_CREDITS}
PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")

add_executable(app MACOSX_BUNDLE glvis.cpp
${GLVIS_APP_ICON} ${GLVIS_APP_CREDITS})
set_target_properties(app
PROPERTIES
EXCLUDE_FROM_ALL TRUE
OUTPUT_NAME GLVis
MACOSX_BUNDLE_INFO_PLIST
${CMAKE_CURRENT_SOURCE_DIR}/share/Info.cmake.plist.in)
target_link_libraries(app PRIVATE glvis glvis_logo)
install(TARGETS app
RUNTIME DESTINATION .
BUNDLE DESTINATION .)
install(CODE [[
include (BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/GLVis.app" "" "")
]] COMPONENT RUNTIME)
endif(APPLE)

endif(NOT EMSCRIPTEN)

Expand Down

0 comments on commit c092dc8

Please sign in to comment.