Commit 4f73de89cc8102fdac17eeddb06a5babc5549c9b

Authored by Jordi Inglada
1 parent 26cb5321
Exists in master and in 1 other branch avignon

COMP: build as an external module

Showing 1 changed file with 17 additions and 9 deletions   Show diff stats
CMakeLists.txt
... ... @@ -11,21 +11,29 @@
11 11 # PURPOSE. See the above copyright notices for more information.
12 12 #
13 13 # =========================================================================
  14 +cmake_minimum_required(VERSION 3.0)
14 15 project(OTBBioVars)
15 16  
16 17 set(CMAKE_MODULE_PATH ${OTBBioVars_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH})
17   -# find_package(GSL)
18   -# if(GSL_FOUND)
19   -# message("-- Using GSL. Your OTB will be under the GNU GPL License or better.")
20   -# else(GSL_FOUND)
21   -# message(FATAL_ERROR "GSL not found but needed for spline interpolation.")
22   -# endif(GSL_FOUND)
23   -
24   -# include_directories(${GSL_INCLUDE_DIRS})
25 18  
26 19 message("-- Using OTBBioVars. Your OTB will be under the Affero GNU GPL License or better.")
27 20  
28   -otb_module_impl()
  21 +if(NOT OTB_SOURCE_DIR)
  22 + find_package(GSL)
  23 + if(GSL_FOUND)
  24 + message("-- Using GSL. Your OTB will be under the GNU GPL License or better.")
  25 + else(GSL_FOUND)
  26 + message(FATAL_ERROR "GSL not found but needed for spline interpolation.")
  27 + endif(GSL_FOUND)
  28 + include_directories(${GSL_INCLUDE_DIRS})
  29 +
  30 + find_package(OTB REQUIRED)
  31 + list(APPEND CMAKE_MODULE_PATH ${OTB_CMAKE_DIR})
  32 + include(OTBModuleExternal)
  33 +else()
  34 + otb_module_impl()
  35 +endif()
  36 +
29 37  
30 38  
31 39  
... ...