-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
105 lines (93 loc) · 2.6 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.22)
project(
toucan
VERSION 0.1.0
DESCRIPTION "toucan"
HOMEPAGE_URL "https://github.com/OpenTimelineIO/toucan"
LANGUAGES CXX C)
set(toucan_VIEW ON CACHE BOOL "Build viewer application")
list(PREPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(NOT BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS OFF)
endif()
if(NOT CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>DLL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
endif()
if(APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_IGNORE_PREFIX_PATH /opt/homebrew)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(WIN32)
elseif(APPLE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
else()
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "../lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
set(TOUCAN_PLUGINS
toucanColorSpace
toucanDraw
toucanFilter
toucanGenerator
toucanTransform
toucanTransition)
enable_testing()
find_package(Imath)
find_package(Freetype)
find_package(ZLIB)
find_package(PNG)
find_package(JPEG)
find_package(TIFF)
find_package(OpenEXR)
find_package(minizip)
find_package(OpenColorIO)
find_package(OpenImageIO)
find_package(OTIO)
find_package(OpenFX)
if(toucan_VIEW)
find_package(lunasvg)
find_package(dtk)
endif()
include_directories(lib)
include_directories(tests)
# \todo OpenTimelineIO doesn't use the "Imath" prefix for includes?
include_directories(${CMAKE_INSTALL_PREFIX}/include/Imath)
add_subdirectory(lib)
add_subdirectory(plugins)
add_subdirectory(bin)
add_subdirectory(tests)
install(
FILES cmake/FindOpenFX.cmake
DESTINATION lib/cmake/toucan)
install(
FILES cmake/FindOTIO.cmake
DESTINATION lib/cmake/toucan)
include(CMakePackageConfigHelpers)
set(INCLUDE_INSTALL_DIR include/toucan)
configure_package_config_file(
toucanConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/toucanConfig.cmake
INSTALL_DESTINATION lib/cmake/toucan
PATH_VARS INCLUDE_INSTALL_DIR)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/toucanConfig.cmake
DESTINATION lib/cmake/toucan)
if(CMAKE_BUILD_TYPE MATCHES "^Release$")
include(Package)
include(CPack)
include(InstallRequiredSystemLibraries)
endif()