fix for static builds with mingw-w64 compilers - part 2

This commit is contained in:
Baruch 2012-05-01 23:01:56 +03:00
parent 165f2b1888
commit f784fe4c07

View File

@ -1,4 +1,3 @@
# some of these macros are inspired from the boost/cmake macros
# this macro adds external dependencies to a static target,
@ -16,8 +15,12 @@ macro(sfml_static_add_libraries target)
foreach(lib ${ARGN})
if(NOT ${lib} MATCHES ".*/.*")
string(REGEX REPLACE "(.*)/bin/.*\\.exe" "\\1" STANDARD_LIBS_PATH "${CMAKE_CXX_COMPILER}")
if(COMPILER_GCC_W64)
set(lib "${STANDARD_LIBS_PATH}/${GCC_MACHINE}/lib/lib${lib}.a")
else()
set(lib "${STANDARD_LIBS_PATH}/lib/lib${lib}.a")
endif()
endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
get_target_property(TARGET_FILENAME ${target} ${BUILD_TYPE}_LOCATION)
add_custom_command(TARGET ${target}