Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Chaofan Chen
ogs
Commits
9be6528d
Commit
9be6528d
authored
3 years ago
by
Lars Bilke
Browse files
Options
Downloads
Patches
Plain Diff
[cmake] Simplify find_package(Threads).
parent
cc05e01f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Applications/DataExplorer/DataExplorer.cmake
+14
-5
14 additions, 5 deletions
Applications/DataExplorer/DataExplorer.cmake
Tests/CMakeLists.txt
+1
-1
1 addition, 1 deletion
Tests/CMakeLists.txt
scripts/cmake/Find.cmake
+3
-10
3 additions, 10 deletions
scripts/cmake/Find.cmake
with
18 additions
and
16 deletions
Applications/DataExplorer/DataExplorer.cmake
+
14
−
5
View file @
9be6528d
...
@@ -34,7 +34,7 @@ target_link_libraries(
...
@@ -34,7 +34,7 @@ target_link_libraries(
QtDataView
QtDataView
QtDiagramView
QtDiagramView
VtkVis
VtkVis
Threads::Threads
$<$<TARGET_EXISTS:Threads::Threads>:Threads::Threads>
Qt5::Core
Qt5::Core
Qt5::Gui
Qt5::Gui
Qt5::Widgets
Qt5::Widgets
...
@@ -86,9 +86,18 @@ if(MSVC)
...
@@ -86,9 +86,18 @@ if(MSVC)
# Install qt libraries
# Install qt libraries
get_target_property
(
mocExe Qt5::moc IMPORTED_LOCATION
)
get_target_property
(
mocExe Qt5::moc IMPORTED_LOCATION
)
get_filename_component
(
qtBinDir
"
${
mocExe
}
"
DIRECTORY
)
get_filename_component
(
qtBinDir
"
${
mocExe
}
"
DIRECTORY
)
find_program
(
DEPLOYQT_EXECUTABLE windeployqt PATHS
"
${
qtBinDir
}
"
NO_DEFAULT_PATH
)
find_program
(
set
(
DEPLOY_OPTIONS
[[bin/DataExplorer.exe --dir . --libdir bin --plugindir plugins]]
)
DEPLOYQT_EXECUTABLE windeployqt PATHS
"
${
qtBinDir
}
"
NO_DEFAULT_PATH
configure_file
(
${
PROJECT_SOURCE_DIR
}
/scripts/cmake/packaging/deployapp.cmake.in deployapp.cmake @ONLY
)
)
set
(
DEPLOY_OPTIONS
[[bin/DataExplorer.exe --dir . --libdir bin --plugindir plugins]]
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/scripts/cmake/packaging/deployapp.cmake.in
deployapp.cmake @ONLY
)
install
(
SCRIPT
${
CMAKE_CURRENT_BINARY_DIR
}
/deployapp.cmake
)
install
(
SCRIPT
${
CMAKE_CURRENT_BINARY_DIR
}
/deployapp.cmake
)
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/scripts/cmake/packaging/qt.conf TYPE BIN
)
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/scripts/cmake/packaging/qt.conf
TYPE BIN
)
endif
()
endif
()
This diff is collapsed.
Click to expand it.
Tests/CMakeLists.txt
+
1
−
1
View file @
9be6528d
...
@@ -77,7 +77,7 @@ target_link_libraries(
...
@@ -77,7 +77,7 @@ target_link_libraries(
ProcessLib
ProcessLib
Processes
Processes
TestInfoLib
TestInfoLib
Threads::Threads
$<$<TARGET_EXISTS:Threads::Threads>:Threads::Threads>
${
VTK_LIBRARIES
}
${
VTK_LIBRARIES
}
$<$<TARGET_EXISTS:LIE>:LIE>
$<$<TARGET_EXISTS:LIE>:LIE>
$<$<TARGET_EXISTS:TH2M>:TH2M>
$<$<TARGET_EXISTS:TH2M>:TH2M>
...
...
This diff is collapsed.
Click to expand it.
scripts/cmake/Find.cmake
+
3
−
10
View file @
9be6528d
...
@@ -20,9 +20,7 @@ find_program(GPROF_PATH gprof DOC "GNU profiler gprof" QUIET)
...
@@ -20,9 +20,7 @@ find_program(GPROF_PATH gprof DOC "GNU profiler gprof" QUIET)
find_program
(
CPPCHECK_TOOL_PATH cppcheck
)
find_program
(
CPPCHECK_TOOL_PATH cppcheck
)
# Find bash itself ...
# Find bash itself ...
find_program
(
find_program
(
BASH_TOOL_PATH bash DOC
"The bash executable"
)
BASH_TOOL_PATH bash HINTS
${
GITHUB_BIN_DIR
}
DOC
"The bash executable"
)
find_program
(
CCACHE_TOOL_PATH ccache
)
find_program
(
CCACHE_TOOL_PATH ccache
)
...
@@ -46,15 +44,10 @@ find_program(GMSH gmsh)
...
@@ -46,15 +44,10 @@ find_program(GMSH gmsh)
# Find libraries
# Find libraries
# ##############################################################################
# ##############################################################################
if
(
OGS_USE_MFRONT
)
if
(
OGS_USE_MFRONT
)
# pthread, is a requirement of mfront ##
set
(
CMAKE_REQUIRE_FIND_PACKAGE_Threads TRUE
)
set
(
CMAKE_THREAD_PREFER_PTHREAD ON
)
set
(
THREADS_PREFER_PTHREAD_FLAG ON
)
set
(
THREADS_PREFER_PTHREAD_FLAG ON
)
find_package
(
Threads REQUIRED
)
if
(
CMAKE_USE_PTHREADS_INIT
)
set
(
HAVE_PTHREADS TRUE
)
add_definitions
(
-DHAVE_PTHREADS
)
endif
()
endif
()
endif
()
find_package
(
Threads
)
find_package
(
OpenMP
)
find_package
(
OpenMP
)
if
(
OPENMP_FOUND
)
if
(
OPENMP_FOUND
)
...
...
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