Commit 65f112f5 authored by Thomas Feuvrier's avatar Thomas Feuvrier

ENH: Add TRY_COMPILE when External Boost library is selected. If the...

ENH: Add TRY_COMPILE when External Boost library is selected. If the compilation aborted, then the internal boost library is used, and OTB_USE_EXTERNAL_BOOST cmake value is force to OFF.
parent 8273971b
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
int
main(int argc, char *argv[])
{
return 1;
}
......@@ -435,6 +435,20 @@ ENDIF(OTB_USE_MAPNIK)
IF(OTB_USE_EXTERNAL_BOOST)
FIND_PACKAGE(Boost)
TRY_COMPILE(BOOST_IS_COMPLETE
${CMAKE_CURRENT_BINARY_DIR}/CMake
${CMAKE_CURRENT_SOURCE_DIR}/CMake/otbTestCompileBoost.cxx
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${Boost_INCLUDE_DIR}"
OUTPUT_VARIABLE OUTPUT)
IF(BOOST_IS_COMPLETE)
MESSAGE(STATUS "Testing external Boost library -- yes")
ELSE(BOOST_IS_COMPLETE)
MESSAGE(STATUS "Testing external Boost library -- no")
MESSAGE(STATUS "Force the OTB_USE_EXTERNAL_BOOST value to OFF.")
SET(OTB_USE_EXTERNAL_BOOST OFF)
ENDIF(BOOST_IS_COMPLETE)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
ENDIF(OTB_USE_EXTERNAL_BOOST)
......
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