Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
cb6d9b9e
Commit
cb6d9b9e
authored
1 year ago
by
Simon Praetorius
Browse files
Options
Downloads
Patches
Plain Diff
Replace mod_INTERFACE_LIBRARIES by mod_LIBRARIES
and introduce an mod_EXPORTED_LIBRARIES
parent
9b924939
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1271
Replace ProjectName_INTERFACE_LIBRARIES by ProjectName_LIBRARIES
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/modules/DuneAddLibrary.cmake
+12
-16
12 additions, 16 deletions
cmake/modules/DuneAddLibrary.cmake
cmake/modules/DuneProject.cmake
+10
-9
10 additions, 9 deletions
cmake/modules/DuneProject.cmake
with
22 additions
and
25 deletions
cmake/modules/DuneAddLibrary.cmake
+
12
−
16
View file @
cb6d9b9e
...
...
@@ -102,12 +102,12 @@ Add a library to a Dune module.
Dune::Common, Dune::ISTL, and Dune::MultiDomainGrid)
``NO_EXPORT``
If omitted the library is exported for usage in other modules.
If omitted the library is exported for usage in other modules and is added to
the global property ``<module>_EXPORTED_LIBRARIES``.
``NO_MODULE_LIBRARY``
If omitted the library is added to the global property ``<module>_LIBRARIES``
and used for internal module configuration. If ``NO_EXPORT`` is omitted, the library
will additionally be added to the global property ``<module>_INTERFACE_LIBRARIES``.
If omitted and if ``NO_EXPORT`` is also omitted, the library
will be added to the global property ``<module>_LIBRARIES``.
.. code-block:: cmake
...
...
@@ -224,15 +224,13 @@ function(dune_add_library_normal _name)
install
(
TARGETS
${
_name
}
EXPORT
${
export_set
}
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
# Register
target as an exported library
# Register
library in global property <module>_LIBRARIES
if
(
NOT ARG_NO_MODULE_LIBRARY
)
set_property
(
GLOBAL APPEND PROPERTY
${
ProjectName
}
_
INTERFACE_
LIBRARIES
${
alias
}
)
set_property
(
GLOBAL APPEND PROPERTY
${
ProjectName
}
_LIBRARIES
${
alias
}
)
endif
()
endif
()
# Register library in global property <module>_LIBRARIES
if
(
NOT ARG_NO_MODULE_LIBRARY
)
set_property
(
GLOBAL APPEND PROPERTY
${
ProjectName
}
_LIBRARIES
${
_name
}
)
# Register target as an exported library
set_property
(
GLOBAL APPEND PROPERTY
${
ProjectName
}
_EXPORTED_LIBRARIES
${
alias
}
)
endif
()
endfunction
(
dune_add_library_normal
)
...
...
@@ -285,15 +283,13 @@ function(dune_add_library_interface _name)
install
(
TARGETS
${
_name
}
EXPORT
${
export_set
}
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
# Register
target as an exported library
# Register
library in global property <module>_LIBRARIES
if
(
NOT ARG_NO_MODULE_LIBRARY
)
set_property
(
GLOBAL APPEND PROPERTY
${
ProjectName
}
_
INTERFACE_
LIBRARIES
${
alias
}
)
set_property
(
GLOBAL APPEND PROPERTY
${
ProjectName
}
_LIBRARIES
${
alias
}
)
endif
()
endif
()
# Register library in global property <module>_LIBRARIES
if
(
NOT ARG_NO_MODULE_LIBRARY
)
set_property
(
GLOBAL APPEND PROPERTY
${
ProjectName
}
_LIBRARIES
${
_name
}
)
# Register target as an exported library
set_property
(
GLOBAL APPEND PROPERTY
${
ProjectName
}
_EXPORTED_LIBRARIES
${
alias
}
)
endif
()
endfunction
(
dune_add_library_interface
)
...
...
This diff is collapsed.
Click to expand it.
cmake/modules/DuneProject.cmake
+
10
−
9
View file @
cb6d9b9e
...
...
@@ -94,11 +94,11 @@ macro(dune_project)
define_property
(
GLOBAL PROPERTY
${
ProjectName
}
_LIBRARIES
BRIEF_DOCS
"List of libraries of the module. DO NOT EDIT!"
FULL_DOCS
"List of
libraries of the module. Used to set up internal module configuration
. DO NOT EDIT!"
)
FULL_DOCS
"List of
all module-libraries
. DO NOT EDIT!"
)
define_property
(
GLOBAL PROPERTY
${
ProjectName
}
_
INTERFACE
_LIBRARIES
BRIEF_DOCS
"List of
interface libraries of
the module. DO NOT EDIT!"
FULL_DOCS
"List of
interface libraries of the module. Used to set up external module configuration
. DO NOT EDIT!"
)
define_property
(
GLOBAL PROPERTY
${
ProjectName
}
_
EXPORTED
_LIBRARIES
BRIEF_DOCS
"List of
libraries exported by
the module. DO NOT EDIT!"
FULL_DOCS
"List of
libraries exported by the module
. DO NOT EDIT!"
)
dune_create_dependency_tree
()
...
...
@@ -228,7 +228,7 @@ set(${ProjectName}_DEPENDS \"@${ProjectName}_DEPENDS@\")
set(
${
ProjectName
}
_SUGGESTS
\"
@
${
ProjectName
}
_SUGGESTS@
\"
)
set(
${
ProjectName
}
_MODULE_PATH
\"
@PACKAGE_DUNE_INSTALL_MODULEDIR@
\"
)
set(
${
ProjectName
}
_PYTHON_WHEELHOUSE
\"
@PACKAGE_DUNE_PYTHON_WHEELHOUSE@
\"
)
set(
${
ProjectName
}
_LIBRARIES
\"
@
${
ProjectName
}
_
INTERFACE_
LIBRARIES@
\"
)
set(
${
ProjectName
}
_LIBRARIES
\"
@
${
ProjectName
}
_LIBRARIES@
\"
)
set(
${
ProjectName
}
_HASPYTHON @DUNE_MODULE_HASPYTHON@)
set(
${
ProjectName
}
_PYTHONREQUIRES
\"
@DUNE_MODULE_PYTHONREQUIRES@
\"
)
...
...
@@ -246,14 +246,15 @@ endif()")
else
()
set
(
CONFIG_SOURCE_FILE
${
PROJECT_SOURCE_DIR
}
/cmake/pkg/
${
ProjectName
}
-config.cmake.in
)
endif
()
get_property
(
${
ProjectName
}
_INTERFACE_LIBRARIES GLOBAL PROPERTY
${
ProjectName
}
_INTERFACE_LIBRARIES
)
get_property
(
${
ProjectName
}
_LIBRARIES GLOBAL PROPERTY
${
ProjectName
}
_LIBRARIES
)
get_property
(
${
ProjectName
}
_EXPORTED_LIBRARIES GLOBAL PROPERTY
${
ProjectName
}
_EXPORTED_LIBRARIES
)
# compute under which libdir the package configuration files are to be installed.
# If the module installs an object library we use CMAKE_INSTALL_LIBDIR
# to capture the multiarch triplet of Debian/Ubuntu.
# Otherwise we fall back to DUNE_INSTALL_NONOBJECTLIB which is lib
# if not set otherwise.
if
(
${
ProjectName
}
_
INTERFACE
_LIBRARIES
)
if
(
${
ProjectName
}
_
EXPORTED
_LIBRARIES
)
set
(
DUNE_INSTALL_LIBDIR
${
CMAKE_INSTALL_LIBDIR
}
)
else
()
set
(
DUNE_INSTALL_LIBDIR
${
DUNE_INSTALL_NONOBJECTLIBDIR
}
)
...
...
@@ -339,7 +340,7 @@ endif()
# find all namespaces (this was setup in dune_add_library)
set
(
_namespaces
""
)
foreach
(
_target
${${
ProjectName
}
_
INTERFACE
_LIBRARIES
}
)
foreach
(
_target
${${
ProjectName
}
_
EXPORTED
_LIBRARIES
}
)
# find namespaces: alias without export name
get_target_property
(
_export_name
${
_target
}
EXPORT_NAME
)
string
(
FIND
"
${
_target
}
"
"
${
_export_name
}
"
_pos_export_name REVERSE
)
...
...
@@ -379,7 +380,7 @@ include(\"\${_dir}/${_target_file}\")")
Set this variable to FALSE only if you do not want compatibility with Dune 2.9 or earlier.
The old behavior will be completely removed after Dune 2.12"
)
if
(
${
ProjectVersionString
}
VERSION_LESS_EQUAL 2.12
)
foreach
(
_interface_name
${${
ProjectName
}
_
INTERFACE_
LIBRARIES
}
)
foreach
(
_interface_name
${${
ProjectName
}
_LIBRARIES
}
)
# alias with original target name (e.g. dunecommon)
get_target_property
(
_unaliased_name
${
_interface_name
}
ALIASED_TARGET
)
if
(
NOT
"
${
_unaliased_name
}
"
STREQUAL
"
${
_interface_name
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment