Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: do not install bundled Rizin in separate prefix #3254

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions cmake/BundledRizin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if(WIN32)
set(RIZIN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
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)
Expand Down Expand Up @@ -39,20 +39,20 @@ endif()
ExternalProject_Add(Rizin-Bundled
SOURCE_DIR "${RIZIN_SOURCE_DIR}"
CONFIGURE_COMMAND "${MESON}" "<SOURCE_DIR>" ${MESON_OPTIONS} && "${MESON}" configure ${MESON_OPTIONS} --buildtype "$<$<CONFIG:Debug>:debug>$<$<NOT:$<CONFIG:Debug>>:release>"
BUILD_COMMAND "${NINJA}"
BUILD_COMMAND "${NINJA}" && "DESTDIR=${RIZIN_INSTALL_DIR}" "${NINJA}" install
Copy link
Member

@ITAYC0HEN ITAYC0HEN Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't work on Windows (with this syntax)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I need to fix it. I guess there's a BUILD_ENV or something in Cmake, i need to check doc.

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
$<BUILD_INTERFACE:${RIZIN_INSTALL_DIR}/lib>
$<BUILD_INTERFACE:${RIZIN_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/lib>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}>)
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
Expand All @@ -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()
Loading