Skip to content
Snippets Groups Projects
CMakeLists.txt 1.84 KiB
Newer Older
cmake_minimum_required(VERSION 3.12)

project(algorithms_library_toolkit
	VERSION 0.0.0
	LANGUAGES CXX)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
set(CMAKE_COLOR_MAKEFILE ON)

if (NOT UNIX)
    message(FATAL_ERROR "Unavailable if not Unix")
endif ()

# If not specified whether Debug or Release, select Release with debug info
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
	message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
	set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
	set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
Tomáš Pecka's avatar
Tomáš Pecka committed
option(WITH_DOCS "Build Doxygen")
option(WITH_AGUI "Build agui2 interface (deprecated gui)")
option(BUILD_TESTING "Compile and run tests" ON)
option(WITH_INSTALL_RPATH "Add RPATH set to installation dir" OFF)
include(alt)
include(CompilerFlags)
include(Install)
Tomáš Pecka's avatar
Tomáš Pecka committed
include(Version)
include_directories(${PROJECT_BINARY_DIR})

if(WITH_INSTALL_RPATH)
	set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
endif()

# testing
include(CTest)
if(BUILD_TESTING)
	include(Catch)
	add_subdirectory(lib/catch2)
	include_directories(${PROJECT_SOURCE_DIR}/tests)
endif()

alt_module(alib2std)
alt_module(alib2measure)
alt_module(alib2abstraction)
alt_module(alib2common)
alt_module(alib2xml)

alt_module(alib2str)
alt_module(alib2data)
alt_module(alib2algo)
alt_module(alib2elgo)
alt_module(alib2algo_experimental)
alt_module(alib2data_experimental)
alt_module(alib2graph_data)
alt_module(alib2graph_algo)

alt_module(alib2raw)

alt_module(alib2aux)
alt_module(alib2dummy)

alt_module(alib2cli)
alt_module(alib2str_cli_integration)
alt_module(alib2raw_cli_integration)
alt_module(aql2)

if(WITH_AGUI)
	alt_module(alib2gui)
	alt_module(agui2)
endif()
Tomáš Pecka's avatar
Tomáš Pecka committed

# docs
Tomáš Pecka's avatar
Tomáš Pecka committed
if(WITH_DOCS)
Tomáš Pecka's avatar
Tomáš Pecka committed
	alt_doxygen()
endif()