From 97f75a0b067a0f22b22af3df84e8e0e8f46fff97 Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Wed, 25 Oct 2023 13:58:36 +0200 Subject: [PATCH] build: do not install bundled Rizin in separate prefix --- cmake/BundledRizin.cmake | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cmake/BundledRizin.cmake b/cmake/BundledRizin.cmake index 1c030690..748addd5 100644 --- a/cmake/BundledRizin.cmake +++ b/cmake/BundledRizin.cmake @@ -8,10 +8,10 @@ if(WIN32) set(RIZIN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/$") endif() set(RIZIN_INSTALL_BINPATH ".") - set(MESON_OPTIONS "--prefix=${RIZIN_INSTALL_DIR}" "--bindir=${RIZIN_INSTALL_BINPATH}") + set(MESON_OPTIONS "--prefix=${CMAKE_INSTALL_PREFIX}" "--bindir=${RIZIN_INSTALL_BINPATH}") else() set(RIZIN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/Rizin-prefix") - set(MESON_OPTIONS "--prefix=${RIZIN_INSTALL_DIR}" --libdir=lib) + set(MESON_OPTIONS "--prefix=${CMAKE_INSTALL_PREFIX}" --libdir=lib) endif() if (CUTTER_ENABLE_PACKAGING) @@ -39,20 +39,20 @@ endif() ExternalProject_Add(Rizin-Bundled SOURCE_DIR "${RIZIN_SOURCE_DIR}" CONFIGURE_COMMAND "${MESON}" "" ${MESON_OPTIONS} && "${MESON}" configure ${MESON_OPTIONS} --buildtype "$<$:debug>$<$>:release>" - BUILD_COMMAND "${NINJA}" + BUILD_COMMAND "${NINJA}" && "DESTDIR=${RIZIN_INSTALL_DIR}" "${NINJA}" install BUILD_ALWAYS TRUE - INSTALL_COMMAND "${NINJA}" install) + INSTALL_COMMAND cmake -E echo "Skipping install step for Rizin-Bundled") -set(Rizin_INCLUDE_DIRS "${RIZIN_INSTALL_DIR}/include/librz" "${RIZIN_INSTALL_DIR}/include/librz/sdb") +set(Rizin_INCLUDE_DIRS "${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/include/librz" "${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/include/librz/sdb") add_library(Rizin INTERFACE) add_dependencies(Rizin Rizin-Bundled) if(NOT (${CMAKE_VERSION} VERSION_LESS "3.13.0")) target_link_directories(Rizin INTERFACE - $ + $ $) else() - link_directories("${RIZIN_INSTALL_DIR}/lib") + link_directories("${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/lib") endif() # TODO: This version number should be fetched automatically @@ -76,17 +76,17 @@ target_include_directories(Rizin INTERFACE install(TARGETS Rizin EXPORT CutterTargets) if (WIN32) foreach(_lib ${RZ_LIBS} ${RZ_EXTRA_LIBS}) - install(FILES "${RIZIN_INSTALL_DIR}/${_lib}-${Rizin_VERSION}.dll" DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(FILES "${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/${_lib}-${Rizin_VERSION}.dll" DESTINATION "${CMAKE_INSTALL_BINDIR}") endforeach() foreach(_exe ${RZ_BIN}) - install(FILES "${RIZIN_INSTALL_DIR}/${_exe}.exe" DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(FILES "${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/${_exe}.exe" DESTINATION "${CMAKE_INSTALL_BINDIR}") endforeach() - install(DIRECTORY "${RIZIN_INSTALL_DIR}/share" DESTINATION ".") - install(DIRECTORY "${RIZIN_INSTALL_DIR}/include" DESTINATION "." + install(DIRECTORY "${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/share" DESTINATION ".") + install(DIRECTORY "${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/include" DESTINATION "." COMPONENT Devel) - install(DIRECTORY "${RIZIN_INSTALL_DIR}/lib" DESTINATION "." + install(DIRECTORY "${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/lib" DESTINATION "." COMPONENT Devel PATTERN "*.pdb" EXCLUDE) else () - install(DIRECTORY "${RIZIN_INSTALL_DIR}/" DESTINATION "." USE_SOURCE_PERMISSIONS) + install(DIRECTORY "${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/" DESTINATION "." USE_SOURCE_PERMISSIONS) endif()