jpayne@68: # Set these variables so that the `${prefix}/lib` expands to something we can jpayne@68: # remove. jpayne@68: set(_harfbuzz_remove_string "REMOVE_ME") jpayne@68: set(exec_prefix "${_harfbuzz_remove_string}") jpayne@68: set(prefix "${_harfbuzz_remove_string}") jpayne@68: jpayne@68: # Compute the installation prefix by stripping components from our current jpayne@68: # location. jpayne@68: get_filename_component(_harfbuzz_prefix "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) jpayne@68: get_filename_component(_harfbuzz_prefix "${_harfbuzz_prefix}" DIRECTORY) jpayne@68: set(_harfbuzz_libdir "${prefix}/lib") jpayne@68: string(REPLACE "${_harfbuzz_remove_string}/" "" _harfbuzz_libdir "${_harfbuzz_libdir}") jpayne@68: set(_harfbuzz_libdir_iter "${_harfbuzz_libdir}") jpayne@68: while (_harfbuzz_libdir_iter) jpayne@68: set(_harfbuzz_libdir_prev_iter "${_harfbuzz_libdir_iter}") jpayne@68: get_filename_component(_harfbuzz_libdir_iter "${_harfbuzz_libdir_iter}" DIRECTORY) jpayne@68: if (_harfbuzz_libdir_prev_iter STREQUAL _harfbuzz_libdir_iter) jpayne@68: break() jpayne@68: endif () jpayne@68: get_filename_component(_harfbuzz_prefix "${_harfbuzz_prefix}" DIRECTORY) jpayne@68: endwhile () jpayne@68: unset(_harfbuzz_libdir_iter) jpayne@68: jpayne@68: # Get the include subdir. jpayne@68: set(_harfbuzz_includedir "${prefix}/include") jpayne@68: string(REPLACE "${_harfbuzz_remove_string}/" "" _harfbuzz_includedir "${_harfbuzz_includedir}") jpayne@68: jpayne@68: # Extract version information from libtool. jpayne@68: set(_harfbuzz_version_info "20702:0:20702") jpayne@68: string(REPLACE ":" ";" _harfbuzz_version_info "${_harfbuzz_version_info}") jpayne@68: list(GET _harfbuzz_version_info 0 jpayne@68: _harfbuzz_current) jpayne@68: list(GET _harfbuzz_version_info 1 jpayne@68: _harfbuzz_revision) jpayne@68: list(GET _harfbuzz_version_info 2 jpayne@68: _harfbuzz_age) jpayne@68: unset(_harfbuzz_version_info) jpayne@68: jpayne@68: if (APPLE) jpayne@68: set(_harfbuzz_lib_suffix ".0${CMAKE_SHARED_LIBRARY_SUFFIX}") jpayne@68: elseif (UNIX) jpayne@68: set(_harfbuzz_lib_suffix "${CMAKE_SHARED_LIBRARY_SUFFIX}.0.${_harfbuzz_current}.${_harfbuzz_revision}") jpayne@68: else () jpayne@68: # Unsupported. jpayne@68: set(harfbuzz_FOUND 0) jpayne@68: endif () jpayne@68: jpayne@68: # Add the libraries. jpayne@68: add_library(harfbuzz::harfbuzz SHARED IMPORTED) jpayne@68: set_target_properties(harfbuzz::harfbuzz PROPERTIES jpayne@68: INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_prefix}/${_harfbuzz_includedir}/harfbuzz" jpayne@68: IMPORTED_LOCATION "${_harfbuzz_prefix}/${_harfbuzz_libdir}/libharfbuzz${_harfbuzz_lib_suffix}") jpayne@68: jpayne@68: add_library(harfbuzz::icu SHARED IMPORTED) jpayne@68: set_target_properties(harfbuzz::icu PROPERTIES jpayne@68: INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_prefix}/${_harfbuzz_includedir}/harfbuzz" jpayne@68: INTERFACE_LINK_LIBRARIES "harfbuzz::harfbuzz" jpayne@68: IMPORTED_LOCATION "${_harfbuzz_prefix}/${_harfbuzz_libdir}/libharfbuzz-icu${_harfbuzz_lib_suffix}") jpayne@68: jpayne@68: add_library(harfbuzz::subset SHARED IMPORTED) jpayne@68: set_target_properties(harfbuzz::subset PROPERTIES jpayne@68: INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_prefix}/${_harfbuzz_includedir}/harfbuzz" jpayne@68: INTERFACE_LINK_LIBRARIES "harfbuzz::harfbuzz" jpayne@68: IMPORTED_LOCATION "${_harfbuzz_prefix}/${_harfbuzz_libdir}/libharfbuzz-subset${_harfbuzz_lib_suffix}") jpayne@68: jpayne@68: # Only add the gobject library if it was built. jpayne@68: set(_harfbuzz_have_gobject "true") jpayne@68: if (_harfbuzz_have_gobject) jpayne@68: add_library(harfbuzz::gobject SHARED IMPORTED) jpayne@68: set_target_properties(harfbuzz::gobject PROPERTIES jpayne@68: INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_prefix}/${_harfbuzz_includedir}/harfbuzz" jpayne@68: INTERFACE_LINK_LIBRARIES "harfbuzz::harfbuzz" jpayne@68: IMPORTED_LOCATION "${_harfbuzz_prefix}/${_harfbuzz_libdir}/libharfbuzz-gobject${_harfbuzz_lib_suffix}") jpayne@68: endif () jpayne@68: jpayne@68: # Clean out variables we used in our scope. jpayne@68: unset(_harfbuzz_lib_suffix) jpayne@68: unset(_harfbuzz_current) jpayne@68: unset(_harfbuzz_revision) jpayne@68: unset(_harfbuzz_age) jpayne@68: unset(_harfbuzz_includedir) jpayne@68: unset(_harfbuzz_libdir) jpayne@68: unset(_harfbuzz_prefix) jpayne@68: unset(exec_prefix) jpayne@68: unset(prefix) jpayne@68: unset(_harfbuzz_remove_string)