Skip to content

Commit 4f8d48f

Browse files
Using JSBSim as a DLL to allow for LGPL License + Plugin License (#650)
1 parent 76a4d4f commit 4f8d48f

File tree

7 files changed

+62
-6
lines changed

7 files changed

+62
-6
lines changed

JSBSimForUnreal.vcxproj

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
</PropertyGroup>
1919
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
21-
<ConfigurationType>StaticLibrary</ConfigurationType>
21+
<ConfigurationType>DynamicLibrary</ConfigurationType>
2222
<WholeProgramOptimization>PGOptimize</WholeProgramOptimization>
2323
<PlatformToolset>v142</PlatformToolset>
2424
</PropertyGroup>
2525
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
26-
<ConfigurationType>StaticLibrary</ConfigurationType>
26+
<ConfigurationType>DynamicLibrary</ConfigurationType>
2727
<PlatformToolset>v142</PlatformToolset>
2828
</PropertyGroup>
2929
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -56,7 +56,7 @@
5656
<ClCompile>
5757
<Optimization>Disabled</Optimization>
5858
<AdditionalIncludeDirectories>$(ProjectDir)src;$(ProjectDir)src\simgear\xml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
59-
<PreprocessorDefinitions>JSBSIM_VERSION="1.0.0";WIN32;NOMINMAX;_DEBUG;_CONSOLE;HAVE_EXPAT_CONFIG_H;_USE_MATH_DEFINES;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
59+
<PreprocessorDefinitions>JSBSIM_EXPORT;JSBSIM_VERSION="1.0.0";WIN32;NOMINMAX;XML_STATIC;_DEBUG;_CONSOLE;HAVE_EXPAT_CONFIG_H;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
6060
<MinimalRebuild>false</MinimalRebuild>
6161
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
6262
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -106,7 +106,7 @@ exit/B %errlev%</Command>
106106
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
107107
<WholeProgramOptimization>true</WholeProgramOptimization>
108108
<AdditionalIncludeDirectories>$(ProjectDir)src;$(ProjectDir)src\simgear\xml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
109-
<PreprocessorDefinitions>JSBSIM_VERSION="1.0.0";WIN32;NOMINMAX;NDEBUG;_CONSOLE;HAVE_EXPAT_CONFIG_H;_USE_MATH_DEFINES;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
109+
<PreprocessorDefinitions>JSBSIM_EXPORT;JSBSIM_VERSION="1.0.0";WIN32;NOMINMAX;XML_STATIC;NDEBUG;_CONSOLE;HAVE_EXPAT_CONFIG_H;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110110
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
111111
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
112112
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
@@ -167,6 +167,7 @@ exit/B %errlev%</Command>
167167
<ClInclude Include="src\input_output\fgpropertyreader.h" />
168168
<ClInclude Include="src\input_output\FGUDPInputSocket.h" />
169169
<ClInclude Include="src\input_output\string_utilities.h" />
170+
<ClInclude Include="src\JSBSim_API.h" />
170171
<ClInclude Include="src\math\FGStateSpace.h" />
171172
<ClInclude Include="src\math\LagrangeMultiplier.h" />
172173
<ClInclude Include="src\models\atmosphere\FGStandardAtmosphere.h" />
@@ -288,6 +289,7 @@ exit/B %errlev%</Command>
288289
<ClCompile Include="src\input_output\FGOutputType.cpp" />
289290
<ClCompile Include="src\input_output\FGPropertyReader.cpp" />
290291
<ClCompile Include="src\input_output\FGUDPInputSocket.cpp" />
292+
<ClCompile Include="src\input_output\FGXMLFileRead.cpp" />
291293
<ClCompile Include="src\math\FGStateSpace.cpp" />
292294
<ClCompile Include="src\math\FGTemplateFunc.cpp" />
293295
<ClCompile Include="src\models\atmosphere\FGStandardAtmosphere.cpp" />

JSBSimForUnreal.vcxproj.filters

+6
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@
326326
<ClCompile Include="src\models\propulsion\FGBrushLessDCMotor.cpp">
327327
<Filter>Source Files</Filter>
328328
</ClCompile>
329+
<ClCompile Include="src\input_output\FGXMLFileRead.cpp">
330+
<Filter>Source Files</Filter>
331+
</ClCompile>
329332
</ItemGroup>
330333
<ItemGroup>
331334
<ClInclude Include="src\input_output\FGInputSocket.h">
@@ -679,5 +682,8 @@
679682
<ClInclude Include="src\models\propulsion\FGBrushLessDCMotor.h">
680683
<Filter>Header Files</Filter>
681684
</ClInclude>
685+
<ClInclude Include="src\JSBSim_API.h">
686+
<Filter>Header Files</Filter>
687+
</ClInclude>
682688
</ItemGroup>
683689
</Project>

UnrealEngine/LICENSE.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License
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 all
11+
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License
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 all
11+
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.

UnrealEngine/Plugins/JSBSimFlightDynamicsModel/Source/ThirdParty/JSBSim.Build.cs

+10
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ public JSBSim(ReadOnlyTargetRules Target) : base(Target)
3434
// Link Lib
3535
string LibPath = Path.Combine(ModuleDirectory, JSBSimLocalFolder, LibFolderName);
3636
PublicAdditionalLibraries.Add(Path.Combine(LibPath, "JSBSim.lib"));
37+
38+
// Stage DLL along the binaries files
39+
string DllFullPath = Path.Combine(LibPath, "JSBSim.dll");
40+
if (!File.Exists(DllFullPath))
41+
{
42+
string Err = string.Format("JSBSim.dll not found in {0} - Make sure that you have built JSBSimForUnreal.sln first", LibPath);
43+
System.Console.WriteLine(Err);
44+
throw new BuildException(Err);
45+
}
46+
RuntimeDependencies.Add("$(BinaryOutputDir)/" + "JSBSim.dll", DllFullPath);
3747
}
3848
}
3949
}

src/models/FGFCS.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ CLASS DOCUMENTATION
185185
CLASS DECLARATION
186186
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
187187

188-
class FGFCS : public FGModel
188+
class JSBSIM_API FGFCS : public FGModel
189189
{
190190

191191
public:

src/models/propulsion/FGTank.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ be printed to the console if the location is not given
199199
CLASS DECLARATION
200200
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
201201

202-
class FGTank : public FGJSBBase
202+
class JSBSIM_API FGTank : public FGJSBBase
203203
{
204204
public:
205205
/** Constructor.

0 commit comments

Comments
 (0)