Fixes/Refactorings to CMakeLists.txt

This commit is contained in:
Stephen Seo 2023-03-31 18:55:36 +09:00
parent ecd65fc42b
commit 7041f732a9

View file

@ -18,12 +18,14 @@ if(NOT DEFINED CMAKE_BUILD_TYPE OR NOT CMAKE_BUILD_TYPE)
endif()
find_package(Threads REQUIRED)
if(NOT DEFINED DISABLE_OPENCL)
find_package(OpenCL QUIET)
if(NOT DEFINED DISABLE_OPENCL OR NOT DISABLE_OPENCL)
find_package(OpenCL)
if(NOT DEFINED OpenCL_FOUND)
set(DISABLE_OPENCL True)
message(WARNING "OpenCL not found, OpenCL usage is disabled.")
endif()
else()
message(STATUS "Not checking for OpenCL")
endif()
find_package(PNG REQUIRED)