diff --git a/ThirdParty/libproj/update.sh b/ThirdParty/libproj/update.sh index 6cf6490d0748a2f597493bbd5a62a14e3d53466f..215e41ba61eeb5fae98fc4cc37ac6d7875917a4d 100755 --- a/ThirdParty/libproj/update.sh +++ b/ThirdParty/libproj/update.sh @@ -8,7 +8,7 @@ readonly name="libproj" readonly ownership="Proj Upstream <kwrobot@kitware.com>" readonly subtree="ThirdParty/$name/vtk$name" readonly repo="https://gitlab.kitware.com/third-party/proj.git" -readonly tag="for/vtk-20181019-4.9.3" +readonly tag="for/vtk-20200507-4.9.3" readonly paths=" .gitattributes ChangeLog diff --git a/ThirdParty/libproj/vtklibproj/CMakeLists.txt b/ThirdParty/libproj/vtklibproj/CMakeLists.txt index 1b02e9c33815e83cc69ba64cddbf87090f0a4b12..5f50546dde9a128145efcf0d10b3bb6aa372a621 100644 --- a/ThirdParty/libproj/vtklibproj/CMakeLists.txt +++ b/ThirdParty/libproj/vtklibproj/CMakeLists.txt @@ -68,11 +68,20 @@ endif(SELFTEST) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package (Threads) -include(CheckSymbolExists) -CHECK_SYMBOL_EXISTS(PTHREAD_MUTEX_RECURSIVE pthread.h HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN) -if (HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN) +if (Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) + set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}") + check_c_source_compiles(" +#include <pthread.h> +int main(int argc, char* argv[]) { + (void)PTHREAD_MUTEX_RECURSIVE; + (void)argv; + return argc; +} + " HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN) + if (HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN) add_definitions(-DHAVE_PTHREAD_MUTEX_RECURSIVE=1) -endif() + endif() +endif () boost_report_value(PROJ_PLATFORM_NAME) boost_report_value(PROJ_COMPILER_NAME) diff --git a/ThirdParty/libproj/vtklibproj/cmake/Proj4Utilities.cmake b/ThirdParty/libproj/vtklibproj/cmake/Proj4Utilities.cmake index c1713861e3039d678615c5dc1a080385c2e70ca6..61cd883dac5f29ab6cec008514df536ec007a0eb 100644 --- a/ThirdParty/libproj/vtklibproj/cmake/Proj4Utilities.cmake +++ b/ThirdParty/libproj/vtklibproj/cmake/Proj4Utilities.cmake @@ -27,214 +27,6 @@ # ################################################################################ -# This utility macro determines whether a particular string value -# occurs within a list of strings: -# -# list_contains(result string_to_find arg1 arg2 arg3 ... argn) -# -# This macro sets the variable named by result equal to TRUE if -# string_to_find is found anywhere in the following arguments. -macro(list_contains var value) - set(${var}) - foreach (value2 ${ARGN}) - if (${value} STREQUAL ${value2}) - set(${var} TRUE) - endif (${value} STREQUAL ${value2}) - endforeach (value2) -endmacro(list_contains) - -# This utility macro extracts the first argument from the list of -# arguments given, and places it into the variable named var. -# -# car(var arg1 arg2 ...) -macro(car var) - set(${var} ${ARGV1}) -endmacro(car) - -# This utility macro extracts all of the arguments given except the -# first, and places them into the variable named var. -# -# car(var arg1 arg2 ...) -macro(cdr var junk) - set(${var} ${ARGN}) -endmacro(cdr) - -# The parse_arguments macro will take the arguments of another macro and -# define several variables. The first argument to parse_arguments is a -# prefix to put on all variables it creates. The second argument is a -# list of names, and the third argument is a list of options. Both of -# these lists should be quoted. The rest of parse_arguments are -# arguments from another macro to be parsed. -# -# parse_arguments(prefix arg_names options arg1 arg2...) -# -# For each item in options, parse_arguments will create a variable with -# that name, prefixed with prefix_. So, for example, if prefix is -# MY_MACRO and options is OPTION1;OPTION2, then parse_arguments will -# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These -# variables will be set to true if the option exists in the command line -# or false otherwise. -# -# For each item in arg_names, parse_arguments will create a variable -# with that name, prefixed with prefix_. Each variable will be filled -# with the arguments that occur after the given arg_name is encountered -# up to the next arg_name or the end of the arguments. All options are -# removed from these lists. parse_arguments also creates a -# prefix_DEFAULT_ARGS variable containing the list of all arguments up -# to the first arg_name encountered. -macro(parse_arguments prefix arg_names option_names) - set(DEFAULT_ARGS) - foreach(arg_name ${arg_names}) - set(${prefix}_${arg_name}) - endforeach(arg_name) - foreach(option ${option_names}) - set(${prefix}_${option} FALSE) - endforeach(option) - - set(current_arg_name DEFAULT_ARGS) - set(current_arg_list) - foreach(arg ${ARGN}) - list_contains(is_arg_name ${arg} ${arg_names}) - if (is_arg_name) - set(${prefix}_${current_arg_name} ${current_arg_list}) - set(current_arg_name ${arg}) - set(current_arg_list) - else (is_arg_name) - list_contains(is_option ${arg} ${option_names}) - if (is_option) - set(${prefix}_${arg} TRUE) - else (is_option) - set(current_arg_list ${current_arg_list} ${arg}) - endif (is_option) - endif (is_arg_name) - endforeach(arg) - set(${prefix}_${current_arg_name} ${current_arg_list}) -endmacro(parse_arguments) - -# Perform a reverse topological sort on the given LIST. -# -# topological_sort(my_list "MY_" "_EDGES") -# -# LIST is the name of a variable containing a list of elements to be -# sorted in reverse topological order. Each element in the list has a -# set of outgoing edges (for example, those other list elements that -# it depends on). In the resulting reverse topological ordering -# (written back into the variable named LIST), an element will come -# later in the list than any of the elements that can be reached by -# following its outgoing edges and the outgoing edges of any vertices -# they target, recursively. Thus, if the edges represent dependencies -# on build targets, for example, the reverse topological ordering is -# the order in which one would build those targets. -# -# For each element E in this list, the edges for E are contained in -# the variable named ${PREFIX}${E}${SUFFIX}, where E is the -# upper-cased version of the element in the list. If no such variable -# exists, then it is assumed that there are no edges. For example, if -# my_list contains a, b, and c, one could provide a dependency graph -# using the following variables: -# -# MY_A_EDGES b -# MY_B_EDGES -# MY_C_EDGES a b -# -# With the involcation of topological_sort shown above and these -# variables, the resulting reverse topological ordering will be b, a, -# c. -function(topological_sort LIST PREFIX SUFFIX) - # Clear the stack and output variable - set(VERTICES "${${LIST}}") - set(STACK) - set(${LIST}) - - # Loop over all of the vertices, starting the topological sort from - # each one. - foreach(VERTEX ${VERTICES}) - string(TOUPPER ${VERTEX} UPPER_VERTEX) - - # If we haven't already processed this vertex, start a depth-first - # search from where. - if (NOT FOUND_${UPPER_VERTEX}) - # Push this vertex onto the stack with all of its outgoing edges - string(REPLACE ";" " " NEW_ELEMENT - "${VERTEX};${${PREFIX}${UPPER_VERTEX}${SUFFIX}}") - list(APPEND STACK ${NEW_ELEMENT}) - - # We've now seen this vertex - set(FOUND_${UPPER_VERTEX} TRUE) - - # While the depth-first search stack is not empty - list(LENGTH STACK STACK_LENGTH) - while(STACK_LENGTH GREATER 0) - # Remove the vertex and its remaining out-edges from the top - # of the stack - list(GET STACK -1 OUT_EDGES) - list(REMOVE_AT STACK -1) - - # Get the source vertex and the list of out-edges - separate_arguments(OUT_EDGES) - list(GET OUT_EDGES 0 SOURCE) - list(REMOVE_AT OUT_EDGES 0) - - # While there are still out-edges remaining - list(LENGTH OUT_EDGES OUT_DEGREE) - while (OUT_DEGREE GREATER 0) - # Pull off the first outgoing edge - list(GET OUT_EDGES 0 TARGET) - list(REMOVE_AT OUT_EDGES 0) - - string(TOUPPER ${TARGET} UPPER_TARGET) - if (NOT FOUND_${UPPER_TARGET}) - # We have not seen the target before, so we will traverse - # its outgoing edges before coming back to our - # source. This is the key to the depth-first traversal. - - # We've now seen this vertex - set(FOUND_${UPPER_TARGET} TRUE) - - # Push the remaining edges for the current vertex onto the - # stack - string(REPLACE ";" " " NEW_ELEMENT - "${SOURCE};${OUT_EDGES}") - list(APPEND STACK ${NEW_ELEMENT}) - - # Setup the new source and outgoing edges - set(SOURCE ${TARGET}) - string(TOUPPER ${SOURCE} UPPER_SOURCE) - set(OUT_EDGES - ${${PREFIX}${UPPER_SOURCE}${SUFFIX}}) - endif(NOT FOUND_${UPPER_TARGET}) - - list(LENGTH OUT_EDGES OUT_DEGREE) - endwhile (OUT_DEGREE GREATER 0) - - # We have finished all of the outgoing edges for - # SOURCE; add it to the resulting list. - list(APPEND ${LIST} ${SOURCE}) - - # Check the length of the stack - list(LENGTH STACK STACK_LENGTH) - endwhile(STACK_LENGTH GREATER 0) - endif (NOT FOUND_${UPPER_VERTEX}) - endforeach(VERTEX) - - set(${LIST} ${${LIST}} PARENT_SCOPE) -endfunction(topological_sort) - -# Small little hack that tweaks a component name (as used for CPack) -# to make sure to avoid certain names that cause problems. Sets the -# variable named varname to the "sanitized" name. -# -# FIXME: This is a complete hack. We probably need to fix the CPack -# generators (NSIS in particular) to get rid of the need for this. -macro(fix_cpack_component_name varname name) - if (${name} STREQUAL "foreach") - set(${varname} "boost_foreach") - else() - set(${varname} ${name}) - endif() -endmacro() - - # # A big shout out to the cmake gurus @ compiz # diff --git a/ThirdParty/libproj/vtklibproj/cmake/Proj4Version.cmake b/ThirdParty/libproj/vtklibproj/cmake/Proj4Version.cmake index ea0fc52d86b48ee0eb98894e47677b17c35f27b5..3f83d325a81353706360e07cfb1f4dd9da53cfbd 100644 --- a/ThirdParty/libproj/vtklibproj/cmake/Proj4Version.cmake +++ b/ThirdParty/libproj/vtklibproj/cmake/Proj4Version.cmake @@ -18,8 +18,12 @@ # MAJOR.MINOR version is used to set SOVERSION # +include(CMakeParseArguments) + macro(proj_version) - parse_arguments(THIS_VERSION "MAJOR;MINOR;PATCH;" + cmake_parse_arguments(THIS_VERSION + "" + "MAJOR;MINOR;PATCH" "" ${ARGN})