Skip to content

Commit 0dbcdc0

Browse files
committed
initial commit
0 parents  commit 0dbcdc0

16 files changed

+577
-0
lines changed

.clang-format

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# clang-format configuration file based on the version 3.8
2+
# releases.llvm.org/3.8.0/tools/clang/docs/ClangFormatStyleOptions.html
3+
#BasedOnStyle (desactivated since we want to control everything [BC])
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: DontAlign
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
# If AlignEscapedNewlinesLeft is false, that put as far right as possible,
9+
# else left. In newer clang-format version,
10+
#use AlignEscapedNewlines: Right instead.
11+
AlignEscapedNewlinesLeft: false
12+
AlignOperands: true
13+
AlignTrailingComments: false
14+
AllowAllParametersOfDeclarationOnNextLine: true
15+
AllowShortBlocksOnASingleLine: true
16+
AllowShortCaseLabelsOnASingleLine: false
17+
AllowShortFunctionsOnASingleLine: Empty # pb with 3.5
18+
AllowShortIfStatementsOnASingleLine: false
19+
AllowShortLoopsOnASingleLine: false
20+
#AlwaysBreakAfterDefinitionReturnType (not set because deprecated [BC])
21+
AlwaysBreakAfterReturnType: None
22+
AlwaysBreakBeforeMultilineStrings: false
23+
AlwaysBreakTemplateDeclarations: true
24+
BinPackArguments: true
25+
BinPackParameters: false
26+
BraceWrapping:
27+
AfterClass: true
28+
AfterControlStatement: true
29+
AfterEnum: true
30+
AfterFunction: true
31+
AfterNamespace: true
32+
AfterObjCDeclaration: true
33+
AfterStruct: true
34+
AfterUnion: true
35+
BeforeCatch: true
36+
BeforeElse: true
37+
IndentBraces: false
38+
#SplitEmptyFunctionBody: false (this option provokes a clang-format error [BC])
39+
BreakBeforeBinaryOperators: NonAssignment # pb with 3.5
40+
BreakBeforeBraces: Custom # pb with 3.5
41+
#BreakBeforeInheritanceComma: false (this option needs a newer clang version)
42+
BreakBeforeTernaryOperators: true
43+
# For newer clang version, consider the new macro:
44+
# BreakConstructorInitializers
45+
BreakConstructorInitializersBeforeComma: false
46+
#BreakStringLiterals
47+
ColumnLimit: 80
48+
CommentPragmas: ''
49+
#CompactNamespaces: false (this option is in newer clang version)
50+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
51+
ConstructorInitializerIndentWidth: 4
52+
ContinuationIndentWidth: 4
53+
Cpp11BracedListStyle: false
54+
DerivePointerAlignment: true
55+
DisableFormat: false
56+
#ExperimentalAutoDetectBinPacking (Not defined since the documentation to not use it)
57+
#FixNamespaceComments: false (this option needs a newer clang version)
58+
#ForEachMacros: TODO
59+
#IncludeCategories: TODO
60+
#IncludeIsMainRegex (this option needs a newer clang version)
61+
IndentCaseLabels: false
62+
IndentWidth: 4
63+
IndentWrappedFunctionNames: true
64+
KeepEmptyLinesAtTheStartOfBlocks: false
65+
Language: Cpp
66+
#MacroBlockBegin TODO
67+
#MacroBlockEnd TODO
68+
MaxEmptyLinesToKeep: 1
69+
NamespaceIndentation: All
70+
#PenaltyBreakBeforeFirstCallParameter TODO
71+
#PenaltyBreakComment TODO
72+
#PenaltyBreakFirstLessLess TODO
73+
#PenaltyBreakString TODO
74+
#PenaltyExcessCharacter TODO
75+
#PenaltyReturnTypeOnItsOwnLine TODO
76+
PointerAlignment: Left
77+
ReflowComments: true # TODO check if 3.5 or 3.8
78+
#SortIncludes (this option needs a newer clang version)
79+
#SortUsingDeclarations (this option needs a newer clang version)
80+
SpaceAfterCStyleCast: true
81+
#SpaceAfterTemplateKeyword: false (this option needs a newer clang version)
82+
SpaceBeforeAssignmentOperators: true
83+
SpaceBeforeParens: Never
84+
SpaceInEmptyParentheses: false
85+
SpacesBeforeTrailingComments: 1
86+
SpacesInAngles: true
87+
SpacesInCStyleCastParentheses: false
88+
SpacesInContainerLiterals: false
89+
SpacesInParentheses: true
90+
SpacesInSquareBrackets: false
91+
Standard: Cpp11
92+
TabWidth: 4
93+
UseTab: Never

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/* linguist-vendored

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
.settings

.releaserc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"plugins": [
3+
'@semantic-release/commit-analyzer',
4+
'@semantic-release/release-notes-generator',
5+
'@semantic-release/github',
6+
'semantic-release-ado'
7+
]
8+
}

CMakeLists.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright (c) 2019 Geode-solutions
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
21+
cmake_minimum_required(VERSION 3.5)
22+
23+
# Define the project
24+
project(MyModule CXX)
25+
26+
option(MYMODULE_WITH_TESTS "Compile test projects" ON)
27+
28+
#------------------------------------------------------------------------------------------------
29+
# Platform dependent settings
30+
if(UNIX)
31+
add_compile_options(-Wall -Wextra -Wno-attributes)
32+
else()
33+
add_compile_options(/DNOMINMAX)
34+
endif()
35+
36+
# Get MyModule dependencies
37+
find_package(OpenGeode REQUIRED)
38+
39+
copy_windows_binaries(OpenGeode::basic)
40+
41+
#------------------------------------------------------------------------------------------------
42+
# Configure the MyModule libraries
43+
add_geode_library(mylib)
44+
45+
#------------------------------------------------------------------------------------------------
46+
# Optional modules configuration
47+
if(MYMODULE_WITH_TESTS)
48+
# Enable testing with CTest
49+
enable_testing()
50+
message(STATUS "Configuring MyModule with tests")
51+
add_subdirectory(tests)
52+
endif()
53+
54+
#------------------------------------------------------------------------------------------------
55+
# Configure CPacks
56+
if(WIN32)
57+
set(CPACK_GENERATOR "ZIP")
58+
else()
59+
set(CPACK_GENERATOR "TGZ")
60+
endif()
61+
62+
# This must always be last!
63+
include(CPack)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Geode-solutions
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# OpenGeode-ModuleTemplate
2+
3+
Template for OpenGeode modules.
4+
5+
Please have a look at this page : https://help.github.com/en/articles/creating-a-repository-from-a-template

azure-pipelines.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
resources:
2+
repositories:
3+
- repository: templates
4+
type: github
5+
name: Geode-solutions/ci_tools
6+
endpoint: Geode-solutions
7+
8+
variables:
9+
- group: Tokens
10+
11+
jobs:
12+
- template: clang-format.yml@templates
13+
14+
- job: Test_Ubuntu
15+
dependsOn: Format
16+
pool:
17+
vmImage: "ubuntu-16.04"
18+
steps:
19+
- template: get-release.yml@templates
20+
parameters:
21+
repo: OpenGeode
22+
pattern: "*Linux*"
23+
- template: unix-compilation.yml@templates
24+
parameters:
25+
type: "Debug"
26+
cmakeArgs: "-DCMAKE_PREFIX_PATH=$(OPENGEODEPATH)"
27+
28+
- job: Test_Windows
29+
dependsOn: Format
30+
pool:
31+
vmImage: "vs2017-win2016"
32+
steps:
33+
- template: get-release.yml@templates
34+
parameters:
35+
repo: OpenGeode
36+
pattern: "*win64*"
37+
- template: windows-compilation.yml@templates
38+
parameters:
39+
type: "Debug"
40+
cmakeArgs: "-DCMAKE_PREFIX_PATH=$(OPENGEODEPATH)"
41+
- template: windows-testing.yml@templates
42+
parameters:
43+
type: "Debug"
44+
cmakeArgs: "-DCMAKE_PREFIX_PATH=$(OPENGEODEPATH)"
45+
46+
- job: Test_Mac
47+
dependsOn: Format
48+
pool:
49+
vmImage: "macOS-10.13"
50+
steps:
51+
- template: get-release.yml@templates
52+
parameters:
53+
repo: OpenGeode
54+
pattern: "*Darwin*"
55+
- template: unix-compilation.yml@templates
56+
parameters:
57+
type: "Debug"
58+
cmakeArgs: "-DCMAKE_PREFIX_PATH=$(OPENGEODEPATH)"
59+
60+
- template: semantic-release.yml@templates
61+
parameters:
62+
dependencies:
63+
- Test_Ubuntu
64+
- Test_Windows
65+
- Test_Mac
66+
67+
- job: Release_Ubuntu
68+
dependsOn: Semantic_release
69+
condition: eq(dependencies.Semantic_release.outputs['save.newRelease'], 'true')
70+
pool:
71+
vmImage: "ubuntu-16.04"
72+
variables:
73+
Version: $[ dependencies.Semantic_release.outputs['save.versionNumber'] ]
74+
steps:
75+
- template: get-release.yml@templates
76+
parameters:
77+
repo: OpenGeode
78+
pattern: "*Linux*"
79+
- template: unix-compilation.yml@templates
80+
parameters:
81+
type: "Release"
82+
cmakeArgs: "-DOPENGEODE_MYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$(Version) -DCMAKE_PREFIX_PATH=$(OPENGEODEPATH)"
83+
- template: unix-release.yml@templates
84+
parameters:
85+
version: $(Version)
86+
87+
- job: Release_Mac
88+
dependsOn: Semantic_release
89+
condition: eq(dependencies.Semantic_release.outputs['save.newRelease'], 'true')
90+
pool:
91+
vmImage: "macOS-10.13"
92+
variables:
93+
Version: $[ dependencies.Semantic_release.outputs['save.versionNumber'] ]
94+
steps:
95+
- template: get-release.yml@templates
96+
parameters:
97+
repo: OpenGeode
98+
pattern: "*Darwin*"
99+
- template: unix-compilation.yml@templates
100+
parameters:
101+
type: "Release"
102+
cmakeArgs: "-DOPENGEODE_MYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$(Version) -DCMAKE_PREFIX_PATH=$(OPENGEODEPATH)"
103+
- template: unix-release.yml@templates
104+
parameters:
105+
version: $(Version)
106+
107+
- job: Release_Windows
108+
dependsOn: Semantic_release
109+
condition: eq(dependencies.Semantic_release.outputs['save.newRelease'], 'true')
110+
pool:
111+
vmImage: "vs2017-win2016"
112+
variables:
113+
Version: $[ dependencies.Semantic_release.outputs['save.versionNumber'] ]
114+
steps:
115+
- template: get-release.yml@templates
116+
parameters:
117+
repo: OpenGeode
118+
pattern: "*win64*"
119+
- template: windows-compilation.yml@templates
120+
parameters:
121+
type: "Release"
122+
cmakeArgs: "-DOPENGEODE_MYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$(Version) -DCMAKE_PREFIX_PATH=$(OPENGEODEPATH)"
123+
- template: windows-release.yml@templates
124+
parameters:
125+
version: $(Version)

include/mylib/hello_world.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#pragma once
25+
26+
#include <mylib/mymodule_mylib_export.h>
27+
28+
namespace mymodule
29+
{
30+
bool mymodule_mylib_api hello_world();
31+
} // namespace mymodule

src/mylib/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2019 Geode-solutions
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
21+
set(sources
22+
"${lib_source_dir}/hello_world.cpp"
23+
)
24+
set(public_headers
25+
"${lib_include_dir}/hello_world.h"
26+
)
27+
target_link_libraries(${target_name}
28+
PRIVATE
29+
OpenGeode::basic
30+
)

0 commit comments

Comments
 (0)