diff --git a/.travis.yml b/.travis.yml index 6ff3429..7cc5705 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,78 +1,78 @@ language: cpp sudo: require dist: trusty os: - linux - osx matrix: exclude: # Don't build with clang on Linux - os: linux compiler: clang # Don't build with gcc on OSX - os: osx compiler: gcc before_install: - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa; sudo add-apt-repository --yes ppa:beineri/opt-qt591-trusty; sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test; sudo add-apt-repository --yes ppa:ppsspp/cmake; sudo apt update -qq; sudo apt install build-essential qt59base qt59quickcontrols qt59serialport qt59charts-no-lgpl g++-4.8 cmake git; export CXX="g++-4.8"; git clone git://anongit.kde.org/extra-cmake-modules; cd extra-cmake-modules; mkdir ecm-build; cd ecm-build; cmake -DCMAKE_INSTALL_PREFIX=/usr ..; make; sudo make install; cd ../../; fi - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update > /dev/null; brew install qt5; brew tap KDE-mac/kde; brew install kf5-extra-cmake-modules; chmod -R 755 /usr/local/opt/qt5/*; export QTDIR="/usr/local/opt/qt5"; export PATH="$QTDIR/bin:$PATH"; fi script: - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then source /opt/qt*/bin/qt*-env.sh; - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr CMakeLists.txt; + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_GUI=ON CMakeLists.txt; make; sudo make install; make DESTDIR=appdir/ install; find appdir/; mkdir -p appdir/usr/plugins; mv appdir/usr/lib/x86_64-linux-gnu/plugins/AtCore/ appdir/usr/plugins/AtCore; rm -rf appdir/usr/include appdir/usr/mkspecs appdir/usr/lib/x86_64-linux-gnu/; wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"; chmod a+x linuxdeployqt*.AppImage; unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH; ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs; ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -appimage; fi - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then cmake CMakeLists.txt; make; - mkdir testclient/AtCoreTest.app/Contents/MacOS/plugins; - mv src/plugins/*.dylib testclient/AtCoreTest.app/Contents/MacOS/plugins/; - macdeployqt testclient/AtCoreTest.app/ -dmg; + mkdir testclient/atcore-gui.app/Contents/MacOS/plugins; + mv src/plugins/*.dylib testclient/atcore-gui.app/Contents/MacOS/plugins/; + macdeployqt testclient/atcore-gui.app/ -dmg; fi after_success: - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq; - bash ./upload.sh ./AtCore*.AppImage*; + bash ./upload.sh ./atcore-gui*.AppImage*; fi -- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then bash ./upload.sh testclient/AtCore*.dmg*; fi +- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then bash ./upload.sh testclient/atcore-gui*.dmg*; fi branches: except: - # Do not build tags that we create when we upload to GitHub Releases - /^(?i:continuous)$/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d69bb7..7b313a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,117 +1,116 @@ project(AtCore) # 3.0 is needed to support CMAKE_AUTOUIC cmake_minimum_required(VERSION 3.0) find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDEInstallDirs) include(KDECMakeSettings) include(ECMInstallIcons) include(FeatureSummary) include(GenerateExportHeader) include(ECMSetupVersion) include(CMakePackageConfigHelpers) include(ECMGenerateHeaders) +option(BUILD_GUI "Build the Test Gui") option(BUILD_DOCS "Build and Install Documents (Requires Doxygen)") +option(BUILD_TESTS "Build and Run Unittests") set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra modules and scripts for CMake" URL "git://anongit.kde.org/extra-cmake-modules") -set(PROJECT_VERSION "0.90.2") +set(PROJECT_VERSION "1.0.70") set(KF5_DEP_VERSION "5.24.0") # handled by release scripts set(REQUIRED_QT_VERSION 5.4.0) IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) FIND_PACKAGE(Git) IF(GIT_FOUND) EXECUTE_PROCESS( COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE "GIT_VERSION" ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) MESSAGE( STATUS "Git Commit: ${GIT_VERSION}" ) add_definitions( -DGIT_REVISION="${GIT_VERSION}") ENDIF(GIT_FOUND) ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_URL_CAST_FROM_STRING) -set(CMAKE_AUTOMOC ON) -option(BUILD_TEST_GUI "Build the Test Gui" ON) - find_package(Qt5 REQUIRED COMPONENTS Core - Test SerialPort - Charts ) include(ECMPoQmTools) -if(BUILD_TEST_GUI) - add_subdirectory(testclient) -endif() - - ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX ATCORE VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/atcore_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/AtCoreConfigVersion.cmake" SOVERSION ${PROJECT_VERSION_MAJOR} ) if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ecm_install_po_files_as_qm(po) endif() if(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11") endif() if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ") endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}) +set(CMAKE_AUTOMOC ON) add_subdirectory(src) -add_subdirectory(unittests) + +#optional Parts. +if(BUILD_GUI) + add_subdirectory(testclient) +endif() + +if (BUILD_TESTS) + add_subdirectory(unittests) +endif() + if (BUILD_DOCS) -#only build docs when asked - find_package(Doxygen) - if(DOXYGEN_FOUND) - add_subdirectory(doc) - endif() + add_subdirectory(doc) endif() + set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/AtCore") configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/AtCoreConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/AtCoreConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AtCoreConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/AtCoreConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) install(EXPORT AtCoreTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE AtCoreTargets.cmake NAMESPACE AtCore:: COMPONENT Devel ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/atcore_version.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/include/AtCore/AtCore" COMPONENT Devel ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/README.md b/README.md index 7251197..85292a3 100644 --- a/README.md +++ b/README.md @@ -1,144 +1,147 @@ ![Logo](testclient/AtCoreTest.png) AtCore - KDE Print Service for 3DPrinters ---- #### Build Status Linux [![Build Status](https://build.kde.org/job/Extragear%20atcore%20kf5-qt5%20SUSEQt5.9/badge/icon)](https://build.kde.org/job/Extragear%20atcore%20kf5-qt5%20SUSEQt5.9/) Windows [![Build Status](https://binary-factory.kde.org/job/atcore-master-win32/badge/icon)](https://binary-factory.kde.org/job/atcore-master-win32/) MacOs [![Build Status](https://binary-factory.kde.org/job/atcore-master-macos/badge/icon)](https://binary-factory.kde.org/job/atcore-master-macos/) FreeBSD [![Build Status](https://build.kde.org/job/Extragear%20atcore%20kf5-qt5%20FreeBSDQt5.9/badge/icon)](https://build.kde.org/job/Extragear%20atcore%20kf5-qt5%20FreeBSDQt5.9/) ---- AtCore is a API to manage the serial connection between the computer and 3D Printers.
This project is under LGPL V2+, for more information read COPYING.TXT. ---- ### AtCore is under development! Please have that in mind while testing! ---- #### Supported Firmwares - Repetier - Marlin - Teacup - APrinter - SPrinter - Smoothie - Grbl --- #### Getting AtCore Install a Premade package for ArchLinux: - AUR [atcore-git](https://aur.archlinux.org/packages/atcore-git/) --- #### Building AtCore For Development ##### Minimal Qt Version: 5.7 Dependencies for AtCore: - qt5-base - qt5-serialport - extra-cmake-modules Extra Dependencies for Test GUI + - qt5-widgets - qt5-charts Optional Dependencies - doxygen + - git Build Switches - - -DBUILD_TEST_GUI = ( ON | OFF ) Build the test client (Default is ON) + - -DBUILD_GUI = ( ON | OFF ) Build the test client (Default is OFF) - -DBUILD_DOCS = (ON | OFF ) Build the Documentation (Default is OFF) + - -DBUILD_TESTS = ( ON | OFF ) Build and Run Unittests (Default is OFF) ---- #### Building on Linux ```bash $ git clone https://github.com/KDE/atcore.git $ cmake -DCMAKE_INSTALL_PREFIX=$(qtpaths --install-prefix) -DCMAKE_INSTALL_LIBDIR=lib CMakeLists.txt $ make $ make install ``` ---- #### Building on Windows For Windows build you need to set up [Craft](https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows) It's tricky, but with all the last changes in half an hour you can have the setup done. Remember, it's easier if you have Python3.6 or higher installed. After you have the Craft environment setup do: ```powershell craft atcore ``` This will dowload all Qt and KDE libraries needed and compile Atcore. For running, inside the prompt call: ```powershell AtCoreTest ``` For debugging run: ```powershell craft vsd vsd AtCoreTest ``` This will give you feedback on the prompt to check what is happening. For packing: ```powershell craft --package atcore ``` At C:/KDE/craft/tmp you will find the installer. #### Building on Mac OS Install: - Git - QtCreator - XCode - CMake - Extra-Cmake-Modules via [Craft](https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Mac) Open a terminal and run: ```bash $ git clone https://github.com/KDE/atcore.git ``` Now you open QtCreator and open AtCore like project selecting the CMakeLists.txt on the root of AtCore folder. Setup your development environment: - Set your CMAKE_C_COMPILER to /usr/bin/cc - Set your ECM_DIR to your ECM install directory. Now you can build AtCore. After build do: - Copy the plugins files from /src/plugins/*.dylib to AtCoreTest.app/Contents/MacOS/plugins - Run macdeployqt on the app ### Docker We have a docker container within this project. To use it on your Docker environment just pull it: ```bash $ docker pull lays147/atcore ``` To run it on Linux: ```bash $ xhost: local:root $ docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --device DEVICE lays147/atcore:latest ``` You need to use the --device option to give the container access to your printer. It must point to the printers serial device. Overriding DEVICE value to the port of your printer.
Example: ```--device /dev/ttyUSB0``` ### Testing AtCore Testing is simple and will help us a lot. - Build / Install the testclient - Connect to your printer - Test the controls in the testclient - Test Print Command - Save your log and send it with errors --- > **Note:** > For your test results to be helpful they must include the full log output. --- #### Getting in Touch You can reach us via:
[IRC] - freenode #kde-atelier
[Telegram] - KDE Atelier group
[Web] - Our web page #### Bugs For any bug that you find it you can go on [KDE Bugs] system and report it. Please try to give all the information about the issue, and backtrace if you have one. [IRC]: https://webchat.freenode.net/ [Telegram]: telegram.me/KDEAtelier [KDE Bugs]: https://bugs.kde.org/enter_bug.cgi?product=Atelier [Web]: https://atelier.kde.org diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index cb22b30..c5e83dc 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,12 +1,14 @@ +find_package(Doxygen REQUIRED) + set(DOXYGEN_PROJECT_NUMBER "${PROJECT_VERSION}") set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) set(DOXYGEN_OUT ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile) configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) add_custom_target(doc ALL COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Building user's documentation into doxyDoc build dir..." ) install (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc/html" DESTINATION share/doc/atcore ) diff --git a/testclient/CMakeLists.txt b/testclient/CMakeLists.txt index 443f2dd..122ecc4 100644 --- a/testclient/CMakeLists.txt +++ b/testclient/CMakeLists.txt @@ -1,52 +1,51 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) +find_package(Qt5 REQUIRED COMPONENTS + Charts + Widgets +) + include_directories(../src) add_subdirectory(widgets) include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(AtCoreTestClient_SRCS main.cpp mainwindow.cpp ) ecm_create_qm_loader(AtCoreTestClient_SRCS atcore_qt) -find_package(Qt5 REQUIRED COMPONENTS - Core - Test - Widgets - SerialPort -) if (NOT APPLE) - add_executable(AtCoreTest ${AtCoreTestClient_SRCS} icons.qrc) + add_executable(atcore-gui ${AtCoreTestClient_SRCS} icons.qrc) - install(TARGETS AtCoreTest RUNTIME DESTINATION bin) + install(TARGETS atcore-gui RUNTIME DESTINATION bin) install(FILES - "${CMAKE_CURRENT_SOURCE_DIR}/AtCoreTest.png" + "${CMAKE_CURRENT_SOURCE_DIR}/atcore-gui.png" DESTINATION share/pixmaps) install(FILES - "${CMAKE_CURRENT_SOURCE_DIR}/AtCoreTest.desktop" + "${CMAKE_CURRENT_SOURCE_DIR}/atcore-gui.desktop" DESTINATION share/applications) else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11") - set(MACOSX_BUNDLE_DISPLAY_NAME "AtCore") + set(MACOSX_BUNDLE_DISPLAY_NAME "atcore-gui") set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.kde.AtCore") - set(MACOSX_BUNDLE_BUNDLE_NAME "AtCoreTest") - set(MACOSX_BUNDLE_DISPLAY_NAME "AtCoreTest") - set(MACOSX_BUNDLE_ICON_FILE AtCoreTest.icns) + set(MACOSX_BUNDLE_BUNDLE_NAME "atcore-gui") + set(MACOSX_BUNDLE_DISPLAY_NAME "atcore-gui") + set(MACOSX_BUNDLE_ICON_FILE atcore-gui.icns) set(MACOSX_BUNDLE_INFO_STRING "AtCore - Test Client") set(MACOSX_BUNDLE_COPYRIGHT "2016-2017 The AtCore Authors") - set(APPICON ${CMAKE_CURRENT_SOURCE_DIR}/AtCoreTest.icns) + set(APPICON ${CMAKE_CURRENT_SOURCE_DIR}/atcore-gui.icns) set_source_files_properties(${APPICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - add_executable(AtCoreTest MACOSX_BUNDLE ${AtCoreTestClient_SRCS} icons.qrc ${APPICON}) - install(TARGETS AtCoreTest BUNDLE DESTINATION bin) + add_executable(atcore-gui MACOSX_BUNDLE ${AtCoreTestClient_SRCS} icons.qrc ${APPICON}) + install(TARGETS atcore-gui BUNDLE DESTINATION bin) endif() -target_link_libraries(AtCoreTest AtCoreTestWidgets AtCore::AtCore Qt5::Widgets Qt5::Charts) +target_link_libraries(atcore-gui AtCoreTestWidgets AtCore::AtCore Qt5::Widgets Qt5::Charts) diff --git a/testclient/AtCoreTest.desktop b/testclient/atcore-gui.desktop similarity index 96% rename from testclient/AtCoreTest.desktop rename to testclient/atcore-gui.desktop index 4c143da..5a81388 100644 --- a/testclient/AtCoreTest.desktop +++ b/testclient/atcore-gui.desktop @@ -1,29 +1,29 @@ [Desktop Entry] Name=AtCore Test Client Name[ast]=Veceru de prueba d'AtCore Name[ca]=Client de prova de l'AtCore Name[ca@valencia]=Client de prova de l'AtCore Name[cs]=Testovací klient AtCore Name[da]=AtCore-testklient Name[de]=AtCore-Testprogramm Name[el]=Εφαρμογή δοκιμής AtCore Name[en_GB]=AtCore Test Client Name[es]=Cliente de prueba de AtCore Name[gl]=Cliente de probas de AtCore Name[nl]=AtCore testclient Name[pl]=Klient testowy AtCore Name[pt]=Cliente de Testes do AtCore Name[pt_BR]=Cliente de teste AtCore Name[ru]=Тестовый клиент AtCore Name[sk]=AtCore Test Klient Name[sv]=AtCore testklient Name[tr]=AtCore Test İstemcisi Name[uk]=Тестовий клієнт AtCore Name[x-test]=xxAtCore Test Clientxx Name[zh_CN]=AtCore 测试客户端 -Exec=AtCoreTest -Icon=AtCoreTest +Exec=atcore-gui +Icon=atcore-gui Categories=Graphics;Qt; StartupNotify=true Terminal=false Type=Application diff --git a/testclient/AtCoreTest.icns b/testclient/atcore-gui.icns similarity index 100% rename from testclient/AtCoreTest.icns rename to testclient/atcore-gui.icns diff --git a/testclient/AtCoreTest.png b/testclient/atcore-gui.png similarity index 100% rename from testclient/AtCoreTest.png rename to testclient/atcore-gui.png diff --git a/testclient/icons.qrc b/testclient/icons.qrc index 7ad4156..2a74208 100644 --- a/testclient/icons.qrc +++ b/testclient/icons.qrc @@ -1,7 +1,7 @@ ../doc/atcore.png - AtCoreTest.png + atcore-gui.png diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 284fe36..79016e3 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -1,30 +1,33 @@ +find_package(Qt5 REQUIRED COMPONENTS + Test +) # Helper macro TEST used to created rules to build, link, install and run tests macro(TEST NAME FILE) add_executable(${NAME} ${FILE} ) target_link_libraries( ${NAME} AtCore Qt5::Core Qt5::Test ) if(CMAKE_SYSTEM_NAME STREQUAL "Windows") # Run test using wine if(WINE_PROGRAM) add_test( NAME ${NAME} COMMAND "$" WORKING_DIRECTORY ${WINDOWS_STAGING_TESTS} ) # Set WINEPATH (%PATH%) to WINDOWS_STAGING_TESTS allowing wine to find dlls # WINEDEBUG=-all is used to avoid anoying winde debug outputs set_tests_properties(${NAME} PROPERTIES ENVIRONMENT "WINEPATH=${WINDOWS_STAGING_TESTS};WINEDEBUG=-all") set_tests_properties(${NAME} PROPERTIES DEPENDS PrepareTests) endif() else() add_test(NAME ${NAME} COMMAND $) endif() endmacro() TEST(AtCoreTests atcoretests.cpp) TEST(GcodeTests gcodetests.cpp) TEST(TemperatureTests temperaturetests.cpp)