#       
#       		File:		 CMakeLists.txt
#           Date:    $Date: $
#           Version: $Revision: $
#           Author:  $Author: $ 
#           ID:      $Id: $
#       
#           File Description
#               Blah blah blah
#       
#           Copyright (c) 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.



ADD_EXECUTABLE( CreateIN CreateIN.cpp CFunction.cpp)
TARGET_LINK_LIBRARIES ( CreateIN ${Boost_LIBRARIES} ${OpenCV_HIGHGUI_LIBRARY} ${OpenCV_CV_LIBRARY} ${OpenCV_CXCORE_LIBRARY} )

 


INSTALL(TARGETS
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
)






link_directories ( ${Boost_LIBRARY_DIRS} )
#install all header files
FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
INSTALL(FILES ${files} DESTINATION include)

#install all template files
FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
INSTALL(FILES ${files} DESTINATION include)

#find all the files that end with ".in"
FILE(GLOB inFiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
    "${CMAKE_CURRENT_SOURCE_DIR}/*.in")

#remove the .in and configure an script librarys/classes for installation
FOREACH(SRC_SCRIPT ${inFiles})

  #Strip of the .in at the end of the file name
  STRING(REGEX MATCH "(.*)\\.in$" source_path "${SRC_SCRIPT}")
  SET(TARG_SCRIPT ${CMAKE_MATCH_1})

  #configure the script to replace the cmake defined things
  CONFIGURE_FILE( ${SRC_SCRIPT} ${EXECUTABLE_OUTPUT_PATH}/${TARG_SCRIPT} @ONLY)
  
  #if this is a unix box make it executable in the local build path
  IF (UNIX)
    EXEC_PROGRAM(chmod ARGS 755 ${EXECUTABLE_OUTPUT_PATH}/${TARG_SCRIPT})
  ENDIF (UNIX)
  
  #install it 
  INSTALL(PROGRAMS
    ${EXECUTABLE_OUTPUT_PATH}/${TARG_SCRIPT}
    DESTINATION bin
  )

ENDFOREACH(SRC_SCRIPT)
