cmake_minimum_required(VERSION 3.2)
project(pglab)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

add_executable(pglab
    ASyncDBConnection.cpp
    ASyncWindow.cpp
    BackupDialog.cpp
    BackupRestore.cpp
    CodeBuilderConfiguration.cpp
    ConnectionConfig.cpp
    ConnectionList.cpp
    ConnectionListModel.cpp
    ConnectionManagerWindow.cpp
    DatabaseInspectorWidget.cpp
    DatabasesTableModel.cpp
    DatabaseWindow.cpp
    ExplainTreeModelItem.cpp
    GlobalIoService.cpp
    jsoncpp.cpp
    main.cpp
    MainWindow.cpp
    MasterController.cpp
    OpenDatabase.cpp
    ParamListModel.cpp
    ParamTypeDelegate.cpp
    PgAuthIdContainer.cpp
    PgAuthId.cpp
    PgClass.cpp
    PgDatabaseCatalogue.cpp
    PgDatabaseContainer.cpp
    PgDatabase.cpp
    PgNamespace.cpp
    PgTypeContainer.cpp
    PgType.cpp
    ProcessStdioWidget.cpp
    QueryExplainModel.cpp
    QueryResultModel.cpp
    QueryTab.cpp
    RolesTableModel.cpp
    ServerWindow.cpp
    SqlSyntaxHighlighter.cpp
    stopwatch.cpp
    tsqueue.cpp
    tuplesresultwidget.cpp
    TypeSelectionItemModel.cpp
    util.cpp
    resources.qrc
    )

set_target_properties(pglab PROPERTIES 
    CXX_STANDARD 14
    CXX_STANDARD_REQUIRED ON)

if(CMAKE_COMPILER_IS_GNUCXX)    
  #  target_compile_options(pglab PRIVATE -Wall -fpic -march=native )
  #  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")
endif()

target_link_libraries( pglab 
    core 
    pgsql
    boost-system
    Qt5::Widgets 
    pthread
    )
