From 90b00710fd37ebbb80bbd22fdfcf7657dfa31c0b Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sun, 3 Jul 2016 01:54:31 +0200 Subject: [PATCH] cmake: link gamestates to common game library if such target is present --- cmake/include.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/include.cmake b/cmake/include.cmake index 1155f6b..4885110 100644 --- a/cmake/include.cmake +++ b/cmake/include.cmake @@ -40,6 +40,10 @@ MACRO(register_gamestate name) target_link_libraries("libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}" ${ALLEGRO5_LIBRARIES} ${ALLEGRO5_FONT_LIBRARIES} ${ALLEGRO5_TTF_LIBRARIES} ${ALLEGRO5_PRIMITIVES_LIBRARIES} ${ALLEGRO5_AUDIO_LIBRARIES} ${ALLEGRO5_ACODEC_LIBRARIES} ${ALLEGRO5_IMAGE_LIBRARIES} ${ALLEGRO5_COLOR_LIBRARIES} m libsuperderpy) + if (TARGET libsuperderpy-${LIBSUPERDERPY_GAMENAME}) + target_link_libraries("libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}" libsuperderpy-${LIBSUPERDERPY_GAMENAME}) + ENDIF() + install(TARGETS "libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}" DESTINATION ${LIB_INSTALL_DIR}) ENDMACRO()