Switch gurobi, snopt, and spotless git repos.

These repositories at github.com/RobotLocomotion are the ones maintained by the
RobotLocomotion group for use with Drake.

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -91,16 +91,16 @@
 set(apriltags_revision 24)
 set(apriltags_depends opencv-drc)

-set(spotless_url https://svn.csail.mit.edu/locomotion/pods/spotless)
-set(spotless_revision 8053)
+set(spotless_url ssh://git@github.com/RobotLocomotion/spotless-pod.git)
+set(spotless_revision 464be854a1296d4726cb37d86f24d39742293ab6)
 set(spotless_depends)

-set(snopt_url https://svn.csail.mit.edu/locomotion/pods/snopt7.2-12)
-set(snopt_revision 7782)
+set(snopt_url ssh://git@github.com/RobotLocomotion/snopt.git)
+set(snopt_revision 26eb6145bfae4671cc86bd5c723b381fb8bd5ab6)
 set(snopt_depends)

-set(gurobi_url https://svn.csail.mit.edu/locomotion/pods/gurobi)
-set(gurobi_revision 8053)
+set(gurobi_url ssh://git@github.com/RobotLocomotion/gurobi.git)
+set(gurobi_revision 46d1985d5a86f7bc660e363cb2d5ff76af4b6fd9)
 set(gurobi_depends)

 set(flycapture_url https://svn.csail.mit.edu/drc/trunk/software/externals/flycapture)
@@ -130,14 +130,14 @@
   camunits-wrapper
   camunits-extra-wrapper
   apriltags
-  spotless
-  snopt
-  gurobi
   flycapture
   )

 set(git-externals
   bullet
+  spotless
+  snopt
+  gurobi
   )


Separate test name extraction into reusable macro

--- prosoft/core/tests/test_utils.cmake
+++ prosoft/core/tests/test_utils.cmake
@@ -1,4 +1,4 @@
-# Copyright © 2015-2016, Prosoft Engineering, Inc. (A.K.A "Prosoft")
+# Copyright © 2015-2017, Prosoft Engineering, Inc. (A.K.A "Prosoft")
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -23,16 +23,23 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-# HOST_NAME can be different from TARGET_NAME to support internal library tests
-macro(ps_add_ctests_from_catch_tests_to_host TARGET_NAME HOST_NAME)
+macro(ps_get_catch_tests OUTPUT_VARIABLE TARGET_NAME)
     get_target_property(srcfiles ${TARGET_NAME} SOURCES)
     foreach(src ${srcfiles})
         file(STRINGS ${src} srcstrs REGEX "TEST_CASE|SCENARIO\\(\".*\"\\)")
         foreach(str ${srcstrs})
             string(REGEX REPLACE "^.*\\(\"(.*)\"\\).*$" "\\1" testName ${str})
             string(REPLACE " " "_" testName ${testName}) # test names can't have spaces
-            add_test(NAME ${testName} COMMAND ${HOST_NAME} ${testName})
+            list(APPEND ${OUTPUT_VARIABLE} ${testName})
         endforeach()
+    endforeach()
+endmacro()
+
+# HOST_NAME can be different from TARGET_NAME to support internal library tests
+macro(ps_add_ctests_from_catch_tests_to_host TARGET_NAME HOST_NAME)
+    ps_get_catch_tests(testNames ${TARGET_NAME})
+    foreach(testName ${testNames})
+        add_test(NAME ${testName} COMMAND ${HOST_NAME} ${testName})
     endforeach()
 endmacro()


BUG: Fix python wrapping of Cuberille remote module

The old wrapping didn't work because the .wrap file did not include the superclass or fully specify the template.

Change-Id: I067fc40c81b8c53ba9574f93aedd530b27e91e10

--- Modules/Remote/Cuberille.remote.cmake
+++ Modules/Remote/Cuberille.remote.cmake
@@ -17,5 +17,5 @@
 http://www.insight-journal.org/browse/publication/213
 "
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKCuberille.git
-  GIT_TAG 7c703ada7854478d8938e13efb860596b948c6c0
+  GIT_TAG aa2dea61661403a72f07019d9411d5aadf928252
   )


don't always create a patch step target

don't always create a patch step target

* patch step target should only be created if there's package to extract or a patch to apply
* fixes duplicate client target in webpro - see issue https://github.com/smanders/externpro/issues/115

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -166,6 +166,11 @@
     set(tgt ${prj})
   endif()
   if(TARGET ${tgt})
+    return()
+  endif()
+  # unless there's a package to extract or a patch to apply,
+  # there's no reason to create a target with ExternalProject_Add()
+  if(NOT DEFINED P_DLURL AND NOT DEFINED P_PATCH)
     return()
   endif()
   if(DEFINED P_PATCH)


_WIN32_WINNT set to 0x0601 (Windows 7)

_WIN32_WINNT set to 0x0601 (Windows 7)

* new library (web socket Sdws) uses boost asio
* won't require BOOST_ASIO_ENABLE_CANCELIO definition if we move this to at least 0x0600

see issue https://github.com/smanders/externpro/issues/180

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1807,7 +1807,7 @@
     -D_CRT_SECURE_NO_WARNINGS
     -D_SCL_SECURE_NO_WARNINGS
     -D_WINSOCK_DEPRECATED_NO_WARNINGS
-    -D_WIN32_WINNT=0x0502 #(Windows Server 2003 target)
+    -D_WIN32_WINNT=0x0601 #(Windows 7 target)
     -DWIN32_LEAN_AND_MEAN
     -DCURL_STATICLIB # Tell cURL not to __declspec(dllimport) its symbols.
     )


also check CMAKE_C_COMPILER_ID for Clang

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1012,9 +1012,12 @@
     set(reldebCompiler "/Zi /O2 /Ob1")
     set(releaseLinker "/INCREMENTAL:NO")
     set(reldebLinker "/debug /INCREMENTAL")
-  elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+  elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR
+         ${CMAKE_C_COMPILER_ID} MATCHES "Clang" OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
     set(releaseCompiler "-O3")
     set(reldebCompiler "-O2 -g")
+  else()
+    message(FATAL_ERROR "unknown compiler")
   endif()
   if(XP_BUILD_WITH_DEBUG_INFO)
     set(from release)


CMake: Set C++11 as standard automatically.

Instead of setting the compiler option manually, we use the
`CMAKE_CXX_STANDARD` variable to set the default for all targets. This
automatically appends the correct flag for each compiler.

Review: https://reviews.apache.org/r/66007

--- cmake/CompilationConfigure.cmake
+++ cmake/CompilationConfigure.cmake
@@ -164,6 +164,13 @@

 # SYSTEM CHECKS.
 ################
+
+# Set the default standard to C++11 for all targets.
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+# Do not use, for example, `-std=gnu++11`.
+set(CMAKE_CXX_EXTENSIONS OFF)
+
 # Check that we are targeting a 64-bit architecture.
 if (NOT (CMAKE_SIZEOF_VOID_P EQUAL 8))
   message(
@@ -178,12 +185,6 @@
     "    `cmake -DCMAKE_OSX_ARCHITECTURES=x86_64`.\n")
 endif ()

-# Make sure C++ 11 features we need are supported.
-# This is split into two cases: Windows and "other platforms".
-#   * For "other platforms", we simply check if the C++11 flags work
-#   * For Windows, C++11 is enabled by default on MSVC 1900.
-#     We just check the MSVC version.
-CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
 if (WIN32)
   # Versions of Visual Studio older than 2017 do not support all core features
   # of C++14, which prevents Mesos from moving past C++11. This adds a
@@ -220,15 +221,6 @@
 # POSIX CONFIGURATION.
 ######################
 if (NOT WIN32)
-  if (NOT COMPILER_SUPPORTS_CXX11)
-    message(
-      FATAL_ERROR
-      "The compiler ${CMAKE_CXX_COMPILER} does not support the `-std=c++11` "
-      "flag. Please use a different C++ compiler.")
-  endif ()
-
-  string(APPEND CMAKE_CXX_FLAGS " -std=c++11")
-
   # Warn about use of format functions that can produce security issues.
   string(APPEND CMAKE_CXX_FLAGS " -Wformat-security")


Remove unused cmake utils (#712)

Remove unused cmake utils (#712)

--- cmake/Modules/Findpybind11.cmake
+++ cmake/Modules/Findpybind11.cmake
@@ -1,18 +0,0 @@
-# Try to find the pybind11 library and headers.
-#  pybind11_FOUND        - system has pybind11
-#  pybind11_INCLUDE_DIRS - the pybind11 include directory
-
-find_path(pybind11_INCLUDE_DIR
-	NAMES pybind11/pybind11.h
-	DOC "The directory where pybind11 includes reside"
-)
-
-set(pybind11_INCLUDE_DIRS ${pybind11_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(pybind11
-	FOUND_VAR pybind11_FOUND
-	REQUIRED_VARS pybind11_INCLUDE_DIR
-)
-
-mark_as_advanced(pybind11_FOUND)


Revert "Revert "Disable autostart for now so usb works.""

This reverts commit 998acf4d0802fe031725ba17d339bab20fcaa677.

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -291,21 +291,23 @@
 	set(romfs_pruner ${CMAKE_SOURCE_DIR}/Tools/px_romfs_pruner.py)
 	set(bin_to_obj ${CMAKE_SOURCE_DIR}/cmake/nuttx/bin_to_obj.py)

-
 	#message(STATUS "temp_dir: ${romfs_temp_dir}")
 	#message(STATUS "src_dir: ${romfs_src_dir}")

 	add_custom_command(OUTPUT rc.autostart
 		COMMAND ${PYTHON_EXECUTABLE} ${romfs_autostart}
-			-a ${romfs_src_dir}/init.d/
+			-a ${romfs_src_dir}/init.d
 			-s rc.autostart
 		)

 	add_custom_command(OUTPUT romfs.bin
 		COMMAND cmake -E remove_directory ${romfs_temp_dir}
 		COMMAND cmake -E copy_directory ${romfs_src_dir} ${romfs_temp_dir}
-		COMMAND cmake -E copy rc.autostart ${romfs_temp_dir}/init.d
-		#TODO add romfs cleanup and pruning
+		# TODO XXX hack to get nsh to work, copying real
+	    # autostart in currently makes nsh fail over usb
+		COMMAND cmake -E touch ${romfs_temp_dir}/init.d/rc.autostart
+		#COMMAND cmake -E copy rc.autostart ${romfs_temp_dir}/init.d
+		#TODO add romfs cleanup of temp file .~, .swp etc
 		COMMAND ${PYTHON_EXECUTABLE} ${romfs_pruner}
 			--folder ${romfs_temp_dir}
 		COMMAND ${GENROMFS} -f ${CMAKE_CURRENT_BINARY_DIR}/romfs.bin


Apply quoting to the CMAKE_CXX_COMPILER_ID variable.

--- external/External.cmake
+++ external/External.cmake
@@ -43,10 +43,10 @@
 set (EXT_PREFIX_DIR  "${CMAKE_BINARY_DIR}/external/prefix"  CACHE STRING "External build prefix.")
 set (EXT_INSTALL_DIR "${CMAKE_BINARY_DIR}/external/local"   CACHE STRING "External install prefix.")

-if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
     set (EXT_CXX_FLAGS)
     set (EXT_C_FLAGS)
-elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     set (EXT_CXX_FLAGS "-w -fPIC")
     set (EXT_C_FLAGS   "-w -fPIC")
 endif ()
@@ -100,7 +100,7 @@
 set (zlib_EXT_DEBUG_NAME)
 set (zlib_EXT_STATIC_LIB_NAME z)

-if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
     set (zlib_EXT_STATIC_LIB_NAME zlibstatic)
     if (NOT CMAKE_BUILD_TYPE_LOWER STREQUAL "release")
         set (zlib_EXT_DEBUG_NAME d)


Media / Devpacks : Updated FFMpeg devpacks to a recent version for Windows 32/64 bits.

--- src/cmake/devpack-standard-imports.cmake
+++ src/cmake/devpack-standard-imports.cmake
@@ -5,10 +5,10 @@
 #
 macro(DEVPACK_IMPORT_FFMPEG)
 	if(WIN64)
-		DEVPACK_IMPORT("ffmpeg" "gitf97e28e" "1" "windows" "x86_64" "all" "all" "all")
+		DEVPACK_IMPORT("ffmpeg" "git09cd228" "1" "windows" "x86_64" "all" "all" "all")
 	else()
 		if (WIN32)
-			DEVPACK_IMPORT("ffmpeg" "gitf97e28e" "1" "windows" "i386" "all" "all" "all")
+			DEVPACK_IMPORT("ffmpeg" "git09cd228" "1" "windows" "i386" "all" "all" "all")
 		else()
 			DEVPACK_IMPORT("ffmpeg" "1.1.1" "1" "all" "all" "${DEVPACK_COMPILER}" "all")
 		endif()


+ py-extensions CMake-module now supports supplementary user-defined flags

--- contrib/cmake/PyExtensions.cmake
+++ contrib/cmake/PyExtensions.cmake
@@ -56,7 +56,7 @@
     find_package( PythonLibs REQUIRED )

     include( ${SWIG_USE_FILE} )
-    set( CMAKE_SWIG_FLAGS "-Wall" )
+    set( CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -Wall )
     include_directories( ${PYTHON_INCLUDE_DIRS} )

     #


Also removed findFFTW, as fftw is no longer used.

--- source/cmake_modules/FindFFTW.cmake
+++ source/cmake_modules/FindFFTW.cmake
@@ -1,125 +0,0 @@
-# - Find the FFTW library
-#
-# Usage:
-#   find_package(FFTW [REQUIRED] [QUIET] )
-#
-# It sets the following variables:
-#   FFTW_FOUND               ... true if fftw is found on the system
-#   FFTW_LIBRARIES           ... full path to fftw library
-#   FFTW_INCLUDES            ... fftw include directory
-#
-# The following variables will be checked by the function
-#   FFTW_USE_STATIC_LIBS    ... if true, only static libraries are found
-#   FFTW_ROOT               ... if set, the libraries are exclusively searched
-#                               under this path
-#   FFTW_LIBRARY            ... fftw library to use
-#   FFTW_INCLUDE_DIR        ... fftw include directory
-#
-
-# This code was copied from the EIGEN repository,
-#  which is licensed as MPL2, BSD, or LGPL2.1
-#  https://bitbucket.org/eigen/eigen/
-#  http://eigen.tuxfamily.org
-#  Downloaded 21/08/2017 by K. Sjobak
-
-#If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT
-if( NOT FFTW_ROOT AND ENV{FFTWDIR} )
-  set( FFTW_ROOT $ENV{FFTWDIR} )
-endif()
-
-# Check if we can use PkgConfig
-find_package(PkgConfig)
-
-#Determine from PKG
-if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT )
-  pkg_check_modules( PKG_FFTW QUIET "fftw3" )
-endif()
-
-#Check whether to search static or dynamic libs
-set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
-
-if( ${FFTW_USE_STATIC_LIBS} )
-  set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} )
-else()
-  set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
-endif()
-
-if( FFTW_ROOT )
-
-  #find libs
-  find_library(
-    FFTW_LIB
-    NAMES "fftw3"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-  )
-
-  find_library(
-    FFTWF_LIB
-    NAMES "fftw3f"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-  )
-
-  find_library(
-    FFTWL_LIB
-    NAMES "fftw3l"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-  )
-
-  #find includes
-  find_path(
-    FFTW_INCLUDES
-    NAMES "fftw3.h"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "include"
-    NO_DEFAULT_PATH
-  )
-
-else()
-
-  find_library(
-    FFTW_LIB
-    NAMES "fftw3"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_library(
-    FFTWF_LIB
-    NAMES "fftw3f"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-
-  find_library(
-    FFTWL_LIB
-    NAMES "fftw3l"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_path(
-    FFTW_INCLUDES
-    NAMES "fftw3.h"
-    PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
-  )
-
-endif( FFTW_ROOT )
-
-set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})
-
-if(FFTWL_LIB)
-  set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB})
-endif()
-
-set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(FFTW DEFAULT_MSG
-                                  FFTW_INCLUDES FFTW_LIBRARIES)
-
-mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB FFTWF_LIB FFTWL_LIB)
-


When setting a variable in CMake using the SET command, one has to use one and only one type. INTERNAL and STRING are both types. Removed the STRING type

--- cmake/BALLCompilerSpecific.cmake
+++ cmake/BALLCompilerSpecific.cmake
@@ -4,12 +4,12 @@

 SET(USE_PEDANTIC ON CACHE BOOL "Use pedantic compilation options if offered by the compiler")

-SET(CXX_COMPILER_ID "(unknown)" CACHE INTERNAL STRING "The C++ compiler id")
+SET(CXX_COMPILER_ID "(unknown)" CACHE INTERNAL "The C++ compiler id")

-SET(CXX_COMPILER_VERSION "0" CACHE INTERNAL STRING "The C++ compiler version")
-SET(CXX_COMPILER_VERSION_MAJOR "0" CACHE INTERNAL STRING "The C++ compiler major version")
-SET(CXX_COMPILER_VERSION_MINOR "0" CACHE INTERNAL STRING "The C++ compiler minor version")
-SET(CXX_COMPILER_VERSION_MINOR_MINOR "0" CACHE INTERNAL STRING "The C++ compiler minor minor version")
+SET(CXX_COMPILER_VERSION "0" CACHE INTERNAL "The C++ compiler version")
+SET(CXX_COMPILER_VERSION_MAJOR "0" CACHE INTERNAL "The C++ compiler major version")
+SET(CXX_COMPILER_VERSION_MINOR "0" CACHE INTERNAL "The C++ compiler minor version")
+SET(CXX_COMPILER_VERSION_MINOR_MINOR "0" CACHE INTERNAL "The C++ compiler minor minor version")

 SET(CXX_USE_TR1 TRUE CACHE STRING "Use tr1 support if available")


Add brew/osx search path for openblas (#5821)

--- cmake/Modules/FindOpenBLAS.cmake
+++ cmake/Modules/FindOpenBLAS.cmake
@@ -12,6 +12,7 @@
   /usr/local/include/openblas
   /usr/local/include/openblas-base
   /opt/OpenBLAS/include
+  /usr/local/opt/openblas/include
   ${PROJECT_SOURCE_DIR}/3rdparty/OpenBLAS/include
   ${PROJECT_SOURCE_DIR}/thirdparty/OpenBLAS/include
   ${OpenBLAS_HOME}
@@ -28,6 +29,7 @@
         /usr/local/lib
         /usr/local/lib64
         /opt/OpenBLAS/lib
+        /usr/local/opt/openblas/lib
         ${PROJECT_SOURCE_DIR}/3rdparty/OpenBLAS/lib
         ${PROJECT_SOURCE_DIR}/thirdparty/OpenBLAS/lib
 	${OpenBLAS_DIR}


cmake/StringToInternalBool.cmake: Removed debug MESSAGE()

--- cmake/StringToInternalBool.cmake
+++ cmake/StringToInternalBool.cmake
@@ -4,5 +4,4 @@
   ELSE (${ARGN})
     SET (${name} 0)
   ENDIF (${ARGN})
-  MESSAGE(STATUS "Using ${name} ${${name}}")
 ENDMACRO(STRINGTOINTERNALBOOL)


Try and add rpaths to make the macOS Python wheels more portable.

--- cmake/add_rpath_for_python.cmake
+++ cmake/add_rpath_for_python.cmake
@@ -2,6 +2,7 @@
 # Make the SWIG generated Python interface modules more portable by using rpath for the the Python dynamic library.
 string(REPLACE "${LIST_SEPARATOR}" ";" SHARED_OBJECT_MODULES "${SHARED_OBJECT_MODULES}")
 foreach(_M ${SHARED_OBJECT_MODULES})
-  execute_process(COMMAND ${INSTALL_NAME_TOOL_EXE} -change "/Library/Frameworks/Python.framework/Versions/${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/Python" @rpath/${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/Python ${_M})
+  execute_process(COMMAND ${INSTALL_NAME_TOOL_EXE} -change "/Library/Frameworks/Python.framework/Versions/${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/Python" @rpath/Python.framework/Versions/${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/Python ${_M})
+  execute_process(COMMAND ${INSTALL_NAME_TOOL_EXE} -add_rpath /opt/homebrew/Frameworks ${_M})
 endforeach()


Added $ENV{MONALISA_DIR} to look for monalisa

--- cmake/modules/FindMonalisa.cmake
+++ cmake/modules/FindMonalisa.cmake
@@ -13,7 +13,8 @@

 find_path(MONALISA_INCLUDE_DIR ApMon.h
   ${MONALISA_DIR}/include
-  /usr/local/include
+  $ENV{MONALISA_DIR}/include
+  /usr/local/include
   /opt/alien/api/include
   /opt/monalisa/include
   /usr/include
@@ -22,7 +23,8 @@

 find_library(MONALISA_LIBRARY NAMES apmoncpp PATHS
   ${MONALISA_DIR}/lib
-  /usr/local/lib
+  $ENV{MONALISA_DIR}/lib
+  /usr/local/lib
   /opt/alien/api/lib
   /opt/monalisa/lib
   /usr/lib


Use WEBP_BUILD_VWEBP=OFF on Apple

Use WEBP_BUILD_VWEBP=OFF on Apple

--- cmake/projects/WebP/hunter.cmake
+++ cmake/projects/WebP/hunter.cmake
@@ -88,6 +88,16 @@
   )
 endif()

+if(APPLE)
+  # FindGLUT issue:
+  # - https://travis-ci.org/ingenue/hunter/jobs/502944277
+  list(
+      APPEND
+      _hunter_webp_cmake_args
+      WEBP_BUILD_VWEBP=OFF
+  )
+endif()
+
 hunter_cmake_args(WebP CMAKE_ARGS ${_hunter_webp_cmake_args})

 hunter_pick_scheme(DEFAULT url_sha1_cmake)


Fixed the CheckCompilerFlags function to use unique flags.

--- CMake/mitkFunctionCheckCompilerFlags.cmake
+++ CMake/mitkFunctionCheckCompilerFlags.cmake
@@ -10,11 +10,11 @@
 # Example:
 #
 #   set(myflags)
-#   MITKFunctionCheckCompilerFlags("-fprofile-arcs" myflags)
+#   mitkFunctionCheckCompilerFlags("-fprofile-arcs" myflags)
 #   message(1-myflags:${myflags})
-#   MITKFunctionCheckCompilerFlags("-fauto-bugfix" myflags)
+#   mitkFunctionCheckCompilerFlags("-fauto-bugfix" myflags)
 #   message(2-myflags:${myflags})
-#   MITKFunctionCheckCompilerFlags("-Wall" myflags)
+#   mitkFunctionCheckCompilerFlags("-Wall" myflags)
 #   message(1-myflags:${myflags})
 #
 #   The output will be:
@@ -30,9 +30,16 @@
     MESSAGE(FATAL_ERROR "CXX_FLAG_TO_TEST shouldn't be empty")
   ENDIF()

-  CHECK_CXX_ACCEPTS_FLAG(${CXX_FLAG_TO_TEST} HAS_FLAG)
+  # Internally, the macro CMAKE_CXX_ACCEPTS_FLAG calls TRY_COMPILE. To avoid
+  # the cost of compiling the test each time the project is configured, the variable set by
+  # the macro is added to the cache so that following invocation of the macro with
+  # the same variable name skip the compilation step.
+  # For that same reason, ctkFunctionCheckCompilerFlags function appends a unique suffix to
+  # the HAS_FLAG variable. This suffix is created using a 'clean version' of the flag to test.
+  STRING(REGEX REPLACE "-\\s\\$\\+\\*\\{\\}\\(\\)\\#" "" suffix ${CXX_FLAG_TO_TEST})
+  CHECK_CXX_ACCEPTS_FLAG(${CXX_FLAG_TO_TEST} HAS_FLAG_${suffix})

-  IF(HAS_FLAG)
+  IF(HAS_FLAG_${suffix})
     SET(${RESULT_VAR} "${${RESULT_VAR}} ${CXX_FLAG_TO_TEST}" PARENT_SCOPE)
   ENDIF()


Fix qhull compilation on mac

Fix qhull compilation on mac

--- deps/Qhull/Qhull.cmake
+++ deps/Qhull/Qhull.cmake
@@ -1,7 +1,7 @@
 include(GNUInstallDirs)
 prusaslicer_add_cmake_project(Qhull
-    URL "https://github.com/qhull/qhull/archive/v8.0.0.zip"
-    URL_HASH SHA256=7edae57142989690bc432893da47db5b7069a150c82ba113e46977904ca326ef
+    URL "https://github.com/qhull/qhull/archive/v8.0.1.zip"
+    URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b
     CMAKE_ARGS
         -DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR}
 )


Properly detect Linux 64 bits with CMake

--- salome_adm/cmake_files/FindPLATFORM.cmake
+++ salome_adm/cmake_files/FindPLATFORM.cmake
@@ -19,6 +19,8 @@

 IF(WINDOWS)
   SET(MACHINE WINDOWS)
+ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+  SET(MACHINE PCLINUX64)
 ELSE(WINDOWS)
   SET(MACHINE PCLINUX)
 ENDIF(WINDOWS)


Fix typo.

Fix typo.

svn path=/branches/kdepim/enterprise4/kdepim/; revision=981122


build: minor cosmetic tweak to Matlab find script

--- cmake-modules/FindThirdPartyMatlab.cmake
+++ cmake-modules/FindThirdPartyMatlab.cmake
@@ -31,7 +31,10 @@

 	# Try relative to the executable path
 	GET_FILENAME_COMPONENT(Matlab_ROOT ${Matlab_EXECUTABLE} PATH)
-	FIND_PATH(Matlab_INCLUDE "mex.h" PATHS ${Matlab_ROOT}/../extern/include ${Matlab_ROOT}/../extern/include/extern)
+	IF(Matlab_ROOT)
+		SET(Matlab_ROOT, ${Matlab_ROOT}/../)
+		FIND_PATH(Matlab_INCLUDE "mex.h" PATHS ${Matlab_ROOT}/extern/include ${Matlab_ROOT}/extern/include/extern)
+	ENDIF(Matlab_ROOT)

 	# matlab executable path might have been pointing to a symbolic link elsewhere, try something else
 	IF((NOT Matlab_INCLUDE) AND UNIX)
@@ -51,7 +54,7 @@
 		ENDIF(UNIX)
 		IF(WIN32)
 			SET(Matlab_LIBRARIES libmex libmx libeng) #mclmcrrt
-			SET(Matlab_LIB_DIRECTORIES ${Matlab_ROOT}/../extern/lib/win32/microsoft)
+			SET(Matlab_LIB_DIRECTORIES ${Matlab_ROOT}/extern/lib/win32/microsoft)
 			# for delayed importation on windows
 			TARGET_LINK_LIBRARIES(${PROJECT_NAME} Delayimp )
 			SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:libeng.dll /DELAYLOAD:libmx.dll")


well i have a .gir and a .typelib now... nfi if they work, but yeah :)

--- cmake/Modules/GObjectIntrospection.cmake
+++ cmake/Modules/GObjectIntrospection.cmake
@@ -95,7 +95,7 @@

 	# if library is set, we need to prepend --library= on to it
 	if(GIR_LIBRARY)
-		set(GIR_LIBRARY "--library=${GIR_LIBRARY}")
+		set(GIR_REAL_LIBRARY "--library=${GIR_LIBRARY}")
 	endif(GIR_LIBRARY)

 	# if program has been set, we prepend --program= on to it
@@ -148,7 +148,7 @@
 			--nsversion=${GIR_NSVERSION}
 			${GIR_REAL_CFLAGS}
 			${GIR_FORMAT}
-			${GIR_LIBRARY}
+			${GIR_REAL_LIBRARY}
 			${GIR_PROGRAM} ${GIR_PROGRAM_ARGS}
 			${GIR_QUIET} ${GIR_VERBOSE}
 			${GIR_REAL_IDENTIFIER_PREFIXES}
@@ -160,9 +160,12 @@
 			${GIR_SOURCES}
 			${GIR_REAL_BUILT_SOURCES}
 		OUTPUT ${GIR_FILENAME}
+		DEPENDS ${GIR_LIBRARY}
 		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 		VERBATIM
 	)
+
+	add_custom_target(${GIR_FILENAME} ALL DEPENDS ${GIR_LIBRARY} ${GIR_FILENAME})

 	# create the name of the typelib
 	string(REPLACE ".gir" ".typelib" GIR_TYPELIB "${GIR_FILENAME}")
@@ -171,11 +174,11 @@
 		COMMAND ${GIR_COMPILER} ${GIR_COMPILER_ARGS}
 			${CMAKE_CURRENT_BINARY_DIR}/${GIR_FILENAME}
 			--output=${CMAKE_CURRENT_BINARY_DIR}/${GIR_TYPELIB}
-		DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${GIR_TYPELIB}
 		OUTPUT ${GIR_TYPELIB}
-		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+		DEPENDS ${GIR_FILENAME}
+		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 	)

-	add_custom_target(${GIR_TYPELIB} ALL DEPENDS ${GIR_FILENAME})
+	add_custom_target(${GIR_TYPELIB} ALL DEPENDS ${GIR_LIBRARY} ${GIR_FILENAME} ${GIR_TYPELIB})
 endfunction(add_gir_introspection)


Update ITKv4 to actually include modulus fix.

Change-Id: I7b6721a88e110f7286f7e4dedcb1067be9a371e1

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -16,7 +16,7 @@

 # NOTE: it is very important to update the ITK_DIR path with the
 # after v4.3rc04 and including modulus functor fix
-set(ITK_TAG_COMMAND GIT_TAG 1fe07a877fda54dded2bcef33a99b56810a42703
+set(ITK_TAG_COMMAND GIT_TAG ff9d8e279a13a12bf6617f13c31b9122e88ef1fe
  )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )


ENH:  Update ITK version.

ENH:  Update ITK version.

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -151,7 +151,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
   # set(${proj}_REPOSITORY ${git_protocol}://github.com/stnava/ITK.git)
-  set(${proj}_GIT_TAG fe34d9caa5d98face1ef422afdfc05d71d38a68c ) ## 20190518 Fix ITKv5 api changes
+  set(${proj}_GIT_TAG 683ba61ad9a95e9bbab9dd30e53c1fda3a37519b ) ## 20190703 Fix warning
   set(ITK_VERSION_ID ITK-5.0) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


[cmake]Build for specific cpu. Solves illegal-instruction-problems when build-host supports more than runtime-host.

--- cmake/FindD.cmake
+++ cmake/FindD.cmake
@@ -46,6 +46,7 @@
     else (dmd_version)
 	string(REGEX MATCH "LLVM-based D Compiler" is_ldc "${d_output}")
 	if (is_ldc)
+        set(LDC_CPU ${CMAKE_SYSTEM_PROCESSOR} CACHE STRING "Set the CPU for LLVM to generate for")
 	    exec_program(${DC} ARGS "--version" OUTPUT_VARIABLE d_output)
 	    string(REGEX MATCH "based on DMD v[0-9]\\.[0-9]+" ldc_version "${d_output}")
 	    set(D_IS_LLVM true)
@@ -116,6 +117,11 @@
     set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -L/subsystem:windows)
 endif(CMAKE_HOST_WIN32)
 set(D_DEBUG_FLAGS ${D_DEBUG_FLAGS} ${D_DEBUG_FLAG})
+
+# Architecture-specific
+if(LDC_CPU)
+    set(D_FLAGS ${D_FLAGS} -mcpu=${LDC_CPU})
+endif(LDC_CPU)

 # Unittest flags.
 option(UNITTEST "Includes unittests" "OFF")


Correct tests to match the new fileIO test

--- test/testing.cmake
+++ test/testing.cmake
@@ -74,19 +74,22 @@
     ./testFileIO
     ${MESHES}/cube/cube.dmg
     ${MESHES}/cube/pumi670/cube.smb
-    ${GRAPHS}/cube/cube)
+    ${GRAPHS}/cube/cube
+    3)

   mpi_test(testFileIOParallel 4
     ./testFileIO
     ${MESHES}/cube/cube.dmg
     ${MESHES}/cube/pumi670/4/cube.smb
-    ${GRAPHS}/cube/4/)
+    ${GRAPHS}/cube/4/
+    3)

   mpi_test(testFileIOParallelTorus 4
     ./testFileIO
     ${MESHES}/torus/torus.dmg
     ${MESHES}/torus/4imb/torus.smb
     ${GRAPHS}/torus/4/
+    3
     0)

   mpi_test(testFileIOParallelTorus01 4
@@ -94,6 +97,7 @@
     ${MESHES}/torus/torus.dmg
     ${MESHES}/torus/4imb/torus.smb
     ${GRAPHS}/torus/4_01/
+    3
     0
     1)
 ENDIF()


Removing "make distclean\; make depsclean" message on Windows (#2977)

--- CMake/CMakeLibs.cmake
+++ CMake/CMakeLibs.cmake
@@ -9,7 +9,9 @@
   set(LINK "http://osquery.readthedocs.io/en/stable/development/building/")
   LOG("Welcome to osquery's build-- thank you for your patience! :)")
   LOG("For a brief tutorial see: ${ESC}[1m${LINK}${ESC}[m")
-  LOG("If at first you dont succeed, perhaps: make distclean; make depsclean")
+  if(NOT WINDOWS)
+    LOG("If at first you dont succeed, perhaps: make distclean; make depsclean")
+  endif()
   LOG("Building for platform ${ESC}[36;1m${NAME} (${OSQUERY_BUILD_PLATFORM}, ${OSQUERY_BUILD_DISTRO})${ESC}[m")
   LOG("Building osquery version ${ESC}[36;1m ${OSQUERY_BUILD_VERSION} sdk ${OSQUERY_BUILD_SDK_VERSION}${ESC}[m")
 endmacro(LOG_PLATFORM)


no message

no message

--- CMake/FindEigen.cmake
+++ CMake/FindEigen.cmake
@@ -94,6 +94,7 @@
 LIST(APPEND EIGEN_CHECK_PATH_SUFFIXES
   eigen3 # Default root directory for Eigen.
   Eigen/include/eigen3 ) # Windows (for C:/Program Files prefix).
+MESSAGE(status ${EIGEN_ROOT})
 MESSAGE(status ${EIGEN_CANDIDATES})
 # Search supplied hint directories first if supplied.
 FIND_PATH(EIGEN_INCLUDE_DIR


changing defaultly downloaded nlopt version to 2.5.0

--- src/libnest2d/cmake_modules/DownloadNLopt.cmake
+++ src/libnest2d/cmake_modules/DownloadNLopt.cmake
@@ -10,7 +10,7 @@
 include(DownloadProject)
 download_project(   PROJ                nlopt
                     GIT_REPOSITORY      https://github.com/stevengj/nlopt.git
-                    GIT_TAG             1fcbcbf2fe8e34234e016cc43a6c41d3e8453e1f #master #nlopt-2.4.2
+                    GIT_TAG             v2.5.0 #1fcbcbf2fe8e34234e016cc43a6c41d3e8453e1f #master #nlopt-2.4.2
                     # CMAKE_CACHE_ARGS    -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${NLopt_DIR}
                     ${UPDATE_DISCONNECTED_IF_AVAILABLE}
 )


FIX (#4432): removed some debug output

FIX (#4432): removed some debug output

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -489,8 +489,7 @@
 		SET(_current_target_location ${bundle_name}.app/Contents/MacOS/${_target_name})
 	    LIST(APPEND _target_locations ${_current_target_location})
 		SET(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS)
-		MESSAGE( "  SET(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) ")
-
+
 		INSTALL(FILES ${_target} DESTINATION ${bundle_name}.app/Contents/MacOS/)
       ENDFOREACH(bundle_name)
     ENDIF(NOT MACOSX_BUNDLE_NAMES)
@@ -501,10 +500,7 @@
   INSTALL(FILES ${_target} DESTINATION bin)
 ENDIF()

-MESSAGE("target locations: ${_target_locations}")
-
 FOREACH(_target_location ${_target_locations})
-MESSAGE("qt locations orig: ${${_target_location}_qt_plugins_install_dir}")

 IF(QT_PLUGINS_DIR)
     INSTALL(DIRECTORY "${QT_PLUGINS_DIR}"


add jemalloc library and library with pic

--- project/cmake/modules/FindJemalloc.cmake
+++ project/cmake/modules/FindJemalloc.cmake
@@ -15,10 +15,12 @@
 #
 # ::
 #
-#   Jemalloc_INCLUDE_DIRS  - where to find jemalloc/jemalloc.h, etc.
-#   Jemalloc_EXECUTABLE    - full path of pproc.
-#   Jemalloc_LIBRARY_DIRS  - directory of libraries of jemalloc.
-#   Jemalloc_FOUND         - True if jemalloc found.
+#   Jemalloc_INCLUDE_DIRS   - where to find jemalloc/jemalloc.h, etc.
+#   Jemalloc_EXECUTABLE     - full path of pproc.
+#   Jemalloc_LIBRARY_DIRS   - directory of libraries of jemalloc.
+#   Jemalloc_LIBRARYIES     - libraries of jemalloc.
+#   Jemalloc_LIBRARYIES_PIC - libraries of jemalloc with pic.
+#   Jemalloc_FOUND          - True if jemalloc found.
 #
 # ::
 #
@@ -31,7 +33,7 @@
 #   (or Jemalloc_ROOT)

 #=============================================================================
-# Copyright 2014-2015 OWenT.
+# Copyright 2014-2018 OWenT.
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -57,17 +59,18 @@
 set(JEMALLOC_NAMES jemalloc jemalloc_pic)

 # Try each search configuration.
-find_path(Jemalloc_INCLUDE_DIRS NAMES "jemalloc/jemalloc.h" ${_JEMALLOC_SEARCH_ROOT})
-find_library(Jemalloc_LIBRARY_DIRS NAMES ${JEMALLOC_NAMES} ${_JEMALLOC_SEARCH_ROOT})
-string(REGEX REPLACE "[/\\\\][^/\\\\]*$" "" Jemalloc_LIBRARY_DIRS "${Jemalloc_LIBRARY_DIRS}")
+find_path(Jemalloc_INCLUDE_DIRS NAMES "jemalloc/jemalloc.h" PATH_SUFFIXES include ${_JEMALLOC_SEARCH_ROOT})
+find_library(Jemalloc_LIBRARYIES NAMES ${JEMALLOC_NAMES} PATH_SUFFIXES lib ${_JEMALLOC_SEARCH_ROOT})
+find_library(Jemalloc_LIBRARYIES_PIC NAMES ${JEMALLOC_NAMES} PATH_SUFFIXES lib ${_JEMALLOC_SEARCH_ROOT})
+string(REGEX REPLACE "[/\\\\][^/\\\\]*$" "" Jemalloc_LIBRARY_DIRS ${Jemalloc_LIBRARYIES})

-mark_as_advanced(Jemalloc_LIBRARY_DIRS Jemalloc_INCLUDE_DIRS )
+mark_as_advanced(Jemalloc_LIBRARYIES Jemalloc_LIBRARYIES_PIC Jemalloc_LIBRARY_DIRS Jemalloc_INCLUDE_DIRS )

 # handle the QUIETLY and REQUIRED arguments and set Jemalloc_FOUND to TRUE if
 # all listed variables are TRUE
 include("FindPackageHandleStandardArgs")
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jemalloc
-  REQUIRED_VARS Jemalloc_INCLUDE_DIRS Jemalloc_LIBRARY_DIRS
+  REQUIRED_VARS Jemalloc_INCLUDE_DIRS Jemalloc_LIBRARYIES Jemalloc_LIBRARYIES_PIC Jemalloc_LIBRARY_DIRS
   FOUND_VAR Jemalloc_FOUND
 )


IncludeWhatYouUse: Also read the COMPILE_FLAGS property

--- IncludeWhatYouUse.cmake
+++ IncludeWhatYouUse.cmake
@@ -99,8 +99,12 @@
         # Convert spaces in IWYU_SOURCE_ARGS to "," delimiter
         string (REPLACE " " "," IWYU_SOURCE_ARGS "${IWYU_SOURCE_ARGS}")

+        get_property (TARGET_PROPERTY_COMPILE_FLAGS
+                      TARGET "${TARGET}" PROPERTY COMPILE_FLAGS)
+
         set (IWYU_ARGUMENTS
              ${IWYU_TARGET_ARGS}
+             ${TARGET_PROPERTY_COMPILE_FLAGS}
              ${IWYU_SOURCE_ARGS})
         string (REPLACE ";" "," IWYU_ARGUMENTS "${IWYU_ARGUMENTS}")


Remove now useless C++1y flag

Remove now useless C++1y flag

As of D66195 we support C++14 by default.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -20,8 +20,6 @@

 set(LLVM_CXX_STD_default "c++14")
 # Preserve behaviour of legacy cache variables
-if (LLVM_ENABLE_CXX1Y)
-  set(LLVM_CXX_STD_default "c++1y")
 elseif (LLVM_ENABLE_CXX1Z)
   set(LLVM_CXX_STD_default "c++1z")
 endif()


CMake: Fixed deprecated _BSD_SOURCE.

CMake: Fixed deprecated _BSD_SOURCE.

Since glibc-2.20 _DEFAULT_SOURCE definition is also required.

Reviewed-by: Alexandr Akulich

--- cmake/modules/TelepathyDefaults.cmake
+++ cmake/modules/TelepathyDefaults.cmake
@@ -108,7 +108,7 @@
     endif(${NOT_RELEASE} EQUAL 1)

     if(CMAKE_SYSTEM_NAME MATCHES Linux)
-        add_definitions(-D_BSD_SOURCE)
+        add_definitions(-D_BSD_SOURCE -D_DEFAULT_SOURCE)
     endif(CMAKE_SYSTEM_NAME MATCHES Linux)

     # Compiler coverage


Switch default platform SDK to 10.6

Switch default platform SDK to 10.6


BUG: different include directory for boost on windows and *nix

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -67,6 +67,9 @@

 #HINT: avoid all uses of  _SB_* in External_<project>.cmake
 # and depend on much saner CMAKE_PREFIX_PATH for cmake projects.
-set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include/boost-1_60)
-
+if(MSVC)
+  set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include/boost-1_60)
+else()
+  set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
+endif()
 SUPERBUILD_PATCH_SOURCE(BOOST)


px4fmu-v2_test don't build frsky_telemetry, gimbal, and snapdragon_rc_pwm

--- cmake/configs/nuttx_px4fmu-v2_test.cmake
+++ cmake/configs/nuttx_px4fmu-v2_test.cmake
@@ -37,16 +37,16 @@
 	drivers/airspeed
 	drivers/ets_airspeed
 	drivers/meas_airspeed
-	drivers/frsky_telemetry
+	#drivers/frsky_telemetry
 	modules/sensors
 	#drivers/mkblctrl
 	drivers/px4flow
 	#drivers/oreoled
-	drivers/gimbal
+	#drivers/gimbal
 	drivers/pwm_input
 	drivers/camera_trigger
 	drivers/bst
-	drivers/snapdragon_rc_pwm
+	#drivers/snapdragon_rc_pwm
 	drivers/lis3mdl

 	#


Use -fno-omit-frame-pointer for Linux opt builds (#221)

--- cmake/toolchains/linux/gcc-default.cmake
+++ cmake/toolchains/linux/gcc-default.cmake
@@ -41,20 +41,20 @@
 set(CMAKE_C_FLAGS   ${DEFAULT_C_FLAGS}   CACHE STRING "Default" FORCE)

-set(CMAKE_CXX_FLAGS_RELEASE         "-O2 -DNDEBUG"
+set(CMAKE_CXX_FLAGS_RELEASE         "-O2 -DNDEBUG -fno-omit-frame-pointer"
     CACHE STRING "Release"        FORCE)
-set(CMAKE_CXX_FLAGS_MINSIZEREL      "-O2 -DNDEBUG"
+set(CMAKE_CXX_FLAGS_MINSIZEREL      "-O2 -DNDEBUG -fno-omit-frame-pointer"
     CACHE STRING "MinSizeRel"     FORCE)
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO  "-O2 -g -DNDEBUG"
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO  "-O2 -g -DNDEBUG -fno-omit-frame-pointer"
     CACHE STRING "RelWithDebInfo" FORCE)
 set(CMAKE_CXX_FLAGS_DEBUG           "-g"
     CACHE STRING "Debug"          FORCE)

-set(CMAKE_C_FLAGS_RELEASE           "-O2 -DNDEBUG"
+set(CMAKE_C_FLAGS_RELEASE           "-O2 -DNDEBUG -fno-omit-frame-pointer"
     CACHE STRING "Release"        FORCE)
-set(CMAKE_C_FLAGS_MINSIZEREL        "-O2 -DNDEBUG"
+set(CMAKE_C_FLAGS_MINSIZEREL        "-O2 -DNDEBUG -fno-omit-frame-pointer"
     CACHE STRING "MinSizeRel"     FORCE)
-set(CMAKE_C_FLAGS_RELWITHDEBINFO    "-O2 -g -DNDEBUG"
+set(CMAKE_C_FLAGS_RELWITHDEBINFO    "-O2 -g -DNDEBUG -fno-omit-frame-pointer"
     CACHE STRING "RelWithDebInfo" FORCE)
 set(CMAKE_C_FLAGS_DEBUG             "-g"
     CACHE STRING "Debug"          FORCE)


Add "Defines Module" setting for iOS framework builds (#1425)

--- toolchains/iOS.framework.cmake
+++ toolchains/iOS.framework.cmake
@@ -128,6 +128,7 @@
 set_xcode_property(${FRAMEWORK_NAME} ONLY_ACTIVE_ARCH "NO")
 set_xcode_property(${FRAMEWORK_NAME} VALID_ARCHS "${IOS_ARCH}")
 set_xcode_property(${FRAMEWORK_NAME} ARCHS "${IOS_ARCH}")
+set_xcode_property(${FRAMEWORK_NAME} DEFINES_MODULE "YES")

 # Set RPATH to be within the application /Frameworks directory
 set_xcode_property(${FRAMEWORK_NAME} LD_DYLIB_INSTALL_NAME "@rpath/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}")


Build input devices by default

Build input devices by default

Build input devices by default, previously this option is set to false.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -388,6 +388,6 @@
 endmacro()

-# options related to build ipnut devices
-#
-option(SURGSIM_DEVICES_BUILD "Include input devices in the build" OFF)
+# options related to build input devices
+#
+option(SURGSIM_DEVICES_BUILD "Include input devices in the build" ON)


Allow running tests under valgrind on Linux.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -20,12 +20,23 @@
 #
 option(SURGSIM_TESTS_BUILD "Include the unit tests in the build" ON)
 option(SURGSIM_TESTS_RUN "Run the unit tests at the end of the build" ON)
+if(NOT WIN32)
+	option(SURGSIM_TESTS_RUN_WITH_VALGRIND "Run the unit tests under Valgrind" OFF)
+endif(NOT WIN32)
 option(SURGSIM_TESTS_ALL_IN_ONE
 	"Build a single binary with all unit tests.  [Does not work yet!]" OFF)
 option(SURGSIM_EXAMPLES_BUILD "Include the examples in the build" ON)
 mark_as_advanced(SURGSIM_TESTS_ALL_IN_ONE)  # hide it as long as it's broken

 set(SURGSIM_COPY_WARNING_ONCE TRUE)
+set(SURGSIM_TEST_RUN_PREFIX)
+if(NOT WIN32)
+	if(SURGSIM_TESTS_RUN_WITH_VALGRIND)
+		set(SURGSIM_TEST_RUN_PREFIX valgrind -v --error-exitcode=1
+			--fullpath-after= --leak-check=full --redzone-size=64)
+	endif(SURGSIM_TESTS_RUN_WITH_VALGRIND)
+endif(NOT WIN32)
+

 # Copy zero or more files to the location of a built target, after the
 # target is built successfully, but only if the condition (which
@@ -138,7 +149,8 @@
 #
 macro(surgsim_unit_test_run_only TESTNAME)
 	if(NOT SURGSIM_TESTS_ALL_IN_ONE)
-		add_custom_command(TARGET ${TESTNAME} POST_BUILD COMMAND ${TESTNAME}
+		add_custom_command(TARGET ${TESTNAME} POST_BUILD
+			COMMAND ${SURGSIM_TEST_RUN_PREFIX} $<TARGET_FILE:${TESTNAME}>
 			VERBATIM)
 	endif()
 endmacro()


Copy translation files to installer

Copy translation files to installer

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -82,6 +82,9 @@
     install(DIRECTORY "${_qmake_path}/../resources/"
             DESTINATION "bin/resources/"
             CONFIGURATIONS Release)
+    install(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales/"
+            DESTINATION "bin/translations/qtwebengine_locales/"
+            CONFIGURATIONS Release)
     install(FILES "${_qmake_path}/../plugins/platforms/qwindowsd.dll"
             DESTINATION "bin/plugins/platforms"
             CONFIGURATIONS Debug)
@@ -96,6 +99,9 @@
             CONFIGURATIONS Debug)
     install(DIRECTORY "${_qmake_path}/../resources/"
             DESTINATION "bin/resources/"
+            CONFIGURATIONS Debug)
+    install(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales/"
+            DESTINATION "bin/translations/qtwebengine_locales/"
             CONFIGURATIONS Debug)
   endif()

@@ -154,6 +160,8 @@
         MITK_INSTALL_HELPER_APP( EXECUTABLES "${_qmake_path}/../libexec/QtWebEngineProcess")
         install(DIRECTORY "${_qmake_path}/../resources/"
             DESTINATION "bin/resources/")
+        install(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales/"
+            DESTINATION "bin/translations/qtwebengine_locales/")
     endif()
   endif()


Don't treat CTKData as a CMake package. Fixes a small issue in #532.

--- CMakeExternals/CTKData.cmake
+++ CMakeExternals/CTKData.cmake
@@ -59,5 +59,4 @@

 mark_as_superbuild(
   VARS CTKData_DIR:PATH
-  LABELS "FIND_PACKAGE"
   )


Try PkgConf first to find CBLAS

Try PkgConf first to find CBLAS

--- CMakeModules/FindCBLAS.cmake
+++ CMakeModules/FindCBLAS.cmake
@@ -20,6 +20,29 @@
   "Path to CBLAS include directory")
 SET(CBLAS_INCLUDE_FILE CACHE STRING
   "CBLAS header name")
+
+
+# If a valid PkgConfig configuration for cblas is found, this overrides and cancels
+# all further checks.
+FIND_PACKAGE(PkgConfig)
+IF(PKG_CONFIG_FOUND)
+  PKG_CHECK_MODULES(PC_CBLAS cblas)
+ENDIF(PKG_CONFIG_FOUND)
+
+IF(PC_CBLAS_FOUND)
+
+  FOREACH(PC_LIB ${PC_CBLAS_LIBRARIES})
+    FIND_LIBRARY(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_CBLAS_LIBRARY_DIRS} )
+    IF (NOT ${PC_LIB}_LIBRARY)
+      message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_CBLAS_LIBRARY_DIRS}")
+    ENDIF (NOT ${PC_LIB}_LIBRARY)
+    LIST(APPEND CBLAS_LIBRARIES ${${PC_LIB}_LIBRARY})
+  ENDFOREACH(PC_LIB)
+
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(CBLAS DEFAULT_MSG CBLAS_LIBRARIES)
+  MARK_AS_ADVANCED(CBLAS_LIBRARIES)
+
+ELSE(PC_CBLAS_FOUND)

 SET(INTEL_MKL_ROOT_DIR CACHE STRING
   "Root directory of the Intel MKL")
@@ -277,3 +300,5 @@
     MESSAGE(STATUS "CBLAS library not found.")
   ENDIF()
 ENDIF(NOT CBLAS_FIND_QUIETLY)
+
+ENDIF(PC_CBLAS_FOUND)


Forgot endif ...

Forgot endif ...

Former-commit-id: f5887e41914e0c983f6e7004bb9dd81a2dbebf7e

--- cmake-modules/FindLAPACKE.cmake
+++ cmake-modules/FindLAPACKE.cmake
@@ -142,12 +142,14 @@
                     "${LAPACKE_INCLUDE_DIR}"
                     "lapack"
                     )
+        endif()
         if(NOT LAPACKE_COMPILES_SYSTEM AND LAPACKE_INCLUDE_DIR)
             CheckLapackeCompiles("SYSTEM" " "   " "
                     ""
                     "${LAPACKE_INCLUDE_DIR}"
                     "lapack"
                     )
+        endif()
         if(NOT LAPACKE_COMPILES_SYSTEM AND LAPACKE_LIBRARY)
             CheckLapackeCompiles("SYSTEM" " "   " "
                     "${LAPACKE_LIBRARY}"


Code formatting cleanup.

Code formatting cleanup.

--- cmake/DOConfigureCompiler.cmake
+++ cmake/DOConfigureCompiler.cmake
@@ -15,9 +15,14 @@
   add_definitions(-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
   message(STATUS "  - NON-SECURE warnings are disabled.")
   add_definitions(/EHsc)
-  message(STATUS "  - Using /EHsc: catches C++ exceptions only and tells the compiler to assume that extern C functions never throw a C++ exception.")
+  message(STATUS
+          "  - Using /EHsc: catches C++ exceptions only and tells the "
+          "compiler to assume that extern C functions never throw a C++ "
+          "exception.")
   if (MSVC_VERSION EQUAL 1700)
-    message(STATUS "  - Using version 2012: setting '_VARIADIC_MAX=10' to compile 'Google Test'")
+    message(STATUS
+            "  - Using version 2012: setting '_VARIADIC_MAX=10' to compile "
+            "'Google Test'")
     add_definitions(/D _VARIADIC_MAX=10)
   endif ()

@@ -27,10 +32,17 @@

 # GNU compiler
 elseif (CMAKE_COMPILER_IS_GNUCXX)
-  exec_program(${CMAKE_C_COMPILER} ARGS "-dumpversion" OUTPUT_VARIABLE _gcc_version_info)
-  string(REGEX REPLACE "^([0-9]+).*$"                   "\\1" GCC_MAJOR ${_gcc_version_info})
-  string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$"          "\\1" GCC_MINOR ${_gcc_version_info})
-  string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" GCC_PATCH ${_gcc_version_info})
+  exec_program(${CMAKE_C_COMPILER}
+               ARGS "-dumpversion"
+               OUTPUT_VARIABLE _gcc_version_info)
+  string(REGEX REPLACE "^([0-9]+).*$" "\\1"
+         GCC_MAJOR ${_gcc_version_info})
+  string(REGEX REPLACE
+         "^[0-9]+\\.([0-9]+).*$" "\\1"
+         GCC_MINOR ${_gcc_version_info})
+  string(REGEX REPLACE
+         "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+         GCC_PATCH ${_gcc_version_info})
   if(GCC_PATCH MATCHES "\\.+")
     set(GCC_PATCH "")
   endif()
@@ -42,16 +54,23 @@
   endif()
   set(GCC_VERSION "${GCC_MAJOR}.${GCC_MINOR}")

-  do_substep_message("${CMAKE_CXX_COMPILER_ID} compiler version: ${GCC_VERSION}")
+  do_substep_message(
+    "${CMAKE_CXX_COMPILER_ID} compiler version: ${GCC_VERSION}")
   if (GCC_VERSION  VERSION_LESS 4.5)
-    message(FATAL_ERROR "GNU compiler version lower than 4.5 are not supported anymore: C++0x features (auto and lambda) are needed.")
+    message(FATAL_ERROR
+            "GNU compiler version lower than 4.5 are not supported anymore: "
+            "C++0x features (auto and lambda) are needed.")
   elseif (GCC_VERSION  VERSION_LESS 4.7)
     set(ENABLE_CXX11 "-std=c++0x")
   else ()
     set (ENABLE_CXX11 "-std=c++11")
   endif ()
 else ()
-  message("WARNING: Compiler '${CMAKE_CXX_COMPILER}' may not be supported by DO-CV. Make sure that C++0x features are needed (auto and lambda) and adjust the CMake variable 'ENABLE_CXX11'. Otherwise, report back to me: david.ok8@gmail.com and I'll try to do what I can.")
+  message("WARNING: Compiler '${CMAKE_CXX_COMPILER}' may not be supported "
+          "by DO-CV. Make sure that C++0x features are needed (auto and "
+          "lambda) and adjust the CMake variable 'ENABLE_CXX11'. Otherwise, "
+          "report back to me: david.ok8@gmail.com and I'll try to do what I "
+          "can.")
 endif ()

 if (UNIX)
@@ -61,8 +80,6 @@
   # Additional flags for Release builds.
   set(CMAKE_CXX_RELEASE_FLAGS "-03 -ffast-math")
   # Additional flags for Debug builds, which include code coverage.
-  set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -g -DDEBUG -D_DEBUG --coverage -fprofile-arcs -ftest-coverage -fno-inline")
+  set(CMAKE_CXX_FLAGS_DEBUG
+      "-g -O0 -g -DDEBUG -D_DEBUG -fprofile-arcs -ftest-coverage -fno-inline")
 endif ()
-
-
-do_step_message("Activating C++11 features with: '${ENABLE_CXX11}'")


cmake/MyPackageDependency.cmake and dependency properties

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -75,12 +75,11 @@
     #
     # Remember all eventual packageDepend variables we depend upon
     #
-    FOREACH (_what INCLUDE_DIRS LIBRARIES C_FLAGS_SHARED LINK_FLAGS)
-      SET (_val ${${_PACKAGEDEPEND}_${_what}})
+    FOREACH (_what "INCLUDE_DIRS" "LIBRARIES" "C_FLAGS_SHARED" "LINK_FLAGS")
       IF (MYPACKAGE_DEBUG)
-        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Setting property MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} to ${_val}")
-      ENDIF ()
-      SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} ${_val})
+        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Setting property MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} to ${${_PACKAGEDEPEND}_${_what}}")
+      ENDIF ()
+      SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} ${${_PACKAGEDEPEND}_${_what}})
     ENDFOREACH ()
   ENDIF ()

@@ -101,6 +100,9 @@
     LIST (APPEND _candidates ${_exe_candidates})
   ENDIF ()
   FOREACH (_target ${_candidates})
+    IF (MYPACKAGE_DEBUG)
+      MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Inspecting target candidate ${_target}")
+    ENDIF ()
     IF (TARGET ${_target})
       IF (ALL_IN_ONE)
         #
@@ -117,7 +119,7 @@
           #
           FOREACH (_include_directory ${packageDependSourceDir}/output/include ${packageDependSourceDir}/include)
             IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
+              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding -I${_include_directory} include to ${_target}")
             ENDIF ()
             TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
           ENDFOREACH ()
@@ -126,36 +128,40 @@
         #
         # Include dependency
         #
-        FOREACH (_include_directory ${MYPACKAGE_DEPENDENCY_${packageDepend}_INCLUDE_DIRS})
-          IF (MYPACKAGE_DEBUG)
-            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
+        GET_PROPERTY(_property GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_INCLUDE_DIRS)
+        FOREACH (_include_directory ${_property})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding -I${_include_directory} include to ${_target}")
           ENDIF ()
           TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
         ENDFOREACH ()
         #
         # Library dependency
         #
-        FOREACH (_library ${MYPACKAGE_DEPENDENCY_${packageDepend}_LIBRARIES})
-          IF (MYPACKAGE_DEBUG)
-            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library dependency to ${_target}")
+        GET_PROPERTY(_property GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_LIBRARIES)
+        FOREACH (_library ${_property})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library to ${_target}")
           ENDIF ()
           TARGET_LINK_LIBRARIES(${_target} PUBLIC ${_library})
         ENDFOREACH ()
         #
         # Compile definitions
         #
-        FOREACH (_flag ${MYPACKAGE_DEPENDENCY_${packageDepend}_C_FLAGS_SHARED})
-          IF (MYPACKAGE_DEBUG)
-            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile definition dependency to ${_target}")
+        GET_PROPERTY(_property GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_C_FLAGS_SHARED)
+        FOREACH (_flag ${_property})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile flag to ${_target}")
           ENDIF ()
           TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC ${_library})
         ENDFOREACH ()
         #
         # Link flags
         #
-        FOREACH (_flag ${MYPACKAGE_DEPENDENCY_${packageDepend}_LINK_FLAGS})
-          IF (MYPACKAGE_DEBUG)
-            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} link flag dependency to ${_target}")
+        GET_PROPERTY(_property GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_LINK_FLAGS)
+        FOREACH (_flag ${_property})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} link flag to ${_target}")
           ENDIF ()
           SET_TARGET_PROPERTIES(${_target}
             PROPERTIES


Fix depend options parsing

Fix depend options parsing

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -2,22 +2,47 @@
   #
   # Optional argument: TESTS, LIBS, EXES
   #
-  SET (_TESTS TRUE)
-  SET (_LIBS TRUE)
-  SET (_EXES TRUE)
+  SET (_ALL TRUE)
+  SET (_TESTS FALSE)
+  SET (_LIBS FALSE)
+  SET (_EXES FALSE)
   FOREACH (_var ${ARGN})
-    IF ("\"${_var}\"" STREQUAL TESTS)
+    IF (${_var} STREQUAL TESTS)
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} test scope argument")
+      ENDIF ()
+      SET (_ALL FALSE)
       SET (_TESTS TRUE)
     ELSE ()
-      IF ("\"${_var}\"" STREQUAL LIBS)
+      IF (${_var} STREQUAL LIBS)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} library scope argument")
+        ENDIF ()
+        SET (_ALL FALSE)
         SET (_LIBS TRUE)
       ELSE ()
-        IF ("\"${_var}\"" STREQUAL EXES)
+        IF (${_var} STREQUAL EXES)
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} executables scope argument")
+          ENDIF ()
+          SET (_ALL FALSE)
           SET (_EXES TRUE)
+        ELSE ()
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} unknown scope argument: ${_var}")
+          ENDIF ()
         ENDIF ()
       ENDIF ()
     ENDIF ()
   ENDFOREACH ()
+  IF (_ALL)
+    SET (_TESTS TRUE)
+    SET (_LIBS TRUE)
+    SET (_EXES TRUE)
+  ENDIF ()
+  IF (MYPACKAGE_DEBUG)
+    MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency scopes are: ALL=${_ALL} TEST=${_TESTS} LIBS=${_LIBS} EXES=${_EXES}")
+  ENDIF ()
   #
   # Check if inclusion was already done - via us or another mechanism... guessed with TARGET check
   #


[CMake] Updating Apple build configurations

This updates Apple build configurations to adapt to r263566 & r263570, which added a PACKAGE_VENDOR variable.

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

--- cmake/caches/Apple-stage2.cmake
+++ cmake/caches/Apple-stage2.cmake
@@ -2,7 +2,7 @@
 # specified by the stage1 build.

 set(LLVM_TARGETS_TO_BUILD X86 ARM AArch64 CACHE STRING "")
-set(CLANG_VENDOR Apple CACHE STRING "")
+set(PACKAGE_VENDOR Apple CACHE STRING "")
 set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
 set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
 set(LLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD OFF CACHE BOOL "")


Update my email address in copyright

Update my email address in copyright

svn path=/trunk/KDE/kdenetwork/cmake/modules/FindDecibel.cmake; revision=593397

--- cmake/modules/FindDecibel.cmake
+++ cmake/modules/FindDecibel.cmake
@@ -14,7 +14,7 @@
 # use pkg-config to get the directories and then use these values
 # in the FIND_PATH() and FIND_LIBRARY() calls
 #
-# Copyright (c) 2006, Michaël Larouche, <michael.larouche@kdemail.net>
+# Copyright (c) 2006, Michaël Larouche, <larouche@kde.org>
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.


Fix a typo in FindLibEdit.cmake

Fix a typo in FindLibEdit.cmake

The package name is LibEdit, so we should use that name in the call to
find_package_handle_standard_args. Failing to do so results in the
standard_args (such as the one telling us whether REQUIRED was used in
the find_package invocation) not being handled.

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

--- cmake/modules/FindLibEdit.cmake
+++ cmake/modules/FindLibEdit.cmake
@@ -51,7 +51,7 @@
   endif()

   include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(libedit
+  find_package_handle_standard_args(LibEdit
                                     REQUIRED_VARS
                                       libedit_INCLUDE_DIRS
                                       libedit_LIBRARIES


Fix the previous nonsensical default PATH used to find ITCL_LIBRARY.  This
bug should not have made any difference for itcl installs that are in standard
locations (since after looking at the nonsensical path, the buggy
version would fall back to the standard install path).  However, this
bugfix should be critical for non-standard itcl install locations.

svn path=/trunk/; revision=7464

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -83,9 +83,10 @@
       if(ITCL_INCLUDE_PATH)
         message(STATUS "Looking for itcl.h - found")
         message(STATUS "Looking for itcl library")
+	get_filename_component(TCL_LIBRARY_PATH ${TCL_LIBRARY} PATH)
         set(itcl_library_versions 3.3 3.2 3.1 3.0 2.1 2.0)
         foreach(version ${itcl_library_versions})
-          find_library(ITCL_LIBRARY itcl${version} ${TCL_LIBRARY}
+          find_library(ITCL_LIBRARY itcl${version} PATHS ${TCL_LIBRARY_PATH}
                        PATH_SUFFIXES itcl${version})
         endforeach(version ${itcl_library_versions})
         if(ITCL_LIBRARY)


Build opentelemetry-proto as static instead of object library (#490)

--- cmake/opentelemetry-proto.cmake
+++ cmake/opentelemetry-proto.cmake
@@ -119,7 +119,7 @@
 include_directories("${GENERATED_PROTOBUF_PATH}")

 add_library(
-  opentelemetry_proto OBJECT
+  opentelemetry_proto STATIC
   ${COMMON_PB_CPP_FILE}
   ${RESOURCE_PB_CPP_FILE}
   ${TRACE_PB_CPP_FILE}


Fix reversed URI installation directories. Approved: Matthias Brantner, Chris Hillery

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -272,12 +272,12 @@
       IF(NOT ${PROJECT_NAME} STREQUAL "zorba")
         STRING(REPLACE "-" "_"  component_name ${PROJECT_NAME})
         INSTALL(TARGETS ${module_lib_target}
-          ${target_type} DESTINATION ${ZORBA_CORE_LIB_DIR}/${module_path}
+          ${target_type} DESTINATION ${ZORBA_NONCORE_LIB_DIR}/${module_path}
           COMPONENT ${component_name})

       ELSE(NOT ${PROJECT_NAME} STREQUAL "zorba")
         INSTALL(TARGETS ${module_lib_target}
-          ${target_type} DESTINATION ${ZORBA_NONCORE_LIB_DIR}/${module_path})
+          ${target_type} DESTINATION ${ZORBA_CORE_LIB_DIR}/${module_path})
       ENDIF(NOT ${PROJECT_NAME} STREQUAL "zorba")
     ENDIF (NOT MODULE_TEST_ONLY)

@@ -427,7 +427,7 @@
         IF(NOT _is_core)
           STRING(REPLACE "-" "_"  component_name ${PROJECT_NAME})
           INSTALL (FILES "${INPUT_FILE}"
-            DESTINATION "${ZORBA_CORE_URI_DIR}/${_output_path}"
+            DESTINATION "${ZORBA_NONCORE_URI_DIR}/${_output_path}"
             RENAME "${_output_filename}"
             COMPONENT "${component_name}")

@@ -447,11 +447,9 @@

         ELSE(NOT _is_core)
           INSTALL (FILES "${INPUT_FILE}"
-          DESTINATION "${ZORBA_NONCORE_URI_DIR}/${_output_path}"
+          DESTINATION "${ZORBA_CORE_URI_DIR}/${_output_path}"
           RENAME "${_output_filename}")
         ENDIF(NOT _is_core)
-
-

       ENDIF (${_output_ext} STREQUAL ".xq" OR ${_output_ext} STREQUAL ".xsd")
     ENDIF (NOT ${TEST_ONLY} EQUAL 1)


[iOS] Fix an issue where the wrong zziplib would be found due to different naming.

--HG--
branch : v1-9

--- CMake/Packages/FindZZip.cmake
+++ CMake/Packages/FindZZip.cmake
@@ -32,7 +32,7 @@
   ZZip_INCLUDE_DIR
 )

-set(ZZip_LIBRARY_NAMES zzip zziplib)
+set(ZZip_LIBRARY_NAMES zziplib zzip)
 get_debug_names(ZZip_LIBRARY_NAMES)

 use_pkgconfig(ZZip_PKGC zziplib)


Add a macro to add subdirectories based on a build switch


BUG: Set ${itk-module}_ENABLE_SHARED in ITKModuleExternal

This variable is used when determining include directories required for
building libraries in src/, and it can cause failures due to missing
export header includes with external module builds. This is a follow-up
to commit ea392a8ef00b025bd6f760b7c9e3d1f3399e1a53.

Change-Id: If0ab740eb965f18f9b53f9f04cb1cb324358d15c

--- CMake/ITKModuleExternal.cmake
+++ CMake/ITKModuleExternal.cmake
@@ -79,6 +79,7 @@
 file(MAKE_DIRECTORY ${${itk-module}-targets-build-directory})
 set(${itk-module}-targets-build "${${itk-module}-targets-build-directory}/${itk-module}Targets.cmake")
 set(${itk-module}_TARGETS_FILE_BUILD "${${itk-module}-targets-build}")
+set(${itk-module}_ENABLE_SHARED "${ITK_MODULE_${itk-module}_ENABLE_SHARED}")
 itk_module_impl()

 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt AND NOT ${itk-module}_NO_SRC AND "${${itk-module}-targets}")


Add threading library's include directory to Ogre include directories in FindOGRE.cmake

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -285,6 +285,7 @@
         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)
@@ -292,6 +293,7 @@
         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)
@@ -299,6 +301,7 @@
         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 ()


respect QUIET in ogre_find_component

respect QUIET in ogre_find_component

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -388,6 +388,7 @@
 )

 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}")


From Jean-Sebastien Guay, added non pkg-config based ffmpeg search scheme.

--- CMakeModules/FindFFmpeg.cmake
+++ CMakeModules/FindFFmpeg.cmake
@@ -1,44 +1,108 @@
 # Locate ffmpeg
 # This module defines
 # FFMPEG_LIBRARIES
-# FFMPEG_FOUND, if false, do not try to link to ffmpeg
+# FFMPEG_FOUND, if false, do not try to link to ffmpeg
 # FFMPEG_INCLUDE_DIR, where to find the headers
 #
 # $FFMPEG_DIR is an environment variable that would
 # correspond to the ./configure --prefix=$FFMPEG_DIR
 #
-# Created by Robert Osfield.
+# Created by Robert Osfield.

-#use pkg-config to find various modes
-INCLUDE(FindPkgConfig OPTIONAL)
+# Macro to find header and lib directories
+# example: FFMPEG_FIND(AVFORMAT avformat avformat.h)
+MACRO(FFMPEG_FIND varname shortname headername)
+    # First try to find header directly in include directory
+    FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername}
+        ${FFMPEG_ROOT}/include
+        $ENV{FFMPEG_DIR}/include
+        $ENV{OSGDIR}/include
+        $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
+        /usr/freeware/include
+    )

-IF(PKG_CONFIG_FOUND)
+    # If not found, try to find it in a subdirectory. Tanguy's build has
+    # avformat.h in include/libavformat, so this catches that case. If that's
+    # standard, perhaps we can keep just this case.
+    IF(NOT FFMPEG_${varname}_INCLUDE_DIRS)
+        FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername}
+            ${FFMPEG_ROOT}/include
+            $ENV{FFMPEG_DIR}/include
+            $ENV{OSGDIR}/include
+            $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
+            /usr/freeware/include
+        )
+    ENDIF(NOT FFMPEG_${varname}_INCLUDE_DIRS)

-    INCLUDE(FindPkgConfig)
+    FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
+        NAMES ${shortname}
+        PATHS
+        ${FFMPEG_ROOT}/lib
+        $ENV{FFMPEG_DIR}/lib
+        $ENV{OSGDIR}/lib
+        $ENV{OSG_ROOT}/lib
+        ~/Library/Frameworks
+        /Library/Frameworks
+        /usr/local/lib
+        /usr/local/lib64
+        /usr/lib
+        /usr/lib64
+        /sw/lib
+        /opt/local/lib
+        /opt/csw/lib
+        /opt/lib
+        /usr/freeware/lib64
+    )

-    pkg_check_modules(FFMPEG_LIBAVFORMAT libavformat)
-    pkg_check_modules(FFMPEG_LIBAVDEVICE libavdevice)
-    pkg_check_modules(FFMPEG_LIBAVCODEC libavcodec)
-    pkg_check_modules(FFMPEG_LIBAVUTIL libavutil)
-    pkg_check_modules(FFMPEG_LIBSWSCALE libswscale)
+    IF   (FFMPEG_${varname}_LIBRARIES)
+        SET(FFMPEG_${varname}_FOUND 1)
+    ENDIF(FFMPEG_${varname}_LIBRARIES)

-ENDIF(PKG_CONFIG_FOUND)
+ENDMACRO(FFMPEG_FIND)
+
+SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")
+
+FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
+FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
+FFMPEG_FIND(LIBAVCODEC  avcodec  avcodec.h)
+FFMPEG_FIND(LIBAVUTIL   avutil   avutil.h)
+FFMPEG_FIND(LIBSWSCALE  swscale  swscale.h)  # not sure about the header to look for here.

 SET(FFMPEG_FOUND "NO")
+# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
 IF   (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND)
-
+
     SET(FFMPEG_FOUND "YES")

     SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS})

     SET(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBAVFORMAT_LIBRARY_DIRS})

+    # Note we don't add FFMPEG_LIBSWSCALE_LIBRARIES here, it will be added if found later.
     SET(FFMPEG_LIBRARIES
         ${FFMPEG_LIBAVFORMAT_LIBRARIES}
         ${FFMPEG_LIBAVDEVICE_LIBRARIES}
         ${FFMPEG_LIBAVCODEC_LIBRARIES}
         ${FFMPEG_LIBAVUTIL_LIBRARIES})
-
+
+ELSE (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND)
+
+    MESSAGE(STATUS "Could not find FFMPEG")
+
 ENDIF(FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND)
-
-


ffmpeg cmake script (mostly whitespace)

ffmpeg cmake script (mostly whitespace)

--- CMakeModules/FindFFmpeg.cmake
+++ CMakeModules/FindFFmpeg.cmake
@@ -6,7 +6,9 @@
 #
 # if found, defines additionally:
 #
-#   FFmpeg_INCLUDE_DIRS FFmpeg_LIBRARIES FFmpeg_CXX_FLAGS
+#   FFmpeg_INCLUDE_DIRS
+#   FFmpeg_LIBRARIES
+#   FFmpeg_CXX_FLAGS
 #
 #  Copyright 2011 Watch that Sound / V2_ Lab
 #
@@ -47,7 +49,7 @@

   IF(FFmpeg_BUILDDIR)
     FOREACH(COMPONENT ${COMPONENTS})
-      SET(ENV{PKG_CONFIG_PATH}
+      SET(ENV{PKG_CONFIG_PATH}
           "${FFmpeg_BUILDDIR}/lib${COMPONENT}${dirsep}$ENV{PKG_CONFIG_PATH}")
     ENDFOREACH(COMPONENT ${COMPONENTS})
   ENDIF(FFmpeg_BUILDDIR)
@@ -67,20 +69,20 @@
     FIND_PATH(FFmpeg_${COMPONENT}_INCLUDE_DIR
       NAMES lib${COMPONENT}/${COMPONENT}.h
       HINTS ${FFmpeg_SRCDIR}
-            ${FFmpeg_${COMPONENT}_INCLUDE_DIRS}
-      PATHS /usr/include
-            /usr/local/include
-            /opt/local/include
+            ${FFmpeg_${COMPONENT}_INCLUDE_DIRS}
+      PATHS /usr/include
+            /usr/local/include
+            /opt/local/include
             /sw/include)

     FIND_LIBRARY(FFmpeg_${COMPONENT}_LIBRARY
       NAMES ${COMPONENT}
       HINTS ${FFmpeg_BUILDDIR}/lib${COMPONENT}
             ${FFmpeg_SRCDIR}/lib${COMPONENT}
-            ${FFmpeg_${COMPONENT}_LIBRARY_DIRS}
+            ${FFmpeg_${COMPONENT}_LIBRARY_DIRS}
       PATHS /usr/lib
-            /usr/local/lib
-            /opt/local/lib
+            /usr/local/lib
+            /opt/local/lib
             /sw/lib)
   ENDMACRO(FFmpeg_FIND)

@@ -90,10 +92,10 @@
     NAMES libavutil/avconfig.h
     HINTS ${FFmpeg_BUILDDIR}
           ${FFmpeg_SRCDIR}
-          ${FFmpeg_avutil_INCLUDE_DIRS}
-    PATHS /usr/include
-          /usr/local/include
-          /opt/local/include
+          ${FFmpeg_avutil_INCLUDE_DIRS}
+    PATHS /usr/include
+          /usr/local/include
+          /opt/local/include
           /sw/include)

   FFmpeg_FIND(avformat)
@@ -101,13 +103,13 @@
   FFmpeg_FIND(avutil)
   FFmpeg_FIND(swscale)

-  SET(FFmpeg_PROCESS_INCLUDES
+  SET(FFmpeg_PROCESS_INCLUDES
     FFmpeg_avformat_INCLUDE_DIR
     FFmpeg_avcodec_INCLUDE_DIR
     FFmpeg_avutil_INCLUDE_DIR
     FFmpeg_avconfig_h_INCLUDE_DIR
     FFmpeg_swscale_INCLUDE_DIR)
-  SET(FFmpeg_PROCESS_LIBS
+  SET(FFmpeg_PROCESS_LIBS
     FFmpeg_avformat_LIBRARY FFmpeg_avformat_LIBRARIES
     FFmpeg_avcodec_LIBRARY FFmpeg_avcodec_LIBRARIES
     FFmpeg_avutil_LIBRARY FFmpeg_avutil_LIBRARIES


ENH: remove useless path, no headers in it

--- CMake/otbIncludeDirectories.cmake
+++ CMake/otbIncludeDirectories.cmake
@@ -44,7 +44,6 @@
   ${OTB_SOURCE_DIR}/Utilities/InsightJournal
   ${OTB_SOURCE_DIR}/Utilities/otb6S
   ${OTB_SOURCE_DIR}/Utilities/otbkml/src
-  ${OTB_SOURCE_DIR}/Utilities/otbkml/third_party
   ${OTB_SOURCE_DIR}/Utilities/otbliblas/include
   ${OTB_SOURCE_DIR}/Utilities/otbedison/segm
   ${OTB_SOURCE_DIR}/Utilities/otbedison/prompt


comment out cmake internal help markup

comment out cmake internal help markup

cmake 2.8.12 cannot parse it. From the looks of it this sort of markup only needs to be parsable when building cmake v3 itself.

--- CMakeModules/FindFontconfig.cmake
+++ CMakeModules/FindFontconfig.cmake
@@ -1,34 +1,34 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 #[[=======================================================================.rst:
-FindFontconfig
---------------
-
-Find Fontconfig headers and library.
-
-Imported Targets
-^^^^^^^^^^^^^^^^
-
-``Fontconfig::Fontconfig``
-  The Fontconfig library, if found.
-
-Result Variables
-^^^^^^^^^^^^^^^^
-
-This will define the following variables in your project:
-
-``FONTCONFIG_FOUND``
-  true if (the requested version of) Fontconfig is available.
-``FONTCONFIG_VERSION``
-  the version of Fontconfig.
-``FONTCONFIG_LIBRARIES``
-  the libraries to link against to use Fontconfig.
-``FONTCONFIG_INCLUDE_DIRS``
-  where to find the Fontconfig headers.
-``FONTCONFIG_COMPILE_OPTIONS``
-  this should be passed to target_compile_options(), if the
-  target is not used for linking
-=======================================================================]]
+# FindFontconfig
+# --------------
+#
+# Find Fontconfig headers and library.
+#
+# Imported Targets
+# ^^^^^^^^^^^^^^^^
+#
+# ``Fontconfig::Fontconfig``
+#  The Fontconfig library, if found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This will define the following variables in your project:
+#
+# ``FONTCONFIG_FOUND``
+#  true if (the requested version of) Fontconfig is available.
+# ``FONTCONFIG_VERSION``
+#  the version of Fontconfig.
+# ``FONTCONFIG_LIBRARIES``
+#  the libraries to link against to use Fontconfig.
+# ``FONTCONFIG_INCLUDE_DIRS``
+#  where to find the Fontconfig headers.
+# ``FONTCONFIG_COMPILE_OPTIONS``
+#  this should be passed to target_compile_options(), if the
+#  target is not used for linking
+#=======================================================================]]

 # use pkg-config to get the directories and then use these values
 # in the FIND_PATH() and FIND_LIBRARY() calls


test=develop

test=develop

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -157,6 +157,8 @@
         # On Mac OS X build fat binaries with x86_64 architectures by default.
         set (CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
     endif()
+    # On Mac OS X register class specifier is deprecated and will cause warning error on latest clang
+    set (COMMON_FLAGS -Wno-deprecated-register)
 endif(APPLE)

 if(LINUX)


Suppress Boost warnings about newer compiler (#5816)

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -230,6 +230,7 @@
       OSQUERY_WINDOWS=1
       OSQUERY_BUILD_PLATFORM=windows
       OSQUERY_BUILD_DISTRO=10
+      BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE=1
     )

     set(windows_common_defines


new limix.cmake

new limix.cmake

--- cmake/limix.cmake
+++ cmake/limix.cmake
@@ -1,149 +1,119 @@
 # limix
-# ---------
 #
 # Common configuration and handy functions for limix projects.
 #
-# This module provides the folloing::
+# This module provides the following::
 #
-#   limix_initialise - Called at the start of the main CMakelists.txt
-#   limix_library - Create static and shared library in one call
+# * limix_initialise - Called at the start of the main CMakelists.txt
+# * limix_library - Create static and shared library in one call
 include(GNUInstallDirs)

 function(display_welcome)
-    foreach(MSG ${WELCOME})
-        string(REPLACE "{NAME}" ${PROJECT_NAME} MSG ${MSG})
-        string(REPLACE "{VERSION}" ${PROJECT_VERSION} MSG ${MSG})
-        string(REPLACE "{GITHUB_URL}" ${GITHUB_URL} MSG ${MSG})
-        message(${MSG})
-    endforeach()
+  foreach(MSG ${WELCOME})
+    string(REPLACE "{NAME}" ${PROJECT_NAME} MSG ${MSG})
+    string(REPLACE "{VERSION}" ${PROJECT_VERSION} MSG ${MSG})
+    string(REPLACE "{GITHUB_URL}" ${GITHUB_URL} MSG ${MSG})
+    message(${MSG})
+  endforeach()
 endfunction(display_welcome)

-macro(limix_windows_config)
+macro(limix_config)
+  enable_testing()
+
+  if(NOT CMAKE_BUILD_TYPE)
+    set(MSG "CMAKE_BUILD_TYPE has not been set.")
+    set(MSG "${MSG} Using the default value \"Release\".")
+    message(STATUS "${MSG}")
+    set(CMAKE_BUILD_TYPE Release)
+  endif()
+
+  macro(set_rpath)
+    set(CMAKE_MACOSX_RPATH TRUE)
+    set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR FALSE)
+  endmacro(set_rpath)
+
+  set_rpath()
+
+  set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
+  # Windows specific common configuration
+  if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
     set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
-    set_property(GLOBAL PROPERTY USE_FOLDERS ON)
     add_definitions(-D_CRT_SECURE_NO_WARNINGS)
     add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
     add_definitions(-Dinline=__inline)
+  endif()

-    set(CompilerFlags
-        CMAKE_CXX_FLAGS
-        CMAKE_CXX_FLAGS_DEBUG
-        CMAKE_CXX_FLAGS_RELEASE
-        CMAKE_C_FLAGS
-        CMAKE_C_FLAGS_DEBUG
-        CMAKE_C_FLAGS_RELEASE)
-
-    foreach(CompilerFlag ${CompilerFlags})
-        string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
-    endforeach()
-endmacro(limix_windows_config)
-
-macro(limix_config)
-    enable_testing()
-
-    # Set default build type.
-    if(NOT CMAKE_BUILD_TYPE)
-        message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Debug'.")
-        set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build."
-            FORCE)
-    endif()
-
-    # Set available build types for CMake GUIs.
-    # A different build type can still be set by -DCMAKE_BUILD_TYPE=...
-    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
-        STRINGS "Debug" "Release")
-
-    macro(set_rpath)
-        set(CMAKE_MACOSX_RPATH TRUE)
-        set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR FALSE)
-    endmacro(set_rpath)
-
-    set_rpath()
-
-    set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
-
-    # Windows specific common configuration
-    if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
-        limix_windows_config()
-    endif()
-
-    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
+  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
 endmacro(limix_config)

 macro(limix_process_default_dirs)
-    include_directories(src include)
-    add_subdirectory(src)
-    add_subdirectory(include)
+  include_directories(src include)
+  add_subdirectory(src)
+  add_subdirectory(include)

-    define_sources(src SOURCES)
-    define_public_headers(include HEADERS)
+  define_sources(src SOURCES)
+  define_public_headers(include HEADERS)
 endmacro(limix_process_default_dirs)

 macro(limix_initialise)
-    file(STRINGS ${CMAKE_HOME_DIRECTORY}/NAME PROJECT_NAME)
-    file(STRINGS ${CMAKE_HOME_DIRECTORY}/VERSION PROJECT_VERSION)
-    file(STRINGS ${CMAKE_HOME_DIRECTORY}/WELCOME WELCOME)
-    file(STRINGS ${CMAKE_HOME_DIRECTORY}/GITHUB_URL GITHUB_URL)
-    display_welcome()
+  file(STRINGS ${CMAKE_HOME_DIRECTORY}/NAME PROJECT_NAME)
+  file(STRINGS ${CMAKE_HOME_DIRECTORY}/VERSION PROJECT_VERSION)
+  file(STRINGS ${CMAKE_HOME_DIRECTORY}/WELCOME WELCOME)
+  file(STRINGS ${CMAKE_HOME_DIRECTORY}/GITHUB_URL GITHUB_URL)
+  display_welcome()
 endmacro(limix_initialise)

 function(easy_set_target_property NAME PROPERTY VALUE)
-    set_target_properties(${NAME} PROPERTIES ${PROPERTY} "${VALUE}")
+  set_target_properties(${NAME} PROPERTIES ${PROPERTY} "${VALUE}")
 endfunction(easy_set_target_property)

-function(easy_shared_install TARGET_NAME)
-    install(TARGETS ${TARGET_NAME}
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-        PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-endfunction(easy_shared_install)
-
-function(easy_static_install TARGET_NAME)
-    install(TARGETS ${TARGET_NAME}
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-endfunction(easy_static_install)
+function(easy_install TARGET_NAME INCLUDE_DIR)
+  install(TARGETS ${TARGET_NAME}
+          ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+          PUBLIC_HEADER DESTINATION ${INCLUDE_DIR})
+endfunction(easy_install)

 function(add_library_type TYPE NAME VERSION SOURCES PUBLIC_HEADERS LIBS)
-    if (TYPE MATCHES "STATIC")
-        set(NAME "${NAME}_static")
-    endif()
-    add_library(${NAME} ${TYPE} "${SOURCES}")
+  if(TYPE MATCHES "STATIC")
+    set(NAME "${NAME}_static")
+  endif()
+  add_library(${NAME} ${TYPE} "${SOURCES}")

-    easy_set_target_property(${NAME} VERSION ${VERSION})
-    if (TYPE MATCHES "SHARED")
-        easy_set_target_property(${NAME} PUBLIC_HEADER "${PUBLIC_HEADERS}")
-        easy_shared_install(${NAME})
-    else()
-        easy_static_install(${NAME})
-    endif()
+  easy_set_target_property(${NAME} VERSION ${VERSION})
+  if(TYPE MATCHES "SHARED")
+    easy_set_target_property(${NAME} PUBLIC_HEADER "${PUBLIC_HEADERS}")
+  endif()

-    target_link_libraries(${NAME} "${LIBS}")
+  if(TYPE MATCHES "SHARED")
+    easy_install(${NAME} include/${NAME})
+  endif()
+
+  target_link_libraries(${NAME} "${LIBS}")
 endfunction(add_library_type)

 function(limix_add_library NAME VERSION SRCS HDRS LIBS)
-    add_library_type("SHARED" ${NAME} ${VERSION} "${SRCS}" "${HDRS}" "${LIBS}")
-    add_library_type("STATIC" ${NAME} ${VERSION} "${SRCS}" "${HDRS}" "${LIBS}")
+  add_library_type("SHARED" ${NAME} ${VERSION} "${SRCS}" "${HDRS}" "${LIBS}")
+  add_library_type("STATIC" ${NAME} ${VERSION} "${SRCS}" "${HDRS}" "${LIBS}")
 endfunction(limix_add_library)

 macro(limix_add_test NAME LIBRARY SOURCES)
-    add_executable(${NAME} ${SOURCES})
-    target_link_libraries(${NAME} ${LIBRARY})
-    add_test(test_${NAME} ${NAME} -E environment)
-    file(TO_CMAKE_PATH "$ENV{PATH}" MYPATH)
+  add_executable(${NAME} ${SOURCES})
+  target_link_libraries(${NAME} ${LIBRARY})
+  add_test(test_${NAME} ${NAME} -E environment)

-    list(APPEND MYPATH ${CMAKE_BINARY_DIR})
-    list(APPEND MYPATH ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
-    string(REPLACE ";" "\\;" MYPATH "${MYPATH}")
+  file(TO_CMAKE_PATH "$ENV{PATH}" MYPATH)
+  list(APPEND MYPATH ${CMAKE_BINARY_DIR})
+  string(REPLACE ";" "\\;" MYPATH "${MYPATH}")

-    set_property(TEST test_${NAME} APPEND PROPERTY ENVIRONMENT
-              "PATH=${MYPATH}")
+  set_property(TEST test_${NAME} APPEND PROPERTY ENVIRONMENT "PATH=${MYPATH}")
 endmacro(limix_add_test)

 function(limix_convert_rel_to_full _FULL BASE_DIR REL)
-    foreach(SRC ${REL})
-        list(APPEND FULL "${BASE_DIR}/${SRC}")
-    endforeach()
-    set(${_FULL} ${FULL} PARENT_SCOPE)
-endfunction(limix_convert_rel_to_full)
+  foreach(SRC ${REL})
+    list(APPEND FULL "${BASE_DIR}/${SRC}")
+  endforeach()
+  set(${_FULL} ${FULL} PARENT_SCOPE)
+endfunction(limix_convert_rel_to_full)


Add CMAKE_BINARY_DIR/bin to search path for rosunit.

--- cmake/tests.cmake
+++ cmake/tests.cmake
@@ -54,7 +54,7 @@

 function(add_pyunit file)
   # Check that we can find rosunit
-  find_program(rosunit_exe rosunit)
+  find_program(rosunit_exe rosunit PATHS ${CMAKE_BINARY_DIR}/bin)
   if(NOT rosunit_exe)
     message(FATAL_ERROR "Can't find rosunit executable")
   endif()
@@ -90,7 +90,7 @@

 function(add_gtest exe)
   # Check that we can find rosunit
-  find_program(rosunit_exe rosunit)
+  find_program(rosunit_exe rosunit PATHS ${CMAKE_BINARY_DIR}/bin)
   if(NOT rosunit_exe)
     message(FATAL_ERROR "Can't find rosunit executable")
   endif()


BUG: Fix a compilation issue on ITK4 with FFTW and shared libraries

Fixes: ITK-3022

Reference site: https://issues.itk.org/jira/browse/ITK-3022

Change-Id: I3a292dd0a2a5002e46ec548e79af3442d529e3ee

--- CMake/FindFFTW.cmake
+++ CMake/FindFFTW.cmake
@@ -34,6 +34,7 @@

   set(FFTW_LIB_SEARCHPATH
     ${FFTW_INSTALL_BASE_PATH}/lib
+    ${FFTW_INSTALL_BASE_PATH}/lib64
     /usr/lib/fftw
     /usr/local/lib/fftw
   )


remove automatic loading of cake-depends-db, error prone

--- Modules/CakeLoadConfig.cmake
+++ Modules/CakeLoadConfig.cmake
@@ -143,8 +143,6 @@

     set(CAKE_LOAD_CONFIG_DONE 0)

-    include(${CAKE_ROOT}/cake-depends-db.cmake)
-
     _cake_stash_config_vars()

     if(NOT "$ENV{CAKE_CONFIG_FILE}" STREQUAL "")


Delete cmake_install.cmake

Delete cmake_install.cmake

--- src/UGVControl/build/cmake_install.cmake
+++ src/UGVControl/build/cmake_install.cmake
@@ -1,132 +0,0 @@
-# Install script for directory: /home/anthony/UGVControl/src
-
-# Set the install prefix
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  set(CMAKE_INSTALL_PREFIX "/home/anthony/UGVControl/install")
-endif()
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  if(BUILD_TYPE)
-    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  else()
-    set(CMAKE_INSTALL_CONFIG_NAME "")
-  endif()
-  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-endif()
-
-# Set the component getting installed.
-if(NOT CMAKE_INSTALL_COMPONENT)
-  if(COMPONENT)
-    message(STATUS "Install component: \"${COMPONENT}\"")
-    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  else()
-    set(CMAKE_INSTALL_COMPONENT)
-  endif()
-endif()
-
-# Install shared libraries without execute permission?
-if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  set(CMAKE_INSTALL_SO_NO_EXE "1")
-endif()
-
-if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-
-      if (NOT EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}")
-        file(MAKE_DIRECTORY "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}")
-      endif()
-      if (NOT EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/.catkin")
-        file(WRITE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/.catkin" "")
-      endif()
-endif()
-
-if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
-   "/home/anthony/UGVControl/install/_setup_util.py")
-  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-file(INSTALL DESTINATION "/home/anthony/UGVControl/install" TYPE PROGRAM FILES "/home/anthony/UGVControl/build/catkin_generated/installspace/_setup_util.py")
-endif()
-
-if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
-   "/home/anthony/UGVControl/install/env.sh")
-  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-file(INSTALL DESTINATION "/home/anthony/UGVControl/install" TYPE PROGRAM FILES "/home/anthony/UGVControl/build/catkin_generated/installspace/env.sh")
-endif()
-
-if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
-   "/home/anthony/UGVControl/install/setup.bash")
-  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-file(INSTALL DESTINATION "/home/anthony/UGVControl/install" TYPE FILE FILES "/home/anthony/UGVControl/build/catkin_generated/installspace/setup.bash")
-endif()
-
-if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
-   "/home/anthony/UGVControl/install/setup.sh")
-  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-file(INSTALL DESTINATION "/home/anthony/UGVControl/install" TYPE FILE FILES "/home/anthony/UGVControl/build/catkin_generated/installspace/setup.sh")
-endif()
-
-if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
-   "/home/anthony/UGVControl/install/setup.zsh")
-  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-file(INSTALL DESTINATION "/home/anthony/UGVControl/install" TYPE FILE FILES "/home/anthony/UGVControl/build/catkin_generated/installspace/setup.zsh")
-endif()
-
-if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
-   "/home/anthony/UGVControl/install/.rosinstall")
-  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
-    message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
-  endif()
-file(INSTALL DESTINATION "/home/anthony/UGVControl/install" TYPE FILE FILES "/home/anthony/UGVControl/build/catkin_generated/installspace/.rosinstall")
-endif()
-
-if(NOT CMAKE_INSTALL_LOCAL_ONLY)
-  # Include the install script for each subdirectory.
-  include("/home/anthony/UGVControl/build/gtest/cmake_install.cmake")
-
-endif()
-
-if(CMAKE_INSTALL_COMPONENT)
-  set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-else()
-  set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-endif()
-
-string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
-       "${CMAKE_INSTALL_MANIFEST_FILES}")
-file(WRITE "/home/anthony/UGVControl/build/${CMAKE_INSTALL_MANIFEST}"
-     "${CMAKE_INSTALL_MANIFEST_CONTENT}")


Change path suffix for CMOCKA_LIBRARY

Change path suffix for CMOCKA_LIBRARY

--- test/cmake/Modules/FindCMocka.cmake
+++ test/cmake/Modules/FindCMocka.cmake
@@ -23,7 +23,7 @@

 find_library(CMOCKA_LIBRARY
   NAMES cmocka
-  PATHS ${CMOCKA_ROOT_DIR}/include
+  PATHS ${CMOCKA_ROOT_DIR}/lib
 )

 if(CMOCKA_LIBRARY)


SuperBuild: do not fail in configure phase if patch is already applied

--- SuperBuild/CMake/patch.cmake
+++ SuperBuild/CMake/patch.cmake
@@ -11,7 +11,9 @@
       OUTPUT_VARIABLE patch_ov
       OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
     if(NOT "${patch_rv}" STREQUAL "0")
-      message(FATAL_ERROR "${PATCH_PROGRAM} returned non-zero exit status '${patch_rv}'")
+      if( NOT "${patch_ov}" MATCHES "previously applied")
+        message(FATAL_ERROR "${PATCH_PROGRAM} returned non-zero exit status '${patch_ov}'")
+      endif()
     else()
       message(STATUS "${patch_ov}")
     endif()


Fixed FindGLEW.cmake for Windows build.

Fixed FindGLEW.cmake for Windows build.

--- modules/FindGLEW.cmake
+++ modules/FindGLEW.cmake
@@ -13,8 +13,12 @@

 else()

-    # Static library
-    find_library(GLEW_LIBRARY GLEW)
+    # Library
+    if(NOT WIN32)
+        find_library(GLEW_LIBRARY GLEW)
+    else()
+        find_library(GLEW_LIBRARY glew32)
+    endif()

     # Include dir
     find_path(GLEW_INCLUDE_DIR


Added new release plugins to build configuration default

--- CMake/mitkBuildConfigurationDefault.cmake
+++ CMake/mitkBuildConfigurationDefault.cmake
@@ -13,4 +13,10 @@
   org.mitk.gui.qt.segmentation
   org.mitk.gui.qt.volumevisualization
   org.mitk.planarfigure
+  org.mitk.gui.qt.moviemaker
+  org.mitk.gui.qt.pointsetinteraction
+  org.mitk.gui.qt.registration
+  org.mitk.gui.qt.remeshing
+  org.mitk.gui.qt.viewnavigator
+  org.mitk.gui.qt.imagecropper
 )


ENH: Add overlord test to module's test export list

--- Modules/Core/ModuleCore.cmake
+++ Modules/Core/ModuleCore.cmake
@@ -22,6 +22,7 @@
   elxBlueprintTest.cxx
   elxComponentFactoryTest.cxx
   elxComponentInterfaceTest.cxx
+  elxOverlordTest.cxx
 )

 # Module source files


Disable 64bit file position on old 32 bit Androids.

This is needed for building LLVM on Android with new NDK (newer
than r15c) and API level < 24. Android C library (Bionic) didn't have
support for 64 bit file position until Android N.

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -233,8 +233,12 @@
 endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )

 # If building on a GNU specific 32-bit system, make sure off_t is 64 bits
-# so that off_t can stored offset > 2GB
-if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
+# so that off_t can stored offset > 2GB.
+# Android until version N (API 24) doesn't support it.
+if (ANDROID AND (ANDROID_NATIVE_API_LEVEL LESS 24))
+  set(LLVM_FORCE_SMALLFILE_FOR_ANDROID TRUE)
+endif()
+if( CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT LLVM_FORCE_SMALLFILE_FOR_ANDROID)
   add_definitions( -D_LARGEFILE_SOURCE )
   add_definitions( -D_FILE_OFFSET_BITS=64 )
 endif()
@@ -303,13 +307,13 @@
     # especially so std::equal(nullptr, nullptr, nullptr) will not assert.
     add_definitions("-D_DEBUG_POINTER_IMPL=")
   endif()
-
+
   include(ChooseMSVCCRT)

   if( MSVC11 )
     add_definitions(-D_VARIADIC_MAX=10)
   endif()
-
+
   # Add definitions that make MSVC much less annoying.
   add_definitions(
     # For some reason MS wants to deprecate a bunch of standard functions...
@@ -370,7 +374,7 @@

       string(FIND "${upper_exe_flags} ${upper_module_flags} ${upper_shared_flags}"
         "/INCREMENTAL" linker_flag_idx)
-
+
       if (${linker_flag_idx} GREATER -1)
         message(WARNING "/Brepro not compatible with /INCREMENTAL linking - builds will be non-deterministic")
       else()


Try to fix the build with MSVC 2015 by disabling sized deallocation

I can't actually test this properly because uninstalling MSVC 2015 CTP 6
and reinstalling the 2015 RC takes hours. I can only verify that this
doesn't mess up MSVC 2013 and 2015 CTP 6 builds, which is what I've
done.

Should fix PR23513.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -345,6 +345,11 @@
     append("${flag}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   endforeach(flag)

+  # Disable sized deallocation if the flag is supported. MSVC fails to compile
+  # the operator new overload in User otherwise.
+  check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC)
+  append_if(SUPPORTS_SIZED_DEALLOC "/Zc:sizedDealloc-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
 elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
   if (LLVM_ENABLE_WARNINGS)
     append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)


Clear cache to properly reconfigure when C++ standard changes

This is necessary to ensure that the header RConfigure.h
will contain correct information if CMAKE_CXX_STANDARD is
changed after the initial configuration.

Related issues: ROOT-9492, ROOT-9841

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -550,6 +550,14 @@
   set(hastmvagpu undef)
 endif()

+# clear cache to allow reconfiguring
+# with a different CMAKE_CXX_STANDARD
+unset(found_stdapply CACHE)
+unset(found_stdindexsequence CACHE)
+unset(found_stdinvoke CACHE)
+unset(found_stdstringview CACHE)
+unset(found_stdexpstringview CACHE)
+unset(found_stod_stringview CACHE)

 set(hasstdexpstringview undef)
 CHECK_CXX_SOURCE_COMPILES("#include <string_view>


Fix for ROOT-6194 and ROOT-6164

Fix for ROOT-6194 and ROOT-6164

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -406,11 +406,7 @@
 if(ruby)
   file(APPEND ${CMAKE_BINARY_DIR}/include/RConfigOptions.h "\#define R__RUBY_MAJOR ${RUBY_MAJOR_VERSION}\n\#define R__RUBY_MINOR ${RUBY_MINOR_VERSION}\n")
 endif()
-if(WIN32)
-  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.win32.in include/compiledata.h)
-else()
-  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.in include/compiledata.h)
-endif()
+
 configure_file(${CMAKE_SOURCE_DIR}/config/Makefile-comp.in config/Makefile.comp)
 configure_file(${CMAKE_SOURCE_DIR}/config/Makefile.in config/Makefile.config)
 configure_file(${CMAKE_SOURCE_DIR}/config/mimes.unix.in ${CMAKE_BINARY_DIR}/etc/root.mimes)
@@ -480,6 +476,20 @@
   set(etcdir $ROOTSYS/etc)
   set(mandir $ROOTSYS/man/man1)
 endif()
+
+
+#---compiledata.h--------------------------------------------------------------------------------------------
+if(WIN32)
+  set(makecompiledata ${CMAKE_SOURCE_DIR}/build/win/compiledata.sh)
+else()
+  set(makecompiledata ${CMAKE_SOURCE_DIR}/build/unix/compiledata.sh)
+endif()
+
+string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+execute_process(COMMAND ${makecompiledata} include/compiledata.h "${cxx}" "" "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}"
+	   "${CMAKE_CXX_FLAGS}" "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}" "${CMAKE_EXE_FLAGS}" "${LibSuffix}" "${SYSLIBS}"
+	   "${libdir}" "-lCore" "-Rint" "${incdir}" "" "" "${ROOT_ARCHITECTURE}" "" "${explicitlink}" )
+
 configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY)


BUG: CMake problem in CIP that caused a build error in Windows

--- SuperBuild/External_CIP.cmake
+++ SuperBuild/External_CIP.cmake
@@ -25,7 +25,7 @@
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${git_protocol}://github.com/acil-bwh/ChestImagingPlatform.git"
-    GIT_TAG "50e6d77d743b5fcf50772e042f65bff80f0e6876" # use develop branch to include CLI modules
+    GIT_TAG "13494a966c073ebc6d654202ba8222ffe076adcf" # Develop
     #DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Remove this line and uncomment GIT_REPOSITORY and GIT_TAG"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${proj}-build


Add possibility to use TSan and ASan in non-server build

--- NonServerBuild.cmake
+++ NonServerBuild.cmake
@@ -32,4 +32,6 @@

 # Include some of the compiler flag modules from couchbase/tlm
 INCLUDE(CouchbaseCompilerOptions)
-INCLUDE(CouchbaseCodeCoverage)+INCLUDE(CouchbaseCodeCoverage)
+INCLUDE(CouchbaseThreadSanitizer)
+INCLUDE(CouchbaseAddressSanitizer)


Do not clone the whole TF repository

Do not clone the whole TF repository

Closes #212

--- tensorflow_cc/cmake/TensorflowBase.cmake
+++ tensorflow_cc/cmake/TensorflowBase.cmake
@@ -3,8 +3,7 @@

 ExternalProject_Add(
   tensorflow_base
-  GIT_REPOSITORY https://github.com/tensorflow/tensorflow.git
-  GIT_TAG "${TENSORFLOW_TAG}"
+  URL https://github.com/tensorflow/tensorflow/archive/${TENSORFLOW_TAG}.tar.gz
   TMP_DIR "/tmp"
   STAMP_DIR "tensorflow-stamp"
   DOWNLOAD_DIR "tensorflow"


fix working directory for visual studio 2012

--- CMake/Utils/MyGUIConfigTargets.cmake
+++ CMake/Utils/MyGUIConfigTargets.cmake
@@ -36,7 +36,11 @@
 			set(MYGUI_WIN_BUILD_CONFIGURATION "Win32")
 		endif()

-		if (${CMAKE_GENERATOR} STREQUAL "Visual Studio 10" OR ${CMAKE_GENERATOR} STREQUAL "Visual Studio 10 Win64")
+		#FIXME
+		if (${CMAKE_GENERATOR} STREQUAL "Visual Studio 10" OR ${CMAKE_GENERATOR} STREQUAL "Visual Studio 10 Win64" OR
+			${CMAKE_GENERATOR} STREQUAL "Visual Studio 11" OR ${CMAKE_GENERATOR} STREQUAL "Visual Studio 11 Win64" OR
+			${CMAKE_GENERATOR} STREQUAL "Visual Studio 12" OR ${CMAKE_GENERATOR} STREQUAL "Visual Studio 12 Win64"
+			)
 			configure_file(
 				${MYGUI_TEMPLATES_DIR}/VisualStudio2010UserFile.vcxproj.user.in
 				${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}.vcxproj.user


Fix GEngine find module

Fix GEngine find module

--- cmake/Modules/FindGEngine.cmake
+++ cmake/Modules/FindGEngine.cmake
@@ -5,7 +5,7 @@
 #  GENGINE_INCLUDE_DIR - the GENGINE include directory
 #  GENGINE_LIBRARIES - The libraries needed to use GENGINE

-if(NOT GENGINE_INCLUDE_DIR AND GENGINE_LIBRARIES)
+if(NOT GENGINE_INCLUDE_DIR OR NOT GENGINE_LIBRARIES)
 	FIND_PATH(GENGINE_INCLUDE_DIR GEngine/GEngine.hpp
 	   /usr/include
 	   /usr/local/include


Fix for CMake message syntax.

Fix for CMake message syntax.

--- cmake/Modules/FindLIBMESH.cmake
+++ cmake/Modules/FindLIBMESH.cmake
@@ -2,7 +2,7 @@
 # module and creates a libmesh imported target

 if (${CMAKE_VERSION} VERSION_LESS 3.12.0)
-    message((FATAL_ERROR "OpenMC builds with libMesh support require CMake version 3.12.0 or greater."))
+    message(FATAL_ERROR "OpenMC builds with libMesh support require CMake version 3.12.0 or greater.")
 endif()

 include(FindPkgConfig)