-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
60 lines (47 loc) · 1.17 KB
/
Copy pathCMakeLists.txt
File metadata and controls
60 lines (47 loc) · 1.17 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
cmake_minimum_required(VERSION 3.20)
project(cpp_image_processing_prototype LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_library(image_processing
src/Image.cpp
src/ImageOperations.cpp
src/PgmIO.cpp
)
target_include_directories(image_processing
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/include"
)
target_compile_options(image_processing
PRIVATE
$<$<CXX_COMPILER_ID:AppleClang,Clang,GNU>:-Wall;-Wextra;-Wpedantic>
)
add_executable(image_tool
src/main.cpp
)
target_link_libraries(image_tool
PRIVATE
image_processing
)
target_compile_options(image_tool
PRIVATE
$<$<CXX_COMPILER_ID:AppleClang,Clang,GNU>:-Wall;-Wextra;-Wpedantic>
)
include(CTest)
if(BUILD_TESTING)
add_executable(image_tests
tests/image_operations_tests.cpp
)
target_link_libraries(image_tests
PRIVATE
image_processing
)
target_compile_options(image_tests
PRIVATE
$<$<CXX_COMPILER_ID:AppleClang,Clang,GNU>:-Wall;-Wextra;-Wpedantic>
)
add_test(
NAME image_operations
COMMAND image_tests
)
endif()