Skip to content

Commit

Permalink
use GNU directory structure on non-Windows systems
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Aug 22, 2019
1 parent 7d8c206 commit 218d849
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 30 deletions.
18 changes: 10 additions & 8 deletions CMakeLists.txt
Expand Up @@ -144,15 +144,16 @@ endif()

if(WIN32)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "Installation root directory")
else(WIN32)
set(CMAKE_INSTALL_BINDIR bin CACHE PATH "Output directory for executables")
set(CMAKE_INSTALL_DATADIR data CACHE PATH "Output directory for data and resource files")
set(CMAKE_INSTALL_INCLUDEDIR include CACHE PATH "Output directory for header files")
set(CMAKE_INSTALL_DOCDIR doc CACHE PATH "Output directory for documentation and license files")
# Don't set it without manual adoption of LibDir variable in src/App/FreeCADInit.py
set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
else()
set(CMAKE_INSTALL_PREFIX "/usr/lib${LIB_SUFFIX}/freecad" CACHE PATH "Installation root directory")
endif(WIN32)

set(CMAKE_INSTALL_DATADIR data CACHE PATH "Output directory for data and resource files")
set(CMAKE_INSTALL_INCLUDEDIR include CACHE PATH "Output directory for header files")
set(CMAKE_INSTALL_DOCDIR doc CACHE PATH "Output directory for documentation and license files")
# Don't set it without manual adoption of LibDir variable in src/App/FreeCADInit.py
set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
include(GNUInstallDirs)
endif()

set(PYCXX_INCLUDE_DIR
"${CMAKE_SOURCE_DIR}/src" CACHE PATH
Expand All @@ -166,6 +167,7 @@ set(RESOURCEDIR "${CMAKE_INSTALL_DATADIR}")
set(DOCDIR "${CMAKE_INSTALL_DOCDIR}")

message(STATUS "prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "bindir: ${CMAKE_INSTALL_BINDIR}")
message(STATUS "datadir: ${CMAKE_INSTALL_DATADIR}")
message(STATUS "docdir: ${CMAKE_INSTALL_DOCDIR}")
message(STATUS "includedir: ${CMAKE_INSTALL_INCLUDEDIR}")
Expand Down
8 changes: 4 additions & 4 deletions src/3rdParty/salomesmesh/CMakeLists.txt
Expand Up @@ -403,8 +403,8 @@ endif (BUILD_FEM_NETGEN)

if(WIN32)
INSTALL(TARGETS SMDS Driver DriverSTL DriverDAT DriverUNV SMESHDS SMESH MEFISTO2 StdMeshers
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else(WIN32)
INSTALL(TARGETS SMDS Driver DriverSTL DriverDAT DriverUNV SMESHDS SMESH MEFISTO2 StdMeshers
Expand All @@ -415,8 +415,8 @@ endif(WIN32)
if (BUILD_FEM_NETGEN)
if(WIN32)
INSTALL(TARGETS NETGENPlugin
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else(WIN32)
INSTALL(TARGETS NETGENPlugin
Expand Down
2 changes: 1 addition & 1 deletion src/App/CMakeLists.txt
Expand Up @@ -299,7 +299,7 @@ SET_BIN_DIR(FreeCADApp FreeCADApp)

if(WIN32)
INSTALL(TARGETS FreeCADApp
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion src/Base/CMakeLists.txt
Expand Up @@ -398,7 +398,7 @@ SET_BIN_DIR(FreeCADBase FreeCADBase)

if(WIN32)
INSTALL(TARGETS FreeCADBase
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else(WIN32)
Expand Down
27 changes: 17 additions & 10 deletions src/Gui/CMakeLists.txt
Expand Up @@ -1323,21 +1323,28 @@ SET_BIN_DIR(FreeCADGui FreeCADGui)

if(WIN32)
INSTALL(TARGETS FreeCADGui
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else(WIN32)
INSTALL(TARGETS FreeCADGui
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
INSTALL(FILES Icons/freecad.xpm
Icons/freecad-icon-16.png
Icons/freecad-icon-32.png
Icons/freecad-icon-48.png
Icons/freecad-icon-64.png
Icons/freecad.svg
Icons/freecad-doc.png
DESTINATION ${CMAKE_INSTALL_DATADIR}
)
#INSTALL(FILES Icons/freecad.xpm
# Icons/freecad-icon-16.png
# Icons/freecad-icon-32.png
# Icons/freecad-icon-48.png
# Icons/freecad-icon-64.png
# Icons/freecad.svg
# Icons/freecad-doc.png
# DESTINATION ${CMAKE_INSTALL_DATADIR}
#)
INSTALL(FILES Icons/freecad-icon-16.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps RENAME freecad.png)
INSTALL(FILES Icons/freecad-icon-32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps RENAME freecad.png)
INSTALL(FILES Icons/freecad-icon-48.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps RENAME freecad.png)
INSTALL(FILES Icons/freecad-icon-64.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps RENAME freecad.png)
INSTALL(FILES Icons/freecad.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
INSTALL(FILES Icons/freecad.xpm DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
INSTALL(FILES Icons/freecad-doc.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes RENAME application-x-extension-fcstd.svg)
endif(WIN32)

12 changes: 6 additions & 6 deletions src/Main/CMakeLists.txt
Expand Up @@ -54,7 +54,7 @@ if(BUILD_GUI)

if(WIN32)
INSTALL(TARGETS FreeCADMain
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
elseif(APPLE AND NOT BUILD_WITH_CONDA)
Expand All @@ -64,7 +64,7 @@ if(BUILD_GUI)
)
else()
INSTALL(TARGETS FreeCADMain
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()
endif(BUILD_GUI)
Expand Down Expand Up @@ -107,7 +107,7 @@ SET_BIN_DIR(FreeCADMainCmd FreeCADCmd)

if(WIN32)
INSTALL(TARGETS FreeCADMainCmd
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
elseif(APPLE AND NOT BUILD_WITH_CONDA)
Expand All @@ -117,7 +117,7 @@ elseif(APPLE AND NOT BUILD_WITH_CONDA)
)
else()
INSTALL(TARGETS FreeCADMainCmd
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()

Expand All @@ -136,7 +136,7 @@ SET_PYTHON_PREFIX_SUFFIX(FreeCADMainPy)

if(WIN32)
INSTALL(TARGETS FreeCADMainPy
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else(WIN32)
Expand Down Expand Up @@ -167,7 +167,7 @@ if(BUILD_GUI)

if(WIN32)
INSTALL(TARGETS FreeCADGuiPy
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else(WIN32)
Expand Down

0 comments on commit 218d849

Please sign in to comment.