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

Add MAGIC_ENUM_OPT_INSTALL option in CMakeLists.txt (#54)

This option allows to skip install target which can be useful when
vendoring magic_enum.

Co-authored-by: Gary Marigliano <gary.marigliano@ecorobotix.com>
This commit is contained in:
Gary MARIGLIANO 2020-09-24 15:55:57 +02:00 committed by GitHub
parent 4813c04927
commit 7063621bce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,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" ON)
if(MAGIC_ENUM_OPT_BUILD_EXAMPLES)
add_subdirectory(example)
@ -33,6 +34,7 @@ write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion)
if(MAGIC_ENUM_OPT_INSTALL)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Config)
@ -45,3 +47,4 @@ install(EXPORT ${PROJECT_NAME}Config
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include
DESTINATION .)
endif()