Skip to content

Commit 3b23ad5

Browse files
author
Dimitar Stanev
committed
compiles on Linux with OpenSim v4.0
1 parent 56dfbed commit 3b23ad5

23 files changed

+1112
-255
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
*.log
22
*.asv
33
*.*~
4+
*.clangd/
5+
/CPP/.dir-locals.el
6+
CPP/build/
7+
/CPP/compile_commands.json
8+
/CPP/install/

CPP/.clang-format

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: -3
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveAssignments: false
6+
AlignConsecutiveDeclarations: false
7+
AlignEscapedNewlines: Right
8+
AlignOperands: true
9+
AlignTrailingComments: true
10+
AllowAllParametersOfDeclarationOnNextLine: true
11+
AllowShortBlocksOnASingleLine: true
12+
AllowShortCaseLabelsOnASingleLine: true
13+
AllowShortFunctionsOnASingleLine: All
14+
AllowShortIfStatementsOnASingleLine: true
15+
AllowShortLoopsOnASingleLine: true
16+
AlwaysBreakAfterReturnType: None
17+
AlwaysBreakBeforeMultilineStrings: false
18+
BinPackArguments: true
19+
BinPackParameters: true
20+
BraceWrapping:
21+
AfterClass: true
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
AfterExternBlock: false
30+
BeforeCatch: false
31+
BeforeElse: false
32+
IndentBraces: false
33+
# SplitEmptyFunction: true
34+
# SplitEmptyRecord: true
35+
# SplitEmptyNamespace: true
36+
BreakBeforeBinaryOperators: None
37+
# BreakBeforeBraces: Attach
38+
BreakBeforeInheritanceComma: false
39+
# BreakInheritanceList: BeforeColon
40+
BreakBeforeTernaryOperators: true
41+
BreakConstructorInitializersBeforeComma: false
42+
BreakConstructorInitializers: BeforeColon
43+
BreakAfterJavaFieldAnnotations: false
44+
BreakStringLiterals: true
45+
ColumnLimit: 80
46+
CompactNamespaces: false
47+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
48+
ConstructorInitializerIndentWidth: 8
49+
ContinuationIndentWidth: 8
50+
Cpp11BracedListStyle: true
51+
DerivePointerAlignment: false
52+
DisableFormat: false
53+
ExperimentalAutoDetectBinPacking: false
54+
FixNamespaceComments: true
55+
ForEachMacros:
56+
- foreach
57+
- Q_FOREACH
58+
- BOOST_FOREACH
59+
IncludeBlocks: Regroup
60+
IndentCaseLabels: false
61+
IndentPPDirectives: AfterHash
62+
IndentWidth: 4
63+
IndentWrappedFunctionNames: false
64+
KeepEmptyLinesAtTheStartOfBlocks: false
65+
MacroBlockBegin: ''
66+
MacroBlockEnd: ''
67+
MaxEmptyLinesToKeep: 1
68+
NamespaceIndentation: None
69+
PenaltyBreakAssignment: 2
70+
PenaltyBreakBeforeFirstCallParameter: 19
71+
PenaltyBreakComment: 300
72+
PenaltyBreakFirstLessLess: 120
73+
PenaltyBreakString: 1000
74+
# PenaltyBreakTemplateDeclaration: 10
75+
PenaltyExcessCharacter: 1000000
76+
PenaltyReturnTypeOnItsOwnLine: 60
77+
PointerAlignment: Left
78+
ReflowComments: true
79+
SortIncludes: true
80+
SortUsingDeclarations: true
81+
SpaceAfterCStyleCast: true
82+
SpaceAfterTemplateKeyword: true
83+
SpaceBeforeAssignmentOperators: true
84+
SpaceBeforeParens: ControlStatements
85+
SpaceInEmptyParentheses: false
86+
SpacesBeforeTrailingComments: 1
87+
SpacesInAngles: false
88+
SpacesInContainerLiterals: true
89+
SpacesInCStyleCastParentheses: false
90+
SpacesInParentheses: false
91+
SpacesInSquareBrackets: false
92+
Standard: Auto
93+
TabWidth: 4
94+
UseTab: Never

CPP/CMakeLists.txt

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
cmake_minimum_required (VERSION 2.8.5)
2-
project(MuscleForceDirection)
1+
cmake_minimum_required(VERSION 3.0)
2+
project(MuscleForceDirection VERSION 1.0.0)
33

4-
set(CMAKE_BUILD_TYPE Release)
4+
if(UNIX AND NOT CMAKE_BUILD_TYPE)
5+
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the build type" FORCE)
6+
endif()
57

6-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})
7-
find_package(OpenSim)
8+
# compilation database (completion for Linux)
9+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
810

9-
add_subdirectory(lib)
11+
add_subdirectory(MuscleForceDirection)
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# find OpenSim
2+
find_package(OpenSim REQUIRED)
3+
include_directories(${OpenSim_INCLUDE_DIRS})
4+
link_directories(${OpenSim_LIB_DIR})
5+
6+
# header and sources
7+
set(MuscleForceDirection_HEADERS
8+
MuscleForceDirection.h RegisterTypes_osimPlugin.h osimPluginDLL.h)
9+
set(MuscleForceDirection_SOURCES
10+
MuscleForceDirection.cpp RegisterTypes_osimPlugin.cpp)
11+
source_group("MuscleForceDirection_headers"
12+
FILES ${MuscleForceDirection_HEADERS})
13+
source_group("MuscleForceDirection_sources"
14+
FILES ${MuscleForceDirection_SOURCES})
15+
16+
# library
17+
set(target MuscleForceDirection)
18+
add_library(${target} SHARED
19+
${MuscleForceDirection_HEADERS}
20+
${MuscleForceDirection_SOURCES})
21+
target_link_libraries(${target} ${OpenSim_LIBRARIES})
22+
set_target_properties(
23+
${target} PROPERTIES
24+
DEFINE_SYMBOL OSIMPLUGIN_EXPORTS
25+
PROJECT_LABEL "Libraries - MuscleForceDirection")
26+
install(TARGETS ${target}
27+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

0 commit comments

Comments
 (0)