This repository has been archived by the owner on Jan 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
62 lines (46 loc) · 1.62 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
message("CMake version: ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
cmake_minimum_required(VERSION 3.4)
project(QtOIIO LANGUAGES CXX C)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# C++11 for Qt5
if(${QT_VERSION_MAJOR} EQUAL 5)
set(CMAKE_CXX_STANDARD 11)
endif()
# C++17 for Qt6
if(${QT_VERSION_MAJOR} EQUAL 6)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# OpenImageIO
find_package(OpenImageIO REQUIRED)
if(TARGET OpenImageIO::OpenImageIO)
message(STATUS "OpenImageIO found.")
else()
message(SEND_ERROR "Failed to find OpenImageIO.")
endif()
# Qt
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON) # needed for automoc
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
if(Qt${QT_VERSION_MAJOR}Core_FOUND)
message(STATUS "Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR} found.")
endif()
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_definitions(-DQT_NO_DEBUG)
# comment to get qDebug outputs
add_definitions(-DQT_NO_DEBUG_OUTPUT)
# comment to handle all possible file formats
# by default: jpeg, png and ico are handled by Qt (for performance reasons)
add_definitions(-DQTOIIO_USE_FORMATS_BLACKLIST)
add_subdirectory(src/imageIOHandler)
# TODO: Make it works for Qt6
# Add to Qt5 only for the moment since 3dcore
# is not part of the distribution anymore.
# Source: https://www.kdab.com/qt-3d-changes-in-qt-6/
if(Qt5_FOUND)
add_subdirectory(src/depthMapEntity)
endif()
# add_subdirectory(src/depthMapEntity)