diff options
46 files changed, 547 insertions, 653 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e13a7e..94d138c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,12 @@ endif() # Use most-recent available language dialects with GNU and Clang if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD) - set(CMAKE_C_STANDARD 11) + include(${CMake_SOURCE_DIR}/Source/Checks/cm_c11_thread_local.cmake) + if(NOT CMake_C11_THREAD_LOCAL_BROKEN) + set(CMAKE_C_STANDARD 11) + else() + set(CMAKE_C_STANDARD 99) + endif() endif() if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD) include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx14_cstdio.cmake) diff --git a/Help/command/string.rst b/Help/command/string.rst index 20f8094..0361c74 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -1,102 +1,84 @@ string ------ +.. only:: html + + .. contents:: + String operations. +Search and Replace +^^^^^^^^^^^^^^^^^^ + +FIND +"""" + :: - string(REGEX MATCH <regular_expression> - <output variable> <input> [<input>...]) - string(REGEX MATCHALL <regular_expression> - <output variable> <input> [<input>...]) - string(REGEX REPLACE <regular_expression> - <replace_expression> <output variable> - <input> [<input>...]) - string(REPLACE <match_string> - <replace_string> <output variable> - <input> [<input>...]) - string(APPEND <string variable> [<input>...]) - string(CONCAT <output variable> [<input>...]) - string(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512> - <output variable> <input>) - string(COMPARE EQUAL <string1> <string2> <output variable>) - string(COMPARE NOTEQUAL <string1> <string2> <output variable>) - string(COMPARE LESS <string1> <string2> <output variable>) - string(COMPARE GREATER <string1> <string2> <output variable>) - string(ASCII <number> [<number> ...] <output variable>) - string(CONFIGURE <string1> <output variable> - [@ONLY] [ESCAPE_QUOTES]) - string(TOUPPER <string1> <output variable>) - string(TOLOWER <string1> <output variable>) - string(LENGTH <string> <output variable>) - string(SUBSTRING <string> <begin> <length> <output variable>) - string(STRIP <string> <output variable>) - string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>] - [RANDOM_SEED <seed>] <output variable>) string(FIND <string> <substring> <output variable> [REVERSE]) - string(TIMESTAMP <output variable> [<format string>] [UTC]) - string(MAKE_C_IDENTIFIER <input string> <output variable>) - string(GENEX_STRIP <input string> <output variable>) - string(UUID <output variable> NAMESPACE <namespace> NAME <name> - TYPE <MD5|SHA1> [UPPER]) -``REGEX MATCH`` will match the regular expression once and store the match -in the output variable. +Return the position where the given substring was found in +the supplied string. If the ``REVERSE`` flag was used, the command will +search for the position of the last occurrence of the specified +substring. If the substring is not found, a position of -1 is returned. -``REGEX MATCHALL`` will match the regular expression as many times as -possible and store the matches in the output variable as a list. +REPLACE +""""""" -``REGEX REPLACE`` will match the regular expression as many times as -possible and substitute the replacement expression for the match in -the output. The replace expression may refer to paren-delimited -subexpressions of the match using \1, \2, ..., \9. Note that two -backslashes (\\1) are required in CMake code to get a backslash -through argument parsing. +:: -``REPLACE`` will replace all occurrences of ``match_string`` in the input + string(REPLACE <match_string> + <replace_string> <output variable> + <input> [<input>...]) + +Replace all occurrences of ``match_string`` in the input with ``replace_string`` and store the result in the output. -``APPEND`` will append all the input arguments to the string. +Regular Expressions +^^^^^^^^^^^^^^^^^^^ -``CONCAT`` will concatenate all the input arguments together and store -the result in the named output variable. +REGEX MATCH +""""""""""" -``MD5``, ``SHA1``, ``SHA224``, ``SHA256``, ``SHA384``, and ``SHA512`` will -compute a cryptographic hash of the input string. +:: -``COMPARE EQUAL``/``COMPARE NOTEQUAL``/``COMPARE LESS/GREATER`` will -compare the strings and store true or false in the output variable. + string(REGEX MATCH <regular_expression> + <output variable> <input> [<input>...]) -``ASCII`` will convert all numbers into corresponding ASCII characters. +Match the regular expression once and store the match in the output variable. +All ``<input>`` arguments are concatenated before matching. -``CONFIGURE`` will transform a string like :command:`configure_file` -transforms a file. +REGEX MATCHALL +"""""""""""""" -``TOUPPER``/``TOLOWER`` will convert string to upper/lower characters. +:: -``LENGTH`` will return a given string's length. + string(REGEX MATCHALL <regular_expression> + <output variable> <input> [<input>...]) -``SUBSTRING`` will return a substring of a given string. If length is -1 -the remainder of the string starting at begin will be returned. -If string is shorter than length then end of string is used instead. +Match the regular expression as many times as possible and store the matches +in the output variable as a list. +All ``<input>`` arguments are concatenated before matching. -.. note:: - CMake 3.1 and below reported an error if length pointed past - the end of string. +REGEX REPLACE +""""""""""""" -``STRIP`` will return a substring of a given string with leading and -trailing spaces removed. +:: -``RANDOM`` will return a random string of given length consisting of -characters from the given alphabet. Default length is 5 characters -and default alphabet is all numbers and upper and lower case letters. -If an integer ``RANDOM_SEED`` is given, its value will be used to seed the -random number generator. + string(REGEX REPLACE <regular_expression> + <replace_expression> <output variable> + <input> [<input>...]) -``FIND`` will return the position where the given substring was found in -the supplied string. If the ``REVERSE`` flag was used, the command will -search for the position of the last occurrence of the specified -substring. If the substring is not found, a position of -1 is returned. +Match the regular expression as many times as possible and substitute the +replacement expression for the match in the output. +All ``<input>`` arguments are concatenated before matching. + +The replace expression may refer to paren-delimited subexpressions of the +match using ``\1``, ``\2``, ..., ``\9``. Note that two backslashes (``\\1``) +are required in CMake code to get a backslash through argument parsing. + +Regex Specification +""""""""""""""""""" The following characters have special meaning in regular expressions: @@ -123,10 +105,159 @@ The following characters have special meaning in regular expressions: ``*``, ``+`` and ``?`` have higher precedence than concatenation. ``|`` has lower precedence than concatenation. This means that the regular -expression "^ab+d$" matches "abbd" but not "ababd", and the regular -expression "^(ab|cd)$" matches "ab" but not "abd". +expression ``^ab+d$`` matches ``abbd`` but not ``ababd``, and the regular +expression ``^(ab|cd)$`` matches ``ab`` but not ``abd``. + +Manipulation +^^^^^^^^^^^^ + +APPEND +"""""" + +:: + + string(APPEND <string variable> [<input>...]) + +Append all the input arguments to the string. + +CONCAT +"""""" + +:: + + string(CONCAT <output variable> [<input>...]) + +Concatenate all the input arguments together and store +the result in the named output variable. + +TOLOWER +""""""" + +:: + + string(TOLOWER <string1> <output variable>) + +Convert string to lower characters. + +TOUPPER +""""""" -``TIMESTAMP`` will write a string representation of the current date +:: + + string(TOUPPER <string1> <output variable>) + +Convert string to upper characters. + +LENGTH +"""""" + +:: + + string(LENGTH <string> <output variable>) + +Store in an output variable a given string's length. + +SUBSTRING +""""""""" + +:: + + string(SUBSTRING <string> <begin> <length> <output variable>) + +Store in an output variable a substring of a given string. If length is +``-1`` the remainder of the string starting at begin will be returned. +If string is shorter than length then end of string is used instead. + +.. note:: + CMake 3.1 and below reported an error if length pointed past + the end of string. + +STRIP +""""" + +:: + + string(STRIP <string> <output variable>) + +Store in an output variable a substring of a given string with leading and +trailing spaces removed. + +GENEX_STRIP +""""""""""" + +:: + + string(GENEX_STRIP <input string> <output variable>) + +Strip any :manual:`generator expressions <cmake-generator-expressions(7)>` +from the ``input string`` and store the result in the ``output variable``. + +Comparison +^^^^^^^^^^ + +:: + + string(COMPARE EQUAL <string1> <string2> <output variable>) + string(COMPARE NOTEQUAL <string1> <string2> <output variable>) + string(COMPARE LESS <string1> <string2> <output variable>) + string(COMPARE GREATER <string1> <string2> <output variable>) + +Compare the strings and store true or false in the output variable. + +Hashing +^^^^^^^ + +:: + + string(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512> + <output variable> <input>) + +Compute a cryptographic hash of the input string. + +Generation +^^^^^^^^^^ + +ASCII +""""" + +:: + + string(ASCII <number> [<number> ...] <output variable>) + +Convert all numbers into corresponding ASCII characters. + +CONFIGURE +""""""""" + +:: + + string(CONFIGURE <string1> <output variable> + [@ONLY] [ESCAPE_QUOTES]) + +Transform a string like :command:`configure_file` transforms a file. + +RANDOM +"""""" + +:: + + string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>] + [RANDOM_SEED <seed>] <output variable>) + +Return a random string of given length consisting of +characters from the given alphabet. Default length is 5 characters +and default alphabet is all numbers and upper and lower case letters. +If an integer ``RANDOM_SEED`` is given, its value will be used to seed the +random number generator. + +TIMESTAMP +""""""""" + +:: + + string(TIMESTAMP <output variable> [<format string>] [UTC]) + +Write a string representation of the current date and/or time to the output variable. Should the command be unable to obtain a timestamp the output variable @@ -163,14 +294,22 @@ If no explicit ``<format string>`` is given it will default to: %Y-%m-%dT%H:%M:%S for local time. %Y-%m-%dT%H:%M:%SZ for UTC. -``MAKE_C_IDENTIFIER`` will write a string which can be used as an -identifier in C. -``GENEX_STRIP`` will strip any -:manual:`generator expressions <cmake-generator-expressions(7)>` from the -``input string`` and store the result in the ``output variable``. +:: + + string(MAKE_C_IDENTIFIER <input string> <output variable>) + +Write a string which can be used as an identifier in C. + +UUID +"""" + +:: + + string(UUID <output variable> NAMESPACE <namespace> NAME <name> + TYPE <MD5|SHA1> [UPPER]) -``UUID`` creates a univerally unique identifier (aka GUID) as per RFC4122 +Create a univerally unique identifier (aka GUID) as per RFC4122 based on the hash of the combined values of ``<namespace>`` (which itself has to be a valid UUID) and ``<name>``. The hash algorithm can be either ``MD5`` (Version 3 UUID) or diff --git a/Help/prop_sf/OBJECT_DEPENDS.rst b/Help/prop_sf/OBJECT_DEPENDS.rst index 18022de..1d24960 100644 --- a/Help/prop_sf/OBJECT_DEPENDS.rst +++ b/Help/prop_sf/OBJECT_DEPENDS.rst @@ -3,9 +3,12 @@ OBJECT_DEPENDS Additional files on which a compiled object file depends. -Specifies a semicolon-separated list of full-paths to files on which -any object files compiled from this source file depend. An object -file will be recompiled if any of the named files is newer than it. +Specifies a :ref:`;-list <CMake Language Lists>` of full-paths to +files on which any object files compiled from this source file depend. +On :ref:`Makefile Generators` and the :generator:`Ninja` generator an +object file will be recompiled if any of the named files is newer than it. +:ref:`Visual Studio Generators` and the :generator:`Xcode` generator +cannot implement such compilation dependencies. This property need not be used to specify the dependency of a source file on a generated header file that it includes. Although the @@ -14,5 +17,5 @@ necessary. If the generated header file is created by a custom command in the same target as the source file, the automatic dependency scanning process will recognize the dependency. If the generated header file is created by another target, an inter-target -dependency should be created with the add_dependencies command (if one -does not already exist due to linking relationships). +dependency should be created with the :command:`add_dependencies` +command (if one does not already exist due to linking relationships). diff --git a/Help/release/dev/FindHDF5-updates.rst b/Help/release/dev/FindHDF5-updates.rst new file mode 100644 index 0000000..a9297bb --- /dev/null +++ b/Help/release/dev/FindHDF5-updates.rst @@ -0,0 +1,6 @@ +FindHDF5-updates +---------------- + +* The :module:`FindHDF5` module learend a new ``HDF5_PREFER_PARALLEL`` + option allowing users to specify that a parallel HDF5 tool is + preferred if both are available. diff --git a/Help/release/dev/FindProtobuf-python-extension.rst b/Help/release/dev/FindProtobuf-python-extension.rst new file mode 100644 index 0000000..95463bf --- /dev/null +++ b/Help/release/dev/FindProtobuf-python-extension.rst @@ -0,0 +1,6 @@ +FindProtobuf-python-extension +----------------------------- + +* The :module:`FindProtobuf` module gained a new + :command:`protobuf_generate_python` function to generate python + sources from ``.proto`` files. diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 8abc465..59092bd 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -31,7 +31,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj # Construct a regex to match linker lines. It must match both the # whole line and just the command (argv[0]). set(linker_regex "^( *|.*[/\\])(${linker}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)") - set(linker_exclude_regex "collect2 version ") + set(linker_exclude_regex "collect2 version |^[A-Za-z0-9_]+=") set(log "${log} link line regex: [${linker_regex}]\n") string(REGEX REPLACE "\r?\n" ";" output_lines "${text}") foreach(line IN LISTS output_lines) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index a449132..37bca83 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -31,6 +31,12 @@ # Find module will then look in this path when searching for HDF5 # executables, paths, and libraries. # +# Both the serial and parallel HDF5 wrappers are considered and the first +# directory to contain either one will be used. In the event that both appear +# in the same directory the serial version is preferentially selected. This +# behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to +# true. +# # In addition to finding the includes and libraries required to compile # an HDF5 client application, this module also makes an effort to find # tools that come with the HDF5 distribution that may be useful for @@ -103,28 +109,43 @@ else() endforeach() endif() +# Determine whether to search for serial or parallel executable first +if(HDF5_PREFER_PARALLEL) + set(HDF5_C_COMPILER_NAMES h5pcc h5cc) + set(HDF5_CXX_COMPILER_NAMES h5pc++ h5c++) + set(HDF5_Fortran_COMPILER_NAMES h5pfc h5fc) +else() + set(HDF5_C_COMPILER_NAMES h5cc h5pcc) + set(HDF5_CXX_COMPILER_NAMES h5c++ h5pc++) + set(HDF5_Fortran_COMPILER_NAMES h5fc h5pfc) +endif() + # try to find the HDF5 wrapper compilers find_program( HDF5_C_COMPILER_EXECUTABLE - NAMES h5cc h5pcc + NAMES ${HDF5_C_COMPILER_NAMES} NAMES_PER_DIR HINTS ENV HDF5_ROOT PATH_SUFFIXES bin Bin DOC "HDF5 Wrapper compiler. Used only to detect HDF5 compile flags." ) mark_as_advanced( HDF5_C_COMPILER_EXECUTABLE ) find_program( HDF5_CXX_COMPILER_EXECUTABLE - NAMES h5c++ h5pc++ + NAMES ${HDF5_CXX_COMPILER_NAMES} NAMES_PER_DIR HINTS ENV HDF5_ROOT PATH_SUFFIXES bin Bin DOC "HDF5 C++ Wrapper compiler. Used only to detect HDF5 compile flags." ) mark_as_advanced( HDF5_CXX_COMPILER_EXECUTABLE ) find_program( HDF5_Fortran_COMPILER_EXECUTABLE - NAMES h5fc h5pfc + NAMES ${HDF5_Fortran_COMPILER_NAMES} NAMES_PER_DIR HINTS ENV HDF5_ROOT PATH_SUFFIXES bin Bin DOC "HDF5 Fortran Wrapper compiler. Used only to detect HDF5 compile flags." ) mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE ) +unset(HDF5_C_COMPILER_NAMES) +unset(HDF5_CXX_COMPILER_NAMES) +unset(HDF5_Fortran_COMPILER_NAMES) + find_program( HDF5_DIFF_EXECUTABLE NAMES h5diff HINTS ENV HDF5_ROOT @@ -378,4 +399,3 @@ find_package_handle_standard_args( HDF5 REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS VERSION_VAR HDF5_VERSION ) - diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 335c408..4a68cd1 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -57,17 +57,18 @@ # include_directories(${PROTOBUF_INCLUDE_DIRS}) # include_directories(${CMAKE_CURRENT_BINARY_DIR}) # protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto) +# protobuf_generate_python(PROTO_PY foo.proto) # add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS}) # target_link_libraries(bar ${PROTOBUF_LIBRARIES}) # # .. note:: -# The PROTOBUF_GENERATE_CPP macro and add_executable() or -# add_library() calls only work properly within the same -# directory. +# The ``protobuf_generate_cpp`` and ``protobuf_generate_python`` +# functions and :command:`add_executable` or :command:`add_library` +# calls only work properly within the same directory. # # .. command:: protobuf_generate_cpp # -# Add custom commands to process ``.proto`` files:: +# Add custom commands to process ``.proto`` files to C++:: # # protobuf_generate_cpp (<SRCS> <HDRS> [<ARGN>...]) # @@ -77,6 +78,17 @@ # Variable to define with autogenerated header files # ``ARGN`` # ``.proto`` files +# +# .. command:: protobuf_generate_python +# +# Add custom commands to process ``.proto`` files to Python:: +# +# protobuf_generate_python (<PY> [<ARGN>...]) +# +# ``PY`` +# Variable to define with autogenerated Python files +# ``ARGN`` +# ``.proto`` filess #============================================================================= # Copyright 2009 Kitware, Inc. @@ -147,6 +159,53 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS) set(${HDRS} ${${HDRS}} PARENT_SCOPE) endfunction() +function(PROTOBUF_GENERATE_PYTHON SRCS) + if(NOT ARGN) + message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called without any proto files") + return() + endif() + + if(PROTOBUF_GENERATE_CPP_APPEND_PATH) + # Create an include path for each file specified + foreach(FIL ${ARGN}) + get_filename_component(ABS_FIL ${FIL} ABSOLUTE) + get_filename_component(ABS_PATH ${ABS_FIL} PATH) + list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) + if(${_contains_already} EQUAL -1) + list(APPEND _protobuf_include_path -I ${ABS_PATH}) + endif() + endforeach() + else() + set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) + endif() + + if(DEFINED PROTOBUF_IMPORT_DIRS) + foreach(DIR ${PROTOBUF_IMPORT_DIRS}) + get_filename_component(ABS_PATH ${DIR} ABSOLUTE) + list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) + if(${_contains_already} EQUAL -1) + list(APPEND _protobuf_include_path -I ${ABS_PATH}) + endif() + endforeach() + endif() + + set(${SRCS}) + foreach(FIL ${ARGN}) + get_filename_component(ABS_FIL ${FIL} ABSOLUTE) + get_filename_component(FIL_WE ${FIL} NAME_WE) + + list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py") + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py" + COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL} + DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE} + COMMENT "Running Python protocol buffer compiler on ${FIL}" + VERBATIM ) + endforeach() + + set(${SRCS} ${${SRCS}} PARENT_SCOPE) +endfunction() + if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(_PROTOBUF_ARCH_DIR x64/) endif() diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index 8784e18..879192e 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -51,7 +51,7 @@ unset(_Python_NAMES) set(_PYTHON1_VERSIONS 1.6 1.5) set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) -set(_PYTHON3_VERSIONS 3.4 3.3 3.2 3.1 3.0) +set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0) if(PythonInterp_FIND_VERSION) if(PythonInterp_FIND_VERSION_COUNT GREATER 1) diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index b80d3ce..1c8776b 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -64,7 +64,7 @@ set(CMAKE_FIND_FRAMEWORK LAST) set(_PYTHON1_VERSIONS 1.6 1.5) set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) -set(_PYTHON3_VERSIONS 3.4 3.3 3.2 3.1 3.0) +set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0) if(PythonLibs_FIND_VERSION) if(PythonLibs_FIND_VERSION_COUNT GREATER 1) @@ -150,18 +150,11 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS}) PATH_SUFFIXES python${_CURRENT_VERSION}/config ) - # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if - # PYTHON_INCLUDE_DIR is not set. - if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR) - set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH - "Path to where Python.h is found" FORCE) - endif() - set(PYTHON_FRAMEWORK_INCLUDES) if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) foreach(dir ${Python_FRAMEWORKS}) list(APPEND PYTHON_FRAMEWORK_INCLUDES - ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION}) + ${dir}/Versions/${_CURRENT_VERSION}/include) endforeach() endif() diff --git a/Modules/UseVTK40.cmake b/Modules/UseVTK40.cmake deleted file mode 100644 index d6bdaaa..0000000 --- a/Modules/UseVTK40.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# - -#============================================================================= -# Copyright 2002-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# This is an implementation detail for using VTK 4.0 with the -# FindVTK.cmake module. Do not include directly by name. This should -# be included only when FindVTK.cmake sets the VTK_USE_FILE variable -# to point here. - -# Add compiler flags needed to use VTK. -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}") - -# Add include directories needed to use VTK. -include_directories(${VTK_INCLUDE_DIRS}) - -# Add link directories needed to use VTK. -link_directories(${VTK_LIBRARY_DIRS}) diff --git a/Modules/UseVTKBuildSettings40.cmake b/Modules/UseVTKBuildSettings40.cmake deleted file mode 100644 index 474f67c..0000000 --- a/Modules/UseVTKBuildSettings40.cmake +++ /dev/null @@ -1,38 +0,0 @@ -# - -#============================================================================= -# Copyright 2002-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# Implementation detail for FindVTK.cmake to let it provide a -# VTK_BUILD_SETTINGS_FILE for VTK 4.0. - -set(CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION "${VTK40_CMAKE_MAJOR_VERSION}") -set(CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION "${VTK40_CMAKE_MINOR_VERSION}") -set(CMAKE_BUILD_SETTING_PROJECT_NAME "VTK") - -set(CMAKE_BUILD_SETTING_C_COMPILER "${VTK40_CMAKE_C_COMPILER}") -set(CMAKE_BUILD_SETTING_C_FLAGS "${VTK40_CMAKE_C_FLAGS}") -set(CMAKE_BUILD_SETTING_C_FLAGS_DEBUG "${VTK40_CMAKE_C_FLAGS_DEBUG}") -set(CMAKE_BUILD_SETTING_C_FLAGS_RELEASE "${VTK40_CMAKE_C_FLAGS_RELEASE}") -set(CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL "${VTK40_CMAKE_C_FLAGS_MINSIZEREL}") -set(CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_C_FLAGS_RELWITHDEBINFO}") - -set(CMAKE_BUILD_SETTING_CXX_COMPILER "${VTK40_CMAKE_CXX_COMPILER}") -set(CMAKE_BUILD_SETTING_CXX_FLAGS "${VTK40_CMAKE_CXX_FLAGS}") -set(CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG "${VTK40_CMAKE_CXX_FLAGS_DEBUG}") -set(CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE "${VTK40_CMAKE_CXX_FLAGS_RELEASE}") -set(CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL "${VTK40_CMAKE_CXX_FLAGS_MINSIZEREL}") -set(CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_CXX_FLAGS_RELWITHDEBINFO}") - -set(CMAKE_BUILD_SETTING_BUILD_TYPE "${VTK40_CMAKE_BUILD_TYPE}") -set(CMAKE_BUILD_SETTING_BUILD_TOOL "${VTK40_CMAKE_BUILD_TOOL}") diff --git a/Modules/UseVTKConfig40.cmake b/Modules/UseVTKConfig40.cmake deleted file mode 100644 index c5022e4..0000000 --- a/Modules/UseVTKConfig40.cmake +++ /dev/null @@ -1,409 +0,0 @@ -# - -#============================================================================= -# Copyright 2002-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# This is an implementation detail for using VTK 4.0 with the -# FindVTK.cmake module. Do not include directly. - -# Hard-code the version number since it isn't provided by VTK 4.0. -set(VTK_MAJOR_VERSION 4) -set(VTK_MINOR_VERSION 0) -set(VTK_BUILD_VERSION 2) - -# Provide a new UseVTK file that doesn't do a full LOAD_CACHE. -set(VTK_USE_FILE ${CMAKE_ROOT}/Modules/UseVTK40.cmake) - -# Provide a build settings file. -set(VTK_BUILD_SETTINGS_FILE ${CMAKE_ROOT}/Modules/UseVTKBuildSettings40.cmake) - -# There are no CMake extensions for VTK 4.0. -set(VTK_CMAKE_EXTENSIONS_DIR "") - -# grep "VTK40_" UseVTKConfig40.cmake |sed 's/.*VTK40_\([A-Za-z0-9_]*\).*/ \1/' -load_cache(${VTK_DIR} READ_WITH_PREFIX VTK40_ - BUILD_SHARED_LIBS - CMAKE_BUILD_TOOL - CMAKE_BUILD_TYPE - CMAKE_CACHE_MAJOR_VERSION - CMAKE_CACHE_MINOR_VERSION - CMAKE_CXX_COMPILER - CMAKE_CXX_FLAGS - CMAKE_CXX_FLAGS_DEBUG - CMAKE_CXX_FLAGS_MINSIZEREL - CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_RELWITHDEBINFO - CMAKE_C_COMPILER - CMAKE_C_FLAGS - CMAKE_C_FLAGS_DEBUG - CMAKE_C_FLAGS_MINSIZEREL - CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_INSTALL_PREFIX - CMAKE_Xutil_INCLUDE_PATH - EXECUTABLE_OUTPUT_PATH - JAVA_INCLUDE_PATH2 - LIBRARY_OUTPUT_PATH - MPIRUN - MPI_INCLUDE_PATH - MPI_POSTFLAGS - MPI_PREFLAGS - OPENGL_INCLUDE_DIR - OSMESA_INCLUDE_PATH - PYTHON_INCLUDE_PATH - TCL_INCLUDE_PATH - VLI_INCLUDE_PATH_FOR_VG500 - VLI_INCLUDE_PATH_FOR_VP1000 - VTK_BINARY_DIR - VTK_DEBUG_LEAKS - VTK_HAVE_VG500 - VTK_HAVE_VP1000 - VTK_MANGLE_MESA - VTK_OPENGL_HAS_OSMESA - VTK_PARSE_JAVA_EXE - VTK_SOURCE_DIR - VTK_USE_64BIT_IDS - VTK_USE_ANSI_STDLIB - VTK_USE_HYBRID - VTK_USE_MATROX_IMAGING - VTK_USE_MPI - VTK_USE_PARALLEL - VTK_USE_PATENTED - VTK_USE_RENDERING - VTK_USE_VIDEO_FOR_WINDOWS - VTK_USE_VOLUMEPRO - VTK_USE_X - VTK_WRAP_JAVA - VTK_WRAP_JAVA_EXE - VTK_WRAP_PYTHON - VTK_WRAP_PYTHON_EXE - VTK_WRAP_TCL - VTK_WRAP_TCL_EXE - vtkCommonJava_LIB_DEPENDS - vtkCommonPython_LIB_DEPENDS - vtkCommonTCL_LIB_DEPENDS - vtkCommon_LIB_DEPENDS - vtkFilteringJava_LIB_DEPENDS - vtkFilteringPython_LIB_DEPENDS - vtkFilteringTCL_LIB_DEPENDS - vtkFiltering_LIB_DEPENDS - vtkGraphicsJava_LIB_DEPENDS - vtkGraphicsPython_LIB_DEPENDS - vtkGraphicsTCL_LIB_DEPENDS - vtkGraphics_LIB_DEPENDS - vtkHybridJava_LIB_DEPENDS - vtkHybridPython_LIB_DEPENDS - vtkHybridTCL_LIB_DEPENDS - vtkHybrid_LIB_DEPENDS - vtkIOJava_LIB_DEPENDS - vtkIOPython_LIB_DEPENDS - vtkIOTCL_LIB_DEPENDS - vtkIO_LIB_DEPENDS - vtkImagingJava_LIB_DEPENDS - vtkImagingPython_LIB_DEPENDS - vtkImagingTCL_LIB_DEPENDS - vtkImaging_LIB_DEPENDS - vtkParallelJava_LIB_DEPENDS - vtkParallelPython_LIB_DEPENDS - vtkParallelTCL_LIB_DEPENDS - vtkParallel_LIB_DEPENDS - vtkPatentedJava_LIB_DEPENDS - vtkPatentedPython_LIB_DEPENDS - vtkPatentedTCL_LIB_DEPENDS - vtkPatented_LIB_DEPENDS - vtkRenderingJava_LIB_DEPENDS - vtkRenderingPythonTkWidgets_LIB_DEPENDS - vtkRenderingPython_LIB_DEPENDS - vtkRenderingTCL_LIB_DEPENDS - vtkRendering_LIB_DEPENDS - vtkjpeg_LIB_DEPENDS - vtkpng_LIB_DEPENDS - vtkzlib_LIB_DEPENDS -) - -# Copy needed settings from the VTK 4.0 cache. -set(VTK_BUILD_SHARED ${VTK40_BUILD_SHARED_LIBS}) -set(VTK_DEBUG_LEAKS ${VTK40_VTK_DEBUG_LEAKS}) -set(VTK_HAVE_VG500 ${VTK40_VTK_HAVE_VG500}) -set(VTK_HAVE_VP1000 ${VTK40_VTK_HAVE_VP1000}) -set(VTK_USE_MANGLED_MESA ${VTK40_VTK_MANGLE_MESA}) -set(VTK_MPIRUN_EXE ${VTK40_MPIRUN}) -set(VTK_MPI_POSTFLAGS ${VTK40_MPI_POSTFLAGS}) -set(VTK_MPI_PREFLAGS ${VTK40_MPI_PREFLAGS}) -set(VTK_OPENGL_HAS_OSMESA ${VTK40_VTK_OPENGL_HAS_OSMESA}) -set(VTK_USE_64BIT_IDS ${VTK40_VTK_USE_64BIT_IDS}) -set(VTK_USE_ANSI_STDLIB ${VTK40_VTK_USE_ANSI_STDLIB}) -set(VTK_USE_HYBRID ${VTK40_VTK_USE_HYBRID}) -set(VTK_USE_MATROX_IMAGING ${VTK40_VTK_USE_MATROX_IMAGING}) -set(VTK_USE_MPI ${VTK40_VTK_USE_MPI}) -set(VTK_USE_PARALLEL ${VTK40_VTK_USE_PARALLEL}) -set(VTK_USE_PATENTED ${VTK40_VTK_USE_PATENTED}) -set(VTK_USE_RENDERING ${VTK40_VTK_USE_RENDERING}) -set(VTK_USE_VIDEO_FOR_WINDOWS ${VTK40_VTK_USE_VIDEO_FOR_WINDOWS}) -set(VTK_USE_VOLUMEPRO ${VTK40_VTK_USE_VOLUMEPRO}) -set(VTK_USE_X ${VTK40_VTK_USE_X}) -set(VTK_WRAP_JAVA ${VTK40_VTK_WRAP_JAVA}) -set(VTK_WRAP_PYTHON ${VTK40_VTK_WRAP_PYTHON}) -set(VTK_WRAP_TCL ${VTK40_VTK_WRAP_TCL}) - -# Create the list of available kits. -set(VTK_KITS COMMON FILTERING GRAPHICS IMAGING IO) -if(VTK_USE_RENDERING) - set(VTK_KITS ${VTK_KITS} RENDERING) -endif() -if(VTK_USE_HYBRID) - set(VTK_KITS ${VTK_KITS} HYBRID) -endif() -if(VTK_USE_PARALLEL) - set(VTK_KITS ${VTK_KITS} PARALLEL) -endif() -if(VTK_USE_PATENTED) - set(VTK_KITS ${VTK_KITS} PATENTED) -endif() - -# Create the list of available languages. -set(VTK_LANGUAGES "") -if(VTK_WRAP_TCL) - set(VTK_LANGUAGES ${VTK_LANGUAGES} TCL) -endif() -if(VTK_WRAP_PYTHON) - set(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON) -endif() -if(VTK_WRAP_JAVA) - set(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA) -endif() - -# Include directories for other projects installed on the system and -# used by VTK. -set(VTK_INCLUDE_DIRS_SYS "") -if(VTK_USE_RENDERING) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} - ${VTK40_OPENGL_INCLUDE_PATH} ${VTK40_OPENGL_INCLUDE_DIR}) - if(VTK_USE_X) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} - ${VTK40_CMAKE_Xlib_INCLUDE_PATH} ${VTK40_CMAKE_Xutil_INCLUDE_PATH}) - endif() -endif() - -if(VTK_OPENGL_HAS_OSMESA) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} - ${VTK40_OSMESA_INCLUDE_PATH}) -endif() - -if(VTK_USE_MPI) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_MPI_INCLUDE_PATH}) -endif() - -if(VTK_WRAP_TCL) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_TCL_INCLUDE_PATH}) -endif() - -if(VTK_WRAP_PYTHON) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_PYTHON_INCLUDE_PATH}) -endif() - -if(VTK_WRAP_JAVA) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} - ${VTK40_JAVA_INCLUDE_PATH} ${VTK40_JAVA_INCLUDE_PATH2}) -endif() - -if(VTK_HAVE_VG500) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} - ${VTK40_VLI_INCLUDE_PATH_FOR_VG500}) -endif() - -if(VTK_HAVE_VP1000) - set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} - ${VTK40_VLI_INCLUDE_PATH_FOR_VP1000}) -endif() - -# See if this is a build tree or install tree. -if(EXISTS ${VTK_DIR}/Common) - # This is a VTK 4.0 build tree. - - set(VTK_LIBRARY_DIRS ${VTK40_LIBRARY_OUTPUT_PATH}) - - # Determine the include directories needed. - set(VTK_INCLUDE_DIRS ${VTK40_VTK_BINARY_DIR}) - if(VTK_USE_PARALLEL) - set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Parallel) - endif() - if(VTK_USE_HYBRID) - set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Hybrid) - endif() - if(VTK_USE_PATENTED) - set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Patented) - endif() - if(VTK_USE_RENDERING) - set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Rendering) - endif() - - # These directories are always needed. - set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} - ${VTK40_VTK_SOURCE_DIR}/IO - ${VTK40_VTK_SOURCE_DIR}/Imaging - ${VTK40_VTK_SOURCE_DIR}/Graphics - ${VTK40_VTK_SOURCE_DIR}/Filtering - ${VTK40_VTK_SOURCE_DIR}/Common) - - # Give access to a few utilities. - set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} - ${VTK40_VTK_BINARY_DIR}/Utilities/png - ${VTK40_VTK_SOURCE_DIR}/Utilities/png - ${VTK40_VTK_BINARY_DIR}/Utilities/zlib - ${VTK40_VTK_SOURCE_DIR}/Utilities/zlib) - - # Executable locations. - if(VTK_WRAP_TCL) - set(VTK_TCL_EXE ${VTK40_EXECUTABLE_OUTPUT_PATH}/vtk) - set(VTK_WRAP_TCL_EXE ${VTK40_VTK_WRAP_TCL_EXE}) - set(VTK_TCL_HOME ${VTK40_VTK_SOURCE_DIR}/Wrapping/Tcl) - endif() - if(VTK_WRAP_PYTHON) - set(VTK_WRAP_PYTHON_EXE ${VTK40_VTK_WRAP_PYTHON_EXE}) - endif() - if(VTK_WRAP_JAVA) - set(VTK_PARSE_JAVA_EXE ${VTK40_VTK_PARSE_JAVA_EXE}) - set(VTK_WRAP_JAVA_EXE ${VTK40_VTK_WRAP_JAVA_EXE}) - endif() - -else() - # This is a VTK 4.0 install tree. - - set(VTK_INCLUDE_DIRS ${VTK_DIR}) - set(VTK_LIBRARY_DIRS ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk) - - # Executable locations. - if(VTK_WRAP_TCL) - set(VTK_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtk) - set(VTK_WRAP_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapTcl) - set(VTK_TCL_HOME ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk/tcl) - endif() - if(VTK_WRAP_PYTHON) - set(VTK_WRAP_PYTHON_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapPython) - endif() - if(VTK_WRAP_JAVA) - set(VTK_PARSE_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkParseJava) - set(VTK_WRAP_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapJava) - endif() -endif() - -# Add the system include directories last. -set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS}) - -# Find the required C and C++ compiler flags. -if(CMAKE_COMPILER_IS_GNUCXX) - if(WIN32) - # The platform is gcc on cygwin. - set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32") - set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32") - endif() -else() - if(CMAKE_ANSI_CFLAGS) - set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") - endif() - if(CMAKE_SYSTEM MATCHES "OSF1-V") - set(VTK_REQUIRED_CXX_FLAGS - "${VTK_REQUIRED_CXX_FLAGS} -timplicit_local -no_implicit_include") - endif() -endif() - -if(VTK_USE_X) - if(CMAKE_X_CFLAGS) - set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_X_CFLAGS}") - set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} ${CMAKE_X_CFLAGS}") - endif() -endif() - -# Copy library dependencies. -set(vtkCommonJava_LIB_DEPENDS "${VTK40_vtkCommonJava_LIB_DEPENDS}") -set(vtkCommonPython_LIB_DEPENDS "${VTK40_vtkCommonPython_LIB_DEPENDS}") -set(vtkCommonTCL_LIB_DEPENDS "${VTK40_vtkCommonTCL_LIB_DEPENDS}") -set(vtkCommon_LIB_DEPENDS "${VTK40_vtkCommon_LIB_DEPENDS}") -set(vtkFilteringJava_LIB_DEPENDS "${VTK40_vtkFilteringJava_LIB_DEPENDS}") -set(vtkFilteringPython_LIB_DEPENDS "${VTK40_vtkFilteringPython_LIB_DEPENDS}") -set(vtkFilteringTCL_LIB_DEPENDS "${VTK40_vtkFilteringTCL_LIB_DEPENDS}") -set(vtkFiltering_LIB_DEPENDS "${VTK40_vtkFiltering_LIB_DEPENDS}") -set(vtkGraphicsJava_LIB_DEPENDS "${VTK40_vtkGraphicsJava_LIB_DEPENDS}") -set(vtkGraphicsPython_LIB_DEPENDS "${VTK40_vtkGraphicsPython_LIB_DEPENDS}") -set(vtkGraphicsTCL_LIB_DEPENDS "${VTK40_vtkGraphicsTCL_LIB_DEPENDS}") -set(vtkGraphics_LIB_DEPENDS "${VTK40_vtkGraphics_LIB_DEPENDS}") -set(vtkHybridJava_LIB_DEPENDS "${VTK40_vtkHybridJava_LIB_DEPENDS}") -set(vtkHybridPython_LIB_DEPENDS "${VTK40_vtkHybridPython_LIB_DEPENDS}") -set(vtkHybridTCL_LIB_DEPENDS "${VTK40_vtkHybridTCL_LIB_DEPENDS}") -set(vtkHybrid_LIB_DEPENDS "${VTK40_vtkHybrid_LIB_DEPENDS}") -set(vtkIOJava_LIB_DEPENDS "${VTK40_vtkIOJava_LIB_DEPENDS}") -set(vtkIOPython_LIB_DEPENDS "${VTK40_vtkIOPython_LIB_DEPENDS}") -set(vtkIOTCL_LIB_DEPENDS "${VTK40_vtkIOTCL_LIB_DEPENDS}") -set(vtkIO_LIB_DEPENDS "${VTK40_vtkIO_LIB_DEPENDS}") -set(vtkImagingJava_LIB_DEPENDS "${VTK40_vtkImagingJava_LIB_DEPENDS}") -set(vtkImagingPython_LIB_DEPENDS "${VTK40_vtkImagingPython_LIB_DEPENDS}") -set(vtkImagingTCL_LIB_DEPENDS "${VTK40_vtkImagingTCL_LIB_DEPENDS}") -set(vtkImaging_LIB_DEPENDS "${VTK40_vtkImaging_LIB_DEPENDS}") -set(vtkParallelJava_LIB_DEPENDS "${VTK40_vtkParallelJava_LIB_DEPENDS}") -set(vtkParallelPython_LIB_DEPENDS "${VTK40_vtkParallelPython_LIB_DEPENDS}") -set(vtkParallelTCL_LIB_DEPENDS "${VTK40_vtkParallelTCL_LIB_DEPENDS}") -set(vtkParallel_LIB_DEPENDS "${VTK40_vtkParallel_LIB_DEPENDS}") -set(vtkPatentedJava_LIB_DEPENDS "${VTK40_vtkPatentedJava_LIB_DEPENDS}") -set(vtkPatentedPython_LIB_DEPENDS "${VTK40_vtkPatentedPython_LIB_DEPENDS}") -set(vtkPatentedTCL_LIB_DEPENDS "${VTK40_vtkPatentedTCL_LIB_DEPENDS}") -set(vtkPatented_LIB_DEPENDS "${VTK40_vtkPatented_LIB_DEPENDS}") -set(vtkRenderingJava_LIB_DEPENDS "${VTK40_vtkRenderingJava_LIB_DEPENDS}") -set(vtkRenderingPythonTkWidgets_LIB_DEPENDS "${VTK40_vtkRenderingPythonTkWidgets_LIB_DEPENDS}") -set(vtkRenderingPython_LIB_DEPENDS "${VTK40_vtkRenderingPython_LIB_DEPENDS}") -set(vtkRenderingTCL_LIB_DEPENDS "${VTK40_vtkRenderingTCL_LIB_DEPENDS}") -set(vtkRendering_LIB_DEPENDS "${VTK40_vtkRendering_LIB_DEPENDS}") -set(vtkjpeg_LIB_DEPENDS "${VTK40_vtkjpeg_LIB_DEPENDS}") -set(vtkpng_LIB_DEPENDS "${VTK40_vtkpng_LIB_DEPENDS}") -set(vtkzlib_LIB_DEPENDS "${VTK40_vtkzlib_LIB_DEPENDS}") - -# List of VTK configuration variables set above. -# grep "^[ ]*set(VTK" UseVTKConfig40.cmake |sed 's/[ ]*set(\([^ ]*\) .*/ \1/' -set(VTK_SETTINGS - VTK_BUILD_SHARED - VTK_BUILD_VERSION - VTK_DEBUG_LEAKS - VTK_HAVE_VG500 - VTK_HAVE_VP1000 - VTK_INCLUDE_DIRS - VTK_KITS - VTK_LANGUAGES - VTK_LIBRARY_DIRS - VTK_MAJOR_VERSION - VTK_MANGLE_MESA - VTK_MINOR_VERSION - VTK_MPIRUN_EXE - VTK_MPI_POSTFLAGS - VTK_MPI_PREFLAGS - VTK_OPENGL_HAS_OSMESA - VTK_PARSE_JAVA_EXE - VTK_TCL_EXE - VTK_TCL_HOME - VTK_USE_64BIT_IDS - VTK_USE_ANSI_STDLIB - VTK_USE_HYBRID - VTK_USE_MATROX_IMAGING - VTK_USE_MPI - VTK_USE_PARALLEL - VTK_USE_PATENTED - VTK_USE_RENDERING - VTK_USE_VIDEO_FOR_WINDOWS - VTK_USE_VOLUMEPRO - VTK_USE_X - VTK_WRAP_JAVA - VTK_WRAP_JAVA_EXE - VTK_WRAP_PYTHON - VTK_WRAP_PYTHON_EXE - VTK_WRAP_TCL - VTK_WRAP_TCL_EXE -) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index de69a15..a0d0160 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 3) -set(CMake_VERSION_PATCH 20150911) +set(CMake_VERSION_PATCH 20150917) #set(CMake_VERSION_RC 1) diff --git a/Source/Checks/cm_c11_thread_local.c b/Source/Checks/cm_c11_thread_local.c new file mode 100644 index 0000000..ab780f2 --- /dev/null +++ b/Source/Checks/cm_c11_thread_local.c @@ -0,0 +1,2 @@ +_Thread_local int i = 42; +int main(void) { return 0; } diff --git a/Source/Checks/cm_c11_thread_local.cmake b/Source/Checks/cm_c11_thread_local.cmake new file mode 100644 index 0000000..6b8d10b --- /dev/null +++ b/Source/Checks/cm_c11_thread_local.cmake @@ -0,0 +1,33 @@ +set(CMake_C11_THREAD_LOCAL_BROKEN 0) +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_C11_STANDARD_COMPILE_OPTION) + if(NOT DEFINED CMake_C11_THREAD_LOCAL_WORKS) + message(STATUS "Checking if compiler supports C11 _Thread_local") + try_compile(CMake_C11_THREAD_LOCAL_WORKS + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_LIST_DIR}/cm_c11_thread_local.c + CMAKE_FLAGS -DCMAKE_C_STANDARD=11 + OUTPUT_VARIABLE OUTPUT + ) + if(CMake_C11_THREAD_LOCAL_WORKS AND "${OUTPUT}" MATCHES "error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'") + set_property(CACHE CMake_C11_THREAD_LOCAL_WORKS PROPERTY VALUE 0) + endif() + if(CMake_C11_THREAD_LOCAL_WORKS) + message(STATUS "Checking if compiler supports C11 _Thread_local - yes") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining if compiler supports C11 _Thread_local passed with the following output:\n" + "${OUTPUT}\n" + "\n" + ) + else() + message(STATUS "Checking if compiler supports C11 _Thread_local - no") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if compiler supports C11 _Thread_local failed with the following output:\n" + "${OUTPUT}\n" + "\n" + ) + endif() + endif() + if(NOT CMake_C11_THREAD_LOCAL_WORKS) + set(CMake_C11_THREAD_LOCAL_BROKEN 1) + endif() +endif() diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 67e4aab..6144ddc 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -80,12 +80,13 @@ void cmCursesLongMessageForm::UpdateStatusBar() sprintf(version+sideSpace, "%s", vertmp); version[width] = '\0'; + char fmt_s[] = "%s"; curses_move(y-4,0); attron(A_STANDOUT); - printw(bar); + printw(fmt_s, bar); attroff(A_STANDOUT); curses_move(y-3,0); - printw(version); + printw(fmt_s, version); pos_form_cursor(this->Form); } @@ -101,8 +102,9 @@ void cmCursesLongMessageForm::PrintKeys() char firstLine[512]; sprintf(firstLine, "Press [e] to exit help"); + char fmt_s[] = "%s"; curses_move(y-2,0); - printw(firstLine); + printw(fmt_s, firstLine); pos_form_cursor(this->Form); } diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index be17a9f..a2fc2c0 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -451,24 +451,25 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) } curses_move(y-4,0); + char fmt_s[] = "%s"; char fmt[512] = "Press [enter] to edit option"; if ( process ) { strcpy(fmt, " "); } - printw(fmt); + printw(fmt_s, fmt); curses_move(y-3,0); - printw(firstLine); + printw(fmt_s, firstLine); curses_move(y-2,0); - printw(secondLine); + printw(fmt_s, secondLine); curses_move(y-1,0); - printw(thirdLine); + printw(fmt_s, thirdLine); if (cw) { sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages); curses_move(0,65-static_cast<unsigned int>(strlen(firstLine))-1); - printw(firstLine); + printw(fmt_s, firstLine); } // } @@ -612,13 +613,13 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) version[width] = '\0'; // Now print both lines + char fmt_s[] = "%s"; curses_move(y-5,0); attron(A_STANDOUT); - char format[] = "%s"; - printw(format, bar); + printw(fmt_s, bar); attroff(A_STANDOUT); curses_move(y-4,0); - printw(version); + printw(fmt_s, version); pos_form_cursor(this->Form); } diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index acf262f..6eb15c1 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -168,17 +168,16 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, else if ( key == 127 || key == KEY_BACKSPACE ) { - if ( form->curcol > 0 ) - { + FIELD *cur = current_field(form); form_driver(form, REQ_DEL_PREV); - } + if (current_field(form) != cur) + { + set_current_field(form, cur); + } } else if ( key == ctrl('d') ||key == KEY_DC ) { - if ( form->curcol >= 0 ) - { - form_driver(form, REQ_DEL_CHAR); - } + form_driver(form, REQ_DEL_CHAR); } else { @@ -221,6 +220,7 @@ bool cmCursesStringWidget::PrintKeys() } if (this->InEdit) { + char fmt_s[] = "%s"; char firstLine[512]; // Clean the toolbar for(int i=0; i<512; i++) @@ -229,17 +229,16 @@ bool cmCursesStringWidget::PrintKeys() } firstLine[511] = '\0'; curses_move(y-4,0); - printw(firstLine); + printw(fmt_s, firstLine); curses_move(y-3,0); - printw(firstLine); + printw(fmt_s, firstLine); curses_move(y-2,0); - printw(firstLine); + printw(fmt_s, firstLine); curses_move(y-1,0); - printw(firstLine); + printw(fmt_s, firstLine); - sprintf(firstLine, "Editing option, press [enter] to leave edit."); curses_move(y-3,0); - printw(firstLine); + printw(fmt_s, "Editing option, press [enter] to leave edit."); return true; } else diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx index e5363f4..a12e4c2 100644 --- a/Source/CursesDialog/cmCursesWidget.cxx +++ b/Source/CursesDialog/cmCursesWidget.cxx @@ -49,7 +49,7 @@ void cmCursesWidget::Move(int x, int y, bool isNewPage) void cmCursesWidget::SetValue(const std::string& value) { this->Value = value; - set_field_buffer(this->Field, 0, value.c_str()); + set_field_buffer(this->Field, 0, const_cast<char *>(value.c_str())); } const char* cmCursesWidget::GetValue() diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index 11e3f34..dc4db63 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -173,7 +173,7 @@ public: */ DumpSymbols(ObjectHeaderType* ih, - FILE* fout) { + FILE* fout, bool is64) { this->ObjectImageHeader = ih; this->SymbolTable = (SymbolTableType*) ((DWORD_PTR)this->ObjectImageHeader @@ -183,6 +183,7 @@ public: GetSectionHeaderOffset(this->ObjectImageHeader); this->ImportFlag = true; this->SymbolCount = this->ObjectImageHeader->NumberOfSymbols; + this->Is64Bit = is64; } /* @@ -287,7 +288,14 @@ public: symbol.erase(posAt); } } - if (symbol[0] == '_') symbol.erase(0,1); + // For 64 bit builds we don't need to remove _ + if(!this->Is64Bit) + { + if (symbol[0] == '_') + { + symbol.erase(0,1); + } + } if (this->ImportFlag) { this->ImportFlag = false; fprintf(this->FileOut,"EXPORTS \n"); @@ -355,6 +363,7 @@ private: PIMAGE_SECTION_HEADER SectionHeaders; ObjectHeaderType* ObjectImageHeader; SymbolTableType* SymbolTable; + bool Is64Bit; }; bool @@ -406,7 +415,8 @@ DumpFile(const char* filename, FILE *fout) * and IMAGE_FILE_HEADER.SizeOfOptionalHeader == 0; */ DumpSymbols<IMAGE_FILE_HEADER, IMAGE_SYMBOL> - symbolDumper((PIMAGE_FILE_HEADER) lpFileBase, fout); + symbolDumper((PIMAGE_FILE_HEADER) lpFileBase, fout, + (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64)); symbolDumper.DumpObjFile(); } else { // check for /bigobj format @@ -414,7 +424,8 @@ DumpFile(const char* filename, FILE *fout) (cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase; if(h->Sig1 == 0x0 && h->Sig2 == 0xffff) { DumpSymbols<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX> - symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase, fout); + symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase, fout, + (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64)); symbolDumper.DumpObjFile(); } else { printf("unrecognized file format in '%s'\n", filename); diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 7959ffe..fa9b381 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -207,6 +207,10 @@ void cmFindBase::ExpandPaths() { this->FillCMakeEnvironmentPath(); } + } + this->FillUserHintsPath(); + if(!this->NoDefaultPath) + { if(!this->NoSystemEnvironmentPath) { this->FillSystemEnvironmentPath(); @@ -216,8 +220,6 @@ void cmFindBase::ExpandPaths() this->FillCMakeSystemVariablePath(); } } - - this->FillUserHintsPath(); this->FillUserGuessPath(); } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 9b9071d..64176e7 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1133,6 +1133,10 @@ void cmFindPackageCommand::ComputePrefixes() { this->FillPrefixesCMakeEnvironment(); } + } + this->FillPrefixesUserHints(); + if(!this->NoDefaultPath) + { if(!this->NoSystemEnvironmentPath) { this->FillPrefixesSystemEnvironment(); @@ -1150,7 +1154,6 @@ void cmFindPackageCommand::ComputePrefixes() this->FillPrefixesSystemRegistry(); } } - this->FillPrefixesUserHints(); this->FillPrefixesUserGuess(); this->ComputeFinalPaths(); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index ee1b192..33b04ac 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -433,19 +433,22 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, { #if defined(_WIN32) && !defined(__CYGWIN__) /* Windows version number data. */ - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(osvi)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + OSVERSIONINFOEXW osviex; + ZeroMemory(&osviex, sizeof(osviex)); + osviex.dwOSVersionInfoSize = sizeof(osviex); + #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (push) # pragma warning (disable:4996) #endif - GetVersionEx (&osvi); + GetVersionExW((OSVERSIONINFOW*)&osviex); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (pop) #endif std::ostringstream windowsVersionString; - windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; + windowsVersionString << osviex.dwMajorVersion << "." + << osviex.dwMinorVersion << "." + << osviex.dwBuildNumber; windowsVersionString.str(); mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", windowsVersionString.str().c_str()); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b360c22..46d5cd8 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -487,7 +487,7 @@ cmState* cmLocalGenerator::GetState() const cmState::Snapshot cmLocalGenerator::GetStateSnapshot() const { - return this->StateSnapshot; + return this->Makefile->GetStateSnapshot(); } // List of variables that are replaced when diff --git a/Source/cmState.cxx b/Source/cmState.cxx index b30c10b..ce9ff32 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -1067,7 +1067,8 @@ cmState::Snapshot cmState::Snapshot::GetBuildsystemDirectoryParent() const PositionType parentPos = this->Position->DirectoryParent; if (parentPos != this->State->SnapshotData.Root()) { - snapshot = Snapshot(this->State, parentPos); + snapshot = Snapshot(this->State, + parentPos->BuildSystemDirectory->DirectoryEnd); } return snapshot; @@ -1376,11 +1377,16 @@ cmBacktraceRange GetPropertyBacktraces(T const& content, template <typename T, typename U, typename V> void AppendEntry(T& content, U& backtraces, V& endContentPosition, - const std::string& vec, const cmListFileBacktrace& lfbt) + const std::string& value, const cmListFileBacktrace& lfbt) { + if (value.empty()) + { + return; + } + assert(endContentPosition == content.size()); - content.push_back(vec); + content.push_back(value); backtraces.push_back(lfbt); endContentPosition = content.size(); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 3425f34..2dfa19c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1706,7 +1706,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if(prop == "INCLUDE_DIRECTORIES") { - if (value) + if (value && *value) { this->Internal->IncludeDirectoriesEntries.push_back(value); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); @@ -1715,7 +1715,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if(prop == "COMPILE_OPTIONS") { - if (value) + if (value && *value) { this->Internal->CompileOptionsEntries.push_back(value); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); @@ -1724,7 +1724,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if(prop == "COMPILE_FEATURES") { - if (value) + if (value && *value) { this->Internal->CompileFeaturesEntries.push_back(value); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); @@ -1733,7 +1733,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if(prop == "COMPILE_DEFINITIONS") { - if (value) + if (value && *value) { this->Internal->CompileDefinitionsEntries.push_back(value); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); @@ -1749,7 +1749,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if (prop == "LINK_LIBRARIES") { - if (value) + if (value && *value) { cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmValueWithOrigin entry(value, lfbt); diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 97a1df8..3857e41 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -4879,11 +4879,8 @@ std::string SystemTools::GetOperatingSystemNameAndVersion() OSVERSIONINFOEXA osvi; BOOL bOsVersionInfoEx; - // Try calling GetVersionEx using the OSVERSIONINFOEX structure. - // If that fails, try using the OSVERSIONINFO structure. - - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEXA)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + ZeroMemory(&osvi, sizeof(osvi)); + osvi.dwOSVersionInfoSize = sizeof(osvi); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (push) @@ -4893,14 +4890,10 @@ std::string SystemTools::GetOperatingSystemNameAndVersion() # pragma warning (disable:4996) # endif #endif - bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi); + bOsVersionInfoEx = GetVersionExA((OSVERSIONINFOA *)&osvi); if (!bOsVersionInfoEx) { - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (!GetVersionEx((OSVERSIONINFO *)&osvi)) - { - return 0; - } + return 0; } #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (pop) @@ -4913,10 +4906,56 @@ std::string SystemTools::GetOperatingSystemNameAndVersion() case VER_PLATFORM_WIN32_NT: // Test for the specific product family. + if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0) + { + if (osvi.wProductType == VER_NT_WORKSTATION) + { + res += "Microsoft Windows 10"; + } + else + { + res += "Microsoft Windows Server 2016 family"; + } + } + + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3) + { + if (osvi.wProductType == VER_NT_WORKSTATION) + { + res += "Microsoft Windows 8.1"; + } + else + { + res += "Microsoft Windows Server 2012 R2 family"; + } + } + + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2) + { + if (osvi.wProductType == VER_NT_WORKSTATION) + { + res += "Microsoft Windows 8"; + } + else + { + res += "Microsoft Windows Server 2012 family"; + } + } + + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1) + { + if (osvi.wProductType == VER_NT_WORKSTATION) + { + res += "Microsoft Windows 7"; + } + else + { + res += "Microsoft Windows Server 2008 R2 family"; + } + } if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) { -#if (_MSC_VER >= 1300) if (osvi.wProductType == VER_NT_WORKSTATION) { res += "Microsoft Windows Vista"; @@ -4925,9 +4964,6 @@ std::string SystemTools::GetOperatingSystemNameAndVersion() { res += "Microsoft Windows Server 2008 family"; } -#else - res += "Microsoft Windows Vista or Windows Server 2008"; -#endif } if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) @@ -4956,7 +4992,6 @@ std::string SystemTools::GetOperatingSystemNameAndVersion() { // Test for the workstation type. -#if (_MSC_VER >= 1300) if (osvi.wProductType == VER_NT_WORKSTATION) { if (osvi.dwMajorVersion == 4) @@ -5028,7 +5063,6 @@ std::string SystemTools::GetOperatingSystemNameAndVersion() } } } -#endif // Visual Studio 7 and up } // Test for specific product on Windows NT 4.0 SP5 and earlier diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in index 055b183..da614e9 100644 --- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in +++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in @@ -105,6 +105,13 @@ set(linux64_test2_libs "c;/opt/sun/sunstudio12/prod/lib/amd64/libc_supp.a") set(linux64_test2_dirs "/opt/sun/sunstudio12/prod/lib/amd64;/lib64;/usr/lib64") list(APPEND platforms linux64_test2) +# -specs=redhat-hardened-ld +set(linux64_test3_text "COLLECT_GCC_OPTIONS='-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' '-v' '-O2' '-g' '-pipe' '-Wall' '-Werror=format-security' '-fexceptions' '-fstack-protector-strong' '--param' 'ssp-buffer-size=4' '-grecord-gcc-switches' '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' '-m64' '-mtune=generic' '-I' '/usr/lib64/gfortran/modules' '-o' 'a.out' '-rdynamic' '-shared-libgcc' '-march=x86-64' '-pie' + /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/5.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccNzxFD8.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z now -pie -o a.out /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1 -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../.. -z relro dummy.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/5.1.1/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/crtn.o") +set(linux64_test3_libs "gfortran;m;quadmath;m;c") +set(linux64_test3_dirs "/usr/lib/gcc/x86_64-redhat-linux/5.1.1;/usr/lib64;/lib64;/usr/lib") +list(APPEND platforms linux64_test3) + #----------------------------------------------------------------------------- # Mac diff --git a/Tests/RunCMake/find_program/A/testAandB b/Tests/RunCMake/find_program/A/testAandB new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/Tests/RunCMake/find_program/A/testAandB @@ -0,0 +1 @@ +#!/bin/sh diff --git a/Tests/RunCMake/find_program/B/testAandB b/Tests/RunCMake/find_program/B/testAandB new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/Tests/RunCMake/find_program/B/testAandB @@ -0,0 +1 @@ +#!/bin/sh diff --git a/Tests/RunCMake/find_program/EnvAndHints-stdout.txt b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt new file mode 100644 index 0000000..39329b2 --- /dev/null +++ b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt @@ -0,0 +1 @@ +-- PROG='[^']*/Tests/RunCMake/find_program/A/testAandB' diff --git a/Tests/RunCMake/find_program/EnvAndHints.cmake b/Tests/RunCMake/find_program/EnvAndHints.cmake new file mode 100644 index 0000000..14ebd6e --- /dev/null +++ b/Tests/RunCMake/find_program/EnvAndHints.cmake @@ -0,0 +1,8 @@ +set(ENV_PATH "$ENV{PATH}") +set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/A) +find_program(PROG + NAMES testAandB + HINTS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B + ) +message(STATUS "PROG='${PROG}'") +set(ENV{PATH} "${ENV_PATH}") diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake index 2adec11..89307c1 100644 --- a/Tests/RunCMake/find_program/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(EnvAndHints) run_cmake(DirsPerName) run_cmake(NamesPerDir) diff --git a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt index b85f41d..dd5bae1 100644 --- a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt +++ b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt @@ -1 +1,2 @@ --- Target COMPILE_DEFINITIONS is 'a;;b;c;;d;;e' +-- Target COMPILE_DEFINITIONS is 'a;b;c;d;;e' +-- Directory COMPILE_DEFINITIONS is 'a;b;c;d;;e' diff --git a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake index ec07ce9..f0c63bf 100644 --- a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake +++ b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake @@ -1,2 +1,3 @@ include(Common.cmake) test_target_property(COMPILE_DEFINITIONS) +test_directory_property(COMPILE_DEFINITIONS) diff --git a/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt b/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt index 81ef170..bd5a992 100644 --- a/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt +++ b/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt @@ -1 +1 @@ --- Target COMPILE_FEATURES is 'a;;b;c;;d;;e' +-- Target COMPILE_FEATURES is 'a;b;c;d;;e' diff --git a/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt b/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt index f18451a..1a20501 100644 --- a/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt +++ b/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt @@ -1 +1,2 @@ --- Target COMPILE_OPTIONS is 'a;;b;c;;d;;e' +-- Target COMPILE_OPTIONS is 'a;b;c;d;;e' +-- Directory COMPILE_OPTIONS is 'a;b;c;d;;e' diff --git a/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake b/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake index da20ec8..75f0535 100644 --- a/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake +++ b/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake @@ -1,2 +1,3 @@ include(Common.cmake) test_target_property(COMPILE_OPTIONS) +test_directory_property(COMPILE_OPTIONS) diff --git a/Tests/RunCMake/set_property/Common.cmake b/Tests/RunCMake/set_property/Common.cmake index b359487..9d5e4f4 100644 --- a/Tests/RunCMake/set_property/Common.cmake +++ b/Tests/RunCMake/set_property/Common.cmake @@ -12,3 +12,17 @@ macro(test_target_property PROP) message(STATUS "Target ${PROP} is '${val}'") set_property(TARGET CustomTarget PROPERTY ${PROP}) endmacro() + +macro(test_directory_property PROP) + set_property(DIRECTORY PROPERTY ${PROP} x) + set_property(DIRECTORY PROPERTY ${PROP}) + set_property(DIRECTORY APPEND PROPERTY ${PROP}) + set_property(DIRECTORY PROPERTY ${PROP} a) + set_property(DIRECTORY APPEND PROPERTY ${PROP} "") + set_property(DIRECTORY APPEND PROPERTY ${PROP} b c) + set_property(DIRECTORY APPEND PROPERTY ${PROP}) + set_property(DIRECTORY APPEND PROPERTY ${PROP} "d;;e") + get_property(val DIRECTORY PROPERTY ${PROP}) + message(STATUS "Directory ${PROP} is '${val}'") + set_property(DIRECTORY PROPERTY ${PROP}) +endmacro() diff --git a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt index f9970ce..c957dd5 100644 --- a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt +++ b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt @@ -1 +1,2 @@ --- Target INCLUDE_DIRECTORIES is 'a;;b;c;;d;;e' +-- Target INCLUDE_DIRECTORIES is 'a;b;c;d;;e' +-- Directory INCLUDE_DIRECTORIES is 'a;b;c;d;;e' diff --git a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake index 8f44aee..c9a9151 100644 --- a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake +++ b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake @@ -1,2 +1,3 @@ include(Common.cmake) test_target_property(INCLUDE_DIRECTORIES) +test_directory_property(INCLUDE_DIRECTORIES) diff --git a/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt b/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt index 1f7663b..9a3988e 100644 --- a/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt +++ b/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt @@ -1 +1 @@ --- Target LINK_LIBRARIES is 'a;;b;c;;d;;e' +-- Target LINK_LIBRARIES is 'a;b;c;d;;e' diff --git a/Tests/RunCMake/set_property/USER_PROP-stdout.txt b/Tests/RunCMake/set_property/USER_PROP-stdout.txt index eaf6e37..107cc87 100644 --- a/Tests/RunCMake/set_property/USER_PROP-stdout.txt +++ b/Tests/RunCMake/set_property/USER_PROP-stdout.txt @@ -1 +1,2 @@ -- Target USER_PROP is 'a;b;c;d;;e' +-- Directory USER_PROP is 'a;b;c;d;;e' diff --git a/Tests/RunCMake/set_property/USER_PROP.cmake b/Tests/RunCMake/set_property/USER_PROP.cmake index e1f88e1..aa0aa83 100644 --- a/Tests/RunCMake/set_property/USER_PROP.cmake +++ b/Tests/RunCMake/set_property/USER_PROP.cmake @@ -1,2 +1,3 @@ include(Common.cmake) test_target_property(USER_PROP) +test_directory_property(USER_PROP) diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp index b64cdb0..e3f4e53 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp @@ -24,7 +24,9 @@ // Solaris #if defined(__sun) # include <ieeefp.h> -# define isfinite finite +# if !defined(isfinite) +# define isfinite finite +# endif #endif // AIX |