Skip to content

Commit

Permalink
solved Desktop shortcut problem, VC redistributables and automatic in…
Browse files Browse the repository at this point in the history
…stall of path.lua
  • Loading branch information
CRiSTiK24 committed Jul 10, 2022
1 parent 4e0fb19 commit 56d794f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
47 changes: 28 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,52 @@ find_file(
/usr/bin
DOC "Path to clang-tidy executable"
)
#================================================
#Copy path.lua. It will have the following contents:
#package.path = package.path .. ';../finalInstallDir/usr/share/librecad/lcUILua/?.lua'
#ui_path='../finalInstallDir/usr/share/librecad/lcUI/ui'
#plugin_path='../finalInstallDir/usr/share/librecad/lcUILua/plugins'
#lua_path='../finalInstallDir/usr/share/librecad/lcUILua'
#If any path is changed, it'll will have to be changed too
#================================================
install(FILES ${CMAKE_SOURCE_DIR}/path.lua
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Install all needed files in windows and set up some cpack variables
IF (WIN32)

#Cpack -> NSIS
#General Vars
set(CPACK_PACKAGE_NAME "LibreCAD 3")
set(CPACK_PACKAGE_NAME "LibreCAD3")
set(CPACK_PACKAGE_VENDOR "LibreCAD")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "1")
set(CPACK_PACKAGE_VERSION_PATCH "1")
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}) #name of the install folder
set(CPACK_PACKAGE_DESCRIPTION "LibreCAD is a free Open Source CAD application for Windows, Apple and Linux. Support and documentation are free from our large, dedicated community of users, contributors and developers.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source 2D-CAD")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://librecad.org/")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
#NSIS Vars
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON")
set(CPACK_NSIS_MODIFY_PATH "ON")
set(CPACK_CREATE_DESKTOP_LINKS "ON")
set(CPACK_NSIS_DISPLAY_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_NSIS_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_NSIS_HELP_LINK "https://github.com/LibreCAD/LibreCAD_3")
set(CPACK_NSIS_URL_INFO_ABOUT ${CPACK_PACKAGE_HOMEPAGE_URL})
set(CPACK_NSIS_CONTACT "https://librecad.zulipchat.com/login/")
set(CPACK_NSIS_FINISH_TITLE "Thanks for installing LibreCAD 3")
#For the shortcut
set(CPACK_PACKAGE_EXECUTABLES
"librecad" "Librecad shortcut"
)
set(CPACK_CREATE_DESKTOP_LINKS
"librecad"
)
include(CPack)

# copy built bin to the installer in Windows
IF (WIN32)

install(
DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
DESTINATION ${CMAKE_INSTALL_BINDIR}/.. # Since we get the folder(bin) instead of the files, we must "paste" to the root install folder
Expand All @@ -207,19 +229,6 @@ install(
DIRECTORY ${CMAKE_SOURCE_DIR}/lcviewernoqt/painters/opengl/resources/fonts
DESTINATION ${CMAKE_INSTALL_BINDIR}/../resources
)
#Install Microsoft Visual C++ Redistributable
include(InstallRequiredSystemLibraries)
ENDIF()




# create path.lua in the folder of the installer. This is here and not in lcUILua because ${CMAKE_INSTALL_BINDIR} doasn't work there.
##TODO
#Make lua be created in Librecad folder instead of C:\Program Files\FID\bin

##create correct lua paths for the installer(Right now installs at C:\bin)
install(CODE "file(WRITE \"${CMAKE_INSTALL_BINDIR}/path.lua\"
\"package.path = package.path .. ';${CMAKE_INSTALL_BINDIR}/../${FINAL_INSTALL_DIR}/usr/share/librecad/lcUILua/?.lua' \n\"
\"ui_path='${CMAKE_INSTALL_BINDIR}/../${FINAL_INSTALL_DIR}/usr/share/librecad/lcUI/ui' \n\"
\"plugin_path='${CMAKE_INSTALL_BINDIR}/../${FINAL_INSTALL_DIR}/usr/share/librecad/lcUILua/' \n\"
\"lua_path='${PROJECT_SOURCE_DIR}/lcUILua'\"
)")#\"lua_path='${PROJECT_SOURCE_DIR}/lcUILua'\" originally, but it doesn't have sense for it to point towards the source dir if it has to be exported
2 changes: 1 addition & 1 deletion lcUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ if(WITH_UNITTESTS)
target_link_libraries(lcui ${EXTRA_LIBS})
endif(WITH_UNITTESTS)

add_executable(librecad ${UI_srcs} ${UI_hdrs} ${UI_HEADERS} ${UI_RESOURCES})
add_executable(librecad ${UI_srcs} ${UI_hdrs} ${UI_HEADERS} ${UI_RESOURCES})

qt5_use_modules(librecad Core Gui Widgets OpenGL Svg)

Expand Down
2 changes: 1 addition & 1 deletion lckernel/tinyspline
Submodule tinyspline updated 67 files
+0 −256 .cmake-format.yaml
+17 −159 .github/workflows/ci.yml
+0 −31 .github/workflows/gh-pages.yml
+6 −8 CMakeLists.txt
+2 −1 LICENSE
+157 −84 README.md
+57 −66 docs/CMakeLists.txt
+194 −0 docs/doxygen/DoxygenLayout.xml
+1,321 −0 docs/doxygen/customdoxygen.css
+194 −372 docs/doxygen/doxygen.conf.in
+26 −0 docs/doxygen/footer.html
+55 −0 docs/doxygen/header.html
+18 −12 examples/CMakeLists.txt
+49 −33 examples/c/CMakeLists.txt
+6 −4 examples/cxx/fltk/CMakeLists.txt
+6 −22 examples/cxx/fltk/demo.fl
+2 −2 examples/cxx/fltk/eval.h
+3 −150 examples/cxx/fltk/interpolation.h
+4 −4 examples/cxx/fltk/sample.h
+1 −1 examples/python/quickstart.py
+3 −3 examples/ruby/quickstart.rb
+ res/getting_started.png
+1,350 −1,704 src/CMakeLists.txt
+0 −3 src/pkg/go.mod.in
+2 −6 src/pkg/macosx-relink.sh.in
+3 −3 src/pkg/tinyspline.gemspec.in
+0 −3 src/pkg/tinyspline.rb.in
+0 −50 src/swig/snake_case.swg
+0 −12 src/swig/tinyspline.i
+4 −16 src/swig/tinysplinecsharp.i
+4 −9 src/swig/tinysplinego.i
+4 −45 src/swig/tinysplinejava.i
+3 −2 src/swig/tinysplinelua.i
+2 −1 src/swig/tinysplineoctave.i
+3 −2 src/swig/tinysplinepython.i
+12 −2 src/swig/tinysplineruby.i
+5 −10 src/tinyspline.c
+0 −21 src/tinyspline.h
+12 −43 src/tinysplinecxx.cxx
+3 −9 src/tinysplinecxx.h
+93 −70 test/CMakeLists.txt
+44 −42 test/c/CMakeLists.txt
+2 −2 test/csharp/FrameTest.cs
+1 −1 test/csharp/InterpolationTest.cs
+0 −50 test/csharp/VecTest.cs
+48 −47 test/cxx/CMakeLists.txt
+0 −64 test/cxx/control_points.cxx
+3 −6 test/cxx/frames.cxx
+0 −2 test/cxx/tests.cxx
+3 −3 test/cxx/testutilscxx/CMakeLists.txt
+0 −144 test/go/all_test.go
+0 −10 test/go/go.mod
+0 −11 test/go/go.sum
+1 −0 test/java/src/test/java/org/tinyspline/EnumTest.java
+1 −1 test/java/src/test/java/org/tinyspline/FrameTest.java
+0 −54 test/java/src/test/java/org/tinyspline/VecTest.java
+18 −62 test/lua/tests.lua
+61 −57 test/pkg/CMakeLists.txt
+30 −141 test/python/tests.py
+0 −6 test/ruby/Gemfile
+0 −182 test/ruby/tests.rb
+13 −72 tools/ci/Dockerfile
+1 −1 tools/ci/README.md
+46 −93 tools/ci/build.sh
+6 −50 tools/ci/package.sh
+0 −24 tools/ci/toolchain-mingw64.cmake
+0 −47 tools/release/README.md
4 changes: 4 additions & 0 deletions path.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package.path = package.path .. ';../finalInstallDir/usr/share/librecad/lcUILua/?.lua'
ui_path='../finalInstallDir/usr/share/librecad/lcUI/ui'
plugin_path='../finalInstallDir/usr/share/librecad/lcUILua/plugins'
lua_path='../finalInstallDir/usr/share/librecad/lcUILua'

0 comments on commit 56d794f

Please sign in to comment.