Lines 202-216
if(USE_EXTERNAL_YAML)
Link Here
|
202 |
# Set minimum yaml version for non-patched sources. |
202 |
# Set minimum yaml version for non-patched sources. |
203 |
set(YAML_VERSION_MIN "0.3.0") |
203 |
set(YAML_VERSION_MIN "0.3.0") |
204 |
include(FindPkgConfig) |
204 |
include(FindPkgConfig) |
205 |
pkg_check_modules(YAML_CPP yaml-cpp) |
205 |
pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) |
|
|
206 |
find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h |
207 |
HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} ) |
208 |
find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp |
209 |
HINTS ${PC_YAML_CPP_LIBRARY_DIRS} ) |
210 |
set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY}) |
211 |
set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) |
212 |
set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION}) |
213 |
|
214 |
if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN}) |
215 |
message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.") |
216 |
endif() |
217 |
|
218 |
find_package_handle_standard_args(yaml-cpp |
219 |
REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS ) |
220 |
set(YAML_CPP_FOUND ${YAML-CPP_FOUND}) |
221 |
mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND) |
222 |
|
206 |
if(YAML_CPP_FOUND) |
223 |
if(YAML_CPP_FOUND) |
207 |
if(YAML_CPP_VERSION VERSION_EQUAL ${YAML_VERSION_MIN} OR |
224 |
if(YAML_CPP_VERSION VERSION_GREATER "0.5.0") |
208 |
YAML_CPP_VERSION VERSION_GREATER ${YAML_VERSION_MIN}) |
225 |
# Need to also get the boost headers here, as yaml-cpp 0.5.0+ requires them. |
209 |
message(STATUS "System yaml-cpp library will be used.") |
226 |
# Don't bother doing this step if we are already including the boost headers for shared_ptr |
210 |
include_directories(BEFORE ${YAML_CPP_INCLUDE_DIRS}) |
227 |
if(NOT OCIO_USE_BOOST_PTR) |
211 |
else() |
228 |
set(Boost_ADDITIONAL_VERSIONS "1.49" "1.45" "1.44" "1.43" "1.43.0" "1.42" |
212 |
message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.") |
229 |
"1.42.0" "1.41" "1.41.0" "1.40" |
|
|
230 |
"1.40.0" "1.39" "1.39.0" "1.38" |
231 |
"1.38.0" "1.37" "1.37.0" "1.34.1" |
232 |
"1_34_1") |
233 |
set(Boost_USE_MULTITHREADED ON) |
234 |
find_package(Boost 1.34) |
235 |
if(NOT Boost_FOUND) |
236 |
message(FATAL_ERROR "Error: Detected system yaml-cpp version ${YAML_CPP_VERSION} is greater than 0.5.0, and therefore requires boost, but a boost installation could not be found.") |
237 |
endif() |
238 |
|
239 |
set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}) |
240 |
endif() |
213 |
endif() |
241 |
endif() |
|
|
242 |
set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${YAML_CPP_INCLUDE_DIRS}) |
214 |
else(YAML_CPP_FOUND) |
243 |
else(YAML_CPP_FOUND) |
215 |
message(FATAL_ERROR "ERROR: System yaml-cpp library was not found. Make sure the library is installed and the pkg-config file exists.") |
244 |
message(FATAL_ERROR "ERROR: System yaml-cpp library was not found. Make sure the library is installed and the pkg-config file exists.") |
216 |
endif(YAML_CPP_FOUND) |
245 |
endif(YAML_CPP_FOUND) |