Updated version 3.9.3 from 'upstream/3.9.3'

with Debian dir 09bfc32e0c
ci/unstable
Felix Geyer 7 years ago
commit 3fb48daea6

@ -14,7 +14,6 @@ if exists("b:did_indent")
endif
let b:did_indent = 1
setlocal et
setlocal indentexpr=CMakeGetIndent(v:lnum)
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(

@ -68,6 +68,7 @@ The following individuals and institutions are among the Contributors:
* Matthaeus G. Chajdas
* Matthias Kretz <kretz@kde.org>
* Matthias Maennich <matthias@maennich.net>
* Michael Stürmer
* Miguel A. Figueroa-Villanueva
* Mike Jackson
* Mike McQuaid <mike@mikemcquaid.com>

@ -70,8 +70,8 @@ be included by the user in the C++ implementation file with a preprocessor
Included ``moc_*.cpp`` and ``*.moc`` files will be generated in the
``<AUTOGEN_BUILD_DIR>/include`` directory which is
automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
(This differs from CMake 3.7 and below; see their documentation for details.)
* This differs from CMake 3.7 and below; see their documentation for details.
* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
Not included ``moc_<basename>.cpp`` files will be generated in custom
@ -107,16 +107,23 @@ inspects the C++ files in the target to determine if they require ``uic`` to
be run, and to create rules to execute ``uic`` at the appropriate time.
If a preprocessor ``#include`` directive is found which matches
``ui_<basename>.h``, and a ``<basename>.ui`` file exists, then ``uic`` will
be executed to generate the appropriate file. The ``<basename>.ui`` file is
searched for first in the vicinity of including file and afterwards in the
optional :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target.
``<path>ui_<basename>.h``, and a ``<basename>.ui`` file exists,
then ``uic`` will be executed to generate the appropriate file.
The ``<basename>.ui`` file is searched for in the following places
1. ``<source_dir>/<basename>.ui``
2. ``<source_dir>/<path><basename>.ui``
3. ``<AUTOUIC_SEARCH_PATHS>/<basename>.ui``
4. ``<AUTOUIC_SEARCH_PATHS>/<path><basename>.ui``
where ``<source_dir>`` is the directory of the C++ file and
:prop_tgt:`AUTOUIC_SEARCH_PATHS` is a list of additional search paths.
The generated generated ``ui_*.h`` files are placed in the
``<AUTOGEN_BUILD_DIR>/include`` directory which is
automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
(This differs from CMake 3.7 and below; see their documentation for details.)
* This differs from CMake 3.7 and below; see their documentation for details.
* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
The :prop_tgt:`AUTOUIC` target property may be pre-set for all following

@ -34,8 +34,6 @@ Generators
This is an experimental feature and can be activated by setting the
:variable:`CMAKE_XCODE_GENERATE_SCHEME` variable to a ``TRUE`` value.
* The :generator:`Xcode` generator now supports Xcode 9.
Commands
--------
@ -310,9 +308,6 @@ Other Changes
in dependent targets may now compile without waiting for their targets'
dependencies to link.
* On macOS, the default application bundle ``Info.plist`` file now enables
Hi-DPI support.
* On macOS, ``RPATH`` settings such as :prop_tgt:`BUILD_WITH_INSTALL_RPATH`
no longer affect the ``install_name`` field. See policy :policy:`CMP0068`.
@ -333,3 +328,15 @@ Changes made since CMake 3.9.0 include the following.
CMake 3.9.0 has been removed for the 3.9 series due to regressions
caused by new use of ``<PackageName>_ROOT`` variables. The behavior
may be re-introduced in the future in a more-compatible way.
3.9.2
-----
* On macOS, the default application bundle ``Info.plist`` file no longer
enables Hi-DPI support as it did in 3.9.0 and 3.9.1. The change had
to be reverted because it broke iOS applications.
* The Xcode generator no longer adds "outputPaths" to custom script
build phases as it did in 3.9.0 and 3.9.1. This was added in an
attempt to support Xcode 9's new build system, but broke incremental
rebuilds for both the old and new Xcode build systems.

@ -43,7 +43,7 @@ endif()
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
# and you can set these flags in the cmake cache
set(CMAKE_CSharp_FLAGS_INIT "$ENV{CSharpFLAGS} ${CMAKE_CSharp_FLAGS_INIT}")
set(CMAKE_CSharp_FLAGS_INIT "$ENV{CSFLAGS} ${CMAKE_CSharp_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache
if(CMAKE_CSharp_FLAGS_INIT STREQUAL " ")
set(CMAKE_CSharp_FLAGS_INIT)

@ -198,11 +198,11 @@ endif()
#These are used when linking relocatable (dc) cuda code
if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY)
set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
"<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
"<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()
if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE)
set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
"<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
"<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()
unset(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS)

@ -706,6 +706,7 @@ function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang userflags)
OUTPUT_VARIABLE out
ERROR_VARIABLE err
RESULT_VARIABLE res
ENCODING AUTO # cl prints in current code page
)
if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n]*:[^:\n]*:[ \t]*)")
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}" PARENT_SCOPE)

@ -2,6 +2,12 @@ if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL
message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
endif()
# Debian:
# * /usr/bin/llvm-ar-4.0
# * /usr/bin/llvm-ranlib-4.0
string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y
"${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}")
# Try to find tools in the same directory as Clang itself
get_filename_component(__clang_hint_1 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" REALPATH)
get_filename_component(__clang_hint_1 "${__clang_hint_1}" DIRECTORY)
@ -12,6 +18,7 @@ set(__clang_hints ${__clang_hint_1} ${__clang_hint_2})
# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ar.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar"
HINTS ${__clang_hints}
DOC "LLVM archiver"
@ -20,6 +27,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ranlib.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib"
HINTS ${__clang_hints}
DOC "Generate index for LLVM archive"

@ -208,10 +208,6 @@
#
# Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
# Save project's policies
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
#-------------------------------------------------------------------------------
# Before we go searching, check whether boost-cmake is available, unless the
# user specifically asked NOT to search for boost-cmake.
@ -554,7 +550,10 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
# The addition of a new release should only require it to be run
# against the new release.
set(_Boost_IMPORTED_TARGETS TRUE)
if(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
if(Boost_VERSION VERSION_LESS 103300)
message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION} (all versions older than 1.33)")
set(_Boost_IMPORTED_TARGETS FALSE)
elseif(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
set(_Boost_REGEX_DEPENDENCIES thread)
set(_Boost_WAVE_DEPENDENCIES filesystem thread)
@ -768,9 +767,28 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
else()
message(WARNING "Imported targets not available for Boost version ${Boost_VERSION}")
if(NOT Boost_VERSION VERSION_LESS 106500)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_NUMPY_DEPENDENCIES python)
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
endif()
if(NOT Boost_VERSION VERSION_LESS 106600)
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
set(_Boost_IMPORTED_TARGETS FALSE)
endif()
endif()
string(TOUPPER ${component} uppercomponent)
set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
@ -819,6 +837,7 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_MATH_TR1L_HEADERS "boost/math/tr1.hpp")
set(_Boost_MPI_HEADERS "boost/mpi.hpp")
set(_Boost_MPI_PYTHON_HEADERS "boost/mpi/python/config.hpp")
set(_Boost_NUMPY_HEADERS "boost/python/numpy.hpp")
set(_Boost_PRG_EXEC_MONITOR_HEADERS "boost/test/prg_exec_monitor.hpp")
set(_Boost_PROGRAM_OPTIONS_HEADERS "boost/program_options.hpp")
set(_Boost_PYTHON_HEADERS "boost/python.hpp")
@ -876,7 +895,9 @@ function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES})
if (NOT ("${componentdep}" IN_LIST _boost_processed_components OR "${componentdep}" IN_LIST _boost_new_components))
list(FIND _boost_processed_components "${componentdep}" _boost_component_found)
list(FIND _boost_new_components "${componentdep}" _boost_component_new)
if (_boost_component_found EQUAL -1 AND _boost_component_new EQUAL -1)
list(APPEND _boost_new_components ${componentdep})
endif()
endforeach()
@ -1000,6 +1021,7 @@ else()
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.65.1" "1.65.0" "1.65"
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
@ -1503,7 +1525,8 @@ endif()
_Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS _Boost_EXTRA_FIND_COMPONENTS)
# If thread is required, get the thread libs as a dependency
if("thread" IN_LIST Boost_FIND_COMPONENTS)
list(FIND Boost_FIND_COMPONENTS thread _Boost_THREAD_DEPENDENCY_LIBS)
if(NOT _Boost_THREAD_DEPENDENCY_LIBS EQUAL -1)
include(CMakeFindDependencyMacro)
find_dependency(Threads)
endif()
@ -1928,6 +1951,3 @@ list(REMOVE_DUPLICATES _Boost_COMPONENTS_SEARCHED)
list(SORT _Boost_COMPONENTS_SEARCHED)
set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}"
CACHE INTERNAL "Components requested for this build tree.")
# Restore project's policies
cmake_policy(POP)

@ -8,14 +8,17 @@
# this module looks for Cygwin
if (WIN32)
find_program(CYGWIN_INSTALL_PATH
if(CYGWIN_INSTALL_PATH)
set(CYGWIN_BAT "${CYGWIN_INSTALL_PATH}/cygwin.bat")
endif()
find_program(CYGWIN_BAT
cygwin.bat
"C:/Cygwin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]"
)
get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_INSTALL_PATH}" DIRECTORY)
mark_as_advanced(
CYGWIN_INSTALL_PATH
)
get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_BAT}" DIRECTORY)
mark_as_advanced(CYGWIN_BAT)
endif ()

@ -429,6 +429,8 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
endforeach()
set(OpenMP_FOUND ${OPENMP_FOUND})
if(CMAKE_Fortran_COMPILER_LOADED AND OpenMP_Fortran_FOUND)
if(NOT DEFINED OpenMP_Fortran_HAVE_OMPLIB_MODULE)
set(OpenMP_Fortran_HAVE_OMPLIB_MODULE FALSE CACHE BOOL INTERNAL "")

@ -89,6 +89,8 @@ if(MSVC)
endif()
if(MSVC_VERSION EQUAL 1400)
set(MSVC_REDIST_NAME VC80)
# Find the runtime library redistribution directory.
get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
@ -129,6 +131,8 @@ if(MSVC)
endif()
if(MSVC_VERSION EQUAL 1500)
set(MSVC_REDIST_NAME VC90)
# Find the runtime library redistribution directory.
get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
@ -171,24 +175,35 @@ if(MSVC)
endif()
endif()
if(MSVC_VERSION EQUAL 1910)
set(MSVC_REDIST_NAME "")
set(_MSVCRT_DLL_VERSION "")
set(_MSVCRT_IDE_VERSION "")
if(MSVC_VERSION GREATER_EQUAL 2000)
message(WARNING "MSVC ${MSVC_VERSION} not yet supported.")
elseif(MSVC_VERSION GREATER_EQUAL 1911)
set(MSVC_REDIST_NAME VC141)
set(_MSVCRT_DLL_VERSION 140)
set(_MSVCRT_IDE_VERSION 15)
elseif(MSVC_VERSION EQUAL 1910)
set(MSVC_REDIST_NAME VC150)
set(_MSVCRT_DLL_VERSION 140)
set(_MSVCRT_IDE_VERSION 15)
elseif(MSVC_VERSION EQUAL 1900)
set(MSVC_REDIST_NAME VC140)
set(_MSVCRT_DLL_VERSION 140)
set(_MSVCRT_IDE_VERSION 14)
elseif(MSVC_VERSION EQUAL 1800)
set(MSVC_REDIST_NAME VC120)
set(_MSVCRT_DLL_VERSION 120)
set(_MSVCRT_IDE_VERSION 12)
elseif(MSVC_VERSION EQUAL 1700)
set(MSVC_REDIST_NAME VC110)
set(_MSVCRT_DLL_VERSION 110)
set(_MSVCRT_IDE_VERSION 11)
elseif(MSVC_VERSION EQUAL 1600)
set(MSVC_REDIST_NAME VC100)
set(_MSVCRT_DLL_VERSION 100)
set(_MSVCRT_IDE_VERSION 10)
else()
set(_MSVCRT_DLL_VERSION "")
set(_MSVCRT_IDE_VERSION "")
endif()
if(_MSVCRT_DLL_VERSION)
@ -219,10 +234,10 @@ if(MSVC)
unset(_vs_dir)
unset(programfilesx86)
endif()
find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT PATHS ${_vs_redist_paths})
find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths})
unset(_vs_redist_paths)
mark_as_advanced(MSVC_REDIST_DIR)
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT")
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs
@ -242,7 +257,7 @@ if(MSVC)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_CRT_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.DebugCRT")
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT")
set(__install__libs ${__install__libs}
"${MSVC_CRT_DIR}/msvcp${v}d.dll"
)
@ -383,7 +398,11 @@ if(MSVC)
)
endif()
if(MSVC_VERSION EQUAL 1910)
set(_MFC_DLL_VERSION "")
set(_MFC_IDE_VERSION "")
if(MSVC_VERSION GREATER_EQUAL 2000)
# Version not yet supported.
elseif(MSVC_VERSION GREATER_EQUAL 1910)
set(_MFC_DLL_VERSION 140)
set(_MFC_IDE_VERSION 15)
elseif(MSVC_VERSION EQUAL 1900)
@ -398,9 +417,6 @@ if(MSVC)
elseif(MSVC_VERSION EQUAL 1600)
set(_MFC_DLL_VERSION 100)
set(_MFC_IDE_VERSION 10)
else()
set(_MFC_DLL_VERSION "")
set(_MFC_IDE_VERSION "")
endif()
if(_MFC_DLL_VERSION)
@ -410,7 +426,7 @@ if(MSVC)
# Starting with VS 15 the MFC DLLs may be in a different directory.
if (NOT vs VERSION_LESS 15)
file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFC
find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC
PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
mark_as_advanced(MSVC_REDIST_MFC_DIR)
unset(_MSVC_REDIST_DIRS)
@ -424,7 +440,7 @@ if(MSVC)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_MFC_DIR
"${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.DebugMFC")
"${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}ud.dll"
"${MSVC_MFC_DIR}/mfcm${v}ud.dll"
@ -437,7 +453,7 @@ if(MSVC)
endif()
endif()
set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFC")
set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}u.dll"
@ -452,7 +468,7 @@ if(MSVC)
endif()
# include the language dll's as well as the actuall dll's
set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFCLOC")
set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC")
set(__install__libs ${__install__libs}
"${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
@ -471,7 +487,11 @@ if(MSVC)
# MSVC 8 was the first version with OpenMP
# Furthermore, there is no debug version of this
if(CMAKE_INSTALL_OPENMP_LIBRARIES)
if(MSVC_VERSION EQUAL 1910)
set(_MSOMP_DLL_VERSION "")
set(_MSOMP_IDE_VERSION "")
if(MSVC_VERSION GREATER_EQUAL 2000)
# Version not yet supported.
elseif(MSVC_VERSION GREATER_EQUAL 1910)
set(_MSOMP_DLL_VERSION 140)
set(_MSOMP_IDE_VERSION 15)
elseif(MSVC_VERSION EQUAL 1900)
@ -492,15 +512,12 @@ if(MSVC)
elseif(MSVC_VERSION EQUAL 1400)
set(_MSOMP_DLL_VERSION 80)
set(_MSOMP_IDE_VERSION 8)
else()
set(_MSOMP_DLL_VERSION "")
set(_MSOMP_IDE_VERSION "")
endif()
if(_MSOMP_DLL_VERSION)
set(v "${_MSOMP_DLL_VERSION}")
set(vs "${_MSOMP_IDE_VERSION}")
set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.OPENMP")
set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}

@ -30,9 +30,5 @@
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
</dict>
</plist>

@ -124,7 +124,7 @@ file(STRINGS "${_ANDROID_TOOL_SETUP_MK}" _ANDROID_TOOL_SETUP REGEX "^(LLVM|TOOLC
unset(_ANDROID_TOOL_SETUP_MK)
set(_ANDROID_TOOL_PREFIX "")
set(_ANDROID_TOOL_NAME_ONLY "")
set(_ANDROID_TOOL_LLVM_NAME "")
set(_ANDROID_TOOL_LLVM_NAME "llvm")
set(_ANDROID_TOOL_LLVM_VERS "")
foreach(line IN LISTS _ANDROID_TOOL_SETUP)
if(CMAKE_ANDROID_NDK_TOOLCHAIN_DEBUG)

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

@ -9,6 +9,7 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
#include <iomanip>
#include <map>
#include <stdlib.h>

@ -570,6 +570,8 @@ int cmCTestCoverageHandler::ProcessHandler()
ostr << "Cannot open source file: " << fullPath;
errorsWhileAccumulating.push_back(ostr.str());
error++;
covLogXML.EndElement(); // Report
covLogXML.EndElement(); // File
continue;
}
int untested = 0;

@ -158,7 +158,7 @@ const char* cmGeneratorTarget::GetSourcesProperty() const
}
static std::string value;
value.clear();
value = cmJoin(values, "");
value = cmJoin(values, ";");
return value.c_str();
}

@ -200,10 +200,16 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations(
std::string guid = this->GetGUID(name);
for (std::vector<std::string>::const_iterator i = configs.begin();
i != configs.end(); ++i) {
const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(*i));
if (dstConfig == CM_NULLPTR) {
dstConfig = i->c_str();
std::vector<std::string> mapConfig;
const char* dstConfig = i->c_str();
if (target.GetProperty("EXTERNAL_MSPROJECT")) {
if (const char* m = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(*i))) {
cmSystemTools::ExpandListArgument(m, mapConfig);
if (!mapConfig.empty()) {
dstConfig = mapConfig[0].c_str();
}
}
}
fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << dstConfig
<< "|" << platformName << std::endl;

@ -354,10 +354,16 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
std::string guid = this->GetGUID(name);
for (std::vector<std::string>::const_iterator i = configs.begin();
i != configs.end(); ++i) {
const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(*i));
if (dstConfig == CM_NULLPTR) {
dstConfig = i->c_str();
std::vector<std::string> mapConfig;
const char* dstConfig = i->c_str();
if (target.GetProperty("EXTERNAL_MSPROJECT")) {
if (const char* m = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(*i))) {
cmSystemTools::ExpandListArgument(m, mapConfig);
if (!mapConfig.empty()) {
dstConfig = mapConfig[0].c_str();
}
}
}
fout << "\t\t{" << guid << "}." << *i << "|" << this->GetPlatformName()
<< ".ActiveCfg = " << dstConfig << "|"

@ -778,6 +778,19 @@ bool cmGlobalVisualStudioGenerator::TargetIsCSharpOnly(
return false;
}
bool cmGlobalVisualStudioGenerator::TargetCanBeReferenced(
cmGeneratorTarget const* gt)
{
if (this->TargetIsCSharpOnly(gt)) {
return true;
}
if (gt->GetType() != cmStateEnums::SHARED_LIBRARY &&
gt->GetType() != cmStateEnums::EXECUTABLE) {
return false;
}
return true;
}
bool cmGlobalVisualStudioGenerator::TargetCompare::operator()(
cmGeneratorTarget const* l, cmGeneratorTarget const* r) const
{

@ -85,6 +85,9 @@ public:
// return true if target is C# only
static bool TargetIsCSharpOnly(cmGeneratorTarget const* gt);
// return true if target can be referenced by C# targets
bool TargetCanBeReferenced(cmGeneratorTarget const* gt);
/** Get the top-level registry key for this VS version. */
std::string GetRegistryBase();

@ -1517,17 +1517,6 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
makecmd += " all";
buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
cmXCodeObject* outputFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
for (std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i) {
std::vector<std::string> const& outputs = i->GetOutputs();
for (std::vector<std::string>::const_iterator j = outputs.begin();
j != outputs.end(); ++j) {
outputFiles->AddObject(this->CreateString(*j));
}
}
buildphase->AddAttribute("outputPaths", outputFiles);
}
void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(

@ -719,7 +719,8 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
const std::string qtMajorVersion = GetQtMajorVersion(target);
const std::string rccCommand = RccGetExecutable(target, qtMajorVersion);
const std::vector<std::string> suffixes = GetConfigurationSuffixes(makefile);
std::vector<std::string> autogenDepends;
std::vector<std::string> autogenDependFiles;
std::vector<std::string> autogenDependTargets;
std::vector<std::string> autogenProvides;
// Remove build directories on cleanup
@ -810,18 +811,16 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
#endif
// Initialize autogen target dependencies
if (const char* deps = target->GetProperty("AUTOGEN_TARGET_DEPENDS")) {
cmSystemTools::ExpandListArgument(deps, autogenDepends);
}
// Add link library targets to the autogen dependencies
{
const cmTarget::LinkLibraryVectorType& libVec =
target->Target->GetOriginalLinkLibraries();
for (cmTarget::LinkLibraryVectorType::const_iterator it = libVec.begin();
it != libVec.end(); ++it) {
const std::string& libName = it->first;
if (makefile->FindTargetToUse(libName) != CM_NULLPTR) {
autogenDepends.push_back(libName);
if (const char* extraDeps = target->GetProperty("AUTOGEN_TARGET_DEPENDS")) {
std::vector<std::string> deps;
cmSystemTools::ExpandListArgument(extraDeps, deps);
for (std::vector<std::string>::const_iterator itC = deps.begin(),
itE = deps.end();
itC != itE; ++itC) {
if (makefile->FindTargetToUse(*itC) != CM_NULLPTR) {
autogenDependTargets.push_back(*itC);
} else {
autogenDependFiles.push_back(*itC);
}
}
}
@ -845,7 +844,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
if (PropertyEnabled(sf, "GENERATED")) {
if ((mocEnabled && !PropertyEnabled(sf, "SKIP_AUTOMOC")) ||
(uicEnabled && !PropertyEnabled(sf, "SKIP_AUTOUIC"))) {
autogenDepends.push_back(
autogenDependFiles.push_back(
cmsys::SystemTools::GetRealPath(sf->GetFullPath()));
#if defined(_WIN32) && !defined(__CYGWIN__)
// Cannot use PRE_BUILD with generated files
@ -890,7 +889,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
if (PropertyEnabled(sf, "GENERATED")) {
// Add generated qrc file to the dependencies
autogenDepends.push_back(absFile);
autogenDependFiles.push_back(absFile);
} else {
// Run cmake again when .qrc file changes
makefile->AddCMakeDependFile(absFile);
@ -898,7 +897,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
// Add the qrc input files to the dependencies
std::string error;
if (!cmQtAutoGeneratorCommon::RccListInputs(
qtMajorVersion, rccCommand, absFile, autogenDepends,
qtMajorVersion, rccCommand, absFile, autogenDependFiles,
&error)) {
cmSystemTools::Error(error.c_str());
}
@ -916,13 +915,9 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
#if defined(_WIN32) && !defined(__CYGWIN__)
if (usePRE_BUILD) {
// If the autogen target depends on an other target don't use PRE_BUILD
for (std::vector<std::string>::iterator it = autogenDepends.begin();
it != autogenDepends.end(); ++it) {
if (makefile->FindTargetToUse(*it) != CM_NULLPTR) {
// We can't use pre-build if we depend on additional files
if (!autogenDependFiles.empty()) {
usePRE_BUILD = false;
break;
}
}
}
if (usePRE_BUILD) {
@ -930,23 +925,63 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
// rejection in cmMakefile::AddCustomCommandToTarget because we know
// PRE_BUILD will work for an OBJECT_LIBRARY in this specific case.
std::vector<std::string> no_output;
cmCustomCommand cc(makefile, no_output, autogenProvides, autogenDepends,
std::vector<std::string> no_depends;
cmCustomCommand cc(makefile, no_output, autogenProvides, no_depends,
commandLines, autogenComment.c_str(),
workingDirectory.c_str());
cc.SetEscapeOldStyle(false);
cc.SetEscapeAllowMakeVars(true);
target->Target->AddPreBuildCommand(cc);
// Add additional target dependencies to the origin target
for (std::vector<std::string>::const_iterator
itC = autogenDependTargets.begin(),
itE = autogenDependTargets.end();
itC != itE; ++itC) {
target->Target->AddUtility(*itC);
}
} else
#endif
{
cmTarget* autogenTarget = makefile->AddUtilityCommand(
autogenTargetName, true, workingDirectory.c_str(),
/*byproducts=*/autogenProvides, autogenDepends, commandLines, false,
/*byproducts=*/autogenProvides, autogenDependFiles, commandLines, false,
autogenComment.c_str());
cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
lg->AddGeneratorTarget(gt);
// Add origin link library targets to the autogen target dependencies
{
const cmTarget::LinkLibraryVectorType& libVec =
target->Target->GetOriginalLinkLibraries();
for (cmTarget::LinkLibraryVectorType::const_iterator
itC = libVec.begin(),
itE = libVec.end();
itC != itE; ++itC) {
const std::string& libName = itC->first;
if (makefile->FindTargetToUse(libName) != CM_NULLPTR) {
autogenDependTargets.push_back(libName);
}
}
}
// Add origin utility targets to the autogen target dependencies
{
const std::set<std::string>& utils = target->Target->GetUtilities();
for (std::set<std::string>::const_iterator itC = utils.begin(),
itE = utils.end();
itC != itE; ++itC) {
autogenDependTargets.push_back(*itC);
}
}
// Add additional target dependencies to the autogen target
for (std::vector<std::string>::const_iterator
itC = autogenDependTargets.begin(),
itE = autogenDependTargets.end();
itC != itE; ++itC) {
autogenTarget->AddUtility(*itC);
}
// Set target folder
const char* autogenFolder =
makefile->GetState()->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");

@ -1446,31 +1446,62 @@ bool cmQtAutoGenerators::MocGenerateFile(
bool cmQtAutoGenerators::UicFindIncludedFile(std::string& absFile,
const std::string& sourceFile,
const std::string& includeString)
const std::string& searchPath,
const std::string& searchFile)
{
bool success = false;
// Search in vicinity of the source
std::vector<std::string> testFiles;
// Collect search paths list
{
std::string testPath = SubDirPrefix(sourceFile);
testPath += includeString;
if (cmsys::SystemTools::FileExists(testPath.c_str())) {
absFile = cmsys::SystemTools::GetRealPath(testPath);
success = true;
const std::string searchFileFull = searchPath + searchFile;
// Vicinity of the source
{
const std::string sourcePath = SubDirPrefix(sourceFile);
testFiles.push_back(sourcePath + searchFile);
if (!searchPath.empty()) {
testFiles.push_back(sourcePath + searchFileFull);
}
}
// Search in include directories
if (!success) {
// AUTOUIC search paths
if (!this->UicSearchPaths.empty()) {
for (std::vector<std::string>::const_iterator iit =
this->UicSearchPaths.begin();
iit != this->UicSearchPaths.end(); ++iit) {
const std::string fullPath = ((*iit) + '/' + includeString);
if (cmsys::SystemTools::FileExists(fullPath.c_str())) {
absFile = cmsys::SystemTools::GetRealPath(fullPath);
testFiles.push_back(*iit + "/" + searchFile);
}
if (!searchPath.empty()) {
for (std::vector<std::string>::const_iterator iit =
this->UicSearchPaths.begin();
iit != this->UicSearchPaths.end(); ++iit) {
testFiles.push_back(*iit + "/" + searchFileFull);
}
}
}
}
// Search for the .ui file!
for (std::vector<std::string>::const_iterator iit = testFiles.begin();
iit != testFiles.end(); ++iit) {
const std::string& testFile = *iit;
if (cmsys::SystemTools::FileExists(testFile.c_str())) {
absFile = cmsys::SystemTools::GetRealPath(testFile);
success = true;
break;
}
}
// Log error
if (!success) {
std::ostringstream ost;
ost << "AutoUic: Error: " << Quoted(sourceFile) << "\n";
ost << "Could not find " << Quoted(searchFile) << " in\n";
for (std::vector<std::string>::const_iterator iit = testFiles.begin();
iit != testFiles.end(); ++iit) {
ost << " " << Quoted(*iit) << "\n";
}
this->LogError(ost.str());
}
return success;
}
@ -1500,16 +1531,14 @@ bool cmQtAutoGenerators::UicGenerateAll(
const std::string uiBasePath = SubDirPrefix(*uit);
const std::string uiBaseName =
cmsys::SystemTools::GetFilenameWithoutLastExtension(*uit).substr(3);
const std::string searchFileName = uiBasePath + uiBaseName + ".ui";
const std::string uiFileName = uiBaseName + ".ui";
std::string uiInputFile;
if (UicFindIncludedFile(uiInputFile, source, searchFileName)) {
if (UicFindIncludedFile(uiInputFile, source, uiBasePath, uiFileName)) {
std::string uiOutputFile = uiBasePath + "ui_" + uiBaseName + ".h";
cmSystemTools::ReplaceString(uiOutputFile, "..", "__");
uiGenMap[uiInputFile] = uiOutputFile;
testMap[uiInputFile] = uiOutputFile;
} else {
this->LogError("AutoUic: Error: " + Quoted(sit->first) +
"\nCould not find " + Quoted(searchFileName));
return false;
}
}

@ -112,7 +112,8 @@ private:
// -- Uic file generation
bool UicFindIncludedFile(std::string& absFile, const std::string& sourceFile,
const std::string& includeString);
const std::string& searchPath,
const std::string& searchFile);
bool UicGenerateAll(
const std::map<std::string, std::vector<std::string> >& includedUis);
bool UicGenerateFile(const std::string& realName,

@ -3502,6 +3502,13 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
(*this->BuildFileStream) << "</Project>\n";
this->WriteString("<Name>", 3);
(*this->BuildFileStream) << name << "</Name>\n";
if (csproj == this->ProjectType) {
if (!static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
->TargetCanBeReferenced(dt)) {
this->WriteString(
"<ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n", 3);
}
}
this->WriteString("</ProjectReference>\n", 2);
}
this->WriteString("</ItemGroup>\n", 1);

@ -306,7 +306,7 @@ int do_cmake(int ac, char const* const* av)
return ret;
}
cmake::Role const role =
workingMode == cmake::NORMAL_MODE ? cmake::RoleProject : cmake::RoleScript;
workingMode == cmake::SCRIPT_MODE ? cmake::RoleScript : cmake::RoleProject;
cmake cm(role);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");

@ -15,3 +15,9 @@ target_compile_options(CLIApp PRIVATE "/clr")
add_executable(CSharpLinkToCxx csharp.cs)
target_link_libraries(CSharpLinkToCxx CLIApp)
# this unmanaged C++ library will be added to the C#/.NET
# references of CSharpLinkToCxx but it will show a warning
# because it is unmanaged
add_library(CppNativeApp SHARED cpp_native.hpp cpp_native.cpp)
target_link_libraries(CSharpLinkToCxx CppNativeApp)

@ -0,0 +1,10 @@
#include "cpp_native.hpp"
#include <iostream>
namespace CppApp {
void MyCpp::testMyCpp()
{
std::cout << "#message from CppApp" << std::endl;
}
}

@ -0,0 +1,9 @@
#pragma once
namespace CppApp {
class MyCpp
{
public:
void testMyCpp();
};
}

@ -5,5 +5,7 @@ find_path(FOO_INCLUDE_DIR NAMES foo.h HINTS "@CMAKE_CURRENT_SOURCE_DIR@" )
set(FOO_LIBRARIES ${FOO_LIBRARY})
set(FOO_INCLUDE_DIRS "${FOO_INCLUDE_DIR}" "/some/path/with a space/include" )
add_library(Foo::Foo INTERFACE IMPORTED)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Foo DEFAULT_MSG FOO_LIBRARY FOO_INCLUDE_DIR )

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.7)
project(mocDepends)
cmake_minimum_required(VERSION 3.9)
project(mocDepends CXX)
if (QT_TEST_VERSION STREQUAL 4)
find_package(Qt4 REQUIRED)
@ -14,34 +14,138 @@ else()
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(CSD ${CMAKE_CURRENT_SOURCE_DIR})
set(CBD ${CMAKE_CURRENT_BINARY_DIR})
# -- Test 1 using generated header
# This tests the dependency of AUTOMOC of mocDepends1 to the generated object.hpp
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/object.hpp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/invalid.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/object.hpp
# -- Test dependency on header generated by a custom command
#
# The ORIGIN_autogen target must depend on the same *GENERATED* source files as
# the ORIGIN target. This is a requirement to ensure that all files for the
# ORIGIN target are generated before the ORIGIN_autogen target is built.
#
# This tests the dependency of the mocDepGenFile_autogen target of
# mocDepGenFile to the source file GenFile.hpp, which is *GENERATED*
# by a custom command.
# If mocDepGenFile_autogen gets built *before* or in *parallel* to the
# custom command, the build will fail. That's because GenFile.hpp,
# which is required by mocDepGenFile_autogen, is only valid after the
# custom command has been completed.
#
# The sleep seconds artificially increase the build time of the custom command
# to simulate a slow file generation process that takes longer to run than
# the build of the mocDepGenFile_autogen target.
add_custom_command(
OUTPUT ${CBD}/GenFile.hpp
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/GenFile.hpp
COMMAND ${CMAKE_COMMAND} -E sleep 3
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/object.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/object.hpp
)
add_executable(mocDepends1 test1.cpp
${CMAKE_CURRENT_BINARY_DIR}/object.hpp
)
target_link_libraries(mocDepends1 ${QT_CORE_TARGET})
set_target_properties(mocDepends1 PROPERTIES AUTOMOC TRUE)
set_property(TARGET mocDepends1 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
# -- Test 2 using generated library
# This tests the dependency of AUTOMOC of mocDepends2 to the
# generated simpleLib.hpp which belongs to a linked library of mocDepends2
add_custom_command(OUTPUT simpleLib.hpp simpleLib.cpp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/invalid.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.hpp
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/GenFile.hpp)
add_executable(mocDepGenFile testGenFile.cpp ${CBD}/GenFile.hpp)
target_link_libraries(mocDepGenFile ${QT_CORE_TARGET})
set_target_properties(mocDepGenFile PROPERTIES AUTOMOC TRUE)
set_property(TARGET mocDepGenFile PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
# -- Test dependency on header generating custom target
#
# The ORIGIN_autogen target must depend on the same user defined targets
# as the ORIGIN target. This is a requirement to ensure that all files for the
# ORIGIN target are generated before the ORIGIN_autogen target is built.
#
# This tests the dependency of the mocDepTarget_autogen target of
# mocDepTarget to the utility target mocDepTargetUtil.
# If mocDepTarget_autogen gets built *before* or in *parallel* to
# mocDepTargetUtil, the build will fail. That's
# because GenTarget.hpp, which is required by mocDepTarget_autogen,
# is only valid after the mocDepTargetUtil build has been completed.
#
# The sleep seconds artificially increase the build time of mocDepTargetUtil
# to simulate a slow utility target build that takes longer to run than
# the build of the mocDepTarget_autogen target.
add_custom_target(mocDepTargetUtil
BYPRODUCTS ${CBD}/GenTarget.hpp
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/GenTarget.hpp
COMMAND ${CMAKE_COMMAND} -E sleep 3
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/GenTarget.hpp)
add_executable(mocDepTarget testGenTarget.cpp)
target_link_libraries(mocDepTarget ${QT_CORE_TARGET})
set_target_properties(mocDepTarget PROPERTIES AUTOMOC TRUE)
add_dependencies(mocDepTarget mocDepTargetUtil)
# -- Test 3: Depend on generated linked library
# The ORIGIN_autogen target must depend on the same linked libraries
# as the ORIGIN target. This is a requirement to ensure that all files for the
# ORIGIN target are generated before the ORIGIN_autogen target is built.
#
# This tests the dependency of the mocDepGenLib_autogen target of mocDepGenLib
# to the user generated library SimpleLib, which mocDepGenLib links to.
# If mocDepGenLib_autogen gets built *before* or in *parallel* to SimpleLib,
# the build will fail. That's because simpleLib.hpp, which is required by
# mocDepGenLib_autogen, is only valid after the SimpleLib build has been
# completed.
#
# The sleep seconds artificially increase the build time of SimpleLib
# to simulate a slow utility library build that takes longer to run than
# the build of the mocDepGenLib_autogen target.
add_custom_command(
OUTPUT ${CBD}/simpleLib.hpp ${CBD}/simpleLib.cpp
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/simpleLib.hpp
COMMAND ${CMAKE_COMMAND} -E sleep 3
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/simpleLib.hpp.in ${CBD}/simpleLib.hpp
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/simpleLib.cpp.in ${CBD}/simpleLib.cpp)
add_library(SimpleLib STATIC ${CBD}/simpleLib.hpp ${CBD}/simpleLib.cpp)
target_link_libraries(SimpleLib ${QT_CORE_TARGET})
add_executable(mocDepGenLib testGenLib.cpp)
target_link_libraries(mocDepGenLib SimpleLib ${QT_CORE_TARGET})
set_target_properties(mocDepGenLib PROPERTIES AUTOMOC TRUE)
# -- Test AUTOGEN_TARGET_DEPENDS with GENERATED file dependency
#
# This tests the dependency of the mocDepATDFile_autogen target of
# mocDepATDTarget to the utility target mocDepATDFileUtil.
# If mocDepATDFile_autogen gets built *before* or in *parallel* to
# mocDepATDFileUtil, the build will fail. That's
# because ATDFile.hpp, which is required by mocDepATDFile_autogen,
# is only valid after the mocDepATDFileUtil build has been completed.
#
# The sleep seconds artificially increase the build time of
# mocDepATDFileUtil to simulate a slow utility target build that takes
# longer to run than the build of the mocDepATDFile_autogen target.
add_custom_command(
OUTPUT ${CBD}/ATDFile.hpp
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDFile.hpp
COMMAND ${CMAKE_COMMAND} -E sleep 3
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDFile.hpp)
add_executable(mocDepATDFile testATDFile.cpp)
target_link_libraries(mocDepATDFile ${QT_CORE_TARGET})
set_target_properties(mocDepATDFile PROPERTIES AUTOMOC TRUE)
set_target_properties(mocDepATDFile PROPERTIES AUTOGEN_TARGET_DEPENDS ${CBD}/ATDFile.hpp)
# -- Test AUTOGEN_TARGET_DEPENDS with target dependency
#
# This tests the dependency of the mocDepATDTarget_autogen target of
# mocDepATDTarget to the utility target mocDepATDTargetUtil.
# If mocDepATDTarget_autogen gets built *before* or in *parallel* to
# mocDepATDTargetUtil, the build will fail. That's
# because ATDTarget.hpp, which is required by mocDepATDTarget_autogen,
# is only valid after the mocDepATDTargetUtil build has been completed.
#
# The sleep seconds artificially increase the build time of
# mocDepATDTargetUtil to simulate a slow utility target build that takes
# longer to run than the build of the mocDepATDTarget_autogen target.
add_custom_target(mocDepATDTargetUtil
BYPRODUCTS ${CBD}/ATDTarget.hpp
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDTarget.hpp
COMMAND ${CMAKE_COMMAND} -E sleep 3
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/simpleLib.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.hpp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/simpleLib.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.cpp
)
add_library(SimpleLib STATIC simpleLib.hpp simpleLib.cpp)
add_executable(mocDepends2 test2.cpp )
target_link_libraries(mocDepends2 SimpleLib ${QT_CORE_TARGET})
set_target_properties(mocDepends2 PROPERTIES AUTOMOC TRUE)
set_property(TARGET mocDepends2 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDTarget.hpp)
add_executable(mocDepATDTarget testATDTarget.cpp)
target_link_libraries(mocDepATDTarget ${QT_CORE_TARGET})
set_target_properties(mocDepATDTarget PROPERTIES AUTOMOC TRUE)
set_target_properties(mocDepATDTarget PROPERTIES AUTOGEN_TARGET_DEPENDS mocDepATDTargetUtil)

@ -1,8 +1,11 @@
#ifndef SIMPLE_LIB_H
#define SIMPLE_LIB_H
class SimpleLib
#include <QObject>
class SimpleLib : public QObject
{
Q_OBJECT
public:
SimpleLib();
~SimpleLib();

@ -1,10 +0,0 @@
#include "test2.hpp"
int main()
{
SimpleLib obj;
LObject lobject;
return 0;
}

@ -0,0 +1,9 @@
#include "ATDFile.hpp"
#include "moc_ATDFile.cpp"
int main()
{
Object obj;
return 0;
}

@ -0,0 +1,9 @@
#include "ATDTarget.hpp"
#include "moc_ATDTarget.cpp"
int main()
{
Object obj;
return 0;
}

@ -1,9 +1,8 @@
#include "object.hpp"
#include "GenFile.hpp"
int main()
{
Object obj;
return 0;
}

@ -0,0 +1,12 @@
#include "testGenLib.hpp"
int main()
{
SimpleLib libObject;
LObject lobject;
return 0;
}
// Depend on and AUTOMOC the SimpleLib header simpleLib.hpp
#include "moc_simpleLib.cpp"

@ -1,5 +1,5 @@
#ifndef TEST2_HPP
#define TEST2_HPP
#ifndef TEST3_HPP
#define TEST3_HPP
#include "simpleLib.hpp"
#include <QObject>

@ -0,0 +1,9 @@
#include "GenTarget.hpp"
#include "moc_GenTarget.cpp"
int main()
{
Object obj;
return 0;
}

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageC2</class>
<widget class="QWidget" name="PageC2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeView" name="treeView"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageB2</class>
<widget class="QWidget" name="PageB2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeView" name="treeView"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageBsub</class>
<widget class="QWidget" name="PageBsub">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeView" name="treeView"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -6,5 +6,13 @@ int main(int argv, char** args)
return 0;
}
#include "sub/ui_PageB.h"
// .ui files in CMAKE_AUTOUIC_SEARCH_PATHS
#include "ui_PageA.h"
// .ui files in AUTOUIC_SEARCH_PATHS
#include "sub/gen/deep/ui_PageB2.h"
#include "subB/ui_PageBsub.h"
#include "ui_PageB.h"
// .ui files in source's vicinity
#include "sub/gen/deep/ui_PageC2.h"
#include "subC/ui_PageCsub.h"
#include "ui_PageC.h"

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageCsub</class>
<widget class="QWidget" name="PageCsub">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeView" name="treeView"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -32,6 +32,7 @@ run_cmake(COMPILE_LANGUAGE-unknown-lang)
run_cmake(TARGET_FILE-recursion)
run_cmake(OUTPUT_NAME-recursion)
run_cmake(TARGET_PROPERTY-LOCATION)
run_cmake(TARGET_PROPERTY-SOURCES)
run_cmake(LINK_ONLY-not-linking)
run_cmake(ImportedTarget-TARGET_BUNDLE_DIR)

@ -0,0 +1,9 @@
file(READ ${RunCMake_TEST_BINARY_DIR}/foo.txt foo_sources)
# VS generators inject CMakeLists.txt as a source. Remove it.
string(REGEX REPLACE ";[^;]*CMakeLists.txt$" "" foo_sources "${foo_sources}")
set(foo_expected "empty.c;empty2.c;empty3.c")
if(NOT foo_sources STREQUAL foo_expected)
set(RunCMake_TEST_FAILED "foo SOURCES was:\n [[${foo_sources}]]\nbut expected:\n [[${foo_expected}]]")
endif()

@ -0,0 +1,5 @@
enable_language(C)
add_library(foo empty.c empty2.c)
target_sources(foo PRIVATE empty3.c)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/foo.txt
CONTENT "$<TARGET_PROPERTY:foo,SOURCES>")

@ -830,6 +830,12 @@ rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
# If building in-source, remove any cmConfigure.h that may
# have been created by a previous run of the bootstrap cmake.
if [ -n "${cmake_in_source_build}" ]; then
rm -f "${cmake_source_dir}/Source/cmConfigure.h"
fi
# If exist compiler flags, set them
cmake_c_flags=${CFLAGS}
cmake_cxx_flags=${CXXFLAGS}

Loading…
Cancel
Save