Commit e51f6ebf authored by Antoine Regimbeau's avatar Antoine Regimbeau

Clear status of BUILD_SHARED, future work: get rid of OTB_BUILD_SHARED_LIBS

parent 6b995b4c
......@@ -33,12 +33,17 @@ if(NOT OTB_VERSION VERSION_GREATER "5.2")
endif()
if(NOT EXISTS ${OTB_CMAKE_DIR}/OTBModuleMacros.cmake)
if(NOT OTB_BUILD_MODULE_AS_STANDALONE)
message(FATAL_ERROR "Modules can only be built against an OTB build tree; they cannot be built against an OTB install tree. You can build your module as a standalone CMake project instead, by activating the BUILD_MODULE_AS_STANDALONE option. Beware that dependency between remote modules will NOT be tracked.")
message(FATAL_ERROR "Modules can only be built against an OTB build tree; \
they cannot be built against an OTB install tree. You can build your module \
as a standalone CMake project instead, by activating the \
BUILD_MODULE_AS_STANDALONE option. Beware that dependency between remote \
modules will NOT be tracked.")
endif()
endif()
if(OTB_BUILD_MODULE_AS_STANDALONE)
message(STATUS "You are building this module as a standalone CMake project. Beware that dependencies to other remote modules will not be tracked.")
message(STATUS "You are building this module as a standalone CMake project. \
Beware that dependencies to other remote modules will not be tracked.")
include(OTBStandaloneModuleMacros)
otb_module_impl()
else()
......@@ -86,7 +91,8 @@ else()
set(CMAKE_EXE_LINKER_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
option(BUILD_SHARED_LIBS "Build OTB with shared libraries." ${OTB_BUILD_SHARED})
option(BUILD_SHARED_LIBS "Build with shared libraries." ${OTB_BUILD_SHARED})
mark_as_advanced(BUILD_SHARED_LIBS)
# Add the OTB_MODULES_DIR to the CMAKE_MODULE_PATH and then use the binary
# directory for the project to write out new ones to.
......
......@@ -210,6 +210,9 @@ endmacro()
# TODO : handle shared libs on windows
option(BUILD_SHARED_LIBS "Build OTB with shared libraries." ON)
mark_as_advanced(BUILD_SHARED_LIBS)
# The following variable can be deleted and replace by BUILD_SHARED_LIBS
# in otbConfigure.h.in
set(OTB_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
......
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