Skip to content

Commit

Permalink
Merge pull request LibreCAD#284 from Jedi18/fhs_feature
Browse files Browse the repository at this point in the history
Adding install commands to install LibreCAD while keeping with FHS standards
  • Loading branch information
feragon committed Mar 28, 2020
2 parents 3eb9342 + 4f4e018 commit 86b42a0
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,6 +8,7 @@ lcdemo*
*.so
.idea
build
install
release
CMakeLists.txt.user
playground
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -21,6 +21,9 @@ if (NOT MSVC) # Too much warnings on MSVC
add_definitions("-Wall")
endif()

include(GNUInstallDirs)
set(FINAL_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")

if(EXISTS "${CMAKE_SOURCE_DIR}/conan/conanbuildinfo.cmake")
include(${CMAKE_SOURCE_DIR}/conan/conanbuildinfo.cmake)
set(CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
Expand Down
4 changes: 4 additions & 0 deletions lcUI/CMakeLists.txt
Expand Up @@ -180,3 +180,7 @@ qt5_use_modules(librecad Core Gui Widgets OpenGL Svg)

target_link_libraries(librecad ${EXTRA_LIBS} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lboost_system
${GLEW_LIBRARY})

# INSTALLATION
install(TARGETS librecad DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(DIRECTORY "${CMAKE_SOURCE_DIR}/lcUI/ui" DESTINATION "usr/share/librecad/lcUI")
9 changes: 9 additions & 0 deletions lcUILua/CMakeLists.txt
Expand Up @@ -8,3 +8,12 @@ file(WRITE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/path.lua"
"plugin_path='${PROJECT_SOURCE_DIR}/lcUILua/plugins' \n"
"require 'ui.init'"
)

install(CODE "file(WRITE \"${FINAL_INSTALL_DIR}/${CMAKE_INSTALL_BINDIR}/path.lua\"
\"package.path = package.path .. ';${FINAL_INSTALL_DIR}/usr/share/librecad/lcUILua/?.lua' \n\"
\"ui_path='${FINAL_INSTALL_DIR}/usr/share/librecad/lcUI/ui' \n\"
\"plugin_path='${FINAL_INSTALL_DIR}/usr/share/librecad/lcUILua/plugins' \n\"
\"require 'ui.init'\"
)")

install(DIRECTORY "${CMAKE_SOURCE_DIR}/lcUILua" DESTINATION "${FINAL_INSTALL_DIR}/usr/share/librecad")
4 changes: 2 additions & 2 deletions lcadluascript/CMakeLists.txt
Expand Up @@ -82,5 +82,5 @@ add_library(lcluascript SHARED ${lcluascript_srcs} ${lcluascript_hdrs})
target_link_libraries(lcluascript ${LUA_LIBRARIES} lckernel)

# INSTALLATION
install(TARGETS lcluascript DESTINATION lib)
install(FILES ${lcluascript_hdrs} DESTINATION include)
install(TARGETS lcluascript RUNTIME DESTINATION lib)
install(TARGETS lcluascript RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
4 changes: 2 additions & 2 deletions lckernel/CMakeLists.txt
Expand Up @@ -259,5 +259,5 @@ add_library(lckernel SHARED ${lckernel_srcs} ${lckernel_hdrs})
target_link_libraries(lckernel ${Boost_LIBRARIES} ${APR_LIBRARIES} ${G_EXTRA_LIBS} tinysplinecpp_shared)

# INSTALLATION
install(TARGETS lckernel DESTINATION lib)
install(FILES ${kernel_hdrs} DESTINATION include)
install(TARGETS lckernel RUNTIME DESTINATION lib)
install(TARGETS lckernel RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
4 changes: 4 additions & 0 deletions lcviewernoqt/CMakeLists.txt
Expand Up @@ -213,3 +213,7 @@ ${Boost_LIBRARIES}
${FREETYPE_LIBRARIES}
${PNG_LIBRARIES}
${BZIP2_LIBRARIES})

# INSTALLATION
install(TARGETS lcviewernoqt RUNTIME DESTINATION lib)
install(TARGETS lcviewernoqt RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
4 changes: 2 additions & 2 deletions persistence/CMakeLists.txt
Expand Up @@ -71,5 +71,5 @@ add_library(persistence SHARED ${persistence_srcs} ${persistence_hdrs})
target_link_libraries(persistence lckernel ${Boost_LIBRARIES} ${LIBDXFRW_LIBRARY} ${Boost_LIBRARIES} ${APR_LIBRARIES} ${OPENCAD_LIB})

# INSTALLATION
install(TARGETS persistence DESTINATION lib)
install(FILES ${persistence_hdrs} DESTINATION include)
install(TARGETS persistence RUNTIME DESTINATION lib)
install(TARGETS persistence RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

0 comments on commit 86b42a0

Please sign in to comment.