project(Caelum)

IF(MSVC)
    add_definitions("-D_SCL_SECURE_NO_WARNINGS /wd4305 /wd4244" )
ENDIF(MSVC)

ADD_DEFINITIONS(-DCAELUM_STATIC)
INCLUDE_DIRECTORIES( 
    ${CMAKE_HOME_DIRECTORY}/extern/caelum/include 
    ${OGRE_INCLUDE_DIR}/Ogre
    )    

file(GLOB_RECURSE CAELUM_SRC src/*)
file(GLOB_RECURSE CAELUM_HDR include/*)

set(SOURCES ${CAELUM_SRC} ${CAELUM_HDR})
add_library(caelum STATIC ${SOURCES})

#
# Resources
#
SET(CAELUM_RES_DEST "${OpenMW_BINARY_DIR}")

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/AtmosphereDepth.png "${CAELUM_RES_DEST}/resources/caelum/AtmosphereDepth.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumGroundFog.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumGroundFog.cg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumLayeredClouds.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumLayeredClouds.cg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumPhaseMoon.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumPhaseMoon.cg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumPointStarfield.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumPointStarfield.cg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumSkyDome.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumSkyDome.cg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CloudCoverLookup.png "${CAELUM_RES_DEST}/resources/caelum/CloudCoverLookup.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.cg "${CAELUM_RES_DEST}/resources/caelum/DepthComposer.cg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.compositor "${CAELUM_RES_DEST}/resources/caelum/DepthComposer.compositor" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.material "${CAELUM_RES_DEST}/resources/caelum/DepthComposer.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthRender.program "${CAELUM_RES_DEST}/resources/caelum/DepthRender.program" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/EarthClearSky2.png "${CAELUM_RES_DEST}/resources/caelum/EarthClearSky2.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/GroundFog.material "${CAELUM_RES_DEST}/resources/caelum/GroundFog.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/GroundFog.program "${CAELUM_RES_DEST}/resources/caelum/GroundFog.program" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Haze.program "${CAELUM_RES_DEST}/resources/caelum/Haze.program" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/LayeredClouds.material "${CAELUM_RES_DEST}/resources/caelum/LayeredClouds.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/MinimalCompositorVP.cg "${CAELUM_RES_DEST}/resources/caelum/MinimalCompositorVP.cg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/MinimalCompositorVP.program "${CAELUM_RES_DEST}/resources/caelum/MinimalCompositorVP.program" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/moon.material "${CAELUM_RES_DEST}/resources/caelum/moon.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/moon_disc.dds "${CAELUM_RES_DEST}/resources/caelum/moon_disc.dds" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise1.dds "${CAELUM_RES_DEST}/resources/caelum/noise1.dds" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise2.dds "${CAELUM_RES_DEST}/resources/caelum/noise2.dds" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise3.dds "${CAELUM_RES_DEST}/resources/caelum/noise3.dds" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise4.dds "${CAELUM_RES_DEST}/resources/caelum/noise4.dds" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/PointStarfield.material "${CAELUM_RES_DEST}/resources/caelum/PointStarfield.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.cg "${CAELUM_RES_DEST}/resources/caelum/Precipitation.cg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.compositor "${CAELUM_RES_DEST}/resources/caelum/Precipitation.compositor" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.material "${CAELUM_RES_DEST}/resources/caelum/Precipitation.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_drizzle.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_drizzle.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_hail.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_hail.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_icecrystals.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_icecrystals.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_icepellets.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_icepellets.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_rain.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_rain.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_smallhail.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_smallhail.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_snow.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_snow.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_snowgrains.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_snowgrains.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/SkyDome.material "${CAELUM_RES_DEST}/resources/caelum/SkyDome.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/sphere.mesh "${CAELUM_RES_DEST}/resources/caelum/sphere.mesh" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Starfield.jpg "${CAELUM_RES_DEST}/resources/caelum/Starfield.jpg" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Starfield.material "${CAELUM_RES_DEST}/resources/caelum/Starfield.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Sun.material "${CAELUM_RES_DEST}/resources/caelum/Sun.material" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/SunGradient.png "${CAELUM_RES_DEST}/resources/caelum/SunGradient.png" COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/sun_disc.png "${CAELUM_RES_DEST}/resources/caelum/sun_disc.png" COPYONLY)
