Fix shader compilation on windows

Fix shader compilation on windows

--- 3rdparty/rclib/RCLib.cmake
+++ 3rdparty/rclib/RCLib.cmake
@@ -30,9 +30,8 @@
     add_custom_command(
         WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
         TARGET ${RC_LIB_NAME}_files
-        PRE_BUILD
         COMMAND $<TARGET_FILE:rcc>
-        ARGS "$<TARGET_PROPERTY:${RC_LIB_NAME},build_dir>/${RC_HEADER_FILE}" ${RESOURCES_FILES}
+        ARGS ${RC_HEADER_FILE} ${RESOURCES_FILES}
         DEPENDS ${RESOURCES_FILES}
         COMMENT "Building resource header ${RC_HEADER_FILE}"
         VERBATIM


Testsuite: Do not write revision.log, this is now done in setup_git.cmake

--- tests/run_testsuite.cmake
+++ tests/run_testsuite.cmake
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2013 - 2014 by the deal.II authors
+## Copyright (C) 2013 - 2015 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -335,7 +335,7 @@
 ENDIF()

 EXECUTE_PROCESS(
-   COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%H %h %ae"
+   COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h"
    WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY}
    OUTPUT_VARIABLE _git_WC_INFO
    RESULT_VARIABLE _result
@@ -346,14 +346,8 @@
   MESSAGE(FATAL_ERROR "\nCould not retrieve git information. Bailing out.\n")
 ENDIF()

-STRING(REGEX REPLACE "^\"([^ ]+) ([^ ]+) ([^\"]+)\""
-         "\\1" _git_WC_REV "${_git_WC_INFO}")
-
-STRING(REGEX REPLACE "^\"([^ ]+) ([^ ]+) ([^\"]+)\""
-         "\\2" _git_WC_SHORTREV "${_git_WC_INFO}")
-
-STRING(REGEX REPLACE "^\"([^ ]+) ([^ ]+) ([^\"]+)\""
-         "\\3" _git_WC_AUTHOR "${_git_WC_INFO}")
+STRING(REGEX REPLACE "^\"([^ ]+)\""
+         "\\1" _git_WC_SHORTREV "${_git_WC_INFO}")

 EXECUTE_PROCESS(
    COMMAND ${GIT_EXECUTABLE} symbolic-ref HEAD
@@ -365,21 +359,6 @@

 STRING(REGEX REPLACE "refs/heads/" ""
   _git_WC_BRANCH "${_git_WC_BRANCH}")
-
-#
-# Write revision log:
-#
-
-FILE(WRITE ${CTEST_BINARY_DIRECTORY}/revision.log
-"###
-#
-#  Git information:
-#    Branch: ${_git_WC_BRANCH}
-#    Commit: ${_git_WC_REV}
-#    Author: ${_git_WC_AUTHOR}
-#
-###"
-  )

 IF(NOT "${_git_WC_BRANCH}" STREQUAL "")
   SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_git_WC_BRANCH}")


ENH: Merge changes from main tree into VTK-5-0 branch. (cvs -q up -j1.9 -j1.10 CMake/vtkTclTkMacros.cmake)

--- CMake/vtkTclTkMacros.cmake
+++ CMake/vtkTclTkMacros.cmake
@@ -15,11 +15,16 @@

   SET (${tcl_tk_major_version} "")
   SET (${tcl_tk_minor_version} "")
+  IF (TK_INTERNAL_PATH)
+    SET (try_tk_internal_path ${TK_INTERNAL_PATH})
+  ELSE (TK_INTERNAL_PATH)
+    SET (try_tk_internal_path ${VTK_TK_INTERNAL_DIR})
+  ENDIF (TK_INTERNAL_PATH)
   FOREACH (tcl_tk_minor_version_try "2" "3" "4")
-    IF ("${TK_INTERNAL_PATH}" MATCHES "tk8\\.?${tcl_tk_minor_version_try}")
-      SET (${tcl_tk_major_version} "8")
-      SET (${tcl_tk_minor_version} ${tcl_tk_minor_version_try})
-    ENDIF ("${TK_INTERNAL_PATH}" MATCHES "tk8\\.?${tcl_tk_minor_version_try}")
+    IF ("${try_tk_internal_path}" MATCHES "tk8\\.?${tcl_tk_minor_version_try}")
+      SET (${tcl_tk_major_version} "8")
+      SET (${tcl_tk_minor_version} ${tcl_tk_minor_version_try})
+    ENDIF ("${try_tk_internal_path}" MATCHES "tk8\\.?${tcl_tk_minor_version_try}")
     IF ("${TCL_LIBRARY}" MATCHES "tcl8\\.?${tcl_tk_minor_version_try}")
       SET (${tcl_tk_major_version} "8")
       SET (${tcl_tk_minor_version} ${tcl_tk_minor_version_try})


Include liboctinterp in octave linking because it resolves some symbols
that are used by our octave interface.

svn path=/trunk/; revision=7086

--- cmake/modules/octave.cmake
+++ cmake/modules/octave.cmake
@@ -84,7 +84,14 @@
   )
   message(STATUS "OCTAVE_LIBRARIES = ${OCTAVE_LIBRARIES}")

-  if(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES)
+  find_library(
+  OCTINTERP_LIBRARIES
+  octinterp
+  PATH_SUFFIXES octave-${OCTAVE_VERSION}
+  )
+  message(STATUS "OCTINTERP_LIBRARIES = ${OCTINTERP_LIBRARIES}")
+
+  if(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
     #Must always have second octave include path which is identical
     #to the first with trailing "/octave" trimmed off.
     string(REGEX REPLACE "/octave$" ""
@@ -98,11 +105,11 @@
     message(STATUS
     "(transformed) OCTAVE_INCLUDE_PATH = ${OCTAVE_INCLUDE_PATH}"
     )
-  else(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES)
+  else(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
     message(STATUS "WARNING: "
     "octave headers and/or library not found. Disabling octave bindings")
     set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
-  endif(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES)
+  endif(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
 endif(ENABLE_octave)

 if(ENABLE_octave)


Applied patch from #3119 to provide option to not override project name

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -132,11 +132,16 @@
   # Record that we've been called
   set(ROSBUILD_init_called 1)

-  # Infer package name from directory name.
-  get_filename_component(_project ${CMAKE_SOURCE_DIR} NAME)
+  # Don't override the project name if the user said not to, #3119
+  if(NOT DEFINED ROSBUILD_DONT_REDEFINE_PROJECT)
+    # Infer package name from directory name.
+    get_filename_component(_project ${CMAKE_SOURCE_DIR} NAME)
+    project(${_project})
+  else(NOT DEFINED ROSBUILD_DONT_REDEFINE_PROJECT)
+    set(_project ${PROJECT_NAME})
+  endif(NOT DEFINED ROSBUILD_DONT_REDEFINE_PROJECT)
+
   message("[rosbuild] Building package ${_project}")
-
-  project(${_project})

   # Must call include(rosconfig) after project, because rosconfig uses
   # PROJECT_SOURCE_DIR


- Fix to Emscripten WASM option

- Fix to Emscripten WASM option

--- cmake/Toolchains/js-emscripten.toolchain.cmake
+++ cmake/Toolchains/js-emscripten.toolchain.cmake
@@ -24,8 +24,8 @@
 option ( COFFEE_GENERATE_WASM "Generate WASM version of code, not asm.js" OFF )

 if(COFFEE_GENERATE_WASM)
-    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_WASM=1" )
-    set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_WASM=1" )
+    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s WASM=1" )
+    set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s WASM=1" )
 endif()

 set(CMAKE_CROSSCOMPILING TRUE)


cmake: fix post-copy-dylibs

cmake: fix post-copy-dylibs

--- cmake/qibuild/templates/post-copy-dylibs.cmake
+++ cmake/qibuild/templates/post-copy-dylibs.cmake
@@ -29,7 +29,8 @@

 foreach(_lib ${_libs})
   if(${_lib} MATCHES ".*\\.dylib")
-    list(APPEND _in_dylibs ${_lib})
+    get_filename_component(_abs ${_lib} REALPATH)
+    list(APPEND _in_dylibs ${_abs})
   endif()
 endforeach()


fixed build error

fixed build error

--- cmake-modules/sl-ext-libs.cmake
+++ cmake-modules/sl-ext-libs.cmake
@@ -217,6 +217,7 @@
         OUTPUT_NAME_DEBUG   "hidapi${DEBUG_SUFFIX}"
     )
     target_include_directories(hidapi PUBLIC ${HIDAPI_INCLUDE_DIRS})
+    target_include_directories(hidapi PRIVATE ${LIBUSB_INCLUDE_DIRS})

   endif()
 endfunction()


Always force type in distortosSet*Configuration()

With previous change in majority of cases current type (INTERNAL, as
variables are hidden initially) will be different than the final type.

--- cmake/distortos-utilities.cmake
+++ cmake/distortos-utilities.cmake
@@ -175,10 +175,7 @@

 	set("${name}" "${defaultValue}" CACHE ${type} "" ${force})
 	set_property(CACHE "${name}" PROPERTY HELPSTRING "${help}")
-	get_property(currentType CACHE "${name}" PROPERTY TYPE)
-	if(NOT currentType STREQUAL type)
-		set_property(CACHE "${name}" PROPERTY TYPE ${type})
-	endif()
+	set_property(CACHE "${name}" PROPERTY TYPE ${type})

 	# verify currently set value
 	set(currentValue ${${name}})
@@ -230,10 +227,7 @@

 	set("${name}" "${defaultValue}" CACHE ${type} "" ${force})
 	set_property(CACHE "${name}" PROPERTY HELPSTRING "${help}")
-	get_property(currentType CACHE "${name}" PROPERTY TYPE)
-	if(NOT currentType STREQUAL type)
-		set_property(CACHE "${name}" PROPERTY TYPE ${type})
-	endif()
+	set_property(CACHE "${name}" PROPERTY TYPE ${type})

 	# verify currently set value
 	set(currentValue "${${name}}")
@@ -279,10 +273,7 @@
 	set("${name}" "${defaultValue}" CACHE ${type} "" ${force})
 	set_property(CACHE "${name}" PROPERTY HELPSTRING "${help}")
 	set_property(CACHE "${name}" PROPERTY STRINGS "${STRING_UNPARSED_ARGUMENTS}")
-	get_property(currentType CACHE "${name}" PROPERTY TYPE)
-	if(NOT currentType STREQUAL type)
-		set_property(CACHE "${name}" PROPERTY TYPE ${type})
-	endif()
+	set_property(CACHE "${name}" PROPERTY TYPE ${type})

 	# verify currently set value
 	set(currentValue ${${name}})


Pin googletest version

Pin googletest version

--- cmake/external/googletest.cmake
+++ cmake/external/googletest.cmake
@@ -35,7 +35,7 @@
 ExternalProject_Add(${GTEST_TARGET}
     PREFIX ${GTEST_TARGET}
     GIT_REPOSITORY https://github.com/google/googletest.git
-    GIT_TAG master
+    GIT_TAG d655d09
     UPDATE_COMMAND ""
     CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
                      -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}


[CMake] LINK_COMPONENTS: Add also corresponding MCTargetDesc and TargetInfo as well, when target names or "nativecodegen" are specified.

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

--- cmake/modules/LLVM-Config.cmake
+++ cmake/modules/LLVM-Config.cmake
@@ -105,6 +105,9 @@
       if( TARGET LLVM${c}AsmParser )
         list(APPEND expanded_components "LLVM${c}AsmParser")
       endif()
+      if( TARGET LLVM${c}Desc )
+        list(APPEND expanded_components "LLVM${c}Desc")
+      endif()
       if( TARGET LLVM${c}Info )
         list(APPEND expanded_components "LLVM${c}Info")
       endif()
@@ -115,6 +118,12 @@
       # already processed
     elseif( c STREQUAL "nativecodegen" )
       list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}CodeGen")
+      if( TARGET LLVM${LLVM_NATIVE_ARCH}Desc )
+        list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}Desc")
+      endif()
+      if( TARGET LLVM${LLVM_NATIVE_ARCH}Info )
+        list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}Info")
+      endif()
     elseif( c STREQUAL "backend" )
       # same case as in `native'.
     elseif( c STREQUAL "engine" )


Extra empty space removed from flatbuffers.cmake

--- tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
+++ tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
@@ -63,10 +63,9 @@
 # purposes the FLATC_INSTALL_PREFIX is already in cache and is just used in this module.
 # In case of standard flatbuffers build (as a dependency) the variable needs to be set.
 if(NOT DEFINED FLATC_INSTALL_PREFIX)
-  set(FLATC_INSTALL_PREFIX <INSTALL_DIR>  CACHE PATH "Flatc installation directory")
+  set(FLATC_INSTALL_PREFIX <INSTALL_DIR> CACHE PATH "Flatc installation directory")
 endif()

-#message(STATUS $CACHE{FLATC_INSTALL_PREFIX})
 ExternalProject_Add(flatbuffers-flatc
   PREFIX ${CMAKE_BINARY_DIR}/flatbuffers-flatc
   SOURCE_DIR ${CMAKE_BINARY_DIR}/flatbuffers


wrapping: check for Tcl wrapping exclusion for warnings

Don't warn if the module isn't wrapped for Tcl explicitly.

Change-Id: Iba520319f810938e6e60ff39475cbde736543786

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -128,7 +128,8 @@
   list(SORT ${vtk-module}_DEPENDS) # Deterministic order.
   list(SORT ${vtk-module-test}_DEPENDS) # Deterministic order.
   list(SORT ${vtk-module}_IMPLEMENTS) # Deterministic order.
-  if(NOT ${vtk-module}_EXCLUDE_FROM_WRAPPING AND
+  if(NOT (${vtk-module}_EXCLUDE_FROM_WRAPPING OR
+          ${vtk-module}_EXCLUDE_FROM_TCL_WRAPPING) AND
       "${${vtk-module}_TCL_NAME}" MATCHES "[0-9]")
     message(AUTHOR_WARNING "Specify a TCL_NAME with no digits.")
   endif()


STYLE: Update VTK version to 6.3

STYLE: Update VTK version to 6.3

--- SuperBuild/External_VTK.cmake
+++ SuperBuild/External_VTK.cmake
@@ -42,7 +42,7 @@
 endif()

 if(USE_VTKv6)
-  set(${extProjName}_REQUIRED_VERSION "6.1")  #If a required version is necessary, then set this, else leave blank
+  set(${extProjName}_REQUIRED_VERSION "6.3.0")  #If a required version is necessary, then set this, else leave blank
 else()
   set(${extProjName}_REQUIRED_VERSION "5.10")  #If a required version is necessary, then set this, else leave blank
 endif()
@@ -194,7 +194,7 @@
     )
   ### --- End Project specific additions
 if(USE_VTKv6)
-  set(${proj}_GIT_TAG "v6.1.0")
+  set(${proj}_GIT_TAG "v6.3.0")
   set(${proj}_REPOSITORY ${git_protocol}://vtk.org/VTK.git)
 else()
   set(${proj}_REPOSITORY ${git_protocol}://github.com/BRAINSia/VTK.git)
@@ -234,7 +234,7 @@
     )

 if(USE_VTKv6)
-  set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-install/lib/cmake/vtk-6.1)
+  set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-install/lib/cmake/vtk-6.3)
 else()
   set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-install/lib/vtk-5.10)
 endif()


cmake,deps: Fixed dependencies installing when not needed

Previously, the build system would erroneously install
BoxFort to $DESTDIR at the full binary path -- this caused
problems for package managers, where a make install DESTDIR=...
would populate the tree with boxfort files for $(pwd),
which would cause conflicts when installing them (plus it
installed things outside of the prefix, which is bad).

This is a quick & dirty fix for that. I'm not too convinced
about using ExternalProject_Add anymore for dependencies.

--- .cmake/Modules/Subprojects.cmake
+++ .cmake/Modules/Subprojects.cmake
@@ -58,13 +58,16 @@
         "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
     endif ()
     set (build_cmds
-      CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR>
-        -DCMAKE_INSTALL_PREFIX=${install_prefix}
+      CONFIGURE_COMMAND DESTDIR= ${CMAKE_COMMAND} <SOURCE_DIR>
+      -DCMAKE_INSTALL_PREFIX=${install_prefix}
         -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
         -G "${ARGS_GENERATOR}"
         ${ARGS_OPTS}
       BUILD_COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}/${_NAME}"
-      INSTALL_COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}/${_NAME}" --target install
+      INSTALL_COMMAND cmake -E echo "Skipping install step."
+    )
+    set (install_cmds
+      DESTDIR= ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}/${_NAME}" --target install
     )
   elseif (ARGS_AUTOTOOLS)
     set (make_opts "")
@@ -73,9 +76,12 @@
     endif ()
     set (build_cmds
       UPDATE_COMMAND <SOURCE_DIR>/autogen.sh
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${install_prefix} ${ARGS_OPTS}
+      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=/ ${ARGS_OPTS}
       BUILD_COMMAND make ${make_opts}
-      INSTALL_COMMAND make install
+      INSTALL_COMMAND cmake -E echo "Skipping install step."
+    )
+    set (install_cmds
+      make DESTDIR= install
     )
   endif ()

@@ -87,6 +93,24 @@
     BINARY_DIR "${CMAKE_BINARY_DIR}/${_NAME}"

     ${build_cmds}
+  )
+
+  externalproject_add_step(${_NAME} bootstrap
+    COMMAND ${install_cmds}
+    DEPENDEES build
+  )
+  externalproject_add_steptargets(${_NAME} bootstrap)
+
+  set_target_properties(${_NAME} PROPERTIES EXCLUDE_FROM_ALL 1)
+
+  add_custom_command(
+    OUTPUT ${CMAKE_BINARY_DIR}/${_NAME}-dep
+    COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${_NAME}-bootstrap
+    COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/${_NAME}-dep
+  )
+
+  add_custom_target(${_NAME}-dependency
+    DEPENDS ${CMAKE_BINARY_DIR}/${_NAME}-dep
   )

   if (WIN32)
@@ -116,7 +140,7 @@
   set (options STATIC SHARED)
   cmake_parse_arguments (ARGS "${options}" "" "" ${ARGN})

-  add_dependencies("${_TARGET}" "${_SUBPROJECT}")
+  add_dependencies("${_TARGET}" "${_SUBPROJECT}-dependency")
   if (ARGS_SHARED)
     target_link_libraries("${_TARGET}" "${${_SUBPROJECT}_SHARED_LIB}")
   endif ()


Update documentation.

Update documentation.

--- tests/Makefile.cmake
+++ tests/Makefile.cmake
@@ -30,8 +30,8 @@

 # Source-to-source compiler configuration
-# use local memory -> set HIPACC_LMEM to off|Linear1D|Linear2D|Array2D
-# use texture memory -> set HIPACC_TEX to off|on
+# use local memory -> set HIPACC_LMEM to off|on
+# use texture memory -> set HIPACC_TEX to off|Linear1D|Linear2D|Array2D
 # vectorize code (experimental, doesn't work) -> set HIPACC_VEC to off|on
 # pad images to a multiple of n bytes -> set HIPACC_PAD to n
 # map n output pixels to one thread -> set HIPACC_PPT to n


Build HDF5 libraries as shared on Windows

Otherwise, find_package(HDF5) didn't find them (we could set a CMake option instead, but that's
getting a bit messy)

--- SuperBuild/External_HDF5.cmake
+++ SuperBuild/External_HDF5.cmake
@@ -62,6 +62,11 @@
     message(STATUS "HDF5 PATCH_COMMAND=${PATCH_COMMAND}")
   endif()

+  if (WIN32)
+    # It seems that we need shared libraries on Windows, as static ones aren't automatically found
+    set(CMAKE_ARGS_WIN -DBUILD_SHARED_LIBS:BOOL=ON)
+  endif()
+
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     URL ${${proj}_URL}
@@ -71,6 +76,7 @@

     CMAKE_ARGS
       ${CLANG_ARG}
+	  ${CMAKE_ARGS_WIN}
       -DHDF5_BUILD_EXAMPLES:BOOL=OFF
       -DHDF5_BUILD_TOOLS:BOOL=OFF
       -DHDF5_BUILD_HL_LIB:BOOL=${HDF5_BUILD_HL_LIB}


exotica: Do not force CMAKE_BUILD_TYPE=RelWithDebInfo - It turns essential debug checks in Eigen off and we missed bugs due to that!! - Users should set it in their additional catkin cmake args rather than a project forcing it

--- exotica/cmake/Exotica.cmake
+++ exotica/cmake/Exotica.cmake
@@ -2,10 +2,6 @@

 message(STATUS "Compiling using c++ 11 (required by EXOTica)")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-
-set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Only allows RelWithDebInfo" FORCE)
-SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "RelWithDebInfo" FORCE)
-message(STATUS "Forcing build type ${CMAKE_BUILD_TYPE} (required by EXOTica)")

 if(EXISTS "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/Ref.h")
    message(STATUS "Eigen found")


ConfigureChecks: configure into the build tree

This helps to keep the source tree cleaner.

--- expat/ConfigureChecks.cmake
+++ expat/ConfigureChecks.cmake
@@ -40,5 +40,5 @@
     set(SIZE_T "unsigned")
 endif(HAVE_SYS_TYPES_H)

-configure_file(expat_config.h.cmake expat_config.h)
+configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")
 add_definitions(-DHAVE_EXPAT_CONFIG_H)


Fix zlib1.dll missing issue.

Fix zlib1.dll missing issue.

--- external/zlib/Options.cmake
+++ external/zlib/Options.cmake
@@ -8,8 +8,7 @@

 # ZLIB library options
 set_option(ZLIB_ENABLED TRUE BOOL "Build 'zlib' 3rdparty/external libraries?")
-# By default ZLIB builds both shared and static libraries
-#set_option(ZLIB_SHARED_LIBRARIES TRUE BOOL "Build 'zlib' shared libraries?")
+set_option(ZLIB_SHARED_LIBRARIES FALSE BOOL "Build 'zlib' shared libraries?")
 set_option(ZLIB_BUILD_DOCS FALSE BOOL "Build 'zlib' documentation?")
 # ZLIB doesn't provide examples
 set_option(ZLIB_BUILD_EXAMPLES FALSE BOOL "Build 'zlib' examples?")
@@ -24,7 +23,11 @@
 set(ZLIB_EXAMPLES example-zlib minigzip example64-zlib minigzip64)

 # Create a list of libraries provided by this 3rd party/external module
-set(ZLIB_LIBS zlib zlibstatic)
+if(ZLIB_SHARED_LIBRARIES)
+  set(ZLIB_LIBS zlib)
+else(ZLIB_SHARED_LIBRARIES)
+  set(ZLIB_LIBS zlibstatic)
+endif(ZLIB_SHARED_LIBRARIES)
 # Push the list to the parent scope for projects to reference
 set(ZLIB_LIBS ${ZLIB_LIBS} PARENT_SCOPE)

@@ -53,7 +56,11 @@
   # Define the libraries produced by this external module

   # Define the global list of libraries produced by this external module
-  set(FIND_LIBRARIES zlib zlibstatic)
+if(ZLIB_SHARED_LIBRARIES)
+  set(FIND_LIBRARIES zlib)
+else(ZLIB_SHARED_LIBRARIES)
+  set(FIND_LIBRARIES zlibstatic)
+endif(ZLIB_SHARED_LIBRARIES)

   # Define the include directory to reference for this external module
   set(FIND_INCLUDE_DIR


SuperBuild: boost remove find_package call

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -5,23 +5,13 @@
 # http://hg.orfeo-toolbox.org/OTB/r# ev/8da67e36c78d

 INCLUDE_ONCE_MACRO(BOOST)
-  # Required
-  find_package ( Boost
-    1.35.0
-    )
-  # Optional components
-  find_package ( Boost
-    1.35.0
-    COMPONENTS unit_test_framework date_time
-    )

+SETUP_SUPERBUILD(BOOST)
+
+option(SUPERBUILD_BOOST_HEADER_ONLY "Only use Boost headers" ON)
+mark_as_advanced(SUPERBUILD_BOOST_HEADER_ONLY)

-  SETUP_SUPERBUILD(BOOST)
-
-  option(SUPERBUILD_BOOST_HEADER_ONLY "Only use Boost headers" ON)
-  mark_as_advanced(SUPERBUILD_BOOST_HEADER_ONLY)
-
-  if(UNIX)
+if(UNIX)
     if(SUPERBUILD_BOOST_HEADER_ONLY)
       ExternalProject_Add(BOOST
         PREFIX BOOST


Issue #35: Turn on vtkExternalRendering.

--- CMake/ExternalProjects/VTK.cmake
+++ CMake/ExternalProjects/VTK.cmake
@@ -72,6 +72,12 @@
      )
   endif()

+  if(VTK_VERSION VERSION_GREATER "7.0")
+    list(APPEND additional_cmake_args
+         -DModule_vtkRenderingExternal:BOOL=ON
+        )
+  endif()
+
   if(CTEST_USE_LAUNCHERS)
     list(APPEND additional_cmake_args
       "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake"


ENH: Add cppcheck, KWStyle, and valgrind checks to Deathstar Debian.

--- Deathstar_Kitware_TubeTK_Nightly.cmake
+++ Deathstar_Kitware_TubeTK_Nightly.cmake
@@ -95,10 +95,10 @@

 set( SITE_NIGHTLY_BUILD ON ) # Must be on for any Nightly to run
 set( SITE_NIGHTLY_TEST ON )
-set( SITE_NIGHTLY_CPPCHECK OFF )
-set( SITE_NIGHTLY_KWSTYLE OFF )
+set( SITE_NIGHTLY_CPPCHECK ON )
+set( SITE_NIGHTLY_KWSTYLE ON )
 set( SITE_NIGHTLY_COVERAGE ON )
-set( SITE_NIGHTLY_MEMORY OFF )
+set( SITE_NIGHTLY_MEMORY ON )
 set( SITE_NIGHTLY_PACKAGE ON )
 set( SITE_NIGHTLY_UPLOAD ON )


Fixed missing CMake variable expansion.

Fixed missing CMake variable expansion.

--- CMake/mitkMacroCheckModule.cmake
+++ CMake/mitkMacroCheckModule.cmake
@@ -54,7 +54,7 @@
     list(SORT PACKAGE_DEPENDS)
   endwhile()

-  foreach(_package PACKAGE_DEPENDS)
+  foreach(_package ${PACKAGE_DEPENDS})
     if((DEFINED MITK_USE_${_package}) AND NOT (${MITK_USE_${_package}}))
       list(APPEND ${RESULT_VAR} ${_package})
     endif()


Bake templates into the compiler binary

Bake templates into the compiler binary

Summary: [Thrift] Bake templates into the compiler binary rather than having to package the templates with the compiler.

Reviewed By: stevegury, vitaut

Differential Revision: D16356056

fbshipit-source-id: b971dce7aada8dc2a26587fbf818e661acd0c555

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -99,10 +99,6 @@
     thrift_include_options
     "-I;$<JOIN:$<TARGET_PROPERTY:${LIB_NAME}.thrift_includes,INTERFACE_INCLUDE_DIRECTORIES>,;-I;>"
   )
-  file(
-    GLOB_RECURSE THRIFT_TEMPLATE_FILES
-    FOLLOW_SYMLINKS "${FBTHRIFT_TEMPLATES_DIR}/cpp2/*.mustache"
-  )

   # Emit the rule to run the thrift compiler
   add_custom_command(
@@ -115,7 +111,6 @@
     COMMAND
       "${FBTHRIFT_COMPILER}"
       --strict
-      --templates "${FBTHRIFT_TEMPLATES_DIR}"
       --gen "mstch_cpp2:${GEN_ARG_STR}"
       "${thrift_include_options}"
       -o "${output_dir}"


New version: 0.3.5

New version: 0.3.5

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "3")
-SET(HAWKEY_PATCH "4")
+SET(HAWKEY_PATCH "5")


New version: 0.4.3

New version: 0.4.3

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "2")
+SET(HAWKEY_PATCH "3")


fix condition where the dlls need to be installed (#4326)

--- cmake/ArangoDBInstall.cmake
+++ cmake/ArangoDBInstall.cmake
@@ -241,10 +241,12 @@
     message(FATAL_ERROR, "BUNDLE_OPENSSL set but couldn't locate SSL DLLs. Please set LIB_EAY_RELEASE_DLL and SSL_EAY_RELEASE_DLL")
   endif()

+endif()
+
+if (SSL_NUGET)
   install (FILES "${LIB_EAY_RELEASE_DLL}" DESTINATION "${CMAKE_INSTALL_BINDIR}/" COMPONENT Libraries)
   install (FILES "${SSL_EAY_RELEASE_DLL}" DESTINATION "${CMAKE_INSTALL_BINDIR}/" COMPONENT Libraries)
 endif()
-

 if (THIRDPARTY_SBIN)
   install(FILES ${THIRDPARTY_SBIN}


Update hunter_default_version for Qt (5.10.1 -> 5.11.1)

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -112,7 +112,7 @@
 elseif(IOS OR ANDROID)
   hunter_default_version(Qt VERSION 5.9.1-p0)
 else()
-  hunter_default_version(Qt VERSION 5.10.1)
+  hunter_default_version(Qt VERSION 5.11.1)
 endif()

 hunter_default_version(QtAndroidCMake VERSION 1.0.9)


add the missing macro PADDLE_USE_MKLDNN

add the missing macro PADDLE_USE_MKLDNN

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -67,4 +67,5 @@
 SET_PROPERTY(TARGET mkldnn PROPERTY IMPORTED_LOCATION ${MKLDNN_LIB})
 ADD_DEPENDENCIES(mkldnn ${MKLDNN_PROJECT})
 MESSAGE(STATUS "MKLDNN library: ${MKLDNN_LIB}")
+add_definitions(-DPADDLE_USE_MKLDNN)
 LIST(APPEND external_project_dependencies mkldnn)


Adds more control for building MKL-DNN. (#322)

* Adds CMake variables `MKLDNN_BUILD_COMMAND_EXTRA_FLAGS`
  and `MKLDNN_CMAKE_EXTRA_FLAGS`.

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -17,6 +17,34 @@
 # Fetch and install MKL-DNN
 #----------------------------------------------------------------------------------------------------------

+set(MKLDNN_BUILD_COMMAND_EXTRA_FLAGS ""
+    CACHE STRING "Additional flags to supply to '${CMAKE_MAKE_PROGRAM}' when building MKLDNN."
+    )
+
+set(MKLDNN_CMAKE_EXTRA_FLAGS ""
+    CACHE STRING "Additional flags to supply to 'cmake' when building the MKLDNN build."
+    )
+
+# CMake is a terrible language when it comes to lists and strings.  Here's the behavior we *want*:
+#   1. CMake's user enters a space-separated list of additional command-line argments to be supplied
+#      to the 'make' invocation that builds MKL-DNN.
+#
+#   2. When that 'make' invocation occurs, each of thoise command-line arguments is a separate token
+#      on the command-line of the 'make' invocation.
+#
+# To avoid CMake grouping all of those command-line arguments together into a single, quote-
+# delimited string on the 'make' command-line, we need to temporarily convert the user-specified,
+# space-separated string into a CMake semicolon-separated list.
+separate_arguments(MKLDNN_BUILD_COMMAND_EXTRA_FLAGS_LIST UNIX_COMMAND
+    "${MKLDNN_BUILD_COMMAND_EXTRA_FLAGS}"
+    )
+
+separate_arguments(MKLDNN_CMAKE_EXTRA_FLAGS_LIST UNIX_COMMAND
+    "${MKLDNN_CMAKE_EXTRA_FLAGS}"
+    )
+
+#----------------------------------------------------------------------------------------------------------
+
 if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

     set(MKLDNN_GIT_REPO_URL https://github.com/01org/mkl-dnn)
@@ -32,7 +60,10 @@
             UPDATE_COMMAND ""
             # Uncomment below with any in-flight MKL-DNN patches
             # PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/third-party/patches/mkldnn-cmake-openmp.patch
-            CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR}
+            CMAKE_ARGS
+                -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR}
+                ${MKLDNN_CMAKE_EXTRA_FLAGS_LIST}
+            BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" ${MKLDNN_BUILD_COMMAND_EXTRA_FLAGS_LIST}
             )
     else()
         ExternalProject_Add(
@@ -42,8 +73,11 @@
             UPDATE_COMMAND ""
             # Uncomment below with any in-flight MKL-DNN patches
             # PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/third-party/patches/mkldnn-cmake-openmp.patch
-            CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR}
             BUILD_BYPRODUCTS "${MKLDNN_INSTALL_DIR}/include/mkldnn.hpp"
+            CMAKE_ARGS
+                -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR}
+                ${MKLDNN_CMAKE_EXTRA_FLAGS_LIST}
+            BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" ${MKLDNN_BUILD_COMMAND_EXTRA_FLAGS_LIST}
             )
     endif()


[cmake] Fix a variable shadowing bug

[cmake] Fix a variable shadowing bug

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1193,6 +1193,7 @@
     list(APPEND LIT_ARGS --param build_mode=${CMAKE_CFG_INTDIR})
   endif ()

+  set(suffix "")
   if (WIN32 AND NOT CYGWIN)
     # llvm-lit needs suffix.py for multiprocess to find a main module.
     set(suffix .py)


MAINT: fix on MacOS.

MAINT: fix on MacOS.

--- cmake/sara_use_halide.cmake
+++ cmake/sara_use_halide.cmake
@@ -64,8 +64,9 @@
   #   PATHS ${HALIDE_DISTRIB_DIR}
   #   PATH_SUFFIXES lib bin)

-  if (UNIX)
-    set(HALIDE_LIBRARIES ${HALIDE_LIBRARY} dl CACHE STRING "")
+  set(HALIDE_LIBRARIES ${HALIDE_LIBRARY})
+  if (NOT APPLE)
+    list(APPEND HALIDE_LIBRARIES dl)
   endif ()

   mark_as_advanced(HALIDE_FOUND
@@ -90,10 +91,16 @@
 # include(${HALIDE_CMAKE_CONFIG_FILEPATH})
 # include(${HALIDE_CMAKE_FILEPATH})

-add_library(Halide SHARED IMPORTED)
+if (WIN32)
+  add_library(Halide SHARED IMPORTED)
+else ()
+  add_library(Halide INTERFACE IMPORTED)
+endif ()
+
 set_target_properties(Halide PROPERTIES
   INTERFACE_INCLUDE_DIRECTORIES "${HALIDE_INCLUDE_DIRS}"
   INTERFACE_COMPILE_OPTIONS ${HALIDE_COMPILE_OPTIONS})
+
 if (WIN32)
   set_target_properties(Halide PROPERTIES
     IMPORTED_IMPLIB_DEBUG ${HALIDE_LIBRARY_DEBUG}


We do not package GLUT or GLFW on mac

We do not package GLUT or GLFW on mac

--- CI/otb-macos-superbuild.cmake
+++ CI/otb-macos-superbuild.cmake
@@ -21,5 +21,5 @@
 # Configuration options for macOS

 set(site_option
-"GLUT_glut_LIBRARY=/usr/X11R6/lib/libglut.3.dylib
-GLUT_INCLUDE_DIR=/usr/X11R6/include")+"OTB_USE_GLUT=OFF
+OTB_USE_GLFW=OFF")


FindOGRE.cmake fixes:
- Use OGRE_DEPENDENCIES_DIR if defined (external dependencies)
- Find media in the OGRE_SOURCE folder correctly
- Use a zip file common to 1.6 and 1.7 to detect media (OgreCore.zip doesn't exist anymore in 1.7+)

--HG--
branch : v1-7
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-7%401870

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -58,6 +58,7 @@
 getenv_path(OGRE_SDK)
 getenv_path(OGRE_SOURCE)
 getenv_path(OGRE_BUILD)
+getenv_path(OGRE_DEPENDENCIES_DIR)
 getenv_path(PROGRAMFILES)

@@ -99,6 +100,7 @@
 # If both OGRE_BUILD and OGRE_SOURCE are set, prepare to find Ogre in a build dir
 set(OGRE_PREFIX_SOURCE ${OGRE_SOURCE} ${ENV_OGRE_SOURCE})
 set(OGRE_PREFIX_BUILD ${OGRE_BUILD} ${ENV_OGRE_BUILD})
+set(OGRE_PREFIX_DEPENDENCIES_DIR ${OGRE_DEPENDENCIES_DIR} ${ENV_OGRE_DEPENDENCIES_DIR})
 if (OGRE_PREFIX_SOURCE AND OGRE_PREFIX_BUILD)
   foreach(dir ${OGRE_PREFIX_SOURCE})
     set(OGRE_INC_SEARCH_PATH ${dir}/OgreMain/include ${dir}/Dependencies/include ${dir}/iPhoneDependencies/include ${OGRE_INC_SEARCH_PATH})
@@ -111,6 +113,12 @@
     set(OGRE_BIN_SEARCH_PATH ${dir}/bin ${OGRE_BIN_SEARCH_PATH})
 	set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
   endforeach(dir)
+
+  if (OGRE_PREFIX_DEPENDENCIES_DIR)
+    set(OGRE_INC_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/include ${OGRE_INC_SEARCH_PATH})
+    set(OGRE_LIB_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/lib ${OGRE_LIB_SEARCH_PATH})
+    set(OGRE_BIN_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/bin ${OGRE_BIN_SEARCH_PATH})
+  endif()
 else()
   set(OGRE_PREFIX_SOURCE "NOTFOUND")
   set(OGRE_PREFIX_BUILD "NOTFOUND")
@@ -493,6 +501,7 @@

 # look for the media directory
 set(OGRE_MEDIA_SEARCH_PATH
+  ${OGRE_SOURCE}
   ${OGRE_LIBRARY_DIR_REL}/..
   ${OGRE_LIBRARY_DIR_DBG}/..
   ${OGRE_LIBRARY_DIR_REL}/../..
@@ -500,12 +509,13 @@
   ${OGRE_PREFIX_SOURCE}
 )
 set(OGRE_MEDIA_SEARCH_SUFFIX
+  Samples/Media
   Media
   media
   share/OGRE/media
-  Samples/Media
 )
+
 clear_if_changed(OGRE_PREFIX_WATCH OGRE_MEDIA_DIR)
-find_path(OGRE_MEDIA_DIR NAMES packs/OgreCore.zip HINTS ${OGRE_MEDIA_SEARCH_PATH}
+find_path(OGRE_MEDIA_DIR NAMES packs/cubemapsJS.zip HINTS ${OGRE_MEDIA_SEARCH_PATH}
   PATHS ${OGRE_PREFIX_PATH} PATH_SUFFIXES ${OGRE_MEDIA_SEARCH_SUFFIX})


CMake: drop FindOGRE.cmake

CMake: drop FindOGRE.cmake

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -1,597 +0,0 @@
-#-------------------------------------------------------------------
-# This file is part of the CMake build system for OGRE
-#     (Object-oriented Graphics Rendering Engine)
-# For the latest info, see http://www.ogre3d.org/
-#
-# The contents of this file are placed in the public domain. Feel
-# free to make use of it in any way you like.
-#-------------------------------------------------------------------
-
-# - Try to find OGRE
-# If you have multiple versions of Ogre installed, use the CMake or
-# the environment variable OGRE_HOME to point to the path where the
-# desired Ogre version can be found.
-# By default this script will look for a dynamic Ogre build. If you
-# need to link against static Ogre libraries, set the CMake variable
-# OGRE_STATIC to TRUE.
-#
-# Once done, this will define
-#
-#  OGRE_FOUND - system has OGRE
-#  OGRE_INCLUDE_DIRS - the OGRE include directories
-#  OGRE_LIBRARIES - link these to use the OGRE core
-#  OGRE_BINARY_REL - location of the main Ogre binary (win32 non-static only, release)
-#  OGRE_BINARY_DBG - location of the main Ogre binaries (win32 non-static only, debug)
-#
-# Additionally this script searches for the following optional
-# parts of the Ogre package:
-#  Plugin_BSPSceneManager, Plugin_CgProgramManager,
-#  Plugin_OctreeSceneManager, Plugin_OctreeZone,
-#  Plugin_ParticleFX, Plugin_PCZSceneManager,
-#  RenderSystem_GL, RenderSystem_GL3Plus,
-#  RenderSystem_GLES, RenderSystem_GLES2,
-#  RenderSystem_Direct3D9, RenderSystem_Direct3D11
-#  Paging, Terrain, Volume, Overlay, MeshLodGenerator, HLMS
-#
-# For each of these components, the following variables are defined:
-#
-#  OGRE_${COMPONENT}_FOUND - ${COMPONENT} is available
-#  OGRE_${COMPONENT}_INCLUDE_DIRS - additional include directories for ${COMPONENT}
-#  OGRE_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT}
-#  OGRE_${COMPONENT}_BINARY_REL - location of the component binary (win32 non-static only, release)
-#  OGRE_${COMPONENT}_BINARY_DBG - location of the component binary (win32 non-static only, debug)
-#
-# Finally, the following variables are defined:
-#
-#  OGRE_PLUGIN_DIR_REL - The directory where the release versions of
-#       the OGRE plugins are located
-#  OGRE_PLUGIN_DIR_DBG - The directory where the debug versions of
-#       the OGRE plugins are located
-#  OGRE_MEDIA_DIR - The directory where the OGRE sample media is
-#       located, if available
-
-include(FindPkgMacros)
-include(PreprocessorUtils)
-findpkg_begin(OGRE)
-
-
-# Get path, convert backslashes as ${ENV_${var}}
-getenv_path(OGRE_HOME)
-getenv_path(OGRE_SDK)
-getenv_path(OGRE_SOURCE)
-getenv_path(OGRE_BUILD)
-getenv_path(OGRE_DEPENDENCIES_DIR)
-getenv_path(PROGRAMFILES)
-
-# Determine whether to search for a dynamic or static build
-if (OGRE_STATIC)
-  set(OGRE_LIB_SUFFIX "Static")
-else ()
-  set(OGRE_LIB_SUFFIX "")
-endif ()
-
-if(APPLE AND NOT OGRE_STATIC)
-	set(OGRE_LIBRARY_NAMES "Ogre${OGRE_LIB_SUFFIX}")
-else()
-    set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}")
-endif()
-get_debug_names(OGRE_LIBRARY_NAMES)
-
-# construct search paths from environmental hints and
-# OS specific guesses
-if (WIN32)
-  set(OGRE_PREFIX_GUESSES
-    ${ENV_PROGRAMFILES}/OGRE
-    C:/OgreSDK
-  )
-elseif (UNIX)
-  set(OGRE_PREFIX_GUESSES
-    /opt/ogre
-    /opt/OGRE
-    /usr/lib${LIB_SUFFIX}/ogre
-    /usr/lib${LIB_SUFFIX}/OGRE
-    /usr/local/lib${LIB_SUFFIX}/ogre
-    /usr/local/lib${LIB_SUFFIX}/OGRE
-    $ENV{HOME}/ogre
-    $ENV{HOME}/OGRE
-  )
-  if (APPLE)
-    set(OGRE_PREFIX_GUESSES
-      ${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx
-      ${OGRE_PREFIX_GUESSES}
-    )
-  endif ()
-endif ()
-set(OGRE_PREFIX_PATH
-  ${OGRE_HOME} ${OGRE_SDK} ${ENV_OGRE_HOME} ${ENV_OGRE_SDK}
-  ${OGRE_PREFIX_GUESSES}
-)
-create_search_paths(OGRE)
-# If both OGRE_BUILD and OGRE_SOURCE are set, prepare to find Ogre in a build dir
-set(OGRE_PREFIX_SOURCE ${OGRE_SOURCE} ${ENV_OGRE_SOURCE})
-set(OGRE_PREFIX_BUILD ${OGRE_BUILD} ${ENV_OGRE_BUILD})
-set(OGRE_PREFIX_DEPENDENCIES_DIR ${OGRE_DEPENDENCIES_DIR} ${ENV_OGRE_DEPENDENCIES_DIR})
-if (OGRE_PREFIX_SOURCE AND OGRE_PREFIX_BUILD)
-  foreach(dir ${OGRE_PREFIX_SOURCE})
-    set(OGRE_INC_SEARCH_PATH ${dir}/OgreMain/include ${dir}/Dependencies/include ${dir}/iOSDependencies/include ${dir}/AndroidDependencies/include ${OGRE_INC_SEARCH_PATH})
-    set(OGRE_LIB_SEARCH_PATH ${dir}/lib ${dir}/Dependencies/lib ${dir}/iOSDependencies/lib ${dir}/AndroidDependencies/lib/${ANDROID_ABI} ${OGRE_LIB_SEARCH_PATH})
-    set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
-  endforeach(dir)
-  foreach(dir ${OGRE_PREFIX_BUILD})
-    set(OGRE_INC_SEARCH_PATH ${dir}/include ${OGRE_INC_SEARCH_PATH})
-    if(APPLE AND NOT APPLE_IOS)
-        set(OGRE_LIB_SEARCH_PATH ${dir}/lib/macosx ${OGRE_LIB_SEARCH_PATH})
-    else()
-        set(OGRE_LIB_SEARCH_PATH ${dir}/lib ${OGRE_LIB_SEARCH_PATH})
-    endif()
-
-    if (APPLE_IOS)
-        set(OGRE_LIB_SEARCH_PATH ${dir}/lib/iphoneos ${dir}/lib/iphonesimulator ${OGRE_LIB_SEARCH_PATH})
-    endif()
-
-    set(OGRE_BIN_SEARCH_PATH ${dir}/bin ${OGRE_BIN_SEARCH_PATH})
-    set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
-
-    if(APPLE AND NOT APPLE_IOS)
-      set(OGRE_BIN_SEARCH_PATH ${dir}/bin/macosx ${OGRE_BIN_SEARCH_PATH})
-    endif()
-  endforeach(dir)
-
-  if (OGRE_PREFIX_DEPENDENCIES_DIR)
-    set(OGRE_INC_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/include ${OGRE_INC_SEARCH_PATH})
-    set(OGRE_LIB_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/lib ${OGRE_LIB_SEARCH_PATH})
-    set(OGRE_BIN_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/bin ${OGRE_BIN_SEARCH_PATH})
-  endif()
-else()
-  set(OGRE_PREFIX_SOURCE "NOTFOUND")
-  set(OGRE_PREFIX_BUILD "NOTFOUND")
-endif ()
-
-# redo search if any of the environmental hints changed
-set(OGRE_COMPONENTS Paging Terrain Volume Overlay MeshLodGenerator HLMS
-  Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager
-  Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX
-  RenderSystem_Direct3D11 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GL3Plus RenderSystem_GLES RenderSystem_GLES2)
-set(OGRE_RESET_VARS
-  OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR
-  OGRE_FRAMEWORK_INCLUDES OGRE_FRAMEWORK_PATH OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG
-  OGRE_PLUGIN_DIR_DBG OGRE_PLUGIN_DIR_REL OGRE_MEDIA_DIR)
-foreach (comp ${OGRE_COMPONENTS})
-  set(OGRE_RESET_VARS ${OGRE_RESET_VARS}
-    OGRE_${comp}_INCLUDE_DIR OGRE_${comp}_LIBRARY_FWK
-    OGRE_${comp}_LIBRARY_DBG OGRE_${comp}_LIBRARY_REL
-  )
-endforeach (comp)
-set(OGRE_PREFIX_WATCH ${OGRE_PREFIX_PATH} ${OGRE_PREFIX_SOURCE} ${OGRE_PREFIX_BUILD})
-clear_if_changed(OGRE_PREFIX_WATCH ${OGRE_RESET_VARS})
-
-if(NOT OGRE_STATIC)
-	# try to locate Ogre via pkg-config
-	use_pkgconfig(OGRE_PKGC "OGRE${OGRE_LIB_SUFFIX}")
-
-	# Set the framework search path for OS X
-    set(OGRE_FRAMEWORK_SEARCH_PATH
-      ${CMAKE_FRAMEWORK_PATH}
-      ~/Library/Frameworks
-      /Library/Frameworks
-      /System/Library/Frameworks
-      /Network/Library/Frameworks
-      ${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/Release
-      ${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/Debug
-    )
-else()
-	set(OGRE_LIBRARY_FWK "")
-endif()
-
-# locate Ogre include files
-find_path(OGRE_CONFIG_INCLUDE_DIR NAMES OgreBuildSettings.h HINTS ${OGRE_INC_SEARCH_PATH} ${OGRE_FRAMEWORK_INCLUDES} ${OGRE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES "OGRE")
-find_path(OGRE_INCLUDE_DIR NAMES OgreRoot.h HINTS ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INC_SEARCH_PATH} ${OGRE_FRAMEWORK_INCLUDES} ${OGRE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES "OGRE")
-set(OGRE_INCOMPATIBLE FALSE)
-
-if (OGRE_INCLUDE_DIR)
-  if (NOT OGRE_CONFIG_INCLUDE_DIR)
-    set(OGRE_CONFIG_INCLUDE_DIR ${OGRE_INCLUDE_DIR})
-  endif ()
-  # determine Ogre version
-  file(READ ${OGRE_INCLUDE_DIR}/OgrePrerequisites.h OGRE_TEMP_VERSION_CONTENT)
-  get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_MAJOR OGRE_VERSION_MAJOR)
-  get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_MINOR OGRE_VERSION_MINOR)
-  get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_PATCH OGRE_VERSION_PATCH)
-  get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_NAME OGRE_VERSION_NAME)
-  set(OGRE_VERSION "${OGRE_VERSION_MAJOR}.${OGRE_VERSION_MINOR}.${OGRE_VERSION_PATCH}")
-  pkg_message(OGRE "Found Ogre ${OGRE_VERSION_NAME} (${OGRE_VERSION})")
-
-  # determine configuration settings
-  set(OGRE_CONFIG_HEADERS
-    ${OGRE_CONFIG_INCLUDE_DIR}/OgreBuildSettings.h
-    ${OGRE_CONFIG_INCLUDE_DIR}/OgreConfig.h
-  )
-  foreach(CFG_FILE ${OGRE_CONFIG_HEADERS})
-    if (EXISTS ${CFG_FILE})
-      set(OGRE_CONFIG_HEADER ${CFG_FILE})
-      break()
-    endif()
-  endforeach()
-  if (OGRE_CONFIG_HEADER)
-    file(READ ${OGRE_CONFIG_HEADER} OGRE_TEMP_CONFIG_CONTENT)
-    has_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_STATIC_LIB OGRE_CONFIG_STATIC)
-    get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_THREAD_SUPPORT OGRE_CONFIG_THREADS)
-    get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_THREAD_PROVIDER OGRE_CONFIG_THREAD_PROVIDER)
-    get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_NO_FREEIMAGE OGRE_CONFIG_FREEIMAGE)
-    if (OGRE_CONFIG_STATIC AND OGRE_STATIC)
-    elseif (OGRE_CONFIG_STATIC OR OGRE_STATIC)
-      pkg_message(OGRE "Build type (static, dynamic) does not match the requested one.")
-      set(OGRE_INCOMPATIBLE TRUE)
-    endif ()
-  else ()
-    pkg_message(OGRE "Could not determine Ogre build configuration.")
-    set(OGRE_INCOMPATIBLE TRUE)
-  endif ()
-else ()
-  set(OGRE_INCOMPATIBLE FALSE)
-endif ()
-
-find_library(OGRE_LIBRARY_REL NAMES ${OGRE_LIBRARY_NAMES} HINTS ${OGRE_LIB_SEARCH_PATH} ${OGRE_PKGC_LIBRARY_DIRS} ${OGRE_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
-find_library(OGRE_LIBRARY_DBG NAMES ${OGRE_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIB_SEARCH_PATH} ${OGRE_PKGC_LIBRARY_DIRS} ${OGRE_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "Debug")
-
-make_library_set(OGRE_LIBRARY)
-
-if (OGRE_INCOMPATIBLE)
-  set(OGRE_LIBRARY "NOTFOUND")
-endif ()
-
-if("${OGRE_FRAMEWORK_INCLUDES}" STREQUAL NOTFOUND)
-  unset(OGRE_FRAMEWORK_INCLUDES CACHE)
-endif()
-set(OGRE_INCLUDE_DIR ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INCLUDE_DIR} ${OGRE_FRAMEWORK_INCLUDES})
-list(REMOVE_DUPLICATES OGRE_INCLUDE_DIR)
-findpkg_finish(OGRE)
-add_parent_dir(OGRE_INCLUDE_DIRS OGRE_INCLUDE_DIR)
-if (OGRE_SOURCE)
-	# If working from source rather than SDK, add samples include
-	set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} "${OGRE_SOURCE}/Samples/Common/include")
-endif()
-
-mark_as_advanced(OGRE_CONFIG_INCLUDE_DIR OGRE_MEDIA_DIR OGRE_PLUGIN_DIR_REL OGRE_PLUGIN_DIR_DBG)
-
-if (NOT OGRE_FOUND)
-  return()
-endif ()
-
-
-# look for required Ogre dependencies in case of static build and/or threading
-if (OGRE_STATIC)
-  set(OGRE_DEPS_FOUND TRUE)
-  find_package(Cg QUIET)
-  find_package(DirectX QUIET)
-  find_package(DirectX11 QUIET)
-  find_package(FreeImage QUIET)
-  find_package(Freetype QUIET)
-  find_package(OpenGL QUIET)
-  find_package(OpenGLES QUIET)
-  find_package(OpenGLES2 QUIET)
-  find_package(ZLIB QUIET)
-  find_package(ZZip QUIET)
-  find_package(SDL2 QUIET)
-  if (UNIX AND NOT APPLE AND NOT ANDROID)
-    find_package(X11 QUIET)
-    find_library(XAW_LIBRARY NAMES Xaw Xaw7 PATHS ${DEP_LIB_SEARCH_DIR} ${X11_LIB_SEARCH_PATH})
-    if (NOT XAW_LIBRARY OR NOT X11_Xt_FOUND)
-      set(X11_FOUND FALSE)
-    endif ()
-  endif ()
-
-  set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES} ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES} ${SDL2_LIBRARY})
-
-  if (APPLE AND NOT APPLE_IOS AND NOT ANDROID)
-    set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB} ${Carbon_LIBRARIES} ${Cocoa_LIBRARIES})
-  endif()
-
-  if (NOT ZLIB_FOUND OR NOT ZZip_FOUND)
-    set(OGRE_DEPS_FOUND FALSE)
-  endif ()
-  if (NOT FreeImage_FOUND AND NOT OGRE_CONFIG_FREEIMAGE)
-    set(OGRE_DEPS_FOUND FALSE)
-  endif ()
-  if (NOT FREETYPE_FOUND)
-    set(OGRE_DEPS_FOUND FALSE)
-  endif ()
-  if (UNIX AND NOT APPLE AND NOT ANDROID)
-	if (NOT X11_FOUND)
-      set(OGRE_DEPS_FOUND FALSE)
-	endif ()
-  endif ()
-endif()
-  if (OGRE_CONFIG_THREADS)
-    if (OGRE_CONFIG_THREAD_PROVIDER EQUAL 1)
-      if (OGRE_STATIC)
-    	set(Boost_USE_STATIC_LIBS TRUE)
-    	if(APPLE_IOS)
-          set(Boost_USE_MULTITHREADED OFF)
-        endif()
-      endif()
-
-      set(OGRE_BOOST_COMPONENTS thread date_time)
-      find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
-      if(Boost_FOUND AND Boost_VERSION GREATER 104900)
-        if(Boost_VERSION GREATER 105300)
-            set(OGRE_BOOST_COMPONENTS thread date_time system atomic chrono)
-        else()
-            set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
-        endif()
-      endif()
-
-      find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
-      if (NOT Boost_THREAD_FOUND)
-        set(OGRE_DEPS_FOUND FALSE)
-      else ()
-        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${Boost_LIBRARIES})
-        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
-      endif ()
-    elseif (OGRE_CONFIG_THREAD_PROVIDER EQUAL 2)
-      find_package(POCO QUIET)
-      if (NOT POCO_FOUND)
-        set(OGRE_DEPS_FOUND FALSE)
-      else ()
-        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${POCO_LIBRARIES})
-        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${POCO_INCLUDE_DIRS})
-      endif ()
-    elseif (OGRE_CONFIG_THREAD_PROVIDER EQUAL 3)
-      find_package(TBB QUIET)
-      if (NOT TBB_FOUND)
-        set(OGRE_DEPS_FOUND FALSE)
-      else ()
-        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${TBB_LIBRARIES})
-        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS})
-      endif ()
-    endif ()
-  endif ()
-if (OGRE_STATIC)
-  if (NOT OGRE_DEPS_FOUND)
-    pkg_message(OGRE "Could not find all required dependencies for the Ogre package.")
-    set(OGRE_FOUND FALSE)
-  endif ()
-endif ()
-
-if (NOT OGRE_FOUND)
-  return()
-endif ()
-
-
-get_filename_component(OGRE_LIBRARY_DIR_REL "${OGRE_LIBRARY_REL}" PATH)
-get_filename_component(OGRE_LIBRARY_DIR_DBG "${OGRE_LIBRARY_DBG}" PATH)
-set(OGRE_LIBRARY_DIRS ${OGRE_LIBRARY_DIR_REL} ${OGRE_LIBRARY_DIR_DBG})
-
-# find binaries
-if (NOT OGRE_STATIC)
-	if (WIN32)
-		find_file(OGRE_BINARY_REL NAMES "OgreMain.dll" HINTS ${OGRE_BIN_SEARCH_PATH}
-          PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel)
-		find_file(OGRE_BINARY_DBG NAMES "OgreMain_d.dll" HINTS ${OGRE_BIN_SEARCH_PATH}
-          PATH_SUFFIXES "" Debug )
-	endif()
-	mark_as_advanced(OGRE_BINARY_REL OGRE_BINARY_DBG)
-endif()
-
-
-#########################################################
-# Find Ogre components
-#########################################################
-
-set(OGRE_COMPONENT_SEARCH_PATH_REL
-  ${OGRE_LIBRARY_DIR_REL}/..
-  ${OGRE_LIBRARY_DIR_REL}/../..
-  ${OGRE_BIN_SEARCH_PATH}
-)
-set(OGRE_COMPONENT_SEARCH_PATH_DBG
-  ${OGRE_LIBRARY_DIR_DBG}/..
-  ${OGRE_LIBRARY_DIR_DBG}/../..
-  ${OGRE_BIN_SEARCH_PATH}
-)
-
-macro(ogre_find_component COMPONENT HEADER)
-  set(OGRE_${COMPONENT}_FIND_QUIETLY ${OGRE_FIND_QUIETLY})
-  findpkg_begin(OGRE_${COMPONENT})
-  find_path(OGRE_${COMPONENT}_INCLUDE_DIR NAMES ${HEADER} HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES ${COMPONENT} OGRE/${COMPONENT} Components/${COMPONENT}/include)
-  set(OGRE_${COMPONENT}_LIBRARY_NAMES "Ogre${COMPONENT}${OGRE_LIB_SUFFIX}")
-  get_debug_names(OGRE_${COMPONENT}_LIBRARY_NAMES)
-  find_library(OGRE_${COMPONENT}_LIBRARY_REL NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} ${OGRE_FRAMEWORK_PATH} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
-  find_library(OGRE_${COMPONENT}_LIBRARY_DBG NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} ${OGRE_FRAMEWORK_PATH} PATH_SUFFIXES "" "Debug")
-  make_library_set(OGRE_${COMPONENT}_LIBRARY)
-  findpkg_finish(OGRE_${COMPONENT})
-  if (OGRE_${COMPONENT}_FOUND)
-    # find binaries
-    if (NOT OGRE_STATIC)
-	  if (WIN32)
-	    find_file(OGRE_${COMPONENT}_BINARY_REL NAMES "Ogre${COMPONENT}.dll" HINTS ${OGRE_COMPONENT_SEARCH_PATH_REL} PATH_SUFFIXES "" bin bin/Release bin/RelWithDebInfo bin/MinSizeRel Release)
-	    find_file(OGRE_${COMPONENT}_BINARY_DBG NAMES "Ogre${COMPONENT}_d.dll" HINTS ${OGRE_COMPONENT_SEARCH_PATH_DBG} PATH_SUFFIXES "" bin bin/Debug Debug)
-	  endif()
-	  mark_as_advanced(OGRE_${COMPONENT}_BINARY_REL OGRE_${COMPONENT}_BINARY_DBG)
-    endif()
-  endif()
-  unset(OGRE_${COMPONENT}_FIND_QUIETLY)
-endmacro()
-
-# look for Paging component
-ogre_find_component(Paging OgrePaging.h)
-# look for Terrain component
-ogre_find_component(Terrain OgreTerrain.h)
-# look for Property component
-ogre_find_component(Property OgreProperty.h)
-# look for RTShaderSystem component
-ogre_find_component(RTShaderSystem OgreRTShaderSystem.h)
-# look for Volume component
-ogre_find_component(Volume OgreVolumePrerequisites.h)
-# look for Overlay component
-ogre_find_component(Overlay OgreOverlaySystem.h)
-# look for MeshLodGenerator component
-ogre_find_component(MeshLodGenerator OgreMeshLodGenerator.h)
-# look for HLMS component
-ogre_find_component(HLMS OgreHlmsManager.h)
-# look for Bites component
-ogre_find_component(Bites OgreApplicationContext.h)
-
-#########################################################
-# Find Ogre plugins
-#########################################################
-macro(ogre_find_plugin PLUGIN HEADER)
-  # On Unix, the plugins might have no prefix
-  if (CMAKE_FIND_LIBRARY_PREFIXES)
-    set(TMP_CMAKE_LIB_PREFIX ${CMAKE_FIND_LIBRARY_PREFIXES})
-    set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "")
-  endif()
-
-  # strip RenderSystem_ or Plugin_ prefix from plugin name
-  string(REPLACE "RenderSystem_" "" PLUGIN_TEMP ${PLUGIN})
-  string(REPLACE "Plugin_" "" PLUGIN_NAME ${PLUGIN_TEMP})
-
-  # header files for plugins are not usually needed, but find them anyway if they are present
-  set(OGRE_PLUGIN_PATH_SUFFIXES
-    PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN}
-    RenderSystems RenderSystems/${PLUGIN_NAME} ${ARGN})
-  find_path(OGRE_${PLUGIN}_INCLUDE_DIR NAMES ${HEADER}
-    HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE}
-    PATH_SUFFIXES ${OGRE_PLUGIN_PATH_SUFFIXES})
-  # find link libraries for plugins
-  set(OGRE_${PLUGIN}_LIBRARY_NAMES "${PLUGIN}${OGRE_LIB_SUFFIX}")
-  get_debug_names(OGRE_${PLUGIN}_LIBRARY_NAMES)
-  set(OGRE_${PLUGIN}_LIBRARY_FWK ${OGRE_LIBRARY_FWK})
-  find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES}
-    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} ${OGRE_FRAMEWORK_PATH} PATH_SUFFIXES "" OGRE OGRE-${OGRE_VERSION} opt Release Release/opt RelWithDebInfo RelWithDebInfo/opt MinSizeRel MinSizeRel/opt)
-  find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG}
-    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} ${OGRE_FRAMEWORK_PATH} PATH_SUFFIXES "" OGRE OGRE-${OGRE_VERSION} opt Debug Debug/opt)
-  make_library_set(OGRE_${PLUGIN}_LIBRARY)
-
-  if (OGRE_${PLUGIN}_LIBRARY OR OGRE_${PLUGIN}_INCLUDE_DIR)
-    set(OGRE_${PLUGIN}_FOUND TRUE)
-    if (OGRE_${PLUGIN}_INCLUDE_DIR)
-      set(OGRE_${PLUGIN}_INCLUDE_DIRS ${OGRE_${PLUGIN}_INCLUDE_DIR})
-    endif()
-    set(OGRE_${PLUGIN}_LIBRARIES ${OGRE_${PLUGIN}_LIBRARY})
-  endif ()
-
-  mark_as_advanced(OGRE_${PLUGIN}_INCLUDE_DIR OGRE_${PLUGIN}_LIBRARY_REL OGRE_${PLUGIN}_LIBRARY_DBG OGRE_${PLUGIN}_LIBRARY_FWK)
-
-  # look for plugin dirs
-  if (OGRE_${PLUGIN}_FOUND)
-    if (NOT OGRE_PLUGIN_DIR_REL OR NOT OGRE_PLUGIN_DIR_DBG)
-      if (WIN32)
-        set(OGRE_PLUGIN_SEARCH_PATH_REL
-          ${OGRE_LIBRARY_DIR_REL}/..
-          ${OGRE_LIBRARY_DIR_REL}/../..
-		  ${OGRE_BIN_SEARCH_PATH}
-        )
-        set(OGRE_PLUGIN_SEARCH_PATH_DBG
-          ${OGRE_LIBRARY_DIR_DBG}/..
-          ${OGRE_LIBRARY_DIR_DBG}/../..
-		  ${OGRE_BIN_SEARCH_PATH}
-        )
-        find_path(OGRE_PLUGIN_DIR_REL NAMES "${PLUGIN}.dll" HINTS ${OGRE_PLUGIN_SEARCH_PATH_REL}
-          PATH_SUFFIXES "" bin bin/Release bin/RelWithDebInfo bin/MinSizeRel Release)
-        find_path(OGRE_PLUGIN_DIR_DBG NAMES "${PLUGIN}_d.dll" HINTS ${OGRE_PLUGIN_SEARCH_PATH_DBG}
-          PATH_SUFFIXES "" bin bin/Debug Debug)
-      elseif (UNIX)
-        get_filename_component(OGRE_PLUGIN_DIR_TMP ${OGRE_${PLUGIN}_LIBRARY_REL} PATH)
-        set(OGRE_PLUGIN_DIR_REL ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (release)" FORCE)
-	    get_filename_component(OGRE_PLUGIN_DIR_TMP ${OGRE_${PLUGIN}_LIBRARY_DBG} PATH)
-        set(OGRE_PLUGIN_DIR_DBG ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (debug)" FORCE)
-      endif ()
-    endif ()
-
-	# find binaries
-	if (NOT OGRE_STATIC)
-		if (WIN32)
-			find_file(OGRE_${PLUGIN}_REL NAMES "${PLUGIN}.dll" HINTS ${OGRE_PLUGIN_DIR_REL})
-			find_file(OGRE_${PLUGIN}_DBG NAMES "${PLUGIN}_d.dll" HINTS ${OGRE_PLUGIN_DIR_DBG})
-		endif()
-		mark_as_advanced(OGRE_${PLUGIN}_REL OGRE_${PLUGIN}_DBG)
-	endif()
-
-  endif ()
-
-  if (TMP_CMAKE_LIB_PREFIX)
-    set(CMAKE_FIND_LIBRARY_PREFIXES ${TMP_CMAKE_LIB_PREFIX})
-  endif ()
-endmacro(ogre_find_plugin)
-
-ogre_find_plugin(Plugin_PCZSceneManager OgrePCZSceneManager.h PCZ PlugIns/PCZSceneManager/include)
-ogre_find_plugin(Plugin_OctreeZone OgreOctreeZone.h PCZ PlugIns/OctreeZone/include)
-ogre_find_plugin(Plugin_BSPSceneManager OgreBspSceneManager.h PlugIns/BSPSceneManager/include)
-ogre_find_plugin(Plugin_CgProgramManager OgreCgProgram.h PlugIns/CgProgramManager/include)
-ogre_find_plugin(Plugin_OctreeSceneManager OgreOctreeSceneManager.h PlugIns/OctreeSceneManager/include)
-ogre_find_plugin(Plugin_ParticleFX OgreParticleFXPrerequisites.h PlugIns/ParticleFX/include)
-ogre_find_plugin(RenderSystem_GL OgreGLRenderSystem.h RenderSystems/GL/include)
-ogre_find_plugin(RenderSystem_GL3Plus OgreGL3PlusRenderSystem.h RenderSystems/GL3Plus/include)
-ogre_find_plugin(RenderSystem_GLES OgreGLESRenderSystem.h RenderSystems/GLES/include)
-ogre_find_plugin(RenderSystem_GLES2 OgreGLES2RenderSystem.h RenderSystems/GLES2/include)
-ogre_find_plugin(RenderSystem_Direct3D9 OgreD3D9RenderSystem.h RenderSystems/Direct3D9/include)
-ogre_find_plugin(RenderSystem_Direct3D11 OgreD3D11RenderSystem.h RenderSystems/Direct3D11/include)
-
-if (OGRE_STATIC)
-  # check if dependencies for plugins are met
-  if (NOT DirectX9_FOUND)
-    set(OGRE_RenderSystem_Direct3D9_FOUND FALSE)
-  endif ()
-  if (NOT DirectX_D3D11_FOUND)
-    set(OGRE_RenderSystem_Direct3D11_FOUND FALSE)
-  endif ()
-  if (NOT OPENGL_FOUND)
-    set(OGRE_RenderSystem_GL_FOUND FALSE)
-  endif ()
-  if (NOT OPENGL_FOUND)
-    set(OGRE_RenderSystem_GL3Plus_FOUND FALSE)
-  endif ()
-  if (NOT OPENGLES_FOUND)
-    set(OGRE_RenderSystem_GLES_FOUND FALSE)
-  endif ()
-  if (NOT OPENGLES2_FOUND)
-    set(OGRE_RenderSystem_GLES2_FOUND FALSE)
-  endif ()
-  if (NOT Cg_FOUND)
-    set(OGRE_Plugin_CgProgramManager_FOUND FALSE)
-  endif ()
-
-  set(OGRE_RenderSystem_Direct3D9_LIBRARIES ${OGRE_RenderSystem_Direct3D9_LIBRARIES}
-    ${DirectX9_LIBRARIES}
-  )
-
-  set(OGRE_RenderSystem_Direct3D11_LIBRARIES ${OGRE_RenderSystem_Direct3D11_LIBRARIES}
-    ${DirectX_D3D11_LIBRARIES}
-  )
-  set(OGRE_RenderSystem_GL_LIBRARIES ${OGRE_RenderSystem_GL_LIBRARIES}
-    ${OPENGL_LIBRARIES}
-  )
-  set(OGRE_RenderSystem_GL3Plus_LIBRARIES ${OGRE_RenderSystem_GL3Plus_LIBRARIES}
-    ${OPENGL_LIBRARIES}
-  )
-  set(OGRE_RenderSystem_GLES_LIBRARIES ${OGRE_RenderSystem_GLES_LIBRARIES}
-    ${OPENGLES_LIBRARIES}
-  )
-  set(OGRE_RenderSystem_GLES2_LIBRARIES ${OGRE_RenderSystem_GLES2_LIBRARIES}
-    ${OPENGLES2_LIBRARIES}
-  )
-  set(OGRE_Plugin_CgProgramManager_LIBRARIES ${OGRE_Plugin_CgProgramManager_LIBRARIES}
-    ${Cg_LIBRARIES}
-  )
-endif ()
-
-# look for the media directory
-set(OGRE_MEDIA_SEARCH_PATH
-  ${OGRE_SOURCE}
-  ${OGRE_LIBRARY_DIR_REL}/..
-  ${OGRE_LIBRARY_DIR_DBG}/..
-  ${OGRE_LIBRARY_DIR_REL}/../..
-  ${OGRE_LIBRARY_DIR_DBG}/../..
-  ${OGRE_PREFIX_SOURCE}
-)
-set(OGRE_MEDIA_SEARCH_SUFFIX
-  Samples/Media
-  Media
-  media
-  share/OGRE/media
-  share/OGRE/Media
-)
-
-clear_if_changed(OGRE_PREFIX_WATCH OGRE_MEDIA_DIR)
-find_path(OGRE_MEDIA_DIR NAMES packs/cubemapsJS.zip HINTS ${OGRE_MEDIA_SEARCH_PATH}
-  PATHS ${OGRE_PREFIX_PATH} PATH_SUFFIXES ${OGRE_MEDIA_SEARCH_SUFFIX})


hastag updated

hastag updated

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag 84372b38)
+  set(revision_tag 7c04beab)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


Update copyright statement in Assist CMake module to 2014.

--- CMakeModules/FindAssist.cmake
+++ CMakeModules/FindAssist.cmake
@@ -1,5 +1,5 @@
- #    Copyright (c) 2010-2013, Delft University of Technology
- #    Copyright (c) 2010-2013, K. Kumar (me@kartikkumar.com)
+ #    Copyright (c) 2010-2014, Delft University of Technology
+ #    Copyright (c) 2010-2014, K. Kumar (me@kartikkumar.com)
  #    All rights reserved.
  #    See http://bit.ly/1jern3m for license details.


Minor fix

Minor fix

--- Common.cmake
+++ Common.cmake
@@ -83,7 +83,7 @@
     message(ERROR "GCC 4.1 or later required, found ${GCC_COMPILER_VERSION}")
   endif()
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wnon-virtual-dtor -Wsign-promo -Winit-self -Wno-unknown-pragmas -Wno-unused-parameter")
-  if(GCC_COMPILER_VERSION VERSION_GREATER 4.1) // < 4.2 doesn't know -isystem
+  if(GCC_COMPILER_VERSION VERSION_GREATER 4.1) # < 4.2 doesn't know -isystem
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
   endif()
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")


CR: OUTPUTNAME can only be set after add_library, can be ignored here

--- Common.cmake
+++ Common.cmake
@@ -186,10 +186,7 @@
     set(THIS_DEFINITIONS) # clear THIS_DEFINITIONS-NOTFOUND
   endif()
   string(TOUPPER ${_target} _TARGET)
-  get_target_property(_libraryname ${_target} OUTPUT_NAME)
-  if(NOT _libraryname)
-    get_target_property(_libraryname ${_target} LOCATION)
-  endif()
+  get_target_property(_libraryname ${_target} LOCATION)
   get_filename_component(_libraryname ${_libraryname} NAME)

   list(APPEND THIS_DEFINITIONS


Fix locating IDL on Windows for more recent IDL versions

--- CMakeModules/FindIDL.cmake
+++ CMakeModules/FindIDL.cmake
@@ -54,7 +54,7 @@
 #
 # ``IDL_FOUND``
 #   ``TRUE`` if the IDL installation is found, ``FALSE``
-#   otherwise. All variable below are defined if IDL is found.
+#   otherwise. All variables below are defined if IDL is found.
 # ``IDL_ROOT_DIR``
 #   the final root of the IDL installation determined by the FindIDL
 #   module.
@@ -78,10 +78,6 @@
 # :command:`IDL_extract_all_installed_versions_from_registry`
 #   parses the registry for all IDL versions. Available on Windows only.
 #   The part of the registry parsed is dependent on the host processor
-# :command:`IDL_get_all_valid_IDL_roots_from_registry`
-#   returns all the possible IDL paths, according to a previously
-#   given list. Only the existing/accessible paths are kept. This is mainly
-#   useful for the searching all possible IDL installation.
 # :command:`IDL_get_version_from_root`
 #   returns the version of IDL, given the IDL root directory.
 #
@@ -115,20 +111,18 @@
 #   installed. The found versions are returned in `IDL_versions`.
 #   Set `win64` to `TRUE` if the 64 bit version of IDL should be looked for
 #   The returned list contains all versions under
-#   ``HKLM\\SOFTWARE\\ITT\\IDL`` or an empty list in case an error
+#   ``HKLM\\SOFTWARE\\Harris\\IDL``, ``HKLM\\SOFTWARE\\Exelis\\IDL``, or
+#   ``HKLM\\SOFTWARE\\ITT\\IDL``, or an empty list in case an error
 #   occurred (or nothing found).
 #
-#   .. note::
-#
-#     Only the versions are provided. No check is made over the existence of the
-#     installation referenced in the registry,
+#   The returned IDL_versions is organized in pairs
+#   ``(version_number,IDL_root_path)``.
 #
 function(IDL_extract_all_installed_versions_from_registry win64 IDL_versions)

   if(NOT CMAKE_HOST_WIN32)
     message(FATAL_ERROR "This macro can only be called by a windows host (call to reg.exe")
   endif()
-

   if(${win64} AND ${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "64")
     set(APPEND_REG "/reg:64")
@@ -136,120 +130,96 @@
     set(APPEND_REG "/reg:32")
   endif()

-  # /reg:64 should be added on 64 bits capable OSs in order to enable the
-  # redirection of 64 bits applications
-  execute_process(
-    COMMAND reg query HKEY_LOCAL_MACHINE\\SOFTWARE\\ITT\\IDL /f * /k ${APPEND_REG}
-    RESULT_VARIABLE resultIDL
-    OUTPUT_VARIABLE varIDL
-    ERROR_VARIABLE errIDL
-    INPUT_FILE NUL
-    )
-
-  set(IDLs_from_registry)
-  if(${resultIDL} EQUAL 0)
-
-    string(
-      REGEX MATCHALL "IDL\\\\([0-9]+(\\.[0-9]+)?)"
-      IDL_versions_regex ${varIDL})
-
-    foreach(match IN LISTS IDL_versions_regex)
+  set(_IDL_versions_list)
+  foreach(_IDL_company Harris Exelis ITT)
+
+    # /reg:64 should be added on 64 bits capable OSs in order to enable the
+    # redirection of 64 bits applications
+    execute_process(
+      COMMAND reg query HKEY_LOCAL_MACHINE\\SOFTWARE\\${_IDL_company}\\IDL /f * /k ${APPEND_REG}
+      RESULT_VARIABLE resultIDL
+      OUTPUT_VARIABLE varIDL
+      ERROR_VARIABLE errIDL
+      INPUT_FILE NUL
+      )
+
+    if(${resultIDL} EQUAL 0)
+
       string(
-        REGEX MATCH "IDL\\\\(([0-9]+)(\\.([0-9]+))?)"
-        current_match ${match})
-
-      set(_IDL_current_version ${CMAKE_MATCH_1})
-      set(current_IDL_version_major ${CMAKE_MATCH_2})
-      set(current_IDL_version_minor ${CMAKE_MATCH_4})
-      if(NOT current_IDL_version_minor)
-        set(current_IDL_version_minor "0")
-      endif()
-
-      list(APPEND IDLs_from_registry ${_IDL_current_version})
-      unset(_IDL_current_version)
-    endforeach(match)
-
-  endif()
-
-  if(IDLs_from_registry)
-    list(REMOVE_DUPLICATES IDLs_from_registry)
-    list(SORT IDLs_from_registry)
-    list(REVERSE IDLs_from_registry)
-  endif()
-
-  set(${IDL_versions} ${IDLs_from_registry} PARENT_SCOPE)
+        REGEX MATCHALL "IDL\\\\([0-9]+(\\.[0-9]+)?)"
+        IDL_versions_regex ${varIDL})
+
+      foreach(match IN LISTS IDL_versions_regex)
+        string(
+          REGEX MATCH "IDL\\\\(([0-9]+)(\\.([0-9]+))?)"
+          current_match ${match})
+
+        set(_IDL_current_version ${CMAKE_MATCH_1})
+        set(current_IDL_version_major ${CMAKE_MATCH_2})
+        set(current_IDL_version_minor ${CMAKE_MATCH_4})
+        if(NOT current_IDL_version_minor)
+          set(current_IDL_version_minor "0")
+        endif()
+
+        get_filename_component(
+          current_IDL_ROOT
+          "[HKEY_LOCAL_MACHINE\\SOFTWARE\\${_IDL_company}\\IDL\\${_IDL_current_version};Installdir]"
+          ABSOLUTE)
+
+        # IDL root is "${Installdir}/IDLxy" with x.y the IDL version
+        string(REPLACE "." "" _IDL_current_version_short ${_IDL_current_version})
+        set(current_IDL_ROOT "${current_IDL_ROOT}/IDL${_IDL_current_version_short}")
+        unset(_IDL_current_version_short)
+        if(EXISTS ${current_IDL_ROOT})
+          list(APPEND _IDL_versions_list ${_IDL_current_version} ${current_IDL_ROOT})
+        endif()
+
+        unset(_IDL_current_version)
+      endforeach(match)
+
+    endif()
+
+  endforeach(_IDL_company)
+
+  set(${IDL_versions} ${_IDL_versions_list} PARENT_SCOPE)

 endfunction()

-#.rst:
-# .. command:: IDL_get_all_valid_IDL_roots_from_registry
-#
-#   Populates the IDL root with valid versions of IDL.
-#   The returned IDL_roots is organized in pairs
-#   ``(version_number,IDL_root_path)``.
-#
-#   ::
-#
-#     IDL_get_all_valid_IDL_roots_from_registry(
-#         IDL_versions
-#         IDL_roots)
-#
-#   ``IDL_versions``
-#     the versions of each of the IDL installations
-#   ``IDL_roots``
-#     the location of each of the IDL installations
-function(IDL_get_all_valid_IDL_roots_from_registry IDL_versions IDL_roots)
-
-  set(_IDL_roots_list )
-  foreach(_IDL_current_version ${IDL_versions})
-    get_filename_component(
-      current_IDL_ROOT
-      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ITT\\IDL\\${_IDL_current_version};Installdir]"
-      ABSOLUTE)
-
-    # IDL root is "${Installdir}/IDLxy" with x.y the IDL version
-    string(REPLACE "." "" _IDL_current_version_short ${_IDL_current_version})
-    set(current_IDL_ROOT "${current_IDL_ROOT}/IDL${_IDL_current_version_short}")
-    unset(_IDL_current_version_short)
-    if(EXISTS ${current_IDL_ROOT})
-      list(APPEND _IDL_roots_list ${_IDL_current_version} ${current_IDL_ROOT})
-    endif()
-
-  endforeach(_IDL_current_version)
-  unset(_IDL_current_version)
-  set(${IDL_roots} ${_IDL_roots_list} PARENT_SCOPE)
-  unset(_IDL_roots_list)
-endfunction()
-
-
-# get IDL version for a given root path from the list of `(version_number,IDL_root_path)`` pairs
-function(IDL_get_version_from_IDL_roots_from_registry IDL_roots IDL_root IDL_version)
-  list(LENGTH IDL_roots _numbers_of_IDL_roots)
-  foreach(i RANGE 0 (_numbers_of_IDL_roots-1) 2)
-    list(GET IDL_roots 0 _IDL_version)
-    list(GET IDL_roots 1 _IDL_root)
-    if(_IDL_root STREQUAL IDL_root)
-      set(IDL_version _IDL_version PARENT_SCOPE)
+# get IDL version for a given root path from the list of `(version_number,IDL_root_path)` pairs
+function(IDL_get_version_from_IDL_versions_from_registry IDL_versions IDL_root IDL_version)
+  file(TO_CMAKE_PATH "${IDL_root}" _given_root)
+  list(LENGTH IDL_versions _numbers_of_IDL_versions)
+  foreach(i RANGE 0 (_numbers_of_IDL_versions-1) 2)
+    list(GET IDL_versions ${i} _IDL_version)
+    math(EXPR j "${i} + 1")
+    list(GET IDL_versions ${j} _IDL_root)
+    if(${_IDL_root} STREQUAL ${_given_root})
+      set(${IDL_version} ${_IDL_version} PARENT_SCOPE)
     endif()
     unset(_IDL_version)
     unset(_IDL_root)
   endforeach()
-  set(_numbers_of_IDL_roots)
+  unset(_given_root)
+  unset(_numbers_of_IDL_versions)
 endfunction()

-# Get the version of IDL from the version.txt file (Mac/Linux only).
+# Get the version of IDL from the version.txt file
 function(IDL_get_version_from_root IDL_root IDL_final_version)
   if(WIN32)
     # determine based on entries in registry
     set(_IDL_versions_from_registry)
     IDL_extract_all_installed_versions_from_registry(CMAKE_CL_64 _IDL_versions_from_registry)
+    if(IDL_FIND_DEBUG)
+      message(STATUS "[IDL] IDL versions from registry are ${_IDL_versions_from_registry}")
+    endif()
     if(_IDL_versions_from_registry)
-      IDL_get_all_valid_IDL_roots_from_registry("${_IDL_versions_from_registry}" _IDL_available_roots)
+      set(_IDL_version)
+      IDL_get_version_from_IDL_versions_from_registry("${_IDL_versions_from_registry}" ${IDL_root} _IDL_version)
       unset(_IDL_versions_from_registry)
-      IDL_get_version_from_IDL_roots_from_registry(_IDL_available_roots IDL_root IDL_final_version)
-      unset(_IDL_available_roots)
-    endif()
+      set(${IDL_final_version} ${_IDL_version} PARENT_SCOPE)
+      unset(_IDL_version)
+    endif(_IDL_versions_from_registry)
   else()
     if(EXISTS ${IDL_root}/version.txt)
       file(READ ${IDL_root}/version.txt _IDL_version LIMIT 10)
@@ -306,21 +276,15 @@
   if(WIN32)

     # On WIN32, we look for IDL installation in the registry
-    # if unsuccessful, we look for all known revision and filter the existing
-    # ones.

     # testing if we are able to extract the needed information from the registry
-    set(_IDL_versions_from_registry)
-    IDL_extract_all_installed_versions_from_registry(CMAKE_CL_64 _IDL_versions_from_registry)
+    set(_IDL_possible_roots)
+    IDL_extract_all_installed_versions_from_registry(CMAKE_CL_64 _IDL_possible_roots)

     # the returned list is empty, doing the search on all known versions
-    if(NOT _IDL_versions_from_registry)
+    if(NOT _IDL_possible_roots)
       message(STATUS "[IDL] Search for IDL from the registry unsuccessful")
     endif()
-
-    # filtering the results with the registry keys
-    IDL_get_all_valid_IDL_roots_from_registry("${_IDL_versions_from_registry}" _IDL_possible_roots)
-    unset(_IDL_versions_from_registry)

   else()


Updated FindOSG.cmake from the version used by Present3D as this is more up to date.

--- CMakeModules/FindOSG.cmake
+++ CMakeModules/FindOSG.cmake
@@ -10,33 +10,36 @@
 # Created by Robert Osfield.

 FIND_PATH(OSG_INCLUDE_DIR osg/Node
+    ${OSG_DIR}/include
     $ENV{OSG_DIR}/include
     $ENV{OSG_DIR}
     $ENV{OSGDIR}/include
     $ENV{OSGDIR}
     $ENV{OSG_ROOT}/include
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include
-    /usr/include
-    /sw/include # Fink
-    /opt/local/include # DarwinPorts
-    /opt/csw/include # Blastwave
-    /opt/include
-    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
-    /usr/freeware/include
+    NO_DEFAULT_PATH
 )
+
+FIND_PATH(OSG_INCLUDE_DIR osg/Node)

 MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)

-    FIND_LIBRARY(${MYLIBRARY}
-        NAMES ${MYLIBRARYNAME}
+    FIND_LIBRARY("${MYLIBRARY}_DEBUG"
+        NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
         PATHS
+        ${OSG_DIR}/lib/Debug
+        ${OSG_DIR}/lib
+        $ENV{OSG_DIR}/lib/debug
         $ENV{OSG_DIR}/lib
         $ENV{OSG_DIR}
         $ENV{OSGDIR}/lib
         $ENV{OSGDIR}
         $ENV{OSG_ROOT}/lib
+        NO_DEFAULT_PATH
+    )
+
+    FIND_LIBRARY("${MYLIBRARY}_DEBUG"
+        NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
+        PATHS
         ~/Library/Frameworks
         /Library/Frameworks
         /usr/local/lib
@@ -48,16 +51,55 @@
         [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
         /usr/freeware/lib64
     )
+
+    FIND_LIBRARY(${MYLIBRARY}
+        NAMES ${MYLIBRARYNAME}
+        PATHS
+        ${OSG_DIR}/lib/Release
+        ${OSG_DIR}/lib
+        $ENV{OSG_DIR}/lib/Release
+        $ENV{OSG_DIR}/lib
+        $ENV{OSG_DIR}
+        $ENV{OSGDIR}/lib
+        $ENV{OSGDIR}
+        $ENV{OSG_ROOT}/lib
+        NO_DEFAULT_PATH
+    )

+    FIND_LIBRARY(${MYLIBRARY}
+        NAMES ${MYLIBRARYNAME}
+        PATHS
+        ~/Library/Frameworks
+        /Library/Frameworks
+        /usr/local/lib
+        /usr/lib
+        /sw/lib
+        /opt/local/lib
+        /opt/csw/lib
+        /opt/lib
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+        /usr/freeware/lib64
+    )
+
+    IF( NOT ${MYLIBRARY}_DEBUG)
+        IF(MYLIBRARY)
+            SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
+         ENDIF(MYLIBRARY)
+    ENDIF( NOT ${MYLIBRARY}_DEBUG)
+
 ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)

 FIND_OSG_LIBRARY(OSG_LIBRARY osg)
+FIND_OSG_LIBRARY(OSGGA_LIBRARY osgGA)
 FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
 FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
 FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
+FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
 FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
 FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
 FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
+FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
+FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)

 SET(OSG_FOUND "NO")
 IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)


Propagate CMAKE_DISABLE_FIND_PACKAGE_* to SimpleITK superbuild

Calling find_package for all languages can have side effects, such as
on OSX, displaying a prompt to install Java. There must be a way to
disable searching for wrapped languages. This patch enables a standard
CMake variable to disable finding languages.

Suggested-by: Jean-Christophe Fillion-Robin <859d3fd8ca46de62a08fca56c64958e301f5352c@kitware.com>

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -424,6 +424,8 @@
          _varName MATCHES "^BUILD_DOXYGEN$"
        OR
          _varName MATCHES "^DOXYGEN_"
+       OR
+         _varName MATCHES "^CMAKE_DISABLE_FIND_PACKAGE_"
          )
     message( STATUS "Passing variable \"${_varName}=${${_varName}}\" to SimpleITK external project.")
     list(APPEND SimpleITK_VARS ${_varName})


RP-41 advances

RP-41 advances

git-svn-id: 609522d7d408cfa97e9ff3bac4923f7fa96011fc@131 3149698f-976c-419d-aa71-eec1decff2c2

--- extensions/FindMatlab.cmake
+++ extensions/FindMatlab.cmake
@@ -484,25 +484,21 @@
       "matlab")

     if(NOT ${MATLAB_PROGRAM})
-      execute_process(COMMAND which matlab OUTPUT_VARIABLE _which_matlab RESULT_VARIABLE _which_matlab_result)
-      message(STATUS "blabalblabal ${_which_matlab_result}" )
-      if((${_which_matlab_result} EQUAL 0))# AND (EXISTS ${_which_matlab}))
-        message("blablablabalbalbalbalbalbal ${_which_matlab}")
-        set(MATLAB_PROGRAM ${_which_matlab})
+      #execute_process(COMMAND which matlab OUTPUT_VARIABLE _which_matlab RESULT_VARIABLE _which_matlab_result)
+      get_filename_component(MATLAB_PROGRAM "matlab" PROGRAM)
+      if(MATLAB_FIND_DEBUG)
+        message(STATUS "[MATLAB] matlab program result from the command line ${MATLAB_PROGRAM}")
       endif()
-    endif()
-
-    if(MATLAB_PROGRAM)
+
+    endif()
+
+    if(MATLAB_PROGRAM AND EXISTS ${MATLAB_PROGRAM})
       if(MATLAB_FIND_DEBUG)
         message(STATUS "[MATLAB] found from the command line at ${MATLAB_PROGRAM}")
       endif()

-      if(IS_SYMLINK  ${MATLAB_PROGRAM})
-        message("is symlink")
-      endif()
       # resolve symlinks
       get_filename_component(_matlab_current_location ${MATLAB_PROGRAM} REALPATH)
-      message(STATUS "symlinks _matlab_current_location ${_matlab_current_location}")
       if(${CMAKE_VERSION} VERSION_LESS "2.8.12")
         set(_directory_alias PATH)
       else()
@@ -511,34 +507,37 @@
       # get the directory (the command below has to be run twice)
       get_filename_component(_matlab_current_location ${_matlab_current_location} ${_directory_alias})
       get_filename_component(_matlab_current_location ${_matlab_current_location} ${_directory_alias}) # Matlab should be in bin
-      list(APPEND _matlab_possible_roots "" ${_matlab_current_location}) # empty version
+      list(APPEND _matlab_possible_roots "NOT-FOUND" ${_matlab_current_location}) # empty version
     endif()

     # on mac, we look for the /Application paths
     # this corresponds to the behaviour on Windows. On Linux, we do not have any other guess.
-    if((NOT _matlab_possible_roots) OR APPLE)
+    if((NOT _matlab_possible_roots) AND APPLE)

-      matlab_get_supported_releases(matlab_releases)
+      matlab_get_supported_releases(_matlab_releases)
       if(MATLAB_FIND_DEBUG)
-        message(STATUS "[MATLAB] Matlab supported versions ${matlab_releases}. If more version should be supported "
+        message(STATUS "[MATLAB] Matlab supported versions ${_matlab_releases}. If more version should be supported "
                        "the variable MATLAB_ADDITIONAL_VERSIONS can be set according to the documentation")
       endif()

-      foreach(current_matlab_release IN LISTS matlab_releases)
-        set(_matlab_full_string "/Applications/MATLAB_${current_matlab_release}.app")
+      foreach(_current_matlab_release IN LISTS _matlab_releases)
+        set(_matlab_full_string "/Applications/MATLAB_${_current_matlab_release}.app")
         if(EXISTS ${_matlab_full_string})
           set(current_matlab_version)
-          matlab_get_version_from_release_name(${current_matlab_release} current_matlab_version)
-          list(APPEND _matlab_possible_roots ${current_matlab_version})
+          matlab_get_version_from_release_name(${_current_matlab_release} current_matlab_version)
+          list(APPEND _matlab_possible_roots ${_current_matlab_version})
           list(APPEND _matlab_possible_roots ${_matlab_full_string})
         endif()

         unset(_matlab_full_string)
-      endforeach(current_matlab_release)
-      unset(current_matlab_release)
-
-    endif()
-
+      endforeach(_current_matlab_release)
+      unset(_current_matlab_release)
+      unset(_matlab_releases)
+    endif()
+
+    # we need to clear MATLAB_PROGRAM here
+    unset(MATLAB_PROGRAM CACHE)
+    unset(MATLAB_PROGRAM)

   elseif(NOT EXISTS ${MATLAB_ROOT})
     # if MATLAB_ROOT specified but erroneous
@@ -550,7 +549,7 @@

 if(MATLAB_FIND_DEBUG)
-  message(STATUS "Matlab ROOTS ${_matlab_possible_roots}")
+  message(STATUS "[MATLAB] Matlab root folders are ${_matlab_possible_roots}")
 endif()

@@ -570,11 +569,12 @@
 endif()

-if(NOT MATLAB_VERSION)
+if(NOT MATLAB_VERSION OR ${MATLAB_VERSION} STREQUAL "NOT-FOUND")
   if((NOT DEFINED MATLAB_PROGRAM) OR (NOT ${MATLAB_PROGRAM}) OR (NOT EXISTS ${MATLAB_PROGRAM}))
     if(MATLAB_FIND_DEBUG)
       message(STATUS "[MATLAB] - Unknown version, looking for Matlab under ${MATLAB_ROOT}")
     endif()
+    message("MATLAB_PROGRAM ${MATLAB_PROGRAM}")
     find_program(
       MATLAB_PROGRAM
       matlab
@@ -582,7 +582,9 @@
       DOC "Matlab main program"
       NO_DEFAULT_PATH
     )
-
+    message("MATLAB_PROGRAM ${MATLAB_PROGRAM}")
+
+

     if(MATLAB_PROGRAM)
       set(matlab_list_of_all_versions)
@@ -591,7 +593,7 @@
       list(GET matlab_list_of_all_versions 0 MATLAB_VERSION_tmp)

       # set the version into the cache
-      set(MATLAB_VERSION ${MATLAB_VERSION_tmp} CACHE STRING "Matlab version (automatically determined)")
+      set(MATLAB_VERSION ${MATLAB_VERSION_tmp})# CACHE STRING "Matlab version (automatically determined)")
       list(LENGTH list_of_all_versions list_of_all_versions_length)
       if(${list_of_all_versions_length} GREATER 1)
         message(WARNING "[MATLAB] Found several versions, taking the first one (versions found ${list_of_all_versions})")


Fix CMake for nanoFramework.Hardware.Esp32 (#825)

--- CMake/Modules/FindnanoFramework.Hardware.Esp32.cmake
+++ CMake/Modules/FindnanoFramework.Hardware.Esp32.cmake
@@ -9,17 +9,18 @@

 # set include directories
 list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Core")
-list(APPEND nanoFrameworkHardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Include")
-list(APPEND nanoFrameworkHardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
-list(APPEND nanoFrameworkHardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/PAL/Include")
-list(APPEND nanoFrameworkHardware.Esp32_INCLUDE_DIRS "${BASE_PATH_FOR_THIS_MODULE}")
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Include")
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/PAL/Include")
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${BASE_PATH_FOR_THIS_MODULE}")

 # source files
 set(nanoFramework.Hardware.Esp32_SRCS
+
     nanoFramework_hardware_esp32_native.cpp
-    nanoFramework_hardware_esp32_native.h
     nanoFramework_hardware_esp32_native_Hardware_Esp32_sleep.cpp
     nanoFramework_hardware_esp32_native_Hardware_Esp32_Logging.cpp
+
 )

 foreach(SRC_FILE ${nanoFramework.Hardware.Esp32_SRCS})


ENH: Could not get Eden to compile Slicer Numpy, disabling in TubeTK

--- Eden_Kitware_TubeTK_Slicer.cmake
+++ Eden_Kitware_TubeTK_Slicer.cmake
@@ -124,7 +124,7 @@
 set( TubeTK_USE_EXAMPLES_AS_TESTS OFF )
 set( TubeTK_USE_IPYTHON_NOTEBOOKS ON )
 set( TubeTK_USE_LIBSVM ON )
-set( TubeTK_USE_NUMPY ON )
+set( TubeTK_USE_NUMPY OFF )
 set( TubeTK_USE_PYQTGRAPH ON )
 set( TubeTK_USE_PYTHON ON )
 set( TubeTK_USE_QT ON )


ENH: new macro SUPPRESS_VC8_DEPRECATED_WARNINGS

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -42,4 +42,11 @@
 ENDIF(MSVC70)
 ENDMACRO(INCREASE_MSVC_HEAP_LIMIT)

+# suppress some warnings in VC8 about using unsafe/deprecated c functions
+MACRO(SUPPRESS_VC8_DEPRECATED_WARNINGS)
+IF(MSVC80)
+  ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
+ENDIF(MSVC80)
+ENDMACRO(SUPPRESS_VC8_DEPRECATED_WARNINGS)

+


[cmake] less aggressive findCCtag

[cmake] less aggressive findCCtag

poparteu/openMVG#17

--- src/cmakeFindModules/FindCCTag.cmake
+++ src/cmakeFindModules/FindCCTag.cmake
@@ -23,10 +23,10 @@
   CCTag
 )

-find_package(OpenCV REQUIRED)
-find_package(OPTPP REQUIRED)
-find_package(Ceres REQUIRED)
-find_package(Glog REQUIRED)
+find_package(OpenCV QUIET)
+find_package(OPTPP QUIET)
+find_package(Ceres QUIET)
+find_package(Glog QUIET)

 IF(CCTAG_INCLUDE_DIR)
   MESSAGE(STATUS "CCTag headers found in ${CCTAG_INCLUDE_DIRS}")


rust: find cargo with find_program to give a better error message when cargo isn't available

Summary:
If you build Watchman from source on a machine without cargo, the
error message was confusing. You'd see "command not found" somewhere
mixed into ninja's output.

Change RustStaticLibrary, which is only used by Watchman and EdenFS,
to find cargo with find_program instead of guessing its name and
assuming it exists. This gives a much less confusing error message at
CMake configure time.

Reviewed By: genevievehelsel

Differential Revision: D40441374

fbshipit-source-id: eeafe615616775c660c700e14cf1f6b2fd9715a8

--- build/fbcode_builder/CMake/RustStaticLibrary.cmake
+++ build/fbcode_builder/CMake/RustStaticLibrary.cmake
@@ -57,6 +57,8 @@
     "directory = \"${ESCAPED_RUST_VENDORED_CRATES_DIR}\"\n"
   )
 endif()
+
+find_program(CARGO_COMMAND cargo REQUIRED)

 # Cargo is a build system in itself, and thus will try to take advantage of all
 # the cores on the system. Unfortunately, this conflicts with Ninja, since it
@@ -119,11 +121,6 @@
   set(staticlib_name "${CMAKE_STATIC_LIBRARY_PREFIX}${crate_name}${CMAKE_STATIC_LIBRARY_SUFFIX}")
   set(rust_staticlib "${CMAKE_CURRENT_BINARY_DIR}/${target_dir}/${staticlib_name}")

-  set(cargo_cmd cargo)
-  if(WIN32)
-    set(cargo_cmd cargo.exe)
-  endif()
-
   if(DEFINED ARG_FEATURES)
     set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
   else()
@@ -142,7 +139,7 @@
       "${CMAKE_COMMAND}" -E env
       "CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}"
       ${extra_cargo_env}
-      ${cargo_cmd}
+      ${CARGO_COMMAND}
       ${cargo_flags}
     COMMENT "Building Rust crate '${crate_name}'..."
     JOB_POOL rust_job_pool
@@ -195,11 +192,6 @@
     set(features )
   endif()

-  set(cargo_cmd cargo)
-  if(WIN32)
-    set(cargo_cmd cargo.exe)
-  endif()
-
   if(DEFINED ARG_FEATURES)
     set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
   else()
@@ -219,7 +211,7 @@
       "${CMAKE_COMMAND}" -E env
       "CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}"
       ${extra_cargo_env}
-      ${cargo_cmd}
+      ${CARGO_COMMAND}
       ${cargo_flags}
     COMMENT "Building Rust executable '${crate_name}'..."
     JOB_POOL rust_job_pool


ENH: Mark WrapITK cmake option as advanced

WrapITK takes a long time to compile requiring additional resources,
and does not reliable work on windows.

Change-Id: I5c1ce8e77429ba7c83adc6898f15c17c8bbc6e36

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -244,6 +244,7 @@
 #------------------------------------------------------------------------------

 set(ITK_WRAPPING OFF CACHE BOOL "Turn OFF wrapping ITK with WrapITK")
+mark_as_advanced( FORCE ITK_WRAPPING )
 if(ITK_WRAPPING)
   list(APPEND ITK_DEPENDENCIES Swig)
 endif()


ENH: Set default build type to release

ENH: Set default build type to release

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -102,9 +102,9 @@
 # Setup build type
 #------------------------------------------------------------------------------

-# By default, let's build as Debug
+# By default, let's build as Release
 if(NOT DEFINED CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE "Debug")
+  set(CMAKE_BUILD_TYPE "Release")
 endif()

 # let a dashboard override the default.


Missing 'Not' in last FindBLAS test ...

Missing 'Not' in last FindBLAS test ...

--- Numerics/cmake/FindBLAS.cmake
+++ Numerics/cmake/FindBLAS.cmake
@@ -267,7 +267,7 @@
       ""
       "blas"
       "")
-    if (BLAS_LIBRARIES)
+    if(NOT BLAS_LIBRARIES)
       set(WITH_BLAS "generic" CACHE STRING "Blas implementation type [mkl/openblas/atlas/accelerate/veclib/generic]" FORCE)
       set(BLAS_HEADERS cblas.h)
     endif (BLAS_LIBRARIES)
@@ -282,7 +282,8 @@
       ""
       "f77blas;cblas"
       "")
-    if (BLAS_LIBRARIES)
+
+    if(BLAS_LIBRARIES)
       set(WITH_BLAS "generic" CACHE STRING "Blas implementation type [mkl/openblas/atlas/accelerate/veclib/generic]" FORCE)
       set(BLAS_HEADERS cblas.h)
     endif (BLAS_LIBRARIES)


Try to hack around ubuntu 12.04 libunwind to having a .pc file

--- framework/cmake/framework.cmake
+++ framework/cmake/framework.cmake
@@ -43,11 +43,21 @@
 find_package(PkgConfig)

 if(BACKTRACE_ON_ERROR)
-		pkg_check_modules(PC_UNWIND REQUIRED libunwind)
-		find_path(UNWIND_INCLUDE_DIR libunwind.h HINTS ${PC_UNWIND_INCLUDEDIR})
-		list(APPEND FRAMEWORK_INCLUDE_DIRS ${UNWIND_INCLUDE_DIR})
-		list(APPEND FRAMEWORK_LIBRARIES ${PC_UNWIND_LIBRARIES} dl)
-		add_definitions(-DBACKTRACE_ON_ERROR)
+		pkg_check_modules(PC_UNWIND libunwind)
+		if (NOT PC_UNWIND_FOUND)
+				#Ubuntu 12.04 libunwind doesn't have a pkgconfig - try 'current' paths anyway
+				find_path(UNWIND_INCLUDE_DIR libunwind.h HINTS ${FRAMEWORK_INCLUDE_DIRS})
+				if (NOT UNWIND_INCLUDE_DIR)
+						message(FATAL_ERROR "Libunwind not found")
+				endif()
+				list(APPEND FRAMEWORK_LIBRARIES unwind dl)
+				#HACK - this assumes the library path is already searched?
+		else()
+			find_path(UNWIND_INCLUDE_DIR libunwind.h HINTS ${PC_UNWIND_INCLUDEDIR})
+			list(APPEND FRAMEWORK_INCLUDE_DIRS ${UNWIND_INCLUDE_DIR})
+			list(APPEND FRAMEWORK_LIBRARIES ${PC_UNWIND_LIBRARIES} dl)
+			add_definitions(-DBACKTRACE_ON_ERROR)
+		endif()
 endif()

 pkg_check_modules(PC_PHYSFS REQUIRED physfs>=2.1.0)


Fixes in DISCODE_FIND_DCL macro

Fixes in DISCODE_FIND_DCL macro

--- share/DisCODeMacros.cmake
+++ share/DisCODeMacros.cmake
@@ -39,7 +39,7 @@

         IF (NOT DEFINED DISCODE_DCL_DIR)
             MESSAGE(STATUS "Looking for DISCODE_DCL_DIR...")
-            SET(DISCODE_DCL_DIR $ENV{DISCODE_DCL_DIR})
+            SET(DISCODE_DCL_DIR $ENV{DISCODE_DCL_DIR} CACHE INTERNAL "DisCODe DCL directory")
         ENDIF (NOT DEFINED DISCODE_DCL_DIR)

         # if DISCODE_DCL_DIR is not set
@@ -64,7 +64,14 @@

     # second check, if found then add apropriate include dirs
     IF( DISCODE_${DCL_NAME}_FOUND )
-        INCLUDE_DIRECTORIES(${DISCODE_DCL_DIR}/${DCL_NAME}/dist/include)
+        # check, if config file exists
+        IF (EXISTS ${DISCODE_DCL_DIR}/${DCL_NAME}/dist/${DCL_NAME}Config.cmake)
+            # include it if it exists
+            INCLUDE(${DISCODE_DCL_DIR}/${DCL_NAME}/dist/${DCL_NAME}Config.cmake)
+        ELSE (EXISTS ${DISCODE_DCL_DIR}/${DCL_NAME}/dist/${DCL_NAME}Config.cmake)
+            # print error message and stop compilation
+            MESSAGE( FATAL_ERROR "${DCL_NAME} DCL found, but ${DCL_NAME}Config.cmake not found" )
+        ENDIF (EXISTS ${DISCODE_DCL_DIR}/${DCL_NAME}/dist/${DCL_NAME}Config.cmake)
     ELSE( DISCODE_${DCL_NAME}_FOUND )
         MESSAGE(FATAL_ERROR "Couldn't find ${DCL_NAME} DCL!")
     ENDIF( DISCODE_${DCL_NAME}_FOUND )


boards: mimxrt1050_evk: Enable pyocd runner

Adds support for debugging and flashing the mimxrt1050_evk board via
pyocd. Support for this board has not yet been merged in upstream pyocd,
therefore the default in zephyr is left as jlink.

Signed-off-by: Maureen Helm <87a696db5547fa477bda9f9e0f00013c839c14d3@nxp.com>

--- boards/arm/mimxrt1050_evk/board.cmake
+++ boards/arm/mimxrt1050_evk/board.cmake
@@ -4,5 +4,18 @@
 # SPDX-License-Identifier: Apache-2.0
 #

+set_ifndef(OPENSDA_FW jlink)
+
+if(OPENSDA_FW STREQUAL jlink)
+  set_ifndef(BOARD_DEBUG_RUNNER jlink)
+  set_ifndef(BOARD_FLASH_RUNNER jlink)
+elseif(OPENSDA_FW STREQUAL daplink)
+  set_ifndef(BOARD_DEBUG_RUNNER pyocd)
+  set_ifndef(BOARD_FLASH_RUNNER pyocd)
+endif()
+
+board_runner_args(pyocd "--target=mimxrt1050_hyperflash")
 board_runner_args(jlink "--device=MCIMXRT1052")
+
+include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)


Update to the SimpleITK 4.11.0 release!

Update to the SimpleITK 4.11.0 release!

Change-Id: I504c6b042cefbe559190303312bdcd6c6f10c443

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -42,7 +42,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG e234d4df432387f5cd667a91c958be9d79892815 )# ITK 4.11 post rc2
+set(ITK_TAG_COMMAND GIT_TAG v4.11.0 )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


Updated call signature for compilation tests

Former-commit-id: 450ad02de2b47c9380938c7c6e4f80dd77c1869c

--- cmake-modules/Fetch_ceres-solver.cmake
+++ cmake-modules/Fetch_ceres-solver.cmake
@@ -183,8 +183,8 @@
     if(TARGET openmp::openmp)
         target_link_libraries(ceres::ceres INTERFACE openmp::openmp )
     endif()
-    check_ceres_compiles("target" "${CERES_FLAGS}" "" "" "" "ceres::ceres")
-    if(NOT CERES_COMPILES_target)
+    check_ceres_compiles("ceres::ceres" "" "" "${CERES_FLAGS}" "")
+    if(NOT CERES_COMPILES)
         include(cmake-modules/PrintTargetProperties.cmake)
         print_target_properties(ceres::ceres)
         message(FATAL_ERROR "Could not compile simple ceres program")


[updated] BOTG_INCLUDE.cmake

[updated] BOTG_INCLUDE.cmake

--- cmake/BOTG_INCLUDE.cmake
+++ cmake/BOTG_INCLUDE.cmake
@@ -32,14 +32,19 @@

 # Set the BootsOnTheGround source directory!
 ELSE()
+    #Special-case if this is the BOTG project.
+    IF( EXISTS "${CMAKE_SOURCE_DIR}/cmake/BOTG.cmake" )
+        SET(BOTG_SOURCE_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH INTERNAL)

-    SET(BOTG_SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/BootsOnTheGround" CACHE PATH INTERNAL)
-
-    IF( EXISTS "${BOTG_SOURCE_DIR}" )
-        MESSAGE( STATUS "[BootsOnTheGround] using BOTG_SOURCE_DIR=${BOTG_SOURCE_DIR} ... ")
+    #Otherwise look in external.
     ELSE()
-        MESSAGE( STATUS "[BootsOnTheGround] bootstrapping in...")
-        BOTG_DownloadExternalProjects( BootsOnTheGround )
+        SET(BOTG_SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/BootsOnTheGround" CACHE PATH INTERNAL)
+        IF( EXISTS "${BOTG_SOURCE_DIR}" )
+            MESSAGE( STATUS "[BootsOnTheGround] using BOTG_SOURCE_DIR=${BOTG_SOURCE_DIR} ... ")
+        ELSE()
+            MESSAGE( STATUS "[BootsOnTheGround] bootstrapping in...")
+            BOTG_DownloadExternalProjects( BootsOnTheGround )
+        ENDIF()
     ENDIF()

 ENDIF()


Small fix to find CppUTest library on case sensitive systems.

git-svn-id: 2595ac559ac7dd568b108f33b264eba7ab70070c@1632597 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/FindCppUTest.cmake
+++ cmake/FindCppUTest.cmake
@@ -18,7 +18,7 @@
 FIND_PATH(CPPUTEST_INCLUDE_DIR NAMES CppUTest/TestHarness.h)
 FIND_PATH(CPPUTEST_EXT_INCLUDE_DIR NAMES CppUTestExt/MockSupport.h)

-FIND_LIBRARY(CPPUTEST_LIBRARY NAMES CppUtest)
+FIND_LIBRARY(CPPUTEST_LIBRARY NAMES CppUTest)
 FIND_LIBRARY(CPPUTEST_EXT_LIBRARY NAMES CppUTestExt)

 # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if


Added STM324xG_EVAL to BSP

Added STM324xG_EVAL to BSP

--- cmake/FindSTM32BSP.cmake
+++ cmake/FindSTM32BSP.cmake
@@ -1,6 +1,8 @@
+MESSAGE("STM Board: ${STM_BOARD}")
 IF(STM32_FAMILY STREQUAL "F4")
 	IF(STM_BOARD STREQUAL "STM32F429I-Discovery")
-		SET(BSP_COMPONENTS eeprom
+		SET(BSP_COMPONENTS
+                eeprom
 			    gyroscope
 			    io
 			    lcd
@@ -10,6 +12,19 @@
 		SET(BSP_HEADERS stm32f429i_discovery.h)
 		SET(BSP_SRC stm32f429i_discovery.c)
 	ENDIF()
+    IF(STM_BOARD STREQUAL "STM324xG_EVAL")
+        SET(BSP_COMPONENTS
+            lcd
+            camera
+            eeprom
+            io
+            sd
+            sram
+            ts)
+        SET(BSP_PREFIX stm324xg_eval_)
+        SET(BSP_HEADERS stm324xg_eval.h)
+        SET(BSP_SRC stm324xg_eval.c)
+    ENDIF()
 	set(COMMON_COMPONENTS ampire480272
 			      ampire640480
 			      cs43l22


Make directory if not exist

Make directory if not exist

--- cmake/add_airframe.cmake
+++ cmake/add_airframe.cmake
@@ -9,7 +9,7 @@

     # aborts if directory where airframe config is put does not exist
     if(NOT EXISTS ${local_airframe_path})
-        message(FATAL_ERROR "PX4 Firmware is REQUIRED.\nInstall and run 'make posix_sitl_default gazebo'.\nIf this persists after installation, make symbolic link from Firmware/ROMFS/px4fmu_common to ~/.ros/etc")
+        file(MAKE_DIRECTORY ${local_airframe_path}/init.d-posix)
     endif()

     # get filename


if (NOT PDAL_BUILD_STATIC) seemed a little confusing; also seeing if the boost linkage is the problem with the build

--- cmake/pdal_options.cmake
+++ cmake/pdal_options.cmake
@@ -43,7 +43,12 @@

 # Build shared libraries by default.
 option(PDAL_BUILD_STATIC "Build PDAL as a static library" OFF)
-if(NOT PDAL_BUILD_STATIC)
+if(PDAL_BUILD_STATIC)
+  set(PDAL_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
+  set(PDAL_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
+  set(PDAL_LIB_TYPE "STATIC")
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
+else(PDAL_BUILD_STATIC)
   set(PDAL_LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
   set(PDAL_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
   set(PDAL_LIB_TYPE "SHARED")
@@ -51,17 +56,12 @@
   if(WIN32)
     set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_IMPORT_LIBRARY_SUFFIX})
   endif(WIN32)
-else(NOT PDAL_BUILD_STATIC)
-  set(PDAL_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
-  set(PDAL_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
-  set(PDAL_LIB_TYPE "STATIC")
-  set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
-endif(NOT PDAL_BUILD_STATIC)
+endif(PDAL_BUILD_STATIC)
 mark_as_advanced(PDAL_BUILD_STATIC)

 if (CMAKE_VERSION VERSION_GREATER 2.8.10)
     set(PDAL_LINKAGE "PUBLIC;general")
-    set(BOOST_LINKAGE "LINK_PRIVATE;general")
+    set(BOOST_LINKAGE "PRIVATE;general")
 else()
     set(PDAL_LINKAGE "")
     set(BOOST_LINKAGE "")


Add cmake flag LLVM_USE_SANITIZE_COVERAGE

Summary:
When LLVM_USE_SANITIZE_COVERAGE=YES
and one of the sanitizers is used -fsanitize-coverage=3 will be added
to build flag. This will be used to run a coverage-guided fuzzer on various
llvm libraries.

Test Plan: n/a

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7116

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -410,6 +410,9 @@
   else()
     message(WARNING "LLVM_USE_SANITIZER is not supported on this platform.")
   endif()
+  if (LLVM_USE_SANITIZE_COVERAGE)
+    append("-fsanitize-coverage=4" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  endif()
 endif()

 # Turn on -gsplit-dwarf if requested


We require MSVC 2013 Update 4 due to previous versions miscompiling ASTMatchers

Previous versions of MSVC 2013 would miscompile ASTMatchers (and/or their
tests). Bump up the requirement and make sure we know about the minor
revision.

Minimum required version found by Michael Edwards!

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -41,8 +41,8 @@
       set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
     endif()
   elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
-      message(FATAL_ERROR "Host Visual Studio must be at least 2013 (MSVC 18.0)")
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.31101)
+      message(FATAL_ERROR "Host Visual Studio must be at least 2013 Update 4 (MSVC 18.0.31101)")
     endif()
   endif()
 endif()


cmake: Remove -D NDEBUG from CFLAGS as well as CXXFLAGS

This silences ~7 warnings on .c files in the LLVM build.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -56,13 +56,16 @@
   if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
     add_definitions( -UNDEBUG )
     # Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
-    set(REGEXP_NDEBUG "(^| )[/-]D *NDEBUG($| )")
-    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
-      CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
-    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
-      CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
-    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
-      CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
+    foreach (flags_var_to_scrub
+        CMAKE_CXX_FLAGS_RELEASE
+        CMAKE_CXX_FLAGS_RELWITHDEBINFO
+        CMAKE_CXX_FLAGS_MINSIZEREL
+        CMAKE_C_FLAGS_RELEASE
+        CMAKE_C_FLAGS_RELWITHDEBINFO
+        CMAKE_C_FLAGS_MINSIZEREL)
+      string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
+        "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
+    endforeach()
   endif()
 else()
   if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )


build: correct variable in SDK configuration

The variable was supported to be set to the triple, except it was set to
the variable itself, effectively setting the variable to nothing.  This
is needed to clear the path to directory style installation for
non-Apple targets.

--- cmake/modules/SwiftConfigureSDK.cmake
+++ cmake/modules/SwiftConfigureSDK.cmake
@@ -374,7 +374,7 @@

     # If the module triple wasn't set explicitly, it's the same as the triple.
     if(NOT SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE)
-      set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE "${SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE}")
+      set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE "${SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE}")
     endif()
   endforeach()

@@ -407,7 +407,7 @@
           "${arch}-unknown-windows-${environment}")
     endif()

-    set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE "${SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE}")
+    set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE "${SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE}")

     # NOTE: set the path to / to avoid a spurious `--sysroot` from being passed
     # to the driver -- rely on the `INCLUDE` AND `LIB` environment variables


adding 2 more warnings for GCC 7

adding 2 more warnings for GCC 7

--- scripts/cmake/common.cmake
+++ scripts/cmake/common.cmake
@@ -122,15 +122,17 @@
         add_compiler_flags(-Wvector-operation-performance)
     endif()

-    if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
+    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
         add_compiler_flags(-Wshift-overflow=2)
         add_compiler_flags(-Wnull-dereference)
         add_compiler_flags(-Wduplicated-cond)
     endif()

-    if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
+    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
         add_compiler_flags(-Walloc-zero)
         add_compiler_flags(-Walloca)
+        add_compiler_flags(-Wduplicated-branches)
+        add_compiler_flags(-Wrestrict)
     endif()
 endif()