1 Star 1 Fork 1

user_5888/magic_enum

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
Daniil Goncharov 提交于 2022-08-10 14:53 . update ci (#205)
cmake_minimum_required(VERSION 3.14)
project(magic_enum VERSION "0.8.1" LANGUAGES CXX)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(IS_TOPLEVEL_PROJECT TRUE)
else()
set(IS_TOPLEVEL_PROJECT FALSE)
endif()
option(MAGIC_ENUM_OPT_ENABLE_NONASCII "Enable support for non-ASCII enumeration identifier" OFF)
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})
if(MAGIC_ENUM_OPT_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
if(MAGIC_ENUM_OPT_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
include(CMakePackageConfigHelpers)
add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME}
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
ARCH_INDEPENDENT)
if(MAGIC_ENUM_OPT_INSTALL)
include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Config)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION lib/cmake/${PROJECT_NAME})
install(EXPORT ${PROJECT_NAME}Config
NAMESPACE ${PROJECT_NAME}::
DESTINATION lib/cmake/${PROJECT_NAME})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include
DESTINATION .)
export(EXPORT ${PROJECT_NAME}Config
NAMESPACE ${PROJECT_NAME}::)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/package.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME})
endif()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/umu618/magic_enum.git
git@gitee.com:umu618/magic_enum.git
umu618
magic_enum
magic_enum
master

搜索帮助