diff --git a/CMakeLists.txt b/CMakeLists.txt index 23e705b289e5c349d3784a2519d49dced0971d65..a8ddbcc84da8e586cb5a365409edd63c9cb728df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -230,7 +230,7 @@ ENDIF(OTB_COMPILE_JPEG2000) IF(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake") FIND_PACKAGE(OpenThreads) ELSE(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake") - INCLUDE(${OTB_SOURCE_DIR}/FindOpenThreads.cmake) + INCLUDE(${OTB_SOURCE_DIR}/CMake/FindOpenThreads.cmake) ENDIF(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake") SET(OTB_USE_EXTERNAL_OPENTHREADS 1 CACHE INTERNAL "") @@ -286,50 +286,44 @@ IF(OTB_USE_VISU_GUI) #------------------------------- # FLTK Library #------------------------------- + OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." OFF) FIND_PACKAGE(FLTK) IF(FLTK_FOUND) - OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." ON) + SET(OTB_USE_EXTERNAL_FLTK ON) ELSE(FLTK_FOUND) - OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." OFF) + SET(OTB_USE_EXTERNAL_FLTK OFF) ENDIF(FLTK_FOUND) + # Option for internal/external FLTK MARK_AS_ADVANCED(OTB_USE_EXTERNAL_FLTK) - # Add an option to use or not use FLTK (http://www.fltk.org) + IF(OTB_USE_EXTERNAL_FLTK) -# FIND_PACKAGE(FLTK) # Mingw Option doesn't exist in the FindFLTK.cmake default configuration file in CMake installationj directory. # Copy FLTK_PLATFORM_DEPENDENT_LIBS from FLTK CmakeList.txt IF(MINGW) ADD_DEFINITIONS(-DWIN32) SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid wsock32 gdi32 comdlg32) ENDIF(MINGW) - IF (NOT FLTK_INCLUDE_DIR) - SET( FLTK_INCLUDE_DIR /usr/include ) - FIND_PACKAGE(FLTK) - ENDIF(NOT FLTK_INCLUDE_DIR) IF(FLTK_FOUND) - INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIRS}) - LINK_DIRECTORIES(${FLTK_LIBRARY_DIRS}) + INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR}) ELSE(FLTK_FOUND) - MESSAGE(FATAL_ERROR + MESSAGE(FATAL_ERROR "Cannot build OTB project without FLTK. Please set FLTK_DIR or set OTB_USE_VISU to OFF or set OTB_USE_EXTERNAL_FLTK OFF to use INTERNAL FLTK set on OTB/Utilities repository.") ENDIF(FLTK_FOUND) ELSE(OTB_USE_EXTERNAL_FLTK) - + SET(FLTK_INCLUDE_DIR "") + SET(FLTK_LIBRARIES "") + SET( FLTK_PLATFORM_DEPENDENT_LIBS "") - IF(EXISTS "${OTB_BINARY_DIR}/Utilities/FLTK/FLTKConfig.cmake") - INCLUDE(${OTB_BINARY_DIR}/Utilities/FLTK/FLTKConfig.cmake) - ENDIF(EXISTS "${OTB_BINARY_DIR}/Utilities/FLTK/FLTKConfig.cmake") - #---------------------------------------------------------------- - # RESUME Alls VISU GUI libraries use by OTB in a single VARIABLE - SET(OTB_VISU_GUI_LIBRARIES "${FLTK_LIBRARIES};${OPENGL_LIBRARIES} ") - SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND}) + INCLUDE(${OTB_BINARY_DIR}/Utilities/FLTK/FLTKConfig.cmake) ENDIF(OTB_USE_EXTERNAL_FLTK) + SET(OTB_VISU_GUI_LIBRARIES "${FLTK_LIBRARIES};${OPENGL_LIBRARIES} ") + SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND}) ENDIF(OTB_USE_VISU_GUI) #------------------------------- @@ -1059,7 +1053,7 @@ IF(NOT OTB_INSTALL_NO_DEVELOPMENT) ${OTB_BINARY_DIR}/OTBBuildSettings.cmake ${OTB_BINARY_DIR}/OTBLibraryDepends.cmake ${OTB_BINARY_DIR}/UseOTB.cmake - ${OTB_SOURCE_DIR}/FindOpenThreads.cmake + ${OTB_SOURCE_DIR}/CMake/FindOpenThreads.cmake DESTINATION ${OTB_INSTALL_PACKAGE_DIR_CM24} COMPONENT Development )