#     HTQC - a high-throughput sequencing quality control toolkit
#
#     This program is free software: you can redistribute it and/or modify
#     it under the terms of the GNU General Public License as published by
#     the Free Software Foundation, either version 3 of the License, or
#     (at your option) any later version.
#
#     This program is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with this program.  If not, see <http://www.gnu.org/licenses/>.

cmake_minimum_required(VERSION 2.8)
project(htqc)

if (CMAKE_BUILD_TYPE STREQUAL "")
  # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
  # differentiation between debug and release builds.
  set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()

list(APPEND CMAKE_CXX_FLAGS "-std=c++11")
#set(CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fsanitize=address)

set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 92)
set(CPACK_PACKAGE_VERSION_PATCH 3)
set(CPACK_GENERATOR TGZ)
set(CPACK_SOURCE_GENERATOR TGZ)
set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES} ".kdev4" "~" "build" "nbproject" "test_data" "CMakeLists.txt.user*")

include(CPack)

find_package(ZLIB)
message(STATUS "  Zlib inc dir  : ${ZLIB_INCLUDE_DIRS}")
message(STATUS "  Zlib libraries: ${ZLIB_LIBRARIES}")

include(GNUInstallDirs)
message(STATUS "GNU install dirs")
message(STATUS "  bin: ${CMAKE_INSTALL_BINDIR}")
message(STATUS "  lib: ${CMAKE_INSTALL_LIBDIR}")
message(STATUS "  inc: ${CMAKE_INSTALL_INCLUDEDIR}")

include_directories(
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_BINARY_DIR}/src
    ${ZLIB_INCLUDE_DIRS}
)

set(juce_dep_libs pthread rt dl)

add_subdirectory(src)
add_subdirectory(t)
