include(${CMAKE_SOURCE_DIR}/cmake/CMakeMacroParseArguments.cmake)

IF(NOT EXISTS ${PROJECT_BINARY_DIR}/lib)
  FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
ENDIF(NOT EXISTS ${PROJECT_BINARY_DIR}/lib)

IF(NOT EXISTS ${PROJECT_BINARY_DIR}/include)
  FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include)
ENDIF(NOT EXISTS ${PROJECT_BINARY_DIR}/include)

IF(NOT EXISTS ${PROJECT_BINARY_DIR}/include/yars)
  FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/yars)
ENDIF(NOT EXISTS ${PROJECT_BINARY_DIR}/include/yars)

INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/xml
  CONFIGURATIONS Release Debug
  DESTINATION yars/examples
  )

INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/lib
  CONFIGURATIONS Release Debug
  DESTINATION ${CMAKE_INSTALL_PREFIX}
  FILES_MATCHING PATTERN "libYars*"
  )

INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/
  DESTINATION ${CMAKE_INSTALL_PREFIX}/include
  # CONFIGURATIONS Release Debug
  PATTERN "*.cpp" EXCLUDE
  PATTERN "*.txt" EXCLUDE
  )

INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/contrib/
  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/yars/
  # CONFIGURATIONS Release Debug
  PATTERN "*.cpp" EXCLUDE
  PATTERN "*.txt" EXCLUDE
  )

# file(COPY ${PROJECT_BINARY_DIR}/bin/yars-config
  # DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
  # FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
  # GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
