CMakeLists.txt

project(CedaExamples VERSION 0.8.0 LANGUAGES CXX)

find_package(Ceda REQUIRED)
find_package(Threads REQUIRED)

cedaSetSourceRoot("${CMAKE_CURRENT_SOURCE_DIR}/..")

cedaTarget(XCPP PROJPATH CedaExamples/lxPersistStore) 
target_link_libraries(lxPersistStore 
    PUBLIC Ceda::cxUtils 
           Ceda::cxObject 
           Ceda::cxLss 
           Ceda::cxPersistStore)

cedaTarget(XCPP PROJPATH CedaExamples/lxOperation)
target_link_libraries(lxOperation 
    PUBLIC Ceda::cxUtils 
           Ceda::cxObject 
           Ceda::cxPersistStore)

cedaTarget(EXE PROJPATH CedaExamples/exThread)
target_link_libraries(exThread
    PUBLIC Ceda::cxUtils 
           Ceda::cxMessage)

cedaTarget(EXE PROJPATH CedaExamples/exLss) 
target_link_libraries(exLss
    PUBLIC Ceda::cxUtils 
           Ceda::cxLss)

cedaTarget(EXE XCPP PROJPATH CedaExamples/exObject)
target_link_libraries(exObject
    PUBLIC Ceda::cxUtils 
           Ceda::cxMessage 
           Ceda::cxObject
           Threads::Threads)

cedaTarget(EXE XCPP PROJPATH CedaExamples/exPersistStore)
target_link_libraries(exPersistStore
    PUBLIC Ceda::cxUtils 
           Ceda::cxMessage 
           Ceda::cxObject 
           Ceda::cxLss 
           Ceda::cxPersistStore 
           lxPersistStore)

#cedaTarget(EXE XCPP PROJPATH CedaExamples/exRmi)
#target_link_libraries(exRmi
#    PUBLIC Ceda::cxUtils 
#           Ceda::cxMessage 
#           Ceda::cxObject 
#           Ceda::cxRmi)

if (NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Android"))
    cedaTarget(EXE XCPP PROJPATH CedaExamples/exCedaScript)
    target_link_libraries(exCedaScript
        PUBLIC Ceda::cxUtils 
               Ceda::cxMessage 
               Ceda::cxMacroExpander 
               Ceda::cxObject 
               Ceda::cxLss 
               Ceda::cxPersistStore 
               Ceda::cxCedaScript)

    cedaTarget(EXE XCPP PROJPATH CedaExamples/exPython)
    linkTargetWithPython(exPython)
    target_link_libraries(exPython
        PUBLIC Ceda::cxUtils 
               Ceda::cxMessage 
               Ceda::cxObject 
               Ceda::cxPython 
               Ceda::cxPersistStore 
               Ceda::cxLss 
               lxOperation)

    cedaTarget(EXE XCPP PROJPATH CedaExamples/exPython2)
    linkTargetWithPython(exPython2)
    target_link_libraries(exPython2
        PUBLIC Ceda::cxUtils 
               Ceda::cxMessage 
               Ceda::cxObject 
               Ceda::cxPersistStore 
               Ceda::cxOperation 
               Ceda::cxWorkingSetIpc 
               Ceda::cxPython 
               Ceda::cxLss 
               Ceda::cxRpc 
               lxOperation)
endif()

cedaTarget(EXE XCPP PROJPATH CedaExamples/exOperation)
target_link_libraries(exOperation
    PUBLIC Ceda::cxUtils 
           Ceda::cxMessage 
           Ceda::cxLss 
           Ceda::cxObject 
           Ceda::cxPersistStore 
           Ceda::cxOperation 
           Ceda::cxWorkingSetIpc)

showCedaVars()

function(addCedaTest targetname)
    message("Adding test ${targetname} with PATH=${Ceda_BIN};CEDA_TEST_DIR=$ENV{CEDA_TEST_DIR}")
	add_test(NAME ${targetname} COMMAND ${targetname})
	set_tests_properties(${targetname} PROPERTIES ENVIRONMENT "PATH=${Ceda_BIN};CEDA_TEST_DIR=$ENV{CEDA_TEST_DIR}")
endfunction()

addCedaTest(exLss)
addCedaTest(exObject)
addCedaTest(exCedaScript)
addCedaTest(exPersistStore)
addCedaTest(exOperation)
addCedaTest(exPython)
addCedaTest(exPython2)
addCedaTest(exThread)
#addCedaTest(exMiddleware)
#addCedaTest(exBlobSet)
#addCedaTest(exRmi)