#cmake_minimum_required(VERSION 2.8.8)
#set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -g -std=c++11")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp -g")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorizer-verbose=3 -ffast-math")
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")

find_package(ZLIB)
include_directories(${ZLIB_INCLUDE_DIR})
find_package(BLAS QUIET)
find_package(LAPACK QUIET)
if(OPENMP_FOUND AND BLAS_FOUND AND LAPACK_FOUND)
  app(test-smat test-smat.cpp smat.cpp zlib_util.cpp)
  target_link_libraries(test-smat ${ZLIB_LIBRARIES})
  app(test-blas test-blas.cpp dmat.cpp)
  target_link_libraries(test-blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
  app(train-ml train-ml.cpp multilabel.cpp wsabie.cpp 
    bilinear.cpp multiple_linear.cpp smat.cpp dmat.cpp zlib_util.cpp tron.cpp)
  target_link_libraries(train-ml ${ZLIB_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
  add_subdirectory(galois)
endif()
