Commit 2f6bf0da authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

COMP: call find_package(OTB) if needed

parent 72651459
...@@ -10,11 +10,16 @@ endif() ...@@ -10,11 +10,16 @@ endif()
#check if this is a standalone build? #check if this is a standalone build?
find_package(OTB REQUIRED)
message(STATUS "[Examples] Found OTB: ${OTB_USE_FILE}")
if(PROJECT_NAME STREQUAL "OTBExamples") if(PROJECT_NAME STREQUAL "OTBExamples")
if(BUILD_TESTING) if(BUILD_TESTING)
include(CTest) include(CTest)
endif() endif()
include(${OTB_USE_FILE})
# dashboard build. Why do I need to see the deprecated warnings on dashboard! # dashboard build. Why do I need to see the deprecated warnings on dashboard!
# It just fades the actual warnings and most importantly very annoying. # It just fades the actual warnings and most importantly very annoying.
if(NOT "$ENV{DASHBOARD_TEST_FROM_CTEST}" STREQUAL "") if(NOT "$ENV{DASHBOARD_TEST_FROM_CTEST}" STREQUAL "")
...@@ -135,10 +140,6 @@ else() ...@@ -135,10 +140,6 @@ else()
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/OTBManageLargeInputPaths.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/OTBManageLargeInputPaths.cmake)
endif() endif()
find_package(OTB REQUIRED)
include(${OTB_USE_FILE})
message(STATUS "Found OTB: ${OTB_USE_FILE}")
set(OTB_TEST_DRIVER otbTestDriver) set(OTB_TEST_DRIVER otbTestDriver)
if(OTBApplicationEngine_LOADED) if(OTBApplicationEngine_LOADED)
......
##### check if standalone project ######
find_package(OTB REQUIRED) if(NOT PROJECT_NAME)
include(${OTB_USE_FILE}) cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
project(OTBCompletion)
find_package(OTB REQUIRED)
message("OTBCompletion")
include(${OTB_USE_FILE})
endif()
add_executable(completionGenerator EXCLUDE_FROM_ALL completionGenerator.cxx) add_executable(completionGenerator EXCLUDE_FROM_ALL completionGenerator.cxx)
target_link_libraries(completionGenerator ${OTB_LIBRARIES}) target_link_libraries(completionGenerator ${OTB_LIBRARIES})
......
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