Skip to content

Commit

Permalink
Fix CMP0115 warning and use default DEFAULT_PLUGIN_DIR or accept (#844)
Browse files Browse the repository at this point in the history
- In the new version of CMP0115 policy extension must also be provided,
  there is no version.h in PROJECT_SOURCE_DIRECTORY.
- Accept the DEFAULT_PLUGIN_DIR during CMAKE configure and use default
  value to ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/edb, if not provided.
  • Loading branch information
tbhaxor authored Nov 1, 2023
1 parent 95c34fe commit 64fca61
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ set(edb_SRCS
${PROJECT_SOURCE_DIR}/include/util/Math.h
${PROJECT_SOURCE_DIR}/include/util/String.h
${PROJECT_SOURCE_DIR}/include/util/Error.h
${PROJECT_SOURCE_DIR}/include/version.h
${PROJECT_SOURCE_DIR}/include/version.h.in
)

if(TARGET_ARCH_FAMILY_X86)
Expand Down Expand Up @@ -260,9 +260,11 @@ if(UNIX AND TARGET_ARCH_FAMILY_X86)
endif()
endif()

target_compile_definitions(edb PRIVATE
-DDEFAULT_PLUGIN_PATH=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/edb\"
)
if (NOT DEFINED DEFAULT_PLUGIN_DIR)
message(STATUS "Using default value of EDB Plugin directory")
set(DEFAULT_PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/edb")
endif()
target_compile_definitions(edb PRIVATE -DDEFAULT_PLUGIN_PATH="${DEFAULT_PLUGIN_DIR}")

target_link_libraries(edb
${CAPSTONE_LIBRARIES}
Expand Down

0 comments on commit 64fca61

Please sign in to comment.