move SDL_SavePNG to the SDL compilation group, on cmake also

This ports over this commit for scons:
ff857d1d2b6dc97e886774115499847c2256804b
This commit is contained in:
Chris Beck 2014-11-05 02:43:57 -05:00
parent d137c378df
commit a97d344b40

View File

@ -394,7 +394,7 @@ if(LIBDBUS_FOUND)
)
endif()
if(PNG_FOUND)
if(ENABLE_LIBPNG AND PNG_FOUND)
set_source_files_properties(
SDL_SavePNG/savepng.cpp
PROPERTIES
@ -415,6 +415,15 @@ set(wesnoth-sdl_SRC
xBRZ/xbrz.cpp
)
# If requested, compile and link this file also to be able to save png files
if(ENABLE_LIBPNG AND PNG_FOUND)
set(wesnoth-sdl_SRC
${wesnoth-sdl_SRC}
SDL_SavePNG/savepng.cpp
)
endif(ENABLE_LIBPNG AND PNG_FOUND)
add_library(wesnoth-sdl
${LIBRARY_TYPE}
EXCLUDE_FROM_ALL
@ -1065,14 +1074,6 @@ if(LIBDBUS_FOUND)
)
endif(LIBDBUS_FOUND)
# If requested, compile and link this file also to be able to save png files
if(ENABLE_LIBPNG AND PNG_FOUND)
set(libwesnoth-game_STAT_SRC
${libwesnoth-game_STAT_SRC}
SDL_SavePNG/savepng.cpp
)
endif(ENABLE_LIBPNG AND PNG_FOUND)
if(ENABLE_GAME AND ENABLE_TESTS)
set(libwesnoth-game_STAT_SRC
${libwesnoth-game_STAT_SRC}