diff --git a/CMakeLists.txt b/CMakeLists.txt index 89e2e4ffa402178273cca0a30b326e326eae452e..470e9e9443f5725473af02632a7df3a3bc1d0eec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -954,14 +954,28 @@ ENDIF(OTB_USE_VISU_GUI) OPTION(BUILD_EXAMPLES "Build the Examples directory." OFF) +#----------------------------------------------------------------------------- +# The entire OTB tree should use the same include path + +# Create the list of include directories needed for OTB header files. +INCLUDE(${OTB_SOURCE_DIR}/otbIncludeDirectories.cmake) + +# This should be the only INCLUDE_DIRECTORIES command in the entire +# tree, except for the Utilities and Wrapping directories. We need to +# do this in one place to make sure the order is correct. +INCLUDE_DIRECTORIES( + ${OTB_INCLUDE_DIRS_BUILD_TREE} + ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX} + ${OTB_INCLUDE_DIRS_SYSTEM} +) + #----------------------------------------------------------------------------- # Dispatch the build into the proper subdirectories. -#Note: SUBDIRS is deprecated and should be replaced by ADD_SUBDIRECTORY -SUBDIRS(Utilities Code) -#ADD_SUBDIRECTORY(Utilities) -#ADD_SUBDIRECTORY(Code) -#ADD_SUBDIRECTORY(Utilities/otbsvm) +#Note: SUBDIRS is deprecated and is replaced by ADD_SUBDIRECTORY +#SUBDIRS(Utilities Code) +ADD_SUBDIRECTORY(Utilities) +ADD_SUBDIRECTORY(Code) IF (BUILD_EXAMPLES) ADD_SUBDIRECTORY(Examples) @@ -1031,16 +1045,16 @@ CONFIGURE_FILE(${OTB_SOURCE_DIR}/otbConfigure.h.in # The entire OTB tree should use the same include path # Create the list of include directories needed for OTB header files. -INCLUDE(${OTB_SOURCE_DIR}/otbIncludeDirectories.cmake) +#INCLUDE(${OTB_SOURCE_DIR}/otbIncludeDirectories.cmake) # This should be the only INCLUDE_DIRECTORIES command in the entire # tree, except for the Utilities and Wrapping directories. We need to # do this in one place to make sure the order is correct. -INCLUDE_DIRECTORIES( - ${OTB_INCLUDE_DIRS_BUILD_TREE} - ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX} - ${OTB_INCLUDE_DIRS_SYSTEM} -) +#INCLUDE_DIRECTORIES( +# ${OTB_INCLUDE_DIRS_BUILD_TREE} +# ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX} +# ${OTB_INCLUDE_DIRS_SYSTEM} +#) #----------------------------------------------------------------------------- # Uninstall cmake use to uninstall OTB. diff --git a/Examples/DataRepresentation/CMakeLists.txt b/Examples/DataRepresentation/CMakeLists.txt index af9cf4a8812b74718a478a364b51ae1326ee335a..0244adc48864c550567371794be9acf7b74834fa 100644 --- a/Examples/DataRepresentation/CMakeLists.txt +++ b/Examples/DataRepresentation/CMakeLists.txt @@ -1,6 +1,4 @@ -SUBDIRS( - Containers - Image - Mesh - Path - ) +ADD_SUBDIRECTORY(Containers) +ADD_SUBDIRECTORY(Image) +ADD_SUBDIRECTORY(Mesh) +ADD_SUBDIRECTORY(Path) diff --git a/otbIncludeDirectories.cmake b/otbIncludeDirectories.cmake index 86c5e08598e051859e18004e1637e21ed53a8202..98fe0a733a26619791a670589d6f2ed242ee1bf1 100644 --- a/otbIncludeDirectories.cmake +++ b/otbIncludeDirectories.cmake @@ -19,7 +19,10 @@ ELSE(OTB_USE_EXTERNAL_BOOST) ) ENDIF(OTB_USE_EXTERNAL_BOOST) - +#----------------------------------------------------------------------------- +# Include directories from the GDAL build tree. +SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} + ${GDAL_INCLUDE_DIR} ) # These directories are always needed. SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} @@ -97,10 +100,7 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} ) -#----------------------------------------------------------------------------- -# Include directories from the GDAL build tree. -SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} - ${GDAL_INCLUDE_DIR} ) + #----------------------------------------------------------------------------- # Include directories from the CURL build tree. IF(OTB_USE_CURL) @@ -221,10 +221,6 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX} ) SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX} ${OTB_GLU_INCLUDE_PATH} ) -#For GDAL header file -SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX} - ${GDAL_INCLUDE_DIR} ) - #For EXPAT header file IF(OTB_USE_EXTERNAL_EXPAT) SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}