mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-16 14:09:02 +07:00
add version to sources and cmake project
This commit is contained in:
@@ -1,12 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
|
||||
|
||||
if(NOT DEFINED PROJECT_NAME)
|
||||
set(BUILD_AS_STANDALONE ON)
|
||||
else()
|
||||
set(BUILD_AS_STANDALONE OFF)
|
||||
endif()
|
||||
#
|
||||
# VERSION
|
||||
#
|
||||
|
||||
project(meta.hpp)
|
||||
file(READ headers/meta.hpp/meta_base/base.hpp META_HPP_BASE_FILE)
|
||||
|
||||
string(REGEX MATCH "#define[ ]+META_HPP_VERSION_MAJOR[ ]+([0-9]+)" _ ${META_HPP_BASE_FILE})
|
||||
set(META_HPP_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
|
||||
string(REGEX MATCH "#define[ ]+META_HPP_VERSION_MINOR[ ]+([0-9]+)" _ ${META_HPP_BASE_FILE})
|
||||
set(META_HPP_VERSION_MINOR "${CMAKE_MATCH_1}")
|
||||
|
||||
string(REGEX MATCH "#define[ ]+META_HPP_VERSION_PATCH[ ]+([0-9]+)" _ ${META_HPP_BASE_FILE})
|
||||
set(META_HPP_VERSION_PATCH "${CMAKE_MATCH_1}")
|
||||
|
||||
set(META_HPP_VERSION ${META_HPP_VERSION_MAJOR}.${META_HPP_VERSION_MINOR}.${META_HPP_VERSION_PATCH})
|
||||
|
||||
#
|
||||
# PROJECT
|
||||
#
|
||||
|
||||
project(meta.hpp
|
||||
VERSION ${META_HPP_VERSION}
|
||||
DESCRIPTION "C++20 tiny dynamic reflection library"
|
||||
HOMEPAGE_URL "https://github.com/blackmatov/meta.hpp")
|
||||
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20)
|
||||
@@ -16,10 +34,10 @@ find_package(Threads REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} INTERFACE Threads::Threads)
|
||||
|
||||
#
|
||||
# BUILD_AS_STANDALONE
|
||||
# DEVELOPER
|
||||
#
|
||||
|
||||
if(NOT ${BUILD_AS_STANDALONE})
|
||||
if(NOT PROJECT_IS_TOP_LEVEL)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 20,
|
||||
"minor": 21,
|
||||
"patch": 0
|
||||
},
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "meta_base.hpp"
|
||||
|
||||
#include "meta_binds.hpp"
|
||||
|
||||
#include "meta_binds/array_bind.hpp"
|
||||
#include "meta_binds/class_bind.hpp"
|
||||
#include "meta_binds/enum_bind.hpp"
|
||||
|
||||
@@ -6,34 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <concepts>
|
||||
#include <functional>
|
||||
#include <initializer_list>
|
||||
#include <iosfwd>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include <span>
|
||||
#include <stdexcept>
|
||||
#include <string_view>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <typeindex>
|
||||
#include <typeinfo>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "meta_base/base.hpp"
|
||||
#include "meta_base/bitflags.hpp"
|
||||
#include "meta_base/cv_traits.hpp"
|
||||
#include "meta_base/cvref_traits.hpp"
|
||||
@@ -48,14 +21,6 @@
|
||||
#include "meta_base/type_kinds.hpp"
|
||||
#include "meta_base/type_list.hpp"
|
||||
|
||||
#if !defined(__cpp_exceptions)
|
||||
# define META_HPP_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if !defined(__cpp_rtti)
|
||||
# define META_HPP_NO_RTTI
|
||||
#endif
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
using detail::select_const;
|
||||
|
||||
47
headers/meta.hpp/meta_base/base.hpp
Normal file
47
headers/meta.hpp/meta_base/base.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "https://github.com/blackmatov/meta.hpp"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2021-2022, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <concepts>
|
||||
#include <functional>
|
||||
#include <initializer_list>
|
||||
#include <iosfwd>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include <span>
|
||||
#include <stdexcept>
|
||||
#include <string_view>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <typeindex>
|
||||
#include <typeinfo>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#define META_HPP_VERSION_MAJOR 0
|
||||
#define META_HPP_VERSION_MINOR 0
|
||||
#define META_HPP_VERSION_PATCH 1
|
||||
|
||||
#if !defined(__cpp_exceptions)
|
||||
# define META_HPP_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if !defined(__cpp_rtti)
|
||||
# define META_HPP_NO_RTTI
|
||||
#endif
|
||||
@@ -6,9 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -6,14 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
|
||||
#include <concepts>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
class noncopyable {
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename... Ts >
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename C, typename R, typename... Args >
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
|
||||
#include "base.hpp"
|
||||
#include "type_list.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tuple>
|
||||
#include "base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -31,6 +31,18 @@
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#define META_HPP_VERSION_MAJOR 0
|
||||
#define META_HPP_VERSION_MINOR 0
|
||||
#define META_HPP_VERSION_PATCH 1
|
||||
|
||||
#if !defined(__cpp_exceptions)
|
||||
# define META_HPP_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if !defined(__cpp_rtti)
|
||||
# define META_HPP_NO_RTTI
|
||||
#endif
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename Enum >
|
||||
@@ -718,14 +730,6 @@ namespace meta_hpp::detail
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(__cpp_exceptions)
|
||||
# define META_HPP_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if !defined(__cpp_rtti)
|
||||
# define META_HPP_NO_RTTI
|
||||
#endif
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
using detail::select_const;
|
||||
|
||||
Reference in New Issue
Block a user