Skip to content

Commit

Permalink
Merge pull request #60 from cgogn/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
pierrekraemer committed Dec 21, 2015
2 parents ee0a8ab + d9ca3ca commit 949c139
Show file tree
Hide file tree
Showing 547 changed files with 231,511 additions and 4 deletions.
67 changes: 67 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: true
AlignConsecutiveAssignments: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@
*.exe
*.out
*.app

# QtCreator local project file
CMakeLists.txt.user

83 changes: 83 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)

set(CGOGN_VERSION_MAJOR 2)
set(CGOGN_VERSION_MINOR 0)
set(CGOGN_VERSION_PATCH 0)

project(CGoGN
VERSION ${CGOGN_VERSION_MAJOR}.${CGOGN_VERSION_MINOR}.${CGOGN_VERSION_PATCH}
LANGUAGES CXX
)

#### Default build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()


#### Here are located the FindPackages that we need
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")

#### Compile Options
include(cmake/CompilerOptions.cmake)
include(cmake/GenerateCppcheck.cmake)
include(cmake/EnableCoverageReport.cmake)


#### Build configuration
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CGOGN_SOURCE_DIR ${CMAKE_SOURCE_DIR}/cgogn)


#### ThirdParty options
option(CGOGN_PROVIDE_EIGEN "Use the version of eigen that is packaged with CGoGN" ON)
option(CGOGN_BUILD_TESTS "build cgogn unit tests using google test framework" ON)


#### RPATH
if(UNIX)
# RPATH is a field in ELF binaries that is used as a hint by the system
# loader to find needed shared libraries.
#
# In the build directory, cmake creates binaries with absolute paths in
# RPATH. And by default, it strips RPATH from installed binaries. Here we
# use CMAKE_INSTALL_RPATH to set a relative RPATH. By doing so, we avoid
# the need to play with LD_LIBRARY_PATH to get applications to run.
set(CMAKE_INSTALL_RPATH "../lib:../../lib")

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_MACOSX_RPATH ON)
endif()
endif(UNIX)

## Deduce build type of not forced by setting the CMAKE_BUILD_TYPE var
setBuildType()


if(CGOGN_BUILD_TESTS)
if(NOT gtest_inited)
set(gtest_inited ON CACHE INTERNAL "" FORCE)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif()
endif(CGOGN_BUILD_TESTS)


add_subdirectory(doc)

add_subdirectory(thirdparty)

add_subdirectory(${CGOGN_SOURCE_DIR})

add_subdirectory(test)

add_subdirectory(utest)

## TODO a mettre dans un fichier cmake particulier

# --- coverage ---
ENABLE_COVERAGE_REPORT(TARGETS ${CGOGN_SOURCE_DIR})

# --- CPPCheck ---
GENERATE_CPPCHECK( SOURCES ${CGOGN_SOURCE_DIR} ENABLE_IDS all INCLUDES ${CGOGN_SOURCE_DIR})
39 changes: 39 additions & 0 deletions QTcreator_IGGstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 2.8.1, 2014-07-11T16:03:10. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">false</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">false</value>
<value type="bool" key="BindStarToLeftSpecifier">false</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">true</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">false</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">4</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">true</value>
<value type="int" key="PaddingMode">2</value>
<value type="bool" key="SpacesForTabs">false</value>
<value type="int" key="TabSize">4</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">IGGstyle</value>
</data>
</qtcreator>
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

CGoGN is a geometric modeling C++ library that provides an efficient implementation of combinatorial maps.

## Building and installing CGoGN
* run cmake <cgogn_path> from the build directory of your choice (this build directory must not be cgogn_path)
* you can specify build type and install path by modifying CMAKE_BUILD_TYPE and CMAKE_INSTALL_PREFIX either by using cmake-gui or ccmake, or by specifying -DCMAKE_BUILD_TYPE="<buildtype>" -DCMAKE_INSTALL_PREFIX="<install_path>" when running cmake
* CMAKE_BUILD_TYPE default value is "Release"
* LINUX and MacOS
* make -jN or ninja in the build directory
* make (or ninja) install in the build directory if you want to install
* Windows
* VS 2013 or better required
* Installation : open INSTALL solution in VS and build it


## Contribution HowTo

* Fork this GitHub repository
Expand Down
2 changes: 2 additions & 0 deletions cgogn/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(utils)
add_subdirectory(core)
60 changes: 60 additions & 0 deletions cgogn/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
project(cgogn_core
LANGUAGES CXX
)

set(HEADER_FILES
basic/dll.h
basic/dart.h
basic/dart_marker.h
basic/cell.h
basic/cell_marker.h

container/chunk_array_container.h
container/chunk_array_factory.h
container/chunk_array_gen.h
container/chunk_array.h
container/chunk_stack.h

map/map_base_data.h
map/map_base.h
map/cmap1.h
map/cmap2.h
map/cmap3.h
map/cmap_tri.h
map/attribute_handler.h

io/surface_import.h
)

set(SOURCE_FILES
basic/cell_marker.cpp
basic/dart_marker.cpp

container/chunk_array_container.cpp

map/map_base_data.cpp
)

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})

set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_d")

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${EIGEN3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CGOGN_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/cgogn/cgogn_core>
)

target_link_libraries(${PROJECT_NAME} cgogn_utils)

install(DIRECTORY basic container
DESTINATION include/cgogn/cgogn_core
FILES_MATCHING PATTERN "*.h"
)

install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
Loading

0 comments on commit 949c139

Please sign in to comment.