1 diff --git a/build/cmake/aom_install.cmake b/build/cmake/aom_install.cmake
2 index 0bd2bf035..5cf5acea8 100644
3 --- a/build/cmake/aom_install.cmake
4 +++ b/build/cmake/aom_install.cmake
5 @@ -42,8 +42,8 @@ macro(setup_aom_install_targets)
7 -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
8 -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
9 - -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
10 - -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
11 + -DCMAKE_INSTALL_FULL_INCLUDEDIR=${CMAKE_INSTALL_FULL_INCLUDEDIR}
12 + -DCMAKE_INSTALL_FULL_LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}
13 -DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME}
14 -DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD}
15 -DCONFIG_TUNE_VMAF=${CONFIG_TUNE_VMAF}
16 @@ -84,12 +84,12 @@ macro(setup_aom_install_targets)
17 # Setup the install rules. install() will automatically prepend
18 # CMAKE_INSTALL_PREFIX to relative paths
19 install(FILES ${AOM_INSTALL_INCS}
20 - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aom")
21 + DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/aom")
22 install(FILES "${AOM_PKG_CONFIG_FILE}"
23 - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
24 + DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
25 install(TARGETS ${AOM_INSTALL_LIBS};${AOM_INSTALL_BINS}
26 - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
27 - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
28 - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
29 + RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}"
30 + LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
31 + ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}")
34 diff --git a/build/cmake/pkg_config.cmake b/build/cmake/pkg_config.cmake
35 index e8fff2e77..b8a73aad4 100644
36 --- a/build/cmake/pkg_config.cmake
37 +++ b/build/cmake/pkg_config.cmake
39 cmake_minimum_required(VERSION 3.5)
41 set(REQUIRED_ARGS "AOM_ROOT" "AOM_CONFIG_DIR" "CMAKE_INSTALL_PREFIX"
42 - "CMAKE_INSTALL_BINDIR" "CMAKE_INSTALL_INCLUDEDIR"
43 - "CMAKE_INSTALL_LIBDIR" "CMAKE_PROJECT_NAME"
44 + "CMAKE_INSTALL_BINDIR" "CMAKE_INSTALL_FULL_INCLUDEDIR"
45 + "CMAKE_INSTALL_FULL_LIBDIR" "CMAKE_PROJECT_NAME"
46 "CONFIG_MULTITHREAD" "HAVE_PTHREAD_H")
48 foreach(arg ${REQUIRED_ARGS})
49 @@ -35,15 +35,15 @@ else()
52 # Write pkg-config info.
53 -set(prefix "${CMAKE_INSTALL_PREFIX}")
54 -set(bindir "${CMAKE_INSTALL_BINDIR}")
55 -set(includedir "${CMAKE_INSTALL_INCLUDEDIR}")
56 -set(libdir "${CMAKE_INSTALL_LIBDIR}")
57 +get_filename_component(prefix "${CMAKE_INSTALL_FULL_INCLUDEDIR}" DIRECTORY)
58 +get_filename_component(exec_prefix "${CMAKE_INSTALL_FULL_LIBDIR}" DIRECTORY)
59 +get_filename_component(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}" NAME)
60 +get_filename_component(libdir "${CMAKE_INSTALL_FULL_LIBDIR}" NAME)
61 set(pkgconfig_file "${AOM_CONFIG_DIR}/aom.pc")
62 string(TOLOWER ${CMAKE_PROJECT_NAME} pkg_name)
63 file(WRITE "${pkgconfig_file}" "# libaom pkg-config.\n")
64 file(APPEND "${pkgconfig_file}" "prefix=${prefix}\n")
65 -file(APPEND "${pkgconfig_file}" "exec_prefix=\${prefix}\n")
66 +file(APPEND "${pkgconfig_file}" "exec_prefix=${exec_prefix}\n")
67 file(APPEND "${pkgconfig_file}" "includedir=\${prefix}/${includedir}\n")
68 file(APPEND "${pkgconfig_file}" "libdir=\${exec_prefix}/${libdir}\n\n")
69 file(APPEND "${pkgconfig_file}" "Name: ${pkg_name}\n")