2014-12-16 13:12:51 +00:00
|
|
|
cmake_minimum_required( VERSION 2.8.7 )
|
|
|
|
|
2014-12-20 16:14:35 +00:00
|
|
|
# Set version information
|
|
|
|
set( TTRTS_VERSION_MAJOR 0 )
|
2014-12-29 21:57:14 +00:00
|
|
|
set( TTRTS_VERSION_MINOR 3 )
|
2014-12-30 19:26:14 +00:00
|
|
|
set( TTRTS_VERSION_PATCH 1 )
|
2014-12-20 16:14:35 +00:00
|
|
|
|
2014-12-16 13:13:02 +00:00
|
|
|
# Use c++1y (14)
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++1y" )
|
|
|
|
|
|
|
|
# Turn on all warnings
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-reorder" )
|
|
|
|
|
|
|
|
# Turn off reorder warnings as they're kind of irrelevant
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder" )
|
2014-12-16 13:12:56 +00:00
|
|
|
|
2014-12-20 16:14:35 +00:00
|
|
|
# This shouldn't be needed, but it looks like IDE's like clion can forget to set -g for Debug
|
2014-12-16 13:12:56 +00:00
|
|
|
if( CMAKE_BUILD_TYPE MATCHES "Debug" )
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" )
|
|
|
|
endif()
|
|
|
|
|
2014-12-30 18:32:17 +00:00
|
|
|
# Add bash completion to install
|
|
|
|
install( FILES scripts/ttrts_complete DESTINATION /etc/bash_completion.d/ )
|
|
|
|
|
|
|
|
# Add target to generate man page
|
|
|
|
# Run the gen_usage script to generate our usage header
|
|
|
|
add_custom_target(
|
|
|
|
ttrts-gen-manpage ALL
|
2014-12-30 19:23:03 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/scripts/gen_manpage.sh "${TTRTS_VERSION_MAJOR}" "${TTRTS_VERSION_MINOR}" "${TTRTS_VERSION_PATCH}" "ttrts.6" "${CMAKE_SOURCE_DIR}/source/client/README.md"
|
2014-12-20 16:14:35 +00:00
|
|
|
)
|
|
|
|
|
2014-12-30 18:32:17 +00:00
|
|
|
# Install the ttrts man page
|
|
|
|
install( FILES "${CMAKE_BINARY_DIR}/ttrts.6" DESTINATION man/man6/ )
|
2014-12-20 16:14:35 +00:00
|
|
|
|
2014-12-16 13:12:51 +00:00
|
|
|
# Subprojects
|
2014-12-30 18:32:17 +00:00
|
|
|
add_subdirectory( source/ttrts )
|
|
|
|
add_subdirectory( source/client )
|
2014-12-16 13:13:02 +00:00
|
|
|
|
|
|
|
# Auxhilary binaries
|
2014-12-30 18:32:17 +00:00
|
|
|
add_subdirectory( source/test )
|
|
|
|
add_subdirectory( source/gen )
|