Skip to content

Commit

Permalink
Fix autogenerated Cpp-Examples for Injection
Browse files Browse the repository at this point in the history
  • Loading branch information
martinweismann committed Jul 9, 2019
1 parent 0d0b41e commit 62379ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/buildbindingccpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1627,12 +1627,12 @@ func buildCppDynamicExampleCMake(componentdefinition ComponentDefinition, w Lang
w.Writeln("project(%s)", projectName)
w.Writeln("set(CMAKE_CXX_STANDARD 11)")
w.Writeln("add_executable(%s \"${CMAKE_CURRENT_SOURCE_DIR}/%s_example.cpp\")", projectName, NameSpace)
if (ExplicitLinking) {
if (ExplicitLinking || (len(componentdefinition.ImportedComponentDefinitions)>0)) {
w.Writeln("if (UNIX)")
w.Writeln(" target_link_libraries(%s ${CMAKE_DL_LIBS})", projectName)
w.Writeln("endif (UNIX)")
} else {
linkFolder := strings.Replace(outputFolder, string(filepath.Separator), "/", -2) + "/../../Implementations/*/*/*"
linkFolder := "${CMAKE_CURRENT_SOURCE_DIR}/../../Implementations/*/*/*"
w.Writeln("find_library(%sLOCATION %s \"%s\")", strings.ToUpper(BaseName), BaseName, linkFolder)
w.Writeln("target_link_libraries(%s ${%sLOCATION})", projectName, strings.ToUpper(BaseName))
}
Expand Down

0 comments on commit 62379ba

Please sign in to comment.