Implemented dependency collection via CPM.cmake

This commit is contained in:
spectranator
2025-04-12 04:09:50 +02:00
parent 7c17d72b1a
commit 977ed0063a
6 changed files with 1419 additions and 35 deletions

View File

@@ -185,7 +185,13 @@ endif()
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
install(TARGETS dynarmic EXPORT dynarmicTargets)
# Hack to get CPM.cmake working with this (should be fine though)
set(BOOST_TARGET )
if (TARGET boost_headers)
set(BOOST_TARGET boost_headers)
endif()
install(TARGETS dynarmic ${BOOST_TARGET} EXPORT dynarmicTargets)
install(EXPORT dynarmicTargets
NAMESPACE dynarmic::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dynarmic"

View File

@@ -503,11 +503,22 @@ set_target_properties(dynarmic PROPERTIES
target_compile_options(dynarmic PRIVATE ${DYNARMIC_CXX_FLAGS})
target_link_libraries(dynarmic
PRIVATE
Boost::boost
fmt::fmt
merry::mcl
tsl::robin_map
)
if (TARGET boost_headers)
target_link_libraries(dynarmic
PRIVATE
boost_headers
)
else()
target_link_libraries(dynarmic
PRIVATE
Boost::boost
)
endif()
if (DYNARMIC_USE_LLVM)
target_include_directories(dynarmic PRIVATE ${LLVM_INCLUDE_DIRS})
target_compile_definitions(dynarmic PRIVATE DYNARMIC_USE_LLVM=1 ${LLVM_DEFINITIONS})