-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
64 lines (47 loc) · 2.04 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Depixelization
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
project(Depixelization CXX)
option(DEPIXELIZATION_BUILD_TESTS "Build unit tests" ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Set directory paths
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(sources
${SOURCE_DIR}/depixelization/public/main.cpp
${SOURCE_DIR}/depixelization/public/ProgramDriver.cpp)
set(includes
${SOURCE_DIR}/depixelization/public/ProgramDriver.h)
add_executable(depixelization ${sources} ${includes})
include(${CMAKE_DIR}/LinkSTB.cmake)
LinkSTB(depixelization PRIVATE)
include(${CMAKE_DIR}/LinkArgParse.cmake)
LinkArgParse(depixelization PRIVATE)
find_package(Boost 1.70 REQUIRED)
# Configure the executable
target_link_libraries(depixelization PUBLIC reshaper ${Boost_LIBRARY_DIRS} utility)
target_include_directories(depixelization
PUBLIC ${SOURCE_DIR}/depixelization/public
PUBLIC ${SOURCE_DIR}/reshaper/public
PUBLIC ${SOURCE_DIR}/utility/public
PRIVATE ${SOURCE_DIR}/reshaper/private)
set_target_properties(depixelization PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO)
# Add projects to the executable
add_subdirectory(${SOURCE_DIR}/reshaper/public)
add_subdirectory(${SOURCE_DIR}/reshaper/private)
add_subdirectory(${SOURCE_DIR}/utility/public)
# Set project folders
set_target_properties(depixelization PROPERTIES FOLDER Depixelization)
set_target_properties(reshaper PROPERTIES FOLDER Depixelization/Reshaper)
set_target_properties(reshaper-impl PROPERTIES FOLDER Depixelization/Reshaper)
set_target_properties(utility PROPERTIES FOLDER Depixelization/Utility)
if (DEPIXELIZATION_BUILD_TESTS)
enable_testing()
add_subdirectory(${SOURCE_DIR}/reshaper/tests)
set_target_properties(reshaper-tests PROPERTIES FOLDER Depixelization/Reshaper)
add_subdirectory(${SOURCE_DIR}/utility/tests)
set_target_properties(utility-tests PROPERTIES FOLDER Depixelization/Utility)
endif()