# HG changeset patch # User Olli Kallioinen # Date 1519579367 -7200 # Sun Feb 25 19:22:47 2018 +0200 # Node ID 6c771ea89b2218455ea68f44a3ac127436c8d82f # Parent ce4bc0462ae5380152cfefc9036685c3cf326a9d cmake: Set debug library name suffix per target instead of setting it globally. Don't add a suffix on android diff -r ce4bc0462ae5 -r 6c771ea89b22 CMakeLists.txt --- a/CMakeLists.txt Sat Feb 24 09:09:20 2018 -0800 +++ b/CMakeLists.txt Sun Feb 25 19:22:47 2018 +0200 @@ -48,10 +48,10 @@ set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") # Set defaults preventing destination file conflicts -set(CMAKE_DEBUG_POSTFIX "d" +set(SDL_CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Name suffix for debug builds") -mark_as_advanced(CMAKE_IMPORT_LIBRARY_SUFFIX CMAKE_DEBUG_POSTFIX) +mark_as_advanced(CMAKE_IMPORT_LIBRARY_SUFFIX SDL_CMAKE_DEBUG_POSTFIX) # Calculate a libtool-like version number math(EXPR LT_CURRENT "${SDL_MICRO_VERSION} - ${SDL_INTERFACE_AGE}") @@ -1697,6 +1697,9 @@ add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) target_include_directories(SDL2main PUBLIC $) set(_INSTALL_LIBS "SDL2main") +if (NOT ANDROID) + set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) +endif() if(SDL_SHARED) add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) @@ -1722,6 +1725,9 @@ set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) target_include_directories(SDL2 PUBLIC $) + if (NOT ANDROID) + set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) + endif() endif() if(SDL_STATIC) @@ -1745,6 +1751,9 @@ set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS}) target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) target_include_directories(SDL2-static PUBLIC $) + if (NOT ANDROID) + set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) + endif() endif() ##### Tests #####