Skip to content

Commit

Permalink
Make compiling test_executable optional
Browse files Browse the repository at this point in the history
  • Loading branch information
photm5 committed Oct 29, 2014
1 parent 967983f commit 44c8ecb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O1" )
# Include headers from inc
include_directories ( ${CMAKE_SOURCE_DIR}/inc )

set ( COMPILE_TESTS OFF CACHE COMPILE_TESTS "Compile test_executable" )

# Add the test subdirectory
add_subdirectory ( ${CMAKE_SOURCE_DIR}/tests )
if ( COMPILE_TESTS )
add_subdirectory ( ${CMAKE_SOURCE_DIR}/tests )
endif ( COMPILE_TESTS )

file ( GLOB_RECURSE EVENTSYSTEM_HEADERS ${CMAKE_SOURCE_DIR}/inc *.(h|hpp) )
install ( FILES ${EVENTSYSTEM_HEADERS} DESTINATION include )
4 changes: 2 additions & 2 deletions cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ set -e

case $1 in
"setup")
cmake -H. -Bbuild
cmake -H. -Bbuild -DCOMPILE_TESTS=ON
;;
"debug")
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug
cmake -H. -Bbuild -DCOMPILE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
;;
"clean")
echo "removing build/, libeventsystem.a and test_executable"
Expand Down

0 comments on commit 44c8ecb

Please sign in to comment.