diff --git a/Core/Geometry/inc/Ellipse.h b/Core/Geometry/inc/Ellipse.h index 893576cf8038e999c8519bcd003088f9b87b478b..9109517db0730f7161fa14f275440cc3337f905e 100644 --- a/Core/Geometry/inc/Ellipse.h +++ b/Core/Geometry/inc/Ellipse.h @@ -25,7 +25,7 @@ namespace Geometry { //! @ingroup tools //! @brief Ellipse shape -class Ellipse : public IShape2D { +class BA_CORE_API_ Ellipse : public IShape2D { public: //! Ellipse constructor //! @param xcenter x-coordinate of Ellipse's center diff --git a/Core/Geometry/inc/Line.h b/Core/Geometry/inc/Line.h index 6584ea20164549fec2c2e4eeadd09a5e0c2a68d0..7ddf8e6def3ac84411232d8c071d1e69778cb7fd 100644 --- a/Core/Geometry/inc/Line.h +++ b/Core/Geometry/inc/Line.h @@ -25,7 +25,7 @@ namespace Geometry { //! @ingroup tools //! @brief The line segment -class Line : public IShape2D { +class BA_CORE_API_ Line : public IShape2D { public: //! Line segment constructor Line(double x1, double y1, double x2, double y2); @@ -47,7 +47,7 @@ private: //! @ingroup tools //! @brief Vertical infinite line -class VerticalLine : public IShape2D { +class BA_CORE_API_ VerticalLine : public IShape2D { public: //! Infinite vertical line constructor //! @param x The value at which it crosses x-axes @@ -70,7 +70,7 @@ private: //! @ingroup tools //! @brief Horizontal infinite line -class HorizontalLine : public IShape2D { +class BA_CORE_API_ HorizontalLine : public IShape2D { public: //! Infinite vertical line constructor //! @param y The value at which it crosses y-axes diff --git a/Core/Geometry/inc/Polygon.h b/Core/Geometry/inc/Polygon.h index d261b2a7fe79e49558d06eb89a222ae479042278..a8bb16cda502097f101c173e8649c681ca0f7365 100644 --- a/Core/Geometry/inc/Polygon.h +++ b/Core/Geometry/inc/Polygon.h @@ -27,7 +27,7 @@ class PolygonPrivate; //! @ingroup tools //! @brief The polygon in 2D space -class Polygon : public IShape2D { +class BA_CORE_API_ Polygon : public IShape2D { public: //! Polygon defined by two arrays with x and y coordinates of points. //! Sizes of arrays should coincide. If polygon is unclosed (the last point diff --git a/Core/Geometry/inc/Rectangle.h b/Core/Geometry/inc/Rectangle.h index 66230efaa3f8c581ff7a4cfc70db2452f0ac146f..5687bd670a85c1b947f68b7b80746ee9573208e0 100644 --- a/Core/Geometry/inc/Rectangle.h +++ b/Core/Geometry/inc/Rectangle.h @@ -25,7 +25,7 @@ namespace Geometry { //! @ingroup tools //! @brief The rectangle shape having its axis aligned to the coordinate system (non-rotated so far). -class Rectangle : public IShape2D { +class BA_CORE_API_ Rectangle : public IShape2D { public: //! Rectangle constructor with lower left and upper right coordinates //! @param xlow x-coordinate of lower left corner diff --git a/Core/Tools/inc/Histogram1D.h b/Core/Tools/inc/Histogram1D.h index ed5454f4f3a2587e3d87ae680f87df213c564896..48a27901498b090917759b862de6636eafdeb8a7 100644 --- a/Core/Tools/inc/Histogram1D.h +++ b/Core/Tools/inc/Histogram1D.h @@ -22,7 +22,7 @@ ////! @ingroup tools ////! @brief One dimensional histogram -class Histogram1D : public IHistogram +class BA_CORE_API_ Histogram1D : public IHistogram { public: //! Constructor for fix bin size histograms. diff --git a/Core/Tools/inc/Histogram2D.h b/Core/Tools/inc/Histogram2D.h index c2e725d78154ec276aa64c8d1e4cf4f987216f4a..12e74bee525958379f9f526f2c62766a3f27b492 100644 --- a/Core/Tools/inc/Histogram2D.h +++ b/Core/Tools/inc/Histogram2D.h @@ -31,7 +31,7 @@ typedef _object PyObject; ////! @ingroup tools ////! @brief Two dimensional histogram -class Histogram2D : public IHistogram +class BA_CORE_API_ Histogram2D : public IHistogram { public: //! Constructor for fix bin size histograms. diff --git a/Core/Tools/inc/IHistogram.h b/Core/Tools/inc/IHistogram.h index 76e0a4c3e7eec13161bac626a8221badf3e427dc..2ee92d66128668f8ecdbce8bbeda1c80eaf5e170 100644 --- a/Core/Tools/inc/IHistogram.h +++ b/Core/Tools/inc/IHistogram.h @@ -33,7 +33,7 @@ class Histogram2D; //! @ingroup tools //! @brief Base class for 1D and 2D histograms holding values of double type -class IHistogram +class BA_CORE_API_ IHistogram { public: enum DataType {INTEGRAL, AVERAGE, ERROR, NENTRIES}; diff --git a/Tests/UnitTests/TestCore/CumulativeValueTest.h b/Tests/UnitTests/TestCore/CumulativeValueTest.h index 882fe59f65e56565fcfb826cf0b8d63fe3e098a0..ecb69a5912f46e32ef02cb407f5c411a1d88f32b 100644 --- a/Tests/UnitTests/TestCore/CumulativeValueTest.h +++ b/Tests/UnitTests/TestCore/CumulativeValueTest.h @@ -65,14 +65,14 @@ TEST_F(CumulativeValueTest, AddValuesWithWeights) EXPECT_EQ(2, cv1.getNumberOfEntries()); EXPECT_DOUBLE_EQ(4.0, cv1.getContent()); EXPECT_DOUBLE_EQ(1.5, cv1.getAverage()); - EXPECT_FLOAT_EQ(0.75, cv1.getRMS()*cv1.getRMS()); + EXPECT_FLOAT_EQ(0.75, (float)cv1.getRMS()*cv1.getRMS()); cv1.add(3.0); cv1.add(3.0); EXPECT_EQ(4, cv1.getNumberOfEntries()); EXPECT_DOUBLE_EQ(10.0, cv1.getContent()); EXPECT_DOUBLE_EQ(2.0, cv1.getAverage()); - EXPECT_FLOAT_EQ(1.0, cv1.getRMS()); + EXPECT_FLOAT_EQ(1.0, (float)cv1.getRMS()); } TEST_F(CumulativeValueTest, Comparison) diff --git a/cmake/modules/FindTIFF.cmake b/cmake/modules/FindTIFF.cmake index ecef9c41e0f8736f22cad33cd3bdbfb9b8620da3..172418627b73bb3141daa52e3c9f3e7ef5d9cdec 100644 --- a/cmake/modules/FindTIFF.cmake +++ b/cmake/modules/FindTIFF.cmake @@ -31,10 +31,14 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -find_path(TIFF_INCLUDE_DIR tiff.h QUIET) +if(WIN32) + find_path(TIFF_INCLUDE_DIR tiff.h PATHS ${CMAKE_INCLUDE_PATH}/libtiff) +else() + find_path(TIFF_INCLUDE_DIR tiff.h) +endif() set(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3) -find_library(TIFF_LIBRARY NAMES ${TIFF_NAMES} QUIET) +find_library(TIFF_LIBRARY NAMES ${TIFF_NAMES}) if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h") file(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str @@ -60,21 +64,23 @@ if(TIFF_FOUND) message(STATUS "Found Tiff version ${TIFF_VERSION_STRING}") message(STATUS "--> TIFF_INCLUDE_DIR: ${TIFF_INCLUDE_DIR} TIFF_LIBRARIES: ${TIFF_LIBRARIES}") - # looking for C++ version of library - list(LENGTH TIFF_LIBRARIES len) - if(len EQUAL 1) - get_filename_component(tiff_library_name ${TIFF_LIBRARIES} NAME_WE ) - get_filename_component(tiff_path ${TIFF_LIBRARIES} DIRECTORY ) - set(cpp_tiff_library "${tiff_path}/${tiff_library_name}xx.so") - if(EXISTS ${cpp_tiff_library}) - set(TIFF_LIBRARIES ${TIFF_LIBRARIES};${cpp_tiff_library}) - message(STATUS "--> Adding to the path also C++ version TIFF_LIBRARIES:${TIFF_LIBRARIES}") - else() - message(STATUS "--> Can't find C++ version ${cpp_tiff_library}. Will proceed as if TIFF is absent on the system.") - set(TIFF_FOUND FALSE) + if(NOT WIN32) + # looking for C++ version of library + list(LENGTH TIFF_LIBRARIES len) + if(len EQUAL 1) + get_filename_component(tiff_library_name ${TIFF_LIBRARIES} NAME_WE ) + get_filename_component(tiff_path ${TIFF_LIBRARIES} DIRECTORY ) + get_filename_component(tiff_ext ${TIFF_LIBRARIES} EXT ) + set(cpp_tiff_library "${tiff_path}/${tiff_library_name}xx.${tiff_ext}") + if(EXISTS ${cpp_tiff_library}) + set(TIFF_LIBRARIES ${TIFF_LIBRARIES};${cpp_tiff_library}) + message(STATUS "--> Adding to the path also C++ version TIFF_LIBRARIES:${TIFF_LIBRARIES}") + else() + message(WARNING "--> Can't find C++ version ${cpp_tiff_library}. Compilation may fail.") + endif() endif() endif() - + message(STATUS "--> TIFF_INCLUDE_DIR: ${TIFF_INCLUDE_DIR} TIFF_LIBRARIES: ${TIFF_LIBRARIES}") endif() diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index bc0fb0b816d8e30ae9d31a5f4be1af960cdd58f7..218de3afc4916d5ab985af2625acab7a79ac8c46 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -40,7 +40,7 @@ find_package(GSL REQUIRED) # Tiff # ----------------------------------------------------------------------------- if(BORNAGAIN_TIFF_SUPPORT) -# find_package(TIFF) + find_package(TIFF REQUIRED) if(NOT TIFF_FOUND) message(STATUS "No TIFF library found, local version will be build.") endif()