Further cmake changes.

Add namespacing to elf find module.

Stop using CMAKE_CXX_FLAGS and start using target properties for this.

Ideally we should remove the actual option strings and replace with cmake
compiler properties or compile features.

Change-Id: I57756387b3bd3c565c99a35fed4b37fe1a2d0556
This commit is contained in:
Sean Keely
2020-06-04 19:36:14 -05:00
parent 55a4f01b16
commit 9ff0268f4c
3 changed files with 42 additions and 52 deletions
@@ -63,7 +63,7 @@ int main() {
mark_as_advanced(LIBELF_INCLUDE_DIRS LIBELF_LIBRARIES ELF_GETSHDRSTRNDX)
if(LIBELF_FOUND)
add_library(elf UNKNOWN IMPORTED)
set_property(TARGET elf PROPERTY IMPORTED_LOCATION ${LIBELF_LIBRARIES})
set_property(TARGET elf PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LIBELF_INCLUDE_DIRS})
add_library(elf::elf UNKNOWN IMPORTED)
set_property(TARGET elf::elf PROPERTY IMPORTED_LOCATION ${LIBELF_LIBRARIES})
set_property(TARGET elf::elf PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LIBELF_INCLUDE_DIRS})
endif()