#
#  libcontra - LIBrary for CONnection TRAcking
#
#  Copyright 2018 Thorsten Alteholz <libcontra@alteholz.eu>
#
#  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 (see the file COPYING included with this
#  distribution); if not, write to the Free Software Foundation, Inc.,
#  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
    message( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt." )
endif()

CMAKE_MINIMUM_REQUIRED (VERSION 3.7)
PROJECT(libcontra)

SET(LATEX_OUTPUT_PATH build)
INCLUDE(docu/UseLATEX.cmake)

file(GLOB_RECURSE contents_files RELATIVE ${CMAKE_SOURCE_DIR} docu/*.tex)

ADD_LATEX_DOCUMENT(
    docu/handbook.tex
    INPUTS ${contents_files}
    IMAGE_DIRS docu/images
#    BIBFILES bibliography.bib
#    USE_INDEX
#    USE_GLOSSARY
#    FILTER_OUTPUT
    )

SET(libcontra_VERSION_MAJOR 0)
SET(libcontra_VERSION_MINOR 1)

ADD_SUBDIRECTORY(libcontra) 

include(CTest)
enable_testing()
add_subdirectory(testlib)
