forked from qubecinema/CTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.cmake
executable file
·97 lines (80 loc) · 4.33 KB
/
configure.cmake
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
# Until we get some of these modules into the upstream packages, put them here
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/CMake")
find_package( PkgConfig QUIET )
find_package( IlmBase QUIET )
if( IlmBase_FOUND )
message( STATUS "found IlmBase, version ${IlmBase_VERSION}" )
###
### Everyone (well, except for DPX) uses IlmBase, so
### make that a global setting
###
include_directories( ${IlmBase_INCLUDE_DIRS} )
link_directories( ${IlmBase_LIBRARY_DIRS} )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IlmBase_CFLAGS}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IlmBase_CFLAGS}" )
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${IlmBase_LDFLAGS}" )
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${IlmBase_LDFLAGS}" )
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${IlmBase_LDFLAGS}" )
else()
message( STATUS "IlmBase will be acquired" )
set(IlmBase_SRC_PATH ${PROJECT_SOURCE_DIR}/deps/openexr/IlmBase)
set(IlmBase_BUILD_PATH ${CMAKE_BINARY_DIR}/deps/openexr/IlmBase)
add_subdirectory(${IlmBase_SRC_PATH} ${IlmBase_BUILD_PATH})
set(IlmBase_FOUND TRUE)
set(IlmBase_INCLUDE_DIR ${IlmBase_BUILD_PATH}/config/
${IlmBase_SRC_PATH}/Imath/
${IlmBase_SRC_PATH}/Half/
${IlmBase_SRC_PATH}/Iex/
${IlmBase_SRC_PATH}/IexMath/
${IlmBase_SRC_PATH}/IlmThread/
${IlmBase_SRC_PATH}/Imath/
CACHE PATHS "IlmBase_INCLUDE_DIR" FORCE)
set(IlmBase_INCLUDE_DIRS ${IlmBase_INCLUDE_DIR} CACHE PATH "IlmBase include dirs" FORCE)
set(IlmBase_LIBRARY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}Half${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}Iex-2_2${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}IexMath-2_2${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}IlmThread-2_2${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}Imath-2_2${CMAKE_STATIC_LIBRARY_SUFFIX}
CACHE FILEPATH "IlmBase LIBRARY" FORCE)
set(IlmBase_LIBRARIES ${IlmBase_LIBRARY} CACHE FILEPATH "IlmBase LIBRARIES" FORCE)
set(IlmBase_LIBRARY_DIRS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} CACHE PATHS "IlmBase LIBRARY DIRS" FORCE)
endif()
find_package( TIFF QUIET )
if ( TIFF_FOUND )
message( STATUS "found TIFF, version ${TIFF_VERSION_STRING}" )
# Make the variables the same as if pkg-config finds them
set(TIFF_INCLUDE_DIRS ${TIFF_INCLUDE_DIR})
get_filename_component(TIFF_LIBRARY_DIR ${TIFF_LIBRARIES} DIRECTORY)
else()
if ( PKG_CONFIG_FOUND )
pkg_search_module( TIFF libtiff libtiff-4 )
if ( TIFF_FOUND )
message( STATUS "found TIFF via pkg-config, version ${TIFF_VERSION}" )
endif()
else()
message( WARNING "Unable to find TIFF libraries, disabling" )
endif()
endif()
find_package( OpenEXR QUIET )
if ( OpenEXR_FOUND )
message( STATUS "Found OpenEXR, version ${OpenEXR_VERSION}" )
else()
message( WARNING "Unable to find OpenEXR libraries, disabling" )
endif()
if(NOT WIN32)
message( STATUS "AcesContainer will be acquired" )
set(AcesContainer_SRC_PATH ${PROJECT_SOURCE_DIR}/deps/aces_container)
set(AcesContainer_BUILD_PATH ${CMAKE_BINARY_DIR}/deps/aces_container)
add_subdirectory(${AcesContainer_SRC_PATH} ${AcesContainer_BUILD_PATH})
set(AcesContainer_FOUND TRUE)
set(AcesContainer_INCLUDE_DIRS ${AcesContainer_SRC_PATH} CACHE PATH "AcesContainer include dirs" FORCE)
set(AcesContainer_LIBRARY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}AcesContainer${CMAKE_SHARED_LIBRARY_SUFFIX}
CACHE FILEPATH "AcesContainer LIBRARY" FORCE)
set(AcesContainer_LIBRARIES ${AcesContainer_LIBRARY} CACHE FILEPATH "AcesContainer LIBRARIES" FORCE)
set(AcesContainer_LIBRARY_DIRS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} CACHE PATHS "AcesContainer LIBRARY DIRS" FORCE)
elseif( PKG_CONFIG_FOUND )
pkg_check_modules( AcesContainer AcesContainer )
else()
message( WARNING "Unable to find AcesContainer libraries, disabling" )
endif()