diff --git a/Code/Core/otbWrapperApplicationFactory.h b/Code/Core/otbWrapperApplicationFactory.h index 4fb76f7726e394782f77d3708425801bdc343659..16ebfd0b6a2ee82c0639240a0ec8dea7ea1ce3dd 100644 --- a/Code/Core/otbWrapperApplicationFactory.h +++ b/Code/Core/otbWrapperApplicationFactory.h @@ -100,13 +100,16 @@ private: } //end namespace otb -#define OTB_APPLICATION_REGISTER( ApplicationType ) \ +#define OTB_APPLICATION_EXPORT( ApplicationType ) \ typedef otb::Wrapper::ApplicationFactory<ApplicationType> ApplicationFactoryType; \ static ApplicationFactoryType::Pointer staticFactory; \ - itk::ObjectFactoryBase* itkLoad() \ + extern "C" \ { \ - staticFactory = ApplicationFactoryType::New(); \ - return staticFactory; \ + itk::ObjectFactoryBase* itkLoad() \ + { \ + staticFactory = ApplicationFactoryType::New(); \ + return staticFactory; \ + } \ } diff --git a/Example/otbAddition.cxx b/Example/otbAddition.cxx index 61325fa767fb55cd42e9ae19e125e72ddc9a7ed9..104a0a2e22a08a91cd4f8d67db52b187a69c18b6 100644 --- a/Example/otbAddition.cxx +++ b/Example/otbAddition.cxx @@ -72,4 +72,4 @@ private: } } -OTB_APPLICATION_REGISTER(otb::Wrapper::Addition) +OTB_APPLICATION_EXPORT(otb::Wrapper::Addition) diff --git a/Example/otbSmoothing.cxx b/Example/otbSmoothing.cxx index f262db60f2d457e360df8961b635e1839664aba9..30b25c33f57930028e848030f0956cec1cec9738 100644 --- a/Example/otbSmoothing.cxx +++ b/Example/otbSmoothing.cxx @@ -168,5 +168,5 @@ private: } } -OTB_APPLICATION_REGISTER(otb::Wrapper::Smoothing) +OTB_APPLICATION_EXPORT(otb::Wrapper::Smoothing) diff --git a/Testing/Core/CMakeLists.txt b/Testing/Core/CMakeLists.txt index 323639eab89508e5afaa9ac510ccf512bb80b008..fb7d1f0dbdc0463b842c5e206a047a87dcadfa47 100644 --- a/Testing/Core/CMakeLists.txt +++ b/Testing/Core/CMakeLists.txt @@ -55,8 +55,8 @@ ADD_TEST(owTuApplication ${OTB_WRAPPER_TESTS} ) # Application class test -ADD_TEST(owTvApplicationFactory ${OTB_WRAPPER_TESTS} - otbWrapperApplicationFactory +ADD_TEST(owTvApplicationRegistry ${OTB_WRAPPER_TESTS} + otbWrapperApplicationRegistry ) # ----------------Source files CXX ----------------------------------- diff --git a/Testing/Python/CMakeLists.txt b/Testing/Python/CMakeLists.txt index 543c04d7999add14dc350ca283eaeac5c770803d..69dae0bfef5cd8df4cb77137637ccd8497fac3b4 100644 --- a/Testing/Python/CMakeLists.txt +++ b/Testing/Python/CMakeLists.txt @@ -4,9 +4,10 @@ FIND_PROGRAM(OTB_TEST_DRIVER otbTestDriver PATHS ${OTB_DIR}/bin ${OTB_DIR}/../.. SET(TEST_DRIVER "${OTB_TEST_DRIVER}" --add-before-env PYTHONPATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG" - --add-before-env ITK_AUTOLOAD_PATH "${CMAKE_BINARY_DIR}/Example/Smoothing" + --add-before-env ITK_AUTOLOAD_PATH "${CMAKE_BINARY_DIR}/Example" ) -SET(TEMP ${OTBWrapper_BINARY_DIR}/Temporary) +SET(TEMP ${CMAKE_BINARY_DIR}/Testing/Temporary) +FILE(MAKE_DIRECTORY ${TEMP}) ADD_TEST( NAME PythonTest1 COMMAND ${TEST_DRIVER} Execute