...
 
Commits (21)
......@@ -53,6 +53,8 @@ ECHO "==============================================================="
IF %errorlevel% NEQ 0 exit /b %errorlevel%
dir /S
cd ..
cd src\Unittests\TestFiles
......
......@@ -10,6 +10,10 @@ export PATH
OPTIONS=""
OPTIONS="${OPTIONS} -DGTEST_LIBRARY=${HOME}/sw/gtest-1.7.0/lib/libgtest.a"
OPTIONS="${OPTIONS} -DGTEST_INCLUDE_DIR=${HOME}/sw/gtest-1.7.0/include/"
OPTIONS="${OPTIONS} -DGTEST_MAIN_LIBRARY=${HOME}/sw/gtest-1.7.0/lib/libgtest_main.a"
if [ "$LANGUAGE" == "C++98" ]; then
echo "Building with C++98";
elif [ "$LANGUAGE" == "C++11" ]; then
......
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 11)
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_policy(VERSION 3.12.0)
if("${PROJECT_NAME}" STREQUAL "")
message("Setting project name to OpenVolumeMesh")
project (OpenVolumeMesh)
set(CMAKE_MACOSX_RPATH 1)
project (OpenVolumeMesh
VERSION 2.1.0
LANGUAGES CXX
HOMEPAGE_URL https://openvolumemesh.org/
)
endif()
# add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set (CMAKE_DEBUG_POSTFIX "d")
#list(INSERT CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
#list(REMOVE_AT CMAKE_MODULE_PATH -1)
# Enable bigobj on MSVC Windows debug mode
if ( MSVC )
add_compile_options("$<IF:$<CXX_COMPILER_ID:MSVC>,$<$<CONFIG:DEBUG>:/bigobj>,>")
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
set(OVM_STANDALONE_BUILD TRUE)
else()
set(OVM_STANDALONE_BUILD FALSE)
endif()
if (WIN32)
add_definitions( -D_USE_MATH_DEFINES -DNOMINMAX )
endif ()
# include our cmake files
include (ACGCommon)
#message("OVM_STANDALONE_BUILD: ${OVM_STANDALONE_BUILD}")
acg_get_version ()
set(OVM_ENABLE_UNITTESTS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh unit tests in 'all' target")
set(OVM_ENABLE_EXAMPLES ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh examples in 'all' target")
include (ACGOutput)
# add our macro directory to cmake search path
set (CMAKE_DEBUG_POSTFIX "d")
# ========================================================================
# Call the subdirectories with the projects
# ========================================================================
enable_testing()
add_subdirectory (src)
# Only add examples and doc to build target if OpenVolumeMesh
# is not built as external library only
if(${PROJECT_NAME} MATCHES "OpenVolumeMesh")
if (OVM_ENABLE_EXAMPLES)
add_subdirectory (examples)
add_subdirectory (documentation)
else()
add_subdirectory (examples EXCLUDE_FROM_ALL)
endif()
# ========================================================================
# Bundle generation (Targets exist, now configure them)
# ========================================================================
#add_subdirectory (documentation EXCLUDE_FROM_ALL)
# display results
acg_print_configure_header (OPENVOLUMEMESH "OpenVolumeMesh")
export(PACKAGE OpenVolumeMesh)
# Locate and configure the Google Test libraries.
#
# Defines the following variable:
#
# GTEST_FOUND - Found the Google Test libraries
# GTEST_INCLUDE_DIRS - The directories needed on the include paths
# GTEST_LIBRARIES - The libraries to link to test executables
# GTEST_MAIN_LIBRARIES - The libraries to link for automatic main() provision
#
# Copyright 2008 Chandler Carruth
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
if(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
set(GTEST_FOUND true)
else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
set(GTEST_PREFIX "" CACHE PATH "Installation prefix for Google Test")
if(GTEST_PREFIX)
find_path(_GTEST_INCLUDE_DIR "gtest/gtest.h"
PATHS "${GTEST_PREFIX}/include"
NO_DEFAULT_PATH)
find_library(_GTEST_LIBRARY gtest
PATHS "${GTEST_PREFIX}/lib"
NO_DEFAULT_PATH)
find_library(_GTEST_MAIN_LIBRARY gtest_main
PATHS "${GTEST_PREFIX}/lib"
NO_DEFAULT_PATH)
if ( _GTEST_LIBRARY )
get_filename_component(_GTEST_LIBRARY_DIR ${_GTEST_LIBRARY} PATH CACHE )
endif()
else(GTEST_PREFIX)
find_path(_GTEST_INCLUDE_DIR "gtest/gtest.h"
PATHS
~/sw/gtest-1.8.0/include
~/sw/gtest-1.7.0/include
~/sw/gtest/include
/ACG/acgdev/gcc-x86_64/gtest/include
/opt/local/include
/usr/local/include
/usr/include
"C:/libs/win32/gtest/include"
NO_DEFAULT_PATH )
find_library(_GTEST_LIBRARY gtest
PATHS
~/sw/gtest-1.8.0/lib
~/sw/gtest-1.7.0/lib
~/sw/gtest/lib
/ACG/acgdev/gcc-x86_64/gtest/lib
/opt/local/lib
/usr/local/lib
/usr/include
"C:/libs/win32/gtest/lib"
NO_DEFAULT_PATH )
find_library(_GTEST_MAIN_LIBRARY gtest_main
PATHS
~/sw/gtest-1.8.0/lib
~/sw/gtest-1.7.0/lib
~/sw/gtest/lib
/ACG/acgdev/gcc-x86_64/gtest/lib
/opt/local/lib
/usr/local/lib
/usr/include
"C:/libs/win32/gtest/lib"
NO_DEFAULT_PATH )
if ( _GTEST_LIBRARY )
get_filename_component(_GTEST_LIBRARY_DIR ${_GTEST_LIBRARY} PATH CACHE )
endif()
endif(GTEST_PREFIX)
if(_GTEST_INCLUDE_DIR AND _GTEST_LIBRARY AND _GTEST_MAIN_LIBRARY)
set(GTEST_FOUND true)
set(GTEST_INCLUDE_DIRS ${_GTEST_INCLUDE_DIR} CACHE PATH
"Include directories for Google Test framework")
if ( NOT WIN32 )
set(GTEST_LIBRARIES ${_GTEST_LIBRARY} CACHE FILEPATH
"Libraries to link for Google Test framework")
set(GTEST_MAIN_LIBRARIES ${_GTEST_MAIN_LIBRARY} CACHE FILEPATH
"Libraries to link for Google Test automatic main() definition")
set(GTEST_MAIN_LIBRARY ${_GTEST_MAIN_LIBRARY} CACHE FILEPATH
"Libraries to link for Google Test automatic main() definition")
else()
set(GTEST_LIBRARIES "optimized;gtest;debug;gtestd" CACHE FILEPATH
"Libraries to link for Google Test framework")
set(GTEST_MAIN_LIBRARIES "optimized;gtest_main;debug;gtest_maind" CACHE FILEPATH
"Libraries to link for Google Test automatic main() definition")
set(GTEST_MAIN_LIBRARY "optimized;gtest_main;debug;gtest_maind" CACHE FILEPATH
"Libraries to link for Google Test automatic main() definition")
endif()
# Macro required to use google test with vs2012
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
add_definitions(-D_VARIADIC_MAX=10)
endif()
set(GTEST_LIBRARY ${_GTEST_LIBRARY} CACHE FILEPATH
"GTest Libraries")
set(GTEST_LIBRARY_DIR ${_GTEST_LIBRARY_DIR} CACHE FILEPATH
"Library dir containing Google Test libraries")
mark_as_advanced(GTEST_INCLUDE_DIRS GTEST_LIBRARIES GTEST_MAIN_LIBRARIES GTEST_LIBRARY_DIR )
if(NOT GoogleTest_FIND_QUIETLY)
message(STATUS "Found Google Test: ${GTEST_LIBRARIES}")
endif(NOT GoogleTest_FIND_QUIETLY)
else(_GTEST_INCLUDE_DIR AND _GTEST_LIBRARY AND _GTEST_MAIN_LIBRARY)
if(GoogleTest_FIND_REQUIRED)
message(FATAL_ERROR "Could not find the Google Test framework")
endif(GoogleTest_FIND_REQUIRED)
endif(_GTEST_INCLUDE_DIR AND _GTEST_LIBRARY AND _GTEST_MAIN_LIBRARY)
endif(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
# Set project variable such that OpenVolumeMesh does not
# build its unit tests and stuff
project(Examples)
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_policy(VERSION 3.12.0)
project(OpenVolumeMeshExamples)
# Add OpenVolumeMesh's source path to include path for compiler
include_directories(../src)
find_package(OpenVolumeMesh REQUIRED)
# Add target for first example
add_executable(simple_mesh EXCLUDE_FROM_ALL simple_mesh/simple_mesh.cc)
if(NOT WIN32)
# Link against OpenVolumeMesh
target_link_libraries(simple_mesh OpenVolumeMesh)
# Set output directory to ${BINARY_DIR}/Examples
set_target_properties(simple_mesh PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples)
else()
# Link against OpenVolumeMesh
target_link_libraries(simple_mesh OpenVolumeMesh)
endif()
add_executable(simple_mesh simple_mesh/simple_mesh.cc)
target_link_libraries(simple_mesh OpenVolumeMesh::OpenVolumeMesh)
set_target_properties(simple_mesh PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples)
#[[=
if(WIN32)
# copy exe file to "Build" directory
# Visual studio will create this file in a subdirectory so we can't use
......@@ -31,4 +21,6 @@ if(WIN32)
copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/simple_mesh.exe
${CMAKE_BINARY_DIR}/Examples/simple_mesh.exe)
else()
endif()
=]]
include (ACGCommon)
set(OVM_ENABLE_DEPRECATED_APIS ON CACHE BOOL "Support deprecated OpenVolumeMesh APIs")
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/Config/DeprecationConfig.hh.in"
"${CMAKE_CURRENT_BINARY_DIR}/Config/DeprecationConfig.hh"
)
include_directories (
..
${CMAKE_CURRENT_SOURCE_DIR}
)
# source code directories
set (directories
.
OpenVolumeMesh/Attribs
OpenVolumeMesh/Core
OpenVolumeMesh/Config
OpenVolumeMesh/FileManager
OpenVolumeMesh/Geometry
OpenVolumeMesh/Mesh
)
# collect all header and source files
acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories})
# Disable Library installation when not building OpenVolumeMesh on its own but as part of another project!
if ( NOT ${PROJECT_NAME} MATCHES "OpenVolumeMesh")
set(ACG_NO_LIBRARY_INSTALL true)
endif()
if (WIN32)
# OpenVolumeMesh has no dll exports so we have to build a static library on windows
acg_add_library (OpenVolumeMesh STATIC ${sources} ${headers})
else ()
acg_add_library (OpenVolumeMesh SHAREDANDSTATIC ${sources} ${headers})
set_target_properties (OpenVolumeMesh PROPERTIES VERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR}
SOVERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR} )
endif ()
foreach(TARGET_NAME OpenVolumeMesh OpenVolumeMeshStatic)
if (TARGET ${TARGET_NAME})
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/Config/")
endif()
endforeach(TARGET_NAME)
# Only install if the project name matches OpenVolumeMesh.
if (NOT APPLE AND ${PROJECT_NAME} MATCHES "OpenVolumeMesh")
# Install Header Files)
install(DIRECTORY .
DESTINATION include
FILES_MATCHING
PATTERN "*.hh"
PATTERN "Unittests" EXCLUDE
PATTERN "FileConverter" EXCLUDE
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "tmp" EXCLUDE
PATTERN "Templates" EXCLUDE
PATTERN "Debian*" EXCLUDE)
endif ()
# install config files
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/DeprecationConfig.hh
DESTINATION include/OpenVolumeMesh/Config )
# Only build unittests and file converter
# if not built as external library
if(${PROJECT_NAME} MATCHES "OpenVolumeMesh")
# Add unittests target
add_subdirectory(Unittests)
add_subdirectory(FileConverter)
endif()
SET(HEADER_FILES
OpenVolumeMesh/System/FunctionalInclude.hh
OpenVolumeMesh/System/MemoryInclude.hh
OpenVolumeMesh/System/Deprecation.hh
OpenVolumeMesh/Attribs/TexCoordAttrib.hh
OpenVolumeMesh/Attribs/OpenVolumeMeshStatus.hh
OpenVolumeMesh/Attribs/ColorAttribT_impl.hh
OpenVolumeMesh/Attribs/ColorAttrib.hh
OpenVolumeMesh/Attribs/NormalAttrib.hh
OpenVolumeMesh/Attribs/NormalAttribT_impl.hh
OpenVolumeMesh/Attribs/TexCoordAttribT_impl.hh
OpenVolumeMesh/Attribs/StatusAttribT_impl.hh
OpenVolumeMesh/Attribs/StatusAttrib.hh
OpenVolumeMesh/Geometry/Vector11T.hh
OpenVolumeMesh/Geometry/VectorT_inc.hh
OpenVolumeMesh/Geometry/VectorT.hh
OpenVolumeMesh/FileManager/FileManagerT_impl.hh
OpenVolumeMesh/FileManager/FileManager.hh
OpenVolumeMesh/Core/BaseEntities.hh
OpenVolumeMesh/Core/OpenVolumeMeshHandle.hh
OpenVolumeMesh/Core/BaseProperty.hh
OpenVolumeMesh/Core/ResourceManager.hh
OpenVolumeMesh/Core/PropertyHandles.hh
OpenVolumeMesh/Core/TypeName.hh
OpenVolumeMesh/Core/PropertyPtrT_impl.hh
OpenVolumeMesh/Core/PropertyDefinesT_impl.hh
OpenVolumeMesh/Core/GeometryKernel.hh
OpenVolumeMesh/Core/TopologyKernel.hh
OpenVolumeMesh/Core/ResourceManagerT_impl.hh
OpenVolumeMesh/Core/PropertyDefines.hh
OpenVolumeMesh/Core/Serializers.hh
OpenVolumeMesh/Core/OpenVolumeMeshBaseProperty.hh
OpenVolumeMesh/Core/ForwardDeclarations.hh
OpenVolumeMesh/Core/PropertyPtr.hh
OpenVolumeMesh/Core/Entities.hh
OpenVolumeMesh/Core/SerializersT_impl.hh
OpenVolumeMesh/Core/OpenVolumeMeshProperty.hh
OpenVolumeMesh/Core/Iterators.hh
OpenVolumeMesh/Mesh/TetrahedralMeshTopologyKernel.hh
OpenVolumeMesh/Mesh/HexahedralMesh.hh
OpenVolumeMesh/Mesh/HexahedralMeshIterators.hh
OpenVolumeMesh/Mesh/TetrahedralMesh.hh
OpenVolumeMesh/Mesh/HexahedralMeshTopologyKernel.hh
OpenVolumeMesh/Mesh/TetrahedralMeshIterators.hh
OpenVolumeMesh/Mesh/PolyhedralMesh.hh
OpenVolumeMesh/Mesh/TetrahedralGeometryKernel.hh
Unittests/unittests_common.hh)
SET(SOURCE_FILES
OpenVolumeMesh/Attribs/OpenVolumeMeshStatus.cc
OpenVolumeMesh/Attribs/StatusAttrib.cc
OpenVolumeMesh/Geometry/Vector.cc
OpenVolumeMesh/FileManager/FileManager.cc
OpenVolumeMesh/Core/PropertyDefines.cc
OpenVolumeMesh/Core/OpenVolumeMeshHandle.cc
OpenVolumeMesh/Core/ResourceManager.cc
OpenVolumeMesh/Core/BaseEntities.cc
OpenVolumeMesh/Core/BaseProperty.cc
OpenVolumeMesh/Core/TopologyKernel.cc
OpenVolumeMesh/Core/Serializers.cc
OpenVolumeMesh/Core/Iterators.cc
OpenVolumeMesh/Core/OpenVolumeMeshBaseProperty.cc
OpenVolumeMesh/Mesh/TetrahedralMeshIterators.cc
OpenVolumeMesh/Mesh/HexahedralMeshIterators.cc
OpenVolumeMesh/Mesh/TetrahedralMeshTopologyKernel.cc
OpenVolumeMesh/Mesh/HexahedralMeshTopologyKernel.cc
)
set(OVM_ENABLE_DEPRECATED_APIS ON CACHE BOOL "Support deprecated OpenVolumeMesh APIs")
set(CMAKE_MACOSX_RPATH 1) # TODO
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/OpenVolumeMesh/Config/DeprecationConfig.hh.in"
"${CMAKE_CURRENT_BINARY_DIR}/OpenVolumeMesh/Config/DeprecationConfig.hh"
)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/OpenVolumeMesh/Config/Version.hh.in"
"${CMAKE_CURRENT_BINARY_DIR}/OpenVolumeMesh/Config/Version.hh"
)
add_library(OpenVolumeMesh
SHARED ${SOURCE_FILES}
)
add_library(OpenVolumeMesh::OpenVolumeMesh ALIAS OpenVolumeMesh)
include(GenerateExportHeader)
generate_export_header(OpenVolumeMesh
BASE_NAME OVM
EXPORT_FILE_NAME "OpenVolumeMesh/Config/Export.hh"
DEPRECATED_MACRO_NAME "CMAKE_OVM_DEPRECATED"
NO_DEPRECATED_MACRO_NAME "CMAKE_OVM_NO_DEPRECATED"
)
set_target_properties (OpenVolumeMesh PROPERTIES
VERSION ${OpenVolumeMesh_VERSION_MAJOR}.${OpenVolumeMesh_VERSION_MINOR}
SOVERSION ${OpenVolumeMesh_VERSION_MAJOR}.${OpenVolumeMesh_VERSION_MINOR})
target_compile_options(OpenVolumeMesh PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/bigobj>")
target_compile_definitions(OpenVolumeMesh
PUBLIC
"$<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>"
"$<$<CXX_COMPILER_ID:MSVC>:_USE_MATH_DEFINES>"
"INCLUDE_TEMPLATES"
"$<$<CXX_COMPILER_ID:MSVC>:OVMDLL>"
PRIVATE
"$<$<CXX_COMPILER_ID:MSVC>:BUILDOVM>"
)
set_target_properties(OpenVolumeMesh PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
target_compile_features(OpenVolumeMesh PUBLIC
cxx_attribute_deprecated
)
target_compile_options(OpenVolumeMesh PRIVATE
"$<$<CXX_COMPILER_ID:GNU>:-Wall>"
"$<$<CXX_COMPILER_ID:Clang>:-Wall;-Wno-c++98-compat;-Wno-c++98-compat-pedantic;-Wno-weak-vtables;-Wno-padded;-Wno-sign-conversion;-Wno-missing-prototypes>"
)
target_include_directories(OpenVolumeMesh
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/OpenVolumeMesh/Config"
)
set_property(TARGET OpenVolumeMesh APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/OpenVolumeMesh/Config>
)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/OpenVolumeMesh)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/OpenVolumeMeshConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/OpenVolumeMeshConfig.cmake"
INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
)
write_basic_package_version_file(
OpenVolumeMeshConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/OpenVolumeMeshConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/OpenVolumeMeshConfig.cmake"
DESTINATION ${INSTALL_CONFIGDIR})
install(DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/OpenVolumeMesh/Config"
DESTINATION include/OpenVolumeMesh)
# Install Header Files
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OpenVolumeMesh
DESTINATION include
FILES_MATCHING PATTERN "*.hh"
)
# install config files
#install( FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/DeprecationConfig.hh
# DESTINATION include/OpenVolumeMesh/Config )
# TODO: tests, fileconverter
install(TARGETS OpenVolumeMesh
EXPORT OpenVolumeMeshTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(EXPORT OpenVolumeMeshTargets
FILE OpenVolumeMeshTargets.cmake
NAMESPACE OpenVolumeMesh::
DESTINATION ${INSTALL_CONFIGDIR}
)
export(EXPORT OpenVolumeMeshTargets
NAMESPACE OpenVolumeMesh::)
export(PACKAGE OpenVolumeMesh)
#add_subdirectory(FileConverter)
enable_testing()
if (OVM_ENABLE_UNITTESTS)
add_subdirectory(Unittests)
else()
add_subdirectory(Unittests EXCLUDE_FROM_ALL)
endif()
......@@ -44,6 +44,7 @@
#include <iostream>
#endif
#include "../Core/TopologyKernel.hh"
#include "StatusAttrib.hh"
namespace OpenVolumeMesh {
......
......@@ -45,6 +45,7 @@
#include <cassert>
#include "../Core/OpenVolumeMeshProperty.hh"
#include "../Core/OpenVolumeMeshHandle.hh"
#include "OpenVolumeMeshStatus.hh"
#include "../Core/PropertyDefines.hh"
......
#pragma once
#define OPENVOLUMEMESH_VERSION "@OpenVolumeMesh_VERSION@"
#define OPENVOLUMEMESH_VERSION_MAJOR @OpenVolumeMesh_VERSION_MAJOR@
#define OPENVOLUMEMESH_VERSION_MINOR @OpenVolumeMesh_VERSION_MINOR@
#define OPENVOLUMEMESH_VERSION_PATCH @OpenVolumeMesh_VERSION_PATCH@
......@@ -64,11 +64,11 @@ public:
template <class PropT, class Entity> friend class PropertyPtr;
typedef T Value;
typedef std::vector<T> vector_type;
typedef T value_type;
typedef typename vector_type::reference reference;
typedef typename vector_type::const_reference const_reference;
typedef T Value;
typedef typename std::vector<T> vector_type;
typedef T value_type;
typedef typename vector_type::reference reference;
typedef typename vector_type::const_reference const_reference;
public:
......
......@@ -38,6 +38,7 @@
#include <stdexcept>
#include <string>
#include <typeinfo>
#include <map>
#include "Entities.hh"
#include "PropertyHandles.hh"
......
......@@ -33,6 +33,7 @@
\*===========================================================================*/
#include "ResourceManager.hh"
#include "BaseProperty.hh"
namespace OpenVolumeMesh {
......
......@@ -41,6 +41,7 @@
#include <vector>
#include <type_traits>
#include "../Config/Export.hh"
#include "OpenVolumeMeshProperty.hh"
#include "PropertyHandles.hh"
#include "TypeName.hh"
......@@ -51,7 +52,7 @@ namespace OpenVolumeMesh {
// Forward declarations
class BaseProperty;
class ResourceManager {
class OVM_EXPORT ResourceManager {
public:
ResourceManager() = default;
ResourceManager(const ResourceManager &other);
......
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openvolumemesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#ifndef DEFINES_HH_
#define DEFINES_HH_
#ifndef OVMDLLEXPORT
#ifdef WIN32
#ifdef OVMDLL
#ifdef BUILDOVM
#define OVMDLLEXPORT __declspec(dllexport)
#define OVMDLLEXPORTONLY __declspec(dllexport)
#else
#define OVMDLLEXPORT __declspec(dllimport)
#define OVMDLLEXPORTONLY
#endif
#else
#define OVMDLLEXPORT
#define OVMDLLEXPORTONLY
#endif
#else
#define OVMDLLEXPORT
#define OVMDLLEXPORTONLY
#endif
#endif
#endif /* DEFINES_HH_ */
#pragma once
#include "DeprecationConfig.hh"
#include "../Config/DeprecationConfig.hh"
#if defined(__cplusplus) && (__cplusplus >= 201402L)
# define OVM_DEPRECATED(msg) [[deprecated(msg)]]
......
get_filename_component(OPENVOLUMEMESH_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(NOT TARGET OpenVolumeMesh::OpenVolumeMesh)
include("${OPENVOLUMEMESH_CMAKE_DIR}/OpenVolumeMeshTargets.cmake")
endif()
include (ACGCommon)
SET(SOURCE_FILES
unittests_smartptr.cc
unittests_basics.cc
unittests_files.cc
unittests_common.cc
unittests.cc
unittests_iterators.cc
unittests_properties.cc)
include_directories (
..
${CMAKE_CURRENT_SOURCE_DIR}
)
find_package(OpenVolumeMesh REQUIRED)
# Search for gtest headers and libraries
find_package(GoogleTest)
enable_testing()
find_package(GTest)
if(GTEST_FOUND)
# Set correct include paths so that the compiler can find the headers
include_directories(${GTEST_INCLUDE_DIRS})
# set additional link directories
link_directories(${GTEST_LIBRARY_DIR} )
# Create executable for all unittests
FILE(GLOB UNITTEST_SRC *.cc)
add_executable(unittests ${UNITTEST_SRC})
if ( NOT WIN32)
# Link against all necessary libraries
target_link_libraries(unittests OpenVolumeMesh ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
# Set output directory to ${BINARY_DIR}/Unittests
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Unittests)
else()
# Link against all necessary libraries
target_link_libraries(unittests OpenVolumeMesh ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
endif()
if ( NOT WIN32 )
set (TMP_FLAGS "-Wall -Wextra -Wuninitialized -Wunused -g -pedantic -ansi -Wno-long-long -Wno-variadic-macros ${CMAKE_CXX_FLAGS}")
# Set compiler flags
set_target_properties(unittests PROPERTIES COMPILE_FLAGS "${TMP_FLAGS}")
else()
# Set compiler flags
set_target_properties(unittests PROPERTIES COMPILE_FLAGS "" )
# copy exe file to "Build" directory
# Visual studio will create this file in a subdirectory so we can't use
# RUNTIME_OUTPUT_DIRECTORY directly here
add_custom_command (TARGET unittests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
include(GoogleTest)
add_executable(unittests ${SOURCE_FILES})
target_link_libraries(unittests
OpenVolumeMesh::OpenVolumeMesh
GTest::GTest
GTest::Main
)
gtest_add_tests(TARGET unittests
EXTRA_ARGS "--gtest_color=yes;--gtest_output=xml"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Unittests"
)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/TestFiles/"
DESTINATION "${CMAKE_BINARY_DIR}/Unittests"
)
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Unittests)
#[[=
if ( WIN32 )
add_custom_command (TARGET unittests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/unittests.exe
${CMAKE_BINARY_DIR}/Unittests/unittests.exe)
endif()
acg_copy_after_build(unittests ${CMAKE_CURRENT_SOURCE_DIR}/TestFiles ${CMAKE_BINARY_DIR}/Unittests/)
else(GTEST_FOUND)
message(STATUS "Google testing framework was not found!")
endif(GTEST_FOUND)
endif()
=]]
endif()
......@@ -5,6 +5,7 @@
#include <OpenVolumeMesh/Mesh/PolyhedralMesh.hh>
#include <OpenVolumeMesh/Mesh/HexahedralMesh.hh>
#include <OpenVolumeMesh/Mesh/TetrahedralMesh.hh>
#include <OpenVolumeMesh/Core/PropertyDefines.hh>
#include <OpenVolumeMesh/Geometry/VectorT.hh>
#ifdef __clang__
......