-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (28 loc) · 1.07 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
cmake_minimum_required(VERSION 3.12)
project(ImageCompressing VERSION 2.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CXX_EXTENSIONS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
set(CMAKE_CXX_FLAGS "-pthread")
add_compile_definitions(USER_PATH="/home/$ENV{USER}")
set(DEBUG ON CACHE BOOL "For local debugging")
if (DEBUG)
set(CMAKE_BUILD_TYPE Debug)
add_compile_definitions(KERNEL_PATH="kernel.cl")
set(CMAKE_CXX_FLAGS_RELEASE "-g3")
else()
set(CMAKE_BUILD_TYPE Release)
add_compile_definitions(KERNEL_PATH="/home/$ENV{USER}/ImageResizer/kernel.cl")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
endif()
set(ALGORITHM_DIR "compressor/")
set(UI_DIR "ui/")
set(TESTS_DIR "tests/")
set(MODULE_GTEST "modules/gtest/")
add_subdirectory(${ALGORITHM_DIR})
add_subdirectory(${UI_DIR})
add_subdirectory(${MODULE_GTEST})
add_subdirectory(${TESTS_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compressor/kernel.cl ${CMAKE_BINARY_DIR} COPYONLY)