Skip to content
Snippets Groups Projects
Commit 9be6528d authored by Lars Bilke's avatar Lars Bilke
Browse files

[cmake] Simplify find_package(Threads).

parent cc05e01f
No related branches found
No related tags found
No related merge requests found
...@@ -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()
...@@ -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>
......
...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment