mirror of
https://github.com/plasma-umass/coz.git
synced 2024-09-11 04:55:25 +03:00
Provide default Findlibelfin.cmake if not using Conan
This commit is contained in:
parent
33a2a5a930
commit
f1a7978f82
@ -5,8 +5,9 @@ enable_testing()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CONAN_CMAKE_SILENT_OUTPUT ON)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_BINARY_DIR})
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(libelfin REQUIRED)
|
||||
|
29
cmake/Findlibelfin.cmake
Normal file
29
cmake/Findlibelfin.cmake
Normal file
@ -0,0 +1,29 @@
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(libelfxx REQUIRED libelf++>=0.3)
|
||||
pkg_check_modules(libdwarfxx REQUIRED libdwarf++>=0.3)
|
||||
|
||||
add_library(libelfin::libelf++ INTERFACE IMPORTED)
|
||||
set_target_properties(libelfin::libelf++ PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${libelfxx_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${libelfxx_LDFLAGS}"
|
||||
INTERFACE_COMPILE_OPTIONS "${libelfxx_CFLAGS};${libelfxx_CFLAGS_OTHER}")
|
||||
add_library(libelfin::libdwarf++ INTERFACE IMPORTED)
|
||||
set_target_properties(libelfin::libdwarf++ PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${libdwarfxx_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${libdwarfxx_LDFLAGS}"
|
||||
INTERFACE_COMPILE_OPTIONS "${libdwarfxx_CFLAGS};${libdwarfxx_CFLAGS_OTHER}")
|
||||
|
||||
if(libelfxx_FOUND AND libdwarfxx_FOUND)
|
||||
set(libelfin_FOUND 1)
|
||||
set(libelfin_VERSION ${libelfxx_VERSION})
|
||||
if(NOT TARGET libelfin::libelfin)
|
||||
add_library(libelfin::libelfin INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_target_properties(libelfin::libelfin PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "libelfin::libdwarf++;libelfin::libelf++")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(libelfin
|
||||
REQUIRED_VARS libelfin_VERSION
|
||||
VERSION_VAR libelfin_VERSION)
|
Loading…
Reference in New Issue
Block a user