mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-08 23:10:58 -04:00
If font is not found, just don't build example instead of failing
This commit is contained in:
parent
3570d812eb
commit
ffc2caf14d
@ -35,12 +35,13 @@ IF(SDL2PP_WITH_TTF)
|
||||
ttf-bitstream-vera
|
||||
)
|
||||
ENDIF(NOT SDL2PP_EXAMPLE_FONT)
|
||||
|
||||
IF(SDL2PP_EXAMPLE_FONT)
|
||||
MESSAGE(STATUS "Using example font: ${SDL2PP_EXAMPLE_FONT}")
|
||||
ADD_DEFINITIONS(-DEXAMPLE_FONT="${SDL2PP_EXAMPLE_FONT}")
|
||||
ADD_EXECUTABLE(ttf ttf.cc)
|
||||
TARGET_LINK_LIBRARIES(ttf SDL2pp)
|
||||
ELSE(SDL2PP_EXAMPLE_FONT)
|
||||
MESSAGE(FATAL_ERROR "Cannot find font to use with ttf example (Vera.ttf). You need to either install it, add path to it into examples/CMakeLists.txt (and submit this chnage upstream) or specify path (to any .ttf file) manually with SDL2PP_EXAMPLE_FONT variable")
|
||||
MESSAGE(WARNING "Cannot find font to use with ttf example (Vera.ttf), ttf example will not be built.\nYou need to install the font if it's not installed, else you may need to either add path to the font into list in examples/CMakeLists.txt or manually specify path to any .ttf file with SDL2PP_EXAMPLE_FONT CMake variable")
|
||||
ENDIF(SDL2PP_EXAMPLE_FONT)
|
||||
ADD_DEFINITIONS(-DEXAMPLE_FONT="${SDL2PP_EXAMPLE_FONT}")
|
||||
ADD_EXECUTABLE(ttf ttf.cc)
|
||||
TARGET_LINK_LIBRARIES(ttf SDL2pp)
|
||||
ENDIF(SDL2PP_WITH_TTF)
|
||||
|
Loading…
x
Reference in New Issue
Block a user