mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
By default search r2 in /usr/local used by sys/install.sh. (#2128)
This commit is contained in:
parent
7110d73979
commit
55d4ee3ce4
@ -12,6 +12,8 @@ include(CutterInstallDirs)
|
||||
set(CUTTER_PYTHON_MIN 3.5)
|
||||
|
||||
option(CUTTER_USE_BUNDLED_RADARE2 "Use radare2 from src/radare2 submodule instead of searching for it on the system" OFF)
|
||||
option(CUTTER_USE_ADDITIONAL_RADARE2_PATHS "Search radare2 in additional paths which are not part of default system library paths.\
|
||||
Disable this option if you are linking against radare2 pacakged as proper system library or in a custom path and additional are paths causing problems." ON)
|
||||
option(CUTTER_ENABLE_PYTHON "Enable Python integration. Requires Python >= ${CUTTER_PYTHON_MIN}." OFF)
|
||||
option(CUTTER_ENABLE_PYTHON_BINDINGS "Enable generating Python bindings with Shiboken2. Unused if CUTTER_ENABLE_PYTHON=OFF." OFF)
|
||||
option(CUTTER_ENABLE_CRASH_REPORTS "Enable crash report system. Unused if CUTTER_ENABLE_CRASH_REPORTS=OFF" OFF)
|
||||
|
@ -72,9 +72,12 @@ if(WIN32)
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Radare2_INCLUDE_DIRS}")
|
||||
set(Radare2_TARGET Radare2::libr)
|
||||
else()
|
||||
# support sys/user.sh install
|
||||
set(Radare2_CMAKE_PREFIX_PATH_TEMP ${CMAKE_PREFIX_PATH})
|
||||
list(APPEND CMAKE_PREFIX_PATH "$ENV{HOME}/bin/prefix/radare2")
|
||||
# support installation locations used by r2 scripts like sys/user.sh and sys/install.sh
|
||||
if(CUTTER_USE_ADDITIONAL_RADARE2_PATHS)
|
||||
set(Radare2_CMAKE_PREFIX_PATH_TEMP ${CMAKE_PREFIX_PATH})
|
||||
list(APPEND CMAKE_PREFIX_PATH "$ENV{HOME}/bin/prefix/radare2") # sys/user.sh
|
||||
list(APPEND CMAKE_PREFIX_PATH "/usr/local") # sys/install.sh
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
if(CMAKE_VERSION VERSION_LESS "3.6")
|
||||
@ -84,7 +87,9 @@ else()
|
||||
endif()
|
||||
|
||||
# reset CMAKE_PREFIX_PATH
|
||||
set(CMAKE_PREFIX_PATH ${Radare2_CMAKE_PREFIX_PATH_TEMP})
|
||||
if(CUTTER_USE_ADDITIONAL_RADARE2_PATHS)
|
||||
set(CMAKE_PREFIX_PATH ${Radare2_CMAKE_PREFIX_PATH_TEMP})
|
||||
endif()
|
||||
|
||||
if((TARGET PkgConfig::Radare2) AND (NOT CMAKE_VERSION VERSION_LESS "3.11.0"))
|
||||
set_target_properties(PkgConfig::Radare2 PROPERTIES IMPORTED_GLOBAL ON)
|
||||
|
Loading…
Reference in New Issue
Block a user