From d3bea639f38bd5b5a5c40e9040a0d1201ed06a73 Mon Sep 17 00:00:00 2001 From: Hauke Moenck <hauke_moenck@gmx.de> Date: Wed, 19 Dec 2018 11:02:46 +0100 Subject: [PATCH] Updated naming scheme, toolchain and versioning Replaced ifdef with pragmas Signed-off-by: Hauke Moenck <hauke_moenck@gmx.de> --- .gitlab-ci.yml | 98 +++++++------- CMakeLists.txt | 45 ++----- Src/CMakeLists.txt | 126 ++++++++++-------- Src/Interfaces/ENUMS.h | 4 +- Src/Interfaces/IBioTrackerContext.h | 5 +- Src/Interfaces/IBioTrackerPlugin.h | 5 +- Src/Interfaces/IModel/IModel.h | 5 +- .../IModel/IModelAreaDescriptor.cpp | 0 .../IModel/IModelTrackedComponent.h | 5 +- .../IModel/IModelTrackedComponentFactory.h | 5 +- .../IModel/IModelTrackedTrajectory.h | 5 +- .../IModel/IModelTrackingAlgorithm.h | 5 +- Src/Interfaces/IModel/IObject.h | 5 +- Src/Interfaces/IView/IView.h | 5 +- .../IView/IViewGraphicsPixmapItem.h | 5 +- Src/Interfaces/IView/IViewGraphicsScene.h | 5 +- Src/Interfaces/IView/IViewGraphicsView.h | 5 +- Src/Interfaces/IView/IViewMainWindow.h | 5 +- Src/Interfaces/IView/IViewOpenGLWidget.h | 4 +- Src/Interfaces/IView/IViewTrackedComponent.h | 5 +- Src/Interfaces/IView/IViewWidget.h | 5 +- cmake/Deploy.cmake | 87 ------------ cmake/Headers.cmake | 8 ++ cmake/Windeployqt.cmake | 112 ---------------- ...n => biotracker-interfacesConfig.cmake.in} | 0 version.txt | 1 + 26 files changed, 156 insertions(+), 404 deletions(-) delete mode 100644 Src/Interfaces/IModel/IModelAreaDescriptor.cpp delete mode 100644 cmake/Deploy.cmake create mode 100644 cmake/Headers.cmake delete mode 100644 cmake/Windeployqt.cmake rename cmake/{BT_InterfacesConfig.cmake.in => biotracker-interfacesConfig.cmake.in} (100%) create mode 100644 version.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4680e4f..a47ddfa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,65 +4,68 @@ stages: - deploy -.base ubuntu-18.04: &base_ubuntu_18_04 +.ubuntu-18.04: tags: [ linux, docker ] - image: git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:ubuntu-18.04 + image: git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:devel-ubuntu18.04 -.base windows: &base_windows +.windows: tags: [ windows, docker ] - image: git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:windows + image: git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:devel-windows -.build ubuntu-18.04: &build_ubuntu_18_04 +.gcc8: &gcc8 + CC: gcc-8 + CXX: g++-8 + +.msvc15.9: &msvc15_9 + VSDevEnv -arch=amd64 -vcvars_ver="14.16" + +.debug: &debug + CMAKE_BUILD_TYPE: Debug + +.release: &release + CMAKE_BUILD_TYPE: Release + + +.build ubuntu-18.04: + extends: .ubuntu-18.04 stage: build - <<: *base_ubuntu_18_04 - variables: - CC: gcc-8 - CXX: g++-8 artifacts: paths: - build expire_in: 1 day + script: + - cmake -Bbuild -H. -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" -G Ninja -DCMAKE_SUPPRESS_REGENERATION=ON -DCMAKE_SKIP_PACKAGE_ALL_DEPENDENCY=ON + - ninja -C build -.build windows: &build_windows +.build windows: + extends: .windows stage: build - <<: *base_windows artifacts: paths: - build expire_in: 1 day before_script: - - C:/VsDevEnv.ps1 -arch=amd64 - -build ubuntu-18.04: - <<: *build_ubuntu_18_04 + - . $Profile + - *msvc15_9 script: - - cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -G Ninja + - cmake -Bbuild "-H." -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" -G Ninja -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_DIR/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="$env:VCPKG_TRIPLET" -DCMAKE_SUPPRESS_REGENERATION=ON -DCMAKE_SKIP_PACKAGE_ALL_DEPENDENCY=ON - ninja -C build -build windows: - <<: *build_windows - script: - - cmake -Bbuild "-H." -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_PREFIX_PATH="$Env:VCPKG_INSTALL_DIR" - - ninja -C build +build ubuntu-18.04: + extends: .build ubuntu-18.04 + variables: + <<: [ *gcc8, *release ] -build windows[cuda]: - <<: *build_windows - script: - - cmake -Bbuild "-H." -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_PREFIX_PATH="$Env:VCPKG_CUDA_INSTALL_DIR" - - ninja -C build +build windows: + extends: .build windows + variables: + <<: [ *release ] build windows[debug]: - <<: *build_windows - script: - - cmake -Bbuild "-H." -DCMAKE_BUILD_TYPE=Debug -G Ninja -DCMAKE_PREFIX_PATH="$Env:VCPKG_INSTALL_DIR" - - ninja -C build - -build windows[debug,cuda]: - <<: *build_windows - script: - - cmake -Bbuild "-H." -DCMAKE_BUILD_TYPE=Debug -G Ninja -DCMAKE_PREFIX_PATH="$Env:VCPKG_CUDA_INSTALL_DIR" - - ninja -C build + extends: .build windows + variables: + <<: [ *debug ] .package: &package @@ -75,32 +78,27 @@ build windows[debug,cuda]: - ninja -C build package package ubuntu-18.04: - <<: *base_ubuntu_18_04 + extends: .ubuntu-18.04 dependencies: - build ubuntu-18.04 <<: *package package windows: - <<: *base_windows + extends: .windows dependencies: - build windows <<: *package -package windows[cuda]: - <<: *base_windows - dependencies: - - build windows[cuda] - <<: *package - package windows[debug]: - <<: *base_windows + extends: .windows dependencies: - build windows[debug] <<: *package -package windows[debug,cuda]: - <<: *base_windows - dependencies: - - build windows[debug,cuda] - <<: *package +trigger dependents: + extends: .ubuntu-18.04 + stage: deploy + script: + - . /etc/profile.d/robofish.sh + - gitlab-trigger-pipeline bioroboticslab%2Fbiotracker%2Futility $CI_JOB_TOKEN master diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e8bac5..dae9ce4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,10 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.13) -exec_program("git" ${CMAKE_CURRENT_SOURCE_DIR} ARGS "describe --tags --abbrev=0" OUTPUT_VARIABLE GIT_TAG) +file(READ version.txt Version) +#exec_program("git" ${CMAKE_CURRENT_SOURCE_DIR} ARGS "describe --tags --abbrev=0" OUTPUT_VARIABLE GIT_TAG) -project(BT_Interfaces - VERSION ${GIT_TAG} +project(biotracker-interfaces + VERSION ${Version} LANGUAGES CXX) include(GNUInstallDirs) @@ -13,33 +14,14 @@ set(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory fo set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} CACHE PATH "Installation directory for header files") set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} CACHE STRING "Installation directory for cmake configuration files") -set(TN BT_Interfaces) -add_library(${TN} SHARED) -set_target_properties(${TN} PROPERTIES OUTPUT_NAME bt_interfaces) -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - set_target_properties(${TN} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true) -endif() - -include(Src/CMakeLists.txt) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) +include(Headers) -install( - TARGETS - BT_Interfaces - EXPORT - ${PROJECT_NAME}Targets - RUNTIME DESTINATION "${INSTALL_BINDIR}" - LIBRARY DESTINATION "${INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${INSTALL_LIBDIR}" -) -foreach(file ${BT_Interfaces_PUBLIC_HEADERS}) - file(RELATIVE_PATH rel_path "${CMAKE_CURRENT_LIST_DIR}/Src" ${file}) - get_filename_component(install_path ${rel_path} DIRECTORY) - install(FILES ${file} DESTINATION "${INSTALL_INCLUDEDIR}/${install_path}") -endforeach() +add_subdirectory(Src) export( TARGETS - BT_Interfaces + ${PROJECT_NAME} FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake" ) @@ -69,14 +51,7 @@ install( DESTINATION ${INSTALL_CONFIGDIR} ) -install( - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Deploy.cmake - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Windeployqt.cmake - DESTINATION ${INSTALL_CONFIGDIR}/Modules/${PROJECT_NAME} -) - set(CPACK_GENERATOR "TXZ") -set(CPACK_PACKAGE_VERSION ${GIT_TAG}) +set(CPACK_PACKAGE_VERSION ${Version}) include(CPack) diff --git a/Src/CMakeLists.txt b/Src/CMakeLists.txt index 40dfe2a..53a7651 100644 --- a/Src/CMakeLists.txt +++ b/Src/CMakeLists.txt @@ -2,73 +2,91 @@ #### Biotracker: Interfaces ############################################################## -target_include_directories(${TN} PUBLIC +set(target ${PROJECT_NAME}) +add_library(${target} SHARED) +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + set_target_properties(${target} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true) +endif() + +install( + TARGETS + ${PROJECT_NAME} + EXPORT + ${PROJECT_NAME}Targets + RUNTIME DESTINATION "${INSTALL_BINDIR}" + LIBRARY DESTINATION "${INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${INSTALL_LIBDIR}" +) + +target_include_directories(${target} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}> $<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}> ) -find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets OpenGL Xml Network) -target_link_libraries(${TN} Qt5::Core Qt5::Gui Qt5::Xml Qt5::Network Qt5::Widgets) +find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets OpenGL) +target_link_libraries(${target} Qt5::Core Qt5::Gui Qt5::Widgets) find_package(OpenCV 3 REQUIRED) -target_link_libraries(${TN} ${OpenCV_LIBS}) +target_link_libraries(${target} ${OpenCV_LIBS}) -set_target_properties(${TN} PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(${TN} PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON) -set_target_properties(${TN} PROPERTIES +set_target_properties(${target} PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON) +set_target_properties(${target} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO ) -target_compile_definitions(${TN} PRIVATE BT_INTERFACES_EXPORT) +target_compile_definitions(${target} PRIVATE BT_INTERFACES_EXPORT) -target_sources(${TN} -PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/ENUMS.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IBioTrackerContext.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IBioTrackerPlugin.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IController/IController.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModel.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelAreaDescriptor.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelDataExporter.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelTrackedComponent.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelTrackedComponentFactory.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelTrackedTrajectory.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelTrackingAlgorithm.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IObject.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/Serializable.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IView.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewGraphicsPixmapItem.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewGraphicsScene.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewGraphicsView.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewMainWindow.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewOpenGLWidget.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewTrackedComponent.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewWidget.cpp" +target_sources(${target} + PRIVATE + "Interfaces/ENUMS.cpp" + "Interfaces/IBioTrackerContext.cpp" + "Interfaces/IBioTrackerPlugin.cpp" + "Interfaces/IController/IController.cpp" + "Interfaces/IModel/IModel.cpp" + "Interfaces/IModel/IModelAreaDescriptor.h" + "Interfaces/IModel/IModelDataExporter.cpp" + "Interfaces/IModel/IModelTrackedComponent.cpp" + "Interfaces/IModel/IModelTrackedComponentFactory.cpp" + "Interfaces/IModel/IModelTrackedTrajectory.cpp" + "Interfaces/IModel/IModelTrackingAlgorithm.cpp" + "Interfaces/IModel/IObject.cpp" + "Interfaces/IModel/Serializable.cpp" + "Interfaces/IView/IView.cpp" + "Interfaces/IView/IViewGraphicsPixmapItem.cpp" + "Interfaces/IView/IViewGraphicsScene.cpp" + "Interfaces/IView/IViewGraphicsView.cpp" + "Interfaces/IView/IViewMainWindow.cpp" + "Interfaces/IView/IViewOpenGLWidget.cpp" + "Interfaces/IView/IViewTrackedComponent.cpp" + "Interfaces/IView/IViewWidget.cpp" ) -set(${TN}_PUBLIC_HEADERS - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/API.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/ENUMS.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IBioTrackerContext.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IBioTrackerPlugin.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IController/IController.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModel.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelAreaDescriptor.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelDataExporter.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelTrackedComponent.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelTrackedComponentFactory.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelTrackedTrajectory.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IModelTrackingAlgorithm.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/IObject.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IModel/Serializable.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IView.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewGraphicsPixmapItem.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewGraphicsScene.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewGraphicsView.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewMainWindow.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewOpenGLWidget.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewTrackedComponent.h" - "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IView/IViewWidget.h" +install_headers( + HEADERS + "Interfaces/API.h" + "Interfaces/ENUMS.h" + "Interfaces/IBioTrackerContext.h" + "Interfaces/IBioTrackerPlugin.h" + "Interfaces/IController/IController.h" + "Interfaces/IModel/IModel.h" + "Interfaces/IModel/IModelAreaDescriptor.h" + "Interfaces/IModel/IModelDataExporter.h" + "Interfaces/IModel/IModelTrackedComponent.h" + "Interfaces/IModel/IModelTrackedComponentFactory.h" + "Interfaces/IModel/IModelTrackedTrajectory.h" + "Interfaces/IModel/IModelTrackingAlgorithm.h" + "Interfaces/IModel/IObject.h" + "Interfaces/IModel/Serializable.h" + "Interfaces/IView/IView.h" + "Interfaces/IView/IViewGraphicsPixmapItem.h" + "Interfaces/IView/IViewGraphicsScene.h" + "Interfaces/IView/IViewGraphicsView.h" + "Interfaces/IView/IViewMainWindow.h" + "Interfaces/IView/IViewOpenGLWidget.h" + "Interfaces/IView/IViewTrackedComponent.h" + "Interfaces/IView/IViewWidget.h" + DESTINATION "${INSTALL_INCLUDEDIR}" ) + diff --git a/Src/Interfaces/ENUMS.h b/Src/Interfaces/ENUMS.h index bafbf8f..d621066 100644 --- a/Src/Interfaces/ENUMS.h +++ b/Src/Interfaces/ENUMS.h @@ -1,5 +1,4 @@ -#ifndef ENUMS_H -#define ENUMS_H +#pragma once #include <QObject> #include <Interfaces/API.h> @@ -40,4 +39,3 @@ public: Q_ENUM(COREPERMISSIONS) }; -#endif // ENUMS_H diff --git a/Src/Interfaces/IBioTrackerContext.h b/Src/Interfaces/IBioTrackerContext.h index 8c3f247..23eb203 100644 --- a/Src/Interfaces/IBioTrackerContext.h +++ b/Src/Interfaces/IBioTrackerContext.h @@ -1,5 +1,4 @@ -#ifndef IBIOTRACKERCONTEXT_H -#define IBIOTRACKERCONTEXT_H +#pragma once #include <QObject> #include "QMap" @@ -30,5 +29,3 @@ protected: }; - -#endif // IBIOTRACKERCONTEXT_H diff --git a/Src/Interfaces/IBioTrackerPlugin.h b/Src/Interfaces/IBioTrackerPlugin.h index 43d0288..e354c83 100644 --- a/Src/Interfaces/IBioTrackerPlugin.h +++ b/Src/Interfaces/IBioTrackerPlugin.h @@ -1,5 +1,4 @@ -#ifndef IBIOTRACKERPLUGIN_H -#define IBIOTRACKERPLUGIN_H +#pragma once #include "QObject" @@ -68,5 +67,3 @@ public Q_SLOTS: #define IBioTrackerPlugin_iid "de.fu-berlin.mi.biorobotics.IBioTrackerPlugin" Q_DECLARE_INTERFACE(IBioTrackerPlugin, IBioTrackerPlugin_iid) - -#endif // IBIOTRACKERPLUGIN_H diff --git a/Src/Interfaces/IModel/IModel.h b/Src/Interfaces/IModel/IModel.h index 82b36cb..6f8e887 100644 --- a/Src/Interfaces/IModel/IModel.h +++ b/Src/Interfaces/IModel/IModel.h @@ -1,5 +1,4 @@ -#ifndef IMODEL_H -#define IMODEL_H +#pragma once #include <QObject> @@ -17,5 +16,3 @@ class BT_INTERFACES_API IModel : public QObject { public Q_SLOTS: }; - -#endif // IMODEL_H diff --git a/Src/Interfaces/IModel/IModelAreaDescriptor.cpp b/Src/Interfaces/IModel/IModelAreaDescriptor.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Src/Interfaces/IModel/IModelTrackedComponent.h b/Src/Interfaces/IModel/IModelTrackedComponent.h index a3bffa1..6cafab0 100644 --- a/Src/Interfaces/IModel/IModelTrackedComponent.h +++ b/Src/Interfaces/IModel/IModelTrackedComponent.h @@ -1,5 +1,4 @@ -#ifndef ITRACKEDCOMPONENT_H -#define ITRACKEDCOMPONENT_H +#pragma once #include "IModel.h" #include <chrono> @@ -337,5 +336,3 @@ public: */ IModelTrackedRectangle(QObject *parent = 0); }; - -#endif // ITRACKEDCOMPONENT_H diff --git a/Src/Interfaces/IModel/IModelTrackedComponentFactory.h b/Src/Interfaces/IModel/IModelTrackedComponentFactory.h index 0df758c..70c1d12 100644 --- a/Src/Interfaces/IModel/IModelTrackedComponentFactory.h +++ b/Src/Interfaces/IModel/IModelTrackedComponentFactory.h @@ -1,5 +1,4 @@ -#ifndef ITRACKEDCOMPONENTFACTORY_H -#define ITRACKEDCOMPONENTFACTORY_H +#pragma once #include "IModel.h" #include "IModelTrackedComponent.h" @@ -23,5 +22,3 @@ protected: virtual IModelTrackedComponent *createTrackedTrajectory(QString name) = 0; }; - -#endif // ITRACKEDCOMPONENTFACTORY_H diff --git a/Src/Interfaces/IModel/IModelTrackedTrajectory.h b/Src/Interfaces/IModel/IModelTrackedTrajectory.h index 78ebd9b..c3bd7b6 100644 --- a/Src/Interfaces/IModel/IModelTrackedTrajectory.h +++ b/Src/Interfaces/IModel/IModelTrackedTrajectory.h @@ -1,5 +1,4 @@ -#ifndef ITRACKEDOTRAJECTORY_H -#define ITRACKEDOTRAJECTORY_H +#pragma once #include "Interfaces/IModel/IModelTrackedComponent.h" @@ -72,5 +71,3 @@ protected: std::chrono::system_clock::time_point _time; }; - -#endif // ITRACKEDOTRAJECTORY_H diff --git a/Src/Interfaces/IModel/IModelTrackingAlgorithm.h b/Src/Interfaces/IModel/IModelTrackingAlgorithm.h index 1841eb8..745c390 100644 --- a/Src/Interfaces/IModel/IModelTrackingAlgorithm.h +++ b/Src/Interfaces/IModel/IModelTrackingAlgorithm.h @@ -1,5 +1,4 @@ -#ifndef ITRACKINGALGORITHM_H -#define ITRACKINGALGORITHM_H +#pragma once #include "IModel.h" #include "opencv2/core/core.hpp" @@ -17,5 +16,3 @@ signals: }; - -#endif // ITRACKINGALGORITHM_H diff --git a/Src/Interfaces/IModel/IObject.h b/Src/Interfaces/IModel/IObject.h index 0a7d9dc..0ef2dd6 100644 --- a/Src/Interfaces/IModel/IObject.h +++ b/Src/Interfaces/IModel/IObject.h @@ -1,5 +1,4 @@ -#ifndef IOBJECT_H -#define IOBJECT_H +#pragma once #include "Interfaces/IModel/IModel.h" @@ -10,5 +9,3 @@ class BT_INTERFACES_API IObject : public IModel { public: IObject(); }; - -#endif // IOBJECT_H diff --git a/Src/Interfaces/IView/IView.h b/Src/Interfaces/IView/IView.h index 5897b69..1178022 100644 --- a/Src/Interfaces/IView/IView.h +++ b/Src/Interfaces/IView/IView.h @@ -1,5 +1,4 @@ -#ifndef IVIEW_H -#define IVIEW_H +#pragma once #include "Interfaces/IModel/IModel.h" #include "Interfaces/ENUMS.h" @@ -25,5 +24,3 @@ class BT_INTERFACES_API IView { IController *mController; IModel *mModel; }; - -#endif // IVIEW_H diff --git a/Src/Interfaces/IView/IViewGraphicsPixmapItem.h b/Src/Interfaces/IView/IViewGraphicsPixmapItem.h index 5302abc..d68e1d4 100644 --- a/Src/Interfaces/IView/IViewGraphicsPixmapItem.h +++ b/Src/Interfaces/IView/IViewGraphicsPixmapItem.h @@ -1,5 +1,4 @@ -#ifndef IGRAPHICSPIXMAPITEM_H -#define IGRAPHICSPIXMAPITEM_H +#pragma once #include "IView.h" #include "QObject" @@ -18,5 +17,3 @@ public: public Q_SLOTS: virtual void getNotified() = 0; }; - -#endif // IGRAPHICSPIXMAPITEM_H diff --git a/Src/Interfaces/IView/IViewGraphicsScene.h b/Src/Interfaces/IView/IViewGraphicsScene.h index 0ed22f4..2193524 100644 --- a/Src/Interfaces/IView/IViewGraphicsScene.h +++ b/Src/Interfaces/IView/IViewGraphicsScene.h @@ -1,5 +1,4 @@ -#ifndef IVIEWGRAPHICSSCENE_H -#define IVIEWGRAPHICSSCENE_H +#pragma once #include "QGraphicsScene" #include "IView.h" @@ -20,5 +19,3 @@ protected: public Q_SLOTS: virtual void getNotified() = 0; }; - -#endif // IVIEWGRAPHICSSCENE_H diff --git a/Src/Interfaces/IView/IViewGraphicsView.h b/Src/Interfaces/IView/IViewGraphicsView.h index 05be9e5..db3fa12 100644 --- a/Src/Interfaces/IView/IViewGraphicsView.h +++ b/Src/Interfaces/IView/IViewGraphicsView.h @@ -1,5 +1,4 @@ -#ifndef IGRAPHICSVIEW_H -#define IGRAPHICSVIEW_H +#pragma once #include "QGraphicsView" #include "IView.h" @@ -20,5 +19,3 @@ protected: public Q_SLOTS: virtual void getNotified() = 0; }; - -#endif // IGRAPHICSVIEW_H diff --git a/Src/Interfaces/IView/IViewMainWindow.h b/Src/Interfaces/IView/IViewMainWindow.h index 8c0fdb5..b5957a8 100644 --- a/Src/Interfaces/IView/IViewMainWindow.h +++ b/Src/Interfaces/IView/IViewMainWindow.h @@ -1,5 +1,4 @@ -#ifndef IVIEWMAINWINDOW_H -#define IVIEWMAINWINDOW_H +#pragma once #include <QMainWindow> #include "Interfaces/IView/IView.h" @@ -13,5 +12,3 @@ class BT_INTERFACES_API IViewMainWindow : public QMainWindow, public IView { void setNewModel(IModel *model); void connectModelView(); }; - -#endif // IVIEWMAINWINDOW_H diff --git a/Src/Interfaces/IView/IViewOpenGLWidget.h b/Src/Interfaces/IView/IViewOpenGLWidget.h index f2f66f5..9383d62 100644 --- a/Src/Interfaces/IView/IViewOpenGLWidget.h +++ b/Src/Interfaces/IView/IViewOpenGLWidget.h @@ -1,5 +1,4 @@ -#ifndef IVIEWOPENGLWIDGET_H -#define IVIEWOPENGLWIDGET_H +#pragma once #include "Interfaces/IView/IView.h" #include <QOpenGLWidget> @@ -22,4 +21,3 @@ class BT_INTERFACES_API IViewOpenGLWidget: public QOpenGLWidget, protected QOpen void initializeGL() override; }; -#endif // IVIEWOPENGLWIDGET_H diff --git a/Src/Interfaces/IView/IViewTrackedComponent.h b/Src/Interfaces/IView/IViewTrackedComponent.h index ff7e0da..612483a 100644 --- a/Src/Interfaces/IView/IViewTrackedComponent.h +++ b/Src/Interfaces/IView/IViewTrackedComponent.h @@ -1,5 +1,4 @@ -#ifndef IVIEWTRACKEDCOMPONENT_H -#define IVIEWTRACKEDCOMPONENT_H +#pragma once #include "IView.h" #include "QGraphicsObject" @@ -31,5 +30,3 @@ public Q_SLOTS: virtual void getNotified() = 0; }; - -#endif // IVIEWTRACKEDCOMPONENT_H diff --git a/Src/Interfaces/IView/IViewWidget.h b/Src/Interfaces/IView/IViewWidget.h index fc97f05..e0da9a3 100644 --- a/Src/Interfaces/IView/IViewWidget.h +++ b/Src/Interfaces/IView/IViewWidget.h @@ -1,5 +1,4 @@ -#ifndef IVIEWWIDGET_H -#define IVIEWWIDGET_H +#pragma once #include <QWidget> #include "Interfaces/IView/IView.h" @@ -17,5 +16,3 @@ class BT_INTERFACES_API IViewWidget : public QWidget, public IView { private: void connectModelView(); }; - -#endif // IVIEWWIDGET_H diff --git a/cmake/Deploy.cmake b/cmake/Deploy.cmake deleted file mode 100644 index 80b144e..0000000 --- a/cmake/Deploy.cmake +++ /dev/null @@ -1,87 +0,0 @@ -if(WIN32) - function(deploy_shared_lib target directory lib) - set(options TO_BUILD) - cmake_parse_arguments(DEPLOY_SHARED_LIB "${options}" "" "" ${ARGN}) - - message("Searching for ${lib}${CMAKE_SHARED_LIBRARY_SUFFIX}") - execute_process( - COMMAND where.exe "${lib}${CMAKE_SHARED_LIBRARY_SUFFIX}" - OUTPUT_VARIABLE _matches - OUTPUT_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE _res - ) - if(NOT "${_res}" STREQUAL "0") - message(FATAL_ERROR "Failed to find ${lib}${CMAKE_SHARED_LIBRARY_SUFFIX}") - endif() - string(REGEX REPLACE "\n" ";" _matches "${_matches}") - list(GET _matches 0 _lib) - string(REGEX REPLACE "\\\\" "/" _lib "${_lib}") - - if(DEPLOY_SHARED_LIB_TO_BUILD) - # Deploy into build tree - add_custom_command(TARGET ${target} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E - copy_if_different "${_lib}" \"$<TARGET_FILE_DIR:${target}>\" - COMMENT "Copying ${_lib} to \"$<TARGET_FILE_DIR:${target}>\"" - ) - endif() - - # Deploy into install tree - install(CODE - " - if(\"${directory}\" STREQUAL \"\") - set(_dest \"\${CMAKE_INSTALL_PREFIX}\") - else() - set(_dest \"\${CMAKE_INSTALL_PREFIX}/${directory}\") - endif() - message(\"Copying ${_lib} to \${_dest}\") - execute_process( - COMMAND \"${CMAKE_COMMAND}\" -E - copy \"${_lib}\" \"\${_dest}/\" - ) - " - ) - endfunction() - - include(${CMAKE_CURRENT_LIST_DIR}/Windeployqt.cmake) - - function(deploy_qt5 target directory) - windeployqt(${target} "${directory}") - endfunction() - - function(deploy_cuda target directory) - set(multiValueArgs COMPONENTS) - cmake_parse_arguments(DEPLOY_CUDA "" "" "${multiValueArgs}" ${ARGN}) - - if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) - set(CUDA_SUFFIX "64_${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}") - else() - set(CUDA_SUFFIX "32_${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}") - endif() - - foreach(component ${DEPLOY_CUDA_COMPONENTS}) - deploy_shared_lib(${target} "${directory}" "${component}${CUDA_SUFFIX}") - endforeach() - endfunction() - - function(deploy_cudnn target directory version) - if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) - set(CUDNN_SUFFIX "64_${version}") - else() - set(CUDNN_SUFFIX "32_${version}") - endif() - - deploy_shared_lib(${target} "${directory}" "cudnn${CUDNN_SUFFIX}") - endfunction() - - function(deploy_opencv target directory) - set(multiValueArgs COMPONENTS) - cmake_parse_arguments(DEPLOY_OPENCV "" "" "${multiValueArgs}" ${ARGN}) - - set(CV_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}") - - foreach(component ${DEPLOY_OPENCV_COMPONENTS}) - deploy_shared_lib(${target} "${directory}" "opencv_${component}${CV_SUFFIX}") - endforeach() - endfunction() -endif() \ No newline at end of file diff --git a/cmake/Headers.cmake b/cmake/Headers.cmake new file mode 100644 index 0000000..5e3dfec --- /dev/null +++ b/cmake/Headers.cmake @@ -0,0 +1,8 @@ +function(install_headers) + cmake_parse_arguments(ARGS "" "DESTINATION" "HEADERS" ${ARGN}) + + foreach(file ${ARGS_HEADERS}) + get_filename_component(install_path ${file} DIRECTORY) + install(FILES ${file} DESTINATION "${ARGS_DESTINATION}/${install_path}") + endforeach() +endfunction() diff --git a/cmake/Windeployqt.cmake b/cmake/Windeployqt.cmake deleted file mode 100644 index dae5bbc..0000000 --- a/cmake/Windeployqt.cmake +++ /dev/null @@ -1,112 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2017 Nathan Osman -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -find_package(Qt5Core REQUIRED) - -# Retrieve the absolute path to qmake and then use that path to find -# the windeployqt binary -get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION) -get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY) -find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}") - -# Running this with MSVC 2015 requires CMake 3.6+ -if((MSVC_VERSION VERSION_EQUAL 1900 OR MSVC_VERSION VERSION_GREATER 1900) - AND CMAKE_VERSION VERSION_LESS "3.6") - message(WARNING "Deploying with MSVC 2015+ requires CMake 3.6+") -endif() - -# Add commands that copy the Qt runtime to the target's output directory after -# build and install the Qt runtime to the specified directory -function(windeployqt target directory) - - # Run windeployqt immediately after build - add_custom_command(TARGET ${target} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E - env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}" - --verbose 0 - --no-compiler-runtime - --no-angle - --no-opengl-sw - \"$<TARGET_FILE:${target}>\" - ) - - # install(CODE ...) doesn't support generator expressions, but - # file(GENERATE ...) does - store the path in a file - file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}_path" - CONTENT "$<TARGET_FILE:${target}>" - ) - - # Before installation, run a series of commands that copy each of the Qt - # runtime files to the appropriate directory for installation - install(CODE - " - file(READ \"${CMAKE_CURRENT_BINARY_DIR}/${target}_path\" _file) - execute_process( - COMMAND \"${CMAKE_COMMAND}\" -E - env PATH=\"${_qt_bin_dir}\" \"${WINDEPLOYQT_EXECUTABLE}\" - --dry-run - --no-compiler-runtime - --no-angle - --no-opengl-sw - --list mapping - \${_file} - OUTPUT_VARIABLE _output - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - separate_arguments(_files WINDOWS_COMMAND \${_output}) - while(_files) - list(GET _files 0 _src) - list(GET _files 1 _dest) - if(\"${directory}\" STREQUAL \"\") - set(_dest \"\${CMAKE_INSTALL_PREFIX}/\${_dest}\") - else() - set(_dest \"\${CMAKE_INSTALL_PREFIX}/${directory}/\${_dest}\") - endif() - message(\"Copying \${_src} to \${_dest}\") - execute_process( - COMMAND \"${CMAKE_COMMAND}\" -E - copy \${_src} \"\${_dest}\" - ) - list(REMOVE_AT _files 0 1) - endwhile() - " - ) - - # windeployqt doesn't work correctly with the system runtime libraries, - # so we fall back to one of CMake's own modules for copying them over - set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE) - if("${directory}" STREQUAL "") - set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .) - else() - set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${directory}") - endif() - include(InstallRequiredSystemLibraries) - foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}) - add_custom_command(TARGET ${target} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E - copy_if_different "${lib}" \"$<TARGET_FILE_DIR:${target}>\" - ) - endforeach() - -endfunction() - -mark_as_advanced(WINDEPLOYQT_EXECUTABLE) diff --git a/cmake/BT_InterfacesConfig.cmake.in b/cmake/biotracker-interfacesConfig.cmake.in similarity index 100% rename from cmake/BT_InterfacesConfig.cmake.in rename to cmake/biotracker-interfacesConfig.cmake.in diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..341cf11 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.2.0 \ No newline at end of file -- GitLab