From 19b12600d834cda166fed399395bcf67dfb9dd95 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sat, 19 Jan 2019 11:06:49 +0000 Subject: [PATCH] Add the version number to vectorwrapper.hpp --- CMakeLists.txt | 21 +++++++++++++++++++ include/vectorwrapper/sequence_range.hpp | 6 +++--- include/vectorwrapper/vector_cast.hpp | 6 +++--- include/vectorwrapper/vectorops.hpp | 4 ++-- ...vectorwrapper.hpp => vectorwrapper.hpp.in} | 14 ++++++++----- test/CMakeLists.txt | 12 +++++++---- 6 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 CMakeLists.txt rename include/vectorwrapper/{vectorwrapper.hpp => vectorwrapper.hpp.in} (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..67a3698 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) +cmake_policy(SET CMP0048 NEW) +project(vectorwrapper VERSION 1.1.0) + +if (BUILD_TESTS) + add_subdirectory(test) +endif() + +configure_file( + include/vectorwrapper/vectorwrapper.hpp.in + ${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper/vectorwrapper.hpp + @ONLY +) + +install(DIRECTORY include/vectorwrapper + DESTINATION include + PATTERN vectorwrapper.hpp.in EXCLUDE +) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper + DESTINATION include +) diff --git a/include/vectorwrapper/sequence_range.hpp b/include/vectorwrapper/sequence_range.hpp index 9260fee..94e0770 100644 --- a/include/vectorwrapper/sequence_range.hpp +++ b/include/vectorwrapper/sequence_range.hpp @@ -16,9 +16,9 @@ #pragma once -#include "vectorwrapper.hpp" -#include "sequence_bt.hpp" -#include "size_type.hpp" +#include "vectorwrapper/vectorwrapper.hpp" +#include "vectorwrapper/sequence_bt.hpp" +#include "vectorwrapper/size_type.hpp" #include #include #include diff --git a/include/vectorwrapper/vector_cast.hpp b/include/vectorwrapper/vector_cast.hpp index da314d9..98750d0 100644 --- a/include/vectorwrapper/vector_cast.hpp +++ b/include/vectorwrapper/vector_cast.hpp @@ -16,9 +16,9 @@ #pragma once -#include "sequence_bt.hpp" -#include "size_type.hpp" -#include "vectorwrapper.hpp" +#include "vectorwrapper/sequence_bt.hpp" +#include "vectorwrapper/size_type.hpp" +#include "vectorwrapper/vectorwrapper.hpp" #if defined VWR_OUTER_NAMESPACE namespace VWR_OUTER_NAMESPACE { diff --git a/include/vectorwrapper/vectorops.hpp b/include/vectorwrapper/vectorops.hpp index 46829e6..4f6ebc0 100644 --- a/include/vectorwrapper/vectorops.hpp +++ b/include/vectorwrapper/vectorops.hpp @@ -16,8 +16,8 @@ #pragma once -#include "vectorwrapper.hpp" -#include "size_type.hpp" +#include "vectorwrapper/vectorwrapper.hpp" +#include "vectorwrapper/size_type.hpp" #include #include diff --git a/include/vectorwrapper/vectorwrapper.hpp b/include/vectorwrapper/vectorwrapper.hpp.in similarity index 98% rename from include/vectorwrapper/vectorwrapper.hpp rename to include/vectorwrapper/vectorwrapper.hpp.in index ca4d983..a467e12 100644 --- a/include/vectorwrapper/vectorwrapper.hpp +++ b/include/vectorwrapper/vectorwrapper.hpp.in @@ -16,16 +16,20 @@ #pragma once -#include "sequence_bt.hpp" -#include "size_type.hpp" -#include "implem_vec_base.hpp" -#include "implem_vec_common.hpp" +#include "vectorwrapper/sequence_bt.hpp" +#include "vectorwrapper/size_type.hpp" +#include "vectorwrapper/implem_vec_base.hpp" +#include "vectorwrapper/implem_vec_common.hpp" #include #include #include #include #include +#define VWR_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define VWR_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define VWR_VERSION_PATCH @PROJECT_VERSION_PATCH@ + #if defined VWR_OUTER_NAMESPACE namespace VWR_OUTER_NAMESPACE { #endif @@ -398,4 +402,4 @@ namespace vwr { } //namespace VWR_OUTER_NAMESPACE #endif -#include "vectorwrapper.inl" +#include "vectorwrapper/vectorwrapper.inl" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1d96ca3..606043e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,13 +1,14 @@ cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) +cmake_policy(SET CMP0048 NEW) include(CTest) add_subdirectory(gtest-1.7.0) -set(GTEST_MAIN_CPP "${CMAKE_SOURCE_DIR}/gtest-1.7.0/src/gtest_main.cc") -set(UNITTEST_DATA_DIR "${CMAKE_SOURCE_DIR}/../data") +set(GTEST_MAIN_CPP "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.7.0/src/gtest_main.cc") +set(UNITTEST_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../data") include_directories(SYSTEM - gtest-1.7.0/include + ${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.7.0/include ) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -std=c++11") @@ -20,6 +21,9 @@ add_definitions( -Wconversion ) -include_directories(../include) +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/../include + ${CMAKE_CURRENT_BINARY_DIR}/../include +) add_subdirectory(unit) add_subdirectory(unit_noconv)