

if(PappsoMSpp_FOUND)
else(PappsoMSpp_FOUND)
  message("PAPPSOms++ library not found")
  message("did you apt-get install libpappsomspp-dev ?")
endif(PappsoMSpp_FOUND)


if(PappsoMSppWidget_FOUND)
else(PappsoMSppWidget_FOUND)
  message("PAPPSOms++ gui library not found")
  message("did you apt-get install libpappsomspp-gui-dev ?")
endif(PappsoMSppWidget_FOUND)

message("PAPPSOms++ library : ${PappsoMSpp_LIBRARIES}")

set(MASSCHROQ_CPP_FILES
    masschroqlightcli.cpp
    input/masschroqml2jsonparser.cpp
)


add_executable(masschroq3 masschroq.cpp ${MASSCHROQ_CPP_FILES} )
target_link_libraries(masschroq3
    PappsoMSpp::Core
    QuaZip::QuaZip
    Qt6::Gui
    Qt6::Concurrent
    Qt6::Sql
    Qt6::Qml
    OdsStream::Core
)


set(MASSCHROQEXPORT_CPP_FILES
    masschroqlightcborcli.cpp
    export/cborstreamreader2json.cpp
    export/cborstreamreaderalignment.cpp
    export/cborstreamreaderbase.cpp
    export/cborstreamreadercompartsv.cpp
    export/cborstreamreaderdebug.cpp
    export/cborstreamreaderdebugquantificationdata.cpp
    export/cborstreamreadershape.cpp
    export/cborstreamreadertsv.cpp
)

add_executable(masschroq-export masschroq_export.cpp ${MASSCHROQEXPORT_CPP_FILES} )
target_link_libraries(masschroq-export
    PappsoMSpp::Core
    QuaZip::QuaZip
    Qt6::Gui
    Qt6::Concurrent
    Qt6::Sql
    Qt6::Qml
    OdsStream::Core
)


if (SYSTEM_UNAME_S EQUAL "mxe")
  target_compile_options(
    masschroq3 PRIVATE -mwindows
  )
  set_target_properties(masschroq3 PROPERTIES LINK_FLAGS "-Wl,--subsystem,windows ${CMAKE_EXE_LINKER_FLAGS}")
  target_compile_options(
    masschroq-export PRIVATE -mwindows
  )
  set_target_properties(masschroq-export PROPERTIES LINK_FLAGS "-Wl,--subsystem,windows ${CMAKE_EXE_LINKER_FLAGS}")
endif (SYSTEM_UNAME_S EQUAL "mxe")

target_compile_definitions(masschroq3 PRIVATE)

target_compile_definitions(masschroq-export PRIVATE)


install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/masschroq3 DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/masschroq-export DESTINATION bin)

