project(lcms)

cmake_minimum_required(VERSION 2.6)

option(BUILD_TOOLS "build jpegicc, tifficc and tiffdiff" ON)
option(BUILD_TESTS "build test application" ON)
option(BUILD_SAMPLES "build sample applications" ON)

if(BUILD_TESTS)
    enable_testing()
endif(BUILD_TESTS)

include_directories(
${CMAKE_BINARY_DIR}/include 
${CMAKE_SOURCE_DIR}/include
)

add_definitions(-DLCMS_DLL)

add_subdirectory(src)

if(BUILD_TOOLS)
    find_package(JPEG)
    find_package(TIFF)

    if(JPEG_FOUND)
        add_subdirectory(jpegicc)
    endif(JPEG_FOUND)

    if(TIFF_FOUND)
        add_subdirectory(tifficc)
    endif(TIFF_FOUND)
endif(BUILD_TOOLS)

if(BUILD_SAMPLES)
    add_subdirectory(samples)
endif(BUILD_SAMPLES)

if(BUILD_TESTS)
    add_subdirectory(testbed)
endif(BUILD_TESTS)
