-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
48 lines (37 loc) · 1.47 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# CMakeList.txt : CMake project for Opencl-ex1, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.8)
project(jpeg-encoder-opencl)
# Adding Opencl libs and include files to the proj
find_package(OpenCL)
include_directories(${OpenCL_INCLUDE_DIRS})
link_directories(${OpenCL_LIBRARY})
find_package(Boost 1.56 REQUIRED)
#adding the Boost libs to the proj
if (WIN32)
set(BOOST_INC "C:/local/boost_1_76_0_b1_rc2")
set(BOOST_LIB "C:/local/boost_1_76_0_b1_rc2/lib64-msvc-14.2/")
include_directories(${BOOST_INC})
link_directories(${BOOST_LIB})
elseif(UNIX)
message("OS: Linux")
include_directories(${Boost_INCLUDE_DIR})
endif()
# set build type to debug
# set(CMAKE_BUILD_TYPE Debug)
add_definitions(-g)
#compile files in Core and OpenCL external libs
file(GLOB CORE_SRC "lib/Core/*.cpp" "lib/Core/*.c")
file(GLOB OPENCL_SRC "lib/OpenCL/*.cpp" "lib/OpenCL/*.c")
if (WIN32)
file(GLOB BOOST_SRC "${BOOST_LIB}/*.lib")
endif()
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
# Add source to this project's executable.
add_executable (jpeg-encoder-opencl "src/OpenCLProject_JpegEncoder.cpp" "src/utils.cpp" ${CORE_SRC} ${OPENCL_SRC} )
target_include_directories (jpeg-encoder-opencl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "CORE" "OPENCL" "src" "lib")
target_link_libraries (jpeg-encoder-opencl ${OpenCL_LIBRARY} dl boost_system) #imagehlp)
# TODO: Add tests and install targets if needed.