diff --git a/Code/Common/CMakeLists.txt b/Code/Common/CMakeLists.txt
index 7f516a7943a45c6104a5ee113d9c591a350442f6..c6f7d53028f19c5f6159a2602b621b6ceb7f2560 100644
--- a/Code/Common/CMakeLists.txt
+++ b/Code/Common/CMakeLists.txt
@@ -19,7 +19,7 @@ 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 pqxx)
+    TARGET_LINK_LIBRARIES(OTBCommon ${PQ_LIBRARY} ${PQXX_LIBRARY})
 ENDIF(OTB_USE_PQXX)
 
 IF(OTB_I18N)
diff --git a/Code/IO/CMakeLists.txt b/Code/IO/CMakeLists.txt
index 5d296cf6f17f50443a95dc9357f04add50560d89..876326d9ba1326e87ad025fd30c6f8db54de6aee 100644
--- a/Code/IO/CMakeLists.txt
+++ b/Code/IO/CMakeLists.txt
@@ -30,7 +30,9 @@ ENDIF(OTB_COMPILE_JPEG2000)
 
 
 ADD_LIBRARY(OTBIO ${OTBIO_SRCS})
-TARGET_LINK_LIBRARIES (OTBIO OTBCommon ${GDAL_LIBRARY} ${OGR_LIBRARY} otbossim otbossimplugins ITKIO ITKCommon dxf otbkml)
+TARGET_LINK_LIBRARIES (OTBIO ${GDAL_LIBRARY} ${OGR_LIBRARY} OTBCommon)
+TARGET_LINK_LIBRARIES (OTBIO otbossim otbossimplugins ITKIO ITKCommon dxf otbkml)
+
 IF (OTB_USE_LIBLAS)
     TARGET_LINK_LIBRARIES(OTBIO otbliblas)
 ENDIF(OTB_USE_LIBLAS)
diff --git a/Code/Radiometry/CMakeLists.txt b/Code/Radiometry/CMakeLists.txt
index b14a18b2ed6882f86f615cf5bf46cf7e5745e8a7..f280fb3030d44de59074b62fb763b229271eccff 100644
--- a/Code/Radiometry/CMakeLists.txt
+++ b/Code/Radiometry/CMakeLists.txt
@@ -3,7 +3,9 @@
 FILE(GLOB OTBRadiometry_SRCS "*.cxx" )
 
 ADD_LIBRARY(OTBRadiometry ${OTBRadiometry_SRCS})
-TARGET_LINK_LIBRARIES (OTBRadiometry OTBCommon otb6S otbossim)
+
+#Note: depend on OTBIO instead of otbossim to keep the correct order between gdal and ossim
+TARGET_LINK_LIBRARIES (OTBRadiometry OTBCommon otb6S OTBIO)
 IF(OTB_LIBRARY_PROPERTIES)
   SET_TARGET_PROPERTIES(OTBRadiometry PROPERTIES ${OTB_LIBRARY_PROPERTIES})
 ENDIF(OTB_LIBRARY_PROPERTIES)