Update CMakelists
Additional install targets for maps, and reworked dependencies
This commit is contained in:
parent
481153606b
commit
415361ac9c
6 changed files with 47 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,4 +9,5 @@
|
||||||
*.user
|
*.user
|
||||||
*.sublime*
|
*.sublime*
|
||||||
*.idea
|
*.idea
|
||||||
|
*~
|
||||||
|
|
||||||
|
|
21
bootstrap.sh
21
bootstrap.sh
|
@ -1,38 +1,51 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
|
# Double check
|
||||||
|
if [ ! -e "source/CMakeLists.txt" ]; then
|
||||||
|
echo "TTRTS: No source cmakelist found"
|
||||||
|
exit
|
||||||
|
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 ../source
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
echo "TTRTS: CMake failed, exiting Bootstrap"
|
echo "TTRTS: CMake failed, exiting Bootstrap"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "TTRTS: Running make"
|
echo "TTRTS: Running make"
|
||||||
make
|
make
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
echo "TTRTS: make failed, exiting Bootstrap"
|
echo "TTRTS: make failed, exiting Bootstrap"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "TTRTS: Running tests"
|
echo "TTRTS: Running tests"
|
||||||
./test/ttrts-test
|
./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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "TTRTS: Generating maps"
|
echo "TTRTS: Generating maps"
|
||||||
test ! -e ../maps && mkdir ../maps
|
./../scripts/gen_maps.sh "$PWD/gen/ttrts-gen"
|
||||||
cd ../maps
|
|
||||||
./../build/gen/ttrts-gen
|
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
echo "TTRTS: Generating maps, exiting Bootstrap"
|
echo "TTRTS: Failed to generate maps, exiting Bootstrap"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
|
# Copy these maps into parent directory
|
||||||
|
cp -rf maps ..
|
||||||
|
|
||||||
echo "TTRTS: Moving binaries"
|
echo "TTRTS: Moving binaries"
|
||||||
cd ..
|
cd ..
|
||||||
if [ ! -e build/ttrts/ttrts ]; then
|
if [ ! -e build/ttrts/ttrts ]; then
|
||||||
echo "TTRTS: No TTRTS Binary found, something has gone wrong"
|
echo "TTRTS: No TTRTS Binary found, something has gone wrong"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp build/ttrts/ttrts .
|
cp build/ttrts/ttrts .
|
||||||
chmod a+x ttrts
|
chmod a+x ttrts
|
||||||
|
|
||||||
|
echo "TTRTS: Bootstrap complete"
|
||||||
|
|
13
scripts/gen_maps.sh
Executable file
13
scripts/gen_maps.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#! /bin/bash
|
||||||
|
# Use to generate the ttrts maps
|
||||||
|
|
||||||
|
ttrtsgen=$1
|
||||||
|
|
||||||
|
test ! -e maps && mkdir maps # Make maps directory if needed
|
||||||
|
if [ ! -e maps ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd maps
|
||||||
|
|
||||||
|
$ttrtsgen
|
|
@ -15,3 +15,14 @@ set( SOURCES
|
||||||
add_executable( ttrts-gen ${SOURCES} )
|
add_executable( ttrts-gen ${SOURCES} )
|
||||||
|
|
||||||
target_link_libraries( ttrts-gen game )
|
target_link_libraries( ttrts-gen game )
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_dependencies(ttrts-gen-maps ${PROJECT_NAME})
|
||||||
|
|
||||||
|
# Installation target
|
||||||
|
install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/maps DESTINATION /usr/share/ttrts )
|
|
@ -23,7 +23,8 @@ 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(
|
||||||
gen_ttrts_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} gen_ttrts_usage)
|
|
||||||
|
add_dependencies(${PROJECT_NAME} ttrts-client-usage)
|
Loading…
Add table
Reference in a new issue