From 973d43faf1ed37c7029f6465b3e1c9ef32b89828 Mon Sep 17 00:00:00 2001 From: Daniel Bermond Date: Fri, 18 Dec 2020 14:30:29 +0000 Subject: [PATCH] Fix install when using a separated build directory This fixes the following error at 'make install' time when using a separated build directory (out-of-tree build): CMake Error at cmake_install.cmake:50 (file): file INSTALL cannot find "/build/libilbc/src/libilbc/ilbc_export.h": No such file or directory. make: *** [Makefile:105: install] Error 1 make: Leaving directory '/build/libilbc/src/build' How to reproduce: $ git clone --recursive https://github.com/TimothyGu/libilbc.git $ cmake -B build -S libilbc $ make -C build $ make -C build install Fixes #28 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 045f05bf20..aa8fd19083 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,7 +323,7 @@ add_custom_target(ilbc_test-sample install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libilbc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -install(FILES ilbc.h ilbc_export.h +install(FILES ilbc.h ${CMAKE_CURRENT_BINARY_DIR}/ilbc_export.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(FILES CONTRIBUTING.md NEWS.md README.md DESTINATION ${CMAKE_INSTALL_DOCDIR})