project (clingof)

cmake_minimum_required(VERSION 2.4)

include (pch.cmake)

SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
FIND_PACKAGE(RE2C REQUIRED)

SET(CPACK_PACKAGE_VERSION "0.1.3")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
# that sucks this is nowhere documented!!!
SET(CPACK_SOURCE_IGNORE_FILES "/build/" "/examples/" "/bin/" "/\\\\.svn/")
SET(CPACK_SOURCE_GENERATOR "TGZ")
include (CPack)


set(EXECUTABLE_OUTPUT_PATH ${clingof_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables." FORCE)
set(LIBRARY_OUTPUT_PATH ${clingof_BINARY_DIR}/lib CACHE PATH "Single output directory for building all libraries." FORCE)
if(LINK_STATIC)
	set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wno-deprecated -static" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
	set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -Wno-deprecated -static" CACHE STRING "Flags used by the compiler during release builds" FORCE)
else(LINK_STATIC)
	set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wno-deprecated" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
	set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -Wno-deprecated" CACHE STRING "Flags used by the compiler during release builds" FORCE)
endif(LINK_STATIC)


if(NOT CMAKE_VERBOSE_MAKEFILE)
	set(CMAKE_VERBOSE_MAKEFILE OFF CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo" FORCE)
endif(NOT CMAKE_VERBOSE_MAKEFILE)

if(NOT CMAKE_BUILD_TYPE)
	set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)

set(WITH_CLASP OFF CACHE BOOL "Enable this flag to build GrinGo with an internal clasp version.")

set(WITH_ICLASP OFF CACHE BOOL "Enable this flag to build GrinGo with an incremental clasp interface.")
if(WITH_ICLASP)
	set(WITH_CLASP ON CACHE BOOL "Enable this flag to build GrinGo with an internal clasp version.")
endif(WITH_ICLASP)

add_subdirectory (app)
add_subdirectory (lib)

