serge1 / ELFIO

ELFIO - ELF (Executable and Linkable Format) reader and producer implemented as a header only C++ library
http://serge1.github.io/ELFIO
MIT License
729 stars 158 forks source link

Add cmake install support #50

Closed schultetwin1 closed 3 years ago

schultetwin1 commented 3 years ago

This change adds an install step to the CMake build system. This will allow other users of CMake to easily integrate ELFIO with their projects without any extra work. This is also the first step to be able to distribute ELFIO via vcpkg.

The benefit of this is, after building using CMake and then running make install with ELFIO users of CMake can then use the following CMake to easily pull in ELFIO.

find_package(elfio REQUIRED)

add_executable(my_example_exe ....)
target_link_libraries(my_example_exe PRIVATE elfio::elfio)

List of changes

schultetwin1 commented 3 years ago

@serge1 if you aren't interested in this change feel free to close it. My main goal is to be able to include ELFIO as a package in vcpkg to make it easier for downstream consumers to use ELFIO.

serge1 commented 3 years ago

Thank you for your submission! I will look at it soon

serge1 commented 3 years ago

Hi Matt, I definetly accept your changes - they are very beneficial for the library. Thank you!

When using GNU make generator, do you know what should be configured to have 'make check' working together (or instead of) 'make test'?

schultetwin1 commented 3 years ago

Hi Matt, I definetly accept your changes - they are very beneficial for the library. Thank you!

When using GNU make generator, do you know what should be configured to have 'make check' working together (or instead of) 'make test'?

I do! I just created #51 to do that