Move top level cmakelist up to main directory

This commit is contained in:
mdiluzio 2014-12-30 18:32:17 +00:00
parent 2c0a393f77
commit f1e4f432e6
4 changed files with 23 additions and 21 deletions

View file

@ -19,19 +19,23 @@ if( CMAKE_BUILD_TYPE MATCHES "Debug" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" )
endif() endif()
# Add definitions for the version number # Add bash completion to install
add_definitions( install( FILES scripts/ttrts_complete DESTINATION /etc/bash_completion.d/ )
-DTTRTS_VERSION_MAJOR=${TTRTS_VERSION_MAJOR}
-DTTRTS_VERSION_MINOR=${TTRTS_VERSION_MINOR} # Add target to generate man page
-DTTRTS_VERSION_PATCH=${TTRTS_VERSION_PATCH} # Run the gen_usage script to generate our usage header
-DTTRTS_VERSION_STRING=\"${TTRTS_VERSION_MAJOR}.${TTRTS_VERSION_MINOR}.${TTRTS_VERSION_PATCH}\" add_custom_target(
ttrts-gen-manpage ALL
${CMAKE_SOURCE_DIR}/scripts/gen_manpage.sh "ttrts.6" "${CMAKE_SOURCE_DIR}/source/client/README.md"
) )
# Install the ttrts man page
install( FILES "${CMAKE_BINARY_DIR}/ttrts.6" DESTINATION man/man6/ )
# Subprojects # Subprojects
add_subdirectory( ttrts ) add_subdirectory( source/ttrts )
add_subdirectory( client ) add_subdirectory( source/client )
# Auxhilary binaries # Auxhilary binaries
add_subdirectory( test ) add_subdirectory( source/test )
add_subdirectory( gen ) add_subdirectory( source/gen )

View file

@ -1,7 +1,7 @@
#! /bin/bash #! /bin/bash
# Double check for cmakelist # Double check for cmakelist
if [ ! -e "source/CMakeLists.txt" ]; then if [ ! -e "CMakeLists.txt" ]; then
echo "TTRTS: No source cmakelist found" echo "TTRTS: No source cmakelist found"
exit exit
fi fi
@ -10,7 +10,7 @@ fi
echo "TTRTS: Running cmake" echo "TTRTS: Running cmake"
test ! -e build && mkdir build test ! -e build && mkdir build
cd build/ cd build/
cmake ../source cmake ..
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo "TTRTS: CMake failed, exiting Bootstrap" echo "TTRTS: CMake failed, exiting Bootstrap"
exit exit
@ -26,7 +26,7 @@ fi
# Run tests # Run tests
echo "TTRTS: Running tests" echo "TTRTS: Running tests"
./test/ttrts-test ./source/test/ttrts-test
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo "TTRTS: Tests failed, build must be broken" echo "TTRTS: Tests failed, build must be broken"
exit exit
@ -34,23 +34,21 @@ fi
# Generate maps # Generate maps
echo "TTRTS: Generating maps" echo "TTRTS: Generating maps"
./../scripts/gen_maps.sh "$PWD/gen/ttrts-gen" cd ..
./scripts/gen_maps.sh "$PWD/build/source/gen/ttrts-gen"
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo "TTRTS: Failed to generate maps, exiting Bootstrap" echo "TTRTS: Failed to generate maps, exiting Bootstrap"
exit exit
fi fi
# Copy these maps into parent directory
cp -rf maps ..
# Move binaries # Move binaries
echo "TTRTS: Moving binaries" echo "TTRTS: Moving binaries"
cd .. if [ ! -e build/source/client/ttrts ]; then
if [ ! -e build/client/ttrts ]; then
echo "TTRTS: No TTRTS Binary found, something has gone wrong" echo "TTRTS: No TTRTS Binary found, something has gone wrong"
exit exit
fi fi
cp build/client/ttrts . cp build/source/client/ttrts .
chmod a+x ttrts chmod a+x ttrts
echo "TTRTS: Bootstrap complete" echo "TTRTS: Bootstrap complete"

View file

@ -28,7 +28,7 @@ install( TARGETS ${PROJECT_NAME} DESTINATION bin )
# Run the gen_usage script to generate our usage header # Run the gen_usage script to generate our usage header
add_custom_target( add_custom_target(
ttrts-client-usage ttrts-client-usage
cd ${CMAKE_CURRENT_SOURCE_DIR} && ${CMAKE_SOURCE_DIR}/../scripts/gen_usage.sh "${CMAKE_CURRENT_BINARY_DIR}/usage.h" cd ${CMAKE_CURRENT_SOURCE_DIR} && ${CMAKE_SOURCE_DIR}/scripts/gen_usage.sh "${CMAKE_CURRENT_BINARY_DIR}/usage.h"
) )
add_dependencies(${PROJECT_NAME} ttrts-client-usage) add_dependencies(${PROJECT_NAME} ttrts-client-usage)

View file

@ -19,7 +19,7 @@ target_link_libraries( ttrts-gen ttrts )
# Run the gen_usage script to generate our usage header # Run the gen_usage script to generate our usage header
add_custom_target( add_custom_target(
ttrts-gen-maps ALL ttrts-gen-maps ALL
${CMAKE_SOURCE_DIR}/../scripts/gen_maps.sh "${CMAKE_CURRENT_BINARY_DIR}/ttrts-gen" ${CMAKE_SOURCE_DIR}/scripts/gen_maps.sh "${CMAKE_CURRENT_BINARY_DIR}/ttrts-gen"
) )
add_dependencies(ttrts-gen-maps ${PROJECT_NAME}) add_dependencies(ttrts-gen-maps ${PROJECT_NAME})