project(ITKIOOpenSlide)
set(ITKIOOpenSlide_LIBRARIES ITKIOOpenSlide)

set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH} )
find_package( OpenSlide REQUIRED )
if( NOT OPENSLIDE_FOUND )
  message( FATAL_ERROR
    "Please specify OPENSLIDE_LIBRARY and OPENSLIDE_INCLUDE_DIR.")
endif()

itk_module_impl()

cmake_minimum_required(VERSION 2.8.9)
project(ITKIOOpenSlide)
set(ITKIOOpenSlide_LIBRARIES ITKIOOpenSlide)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package( OpenSlide REQUIRED )
if(NOT OPENSLIDE_FOUND)
  message(FATAL_ERROR "Please specify OPENSLIDE_LIBRARY and OPENSLIDE_INCLUDE_DIR.")
endif()

if(NOT ITK_SOURCE_DIR)
  find_package(ITK 4.9 REQUIRED)
  list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
  include(ITKModuleExternal)
else()
  itk_module_impl()
endif()

Make it possible to build the module externally against ITK.
ENH: Make it possible to build the module externally against ITK.

See:

  https://www.kitware.com/blog/home/post/997
