Commit ae30a4bb authored by Laurent Claustre's avatar Laurent Claustre

Merge branch '11-remove-compatibility-h-use-the-header-generated-by-cmake-instead' into 'master'

Resolve "Remove Compatibility.h, use the header generated by CMake instead"

Closes #11

See merge request !20
parents 5fb85c67 2d029ae4
Pipeline #8670 passed with stages
in 6 minutes and 12 seconds
......@@ -178,6 +178,7 @@ endif(PROCESSLIB_ENABLE_GSL)
target_include_directories(processlib PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/core/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tasks/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
if(WIN32)
......@@ -195,7 +196,7 @@ if(CMAKE_THREAD_LIBS_INIT)
endif()
if(WIN32)
target_compile_definitions(processlib PRIVATE LIBPROCESSLIB_EXPORTS)
target_compile_definitions(processlib PRIVATE processlib_EXPORTS)
set_target_properties(processlib PROPERTIES PREFIX "lib")
set_target_properties(processlib PROPERTIES IMPORT_PREFIX "lib")
endif()
......@@ -209,6 +210,7 @@ if(PROCESSLIB_ENABLE_PYTHON)
set(SIP_DISABLE_FEATURES "BPM_SUPPORT")
endif(NOT PROCESSLIB_ENABLE_GSL)
add_sip_python_module(processlib "${CMAKE_CURRENT_BINARY_DIR}/sip/processlib.sip")
target_compile_definitions(python_module_processlib PRIVATE processlib_EXPORTS)
target_include_directories(python_module_processlib PRIVATE ${PYTHON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/sip)
target_link_libraries(python_module_processlib PRIVATE processlib)
endif()
......
//###########################################################################
// This file is part of ProcessLib, a submodule of LImA project the
// Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This 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.
//
// This software 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/>.
//###########################################################################
#if !defined(PROCESSLIB_COMPATIBILITY_H)
#define PROCESSLIB_COMPATIBILITY_H
#ifdef WIN32
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT
#endif
#ifdef WIN32
#if (_WIN32_WINNT < _WIN32_WINNT_LONGHORN)
#define PTHREAD_WIN_XP_SYNC
#endif
#endif
#endif //! defined(PROCESSLIB_COMPATIBILITY_H)
......@@ -39,12 +39,12 @@
#include <string>
#include <vector>
#include "processlib/Compatibility.h"
#include <processlib_export.h>
#include "processlib/ProcessExceptions.h"
struct DLL_EXPORT Buffer
struct PROCESSLIB_EXPORT Buffer
{
class DLL_EXPORT Callback
class PROCESSLIB_EXPORT Callback
{
public:
virtual ~Callback() {}
......@@ -93,9 +93,9 @@ struct DLL_EXPORT Buffer
std::mutex _mutex;
Callback *callback;
};
struct DLL_EXPORT Data
struct PROCESSLIB_EXPORT Data
{
class DLL_EXPORT HeaderContainer
class PROCESSLIB_EXPORT HeaderContainer
{
public:
typedef std::map<std::string, std::string> Header;
......@@ -567,7 +567,7 @@ Data Data::cast(Data::TYPE aType)
return aReturnData;
}
DLL_EXPORT std::ostream &operator<<(std::ostream &os, const Data::HeaderContainer &aHeader);
PROCESSLIB_EXPORT std::ostream &operator<<(std::ostream &os, const Data::HeaderContainer &aHeader);
inline std::ostream &operator<<(std::ostream &os, const Buffer &aBuffer)
{
......
......@@ -35,11 +35,11 @@
#include <string>
#include <thread>
#include "processlib/Compatibility.h"
#include <processlib_export.h>
/** @brief this class manage error message in thread safe maner
*/
class DLL_EXPORT GslErrorMgr
class PROCESSLIB_EXPORT GslErrorMgr
{
typedef std::map<std::thread::id, std::string> ErrorMessageType;
typedef std::map<std::thread::id, int> ErrnoType;
......
......@@ -29,7 +29,8 @@
#include "processlib/Data.h"
#include "processlib/TaskEventCallback.h"
class DLL_EXPORT LinkTask
class PROCESSLIB_EXPORT LinkTask
{
public:
LinkTask();
......
......@@ -37,12 +37,12 @@
#include <thread>
#include <vector>
#include "processlib/Compatibility.h"
#include <processlib_export.h>
class TaskMgr;
struct Data;
class DLL_EXPORT PoolThreadMgr
class PROCESSLIB_EXPORT PoolThreadMgr
{
public:
typedef std::pair<int, int> TaskPriority;
......
......@@ -32,7 +32,7 @@
#include "processlib/SinkTaskMgr.h"
#include "processlib/TaskEventCallback.h"
class DLL_EXPORT SinkTaskBase
class PROCESSLIB_EXPORT SinkTaskBase
{
public:
SinkTaskBase();
......
......@@ -35,7 +35,7 @@
#include "processlib/PoolThreadMgr.h"
template <class Result>
class DLL_EXPORT SinkTaskMgr
class PROCESSLIB_EXPORT SinkTaskMgr
{
typedef std::vector<Result> FrameResultList;
......
......@@ -30,7 +30,7 @@
#include <stdlib.h>
#include <string>
class DLL_EXPORT Stat
class PROCESSLIB_EXPORT Stat
{
public:
Stat(const Data &data, const std::string &info) : _data(data), _info(info)
......
......@@ -30,7 +30,7 @@
#include "processlib/Data.h"
class DLL_EXPORT TaskEventCallback
class PROCESSLIB_EXPORT TaskEventCallback
{
public:
TaskEventCallback();
......
......@@ -26,7 +26,7 @@
#if !defined(PROCESSLIB_TASKMGR_H)
#define PROCESSLIB_TASKMGR_H
#include "processlib/Compatibility.h"
#include <processlib_export.h>
#include "processlib/Data.h"
#include <deque>
......@@ -34,7 +34,7 @@ class LinkTask;
class SinkTaskBase;
class PoolThreadMgr;
class DLL_EXPORT TaskMgr
class PROCESSLIB_EXPORT TaskMgr
{
friend class PoolThreadMgr;
struct Task
......
......@@ -24,7 +24,7 @@
#define __BACKGROUNDSUBSTRACTION__H_
#include "processlib/LinkTask.h"
namespace Tasks {
class DLL_EXPORT BackgroundSubstraction : public LinkTask
class PROCESSLIB_EXPORT BackgroundSubstraction : public LinkTask
{
public:
BackgroundSubstraction();
......
......@@ -22,7 +22,7 @@
//###########################################################################
#include "processlib/LinkTask.h"
namespace Tasks {
class DLL_EXPORT Binning : public LinkTask
class PROCESSLIB_EXPORT Binning : public LinkTask
{
public:
Binning();
......
......@@ -30,7 +30,7 @@ class BpmResult;
typedef SinkTaskMgr<BpmResult> BpmManager;
class DLL_EXPORT BpmResult
class PROCESSLIB_EXPORT BpmResult
{
public:
BpmResult()
......@@ -88,7 +88,7 @@ class DLL_EXPORT BpmResult
}
};
class DLL_EXPORT BpmTask : public SinkTask<BpmResult>
class PROCESSLIB_EXPORT BpmTask : public SinkTask<BpmResult>
{
public:
BpmTask(BpmManager &);
......
......@@ -22,7 +22,7 @@
//###########################################################################
#include "processlib/LinkTask.h"
namespace Tasks {
class DLL_EXPORT FlatfieldCorrection : public LinkTask
class PROCESSLIB_EXPORT FlatfieldCorrection : public LinkTask
{
public:
FlatfieldCorrection();
......
......@@ -22,7 +22,7 @@
//###########################################################################
#include "processlib/LinkTask.h"
namespace Tasks {
class DLL_EXPORT Flip : public LinkTask
class PROCESSLIB_EXPORT Flip : public LinkTask
{
public:
enum FLIP_MODE { FLIP_NONE, FLIP_X, FLIP_Y, FLIP_ALL };
......
......@@ -23,7 +23,7 @@
#include "processlib/LinkTask.h"
namespace Tasks {
class DLL_EXPORT Mask : public LinkTask
class PROCESSLIB_EXPORT Mask : public LinkTask
{
public:
enum Type { STANDARD, DUMMY };
......
......@@ -31,7 +31,7 @@ struct PeakFinderResult;
typedef SinkTaskMgr<PeakFinderResult> PeakFinderManager;
struct DLL_EXPORT PeakFinderResult
struct PROCESSLIB_EXPORT PeakFinderResult
{
PeakFinderResult() : x_peak(0.), y_peak(0.), frameNumber(-1), errorCode(PeakFinderManager::OK) {}
explicit PeakFinderResult(PeakFinderManager::ErrorCode code) : errorCode(code) {}
......@@ -52,7 +52,7 @@ inline std::ostream &operator<<(std::ostream &os, const PeakFinderResult &aPeakR
return os;
}
class DLL_EXPORT PeakFinderTask : public SinkTask<PeakFinderResult>
class PROCESSLIB_EXPORT PeakFinderTask : public SinkTask<PeakFinderResult>
{
public:
enum ComputingMode { MAXIMUM, CM };
......
......@@ -30,7 +30,7 @@ struct Roi2SpectrumResult;
typedef SinkTaskMgr<Roi2SpectrumResult> Roi2SpectrumManager;
struct DLL_EXPORT Roi2SpectrumResult
struct PROCESSLIB_EXPORT Roi2SpectrumResult
{
Roi2SpectrumResult() : frameNumber(-1), errorCode(Roi2SpectrumManager::OK) {}
explicit Roi2SpectrumResult(Roi2SpectrumManager::ErrorCode code) : errorCode(code) {}
......@@ -49,7 +49,7 @@ inline std::ostream &operator<<(std::ostream &os, const Roi2SpectrumResult &aRes
return os;
}
class DLL_EXPORT Roi2SpectrumTask : public SinkTask<Roi2SpectrumResult>
class PROCESSLIB_EXPORT Roi2SpectrumTask : public SinkTask<Roi2SpectrumResult>
{
public:
enum Mode { LINES_SUM, COLUMN_SUM };
......
......@@ -31,7 +31,7 @@ struct RoiCounterResult;
typedef SinkTaskMgr<RoiCounterResult> RoiCounterManager;
struct DLL_EXPORT RoiCounterResult
struct PROCESSLIB_EXPORT RoiCounterResult
{
RoiCounterResult()
: sum(0.), average(0.), std(0.), minValue(0.), maxValue(0.), frameNumber(-1), errorCode(RoiCounterManager::OK)
......@@ -61,7 +61,7 @@ inline std::ostream &operator<<(std::ostream &os, const RoiCounterResult &aRoiRe
return os;
}
class DLL_EXPORT RoiCounterTask : public SinkTask<RoiCounterResult>
class PROCESSLIB_EXPORT RoiCounterTask : public SinkTask<RoiCounterResult>
{
public:
enum type { UNDEF, SQUARE, ARC, LUT, MASK };
......
......@@ -25,7 +25,7 @@
#include "processlib/LinkTask.h"
namespace Tasks {
class DLL_EXPORT Rotation : public LinkTask
class PROCESSLIB_EXPORT Rotation : public LinkTask
{
public:
enum Type { R_90, R_180, R_270 };
......
......@@ -24,7 +24,7 @@
#define PROCESSLIB_SOFTROI_H
#include "processlib/LinkTask.h"
namespace Tasks {
class DLL_EXPORT SoftRoi : public LinkTask
class PROCESSLIB_EXPORT SoftRoi : public LinkTask
{
public:
SoftRoi();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment