Merge remote-tracking branch 'origin/maint'

This commit is contained in:
Kolan Sh 2016-03-25 01:51:24 +03:00
commit 153fe7367c
15 changed files with 145 additions and 35 deletions

View File

@ -52,7 +52,14 @@ function(_ios_install_combined_get_build_setting sdk variable resultvar)
endif() endif()
if(NOT output MATCHES " ${variable} = ([^\n]*)") if(NOT output MATCHES " ${variable} = ([^\n]*)")
message(FATAL_ERROR "${variable} not found.") if("${variable}" STREQUAL "VALID_ARCHS")
# VALID_ARCHS may be unset by user for given SDK
# (e.g. for build without simulator).
set("${resultvar}" "" PARENT_SCOPE)
return()
else()
message(FATAL_ERROR "${variable} not found.")
endif()
endif() endif()
set("${resultvar}" "${CMAKE_MATCH_1}" PARENT_SCOPE) set("${resultvar}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
@ -72,6 +79,9 @@ function(_ios_install_combined_get_valid_archs sdk resultvar)
list(REMOVE_ITEM valid_archs "") # remove empty elements list(REMOVE_ITEM valid_archs "") # remove empty elements
list(REMOVE_DUPLICATES valid_archs) list(REMOVE_DUPLICATES valid_archs)
string(REPLACE ";" " " printable "${valid_archs}")
_ios_install_combined_message("Architectures (${sdk}): ${printable}")
set("${resultvar}" "${valid_archs}" PARENT_SCOPE) set("${resultvar}" "${valid_archs}" PARENT_SCOPE)
endfunction() endfunction()

View File

@ -745,9 +745,10 @@ endfunction()
# defined; FALSE if dependency information is unavailable). # defined; FALSE if dependency information is unavailable).
# #
# componentvar - the component list variable name # componentvar - the component list variable name
# extravar - the indirect dependency list variable name
# #
# #
function(_Boost_MISSING_DEPENDENCIES componentvar) function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
# _boost_unprocessed_components - list of components requiring processing # _boost_unprocessed_components - list of components requiring processing
# _boost_processed_components - components already processed (or currently being processed) # _boost_processed_components - components already processed (or currently being processed)
# _boost_new_components - new components discovered for future processing # _boost_new_components - new components discovered for future processing
@ -773,7 +774,12 @@ function(_Boost_MISSING_DEPENDENCIES componentvar)
set(_boost_unprocessed_components ${_boost_new_components}) set(_boost_unprocessed_components ${_boost_new_components})
unset(_boost_new_components) unset(_boost_new_components)
endwhile() endwhile()
set(_boost_extra_components ${_boost_processed_components})
if(_boost_extra_components AND ${componentvar})
list(REMOVE_ITEM _boost_extra_components ${${componentvar}})
endif()
set(${componentvar} ${_boost_processed_components} PARENT_SCOPE) set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
set(${extravar} ${_boost_extra_components} PARENT_SCOPE)
endfunction() endfunction()
# #
@ -1306,7 +1312,7 @@ endif()
# Additional components may be required via component dependencies. # Additional components may be required via component dependencies.
# Add any missing components to the list. # Add any missing components to the list.
_Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS) _Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS _Boost_EXTRA_FIND_COMPONENTS)
# If thread is required, get the thread libs as a dependency # If thread is required, get the thread libs as a dependency
list(FIND Boost_FIND_COMPONENTS thread _Boost_THREAD_DEPENDENCY_LIBS) list(FIND Boost_FIND_COMPONENTS thread _Boost_THREAD_DEPENDENCY_LIBS)
@ -1484,6 +1490,10 @@ if(Boost_FOUND)
list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
endif() endif()
endforeach() endforeach()
if(_Boost_MISSING_COMPONENTS AND _Boost_EXTRA_FIND_COMPONENTS)
# Optional indirect dependencies are not counted as missing.
list(REMOVE_ITEM _Boost_MISSING_COMPONENTS ${_Boost_EXTRA_FIND_COMPONENTS})
endif()
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}") message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")

View File

@ -1551,7 +1551,12 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
list( FIND nvcc_flags "-ccbin" ccbin_found0 ) list( FIND nvcc_flags "-ccbin" ccbin_found0 )
list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 )
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") # Match VERBATIM check below.
if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)")
list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
else()
list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}")
endif()
endif() endif()
# Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS*

View File

@ -383,7 +383,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" ${_pkg_check_modules_pkg} "includedir") pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" ${_pkg_check_modules_pkg} "includedir")
pkg_get_variable("${_pkg_check_prefix}_LIBDIR" ${_pkg_check_modules_pkg} "libdir") pkg_get_variable("${_pkg_check_prefix}_LIBDIR" ${_pkg_check_modules_pkg} "libdir")
foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR) foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
_pkgconfig_set("${_pkg_check_modules_pkg}_${variable}" "${${_pkg_check_modules_pkg}_${variable}}") _pkgconfig_set("${_pkg_check_prefix}_${variable}" "${${_pkg_check_prefix}_${variable}}")
endforeach () endforeach ()
if (NOT ${_is_silent}) if (NOT ${_is_silent})

View File

@ -728,7 +728,20 @@ endif()
add_library(CPackLib ${CPACK_SRCS}) add_library(CPackLib ${CPACK_SRCS})
target_link_libraries(CPackLib CMakeLib) target_link_libraries(CPackLib CMakeLib)
if(APPLE) if(APPLE)
target_link_libraries(CPackLib "-framework Carbon") # Some compilers produce errors in the CoreServices framework headers.
# Ideally such errors should be fixed by either the compiler vendor
# or the framework source, but we try to workaround it and build anyway.
# If it does not work, build with reduced functionality and warn.
check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
if(HAVE_CoreServices)
set_property(SOURCE CPack/cmCPackDragNDropGenerator.cxx PROPERTY COMPILE_DEFINITIONS HAVE_CoreServices)
target_link_libraries(CPackLib "-framework CoreServices")
else()
message(WARNING "This compiler does not appear to support\n"
" #include <CoreServices/CoreServices.h>\n"
"Some CPack functionality may be limited.\n"
"See CMakeFiles/CMakeError.log for details of the failure.")
endif()
endif() endif()
if(APPLE) if(APPLE)

View File

@ -1,5 +1,5 @@
# CMake version number components. # CMake version number components.
set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 5) set(CMake_VERSION_MINOR 5)
set(CMake_VERSION_PATCH 0) set(CMake_VERSION_PATCH 1)
#set(CMake_VERSION_RC 0) #set(CMake_VERSION_RC 0)

View File

@ -20,20 +20,13 @@
#include <iomanip> #include <iomanip>
#include <CoreFoundation/CFBase.h> #include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFLocale.h>
// The carbon framework is deprecated, but the Region codes it supplies are #ifdef HAVE_CoreServices
// needed for the LPic data structure used for generating multi-lingual SLAs. // For the old LocaleStringToLangAndRegionCodes() function, to convert
// There does not seem to be a replacement API for these region codes. // to the old Script Manager RegionCode values needed for the 'LPic' data
#if defined(__clang__) // structure used for generating multi-lingual SLAs.
# pragma clang diagnostic push #include <CoreServices/CoreServices.h>
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#include <Carbon/Carbon.h>
#if defined(__clang__)
# pragma clang diagnostic pop
#endif #endif
static const char* SLAHeader = static const char* SLAHeader =
@ -652,9 +645,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
kCFStringEncodingMacRoman); kCFStringEncodingMacRoman);
LangCode lang = 0; LangCode lang = 0;
RegionCode region = 0; RegionCode region = 0;
#ifdef HAVE_CoreServices
OSStatus err = LocaleStringToLangAndRegionCodes(iso_language_cstr, OSStatus err = LocaleStringToLangAndRegionCodes(iso_language_cstr,
&lang, &region); &lang, &region);
if (err != noErr) if (err != noErr)
#endif
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"No language/region code available for " << iso_language_cstr "No language/region code available for " << iso_language_cstr
@ -662,10 +657,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
free(iso_language_cstr); free(iso_language_cstr);
return 0; return 0;
} }
#ifdef HAVE_CoreServices
free(iso_language_cstr); free(iso_language_cstr);
header_data.push_back(region); header_data.push_back(region);
header_data.push_back(i); header_data.push_back(i);
header_data.push_back(0); header_data.push_back(0);
#endif
} }
ofs << "data 'LPic' (5000) {\n"; ofs << "data 'LPic' (5000) {\n";
ofs << std::hex << std::uppercase << std::setfill('0'); ofs << std::hex << std::uppercase << std::setfill('0');

View File

@ -173,6 +173,7 @@ if(APPLE)
MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_BUNDLE_VERSION}" MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_BUNDLE_VERSION}"
# TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}" # TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "${copyright_line}" MACOSX_BUNDLE_COPYRIGHT "${copyright_line}"
MACOSX_BUNDLE_GUI_IDENTIFIER "org.cmake.cmake"
) )
# Create a symlink in the build tree to provide a "cmake-gui" next # Create a symlink in the build tree to provide a "cmake-gui" next

View File

@ -2531,15 +2531,22 @@ const char* cmMakefile::GetDefinition(const std::string& name) const
cmVariableWatch* vv = this->GetVariableWatch(); cmVariableWatch* vv = this->GetVariableWatch();
if ( vv && !this->SuppressWatches ) if ( vv && !this->SuppressWatches )
{ {
if ( def ) bool const watch_function_executed =
{
vv->VariableAccessed(name, cmVariableWatch::VARIABLE_READ_ACCESS,
def, this);
}
else
{
vv->VariableAccessed(name, vv->VariableAccessed(name,
cmVariableWatch::UNKNOWN_VARIABLE_READ_ACCESS, def, this); def ? cmVariableWatch::VARIABLE_READ_ACCESS
: cmVariableWatch::UNKNOWN_VARIABLE_READ_ACCESS,
def, this);
if (watch_function_executed)
{
// A callback was executed and may have caused re-allocation of the
// variable storage. Look it up again for now.
// FIXME: Refactor variable storage to avoid this problem.
def = this->StateSnapshot.GetDefinition(name);
if(!def)
{
def = this->GetState()->GetInitializedCacheValue(name);
}
} }
} }
#endif #endif

View File

@ -96,7 +96,7 @@ void cmVariableWatch::RemoveWatch(const std::string& variable,
} }
} }
void cmVariableWatch::VariableAccessed(const std::string& variable, bool cmVariableWatch::VariableAccessed(const std::string& variable,
int access_type, int access_type,
const char* newValue, const char* newValue,
const cmMakefile* mf) const const cmMakefile* mf) const
@ -112,5 +112,7 @@ void cmVariableWatch::VariableAccessed(const std::string& variable,
(*it)->Method(variable, access_type, (*it)->ClientData, (*it)->Method(variable, access_type, (*it)->ClientData,
newValue, mf); newValue, mf);
} }
return true;
} }
return false;
} }

View File

@ -42,7 +42,7 @@ public:
/** /**
* This method is called when variable is accessed * This method is called when variable is accessed
*/ */
void VariableAccessed(const std::string& variable, int access_type, bool VariableAccessed(const std::string& variable, int access_type,
const char* newValue, const cmMakefile* mf) const; const char* newValue, const cmMakefile* mf) const;
/** /**

View File

@ -1,14 +1,15 @@
cmake_minimum_required(VERSION 3.3)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(NCURSES QUIET ncurses) pkg_check_modules(NCURSES QUIET ncurses)
if (NCURSES_FOUND) if (NCURSES_FOUND)
foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR) foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
get_property("${variable}" get_property(value
CACHE "NCURSES_${variable}" CACHE "NCURSES_${variable}"
PROPERTY TYPE PROPERTY VALUE)
SET) if (NOT value STREQUAL NCURSES_${variable})
if (NOT ${variable}) message(FATAL_ERROR "Failed to set cache entry for NCURSES_${variable}:\nexpected -->${value}<--\nreceived -->${NCURSES_${variable}}<--")
message(FATAL_ERROR "Failed to set cache entry for NCURSES_${variable}")
endif () endif ()
endforeach () endforeach ()
else () else ()

View File

@ -97,6 +97,7 @@ if(NOT XCODE_VERSION VERSION_LESS 7)
endif() endif()
if(NOT XCODE_VERSION VERSION_LESS 6) if(NOT XCODE_VERSION VERSION_LESS 6)
# XcodeIOSInstallCombined
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombined-build) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombined-build)
set(RunCMake_TEST_NO_CLEAN 1) set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS set(RunCMake_TEST_OPTIONS
@ -114,6 +115,7 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
unset(RunCMake_TEST_NO_CLEAN) unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS) unset(RunCMake_TEST_OPTIONS)
# XcodeIOSInstallCombinedPrune
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedPrune-build) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedPrune-build)
set(RunCMake_TEST_NO_CLEAN 1) set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS set(RunCMake_TEST_OPTIONS
@ -130,4 +132,22 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
unset(RunCMake_TEST_BINARY_DIR) unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN) unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS) unset(RunCMake_TEST_OPTIONS)
# XcodeIOSInstallCombinedSingleArch
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedSingleArch-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
"-DCMAKE_IOS_INSTALL_COMBINED=YES")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
run_cmake(XcodeIOSInstallCombinedSingleArch)
run_cmake_command(XcodeIOSInstallCombinedSingleArch-build ${CMAKE_COMMAND} --build .)
run_cmake_command(XcodeIOSInstallCombinedSingleArch-install ${CMAKE_COMMAND} --build . --target install)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS)
endif() endif()

View File

@ -0,0 +1,25 @@
function(verify_architecture file)
execute_process(
COMMAND xcrun lipo -info ${RunCMake_TEST_BINARY_DIR}/_install/${file}
OUTPUT_VARIABLE lipo_out
ERROR_VARIABLE lipo_err
RESULT_VARIABLE lipo_result)
if(NOT lipo_result EQUAL "0")
message(SEND_ERROR "lipo -info failed: ${lipo_err}")
return()
endif()
string(REGEX MATCHALL "is architecture: [^ \n\t]+" architecture "${lipo_out}")
string(REGEX REPLACE "is architecture: " "" actual "${architecture}")
set(expected armv7)
if(NOT actual STREQUAL expected)
message(SEND_ERROR
"The actual library architecture:\n ${actual} \n"
"which do not match expected ones:\n ${expected} \n"
"lipo output:\n${lipo_out}")
endif()
endfunction()
verify_architecture(lib/libfoo.dylib)

View File

@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.3)
project(XcodeIOSInstallCombinedSingleArch CXX)
set(CMAKE_OSX_SYSROOT iphoneos)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
add_library(foo SHARED foo.cpp)
install(TARGETS foo DESTINATION lib)
set_target_properties(
foo
PROPERTIES
XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] armv7
XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] armv7
XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] ""
XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] ""
)