From eab2371bc4ad32c9ba0b8f2a747c3db21c57c077 Mon Sep 17 00:00:00 2001 From: Tossy0423 Date: Sun, 19 Sep 2021 17:00:35 +0900 Subject: [PATCH] Fix --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e1abf32d9c..26e435e4263 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,15 +181,17 @@ else() endif() if(USE_INTEGRATED_LIBS) - set(PThreads_windows_DIR ${CMAKE_CURRENT_LIST_DIR}/3rdparty/pthreads CACHE PATH "Path where pthreads for windows can be located") + set(PThreads4W_ROOT ${CMAKE_CURRENT_LIST_DIR}/3rdparty/pthreads CACHE PATH "Path where pthreads for windows can be located") endif() set(Stb_DIR ${CMAKE_CURRENT_LIST_DIR}/3rdparty/stb CACHE PATH "Path where Stb image library can be located") set(CMAKE_DEBUG_POSTFIX d) set(CMAKE_THREAD_PREFER_PTHREAD ON) find_package(Threads REQUIRED) -if(MSVC) - find_package(PThreads_windows REQUIRED) +if(MSVC AND USE_INTEGRATED_LIBS) + find_package(PThreads4W REQUIRED) +elseif(MSVC) + find_package(pthreads REQUIRED) endif() if(ENABLE_OPENCV) find_package(OpenCV REQUIRED)