diff --git a/Framework/CMakeLists.txt b/Framework/CMakeLists.txt index 42bf261dc53af88f405443b6f274f1c7c3ff2c76..0b63e7af95e2d4f5198c127d497067692634fe4c 100644 --- a/Framework/CMakeLists.txt +++ b/Framework/CMakeLists.txt @@ -70,6 +70,10 @@ include_directories (Kernel/inc) add_subdirectory (Kernel) set ( MANTIDLIBS ${MANTIDLIBS} Kernel ) +include_directories (Histogram/inc) +add_subdirectory (Histogram) +set ( MANTIDLIBS ${MANTIDLIBS} Histogram ) + include_directories (Geometry/inc) # muParser needed by Geometry and subsequent packages include_directories ( ${MUPARSER_INCLUDE_DIR} ) @@ -131,7 +135,7 @@ add_subdirectory (ISISLiveData) # Add a custom target to build all of the Framework ########################################################################### -set ( FRAMEWORK_LIBS Kernel Geometry API DataObjects +set ( FRAMEWORK_LIBS Kernel Histogram Geometry API DataObjects PythonKernelModule PythonGeometryModule PythonAPIModule PythonDataObjectsModule DataHandling Nexus Algorithms CurveFitting ICat diff --git a/Framework/Histogram/CMakeLists.txt b/Framework/Histogram/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f1a67c5d71d66e6a08736ea1f277f6f6c21fac62 --- /dev/null +++ b/Framework/Histogram/CMakeLists.txt @@ -0,0 +1,61 @@ +set ( SRC_FILES + src/BinEdges.cpp + src/Histogram.cpp + src/HistogramX.cpp + src/Points.cpp + ) + +set ( INC_FILES + inc/MantidHistogram/BinEdges.h + inc/MantidHistogram/ConstIterable.h + inc/MantidHistogram/Histogram.h + inc/MantidHistogram/HistogramData.h + inc/MantidHistogram/HistogramX.h + inc/MantidHistogram/Points.h + inc/MantidHistogram/VectorOf.h + ) + +set ( TEST_FILES + HistogramDataTest.h + BinEdgesTest.h + ConstIterableTest.h + HistogramXTest.h + PointsTest.h + HistogramTest.h + VectorOfTest.h + ) + +if (COVERALLS) + foreach( loop_var ${SRC_FILES} ${INC_FILES}) + set_property(GLOBAL APPEND PROPERTY COVERAGE_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}") + endforeach(loop_var) +endif() + +if(UNITY_BUILD) + include(UnityBuild) + enable_unity_build(Histogram SRC_FILES SRC_UNITY_IGNORE_FILES 10) +endif(UNITY_BUILD) + +# Add the target for this directory +add_library ( Histogram ${SRC_FILES} ${INC_FILES} ) +# Set the name of the generated library +set_target_properties ( Histogram PROPERTIES OUTPUT_NAME MantidHistogram + COMPILE_DEFINITIONS IN_MANTID_HISTOGRAM ) + +if (OSX_VERSION VERSION_GREATER 10.8) + set_target_properties ( Histogram PROPERTIES INSTALL_RPATH "@loader_path/../MacOS") +endif () + +# Add to the 'Framework' group in VS +set_property ( TARGET Histogram PROPERTY FOLDER "MantidFramework" ) + +target_link_libraries ( Histogram LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} ${MANTIDLIBS} ) + +# Add the unit tests directory +add_subdirectory ( test ) + +########################################################################### +# Installation settings +########################################################################### + +install ( TARGETS Histogram ${SYSTEM_PACKAGE_TARGET} DESTINATION ${LIB_DIR} ) diff --git a/Framework/Kernel/inc/MantidKernel/Histogram/BinEdges.h b/Framework/Histogram/inc/MantidHistogram/BinEdges.h similarity index 100% rename from Framework/Kernel/inc/MantidKernel/Histogram/BinEdges.h rename to Framework/Histogram/inc/MantidHistogram/BinEdges.h diff --git a/Framework/Kernel/inc/MantidKernel/Histogram/ConstIterable.h b/Framework/Histogram/inc/MantidHistogram/ConstIterable.h similarity index 100% rename from Framework/Kernel/inc/MantidKernel/Histogram/ConstIterable.h rename to Framework/Histogram/inc/MantidHistogram/ConstIterable.h diff --git a/Framework/Histogram/inc/MantidHistogram/DllConfig.h b/Framework/Histogram/inc/MantidHistogram/DllConfig.h new file mode 100644 index 0000000000000000000000000000000000000000..b2dfc7a76feb9cf2f77ce5ef8298766fefd4a98b --- /dev/null +++ b/Framework/Histogram/inc/MantidHistogram/DllConfig.h @@ -0,0 +1,37 @@ +#ifndef MANTID_HISTOGRAM_DLLCONFIG_H_ +#define MANTID_HISTOGRAM_DLLCONFIG_H_ + +/* + This file contains the DLLExport/DLLImport linkage configuration for the + Histogram library + + Copyright © 2016 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge + National Laboratory & European Spallation Source + + This file is part of Mantid. + + Mantid is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Mantid is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + File change history is stored at: <https://github.com/mantidproject/mantid> + Code Documentation is available at: <http://doxygen.mantidproject.org> +*/ +#include "MantidKernel/System.h" + +#ifdef IN_MANTID_HISTOGRAM +#define MANTID_HISTOGRAM_DLL DLLExport +#else +#define MANTID_HISTOGRAM_DLL DLLImport +#endif // IN_MANTID_HISTOGRAM + +#endif // MANTID_HISTOGRAM_DLLCONFIG_H_ diff --git a/Framework/Kernel/inc/MantidKernel/Histogram/Histogram.h b/Framework/Histogram/inc/MantidHistogram/Histogram.h similarity index 100% rename from Framework/Kernel/inc/MantidKernel/Histogram/Histogram.h rename to Framework/Histogram/inc/MantidHistogram/Histogram.h diff --git a/Framework/Kernel/inc/MantidKernel/Histogram/HistogramData.h b/Framework/Histogram/inc/MantidHistogram/HistogramData.h similarity index 100% rename from Framework/Kernel/inc/MantidKernel/Histogram/HistogramData.h rename to Framework/Histogram/inc/MantidHistogram/HistogramData.h diff --git a/Framework/Kernel/inc/MantidKernel/Histogram/HistogramX.h b/Framework/Histogram/inc/MantidHistogram/HistogramX.h similarity index 100% rename from Framework/Kernel/inc/MantidKernel/Histogram/HistogramX.h rename to Framework/Histogram/inc/MantidHistogram/HistogramX.h diff --git a/Framework/Kernel/inc/MantidKernel/Histogram/Points.h b/Framework/Histogram/inc/MantidHistogram/Points.h similarity index 100% rename from Framework/Kernel/inc/MantidKernel/Histogram/Points.h rename to Framework/Histogram/inc/MantidHistogram/Points.h diff --git a/Framework/Kernel/inc/MantidKernel/Histogram/VectorOf.h b/Framework/Histogram/inc/MantidHistogram/VectorOf.h similarity index 100% rename from Framework/Kernel/inc/MantidKernel/Histogram/VectorOf.h rename to Framework/Histogram/inc/MantidHistogram/VectorOf.h diff --git a/Framework/Kernel/src/Histogram/BinEdges.cpp b/Framework/Histogram/src/BinEdges.cpp similarity index 100% rename from Framework/Kernel/src/Histogram/BinEdges.cpp rename to Framework/Histogram/src/BinEdges.cpp diff --git a/Framework/Kernel/src/Histogram/Histogram.cpp b/Framework/Histogram/src/Histogram.cpp similarity index 100% rename from Framework/Kernel/src/Histogram/Histogram.cpp rename to Framework/Histogram/src/Histogram.cpp diff --git a/Framework/Kernel/src/Histogram/HistogramX.cpp b/Framework/Histogram/src/HistogramX.cpp similarity index 100% rename from Framework/Kernel/src/Histogram/HistogramX.cpp rename to Framework/Histogram/src/HistogramX.cpp diff --git a/Framework/Kernel/src/Histogram/Points.cpp b/Framework/Histogram/src/Points.cpp similarity index 100% rename from Framework/Kernel/src/Histogram/Points.cpp rename to Framework/Histogram/src/Points.cpp diff --git a/Framework/Kernel/test/HistogramBinEdgesTest.h b/Framework/Histogram/test/BinEdgesTest.h similarity index 100% rename from Framework/Kernel/test/HistogramBinEdgesTest.h rename to Framework/Histogram/test/BinEdgesTest.h diff --git a/Framework/Histogram/test/CMakeLists.txt b/Framework/Histogram/test/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..2bdabefe3d22c8fa94bf25615b128a1551673e4b --- /dev/null +++ b/Framework/Histogram/test/CMakeLists.txt @@ -0,0 +1,16 @@ +if ( CXXTEST_FOUND ) + include_directories ( SYSTEM ${CXXTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR} ) + + cxxtest_add_test ( HistogramTest ${TEST_FILES} ${GMOCK_TEST_FILES}) + target_link_libraries( HistogramTest LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} + Histogram + Kernel + ${Boost_LIBRARIES} + ${POCO_LIBRARIES} + ${GMOCK_LIBRARIES} + ${GTEST_LIBRARIES} ) + + add_dependencies ( FrameworkTests HistogramTest ) + # Add to the 'FrameworkTests' group in VS + set_property ( TARGET HistogramTest PROPERTY FOLDER "UnitTests" ) +endif () diff --git a/Framework/Kernel/test/HistogramConstIterableTest.h b/Framework/Histogram/test/ConstIterableTest.h similarity index 100% rename from Framework/Kernel/test/HistogramConstIterableTest.h rename to Framework/Histogram/test/ConstIterableTest.h diff --git a/Framework/Kernel/test/HistogramHistogramDataTest.h b/Framework/Histogram/test/HistogramDataTest.h similarity index 100% rename from Framework/Kernel/test/HistogramHistogramDataTest.h rename to Framework/Histogram/test/HistogramDataTest.h diff --git a/Framework/Kernel/test/HistogramTest.h b/Framework/Histogram/test/HistogramTest.h similarity index 100% rename from Framework/Kernel/test/HistogramTest.h rename to Framework/Histogram/test/HistogramTest.h diff --git a/Framework/Kernel/test/HistogramHistogramXTest.h b/Framework/Histogram/test/HistogramXTest.h similarity index 100% rename from Framework/Kernel/test/HistogramHistogramXTest.h rename to Framework/Histogram/test/HistogramXTest.h diff --git a/Framework/Kernel/test/HistogramPointsTest.h b/Framework/Histogram/test/PointsTest.h similarity index 100% rename from Framework/Kernel/test/HistogramPointsTest.h rename to Framework/Histogram/test/PointsTest.h diff --git a/Framework/Kernel/test/HistogramVectorOfTest.h b/Framework/Histogram/test/VectorOfTest.h similarity index 100% rename from Framework/Kernel/test/HistogramVectorOfTest.h rename to Framework/Histogram/test/VectorOfTest.h diff --git a/Framework/Kernel/CMakeLists.txt b/Framework/Kernel/CMakeLists.txt index 0d92c5d305598b6a03ce1102c51f8edabbbda026..1ae8c3accbe45e3496a59ce9e1284c5b90460023 100644 --- a/Framework/Kernel/CMakeLists.txt +++ b/Framework/Kernel/CMakeLists.txt @@ -32,10 +32,6 @@ set ( SRC_FILES src/FloatingPointComparison.cpp src/FreeBlock.cpp src/Glob.cpp - src/Histogram/BinEdges.cpp - src/Histogram/Histogram.cpp - src/Histogram/HistogramX.cpp - src/Histogram/Points.cpp src/ICatalogInfo.cpp src/IPropertyManager.cpp src/ISaveable.cpp @@ -182,13 +178,6 @@ set ( INC_FILES inc/MantidKernel/FreeBlock.h inc/MantidKernel/FunctionTask.h inc/MantidKernel/Glob.h - inc/MantidKernel/Histogram/BinEdges.h - inc/MantidKernel/Histogram/ConstIterable.h - inc/MantidKernel/Histogram/Histogram.h - inc/MantidKernel/Histogram/HistogramData.h - inc/MantidKernel/Histogram/HistogramX.h - inc/MantidKernel/Histogram/Points.h - inc/MantidKernel/Histogram/VectorOf.h inc/MantidKernel/ICatalogInfo.h inc/MantidKernel/IPropertyManager.h inc/MantidKernel/IPropertySettings.h @@ -344,13 +333,6 @@ set ( TEST_FILES FreeBlockTest.h FunctionTaskTest.h GlobTest.h - HistogramHistogramDataTest.h - HistogramBinEdgesTest.h - HistogramConstIterableTest.h - HistogramHistogramXTest.h - HistogramPointsTest.h - HistogramTest.h - HistogramVectorOfTest.h IPropertySettingsTest.h ISaveableTest.h IValidatorTest.h