#
#	Set default PATH
#
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})

if(DEFINED TANGO_HOME)
	message("-DTANGO_HOME specified in the command line")
else()
	set(TANGO_HOME $ENV{TANGO_HOME})
endif(DEFINED TANGO_HOME)

if(DEFINED TANGO_HOME)
	message("TANGO_HOME = ${TANGO_HOME}")
else()
	set(TANGO_HOME @CMAKE_INSTALL_PREFIX@)
endif(DEFINED TANGO_HOME)

set(ENV{PKG_CONFIG_PATH} "${TANGO_HOME}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")

if(DEFINED OMNI_HOME)
	message("-DOMNI_HOME specified in the command line")
else()
	set(OMNI_HOME $ENV{OMNI_HOME})
endif(DEFINED OMNI_HOME)
if(DEFINED OMNI_HOME)
	message("OMNI_HOME = ${OMNI_HOME}")
	set(ENV{PKG_CONFIG_PATH} "${OMNI_HOME}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
endif(DEFINED OMNI_HOME)


if(DEFINED ZMQ_HOME)
	message("-DZMQ_HOME specified in the command line")
else()
	set(ZMQ_HOME $ENV{ZMQ_HOME})
endif(DEFINED ZMQ_HOME)
if(DEFINED ZMQ_HOME)
	message("ZMQ_HOME = ${ZMQ_HOME}")
	set(ENV{PKG_CONFIG_PATH} "${ZMQ_HOME}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
endif(DEFINED ZMQ_HOME)

#
# Compiler flags
#
set(CMAKE_CXX_FLAGS "${CXXFLAGS_USER}  ${CMAKE_CXX_FLAGS}")

find_package(PkgConfig REQUIRED)
pkg_check_modules(PKG_TANGO REQUIRED tango)

set(TANGO_INCLUDES ${PKG_TANGO_INCLUDE_DIRS})
set(TANGO_LIBS ${PKG_TANGO_LIBRARIES})
set(TANGO_LIB_HOME ${PKG_TANGO_LIBRARY_DIRS})

add_definitions (${PKG_TANGO_CFLAGS_OTHER})
