Make Junction installable
[junction.git] / cmake / modules / FindTurf.cmake
1 #----------------------------------------------
2 # This find module locates the Turf *source*.
3 #
4 # Later, it might find binary packages too.
5 #
6 # Sets:
7 #    TURF_FOUND
8 #    TURF_ROOT - the root folder, containing CMakeLists.txt
9 #    TURF_INCLUDE_DIRS - pass to include_directories()
10 #----------------------------------------------
11
12 if(TURF_ROOT)
13     get_filename_component(fullPath "${TURF_ROOT}" ABSOLUTE)
14     if(EXISTS "${fullPath}/cmake/turf_config.h.in")
15         set(TURF_FOUND TRUE)
16     endif()
17 else()
18     find_path(TURF_ROOT "cmake/turf_config.h.in" PATHS
19         "${CMAKE_CURRENT_SOURCE_DIR}/../turf"
20         "${CMAKE_SOURCE_DIR}/../turf"
21         "${CMAKE_CURRENT_LIST_DIR}/../../../turf")
22     if(TURF_ROOT)
23         set(TURF_FOUND TRUE)
24     endif()
25 endif()
26
27 if(NOT TURF_FOUND)
28     message("Can't find Turf!")
29     if(Turf_FIND_REQUIRED)
30         message(FATAL_ERROR "Missing required package Turf")
31     endif()
32 endif()