Skip to content

Commit

Permalink
Preserve user's module path when looking for Dyninst modules
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Dec 22, 2022
1 parent ef3c267 commit 27cce4f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/DyninstConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
# DYNINST_INCLUDE_DIRS
# DYNINST_INTERNAL_DEFINES - used by the test suite

# Find Dyninst-provided third-party library modules without tainting the user's paths
set(_DYNINST_module_path_save "${CMAKE_MODULE_PATH}")
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/Modules" "${CMAKE_CURRENT_LIST_DIR}/tpls")

include(DyninstTBB)
include(DyninstBoost)
include(DyninstElfUtils)
include(DyninstLibIberty)

# compute paths
set(CMAKE_MODULE_PATH ${_DYNINST_module_path_save})
unset(_DYNINST_module_path_save)

get_filename_component(DYNINST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(DYNINST_INCLUDE_DIR @CONF_INCLUDE_DIRS@)
Expand Down

0 comments on commit 27cce4f

Please sign in to comment.