1 Star 0 Fork 0

george123456/Optional

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
TheAssassin 提交于 2017-10-08 00:33 . Fix include directories
# if CMAKE_VERSION >= 3.0 this project installs an INTERFACE target for
# the optional.hpp file.
#
# Usage:
#
# In your project's CMakeLists.txt:
#
# find_package(akrzemi1_optional REQUIRED)
# ...
# target_link_libraries(mytarget ... akrzemi1::optional ...)
#
# In your C++ source file:
#
# #include "akrzemi1/optional.hpp"
#
project(optional)
cmake_minimum_required(VERSION 2.8)
enable_testing()
if(CMAKE_VERSION VERSION_LESS 3.1)
set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(NOT CMAKE_CXX_STANDARD) # don't override c++ standard if already set
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
# if CMAKE_VERSION >= 3.0
if(NOT (CMAKE_VERSION VERSION_LESS 3.0))
add_library(optional INTERFACE)
target_include_directories(optional INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
install(TARGETS optional EXPORT optional-targets)
install(EXPORT optional-targets DESTINATION lib/cmake/akrzemi1_optional
FILE akrzemi1_optional-config.cmake
NAMESPACE akrzemi1::)
install(FILES optional.hpp DESTINATION include/akrzemi1)
endif()
add_executable(test_optional test_optional.cpp)
add_executable(test_type_traits test_type_traits.cpp)
add_test(test_optional test_optional)
add_test(test_type_traits test_type_traits)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/george22222/Optional.git
git@gitee.com:george22222/Optional.git
george22222
Optional
Optional
master

搜索帮助