diff options
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/FindTut.cmake | 31 | ||||
-rw-r--r-- | indra/cmake/Tut.cmake | 10 |
2 files changed, 39 insertions, 2 deletions
diff --git a/indra/cmake/FindTut.cmake b/indra/cmake/FindTut.cmake new file mode 100644 index 0000000000..b5d58f6396 --- /dev/null +++ b/indra/cmake/FindTut.cmake @@ -0,0 +1,31 @@ +# -*- cmake -*- + +# - Find Tut +# Find the Tut unit test framework includes and library +# This module defines +# TUT_INCLUDE_DIR, where to find tut.h, etc. +# TUT_FOUND, If false, do not try to use Tut. + +find_path(TUT_INCLUDE_DIR tut.h + /usr/local/include/ + /usr/include + ) + +if (TUT_INCLUDE_DIR) + set(TUT_FOUND "YES") +else (TUT_INCLUDE_DIR) + set(TUT_FOUND "NO") +endif (TUT_INCLUDE_DIR) + +if (TUT_FOUND) + if (NOT TUT_FIND_QUIETLY) + message(STATUS "Found Tut: ${TUT_INCLUDE_DIR}") + set(TUT_FIND_QUIETLY TRUE) # Only alert us the first time + endif (NOT TUT_FIND_QUIETLY) +else (TUT_FOUND) + if (TUT_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Tut") + endif (TUT_FIND_REQUIRED) +endif (TUT_FOUND) + +mark_as_advanced(TUT_INCLUDE_DIR) diff --git a/indra/cmake/Tut.cmake b/indra/cmake/Tut.cmake index 7488e9dcb0..784560471d 100644 --- a/indra/cmake/Tut.cmake +++ b/indra/cmake/Tut.cmake @@ -1,6 +1,12 @@ # -*- cmake -*- include(Prebuilt) -if (NOT STANDALONE) +set(TUT_FIND_REQUIRED TRUE) +set(TUT_FIND_QUIETLY TRUE) + +if (STANDALONE) + include(FindTut) + include_directories(${TUT_INCLUDE_DIR}) +else (STANDALONE) use_prebuilt_binary(tut) -endif(NOT STANDALONE) +endif (STANDALONE) |