X-Git-Url: http://plrg.eecs.uci.edu/git/?p=junction.git;a=blobdiff_plain;f=cmake%2Fmodules%2FFindTurf.cmake;h=d9a684a175645b5c2b2d0d961d3c093cabc6ca70;hp=eef27498d200bd305196c7731c9ac260fbcc34e2;hb=4249e1abd767b5cbbe9b722710b90ed49cd0390a;hpb=125c4e5e45715acb0444d77db7dfa384cbaff208 diff --git a/cmake/modules/FindTurf.cmake b/cmake/modules/FindTurf.cmake index eef2749..d9a684a 100644 --- a/cmake/modules/FindTurf.cmake +++ b/cmake/modules/FindTurf.cmake @@ -1,25 +1,30 @@ #---------------------------------------------- -# When Turf is found, it's basically as if TurfProjectDefs.cmake was included. +# This find module locates the Turf *source*. # -# Later, this might find binary packages too. +# Later, it might find binary packages too. # # Sets: # TURF_FOUND -# TURF_ROOT - the root folder +# TURF_ROOT - the root folder, containing CMakeLists.txt # TURF_INCLUDE_DIRS - pass to include_directories() -# AddTurfTarget() - call this to actually add the target -# -# You'll want to set the compiler options before calling AddTurfTarget(). #---------------------------------------------- -find_path(TURF_ROOT "turf/Core.h" PATHS - "${CMAKE_CURRENT_SOURCE_DIR}/../turf" - "${CMAKE_SOURCE_DIR}/../turf" - "${CMAKE_CURRENT_LIST_DIR}/../../../turf") - if(TURF_ROOT) - set(TURF_FOUND TRUE) + get_filename_component(fullPath "${TURF_ROOT}" ABSOLUTE) + if(EXISTS "${fullPath}/cmake/turf_config.h.in") + set(TURF_FOUND TRUE) + endif() else() + find_path(TURF_ROOT "cmake/turf_config.h.in" PATHS + "${CMAKE_CURRENT_SOURCE_DIR}/../turf" + "${CMAKE_SOURCE_DIR}/../turf" + "${CMAKE_CURRENT_LIST_DIR}/../../../turf") + if(TURF_ROOT) + set(TURF_FOUND TRUE) + endif() +endif() + +if(NOT TURF_FOUND) message("Can't find Turf!") if(Turf_FIND_REQUIRED) message(FATAL_ERROR "Missing required package Turf")