2021-10-06 10:54:07 +00:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
project(Dithering)
|
|
|
|
|
|
|
|
set(Dithering_SOURCES
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/blue_noise.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/image.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
|
|
|
|
|
|
|
|
if(NOT DEFINED CMAKE_BUILD_TYPE OR NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
|
|
message("Set build type to Debug by default")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
find_package(OpenCL REQUIRED)
|
2021-11-08 11:04:58 +00:00
|
|
|
find_package(PNG REQUIRED)
|
2021-10-06 10:54:07 +00:00
|
|
|
|
|
|
|
add_executable(Dithering ${Dithering_SOURCES})
|
|
|
|
target_compile_features(Dithering PUBLIC cxx_std_17)
|
|
|
|
target_include_directories(Dithering PUBLIC
|
|
|
|
Threads::Threads
|
2021-11-08 11:04:58 +00:00
|
|
|
${OpenCL_INCLUDE_DIRS}
|
|
|
|
${PNG_INCLUDE_DIRS})
|
2021-10-06 10:54:07 +00:00
|
|
|
target_link_libraries(Dithering PUBLIC
|
|
|
|
Threads::Threads
|
2021-11-08 11:04:58 +00:00
|
|
|
${OpenCL_LIBRARIES}
|
|
|
|
${PNG_LIBRARIES})
|