1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

Add better support for Yocto/PetaLinux (#360)

Added a new option of MAGIC_ENUM_OPT_INSTALL_PACKAGE_XML to allow disabling the package.xml file
This commit is contained in:
Shahar Hadas 2024-06-09 23:06:15 +03:00 committed by GitHub
parent 173f22250c
commit bf3c74ab7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,6 +22,7 @@ endif()
option(MAGIC_ENUM_OPT_BUILD_EXAMPLES "Build magic_enum examples" ${IS_TOPLEVEL_PROJECT})
option(MAGIC_ENUM_OPT_BUILD_TESTS "Build and perform magic_enum tests" ${IS_TOPLEVEL_PROJECT})
option(MAGIC_ENUM_OPT_INSTALL "Generate and install magic_enum target" ${IS_TOPLEVEL_PROJECT})
option(MAGIC_ENUM_OPT_INSTALL_PACKAGE_XML "Include package.xml when installing" ${MAGIC_ENUM_OPT_INSTALL})
if(MAGIC_ENUM_OPT_BUILD_EXAMPLES)
add_subdirectory(example)
@ -121,7 +122,10 @@ if(MAGIC_ENUM_OPT_INSTALL)
INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/package.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME})
if (MAGIC_ENUM_OPT_INSTALL_PACKAGE_XML)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/package.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME})
endif()
include(CPack)
endif()