magic_enum/example/CMakeLists.txt
manual set(MAGIC_ENUM_OPT_BUILD_EXAMPLES ON)
target_link_libraries(${target} PRIVATE ${CMAKE_PROJECT_NAME})
target_link_libraries(${target} PRIVATE ${PROJECT_NAME}) ?
Sorry, I didn't quite understand the question.
an error occurs when I manually set the "set(MAGIC_ENUM_OPT_BUILD_EXAMPLES ON)"
[build] /home/cyc/self/ayaoho/3rdparty/magic_enum/example/example_custom_name.cpp:25:10: fatal error: magic_enum.hpp: No such file or directory [build] 25 | #include <magic_enum.hpp> [build] | ^~~~~~~~~~~~~~~~ [build] /home/cyc/self/ayaoho/3rdparty/magic_enum/example/enum_flag_example.cpp:26:10: fatal error: magic_enum.hpp: No such file or directory [build] 26 | #include <magic_enum.hpp> [build] | ^~~~~~~~~~~~~~~~
this is my magic_enum.cmake:
set(git_name magic_enum)
include(FetchContent)
FetchContent_Declare( ${git_name} SOURCE_DIR ${third_party_path}/${git_name} GIT_REPOSITORY https://${git_proxy}/Neargye/${git_name}.git GIT_TAG v0.8.0 )
set(MAGIC_ENUM_OPT_BUILD_EXAMPLES ON)
FetchContent_MakeAvailable(${git_name})
unset(git_name)