########################################################################
#
#    Date:    $Date$
#    Version: $Revision$
#    Author:  $Author$ 
#    ID:      $Id$
#
#    File Description
#        Blah blah blah
#
#    Copyright (c) Blah Blah Blah
#    
#    This software is distributed WITHOUT ANY WARRANTY; without even
#    the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#    PURPOSE.  See the above copyright notices for more information.
########################################################################

PROJECT( ProjectTemplate )

cmake_minimum_required(VERSION 2.6)
SET(PROJECT_VERSION 0.0.0)

#add #defines, for the Project Name and the Project Release
ADD_DEFINITIONS(-DPROJECT_NAME="${PROJECT_NAME}")
ADD_DEFINITIONS(-DPROJECT_VERSION="${PROJECT_VERSION}")

#find the sbiaDefs.cmake file in the system places
find_file(SBIADEFS_file sbiaDefs.cmake)
  
IF (NOT SBIADEFS_file)
  SET(SBIADEFS_file ${PROJECT_SOURCE_DIR}/cmake_modules/sbiaDefs.cmake
   CACHE FILEPATH "location of sbiaDefs.cmake" FORCE)
  MESSAGE (STATUS "Can't find global sbiaDefs.cmake. Using local (project) version.")
ENDIF (NOT SBIADEFS_file)

MARK_AS_ADVANCED ( SBIADEFS_file ) #we don't want to see this in the GUI

IF (EXISTS "${SBIADEFS_file}")
  INCLUDE (${SBIADEFS_file})
ELSE (EXISTS "${SBIADEFS_file}")
  MESSAGE (FATAL_ERROR "Can't Find ANY sbiaDefs.cmake. There should be one in Cmake Directory?")
ENDIF (EXISTS "${SBIADEFS_file}")

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/")

SET (BUILD_TEST ON CACHE BOOL "Do you want to build tests")
SET (BUILD_DOC  ON CACHE BOOL "Do you want to build Documentation (Needs Doxygen) ")

############################
### EDIT FROM HERE DOWN ####
############################

#here you can use cmake to find your dependancies
#see the CMakeProjectTemplateExample for an example usage

#You may need to change this based on where stuff is loacted
#this is where the *.h s are!
SET( ${PROJECT_NAME}_INCLUDES
  Code/Source
)

#You will have to set thie to your actuall project name
#for eaxmple this porjects is called "ProjectTemplate" since that is
#what is in the PROJECT call (at the begining of the File
#so this line would be
INCLUDE_DIRECTORIES( ${${PROJECT_NAME}_INCLUDES} )
#FIND_PACKAGE ( ITK )
#IF ( ITK_FOUND )
#      INCLUDE( ${USE_ITK_FILE} )
#ENDIF( ITK_FOUND )

#FIND_PACKAGE ( Boost )
#IF ( Boost_FOUND )
   #   link_directories ( ${Boost_LIBRARY_DIRS} )
 #     include_directories ( ${Boost_INCLUDE_DIRS} )
#ENDIF( Boost_FOUND )

#FIND_PACKAGE( Lapack )
#IF (Lapack_FOUND)
#link_libraries( ${LAPACK_LIBS}  ) 
#include_directories(  ${CBLAS_INCLUDES}  ) 
     #ENDIF (Lapack_FOUND)

#ADD_SUBDIRECTORY(Utilities)
#INCLUDE_DIRECTORIES( ${UTILITIES_INCLUDES} )

FIND_PACKAGE ( OpenCV )
IF ( OpenCV_FOUND )

#message( "found boost: ${OpenCV_CV_INCLUDE_DIR}" )
#message( "found boost: ${OpenCV_HIGHGUI_LIBRARY}" )  
#message( "found boost: ${OpenCV_CV_LIBRARY}" )
#message( "found boost: ${OpenCV_CXCORE_LIBRARY}" )
#message( "found boost: ${OpenCV_CV_INCLUDE_DIR}" )

	INCLUDE_DIRECTORIES(${OpenCV_CV_INCLUDE_DIR})
      #INCLUDE( ${USE_OpenCV_FILE} )
ENDIF( OpenCV_FOUND )
#ENABLE_TESTING()





ADD_SUBDIRECTORY(Code)

IF (BUILD_TEST)
  ADD_SUBDIRECTORY(Testing)
ENDIF (BUILD_TEST)

IF (BUILD_DOC)
  ADD_SUBDIRECTORY(Doc)
ENDIF (BUILD_DOC)
