Updating build and install rules.

parent 76cdb1e2
......@@ -38,6 +38,9 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_INSTALL_RPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
## #################################################################
## Install prefix
## #################################################################
......
......@@ -61,6 +61,13 @@ target_link_libraries(${PROJECT_NAME} dtkWidgets)
## Bundle setup
## ###################################################################
if(APPLE)
set(${PROJECT_NAME}_RESOURCE_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${${PROJECT_NAME}_RESOURCE_DIR}
COMMAND ${CMAKE_COMMAND} ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.icns ${${PROJECT_NAME}_RESOURCE_DIR})
endif(APPLE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.plist.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.plist)
if(APPLE)
......@@ -71,6 +78,12 @@ endif(APPLE)
## Install rules
## #################################################################
if (UNIX AND NOT APPLE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.desktop.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop)
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION ~/.local/share/applications)
endif(UNIX AND NOT APPLE)
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION modules)
install(TARGETS ${PROJECT_NAME}
BUNDLE DESTINATION bin
......
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Exec=@CMAKE_INSTALL_PREFIX@/bin/@PROJECT_NAME@ %u
Icon=@CMAKE_CURRENT_SOURCE_DIR@/@PROJECT_NAME@.png
Terminal=false
Name=@PROJECT_NAME@
GenericName=@PROJECT_NAME@
Categories=Science, Mathematics, Visualization
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment