Skip to content

Instantly share code, notes, and snippets.

@theoremoon
Created June 14, 2020 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theoremoon/b143c34dec32d9acef10b37a1e1156b0 to your computer and use it in GitHub Desktop.
Save theoremoon/b143c34dec32d9acef10b37a1e1156b0 to your computer and use it in GitHub Desktop.

avast/retdec をcloneしてきてビルドした後、retdec::deps::eigen が見つからないといってretdecを用いたプログラムのコンパイルに失敗した時の対処

diff --git a/deps/eigen/CMakeLists.txt b/deps/eigen/CMakeLists.txt
index 7d92d1b1..f8f3385b 100644
--- a/deps/eigen/CMakeLists.txt
+++ b/deps/eigen/CMakeLists.txt
@@ -39,3 +39,21 @@ install(EXPORT eigen-targets
NAMESPACE retdec::deps::
DESTINATION ${RETDEC_INSTALL_CMAKE_DIR}
)
+
+# Configure config file.
+set(EIGEN_LIB_INSTALLED "${RETDEC_INSTALL_LIB_DIR_ABS}/${EIGEN_LIB_PNAME}")
+configure_package_config_file(
+ "retdec-eigen-config.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/retdec-eigen-config.cmake"
+ INSTALL_DESTINATION ${RETDEC_INSTALL_CMAKE_DIR}
+ PATH_VARS
+ EIGEN_LIB_INSTALLED
+)
+
+# Install CMake files.
+install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/retdec-eigen-config.cmake"
+ DESTINATION
+ "${RETDEC_INSTALL_CMAKE_DIR}"
+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment