Use GNUInstallDirs CMake module when installing files.

This should handle platform conventions more correctly, especially
on 64-bit or multiarch systems.
pull/4/head
whitequark 2016-02-17 06:22:34 +00:00
parent 7c2ec8f80e
commit 575146b975
1 changed files with 14 additions and 10 deletions

View File

@ -1,5 +1,7 @@
# global # global
include(GNUInstallDirs)
include_directories( include_directories(
${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}
${PNG_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS}
@ -69,8 +71,8 @@ set_target_properties(slvs PROPERTIES
if(NOT WIN32) if(NOT WIN32)
install(TARGETS slvs install(TARGETS slvs
LIBRARY DESTINATION lib/${CMAKE_LIBRARY_PATH} # multiarch LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION include) PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif() endif()
# generated files # generated files
@ -347,18 +349,20 @@ if(APPLE)
DEPENDS ${CMAKE_BINARY_DIR}/${bundle}.dmg) DEPENDS ${CMAKE_BINARY_DIR}/${bundle}.dmg)
endif() endif()
install(TARGETS solvespace if(NOT WIN32)
RUNTIME DESTINATION bin install(TARGETS solvespace
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION .) BUNDLE DESTINATION .)
endif()
install(FILES unix/solvespace.desktop install(FILES unix/solvespace.desktop
DESTINATION share/applications) DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
foreach(SIZE 16x16 24x24 32x32 48x48) foreach(SIZE 16x16 24x24 32x32 48x48)
install(FILES unix/solvespace-${SIZE}.png install(FILES unix/solvespace-${SIZE}.png
DESTINATION share/icons/hicolor/${SIZE}/apps DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/apps
RENAME solvespace.png) RENAME solvespace.png)
install(FILES unix/solvespace-${SIZE}.png install(FILES unix/solvespace-${SIZE}.png
DESTINATION share/icons/hicolor/${SIZE}/mimetypes DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/mimetypes
RENAME application.x-solvespace.png) RENAME application.x-solvespace.png)
endforeach() endforeach()