Skip to content

Commit

Permalink
Add better support for Yocto/PetaLinux (#360)
Browse files Browse the repository at this point in the history
Added a new option of MAGIC_ENUM_OPT_INSTALL_PACKAGE_XML to allow disabling the package.xml file
  • Loading branch information
ShaharHD authored Jun 9, 2024
1 parent 173f222 commit bf3c74a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()

0 comments on commit bf3c74a

Please sign in to comment.