PROJECT(wms)

INCLUDE(OssimVersion)
INCLUDE(OssimUtilities)
INCLUDE(OssimCommonVariables)

IF(NOT APPLE)
  cmake_minimum_required(VERSION 2.6)
ELSE(NOT APPLE)
  cmake_minimum_required(VERSION 2.8)
ENDIF(NOT APPLE)

find_package(CURL)
find_package(EXPAT)

MESSAGE( STATUS "CURL_INCLUDE_DIR = ${CURL_INCLUDE_DIR}")
MESSAGE( STATUS "CURL_LIBRARIES   = ${CURL_LIBRARIES}")
MESSAGE( STATUS "EXPAT_INCLUDE_DIR = ${EXPAT_INCLUDE_DIR}")
MESSAGE( STATUS "EXPAT_LIBRARIES   = ${EXPAT_LIBRARIES}")

################################################## BUILD THE LIBRARY #######################################
SET(LIB_NAME wms)

INCLUDE_DIRECTORIES(${${PROJECT_NAME}_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})


FILE(GLOB WMS_SRCS RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
FILE(GLOB WMS_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/wms/*.h")

SET(INSTALL_INCLUDE_DIR "include/wms")

OSSIM_LINK_LIBRARY(${LIB_NAME} COMPONENT_NAME ossimPredator TYPE "${OSSIM_USER_DEFINED_DYNAMIC_OR_STATIC}" HEADERS ${WMS_HEADERS} SOURCE_FILES ${WMS_SRCS} 
                   LIBRARIES  ${CURL_LIBRARIES} ${EXPAT_LIBRARIES}
                   INSTALL_LIB INSTALL_HEADERS VERSION_SYMLINKS ADDITIONAL_COMPILE_FLAGS "-DWMS_LIBRARY")

####################################### SETUP THE UNINSTALL #################################
OSSIM_ADD_COMMON_MAKE_UNINSTALL()