parameters for add_gtest

parameters for add_gtest

NO_MAIN
NO_TOOLS

--- cmake/Modules/LibAddTest.cmake
+++ cmake/Modules/LibAddTest.cmake
@@ -9,14 +9,26 @@

 macro (add_gtest source)
+	parse_arguments(ARG
+		""
+		"NO_MAIN;NO_TOOLS"
+		${ARGN}
+		)
+
 	if (BUILD_TESTING)
 	set (SOURCES ${HDR_FILES} ${source}.cpp)
 	add_executable (${source} ${SOURCES})

-	#do not hardcode tools here:
-	target_link_elektratools(${source})
+	if (NOT ARG_NO_TOOLS)
+		# invert logic?
+		target_link_elektratools(${source})
+	endif (NOT ARG_NO_TOOLS)

-	target_link_libraries(${source} gtest gtest_main)
+	target_link_libraries(${source} gtest)
+	if (NOT ARG_NO_MAIN)
+		target_link_libraries(${source} gtest_main)
+	endif (NOT ARG_NO_MAIN)
+
 	include_directories(SYSTEM ${GOOGLETEST_ROOT}/include)
 	include_directories(${CMAKE_SOURCE_DIR}/tests/gtest-framework)


Squashed '3rdparty/github/cmake-utils-remote/' changes from 3c115a5..ab35df0

ab35df0 CTEST_OUTPUT_ON_FAILURE=1

git-subtree-dir: 3rdparty/github/cmake-utils-remote
git-subtree-split: ab35df086a2f9f2190ffb45fffdcdae8cc0b6a8b

--- cmake/MyPackageBootstrap.cmake
+++ cmake/MyPackageBootstrap.cmake
@@ -43,7 +43,13 @@
   IF (MYPACKAGE_DEBUG)
     MESSAGE (STATUS "[${PROJECT_NAME}-BOOTSTRAP-DEBUG] Creating target check")
   ENDIF ()
-  ADD_CUSTOM_TARGET (check COMMAND ${CMAKE_CTEST_COMMAND})
+  ADD_CUSTOM_TARGET(check
+            ${CMAKE_COMMAND} -E echo ----------------------------------
+    COMMAND ${CMAKE_COMMAND} -E echo Test command:
+    COMMAND ${CMAKE_COMMAND} -E echo ${CMAKE_CTEST_COMMAND} -C $<CONFIG>
+    COMMAND ${CMAKE_COMMAND} -E echo ----------------------------------
+    COMMAND ${CMAKE_COMMAND} -E env CTEST_OUTPUT_ON_FAILURE=1 ${CMAKE_CTEST_COMMAND} -C $<CONFIG>
+    )
   IF (MYPACKAGE_DEBUG)
     MESSAGE (STATUS "[${PROJECT_NAME}-BOOTSTRAP-DEBUG] Creating target man")
   ENDIF ()


Revert "[cmake] Simplify and move the var init outside of ARG_MODULE."

This reverts commit 1ff208ce2f6f1556cc43532113e2c9f2348f9cba.
It causes duplicate cintdll targets and a race.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -412,19 +412,20 @@

   #---Set the library output directory-----------------------
   ROOT_GET_LIBRARY_OUTPUT_DIR(library_output_dir)
-  set(runtime_cxxmodule_dependencies )
-  set(cpp_module)
+  set (runtime_cxxmodule_dependencies )
   set(library_name ${libprefix}${library_target_name}${libsuffix})
   set(newargs -s ${library_output_dir}/${library_name})
   set(rootmap_name ${library_output_dir}/${libprefix}${library_target_name}.rootmap)
-  set(pcm_name ${library_output_dir}/${libprefix}${library_target_name}_rdict.pcm)
   if(ARG_MODULE)
+    set(cpp_module)
+    set(master_pcm_name ${library_output_dir}/${libprefix}${library_target_name}_rdict.pcm)
     if(ARG_MULTIDICT)
       set(newargs ${newargs} -multiDict)
       set(pcm_name ${library_output_dir}/${libprefix}${library_target_name}_${dictionary}_rdict.pcm)
       set(rootmap_name ${library_output_dir}/${libprefix}${library_target_name}32.rootmap)
     else()
       set(cpp_module ${library_target_name})
+      set(pcm_name ${master_pcm_name})
     endif(ARG_MULTIDICT)

     if(runtime_cxxmodules)
@@ -442,6 +443,8 @@
         endif()
       endif(cpp_module)
     endif()
+  else()
+    set(pcm_name ${library_output_dir}/${libprefix}${library_target_name}_rdict.pcm)
   endif()

   if(CMAKE_ROOTTEST_NOROOTMAP OR cpp_module_file)


ARROW-1944: [C++] Fix ARROW_STATIC_LIB in FindArrow

Author: Philipp Moritz <pcmoritz@gmail.com>

Closes #1440 from pcmoritz/findarrow-libs-fix and squashes the following commits:

bb161b4d [Philipp Moritz] fix static lib path in FindArrow

--- cpp/cmake_modules/FindArrow.cmake
+++ cpp/cmake_modules/FindArrow.cmake
@@ -97,8 +97,8 @@
     set(ARROW_SHARED_IMP_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}.lib)
     set(ARROW_PYTHON_SHARED_IMP_LIB ${ARROW_PYTHON_LIBS}/${ARROW_PYTHON_LIB_NAME}.lib)
   else()
-    set(ARROW_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/lib${ARROW_LIB_NAME}.a)
-    set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/lib${ARROW_PYTHON_LIB_NAME}.a)
+    set(ARROW_STATIC_LIB ${ARROW_LIBS}/lib${ARROW_LIB_NAME}.a)
+    set(ARROW_PYTHON_STATIC_LIB ${ARROW_LIBS}/lib${ARROW_PYTHON_LIB_NAME}.a)

     set(ARROW_SHARED_LIB ${ARROW_LIBS}/lib${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
     set(ARROW_PYTHON_SHARED_LIB ${ARROW_LIBS}/lib${ARROW_PYTHON_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})


CMake: Do not put static libraries to shared library dir on android.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -50,7 +50,7 @@
 set (DEST_SHARE_DIR share)
 set (DEST_RESOURCE_DIR ${DEST_BIN_DIR})
 set (DEST_BUNDLE_DIR ${DEST_SHARE_DIR}/Applications)
-set (DEST_ARCHIVE_DIR lib${LIB_SUFFIX})
+set (DEST_ARCHIVE_DIR lib)
 set (DEST_PKGCONFIG_DIR ${DEST_ARCHIVE_DIR}/pkgconfig)
 set (DEST_THIRDPARTY_HEADERS_DIR ${DEST_INCLUDE_DIR}/ThirdParty)
 if (ANDROID)


Android - fix PCH generation for Android build.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -1218,6 +1218,10 @@
                 if (TYPE MATCHES SHARED)
                     list (APPEND COMPILE_DEFINITIONS ${TARGET_NAME}_EXPORTS)
                 endif ()
+                # Clang for Android platform requires additional target compiler flag
+                if (ANDROID)
+                    set (ARCH "--target=${ANDROID_LLVM_TRIPLE} --gcc-toolchain=${ANDROID_TOOLCHAIN_ROOT}")  # Stringify here to ensure they are not treated as list
+                endif ()
                 # Use PIC flags as necessary, except when compiling using MinGW which already uses PIC flags for all codes
                 if (NOT MINGW)
                     get_target_property (PIC ${TARGET_NAME} POSITION_INDEPENDENT_CODE)
@@ -1247,7 +1251,7 @@
                 foreach (CONFIG ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})   # These two vars are mutually exclusive
                     # Generate *.rsp containing configuration specific compiler flags
                     string (TOUPPER ${CONFIG} UPPERCASE_CONFIG)
-                    file (WRITE ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new "${COMPILE_DEFINITIONS} ${SYSROOT_FLAGS} ${CLANG_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS_${UPPERCASE_CONFIG}} ${PIC_FLAGS} ${CVP} ${VID} ${CXX_STANDARD} ${INCLUDE_DIRECTORIES} -c -x ${LANG_H}")
+                    file (WRITE ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new "${ARCH} ${COMPILE_DEFINITIONS} ${SYSROOT_FLAGS} ${CLANG_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS_${UPPERCASE_CONFIG}} ${PIC_FLAGS} ${CVP} ${VID} ${CXX_STANDARD} ${INCLUDE_DIRECTORIES} -c -x ${LANG_H}")
                     execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new ${ABS_PATH_PCH}.${CONFIG}.pch.rsp)
                     file (REMOVE ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new)
                     if (NOT ${TARGET_NAME}_PCH_DEPS)


- improve detection of libSBML

- improve detection of libSBML

--- CMakeModules/FindLIBSBML.cmake
+++ CMakeModules/FindLIBSBML.cmake
@@ -1,4 +1,9 @@
-# Copyright (C) 2012 - 2013 by Pedro Mendes, Virginia Tech Intellectual
+# Copyright (C) 2017 by Pedro Mendes, Virginia Tech Intellectual
+# Properties, Inc., University of Heidelberg, and University of
+# of Connecticut School of Medicine.
+# All rights reserved.
+
+# Copyright (C) 2012 - 2016 by Pedro Mendes, Virginia Tech Intellectual
 # Properties, Inc., University of Heidelberg, and The University
 # of Manchester.
 # All rights reserved.
@@ -8,19 +13,48 @@
 # LIBSBML_INCLUDE_DIR, where to find the headers
 #
 # LIBSBML_LIBRARY, LIBSBML_LIBRARY_DEBUG
-# LIBSBML_FOUND
-#
-# $LIBSBML_DIR is an environment variable that would
-# correspond to the ./configure --prefix=$LIBSBML_DIR
-#
-# Created by Robert Osfield.
-# Modified by Ralph Gauges
+# LIBSBML_FOUND, LIBSBML_LIBRARY_NAME

-message (STATUS "$ENV{LIBSBML_DIR}")
+
+if(UNIX OR CYGWIN OR MINGW)
+  set(LIBSBML_LIBRARY_NAME sbml)
+else()
+  set(LIBSBML_LIBRARY_NAME libsbml)
+endif()
+
+if (NOT LIBSBML_SHARED)
+  set(LIBSBML_LIBRARY_NAME "${LIBSBML_LIBRARY_NAME}-static")
+endif()
+
+message (STATUS "Looking for ${LIBSBML_LIBRARY_NAME}")
+
+find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET)
+
+if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
+  find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET
+    PATHS /usr/lib/cmake
+          /usr/local/lib/cmake
+          /opt/lib/cmake
+          /opt/local/lib/cmake
+          /sw/lib/cmake
+  )
+endif()
+
+if (${LIBSBML_LIBRARY_NAME}_FOUND)
+
+  get_target_property(LIBSBML_LIBRARY ${LIBSBML_LIBRARY_NAME} LOCATION)
+  get_filename_component(LIB_PATH ${LIBSBML_LIBRARY} DIRECTORY)
+  file(TO_CMAKE_PATH ${LIB_PATH}/../include LIBSBML_INCLUDE_DIR)
+  get_filename_component (LIBSBML_INCLUDE_DIR ${LIBSBML_INCLUDE_DIR} REALPATH)
+  get_target_property(LIBSBML_VERSION ${LIBSBML_LIBRARY_NAME} VERSION)
+
+else()

 find_path(LIBSBML_INCLUDE_DIR sbml/SBase.h
     PATHS $ENV{LIBSBML_DIR}/include
           $ENV{LIBSBML_DIR}
+          ${COPASI_DEPENDENCY_DIR}
+          ${COPASI_DEPENDENCY_DIR}/include
           ~/Library/Frameworks
           /Library/Frameworks
           /sw/include        # Fink
@@ -31,12 +65,14 @@
     NO_DEFAULT_PATH)

 if (NOT LIBSBML_INCLUDE_DIR)
+    find_path(LIBSBML_INCLUDE_DIR sbml/SBase.h)
+endif (NOT LIBSBML_INCLUDE_DIR)
+
+
+if (NOT LIBSBML_INCLUDE_DIR)
     message(FATAL_ERROR "libsbml include dir not found not found!")
 endif (NOT LIBSBML_INCLUDE_DIR)

-if (NOT LIBSBML_INCLUDE_DIR)
-    find_path(LIBSBML_INCLUDE_DIR sbml/SBase.h)
-endif (NOT LIBSBML_INCLUDE_DIR)

 find_library(LIBSBML_LIBRARY
     NAMES sbml-static
@@ -45,6 +81,8 @@
           libsbml
     PATHS $ENV{LIBSBML_DIR}/lib
           $ENV{LIBSBML_DIR}
+          ${COPASI_DEPENDENCY_DIR}
+          ${COPASI_DEPENDENCY_DIR}/lib
           ~/Library/Frameworks
           /Library/Frameworks
           /sw/lib        # Fink
@@ -64,9 +102,16 @@
     message(FATAL_ERROR "LIBSBML library not found!")
 endif (NOT LIBSBML_LIBRARY)

+  add_library(${LIBSBML_LIBRARY_NAME} UNKNOWN IMPORTED)
+  set_target_properties(${LIBSBML_LIBRARY_NAME} PROPERTIES IMPORTED_LOCATION ${LIBSBML_LIBRARY})
+
+endif()
+
+
+
 set(LIBSBML_FOUND "NO")
 if(LIBSBML_LIBRARY)
-    if   (LIBSBML_INCLUDE_DIR)
+    if (LIBSBML_INCLUDE_DIR)
         SET(LIBSBML_FOUND "YES")
     endif(LIBSBML_INCLUDE_DIR)
 endif(LIBSBML_LIBRARY)
@@ -74,6 +119,7 @@
 # handle the QUIETLY and REQUIRED arguments and set LIBSBML_FOUND to TRUE if
 # all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSBML DEFAULT_MSG LIBSBML_LIBRARY LIBSBML_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSBML DEFAULT_MSG LIBSBML_LIBRARY_NAME LIBSBML_LIBRARY LIBSBML_INCLUDE_DIR)

-mark_as_advanced(LIBSBML_INCLUDE_DIR LIBSBML_LIBRARY)
+mark_as_advanced(LIBSBML_INCLUDE_DIR LIBSBML_LIBRARY LIBSBML_LIBRARY_NAME)
+


Remove build to fix issue on ssh connection

--- CI/prepare_superbuild.cmake
+++ CI/prepare_superbuild.cmake
@@ -117,25 +117,25 @@
     CAPTURE_CMAKE_ERROR _configure_error
     )

-if ( NOT _configure_rv EQUAL 0 )
-  ctest_submit()
-  message( SEND_ERROR "An error occurs during ctest_configure.")
-  return()
-endif()
-
-ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
-            TARGET "OTB_DEPENDS"
-            RETURN_VALUE _build_rv
-            CAPTURE_CMAKE_ERROR _build_error
-            )
-
-if ( NOT _build_rv EQUAL 0 )
-  ctest_submit()
-  message( SEND_ERROR "An error occurs during ctest_build.")
-  return()
-endif()
-
-ctest_submit()
+# if ( NOT _configure_rv EQUAL 0 )
+#   ctest_submit()
+#   message( SEND_ERROR "An error occurs during ctest_configure.")
+#   return()
+# endif()
+
+# ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
+#             TARGET "OTB_DEPENDS"
+#             RETURN_VALUE _build_rv
+#             CAPTURE_CMAKE_ERROR _build_error
+#             )
+
+# if ( NOT _build_rv EQUAL 0 )
+#   ctest_submit()
+#   message( SEND_ERROR "An error occurs during ctest_build.")
+#   return()
+# endif()
+
+# ctest_submit()

 ########################################################################
 ########################################################################


ENH: Tell ExternalData module to search local store

Commit 54b561d6 (Teach pre-commit hook to process ExternalData content
links, 2011-05-04) taught our pre-commit hook to place data referenced
by new or modified content links in ".ExternalData/${algo}/${hash}"
under the top of the source tree.  Add this location to the search path
so the objects can be fetched from it at build time.

--- CMake/ITKExternalData.cmake
+++ CMake/ITKExternalData.cmake
@@ -1,5 +1,9 @@
 get_filename_component(_ITKExternalData_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
 include(${_ITKExternalData_DIR}/ExternalData.cmake)
 list(APPEND ExternalData_URL_TEMPLATES
+  # Local data store populated by the ITK pre-commit hook
+  "file:///${CMAKE_SOURCE_DIR}/.ExternalData/%(algo)/%(hash)"
+
+  # Data published by MIDAS
   "http://midas.kitware.com/api/rest/midas.bitstream.by.hash?hash=%(hash)&algorithm=%(algo)"
   )


Use QtSOAP with shared library support.

Use QtSOAP with shared library support.

--- CMakeExternals/QtSOAP.cmake
+++ CMakeExternals/QtSOAP.cmake
@@ -20,7 +20,7 @@

   IF(NOT DEFINED QtSOAP_DIR)

-    SET(revision_tag 42ce9d3dcbc66dd551a8)
+    SET(revision_tag 6bf1b8c8)
     IF(${proj}_REVISION_TAG)
       SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()
@@ -48,6 +48,7 @@
         -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
         -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}
         -DCMAKE_C_FLAGS:STRING=${ep_common_c_flags}
+        -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:STRING=${CTK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
         -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
         ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS}
         -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
@@ -56,7 +57,7 @@
       )
     SET(QtSOAP_DIR "${CMAKE_BINARY_DIR}/${proj}-build")

-    # Since QtSOAP is statically build, there is not need to add its corresponding
+    # Since the QtSOAP dll is created directly in CTK-build/bin, there is not need to add a
     # library output directory to CTK_EXTERNAL_LIBRARY_DIRS

   ELSE()


COMP: Included missing class in files.cmake... (see bug #522)

--- Core/DataStructures/files.cmake
+++ Core/DataStructures/files.cmake
@@ -108,6 +108,7 @@
   mitkVideoSource.cpp
   mitkVtkInterpolationProperty.cpp
   mitkVtkRepresentationProperty.cpp
+  mitkVtkResliceInterpolationProperty.cpp
   mitkVtkScalarModeProperty.cpp
   mitkWeakPointerProperty.cpp
   mitkXMLIO.cpp


cmake: make benchmarks compilable without -wmo

This only affects benchmark builds for which -whole-module-optimization is removed from BENCHOPTS in benchmark/CMakeLists.txt

--- benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
+++ benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
@@ -165,6 +165,16 @@
       set(swiftmodule "${objdir}/${module_name}.swiftmodule")
       set(source "${srcdir}/${module_name_path}.swift")
       list(APPEND SWIFT_BENCH_OBJFILES "${objfile}")
+
+      if ("${bench_flags}" MATCHES "-whole-module.*")
+        set(output_option "-o" "${objfile}")
+      else()
+        set(json "{\n  \"${source}\": { \"object\": \"${objfile}\" },\n}")
+        file(WRITE "${objdir}/${module_name}-outputmap.json" ${json})
+        set(output_option "-output-file-map"
+                          "${objdir}/${module_name}-outputmap.json")
+      endif()
+
       add_custom_command(
           OUTPUT "${objfile}"
           DEPENDS
@@ -176,9 +186,9 @@
           "-parse-as-library"
           ${bench_flags}
           "-module-name" "${module_name}"
-          "-emit-module" "-emit-module-path" "${swiftmodule}"
+          "-emit-module-path" "${swiftmodule}"
           "-I" "${objdir}"
-          "-o" "${objfile}"
+          ${output_option}
           "${source}")
       if (SWIFT_BENCHMARK_EMIT_SIB)
         set(sibfile "${objdir}/${module_name}.sib")
@@ -257,6 +267,7 @@
           ${common_options}
           ${bench_flags}
           "-parse-as-library"
+          "-emit-module-path" "${objdir}/${module_name}.swiftmodule"
           "-module-name" "${module_name}"
           "-I" "${objdir}"
           "-output-file-map" "${objdir}/${module_name}/outputmap.json"


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -813,8 +813,8 @@

                     OS_X_CLEAN_UP_FILE_WITH_QT_LIBRARIES(${TEST_NAME} ${DEST_TESTS_DIR} ${TEST_FILENAME})

-                    # Make sure that the plugin's tests refer to our embedded version of the
-                    # binary plugins on which they depend
+                    # Make sure that the plugin's tests refer to our embedded
+                    # version of the binary plugins on which they depend

                     FOREACH(PLUGIN_BINARY ${PLUGIN_BINARIES})
                         STRING(REGEX REPLACE "^.*/" "" PLUGIN_BINARY "${PLUGIN_BINARY}")
@@ -825,8 +825,8 @@
                                                                              ${DEST_TESTS_DIR}/${TEST_FILENAME})
                     ENDFOREACH()

-                    # Make sure that the plugin's tests refer to our embedded version of the
-                    # external binaries on which they depend
+                    # Make sure that the plugin's tests refer to our embedded
+                    # version of the external binaries on which they depend

                     FOREACH(EXTERNAL_BINARY ${EXTERNAL_BINARIES})
                         ADD_CUSTOM_COMMAND(TARGET ${TEST_NAME} POST_BUILD


Revert "Got rid of the -headerpad_max_install_names property for the linker on OS X since that property is not needed on a 64-bit system."

This reverts commit 62788e869a191b5338850fcaf5f28ad88730d649.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -51,6 +51,12 @@
             # Note #2: the above linking option has become obsolete on OS X,
             #          so...
         ENDIF()
+    ENDIF()
+
+    # Make sure that we can use install_name_tool without any prolem
+
+    IF(APPLE)
+        SET(LINK_FLAGS_PROPERTIES "${LINK_FLAGS_PROPERTIES} -headerpad_max_install_names")
     ENDIF()

     # Required packages


Some minor improvements for our Windows build.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -41,7 +41,7 @@
         # Default compiler and linker settings

         IF(WIN32)
-            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DNDEBUG /MD /O2 /Ob2 /Oy-")
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DNDEBUG /MD /O2 /Ob2")
             SET(LINK_FLAGS_PROPERTIES "${LINK_FLAGS_PROPERTIES} /INCREMENTAL:NO")
         ELSE()
             SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -ffast-math")
@@ -56,7 +56,7 @@
         ENDIF()
     ENDIF()

-    # Ask MSVC to treat wchat_t as a built-in type
+    # Ask MSVC not to treat wchat_t as a built-in type

     IF(WIN32)
         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-")


Cleaned up our CMake code for building a plugin.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -132,7 +132,6 @@
     SET(UIS)
     SET(INCLUDE_DIRS)
     SET(DEFINITIONS)
-    SET(FLAGS)
     SET(OPENCOR_DEPENDENCIES)
     SET(QT_DEPENDENCIES)
     SET(EXTERNAL_DEPENDENCIES_DIR)
@@ -153,16 +152,14 @@
             SET(TYPE_OF_PARAMETER 4)
         ELSEIF(${PARAMETER} STREQUAL "DEFINITIONS")
             SET(TYPE_OF_PARAMETER 5)
-        ELSEIF(${PARAMETER} STREQUAL "FLAGS")
+        ELSEIF(${PARAMETER} STREQUAL "OPENCOR_DEPENDENCIES")
             SET(TYPE_OF_PARAMETER 6)
-        ELSEIF(${PARAMETER} STREQUAL "OPENCOR_DEPENDENCIES")
+        ELSEIF(${PARAMETER} STREQUAL "QT_DEPENDENCIES")
             SET(TYPE_OF_PARAMETER 7)
-        ELSEIF(${PARAMETER} STREQUAL "QT_DEPENDENCIES")
+        ELSEIF(${PARAMETER} STREQUAL "EXTERNAL_DEPENDENCIES_DIR")
             SET(TYPE_OF_PARAMETER 8)
-        ELSEIF(${PARAMETER} STREQUAL "EXTERNAL_DEPENDENCIES_DIR")
+        ELSEIF(${PARAMETER} STREQUAL "EXTERNAL_DEPENDENCIES")
             SET(TYPE_OF_PARAMETER 9)
-        ELSEIF(${PARAMETER} STREQUAL "EXTERNAL_DEPENDENCIES")
-            SET(TYPE_OF_PARAMETER 10)
         ELSE()
             # Not one of the headers, so add the parameter to the corresponding
             # set
@@ -178,14 +175,12 @@
             ELSEIF(${TYPE_OF_PARAMETER} EQUAL 5)
                 SET(DEFINITIONS ${DEFINITIONS} ${PARAMETER})
             ELSEIF(${TYPE_OF_PARAMETER} EQUAL 6)
-                SET(FLAGS ${FLAGS} ${PARAMETER})
+                SET(OPENCOR_DEPENDENCIES ${OPENCOR_DEPENDENCIES} ${PARAMETER})
             ELSEIF(${TYPE_OF_PARAMETER} EQUAL 7)
-                SET(OPENCOR_DEPENDENCIES ${OPENCOR_DEPENDENCIES} ${PARAMETER})
+                SET(QT_DEPENDENCIES ${QT_DEPENDENCIES} ${PARAMETER})
             ELSEIF(${TYPE_OF_PARAMETER} EQUAL 8)
-                SET(QT_DEPENDENCIES ${QT_DEPENDENCIES} ${PARAMETER})
+                SET(EXTERNAL_DEPENDENCIES_DIR ${PARAMETER})
             ELSEIF(${TYPE_OF_PARAMETER} EQUAL 9)
-                SET(EXTERNAL_DEPENDENCIES_DIR ${PARAMETER})
-            ELSEIF(${TYPE_OF_PARAMETER} EQUAL 10)
                 SET(EXTERNAL_DEPENDENCIES ${EXTERNAL_DEPENDENCIES} ${PARAMETER})
             ENDIF()
         ENDIF()
@@ -327,14 +322,6 @@

     FOREACH(DEFINITION ${DEFINITIONS})
         ADD_DEFINITIONS(-D${DEFINITION})
-    ENDFOREACH()
-
-    # Add some more flags
-
-    FOREACH(FLAG ${FLAGS})
-        SET_TARGET_PROPERTIES(${PROJECT_NAME}
-            PROPERTIES OUTPUT_NAME ${PLUGIN_NAME} LINK_FLAGS "${FLAG}"
-        )
     ENDFOREACH()

     # A few Mac OS X specific things


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -2,7 +2,7 @@
 #    SET(CMAKE_VERBOSE_MAKEFILE ON)
     SET(CMAKE_INCLUDE_CURRENT_DIR ON)

-    # Check whether we want EXECUTE_PROCESS to be OUTPUT_QUIET
+    # Check whether we want some EXECUTE_PROCESS() calls to be OUTPUT_QUIET

     IF(SHOW_INFORMATION_MESSAGE)
         SET(OUTPUT_QUIET)


build: luajit: set LDFLAGS on MacOS

build: luajit: set LDFLAGS on MacOS

Signed-off-by: Eduardo Silva <81f705dc2ce1a61a2621e0e4b442a9474e1d0c70@calyptia.com>

--- cmake/luajit.cmake
+++ cmake/luajit.cmake
@@ -32,12 +32,13 @@

 # luajit (UNIX)
 # =============
+
 ExternalProject_Add(luajit
   BUILD_IN_SOURCE TRUE
   EXCLUDE_FROM_ALL TRUE
   SOURCE_DIR ${LUAJIT_SRC}
   CONFIGURE_COMMAND ./configure
-  BUILD_COMMAND $(MAKE) CC=${CMAKE_C_COMPILER} ${DEPLOYMENT_TARGET} CFLAGS=${CFLAGS} BUILDMODE=static "XCFLAGS=-fPIC"
+  BUILD_COMMAND $(MAKE) CC=${CMAKE_C_COMPILER} ${DEPLOYMENT_TARGET} CFLAGS=${CFLAGS} LDFLAGS="-L${CMAKE_OSX_SYSROOT}/usr/lib" BUILDMODE=static "XCFLAGS=-fPIC"
   INSTALL_COMMAND cp src/libluajit.a "${LUAJIT_DEST}/lib/libluajit.a")

 # luajit (Windows)


python: Fix venv not being updated

python: Fix venv not being updated

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -215,6 +215,7 @@
   endif()
   # make a virtualenv to install our python package in it
   add_custom_command(TARGET python_package POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E remove_directory ${VENV_DIR}
     COMMAND ${VENV_EXECUTABLE} ${VENV_DIR}
     # Must not call it in a folder containing the setup.py otherwise pip call it
     # (i.e. "python setup.py bdist") while we want to consume the wheel package


[CLI] [CMake] Use Virgil Keys SDK from branch hotfix-1.0.5.

--- cmake/virgil.cmake
+++ cmake/virgil.cmake
@@ -126,7 +126,7 @@

         ExternalProject_Add (${VIRGIL}_project
             GIT_REPOSITORY "https://github.com/VirgilSecurity/virgil-cpp.git"
-            GIT_TAG "virgil-sdk-keys-1.0.4"
+            GIT_TAG "hotfix-1.0.5"
             PREFIX "${CMAKE_CURRENT_BINARY_DIR}/ext/virgil-cpp"
             CMAKE_ARGS ${CMAKE_ARGS}
         )


Make internal dependency private for Domains/Chemistry -> vtksys.

--- Domains/Chemistry/module.cmake
+++ Domains/Chemistry/module.cmake
@@ -8,10 +8,10 @@
   DEPENDS
     vtkCommonDataModel
     vtkRenderingCore
-    vtksys
   PRIVATE_DEPENDS
     vtkIOXML
     vtkFiltersSources
+    vtksys
   TEST_DEPENDS
     vtkIOLegacy
     vtkTestingCore


windows fix

windows fix

--- tools/cmake/HGVersion.cmake
+++ tools/cmake/HGVersion.cmake
@@ -9,7 +9,8 @@
 exec_program( hg ${PROJECT_SOURCE_DIR} ARGS tip --template='{rev}:{node|short}\n' OUTPUT_VARIABLE __HGTIP__ )
 message(STATUS "__HGTIP__=${__HGTIP__}")

-SET( CHANGESET  "\"" ${__HGTIP__} "\"" )
+#SET( CHANGESET  "\"" ${__HGTIP__} "\"" )
+SET( CHANGESET  "\""  "\"" )

 #string( REPLACE "\n" ";" __HGTIP__ ${__HGTIP__} )
 #foreach(HGTIP ${__HGTIP__})


Updating ITKv4 superbuild version to version 4.1.0

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -14,7 +14,7 @@
 set(proj ITK)  ## Use ITK convention of calling it ITK
 set(ITK_REPOSITORY git://itk.org/ITK.git)
 set(ITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.1)
-set(ITK_TAG_COMMAND GIT_TAG v4.1rc04 )
+set(ITK_TAG_COMMAND GIT_TAG v4.1.0 )
 set(WrapITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.0/WrapITK)

 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_languages_cache}\n${ep_common_cache}" )


LLVM 3.4 -> LLVM 3.5

LLVM 3.4 -> LLVM 3.5

Change LLVM VERSION variable of cmake scripts to 3.5. Opcode
coding number does not change from LLVM 3.4 to 3.5.

--- scripts/TracerConfig.cmake
+++ scripts/TracerConfig.cmake
@@ -1,5 +1,5 @@
 # In two-number form only. PinaVM will determine the patch version for you.
-SET(LLVM_RECOMMAND_VERSION 3.4)
+SET(LLVM_RECOMMAND_VERSION 3.5)

 # TODO the llvm libraries which PinaVM need.
 SET(NEED_LLVM_LIB mcjit native bitwriter jit interpreter


- Remove printing from Linux toolchain file

--- cmake/Toolchains/linux-generic_linux.toolchain.cmake
+++ cmake/Toolchains/linux-generic_linux.toolchain.cmake
@@ -1,4 +1,3 @@
-message("-- Hiding symbols")
 add_definitions (-fvisibility=hidden)

 if(LINUX_PARANOID_BUILD)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   10)
+SET(KWSYS_DATE_STAMP_DAY   11)


order available rmw implementations

order available rmw implementations

--- rmw_implementation/cmake/get_available_rmw_implementations.cmake
+++ rmw_implementation/cmake/get_available_rmw_implementations.cmake
@@ -20,5 +20,6 @@
 #
 function(get_available_rmw_implementations var)
   ament_index_get_resources(middleware_implementations "rmw_implementation")
+  list(SORT middleware_implementations)
   set(${var} ${middleware_implementations} PARENT_SCOPE)
 endfunction()


disable generation of prefix level setup files by default

--- ament_cmake_core/ament_cmake_environment-extras.cmake
+++ ament_cmake_core/ament_cmake_environment-extras.cmake
@@ -15,7 +15,7 @@
 # copied from ament_cmake_core/ament_cmake_environment-extras.cmake

 option(AMENT_CMAKE_ENVIRONMENT_GENERATION
-  "Generate environment files in the CMAKE_INSTALL_PREFIX" ON)
+  "Generate environment files in the CMAKE_INSTALL_PREFIX" OFF)
 option(AMENT_CMAKE_ENVIRONMENT_PARENT_PREFIX_PATH_GENERATION
   "Generate marker file containing the parent prefix path" ON)


CMake: Use a better FindIconv.cmake

CMake: Use a better FindIconv.cmake

The current FindIconv.cmake module matches a library named "c", which happens
to match 'libc.so', which is invalid. I replaced it with a version of
FindIconv.cmake from the Orphis/boost-cmake project on github here:

https://github.com/Orphis/boost-cmake/blob/master/cmake/Modules/FindIconv.cmake

--- cmake/FindModules/FindIconv.cmake
+++ cmake/FindModules/FindIconv.cmake
@@ -1,57 +1,76 @@
-# - Try to find Iconv
-# Once done this will define
-#
-#  ICONV_FOUND - system has Iconv
-#  ICONV_INCLUDE_DIR - the Iconv include directory
-#  ICONV_LIBRARIES - Link these to use Iconv
-#  ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
-#
-include(CheckCXXSourceCompiles)
+function(_iconv_find)
+  if(ICONV_ROOT)
+    list(APPEND iconv_roots ${ICONV_ROOT})
+  else()
+    if(NOT "$ENV{ICONV_ROOT}" STREQUAL "")
+      file(TO_CMAKE_PATH "$ENV{ICONV_ROOT}" NATIVE_PATH)
+      list(APPEND iconv_roots "${NATIVE_PATH}")
+      set(ICONV_ROOT "${NATIVE_PATH}"
+        CACHE PATH "Location of the Iconv installation" FORCE)
+    endif()
+  endif()

-IF (ICONV_INCLUDE_DIR)
-  # Already in cache, be silent
-  SET(ICONV_FIND_QUIETLY TRUE)
-ENDIF (ICONV_INCLUDE_DIR)
+  list(APPEND iconv_library_suffixes "lib")
+  list(APPEND iconv_include_suffixes "include")

-FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
-
-FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
-
-IF(ICONV_INCLUDE_DIR)
-   SET(ICONV_FOUND TRUE)
-ENDIF(ICONV_INCLUDE_DIR)
+  find_path(ICONV_INCLUDE_DIR
+    NAMES "iconv.h"
+    HINTS ${iconv_roots}
+    PATH_SUFFIXES ${iconv_include_suffixes}
+    DOC "Iconv include directory")
+  set(ICONV_INCLUDE_DIR "${ICONV_INCLUDE_DIR}" PARENT_SCOPE)

-set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
-set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
-IF(ICONV_FOUND)
-  check_cxx_source_compiles("
-  #include <iconv.h>
-  int main(){
-    iconv_t conv = 0;
-    char* in = 0;
-    size_t ilen = 0;
-    char* out = 0;
-    size_t olen = 0;
-    iconv(conv, &in, &ilen, &out, &olen);
-    return 0;
-  }
-" ICONV_SECOND_ARGUMENT_IS_CONST )
-ENDIF(ICONV_FOUND)
-set(CMAKE_REQUIRED_INCLUDES)
-set(CMAKE_REQUIRED_LIBRARIES)
+  find_library(ICONV_LIBRARY
+    NAMES
+      iconv
+      libiconv
+      libiconv2
+    HINTS ${iconv_roots}
+    PATH_SUFFIXES ${iconv_library_suffixes}
+    DOC "Iconv library")
+  set(ICONV_LIBRARY "${ICONV_LIBRARY}" PARENT_SCOPE)

-IF(ICONV_FOUND)
-  IF(NOT ICONV_FIND_QUIETLY)
-    MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
-  ENDIF(NOT ICONV_FIND_QUIETLY)
-ELSE(ICONV_FOUND)
-  IF(Iconv_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR "Could not find Iconv")
-  ENDIF(Iconv_FIND_REQUIRED)
-ENDIF(ICONV_FOUND)
+  if(ICONV_INCLUDE_DIR AND NOT ICONV_LIBRARY)
+    include(CheckFunctionExists)
+    check_function_exists(iconv HAVE_ICONV_IN_LIBC)
+    if(HAVE_ICONV_IN_LIBC)
+      set(HAVE_ICONV_IN_LIBC "${HAVE_ICONV_IN_LIBC}" PARENT_SCOPE)
+      set(ICONV_LIBRARY "integrated in standard library" PARENT_SCOPE)
+    endif()
+  endif()

-MARK_AS_ADVANCED(
-  ICONV_INCLUDE_DIR
-  ICONV_LIBRARIES
-  ICONV_SECOND_ARGUMENT_IS_CONST
-)
+  if(ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
+    set(ICONV_FOUND ON PARENT_SCOPE)
+  endif()
+endfunction()
+
+_iconv_find()
+
+if(ICONV_FOUND)
+  if(NOT ICONV_FIND_QUIETLY)
+    message(STATUS "Found iconv library: ${ICONV_LIBRARY}")
+  endif()
+
+  if(HAVE_ICONV_IN_LIBC)
+    set(_lib_type INTERFACE)
+  else()
+    set(_lib_type UNKNOWN)
+  endif()
+
+  add_library(Iconv::Iconv ${_lib_type} IMPORTED)
+  set_target_properties(Iconv::Iconv PROPERTIES
+    INTERFACE_INCLUDE_DIRECTORIES "${ICONV_INCLUDE_DIR}")
+
+  if(NOT HAVE_ICONV_IN_LIBC)
+    set_target_properties(Iconv::Iconv PROPERTIES
+      IMPORTED_LOCATION "${ICONV_LIBRARY}")
+  endif()
+
+  unset(_lib_type)
+else()
+  if(ICONV_FIND_REQUIRED)
+    message(FATAL_ERROR "Could NOT find iconv library")
+  endif()
+endif()
+
+mark_as_advanced(ICONV_LIBRARY ICONV_INCLUDE_DIR)


[CMake] Enable libc++ for Fuchsia toolchain on Darwin

This is necessary in order to get a working C++ compiler on Darwin
since Clang expects libc++ headers to be part of the toolchain.

Differential Revision: https://reviews.llvm.org/D46075

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@330855 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -38,16 +38,7 @@
 set(LLVM_RUNTIME_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia;x86_64-fuchsia-asan:x86_64-fuchsia;aarch64-fuchsia-asan:aarch64-fuchsia" CACHE STRING "")

 # Set the default target runtimes options.
-if(APPLE)
-  # Disable installing libc++, libc++abi or libunwind on Darwin, since Clang
-  # driver doesn't know how to use libraries that are part of the toolchain.
-  set(LIBUNWIND_INSTALL_HEADERS OFF CACHE BOOL "")
-  set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
-  set(LIBCXXABI_INSTALL_HEADERS OFF CACHE BOOL "")
-  set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
-  set(LIBCXX_INSTALL_HEADERS OFF CACHE BOOL "")
-  set(LIBCXX_INSTALL_LIBRARY OFF CACHE BOOL "")
-else()
+if(NOT APPLE)
   set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
   set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
   set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")


Build system: FindwxWidgets.cmake: order of search for aliases of wx-config

The usual CMake philosophy is to search first for most specific forms
of names in descending order by version then generic.  So I have
followed that philosophy for the possible aliases of wx-config.  I
also included 2.9 in the range of versions from 3.0 to 2.8 because
that is also a possibility. Finally, I replaced the previous logic of
separate find_program calls by using the NAMES signature for
find_program.

--- cmake/modules/FindwxWidgets.cmake
+++ cmake/modules/FindwxWidgets.cmake
@@ -771,25 +771,12 @@
     # UNIX: Start actual work.
     #-----------------------------------------------------------------
     # Support cross-compiling, only search in the target platform.
-    find_program(wxWidgets_CONFIG_EXECUTABLE wx-config
+    # MAINTENANCE! versioned names of wx-config on e.g., Cygwin.
+    find_program(wxWidgets_CONFIG_EXECUTABLE
+      NAMES wx-config-3.0 wx-config-2.9 wx-config-2.8 wx-config
       DOC "Location of wxWidgets library configuration provider binary (wx-config)."
       ONLY_CMAKE_FIND_ROOT_PATH
       )
-    #On Cygwin wx-config is actually called wx-config-3.0 or wx-config-2.8 - rather
-    #frustrating really as this will need updating every release.
-    if(NOT wxWidgets_CONFIG_EXECUTABLE)
-      find_program(wxWidgets_CONFIG_EXECUTABLE wx-config-3.0
-        DOC "Location of wxWidgets library configuration provider binary (wx-config)."
-        ONLY_CMAKE_FIND_ROOT_PATH
-        )
-    endif(NOT wxWidgets_CONFIG_EXECUTABLE)
-    if(NOT wxWidgets_CONFIG_EXECUTABLE)
-      find_program(wxWidgets_CONFIG_EXECUTABLE wx-config-2.8
-        DOC "Location of wxWidgets library configuration provider binary (wx-config)."
-        ONLY_CMAKE_FIND_ROOT_PATH
-        )
-    endif(NOT wxWidgets_CONFIG_EXECUTABLE)
-

     if(wxWidgets_CONFIG_EXECUTABLE)
       set(wxWidgets_FOUND TRUE)


build: don't attempt to run config.guess on Windows

When cross-compiling LLVM to android from Windows (for LLVMSupport), we would
attempt to execute `config.guess` to determine the host triple since
`CMAKE_SYSTEM_NAME` is not Windows and `CMAKE_C_COMPILER` will be set to GNU or
Clang.  This will fail as `config.guess` is a shell script which cannot be
executed on Windows.  Simply log a warning instead.  The user can specify the
value for this instead in those cases.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@363420 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/GetHostTriple.cmake
+++ cmake/modules/GetHostTriple.cmake
@@ -15,16 +15,20 @@
       set( value "i686-pc-windows-gnu" )
     endif()
   else( MSVC )
-    set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
-    execute_process(COMMAND sh ${config_guess}
-      RESULT_VARIABLE TT_RV
-      OUTPUT_VARIABLE TT_OUT
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if( NOT TT_RV EQUAL 0 )
-      message(FATAL_ERROR "Failed to execute ${config_guess}")
-    endif( NOT TT_RV EQUAL 0 )
-    # Defer to dynamic detection of the host AIX version.
-    string(REGEX REPLACE "-aix[0-9][^-]*" "-aix" value ${TT_OUT})
+    if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
+      message(WARNING "unable to determine host target triple")
+    else()
+      set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
+      execute_process(COMMAND sh ${config_guess}
+        RESULT_VARIABLE TT_RV
+        OUTPUT_VARIABLE TT_OUT
+        OUTPUT_STRIP_TRAILING_WHITESPACE)
+      if( NOT TT_RV EQUAL 0 )
+        message(FATAL_ERROR "Failed to execute ${config_guess}")
+      endif( NOT TT_RV EQUAL 0 )
+      # Defer to dynamic detection of the host AIX version.
+      string(REGEX REPLACE "-aix[0-9][^-]*" "-aix" value ${TT_OUT})
+    endif()
   endif( MSVC )
   set( ${var} ${value} PARENT_SCOPE )
 endfunction( get_host_triple var )


Remove dead code.

Remove dead code.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -229,6 +229,10 @@
     endforeach()
   endif(ARG_OPTIONS)

+  if (ARG_DEPENDENCIES)
+    message(FATAL_ERROR "Unimplemented switch!")
+  endif(ARG_DEPENDENCIES)
+
   #---roottest compability---------------------------------
   if(CMAKE_ROOTTEST_DICT)
     set(CMAKE_INSTALL_LIBDIR ${CMAKE_CURRENT_BINARY_DIR})
@@ -348,13 +352,6 @@
     set(rootmapargs )
   else()
     set(rootmapargs -rml ${library_name} -rmf ${rootmap_name})
-  endif()
-
-  #---Get the library and module dependencies-----------------
-  if(ARG_DEPENDENCIES)
-    foreach(dep ${ARG_DEPENDENCIES})
-      set(newargs ${newargs} -m  ${libprefix}${dep}_rdict.pcm)
-    endforeach()
   endif()

   #---what rootcling command to use--------------------------


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/gloox/hunter.cmake
+++ cmake/projects/gloox/hunter.cmake
@@ -5,6 +5,18 @@
 include(hunter_pick_scheme)

 # List of versions here...
+
+
+hunter_add_version(
+    PACKAGE_NAME
+    gloox
+    VERSION
+    "1.0.20-p2"
+    URL
+    "https://github.com/designerror/gloox/archive/v1.0.20-p2.tar.gz"
+    SHA1
+    f337df8459c43df0091ace43fdcde412a9ede676
+)

 hunter_add_version(
     PACKAGE_NAME


PKG: sort windows system dlls

PKG: sort windows system dlls

--- Packaging/PackageGlobals.cmake
+++ Packaging/PackageGlobals.cmake
@@ -43,30 +43,30 @@
 endif()

 set(WINDOWS_SYSTEM_DLLS
-  user32.dll
+  advapi32.dll
+  comdlg32.dll
+  crypt32.dll
   gdi32.dll
-  shell32.dll
+  glu32.dll
+  imm32.dll
   kernel32.dll
-  ws2_32.dll
-  wldap32.dll
-  ole32.dll
-  comdlg32.dll
-  shfolder.dll
-  secur32.dll
-  wsock32.dll
-  advapi32.dll
-  crypt32.dll
-  imm32.dll
-  oleaut32.dll
-  winmm.dll
-  opengl32.dll
-  glu32.dll
-  rpcrt4.dll
-  winspool.drv
   normaliz.dll
   odbc32.dll
+  ole32.dll
+  oleaut32.dll
+  opengl32.dll
   psapi.dll
   python...dll
+  rpcrt4.dll
+  secur32.dll
+  shell32.dll
+  shfolder.dll
+  user32.dll
+  winmm.dll
+  winspool.drv
+  wldap32.dll
+  ws2_32.dll
+  wsock32.dll
   )

 set(LINUX_SYSTEM_DLLS


Don't do sub project testing

Don't do sub project testing

--- cmake/AddGitSubmodule.cmake
+++ cmake/AddGitSubmodule.cmake
@@ -16,5 +16,7 @@
 			COMMAND_ERROR_IS_FATAL ANY)
 	endif()

+	set(ENABLE_TESTING OFF)
+
 	add_subdirectory(${dir} ${ARGV})
 endfunction(add_git_submodule)


Packed LuxMark 2.0 binaries

Packed LuxMark 2.0 binaries

--- cmake/AssembleBinDirs.cmake
+++ cmake/AssembleBinDirs.cmake
@@ -123,8 +123,8 @@

 ELSE (WIN32)

-	set(LUXMARK_LINUX64_BIN_DIR "luxmark-linux64-v2.0beta2")
-	set(LUXMARK_WIN32_BIN_DIR "luxmark-win32-v2.0beta2")
+	set(LUXMARK_LINUX64_BIN_DIR "luxmark-linux64-v2.0")
+	set(LUXMARK_WIN32_BIN_DIR "luxmark-win32-v2.0")

 	# Win32
 	add_custom_command(


- Remove message

- Remove message

--- cmake/Find/Findassimp.cmake
+++ cmake/Find/Findassimp.cmake
@@ -105,8 +105,6 @@

 ENDIF (ASSIMP_INCLUDE_DIR_TMP AND ASSIMP_LIBRARY_TMP)

-message ( "${ASSIMP_LIBRARIES}" )
-
 INCLUDE(FindPackageHandleStandardArgs)

 FIND_PACKAGE_HANDLE_STANDARD_ARGS(assimp


DO not include microsoft system libs in openmesh installer

git-svn-id: e0b5bbb11d0e9fdbbfcabba14dc32ad5d6b235bd@201 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/OpenMeshpackage.cmake
+++ cmake/OpenMeshpackage.cmake
@@ -122,7 +122,7 @@
 # has to be last
 if (WIN32)
   set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP "true")
-  include (InstallRequiredSystemLibraries)
+#  include (InstallRequiredSystemLibraries)
   install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ${ACG_PROJECT_BINDIR})
 else ()
   include (InstallRequiredSystemLibraries)


Default all modules to ON

Default all modules to ON

They are only really in here if we want them, this repo is literally
here to build binary installers... Let's see what happens when we flip
the default (parsing of keywords was way too delicate to enable some
packages).

Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>

--- cmake/ParaViewModules.cmake
+++ cmake/ParaViewModules.cmake
@@ -103,7 +103,7 @@
     set(${cm-project}_DEPENDS_ANY "")
     set(${cm-project}_DEPENDS_OPTIONAL "")
     set(${cm-project}_CAN_USE_SYSTEM 0)
-    set(${cm-project}_ENABLED_DEFAULT OFF)
+    set(${cm-project}_ENABLED_DEFAULT ON)
     set (doing "")

     set (project_arguments "${ARGN}") #need quotes to keep empty list items


Add some test code to build PETSc through externalproject

--- cmake/ThirdPartyPETSc.cmake
+++ cmake/ThirdPartyPETSc.cmake
@@ -5,16 +5,52 @@
     "Build PETSc if needed" OFF
     "NEKTAR_USE_PETSC" OFF)

-IF( NEKTAR_USE_PETSC )
-    INCLUDE(FindPETSc)
-    MESSAGE(STATUS "Found PETSc: ${PETSC_LIBRARIES}")
+IF (NEKTAR_USE_PETSC)
     ADD_DEFINITIONS(-DNEKTAR_USING_PETSC)
-    INCLUDE_DIRECTORIES(${PETSC_INCLUDES})
+
+    IF (THIRDPARTY_BUILD_PETSC)
+        INCLUDE(ExternalProject)
+
+        SET(PETSC_C_COMPILER "${CMAKE_C_COMPILER}")
+        SET(PETSC_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
+
+        IF (NEKTAR_USE_MPI)
+            IF (NOT MPI_BUILTIN)
+                SET(PETSC_C_COMPILER "${MPI_C_COMPILER}")
+                SET(PETSC_CXX_COMPILER "${MPI_CXX_COMPILER}")
+            ENDIF (NOT MPI_BUILTIN)
+        ELSE (NEKTAR_USE_MPI)
+            SET(PETSC_NO_MPI "--with-mpi=0")
+        ENDIF (NEKTAR_USE_MPI)
+
+        EXTERNALPROJECT_ADD(
+            petsc-3.5.1
+            PREFIX ${TPSRC}
+            BINARY_DIR ${TPSRC}/src/petsc-3.5.1
+            URL http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.5.1.tar.gz
+            URL_MD5 "539b3bdb627407b7e4e9e830fd5ccf43"
+            DOWNLOAD_DIR ${TPSRC}
+            CONFIGURE_COMMAND ./configure
+                --with-cc=${PETSC_C_COMPILER}
+                --with-cxx=${PETSC_CXX_COMPILER}
+                --prefix=${TPSRC}/dist
+                --with-petsc-arch=c-opt
+                --with-fc=0
+                ${PETSC_NO_MPI}
+                )
+
+        INCLUDE_DIRECTORIES(${TPSRC}/dist/include)
+        SET(PETSC_LIBRARIES "${TPSRC}/dist/lib/libpetsc.a")
+        MESSAGE(STATUS "Will build PETSc")
+    ELSE (THIRDPARTY_BUILD_PETSC)
+        INCLUDE(FindPETSc)
+        IF (NOT PETSC_FOUND)
+            MESSAGE(FATAL_ERROR "Could not find PETSc")
+        ELSE (NOT PETSC_FOUND)
+            MESSAGE(STATUS "Found PETSc: ${PETSC_LIBRARIES}")
+        ENDIF (NOT PETSC_FOUND)
+        INCLUDE_DIRECTORIES(${PETSC_INCLUDES})
+    ENDIF (THIRDPARTY_BUILD_PETSC)
 ENDIF( NEKTAR_USE_PETSC )

 INCLUDE_DIRECTORIES(${PETSC_INCLUDES})
-
-
-
-
-


[CMake] Accept entitlements for code signing in add_lldb_library()

Summary:
D57334 added entitlements support in `add_llvm_library()` so we can use it for library targets in LLDB.

Additionally this patch fixes the way that the entitlements argument is passed on from `add_lldb_executable()` to `add_llvm_executable()`. We still need the explicit parsing and passing on of single- and multi-value arguments as long as we are on CMake < 3.7 (due to bug https://gitlab.kitware.com/cmake/cmake/merge_requests/133).

Reviewers: beanz, JDevlieghere, aprantl

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D57378

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@352629 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -3,7 +3,7 @@
   # MODULE;SHARED;STATIC library type and source files
   cmake_parse_arguments(PARAM
     "MODULE;SHARED;STATIC;OBJECT;PLUGIN"
-    ""
+    "ENTITLEMENTS"
     "EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS"
     ${ARGN})
   llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS})
@@ -44,6 +44,10 @@
   if (PARAM_OBJECT)
     add_library(${name} ${libkind} ${srcs})
   else()
+    if(PARAM_ENTITLEMENTS)
+      set(pass_ENTITLEMENTS ENTITLEMENTS ${PARAM_ENTITLEMENTS})
+    endif()
+
     if(LLDB_NO_INSTALL_DEFAULT_RPATH)
       set(pass_NO_INSTALL_RPATH NO_INSTALL_RPATH)
     endif()
@@ -51,6 +55,7 @@
     llvm_add_library(${name} ${libkind} ${srcs}
       LINK_LIBS ${PARAM_LINK_LIBS}
       DEPENDS ${PARAM_DEPENDS}
+      ${pass_ENTITLEMENTS}
       ${pass_NO_INSTALL_RPATH}
     )

@@ -106,14 +111,19 @@
     ${ARGN}
     )

+  if(ARG_ENTITLEMENTS)
+    set(pass_ENTITLEMENTS ENTITLEMENTS ${ARG_ENTITLEMENTS})
+  endif()
+
   if(LLDB_NO_INSTALL_DEFAULT_RPATH)
     set(pass_NO_INSTALL_RPATH NO_INSTALL_RPATH)
   endif()

   list(APPEND LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS})
-  add_llvm_executable(${name} ${ARG_UNPARSED_ARGUMENTS}
-    ENTITLEMENTS ${ARG_ENTITLEMENTS}
+  add_llvm_executable(${name}
+    ${pass_ENTITLEMENTS}
     ${pass_NO_INSTALL_RPATH}
+    ${ARG_UNPARSED_ARGUMENTS}
   )

   target_link_libraries(${name} PRIVATE ${ARG_LINK_LIBS})


Fix Windows bots.

Fix Windows bots.

Turns out Windows is special. All library installs are RUNTIME.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@235120 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -423,7 +423,12 @@
     set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
   else()
     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO")
-      if(ARG_SHARED OR BUILD_SHARED_LIBS)
+      if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+        install(TARGETS ${name}
+          EXPORT LLVMExports
+          RUNTIME DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+          COMPONENT ${name})
+      elseif(ARG_SHARED OR BUILD_SHARED_LIBS)
         install(TARGETS ${name}
           EXPORT LLVMExports
           LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}


Do not run checks for strtok_r  on Windows - we know the function is not there..

--- cmake/os/WindowsCache.cmake
+++ cmake/os/WindowsCache.cmake
@@ -249,6 +249,7 @@
 SET(HAVE_STRSEP CACHE  INTERNAL "")
 SET(HAVE_STRSIGNAL CACHE  INTERNAL "")
 SET(HAVE_STRSTR 1 CACHE  INTERNAL "")
+SET(HAVE_STRTOK_R CACHE  INTERNAL "")
 SET(HAVE_STRTOL 1 CACHE  INTERNAL "")
 SET(HAVE_STRTOLL CACHE  INTERNAL "")
 SET(HAVE_STRTOUL 1 CACHE  INTERNAL "")


Typo in install.cmake

Typo in install.cmake

Change-Id: I04ea1e1590ea0d5414e1c07f402f3f9913ee1107
Reviewed-on: http://gerrit.aldebaran.lan/24427
Tested-by: gerrit
Reviewed-by: vbarbaresi <371b46c96c99af52f4f920034e4fcb63ece5bdb5@aldebaran-robotics.com>

--- cmake/qibuild/install.cmake
+++ cmake/qibuild/install.cmake
@@ -252,7 +252,7 @@
     string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" _python_version_full "${_python_version_full}")
     string(REGEX MATCH "^[0-9]+\\.[0-9]+" _python_version_major "${_python_version_full}")
   else()
-    qi_warning("Could not fing python headers, assuming version 2.7")
+    qi_warning("Could not find python headers, assuming version 2.7")
     set(_python_version_major "2.7")
   endif()


COMP: unify the search for the CUDA SDK

COMP: unify the search for the CUDA SDK

--- src/CMake/FindOpenCL.cmake
+++ src/CMake/FindOpenCL.cmake
@@ -202,8 +202,7 @@
   # Find cl.h in NVidia OpenCL SDK
   find_path( OPENCL_NVIDIA_INCLUDE_DIR ${OPENCL_HEADER_NAME}
     HINTS
-      $ENV{CUDA_PATH_V6_5}
-      $ENV{CUDA_PATH_V6_0}
+      $ENV{CUDA_PATH}
     PATH_SUFFIXES include
     PATHS /usr/local/cuda
     NO_DEFAULT_PATH
@@ -216,8 +215,7 @@
     find_library( OPENCL_NVIDIA_LIBRARY
       NAMES OpenCL
       HINTS
-        $ENV{CUDA_PATH_V6_5}
-        $ENV{CUDA_PATH_V6_0}
+        $ENV{CUDA_PATH}
       PATH_SUFFIXES lib/x64
       PATHS /usr/local/cuda/lib64
       NO_DEFAULT_PATH
@@ -226,8 +224,7 @@
     find_library( OPENCL_NVIDIA_LIBRARY
       NAMES OpenCL
       HINTS
-        $ENV{CUDA_PATH_V6_5}
-        $ENV{CUDA_PATH_V6_0}
+        $ENV{CUDA_PATH}
       PATH_SUFFIXES lib/Win32
       PATHS /usr/local/cuda/lib
       NO_DEFAULT_PATH


Adjust path.

Adjust path.

--- macros.cmake
+++ macros.cmake
@@ -6,7 +6,7 @@
 	add_custom_command(
 		OUTPUT ${hfile} ${cfile}
 		COMMAND
-			${CMAKE_CURRENT_SOURCE_DIR}/common/genversion.sh
+			${CMAKE_CURRENT_SOURCE_DIR}/../common/genversion.sh
 		ARGS
 			${CMAKE_CURRENT_BINARY_DIR}
 		DEPENDS [!v][!e][!r]*.c [!v][!e][!r]*.h *.sh CMakeLists.txt
@@ -29,12 +29,12 @@
 			${hfile}
 			${cfile}
 		COMMAND
-			${CMAKE_CURRENT_SOURCE_DIR}/common/make_c.sh
+			${CMAKE_CURRENT_SOURCE_DIR}/../common/make_c.sh
 			${CMAKE_CURRENT_SOURCE_DIR}/${file}
 			${hfile}
 			${cfile}
 		DEPENDS
-			${CMAKE_CURRENT_SOURCE_DIR}/common/make_c.sh
+			${CMAKE_CURRENT_SOURCE_DIR}/../common/make_c.sh
 			${CMAKE_CURRENT_SOURCE_DIR}/${file}
 		WORKING_DIRECTORY
 			${CMAKE_CURRENT_SOURCE_DIR}


Fix LocateQt5.cmake

Fix LocateQt5.cmake

It failed when qt was installed in a path that contained `Tools`.

--- CMakeScripts/LocateQt5.cmake
+++ CMakeScripts/LocateQt5.cmake
@@ -8,8 +8,11 @@
         MESSAGE(FATAL_ERROR "SEGS requires visual studio 2017 to build")
     endif()

-    # get root path so we can search for 5.3, 5.4, 5.5, etc
-    STRING(REPLACE "/Tools" ";" QT_BIN "${QT_BIN}")
+    # get root path so we can search for 5.3, 5.4, 5.5, etc, assumes provided path is in a Qt\Tools\QtCreator\bin\qtcreator.exe
+    get_filename_component(t_path ${QT_BIN} DIRECTORY)
+    get_filename_component(t_path ${t_path} DIRECTORY)
+    get_filename_component(QT_BIN ${t_path} DIRECTORY)
+
     LIST(GET QT_BIN 0 QT_BIN)
     FILE(GLOB QT_VERSIONS "${QT_BIN}/5.*")
     LIST(GET QT_VERSIONS 0 QT_VERSION)


Also restore exe config for unix.

Also restore exe config for unix.

--- src/inserts/functions.cmake
+++ src/inserts/functions.cmake
@@ -353,7 +353,7 @@
 ########################################

 function(get_configuration_exe_unhashed out)
-    if (NOT NINJA)
+    if (NOT NINJA AND NOT UNIX)
         get_configuration_unhashed(config)
         set(${out} ${config} PARENT_SCOPE)
         return()


Hack include path on win32.

Hack include path on win32.

	* build-aux/cmake/modules/Makeinfo.cmake: Here.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/Makeinfo.cmake
+++ build-aux/cmake/modules/Makeinfo.cmake
@@ -54,7 +54,15 @@
   endif(UNIX)
   # Compute include paths
   foreach(i ${includepaths})
-    set(opts ${opts} -I ${i} )
+    #HACK: On cygwin/win32 with mingw make, makeinfo.exe 4.8 do understand
+    #      input/output file c:/like/that but not path to include
+    #      directories. So, we convert c: to /cygdrive/c
+    if(WIN32)
+      string(REGEX REPLACE "^[cC]:" "/cygdrive/c" dir ${i})
+    else(WIN32)
+      set(dir ${i})
+    endif(WIN32)
+    set(opts ${opts} -I ${dir})
   endforeach(i)
   # Add command
   # FIXME: We do not use add_custom_command because CPack.cmake needs the
@@ -80,7 +88,8 @@
     )
   if(ret)
     message(SEND_ERROR
-      "'${MAKEINFO_EXECUTABLE}' failed to build '${input}' to '${output}'")
+      "'${MAKEINFO_EXECUTABLE}' failed to build '${input}' to '${output}' "
+      "(with options '${opts}' from '${CMAKE_CURRENT_SOURCE_DIR}')")
     message(STATUS "Makeinfo error begins:\n${err}\nMakeinfo error ends.")
   else(ret)
     message(STATUS "Makeinfo '${opts}' '${input}' to '${output}'")


Our compiler is new enough

Our compiler is new enough

--- build/shared/SharedConfig_Common.cmake
+++ build/shared/SharedConfig_Common.cmake
@@ -35,10 +35,10 @@
 		endif()

 		# workaround for visibility problem and gcc 4.1.x
-		if(${${COMPONENT}_VERSIONING_GCC_VERSION} LESS 413)
-			# only remove inline hidden...
-			string(REGEX REPLACE "-fvisibility-inlines-hidden" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-		endif()
+                #if(${${COMPONENT}_VERSIONING_GCC_VERSION} LESS 413)
+                #	# only remove inline hidden...
+                #	string(REGEX REPLACE "-fvisibility-inlines-hidden" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+                #endif()
 	endif()

 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${COMPONENT}_PREPROCESSOR_FLAGS}" PARENT_SCOPE)


ENH: added OpenCV classes

ENH: added OpenCV classes

--- Core/Controllers/files.cmake
+++ Core/Controllers/files.cmake
@@ -25,3 +25,8 @@
 IF(WIN32)
   SET(CPP_FILES ${CPP_FILES} mitkMovieGeneratorWin32.cpp)
 ENDIF(WIN32)
+
+IF(MITK_USE_OPEN_CV)
+  SET(CPP_FILES ${CPP_FILES}  mitkMovieGeneratorOpenCV.cpp)
+ENDIF(MITK_USE_OPEN_CV)
+


Add more Superbuild variables to support find root

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -229,6 +229,16 @@
   CMAKE_FIND_FRAMEWORK
   CMAKE_FRAMEWORK_PATH
   CMAKE_SYSTEM_FRAMEWORK_PATH
+
+  CMAKE_APPBUNDLE_PATH
+  CMAKE_FIND_APPBUNDLE
+  CMAKE_SYSTEM_APPBUNDLE_PATH
+
+  CMAKE_FIND_ROOT_PATH
+  CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
+  CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
+  CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
+  CMAKE_FIND_ROOT_PATH_MODE_PACKAGE

   CMAKE_DL_LIBS
   CMAKE_THREAD_LIBS_INIT


Unfortunately, we need to disable this warnings also for the header files.

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@26498 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/contrib/cmake/configure/configure_1_tbb.cmake
+++ deal.II/contrib/cmake/configure/configure_1_tbb.cmake
@@ -130,6 +130,14 @@
   # and if successfull return TRUE:
   SETUP_THREADING(${var})

+
+  #
+  # We have to disable a bunch of warnings:
+  #
+  ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-parentheses")
+  ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-long-long")
+
+
   INCLUDE_DIRECTORIES(
     ${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss/include
     )


cmake: updated linking to avoid incompatible calls for target_link_properties.

--- test/min-lib-unittest.cmake
+++ test/min-lib-unittest.cmake
@@ -25,11 +25,11 @@

 add_executable(${PROJECT_NAME} ${PROJECT_NAME}.cpp)

-target_link_libraries(${PROJECT_NAME} "mock_kernel")
+target_link_libraries(${PROJECT_NAME} PUBLIC "mock_kernel")
+

 if (APPLE)
-	target_link_libraries(${PROJECT_NAME} "-weak_framework JitterAPI")
-	set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-F'${C74_MAX_API_DIR}/lib/mac'")
+	set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-F'${C74_MAX_API_DIR}/lib/mac', -weak_framework JitterAPI")

     # The build dir won't be present the first time the test is compiled.
     # This isn't a problem but it does generate linker warnings about the folder not existing.


ENH: parse version for muParserX

ENH: parse version for muParserX

--- CMake/FindMuParserX.cmake
+++ CMake/FindMuParserX.cmake
@@ -1,8 +1,13 @@
 # Find MuParserX
 #
-#   MUPARSERX_FOUND        - True if MuParser found.
+#   MUPARSERX_FOUND        - True if MuParserX found.
 #   MUPARSERX_INCLUDE_DIRS - where to find mpParser.h, etc.
-#   MUPARSERX_LIBRARIES    - List of libraries when using MuParser.
+#   MUPARSERX_LIBRARIES    - List of libraries when using MuParserX.
+#   MUPARSERX_VERSION        - version string
+#   MUPARSERX_VERSION_MAJOR  - version major number
+#   MUPARSERX_VERSION_MINOR  - version minor number
+#   MUPARSERX_VERSION_PATCH  - version patch number
+#   MUPARSERX_VERSION_NUMBER - version number ((major*100)+minor)*100+patch
 #

 if( MUPARSERX_INCLUDE_DIR )
@@ -12,6 +17,21 @@

 find_path( MUPARSERX_INCLUDE_DIR mpParser.h
            PATH_SUFFIXES mpParser )
+
+if(EXISTS "${MUPARSERX_INCLUDE_DIR}/mpDefines.h")
+  file(READ "${MUPARSERX_INCLUDE_DIR}/mpDefines.h" _mpDefines_h_CONTENTS)
+  string(REGEX REPLACE ".*# *define MUP_PARSER_VERSION *_T\\(\"([0-9.]+)( .*)?\"\\).*" "\\1" MUPARSERX_VERSION "${_mpDefines_h_CONTENTS}")
+  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" MUPARSERX_VERSION_MAJOR "${MUPARSERX_VERSION}")
+  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" MUPARSERX_VERSION_MINOR "${MUPARSERX_VERSION}")
+  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" MUPARSERX_VERSION_PATCH "${MUPARSERX_VERSION}")
+  math(EXPR MUPARSERX_VERSION_NUMBER
+    "((${MUPARSERX_VERSION_MAJOR})*100+${MUPARSERX_VERSION_MINOR})*100+${MUPARSERX_VERSION_PATCH}")
+else()
+  if(NOT MuParserX_FIND_QUIETLY)
+  message(WARNING "mpDefines.h not found !")
+  endif()
+endif()
+

 find_library( MUPARSERX_LIBRARY
               NAMES muparserx


hack to enable building on os400

hack to enable building on os400

--- config.h.cmake
+++ config.h.cmake
@@ -662,6 +662,7 @@
 #define __STDC_FORMAT_MACROS
 #endif

+#define __STDC_FORMAT_MACROS
 /*
   stat structure (from <sys/stat.h>) is conditionally defined
   to have different layout and size depending on the defined macros.


chore: bump libs to latest master `e71045b`

Signed-off-by: Andrea Terzolo <e5d56ca40331b19d1b875d4011b1caad0ad5e7cb@polito.it>

--- cmake/modules/falcosecurity-libs.cmake
+++ cmake/modules/falcosecurity-libs.cmake
@@ -24,8 +24,8 @@
   # default below In case you want to test against another falcosecurity/libs version just pass the variable - ie., `cmake
   # -DFALCOSECURITY_LIBS_VERSION=dev ..`
   if(NOT FALCOSECURITY_LIBS_VERSION)
-    set(FALCOSECURITY_LIBS_VERSION "39e05ab79c77cfb05a3fa2309becc346d2b0fa2b")
-    set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=3f9a20e871d22333bfa34ea3f4a05d0697202895450dd3a7d519096c9e587b1e")
+    set(FALCOSECURITY_LIBS_VERSION "e71045b29dc4948f4b45ab2dd254499f9eeb0c09")
+    set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=964418a42f377d8d6881f086827779de4f9123a8cc952cc4a2d7112c8483a025")
   endif()

   # cd /path/to/build && cmake /path/to/source


Added a specific SOURCE_GROUP for each MODULE

--- adm/cmake/OccBuildKit.cmake
+++ adm/cmake/OccBuildKit.cmake
@@ -17,6 +17,8 @@
 		# For compilers under Windows a define must be set per file to correctly set the export macro
 		SET_SOURCE_FILES_PROPERTIES(${source_files} PROPERTIES COMPILE_FLAGS "-D__${MODULE}_DLL")
 	ENDIF(WIN32)
+
+	SOURCE_GROUP (${MODULE} FILES ${source_files})

 	# append these source files to the list of source files of the toolkit
 	SET(TOOLKIT_SOURCE_FILES ${TOOLKIT_SOURCE_FILES} ${source_files})


build: add a workaround for CMake[>=3.22] and SourceKit

The switch between compilers causes problems due to new flags being used
for building.  This adds a workaround to avoid the search path
re-ordering which breaks the build with a newer CMake.

--- tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -11,6 +11,10 @@
   if(${SWIFT_HOST_VARIANT_SDK} STREQUAL WINDOWS)
     swift_windows_include_for_arch(${SWIFT_HOST_VARIANT_ARCH}
       ${SWIFT_HOST_VARIANT_ARCH}_INCLUDE)
+    if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
+      set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I")
+      set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I")
+    endif()
     target_include_directories(${target} SYSTEM PRIVATE
       ${${SWIFT_HOST_VARIANT_ARCH}_INCLUDE})
   endif()


added: install/package component name for data

--- share/hugh/cmake/CMakeAddons_DefaultVariables.cmake
+++ share/hugh/cmake/CMakeAddons_DefaultVariables.cmake
@@ -14,6 +14,7 @@
 set(${PROJECT_NAME}_LIB_COMPONENT_NAME lib)
 set(${PROJECT_NAME}_HDR_COMPONENT_NAME hdr)
 set(${PROJECT_NAME}_DOC_COMPONENT_NAME doc)
+set(${PROJECT_NAME}_DAT_COMPONENT_NAME dat)

 # Boost
 if(VERBOSE)


Add vtkImagingCore to DEPENDS.

Add vtkImagingCore to DEPENDS.

This is needed now that vtkImagingStatistics has move to COMPILE_DEPENDS.
Imaging classes are used by the vtkDICOMCTRectifier class.

--- module.cmake
+++ module.cmake
@@ -8,6 +8,7 @@
   DESCRIPTION
     "${DOCUMENTATION}"
   DEPENDS
+    vtkImagingCore
     vtkIOImage
     vtkIOSQL
   PRIVATE_DEPENDS


SQPE FindAtlas fixes.

SQPE FindAtlas fixes.

--- cmake/FindATLAS.cmake
+++ cmake/FindATLAS.cmake
@@ -104,6 +104,10 @@
                  NAMES ${ATLAS_THREAD_PREFIX}lapack
                  PATHS ${LAPACKE_SEARCH_PATHS}
                  PATH_SUFFIXES ${PATH_SUFFIXES_LIST})
+find_library(LAPACKE_LIB
+                 NAMES ${ATLAS_THREAD_PREFIX}lapacke
+                 PATHS ${LAPACKE_SEARCH_PATHS}
+                 PATH_SUFFIXES ${PATH_SUFFIXES_LIST})
 find_library(F77BLAS_LIB
                  NAMES ${ATLAS_THREAD_PREFIX}f77blas
                  PATHS ${LAPACKE_SEARCH_PATHS}
@@ -132,10 +136,11 @@
   REQUIRED_VARS
                 ATLAS_CBLAS_INCLUDE_DIR
                 ATLAS_LAPACKE_INCLUDE_DIR
-                ATLAS_LIB
-                CBLAS_LIB
+                LAPACKE_LIB
                 LAPACK_LIB
                 F77BLAS_LIB
+                CBLAS_LIB
+                ATLAS_LIB
   VERSION_VAR ATLAS_VERSION_STRING
 )
 if (ATLAS_FOUND)
@@ -148,7 +153,7 @@
       ) #NOT MSVC
     set(MATH_LIB m)
   endif()
-  list(APPEND ATLAS_LIBRARIES ${LAPACK_LIB} ${F77BLAS_LIB} ${CBLAS_LIB} ${ATLAS_LIB} ${MATH_LIB})
+  list(APPEND ATLAS_LIBRARIES ${LAPACKE_LIB} ${LAPACK_LIB} ${F77BLAS_LIB} ${CBLAS_LIB} ${ATLAS_LIB} ${MATH_LIB})
 endif()

 mark_as_advanced(


added support for mumps_5.0.2

added support for mumps_5.0.2

--- cmake/FindMumps.cmake
+++ cmake/FindMumps.cmake
@@ -12,6 +12,7 @@
 #
 set(LIB_SEARCH_PATH
   $ENV{MUMPS_ROOT}
+  ${CMAKE_SOURCE_DIR}/../MUMPS_5.0.2/lib
   ${CMAKE_SOURCE_DIR}/../MUMPS_5.0.1/lib
   $ENV{HOME}/local/lib
   $ENV{HOME}/.local/lib
@@ -34,6 +35,7 @@
 find_path(MUMPS_INCLUDE_PATH
   NAMES mumps_compat.h
   PATHS $ENV{MUMPS_ROOT}
+    ${CMAKE_SOURCE_DIR}/../MUMPS_5.0.2/include
     ${CMAKE_SOURCE_DIR}/../MUMPS_5.0.1/include
     $ENV{HOME}/local/include
     $ENV{HOME}/.local/include


added safety net find_path/find_library call in case the first one does not produce a valid result, note, if the first succeeds, the second fall of find_xxx for the same target variable is not executed

--- cmake/FindclFFT.cmake
+++ cmake/FindclFFT.cmake
@@ -42,16 +42,28 @@
   PATHS ENV CLFFT_ROOT
   DOC "clFFT root directory.")

+FIND_PATH(CLFFT_ROOT_DIR
+  NAMES include/clFFT.h
+  DOC "clFFT root directory.")
+
 FIND_PATH(_CLFFT_INCLUDE_DIRS
   NAMES clFFT.h
   PATHS ${CLFFT_ROOT_DIR}
   PATH_SUFFIXES "include"
   DOC "clFFT include directory")

+FIND_PATH(_CLFFT_INCLUDE_DIRS
+  NAMES clFFT.h
+  DOC "clFFT include directory")
+
 FIND_LIBRARY(_CLFFT_LIBRARY
   NAMES clFFT
   PATHS ${CLFFT_ROOT_DIR}
   PATH_SUFFIXES "lib" "lib64"
+  DOC "clFFT library directory")
+
+FIND_LIBRARY(_CLFFT_LIBRARY
+  NAMES clFFT
   DOC "clFFT library directory")


fix bug of -DPADDLE_WITH_SSE3 not set when WITH_AVX AND AVX_FOUND even SSE3_FOUND (#38931)

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -31,10 +31,12 @@
 if(WITH_AVX AND AVX_FOUND)
     set(SIMD_FLAG ${AVX_FLAG})
     add_definitions(-DPADDLE_WITH_AVX)
-elseif(SSE3_FOUND)
-    if(NOT WIN32)
-        set(SIMD_FLAG ${SSE3_FLAG})
-    endif()
+elseif(SSE3_FOUND AND NOT WIN32)
+    set(SIMD_FLAG ${SSE3_FLAG})
+endif()
+
+if (SSE3_FOUND)
+    # TODO: Runtime detection should be used here.
     add_definitions(-DPADDLE_WITH_SSE3)
 endif()


removing test+python from the dependency graph

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@2645 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/dep_graph.cmake
+++ cmake/dep_graph.cmake
@@ -7,6 +7,8 @@
       if(NOT _ss STREQUAL "global_tests" AND
          NOT _ss STREQUAL "apps" AND
          NOT _ss STREQUAL "tools" AND
+         NOT _ss STREQUAL "test" AND
+         NOT _ss STREQUAL "python" AND
          NOT _ss STREQUAL "documentation")
         PCL_GET_SUBSYS_STATUS(_status ${_ss})
         if(_status)


r9570/sofa : ADD: boost works with cmake

Former-commit-id: 77cd6f6ffb2f4749ab3019e7f57e164a880b4e52

--- cmake/externals.cmake
+++ cmake/externals.cmake
@@ -26,9 +26,13 @@
 	if(NOT SOFA-EXTERNAL_BOOST_PATH STREQUAL "")
 		set(ENV{Boost_DIR} ${SOFA-EXTERNAL_BOOST_PATH})
 	endif()
+	set(Boost_USE_STATIC_LIBS		OFF)
+	set(Boost_USE_MULTITHREADED		ON)
+	set(Boost_USE_STATIC_RUNTIME    OFF)
 	find_package("Boost" REQUIRED COMPONENTS thread graph system)
 	set(Boost_DIR ${SOFA-EXTERNAL_BOOST_PATH} CACHE INTERNAL "Boost root directory" FORCE)
 	set(Boost_LIB_DIAGNOSTIC_DEFINITIONS ${Boost_LIB_DIAGNOSTIC_DEFINITIONS} CACHE INTERNAL "Boost lib diagnostic definitions" FORCE)
+	set(GLOBAL_COMPILER_DEFINES ${GLOBAL_COMPILER_DEFINES} BOOST_ALL_NO_LIB CACHE INTERNAL "Global Compiler Defines" FORCE)
 	list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
 else()
     list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_EXTLIBS_DIR}/miniBoost")


r10313/sofa : !!! DEV-WARNING : CHANGE IN CMAKE !!!
CHANGE: the CMakeLists.txt research engine for plugins now looks inside the plugin folders (e.g. plugins/Flexible, plugins/Image, etc.) and theirs direct sub-folders only (e.g. plugins/Image/Image_gui, plugins/Image/Image_test, etc.) and does not recurse into indirect sub-folders to avoid parsing of external libraries internal CMakeLists.txt (e.g. plugins/myplugin/myextlib/internal/CMakeLists.txt)

Former-commit-id: 138fdfe7566980978e138a1deb1c0e4af3ddd422

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -298,17 +298,32 @@
 						RegisterProjects(${solutionName} OPTION "${optionName}" COMPILE_DEFINITIONS "${definitionPrefix}${dependencyToUpperName}" PATH "${solutionFolder}")
 					endif()
 					unset(solutionPath)
-				else() # register every CMakeLists.txt
-					file(GLOB_RECURSE dependencyPathes "${dependencyDir}/*CMakeLists.txt") # WARNING: this wildcard expression can catch "example/badCMakeLists.txt" but we need it to catch all subdirs
-					if(NOT dependencyPathes STREQUAL "")
+				else() # register every CMakeLists.txt in the folder and in the DIRECT sub-folders (we do not go below the direct sub-folders !)
+					file(GLOB projectPath "${dependencyDir}/CMakeLists.txt")
+					if(projectPath)
+						string(REPLACE "/CMakeLists.txt" "" projectFolder ${projectPath})
+						get_filename_component(projectName ${projectFolder} NAME)
 						option("${optionName}" "${optionDescription} ${dependencyName}" OFF)
-						foreach(dependencyPath ${dependencyPathes})
-							get_filename_component(dependencyFilename ${dependencyPath} NAME)
-							string(REPLACE "/${dependencyFilename}" "" dependencyFolder ${dependencyPath})
-							get_filename_component(dependencyProjectName ${dependencyFolder} NAME)
-                            RegisterProjects(${dependencyProjectName} OPTION "${optionName}" COMPILE_DEFINITIONS "${definitionPrefix}${dependencyToUpperName}" PATH "${dependencyFolder}")
-						endforeach()
+						RegisterProjects(${projectName} OPTION "${optionName}" COMPILE_DEFINITIONS "${definitionPrefix}${dependencyToUpperName}" PATH "${projectFolder}")
+
+						# then gather CMakeLists in every direct sub-folders
+						file(GLOB subPathes "${dependencyDir}/*")
+						if(NOT subPathes STREQUAL "")
+							foreach(subPath ${subPathes})
+								if(IS_DIRECTORY ${subPath})
+									file(GLOB subProject "${subPath}/CMakeLists.txt")
+									if(NOT subProject STREQUAL "")
+										string(REPLACE "/CMakeLists.txt" "" subFolder ${subProject})
+										get_filename_component(subProjectName ${subFolder} NAME)
+										RegisterProjects(${subProjectName} OPTION "${optionName}" COMPILE_DEFINITIONS "${definitionPrefix}${dependencyToUpperName}" PATH "${subFolder}")
+									endif()
+								endif()
+							endforeach()
+						endif()
 					endif()
+					unset(projectPath)
+
+
 				endif()
 			endif()
 		endif()


small config fix

small config fix

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@5775 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsLibrary.cmake
+++ cmake/gsLibrary.cmake
@@ -85,7 +85,7 @@
    else()
      message("STATUS Looking for Pardiso MKL libraries.")
      find_package(MKL REQUIRED)
-     set(PARDISO_MKL_FOUND true)
+     set(PARDISO_LIBRARY ${MKL_LIBRARIES})
    endif()
    target_link_libraries(${PROJECT_NAME} ${PARDISO_LIBRARY})
 endif()


Fixed typo in FindFBX.cmake

Fixed typo in FindFBX.cmake

--- FindFBX.cmake
+++ FindFBX.cmake
@@ -92,9 +92,9 @@

 include(FindPackageHandleStandardArgs)
 if(WIN32 AND FBX_VERSION VERSION_GREATER_EQUAL 2019)
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(FBX DEFAULT_MSG FBX_LIBRARY FBX_INCLUDE_DIR XML2_LIBRARY ZLIB_LIBRARY)
+else()
     FIND_PACKAGE_HANDLE_STANDARD_ARGS(FBX DEFAULT_MSG FBX_LIBRARY FBX_INCLUDE_DIR)
-else()
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(FBX DEFAULT_MSG FBX_LIBRARY XML2_LIBRARY ZLIB_LIBRARY FBX_INCLUDE_DIR)
 endif()

 if(FBX_FOUND)


add official GLM cmake file

add official GLM cmake file

--- FindGLM.cmake
+++ FindGLM.cmake
@@ -1,16 +1,63 @@
-# try to find GLM
+# FindGLM - attempts to locate the glm matrix/vector library.
+#
+# This module defines the following variables (on success):
+#   GLM_INCLUDE_DIRS  - where to find glm/glm.hpp
+#   GLM_FOUND         - if the library was successfully located
+#
+# It is trying a few standard installation locations, but can be customized
+# with the following variables:
+#   GLM_ROOT_DIR      - root directory of a glm installation
+#                       Headers are expected to be found in either:
+#                       <GLM_ROOT_DIR>/glm/glm.hpp           OR
+#                       <GLM_ROOT_DIR>/include/glm/glm.hpp
+#                       This variable can either be a cmake or environment
+#                       variable. Note however that changing the value
+#                       of the environment varible will NOT result in
+#                       re-running the header search and therefore NOT
+#                       adjust the variables set by this module.

-# defines:
-#   GLM_FOUND - if found
-#   GLM_INCLUDE_DIRS
-#   GLM_LIBRARIES - alays blank (no libs needed)
-#   GLM_DEFINITIONS - alays blank (no defs needed)
+#=============================================================================
+# Copyright 2012 Carsten Neumann
+#
+# 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.)

-find_path(GLM_INCLUDE_DIR glm/glm.hpp)
+# default search dirs
+SET(_glm_HEADER_SEARCH_DIRS
+    "/usr/include"
+    "/usr/local/include")

-set(GLM_INCLUDE_DIRS ${GLM_INCLUDE_DIR})
+# check environment variable
+SET(_glm_ENV_ROOT_DIR "$ENV{GLM_ROOT_DIR}")

-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GLM DEFAULT_MSG
+IF(NOT GLM_ROOT_DIR AND _glm_ENV_ROOT_DIR)
+    SET(GLM_ROOT_DIR "${_glm_ENV_ROOT_DIR}")
+ENDIF(NOT GLM_ROOT_DIR AND _glm_ENV_ROOT_DIR)
+
+# put user specified location at beginning of search
+IF(GLM_ROOT_DIR)
+    SET(_glm_HEADER_SEARCH_DIRS "${GLM_ROOT_DIR}"
+                                "${GLM_ROOT_DIR}/include"
+                                 ${_glm_HEADER_SEARCH_DIRS})
+ENDIF(GLM_ROOT_DIR)
+
+# locate header
+FIND_PATH(GLM_INCLUDE_DIR "glm/glm.hpp"
+    PATHS ${_glm_HEADER_SEARCH_DIRS})
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLM DEFAULT_MSG
     GLM_INCLUDE_DIR)
-mark_as_advanced(GLM_INCLUDE_DIR)
+
+IF(GLM_FOUND)
+    SET(GLM_INCLUDE_DIRS "${GLM_INCLUDE_DIR}")
+
+    MESSAGE(STATUS "GLM_INCLUDE_DIR = ${GLM_INCLUDE_DIR}")
+ENDIF(GLM_FOUND)


attempt to distinguish release and debug ICU builds (win32)

--- FindICU.cmake
+++ FindICU.cmake
@@ -198,35 +198,51 @@

     # Check libraries
     foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_NAMES )
+        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES )
+        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES )
         foreach(${ICU_PRIVATE_VAR_NS}_BASE_NAME ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}")
-            #list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}")
-            #list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}d")
+            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}")
+            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
+            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}")
+            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}d")
         endforeach(${ICU_PRIVATE_VAR_NS}_BASE_NAME)

         find_library(
-            ${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_NAMES}
+            ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
+            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
             HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
             PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-            DOC "Libraries for ICU"
+            DOC "Release libraries for ICU"
         )
+        find_library(
+            ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
+            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
+            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
+            PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
+            DOC "Debug libraries for ICU"
+        )

         string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-        if(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}-NOTFOUND)
+        if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # both not found
             set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE)
             set("${ICU_PUBLIC_VAR_NS}_FOUND" FALSE)
-        else(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}-NOTFOUND)
+        else(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # one or both found
             set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE)
-        endif(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}-NOTFOUND)
-
-        list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
+            if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # release not found => we are in debug
+                set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
+            elseif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # debug not found => we are in release
+                set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
+            else() # both found
+                set(
+                    ${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
+                    optimized ${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
+                    debug ${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
+                )
+            endif()
+            list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
+        endif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
     endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
 endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-
-list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_LIBRARIES)

 if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
     include(FindPackageHandleStandardArgs)


Top level fix to not enable both pthreads and win32 threads in MinGW.

--- CMake/CMakeBackwardCompatibilityC.cmake
+++ CMake/CMakeBackwardCompatibilityC.cmake
@@ -62,6 +62,16 @@

   SET (CMAKE_USE_SPROC          ${CMAKE_USE_SPROC_INIT} CACHE BOOL
      "Use sproc libs.")
+
+  IF(MINGW AND CMAKE_USE_PTHREADS AND CMAKE_USE_WIN32_THREADS)
+    MESSAGE(STATUS
+      "Forcing CMAKE_USE_PTHREADS OFF as only one threading library should be used.")
+    SET(CMAKE_USE_PTHREADS OFF CACHE BOOL
+      "Force pthreads off if WIN32 threads are enabled" FORCE)
+    SET(CMAKE_THREAD_LIBS "" CACHE STRING "Thread library used." FORCE)
+  ELSE()
+    SET(CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING "Thread library used.")
+  ENDIF()
 ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)

 MARK_AS_ADVANCED(


Explicitly include the Qt use file again.

--- CMake/ctkMacroBuildLib.cmake
+++ CMake/ctkMacroBuildLib.cmake
@@ -50,7 +50,7 @@

   # Define library name
   set(lib_name ${MY_NAME})
-
+
   # Library target names must not contain a '_' (reserved for plug-in target names)
   if(lib_name MATCHES _)
     message(FATAL_ERROR "The library name ${lib_name} must not contain a '_' character.")
@@ -76,6 +76,9 @@
   #foreach(i ${my_includes})
   #  message(i:${i})
   #endforeach()
+
+  # Add Qt include dirs and defines
+  include(${QT_USE_FILE})

   # Add the library directories from the external project
   ctkFunctionGetLibraryDirs(my_library_dirs ${lib_name})


vtkTestingMacros: Add vtk_add_test_cxx function

Create a function with a signature similar to vtk_add_test_(python|tcl)
that can be used to add C++-implemented tests.  Support more than one
test name per call each optionally followed by a comma-separated list of
per-test options.  Store test source files in a VTK_TEST_CXX_SOURCES
directory property so callers can get the list of source files to
compile into a test driver.

Add macro vtk_test_cxx_executable to get the VTK_TEST_CXX_SOURCES value
and invoke create_test_sourcelist and vtk_module_test_executable.  Use
optional arguments to enable the rendering factory or add extra sources
to the executable.

Change-Id: I73dee627fa87a399c48b409af046b116fc75a0fd

--- CMake/vtkTestingMacros.cmake
+++ CMake/vtkTestingMacros.cmake
@@ -130,6 +130,103 @@
 endmacro()

 # -----------------------------------------------------------------------------
+# Usage: vtk_add_test_cxx([name.cxx[,-E<n>][,NO_VALID]]...
+#          [NO_DATA] [NO_VALID|<base_dir>] [VALID_ERROR <n>])
+function(vtk_add_test_cxx)
+  # Parse Command line args
+  set(names "")
+  set(no_data 0)
+  set(no_valid 0)
+  set(no_output 0)
+  set(large_data 0)
+  unset(base_dir)
+  foreach(a IN LISTS ARGN)
+    if("[${a}]" STREQUAL "[NO_DATA]")
+      set(no_data 1)
+    elseif("[${a}]" STREQUAL "[NO_VALID]")
+      set(no_valid 1)
+    elseif("[${a}]" STREQUAL "[NO_OUTPUT]")
+      set(no_output 1)
+    elseif("[${a}]" STREQUAL "[LARGE_DATA]")
+      set(large_data 1)
+    elseif("x${a}" MATCHES "^x([^.]*)\\.cxx,?(.*)$")
+      set(name "${CMAKE_MATCH_1}")
+      string(REPLACE "," ";" _${name}_OPTIONS "${CMAKE_MATCH_2}")
+      list(APPEND names ${name})
+    elseif(NOT DEFINED base_dir)
+      set(base_dir "${a}")
+    else()
+      message(FATAL_ERROR "Unknown argument \"${a}\"")
+    endif()
+  endforeach()
+
+  if(no_valid)
+    set(base_dir "")
+  elseif(NOT DEFINED base_dir)
+    message(FATAL_ERROR "Call must specify either NO_VALID or <base_dir> ")
+  endif()
+
+  if(large_data)
+    set(data_dir "${VTK_LARGE_DATA_ROOT}")
+  else()
+    set(data_dir "${VTK_DATA_ROOT}")
+  endif()
+
+  if(data_dir AND NOT no_data)
+    set(_D -D ${data_dir})
+  else()
+    set(_D "")
+  endif()
+
+  set(_T "")
+  if(NOT no_output)
+    set(_T -T ${VTK_TEST_OUTPUT_DIR})
+  endif()
+
+  foreach(name ${names})
+    set(_V "")
+    set(_E "")
+    set(tmp_base "${base_dir}")
+    foreach(opt IN LISTS _${name}_OPTIONS)
+      if("x${opt}" MATCHES "^x-E([0-9]+)$")
+        set(_E -E ${CMAKE_MATCH_1})
+      elseif("[${opt}]" STREQUAL "[NO_VALID]")
+        set(tmp_base "")
+      else()
+        message(FATAL_ERROR "Test ${name} has unknown option \"${opt}\"")
+      endif()
+    endforeach()
+    if(data_dir AND tmp_base)
+      set(_V -V Baseline/${tmp_base}/${name}.png)
+    endif()
+    add_test(NAME ${vtk-module}Cxx-${name}
+      COMMAND ${vtk-module}CxxTests ${name} ${${name}_ARGS}
+      ${_D} ${_T} ${_V} ${_E})
+    set_property(DIRECTORY APPEND PROPERTY VTK_TEST_CXX_SOURCES ${name}.cxx)
+  endforeach()
+endfunction()
+
+macro(vtk_test_cxx_executable exe_name)
+  set(argn "${ARGN}")
+  set(test_driver vtkTestDriver.h)
+  set(test_extra "")
+  foreach(a IN LISTS argn)
+    if("[${a}]" STREQUAL "[RENDERING_FACTORY]")
+      include(vtkTestingRenderingDriver)
+      set(test_driver ${vtkTestingRendering_SOURCE_DIR}/vtkTestingObjectFactory.h)
+    elseif("x${a}" MATCHES "\\.cxx$")
+      list(APPEND test_extra ${a})
+    else()
+      message(FATAL_ERROR "Unknown argument \"${a}\"")
+    endif()
+  endforeach()
+  get_property(vtk_test_cxx_sources DIRECTORY PROPERTY VTK_TEST_CXX_SOURCES)
+  create_test_sourcelist(Tests ${exe_name}.cxx ${vtk_test_cxx_sources}
+    EXTRA_INCLUDE ${test_driver})
+  vtk_module_test_executable(${exe_name} ${Tests} ${test_extra})
+endmacro()
+
+# -----------------------------------------------------------------------------
 # Usage: vtk_add_test_python(name [NO_RT] [NO_DATA] [NO_VALID|<base_dir>])
 # NO_RT is for tests using vtk.test.testing
 function(vtk_add_test_python name)


BUG: ITK_INCLUDE_DIR correction in otbIncludeDirectories.cmake for install configuration

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -372,10 +372,24 @@
 ELSE(OTB_USE_EXTERNAL_ITK)

     #Add prefix path "Utilities/ITK" For ITK_INCLUDE_RELATIVE_DIRS paths
-    FOREACH(DIR ${ITK_INCLUDE_RELATIVE_DIRS})
-        LIST(APPEND OTB_INCLUDE_RELATIVE_DIRS Utilities/ITK/${DIR})
-    ENDFOREACH(DIR)
-
+        SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
+              Utilities/ITK/Algorithms
+              Utilities/ITK/BasicFilters
+              Utilities/ITK/Common
+              Utilities/ITK/IO
+              Utilities/ITK/Numerics
+              Utilities/ITK/Numerics/FEM
+              Utilities/ITK/Numerics/NeuralNetworks
+              Utilities/ITK/Numerics/Statistics
+              Utilities/ITK/Patented
+              Utilities/ITK/Review
+              Utilities/ITK/SpatialObject
+              Utilities/ITK
+              Utilities/ITK/Utilities/vxl/v3p/netlib
+              Utilities/ITK/Utilities/vxl/vcl
+              Utilities/ITK/Utilities/vxl/core
+              Utilities/ITK/Utilities
+        )

 # JULIEN Seems that ITK_INCLUDE_DIRS_CONFIG replaces ITK_INCLUDE_DIRS_INSTALL_TREE
 #             SET(ITK_INCLUDE_DIRS  ${OTB_INSTALL_INCLUDE_DIR}/Utilities/ITK/)


remove qtwidgets dependency

remove qtwidgets dependency

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@1107 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCommon.cmake
+++ cmake/ACGCommon.cmake
@@ -213,12 +213,11 @@
       endif()
     endif(Qt5Core_FOUND AND WIN32)

-    find_package (Qt5Widgets QUIET)
     find_package (Qt5Gui QUIET)
     find_package (Qt5OpenGL QUIET)

-    if (Qt5Core_FOUND AND Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND)
+    if (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND)
       set (QT5_FOUND TRUE)
     endif()

@@ -251,11 +250,9 @@
       set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

       include_directories(${Qt5Core_INCLUDE_DIRS})
-      include_directories(${Qt5Widgets_INCLUDE_DIRS})
       include_directories(${Qt5Gui_INCLUDE_DIRS})
       include_directories(${Qt5OpenGL_INCLUDE_DIRS})
       add_definitions(${Qt5Core_DEFINITIONS})
-      add_definitions(${Qt5Widgets_DEFINITIONS})
       add_definitions(${Qt5Gui_DEFINITIONS})
       add_definitions(${Qt5OpenGL_DEFINITIONS})


speed up mvfst build by not building fizz test target

Summary:
When consuming fizz as an external target, it's wasteful to build test targets
of fizz.
This should fix the travis build timeout of mvfst in oss:
https://travis-ci.com/facebookincubator/mvfst/builds/114688200

Reviewed By: yangchi

Differential Revision: D15712260

fbshipit-source-id: 2c7c1262bb40962c169f5f922e1343e9ab27410e

--- cmake/BuildFizz.cmake
+++ cmake/BuildFizz.cmake
@@ -10,6 +10,7 @@
 list(APPEND CMAKE_ARGS
       -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
       -DCMAKE_PREFIX_PATH:STRING=${PREFIX_PATH}
+      -DBUILD_TESTS:STRING=OFF
 )
 if(UNIX AND APPLE)
   list(APPEND CMAKE_ARGS


Swap clang-tidy paths for HIP-Clang (#2284)

HIP-Clang requires to use its own updated clang-tidy from llvm-amdgpu installed to /opt/rocm/llvm. Luckily, HCC does not install llvm-amdgpu, so this should still work for HCC same as before.

--- cmake/ClangTidy.cmake
+++ cmake/ClangTidy.cmake
@@ -39,8 +39,8 @@
     PATH_SUFFIXES
         compiler/bin
     PATHS
+        /opt/rocm/llvm/bin
         /opt/rocm/hcc
-        /opt/rocm/llvm/bin
         /usr/local/opt/llvm/bin
 )


stop linking std::filesystem tests against libc++fs on clang 9

--- cmake/GhcHelper.cmake
+++ cmake/GhcHelper.cmake
@@ -7,14 +7,18 @@
     endif()
     add_executable(${targetName} ${ARGN})
     set_property(TARGET ${targetName} PROPERTY CXX_STANDARD 17)
-    if(APPLE)
-        target_link_libraries(${targetName} -lc++fs)
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
+        if(APPLE)
+            target_link_libraries(${targetName} -lc++fs)
+        else()
+            target_compile_options(${targetName} PRIVATE "-stdlib=libc++")
+            target_link_libraries(${targetName} -stdlib=libc++ -lc++fs)
+        endif()
     else()
-        target_compile_options(${targetName} PRIVATE "-stdlib=libc++")
-        target_link_libraries(${targetName} -stdlib=libc++ -lc++fs)
+        if(NOT APPLE)
+            target_link_libraries(${targetName} -stdlib=libc++)
+        endif()
     endif()
-
-    target_link_libraries(${targetName} -lc++fs)
     target_compile_definitions(${targetName} PRIVATE USE_STD_FS)
 endif()


turn off deprecation warning if glog needs so

Summary:
This addresses #162 for thatguymike
Closes https://github.com/caffe2/caffe2/pull/172

Differential Revision: D4620982

Pulled By: Yangqing

fbshipit-source-id: df3ef45f2c95418c538baa65d5dde3755cb25d1c

--- cmake/MiscCheck.cmake
+++ cmake/MiscCheck.cmake
@@ -36,8 +36,23 @@
   add_definitions(-DCAFFE2_NO_BUILTIN_CPU_SUPPORTS)
 endif()

+# Note(jiayq): on ubuntu 14.04, the default glog install uses ext/hash_set that
+# is being deprecated. As a result, we will test if this is the environment we
+# are building under. If yes, we will turn off deprecation warning for a
+# cleaner build output.
+CHECK_CXX_SOURCE_COMPILES(
+    "#include <glog/stl_logging.h>
+    int main(int argc, char** argv) {
+      return 0;
+    }" CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING
+    FAIL_REGEX ".*-Wno-deprecated.*")
+
+if(NOT CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING)
+  message(STATUS "Turning off deprecation warning due to glog.")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
+endif()
+
 # ---[ If we are using msvc, set no warning flags
 if (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
   message(STATUS "Adding no warning argument to the compiler")
-
-endif()+endif()


MDEV-5250 doesn't install on fedora if mysql is installed

when our package is to replace "mysql", it has both provide and obsolete it

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -127,6 +127,8 @@
 MACRO(ALTERNATIVE_NAME real alt)
   SET(p "CPACK_RPM_${real}_PACKAGE_PROVIDES")
   SET(${p} "${${p}} ${alt} ${alt}(x86-32) ${alt}(x86-64) config(${alt})")
+  SET(o "CPACK_RPM_${real}_PACKAGE_OBSOLETES")
+  SET(${o} "${${o}} ${alt}")
 ENDMACRO(ALTERNATIVE_NAME)

 IF(RPM MATCHES "(rhel|centos)5")


Bump to 1.2.1

Bump to 1.2.1

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(LIBREPO_MAJOR "1")
 SET(LIBREPO_MINOR "2")
-SET(LIBREPO_PATCH "0")
+SET(LIBREPO_PATCH "1")


removed -Werror

removed -Werror

--- cmake/EthCompilerSettings.cmake
+++ cmake/EthCompilerSettings.cmake
@@ -3,7 +3,7 @@
 # C++11 check and activation
 if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")

-	set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra -Werror -pedantic -DSHAREDLIB -fPIC ${CMAKE_CXX_FLAGS}")
+	set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra -pedantic -DSHAREDLIB -fPIC ${CMAKE_CXX_FLAGS}")
 	set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -DETH_DEBUG")
 	set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG -DETH_RELEASE")
 	set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG -DETH_RELEASE")


cmake: xerces fix include libraries

cmake: xerces fix include libraries

--- cmake/Modules/FindXercesC.cmake
+++ cmake/Modules/FindXercesC.cmake
@@ -86,7 +86,7 @@
   find_library(XercesC_LIBRARY_DEBUG
                NAMES "xerces-cd" "xerces-c_3D" "xerces-c_3_1D"
                DOC "Xerces-C++ libraries (debug)")
-  include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+  include(SelectLibraryConfigurations)
   select_library_configurations(XercesC)
   mark_as_advanced(XercesC_LIBRARY_RELEASE XercesC_LIBRARY_DEBUG)
 endif()
@@ -95,7 +95,7 @@
   _XercesC_GET_VERSION("${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp")
 endif()

-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(XercesC
                                   FOUND_VAR XercesC_FOUND
                                   REQUIRED_VARS XercesC_LIBRARY


better setup.py docs

better setup.py docs

--- cmake/catkin_python_setup.cmake
+++ cmake/catkin_python_setup.cmake
@@ -1,16 +1,17 @@
+# This macro will interrogate the Python setup.py file in
+# ``${${PROJECT_NAME}_SOURCE_DIR}``, and then creates forwarding
+# Python :term:`pkgutil` infrastructure in devel space
+# accordingly for the scripts and packages declared in setup.py.
 #
-# Creates forwarding Python :term:`pkgutil` infrastructure in
-# devel space that enables mixing :term:`generated code` in devel
-# space with :term:`static code` from sourcespace within a single
-# Python package.
+# Doing so enables mixing :term:`generated code` in
+# devel space with :term:`static code` from sourcespace within a
+# single Python package.
 #
-# In addition, this will interrogate the Python setup.py file in
-# ``${${PROJECT_NAME}_SOURCE_DIR}`` and add the install command of
+# In addition, it adds the install command of
 # distutils/setuputils to the install target.
-#
-# .. note:: If the project also uses message generation via
+#
+# .. note:: If the project also uses genmsg message generation via
 #   ``generate_messages()`` this function must be called before.
-#
 #
 # @public
 #


Adds ASM Language check to the celix_container_embedded_bundles cmake function

--- cmake/cmake_celix/Generic.cmake
+++ cmake/cmake_celix/Generic.cmake
@@ -95,6 +95,12 @@
 `celix_framework_utils_installEmbeddedBundles` (C) or `celix::installEmbeddedBundles` (C++).
 ]]
 function(celix_target_embedded_bundle)
+    get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+    if (NOT "ASM" IN_LIST LANGUAGES)
+        message(FATAL_ERROR "celix_target_embedded_bundle is only supported it the language ASM is enabled."
+         " Please add ASM as cmake project language.")
+    endif ()
+
     list(GET ARGN 0 TARGET_NAME)
     list(REMOVE_AT ARGN 0)


FIX: not all platforms has FIND_64 property

--- cmake/dependencies/docopt.cmake
+++ cmake/dependencies/docopt.cmake
@@ -47,10 +47,11 @@
 		)
 		add_dependencies(dependencies::docopt dependencies_docopt)
 		get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
-		if (${LIB64} STREQUAL "TRUE")
-			set(LIBSUFFIX 64)
-		else()
-			set(LIBSUFFIX "")
+		set(LIBSUFFIX "")
+		if (LIB64)
+			if (${LIB64} STREQUAL "TRUE")
+				set(LIBSUFFIX 64)
+			endif()
 		endif()
 		set(DOCOPT_INCLUDE_DIR "${STAGING_DIR}/include")
 		set(DOCOPT_LIBRARIES "${STAGING_DIR}/lib${LIBSUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}docopt${CMAKE_STATIC_LIBRARY_SUFFIX}")


Use post-build event for dmp() function

Use post-build event for dmp() function

--- cmake/distortos-utilities.cmake
+++ cmake/distortos-utilities.cmake
@@ -19,15 +19,14 @@
 endfunction()

 #
-# Dumps symbols from ELF file named `elfFilename` to file named `dmpFilename`.
+# Dumps symbols from output file of `target` to file named `dmpFilename`.
 #

-function(dmp elfFilename dmpFilename)
-	add_custom_command(OUTPUT ${dmpFilename}
-			COMMAND ${CMAKE_OBJDUMP} -x --syms --demangle ${elfFilename} > ${dmpFilename}
-			DEPENDS ${elfFilename}
-			USES_TERMINAL)
-	add_custom_target(${elfFilename}-to-${dmpFilename} ALL DEPENDS ${dmpFilename})
+function(dmp target dmpFilename)
+	add_custom_command(TARGET ${target} POST_BUILD
+			COMMAND ${CMAKE_OBJDUMP} -x --syms --demangle $<TARGET_FILE:${target}> > ${dmpFilename}
+			BYPRODUCTS ${dmpFilename}
+			VERBATIM)
 endfunction()

 #


Revert "Build workaround: only consider shims to be protected in Swift code on Darwin."

This reverts commit 3e20817f8cb4cb56fd30ccb6bf1648ad4e780377.  Now that we are
using gold, this should work.  The work around is only needed for BFD linkers.

--- cmake/modules/SwiftSource.cmake
+++ cmake/modules/SwiftSource.cmake
@@ -79,8 +79,7 @@
     # <rdar://problem/15972329>
     list(APPEND swift_compile_flags "-force-single-frontend-invocation")

-    # FIXME: Apply this on all platforms where the linker supports it.
-    if(SWIFTSOURCES_IS_STDLIB_CORE AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+    if(SWIFTSOURCES_IS_STDLIB_CORE)
       list(APPEND swift_compile_flags "-Xcc" "-D__SWIFT_CURRENT_DYLIB=swiftCore")
     endif()


Add automatic test suggested by Arjen to determine HAVE_TCL_GT_84.

svn path=/trunk/; revision=8129

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -59,12 +59,6 @@
   find_package(TCL)
   # Supplement those results with iTcl and iTk include paths and libraries.
   if(TCL_FOUND)
-    # FIXME.  Replace this user option (which they can set incorrectly) by
-    # the automatic determination of HAVE_TCL_GT_84.  What is needed is
-    # a CMake cross-platform test for Tcl version plus the appropriate
-    # CMake logic to determine HAVE_TCL_GT_84 from that version number.
-    option(HAVE_TCL_GT_84 "if Tcl version is greater than 8.4" OFF)
-    message(STATUS "HAVE_TCL_GT_84 = ${HAVE_TCL_GT_84}")
     message(STATUS
     "Looking for include paths and libraries for Tcl/Tk - found"
     )
@@ -72,9 +66,19 @@
     include(FindTclsh)
     if(TCL_TCLSH)
       message(STATUS "Looking for tclsh - found")
+      message(STATUS "TCL_TCLSH = ${TCL_TCLSH}")
+      # test to determine HAVE_TCL_GT_84
+      execute_process(
+      COMMAND ${TCL_TCLSH} CheckTCL_GT_84.tcl
+      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/modules
+      OUTPUT_VARIABLE HAVE_TCL_GT_84
+      )
     else(TCL_TCLSH)
       message(STATUS "Looking for tclsh - not found")
+      # Fall back to user option for determining HAVE_TCL_GT_84.
+      option(HAVE_TCL_GT_84 "if Tcl version is greater than 8.4" OFF)
     endif(TCL_TCLSH)
+    message(STATUS "HAVE_TCL_GT_84 = ${HAVE_TCL_GT_84}")
   else(TCL_FOUND)
     message(STATUS
     "Looking for include paths and libraries for Tcl/Tk - not found"


Added newline

Added newline

--- cmake/projects/ccv/hunter.cmake
+++ cmake/projects/ccv/hunter.cmake
@@ -38,6 +38,7 @@

+
 hunter_pick_scheme(DEFAULT url_sha1_cmake)

 hunter_download(PACKAGE_NAME ccv)


Removed Install of jar files for operating systems different from Windows.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -518,8 +518,10 @@
     ELSE (JAR_EXTERNAL AND NOT ZORBA_PACKAGE_EXTERNAL_JARS)
       # Copy jar to jars/ directory and add relative path to classpath file
       GET_FILENAME_COMPONENT (_output_filename "${_jar_file}" NAME)
-      ADD_COPY_RULE ("LIB" "${_jar_file}" "jars/${_output_filename}" ""
-	"${JAR_TARGET}" 1 "${JAR_TEST_ONLY}")
+      IF (WIN32)
+        ADD_COPY_RULE ("LIB" "${_jar_file}" "jars/${_output_filename}" ""
+	  "${JAR_TARGET}" 1 "${JAR_TEST_ONLY}")
+      ENDIF (WIN32)
       FILE (APPEND "${_CP_FILE}" "${_output_filename}\n")
     ENDIF (JAR_EXTERNAL AND NOT ZORBA_PACKAGE_EXTERNAL_JARS)


Corrected spaces; expanded comment.

Corrected spaces; expanded comment.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -118,7 +118,9 @@
 #              information; see below
 #       TEST_ONLY - (optional) Module is for testcases only and should not
 #              be installed
-#       LIBRARY_DEPENDS - (optional) List of targets the module depends on
+#       LIBRARY_DEPENDS - (optional) List of targets that the external
+#              function library will depend on (only works if the module
+#              contains C++ external functions)
 #
 # CONFIG_FILES - any files specific here will be copied to
 # CMAKE_CURRENT_BINARY_DIR using CONFIGURE_FILE(). They may contain
@@ -137,7 +139,7 @@
 # file enough to deduce the URI and version?
 MACRO (DECLARE_ZORBA_MODULE)
   # Parse and validate arguments
-  PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES LIBRARY_DEPENDS"
+  PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES;LIBRARY_DEPENDS"
     "URI;FILE;VERSION" "TEST_ONLY" ${ARGN})
   IF (NOT MODULE_FILE)
     MESSAGE (FATAL_ERROR "'FILE' argument is required for ZORBA_DECLARE_MODULE()")
@@ -269,8 +271,8 @@
     # the module *URI*'s final component.
     SET(module_lib_target "modlib${num_zorba_modules}_${module_name}")
     ADD_LIBRARY(${module_lib_target} SHARED ${SRC_FILES})
-    IF (MODULE LIBRARY_DEPENDS)
-      ADD_DEPENDENCIES(${module_lib_target} ${MODULE LIBRARY_DEPENDS})
+    IF (MODULE_LIBRARY_DEPENDS)
+      ADD_DEPENDENCIES(${module_lib_target} ${MODULE_LIBRARY_DEPENDS})
     ENDIF()
     GET_FILENAME_COMPONENT(module_filewe "${module_filename}" NAME_WE)
     IF (MODULE_VERSION)


New version: 0.4.13

New version: 0.4.13

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "12")
+SET(HAWKEY_PATCH "13")


Fixed rc.exe search even if arm64 is in the way

MegaMol is not for ARM at the moment, so that works. Maybe CMake gets a proper target arch variable at some time.

--- configurator/cmake/FindRC.cmake
+++ configurator/cmake/FindRC.cmake
@@ -26,7 +26,22 @@

 list(LENGTH RC_EXE_LIST length)
 if(${length} GREATER 0)
-  set(RC_FOUND TRUE)
-  list(GET RC_EXE_LIST 0 RC_EXE)
-  string(REGEX REPLACE "/" "\\\\" RC_EXE ${RC_EXE})
+  foreach(rc ${RC_EXE_LIST})
+    #message(INFO "trying ${rc}")
+    string(FIND ${rc} "x86" RC_OK86)
+    string(FIND ${rc} "x64" RC_OK64)
+    string(FIND ${rc} "arm64" RC_OKARM)
+    if ((${RC_OK86} GREATER -1) OR (${RC_OK64} GREATER -1) AND NOT (${RC_OKARM} GREATER -1))
+      set(RC_FOUND TRUE)
+      #list(GET RC_EXE_LIST 0 RC_EXE)
+      set(RC_EXE ${rc})
+      string(REGEX REPLACE "/" "\\\\" RC_EXE ${RC_EXE})
+      break()
+    else()
+    endif()
+  endforeach()
 endif()
+
+if (${RC_FOUND})
+  message(STATUS "Found resource compiler: ${RC_EXE}")
+endif()