From 32379e8772ffcf00d116947472991e57a7abeff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 14 Dec 2018 11:14:13 +0100 Subject: [PATCH 1/4] Use QT MOC from cmake instead of own implementation --- cmake/ACGQt.cmake | 48 +------ .../Decimating/DecimaterGui/CMakeLists.txt | 101 +++++++-------- src/OpenMesh/Apps/ProgViewer/CMakeLists.txt | 11 +- src/OpenMesh/Apps/QtViewer/CMakeLists.txt | 16 +-- .../Apps/QtViewer/MeshViewerWidget.cc | 119 ++++++++++++++++++ .../Apps/QtViewer/MeshViewerWidget.hh | 68 ++-------- .../Apps/QtViewer/MeshViewerWidgetT.hh | 6 +- .../Subdivider/SubdividerGui/CMakeLists.txt | 11 +- .../VDProgMesh/Synthesizer/CMakeLists.txt | 11 +- 9 files changed, 191 insertions(+), 200 deletions(-) create mode 100644 src/OpenMesh/Apps/QtViewer/MeshViewerWidget.cc diff --git a/cmake/ACGQt.cmake b/cmake/ACGQt.cmake index 217121b6..bee96d9f 100644 --- a/cmake/ACGQt.cmake +++ b/cmake/ACGQt.cmake @@ -144,50 +144,8 @@ macro (acg_qt5) endif() endif(MSVC_IDE) - endif () -endmacro () - -# generate moc targets for sources in list -macro (acg_qt5_automoc moc_SRCS) - qt5_get_moc_flags (_moc_INCS) - - list(REMOVE_DUPLICATES _moc_INCS) - - set (_matching_FILES ) - foreach (_current_FILE ${ARGN}) - - get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE) - # if "SKIP_AUTOMOC" is set to true, we will not handle this file here. - # here. this is required to make bouic work correctly: - # we need to add generated .cpp files to the sources (to compile them), - # but we cannot let automoc handle them, as the .cpp files don't exist yet when - # cmake is run for the very first time on them -> however the .cpp files might - # exist at a later run. at that time we need to skip them, so that we don't add two - # different rules for the same moc file - get_source_file_property (_skip ${_abs_FILE} SKIP_AUTOMOC) - - if ( NOT _skip AND EXISTS ${_abs_FILE} ) + # Enable automoc + set(CMAKE_AUTOMOC ON) - file (READ ${_abs_FILE} _contents) - - get_filename_component (_abs_PATH ${_abs_FILE} PATH) - - string (REGEX MATCHALL "Q_OBJECT" _match "${_contents}") - if (_match) - get_filename_component (_basename ${_current_FILE} NAME_WE) - set (_header ${_abs_FILE}) - set (_moc ${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp) - - add_custom_command (OUTPUT ${_moc} - COMMAND ${QT_MOC_EXECUTABLE} - ARGS ${_moc_INCS} ${_header} -o ${_moc} - DEPENDS ${_header} - ) - - add_file_dependencies (${_abs_FILE} ${_moc}) - set (${moc_SRCS} ${${moc_SRCS}} ${_moc}) - - endif () - endif () - endforeach () + endif (QT5_FOUND) endmacro () diff --git a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt index 89d0596a..cdf8c291 100644 --- a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt @@ -1,54 +1,47 @@ -include (ACGCommon) - -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} - ${GLUT_INCLUDE_DIR} - ${QT_INCLUDE_DIR} -) - - -set (targetName DecimaterGui) - -# source code directories -set (directories - ../../QtViewer - ../ -) - -# collect all header and source files -acg_append_files (headers "*.hh" ${directories}) - -set (sources - ../../QtViewer/QGLViewerWidget.cc - ../../QtViewer/MeshViewerWidgetT.cc - ../DecimaterViewerWidget.cc - ../decimaterviewer.cc -) - -# remove template cc files from source file list -acg_drop_templates (sources) - -# genereate uic and moc targets -if(QT5_FOUND) - acg_qt5_automoc (moc_targets ${headers}) -else() - acg_qt4_automoc (moc_targets ${headers}) -endif() - -if (WIN32) - acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets}) - # link to qtmain library to get WinMain function for a non terminal app - target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) -else () - acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets}) -endif () - -target_link_libraries (${targetName} - OpenMeshCore - OpenMeshTools - ${QT_LIBRARIES} - ${OPENGL_LIBRARIES} - ${GLUT_LIBRARIES} -) - +include (ACGCommon) + +include_directories ( + ../../../.. + ${CMAKE_CURRENT_SOURCE_DIR} + ${GLUT_INCLUDE_DIR} + ${QT_INCLUDE_DIR} +) + + +set (targetName DecimaterGui) + +# source code directories +set (directories + ../../QtViewer + ../ +) + +# collect all header and source files +acg_append_files (headers "*.hh" ${directories}) + +set (sources + ../../QtViewer/QGLViewerWidget.cc + ../../QtViewer/MeshViewerWidgetT.cc + ../DecimaterViewerWidget.cc + ../decimaterviewer.cc +) + +# remove template cc files from source file list +acg_drop_templates (sources) + +if (WIN32) + acg_add_executable (${targetName} WIN32 ${sources} ${headers}) + # link to qtmain library to get WinMain function for a non terminal app + target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) +else () + acg_add_executable (${targetName} ${sources} ${headers} ) +endif () + +target_link_libraries (${targetName} + OpenMeshCore + OpenMeshTools + ${QT_LIBRARIES} + ${OPENGL_LIBRARIES} + ${GLUT_LIBRARIES} +) + diff --git a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt index 092d46cc..174fe47b 100644 --- a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt @@ -39,19 +39,12 @@ list (APPEND headers "../QtViewer/MeshViewerWidgetT.hh") # remove template cc files from source file list acg_drop_templates (sources) -# genereate uic and moc targets -if(QT5_FOUND) - acg_qt5_automoc (moc_targets ${headers}) -else() - acg_qt4_automoc (moc_targets ${headers}) -endif() - if (WIN32) - acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets}) + acg_add_executable (${targetName} WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) else () - acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets}) + acg_add_executable (${targetName} ${sources} ${headers}) endif () target_link_libraries (${targetName} diff --git a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt index 93a1206a..d7991679 100644 --- a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt @@ -7,8 +7,6 @@ include_directories ( ${QT_INCLUDE_DIR} ) -set (targetName QtViewer) - # source code directories set (directories . @@ -21,23 +19,15 @@ acg_append_files (sources "*.cc" ${directories}) # remove template cc files from source file list acg_drop_templates (sources) -# genereate uic and moc targets -if(QT5_FOUND) - acg_qt5_automoc (moc_targets ${headers}) -else() - acg_qt4_automoc (moc_targets ${headers}) -endif() - - if (WIN32) - acg_add_executable (${targetName} WIN32 ${uic_targets} ${sources} ${headers} ${moc_targets}) + acg_add_executable (QtViewer WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) else () - acg_add_executable (${targetName} ${uic_targets} ${sources} ${headers} ${moc_targets}) + acg_add_executable (QtViewer ${sources} ${headers}) endif () -target_link_libraries (${targetName} +target_link_libraries (QtViewer OpenMeshCore OpenMeshTools ${QT_LIBRARIES} diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.cc b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.cc new file mode 100644 index 00000000..2418a97b --- /dev/null +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.cc @@ -0,0 +1,119 @@ +/* ========================================================================= * + * * + * OpenMesh * + * Copyright (c) 2001-2015, RWTH-Aachen University * + * Department of Computer Graphics and Multimedia * + * All rights reserved. * + * www.openmesh.org * + * * + *---------------------------------------------------------------------------* + * This file is part of OpenMesh. * + *---------------------------------------------------------------------------* + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * 3. Neither the name of the copyright holder nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER * + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * + * ========================================================================= */ + +/*===========================================================================*\ + * * + * $Revision$ * + * $Date$ * + * * +\*===========================================================================*/ + +#define OPENMESHAPPS_MESHVIEWERWIDGET_CC + +//== INCLUDES ================================================================= + +#include + + +//== IMPLEMENTATION ========================================================== + +/// default constructor +MeshViewerWidget::MeshViewerWidget(QWidget* parent) : MeshViewerWidgetT(parent) +{} + + void MeshViewerWidget::open_mesh_gui(QString fname) +{ + OpenMesh::Utils::Timer t; + t.start(); + if ( fname.isEmpty() || !open_mesh(fname.toLocal8Bit(), _options) ) + { + QString msg = "Cannot read mesh from file:\n '"; + msg += fname; + msg += "'"; + QMessageBox::critical( NULL, windowTitle(), msg); + } + t.stop(); + std::cout << "Loaded mesh in ~" << t.as_string() << std::endl; + +} + +void MeshViewerWidget::open_texture_gui(QString fname) +{ + if ( fname.isEmpty() || !open_texture( fname.toLocal8Bit() ) ) + { + QString msg = "Cannot load texture image from file:\n '"; + msg += fname; + msg += "'\n\nPossible reasons:\n"; + msg += "- Mesh file didn't provide texture coordinates\n"; + msg += "- Texture file does not exist\n"; + msg += "- Texture file is not accessible.\n"; + QMessageBox::warning( NULL, windowTitle(), msg ); + } +} + +void MeshViewerWidget::query_open_mesh_file() { + QString fileName = QFileDialog::getOpenFileName(this, + tr("Open mesh file"), + tr(""), + tr("OBJ Files (*.obj);;" + "OFF Files (*.off);;" + "STL Files (*.stl);;" + "All Files (*)")); + if (!fileName.isEmpty()) + open_mesh_gui(fileName); +} + +void MeshViewerWidget::query_open_texture_file() { + QString fileName = QFileDialog::getOpenFileName(this, + tr("Open texture file"), + tr(""), + tr("PNG Files (*.png);;" + "BMP Files (*.bmp);;" + "GIF Files (*.gif);;" + "JPEG Files (*.jpg);;" + "TIFF Files (*.tif);;" + "All Files (*)")); + if (!fileName.isEmpty()) + open_texture_gui(fileName); +} + +//============================================================================= + diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh index 7c8c1cd4..ab229c7b 100644 --- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh @@ -46,8 +46,7 @@ * * \*===========================================================================*/ -#ifndef OPENMESHAPPS_VIEWERWIDGET_HH -#define OPENMESHAPPS_VIEWERWIDGET_HH +#pragma once //== INCLUDES ================================================================= @@ -55,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -80,70 +80,24 @@ typedef OpenMesh::TriMesh_ArrayKernelT MyMesh; class MeshViewerWidget : public MeshViewerWidgetT { Q_OBJECT + public: /// default constructor - explicit MeshViewerWidget(QWidget* parent=0) : MeshViewerWidgetT(parent) - {} + MeshViewerWidget(QWidget* parent=0); + OpenMesh::IO::Options& options() { return _options; } const OpenMesh::IO::Options& options() const { return _options; } void setOptions(const OpenMesh::IO::Options& opts) { _options = opts; } - void open_mesh_gui(QString fname) - { - OpenMesh::Utils::Timer t; - t.start(); - if ( fname.isEmpty() || !open_mesh(fname.toLocal8Bit(), _options) ) - { - QString msg = "Cannot read mesh from file:\n '"; - msg += fname; - msg += "'"; - QMessageBox::critical( NULL, windowTitle(), msg); - } - t.stop(); - std::cout << "Loaded mesh in ~" << t.as_string() << std::endl; - } - void open_texture_gui(QString fname) - { - if ( fname.isEmpty() || !open_texture( fname.toLocal8Bit() ) ) - { - QString msg = "Cannot load texture image from file:\n '"; - msg += fname; - msg += "'\n\nPossible reasons:\n"; - msg += "- Mesh file didn't provide texture coordinates\n"; - msg += "- Texture file does not exist\n"; - msg += "- Texture file is not accessible.\n"; - QMessageBox::warning( NULL, windowTitle(), msg ); - } - } + void open_mesh_gui(QString fname); + + void open_texture_gui(QString fname); public slots: - void query_open_mesh_file() { - QString fileName = QFileDialog::getOpenFileName(this, - tr("Open mesh file"), - tr(""), - tr("OBJ Files (*.obj);;" - "OFF Files (*.off);;" - "STL Files (*.stl);;" - "All Files (*)")); - if (!fileName.isEmpty()) - open_mesh_gui(fileName); - } - void query_open_texture_file() { - QString fileName = QFileDialog::getOpenFileName(this, - tr("Open texture file"), - tr(""), - tr("PNG Files (*.png);;" - "BMP Files (*.bmp);;" - "GIF Files (*.gif);;" - "JPEG Files (*.jpg);;" - "TIFF Files (*.tif);;" - "All Files (*)")); - if (!fileName.isEmpty()) - open_texture_gui(fileName); - } + void query_open_mesh_file(); + + void query_open_texture_file(); private: OpenMesh::IO::Options _options; }; - -#endif diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh index ce076d62..f11cf59d 100644 --- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh @@ -47,8 +47,7 @@ \*===========================================================================*/ -#ifndef OPENMESHAPPS_MESHVIEWERWIDGETT_HH -#define OPENMESHAPPS_MESHVIEWERWIDGETT_HH +#pragma once //== INCLUDES ================================================================= @@ -75,6 +74,7 @@ class QImage; template class MeshViewerWidgetT : public QGLViewerWidget { + public: typedef M Mesh; @@ -200,6 +200,4 @@ protected: # include "MeshViewerWidgetT.cc" #endif //============================================================================= -#endif // OPENMESHAPPS_MESHVIEWERWIDGETT_HH defined -//============================================================================= diff --git a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt index abc8f9f1..bc0b4b61 100644 --- a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt @@ -28,19 +28,12 @@ set (sources # remove template cc files from source file list acg_drop_templates (sources) -# genereate uic and moc targets -if(QT5_FOUND) - acg_qt5_automoc (moc_targets ${headers}) -else() - acg_qt4_automoc (moc_targets ${headers}) -endif() - if (WIN32) - acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets}) + acg_add_executable (${targetName} WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) else () - acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets}) + acg_add_executable (${targetName} ${sources} ${headers}) endif () target_link_libraries (${targetName} diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt index ac1216ed..f676728b 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt @@ -22,19 +22,12 @@ list (APPEND headers "../../QtViewer/MeshViewerWidgetT.hh") # remove template cc files from source file list acg_drop_templates (sources) -# genereate uic and moc targets -if(QT5_FOUND) - acg_qt5_automoc (moc_targets ${headers}) -else() - acg_qt4_automoc (moc_targets ${headers}) -endif() - if (WIN32) - acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets}) + acg_add_executable (${targetName} WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) else () - acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets}) + acg_add_executable (${targetName} ${sources} ${headers}) endif () target_link_libraries (${targetName} -- GitLab From b2da36fcfdad719c6db5cad72cc1778fe46f77fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 14 Dec 2018 11:25:50 +0100 Subject: [PATCH 2/4] Added missing explicit to make cppcheck happy again --- src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh index ab229c7b..03276073 100644 --- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh @@ -83,7 +83,7 @@ class MeshViewerWidget : public MeshViewerWidgetT public: /// default constructor - MeshViewerWidget(QWidget* parent=0); + explicit MeshViewerWidget(QWidget* parent=0); OpenMesh::IO::Options& options() { return _options; } const OpenMesh::IO::Options& options() const { return _options; } -- GitLab From 92b580a9eccd706b94ec4061f011c32cf3dd8a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 14 Dec 2018 11:51:28 +0100 Subject: [PATCH 3/4] Fixed naming typo --- cmake/ACGQt.cmake | 3 --- src/OpenMesh/Apps/QtViewer/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cmake/ACGQt.cmake b/cmake/ACGQt.cmake index bee96d9f..c5c6a5a9 100644 --- a/cmake/ACGQt.cmake +++ b/cmake/ACGQt.cmake @@ -16,9 +16,6 @@ macro (acg_qt5) # Automatically link Qt executables to qtmain target on Windows cmake_policy(SET CMP0020 NEW) endif(POLICY CMP0020) - #if (NOT QT5_FOUND) - - #set (QT_MIN_VERSION ${ARGN}) #try to find qt5 automatically #for custom installation of qt5, dont use any of these variables diff --git a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt index d7991679..2cfb0fc5 100644 --- a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt @@ -22,7 +22,7 @@ acg_drop_templates (sources) if (WIN32) acg_add_executable (QtViewer WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app - target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) + target_link_libraries (QtViewer ${QT_QTMAIN_LIBRARY}) else () acg_add_executable (QtViewer ${sources} ${headers}) endif () -- GitLab From 06061b2d5b800aed14e175db39e77f21bb815e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 14 Dec 2018 11:59:42 +0100 Subject: [PATCH 4/4] Some cleanup in App cmake files to make them smaller and more readable --- .../Decimating/DecimaterGui/CMakeLists.txt | 11 +++----- .../commandlineDecimater/CMakeLists.txt | 6 ++--- src/OpenMesh/Apps/Dualizer/CMakeLists.txt | 6 ++--- src/OpenMesh/Apps/ProgViewer/CMakeLists.txt | 26 +++---------------- src/OpenMesh/Apps/Smoothing/CMakeLists.txt | 6 ++--- .../Subdivider/SubdividerGui/CMakeLists.txt | 10 +++---- .../CMakeLists.txt | 6 ++--- .../commandlineSubdivider/CMakeLists.txt | 6 ++--- .../Apps/VDProgMesh/Analyzer/CMakeLists.txt | 6 ++--- .../VDProgMesh/Synthesizer/CMakeLists.txt | 10 +++---- .../VDProgMesh/mkbalancedpm/CMakeLists.txt | 6 ++--- src/OpenMesh/Apps/mconvert/CMakeLists.txt | 6 ++--- 12 files changed, 32 insertions(+), 73 deletions(-) diff --git a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt index cdf8c291..5357f844 100644 --- a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt @@ -7,9 +7,6 @@ include_directories ( ${QT_INCLUDE_DIR} ) - -set (targetName DecimaterGui) - # source code directories set (directories ../../QtViewer @@ -30,14 +27,14 @@ set (sources acg_drop_templates (sources) if (WIN32) - acg_add_executable (${targetName} WIN32 ${sources} ${headers}) + acg_add_executable (DecimaterGui WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app - target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) + target_link_libraries (DecimaterGui ${QT_QTMAIN_LIBRARY}) else () - acg_add_executable (${targetName} ${sources} ${headers} ) + acg_add_executable (DecimaterGui ${sources} ${headers} ) endif () -target_link_libraries (${targetName} +target_link_libraries (DecimaterGui OpenMeshCore OpenMeshTools ${QT_LIBRARIES} diff --git a/src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt b/src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt index 67642927..daa3ec11 100644 --- a/src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt +++ b/src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt @@ -5,16 +5,14 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -set (targetName commandlineDecimater) - # collect all header and source files set (sources ../decimater.cc ) -acg_add_executable (${targetName} ${sources}) +acg_add_executable (commandlineDecimater ${sources}) -target_link_libraries (${targetName} +target_link_libraries (commandlineDecimater OpenMeshCore OpenMeshTools ) diff --git a/src/OpenMesh/Apps/Dualizer/CMakeLists.txt b/src/OpenMesh/Apps/Dualizer/CMakeLists.txt index 861f5fed..65a36fc2 100644 --- a/src/OpenMesh/Apps/Dualizer/CMakeLists.txt +++ b/src/OpenMesh/Apps/Dualizer/CMakeLists.txt @@ -5,15 +5,13 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -set (targetName Dualizer) - # collect all header and source files acg_append_files (headers "*.hh" .) acg_append_files (sources "*.cc" .) -acg_add_executable (${targetName} ${headers} ${sources}) +acg_add_executable (Dualizer ${headers} ${sources}) -target_link_libraries (${targetName} +target_link_libraries (Dualizer OpenMeshCore OpenMeshTools ) diff --git a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt index 174fe47b..e25a2c6b 100644 --- a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt @@ -7,8 +7,6 @@ include_directories ( ${QT_INCLUDE_DIR} ) -set (targetName ProgViewer) - # collect all header and source files acg_append_files (headers "*.hh" .) @@ -20,34 +18,18 @@ list (APPEND sources "../QtViewer/MeshViewerWidgetT.cc") list (APPEND headers "../QtViewer/QGLViewerWidget.hh") list (APPEND headers "../QtViewer/MeshViewerWidgetT.hh") - -# # source code directories -# set (directories -# . -# ../QtViewer -# ) - -# # collect all header and source files -# acg_append_files (headers "*.hh" ${directories}) - -# set (sources -# ../../QtViewer/QGLViewerWidget.cc -# ../../QtViewer/MeshViewerWidgetT.cc -# ./ProgViewerWidget.cc -# ) - # remove template cc files from source file list acg_drop_templates (sources) if (WIN32) - acg_add_executable (${targetName} WIN32 ${sources} ${headers}) + acg_add_executable( ProgViewer WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app - target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) + target_link_libraries( ProgViewer ${QT_QTMAIN_LIBRARY}) else () - acg_add_executable (${targetName} ${sources} ${headers}) + acg_add_executable( ProgViewer ${sources} ${headers}) endif () -target_link_libraries (${targetName} +target_link_libraries ( ProgViewer OpenMeshCore OpenMeshTools ${QT_LIBRARIES} diff --git a/src/OpenMesh/Apps/Smoothing/CMakeLists.txt b/src/OpenMesh/Apps/Smoothing/CMakeLists.txt index 82eac480..e330787f 100644 --- a/src/OpenMesh/Apps/Smoothing/CMakeLists.txt +++ b/src/OpenMesh/Apps/Smoothing/CMakeLists.txt @@ -5,15 +5,13 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -set (targetName Smoothing) - # collect all header and source files acg_append_files (headers "*.hh" .) acg_append_files (sources "*.cc" .) -acg_add_executable (${targetName} ${headers} ${sources}) +acg_add_executable (Smoothing ${headers} ${sources}) -target_link_libraries (${targetName} +target_link_libraries (Smoothing OpenMeshCore OpenMeshTools ) diff --git a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt index bc0b4b61..112eb226 100644 --- a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt @@ -7,8 +7,6 @@ include_directories ( ${QT_INCLUDE_DIR} ) -set (targetName SubdividerGui) - # source code directories set (directories ../../QtViewer @@ -29,14 +27,14 @@ set (sources acg_drop_templates (sources) if (WIN32) - acg_add_executable (${targetName} WIN32 ${sources} ${headers}) + acg_add_executable (SubdividerGui WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app - target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) + target_link_libraries (SubdividerGui ${QT_QTMAIN_LIBRARY}) else () - acg_add_executable (${targetName} ${sources} ${headers}) + acg_add_executable (SubdividerGui ${sources} ${headers}) endif () -target_link_libraries (${targetName} +target_link_libraries (SubdividerGui OpenMeshCore OpenMeshTools ${QT_LIBRARIES} diff --git a/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt index 0cd93599..35800704 100644 --- a/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt @@ -5,16 +5,14 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -set (targetName commandlineAdaptiveSubdivider) - # collect all header and source files set (sources ../adaptive_subdivider.cc ) -acg_add_executable (${targetName} ${sources}) +acg_add_executable (commandlineAdaptiveSubdivider ${sources}) -target_link_libraries (${targetName} +target_link_libraries (commandlineAdaptiveSubdivider OpenMeshCore OpenMeshTools ) diff --git a/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt index bcc48469..0ef2b3bb 100644 --- a/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt @@ -5,16 +5,14 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -set (targetName commandlineSubdivider) - # collect all header and source files set (sources ../subdivider.cc ) -acg_add_executable (${targetName} ${sources}) +acg_add_executable (commandlineSubdivider ${sources}) -target_link_libraries (${targetName} +target_link_libraries (commandlineSubdivider OpenMeshCore OpenMeshTools ) diff --git a/src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt index 16c92eb6..f1e00640 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt @@ -5,16 +5,14 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -set (targetName Analyzer) - # collect all header and source files set (sources ./vdpmanalyzer.cc ) -acg_add_executable (${targetName} ${sources}) +acg_add_executable (Analyzer ${sources}) -target_link_libraries (${targetName} +target_link_libraries (Analyzer OpenMeshCore OpenMeshTools ) diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt index f676728b..2beaac53 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt @@ -7,8 +7,6 @@ include_directories ( ${QT_INCLUDE_DIR} ) -set (targetName Synthesizer) - # collect all header and source files acg_append_files (headers "*.hh" .) acg_append_files (sources "*.cc" .) @@ -23,14 +21,14 @@ list (APPEND headers "../../QtViewer/MeshViewerWidgetT.hh") acg_drop_templates (sources) if (WIN32) - acg_add_executable (${targetName} WIN32 ${sources} ${headers}) + acg_add_executable (Synthesizer WIN32 ${sources} ${headers}) # link to qtmain library to get WinMain function for a non terminal app - target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) + target_link_libraries (Synthesizer ${QT_QTMAIN_LIBRARY}) else () - acg_add_executable (${targetName} ${sources} ${headers}) + acg_add_executable (Synthesizer ${sources} ${headers}) endif () -target_link_libraries (${targetName} +target_link_libraries (Synthesizer OpenMeshCore OpenMeshTools ${QT_LIBRARIES} diff --git a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt index c0e311e4..f4662079 100644 --- a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt @@ -5,16 +5,14 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -set (targetName mkbalancedpm) - # collect all header and source files set (sources ./mkbalancedpm.cc ) -acg_add_executable (${targetName} ${sources}) +acg_add_executable (mkbalancedpm ${sources}) -target_link_libraries (${targetName} +target_link_libraries (mkbalancedpm OpenMeshCore OpenMeshTools ) diff --git a/src/OpenMesh/Apps/mconvert/CMakeLists.txt b/src/OpenMesh/Apps/mconvert/CMakeLists.txt index dc76a122..b4c29800 100644 --- a/src/OpenMesh/Apps/mconvert/CMakeLists.txt +++ b/src/OpenMesh/Apps/mconvert/CMakeLists.txt @@ -5,15 +5,13 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -set (targetName mconvert) - # collect all header and source files acg_append_files (headers "*.hh" .) acg_append_files (sources "*.cc" .) -acg_add_executable (${targetName} ${headers} ${sources}) +acg_add_executable (mconvert ${headers} ${sources}) -target_link_libraries (${targetName} +target_link_libraries (mconvert OpenMeshCore OpenMeshTools ) -- GitLab