From 7c20d648fc71d5cd4e55c57e21a16d9c6ffa8ba7 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Thu, 4 Nov 2010 21:21:32 +0000 Subject: [PATCH] Changed the naming rules for SFML 2 libraries: the major version number no longer appears in them, except for Windows DLLs (not in import libraries) git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1609 4e206d99-4929-0410-ac5d-dfc041789085 --- cmake/Macros.cmake | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index f875b4965..b149ec3a9 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -103,8 +103,16 @@ macro(sfml_add_library target) # adjust the output file prefix/suffix to match our conventions if(BUILD_SHARED_LIBS) - set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + if(WINDOWS) + # include the major version number in Windows shared library names (but not import library names) + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + set_target_properties(${target} PROPERTIES SUFFIX "-${VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}") + else() + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + endif() if (WINDOWS AND COMPILER_GCC) + # on Windows/gcc get rid of "lib" prefix for shared libraries, + # and transform the ".dll.a" suffix into ".a" for import libraries set_target_properties(${target} PROPERTIES PREFIX "") set_target_properties(${target} PROPERTIES IMPORT_SUFFIX ".a") endif() @@ -112,14 +120,10 @@ macro(sfml_add_library target) set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -s-d) set_target_properties(${target} PROPERTIES RELEASE_POSTFIX -s) endif() - - # set the version and soversion of the target (for compatible systems -- mostly Linuxes) - set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}) - set_target_properties(${target} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - # insert the major version number in the output filename - string(REGEX REPLACE "sfml(-.*)" "sfml${VERSION_MAJOR}\\1" OUTPUT_NAME ${target}) - set_target_properties(${target} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}) + # set the version and soversion of the target (for compatible systems -- mostly Linuxes) + set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}) + set_target_properties(${target} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) # for gcc 4.x on Windows, we add the -static-libgcc linker flag to get rid of an extra gcc DLL if(WINDOWS AND COMPILER_GCC)