Skip to content

Commit

Permalink
merge ci_dev
Browse files Browse the repository at this point in the history
scripts/windows-install/createConanDirAndInstallDependencies.bat
  • Loading branch information
dxli committed Sep 8, 2023
1 parent 0f93428 commit d4e8279
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 19 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ jobs:

- run: setx QT_QPA_PLATFORM_PLUGIN_PATH "${{ env.Qt5_DIR }}\plugins\platforms\"

- run: setx QT_QPA_PLATFORM_PLUGIN_PATH "${{ env.Qt5_DIR }}\plugins\platforms\"
- run: setx QTDIR "${{ env.Qt5_DIR }}\5.15.2\msvc2019_64"

- run: setx QT_QPA_PLATFORM_PLUGIN_PATH "${{ env.Qt5_DIR }}\plugins\platforms\"

- run: ${{ github.workspace }}/scripts/windows-install/addPathVariables.ps1

- run: cd ${{ github.workspace }}
Expand All @@ -79,5 +84,5 @@ jobs:
- name: Uploading exe
uses: actions/[email protected]
with:
path: '${{ github.workspace }}/out/build/windows-default/LibreCAD3**.exe'
path: '${{ github.workspace }}/build/bin/LibreCAD3**.exe'
name: LibreCAD3.exe
34 changes: 31 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.8...3.27)
project(LC)
if (MSVC)
project(LibreCAD3)
else()
project(LC)
endif()

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand All @@ -19,12 +23,36 @@ option(WITH_PERSISTENCE "Build dxf/dwg support" ON)
# Define compiler warnings
if (NOT MSVC) # Too much warnings on MSVC
add_definitions("-Wall")
include(GNUInstallDirs)
endif()

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

if(EXISTS "${CMAKE_SOURCE_DIR}/conan_toolchain.cmake")
#set(FINAL_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
set(FINAL_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
set(CMAKE_INSTALL_BINDIR "bin")

#SET(CPACK_GENERATOR "ZIP;TGZ")
SET(CPACK_BINARY_NSIS True)
SET(CPACK_NSIS_DISPLAY_NAME "LibreCAD3")
set(CPACK_NSIS_PACKAGE_NAME "LibreCAD3")
set(CPACK_PACKAGE_VENDOR "librecad.org")
set(CPACK_PACKAGE_NAME "LibreCAD3")
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR}/build/bin;.")
set(CPACK_BUILD_SOURCE_DIRS "${CMAKE_SOURCE_DIR}/build/bin")

#SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_SOURCE_DIR}/build/bin/librecad.exe")
SET(CPACK_NSIS_PACKAGE_NAME "LibreCAD3")
set(CPACK_CREATE_DESKTOP_LINKS "LibreCAD3")
set(CPACK_PACKAGE_EXECUTABLES "librecad.exe;LibreCAD3")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "LibreCAD3")
set(CPACK_PACKAGE_NAME "LibreCAD3")
set(CPACK_INSTALL_CMAKE_PROJECTS "build/bin/Release;LibreCAD3;ALL;/")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
file(COPY "${CMAKE_SOURCE_DIR}/LICENSE" DESTINATION "${FINAL_INSTALL_DIR}")
include(CPack)

#include(${CMAKE_SOURCE_DIR}/conan_toolchain.cmake)
set(CMAKE_FIND_LIBRARY_PREFIXES "" "lib")

Expand Down Expand Up @@ -125,7 +153,7 @@ if(MSVC)
#SET(Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE(Boost COMPONENTS log log_setup REQUIRED)
find_package(Eigen3 REQUIRED)
message(eigen3:="${Eigen3_INCLUDE_DIR}")
include_directories("${Eigen3_INCLUDE_DIR}")
include_directories("${Eigen3_INCLUDE_DIR}")
message("${CMAKE_SOURCE_DIR}/include")
include_directories("third_party/msvc_dirent")
Expand Down
14 changes: 13 additions & 1 deletion lcUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set(CMAKE_AUTORCC ON)

# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

set(QT_USE_QTOPENGL TRUE)

find_package(Qt5Widgets)
Expand Down Expand Up @@ -295,8 +296,19 @@ if (MSVC)
target_link_libraries(librecad Boost::log Boost::system GLEW::GLEW)
endif()

if (MSVC)
target_link_libraries(librecad Boost::log Boost::system GLEW::GLEW)
message(CMAKE_INSTALL_BINDIR="${CMAKE_INSTALL_BINDIR}")
endif()

# INSTALLATION
install(TARGETS librecad DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(DIRECTORY "${CMAKE_SOURCE_DIR}/lcUI/ui" DESTINATION "usr/share/librecad/lcUI")
if (NOT MSVC)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/lcUI/ui" DESTINATION "usr/share/librecad/lcUI")
else()
install(TARGETS librecad DESTINATION "${FINAL_INSTALL_DIR}")
install(DIRECTORY "${CMAKE_SOURCE_DIR}/build/bin/lcUI/ui" DESTINATION "lcUI")
endif()
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/default_ui_settings.json" DESTINATION "${SETTINGS_PATH}")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/settings_schema.json" DESTINATION "${SETTINGS_PATH}")

13 changes: 13 additions & 0 deletions lcUILua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ file(WRITE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/path.lua"
"plugin_path='${PROJECT_SOURCE_DIR}/lcUILua/plugins' \n"
"lua_path='${PROJECT_SOURCE_DIR}/lcUILua'"
)
if (MSVC)
install(CODE "file(WRITE \"${FINAL_INSTALL_DIR}/${CMAKE_INSTALL_BINDIR}/path.lua\"
\"package.path = package.path .. ';${FINAL_INSTALL_DIR}/lcUILua/?.lua' \n\"
\"ui_path='${FINAL_INSTALL_DIR}/lcUI/ui' \n\"
\"plugin_path='${FINAL_INSTALL_DIR}/lcUILua/plugins' \n\"
\"lua_path='${PROJECT_SOURCE_DIR}/lcUILua'\"
)")

install(DIRECTORY "${CMAKE_SOURCE_DIR}/lcUILua"
DESTINATION "${FINAL_INSTALL_DIR}/"
PATTERN "CMakeLists.txt" EXCLUDE
)
else()
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\"
Expand All @@ -20,3 +32,4 @@ install(DIRECTORY "${CMAKE_SOURCE_DIR}/lcUILua"
DESTINATION "${FINAL_INSTALL_DIR}/usr/share/librecad"
PATTERN "CMakeLists.txt" EXCLUDE
)
endif()
10 changes: 7 additions & 3 deletions lckernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ project(LCKERNEL)

#TODO: Fix this
set(PATTERN_RESOURCE_PATH ${CMAKE_SOURCE_DIR}/res/hatch)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/res/hatch"
DESTINATION "${FINAL_INSTALL_DIR}/usr/share/librecad"
)
if (MSVC)
install(DIRECTORY "${PATTERN_RESOURCE_PATH}"
DESTINATION "${FINAL_INSTALL_DIR}/res" )
else()
install(DIRECTORY "${PATTERN_RESOURCE_PATH}"
DESTINATION "${FINAL_INSTALL_DIR}/usr/share/librecad" )
endif()

#Include TinySpline
add_definitions("-DTINYSPLINE_DOUBLE_PRECISION")
Expand Down
2 changes: 1 addition & 1 deletion lckernel/tinyspline
Submodule tinyspline updated 89 files
+256 −0 .cmake-format.yaml
+12 −0 .dockerignore
+239 −54 .github/workflows/ci.yml
+3 −3 .github/workflows/codeql-analysis.yml
+31 −0 .github/workflows/gh-pages.yml
+2 −2 BUILD.md
+8 −6 CMakeLists.txt
+1 −2 LICENSE
+156 −159 README.md
+66 −57 docs/CMakeLists.txt
+0 −194 docs/doxygen/DoxygenLayout.xml
+0 −1,321 docs/doxygen/customdoxygen.css
+372 −194 docs/doxygen/doxygen.conf.in
+0 −26 docs/doxygen/footer.html
+0 −55 docs/doxygen/header.html
+12 −18 examples/CMakeLists.txt
+33 −49 examples/c/CMakeLists.txt
+14 −7 examples/cxx/fltk/CMakeLists.txt
+22 −6 examples/cxx/fltk/demo.fl
+2 −2 examples/cxx/fltk/eval.h
+150 −3 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,637 −1,321 src/CMakeLists.txt
+117 −87 src/cmake/FindPHP.cmake
+78 −52 src/cmake/TargetArch.cmake
+3 −0 src/pkg/go.mod.in
+0 −23 src/pkg/macosx-relink.sh.in
+3 −3 src/pkg/tinyspline.gemspec.in
+19 −0 src/pkg/tinyspline.lua.in
+3 −0 src/pkg/tinyspline.rb.in
+1 −5 src/pkg/tinyspline.rockspec.in
+50 −0 src/swig/snake_case.swg
+47 −8 src/swig/tinyspline.i
+19 −12 src/swig/tinysplinecsharp.i
+1 −9 src/swig/tinysplinedlang.i
+11 −12 src/swig/tinysplinego.i
+222 −128 src/swig/tinysplinejava.i
+2 −6 src/swig/tinysplinelua.i
+1 −11 src/swig/tinysplineoctave.i
+1 −8 src/swig/tinysplinephp.i
+2 −11 src/swig/tinysplinepython.i
+0 −9 src/swig/tinyspliner.i
+2 −22 src/swig/tinysplineruby.i
+416 −89 src/tinyspline.c
+285 −33 src/tinyspline.h
+431 −137 src/tinysplinecxx.cxx
+431 −88 src/tinysplinecxx.h
+70 −93 test/CMakeLists.txt
+42 −44 test/c/CMakeLists.txt
+177 −0 test/c/chord_lengths.c
+69 −0 test/c/copy.c
+42 −10 test/c/eval.c
+70 −0 test/c/interpolation.c
+485 −0 test/c/sub_spline.c
+6 −0 test/c/tests.c
+2 −2 test/csharp/FrameTest.cs
+1 −1 test/csharp/InterpolationTest.cs
+50 −0 test/csharp/VecTest.cs
+47 −48 test/cxx/CMakeLists.txt
+216 −0 test/cxx/chordlengths.cxx
+64 −0 test/cxx/control_points.cxx
+6 −3 test/cxx/frames.cxx
+4 −0 test/cxx/tests.cxx
+3 −3 test/cxx/testutilscxx/CMakeLists.txt
+144 −0 test/go/all_test.go
+10 −0 test/go/go.mod
+11 −0 test/go/go.sum
+0 −1 test/java/src/test/java/org/tinyspline/EnumTest.java
+1 −1 test/java/src/test/java/org/tinyspline/FrameTest.java
+54 −0 test/java/src/test/java/org/tinyspline/VecTest.java
+62 −18 test/lua/tests.lua
+57 −61 test/pkg/CMakeLists.txt
+141 −30 test/python/tests.py
+6 −0 test/ruby/Gemfile
+182 −0 test/ruby/tests.rb
+32 −32 test/testutils.c
+1 −1 test/testutils.h
+105 −28 tools/ci/Dockerfile
+1 −1 tools/ci/README.md
+124 −62 tools/ci/build.sh
+3 −1 tools/ci/docs.sh
+66 −10 tools/ci/package.sh
+24 −0 tools/ci/toolchain-mingw64.cmake
+47 −0 tools/release/README.md
+3 −3 tools/release/maven.sh
+4 −4 tools/release/pypi.sh
25 changes: 15 additions & 10 deletions scripts/windows-install/buildLibrecadAndCreatePackage.bat
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
echo on
cd ${{ github.workspace }}

pwd

cmake -S %cd% -G "Visual Studio 17 2022" ^
-B %cd%\out\build\windows-default ^
-DCMAKE_TOOLCHAIN_FILE=%cd%\conan_toolchain.cmake ^
-DCMAKE_VERBOSE_MAKEFILE=TRUE ^
-B %cd%\build ^
-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake ^
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ^
-DWITH_UNITTESTS=OFF ^
-DWITH_RENDERING_UNITTESTS=OFF ^
--install-prefix %cd%\installprefix

rem -DWITH_UNITTESTS=OFF
cd out\build\windows-default
cd build
dir CPack*.cmake

cmake --build . --config Release
cmake --build . --config Release --target package

cd bin
cd bin/Release
dir

WinDeployQt librecad.exe
dir ..
copy ..\*.lua ..\*.json .
where makensis.exe
dir ..\..\CPack*.cmake

cd ..

cpack -C RelWithDebInfo

cpack --verbose -G NSIS --config ..\..\CPackConfig.cmake
copy LibreCAD3-*.exe ..
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
echo "conan"
pwd
mkdir conan
pushd conan
conan profile detect --force
Expand Down
1 change: 1 addition & 0 deletions scripts/windows-install/installConan.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pip install boost
pip install conan
pip install mkdocs
pip install numpy
pip install numpy

0 comments on commit d4e8279

Please sign in to comment.