diff options
99 files changed, 792 insertions, 191 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index b0f86ec..6010b64 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -54,6 +54,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "ld: warning: directory not found for option .-(F|L)" "warning.*This version of Mac OS X is unsupported" "clang.*: warning: argument unused during compilation: .-g" + "note: in expansion of macro" # diagnostic context note # Ignore clang's summary warning, assuming prior text has matched some # other warning expression: diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst index b0c5446..028ca5a 100644 --- a/Help/command/add_custom_command.rst +++ b/Help/command/add_custom_command.rst @@ -156,3 +156,7 @@ target is built before any target using this custom command. Additionally, if the target is an executable or library a file-level dependency is created to cause the custom command to re-run whenever the target is recompiled. + +Arguments to ``DEPENDS`` may use "generator expressions" with the syntax +``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for +available expressions. diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index e4c3246..cad4951 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -173,7 +173,7 @@ The Qt 4 and 5 :prop_tgt:`IMPORTED` targets for the QtGui libraries specify that the qtmain.lib static library shipped with Qt will be linked by all dependent executables which have the :prop_tgt:`WIN32_EXECUTABLE` enabled. -Do disable this behavior, enable the ``Qt5_NO_LINK_QTMAIN`` target property for +To disable this behavior, enable the ``Qt5_NO_LINK_QTMAIN`` target property for Qt 5 based targets or ``QT4_NO_LINK_QTMAIN`` target property for Qt 4 based targets. diff --git a/Help/release/dev/ExternalProject-no-download-progress.rst b/Help/release/dev/ExternalProject-no-download-progress.rst new file mode 100644 index 0000000..41db55d --- /dev/null +++ b/Help/release/dev/ExternalProject-no-download-progress.rst @@ -0,0 +1,6 @@ +ExternalProject-no-download-progress +------------------------------------ + +* The :module:`ExternalProject` module ``ExternalProject_Add`` command + learned a new ``DOWNLOAD_NO_PROGRESS`` option to disable progress + output while downloading the source tarball. diff --git a/Help/release/dev/add_custom_command-DEPENDS-genex.rst b/Help/release/dev/add_custom_command-DEPENDS-genex.rst new file mode 100644 index 0000000..1e528e6 --- /dev/null +++ b/Help/release/dev/add_custom_command-DEPENDS-genex.rst @@ -0,0 +1,5 @@ +add_custom_command-DEPENDS-genex +-------------------------------- + +* The :command:`add_custom_command` command learned to interpret + :manual:`cmake-generator-expressions(7)` in arguments to ``DEPENDS``. diff --git a/Help/release/dev/custom-ninja-deptypes.rst b/Help/release/dev/custom-ninja-deptypes.rst new file mode 100644 index 0000000..7750da8 --- /dev/null +++ b/Help/release/dev/custom-ninja-deptypes.rst @@ -0,0 +1,5 @@ +custom-ninja-deptypes +--------------------- + +* Add a `CMAKE_NINJA_DEPTYPE_<LANG>` variable so that compilers may set the + deptype for use in Ninja other than those CMake itself knows about. diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index 804cce2..694f8b8 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -26,7 +26,7 @@ if(CMAKE_COMPILER_IS_MINGW) set(MINGW 1) endif() set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_C_LINKER_PREFERENCE 10) diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 561ccf2..16e19cd 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -68,10 +68,19 @@ # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) #elif defined(__WATCOMC__) -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) +# if __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRP */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# else +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# endif +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif #elif defined(__SUNPRO_C) # define COMPILER_ID "SunPro" diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 35aa6c4..c75611a 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -27,7 +27,7 @@ if(CMAKE_COMPILER_IS_MINGW) endif() set(CMAKE_CXX_COMPILER_ID_RUN 1) set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) set(CMAKE_CXX_LINKER_PREFERENCE 30) set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 6c602d4..d81df77 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -73,10 +73,19 @@ # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) #elif defined(__WATCOMC__) -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) +# if __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRP */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# else +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# endif +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif #elif defined(__SUNPRO_CC) # define COMPILER_ID "SunPro" diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake index 38a6d35..fa025a8 100644 --- a/Modules/CMakeCommonLanguageInclude.cmake +++ b/Modules/CMakeCommonLanguageInclude.cmake @@ -16,9 +16,11 @@ # cache values that can be initialized in the platform-compiler.cmake file # it may be included by more than one language. -set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" - CACHE STRING "Flags used by the linker.") - +if(NOT "x$ENV{LDFLAGS}" STREQUAL "x") + set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}") + set (CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}") + set (CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}") +endif() if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) # default build type is none @@ -82,12 +84,17 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) ${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING "Flags used by the linker during Release with Debug Info builds.") endif() + +# executable linker flags +set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT}" + CACHE STRING "Flags used by the linker.") + # shared linker flags -set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" +set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT}" CACHE STRING "Flags used by the linker during the creation of dll's.") # module linker flags -set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" +set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT}" CACHE STRING "Flags used by the linker during the creation of modules.") # static linker flags @@ -124,4 +131,3 @@ CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL CMAKE_STATIC_LINKER_FLAGS_RELEASE CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO ) - diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index 1e41fec..bc26c07 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -74,6 +74,23 @@ #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) # define PLATFORM_ID "Xenix" +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID "" +# endif + #else /* unknown platform */ # define PLATFORM_ID "" @@ -107,6 +124,17 @@ # define ARCHITECTURE_ID "" # endif +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + #else # define ARCHITECTURE_ID "" #endif diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index ec28d8b..333b325 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -75,6 +75,7 @@ # License text for the above reference.) include(CheckIncludeFile) +include(CheckIncludeFileCXX) cmake_policy(PUSH) cmake_minimum_required(VERSION 2.6 FATAL_ERROR) @@ -218,9 +219,15 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE) set(_builtin 0) else() set(_builtin 1) - check_include_file(sys/types.h HAVE_SYS_TYPES_H) - check_include_file(stdint.h HAVE_STDINT_H) - check_include_file(stddef.h HAVE_STDDEF_H) + if("${_language}" STREQUAL "C") + check_include_file(sys/types.h HAVE_SYS_TYPES_H) + check_include_file(stdint.h HAVE_STDINT_H) + check_include_file(stddef.h HAVE_STDDEF_H) + elseif("${_language}" STREQUAL "CXX") + check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H) + check_include_file_cxx(stdint.h HAVE_STDINT_H) + check_include_file_cxx(stddef.h HAVE_STDDEF_H) + endif() endif() unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY) unset(_CHECK_TYPE_SIZE_LANGUAGE) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 1e83163..8235dda 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -20,6 +20,7 @@ # [DOWNLOAD_NAME fname] # File name to store (if not end of URL) # [DOWNLOAD_DIR dir] # Directory to store downloaded files # [DOWNLOAD_COMMAND cmd...] # Command to download source tree +# [DOWNLOAD_NO_PROGRESS 1] # Disable download progress reports # [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository # [CVS_MODULE mod] # Module to checkout from CVS repo # [CVS_TAG tag] # Tag to checkout from CVS repo @@ -515,7 +516,7 @@ endif() endfunction(_ep_write_gitupdate_script) -function(_ep_write_downloadfile_script script_filename remote local timeout hash tls_verify tls_cainfo) +function(_ep_write_downloadfile_script script_filename remote local timeout no_progress hash tls_verify tls_cainfo) if(timeout) set(timeout_args TIMEOUT ${timeout}) set(timeout_msg "${timeout} seconds") @@ -524,6 +525,12 @@ function(_ep_write_downloadfile_script script_filename remote local timeout hash set(timeout_msg "none") endif() + if(no_progress) + set(show_progress "") + else() + set(show_progress "SHOW_PROGRESS") + endif() + if("${hash}" MATCHES "${_ep_hash_regex}") set(hash_args EXPECTED_HASH ${CMAKE_MATCH_1}=${CMAKE_MATCH_2}) else() @@ -563,7 +570,7 @@ ${tls_cainfo} file(DOWNLOAD \"${remote}\" \"${local}\" - SHOW_PROGRESS + ${show_progress} ${hash_args} ${timeout_args} STATUS status @@ -1443,10 +1450,11 @@ function(_ep_add_download_command name) string(REPLACE ";" "-" fname "${fname}") set(file ${download_dir}/${fname}) get_property(timeout TARGET ${name} PROPERTY _EP_TIMEOUT) + get_property(no_progress TARGET ${name} PROPERTY _EP_DOWNLOAD_NO_PROGRESS) get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY) get_property(tls_cainfo TARGET ${name} PROPERTY _EP_TLS_CAINFO) set(download_script "${stamp_dir}/download-${name}.cmake") - _ep_write_downloadfile_script("${download_script}" "${url}" "${file}" "${timeout}" "${hash}" "${tls_verify}" "${tls_cainfo}") + _ep_write_downloadfile_script("${download_script}" "${url}" "${file}" "${timeout}" "${no_progress}" "${hash}" "${tls_verify}" "${tls_cainfo}") set(cmd ${CMAKE_COMMAND} -P "${download_script}" COMMAND) set(retries 3) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index a57e12c..d4026af 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -954,7 +954,8 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) # Compute component-specific hints. set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "") - if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python") + if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR + ${COMPONENT} STREQUAL "graph_parallel") foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES}) if(IS_ABSOLUTE "${lib}") get_filename_component(libdir "${lib}" PATH) diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 812bb92..8327143 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -136,6 +136,31 @@ macro(_pkgconfig_parse_options _result _is_req _is_silent _no_cmake_path _no_cma list(REMOVE_ITEM ${_result} "NO_CMAKE_ENVIRONMENT_PATH") endmacro() +# Add the content of a variable or an environment variable to a list of +# paths +# Usage: +# - _pkgconfig_add_extra_path(_extra_paths VAR) +# - _pkgconfig_add_extra_path(_extra_paths ENV VAR) +function(_pkgconfig_add_extra_path _extra_paths_var _var) + set(_is_env 0) + if(_var STREQUAL "ENV") + set(_var ${ARGV2}) + set(_is_env 1) + endif() + if(NOT _is_env) + if(NOT "${${_var}}" STREQUAL "") + list(APPEND ${_extra_paths_var} ${CMAKE_PREFIX_PATH}) + endif() + else() + if(NOT "$ENV{${_var}}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{${_var}}" _path) + list(APPEND ${_extra_paths_var} ${_path}) + unset(_path) + endif() + endif() + set(${_extra_paths_var} ${${_extra_paths_var}} PARENT_SCOPE) +endfunction() + ### macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cmake_environment_path _prefix) _pkgconfig_unset(${_prefix}_FOUND) @@ -179,33 +204,15 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma set(_extra_paths) if(NOT _no_cmake_path) - if(NOT "${CMAKE_PREFIX_PATH}" STREQUAL "") - list(APPEND _extra_paths ${CMAKE_PREFIX_PATH}) - endif() - if(NOT "${CMAKE_FRAMEWORK_PATH}" STREQUAL "") - list(APPEND _extra_paths ${CMAKE_FRAMEWORK_PATH}) - endif() - if(NOT "${CMAKE_APPBUNDLE_PATH}" STREQUAL "") - list(APPEND _extra_paths ${CMAKE_FRAMEWORK_PATH}) - endif() + _pkgconfig_add_extra_path(_extra_paths CMAKE_PREFIX_PATH) + _pkgconfig_add_extra_path(_extra_paths CMAKE_FRAMEWORK_PATH) + _pkgconfig_add_extra_path(_extra_paths CMAKE_APPBUNDLE_PATH) endif() if(NOT _no_cmake_environment_path) - if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "") - file(TO_CMAKE_PATH "$ENV{CMAKE_PREFIX_PATH}" _path) - list(APPEND _extra_paths ${_path}) - unset(_path) - endif() - if(NOT "$ENV{CMAKE_FRAMEWORK_PATH}" STREQUAL "") - file(TO_CMAKE_PATH "$ENV{CMAKE_FRAMEWORK_PATH}" _path) - list(APPEND _extra_paths ${_path}) - unset(_path) - endif() - if(NOT "$ENV{CMAKE_APPBUNDLE_PATH}" STREQUAL "") - file(TO_CMAKE_PATH "$ENV{CMAKE_APPBUNDLE_PATH}" _path) - list(APPEND _extra_paths ${_path}) - unset(_path) - endif() + _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_PREFIX_PATH) + _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_FRAMEWORK_PATH) + _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_APPBUNDLE_PATH) endif() if(NOT "${_extra_paths}" STREQUAL "") @@ -330,7 +337,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma if(_pkg_check_modules_failed) # fail when requested if (${_is_required}) - message(SEND_ERROR "A required package was not found") + message(FATAL_ERROR "A required package was not found") endif () else() # when we are here, we checked whether requested modules diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index ec671bf..7f84522 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -63,32 +63,31 @@ else() set(CMAKE_THREAD_LIBS_INIT "") set(CMAKE_HAVE_THREADS_LIBRARY 1) set(Threads_FOUND TRUE) - endif() + else() - if(NOT CMAKE_HAVE_THREADS_LIBRARY) # Do we have -lpthreads CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE) if(CMAKE_HAVE_PTHREADS_CREATE) set(CMAKE_THREAD_LIBS_INIT "-lpthreads") set(CMAKE_HAVE_THREADS_LIBRARY 1) set(Threads_FOUND TRUE) - endif() - - # Ok, how about -lpthread - CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE) - if(CMAKE_HAVE_PTHREAD_CREATE) - set(CMAKE_THREAD_LIBS_INIT "-lpthread") - set(CMAKE_HAVE_THREADS_LIBRARY 1) - set(Threads_FOUND TRUE) - endif() + else() - if(CMAKE_SYSTEM MATCHES "SunOS.*") - # On sun also check for -lthread - CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE) - if(CMAKE_HAVE_THR_CREATE) - set(CMAKE_THREAD_LIBS_INIT "-lthread") + # Ok, how about -lpthread + CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE) + if(CMAKE_HAVE_PTHREAD_CREATE) + set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_HAVE_THREADS_LIBRARY 1) set(Threads_FOUND TRUE) + + elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS") + # On sun also check for -lthread + CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE) + if(CMAKE_HAVE_THR_CREATE) + set(CMAKE_THREAD_LIBS_INIT "-lthread") + set(CMAKE_HAVE_THREADS_LIBRARY 1) + set(Threads_FOUND TRUE) + endif() endif() endif() endif() @@ -96,7 +95,7 @@ else() if(NOT CMAKE_HAVE_THREADS_LIBRARY) # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread - if("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG") + if("x${THREADS_HAVE_PTHREAD_ARG}" STREQUAL "x") message(STATUS "Check if compiler accepts -pthread") try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG ${CMAKE_BINARY_DIR} diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 7e68e8f..4b551e6 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -374,10 +374,6 @@ if(WATCOM) string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}") list(GET _watcom_version_list 0 _watcom_major) list(GET _watcom_version_list 1 _watcom_minor) - if(${_watcom_major} GREATER 11) - math(EXPR _watcom_major "${_watcom_major} - 11") - endif() - math(EXPR _watcom_minor "${_watcom_minor} / 10") set( __install__libs ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake new file mode 100644 index 0000000..a4c122d --- /dev/null +++ b/Modules/Platform/Android.cmake @@ -0,0 +1,5 @@ +include(Platform/Linux) +set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "") +# RPath is useless on Android, because we can't determine the installation +# location ahead of time. +set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake index 825f851..dfc2664 100644 --- a/Modules/Platform/Haiku.cmake +++ b/Modules/Platform/Haiku.cmake @@ -21,18 +21,26 @@ set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic") # "/boot/system/develop/lib/<subdir>/", which we assume to be the secondary # architecture specific subdirectory and extract the name of the architecture # accordingly. -set(__HAIKU_COMPILER ${CMAKE_C_COMPILER}) -if(NOT __HAIKU_COMPILER) +# First of all, find a C or C++ compiler we can run. The "arg1" is necessary +# here for compilers such as "distcc gcc-x86" or "ccache gcc-x86" +# TODO See CMakeDetermineCompilerId.cmake for some more things we may want to do. +if(CMAKE_C_COMPILER) + set(__HAIKU_COMPILER ${CMAKE_C_COMPILER}) + string (STRIP "${CMAKE_C_COMPILER_ARG1}" __HAIKU_COMPILER_FLAGS) +else() set(__HAIKU_COMPILER ${CMAKE_CXX_COMPILER}) + string (STRIP "${CMAKE_CXX_COMPILER_ARG1}" __HAIKU_COMPILER_FLAGS) endif() + execute_process( - COMMAND ${__HAIKU_COMPILER} -print-search-dirs + COMMAND ${__HAIKU_COMPILER} ${__HAIKU_COMPILER_FLAGS} -print-search-dirs OUTPUT_VARIABLE _HAIKU_SEARCH_DIRS + RESULT_VARIABLE _HAIKU_SEARCH_DIRS_FOUND OUTPUT_STRIP_TRAILING_WHITESPACE) -string(REGEX MATCH ".*\nlibraries: =?([^\n]*:)?/boot/system/develop/lib/([^/]*)/(:[^\n]*)?\n.*" _dummy "\n${_HAIKU_SEARCH_DIRS}\n") +string(REGEX MATCH "libraries: =?([^\n]*:)?/boot/system/develop/lib/([^/]*)/?(:?\n+)" _dummy "${_HAIKU_SEARCH_DIRS}\n") set(CMAKE_HAIKU_SECONDARY_ARCH "${CMAKE_MATCH_2}") if(NOT CMAKE_HAIKU_SECONDARY_ARCH) @@ -53,14 +61,12 @@ else() endif() list(APPEND CMAKE_SYSTEM_PREFIX_PATH - /boot/common/non-packaged - /boot/common + /boot/system/non-packaged /boot/system ) LIST(APPEND CMAKE_HAIKU_COMMON_INCLUDE_DIRECTORIES - /boot/common/non-packaged/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} - /boot/common/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} + /boot/system/non-packaged/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} /boot/system/develop/headers/os /boot/system/develop/headers/os/app /boot/system/develop/headers/os/device @@ -108,8 +114,7 @@ LIST(APPEND CMAKE_HAIKU_CXX_INCLUDE_DIRECTORIES LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_HAIKU_C_INCLUDE_DIRECTORIES}) LIST(APPEND CMAKE_HAIKU_DEVELOP_LIB_DIRECTORIES - /boot/common/non-packaged/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} - /boot/common/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} + /boot/system/non-packaged/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} /boot/system/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} ) @@ -120,6 +125,6 @@ LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_HAIKU_DEVELOP_LIB_DIRECTORIES}) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH + set(CMAKE_INSTALL_PREFIX "/boot/system" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) endif() diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index d40d718..6b1cfd1 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -93,16 +93,18 @@ if(NOT _CMAKE_WATCOM_VERSION) set(WATCOM17) set(WATCOM18) set(WATCOM19) - if("${_compiler_version}" LESS 12.70) - set(WATCOM16 1) - endif() - if("${_compiler_version}" EQUAL 12.70) - set(WATCOM17 1) - endif() - if("${_compiler_version}" EQUAL 12.80) - set(WATCOM18 1) - endif() - if("${_compiler_version}" EQUAL 12.90) - set(WATCOM19 1) + if("${_compiler_id}" STREQUAL "OpenWatcom") + if("${_compiler_version}" VERSION_LESS 1.7) + set(WATCOM16 1) + endif() + if("${_compiler_version}" VERSION_EQUAL 1.7) + set(WATCOM17 1) + endif() + if("${_compiler_version}" VERSION_EQUAL 1.8) + set(WATCOM18 1) + endif() + if("${_compiler_version}" VERSION_EQUAL 1.9) + set(WATCOM19 1) + endif() endif() endif() diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 8baf896..aca8996 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -141,7 +141,7 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) set(_moc_extra_parameters_file @${_moc_parameters_file}) add_custom_command(OUTPUT ${outfile} COMMAND Qt4::moc ${_moc_extra_parameters_file} - DEPENDS ${infile} + DEPENDS ${infile} ${_moc_parameters_file} ${_moc_working_dir} VERBATIM) endmacro () diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 654b4d0..127012f 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -426,6 +426,7 @@ function(add_jar _TARGET_NAME) set(_JAVA_DEPENDS) set(_JAVA_COMPILE_DEPENDS) set(_JAVA_RESOURCE_FILES) + set(_JAVA_RESOURCE_FILES_RELATIVE) foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES}) get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT) get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE) @@ -462,7 +463,8 @@ function(add_jar _TARGET_NAME) __java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE} "Copying ${_JAVA_SOURCE_FILE} to the build directory") - list(APPEND _JAVA_RESOURCE_FILES ${_JAVA_SOURCE_FILE}) + list(APPEND _JAVA_RESOURCE_FILES ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE}) + list(APPEND _JAVA_RESOURCE_FILES_RELATIVE ${_JAVA_SOURCE_FILE}) endif () endforeach() @@ -529,7 +531,7 @@ function(add_jar _TARGET_NAME) OUTPUT ${_JAVA_JAR_OUTPUT_PATH} COMMAND ${Java_JAR_EXECUTABLE} -cf${_ENTRY_POINT_OPTION}${_MANIFEST_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE} ${_MANIFEST_VALUE} - ${_JAVA_RESOURCE_FILES} @java_class_filelist + ${_JAVA_RESOURCE_FILES_RELATIVE} @java_class_filelist COMMAND ${CMAKE_COMMAND} -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} @@ -549,7 +551,7 @@ function(add_jar _TARGET_NAME) OUTPUT ${_JAVA_JAR_OUTPUT_PATH} COMMAND ${Java_JAR_EXECUTABLE} -cf${_ENTRY_POINT_OPTION}${_MANIFEST_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE} ${_MANIFEST_VALUE} - ${_JAVA_RESOURCE_FILES} @java_class_filelist + ${_JAVA_RESOURCE_FILES_RELATIVE} @java_class_filelist COMMAND ${CMAKE_COMMAND} -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 9347687..23bf933 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -85,6 +85,9 @@ macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile) set(${outfiles} "") get_source_file_property(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename ${infile} SWIG_MODULE_NAME) + if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND") + get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE) + endif() foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION}) set(${outfiles} ${${outfiles}} "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}") @@ -100,10 +103,6 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) get_source_file_property(swig_source_file_generated ${infile} GENERATED) get_source_file_property(swig_source_file_cplusplus ${infile} CPLUSPLUS) get_source_file_property(swig_source_file_flags ${infile} SWIG_FLAGS) - get_source_file_property(_SWIG_MODULE_NAME ${infile} SWIG_MODULE_NAME) - if ( NOT _SWIG_MODULE_NAME ) - set_source_files_properties(${infile} PROPERTIES SWIG_MODULE_NAME ${name}) - endif () if("${swig_source_file_flags}" STREQUAL "NOTFOUND") set(swig_source_file_flags "") endif() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 9fb8d9a..27d099d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -18,6 +18,23 @@ else() endif() if(HAVE_ELF_H) set(CMAKE_USE_ELF_PARSER 1) +elseif(HAIKU) + # On Haiku, we need to include elf32.h from the private headers + set(CMake_HAIKU_INCLUDE_DIRS + /boot/system/develop/headers/private/system + /boot/system/develop/headers/private/system/arch/x86 + ) + + set(CMAKE_REQUIRED_INCLUDES ${CMake_HAIKU_INCLUDE_DIRS}) + CHECK_INCLUDE_FILE("elf32.h" HAVE_ELF32_H) + unset(CMAKE_REQUIRED_INCLUDES) + + if(HAVE_ELF32_H) + set(CMAKE_USE_ELF_PARSER 1) + else() + unset(CMake_HAIKU_INCLUDE_DIRS) + set(CMAKE_USE_ELF_PARSER) + endif() else() set(CMAKE_USE_ELF_PARSER) endif() @@ -57,6 +74,7 @@ include_directories( ${CMAKE_EXPAT_INCLUDES} ${CMAKE_TAR_INCLUDES} ${CMAKE_COMPRESS_INCLUDES} + ${CMake_HAIKU_INCLUDE_DIRS} ) # let cmake know it is supposed to use it @@ -404,7 +422,6 @@ if (WIN32) cmGlobalVisualStudio12Generator.cxx cmGlobalVisualStudioGenerator.cxx cmGlobalVisualStudioGenerator.h - cmGlobalWatcomWMakeGenerator.cxx cmIDEFlagTable.h cmIDEOptions.cxx cmIDEOptions.h @@ -424,6 +441,15 @@ if (WIN32) endif() endif () +# Watcom support +if(WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set_property(SOURCE cmake.cxx APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_USE_WMAKE) + list(APPEND SRCS + cmGlobalWatcomWMakeGenerator.cxx + cmGlobalWatcomWMakeGenerator.h + ) +endif() + # Ninja support set(SRCS ${SRCS} cmGlobalNinjaGenerator.cxx diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0744061..27f2e91 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 20140320) +set(CMake_VERSION_PATCH 20140401) #set(CMake_VERSION_RC 1) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 07a50b9..7885a0c 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -28,7 +28,7 @@ if (Qt5Widgets_FOUND) qt5_add_resources(${ARGN}) endmacro() set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) - set(QT_QTMAIN_LIBRARY Qt5::WinMain) + set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) # Remove this when the minimum version of Qt is 4.6. add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index a091cff..cebd9f5 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -21,7 +21,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator( cmCustomCommand const& cc, const std::string& config, cmMakefile* mf): CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()), OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()), - GE(new cmGeneratorExpression(cc.GetBacktrace())) + GE(new cmGeneratorExpression(cc.GetBacktrace())), DependsDone(false) { } @@ -93,5 +93,19 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetOutputs() const //---------------------------------------------------------------------------- std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const { - return this->CC.GetDepends(); + if (!this->DependsDone) + { + this->DependsDone = true; + std::vector<std::string> depends = this->CC.GetDepends(); + for(std::vector<std::string>::const_iterator + i = depends.begin(); + i != depends.end(); ++i) + { + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge + = this->GE->Parse(*i); + cmSystemTools::ExpandListArgument( + cge->Evaluate(this->Makefile, this->Config), this->Depends); + } + } + return this->Depends; } diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h index cbcdb41..0d8a0a4 100644 --- a/Source/cmCustomCommandGenerator.h +++ b/Source/cmCustomCommandGenerator.h @@ -28,6 +28,8 @@ class cmCustomCommandGenerator bool OldStyle; bool MakeVars; cmGeneratorExpression* GE; + mutable bool DependsDone; + mutable std::vector<std::string> Depends; public: cmCustomCommandGenerator(cmCustomCommand const& cc, const std::string& config, diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index bc1c25b..dc6772c 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -23,6 +23,26 @@ #if defined(__OpenBSD__) # include <stdint.h> # include <elf_abi.h> +#elif defined(__HAIKU__) +# include <elf32.h> +# include <elf64.h> + typedef struct Elf32_Ehdr Elf32_Ehdr; + typedef struct Elf32_Shdr Elf32_Shdr; + typedef struct Elf32_Sym Elf32_Sym; + typedef struct Elf32_Rel Elf32_Rel; + typedef struct Elf32_Rela Elf32_Rela; +# define ELFMAG0 0x7F +# define ELFMAG1 'E' +# define ELFMAG2 'L' +# define ELFMAG3 'F' +# define ET_NONE 0 +# define ET_REL 1 +# define ET_EXEC 2 +# define ET_DYN 3 +# define ET_CORE 4 +# define EM_386 3 +# define EM_SPARC 2 +# define EM_PPC 20 #else # include <elf.h> #endif diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index dba2406..e99bf04 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -715,7 +715,7 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf) { compiler = "icc"; } - else if (compilerId == "Watcom") + else if (compilerId == "Watcom" || compilerId == "OpenWatcom") { compiler = "ow"; } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 9fabdc7..5bfb664 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2539,6 +2539,11 @@ namespace { if (total > 0.0) { this->CurrentPercentage = static_cast<int>(value/total*100.0 + 0.5); + if(this->CurrentPercentage > 100) + { + // Avoid extra progress reports for unexpected data beyond total. + this->CurrentPercentage = 100; + } } bool updated = (OldPercentage != this->CurrentPercentage); diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 5b97e8b..d0a6aef 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -16,8 +16,6 @@ #include "cmStandardIncludes.h" #include "cmListFileCache.h" -#include <stack> - #include <cmsys/RegularExpression.hxx> #include <cmsys/auto_ptr.hxx> diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 2a144c6..b35e859 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -19,6 +19,7 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorExpressionDAGChecker.h" #include "cmComputeLinkInformation.h" +#include "cmCustomCommandGenerator.h" #include <queue> @@ -610,6 +611,9 @@ private: bool IsUtility(std::string const& dep); void CheckCustomCommand(cmCustomCommand const& cc); void CheckCustomCommands(const std::vector<cmCustomCommand>& commands); + void FollowCommandDepends(cmCustomCommand const& cc, + const std::string& config, + std::set<std::string>& emitted); }; //---------------------------------------------------------------------------- @@ -826,16 +830,41 @@ cmTargetTraceDependencies } // Queue the custom command dependencies. - std::vector<std::string> const& depends = cc.GetDepends(); + std::vector<std::string> configs; + std::set<std::string> emitted; + this->Makefile->GetConfigurations(configs); + if (configs.empty()) + { + configs.push_back(""); + } + for(std::vector<std::string>::const_iterator ci = configs.begin(); + ci != configs.end(); ++ci) + { + this->FollowCommandDepends(cc, *ci, emitted); + } +} + +//---------------------------------------------------------------------------- +void cmTargetTraceDependencies::FollowCommandDepends(cmCustomCommand const& cc, + const std::string& config, + std::set<std::string>& emitted) +{ + cmCustomCommandGenerator ccg(cc, config, this->Makefile); + + const std::vector<std::string>& depends = ccg.GetDepends(); + for(std::vector<std::string>::const_iterator di = depends.begin(); di != depends.end(); ++di) { std::string const& dep = *di; - if(!this->IsUtility(dep)) + if(emitted.insert(dep).second) { - // The dependency does not name a target and may be a file we - // know how to generate. Queue it. - this->FollowName(dep); + if(!this->IsUtility(dep)) + { + // The dependency does not name a target and may be a file we + // know how to generate. Queue it. + this->FollowName(dep); + } } } } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 49ce1b5..88f1b08 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -639,12 +639,12 @@ void cmGlobalNinjaGenerator cmTarget* target = gt->Target; // Compute full path to object file directory for this target. - std::string dir_max; - dir_max += gt->Makefile->GetCurrentOutputDirectory(); - dir_max += "/"; - dir_max += gt->LocalGenerator->GetTargetDirectory(*target); - dir_max += "/"; - gt->ObjectDirectory = dir_max; + std::string dir; + dir += gt->Makefile->GetCurrentOutputDirectory(); + dir += "/"; + dir += gt->LocalGenerator->GetTargetDirectory(*target); + dir += "/"; + gt->ObjectDirectory = dir; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 4632071..3aa293e 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -111,12 +111,12 @@ cmGlobalUnixMakefileGenerator3 cmTarget* target = gt->Target; // Compute full path to object file directory for this target. - std::string dir_max; - dir_max += gt->Makefile->GetCurrentOutputDirectory(); - dir_max += "/"; - dir_max += gt->LocalGenerator->GetTargetDirectory(*target); - dir_max += "/"; - gt->ObjectDirectory = dir_max; + std::string dir; + dir += gt->Makefile->GetCurrentOutputDirectory(); + dir += "/"; + dir += gt->LocalGenerator->GetTargetDirectory(*target); + dir += "/"; + gt->ObjectDirectory = dir; } void cmGlobalUnixMakefileGenerator3::Configure() @@ -958,21 +958,6 @@ cmGlobalUnixMakefileGenerator3::RecordTargetProgress( } //---------------------------------------------------------------------------- -bool -cmGlobalUnixMakefileGenerator3::ProgressMapCompare -::operator()(cmTarget const* l, cmTarget const* r) const -{ - // Order by target name. - if(int c = strcmp(l->GetName().c_str(), r->GetName().c_str())) - { - return c < 0; - } - // Order duplicate targets by binary directory. - return strcmp(l->GetMakefile()->GetCurrentOutputDirectory(), - r->GetMakefile()->GetCurrentOutputDirectory()) < 0; -} - -//---------------------------------------------------------------------------- void cmGlobalUnixMakefileGenerator3::TargetProgress ::WriteProgressVariables(unsigned long total, unsigned long ¤t) diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index d003789..f44dd12 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -185,10 +185,8 @@ protected: std::vector<unsigned long> Marks; void WriteProgressVariables(unsigned long total, unsigned long& current); }; - struct ProgressMapCompare { bool operator()(cmTarget const*, - cmTarget const*) const; }; typedef std::map<cmTarget const*, TargetProgress, - ProgressMapCompare> ProgressMapType; + cmStrictTargetComparison> ProgressMapType; ProgressMapType ProgressMap; size_t CountProgressMarksInTarget(cmTarget const* target, diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index 671166e..0ae1b34 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -16,7 +16,9 @@ cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator() { this->FindMakeProgramFile = "CMakeFindWMake.cmake"; +#ifdef _WIN32 this->ForceUnixPaths = false; +#endif this->ToolSupportsColor = true; this->NeedSymbolicMark = true; this->EmptyRuleHackCommand = "@cd ."; @@ -44,7 +46,9 @@ cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator() { cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3; lg->SetDefineWindowsNULL(true); +#ifdef _WIN32 lg->SetWindowsShell(true); +#endif lg->SetWatcomWMake(true); lg->SetMakeSilentFlag("-h"); lg->SetGlobalGenerator(this); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c63de79..c47147c 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -264,7 +264,8 @@ void cmLocalGenerator::TraceDependencies() for(cmGeneratorTargetsType::iterator t = targets.begin(); t != targets.end(); ++t) { - if (t->second->Target->IsImported()) + if (t->second->Target->IsImported() + || t->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY) { continue; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 2d36089..cc872d5 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -202,11 +202,11 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles) std::vector<cmSourceFile const*> objectSources; gt->GetObjectSources(objectSources); // Compute full path to object file directory for this target. - std::string dir_max; - dir_max += gt->Makefile->GetCurrentOutputDirectory(); - dir_max += "/"; - dir_max += this->GetTargetDirectory(*gt->Target); - dir_max += "/"; + std::string dir; + dir += gt->Makefile->GetCurrentOutputDirectory(); + dir += "/"; + dir += this->GetTargetDirectory(*gt->Target); + dir += "/"; // Compute the name of each object file. for(std::vector<cmSourceFile const*>::iterator si = objectSources.begin(); @@ -215,7 +215,7 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles) cmSourceFile const* sf = *si; bool hasSourceExtension = true; std::string objectName = this->GetObjectFileNameWithoutTarget(*sf, - dir_max, + dir, &hasSourceExtension); if(cmSystemTools::FileIsFullPath(objectName.c_str())) { @@ -829,6 +829,7 @@ cmLocalUnixMakefileGenerator3 "!ifndef VERBOSE\n" ".SILENT\n" "!endif\n" + "\n" ; } else diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 58625fb..dce71de 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -926,6 +926,14 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, this->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } + if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY) + { + cmOStringStream e; + e << "Target \"" << target << "\" is an INTERFACE library " + "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; + this->IssueMessage(cmake::FATAL_ERROR, e.str()); + return; + } // Add the command to the appropriate build step for the target. std::vector<std::string> no_output; cmCustomCommand cc(this, no_output, depends, @@ -2071,7 +2079,7 @@ cmMakefile::LinearGetSourceFileWithOutput(const std::string& name) const // does this source file have a custom command? if ((*i)->GetCustomCommand()) { - // is the output of the custom command match the source files name + // Does the output of the custom command match the source file name? const std::vector<std::string>& outputs = (*i)->GetCustomCommand()->GetOutputs(); for(std::vector<std::string>::const_iterator o = outputs.begin(); @@ -2101,7 +2109,7 @@ cmSourceFile *cmMakefile::GetSourceFileWithOutput( // linear-time search for an output with a matching suffix. if(!cmSystemTools::FileIsFullPath(name.c_str())) { - return LinearGetSourceFileWithOutput(name); + return this->LinearGetSourceFileWithOutput(name); } // Otherwise we use an efficient lookup map. OutputToSourceMap::const_iterator o = this->OutputToSource.find(name); @@ -3518,6 +3526,20 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile, return 0; } + cmsys::FStream::BOM bom = cmsys::FStream::ReadBOM(fin); + if(bom != cmsys::FStream::BOM_None && + bom != cmsys::FStream::BOM_UTF8) + { + cmOStringStream e; + e << "File starts with a Byte-Order-Mark that is not UTF-8:\n " + << sinfile; + this->IssueMessage(cmake::FATAL_ERROR, e.str()); + return 0; + } + // rewind to copy BOM to output file + fin.seekg(0); + + // now copy input to output and expand variables in the // input file at the same time std::string inLine; @@ -4178,6 +4200,9 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, case cmTarget::UTILITY: e << "a custom target "; break; + case cmTarget::INTERFACE_LIBRARY: + e << "an interface library "; + break; default: break; } e << "created in source directory \"" diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 4319f3c..8865b3d 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -418,6 +418,11 @@ cmNinjaTargetGenerator else { deptype = "gcc"; + const char* langdeptype = mf->GetDefinition("CMAKE_NINJA_DEPTYPE_" + lang); + if (langdeptype) + { + deptype = langdeptype; + } depfile = "$DEP_FILE"; const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang; std::string depfileFlags = mf->GetSafeDefinition(flagsName); diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index 6f16913..786e6e2 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -178,7 +178,7 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName, // Configure the Info.plist file. Note that it needs the executable name // to be set. - std::string plist = + std::string plist = root + "/" + this->GT->Target->GetCFBundleDirectory(this->ConfigName, true); plist += "/Info.plist"; this->LocalGenerator->GenerateAppleInfoPList(this->GT->Target, diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 7b11b61..a6e6af7 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1791,8 +1791,8 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, std::string::size_type matchOffset = 0; - const std::string absPath = cmsys::SystemTools::GetFilenamePath( - cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/'; + const std::string realName = + cmsys::SystemTools::GetRealPath(absFilename.c_str()); matchOffset = 0; if ((strstr(contentsString.c_str(), "ui_") != NULL) @@ -1809,7 +1809,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, // finding the correct header, so we need to remove the ui_ part basename = basename.substr(3); - includedUis[absPath] = basename; + includedUis[realName] = basename; matchOffset += uiIncludeRegExp.end(); } while(uiIncludeRegExp.find(contentsString.c_str() + matchOffset)); @@ -1965,7 +1965,7 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile, return false; } -bool cmQtAutoGenerators::GenerateUi(const std::string& path, +bool cmQtAutoGenerators::GenerateUi(const std::string& realName, const std::string& uiFileName) { if (!cmsys::SystemTools::FileExists(this->Builddir.c_str(), false)) @@ -1973,6 +1973,9 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& path, cmsys::SystemTools::MakeDirectory(this->Builddir.c_str()); } + const std::string path = cmsys::SystemTools::GetFilenamePath( + realName.c_str()) + '/'; + std::string ui_output_file = "ui_" + uiFileName + ".h"; std::string ui_input_file = path + uiFileName + ".ui"; @@ -2079,6 +2082,8 @@ bool cmQtAutoGenerators::GenerateQrc() } } + command.push_back("-name"); + command.push_back(basename); command.push_back("-o"); command.push_back(rcc_output_file); command.push_back(*si); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index a593dd5..8003795 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -48,7 +48,7 @@ private: bool RunAutogen(cmMakefile* makefile); bool GenerateMoc(const std::string& sourceFile, const std::string& mocFileName); - bool GenerateUi(const std::string& path, const std::string& uiFileName); + bool GenerateUi(const std::string& realName, const std::string& uiFileName); bool GenerateQrc(); void ParseCppFile(const std::string& absFilename, const std::vector<std::string>& headerExtensions, diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 4ce1d70..2cf636c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -60,13 +60,15 @@ # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" # include "cmGlobalJOMMakefileGenerator.h" -# include "cmGlobalWatcomWMakeGenerator.h" # define CMAKE_HAVE_VS_GENERATORS # endif # include "cmGlobalMSYSMakefileGenerator.h" # include "cmGlobalMinGWMakefileGenerator.h" #else #endif +#if defined(CMAKE_USE_WMAKE) +# include "cmGlobalWatcomWMakeGenerator.h" +#endif #include "cmGlobalUnixMakefileGenerator3.h" #include "cmGlobalNinjaGenerator.h" #include "cmExtraCodeLiteGenerator.h" @@ -1411,8 +1413,8 @@ int cmake::ActualConfigure() message += "\nDoes not match the generator used previously: "; message += genName; message += - "\nEither remove the CMakeCache.txt file or choose a different" - " binary directory."; + "\nEither remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."; cmSystemTools::Error(message.c_str()); return -2; } @@ -1443,8 +1445,8 @@ int cmake::ActualConfigure() message += "\nDoes not match the toolset used previously: "; message += tsName; message += - "\nEither remove the CMakeCache.txt file or choose a different" - " binary directory."; + "\nEither remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."; cmSystemTools::Error(message.c_str()); return -2; } @@ -1781,8 +1783,6 @@ void cmake::AddDefaultGenerators() cmGlobalNMakeMakefileGenerator::NewFactory()); this->Generators.push_back( cmGlobalJOMMakefileGenerator::NewFactory()); - this->Generators.push_back( - cmGlobalWatcomWMakeGenerator::NewFactory()); # endif this->Generators.push_back( cmGlobalMSYSMakefileGenerator::NewFactory()); @@ -1793,6 +1793,10 @@ void cmake::AddDefaultGenerators() cmGlobalUnixMakefileGenerator3::NewFactory()); this->Generators.push_back( cmGlobalNinjaGenerator::NewFactory()); +#if defined(CMAKE_USE_WMAKE) + this->Generators.push_back( + cmGlobalWatcomWMakeGenerator::NewFactory()); +#endif #ifdef CMAKE_USE_XCODE this->Generators.push_back( cmGlobalXCodeGenerator::NewFactory()); diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 9c26380..720a7c3 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -5023,21 +5023,26 @@ bool SystemInformationImplementation::QueryHPUXProcessor() case CPU_PA_RISC1_0: this->ChipID.Vendor = "Hewlett-Packard"; this->ChipID.Family = 0x100; + break; case CPU_PA_RISC1_1: this->ChipID.Vendor = "Hewlett-Packard"; this->ChipID.Family = 0x110; + break; case CPU_PA_RISC2_0: this->ChipID.Vendor = "Hewlett-Packard"; this->ChipID.Family = 0x200; -# ifdef CPU_HP_INTEL_EM_1_0 + break; +# if defined(CPU_HP_INTEL_EM_1_0) || defined(CPU_IA64_ARCHREV_0) +# ifdef CPU_HP_INTEL_EM_1_0 case CPU_HP_INTEL_EM_1_0: -# endif -# ifdef CPU_IA64_ARCHREV_0 +# endif +# ifdef CPU_IA64_ARCHREV_0 case CPU_IA64_ARCHREV_0: -# endif +# endif this->ChipID.Vendor = "GenuineIntel"; this->Features.HasIA64 = true; break; +# endif default: return false; } diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 691728a..15493be 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -8,11 +8,14 @@ endif () # Avoid ctest truncation of output message(STATUS "CTEST_FULL_OUTPUT") +set(ORIGINAL_MODULE_PATH "${CMAKE_MODULE_PATH}") + file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake" ) macro(do_find MODULE_NAME) message(STATUS " Checking Find${MODULE_NAME}") find_package(${MODULE_NAME}) + set(CMAKE_MODULE_PATH "${ORIGINAL_MODULE_PATH}") endmacro() # It is only possible to use either Qt3 or Qt4 in one project. diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index 9bd7249..8984463 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -19,14 +19,6 @@ add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind) target_link_libraries(pseudo_valgrind CMakeLib) -# Xcode 2.x forgets to create the output directory before linking -# the individual architectures. -if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") - add_custom_command(TARGET pseudo_valgrind - PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" - ) -endif() - add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify) target_link_libraries(pseudo_purify CMakeLib) @@ -196,3 +188,18 @@ set_tests_properties(CTestTestMemcheckDummyValgrindCustomOptions PROPERTIES set_tests_properties(CTestTestMemcheckDummyValgrindTwoTargets PROPERTIES PASS_REGULAR_EXPRESSION "\nMemory check project ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyValgrindTwoTargets\n.*\n *Start 1: RunCMake\n(.*\n)?Memory check command: .* \"--log-file=${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyValgrindTwoTargets/Testing/Temporary/MemoryChecker.1.log\" \"-q\".*\n *Start 2: RunCMakeAgain\n(.*\n)?Memory check command: .* \"--log-file=${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyValgrindTwoTargets/Testing/Temporary/MemoryChecker.2.log\" \"-q\".*\n") + +# Xcode 2.x forgets to create the output directory before linking +# the individual architectures. +if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") + foreach(t + memcheck_fail + pseudo_BC + pseudo_purify + pseudo_valgrind + ) + add_custom_command(TARGET ${t} + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" + ) + endforeach() +endif() diff --git a/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt b/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt index c5aa2cd..3a45bfe 100644 --- a/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt @@ -1,17 +1,22 @@ # A dummy checker implementation that does not write the requested output file # so it triggers an error for every checker. -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c" "int main(){return 0;}\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" "int main(){return 0;}\n") + +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" + "${CMAKE_CURRENT_BINARY_DIR}/ret0.c" + ) foreach(_pseudo IN ITEMS valgrind purify BC) add_executable(pseudonl_${_pseudo} "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") set_target_properties(pseudonl_${_pseudo} PROPERTIES OUTPUT_NAME ${_pseudo}) -endforeach() -# Xcode 2.x forgets to create the output directory before linking -# the individual architectures. -if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") - add_custom_command(TARGET pseudonl_valgrind + # Xcode 2.x forgets to create the output directory before linking + # the individual architectures. + if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") + add_custom_command(TARGET pseudonl_${_pseudo} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" ) -endif() + endif() +endforeach() diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index bbae387..a194a5f 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -185,7 +185,7 @@ add_executable(CustomCommand # here to test adding the generation rule after referencing the # generated source in a target. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/generated.c - DEPENDS generator + DEPENDS $<1:generator> $<0:does_not_exist> COMMAND generator ARGS ${PROJECT_BINARY_DIR}/generated.c ) @@ -221,8 +221,11 @@ add_subdirectory(GeneratorInExtraDir) add_executable(tcat tcat.cxx) +# Test that list expansion from a generator expression works. +set_property(TARGET tcat PROPERTY DEPSLIST tcat gen_redirect_in.c) + add_custom_command(OUTPUT gen_redirect.c - DEPENDS tcat gen_redirect_in.c + DEPENDS $<TARGET_PROPERTY:tcat,DEPSLIST> COMMAND tcat < ${CMAKE_CURRENT_SOURCE_DIR}/gen_redirect_in.c > gen_redirect.c COMMAND ${CMAKE_COMMAND} -E echo "#endif" >> gen_redirect.c VERBATIM diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index d9344ec..0ed5561 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -98,6 +98,7 @@ ExternalProject_Add(${proj} CVS_TAG "" DEPENDS "MinimalNoOpProject" NonExternalProjectTarget DOWNLOAD_COMMAND "" + DOWNLOAD_NO_PROGRESS 1 INSTALL_COMMAND "" PATCH_COMMAND "" STEP_TARGETS install update diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt index af9fc3f..7430084 100644 --- a/Tests/Qt4Targets/CMakeLists.txt +++ b/Tests/Qt4Targets/CMakeLists.txt @@ -36,3 +36,30 @@ add_executable(Qt4WrapMacroTest WIN32 main_wrap_test.cpp ${moc_file}) set_property(TARGET Qt4WrapMacroTest PROPERTY AUTOMOC OFF) target_include_directories(Qt4WrapMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface") target_link_libraries(Qt4WrapMacroTest Qt4::QtGui) + +set(timeformat "%Y%j%H%M%S") +try_compile(RESULT + "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild" + "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc" + IncrementalMoc + CMAKE_FLAGS -DADD_DEF=0 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}") +file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild/moc_foo.cpp" tsvar_before "${timeformat}") +if (NOT tsvar_before) + message(SEND_ERROR "Unable to read timestamp from moc file from first build!") +endif() + +execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 2) # Ensure that the timestamp will change. + +try_compile(RESULT + "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild" + "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc" + IncrementalMoc + CMAKE_FLAGS -DADD_DEF=1 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}") +file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild/moc_foo.cpp" tsvar_after "${timeformat}") +if (NOT tsvar_after) + message(SEND_ERROR "Unable to read timestamp from moc file from second build!") +endif() + +if (NOT tsvar_after GREATER tsvar_before) + message(SEND_ERROR "Rebuild did not re-create moc file. Before: ${tsvar_before}. After: ${tsvar_after}") +endif() diff --git a/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt new file mode 100644 index 0000000..4ba0ced --- /dev/null +++ b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt @@ -0,0 +1,13 @@ + +cmake_minimum_required(VERSION 2.8.12) +project(IncrementalMoc) + +find_package(Qt4 REQUIRED) + +qt4_generate_moc(foo.h moc_foo.cpp) + +add_library(testlib foo.cpp moc_foo.cpp) +target_link_libraries(testlib Qt4::QtCore) +if (ADD_DEF) + target_compile_definitions(testlib PRIVATE NEW_DEF) +endif() diff --git a/Tests/Qt4Targets/IncrementalMoc/foo.cpp b/Tests/Qt4Targets/IncrementalMoc/foo.cpp new file mode 100644 index 0000000..e924f7e --- /dev/null +++ b/Tests/Qt4Targets/IncrementalMoc/foo.cpp @@ -0,0 +1,8 @@ + +#include "foo.h" + +Foo::Foo() + : QObject(0) +{ + +} diff --git a/Tests/Qt4Targets/IncrementalMoc/foo.h b/Tests/Qt4Targets/IncrementalMoc/foo.h new file mode 100644 index 0000000..38d899f --- /dev/null +++ b/Tests/Qt4Targets/IncrementalMoc/foo.h @@ -0,0 +1,9 @@ + +#include <QObject> + +class Foo : QObject +{ + Q_OBJECT +public: + Foo(); +}; diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 0821b45..d2116aa 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -64,9 +64,9 @@ add_custom_command( DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" ) -add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp +add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot> - test.qrc resourcetester.cpp generated.cpp + test.qrc second_resource.qrc resourcetester.cpp generated.cpp ) set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h") diff --git a/Tests/QtAutogen/resourcetester.cpp b/Tests/QtAutogen/resourcetester.cpp index 43314e1..0c64d80 100644 --- a/Tests/QtAutogen/resourcetester.cpp +++ b/Tests/QtAutogen/resourcetester.cpp @@ -16,6 +16,8 @@ void ResourceTester::doTest() { if (!QFile::exists(":/CMakeLists.txt")) qApp->exit(EXIT_FAILURE); + if (!QFile::exists(":/main.cpp")) + qApp->exit(EXIT_FAILURE); QTimer::singleShot(0, qApp, SLOT(quit())); } diff --git a/Tests/QtAutogen/second_resource.qrc b/Tests/QtAutogen/second_resource.qrc new file mode 100644 index 0000000..27bfb14 --- /dev/null +++ b/Tests/QtAutogen/second_resource.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>main.cpp</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/second_widget.cpp b/Tests/QtAutogen/second_widget.cpp new file mode 100644 index 0000000..65ba962 --- /dev/null +++ b/Tests/QtAutogen/second_widget.cpp @@ -0,0 +1,14 @@ + +#include "second_widget.h" +#include "ui_second_widget.h" + +SecondWidget::SecondWidget(QWidget *parent) + : QWidget(parent), ui(new Ui::SecondWidget) +{ + ui->setupUi(this); +} + +SecondWidget::~SecondWidget() +{ + delete ui; +} diff --git a/Tests/QtAutogen/second_widget.h b/Tests/QtAutogen/second_widget.h new file mode 100644 index 0000000..fe4d175 --- /dev/null +++ b/Tests/QtAutogen/second_widget.h @@ -0,0 +1,19 @@ + +#include <QWidget> + +namespace Ui +{ +class SecondWidget; +} + +class SecondWidget : public QWidget +{ + Q_OBJECT +public: + explicit SecondWidget(QWidget *parent = 0); + + ~SecondWidget(); + +private: + Ui::SecondWidget* ui; +}; diff --git a/Tests/QtAutogen/second_widget.ui b/Tests/QtAutogen/second_widget.ui new file mode 100644 index 0000000..4effa58 --- /dev/null +++ b/Tests/QtAutogen/second_widget.ui @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>SecondWidget</class> + <widget class="QWidget" name="SecondWidget"> + <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> + <widget class="QPushButton" name="pushButton"> + <property name="geometry"> + <rect> + <x>80</x> + <y>20</y> + <width>94</width> + <height>24</height> + </rect> + </property> + <property name="text"> + <string>PushButton</string> + </property> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index f9d590a..7691f32 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -96,6 +96,7 @@ add_RunCMake_test(TargetPolicies) add_RunCMake_test(alias_targets) add_RunCMake_test(interface_library) add_RunCMake_test(no_install_prefix) +add_RunCMake_test(configure_file) find_package(Qt4 QUIET) find_package(Qt5Core QUIET) diff --git a/Tests/RunCMake/CheckModules/CheckTypeSizeOkNoC.cmake b/Tests/RunCMake/CheckModules/CheckTypeSizeOkNoC.cmake new file mode 100644 index 0000000..b2dcd7f --- /dev/null +++ b/Tests/RunCMake/CheckModules/CheckTypeSizeOkNoC.cmake @@ -0,0 +1,4 @@ +enable_language(CXX) +include(CheckTypeSize) +check_type_size(int SIZEOF_INT LANGUAGE CXX) +check_type_size(int SIZEOF_INT BUILTIN_TYPES_ONLY LANGUAGE CXX) diff --git a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake index fda7ebf..5b4e57e 100644 --- a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake @@ -12,3 +12,5 @@ run_cmake(CheckTypeSizeUnknownLanguage) run_cmake(CheckTypeSizeMissingLanguage) run_cmake(CheckTypeSizeUnknownArgument) run_cmake(CheckTypeSizeMixedArgs) + +run_cmake(CheckTypeSizeOkNoC) diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake new file mode 100644 index 0000000..924976e --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake @@ -0,0 +1,41 @@ +# Needed for CMAKE_SYSTEM_NAME, CMAKE_LIBRARY_ARCHITECTURE and FIND_LIBRARY_USE_LIB64_PATHS +enable_language(C) + +# Prepare environment and variables +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH FALSE) +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo") +if(WIN32) + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem") + set(ENV{PKG_CONFIG_PATH} "C:\\baz") +else() + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem") + set(ENV{PKG_CONFIG_PATH} "/baz") +endif() + + +find_package(PkgConfig) + +if(WIN32) + set(expected_path "C:\\baz") +else() + set(expected_path "/baz") +endif() + + +pkg_check_modules(FOO "${expected_path}") + +if(NOT "FOO_FOUND") + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() + + + +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) + +pkg_check_modules(BAR "${expected_path}" NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH) + +if(NOT "BAR_FOUND") + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake index 5f9913f..4a66e85 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake @@ -44,7 +44,7 @@ else() endif() -pkg_check_modules (FOO "${expected_path}") +pkg_check_modules(FOO "${expected_path}") if(NOT "FOO_FOUND") message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake new file mode 100644 index 0000000..0b057b8 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake @@ -0,0 +1,51 @@ +# Needed for CMAKE_SYSTEM_NAME, CMAKE_LIBRARY_ARCHITECTURE and FIND_LIBRARY_USE_LIB64_PATHS +enable_language(C) + +# Prepare environment and variables +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo") +if(WIN32) + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem") + set(ENV{PKG_CONFIG_PATH} "C:\\baz") +else() + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem") + set(ENV{PKG_CONFIG_PATH} "/baz") +endif() + + +find_package(PkgConfig) + + +if(NOT DEFINED CMAKE_SYSTEM_NAME + OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" + AND NOT CMAKE_CROSSCOMPILING)) + if(EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$") + # Cannot create directories for all the existing architectures... + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + endif() + else() + # not debian, chech the FIND_LIBRARY_USE_LIB64_PATHS property + get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) + if(uselib64) + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + endif() + endif() +else() + if(WIN32) + set(expected_path "C:\\baz;${CMAKE_CURRENT_SOURCE_DIR}\\pc-foo\\lib\\pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + endif() +endif() + + +pkg_check_modules(FOO "${expected_path}" NO_CMAKE_ENVIRONMENT_PATH) + +if(NOT "FOO_FOUND") + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake new file mode 100644 index 0000000..a3154f1 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake @@ -0,0 +1,51 @@ +# Needed for CMAKE_SYSTEM_NAME, CMAKE_LIBRARY_ARCHITECTURE and FIND_LIBRARY_USE_LIB64_PATHS +enable_language(C) + +# Prepare environment and variables +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo") +if(WIN32) + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem") + set(ENV{PKG_CONFIG_PATH} "C:\\baz") +else() + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem") + set(ENV{PKG_CONFIG_PATH} "/baz") +endif() + + +find_package(PkgConfig) + + +if(NOT DEFINED CMAKE_SYSTEM_NAME + OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" + AND NOT CMAKE_CROSSCOMPILING)) + if(EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$") + # Cannot create directories for all the existing architectures... + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + endif() + else() + # not debian, chech the FIND_LIBRARY_USE_LIB64_PATHS property + get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) + if(uselib64) + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + endif() + endif() +else() + if(WIN32) + set(expected_path "C:\\baz;${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar\\lib\\pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + endif() +endif() + + +pkg_check_modules(FOO "${expected_path}" NO_CMAKE_PATH) + +if(NOT "FOO_FOUND") + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake index ad77ad0..bca93bb 100644 --- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake @@ -1,3 +1,6 @@ include(RunCMake) +run_cmake(FindPkgConfig_NO_PKGCONFIG_PATH) run_cmake(FindPkgConfig_PKGCONFIG_PATH) +run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH) +run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH) diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat index b2096ed..f2f86b0 100755 --- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat +++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat @@ -9,6 +9,8 @@ IF "%1"=="--version" ( IF "%1"=="--exists" ( SHIFT + ECHO Expected: %* + ECHO Found: %PKG_CONFIG_PATH% IF NOT "%*"=="%PKG_CONFIG_PATH%" ( EXIT /B 1 ) diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh index e62bb74..852e841 100755 --- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh +++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh @@ -10,8 +10,8 @@ case $1 in ;; --exists) shift - echo "$@" - echo "${PKG_CONFIG_PATH}" + echo "Expected: $@" + echo "Found: ${PKG_CONFIG_PATH}" [ "$@" = "${PKG_CONFIG_PATH}" ] || exit 1 ;; *) diff --git a/Tests/RunCMake/configure_file/CMakeLists.txt b/Tests/RunCMake/configure_file/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/configure_file/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/configure_file/NO-BOM.cmake b/Tests/RunCMake/configure_file/NO-BOM.cmake new file mode 100644 index 0000000..003d526 --- /dev/null +++ b/Tests/RunCMake/configure_file/NO-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(NO-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/NO-BOM.txt) diff --git a/Tests/RunCMake/configure_file/NO-BOM.txt.in b/Tests/RunCMake/configure_file/NO-BOM.txt.in new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/Tests/RunCMake/configure_file/NO-BOM.txt.in @@ -0,0 +1 @@ +Hello World diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake new file mode 100644 index 0000000..c8bfa57 --- /dev/null +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -0,0 +1,8 @@ +include(RunCMake) + +run_cmake(NO-BOM) +run_cmake(UTF8-BOM) +run_cmake(UTF16LE-BOM) +run_cmake(UTF16BE-BOM) +run_cmake(UTF32LE-BOM) +run_cmake(UTF32BE-BOM) diff --git a/Tests/RunCMake/configure_file/UTF16BE-BOM-result.txt b/Tests/RunCMake/configure_file/UTF16BE-BOM-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16BE-BOM-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/configure_file/UTF16BE-BOM-stderr.txt b/Tests/RunCMake/configure_file/UTF16BE-BOM-stderr.txt new file mode 100644 index 0000000..5132c4d --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16BE-BOM-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at UTF16BE-BOM.cmake:2 \(configure_file\): + File starts with a Byte-Order-Mark that is not UTF-8: + + .*/Tests/RunCMake/configure_file/UTF16BE-BOM.txt.in +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/configure_file/UTF16BE-BOM.cmake b/Tests/RunCMake/configure_file/UTF16BE-BOM.cmake new file mode 100644 index 0000000..c570742 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16BE-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF16BE-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF16BE-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF16BE-BOM.txt.in b/Tests/RunCMake/configure_file/UTF16BE-BOM.txt.in Binary files differnew file mode 100644 index 0000000..70fd9cb --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16BE-BOM.txt.in diff --git a/Tests/RunCMake/configure_file/UTF16LE-BOM-result.txt b/Tests/RunCMake/configure_file/UTF16LE-BOM-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16LE-BOM-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/configure_file/UTF16LE-BOM-stderr.txt b/Tests/RunCMake/configure_file/UTF16LE-BOM-stderr.txt new file mode 100644 index 0000000..8f997bc --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16LE-BOM-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at UTF16LE-BOM.cmake:2 \(configure_file\): + File starts with a Byte-Order-Mark that is not UTF-8: + + .*/Tests/RunCMake/configure_file/UTF16LE-BOM.txt.in +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/configure_file/UTF16LE-BOM.cmake b/Tests/RunCMake/configure_file/UTF16LE-BOM.cmake new file mode 100644 index 0000000..05c9cd7 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16LE-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF16LE-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF16LE-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF16LE-BOM.txt.in b/Tests/RunCMake/configure_file/UTF16LE-BOM.txt.in Binary files differnew file mode 100644 index 0000000..036f8c5 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16LE-BOM.txt.in diff --git a/Tests/RunCMake/configure_file/UTF32BE-BOM-result.txt b/Tests/RunCMake/configure_file/UTF32BE-BOM-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32BE-BOM-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/configure_file/UTF32BE-BOM-stderr.txt b/Tests/RunCMake/configure_file/UTF32BE-BOM-stderr.txt new file mode 100644 index 0000000..12811aa --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32BE-BOM-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at UTF32BE-BOM.cmake:2 \(configure_file\): + File starts with a Byte-Order-Mark that is not UTF-8: + + .*/Tests/RunCMake/configure_file/UTF32BE-BOM.txt.in +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/configure_file/UTF32BE-BOM.cmake b/Tests/RunCMake/configure_file/UTF32BE-BOM.cmake new file mode 100644 index 0000000..0c6ea87 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32BE-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF32BE-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF32BE-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF32BE-BOM.txt.in b/Tests/RunCMake/configure_file/UTF32BE-BOM.txt.in Binary files differnew file mode 100644 index 0000000..c87cfd5 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32BE-BOM.txt.in diff --git a/Tests/RunCMake/configure_file/UTF32LE-BOM-result.txt b/Tests/RunCMake/configure_file/UTF32LE-BOM-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32LE-BOM-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/configure_file/UTF32LE-BOM-stderr.txt b/Tests/RunCMake/configure_file/UTF32LE-BOM-stderr.txt new file mode 100644 index 0000000..fa9e01a --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32LE-BOM-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at UTF32LE-BOM.cmake:2 \(configure_file\): + File starts with a Byte-Order-Mark that is not UTF-8: + + .*/Tests/RunCMake/configure_file/UTF32LE-BOM.txt.in +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/configure_file/UTF32LE-BOM.cmake b/Tests/RunCMake/configure_file/UTF32LE-BOM.cmake new file mode 100644 index 0000000..b6351b0 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32LE-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF32LE-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF32LE-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF32LE-BOM.txt.in b/Tests/RunCMake/configure_file/UTF32LE-BOM.txt.in Binary files differnew file mode 100644 index 0000000..27c8183 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32LE-BOM.txt.in diff --git a/Tests/RunCMake/configure_file/UTF8-BOM.cmake b/Tests/RunCMake/configure_file/UTF8-BOM.cmake new file mode 100644 index 0000000..af2adae --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF8-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF8-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF8-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF8-BOM.txt.in b/Tests/RunCMake/configure_file/UTF8-BOM.txt.in new file mode 100644 index 0000000..abc0aca --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF8-BOM.txt.in @@ -0,0 +1 @@ +Hello World diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake index 3c457c5..08e81c6 100644 --- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake @@ -8,3 +8,4 @@ run_cmake(invalid_signature) run_cmake(global-interface) run_cmake(genex_link) run_cmake(add_dependencies) +run_cmake(add_custom_command-TARGET) diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt b/Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt b/Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt new file mode 100644 index 0000000..c095262 --- /dev/null +++ b/Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at add_custom_command-TARGET.cmake:4 \(add_custom_command\): + Target "iface" is an INTERFACE library that may not have PRE_BUILD, + PRE_LINK, or POST_BUILD commands. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake b/Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake new file mode 100644 index 0000000..a5136ef --- /dev/null +++ b/Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake @@ -0,0 +1,6 @@ + +add_library(iface INTERFACE) + +add_custom_command(TARGET iface + COMMAND "${CMAKE_COMMAND}" -E echo test +) @@ -329,6 +329,7 @@ fi KWSYS_CXX_SOURCES="\ Directory \ EncodingCXX \ + FStream \ Glob \ RegularExpression \ SystemTools" |