Remove demos into more suitable examples

Also add options for conditional build of tests and examples
This commit is contained in:
Dmitry Marakasov 2014-12-20 17:50:50 +03:00
parent 5c0dfc3824
commit 18fe309309
11 changed files with 16 additions and 9 deletions

View File

@ -8,4 +8,4 @@ before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq cmake libsdl2-dev libsdl2-image-dev g++-4.8
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
script: cmake . -DRUN_GUI_TESTS=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/_prefix -DSDL2PP_WITH_WERROR=YES && make && make test && make install
script: cmake . -DSDL2PP_ENABLE_GUI_TEST=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/_prefix -DSDL2PP_WITH_WERROR=YES && make && make test && make install

View File

@ -102,12 +102,19 @@ IF(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
TARGET_LINK_LIBRARIES(SDL2pp ${SDL2_ALL_LIBRARIES})
SET_TARGET_PROPERTIES(SDL2pp PROPERTIES VERSION 1.0.0 SOVERSION 1)
# demos and tests
OPTION(RUN_GUI_TESTS "Run GUI tests (requires X11 display)" ON)
ENABLE_TESTING()
# examples and tests
OPTION(SDL2PP_WITH_EXAMPLES "Build examples" ON)
OPTION(SDL2PP_WITH_TESTS "Build tests" ON)
OPTION(SDL2PP_ENABLE_GUI_TEST "Enable GUI test (requires X11 display)" ON)
ADD_SUBDIRECTORY(demos)
ADD_SUBDIRECTORY(tests)
IF(SDL2PP_WITH_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF(SDL2PP_WITH_EXAMPLES)
IF(SDL2PP_WITH_TESTS)
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)
ENDIF(SDL2PP_WITH_TESTS)
# pkgconfig
SET(PKGCONFIGDIR lib/pkgconfig CACHE STRING "directory where to install pkg-config files")

View File

@ -132,7 +132,7 @@ ADD_EXECUTABLE(mytarget ...)
TARGET_LINK_LIBRARIES(mytarget ${SDL2PP_LIBRARIES})
```
if bundled, libSDL2pp does not build demos and becomes a static
if bundled, libSDL2pp does not build examples and becomes a static
library, providing required SDL2 includes/libs in the mentioned
variables.

View File

@ -30,7 +30,7 @@ ENDFOREACH(TEST ${TESTS})
FOREACH(TEST ${GUI_TESTS})
ADD_EXECUTABLE(${TEST} ${TEST}.cc)
TARGET_LINK_LIBRARIES(${TEST} SDL2pp)
IF(RUN_GUI_TESTS)
IF(SDL2PP_ENABLE_GUI_TEST)
ADD_TEST(${TEST} ${TEST})
ENDIF(RUN_GUI_TESTS)
ENDIF(SDL2PP_ENABLE_GUI_TEST)
ENDFOREACH(TEST ${TESTS})