Blame |
Last modification |
View Log
| Download
| RSS feed
# if CMAKE_LIBTOOL is not set, try and find it with xcrun or find_program
OUTPUT_VARIABLE CMAKE_LIBTOOL
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT CMAKE_LIBTOOL
OR NOT EXISTS CMAKE_LIBTOOL
)
set(CMAKE_LIBTOOL
${CMAKE_LIBTOOL} CACHE PATH "libtool executable")
message(STATUS "Found libtool - ${CMAKE_LIBTOOL}")
OUTPUT_VARIABLE LIBTOOL_V_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE)
if("${LIBTOOL_V_OUTPUT}" MATCHES ".*cctools-([0-9.]+).*")
string(REGEX REPLACE ".*cctools-([0-9.]+).*" "\\1" LIBTOOL_VERSION
${LIBTOOL_V_OUTPUT})
if(NOT LIBTOOL_VERSION
VERSION_LESS "862")
set(LIBTOOL_NO_WARNING_FLAG
"-no_warning_for_no_symbols")
set(CMAKE_
${lang}_CREATE_STATIC_LIBRARY
"\"${CMAKE_LIBTOOL}\" -static ${LIBTOOL_NO_WARNING_FLAG} -o <TARGET> <LINK_FLAGS> <OBJECTS>")
# If DYLD_LIBRARY_PATH is set we need to set it on archiver commands
set(dyld_envar
"DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}")
foreach(cmd
${CMAKE_${lang}_CREATE_STATIC_LIBRARY}
)
list(APPEND CMAKE_
${lang}_CREATE_STATIC_LIBRARY_NEW
"${dyld_envar} ${cmd}")
set(CMAKE_
${lang}_CREATE_STATIC_LIBRARY
${CMAKE_${lang}_CREATE_STATIC_LIBRARY_NEW})