Commit 4ea12b22 authored by Manuel Grizonnet's avatar Manuel Grizonnet

BUG: Mantis 950 - compatibility with cmake 3.0

Drop reference to cmake macro CMAKE_IMPORT_BUILD_SETTINGS and
CMAKE_EXPORT_BUILD_SETTINGS. Those macros seems to do nothing since CMake
2.8. It should allow to compile current trunk with cmake 3.0 wainting for the
new modular OTB which rewrite completely cmake configuration.
parent 54bc1795
......@@ -39,7 +39,10 @@ set(OTB_VERSION_STRING "@OTB_VERSION_STRING@")
set(OTB_USE_FILE "@OTB_USE_FILE@")
# The build settings file.
set(OTB_BUILD_SETTINGS_FILE "@OTB_BUILD_SETTINGS_FILE@")
#Comment Import/Export of build settings as it as been dropped by cmake
# https://github.com/Kitware/CMake/commit/fd47a2ae966c3ac1fac1ee699728c55862fb23a2
#It is still used?
#set(OTB_BUILD_SETTINGS_FILE "@OTB_BUILD_SETTINGS_FILE@")
# Whether OTB was built with shared libraries.
set(OTB_BUILD_SHARED_LIBS "@OTB_BUILD_SHARED_LIBS@")
......
......@@ -5,10 +5,14 @@
# obtained from OTBConfig.cmake.
#
if(OTB_BUILD_SETTINGS_FILE)
include(${CMAKE_ROOT}/Modules/CMakeImportBuildSettings.cmake)
CMAKE_IMPORT_BUILD_SETTINGS(${OTB_BUILD_SETTINGS_FILE})
endif()
#Comment Import/Export of build settings as it as been dropped by cmake
# https://github.com/Kitware/CMake/commit/fd47a2ae966c3ac1fac1ee699728c55862fb23a2
#It is still used?
#
# if(OTB_BUILD_SETTINGS_FILE)
# include(${CMAKE_ROOT}/Modules/CMakeImportBuildSettings.cmake)
# CMAKE_IMPORT_BUILD_SETTINGS(${OTB_BUILD_SETTINGS_FILE})
# endif()
# Add compiler flags needed to use OTB.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OTB_REQUIRED_C_FLAGS}")
......
......@@ -12,7 +12,10 @@ set(OTB_USE_FILE ${OTB_BINARY_DIR}/UseOTB.cmake)
set(OTB_LIBRARY_DEPENDS_FILE ${OTB_BINARY_DIR}/OTBLibraryDepends.cmake)
# The build settings file.
set(OTB_BUILD_SETTINGS_FILE ${OTB_BINARY_DIR}/OTBBuildSettings.cmake)
#Comment Import/Export of build settings as it as been dropped by cmake
# https://github.com/Kitware/CMake/commit/fd47a2ae966c3ac1fac1ee699728c55862fb23a2
#It is still used?
#set(OTB_BUILD_SETTINGS_FILE ${OTB_BINARY_DIR}/OTBBuildSettings.cmake)
# Library directory.
set(OTB_LIBRARY_DIRS_CONFIG ${OTB_LIBRARY_PATH})
......@@ -44,7 +47,7 @@ set(OTB_LIBRARY_DEPENDS_FILE "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/
set(OTB_USE_FILE \${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/UseOTB.cmake)
# The build settings file.
set(OTB_BUILD_SETTINGS_FILE \${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/OTBBuildSettings.cmake)
#set(OTB_BUILD_SETTINGS_FILE \${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/OTBBuildSettings.cmake)
# Include directories.
......
......@@ -359,9 +359,14 @@ configure_file(${OTB_SOURCE_DIR}/CMake/UseOTB.cmake.in
configure_file(${OTB_SOURCE_DIR}/CMake/OTBWrapperMacros.cmake
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/OTBWrapperMacros.cmake COPYONLY IMMEDIATE)
# The command CMAKE_EXPORT_BUILD_SETTINGS(...) was used by
# OTB to generate this file. As of CMake 2.8 the
# functionality of this command has been dropped as it was deemed
# harmful (confusing users by changing their compiler).
# Save the compiler settings so another project can import them.
include(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake)
CMAKE_EXPORT_BUILD_SETTINGS(${OTB_BINARY_DIR}/OTBBuildSettings.cmake)
#include(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake)
#CMAKE_EXPORT_BUILD_SETTINGS(${OTB_BINARY_DIR}/OTBBuildSettings.cmake)
# Save library dependencies.
export_library_dependencies(${OTB_BINARY_DIR}/OTBLibraryDepends.cmake)
......@@ -371,7 +376,6 @@ include(${OTB_SOURCE_DIR}/CMake/otbGenerateOTBConfig.cmake)
if(NOT OTB_INSTALL_NO_DEVELOPMENT)
install(FILES
${OTB_BINARY_DIR}/OTBBuildSettings.cmake
${OTB_BINARY_DIR}/OTBLibraryDepends.cmake
${OTB_BINARY_DIR}/UseOTB.cmake
${OTB_SOURCE_DIR}/CMake/OTBWrapperMacros.cmake
......
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