MESSAGE("Specialized FindMapServer Called")

if( NOT $ENV{MAPSERVER_LIBRARY} STREQUAL "" )
  SET(MAPSERVER_LIBRARY  $ENV{MAPSERVER_LIBRARY})

  if( NOT $ENV{MAPSERVER_INCLUDE_DIR} STREQUAL "" )
     SET(MAPSERVER_INCLUDE_DIR  $ENV{MAPSERVER_INCLUDE_DIR})
  else()
     SET(MAPSERVER_INCLUDE_DIR "MapServerIncDir")
  endif()
  SET(MAPSERVER_INCLUDE_DIRS ${MAPSERVER_INCLUDE_DIR})
  SET(MAPSERVER_LIBRARYS ${MAPSERVER_LIBRARY})

  MARK_AS_ADVANCED(MAPSERVER_LIBRARY MAPSERVER_INCLUDE_DIR)
  SET(MAPSERVER_FOUND TRUE)
  MESSAGE("FindMapSever Set By Envionment")

else()

FIND_PATH(MAPSERVER_INCLUDE_DIR
    NAMES mapserver.h
    PATH_SUFFIXES mapserver
)

FIND_LIBRARY(MAPSERVER_LIBRARY
    NAMES mapserver
)

set(MAPSERVER_INCLUDE_DIRS ${MAPSERVER_INCLUDE_DIR})
set(MAPSERVER_LIBRARIES ${MAPSERVER_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MAPSERVER DEFAULT_MSG MAPSERVER_LIBRARY MAPSERVER_INCLUDE_DIR)
mark_as_advanced(MAPSERVER_LIBRARY MAPSERVER_INCLUDE_DIR)
endif()

