Skip to content
Snippets Groups Projects
Commit 2c12f636 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Bunch of BA_CORE_API for windows compilation.

parent 6883f762
Branches 142-manual-setting-height-too-restrictive
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ namespace Geometry { ...@@ -25,7 +25,7 @@ namespace Geometry {
//! @ingroup tools //! @ingroup tools
//! @brief Ellipse shape //! @brief Ellipse shape
class Ellipse : public IShape2D { class BA_CORE_API_ Ellipse : public IShape2D {
public: public:
//! Ellipse constructor //! Ellipse constructor
//! @param xcenter x-coordinate of Ellipse's center //! @param xcenter x-coordinate of Ellipse's center
......
...@@ -25,7 +25,7 @@ namespace Geometry { ...@@ -25,7 +25,7 @@ namespace Geometry {
//! @ingroup tools //! @ingroup tools
//! @brief The line segment //! @brief The line segment
class Line : public IShape2D { class BA_CORE_API_ Line : public IShape2D {
public: public:
//! Line segment constructor //! Line segment constructor
Line(double x1, double y1, double x2, double y2); Line(double x1, double y1, double x2, double y2);
...@@ -47,7 +47,7 @@ private: ...@@ -47,7 +47,7 @@ private:
//! @ingroup tools //! @ingroup tools
//! @brief Vertical infinite line //! @brief Vertical infinite line
class VerticalLine : public IShape2D { class BA_CORE_API_ VerticalLine : public IShape2D {
public: public:
//! Infinite vertical line constructor //! Infinite vertical line constructor
//! @param x The value at which it crosses x-axes //! @param x The value at which it crosses x-axes
...@@ -70,7 +70,7 @@ private: ...@@ -70,7 +70,7 @@ private:
//! @ingroup tools //! @ingroup tools
//! @brief Horizontal infinite line //! @brief Horizontal infinite line
class HorizontalLine : public IShape2D { class BA_CORE_API_ HorizontalLine : public IShape2D {
public: public:
//! Infinite vertical line constructor //! Infinite vertical line constructor
//! @param y The value at which it crosses y-axes //! @param y The value at which it crosses y-axes
......
...@@ -27,7 +27,7 @@ class PolygonPrivate; ...@@ -27,7 +27,7 @@ class PolygonPrivate;
//! @ingroup tools //! @ingroup tools
//! @brief The polygon in 2D space //! @brief The polygon in 2D space
class Polygon : public IShape2D { class BA_CORE_API_ Polygon : public IShape2D {
public: public:
//! Polygon defined by two arrays with x and y coordinates of points. //! Polygon defined by two arrays with x and y coordinates of points.
//! Sizes of arrays should coincide. If polygon is unclosed (the last point //! Sizes of arrays should coincide. If polygon is unclosed (the last point
......
...@@ -25,7 +25,7 @@ namespace Geometry { ...@@ -25,7 +25,7 @@ namespace Geometry {
//! @ingroup tools //! @ingroup tools
//! @brief The rectangle shape having its axis aligned to the coordinate system (non-rotated so far). //! @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: public:
//! Rectangle constructor with lower left and upper right coordinates //! Rectangle constructor with lower left and upper right coordinates
//! @param xlow x-coordinate of lower left corner //! @param xlow x-coordinate of lower left corner
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
////! @ingroup tools ////! @ingroup tools
////! @brief One dimensional histogram ////! @brief One dimensional histogram
class Histogram1D : public IHistogram class BA_CORE_API_ Histogram1D : public IHistogram
{ {
public: public:
//! Constructor for fix bin size histograms. //! Constructor for fix bin size histograms.
......
...@@ -31,7 +31,7 @@ typedef _object PyObject; ...@@ -31,7 +31,7 @@ typedef _object PyObject;
////! @ingroup tools ////! @ingroup tools
////! @brief Two dimensional histogram ////! @brief Two dimensional histogram
class Histogram2D : public IHistogram class BA_CORE_API_ Histogram2D : public IHistogram
{ {
public: public:
//! Constructor for fix bin size histograms. //! Constructor for fix bin size histograms.
......
...@@ -33,7 +33,7 @@ class Histogram2D; ...@@ -33,7 +33,7 @@ class Histogram2D;
//! @ingroup tools //! @ingroup tools
//! @brief Base class for 1D and 2D histograms holding values of double type //! @brief Base class for 1D and 2D histograms holding values of double type
class IHistogram class BA_CORE_API_ IHistogram
{ {
public: public:
enum DataType {INTEGRAL, AVERAGE, ERROR, NENTRIES}; enum DataType {INTEGRAL, AVERAGE, ERROR, NENTRIES};
......
...@@ -65,14 +65,14 @@ TEST_F(CumulativeValueTest, AddValuesWithWeights) ...@@ -65,14 +65,14 @@ TEST_F(CumulativeValueTest, AddValuesWithWeights)
EXPECT_EQ(2, cv1.getNumberOfEntries()); EXPECT_EQ(2, cv1.getNumberOfEntries());
EXPECT_DOUBLE_EQ(4.0, cv1.getContent()); EXPECT_DOUBLE_EQ(4.0, cv1.getContent());
EXPECT_DOUBLE_EQ(1.5, cv1.getAverage()); 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);
cv1.add(3.0); cv1.add(3.0);
EXPECT_EQ(4, cv1.getNumberOfEntries()); EXPECT_EQ(4, cv1.getNumberOfEntries());
EXPECT_DOUBLE_EQ(10.0, cv1.getContent()); EXPECT_DOUBLE_EQ(10.0, cv1.getContent());
EXPECT_DOUBLE_EQ(2.0, cv1.getAverage()); 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) TEST_F(CumulativeValueTest, Comparison)
......
...@@ -31,10 +31,14 @@ ...@@ -31,10 +31,14 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # 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) 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") if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
file(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str file(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str
...@@ -60,21 +64,23 @@ if(TIFF_FOUND) ...@@ -60,21 +64,23 @@ if(TIFF_FOUND)
message(STATUS "Found Tiff version ${TIFF_VERSION_STRING}") message(STATUS "Found Tiff version ${TIFF_VERSION_STRING}")
message(STATUS "--> TIFF_INCLUDE_DIR: ${TIFF_INCLUDE_DIR} TIFF_LIBRARIES: ${TIFF_LIBRARIES}") message(STATUS "--> TIFF_INCLUDE_DIR: ${TIFF_INCLUDE_DIR} TIFF_LIBRARIES: ${TIFF_LIBRARIES}")
# looking for C++ version of library if(NOT WIN32)
list(LENGTH TIFF_LIBRARIES len) # looking for C++ version of library
if(len EQUAL 1) list(LENGTH TIFF_LIBRARIES len)
get_filename_component(tiff_library_name ${TIFF_LIBRARIES} NAME_WE ) if(len EQUAL 1)
get_filename_component(tiff_path ${TIFF_LIBRARIES} DIRECTORY ) get_filename_component(tiff_library_name ${TIFF_LIBRARIES} NAME_WE )
set(cpp_tiff_library "${tiff_path}/${tiff_library_name}xx.so") get_filename_component(tiff_path ${TIFF_LIBRARIES} DIRECTORY )
if(EXISTS ${cpp_tiff_library}) get_filename_component(tiff_ext ${TIFF_LIBRARIES} EXT )
set(TIFF_LIBRARIES ${TIFF_LIBRARIES};${cpp_tiff_library}) set(cpp_tiff_library "${tiff_path}/${tiff_library_name}xx.${tiff_ext}")
message(STATUS "--> Adding to the path also C++ version TIFF_LIBRARIES:${TIFF_LIBRARIES}") if(EXISTS ${cpp_tiff_library})
else() set(TIFF_LIBRARIES ${TIFF_LIBRARIES};${cpp_tiff_library})
message(STATUS "--> Can't find C++ version ${cpp_tiff_library}. Will proceed as if TIFF is absent on the system.") message(STATUS "--> Adding to the path also C++ version TIFF_LIBRARIES:${TIFF_LIBRARIES}")
set(TIFF_FOUND FALSE) else()
message(WARNING "--> Can't find C++ version ${cpp_tiff_library}. Compilation may fail.")
endif()
endif() endif()
endif() endif()
message(STATUS "--> TIFF_INCLUDE_DIR: ${TIFF_INCLUDE_DIR} TIFF_LIBRARIES: ${TIFF_LIBRARIES}")
endif() endif()
......
...@@ -40,7 +40,7 @@ find_package(GSL REQUIRED) ...@@ -40,7 +40,7 @@ find_package(GSL REQUIRED)
# Tiff # Tiff
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
if(BORNAGAIN_TIFF_SUPPORT) if(BORNAGAIN_TIFF_SUPPORT)
# find_package(TIFF) find_package(TIFF REQUIRED)
if(NOT TIFF_FOUND) if(NOT TIFF_FOUND)
message(STATUS "No TIFF library found, local version will be build.") message(STATUS "No TIFF library found, local version will be build.")
endif() endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment