project(mml)

cmake_minimum_required(VERSION 2.6)

#set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Verbose makefile" FORCE)

# Is this tool is compiled inside or outside CAMITK (as a standalone)?
if (NOT CAMITK_SOURCE_DIR)
  # if this tool is compiled independantly from CamiTK
  set(MML_STANDALONE ON CACHE BOOL "ON only if MML compiled outside CAMITK")
  message(SEND_ERROR "Compilation of MML outside CamiTK not implemented yet. Please contact authors")
endif()

# find xml2
find_package(Xml2 REQUIRED)

# Find Xerces-C
find_package(XercesC REQUIRED)

set(MML_LIB_DIRECTORIES ${CAMITK_LIB_DIRECTORIES})

set(MML_INCLUDE_DIRECTORIES
  ${CAMITK_INCLUDE_DIRECTORIES}
  ${CAMITK_INCLUDE_DIR}/monitoring
  ${CAMITK_INCLUDE_DIR}/mml
  ${CAMITK_INCLUDE_DIR}/pml
  ${CAMITK_INCLUDE_DIR}/lml
  ${LIBXML2_INCLUDE_DIR}
  ${XERCESC_INCLUDE_DIR}
)

set(MML_LIBRARIES
  ${LIBXML2_LIBRARIES}
  ${XERCESC_LIBRARIES}
)

#-----------
# 64bits
#-----------
# this is needed on 64bits processor to avoid relocation R_X86_64_32 error
if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
  add_definitions(-fPIC)
endif( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )

# default list of subdirectory
add_subdirectory(schema)
add_subdirectory(monitoring)
add_subdirectory(applications)
