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
38068aaf
Commit
38068aaf
authored
4 months ago
by
Santiago Ospina De Los Ríos
Committed by
Timo Koch
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add Threads library dependency and propagate pthreads flag
parent
99387d38
No related branches found
No related tags found
1 merge request
!1464
[cmake] Require linked libs through find_dependency
Pipeline
#75738
passed
3 months ago
Stage: .pre
Stage: test
Stage: code_quality
Stage: downstream
Pipeline: Dune Nightly Test
#75741
Pipeline: Dune Nightly Test
#75740
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+13
-9
13 additions, 9 deletions
CMakeLists.txt
cmake/modules/DuneMacros.cmake
+0
-4
0 additions, 4 deletions
cmake/modules/DuneMacros.cmake
with
13 additions
and
13 deletions
CMakeLists.txt
+
13
−
9
View file @
38068aaf
...
...
@@ -12,6 +12,8 @@ endif()
# make sure our own modules are found
list
(
APPEND CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/cmake/modules
)
set
(
THREADS_PREFER_PTHREAD_FLAG TRUE CACHE BOOL
"Prefer -pthread compiler and linker flag"
)
#include the dune macros
include
(
DuneMacros
)
...
...
@@ -35,7 +37,8 @@ add_dune_blas_lapack_flags(dunecommon)
add_dune_tbb_flags
(
dunecommon
)
# collect dependencies to be added into the dune-common-config.cmake files
set
(
DUNE_COMMON_PACKAGE_DEPENDENCIES
)
set
(
DUNE_COMMON_PACKAGE_DEPENDENCIES
[[set(THREADS_PREFER_PTHREAD_FLAG TRUE CACHE BOOL "Prefer -pthread compiler and linker flag")]]
)
# since dunecommon is exported its linked libs must be provided downstream too
if
(
LAPACK_FOUND
)
...
...
@@ -43,6 +46,9 @@ if (LAPACK_FOUND)
elseif
(
BLAS_FOUND
)
list
(
APPEND DUNE_COMMON_PACKAGE_DEPENDENCIES
"find_dependency(BLAS)"
)
endif
()
if
(
Threads_FOUND
)
list
(
APPEND DUNE_COMMON_PACKAGE_DEPENDENCIES
"find_dependency(Threads)"
)
endif
()
if
(
TBB_FOUND
)
list
(
APPEND DUNE_COMMON_PACKAGE_DEPENDENCIES
"find_dependency(TBB)"
)
endif
()
...
...
@@ -60,14 +66,12 @@ if(DUNE_ENABLE_PYTHONBINDINGS)
add_subdirectory
(
python
)
endif
()
if
(
DUNE_COMMON_PACKAGE_DEPENDENCIES
)
# write contents into DUNE_CUSTOM_PKG_CONFIG_SECTION, which will be injected into dune-common-config.cmake
string
(
JOIN
"
\n
"
DUNE_CUSTOM_PKG_CONFIG_SECTION
# make sure that Find<module>.cmake provided by dune-common can be found by cmake
[[list(APPEND CMAKE_MODULE_PATH "
${
dune-common_MODULE_PATH
}
")]]
${
DUNE_COMMON_PACKAGE_DEPENDENCIES
}
)
endif
()
# write contents into DUNE_CUSTOM_PKG_CONFIG_SECTION, which will be injected into dune-common-config.cmake
string
(
JOIN
"
\n
"
DUNE_CUSTOM_PKG_CONFIG_SECTION
# make sure that Find<module>.cmake provided by dune-common can be found by cmake
[[list(APPEND CMAKE_MODULE_PATH "
${
dune-common_MODULE_PATH
}
")]]
${
DUNE_COMMON_PACKAGE_DEPENDENCIES
}
)
# finalize the dune project, e.g. generating config.h, dune-common-config.cmake, etc.
finalize_dune_project
()
This diff is collapsed.
Click to expand it.
cmake/modules/DuneMacros.cmake
+
0
−
4
View file @
38068aaf
...
...
@@ -30,10 +30,6 @@ include_guard(GLOBAL)
enable_language
(
C
)
# Enable C to skip CXX bindings for some tests.
# By default use -pthread flag. This option is set at the beginning to enforce it for
# find_package(Threads) everywhere
set
(
THREADS_PREFER_PTHREAD_FLAG TRUE CACHE BOOL
"Prefer -pthread compiler and linker flag"
)
include
(
DuneAddLibrary
)
include
(
DuneDefaultIncludeDirectories
)
include
(
DuneEnableAllPackages
)
...
...
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