...
 
Commits (52)
......@@ -45,9 +45,13 @@ ECHO "LIBPATH : %LIBPATH%"
ECHO "==============================================================="
ECHO "==============================================================="
set GTEST_PREFIX=%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%
set GTEST_INCLUDE_DIR=%GTEST_PREFIX%\include
set GTEST_LIBRARY=%GTEST_PREFIX%\lib\gtest.lib
set GTEST_MAIN_LIBRARY=%GTEST_PREFIX%\lib\gtest_main.lib
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_LIBRARY="%GTEST_LIBRARY%" -DGTEST_INCLUDE_DIR="%GTEST_INCLUDE_DIR%" -DGTEST_MAIN_LIBRARY="%GTEST_MAIN_LIBRARY%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Release" OpenVolumeMesh.sln /Project "ALL_BUILD"
......@@ -57,7 +61,7 @@ cd ..
cd src\Unittests\TestFiles
..\..\..\build-release\src\Unittests\Release\unittests.exe
..\..\..\build-release\Unittests\Release\unittests.exe
cd ..\..\..\
......@@ -68,7 +72,10 @@ mkdir build-debug
cd build-debug
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Debug %CMAKE_CONFIGURATION% ..
set GTEST_LIBRARY=%GTEST_PREFIX%\lib\gtestd.lib
set GTEST_MAIN_LIBRARY=%GTEST_PREFIX%\lib\gtest_maind.lib
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_LIBRARY="%GTEST_LIBRARY%" -DGTEST_INCLUDE_DIR="%GTEST_INCLUDE_DIR%" -DGTEST_MAIN_LIBRARY="%GTEST_MAIN_LIBRARY%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Debug %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Debug" OpenVolumeMesh.sln /Project "ALL_BUILD"
......@@ -78,7 +85,7 @@ cd ..
cd src\Unittests\TestFiles
..\..\..\build-debug\src\Unittests\Debug\unittests.exe
..\..\..\build-debug\Unittests\Debug\unittests.exe
IF %errorlevel% NEQ 0 exit /b %errorlevel%
......@@ -10,6 +10,12 @@ NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'
BUILDPATH="build-cppcheck"
mkdir -p "${BUILDPATH}"
cd "${BUILDPATH}"
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
cd ..
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "Running cppcheck"
......@@ -20,7 +26,15 @@ echo -e "${NC}"
echo "Please Wait ..."
# Run cppcheck and output into file
cppcheck --enable=all . -I src -i Doc/ --force --suppress=missingIncludeSystem --inline-suppr --quiet -Umin -Umax -UBMPOSTFIX -DOPENVOLUMEMESHDLLEXPORT="" 2>&1 | tee cppcheck.log
# we do not enable 'style' and 'unusedFunction' (the latter gives false positive
# for the public library interface)
cppcheck \
--project=${BUILDPATH}/compile_commands.json \
--force \
--enable=warning,performance,portability,information,missingInclude \
--inline-suppr \
--quiet \
2>&1 | tee cppcheck.log
COUNT=$(wc -l < cppcheck.log )
......@@ -30,7 +44,7 @@ echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
if [ $COUNT -gt 5 ]; then
if [ $COUNT -gt 3 ]; then
echo -e ${WARNING}
echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed";
echo -e "${NC}"
......
......@@ -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(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# 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)
acg_get_version ()
#message("OVM_STANDALONE_BUILD: ${OVM_STANDALONE_BUILD}")
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")
set(OVM_BUILD_DOCUMENTATION ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh documentation in 'all' target")
include (ACGOutput)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if (WIN32)
set (ACG_PROJECT_LIBDIR "lib")
set (ACG_PROJECT_BINDIR ".")
else ()
set (ACG_PROJECT_LIBDIR "lib")
set (ACG_PROJECT_BINDIR "bin")
endif ()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}")
endif()
# ========================================================================
# Call the subdirectories with the projects
# ========================================================================
set (CMAKE_DEBUG_POSTFIX "d")
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)
endif()
if (OVM_BUILD_DOCUMENTATION)
add_subdirectory (documentation)
endif()
# ========================================================================
# Bundle generation (Targets exist, now configure them)
# ========================================================================
#export(PACKAGE OpenVolumeMesh)
# display results
acg_print_configure_header (OPENVOLUMEMESH "OpenVolumeMesh")
list(REMOVE_AT CMAKE_MODULE_PATH -1)
This diff is collapsed.
################################################################################
# Custom settings for compiler flags and similar
################################################################################
if (UNIX)
set ( ADDITIONAL_CXX_FLAGS )
set ( ADDITIONAL_CXX_DEBUG_FLAGS )
set ( ADDITIONAL_CXX_RELEASE_FLAGS )
set ( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS )
set ( ADDITIONAL_C_FLAGS )
set ( ADDITIONAL_C_DEBUG_FLAGS )
set ( ADDITIONAL_C_RELEASE_FLAGS )
set ( ADDITIONAL_C_RELWITHDEBINFO_FLAGS )
################################################################################
# Defaults
################################################################################
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_CXX_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_FLAGS "-DINCLUDE_TEMPLATES" )
# Increase the template depth as this might be exceeded from time to time
IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
list(APPEND ADDITIONAL_CXX_FLAGS "-ftemplate-depth-100" )
ENDIF()
################################################################################
# Build/Release Defines
################################################################################
IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-DDEBUG" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-DNDEBUG" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-DDEBUG" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-DDEBUG" )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-DNDEBUG" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-DDEBUG" )
ENDIF()
################################################################################
# Warnings
################################################################################
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
list(APPEND ADDITIONAL_CXX_FLAGS "-Weverything")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-c++98-compat")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-c++98-compat-pedantic")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-padded")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-old-style-cast")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-documentation-unknown-command")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-unreachable-code-return")
# enable later:
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-sign-conversion")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-deprecated")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-weak-vtables")
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wall")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wextra")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wpedantic")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wshadow")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wpointer-arith")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wcast-qual")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wconversion")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wtype-limits")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wsign-compare")
endif()
################################################################################
# STL Vector checks
################################################################################
# Pre initialize stl vector check variable
if ( NOT STL_VECTOR_CHECKS )
set ( STL_VECTOR_CHECKS false CACHE BOOL "Include full stl vector checks in debug mode (This option is only used in debug Mode!)" )
endif ( NOT STL_VECTOR_CHECKS )
# Add a flag to check stl vectors in debugging mode
if ( STL_VECTOR_CHECKS AND NOT CMAKE_SYSTEM MATCHES "SunOS*" )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
endif()
################################################################################
# Process the additional flags:
################################################################################
# Add the debug flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_DEBUG_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELEASE_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
# Add the debug flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_DEBUG_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELEASE_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
#TODO : Test and remove it?!
IF( CMAKE_SYSTEM MATCHES "SunOS*")
set (CMAKE_CFLAGS_RELEASE "-xO3")
set (CMAKE_CXX_FLAGS_RELEASE "-xO3")
endif ( CMAKE_SYSTEM MATCHES "SunOS*" )
################################################################################
# C++ 11 support
################################################################################
# On apple, if we have c++ 11 support, we enable it automatically here
# if (APPLE)
#
# include(CheckCXXCompilerFlag)
# CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
# CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
#
# if(COMPILER_SUPPORTS_CXX11)
# set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11")
# set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11")
# set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11")
# elseif(COMPILER_SUPPORTS_CXX0X)
# set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++0x")
# set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} -std=c++0x")
# set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG} -std=c++0x")
# else()
# message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Falling back to non C++11 mode. If you encounter errors, please use a different C++ compiler.")
# endif()
#
# endif()
endif ()
# fill string with spaces
macro (acg_format_string str length return)
string (LENGTH "${str}" _str_len)
math (EXPR _add_chr "${length} - ${_str_len}")
set (${return} "${str}")
while (_add_chr GREATER 0)
set (${return} "${${return}} ")
math (EXPR _add_chr "${_add_chr} - 1")
endwhile ()
endmacro ()
# print message with color escape sequences if CMAKE_COLOR_MAKEFILE is set
string (ASCII 27 _escape)
function (acg_color_message _str)
if (CMAKE_COLOR_MAKEFILE AND NOT WIN32)
message (${_str})
else ()
string (REGEX REPLACE "${_escape}.[0123456789;]*m" "" __str ${_str})
message (${__str})
endif ()
endfunction ()
# info header
function (acg_print_configure_header _id _name)
acg_format_string ("${_name}" 40 _project)
acg_format_string ("${${_id}_VERSION}" 40 _version)
acg_color_message ("\n${_escape}[40;37m************************************************************${_escape}[0m")
acg_color_message ("${_escape}[40;37m* ${_escape}[1;31mACG ${_escape}[0;40;34mBuildsystem${_escape}[0m${_escape}[40;37m *${_escape}[0m")
acg_color_message ("${_escape}[40;37m* *${_escape}[0m")
acg_color_message ("${_escape}[40;37m* Package : ${_escape}[32m${_project} ${_escape}[37m *${_escape}[0m")
acg_color_message ("${_escape}[40;37m* Version : ${_escape}[32m${_version} ${_escape}[37m *${_escape}[0m")
if ( NOT WIN32 )
# Just artistic. remove 2 spaces for release to make it look nicer ;-)
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
acg_color_message ("${_escape}[40;37m* Type : ${_escape}[32m${CMAKE_BUILD_TYPE} ${_escape}[37m *${_escape}[0m")
else()
acg_color_message ("${_escape}[40;37m* Type : ${_escape}[32m${CMAKE_BUILD_TYPE} ${_escape}[37m *${_escape}[0m")
endif()
endif()
acg_color_message ("${_escape}[40;37m************************************************************${_escape}[0m")
endfunction ()
# info line
function (acg_print_configure_footer)
acg_color_message ("${_escape}[40;37m************************************************************${_escape}[0m\n")
endfunction ()
# 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)
include (ACGDoxygen)
IF (DOXYGEN_FOUND)
if (TARGET doc)
acg_copy_after_build (doc "${CMAKE_CURRENT_SOURCE_DIR}/html" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/html")
endif ()
# Add a documentation install target
add_custom_target(doc-install COMMENT "Installing Documentation" VERBATIM )
# Build Documentation before installing it
add_dependencies(doc-install doc)
if (TARGET doc-install)
acg_copy_after_build (doc-install "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/html" "${CMAKE_INSTALL_PREFIX}/${ACG_PROJECT_DATADIR}/doc/html")
endif()
ENDIF(DOXYGEN_FOUND)
\ No newline at end of file
if (NOT TARGET doc)
include (ACGDoxygen)
#find_package(Doxygen REQUIRED dot)
IF (DOXYGEN_FOUND)
if (TARGET doc)
# TODO
#acg_copy_after_build (doc "${CMAKE_CURRENT_SOURCE_DIR}/html" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/html")
endif ()
# Add a documentation install target
add_custom_target(doc-install COMMENT "Installing Documentation" VERBATIM )
# Build Documentation before installing it
add_dependencies(doc-install doc)
if (TARGET doc-install)
# TODO
# acg_copy_after_build (doc-install "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/html" "${CMAKE_INSTALL_PREFIX}/${ACG_PROJECT_DATADIR}/doc/html")
endif()
ENDIF(DOXYGEN_FOUND)
ENDIF()
# 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
CXX_STANDARD 14
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO)
#[[=
if(WIN32)
# copy exe file to "Build" directory
# Visual studio will create this file in a subdirectory so we can't use
......@@ -31,4 +24,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()
=]]
This diff is collapsed.
......@@ -44,6 +44,7 @@
#define STATUS_HH_
#include <iosfwd>
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -52,7 +53,7 @@ namespace OpenVolumeMesh {
* \brief Stores statuses like selected, tagged, deleted, etc.
*/
class OpenVolumeMeshStatus {
class OVM_EXPORT OpenVolumeMeshStatus {
public:
// Default constructor
......
......@@ -44,6 +44,7 @@
#include <iostream>
#endif
#include "../Core/TopologyKernel.hh"
#include "StatusAttrib.hh"
namespace OpenVolumeMesh {
......
......@@ -45,16 +45,18 @@
#include <cassert>
#include "../Core/OpenVolumeMeshProperty.hh"
#include "../Core/OpenVolumeMeshHandle.hh"
#include "OpenVolumeMeshStatus.hh"
#include "../Core/PropertyDefines.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
// Forward declaration
class TopologyKernel;
class StatusAttrib {
class OVM_EXPORT StatusAttrib {
public:
explicit StatusAttrib(TopologyKernel& _kernel);
~StatusAttrib();
......
#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@
......@@ -45,11 +45,12 @@
#include <vector>
#include "../Config/Export.hh"
#include "OpenVolumeMeshHandle.hh"
namespace OpenVolumeMesh {
class OpenVolumeMeshEdge {
class OVM_EXPORT OpenVolumeMeshEdge {
friend class TopologyKernel;
public:
OpenVolumeMeshEdge(const VertexHandle& _fromVertex,
......@@ -84,7 +85,7 @@ std::ostream& operator<<(std::ostream& _os, const OpenVolumeMeshEdge& _edge);
//***************************************************************************
class OpenVolumeMeshFace {
class OVM_EXPORT OpenVolumeMeshFace {
friend class TopologyKernel;
public:
explicit OpenVolumeMeshFace(const std::vector<HalfEdgeHandle>& _halfedges) :
......@@ -115,7 +116,7 @@ std::ostream& operator<<(std::ostream& _os, const OpenVolumeMeshFace& _face);
//***************************************************************************
class OpenVolumeMeshCell {
class OVM_EXPORT OpenVolumeMeshCell {
friend class TopologyKernel;
public:
explicit OpenVolumeMeshCell(const std::vector<HalfFaceHandle>& _halffaces) :
......
......@@ -38,12 +38,13 @@
#include <string>
#include "OpenVolumeMeshHandle.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
class ResourceManager;
class BaseProperty {
class OVM_EXPORT BaseProperty {
public:
friend class ResourceManager;
......
#pragma once
#include "../Config/Export.hh"
#include <type_traits>
namespace OpenVolumeMesh {
namespace Entity {
struct Vertex {};
struct Edge {};
struct HalfEdge {};
struct Face {};
struct HalfFace {};
struct Cell {};
struct Mesh {};
struct OVM_EXPORT Vertex {};
struct OVM_EXPORT Edge {};
struct OVM_EXPORT HalfEdge {};
struct OVM_EXPORT Face {};
struct OVM_EXPORT HalfFace {};
struct OVM_EXPORT Cell {};
struct OVM_EXPORT Mesh {};
}
template<typename T>
struct is_entity : std::false_type {};
template<> struct is_entity<Entity::Vertex> : std::true_type {};
template<> struct is_entity<Entity::Edge> : std::true_type {};
template<> struct is_entity<Entity::HalfEdge> : std::true_type {};
template<> struct is_entity<Entity::Face> : std::true_type {};
template<> struct is_entity<Entity::HalfFace> : std::true_type {};
template<> struct is_entity<Entity::Cell> : std::true_type {};
template<> struct is_entity<Entity::Mesh> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Vertex> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Edge> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::HalfEdge> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Face> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::HalfFace> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Cell> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Mesh> : std::true_type {};
} // namespace OpenVolumeMesh
This diff is collapsed.
......@@ -40,6 +40,7 @@
#include <vector>
#include "OpenVolumeMeshHandle.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -49,7 +50,7 @@ namespace OpenVolumeMesh {
**/
class OpenVolumeMeshBaseProperty {
class OVM_EXPORT OpenVolumeMeshBaseProperty {
public:
friend class ResourceManager;
......
......@@ -43,11 +43,12 @@
#include "Entities.hh"
#include "../System/FunctionalInclude.hh"
#include "../System/Deprecation.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
// Define handle types in order to distinguish different entities by their indices
class OpenVolumeMeshHandle {
class OVM_EXPORT OpenVolumeMeshHandle {
public:
// Default constructor
explicit constexpr OpenVolumeMeshHandle(int _idx) : idx_(_idx) {}
......@@ -124,6 +125,14 @@ public:
};
// Default entity handles
//
template class OVM_EXPORT HandleT<Entity::Vertex>;
template class OVM_EXPORT HandleT<Entity::HalfEdge>;
template class OVM_EXPORT HandleT<Entity::Edge>;
template class OVM_EXPORT HandleT<Entity::HalfFace>;
template class OVM_EXPORT HandleT<Entity::Face>;
template class OVM_EXPORT HandleT<Entity::Cell>;
template class OVM_EXPORT HandleT<Entity::Mesh>;
using VertexHandle = HandleT<Entity::Vertex>;
using HalfEdgeHandle = HandleT<Entity::HalfEdge>;
......@@ -191,16 +200,22 @@ private:
CellHandle thld_;
};
OVM_EXPORT
bool operator==(const int& _lhs, const OpenVolumeMeshHandle& _rhs);
OVM_EXPORT
bool operator==(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs);
OVM_EXPORT
bool operator!=(const int& _lhs, const OpenVolumeMeshHandle& _rhs);
OVM_EXPORT
bool operator!=(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs);
OVM_EXPORT
std::ostream& operator<<(std::ostream& _ostr, const OpenVolumeMeshHandle& _handle);
OVM_EXPORT
std::istream& operator>>(std::istream& _istr, OpenVolumeMeshHandle& _handle);
} // Namespace OpenVolumeMesh
......
......@@ -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"
......@@ -53,33 +54,33 @@ class ResourceManager;
template <class T>
const std::string typeName();
template <> const std::string typeName<int>();
template <> const std::string typeName<unsigned int>();
template <> const std::string typeName<short>();
template <> const std::string typeName<long>();
template <> const std::string typeName<unsigned long>();
template <> const std::string typeName<char>();
template <> const std::string typeName<unsigned char>();
template <> const std::string typeName<bool>();
template <> const std::string typeName<float>();
template <> const std::string typeName<double>();
template <> const std::string typeName<std::string>();
template <> const std::string typeName<std::map<HalfEdgeHandle, int> >();
template <> const std::string typeName<std::vector<double> >();
template <> const std::string typeName<std::vector<VertexHandle> >();
template <> const std::string typeName<std::vector<HalfFaceHandle> >();
template <> const std::string typeName<std::vector<std::vector<HalfFaceHandle> > >();
template <> OVM_EXPORT const std::string typeName<int>();
template <> OVM_EXPORT const std::string typeName<unsigned int>();
template <> OVM_EXPORT const std::string typeName<short>();
template <> OVM_EXPORT const std::string typeName<long>();
template <> OVM_EXPORT const std::string typeName<unsigned long>();
template <> OVM_EXPORT const std::string typeName<char>();
template <> OVM_EXPORT const std::string typeName<unsigned char>();
template <> OVM_EXPORT const std::string typeName<bool>();
template <> OVM_EXPORT const std::string typeName<float>();
template <> OVM_EXPORT const std::string typeName<double>();
template <> OVM_EXPORT const std::string typeName<std::string>();
template <> OVM_EXPORT const std::string typeName<std::map<HalfEdgeHandle, int> >();
template <> OVM_EXPORT const std::string typeName<std::vector<double> >();
template <> OVM_EXPORT const std::string typeName<std::vector<VertexHandle> >();
template <> OVM_EXPORT const std::string typeName<std::vector<HalfFaceHandle> >();
template <> OVM_EXPORT const std::string typeName<std::vector<std::vector<HalfFaceHandle> > >();
template<typename Entity>
const std::string entityTypeName();
template <> const std::string entityTypeName<Entity::Vertex>();
template <> const std::string entityTypeName<Entity::HalfEdge>();
template <> const std::string entityTypeName<Entity::Edge>();
template <> const std::string entityTypeName<Entity::Face>();
template <> const std::string entityTypeName<Entity::HalfFace>();
template <> const std::string entityTypeName<Entity::Cell>();
template <> const std::string entityTypeName<Entity::Mesh>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Vertex>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::HalfEdge>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Edge>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Face>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::HalfFace>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Cell>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Mesh>();
template<typename T, typename Entity>
class PropertyTT : public PropertyPtr<OpenVolumeMeshPropertyT<T>, Entity> {
......
......@@ -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);
......
......@@ -110,7 +110,7 @@ PropT ResourceManager::internal_request_property(StdVecT& _vec, const std::strin
return *prop;
}
// request_property: work around C++ currently now allowing partial specialisation on functions by using structs:
// request_property: work around C++ currently not allowing partial specialisation on functions by using structs:
template<class T, typename EntityTag>
struct request_property_impl {
......
......@@ -52,6 +52,7 @@
#include <string>
#include <iterator>
#include "../Config/Export.hh"
namespace OpenVolumeMesh
{
......@@ -59,11 +60,13 @@ namespace OpenVolumeMesh
template <typename ValueT>
std::ostream& serialize(std::ostream& os, const ValueT& rhs);
OVM_EXPORT
std::ostream& serialize(std::ostream& os, const std::string& rhs);
template <typename ValueT>
std::istream& deserialize(std::istream& is, ValueT& rhs);
OVM_EXPORT
std::istream& deserialize(std::istream& is, std::string& rhs);
template <typename KeyT, typename ValueT>
......@@ -78,6 +81,7 @@ std::ostream& operator<<(std::ostream& os, const std::vector< ValueT >& rhs);
template <typename ValueT>
std::istream& operator>>(std::istream& is, std::vector< ValueT >& rhs);
OVM_EXPORT
std::istream& operator>>(std::istream& is, std::vector< bool >& rhs);
}
......
......@@ -43,10 +43,11 @@
#include "OpenVolumeMeshHandle.hh"
#include "ResourceManager.hh"
#include "Iterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
class TopologyKernel : public ResourceManager {
class OVM_EXPORT TopologyKernel : public ResourceManager {
public:
TopologyKernel() = default;
......
......@@ -47,6 +47,7 @@
#include <fstream>
#include <istream>
#include <ostream>
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -59,7 +60,7 @@ namespace IO {
* \todo Implement binary file support
*/
class FileManager {
class OVM_EXPORT FileManager {
public:
/// Default constructor
......
......@@ -54,6 +54,8 @@
#include <cassert>
#include <cstdlib>
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
namespace Geometry {
......@@ -830,20 +832,20 @@ using namespace Geometry;
template <class T>
const std::string typeName();
template <> const std::string typeName<Vec2f>();
template <> const std::string typeName<Vec2d>();
template <> const std::string typeName<Vec2i>();
template <> const std::string typeName<Vec2ui>();
template <> OVM_EXPORT const std::string typeName<Vec2f>();
template <> OVM_EXPORT const std::string typeName<Vec2d>();
template <> OVM_EXPORT const std::string typeName<Vec2i>();
template <> OVM_EXPORT const std::string typeName<Vec2ui>();
template <> const std::string typeName<Vec3f>();
template <> const std::string typeName<Vec3d>();
template <> const std::string typeName<Vec3i>();
template <> const std::string typeName<Vec3ui>();
template <> OVM_EXPORT const std::string typeName<Vec3f>();
template <> OVM_EXPORT const std::string typeName<Vec3d>();
template <> OVM_EXPORT const std::string typeName<Vec3i>();
template <> OVM_EXPORT const std::string typeName<Vec3ui>();
template <> const std::string typeName<Vec4f>();
template <> const std::string typeName<Vec4d>();
template <> const std::string typeName<Vec4i>();
template <> const std::string typeName<Vec4ui>();
template <> OVM_EXPORT const std::string typeName<Vec4f>();
template <> OVM_EXPORT const std::string typeName<Vec4d>();
template <> OVM_EXPORT const std::string typeName<Vec4i>();
template <> OVM_EXPORT const std::string typeName<Vec4ui>();
} // namespace OpenVolumeMesh
......
This diff is collapsed.
This diff is collapsed.
......@@ -44,13 +44,14 @@
#define HEXAHEDRALMESHITERATORS_HH
#include "../Core/Iterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
class HexahedralMeshTopologyKernel;
class CellSheetCellIter : public BaseCirculator<CellHandle, CellHandle> {
class OVM_EXPORT CellSheetCellIter : public BaseCirculator<CellHandle, CellHandle> {
private:
typedef BaseCirculator<CellHandle, CellHandle> BaseIter;
public:
......@@ -104,7 +105,7 @@ private:
};
class HalfFaceSheetHalfFaceIter : public BaseCirculator<HalfFaceHandle,HalfFaceHandle> {
class OVM_EXPORT HalfFaceSheetHalfFaceIter : public BaseCirculator<HalfFaceHandle,HalfFaceHandle> {
private:
typedef BaseCirculator<HalfFaceHandle, HalfFaceHandle> BaseIter;
public:
......@@ -174,7 +175,7 @@ private:
* 0-------1
*/
class HexVertexIter : public BaseCirculator<CellHandle,
class OVM_EXPORT HexVertexIter : public BaseCirculator<CellHandle,
VertexHandle> {
private:
typedef BaseCirculator<CellHandle,
......
......@@ -42,6 +42,7 @@
#include "../Core/TopologyKernel.hh"
#include "HexahedralMeshIterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -75,7 +76,7 @@ namespace OpenVolumeMesh {
* \li \c 6. ZB
*/
class HexahedralMeshTopologyKernel : public TopologyKernel {
class OVM_EXPORT HexahedralMeshTopologyKernel : public TopologyKernel {
public:
// Orientation constants
......
......@@ -44,6 +44,7 @@
#define TETRAHEDRALMESHITERATORS_HH
#include "../Core/Iterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -56,7 +57,7 @@ class TetrahedralMeshTopologyKernel;
*
*/
class TetVertexIter : public BaseCirculator<CellHandle,
class OVM_EXPORT TetVertexIter : public BaseCirculator<CellHandle,
VertexHandle> {
private:
typedef BaseCirculator<CellHandle,
......
......@@ -50,6 +50,7 @@
#include "../Core/TopologyKernel.hh"
#include "TetrahedralMeshIterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -60,7 +61,7 @@ namespace OpenVolumeMesh {
*
*/
class TetrahedralMeshTopologyKernel : public TopologyKernel {
class OVM_EXPORT TetrahedralMeshTopologyKernel : public TopologyKernel {
public:
TetrahedralMeshTopologyKernel() = default;
......
/*===========================================================================*\
* *
* 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_ */
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__
......