diff --git a/cmake/FindCImg.cmake b/cmake/FindCImg.cmake index 38a929e7a7..5db69aba18 100644 --- a/cmake/FindCImg.cmake +++ b/cmake/FindCImg.cmake @@ -83,10 +83,10 @@ if (CIMG_FOUND) endif (X11_Xrandr_FOUND) ### PThread is required when using X11 display engine ### - find_package (PTHREAD QUIET) - if (PTHREAD_FOUND) - set (CIMG_INCLUDE_DIRS ${CIMG_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIRS}) - set (CIMG_LIBRARIES ${CIMG_LIBRARIES} ${PTHREAD_LIBRARIES}) + find_package (Threads QUIET) + if (Threads_FOUND) + set (CIMG_INCLUDE_DIRS ${CIMG_INCLUDE_DIRS}) + set (CIMG_LIBRARIES ${CIMG_LIBRARIES} Threads::Threads) message(STATUS "FindCImg.cmake: pthread found") else (PTHREAD_FOUND) message(STATUS "!!! FindCIMG.cmake !!! pthread NOT found. pthread required by cimg for running X11.") @@ -98,18 +98,6 @@ if (CIMG_FOUND) message(WARNING "FindCImg.cmake: display disabled") set (CIMG_DEFINITIONS ${CIMG_DEFINITIONS} -Dcimg_display=0) endif (X11_FOUND) - else (UNIX OR APPLE) - if (WIN32) - find_package(GDI QUIET) - if (GDI_FOUND) - set (CIMG_LIBRARIES ${CIMG_LIBRARIES} ${GDI_LIBRARIES}) - message(STATUS "FindCImg.cmake: GDI found") - else (GDI_FOUND) - message(STATUS "!!! FindCIMG.cmake !!! GDI NOT found.") - message(WARNING "FindCImg.cmake: display disabled") - set (CIMG_DEFINITIONS ${CIMG_DEFINITIONS} -Dcimg_display=0) - endif (GDI_FOUND) - endif (WIN32) endif (UNIX OR APPLE) endif() @@ -135,4 +123,4 @@ if (CIMG_FOUND) target_compile_definitions(CImg::CImg INTERFACE ${CIMG_DEFINITIONS}) target_link_libraries(CImg::CImg INTERFACE ${CIMG_LIBRARIES}) target_include_directories(CImg::CImg INTERFACE ${CIMG_INCLUDE_DIRS}) -endif(CIMG_FOUND) \ No newline at end of file +endif(CIMG_FOUND)