project(tbpm_sample LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5 COMPONENTS Core Widgets REQUIRED)

find_package(Eigen3 REQUIRED)

include_directories(${EIGEN3_INCLUDE_DIR})

enable_language(Fortran)


add_subdirectory(fortran)

add_executable(tbpm_sample
  main.cpp
)

find_package(MKL REQUIRED)   
target_link_libraries(tbpm_sample  MKL::MKL_SCALAPACK MKL::MKL)
target_link_directories(tbpm_sample PRIVATE ${MKL_ROOT}/lib)
target_link_directories(tbpm_sample PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/out)

include_directories(${MKL_INCLUDE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../3rdparty)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../sources)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
include_directories(${Qt5Core_INCLUDE_DIRS})


target_link_libraries(tbpm_sample Qt5::Core Qt5::Widgets)
target_link_libraries(tbpm_sample ${TARGET_TBPM})
target_link_libraries(tbpm_sample ${TARGET_DIAG})
target_link_libraries(tbpm_sample ${TARGET_ADAPTER})
target_link_libraries(tbpm_sample ${TARGET_BUILDER})
target_link_libraries(tbpm_sample ${TARGET_BASE})