build(cmake): add install target

This makes dynarmic installable, and also adds a CMake package config
file, that allows projects to use `find_package(dynarmic)` to import the
library.

I know #636 adds the same thing, but while experimenting with the
different install options in
https://github.com/merryhime/dynarmic/pull/636#discussion_r725656034
I ended up with a working patch, so I'm proposing this as well. This
implements solution 2.
This commit is contained in:
Andrea Pappacoda 2021-10-12 10:09:21 +02:00 committed by merry
parent cce7e4ee5d
commit 4dcebc1822
4 changed files with 47 additions and 11 deletions

View file

@ -24,9 +24,7 @@ target_include_directories(mp INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE
# robin-map
if (NOT TARGET tsl::robin_map)
add_library(robin_map INTERFACE)
add_library(tsl::robin_map ALIAS robin_map)
target_include_directories(robin_map SYSTEM INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/robin-map/include>")
add_subdirectory(robin-map)
endif()
# vixl