#=============================================================================
#
# file :        CMakeLists.txt
#
# description : File to generate a TANGO device server using cmake.
#
# project :     MegaCoffee3k
#
#=============================================================================
#                This file is generated by POGO
#        (Program Obviously used to Generate tango Object)
#=============================================================================
#
#

cmake_minimum_required (VERSION 3.18...3.26 FATAL_ERROR)
set(CMAKE_SKIP_RPATH true)

# Windows cmakelists

# MAKE_ENV is the path to find the common environment to build the project
#
if (DEFINED ENV{MAKE_ENV})
    set(MAKE_ENV $ENV{MAKE_ENV})
else()
    set(MAKE_ENV /opt/homebrew/Caskroom/mambaforge/base/envs/pogo/share/pogo/preferences)
endif()
#
# Project definitions
#
project(MegaCoffee3k)

#
# optional compiler flags
#
set(CXXFLAGS_USER -g)


#
# Get global information
#
include(CmakeTangoWin.cmake)

#
# Files for MegaCoffee3k TANGO class
#
set(MegaCoffee3k MegaCoffee3k)
set(MegaCoffee3k_INCLUDE ${CMAKE_SOURCE_DIR})
set(MegaCoffee3k_SRC  ${MegaCoffee3k}.cpp
                       ${MegaCoffee3k}Class.cpp
                       ${MegaCoffee3k}StateMachine.cpp)


#
# User additional include, link folders/libraries and source files
#
set(USER_INCL_DIR )
set(USER_LIB_DIR )
set(USER_LIBS )
set(USER_SRC_FILES )

#
# Set global info and include directories
#
set(ALL_CLASS_INCLUDE  ${MegaCoffee3k_INCLUDE}  ${USER_INCL_DIR})
set(SERVER_SRC ${MegaCoffee3k_SRC}  ${USER_SRC_FILES} ClassFactory.cpp main.cpp)
include_directories(${ALL_CLASS_INCLUDE}  ${USER_INCL_DIR} ${TANGO_INCLUDES})
link_directories(${TANGO_LNK_DIR})

#
# Device Server generation
#
set(SERVER_NAME MegaCoffee3k)
add_executable(MegaCoffee3k ${SERVER_SRC})
target_link_libraries(MegaCoffee3k PUBLIC ${TANGO_LIBS} ${WIN_LIBS} ${ZMQ_LIB})
# Cpack target
install(TARGETS MegaCoffee3k
	RUNTIME DESTINATION bin
	LIBRARY DESTINATION bin
	ARCHIVE DESTINATION bin)
