Fixed android AddLLVM.cmake to work with new LLVM changes

Change-Id: Ibeba3ad310ea9c6a726f4ea8227bbef7dd80dd70
Reviewed-on: https://wn-project.dnsalias.net/31
Reviewed-by: awoloszyn <e2369e5718828207ec1ac01b275c8deeb7980580@gmail.com>
Tested-by: awoloszyn <e2369e5718828207ec1ac01b275c8deeb7980580@gmail.com>

--- Utilities/AddLLVM.cmake
+++ Utilities/AddLLVM.cmake
@@ -1,4 +1,4 @@
-#This is a slight modification to the GetHostTriple found in the LLVM
+#This is a slight modification to the AddLLVM found in the LLVM
 #source tree. The License is copied here in full.

 #==============================================================================
@@ -45,7 +45,6 @@
 #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
 #SOFTWARE.

-include(LLVMParseArguments)
 include(LLVMProcessSources)
 include(LLVM-Config)

@@ -131,25 +130,19 @@
       DEPENDS ${export_file}
       VERBATIM
       COMMENT "Creating export file for ${target_name}")
-    set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                 LINK_FLAGS "  -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+    if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+      set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                   LINK_FLAGS "  -Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+    else()
+      set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                   LINK_FLAGS "  -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+    endif()
   else()
     set(native_export_file "${target_name}.def")

-    set(CAT "cat")
-    set(export_file_nativeslashes ${export_file})
-    if(WIN32 AND NOT CYGWIN)
-      set(CAT "type")
-      # Convert ${export_file} to native format (backslashes) for "type"
-      # Does not use file(TO_NATIVE_PATH) as it doesn't create a native
-      # path but a build-system specific format (see CMake bug
-      # http://public.kitware.com/Bug/print_bug_page.php?bug_id=5939 )
-      string(REPLACE / \\ export_file_nativeslashes ${export_file})
-    endif()
-
     add_custom_command(OUTPUT ${native_export_file}
-      COMMAND ${CMAKE_COMMAND} -E echo "EXPORTS" > ${native_export_file}
-      COMMAND ${CAT} ${export_file_nativeslashes} >> ${native_export_file}
+      COMMAND ${PYTHON_EXECUTABLE} -c "import sys;print(''.join(['EXPORTS\\n']+sys.stdin.readlines(),))"
+        < ${export_file} > ${native_export_file}
       DEPENDS ${export_file}
       VERBATIM
       COMMENT "Creating export file for ${target_name}")
@@ -211,7 +204,7 @@

     # Pass -O3 to the linker. This enabled different optimizations on different
     # linkers.
-    if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32))
+    if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|SunOS" OR WIN32))
       set_property(TARGET ${target_name} APPEND_STRING PROPERTY
                    LINK_FLAGS " -Wl,-O3")
     endif()
@@ -229,6 +222,9 @@
         # ld64's implementation of -dead_strip breaks tools that use plugins.
         set_property(TARGET ${target_name} APPEND_STRING PROPERTY
                      LINK_FLAGS " -Wl,-dead_strip")
+      elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+        set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                     LINK_FLAGS " -Wl,-z -Wl,discard-unused=sections")
       elseif(NOT WIN32 AND NOT LLVM_LINKER_IS_GOLD)
         # Object files are compiled with -ffunction-data-sections.
         # Versions of bfd ld < 2.23.1 have a bug in --gc-sections that breaks
@@ -274,6 +270,78 @@
     set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${moddir})
   endif()
 endfunction()
+
+# If on Windows and building with MSVC, add the resource script containing the
+# VERSIONINFO data to the project.  This embeds version resource information
+# into the output .exe or .dll.
+# TODO: Enable for MinGW Windows builds too.
+#
+function(add_windows_version_resource_file OUT_VAR)
+  set(sources ${ARGN})
+  if (MSVC)
+    set(resource_file ${LLVM_SOURCE_DIR}/resources/windows_version_resource.rc)
+    if(EXISTS ${resource_file})
+      set(sources ${sources} ${resource_file})
+      source_group("Resource Files" ${resource_file})
+      set(windows_resource_file ${resource_file} PARENT_SCOPE)
+    endif()
+  endif(MSVC)
+
+  set(${OUT_VAR} ${sources} PARENT_SCOPE)
+endfunction(add_windows_version_resource_file)
+
+# set_windows_version_resource_properties(name resource_file...
+#   VERSION_MAJOR int
+#     Optional major version number (defaults to LLVM_VERSION_MAJOR)
+#   VERSION_MINOR int
+#     Optional minor version number (defaults to LLVM_VERSION_MINOR)
+#   VERSION_PATCHLEVEL int
+#     Optional patchlevel version number (defaults to LLVM_VERSION_PATCH)
+#   VERSION_STRING
+#     Optional version string (defaults to PACKAGE_VERSION)
+#   PRODUCT_NAME
+#     Optional product name string (defaults to "LLVM")
+#   )
+function(set_windows_version_resource_properties name resource_file)
+  cmake_parse_arguments(ARG
+    ""
+    "VERSION_MAJOR;VERSION_MINOR;VERSION_PATCHLEVEL;VERSION_STRING;PRODUCT_NAME"
+    ""
+    ${ARGN})
+
+  if (NOT DEFINED ARG_VERSION_MAJOR)
+    set(ARG_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
+  endif()
+
+  if (NOT DEFINED ARG_VERSION_MINOR)
+    set(ARG_VERSION_MINOR ${LLVM_VERSION_MINOR})
+  endif()
+
+  if (NOT DEFINED ARG_VERSION_PATCHLEVEL)
+    set(ARG_VERSION_PATCHLEVEL ${LLVM_VERSION_PATCH})
+  endif()
+
+  if (NOT DEFINED ARG_VERSION_STRING)
+    set(ARG_VERSION_STRING ${PACKAGE_VERSION})
+  endif()
+
+  if (NOT DEFINED ARG_PRODUCT_NAME)
+    set(ARG_PRODUCT_NAME "LLVM")
+  endif()
+
+  set_property(SOURCE ${resource_file}
+               PROPERTY COMPILE_FLAGS /nologo)
+  set_property(SOURCE ${resource_file}
+               PROPERTY COMPILE_DEFINITIONS
+               "RC_VERSION_FIELD_1=${ARG_VERSION_MAJOR}"
+               "RC_VERSION_FIELD_2=${ARG_VERSION_MINOR}"
+               "RC_VERSION_FIELD_3=${ARG_VERSION_PATCHLEVEL}"
+               "RC_VERSION_FIELD_4=0"
+               "RC_FILE_VERSION=\"${ARG_VERSION_STRING}\""
+               "RC_INTERNAL_NAME=\"${name}\""
+               "RC_PRODUCT_NAME=\"${ARG_PRODUCT_NAME}\""
+               "RC_PRODUCT_VERSION=\"${ARG_VERSION_STRING}\"")
+endfunction(set_windows_version_resource_properties)

 # llvm_add_library(name sources...
 #   SHARED;STATIC
@@ -363,10 +431,17 @@
   if(ARG_MODULE)
     add_library(${name} MODULE ${ALL_FILES})
   elseif(ARG_SHARED)
+    add_windows_version_resource_file(ALL_FILES ${ALL_FILES})
     add_library(${name} SHARED ${ALL_FILES})
   else()
     add_library(${name} STATIC ${ALL_FILES})
   endif()
+
+  if(DEFINED windows_resource_file)
+    set_windows_version_resource_properties(${name} ${windows_resource_file})
+    set(windows_resource_file ${windows_resource_file} PARENT_SCOPE)
+  endif()
+
   set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
   llvm_update_compile_flags(${name})
   add_link_opts( ${name} )
@@ -465,11 +540,17 @@
     else()
       llvm_add_library(${name} ${ARGN})
     endif()
-    set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} )
+    # The gtest libraries should not be installed or exported as a target
+    if ("${name}" STREQUAL gtest OR "${name}" STREQUAL gtest_main)
+      set(_is_gtest TRUE)
+    else()
+      set(_is_gtest FALSE)
+      set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} )
+    endif()

     if( EXCLUDE_FROM_ALL )
       set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
-    else()
+    elseif(NOT _is_gtest)
       if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO")
         if(ARG_SHARED OR BUILD_SHARED_LIBS)
           if(WIN32 OR CYGWIN)
@@ -497,7 +578,7 @@
       set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
     endif()
     set_target_properties(${name} PROPERTIES FOLDER "Libraries")
-   endif()
+  endif()
 endmacro(add_llvm_library name)

 macro(add_llvm_loadable_module name)
@@ -531,11 +612,18 @@

 macro(add_llvm_executable name)
   llvm_process_sources( ALL_FILES ${ARGN} )
+  add_windows_version_resource_file(ALL_FILES ${ALL_FILES})
+
   if( EXCLUDE_FROM_ALL )
     add_executable(${name} EXCLUDE_FROM_ALL ${ALL_FILES})
   else()
     add_executable(${name} ${ALL_FILES})
   endif()
+
+  if(DEFINED windows_resource_file)
+    set_windows_version_resource_properties(${name} ${windows_resource_file})
+  endif()
+
   llvm_update_compile_flags(${name})
   add_link_opts( ${name} )

@@ -650,10 +738,18 @@
   list(APPEND LLVM_IMPLICIT_PROJECT_IGNORE "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
   string(REPLACE "-" "_" nameUNDERSCORE ${name})
   string(TOUPPER ${nameUNDERSCORE} nameUPPER)
-  set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}"
-      CACHE PATH "Path to ${name} source directory")
-  if (NOT ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} STREQUAL ""
-      AND EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}/CMakeLists.txt)
+  #TODO: Remove this check in a few days once it has circulated through
+  # buildbots and people's checkouts (cbieneman - July 14, 2015)
+  if("${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
+    unset(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR CACHE)
+  endif()
+  if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR)
+    set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
+  else()
+    set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR
+        CACHE PATH "Path to ${name} source directory")
+  endif()
+  if (EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}/CMakeLists.txt)
     option(LLVM_EXTERNAL_${nameUPPER}_BUILD
            "Whether to build ${name} as part of LLVM" ON)
     if (LLVM_EXTERNAL_${nameUPPER}_BUILD)
@@ -809,7 +905,7 @@
 # A raw function to create a lit target. This is used to implement the testuite
 # management functions.
 function(add_lit_target target comment)
-  parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
+  cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
   set(LIT_ARGS "${ARG_ARGS} ${LLVM_LIT_ARGS}")
   separate_arguments(LIT_ARGS)
   if (NOT CMAKE_CFG_INTDIR STREQUAL ".")
@@ -824,9 +920,9 @@
   foreach(param ${ARG_PARAMS})
     list(APPEND LIT_COMMAND --param ${param})
   endforeach()
-  if (ARG_DEFAULT_ARGS)
+  if (ARG_UNPARSED_ARGUMENTS)
     add_custom_target(${target}
-      COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS}
+      COMMAND ${LIT_COMMAND} ${ARG_UNPARSED_ARGUMENTS}
       COMMENT "${comment}"
       ${cmake_3_2_USES_TERMINAL}
       )
@@ -845,12 +941,12 @@

 # A function to add a set of lit test suites to be driven through 'check-*' targets.
 function(add_lit_testsuite target comment)
-  parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
+  cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})

   # EXCLUDE_FROM_ALL excludes the test ${target} out of check-all.
   if(NOT EXCLUDE_FROM_ALL)
     # Register the testsuites, params and depends for the global check rule.
-    set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${ARG_DEFAULT_ARGS})
+    set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${ARG_UNPARSED_ARGUMENTS})
     set_property(GLOBAL APPEND PROPERTY LLVM_LIT_PARAMS ${ARG_PARAMS})
     set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS})
     set_property(GLOBAL APPEND PROPERTY LLVM_LIT_EXTRA_ARGS ${ARG_ARGS})
@@ -858,7 +954,7 @@

   # Produce a specific suffixed check rule.
   add_lit_target(${target} ${comment}
-    ${ARG_DEFAULT_ARGS}
+    ${ARG_UNPARSED_ARGUMENTS}
     PARAMS ${ARG_PARAMS}
     DEPENDS ${ARG_DEPENDS}
     ARGS ${ARG_ARGS}
@@ -867,7 +963,7 @@

 function(add_lit_testsuites project directory)
   if (NOT CMAKE_CONFIGURATION_TYPES)
-    parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
+    cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
     file(GLOB_RECURSE litCfg ${directory}/lit*.cfg)
     set(lit_suites)
     foreach(f ${litCfg})


Separate suffix for -dev psttfc or psttf.

svn path=/trunk/; revision=6892

--- test/plplot-test.sh.cmake
+++ test/plplot-test.sh.cmake
@@ -153,8 +153,13 @@
 fe=""

 case "$device" in
-   ps|psc|psttf|psttfc)
+   ps|psc)
       dsuffix=ps
+      options=
+      export dsuffix options
+      ;;
+   psttf|psttfc)
+      dsuffix=psttf
       options=
       export dsuffix options
       ;;


removing modules from blacklist

removing modules from blacklist

--- modules/python/common.cmake
+++ modules/python/common.cmake
@@ -14,15 +14,7 @@

 # module blacklist
 ocv_list_filterout(candidate_deps "^opencv_cud(a|ev)")
-ocv_list_filterout(candidate_deps "^opencv_adas$")
-ocv_list_filterout(candidate_deps "^opencv_face$")
 ocv_list_filterout(candidate_deps "^opencv_matlab$")
-ocv_list_filterout(candidate_deps "^opencv_tracking$")
-ocv_list_filterout(candidate_deps "^opencv_optflow$")
-ocv_list_filterout(candidate_deps "^opencv_bgsegm$")
-ocv_list_filterout(candidate_deps "^opencv_xfeatures2d$")
-ocv_list_filterout(candidate_deps "^opencv_ximgproc$")
-ocv_list_filterout(candidate_deps "^opencv_xphoto$")
 ocv_list_filterout(candidate_deps "^opencv_ts$")

 ocv_add_module(${MODULE_NAME} BINDINGS OPTIONAL ${candidate_deps})
@@ -43,7 +35,6 @@
 ocv_list_filterout(opencv_hdrs "cuda")
 ocv_list_filterout(opencv_hdrs "cudev")
 ocv_list_filterout(opencv_hdrs "opencv2/objdetect/detection_based_tracker.hpp")
-ocv_list_filterout(opencv_hdrs "opencv2/optim.hpp")

 set(cv2_generated_hdrs
     "${CMAKE_CURRENT_BINARY_DIR}/pyopencv_generated_include.h"


fix(CMake/MSVC): Cleanup and enable some warnings (#10295)

* fix(CMake/MSVC): Cleanup and enable some warnings

* cherry-pick from commit (https://github.com/TrinityCore/TrinityCore/commit/73b4b1733a49430b2288417d26f96c24a19c8c28)

Co-Authored-By: Shauren <e992da2f52a2ceaa4f3fc83863889185dc66f7df@gmail.com>

* Update settings.cmake

Co-authored-by: Shauren <e992da2f52a2ceaa4f3fc83863889185dc66f7df@gmail.com>

--- src/cmake/compiler/msvc/settings.cmake
+++ src/cmake/compiler/msvc/settings.cmake
@@ -101,61 +101,53 @@
     -D__STDC_LIMIT_MACROS)
 message(STATUS "MSVC: Disabled INTMAX_MAX warnings")

-# disable warnings in Visual Studio 8 and above if not wanted
+# Ignore specific warnings
+target_compile_options(acore-compile-option-interface
+  INTERFACE
+    /wd4351  # C4351: new behavior: elements of array 'x' will be default initialized
+    /wd4091) # C4091: 'typedef ': ignored on left of '' when no variable is declared
+
 if(NOT WITH_WARNINGS)
-  if(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
   target_compile_options(acore-warning-interface
     INTERFACE
-      /wd4996
-      /wd4355
-      /wd4244
-      /wd4985
-      /wd4267
-      /wd4619
-      # /wd4512
-      )
-    message(STATUS "MSVC: Disabled generic compiletime warnings")
-  endif()
+      /wd4996  # C4996 deprecation
+      /wd4985  # C4985 'symbol-name': attributes not present on previous declaration.
+      /wd4244  # C4244 'argument' : conversion from 'type1' to 'type2', possible loss of data
+      /wd4267  # C4267 'var' : conversion from 'size_t' to 'type', possible loss of data
+      /wd4619  # C4619 #pragma warning : there is no warning number 'number'
+      /wd4512) # C4512 'class' : assignment operator could not be generated
+
+  message(STATUS "MSVC: Disabled generic compiletime warnings")
 endif()

-# Ignore specific warnings
-# C4351: new behavior: elements of array 'x' will be default initialized
-# C4091: 'typedef ': ignored on left of '' when no variable is declared
+# Move some warnings that are enabled for other compilers from level 4 to level 3
 target_compile_options(acore-compile-option-interface
   INTERFACE
-    /wd4351
-    /wd4091)
-
-# Specify the maximum PreCompiled Header memory allocation limit
-# Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies)
-# (And yes, this is a verified , unresolved bug with MSVC... *sigh*)
-string(REGEX REPLACE "/Zm[0-9]+ *" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500")
-
-# Enable and treat as errors the following warnings to easily detect virtual function signature failures:
-# 'function' : member function does not override any base class virtual member function
-# 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden
-target_compile_options(acore-warning-interface
-  INTERFACE
-    /we4263
-    /we4264)
+    /w34100  # C4100 'identifier' : unreferenced formal parameter
+    /w34101  # C4101: 'identifier' : unreferenced local variable
+    /w34189  # C4189: 'identifier' : local variable is initialized but not referenced
+    /w34389) # C4189: 'equality-operator' : signed/unsigned mismatch

 if(BUILD_SHARED_LIBS)
-  # C4251: needs to have dll-interface to be used by clients of class '...'
-  # C4275: non dll-interface class ...' used as base for dll-interface class '...'
   target_compile_options(acore-compile-option-interface
     INTERFACE
-      /wd4251
-      /wd4275)
+      /wd4251  # C4251: needs to have dll-interface to be used by clients of class '...'
+      /wd4275) # C4275: non dll-interface class ...' used as base for dll-interface class '...'

   message(STATUS "MSVC: Enabled shared linking")
 endif()

+# Enable and treat as errors the following warnings to easily detect virtual function signature failures:
+target_compile_options(acore-warning-interface
+  INTERFACE
+    /we4263  # 'function' : member function does not override any base class virtual member function
+    /we4264) # 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden
+
 # Disable incremental linking in debug builds.
 # To prevent linking getting stuck (which might be fixed in a later VS version).
 macro(DisableIncrementalLinking variable)
-string(REGEX REPLACE "/INCREMENTAL *" "" ${variable} "${${variable}}")
-set(${variable} "${${variable}} /INCREMENTAL:NO")
+  string(REGEX REPLACE "/INCREMENTAL *" "" ${variable} "${${variable}}")
+  set(${variable} "${${variable}} /INCREMENTAL:NO")
 endmacro()

 DisableIncrementalLinking(CMAKE_EXE_LINKER_FLAGS_DEBUG)


Added boxen search path.

Added boxen search path.

--- FindOpenSG.cmake
+++ FindOpenSG.cmake
@@ -38,7 +38,7 @@
 			-DOSG_WITH_JPG
 		)
 		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4231 /wd4275")
-        ADD_DEFINITIONS(/W1)
+		ADD_DEFINITIONS(/W1)
 	ENDIF (MSVC)
 	TARGET_LINK_LIBRARIES( ${targetName} ${OpenSG_LIBRARIES} )
 	INCLUDE_DIRECTORIES( ${OpenSG_INCLUDE_DIRS} )
@@ -46,14 +46,14 @@

 SET(__OpenSG_IN_CACHE TRUE)
 IF(OpenSG_INCLUDE_DIR)
-    FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
-        STRING(TOUPPER ${COMPONENT} COMPONENT)
-        IF(NOT OpenSG_${COMPONENT}_FOUND)
-            SET(__OpenSG_IN_CACHE FALSE)
-        ENDIF(NOT OpenSG_${COMPONENT}_FOUND)
-    ENDFOREACH(COMPONENT)
+	FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
+		STRING(TOUPPER ${COMPONENT} COMPONENT)
+		IF(NOT OpenSG_${COMPONENT}_FOUND)
+			SET(__OpenSG_IN_CACHE FALSE)
+		ENDIF(NOT OpenSG_${COMPONENT}_FOUND)
+	ENDFOREACH(COMPONENT)
 ELSE(OpenSG_INCLUDE_DIR)
-    SET(__OpenSG_IN_CACHE FALSE)
+	SET(__OpenSG_IN_CACHE FALSE)
 ENDIF(OpenSG_INCLUDE_DIR)

@@ -73,257 +73,261 @@
 #########################################################################

 MACRO(__OpenSG_ADJUST_LIB_VARS basename)
-    IF(OpenSG_INCLUDE_DIR)
-        IF(OpenSG_${basename}_LIBRARY_DEBUG AND OpenSG_${basename}_LIBRARY_RELEASE)
-        # if the generator supports configuration types then set
-        # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
-            IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
-                SET(OpenSG_${basename}_LIBRARY optimized ${OpenSG_${basename}_LIBRARY_RELEASE} debug ${OpenSG_${basename}_LIBRARY_DEBUG})
-            ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
-                # if there are no configuration types and CMAKE_BUILD_TYPE has no value
-                # then just use the release libraries
-                SET(OpenSG_${basename}_LIBRARY ${OpenSG_${basename}_LIBRARY_RELEASE} )
-            ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
-
-            SET(OpenSG_${basename}_LIBRARIES optimized ${OpenSG_${basename}_LIBRARY_RELEASE} debug ${OpenSG_${basename}_LIBRARY_DEBUG})
-        ENDIF(OpenSG_${basename}_LIBRARY_DEBUG AND OpenSG_${basename}_LIBRARY_RELEASE)
-
-        # if only the release version was found, set the debug variable also to the release version
-        IF(OpenSG_${basename}_LIBRARY_RELEASE AND NOT OpenSG_${basename}_LIBRARY_DEBUG)
-            SET(OpenSG_${basename}_LIBRARY_DEBUG ${OpenSG_${basename}_LIBRARY_RELEASE})
-            SET(OpenSG_${basename}_LIBRARY       ${OpenSG_${basename}_LIBRARY_RELEASE})
-            SET(OpenSG_${basename}_LIBRARIES     ${OpenSG_${basename}_LIBRARY_RELEASE})
-        ENDIF(OpenSG_${basename}_LIBRARY_RELEASE AND NOT OpenSG_${basename}_LIBRARY_DEBUG)
-
-        # if only the debug version was found, set the release variable also to the debug version
-        IF(OpenSG_${basename}_LIBRARY_DEBUG AND NOT OpenSG_${basename}_LIBRARY_RELEASE)
-            SET(OpenSG_${basename}_LIBRARY_RELEASE ${OpenSG_${basename}_LIBRARY_DEBUG})
-            SET(OpenSG_${basename}_LIBRARY         ${OpenSG_${basename}_LIBRARY_DEBUG})
-            SET(OpenSG_${basename}_LIBRARIES       ${OpenSG_${basename}_LIBRARY_DEBUG})
-        ENDIF(OpenSG_${basename}_LIBRARY_DEBUG AND NOT OpenSG_${basename}_LIBRARY_RELEASE)
-
-        IF(OpenSG_${basename}_LIBRARY)
-            SET(OpenSG_${basename}_LIBRARY ${OpenSG_${basename}_LIBRARY} CACHE FILEPATH "The OpenSG ${basename} library")
-            GET_FILENAME_COMPONENT(OpenSG_LIBRARY_DIRS "${OpenSG_${basename}_LIBRARY}" PATH)
-            SET(OpenSG_LIBRARY_DIRS ${OpenSG_LIBRARY_DIRS} CACHE FILEPATH "OpenSG library directory")
-            SET(OpenSG_${basename}_FOUND ON CACHE INTERNAL "Whether the OpenSG ${basename} library found")
-        ENDIF(OpenSG_${basename}_LIBRARY)
-
-    ENDIF(OpenSG_INCLUDE_DIR)
-
-    # Make variables changeble to the advanced user
-    MARK_AS_ADVANCED(
-        OpenSG_${basename}_LIBRARY
-        OpenSG_${basename}_LIBRARY_RELEASE
-        OpenSG_${basename}_LIBRARY_DEBUG
-    )
+	IF(OpenSG_INCLUDE_DIR)
+		IF(OpenSG_${basename}_LIBRARY_DEBUG AND OpenSG_${basename}_LIBRARY_RELEASE)
+		# if the generator supports configuration types then set
+		# optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
+			IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+				SET(OpenSG_${basename}_LIBRARY optimized ${OpenSG_${basename}_LIBRARY_RELEASE} debug ${OpenSG_${basename}_LIBRARY_DEBUG})
+			ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+				# if there are no configuration types and CMAKE_BUILD_TYPE has no value
+				# then just use the release libraries
+				SET(OpenSG_${basename}_LIBRARY ${OpenSG_${basename}_LIBRARY_RELEASE} )
+			ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+
+			SET(OpenSG_${basename}_LIBRARIES optimized ${OpenSG_${basename}_LIBRARY_RELEASE} debug ${OpenSG_${basename}_LIBRARY_DEBUG})
+		ENDIF(OpenSG_${basename}_LIBRARY_DEBUG AND OpenSG_${basename}_LIBRARY_RELEASE)
+
+		# if only the release version was found, set the debug variable also to the release version
+		IF(OpenSG_${basename}_LIBRARY_RELEASE AND NOT OpenSG_${basename}_LIBRARY_DEBUG)
+			SET(OpenSG_${basename}_LIBRARY_DEBUG ${OpenSG_${basename}_LIBRARY_RELEASE})
+			SET(OpenSG_${basename}_LIBRARY       ${OpenSG_${basename}_LIBRARY_RELEASE})
+			SET(OpenSG_${basename}_LIBRARIES     ${OpenSG_${basename}_LIBRARY_RELEASE})
+		ENDIF(OpenSG_${basename}_LIBRARY_RELEASE AND NOT OpenSG_${basename}_LIBRARY_DEBUG)
+
+		# if only the debug version was found, set the release variable also to the debug version
+		IF(OpenSG_${basename}_LIBRARY_DEBUG AND NOT OpenSG_${basename}_LIBRARY_RELEASE)
+			SET(OpenSG_${basename}_LIBRARY_RELEASE ${OpenSG_${basename}_LIBRARY_DEBUG})
+			SET(OpenSG_${basename}_LIBRARY         ${OpenSG_${basename}_LIBRARY_DEBUG})
+			SET(OpenSG_${basename}_LIBRARIES       ${OpenSG_${basename}_LIBRARY_DEBUG})
+		ENDIF(OpenSG_${basename}_LIBRARY_DEBUG AND NOT OpenSG_${basename}_LIBRARY_RELEASE)
+
+		IF(OpenSG_${basename}_LIBRARY)
+			SET(OpenSG_${basename}_LIBRARY ${OpenSG_${basename}_LIBRARY} CACHE FILEPATH "The OpenSG ${basename} library")
+			GET_FILENAME_COMPONENT(OpenSG_LIBRARY_DIRS "${OpenSG_${basename}_LIBRARY}" PATH)
+			SET(OpenSG_LIBRARY_DIRS ${OpenSG_LIBRARY_DIRS} CACHE FILEPATH "OpenSG library directory")
+			SET(OpenSG_${basename}_FOUND ON CACHE INTERNAL "Whether the OpenSG ${basename} library found")
+		ENDIF(OpenSG_${basename}_LIBRARY)
+
+	ENDIF(OpenSG_INCLUDE_DIR)
+
+	# Make variables changeble to the advanced user
+	MARK_AS_ADVANCED(
+		OpenSG_${basename}_LIBRARY
+		OpenSG_${basename}_LIBRARY_RELEASE
+		OpenSG_${basename}_LIBRARY_DEBUG
+	)
 ENDMACRO(__OpenSG_ADJUST_LIB_VARS)

 #-------------------------------------------------------------------------------

 IF(__OpenSG_IN_CACHE)
-    # values are already in the cache
-
-    SET(OpenSG_FOUND TRUE)
-    FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
-        STRING(TOUPPER ${COMPONENT} COMPONENT)
-        __OpenSG_ADJUST_LIB_VARS(${COMPONENT})
-        SET(OpenSG_LIBRARIES ${OpenSG_LIBRARIES} ${OpenSG_${COMPONENT}_LIBRARY})
-    ENDFOREACH(COMPONENT)
-
-    SET(OpenSG_INCLUDE_DIRS "${OpenSG_INCLUDE_DIR}" "${OpenSG_INCLUDE_DIR}/OpenSG")
+	# values are already in the cache
+
+	SET(OpenSG_FOUND TRUE)
+	FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
+		STRING(TOUPPER ${COMPONENT} COMPONENT)
+		__OpenSG_ADJUST_LIB_VARS(${COMPONENT})
+		SET(OpenSG_LIBRARIES ${OpenSG_LIBRARIES} ${OpenSG_${COMPONENT}_LIBRARY})
+	ENDFOREACH(COMPONENT)
+
+	SET(OpenSG_INCLUDE_DIRS "${OpenSG_INCLUDE_DIR}" "${OpenSG_INCLUDE_DIR}/OpenSG")

 ELSE(__OpenSG_IN_CACHE)
-    # need to search for libs
+	# need to search for libs

 	# Visual Studio x32
 	if (VS32)
 	  # Visual Studio x32
 	  SET( __OpenSG_INCLUDE_SEARCH_DIRS
-	    $ENV{OPENSG_ROOT}/include
-	    ${OPENSG_ROOT}/include
-	    ${LIBRARIES_DIR}/opensg/include
-	    ${CMAKE_SOURCE_DIR}/../OpenSG/include )
+		$ENV{OPENSG_ROOT}/include
+		${OPENSG_ROOT}/include
+		${LIBRARIES_DIR}/opensg/include
+		${CMAKE_SOURCE_DIR}/../OpenSG/include )
 	  SET( __OpenSG_LIBRARIES_SEARCH_DIRS
-	    $ENV{OPENSG_ROOT}/lib
-	    ${OPENSG_ROOT}/lib
-	    ${LIBRARIES_DIR}/opensg/lib
-	    ${CMAKE_SOURCE_DIR}/../opensg/lib )
-	else (VS32)
-	  if (VS64)
-	    # Visual Studio x64
+		$ENV{OPENSG_ROOT}/lib
+		${OPENSG_ROOT}/lib
+		${LIBRARIES_DIR}/opensg/lib
+		${CMAKE_SOURCE_DIR}/../opensg/lib )
+	else (VS32)
+	  if (VS64)
+		# Visual Studio x64
 		SET( __OpenSG_INCLUDE_SEARCH_DIRS
 		$ENV{OPENSG_ROOT}/include
 		${OPENSG_ROOT}/include
-	      ${LIBRARIES_DIR}/opensg_x64/include
-	      ${CMAKE_SOURCE_DIR}/../opensg_x64/include )
+		  ${LIBRARIES_DIR}/opensg_x64/include
+		  ${CMAKE_SOURCE_DIR}/../opensg_x64/include )
 		SET( __OpenSG_LIBRARIES_SEARCH_DIRS
 		$ENV{OPENSG_ROOT}/lib
 		${OPENSG_ROOT}/lib
-	      ${LIBRARIES_DIR}/opensg_x64/lib
-	      ${CMAKE_SOURCE_DIR}/../opensg_x64/lib )
-	  else (VS64)
-	    # Linux or Mac
+		  ${LIBRARIES_DIR}/opensg_x64/lib
+		  ${CMAKE_SOURCE_DIR}/../opensg_x64/lib )
+	  else (VS64)
+		# Linux or Mac
 		SET( __OpenSG_INCLUDE_SEARCH_DIRS
-          "/usr/local"
-	      "/usr/local/include" )
+		  "/usr/local"
+		  "/usr/local/include"
+		  "/opt/boxen/homebrew"
+		  "/opt/boxen/homebrew/include" )
 		SET( __OpenSG_LIBRARIES_SEARCH_DIRS
-	      "/usr/local"
-	      "/usr/local/lib" )
+		  "/usr/local"
+		  "/usr/local/lib"
+		  "/opt/boxen/homebrew"
+		  "/opt/boxen/homebrew/lib" )
 	  endif(VS64)
 	endif (VS32)
-
-
-    # handle input variable OPENSG_INCLUDE_DIR
-    IF(OPENSG_INCLUDE_DIR)
-        FILE(TO_CMAKE_PATH ${OPENSG_INCLUDE_DIR} OPENSG_INCLUDE_DIR)
-        SET(__OpenSG_INCLUDE_SEARCH_DIRS
-            ${OPENSG_INCLUDE_DIR} ${__OpenSG_INCLUDE_SEARCH_DIRS})
-    ENDIF(OPENSG_INCLUDE_DIR)
-
-    # handle input variable OPENSG_LIBRARY_DIR
-    IF(OPENSG_LIBRARY_DIR)
-        FILE(TO_CMAKE_PATH ${OPENSG_LIBRARY_DIR} OPENSG_LIBRARY_DIR)
-        SET(__OpenSG_LIBRARIES_SEARCH_DIRS
-            ${OPENSG_LIBRARY_DIR} ${__OpenSG_LIBRARIES_SEARCH_DIRS})
-    ENDIF(OPENSG_LIBRARY_DIR)
-
-    # handle input variable OPENSG_INCLUDE_SEARCH_DIR
-    IF(OPENSG_INCLUDE_SEARCH_DIR)
-        FILE(TO_CMAKE_PATH ${OPENSG_INCLUDE_SEARCH_DIR} OPENSG_INCLUDE_SEARCH_DIR)
-        SET(__OpenSG_INCLUDE_SEARCH_DIRS
-            ${OPENSG_INCLUDE_SEARCH_DIR} ${__OpenSG_INCLUDE_SEARCH_DIRS})
-    ENDIF(OPENSG_INCLUDE_SEARCH_DIR)
-
-    # handle input variable OPENSG_LIBRARY_SEARCH_DIR
-    IF(OPENSG_LIBRARY_SEARCH_DIR)
-        FILE(TO_CMAKE_PATH ${OPENSG_LIBRARY_SEARCH_DIR} OPENSG_LIBRARY_SEARCH_DIR)
-        SET(__OpenSG_LIBRARIES_SEARCH_DIRS
-            ${OPENSG_LIBRARY_SEARCH_DIR} ${__OpenSG_LIBRARIES_SEARCH_DIRS})
-    ENDIF(OPENSG_LIBRARY_SEARCH_DIR)
-
-    IF(NOT OpenSG_INCLUDE_DIR)
-        # try to find include dirrectory by searching for OSGConfigured.h
-        FIND_PATH(OpenSG_INCLUDE_DIR
-            NAMES         OpenSG/OSGConfigured.h
-            HINTS         ${__OpenSG_INCLUDE_SEARCH_DIRS})
-    ENDIF(NOT OpenSG_INCLUDE_DIR)
+
+
+	# handle input variable OPENSG_INCLUDE_DIR
+	IF(OPENSG_INCLUDE_DIR)
+		FILE(TO_CMAKE_PATH ${OPENSG_INCLUDE_DIR} OPENSG_INCLUDE_DIR)
+		SET(__OpenSG_INCLUDE_SEARCH_DIRS
+			${OPENSG_INCLUDE_DIR} ${__OpenSG_INCLUDE_SEARCH_DIRS})
+	ENDIF(OPENSG_INCLUDE_DIR)
+
+	# handle input variable OPENSG_LIBRARY_DIR
+	IF(OPENSG_LIBRARY_DIR)
+		FILE(TO_CMAKE_PATH ${OPENSG_LIBRARY_DIR} OPENSG_LIBRARY_DIR)
+		SET(__OpenSG_LIBRARIES_SEARCH_DIRS
+			${OPENSG_LIBRARY_DIR} ${__OpenSG_LIBRARIES_SEARCH_DIRS})
+	ENDIF(OPENSG_LIBRARY_DIR)
+
+	# handle input variable OPENSG_INCLUDE_SEARCH_DIR
+	IF(OPENSG_INCLUDE_SEARCH_DIR)
+		FILE(TO_CMAKE_PATH ${OPENSG_INCLUDE_SEARCH_DIR} OPENSG_INCLUDE_SEARCH_DIR)
+		SET(__OpenSG_INCLUDE_SEARCH_DIRS
+			${OPENSG_INCLUDE_SEARCH_DIR} ${__OpenSG_INCLUDE_SEARCH_DIRS})
+	ENDIF(OPENSG_INCLUDE_SEARCH_DIR)
+
+	# handle input variable OPENSG_LIBRARY_SEARCH_DIR
+	IF(OPENSG_LIBRARY_SEARCH_DIR)
+		FILE(TO_CMAKE_PATH ${OPENSG_LIBRARY_SEARCH_DIR} OPENSG_LIBRARY_SEARCH_DIR)
+		SET(__OpenSG_LIBRARIES_SEARCH_DIRS
+			${OPENSG_LIBRARY_SEARCH_DIR} ${__OpenSG_LIBRARIES_SEARCH_DIRS})
+	ENDIF(OPENSG_LIBRARY_SEARCH_DIR)
+
+	IF(NOT OpenSG_INCLUDE_DIR)
+		# try to find include dirrectory by searching for OSGConfigured.h
+		FIND_PATH(OpenSG_INCLUDE_DIR
+			NAMES         OpenSG/OSGConfigured.h
+			HINTS         ${__OpenSG_INCLUDE_SEARCH_DIRS})
+	ENDIF(NOT OpenSG_INCLUDE_DIR)
 	#message(STATUS "OpenSG_INCLUDE_DIR: " ${OpenSG_INCLUDE_DIR})
-    # ------------------------------------------------------------------------
-    #  Begin finding OpenSG libraries
-    # ------------------------------------------------------------------------
-    FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
-        STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
-        SET(OpenSG_${UPPERCOMPONENT}_LIBRARY "OpenSG_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
-        SET(OpenSG_${UPPERCOMPONENT}_LIBRARY_RELEASE "OpenSG_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
-        SET(OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG "OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND")
-
+	# ------------------------------------------------------------------------
+	#  Begin finding OpenSG libraries
+	# ------------------------------------------------------------------------
+	FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
+		STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+		SET(OpenSG_${UPPERCOMPONENT}_LIBRARY "OpenSG_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
+		SET(OpenSG_${UPPERCOMPONENT}_LIBRARY_RELEASE "OpenSG_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
+		SET(OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG "OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND")
+
 	IF (WIN32)
-        FIND_LIBRARY(OpenSG_${UPPERCOMPONENT}_LIBRARY_RELEASE
-            NAMES  ${COMPONENT}
-            HINTS  ${__OpenSG_LIBRARIES_SEARCH_DIRS}
-        )
-
+		FIND_LIBRARY(OpenSG_${UPPERCOMPONENT}_LIBRARY_RELEASE
+			NAMES  ${COMPONENT}
+			HINTS  ${__OpenSG_LIBRARIES_SEARCH_DIRS}
+		)
+
 		#message(STATUS "OpenSG Component: " ${COMPONENT})
-
-        FIND_LIBRARY(OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG
-	    # 1.8 Added the "D" suffix
-            NAMES  ${COMPONENT}D
-            HINTS  ${__OpenSG_LIBRARIES_SEARCH_DIRS}
-            # 1.8 Removed next line
-	    #PATH_SUFFIXES "debug"
-        )
+
+		FIND_LIBRARY(OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG
+		# 1.8 Added the "D" suffix
+			NAMES  ${COMPONENT}D
+			HINTS  ${__OpenSG_LIBRARIES_SEARCH_DIRS}
+			# 1.8 Removed next line
+		#PATH_SUFFIXES "debug"
+		)
 	ELSE (WIN32)
 	FIND_LIBRARY(OpenSG_${UPPERCOMPONENT}_LIBRARY_RELEASE
-            NAMES  ${COMPONENT}
-            HINTS  ${__OpenSG_LIBRARIES_SEARCH_DIRS}
-	    PATH_SUFFIXES "/opt"
-        )
-
+			NAMES  ${COMPONENT}
+			HINTS  ${__OpenSG_LIBRARIES_SEARCH_DIRS}
+		PATH_SUFFIXES "/opt"
+		)
+
 		#message(STATUS "OpenSG Component: " ${COMPONENT})
-
-        FIND_LIBRARY(OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG
-            NAMES  ${COMPONENT}
-            HINTS  ${__OpenSG_LIBRARIES_SEARCH_DIRS}
-	    PATH_SUFFIXES "/dbg"
-        )
+
+		FIND_LIBRARY(OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG
+			NAMES  ${COMPONENT}
+			HINTS  ${__OpenSG_LIBRARIES_SEARCH_DIRS}
+		PATH_SUFFIXES "/dbg"
+		)
 	ENDIF(WIN32)
-
-        __OpenSG_ADJUST_LIB_VARS(${UPPERCOMPONENT})
-    ENDFOREACH(COMPONENT)
-    # ------------------------------------------------------------------------
-    #  End finding OpenSG libraries
-    # ------------------------------------------------------------------------
-
-    SET(OpenSG_INCLUDE_DIRS "${OpenSG_INCLUDE_DIR}" "${OpenSG_INCLUDE_DIR}/OpenSG")
-
-    SET(OpenSG_FOUND FALSE)
-
-    IF(OpenSG_INCLUDE_DIR)
-        SET(OpenSG_FOUND TRUE)
-
-        # check if all requested components were found
-        SET(__OpenSG_CHECKED_COMPONENT FALSE)
-        SET(__OpenSG_MISSING_COMPONENTS)
-
-        FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
-            STRING(TOUPPER ${COMPONENT} COMPONENT)
-            SET(__OpenSG_CHECKED_COMPONENT TRUE)
-
-            IF(NOT OpenSG_${COMPONENT}_FOUND)
-                STRING(TOLOWER ${COMPONENT} COMPONENT)
-                LIST(APPEND __OpenSG_MISSING_COMPONENTS ${COMPONENT})
-                SET(OpenSG_FOUND FALSE)
-            ENDIF(NOT OpenSG_${COMPONENT}_FOUND)
-        ENDFOREACH(COMPONENT)
-
-        IF(__OpenSG_MISSING_COMPONENTS)
-            # We were unable to find some libraries, so generate a sensible
-            # error message that lists the libraries we were unable to find.
-            SET(OpenSG_ERROR_REASON
-                "${OpenSG_ERROR_REASON}\nThe following OpenSG libraries could not be found:\n")
-            FOREACH(COMPONENT ${__OpenSG_MISSING_COMPONENTS})
-                SET(OpenSG_ERROR_REASON
-                    "${OpenSG_ERROR_REASON}        ${COMPONENT}\n")
-            ENDFOREACH(COMPONENT)
-
-            LIST(LENGTH OpenSG_FIND_COMPONENTS __OpenSG_NUM_COMPONENTS_WANTED)
-            LIST(LENGTH __OpenSG_MISSING_COMPONENTS __OpenSG_NUM_MISSING_COMPONENTS)
-            IF(${__OpenSG_NUM_COMPONENTS_WANTED} EQUAL ${__OpenSG_NUM_MISSING_COMPONENTS})
-                SET(OpenSG_ERROR_REASON
-                "${OpenSG_ERROR_REASON}No OpenSG libraries were found. You may need to set OPENSG_LIBRARY_DIR to the directory containing OpenSG libraries or OPENSG_ROOT to the location of OpenSG.")
-            ELSE(${__OpenSG_NUM_COMPONENTS_WANTED} EQUAL ${__OpenSG_NUM_MISSING_COMPONENTS})
-                SET(OpenSG_ERROR_REASON
-                "${OpenSG_ERROR_REASON}Some (but not all) of the required OpenSG libraries were found. You may need to install these additional OpenSG libraries. Alternatively, set OPENSG_LIBRARY_DIR to the directory containing OpenSG libraries or OPENSG_ROOT to the location of OpenSG.")
-            ENDIF(${__OpenSG_NUM_COMPONENTS_WANTED} EQUAL ${__OpenSG_NUM_MISSING_COMPONENTS})
-        ENDIF(__OpenSG_MISSING_COMPONENTS)
-
-    ENDIF(OpenSG_INCLUDE_DIR)
-
-    IF(OpenSG_FOUND)
-        IF(NOT OpenSG_FIND_QUIETLY)
-            MESSAGE(STATUS "OpenSG found.")
-        ENDIF(NOT OpenSG_FIND_QUIETLY)
-
-        IF (NOT OpenSG_FIND_QUIETLY)
-            MESSAGE(STATUS "Found the following OpenSG libraries:")
-        ENDIF(NOT OpenSG_FIND_QUIETLY)
-
-        FOREACH(COMPONENT  ${OpenSG_FIND_COMPONENTS})
-            STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
-            IF(OpenSG_${UPPERCOMPONENT}_FOUND)
-                IF(NOT OpenSG_FIND_QUIETLY)
-                    MESSAGE(STATUS "  ${COMPONENT}")
-                ENDIF(NOT OpenSG_FIND_QUIETLY)
-                SET(OpenSG_LIBRARIES ${OpenSG_LIBRARIES} ${OpenSG_${UPPERCOMPONENT}_LIBRARY})
-            ENDIF(OpenSG_${UPPERCOMPONENT}_FOUND)
-        ENDFOREACH(COMPONENT)
-
-    ELSE(OpenSG_FOUND)
-        IF(OpenSG_FIND_REQUIRED)
-            MESSAGE(SEND_ERROR "Unable to find the requested OpenSG libraries.\n${OpenSG_ERROR_REASON}")
-        ENDIF(OpenSG_FIND_REQUIRED)
-    ENDIF(OpenSG_FOUND)
+
+		__OpenSG_ADJUST_LIB_VARS(${UPPERCOMPONENT})
+	ENDFOREACH(COMPONENT)
+	# ------------------------------------------------------------------------
+	#  End finding OpenSG libraries
+	# ------------------------------------------------------------------------
+
+	SET(OpenSG_INCLUDE_DIRS "${OpenSG_INCLUDE_DIR}" "${OpenSG_INCLUDE_DIR}/OpenSG")
+
+	SET(OpenSG_FOUND FALSE)
+
+	IF(OpenSG_INCLUDE_DIR)
+		SET(OpenSG_FOUND TRUE)
+
+		# check if all requested components were found
+		SET(__OpenSG_CHECKED_COMPONENT FALSE)
+		SET(__OpenSG_MISSING_COMPONENTS)
+
+		FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
+			STRING(TOUPPER ${COMPONENT} COMPONENT)
+			SET(__OpenSG_CHECKED_COMPONENT TRUE)
+
+			IF(NOT OpenSG_${COMPONENT}_FOUND)
+				STRING(TOLOWER ${COMPONENT} COMPONENT)
+				LIST(APPEND __OpenSG_MISSING_COMPONENTS ${COMPONENT})
+				SET(OpenSG_FOUND FALSE)
+			ENDIF(NOT OpenSG_${COMPONENT}_FOUND)
+		ENDFOREACH(COMPONENT)
+
+		IF(__OpenSG_MISSING_COMPONENTS)
+			# We were unable to find some libraries, so generate a sensible
+			# error message that lists the libraries we were unable to find.
+			SET(OpenSG_ERROR_REASON
+				"${OpenSG_ERROR_REASON}\nThe following OpenSG libraries could not be found:\n")
+			FOREACH(COMPONENT ${__OpenSG_MISSING_COMPONENTS})
+				SET(OpenSG_ERROR_REASON
+					"${OpenSG_ERROR_REASON}        ${COMPONENT}\n")
+			ENDFOREACH(COMPONENT)
+
+			LIST(LENGTH OpenSG_FIND_COMPONENTS __OpenSG_NUM_COMPONENTS_WANTED)
+			LIST(LENGTH __OpenSG_MISSING_COMPONENTS __OpenSG_NUM_MISSING_COMPONENTS)
+			IF(${__OpenSG_NUM_COMPONENTS_WANTED} EQUAL ${__OpenSG_NUM_MISSING_COMPONENTS})
+				SET(OpenSG_ERROR_REASON
+				"${OpenSG_ERROR_REASON}No OpenSG libraries were found. You may need to set OPENSG_LIBRARY_DIR to the directory containing OpenSG libraries or OPENSG_ROOT to the location of OpenSG.")
+			ELSE(${__OpenSG_NUM_COMPONENTS_WANTED} EQUAL ${__OpenSG_NUM_MISSING_COMPONENTS})
+				SET(OpenSG_ERROR_REASON
+				"${OpenSG_ERROR_REASON}Some (but not all) of the required OpenSG libraries were found. You may need to install these additional OpenSG libraries. Alternatively, set OPENSG_LIBRARY_DIR to the directory containing OpenSG libraries or OPENSG_ROOT to the location of OpenSG.")
+			ENDIF(${__OpenSG_NUM_COMPONENTS_WANTED} EQUAL ${__OpenSG_NUM_MISSING_COMPONENTS})
+		ENDIF(__OpenSG_MISSING_COMPONENTS)
+
+	ENDIF(OpenSG_INCLUDE_DIR)
+
+	IF(OpenSG_FOUND)
+		IF(NOT OpenSG_FIND_QUIETLY)
+			MESSAGE(STATUS "OpenSG found.")
+		ENDIF(NOT OpenSG_FIND_QUIETLY)
+
+		IF (NOT OpenSG_FIND_QUIETLY)
+			MESSAGE(STATUS "Found the following OpenSG libraries:")
+		ENDIF(NOT OpenSG_FIND_QUIETLY)
+
+		FOREACH(COMPONENT  ${OpenSG_FIND_COMPONENTS})
+			STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+			IF(OpenSG_${UPPERCOMPONENT}_FOUND)
+				IF(NOT OpenSG_FIND_QUIETLY)
+					MESSAGE(STATUS "  ${COMPONENT}")
+				ENDIF(NOT OpenSG_FIND_QUIETLY)
+				SET(OpenSG_LIBRARIES ${OpenSG_LIBRARIES} ${OpenSG_${UPPERCOMPONENT}_LIBRARY})
+			ENDIF(OpenSG_${UPPERCOMPONENT}_FOUND)
+		ENDFOREACH(COMPONENT)
+
+	ELSE(OpenSG_FOUND)
+		IF(OpenSG_FIND_REQUIRED)
+			MESSAGE(SEND_ERROR "Unable to find the requested OpenSG libraries.\n${OpenSG_ERROR_REASON}")
+		ENDIF(OpenSG_FIND_REQUIRED)
+	ENDIF(OpenSG_FOUND)

 ENDIF(__OpenSG_IN_CACHE)


ARROW-3125: [C++] Add support for finding libpython on MSYS2

libpython on MSYS2 uses "${PYTHON_PREFIX}/lib/libpython3.6m.dll.a"
format.

Author: Kouhei Sutou <kou@clear-code.com>

Closes #2540 from kou/cpp-support-finding-libpython-on-msys2 and squashes the following commits:

8e648850 <Kouhei Sutou>  Add support for finding libpython on MSYS2

--- cpp/cmake_modules/FindPythonLibsNew.cmake
+++ cpp/cmake_modules/FindPythonLibsNew.cmake
@@ -149,7 +149,10 @@
     set(PYTHON_LIBRARY
       "${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
   else()
-    set(PYTHON_LIBRARY "${PYTHON_PREFIX}/libs/libpython${PYTHON_LIBRARY_SUFFIX}.a")
+    find_library(PYTHON_LIBRARY
+        NAMES "python${PYTHON_LIBRARY_SUFFIX}"
+        PATHS "${PYTHON_PREFIX}" NO_DEFAULT_PATH
+        PATH_SUFFIXES "lib" "libs")
   endif()
 elseif(APPLE)


Switch back to master now qt5-porting is merged

This should have been switched before merging, but works on our
dashboards due to the way the builder code is set up.

--- versions.cmake
+++ versions.cmake
@@ -107,7 +107,7 @@
   # Download tomviz from GIT
   add_customizable_revision(tomviz
     GIT_REPOSITORY https://github.com/openchemistry/tomviz.git
-    GIT_TAG "qt5-porting")
+    GIT_TAG "master")
 else()
   if (tomviz_FROM_SOURCE_DIR)
     add_customizable_revision(tomviz


GitInfo: provide list of authors

GitInfo: provide list of authors

--- GitInfo.cmake
+++ GitInfo.cmake
@@ -6,6 +6,7 @@
 # GIT_ORIGIN_URL: The origin of the working tree
 # GIT_ROOT_URL: The root remote of the working tree
 # GIT_BRANCH: The name of the current branch
+# GIT_AUTHORS: A list of all authors in the git history

 if(GIT_INFO_DONE_${PROJECT_NAME})
   return()
@@ -39,6 +40,27 @@
       OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE
       WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

+    if(EXISTS ${PROJECT_BINARY_DIR}/Authors.txt)
+      file(READ ${PROJECT_BINARY_DIR}/Authors.txt GIT_AUTHORS)
+    else()
+      # cache authors to not slow down cmake runs
+      set(GIT_AUTHORS)
+      execute_process(COMMAND "${GIT_EXECUTABLE}" log
+        OUTPUT_VARIABLE GIT_LOG OUTPUT_STRIP_TRAILING_WHITESPACE
+        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+      string(REPLACE "\n" ";" GIT_LOG ${GIT_LOG})
+      foreach(__line ${GIT_LOG})
+        if(__line MATCHES "^Author:")
+          string(REPLACE "Author: " "" __line "${__line}")
+          string(REGEX REPLACE "[ ]?<.*" "" __line "${__line}")
+          list(APPEND GIT_AUTHORS "${__line}")
+        endif()
+      endforeach()
+      list(SORT GIT_AUTHORS)
+      list(REMOVE_DUPLICATES GIT_AUTHORS)
+      file(WRITE ${PROJECT_BINARY_DIR}/Authors.txt "${GIT_AUTHORS}")
+    endif()
+
     if(NOT GIT_REVISION)
       set(GIT_REVISION "0")
     endif()
@@ -49,6 +71,7 @@
        set(GIT_STATE "<no-tag>")
     endif()
     string(REPLACE "* " "" GIT_BRANCH ${GIT_BRANCH})
+
   else()
     message(STATUS "No revision version support, git not found")
   endif()


fbcode_builder: update ThriftCppLibrary to use fb_cmake_parse_args()

Summary:
Change ThriftCppLibrary to use `fb_cmake_parse_args()`

This code doesn't really care much about handling empty arguments, so we could
use the standard `cmake_parse_arguments()` function here instead of
`fb_cmake_parse_args()`.  However, it is slightly more convenient that
`fb_cmake_parse_args()` automatically errors out on unhandled arguments, so
that we don't have to check for this ourselves.

Reviewed By: wez

Differential Revision: D16738445

fbshipit-source-id: 67b9761f2ceaf7665bd336290bb44af32fec6f4a

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -1,34 +1,13 @@
 # Copyright (c) Facebook, Inc. and its affiliates.
 # NOTE: If you change this file, fbcode/fboss/github/ThriftCppLibrary.cmake also
 # needs to be changed.  TODO: this should be handled via shipit.
+
+include(FBCMakeParseArgs)
+
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
-  set(SERVICES)
-  set(DEPENDS)
-  set(GEN_ARGS)
-  set(mode "UNSET")
-  foreach(arg IN LISTS ARGN)
-    if("${arg}" STREQUAL "SERVICES")
-      set(mode "SERVICES")
-    elseif("${arg}" STREQUAL "DEPENDS")
-      set(mode "DEPENDS")
-    elseif("${arg}" STREQUAL "OPTIONS")
-      set(mode "OPTIONS")
-    else()
-      if("${mode}" STREQUAL "SERVICES")
-        list(APPEND SERVICES "${arg}")
-      elseif("${mode}" STREQUAL "DEPENDS")
-        list(APPEND DEPENDS "${arg}")
-      elseif("${mode}" STREQUAL "OPTIONS")
-        list(APPEND GEN_ARGS "${arg}")
-      else()
-        message(
-          FATAL_ERROR
-          "expected SERVICES, DEPENDS, or OPTIONS argument, found ${arg}"
-        )
-      endif()
-    endif()
-  endforeach()
+  set(multi_value_args SERVICES DEPENDS OPTIONS)
+  fb_cmake_parse_args(ARG "" "" "${multi_value_args}" "${ARGN}")

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -42,11 +21,11 @@
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)

   if (NOT "${include_prefix}" STREQUAL "")
-    list(APPEND GEN_ARGS "include_prefix=${include_prefix}")
+    list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
   endif()
   # CMake 3.12 is finally getting a list(JOIN) function, but until then
   # treating the list as a string and replacing the semicolons is good enough.
-  string(REPLACE ";" "," GEN_ARG_STR "${GEN_ARGS}")
+  string(REPLACE ";" "," GEN_ARG_STR "${ARG_OPTIONS}")

   # Compute the list of generated files
   list(APPEND generated_headers
@@ -61,7 +40,7 @@
     ${output_dir}/gen-cpp2/${base}_data.cpp
     ${output_dir}/gen-cpp2/${base}_types.cpp
   )
-  foreach(service IN LISTS SERVICES)
+  foreach(service IN LISTS ARG_SERVICES)
     list(APPEND generated_headers
       ${output_dir}/gen-cpp2/${service}.h
       ${output_dir}/gen-cpp2/${service}.tcc
@@ -77,7 +56,7 @@
   endforeach()

   list(APPEND thrift_include_options -I ${CMAKE_SOURCE_DIR})
-  foreach(depends IN LISTS DEPENDS)
+  foreach(depends IN LISTS ARG_DEPENDS)
     get_property(thrift_include_directory
       TARGET ${depends}
       PROPERTY THRIFT_INCLUDE_DIRECTORY)
@@ -114,7 +93,7 @@
     MAIN_DEPENDENCY
       ${THRIFT_FILE}
     DEPENDS
-      ${DEPENDS}
+      ${ARG_DEPENDS}
   )

   # Now emit the library rule to compile the sources
@@ -139,7 +118,7 @@
   target_link_libraries(
     ${LIB_NAME}
     PUBLIC
-      ${DEPENDS}
+      ${ARG_DEPENDS}
       FBThrift::thriftcpp2
       Folly::folly
   )


misc: bump version to 1.0.1 for fix release

--- CMakeModules/Version.cmake
+++ CMakeModules/Version.cmake
@@ -9,7 +9,7 @@

 SET(FG_VERSION_MAJOR "1")
 SET(FG_VERSION_MINOR "0")
-SET(FG_VERSION_PATCH "0")
+SET(FG_VERSION_PATCH "1")

 SET(FG_VERSION "${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}")
 SET(FG_API_VERSION_CURRENT ${FG_VERSION_MAJOR}${FG_VERSION_MINOR})


Bump to version 1.1.0

Bump to version 1.1.0

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


Bump version to 1.7.12

Bump version to 1.7.12

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(LIBREPO_MAJOR "1")
 SET(LIBREPO_MINOR "7")
-SET(LIBREPO_PATCH "11")
+SET(LIBREPO_PATCH "12")


v2.4.1

--- VERSION.cmake
+++ VERSION.cmake
@@ -44,10 +44,10 @@
 #    set COMPATMINOR to MINOR. (binary incompatible change)
 #

-# Package version 2.4.0
+# Package version 2.4.1
 SET(OPENWSMAN_MAJOR "2")
 SET(OPENWSMAN_MINOR "4")
-SET(OPENWSMAN_PATCH "0")
+SET(OPENWSMAN_PATCH "1")

 # Plugin API 2.2
 SET(OPENWSMAN_PLUGIN_API_MAJOR "2")


COMP: use the same if(UNIX) as in FindGDAL.cmake

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -20,7 +20,7 @@
   MESSAGE(STATUS "  GDAL includes : ${GDAL_INCLUDE_DIR}")
   MESSAGE(STATUS "  GDAL library  : ${GDAL_LIBRARY}")

-  IF(NOT WIN32)
+  IF(UNIX)
     # Find gdal version with gdal-config
     FIND_PROGRAM(GDALCONFIG_EXECUTABLE gdal-config)
     MARK_AS_ADVANCED(GDALCONFIG_EXECUTABLE)
@@ -42,14 +42,14 @@
        MESSAGE(STATUS "CHECK_GDAL_BUILDED_WITH_HDF test failed : GDAL is not built with hdf support. So the HDF tests will be deactivated. Formats supported by your GDAL: " [ ${GDAL_FORMATS} ] )
        SET(CHECK_GDAL_BUILDED_WITH_HDF 0 CACHE INTERNAL "GDAL_BUILDED_WITH_HDF" FORCE)
     ENDIF(${GDAL_FORMATS} MATCHES "hdf")
-
-  ELSE (NOT WIN32)
+  ELSE (UNIX)
   	# For WIN32 platform, GDAL is automatically built with HDF support.
     SET(CHECK_GDAL_BUILDED_WITH_HDF 1 CACHE INTERNAL "GDAL_BUILDED_WITH_HDF" FORCE)
     # GDAL_INCLUDE_DIR has already been checked here
     FILE(READ "${GDAL_INCLUDE_DIR}/gdal_version.h" _gdal_version_h_CONTENTS)
     STRING(REGEX REPLACE ".*# *define GDAL_RELEASE_NAME *\"([0-9.]+)\".*" "\\1" GDAL_VERSION "${_gdal_version_h_CONTENTS}")
-  ENDIF (NOT WIN32)
+  ENDIF (UNIX)
+
   MESSAGE(STATUS "  GDAL version is " ${GDAL_VERSION})
   SET(GDAL_VERSION ${GDAL_VERSION} CACHE STRING "GDAL version" FORCE)
   MARK_AS_ADVANCED(GDAL_VERSION)


ENH: Update ITK CMake version for 5.1.2

ENH: Update ITK CMake version for 5.1.2

--- CMake/itkVersion.cmake
+++ CMake/itkVersion.cmake
@@ -1,4 +1,4 @@
 # ITK version number components.
 set(ITK_VERSION_MAJOR "5")
 set(ITK_VERSION_MINOR "1")
-set(ITK_VERSION_PATCH "1")
+set(ITK_VERSION_PATCH "2")


force-overwrite ceres options

force-overwrite ceres options

--- VAD_Ceres.cmake
+++ VAD_Ceres.cmake
@@ -41,10 +41,10 @@
         "#undef ERROR\n#define MAX_LOG_LEVEL -1" FILECONTENT "${FILECONTENT}")
   file(WRITE "${VAD_EXTERNAL_ROOT}/Ceres/internal/ceres/miniglog/glog/logging.h" "${FILECONTENT}")

-  set(EIGENSPARSE ON) #use Eigen (no additional deps required - but suitesparse should be faster!)
-  set(MINIGLOG ON) #use miniglog
-  set(EIGENSPARSE ON)
-  set(BUILD_TESTING OFF)
+  set(EIGENSPARSE ON CACHE BOOL "" FORCE) #use Eigen (no additional deps required - but suitesparse should be faster!)
+  set(MINIGLOG ON CACHE BOOL "" FORCE) #use miniglog
+  set(EIGENSPARSE ON CACHE BOOL "" FORCE)
+  set(BUILD_TESTING OFF CACHE BOOL "" FORCE)

   # TODO default seems to point to checkout out dir in source?!?
   add_subdirectory("${VAD_EXTERNAL_ROOT}/Ceres" "${CMAKE_BINARY_DIR}/external/Ceres")


CUDA cmake integration

CUDA cmake integration

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@8238 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/projects/library/cmake/CMake/cuda/FindCUDA.cmake
+++ seqan/projects/library/cmake/CMake/cuda/FindCUDA.cmake
@@ -165,7 +165,7 @@
 #     and will link in the resulting object file automatically.
 #
 #     This script will also generate a separate cmake script that is used at
-#     build time to invoke nvcc.  This is for serveral reasons.
+#     build time to invoke nvcc.  This is for several reasons.
 #
 #       1. nvcc can return negative numbers as return values which confuses
 #       Visual Studio into thinking that the command succeeded.  The script now
@@ -418,6 +418,10 @@
   unset(CUDA_VERSION CACHE)
   unset(CUDA_TOOLKIT_INCLUDE CACHE)
   unset(CUDA_CUDART_LIBRARY CACHE)
+  if(CUDA_VERSION VERSION_EQUAL "3.0")
+    # This only existed in the 3.0 version of the CUDA toolkit
+    unset(CUDA_CUDARTEMU_LIBRARY CACHE)
+  endif()
   unset(CUDA_CUDA_LIBRARY CACHE)
   unset(CUDA_cublas_LIBRARY CACHE)
   unset(CUDA_cublasemu_LIBRARY CACHE)
@@ -484,6 +488,10 @@
   string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT})
   set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.")
   mark_as_advanced(CUDA_VERSION)
+else()
+  # Need to set these based off of the cached value
+  string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}")
+  string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}")
 endif()

 # Always set this convenience variable
@@ -529,11 +537,19 @@

 macro(FIND_LIBRARY_LOCAL_FIRST _var _names _doc)
   if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    set(_cuda_64bit_lib_dir "${CUDA_TOOLKIT_ROOT_DIR}/lib64")
-  endif()
+    # CUDA 3.2+ on Windows moved the library directoryies, so we need the new
+    # and old paths.
+    set(_cuda_64bit_lib_dir
+      "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64"
+      "${CUDA_TOOLKIT_ROOT_DIR}/lib64"
+      )
+  endif()
+  # CUDA 3.2+ on Windows moved the library directories, so we need to new
+  # (lib/Win32) and the old path (lib).
   find_library(${_var}
     NAMES ${_names}
     PATHS ${_cuda_64bit_lib_dir}
+          "${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32"
           "${CUDA_TOOLKIT_ROOT_DIR}/lib"
     ENV CUDA_LIB_PATH
     DOC ${_doc}
@@ -545,11 +561,28 @@

 # CUDA_LIBRARIES
 find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library")
-set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
+if(CUDA_VERSION VERSION_EQUAL "3.0")
+  # The cudartemu library only existed for the 3.0 version of CUDA.
+  find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library")
+  mark_as_advanced(
+    CUDA_CUDARTEMU_LIBRARY
+    )
+endif()
+# If we are using emulation mode and we found the cudartemu library then use
+# that one instead of cudart.
+if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
+  set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
+else()
+  set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
+endif()
 if(APPLE)
   # We need to add the path to cudart to the linker using rpath, since the
   # library name for the cuda libraries is prepended with @rpath.
-  get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
+  if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
+    get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH)
+  else()
+    get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
+  endif()
   if(_cuda_path_to_cudart)
     list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
   endif()
@@ -576,9 +609,20 @@
   mark_as_advanced(CUDA_${_name}_LIBRARY)
 endmacro(FIND_CUDA_HELPER_LIBS)

+#######################
+# Disable emulation for v3.1 onward
+if(CUDA_VERSION VERSION_GREATER "3.0")
+  if(CUDA_BUILD_EMULATION)
+    message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards.  You must disable it to proceed.  You have version ${CUDA_VERSION}.")
+  endif()
+endif()
+
 # Search for cufft and cublas libraries.
-find_cuda_helper_libs(cufftemu)
-find_cuda_helper_libs(cublasemu)
+if(CUDA_VERSION VERSION_LESS "3.1")
+  # Emulation libraries aren't available in version 3.1 onward.
+  find_cuda_helper_libs(cufftemu)
+  find_cuda_helper_libs(cublasemu)
+endif()
 find_cuda_helper_libs(cufft)
 find_cuda_helper_libs(cublas)

@@ -591,8 +635,10 @@
 endif()

 ########################
-# Look for the SDK stuff
+# Look for the SDK stuff.  As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with
+# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory
 find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h
+  "$ENV{NVSDKCOMPUTE_ROOT}/C"
   "$ENV{NVSDKCUDA_ROOT}"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]"
   "/Developer/GPU\ Computing/C"
@@ -607,48 +653,57 @@
   "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK"
   "$ENV{HOME}/NVIDIA_CUDA_SDK"
   "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX"
+  "$ENV{HOME}/NVIDIA_GPU_Computing_SDK/C"
   "/Developer/CUDA"
   )

 # Example of how to find an include file from the CUDA_SDK_ROOT_DIR

-# find_path(CUDA_CUT_INCLUDE_DIR
-#   cutil.h
-#   PATHS ${CUDA_SDK_SEARCH_PATH}
-#   PATH_SUFFIXES "common/inc"
-#   DOC "Location of cutil.h"
-#   NO_DEFAULT_PATH
-#   )
-# # Now search system paths
-# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h")
-
-# mark_as_advanced(CUDA_CUT_INCLUDE_DIR)
+find_path(CUDA_CUT_INCLUDE_DIR
+  cutil.h
+  PATHS ${CUDA_SDK_SEARCH_PATH}
+  PATH_SUFFIXES "common/inc"
+  DOC "Location of cutil.h"
+  NO_DEFAULT_PATH
+  )
+# Now search system paths
+find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h")
+
+mark_as_advanced(CUDA_CUT_INCLUDE_DIR)

 # Example of how to find a library in the CUDA_SDK_ROOT_DIR

-# # cutil library is called cutil64 for 64 bit builds on windows.  We don't want
-# # to get these confused, so we are setting the name based on the word size of
-# # the build.
-
-# if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-#   set(cuda_cutil_name cutil64)
-# else(CMAKE_SIZEOF_VOID_P EQUAL 8)
-#   set(cuda_cutil_name cutil32)
-# endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
-
-# find_library(CUDA_CUT_LIBRARY
-#   NAMES cutil ${cuda_cutil_name}
-#   PATHS ${CUDA_SDK_SEARCH_PATH}
-#   # The new version of the sdk shows up in common/lib, but the old one is in lib
-#   PATH_SUFFIXES "common/lib" "lib"
-#   DOC "Location of cutil library"
-#   NO_DEFAULT_PATH
-#   )
-# # Now search system paths
-# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library")
-# mark_as_advanced(CUDA_CUT_LIBRARY)
-# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY})
+# cutil library is called cutil64 for 64 bit builds on windows.  We don't want
+# to get these confused, so we are setting the name based on the word size of
+# the build.
+
+if (CMAKE_HOST_WIN32)
+  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    set(cuda_cutil_name cutil64)
+  else(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    set(cuda_cutil_name cutil32)
+  endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+else (CMAKE_HOST_WIN32)
+  if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+    set(cuda_cutil_name cutil_i386)
+  else(CMAKE_SIZEOF_VOID_P EQUAL 4)
+    set(cuda_cutil_name cutil_x86_64)
+  endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+endif (CMAKE_HOST_WIN32)
+
+find_library(CUDA_CUT_LIBRARY
+  NAMES cutil ${cuda_cutil_name}
+  PATHS ${CUDA_SDK_SEARCH_PATH}
+  # The new version of the sdk shows up in common/lib, but the old one is in lib
+  PATH_SUFFIXES "common/lib" "lib"
+  DOC "Location of cutil library"
+  NO_DEFAULT_PATH
+  )
+# Now search system paths
+find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library")
+mark_as_advanced(CUDA_CUT_LIBRARY)
+set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY})

@@ -786,7 +841,7 @@
 ##############################################################################
 # This helper macro populates the following variables and setups up custom
 # commands and targets to invoke the nvcc compiler to generate C or PTX source
-# dependant upon the format parameter.  The compiler is invoked once with -M
+# dependent upon the format parameter.  The compiler is invoked once with -M
 # to generate a dependency file and a second time with -cuda or -ptx to generate
 # a .cpp or .ptx file.
 # INPUT:


Add debug for the translator step

Add debug for the translator step

--- test/base_test.cmake
+++ test/base_test.cmake
@@ -21,7 +21,7 @@
 # Create intermediate representation in XcodeML Fortran format
 add_custom_command(
   OUTPUT  ${OUTPUT_FILE}
-  COMMAND ${CLAWF90} -J ${XMOD_DIR} -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
+  COMMAND ${CLAWF90} -J ${XMOD_DIR} --Wx-d -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
   DEPENDS ${ORIGINAL_FILE}
   COMMENT "Translating CLAW directive with ${CLAWF90}"
 )


Add option to skip compilation

Add option to skip compilation

--- test/base_test.cmake
+++ test/base_test.cmake
@@ -58,8 +58,10 @@
 set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${CLAW_TEST_FFP_FLAGS}")

 # Build the original code and the transformed code
-add_executable (${EXECUTABLE_ORIGINAL} EXCLUDE_FROM_ALL ${ORIGINAL_FILE})
-add_executable (${EXECUTABLE_TRANSFORMED} EXCLUDE_FROM_ALL ${OUTPUT_FILE})
+if(NOT NO_COMPILE)
+  add_executable (${EXECUTABLE_ORIGINAL} EXCLUDE_FROM_ALL ${ORIGINAL_FILE})
+  add_executable (${EXECUTABLE_TRANSFORMED} EXCLUDE_FROM_ALL ${OUTPUT_FILE})
+endif()

 if(NOT IGNORE_TEST)
   # Compare reference transformed code and output of the transformation


CMake: Remove obsolete file

CMake: Remove obsolete file

--- cmake/macros/macro_deal_ii_add_dependencies.cmake
+++ cmake/macros/macro_deal_ii_add_dependencies.cmake
@@ -1,31 +0,0 @@
-## ---------------------------------------------------------------------
-##
-## Copyright (C) 2012 - 2014 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## The deal.II library is free software; you can use it, redistribute
-## it, and/or modify it under the terms of the GNU Lesser General
-## Public License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-## The full text of the license can be found in the file LICENSE at
-## the top level of the deal.II distribution.
-##
-## ---------------------------------------------------------------------
-
-#
-# A small wrapper around ADD_DEPENDENCIES to add the specified dependencies
-# to every ${target}_${build} target, where build runs through all build
-# types specified in DEAL_II_BUILD_TYPES
-#
-
-MACRO(DEAL_II_ADD_DEPENDENCIES _name _target)
-
-  FOREACH(_build ${DEAL_II_BUILD_TYPES})
-    STRING(TOLOWER ${_build} _build_lowercase)
-    ADD_DEPENDENCIES(${_name}.${_build_lowercase}
-      ${_target}.${_build_lowercase}
-      )
-  ENDFOREACH()
-
-ENDMACRO()


COMP (#581): fixed missing generation of ui files for Qt4

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -54,7 +54,7 @@
   INCLUDE_DIRECTORIES(${Q${KITNAME}_INCLUDE_DIRS})
   ADD_DEFINITIONS(${QT_DEFINITIONS})
   IF(UI_FILES)
-  QT4_WRAP_UI(${UI_FILES})
+  QT4_WRAP_UI(Q${KITNAME}_GENERATED_CPP ${UI_FILES})
   ENDIF(UI_FILES)
   IF(MOC_H_FILES)
   QT4_WRAP_CPP(Q${KITNAME}_GENERATED_CPP ${MOC_H_FILES})


CMake: default to OGRE_ASSERT_MODE 2

CMake: default to OGRE_ASSERT_MODE 2

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -68,11 +68,11 @@

 endif()

-set(OGRE_ASSERT_MODE 1 CACHE STRING
-	"Enable Ogre asserts and exceptions. Possible values:
+set(OGRE_ASSERT_MODE 2 CACHE STRING
+	"Enable Ogre asserts. Possible values:
 	0 - Standard asserts in debug builds, nothing in release builds.
 	1 - Standard asserts in debug builds, exceptions in release builds.
-	2 - Exceptions in debug builds, exceptions in release builds."
+	2 - Exceptions in debug & release builds."
 )
 set_property(CACHE OGRE_ASSERT_MODE PROPERTY STRINGS 0 1 2)


Use CMakePushCheckState

Use CMakePushCheckState

--- CMake/sitkCheckCXX11.cmake
+++ CMake/sitkCheckCXX11.cmake
@@ -14,6 +14,9 @@
 # SITK_HAS_TR1_FUNCTIONAL
 # SITK_HAS_TR1_TYPE_TRAITS
 # SITK_HAS_TR1_UNORDERED_MAP
+
+include(CMakePushCheckState)
+

 if(POLICY CMP0067) # CMake 3.8.2
   cmake_policy(SET CMP0067 NEW)
@@ -59,6 +62,8 @@
    endif()
 endfunction()

+cmake_push_check_state(RESET)
+
 #
 # Check for CXX11 Features
 #
@@ -76,7 +81,6 @@
 # prefix to tr1 headers, while libc++
 sitkCXX11Test(SITK_HAS_TR1_SUB_INCLUDE)

-set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
 if (SITK_HAS_TR1_SUB_INCLUDE)
   list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DHAS_TR1_SUB_INCLUDE")
 endif()
@@ -88,8 +92,8 @@
 sitkCXX11Test(SITK_HAS_TR1_TYPE_TRAITS)
 sitkCXX11Test(SITK_HAS_TR1_UNORDERED_MAP)

-# restore varaible
-set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})
+# restore variable
+cmake_pop_check_state()

 if ( (NOT SITK_HAS_TR1_FUNCTIONAL AND NOT SITK_HAS_CXX11_FUNCTIONAL)


ENH: update DCMTK to 3.6.6 patched for seg

See https://github.com/QIICR/dcmqi/issues/341#issuecomment-778253753

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -28,13 +28,13 @@

   ExternalProject_SetIfNotDefined(
     ${proj}_GIT_REPOSITORY
-    "${EP_GIT_PROTOCOL}://git.dcmtk.org/dcmtk.git"
+    "${EP_GIT_PROTOCOL}://github.com/commontk/DCMTK.git"
     QUIET
     )

   ExternalProject_SetIfNotDefined(
     ${proj}_REVISION_TAG
-    "0f2de2313a00f9360bdf33399a2f37ee5e65c429"
+    "patched-DCMTK-3.6.6_20210115"
     QUIET
     )


fbcode_builder: fix a minor bug in THRIFT_INCLUDE_DIR argument parsing

Summary:
Fix a minor bug in the argument parsing for `add_fbthrift_cpp_library()`:
only a single value should be supplied for the `THRIFT_INCLUDE_DIR` argument.
This parameter should not accept a list of arguments.

Reviewed By: strager

Differential Revision: D17125810

fbshipit-source-id: 31f354e4d6299d3626a94f3b4b5ff8c58bb0cf7b

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -22,8 +22,8 @@
 #   desired.
 function(add_fbthrift_cpp_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
-  set(one_value_args INCLUDE_DIR)
-  set(multi_value_args SERVICES DEPENDS OPTIONS THRIFT_INCLUDE_DIR)
+  set(one_value_args INCLUDE_DIR THRIFT_INCLUDE_DIR)
+  set(multi_value_args SERVICES DEPENDS OPTIONS)
   fb_cmake_parse_args(
     ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
   )


static Qt 5.3 builds compatibility fix

static Qt 5.3 builds compatibility fix

--- src/Win/projectDef.cmake
+++ src/Win/projectDef.cmake
@@ -111,15 +111,13 @@
         Crypt32.lib
     )

-    target_link_libraries( ${PROJECT_NAME} debug "$ENV{QTDIR}/lib/translator_commond.lib" )
-    target_link_libraries( ${PROJECT_NAME} debug "$ENV{QTDIR}/lib/translator_hlsld.lib" )
+    target_link_libraries( ${PROJECT_NAME} debug "$ENV{QTDIR}/lib/translatord.lib" )
     target_link_libraries( ${PROJECT_NAME} debug "$ENV{QTDIR}/lib/preprocessord.lib" )
     target_link_libraries( ${PROJECT_NAME} debug "$ENV{QTDIR}/lib/Qt5PlatformSupportd.lib" )
     target_link_libraries( ${PROJECT_NAME} debug "$ENV{QTDIR}/qml/QtQuick.2/qtquick2plugind.lib" )
     target_link_libraries( ${PROJECT_NAME} debug "$ENV{QTDIR}/qml/QtQuick/Layouts/qquicklayoutsplugind.lib" )

-    target_link_libraries( ${PROJECT_NAME} optimized "$ENV{QTDIR}/lib/translator_common.lib" )
-    target_link_libraries( ${PROJECT_NAME} optimized "$ENV{QTDIR}/lib/translator_hlsl.lib" )
+    target_link_libraries( ${PROJECT_NAME} optimized "$ENV{QTDIR}/lib/translator.lib" )
     target_link_libraries( ${PROJECT_NAME} optimized "$ENV{QTDIR}/lib/preprocessor.lib" )
     target_link_libraries( ${PROJECT_NAME} optimized "$ENV{QTDIR}/lib/Qt5PlatformSupport.lib" )
     target_link_libraries( ${PROJECT_NAME} optimized "$ENV{QTDIR}/qml/QtQuick.2/qtquick2plugin.lib" )


Makefile: Set GPU_ARCH by default to 30

Makefile: Set GPU_ARCH by default to 30

--- tests/Makefile.cmake
+++ tests/Makefile.cmake
@@ -12,6 +12,7 @@
                   $(COMMON_INC)
 TEST_CASE      ?= ./tests/opencv_blur_8uc1
 MYFLAGS        ?= -DWIDTH=2048 -DHEIGHT=2048 -DSIZE_X=5 -DSIZE_Y=5
+GPU_ARCH        = 30
 NVCC_FLAGS      = -gencode=arch=compute_$(GPU_ARCH),code=\"sm_$(GPU_ARCH),compute_$(GPU_ARCH)\" -res-usage #-keep
 OFLAGS          = -O3

@@ -47,6 +48,8 @@

 ifdef HIPACC_TARGET
     HIPACC_OPTS=-target $(HIPACC_TARGET)
+    # set target GPU architecture to the compute capability encoded in target
+    GPU_ARCH := $(shell echo $(HIPACC_TARGET) |cut -f2 -d-)
 endif
 ifdef HIPACC_CONFIG
     HIPACC_OPTS+= -use-config $(HIPACC_CONFIG)
@@ -81,9 +84,6 @@
     HIPACC_OPTS+= -v-w $(HIPACC_VEC_WIDTH)
 endif
 endif
-
-# set target GPU architecture to the compute capability encoded in target
-GPU_ARCH := $(shell echo $(HIPACC_TARGET) |cut -f2 -d-)

 all:


Ensure OGRE_USE_BOOST is 0 by default (thanks dermont)

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -36,6 +36,7 @@
 set(OGRE_SET_DISABLE_DDS 0)
 set(OGRE_SET_NEW_COMPILERS 0)
 set(OGRE_STATIC_LIB 0)
+set(OGRE_USE_BOOST 0)
 if (OGRE_CONFIG_DOUBLE)
   set(OGRE_SET_DOUBLE 1)
 endif()


Reset conditionally used variables at beginning

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -16,6 +16,12 @@
 set(Boost_DEPENDS ${proj})

 if(NOT DEFINED BOOST_ROOT AND NOT MITK_USE_SYSTEM_Boost)
+
+  #[[ Reset variables. ]]
+  set(patch_cmd "")
+  set(configure_cmd "")
+  set(build_cmd "")
+  set(install_cmd "")

   set(BOOST_ROOT ${ep_prefix})


adding FindROS changes

adding FindROS changes

--- CMakeModules/FindROS.cmake
+++ CMakeModules/FindROS.cmake
@@ -55,7 +55,9 @@
     LIST(APPEND ROS_LIBRARIES ${${NAME}_LIB})
   ENDFOREACH(NAME)
   #Now that we're not using BOOST by default, boost_system is needed to use ROS libraries
-  LIST(APPEND ROS_LIBRARIES boost_system)
+  #LIST(APPEND ROS_LIBRARIES boost_system)
+  FIND_LIBRARY(BOOST_SYSTEM_LIBRARY NAMES boost_system)
+  LIST(APPEND ROS_LIBRARIES ${BOOST_SYSTEM_LIBRARY})
   MESSAGE(STATUS "ROS dependencies ${ROSDEPS} need the following libraries:")
   FOREACH(NAME ${ROS_LIBRARIES})
     MESSAGE(STATUS "  " ${NAME})


Make the RegEvent server to restart automatically on package update

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -127,7 +127,7 @@
 %define ctest_name ctest
 %endif

-%global flexisip_services %(printf 'flexisip-proxy.service'; if [ @ENABLE_PRESENCE@ -eq 1 ]; then printf ' flexisip-presence.service'; fi; if [ @ENABLE_CONFERENCE@ -eq 1 ]; then printf ' flexisip-conference.service'; fi)
+%global flexisip_services %(printf 'flexisip-proxy.service flexisip-regevent.service'; if [ @ENABLE_PRESENCE@ -eq 1 ]; then printf ' flexisip-presence.service'; fi; if [ @ENABLE_CONFERENCE@ -eq 1 ]; then printf ' flexisip-conference.service'; fi)

 %description
 Extensible SIP proxy with media capabilities. Designed for robustness and easy of use.


devenv: Remove "v" from DFK_VERSION

devenv: Remove "v" from DFK_VERSION

--- cmake/fw.cmake
+++ cmake/fw.cmake
@@ -17,9 +17,10 @@
     set(${version} "NOT-FOUND" PARENT_SCOPE)
     return()
   endif()
-  string(REGEX REPLACE "v([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" major ${version})
-  string(REGEX REPLACE "v[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" minor ${version})
-  string(REGEX REPLACE "v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" patch ${version})
+  string(REGEX REPLACE "v(\\.*)" "\\1" version ${version})
+  string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" major ${version})
+  string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" minor ${version})
+  string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" patch ${version})
   foreach(i version major minor patch)
     set(${out_${i}} ${${i}} PARENT_SCOPE)
   endforeach()


Updated metis path within petsc

Updated metis path within petsc

--- cmake-modules/FindMETIS.cmake
+++ cmake-modules/FindMETIS.cmake
@@ -54,7 +54,7 @@
     set(metis_inc_names "metis.h")

     # we look into petsc externalpackage (for 3.5.2 version, to be improved)
-    find_path(METIS_INCLUDE_DIR ${metis_inc_names} "${PETSC_DIR}/${PETSC_ARCH}/externalpackages/metis-5.1.0-p1/build/include/")
+    find_path(METIS_INCLUDE_DIR ${metis_inc_names} "${PETSC_DIR}/${PETSC_ARCH}/externalpackages/git.metis/build/include/")

     if (METIS_INCLUDE_DIR)


Remove unneeded todos and prints.

Remove unneeded todos and prints.

--- cmake/ConfigurePackages.cmake
+++ cmake/ConfigurePackages.cmake
@@ -203,8 +203,6 @@
 endmacro (configure_sparkle)

 macro(use_package_knet)
-    message ("** Configuring KNET")
-
     set(KNET_DIR ${ENV_KNET_DIR_QT47})

     # If KNET_DIR_QT47 was not specified, use kNet from TUNDRA_DEP_PATH.
@@ -228,8 +226,6 @@
 endmacro()

 macro(use_package_bullet)
-    # todo: convert to sagase_configure_package and sagase_report or custom FindBullet.cmake
-    message(STATUS "todo: fix use_package_bullet() from hardcoded one to more robust using sagase.")
     if (WIN32)
         if ("${ENV_BULLET_DIR}" STREQUAL "")
             set(BULLET_DIR ${ENV_TUNDRA_DEP_PATH}/Bullet)
@@ -317,8 +313,6 @@

 macro(use_package_assimp)
-    # todo: convert to sagase_configure_package and sagase_report or custom FindAssimp.cmake
-    message(STATUS "todo: fix use_package_assimp() from hardcoded one to more robust using sagase.")
     if (WIN32)
         if ("${ENV_ASSIMP_DIR}" STREQUAL "")
            set(ASSIMP_DIR ${ENV_TUNDRA_DEP_PATH}/assimp)


cuda version update

cuda version update

--- cmake/Dependencies_cuda.cmake
+++ cmake/Dependencies_cuda.cmake
@@ -49,13 +49,21 @@
     list(APPEND SAIGA_CUDA_FLAGS "--relocatable-device-code=true")
   endif()

+  if(${CUDAToolkit_VERSION})
+    set(SAIGA_CUDA_VERSION ${CUDAToolkit_VERSION})
+  elseif(${CUDA_VERSION})
+    set(SAIGA_CUDA_VERSION ${CUDA_VERSION})
+  else()
+    message(FATAL_ERROR "Unknown cuda version")
+  endif()
+

   # 30 GTX 7xx
   # 52 GTX 9xx
   # 61 GTX 10xx
   # 75 RTX 20xx
   # 86 RTX 30xx
-  if(${CUDAToolkit_VERSION} VERSION_LESS "11")
+  if(${SAIGA_CUDA_VERSION} VERSION_LESS "11")
     set(SAIGA_CUDA_ARCH "30-virtual" "52-virtual" CACHE STRING "The cuda architecture used for compiling .cu files")
   else()
     # CUDA 11 and later doesn't support 30 anymore


Final regex fix

Final regex fix

--- cmake/GetBoostLibB2Args.cmake
+++ cmake/GetBoostLibB2Args.cmake
@@ -71,7 +71,7 @@
         else()
             list(APPEND b2Args cxxflags=-fPIC cxxflags=-std=c++11)
             # Need to configure the toolset based on whatever version CMAKE_CXX_COMPILER is
-            string(REGEX MATCH "[0-9]+\\.[0-9]+(?:\\.[0-9]+)?" ToolsetVer "${CMAKE_CXX_COMPILER_VERSION}")
+            string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" ToolsetVer "${CMAKE_CXX_COMPILER_VERSION}")
             if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
                 list(APPEND b2Args toolset=clang-${ToolsetVer})
                 if(HAVE_LIBC++)


CI: Fix multiple distributions management. Add changelog message.

--- cmake/Modules/UploadPPA.cmake
+++ cmake/Modules/UploadPPA.cmake
@@ -6,11 +6,17 @@
   return()
 endif(NOT DEBUILD_EXECUTABLE OR NOT DPUT_EXECUTABLE)

+
+execute_process(COMMAND git tag -n20 --points-at v${AFF3CT_VERSION}
+                OUTPUT_VARIABLE CHANGELOG
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(CHANGELOG_MESSAGE ${CHANGELOG})
+
 if(NOT AFF3CT_PPA_DISTRIB)
 execute_process(COMMAND lsb_release -cs
                 OUTPUT_VARIABLE DISTRI
                 OUTPUT_STRIP_TRAILING_WHITESPACE)
-                set(AFF3CT_PPA_DISTRIB ${DISTRI})
+set(AFF3CT_PPA_DISTRIB ${DISTRI})
 endif()

 foreach(DISTRI ${AFF3CT_PPA_DISTRIB})
@@ -22,7 +28,7 @@
     set(DEBIAN_COPYRIGHT ${DEBIAN_SOURCE_DIR}/debian/copyright)
     set(DEBIAN_RULES ${DEBIAN_SOURCE_DIR}/debian/rules)
     set(DEBIAN_CHANGELOG ${DEBIAN_SOURCE_DIR}/debian/changelog)
-    set(DEBIAN_SOURCE_CHANGES ${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_source.changes)
+    set(DEBIAN_SOURCE_CHANGES ${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}-${DISTRI}_source.changes)
     set(ORIG_FILE "${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEBIAN_PACKAGE_FILE_NAME}.tar.gz")
     set(DPUT_HOST "ppa:aff3ct/aff3ct")
     if(CHANGELOG_MESSAGE) # TODO get it from git
@@ -96,7 +102,7 @@
                             OUTPUT_VARIABLE DATE_TIME
                             OUTPUT_STRIP_TRAILING_WHITESPACE)
             file(WRITE ${DEBIAN_CHANGELOG}
-                 "${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL} ${DISTRI}; urgency=low\n\n"
+                 "${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL}-${DISTRI} ${DISTRI}; urgency=low\n\n"
                  "  ${output_changelog_msg}\n\n"
                  " -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER}  ${DATE_TIME}\n\n")
             file(APPEND ${DEBIAN_CHANGELOG} ${DEBIAN_CHANGELOG_content})
@@ -107,7 +113,7 @@
                       OUTPUT_VARIABLE DATE_TIME
                       OUTPUT_STRIP_TRAILING_WHITESPACE)
       file(WRITE ${DEBIAN_CHANGELOG}
-           "${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL}) ${DISTRI}; urgency=low\n\n"
+           "${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL}-${DISTRI}) ${DISTRI}; urgency=low\n\n"
            "  ${output_changelog_msg}\n\n"
            " -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER}  ${DATE_TIME}\n")
     endif()
@@ -144,4 +150,6 @@
                       COMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEBIAN_SOURCE_CHANGES}
                       DEPENDS  debuild_${DISTRI}
                       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI})
+
+
 endforeach(DISTRI)


[cmake] ensure test binaries are build with dune's own make test

--- cmake/modules/DuneUtils.cmake
+++ cmake/modules/DuneUtils.cmake
@@ -125,6 +125,8 @@
 endmacro(BEGIN_TESTCASES)

 macro(END_TESTCASES)
+    add_directory_test_target(_test_target)
+    add_dependencies(${_test_target} ${testnames})
 	add_custom_target(test_binaries DEPENDS ${testnames})
 	add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}
                   DEPENDS test_binaries)


cmake: a little helper function

cmake: a little helper function

for notifying the user about 3rdparty dependencies, which get pulled in
but will not get installed together with PFASST++

--- cmake/utility_functions.cmake
+++ cmake/utility_functions.cmake
@@ -19,3 +19,11 @@
 #   message(STATUS "Full string is now: '${in_string}'")
     set(${out_string} ${in_string} PARENT_SCOPE)
 endfunction(add_to_string_list)
+
+macro(msg_not_installed dependency_name)
+    message("!!!!")
+    message("!  ${dependency_name} will not be installed with PFASST++.")
+    message("!  When using PFASST++ with your own code, please make sure to also add")
+    message("!  ${dependency_name} manually to your project.")
+    message("!!!!")
+endmacro(msg_not_installed)


cmake: Updated livba requirements

cmake: Updated livba requirements

libva >= 2.5.0 (VA_API_VERSION>=1.5.0) required for build

--- builder/FindPackages.cmake
+++ builder/FindPackages.cmake
@@ -481,9 +481,9 @@
   find_package(PkgConfig REQUIRED)

   # required:
-  pkg_check_modules(PKG_LIBVA     REQUIRED libva>=0.33)
+  pkg_check_modules(PKG_LIBVA     REQUIRED libva>=1.5.0)
   pkg_check_modules(PKG_LIBDRM    REQUIRED libdrm)
-  pkg_check_modules(PKG_LIBVA_DRM REQUIRED libva-drm>=0.33)
+  pkg_check_modules(PKG_LIBVA_DRM REQUIRED libva-drm>=1.5.0)

   # optional:
   pkg_check_modules( PKG_MFX       libmfx>=1.28 )
@@ -494,7 +494,7 @@
     endif()

     pkg_check_modules( PKG_X11       ${X11_REQUIRED} x11 )
-    pkg_check_modules( PKG_LIBVA_X11 ${X11_REQUIRED} libva-x11>=0.33 )
+    pkg_check_modules( PKG_LIBVA_X11 ${X11_REQUIRED} libva-x11>=1.5.0 )

     if ( PKG_X11_FOUND AND PKG_LIBVA_X11_FOUND )
       set( ENABLE_X11 ON )


cmake: visual studio: reduce runtime checks in debug mode

--- src/cmake/common-settings.cmake
+++ src/cmake/common-settings.cmake
@@ -15,9 +15,9 @@

 if ("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
-	set(YUNI_)
+	set(YUNI_TARGET "release")
 else()
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")
+	set(YUNI_TARGET "debug")
 endif()

@@ -73,7 +73,10 @@
 set(YUNI_COMMON_CC_OPTIONS  "${YUNI_COMMON_CC_OPTIONS} -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64")
 set(YUNI_COMMON_CXX_OPTIONS  "")

-set(COMMON_MSVC_FLAGS "/W3 /MP4 /Zi")
+set(COMMON_MSVC_FLAGS "/W3 /MP4")
+if ("${YUNI_TARGET}" STREQUAL "debug")
+	set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /Zi")
+endif()
 set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /DREENTRANT /D_LARGEFILE_SOURCE /D_LARGEFILE64_SOURCE /D_FILE_OFFSET_BITS=64")
 set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /DUNICODE /D_UNICODE")

@@ -182,13 +185,13 @@
 endif()

 if(MSVC)
-	set(CMAKE_C_FLAGS_DEBUG   "${COMMON_MSVC_FLAGS} /MDd /GR /Ot /Od /EHsc /RTC1")
-	set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_MSVC_FLAGS} /MDd /GR /Ot /Od /EHsc /RTC1 /fp:except")
+	set(CMAKE_C_FLAGS_DEBUG   "${COMMON_MSVC_FLAGS} /MD /GR /Ot /Od /EHsc")
+	set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_MSVC_FLAGS} /MD /GR /Ot /Od /EHsc /fp:except")

 	set(MSVC_RELEASE_FLAGS)

 	# O2x: optimization
-	set(MSVC_RELEASE_FLAGS "${MSVC_RELEASE_FLAGS} /O2")
+	set(MSVC_RELEASE_FLAGS "${MSVC_RELEASE_FLAGS} /Ox")
 	# Prefer speed instead of size
 	set(MSVC_RELEASE_FLAGS "${MSVC_RELEASE_FLAGS} /Ot")
 	# Omit frame pointer


cmake: added -g3 and -fsanitize options when available

--- src/cmake/common-settings.cmake
+++ src/cmake/common-settings.cmake
@@ -223,9 +223,14 @@

 	# debugging symbols
 	compile_flag("-g"     DEBUG_G     DEBUG RELWITHDEBINFO)
+	compile_flag("-g3"    DEBUG_G3    DEBUG RELWITHDEBINFO)
 	compile_flag("-gfull" DEBUG_GFULL DEBUG RELWITHDEBINFO)
 	compile_flag("-ggdb"  DEBUG_GDB   DEBUG RELWITHDEBINFO)
 	compile_flag("-ggdb3" DEBUG_GDB3  DEBUG RELWITHDEBINFO)
+
+	# extra debugging tools
+	compile_flag("-fsanitize=undefined" DEBUG_SANITIZE_UNDEF DEBUG RELWITHDEBINFO)
+	compile_flag("-fsanitize=address"   DEBUG_SANITIZE_ADDR  DEBUG RELWITHDEBINFO)

 	# warnings
 	compile_flag("-W"                         W   RELEASE DEBUG RELWITHDEBINFO)


Adding gflags for glog and ceres

Adding gflags for glog and ceres

Former-commit-id: 2f8be133b0ae6426c09f81dc56c5d033a8d20e11

--- cmake-modules/Fetch_Gflags.cmake
+++ cmake-modules/Fetch_Gflags.cmake
@@ -7,16 +7,16 @@
     # For some reason gflags imports libunwind.so even though we asked for static libraries.
     # In addition, libgflags.a hides in the property "LOCATION" instead of its rightful
     # place "INTERFACE_LINK_LIBRARIES".
+    add_library(gflags::gflags ALIAS gflags)

-    get_target_property(GFLAGS_INCLUDE_DIR gflags::gflags INTERFACE_INCLUDE_DIRECTORIES)
-    get_target_property(GFLAGS_LIBRARIES   gflags::gflags LOCATION)
+    get_target_property(GFLAGS_INCLUDE_DIR gflags INTERFACE_INCLUDE_DIRECTORIES)
+    get_target_property(GFLAGS_LIBRARIES   gflags LOCATION)
     # In addition, the library may be .so
     get_filename_component(gflags_dir ${GFLAGS_LIBRARIES} DIRECTORY)
     get_filename_component(gflags_we  ${GFLAGS_LIBRARIES} NAME_WE)
     set(GFLAGS_LIBRARIES "${gflags_dir}/${gflags_we}${CUSTOM_SUFFIX}")
-    add_library(gflags::gflags ALIAS gflags)
-    set_target_properties(gflags::gflags PROPERTIES INTERFACE_LINK_LIBRARIES "${GFLAGS_LIBRARIES}")
-    set_target_properties(gflags::gflags PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GFLAGS_INCLUDE_DIR}")
+    set_target_properties(gflags PROPERTIES INTERFACE_LINK_LIBRARIES "${GFLAGS_LIBRARIES}")
+    set_target_properties(gflags PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GFLAGS_INCLUDE_DIR}")
     message(STATUS "Searching for gflags - Success: LIB: ${GFLAGS_LIBRARIES}")
     message(STATUS "Searching for gflags - Success: INC: ${GFLAGS_INCLUDE_DIR}")
 else()


fixed bug that prevented multiple arguments to be passed to coverage run

--- cmake/modules/CodeCoverage.cmake
+++ cmake/modules/CodeCoverage.cmake
@@ -146,11 +146,11 @@
 function(add_coverage_run name command)
   if(CMAKE_HOST_UNIX)
     set(failsafe_command
-      ${command} ${ARGV2} > /dev/null ||
+      ${command} ${ARGN} > /dev/null ||
         ${CMAKE_COMMAND} -E echo "Coverage run returned non-zero exit code")
   elseif(CMAKE_HOST_WIN32)
     set(failsafe_command
-      ${command} ${ARGV2} > NUL ||
+      ${command} ${ARGN} > NUL ||
         ${CMAKE_COMMAND} -E echo "Coverage run returned non-zero exit code")
   else()
     message(


pstex is turned off by default for different reasons now.

svn path=/trunk/; revision=7866

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -104,8 +104,8 @@
 # yet.... :-)
 "plmeta:plmeta:OFF"
 "ps:ps:ON"
-# Default OFF because this device is not well maintained (it currently
-# segfaults).
+# No longer segfaults, but still default OFF because cleaner/better ways
+# (psttf and pscairo) to get modern fonts for postscript results.
 "pstex:pstex:OFF"
 "psttf:psttf:ON"
 "xterm:tek:OFF" "tek4010:tek:OFF" "tek4107:tek:OFF" "mskermit:tek:OFF"


incorporate latest hunter OPENCV_CMAKE_ARGS defaults for opencv 3.1.0 update

--- cmake/Hunter/config.cmake
+++ cmake/Hunter/config.cmake
@@ -10,9 +10,20 @@
   ENABLE_NEON=OFF
   BUILD_ANDROID_SERVICE=OFF
   BUILD_ANDROID_EXAMPLES=OFF
+
+  INSTALL_PYTHON_EXAMPLES=OFF
+  BUILD_WITH_STATIC_CRT=OFF # Fix https://github.com/ruslo/hunter/issues/177
+
+  # Find packages in Hunter (instead of building from OpenCV sources)
   BUILD_ZLIB=OFF ## HUNTER
   BUILD_TIFF=OFF ## HUNTER
   BUILD_PNG=OFF  ## HUNTER
+  BUILD_JPEG=OFF
+
+  BUILD_opencv_java=OFF
+  BUILD_opencv_python2=OFF
+  BUILD_opencv_python3=OFF
+
   ANDROID_EXAMPLES_WITH_LIBS=OFF    # "Build binaries of Android examples with native libraries"

   ### Custom ARGS ###


Removing debug message from ZincPackaging.cmake.  https://tracker.physiomeproject.org/show_bug.cgi?id=3439

git-svn-id: b9baf8c2d14a71b3ba9c27a102eb6e792fc13348@9852 3c1deb5b-d424-0410-962d-aba41a686d42

--- cmake/ZincPackaging.cmake
+++ cmake/ZincPackaging.cmake
@@ -37,7 +37,6 @@
 	IF ( ${CMAKE_VERSION} VERSION_LESS "2.8.11" )
 		MESSAGE( STATUS "The CMAKE_SYSTEM_PROCESSOR will not give the correct value for 64 bit systems." )
 	ENDIF()
-	message(STATUS "dld: ${CPACK_PACKAGE_NAME}")
 	SET( CPACK_GENERATOR "ZIP;NSIS" )
 	SET( CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}" )
 	SET( CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}" )


superbuild: Drop unused 'cmb' and 'smtk' project versions

--- superbuild/versions.cmake
+++ superbuild/versions.cmake
@@ -162,14 +162,6 @@
   URL "http://www.paraview.org/files/dependencies/portfwd-0.29.tar.gz"
   URL_MD5 93161c91e12b0d67ca52dc13708a2f2f)

-#------------------------------------------------------------------------------
-# CMB versions
-#------------------------------------------------------------------------------
-add_revision(cmb
-  GIT_REPOSITORY git@www.kitware.com:ERDC/CMB.git
-  GIT_TAG "master"
-  )
-
 add_revision(vxl
   URL http://vtk.org/files/support/vxl_r35313.tar.gz
   URL_MD5 cb7884a8eb0f816a4bb378dc968c8333)
@@ -202,10 +194,6 @@
   URL_MD5 8d77df722a01cc86b292300a007a3282
   )

-add_revision(smtk
-  GIT_REPOSITORY git@www.kitware.com:SMTK.git
-  GIT_TAG master)
-
 add_revision(shiboken
   GIT_REPOSITORY https://github.com/OpenGeoscience/shiboken.git
   GIT_TAG smtk-head)


Cycles: attempt to fix OIIO include path on windows.

--- cmake/external_libs.cmake
+++ cmake/external_libs.cmake
@@ -36,7 +36,7 @@
 # OpenImageIO

 FIND_LIBRARY(OPENIMAGEIO_LIBRARY NAMES OpenImageIO PATHS ${CYCLES_OIIO}/lib ${CYCLES_OIIO}/dist)
-FIND_PATH(OPENIMAGEIO_INCLUDES OpenImageIO/imageio.h ${CYCLES_OIIO}/include ${CYCLES_OIIO}/dist)
+FIND_PATH(OPENIMAGEIO_INCLUDES OpenImageIO/imageio.h PATHS ${CYCLES_OIIO}/include ${CYCLES_OIIO}/dist)
 FIND_PROGRAM(OPENIMAGEIO_IDIFF NAMES idiff PATHS ${CYCLES_OIIO}/bin ${CYCLES_OIIO}/dist)

 IF(OPENIMAGEIO_INCLUDES AND OPENIMAGEIO_LIBRARY)
@@ -76,7 +76,7 @@
 	MESSAGE(STATUS "CYCLES_OSL = ${CYCLES_OSL}")

 	FIND_LIBRARY(OSL_LIBRARIES NAMES oslexec oslcomp oslquery PATHS ${CYCLES_OSL}/lib ${CYCLES_OSL}/dist)
-	FIND_PATH(OSL_INCLUDES OSL/oslclosure.h ${CYCLES_OSL}/include ${CYCLES_OSL}/dist)
+	FIND_PATH(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include ${CYCLES_OSL}/dist)
 	FIND_PROGRAM(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin ${CYCLES_OSL}/dist)

 	IF(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)


only copy header file of boost

only copy header file of boost

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -70,9 +70,9 @@
   DSTS ${dst_dir} ${dst_dir}/lib
 )

-set(dst_dir "${CMAKE_INSTALL_PREFIX}/third_party/install/boost")
+set(dst_dir "${CMAKE_INSTALL_PREFIX}/third_party/boost/include")
 copy(boost_lib
-  SRCS ${BOOST_INCLUDE_DIR}
+  SRCS ${BOOST_INCLUDE_DIR}/boost
   DSTS ${dst_dir}
 )


Remove deprecated workaround

Remove deprecated workaround

--- cmake/ospray_macros.cmake
+++ cmake/ospray_macros.cmake
@@ -50,12 +50,6 @@
             " directory.")
   else()
     message(STATUS "Found Embree v${EMBREE_VERSION}: ${EMBREE_LIBRARY}")
-  endif()
-
-  # workaround issue in Embree v2.15.0-v2.16.4
-  # where embree-config.cmake returned the symlink in EMBREE_LIBRARY
-  if (IS_SYMLINK ${EMBREE_LIBRARY})
-    get_filename_component(EMBREE_LIBRARY ${EMBREE_LIBRARY} REALPATH)
   endif()

   set(EMBREE_LIBRARIES ${EMBREE_LIBRARY})


qi_create_gtest: remove a very old hack

qi_create_gtest: remove a very old hack

the hack was use when we add gtest packaged in our toolchains,
and we had conflicts with upstream's FindGtest file

now we don't put gtest in our package but put the sources in our
worktree, which is the way we should have done it in the first place,
so the hack no longer is necessary

Change-Id: I757734c486ee9a0a3660069973a94f451309da07
Reviewed-on: http://gerrit.aldebaran.lan:8080/13339
Tested-by: gerrit
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -86,39 +86,6 @@
     return()
   endif()

-  if(NOT DEFINED GTEST_PACKAGE_FOUND)
-    find_package(GTEST NO_MODULE)
-    if(NOT GTEST_PACKAGE_FOUND)
-      qi_set_global(GTEST_PACKAGE_FOUND FALSE)
-    endif()
-  endif()
-
-  if(NOT GTEST_PACKAGE_FOUND)
-    if(NOT QI_CREATE_GTEST_WARNED)
-      qi_info("GTest was not found:
-      qi_create_gtest will create no target
-      ")
-      qi_set_global(QI_CREATE_GTEST_WARNED TRUE)
-    endif()
-    qi_set_global(QI_${name}_TARGET_DISABLED TRUE)
-    return()
-  endif()
-
-  set(_using_qibuild_gtest TRUE)
-  # Make sure we are using the qibuild flavored gtest
-  # package:
-  find_package(gtest_main QUIET)
-  if(NOT GTEST_MAIN_PACKAGE_FOUND)
-    set(_using_qibuild_gtest FALSE)
-    if(NOT QI_GTEST_QIBUID_WARNED)
-      qi_info("Could not find qibuild flavored gtest. (not GTEST_MAIN package)
-      Please use a qibuild port of gtest or be ready to
-      experience weird link errors ...
-      ")
-      qi_set_global(QI_GTEST_QIBUID_WARNED TRUE)
-    endif()
-  endif()
-
   # create tests_results folder if it does not exist
   file(MAKE_DIRECTORY "${_TESTS_RESULTS_FOLDER}")
   cmake_parse_arguments(ARG "NO_ADD_TEST;NIGHTLY" "TIMEOUT" "SRC;DEPENDS;ARGUMENTS" ${ARGN})
@@ -128,10 +95,7 @@

   # First, create the target
   qi_create_bin(${name} SRC ${ARG_SRC} ${ARG_UNPARSED_ARGUMENTS} NO_INSTALL)
-  qi_use_lib(${name} GTEST ${ARG_DEPENDS})
-  if(${_using_qibuild_gtest})
-    qi_use_lib(${name} GTEST_MAIN)
-  endif()
+  qi_use_lib(${name} GTEST GTEST_MAIN ${ARG_DEPENDS})

   # Build a correct xml output name
   set(_xml_output "${_TESTS_RESULTS_FOLDER}/${name}.xml")


CI: allow caching downloaded NDK

CI: allow caching downloaded NDK

--- ci-build.cmake
+++ ci-build.cmake
@@ -69,12 +69,14 @@
         -DOGRE_DEPENDENCIES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ogredeps)
     set(BUILD_DEPS TRUE)

-    message(STATUS "Downloading Android NDK")
-    file(DOWNLOAD
-        http://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
-        ./android-ndk-r13b-linux-x86_64.zip)
-    message(STATUS "Extracting Android NDK")
-    execute_process(COMMAND unzip android-ndk-r13b-linux-x86_64.zip OUTPUT_QUIET)
+    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r13b)
+        message(STATUS "Downloading Android NDK")
+        file(DOWNLOAD
+            http://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
+            ./android-ndk-r13b-linux-x86_64.zip)
+        message(STATUS "Extracting Android NDK")
+        execute_process(COMMAND unzip android-ndk-r13b-linux-x86_64.zip OUTPUT_QUIET)
+    endif()
 endif()

 execute_process(COMMAND cmake


Disable EXPRECISION and add -lm on OSX (same as the BSDs and Linux)

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -8,7 +8,7 @@
   set(NO_EXPRECISION 1)
 endif ()

-if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|OpenBSD|NetBSD|DragonFly")
+if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|OpenBSD|NetBSD|DragonFly|Darwin")
   set(EXTRALIB "${EXTRALIB} -lm")
   set(NO_EXPRECISION 1)
 endif ()


Android: Disable experimental compilers (NDK 0.8c)

--- CMake/toolchain/android.toolchain.cmake
+++ CMake/toolchain/android.toolchain.cmake
@@ -471,6 +471,8 @@
  string( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
  file( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
  __LIST_FILTER( __availableToolchains "^[.]" )
+ __LIST_FILTER( __availableToolchains ".*clang.*") # ignore experimental compilers
+ __LIST_FILTER( __availableToolchains ".*llvm.*")
  set( __availableToolchainMachines "" )
  set( __availableToolchainArchs "" )
  set( __availableToolchainCompilerVersions "" )


Update android toolchain to support latest ndk 0.8b

--HG--
branch : v1-9

--- CMake/toolchain/android.toolchain.cmake
+++ CMake/toolchain/android.toolchain.cmake
@@ -1,5 +1,5 @@
 # ------------------------------------------------------------------------------
-#  Android CMake toolchain file, for use with the Android NDK r5-r8
+#  Android CMake toolchain file, for use with the Android NDK r5-r8b
 #  Requires cmake 2.6.3 or newer (2.8.3 or newer is recommended).
 #  See home page: http://code.google.com/p/android-cmake/
 #
@@ -180,6 +180,10 @@
 #   - modified May 2012
 #     [+] updated for NDK r8
 #     [+] added mips architecture support
+#   - modified July 2012 by ifreedom.cn@gmail.com
+#     [+] updated for NDK r8b
+#     [+] fixed compiler version get
+#     [+] fixed gnu-stl version choose
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
@@ -199,7 +203,7 @@
 #this one not so much
 set( CMAKE_SYSTEM_VERSION 1 )

-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8b -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
 if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
  if( CMAKE_HOST_WIN32 )
   file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
@@ -473,7 +477,8 @@
  foreach( __toolchain ${__availableToolchains} )
   __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK}/toolchains/${__toolchain}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
   if( __machine )
-   string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]+$" __version "${__toolchain}" )
+   string( REGEX MATCH "[0-9]+.[0-9]+(.[0-9]+)?$" __version "${__toolchain}" )
+   string( REGEX MATCH "[0-9]+.[0-9]+(.[0-9]+)?$" __version "${__version}" )
    string( REGEX MATCH "^[^-]+" __arch "${__toolchain}" )
    list( APPEND __availableToolchainMachines ${__machine} )
    list( APPEND __availableToolchainArchs ${__arch} )
@@ -485,6 +490,13 @@
  if( NOT __availableToolchains )
   message( FATAL_ERROR "Could not any working toolchain in the NDK. Probably your Android NDK is broken." )
  endif()
+endif()
+#is ndk r8b?
+list( FIND __availableToolchainCompilerVersions "4.6" __hasGCC46 )
+if( __hasGCC46 EQUAL -1 )
+ set( __hasGCC46 FALSE )
+else()
+ set( __hasGCC46 TRUE )
 endif()

 #build list of available ABIs
@@ -669,8 +681,13 @@
   set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/stlport/stlport" )
   set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/stlport/libs/${ANDROID_NDK_ABI_NAME}" )
  else()
-  set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include" )
-  set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}" )
+  if(__hasGCC46)
+   set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/include" )
+   set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}" )
+  else()
+   set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include" )
+   set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}" )
+  endif()
  endif()
 endif()


Make ament_python_install_package() match setuptools' egg names. (#338)

Signed-off-by: Michel Hidalgo <2c7f9fd20fbeb41ce8894ec4653d66fa7f3b6e1a@ekumenlabs.com>

--- ament_cmake_python/cmake/ament_python_install_package.cmake
+++ ament_cmake_python/cmake/ament_python_install_package.cmake
@@ -127,9 +127,15 @@
     DEPENDS ${egg_dependencies}
   )

+  set(python_version "py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
+
+  set(egg_name "${package_name}")
+  set(egg_install_name "${egg_name}-${ARG_VERSION}")
+  set(egg_install_name "${egg_install_name}-${python_version}")
+
   install(
-    DIRECTORY "${build_dir}/${package_name}.egg-info"
-    DESTINATION "${ARG_DESTINATION}/"
+    DIRECTORY "${build_dir}/${egg_name}.egg-info/"
+    DESTINATION "${ARG_DESTINATION}/${egg_install_name}.egg-info"
   )

   if(ARG_SCRIPTS_DESTINATION)


Ensure we also put gluon_global.h in hte right place

--- cmake/GluonVariables.cmake
+++ cmake/GluonVariables.cmake
@@ -22,6 +22,6 @@
         set( GLUON_ARCHITECTURE "32" )
     endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

-    configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/gluon_global.h.in ${CMAKE_CURRENT_BINARY_DIR}/gluon_global.h )
-    install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gluon_global.h DESTINATION ${INCLUDE_INSTALL_DIR} )
+    configure_file( ${CMAKE_SOURCE_DIR}/gluon_global.h.in ${CMAKE_BINARY_DIR}/gluon_global.h )
+    install( FILES ${CMAKE_BINARY_DIR}/gluon_global.h DESTINATION ${INCLUDE_INSTALL_DIR} )
 endif( NOT DEFINED ${GLUON_VERSION_STRING} )


cmake: Check CPU architecture by pointer size if we are not cross compiling

--- cmake/PlatformDetect.cmake
+++ cmake/PlatformDetect.cmake
@@ -31,10 +31,21 @@
 endfunction (plib_detect_os_bits)

 function (plib_detect_cpu_arch result)
-	if (CMAKE_SYSTEM_PROCESSOR MATCHES "i*86")
-		set (PLIB_PROCESSOR_ARCH x86)
-	elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
-		set (PLIB_PROCESSOR_ARCH x64)
+	if (CMAKE_SYSTEM_PROCESSOR MATCHES "[i?86 x86_64]")
+		if (CMAKE_CROSSCOMPILING)
+			if (CMAKE_SYSTEM_PROCESSOR MATCHES "i?386")
+				set (PLIB_PROCESSOR_ARCH "x86")
+			else()
+				set (PLIB_PROCESSOR_ARCH "x64")
+			endif()
+		else()
+			plib_detect_os_bits (PLIB_OS_BITS)
+			if (PLIB_OS_BITS STREQUAL "32")
+				set (PLIB_PROCESSOR_ARCH "x86")
+			else()
+				set (PLIB_PROCESSOR_ARCH "x64")
+			endif()
+		endif()
 	else()
 		set (PLIB_PROCESSOR_ARCH ${CMAKE_SYSTEM_PROCESSOR MATCHES})
 	endif()


[build] Enable -Werror on Linux & Mac (#4941)

--- cmake/TaichiCXXFlags.cmake
+++ cmake/TaichiCXXFlags.cmake
@@ -49,6 +49,9 @@

     # [Global] CXX compilation option to enable all warnings.
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ")
+
+    # [Global] CXX compilation option to treat all warnings as errors.
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror ")

     # [Global] By default, CXX compiler will throw a warning if it decides to ignore an attribute, for example "[[ maybe unused ]]".
     # However, this behaviour diverges across different compilers (GCC/CLANG), as well as different compiler versions.


Fix issue with thirdparty compilation of FFTW

--- cmake/ThirdPartyFFTW.cmake
+++ cmake/ThirdPartyFFTW.cmake
@@ -41,7 +41,7 @@
             CONFIGURE_COMMAND ${TPSRC}/fftw-3.2.2/configure --prefix=${TPDIST} --quiet --enable-shared --disable-dependency-tracking
         )

-        SET(FFTW_LIBRARY fftw CACHE FILEPATH
+        SET(FFTW_LIBRARY fftw3 CACHE FILEPATH
             "FFTW library" FORCE)
         SET(FFTW_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
             "FFTW include" FORCE)


update mklml tag

update mklml tag

--- cmake/external/mklml.cmake
+++ cmake/external/mklml.cmake
@@ -27,8 +27,8 @@
 INCLUDE(ExternalProject)

 SET(MKLML_PROJECT       "extern_mklml")
-SET(MKLML_VER           "mklml_lnx_2018.0.20170720")
-SET(MKLML_URL           "https://github.com/01org/mkl-dnn/releases/download/v0.10/${MKLML_VER}.tgz")
+SET(MKLML_VER           "mklml_lnx_2018.0.1.20171007")
+SET(MKLML_URL           "https://github.com/01org/mkl-dnn/releases/download/v0.11/${MKLML_VER}.tgz")
 SET(MKLML_SOURCE_DIR    "${THIRD_PARTY_PATH}/mklml")
 SET(MKLML_DOWNLOAD_DIR  "${MKLML_SOURCE_DIR}/src/${MKLML_PROJECT}")
 SET(MKLML_DST_DIR       "mklml")