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" )
endif()
# Add definitions for the version number
add_definitions(
-DTTRTS_VERSION_MAJOR=${TTRTS_VERSION_MAJOR}
-DTTRTS_VERSION_MINOR=${TTRTS_VERSION_MINOR}
-DTTRTS_VERSION_PATCH=${TTRTS_VERSION_PATCH}
-DTTRTS_VERSION_STRING=\"${TTRTS_VERSION_MAJOR}.${TTRTS_VERSION_MINOR}.${TTRTS_VERSION_PATCH}\"
# 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
${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
add_subdirectory( ttrts )
add_subdirectory( client )
add_subdirectory( source/ttrts )
add_subdirectory( source/client )
# Auxhilary binaries
add_subdirectory( test )
add_subdirectory( gen )
add_subdirectory( source/test )
add_subdirectory( source/gen )

View file

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

View file

@ -19,7 +19,7 @@ target_link_libraries( ttrts-gen ttrts )
# Run the gen_usage script to generate our usage header
add_custom_target(
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})