diff --git a/Code/Common/CMakeLists.txt b/Code/Common/CMakeLists.txt index c6f7d53028f19c5f6159a2602b621b6ceb7f2560..576c3bd5365f86bdf63bc7d83ad7471ed44429d9 100644 --- a/Code/Common/CMakeLists.txt +++ b/Code/Common/CMakeLists.txt @@ -12,13 +12,16 @@ ENDIF( NOT OTB_USE_PQXX ) ADD_LIBRARY(OTBCommon ${OTBCommon_SRCS}) +SET_TARGET_PROPERTIES(OTBCommon + PROPERTIES + LINK_INTERFACE_LIBRARIES "" +) TARGET_LINK_LIBRARIES (OTBCommon ITKAlgorithms ITKStatistics ITKCommon otbconfigfile) IF(OTB_USE_MAPNIK) TARGET_LINK_LIBRARIES(OTBCommon ${MAPNIK_LIBRARY}) ENDIF(OTB_USE_MAPNIK) IF(OTB_USE_PQXX) -#TODO this line should be refined when we will like to have this capability with windows TARGET_LINK_LIBRARIES(OTBCommon ${PQ_LIBRARY} ${PQXX_LIBRARY}) ENDIF(OTB_USE_PQXX) diff --git a/Code/GeospatialAnalysis/CMakeLists.txt b/Code/GeospatialAnalysis/CMakeLists.txt index 039e2ca221c4a4458c3c32e73c7e6b67e9a260d9..8df46d5af27ca86e0d6f1f95f15e25acb26d2443 100644 --- a/Code/GeospatialAnalysis/CMakeLists.txt +++ b/Code/GeospatialAnalysis/CMakeLists.txt @@ -4,7 +4,7 @@ FILE(GLOB OTBGeospatialAnalysis_SRCS "*.cxx" ) ADD_LIBRARY(OTBGeospatialAnalysis ${OTBGeospatialAnalysis_SRCS}) -TARGET_LINK_LIBRARIES (OTBGeospatialAnalysis OTBCommon pq pqxx) +TARGET_LINK_LIBRARIES (OTBGeospatialAnalysis OTBCommon ${PQ_LIBRARY} ${PQXX_LIBRARY}) IF(OTB_LIBRARY_PROPERTIES) SET_TARGET_PROPERTIES(OTBGeospatialAnalysis PROPERTIES ${OTB_LIBRARY_PROPERTIES}) ENDIF(OTB_LIBRARY_PROPERTIES) diff --git a/Code/IO/CMakeLists.txt b/Code/IO/CMakeLists.txt index 876326d9ba1326e87ad025fd30c6f8db54de6aee..3d1f1208ee5452970df8897c7d2850781c21a0ae 100644 --- a/Code/IO/CMakeLists.txt +++ b/Code/IO/CMakeLists.txt @@ -30,7 +30,11 @@ ENDIF(OTB_COMPILE_JPEG2000) ADD_LIBRARY(OTBIO ${OTBIO_SRCS}) -TARGET_LINK_LIBRARIES (OTBIO ${GDAL_LIBRARY} ${OGR_LIBRARY} OTBCommon) + SET_TARGET_PROPERTIES(OTBIO + PROPERTIES + LINK_INTERFACE_LIBRARIES "" + ) +TARGET_LINK_LIBRARIES (OTBIO ${GDAL_LIBRARY} ${OGR_LIBRARY} ${JPEG_LIBRARY} ${TIFF_LIBRARY} ${GEOTIFF_LIBRARY} OTBCommon) TARGET_LINK_LIBRARIES (OTBIO otbossim otbossimplugins ITKIO ITKCommon dxf otbkml) IF (OTB_USE_LIBLAS) @@ -70,10 +74,10 @@ IF(NOT OTB_COMPILE_JPEG2000) ENDIF(NOT OTB_COMPILE_JPEG2000) # Compile otbTestDriver -# Nedded in the OTB-Wrapping project. +# Needed in the OTB-Wrapping project. # Has to be compiled even if the BUILD_TEST are set to OFF IF(CMAKE_COMPILER_IS_GNUCXX) - SET_SOURCE_FILES_PROPERTIES(itkTestDriver.cxx PROPERTIES COMPILE_FLAGS -w) + SET_SOURCE_FILES_PROPERTIES(otbTestDriver.cxx PROPERTIES COMPILE_FLAGS -w) ENDIF(CMAKE_COMPILER_IS_GNUCXX) ADD_EXECUTABLE(otbTestDriver otbTestDriver.cxx) diff --git a/Code/Testing/CMakeLists.txt b/Code/Testing/CMakeLists.txt index 091ed1945f72a6ec4c9334265e5bc550784887e2..29bf017a0ae02846dd94de4793e18e0e95ae4c6e 100644 --- a/Code/Testing/CMakeLists.txt +++ b/Code/Testing/CMakeLists.txt @@ -3,6 +3,10 @@ FILE(GLOB OTBTesting_SRCS "*.cxx" ) ADD_LIBRARY(OTBTesting ${OTBTesting_SRCS}) +SET_TARGET_PROPERTIES(OTBTesting + PROPERTIES + LINK_INTERFACE_LIBRARIES "" +) TARGET_LINK_LIBRARIES (OTBTesting OTBBasicFilters OTBIO OTBCommon ITKBasicFilters) IF(OTB_LIBRARY_PROPERTIES) SET_TARGET_PROPERTIES(OTBTesting PROPERTIES ${OTB_LIBRARY_PROPERTIES}) diff --git a/Testing/Code/BasicFilters/otbBasicFiltersTests1.cxx b/Testing/Code/BasicFilters/otbBasicFiltersTests1.cxx index a771c78e31a4d9f5297a94f2b99e660f59162e41..b264f1d11cb56e85fd752e0a7de9ee8595e42ebd 100644 --- a/Testing/Code/BasicFilters/otbBasicFiltersTests1.cxx +++ b/Testing/Code/BasicFilters/otbBasicFiltersTests1.cxx @@ -29,7 +29,6 @@ void RegisterTests() { REGISTER_TEST(otbLeeFilter); REGISTER_TEST(otbFrostFilterNew); - // REGISTER_TEST(otbFrostFilterTest); REGISTER_TEST(otbFrostFilter); REGISTER_TEST(otbImageToPointSetFilterTest); REGISTER_TEST(otbOpeningClosingMorphologicalFilterNew); diff --git a/Testing/Code/Projections/CMakeLists.txt b/Testing/Code/Projections/CMakeLists.txt index e9357b851ff30ebe1a5f7c4b00d1218da451a352..6bf4561c6722e5a2834a93404c8b188d65f9c010 100644 --- a/Testing/Code/Projections/CMakeLists.txt +++ b/Testing/Code/Projections/CMakeLists.txt @@ -457,6 +457,17 @@ ADD_TEST(prTvVectorDataProjectionFilterFromMapToGeo ${PROJECTIONS_TESTS3} ${TEMP}/prTvVectorDataProjectionFilterFromMapToGeo.kml ) +ADD_TEST(prTvVectorDataProjectionFilterFromMapToImage ${PROJECTIONS_TESTS3} + --compare-ascii ${NOTOL} + ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToImage.kml + ${TEMP}/prTvVectorDataProjectionFilterFromMapToImage.kml + otbVectorDataProjectionFilterFromMapToImage + ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif + ${TEMP}/prTvVectorDataProjectionFilterFromMapToImage.kml +) + + ADD_TEST(prTuGeocentricTransformNew ${PROJECTIONS_TESTS3} otbGeocentricTransformNew ) @@ -509,6 +520,7 @@ otbVectorDataProjectionFilterNew.cxx otbVectorDataProjectionFilter.cxx otbVectorDataProjectionFilterFromMapToSensor.cxx otbVectorDataProjectionFilterFromMapToGeo.cxx +otbVectorDataProjectionFilterFromMapToImage.cxx otbGeocentricTransformNew.cxx otbGeocentricTransform.cxx otbVectorDataExtractROIandProjection.cxx diff --git a/Testing/Code/Projections/otbProjectionsTests3.cxx b/Testing/Code/Projections/otbProjectionsTests3.cxx index 712ecb957e3f7d744fecb3a7eaf677de44ecf0ee..00db5e5f43a801da0f1654ecba813e7de0b43d01 100644 --- a/Testing/Code/Projections/otbProjectionsTests3.cxx +++ b/Testing/Code/Projections/otbProjectionsTests3.cxx @@ -37,6 +37,7 @@ void RegisterTests() REGISTER_TEST(otbVectorDataProjectionFilter); REGISTER_TEST(otbVectorDataProjectionFilterFromMapToSensor); REGISTER_TEST(otbVectorDataProjectionFilterFromMapToGeo); + REGISTER_TEST(otbVectorDataProjectionFilterFromMapToImage); REGISTER_TEST(otbGeocentricTransformNew); REGISTER_TEST(otbGeocentricTransform); REGISTER_TEST(otbVectorDataExtractROIandProjection); diff --git a/Testing/Code/Projections/otbVectorDataProjectionFilterFromMapToImage.cxx b/Testing/Code/Projections/otbVectorDataProjectionFilterFromMapToImage.cxx new file mode 100644 index 0000000000000000000000000000000000000000..df59f989f2e0c53592a54b9e368d55ee43f7fef0 --- /dev/null +++ b/Testing/Code/Projections/otbVectorDataProjectionFilterFromMapToImage.cxx @@ -0,0 +1,75 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "itkExceptionObject.h" +#include "otbVectorDataProjectionFilter.h" +#include "otbVectorData.h" +#include "otbVectorDataFileReader.h" +#include "otbVectorDataFileWriter.h" + +#include "otbImage.h" +#include "otbImageFileReader.h" + +int otbVectorDataProjectionFilterFromMapToImage(int argc, char * argv[]) +{ + + if (argc < 4 ) + { + std::cout << argv[0] <<" <input vector filename> <input image filename>" + << " <output vector filename> " << std::endl; + + return EXIT_FAILURE; + } + + typedef otb::VectorData<double > InputVectorDataType; + typedef otb::VectorData<double > OutputVectorDataType; + + + typedef otb::VectorDataFileReader<InputVectorDataType> VectorDataFileReaderType; + VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New(); + + reader->SetFileName(argv[1]); + reader->UpdateOutputInformation(); + + + typedef otb::Image<unsigned short int, 2> ImageType; + typedef otb::ImageFileReader<ImageType> ImageReaderType; + ImageReaderType::Pointer imageReader = ImageReaderType::New(); + imageReader->SetFileName(argv[2]); + imageReader->UpdateOutputInformation(); + + + typedef otb::VectorDataProjectionFilter<InputVectorDataType,OutputVectorDataType> VectorDataFilterType; + + VectorDataFilterType::Pointer vectorDataProjection = VectorDataFilterType::New(); + + vectorDataProjection->SetInput(reader->GetOutput()); + + vectorDataProjection->SetOutputProjectionRef(imageReader->GetOutput()->GetProjectionRef()); + vectorDataProjection->SetOutputOrigin(imageReader->GetOutput()->GetOrigin()); + vectorDataProjection->SetOutputSpacing(imageReader->GetOutput()->GetSpacing()); + + + typedef otb::VectorDataFileWriter<OutputVectorDataType> VectorDataFileWriterType; + VectorDataFileWriterType::Pointer writer = VectorDataFileWriterType::New(); + writer->SetFileName(argv[3]); + writer->SetInput(vectorDataProjection->GetOutput()); + writer->Update(); + + + return EXIT_SUCCESS; +} diff --git a/Utilities/dxflib/CMakeLists.txt b/Utilities/dxflib/CMakeLists.txt index e4df2ad34b7f2c9fa8d2e6ee7fa02057b0fdac9e..867243ef4ac995141157ebfa6dda69feb8464a08 100644 --- a/Utilities/dxflib/CMakeLists.txt +++ b/Utilities/dxflib/CMakeLists.txt @@ -2,7 +2,7 @@ PROJECT(dxflib) FILE(GLOB dxflib_SRCS "*.cpp") ADD_LIBRARY(dxf ${dxflib_SRCS}) -TARGET_LINK_LIBRARIES(dxf) + IF(OTB_LIBRARY_PROPERTIES) SET_TARGET_PROPERTIES(dxf PROPERTIES ${OTB_LIBRARY_PROPERTIES}) ENDIF(OTB_LIBRARY_PROPERTIES) diff --git a/Utilities/otbconfigfile/CMakeLists.txt b/Utilities/otbconfigfile/CMakeLists.txt index dd622f9749c55741eda9b899a5766712e675d2bf..245153a5e402a6c3524bcccd4e6eb6eea1be8f57 100644 --- a/Utilities/otbconfigfile/CMakeLists.txt +++ b/Utilities/otbconfigfile/CMakeLists.txt @@ -5,7 +5,6 @@ FILE(GLOB otbconfigfilelib_HDRS "ConfigFile.h") ADD_LIBRARY(otbconfigfile ${otbconfigfilelib_SRCS} ) -TARGET_LINK_LIBRARIES(otbconfigfile ) IF(OTB_LIBRARY_PROPERTIES) SET_TARGET_PROPERTIES(otbconfigfile PROPERTIES ${OTB_LIBRARY_PROPERTIES}) ENDIF(OTB_LIBRARY_PROPERTIES) diff --git a/Utilities/otbossim/CMakeLists.txt b/Utilities/otbossim/CMakeLists.txt index 4764d625f5bb91b6cdff97c54cdeb66fea88df7a..e6b2ca5c74ead4ed1d7423815901d7cbe35ff838 100644 --- a/Utilities/otbossim/CMakeLists.txt +++ b/Utilities/otbossim/CMakeLists.txt @@ -139,9 +139,15 @@ IF(NOT OTB_DISABLE_UTILITIES_COMPILATION) ${ossim_projection_SRCS} ${ossim_imaging_SRCS} ${ossim_parallel_SRCS} - ${ossim_elevation_SRCS} + ${ossim_elevation_SRCS}) + + SET_TARGET_PROPERTIES(otbossim + PROPERTIES + LINK_INTERFACE_LIBRARIES "" ) - TARGET_LINK_LIBRARIES(otbossim ${TIFF_LIBRARY} ${GEOTIFF_LIBRARY} ${JPEG_LIBRARY} ${OPENTHREADS_LIBRARY}) +# TARGET_LINK_LIBRARIES(otbossim ${GDAL_LIBRARY})#To make sure that gdal appear before geotiff +# TARGET_LINK_LIBRARIES(otbossim ${JPEG_LIBRARY} ${TIFF_LIBRARY} ${GEOTIFF_LIBRARY} ${OPENTHREADS_LIBRARY}) + TARGET_LINK_LIBRARIES(otbossim ${OPENTHREADS_LIBRARY}) IF(NOT OTB_INSTALL_NO_LIBRARIES) INSTALL(TARGETS otbossim diff --git a/Utilities/otbossimplugins/CMakeLists.txt b/Utilities/otbossimplugins/CMakeLists.txt index 87dac26d4fd7173900b2b1970b54622e01bb857e..b2e4ac195b3a8719b7707a764a346ef726153f54 100644 --- a/Utilities/otbossimplugins/CMakeLists.txt +++ b/Utilities/otbossimplugins/CMakeLists.txt @@ -23,9 +23,8 @@ SET(ossimplugins_SOURCES ${ossimplugins_ossim_SRCS} ) - ADD_LIBRARY(otbossimplugins ${ossimplugins_SOURCES} ) -TARGET_LINK_LIBRARIES(otbossimplugins ${GDAL_LIBRARY} otbossim) +#TARGET_LINK_LIBRARIES(otbossimplugins ${GDAL_LIBRARY} otbossim) IF(OTB_LIBRARY_PROPERTIES) SET_TARGET_PROPERTIES(otbossimplugins PROPERTIES ${OTB_LIBRARY_PROPERTIES}) ENDIF(OTB_LIBRARY_PROPERTIES)