Something went wrong on our end
-
Martin Beseda authoredMartin Beseda authored
FindTurtle.cmake 1.16 KiB
message("FindTurtle starting...")
# Find headers and libraries
FIND_PATH(
TURTLE_INCLUDE_DIR
NAMES
mock.hpp
HINTS
$ENV{TURTLE_INCLUDE_DIR}
${TURTLE_INCLUDE_DIR}
${ROOT_DIR}/external_dependencies/turtle/
PATHS
/usr
/home
/opt
PATH_SUFFIXES
include
turtle
include/turtle/include/turtle
include/turtle
local
)
# Set TURTLE_FOUND honoring the QUIET and REQUIRED arguments
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
turtle
"Turtle was NOT found!"
TURTLE_INCLUDE_DIR)
# Output variables
IF(TURTLE_FOUND)
# Include dirs
SET(TURTLE_INCLUDE_DIRS ${TURTLE_INCLUDE_DIR})
message("Turtle was successfully found.")
ELSE()
# MESSAGE(FATAL_ERROR "Set, please, the environmental variable TURTLE_INCLUDE_DIR to the folder, where 'mock.hpp' is located...")
ENDIF(TURTLE_FOUND)
# Add path only to the 'include' folder
set(TMP "")
string(REGEX REPLACE "/turtle$" "" TMP ${TURTLE_INCLUDE_DIR})
list(APPEND TURTLE_INCLUDE_DIR ${TMP})
# Advanced options for not cluttering the cmake UIs:
MARK_AS_ADVANCED(TURTLE_INCLUDE_DIR)