# CMake script for peptider
# Author: Olivier Langella
# Created: 28/05/2016

    
# tests : ./src/deepprot -f /gorgone/pappso/moulon/database/Genome_Z_mays_5a.fasta -m /gorgone/pappso/data_extraction_pappso/mzXML/20120906_balliau_extract_1_A01_urnb-1.mzXML
#./src/deepprot -f /espace/Genome_Z_mays_5a.fasta -m /espace/bio/mzxml/20120906_balliau_extract_1_A01_urnb-1.mzXML
# ./src/deepprot -f /gorgone/pappso/moulon/archive_database/Genome_Z_mays_5a.fasta -m /gorgone/pappso/data_extraction_pappso/mzXML/20120906_balliau_extract_1_A01_urnb-1.mzxml -o /gorgone/pappso/versions_logiciels_pappso/deepprot/20181127/test_morpheus.ods


qt6_add_resources(spec_RCC_SRCS "resources.qrc")


configure_file (${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_SOURCE_DIR}/src/config.h)

# File list
set(CPP_FILES
    output/peptidomscboroutput.cpp
    core/runningpeptidoms.cpp
    core/onescanprocess.cpp
)


set(SPECPEPTIDOMS_CLI_SRCS
    peptidoms.cpp
    ${CPP_FILES}
)
add_executable(peptidoms ${SPECPEPTIDOMS_CLI_SRCS}  )

target_link_libraries(peptidoms
    PappsoMSpp::Core
    Qt6::Core
    Qt6::Widgets
    Qt6::Sql
    Qt6::Qml
    Qt6::Concurrent
    QuaZip::QuaZip
    OdsStream::Core
)

add_executable(proteinmatcher
    proteinmatchercli.cpp
    core/runningproteinmatcher.cpp
    core/onescanprocessproteinmatcher.cpp
    output/peptidomscboroutput.cpp
)

target_link_libraries(proteinmatcher
    PappsoMSpp::Core
    Qt6::Core
    Qt6::Sql
    Qt6::Qml
    Qt6::Concurrent
    QuaZip::QuaZip
    OdsStream::Core
)

add_executable(specglobtool
    specglobtool.cpp
)

target_link_libraries(specglobtool
    PappsoMSpp::Core
    Qt6::Core
    Qt6::Sql
    Qt6::Qml
    Qt6::Concurrent
    QuaZip::QuaZip
    OdsStream::Core
)

add_executable(peptidoms-export peptidomsexport.cpp output/odspsm.cpp  )

target_link_libraries(peptidoms-export
    PappsoMSpp::Core
    Qt6::Core
    Qt6::Widgets
    Qt6::Sql
    Qt6::Qml
    QuaZip::QuaZip
    OdsStream::Core
)

add_executable(psmfeatures psmfeatures.cpp)

target_link_libraries(psmfeatures
    PappsoMSpp::Core
    Qt6::Core
    Qt6::Widgets
    Qt6::Sql
    Qt6::Qml
    QuaZip::QuaZip
    OdsStream::Core
)


add_executable(psmionseries psmionseriescli.cpp)

target_link_libraries(psmionseries
    PappsoMSpp::Core
    Qt6::Core
    Qt6::Widgets
    Qt6::Sql
    Qt6::Qml
    QuaZip::QuaZip
    OdsStream::Core
)

set(PSMFEATURES_CLI_SRCS
    psmfeaturesexport.cpp
    output/odsfeatures.cpp
    ${spec_RCC_SRCS}
)

add_executable(psmfeatures-export ${PSMFEATURES_CLI_SRCS})

target_link_libraries(psmfeatures-export
    PappsoMSpp::Core
    Qt6::Core
    Qt6::Widgets
    Qt6::Sql
    Qt6::Qml
    QuaZip::QuaZip
    OdsStream::Core
)


if (MXE)
    target_compile_options(
        deepprot-gui PRIVATE -mwindows
    )
    set_target_properties(deepprot-gui PROPERTIES LINK_FLAGS "-Wl,--subsystem,windows ${CMAKE_EXE_LINKER_FLAGS}")
endif (MXE)


install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/peptidoms DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/peptidoms-export DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/proteinmatcher DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/specglobtool DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/psmionseries DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/psmfeatures DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/psmfeatures-export DESTINATION bin)
