Merge branch 'cmake_jan' into 'master'

Cmake jan

See merge request OpenMesh/OpenMesh!316
This commit is contained in:
Jan Möbius
2022-02-23 11:04:06 +00:00
17 changed files with 309 additions and 126 deletions

View File

@@ -8,6 +8,11 @@
<tr valign=top><td><b>9.1</b> (?/?/?)</td><td>
<b>Build System</b>
<ul>
<li>Removed globbing for Core and Tools library include and source files</li>
<li>Removed global includes from App builds</li>
</ul>
</tr>

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
set (headers
../DecimaterViewerWidget.hh
../../QtViewer/QGLViewerWidget.hh

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
vci_add_executable (commandlineDecimater ../decimater.cc)
target_link_libraries (commandlineDecimater

View File

@@ -1,9 +1,5 @@
include (VCICommon)
include_directories (
../../..
)
vci_add_executable (Dualizer dualizer.cc)
target_link_libraries (Dualizer

View File

@@ -1,11 +1,5 @@
include (VCICommon)
include_directories (
../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
set( headers
ProgViewerWidget.hh
../QtViewer/QGLViewerWidget.hh

View File

@@ -1,15 +1,5 @@
include (VCICommon)
include_directories (
../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
# source code directories
set (directories
.
)
set (sources
MeshViewerWidget.cc
QGLViewerWidget.cc

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
vci_add_executable (Smoothing smooth.cc)
target_link_libraries (Smoothing

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
set (headers
../MeshViewerWidget.hh
../SubdivideWidget.hh

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
vci_add_executable (commandlineAdaptiveSubdivider ../adaptive_subdivider.cc)
target_link_libraries (commandlineAdaptiveSubdivider

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
vci_add_executable (commandlineSubdivider ../subdivider.cc)
target_link_libraries (commandlineSubdivider

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
vci_add_executable (Analyzer vdpmanalyzer.cc)
target_link_libraries (Analyzer

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
set (headers
VDPMSynthesizerViewerWidget.hh
)

View File

@@ -1,10 +1,5 @@
include (VCICommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
vci_add_executable (mkbalancedpm mkbalancedpm.cc)
target_link_libraries (mkbalancedpm

View File

@@ -1,9 +1,5 @@
include (VCICommon)
include_directories (
../../..
)
vci_add_executable (mconvert mconvert.cc)
target_link_libraries (mconvert

View File

@@ -1,29 +1,134 @@
include (VCICommon)
include_directories (
../..
${CMAKE_CURRENT_SOURCE_DIR}
set ( headers
Geometry/Config.hh
Geometry/EigenVectorT.hh
Geometry/LoopSchemeMaskT.hh
Geometry/MathDefs.hh
Geometry/NormalConeT.hh
Geometry/NormalConeT_impl.hh
Geometry/Plane3d.hh
Geometry/QuadricT.hh
Geometry/Vector11T.hh
Geometry/VectorT.hh
Geometry/VectorT_inc.hh
IO/BinaryHelper.hh
IO/IOInstances.hh
IO/IOManager.hh
IO/MeshIO.hh
IO/OFFFormat.hh
IO/OMFormat.hh
IO/OMFormatT_impl.hh
IO/Options.hh
IO/SR_binary.hh
IO/SR_binary_spec.hh
IO/SR_rbo.hh
IO/SR_store.hh
IO/SR_types.hh
IO/StoreRestore.hh
IO/exporter/BaseExporter.hh
IO/exporter/ExporterT.hh
IO/importer/BaseImporter.hh
IO/importer/ImporterT.hh
IO/reader/BaseReader.hh
IO/reader/OBJReader.hh
IO/reader/OFFReader.hh
IO/reader/OMReader.hh
IO/reader/PLYReader.hh
IO/reader/STLReader.hh
IO/writer/BaseWriter.hh
IO/writer/OBJWriter.hh
IO/writer/OFFWriter.hh
IO/writer/OMWriter.hh
IO/writer/PLYWriter.hh
IO/writer/STLWriter.hh
IO/writer/VTKWriter.hh
Mesh/ArrayItems.hh
Mesh/ArrayKernel.hh
Mesh/ArrayKernelT_impl.hh
Mesh/AttribKernelT.hh
Mesh/Attributes.hh
Mesh/BaseKernel.hh
Mesh/BaseMesh.hh
Mesh/Casts.hh
Mesh/CirculatorsT.hh
Mesh/DefaultPolyMesh.hh
Mesh/DefaultTriMesh.hh
Mesh/FinalMeshItemsT.hh
Mesh/Handles.hh
Mesh/IteratorsT.hh
Mesh/PolyConnectivity.hh
Mesh/PolyConnectivity_inline_impl.hh
Mesh/PolyMeshT.hh
Mesh/PolyMeshT_impl.hh
Mesh/PolyMesh_ArrayKernelT.hh
Mesh/SmartHandles.hh
Mesh/SmartRange.hh
Mesh/Status.hh
Mesh/Tags.hh
Mesh/Traits.hh
Mesh/TriConnectivity.hh
Mesh/TriMeshT.hh
Mesh/TriMeshT_impl.hh
Mesh/TriMesh_ArrayKernelT.hh
Mesh/gen/circulators_header.hh
Mesh/gen/circulators_template.hh
Mesh/gen/footer.hh
Mesh/gen/iterators_header.hh
Mesh/gen/iterators_template.hh
System/OpenMeshDLLMacros.hh
System/compiler.hh
System/config.hh
System/mostream.hh
System/omstream.hh
Utils/AutoPropertyHandleT.hh
Utils/BaseProperty.hh
Utils/Endian.hh
Utils/GenProg.hh
Utils/HandleToPropHandle.hh
Utils/Noncopyable.hh
Utils/Predicates.hh
Utils/Property.hh
Utils/PropertyContainer.hh
Utils/PropertyCreator.hh
Utils/PropertyManager.hh
Utils/RandomNumberGenerator.hh
Utils/SingletonT.hh
Utils/SingletonT_impl.hh
Utils/color_cast.hh
Utils/typename.hh
Utils/vector_cast.hh
Utils/vector_traits.hh
)
# source code directories
set (directories
.
Geometry
IO
IO/exporter
IO/importer
IO/reader
IO/writer
Mesh
Mesh/gen
System
Utils
set ( sources
IO/BinaryHelper.cc
IO/IOManager.cc
IO/OMFormat.cc
IO/reader/BaseReader.cc
IO/reader/OBJReader.cc
IO/reader/OFFReader.cc
IO/reader/OMReader.cc
IO/reader/PLYReader.cc
IO/reader/STLReader.cc
IO/writer/BaseWriter.cc
IO/writer/OBJWriter.cc
IO/writer/OFFWriter.cc
IO/writer/OMWriter.cc
IO/writer/PLYWriter.cc
IO/writer/STLWriter.cc
IO/writer/VTKWriter.cc
Mesh/ArrayKernel.cc
Mesh/BaseKernel.cc
Mesh/PolyConnectivity.cc
Mesh/TriConnectivity.cc
System/omstream.cc
Utils/BaseProperty.cc
Utils/Endian.cc
Utils/PropertyCreator.cc
Utils/RandomNumberGenerator.cc
)
# collect all header and source files
vci_append_files (headers "*.hh" ${directories})
vci_append_files (sources "*.cc" ${directories})
# Disable Library installation when not building OpenMesh on its own but as part of another project!
if ( NOT ${CMAKE_PROJECT_NAME} MATCHES "OpenMesh")
set(VCI_NO_LIBRARY_INSTALL true)
@@ -36,12 +141,25 @@ if (WIN32)
add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL)
vci_add_library (OpenMeshCore SHARED ${sources} ${headers})
else()
# OpenMesh has no dll exports so we have to build a static library on windows
vci_add_library (OpenMeshCore STATIC ${sources} ${headers})
endif()
target_include_directories(OpenMeshCore PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
else ()
vci_add_library (OpenMeshCore SHAREDANDSTATIC ${sources} ${headers})
target_include_directories(OpenMeshCore PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
target_include_directories(OpenMeshCoreStatic PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
set_target_properties (OpenMeshCore PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} )
endif ()
@@ -141,10 +259,6 @@ install(DIRECTORY IO/
PATTERN "Debian*" EXCLUDE )
endif ()
target_include_directories(OpenMeshCore PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
install(TARGETS OpenMeshCore EXPORT OpenMeshConfig
ARCHIVE DESTINATION ${VCI_PROJECT_LIBDIR}
LIBRARY DESTINATION ${VCI_PROJECT_LIBDIR}

View File

@@ -1,29 +1,98 @@
include (VCICommon)
include_directories (
../..
${CMAKE_CURRENT_SOURCE_DIR}
set ( headers
Decimater/BaseDecimaterT.hh
Decimater/BaseDecimaterT_impl.hh
Decimater/CollapseInfoT.hh
Decimater/DecimaterT.hh
Decimater/DecimaterT_impl.hh
Decimater/McDecimaterT.hh
Decimater/McDecimaterT_impl.hh
Decimater/MixedDecimaterT.hh
Decimater/MixedDecimaterT_impl.hh
Decimater/ModAspectRatioT.hh
Decimater/ModAspectRatioT_impl.hh
Decimater/ModBaseT.hh
Decimater/ModEdgeLengthT.hh
Decimater/ModEdgeLengthT_impl.hh
Decimater/ModHausdorffT.hh
Decimater/ModHausdorffT_impl.hh
Decimater/ModIndependentSetsT.hh
Decimater/ModNormalDeviationT.hh
Decimater/ModNormalFlippingT.hh
Decimater/ModProgMeshT.hh
Decimater/ModProgMeshT_impl.hh
Decimater/ModQuadricT.hh
Decimater/ModQuadricT_impl.hh
Decimater/ModRoundnessT.hh
Decimater/Observer.hh
Dualizer/meshDualT.hh
Smoother/JacobiLaplaceSmootherT.hh
Smoother/JacobiLaplaceSmootherT_impl.hh
Smoother/LaplaceSmootherT.hh
Smoother/LaplaceSmootherT_impl.hh
Smoother/SmootherT.hh
Smoother/SmootherT_impl.hh
Smoother/smooth_mesh.hh
Subdivider/Adaptive/Composite/CompositeT.hh
Subdivider/Adaptive/Composite/CompositeT_impl.hh
Subdivider/Adaptive/Composite/CompositeTraits.hh
Subdivider/Adaptive/Composite/RuleInterfaceT.hh
Subdivider/Adaptive/Composite/RulesT.hh
Subdivider/Adaptive/Composite/RulesT_impl.hh
Subdivider/Adaptive/Composite/Traits.hh
Subdivider/Uniform/Composite/CompositeT.hh
Subdivider/Uniform/Composite/CompositeT_impl.hh
Subdivider/Uniform/Composite/CompositeTraits.hh
Subdivider/Uniform/CatmullClarkT.hh
Subdivider/Uniform/CatmullClarkT_impl.hh
Subdivider/Uniform/CompositeLoopT.hh
Subdivider/Uniform/CompositeSqrt3T.hh
Subdivider/Uniform/LongestEdgeT.hh
Subdivider/Uniform/LoopT.hh
Subdivider/Uniform/MidpointT.hh
Subdivider/Uniform/ModifiedButterFlyT.hh
Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh
Subdivider/Uniform/Sqrt3T.hh
Subdivider/Uniform/SubdividerT.hh
Utils/Config.hh
Utils/GLConstAsString.hh
Utils/Gnuplot.hh
Utils/HeapT.hh
Utils/MeshCheckerT.hh
Utils/MeshCheckerT_impl.hh
Utils/NumLimitsT.hh
Utils/StripifierT.hh
Utils/StripifierT_impl.hh
Utils/TestingFramework.hh
Utils/Timer.hh
Utils/conio.hh
VDPM/MeshTraits.hh
VDPM/StreamingDef.hh
VDPM/VFront.hh
VDPM/VHierarchy.hh
VDPM/VHierarchyNode.hh
VDPM/VHierarchyNodeIndex.hh
VDPM/VHierarchyWindow.hh
VDPM/ViewingParameters.hh
)
# source code directories
set (directories
.
Decimater
Dualizer
Smoother
Subdivider/Adaptive/Composite
Subdivider/Uniform/Composite
Subdivider/Uniform
Utils
VDPM
set ( sources
Decimater/Observer.cc
Utils/Gnuplot.cc
Utils/Timer.cc
Utils/conio.cc
VDPM/VFront.cc
VDPM/VHierarchy.cc
VDPM/VHierarchyNodeIndex.cc
VDPM/VHierarchyWindow.cc
VDPM/ViewingParameters.cc
)
# collect all header and source files
vci_append_files (headers "*.hh" ${directories})
vci_append_files (sources "*.cc" ${directories})
IF(WIN32 AND NOT MINGW)
vci_append_files (sources "*.c" ${directories})
list(APPEND sources "Utils/getopt.c")
ENDIF(WIN32 AND NOT MINGW)
# Disable Library installation when not building OpenMesh on its own but as part of another project!
@@ -42,8 +111,21 @@ if (WIN32)
vci_add_library (OpenMeshTools STATIC ${sources} ${headers})
endif()
target_include_directories(OpenMeshTools PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
else ()
vci_add_library (OpenMeshTools SHAREDANDSTATIC ${sources} ${headers})
target_include_directories(OpenMeshTools PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
target_include_directories(OpenMeshToolsStatic PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
set_target_properties (OpenMeshTools PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} )
endif ()
@@ -104,9 +186,8 @@ else()
endif()
if (NOT APPLE AND NOT ${OPENMESH_NO_INSTALL_HEADERS})
# Install Header Files
install(DIRECTORY .
# Install Header Files
install(DIRECTORY .
DESTINATION include/OpenMesh/Tools
FILES_MATCHING
PATTERN "*.hh"
@@ -116,15 +197,10 @@ install(DIRECTORY .
PATTERN "Templates" EXCLUDE
PATTERN "Debian*" EXCLUDE)
#install the config file
install(FILES Utils/getopt.h DESTINATION include/OpenMesh/Tools/Utils)
#install the config file
install(FILES Utils/getopt.h DESTINATION include/OpenMesh/Tools/Utils)
endif ()
target_include_directories(OpenMeshTools PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
install(TARGETS OpenMeshTools EXPORT OpenMeshConfig
ARCHIVE DESTINATION ${VCI_PROJECT_LIBDIR}
LIBRARY DESTINATION ${VCI_PROJECT_LIBDIR}

View File

@@ -1,10 +1,68 @@
include (VCICommon)
include_directories (
..
${CMAKE_CURRENT_SOURCE_DIR}
set( UNITTEST_SRC
unittests.cc
unittests_add_face.cc
unittests_boundary.cc
unittests_centroid_calculations.cc
unittests_convert_meshes.cc
unittests_cpp_11_features.cc
unittests_decimater.cc
unittests_delete_face.cc
unittests_eigen3_type.cc
unittests_faceless_mesh.cc
unittests_mc_decimater.cc
unittests_mesh_cast.cc
unittests_mesh_dual.cc
unittests_mesh_type.cc
unittests_mixed_decimater.cc
unittests_normal_calculations.cc
unittests_polymesh_collapse.cc
unittests_polymesh_vec2i.cc
unittests_property.cc
unittests_propertymanager.cc
unittests_randomNumberGenerator.cc
unittests_read_write_OBJ.cc
unittests_read_write_OFF.cc
unittests_read_write_OM.cc
unittests_read_write_PLY.cc
unittests_read_write_STL.cc
unittests_set_positions_directly.cc
unittests_smart_handles.cc
unittests_smart_ranges.cc
unittests_smarttagger.cc
unittests_smoother.cc
unittests_split_copy.cc
unittests_split_edge_copy.cc
unittests_sr_binary.cc
unittests_stripifier.cc
unittests_subdivider_adaptive.cc
unittests_subdivider_uniform.cc
unittests_trimesh_circulator_current_halfedge_handle_replacement.cc
unittests_trimesh_circulator_face_edge.cc
unittests_trimesh_circulator_face_face.cc
unittests_trimesh_circulator_face_halfedge.cc
unittests_trimesh_circulator_face_vertex.cc
unittests_trimesh_circulator_halfedge_loop.cc
unittests_trimesh_circulator_vertex_edge.cc
unittests_trimesh_circulator_vertex_face.cc
unittests_trimesh_circulator_vertex_ihalfedge.cc
unittests_trimesh_circulator_vertex_ohalfedge.cc
unittests_trimesh_circulator_vertex_vertex.cc
unittests_trimesh_collapse.cc
unittests_trimesh_garbage_collection.cc
unittests_trimesh_iterators.cc
unittests_trimesh_others.cc
unittests_trimesh_ranges.cc
unittests_trimesh_split.cc
unittests_trimesh_vec2i.cc
unittests_tutorials.cc
unittests_vdpm.cc
unittests_vector_type.cc
)
if ( NOT DEFINED OPENMESH_BUILD_UNIT_TESTS)
set( OPENMESH_BUILD_UNIT_TESTS false CACHE BOOL "Enable or disable unit test builds in OpenMesh." )
endif()
@@ -35,7 +93,6 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
endif()
# Create new target named unittests_hexmeshing
FILE(GLOB UNITTEST_SRC *.cc)
# Create unittest executable
vci_add_executable(unittests ${UNITTEST_SRC})
vci_add_executable(unittests_customvec ${UNITTEST_SRC})