Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Florian Weik
waLBerla
Commits
213e0d99
Commit
213e0d99
authored
Feb 13, 2019
by
Michael Kuron
Browse files
Call target_link_libraries with PUBLIC keyword if necessary
parent
b6c6e2dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
213e0d99
...
@@ -129,6 +129,11 @@ list( APPEND WALBERLA_MODULE_DIRS "${walberla_SOURCE_DIR}/src" "${walberla_SOURC
...
@@ -129,6 +129,11 @@ list( APPEND WALBERLA_MODULE_DIRS "${walberla_SOURCE_DIR}/src" "${walberla_SOURC
list
(
REMOVE_DUPLICATES WALBERLA_MODULE_DIRS
)
list
(
REMOVE_DUPLICATES WALBERLA_MODULE_DIRS
)
set
(
WALBERLA_MODULE_DIRS
${
WALBERLA_MODULE_DIRS
}
CACHE INTERNAL
"All folders that contain modules or tests"
)
set
(
WALBERLA_MODULE_DIRS
${
WALBERLA_MODULE_DIRS
}
CACHE INTERNAL
"All folders that contain modules or tests"
)
# target_link_libraries needs to called with keywords everywhere if it is called with keywords once
if
(
DEFINED CUDA_LINK_LIBRARIES_KEYWORD AND NOT CUDA_LINK_LIBRARIES_KEYWORD STREQUAL
""
)
set
(
WALBERLA_LINK_LIBRARIES_KEYWORD PUBLIC
)
endif
()
############################################################################################################################
############################################################################################################################
...
...
apps/pythonmodule/CMakeLists.txt
View file @
213e0d99
...
@@ -26,7 +26,7 @@ if ( WALBERLA_BUILD_WITH_PYTHON_MODULE )
...
@@ -26,7 +26,7 @@ if ( WALBERLA_BUILD_WITH_PYTHON_MODULE )
add_library
(
walberla_cpp SHARED PythonModule.cpp
)
add_library
(
walberla_cpp SHARED PythonModule.cpp
)
endif
()
endif
()
target_link_libraries
(
walberla_cpp
${
pythonModules
}
${
SERVICE_LIBS
}
)
target_link_libraries
(
walberla_cpp
${
WALBERLA_LINK_LIBRARIES_KEYWORD
}
${
pythonModules
}
${
SERVICE_LIBS
}
)
set_target_properties
(
walberla_cpp PROPERTIES PREFIX
""
)
set_target_properties
(
walberla_cpp PROPERTIES PREFIX
""
)
if
(
APPLE
)
if
(
APPLE
)
set_target_properties
(
walberla_cpp PROPERTIES SUFFIX
".so"
)
set_target_properties
(
walberla_cpp PROPERTIES SUFFIX
".so"
)
...
...
cmake/waLBerlaFunctions.cmake
View file @
213e0d99
...
@@ -228,7 +228,7 @@ function ( waLBerla_add_executable )
...
@@ -228,7 +228,7 @@ function ( waLBerla_add_executable )
set_source_files_properties
(
${
generatedSourceFiles
}
PROPERTIES GENERATED TRUE
)
set_source_files_properties
(
${
generatedSourceFiles
}
PROPERTIES GENERATED TRUE
)
target_link_modules
(
${
ARG_NAME
}
${
ARG_DEPENDS
}
)
target_link_modules
(
${
ARG_NAME
}
${
ARG_DEPENDS
}
)
target_link_libraries
(
${
ARG_NAME
}
${
SERVICE_LIBS
}
)
target_link_libraries
(
${
ARG_NAME
}
${
WALBERLA_LINK_LIBRARIES_KEYWORD
}
${
SERVICE_LIBS
}
)
set_property
(
TARGET
${
ARG_NAME
}
PROPERTY CXX_STANDARD 14
)
set_property
(
TARGET
${
ARG_NAME
}
PROPERTY CXX_STANDARD 14
)
if
(
WALBERLA_GROUP_PROJECTS
)
if
(
WALBERLA_GROUP_PROJECTS
)
...
...
cmake/waLBerlaModuleDependencySystem.cmake
View file @
213e0d99
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
# This mechanism is just for convenience, one can simply compile an application that uses walberla modules
# This mechanism is just for convenience, one can simply compile an application that uses walberla modules
# by standard cmake mechanisms:
# by standard cmake mechanisms:
# add_executable ( myApp ${mySourceFiles} )
# add_executable ( myApp ${mySourceFiles} )
# target_link_libraries ( myApp walberlaModule1 core-field lbm-boundary )
# target_link_libraries ( myApp
${WALBERLA_LINK_LIBRARIES_KEYWORD}
walberlaModule1 core-field lbm-boundary )
# The difference here is that all transitively depending modules also have to be specified manually.
# The difference here is that all transitively depending modules also have to be specified manually.
# i.e. assume core-field depends on core-stencil, then core-stencil has to be added by hand.
# i.e. assume core-field depends on core-stencil, then core-stencil has to be added by hand.
# If you use waLBerla_add_executable , these dependent modules are added automatically.
# If you use waLBerla_add_executable , these dependent modules are added automatically.
...
@@ -202,7 +202,7 @@ function ( target_link_modules target )
...
@@ -202,7 +202,7 @@ function ( target_link_modules target )
if
(
TARGET
${
libraryName
}
)
if
(
TARGET
${
libraryName
}
)
get_target_property
(
target_type
${
libraryName
}
TYPE
)
get_target_property
(
target_type
${
libraryName
}
TYPE
)
if
(
${
target_type
}
MATCHES LIBRARY
)
if
(
${
target_type
}
MATCHES LIBRARY
)
target_link_libraries
(
${
target
}
${
libraryName
}
)
target_link_libraries
(
${
target
}
${
WALBERLA_LINK_LIBRARIES_KEYWORD
}
${
libraryName
}
)
endif
(
)
endif
(
)
endif
(
)
endif
(
)
endforeach
()
endforeach
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment