Adding quote marks around paths

Adding quote marks around paths

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -4,7 +4,7 @@

 # Sets location where external project are included
 if(NOT EXTERNAL_ROOT)
-  set(EXTERNAL_ROOT ${CMAKE_BINARY_DIR}/external)
+  set(EXTERNAL_ROOT "${CMAKE_BINARY_DIR}/external")
 endif(NOT EXTERNAL_ROOT)
 # Makes sure external projects are found by cmake
 list(FIND CMAKE_PREFIX_PATH "${EXTERNAL_ROOT}" has_external_root)
@@ -30,7 +30,7 @@

 function(_find_lookup_recipe package OUTVAR)
     foreach(path ${CMAKE_MODULE_PATH})
-      list(APPEND cmake_paths ${path}/${package})
+      list(APPEND cmake_paths "${path}/${package}")
     endforeach()
     set(LOOKUP_RECIPE LOOKUP_RECIPE-NOTFOUND)
     foreach(filename ${package}-lookup.cmake LookUp${package}.cmake)


Use CFLAGS to set include path

Use CFLAGS to set include path

--- projects/python.cmake
+++ projects/python.cmake
@@ -3,7 +3,7 @@
   CONFIGURE_COMMAND <SOURCE_DIR>/configure
                     --prefix=<INSTALL_DIR>
                     --enable-unicode=ucs4
-                    --enable-shared
+                    --enable-shared CFLAGS=-I${CMAKE_OSX_SYSROOT}/usr/include
   PROCESS_ENVIRONMENT CFLAGS -I${CMAKE_OSX_SYSROOT}/usr/include
   )
 set (pv_python_executable "${install_location}/bin/python3" CACHE INTERNAL "" FORCE)


Remove SSE2 flag because even though is the default flag it generates warnings when set.

--- cmake/BuildFlags.cmake
+++ cmake/BuildFlags.cmake
@@ -55,9 +55,9 @@
     $<$<STREQUAL:"${CSE_BUILD_ARCHITECTURE}","32">:
       /arch:IA32    # Specifies the architecture for code generation (no special instructions).
     >
-    $<$<STREQUAL:"${CSE_BUILD_ARCHITECTURE}","64">:
-      /arch:SSE2    # Enables the use of Intel Advanced Vector Extensions instructions.
-    >
+    # $<$<STREQUAL:"${CSE_BUILD_ARCHITECTURE}","64">:
+    #   /arch:SSE2    # Enables the use of Intel Advanced Vector Extensions instructions.
+    # >
     $<$<CONFIG:Release>:
       # /MD       #*Creates a multithreaded DLL using MSVCRT.lib.
       # /MT       # Creates a multithreaded executable file using LIBCMT.lib. (set through CMAKE_MSVC_RUNTIME_LIBRARY)


cmake/BuildPCRE2.cmake: use INSTALL_DIR instead of INSTALL_COMMAND, fix WIN32 tests [ci skip]

--- cmake/BuildPCRE2.cmake
+++ cmake/BuildPCRE2.cmake
@@ -40,16 +40,16 @@
   URL "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23-patched.tar.gz"
   UPDATE_COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23/CMakeLists_fixed.txt" "${CMAKE_CURRENT_BINARY_DIR}/pcre2/src/pcre2/CMakeLists.txt"
   PREFIX "${CMAKE_CURRENT_BINARY_DIR}/pcre2"
+  INSTALL_DIR "."
   CMAKE_ARGS ${_PCRE2_CMAKE_ARGS}
   CMAKE_CACHE_ARGS ${_CMAKE_CACHE_ARGS}
-  INSTALL_COMMAND "${CMAKE_MAKE_PROGRAM}" install "DESTDIR="
   )
 SET (PCRE2_INCLUDE_DIR "${3RDPARTY_OUTPUT_PATH}/include")
-IF (WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))
+IF (WIN32 AND (CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo))
   SET (PCRE2_LINK_FLAGS  "${3RDPARTY_OUTPUT_PATH}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pcre2-8d${CMAKE_STATIC_LIBRARY_SUFFIX}")
-ELSE (WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))
+ELSE ()
   SET (PCRE2_LINK_FLAGS  "${3RDPARTY_OUTPUT_PATH}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pcre2-8${CMAKE_STATIC_LIBRARY_SUFFIX}")
-ENDIF (WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))
+ENDIF ()
 SET (PCRE2_LIBRARIES   "${PCRE2_LINK_FLAGS}")
 MESSAGE(STATUS "-----------------------------------------")
 MESSAGE(STATUS "Setup PCRE2:")


Specify version 3.7 for clang-format

Specify version 3.7 for clang-format

--- cmake/CodeFormat.cmake
+++ cmake/CodeFormat.cmake
@@ -1,5 +1,8 @@
 ## C++ format #################################################################
-find_program(CLANG_FORMAT_EXECUTABLE clang-format)
+find_program(CLANG_FORMAT_EXECUTABLE NAMES
+    clang-format-3.7
+    clang-format-mp-3.7
+)
 if(CLANG_FORMAT_EXECUTABLE)
     message("-- Found clang-format: ${CLANG_FORMAT_EXECUTABLE}")
 else()
@@ -21,6 +24,7 @@
     ${CMAKE_BINARY_DIR}/diff-clang-format.py
         --file-extension='.h'
         --file-extension='.cc'
+        --binary=${CLANG_FORMAT_EXECUTABLE}
         --style=file
         --config=${CMAKE_SOURCE_DIR}/.clang-format
         --apply-patch
@@ -33,6 +37,7 @@
     "${PYTHON_EXECUTABLE} "
     "${CMAKE_BINARY_DIR}/diff-clang-format.py "
     "--file-extension='.h' --file-extension='.cc' "
+    "--binary=${CLANG_FORMAT_EXECUTABLE} "
     "--style=file "
     "--config=${CMAKE_SOURCE_DIR}/.clang-format "
     "${CMAKE_SOURCE_DIR}/cpp"


Disable check Python format when Python is not enabled

--- cmake/CodeFormat.cmake
+++ cmake/CodeFormat.cmake
@@ -52,44 +52,46 @@
 )

 ## Python format ##############################################################
-find_program(AUTOPEP8_EXECUTABLE autopep8)
-if(AUTOPEP8_EXECUTABLE)
-    message("-- Found autopep8: ${AUTOPEP8_EXECUTABLE}")
-else()
-    message(FATAL_ERROR "-- autopep8 not found")
+if(ENABLE_PYTHON)
+  find_program(AUTOPEP8_EXECUTABLE autopep8)
+  if(AUTOPEP8_EXECUTABLE)
+      message("-- Found autopep8: ${AUTOPEP8_EXECUTABLE}")
+  else()
+      message(FATAL_ERROR "-- autopep8 not found")
+  endif()
+  add_custom_target(format-python
+      ${AUTOPEP8_EXECUTABLE}
+      --in-place --recursive
+      ${CMAKE_SOURCE_DIR}/python
+  )
+  file(WRITE
+      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/check_format_python.sh
+      "#!/usr/bin/env bash\n"
+      "\n"
+      "${AUTOPEP8_EXECUTABLE} "
+      "--diff --recursive "
+      "${CMAKE_SOURCE_DIR}/python "
+      "| tee diff\n"
+      "diff=`cat diff`\n"
+      "rm diff\n"
+      "if [ -z \"$diff\" ]; then\n"
+      "    echo OK\n"
+      "    exit 0\n"
+      "else\n"
+      "    exit 1\n"
+      "fi"
+  )
+  file(COPY
+      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/check_format_python.sh
+      DESTINATION
+          ${CMAKE_BINARY_DIR}
+      FILE_PERMISSIONS
+          OWNER_READ OWNER_WRITE OWNER_EXECUTE
+          GROUP_READ GROUP_EXECUTE
+          WORLD_READ WORLD_EXECUTE
+  )
+  add_test(
+      NAME check_format_py
+      COMMAND ${CMAKE_BINARY_DIR}/check_format_python.sh
+  )
 endif()
-add_custom_target(format-python
-    ${AUTOPEP8_EXECUTABLE}
-    --in-place --recursive
-    ${CMAKE_SOURCE_DIR}/python
-)
-file(WRITE
-    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/check_format_python.sh
-    "#!/usr/bin/env bash\n"
-    "\n"
-    "${AUTOPEP8_EXECUTABLE} "
-    "--diff --recursive "
-    "${CMAKE_SOURCE_DIR}/python "
-    "| tee diff\n"
-    "diff=`cat diff`\n"
-    "rm diff\n"
-    "if [ -z \"$diff\" ]; then\n"
-    "    echo OK\n"
-    "    exit 0\n"
-    "else\n"
-    "    exit 1\n"
-    "fi"
-)
-file(COPY
-    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/check_format_python.sh
-    DESTINATION
-        ${CMAKE_BINARY_DIR}
-    FILE_PERMISSIONS
-        OWNER_READ OWNER_WRITE OWNER_EXECUTE
-        GROUP_READ GROUP_EXECUTE
-        WORLD_READ WORLD_EXECUTE
-)
-add_test(
-    NAME check_format_py
-    COMMAND ${CMAKE_BINARY_DIR}/check_format_python.sh
-)


Aaaaaaand another Eigen3 detection fix

Aaaaaaand another Eigen3 detection fix

--- cmake/FindEigen3.cmake
+++ cmake/FindEigen3.cmake
@@ -60,7 +60,6 @@
   set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})

 else (EIGEN3_INCLUDE_DIR)
-
   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
       PATHS
       ${CMAKE_INSTALL_PREFIX}/include
@@ -70,12 +69,12 @@

 	if (NOT EIGEN3_INCLUDE_DIR)
 		## Try harder...
-		find_file(EIGEN3_INCLUDE_DIR NAMES src/Core/EigenBase.h
+		find_file(EIGENBASE_PATH NAMES src/Core/EigenBase.h
 			PATHS ${CMAKE_FIND_ROOT_PATH}
 			PATH_SUFFIXES include Eigen include/Eigen)
-		IF (EIGEN3_INCLUDE_DIR)
-			STRING(REGEX REPLACE /Eigen/src/Core/EigenBase.h / EIGEN3_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR})
-		ENDIF ()
+			IF (EIGENBASE_PATH)
+				STRING(REPLACE "/Eigen/src/Core/EigenBase.h" "/" EIGEN3_INCLUDE_DIR ${EIGENBASE_PATH})
+			ENDIF ()
 	endif (NOT EIGEN3_INCLUDE_DIR)

   if(EIGEN3_INCLUDE_DIR)


only add bzip2 if it's available

only add bzip2 if it's available

--- cmake/FindLIBZIP.cmake
+++ cmake/FindLIBZIP.cmake
@@ -15,7 +15,7 @@
 # @author Lars Ivar Hatledal

 find_package(ZLIB REQUIRED)
-find_package(BZip2 REQUIRED)
+find_package(BZip2)

 find_path(LIBZIP_INCLUDE_DIR NAMES zip.h)
 mark_as_advanced(LIBZIP_INCLUDE_DIR)
@@ -35,7 +35,7 @@
         set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY})
     endif()

-    if (NOT TARGET  LIBZIP::LIBZIP)
+    if (NOT TARGET LIBZIP::LIBZIP)
         add_library( LIBZIP::LIBZIP UNKNOWN IMPORTED)
         set_property(TARGET  LIBZIP::LIBZIP
                 APPEND
@@ -43,11 +43,15 @@
         set_property(TARGET  LIBZIP::LIBZIP
                 APPEND
                 PROPERTY IMPORTED_LOCATION "${LIBZIP_LIBRARY}")
+
+        set(INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
+        if (BZip2_FOUND)
+            list(APPEND INTERFACE_LINK_LIBRARIES BZip2::BZip2)
+        endif()
         set_property(TARGET  LIBZIP::LIBZIP
                 APPEND
                 PROPERTY INTERFACE_LINK_LIBRARIES
-                ZLIB::ZLIB
-                BZip2::BZip2)
+                ${INTERFACE_LINK_LIBRARIES})

     endif()


updated FindMatlab to avoid picking up latex installations on OS X

--- cmake/FindMatlab.cmake
+++ cmake/FindMatlab.cmake
@@ -132,18 +132,18 @@
     find_file(MATLAB_QT_QTCORE_LIBRARY libQtXml.so.4
         HINTS $ENV{MATLAB_ROOT}/bin/glnxa64/
         PATHS ${MATLAB_LIB_PATHS}
-        NO_DEFAULT_PATH)
+        NO_DEFAULT_PATH)
   else ()
-    find_library(MATLAB_QT_QTCORE_LIBRARY QtCore
-        HINTS
-        /Applications/MATLAB_R2012b.app/bin/maci64
-        NO_DEFAULT_PATH)
-    find_library(MATLAB_QT_QTGUI_LIBRARY QtGui
-        HINTS
+    find_library(MATLAB_QT_QTCORE_LIBRARY QtCore
+        HINTS
         /Applications/MATLAB_R2012b.app/bin/maci64
         NO_DEFAULT_PATH)
-    find_library(MATLAB_QT_QTXML_LIBRARY QtXml
-        HINTS
+    find_library(MATLAB_QT_QTGUI_LIBRARY QtGui
+        HINTS
+        /Applications/MATLAB_R2012b.app/bin/maci64
+        NO_DEFAULT_PATH)
+    find_library(MATLAB_QT_QTXML_LIBRARY QtXml
+        HINTS
         /Applications/MATLAB_R2012b.app/bin/maci64
         NO_DEFAULT_PATH)
     #find_package(Qt4 4.6 QUIET)
@@ -181,7 +181,7 @@
 ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)

 # Find the MATLAB binary path
-find_path(MATLAB_BINARY_DIR mex
+find_path(MATLAB_BINARY_DIR matlab
     HINTS
     $ENV{MATLAB_ROOT}
     PATHS


FindSphinx.cmake fix devhelp -> QTHELP typo.

--- cmake/FindSphinx.cmake
+++ cmake/FindSphinx.cmake
@@ -19,7 +19,7 @@
 option( SPHINX_HTML_OUTPUT "Build a single HTML with the whole content." ON )
 option( SPHINX_DIRHTML_OUTPUT "Build HTML pages, but with a single directory per document." OFF )
 option( SPHINX_HTMLHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in htmlhelp." OFF )
-option( SPHINX_devhelp_OUTPUT "Build HTML pages with additional information for building a documentation collection in qthelp." OFF )
+option( SPHINX_QTHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in qthelp." OFF )
 option( SPHINX_DEVHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in devhelp." OFF )
 option( SPHINX_EPUB_OUTPUT "Build HTML pages with additional information for building a documentation collection in epub." OFF )
 option( SPHINX_LATEX_OUTPUT "Build LaTeX sources that can be compiled to a PDF document using pdflatex." OFF )
@@ -32,7 +32,7 @@
   SPHINX_HTML_OUTPUT
   SPHINX_DIRHTML_OUTPUT
   SPHINX_HTMLHELP_OUTPUT
-  SPHINX_devhelp_OUTPUT
+  SPHINX_QTHELP_OUTPUT
   SPHINX_DEVHELP_OUTPUT
   SPHINX_EPUB_OUTPUT
   SPHINX_LATEX_OUTPUT
@@ -56,6 +56,7 @@
     )
 endfunction()

+# Target dependencies can be optionally listed at the end.
 function( Sphinx_add_targets target_base_name conf source base_destination )

   set( _dependencies )


Remove commented out lines for Xcode

Remove commented out lines for Xcode

CMake as of 3.3 appears to use correct stdlib setting.

--- cmake/CheckCXXFeature.cmake
+++ cmake/CheckCXXFeature.cmake
@@ -95,7 +95,6 @@
     else()
       try_run(_RUN_RESULT_VAR _COMPILE_RESULT_VAR
         "${_bindir}" "${_SRCFILE}"
-        #CMAKE_FLAGS "-DCMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY='libc++'"
         COMPILE_DEFINITIONS "${CMAKE_CXX${_CF_CXX_STANDARD}_STANDARD_COMPILE_OPTION}")
       if(_COMPILE_RESULT_VAR AND NOT _RUN_RESULT_VAR)
         set(${RESULT_VAR} TRUE)
@@ -106,7 +105,6 @@
       if(${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL})
         try_run(_RUN_RESULT_VAR _COMPILE_RESULT_VAR
           "${_bindir}_fail" "${_SRCFILE_FAIL}"
-          #CMAKE_FLAGS "-DCMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY='libc++'"
           COMPILE_DEFINITIONS "${CMAKE_CXX${_CF_CXX_STANDARD}_STANDARD_COMPILE_OPTION}")
         if(_COMPILE_RESULT_VAR AND _RUN_RESULT_VAR)
           set(${RESULT_VAR} TRUE)
@@ -118,7 +116,6 @@

     if(${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL_COMPILE})
       try_compile(_TMP_RESULT "${_bindir}_fail_compile" "${_SRCFILE_FAIL_COMPILE}"
-        #CMAKE_FLAGS "-DCMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY='libc++'"
         COMPILE_DEFINITIONS "${CMAKE_CXX${_CF_CXX_STANDARD}_STANDARD_COMPILE_OPTION}")
       if(_TMP_RESULT)
         set(${RESULT_VAR} FALSE)


Add macro allowing to set variable and update list of required definition.

This macro will minimize error while defining variable that should
also be added to the list of required definition to allow the
both compile and run test to work as expected.

While updating the code, I also notice that there was a typo associated
with the "_NETBSD_SOURCE" definition. The variable _NETBSD_SOURCE was
set but the definition -DNETBSD_SOURCE=1 was set.

Also add an informational message indicating if XOPEN_SOURCE related
definition are set or not.

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -27,6 +27,14 @@
     set(${var} ${${var}} ${item})
   endif(${cond})
 endmacro(ADD_COND)
+
+set(CMAKE_REQUIRED_DEFINITIONS )
+
+# Convenient macro allowing to conditonally update CMAKE_REQUIRED_DEFINITIONS
+macro(set_required_def var value)
+  set(${var} ${value})
+  list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D${var}=${value}")
+endmacro(set_required_def)

 # Emulate AC_HEADER_DIRENT
 check_include_files(dirent.h HAVE_DIRENT_H)
@@ -149,47 +157,43 @@
 set(_FILE_OFFSET_BITS 64)
 set(_LARGEFILE_SOURCE 1)

-set(__BSD_VISIBLE 1)
-set(_BSD_TYPES 1)
 set(__EXTENSIONS__ 1)
-set(_GNU_SOURCE 1)
-set(_NETBSD_SOURCE 1)
-set(_DARWIN_C_SOURCE 1)
+
+set_required_def(_GNU_SOURCE 1)       # Define on Linux to activate all library features
+set_required_def(_NETBSD_SOURCE 1)    # Define on NetBSD to activate all library features
+set_required_def(__BSD_VISIBLE 1)     # Define on FreeBSD to activate all library features
+set_required_def(_BSD_TYPES 1)        # Define on Irix to enable u_int
+set_required_def(_DARWIN_C_SOURCE 1)  # Define on Darwin to activate all library features
+

 if(HAVE_MINIX_CONFIG_H)
-  set(_POSIX_SOURCE 1)
-  set(_POSIX_1_SOURCE 2)
-  set(_MINIX 1)
+  set_required_def(_POSIX_SOURCE 1)   # Define to 1 if you need to in order for 'stat' and other things to work.
+  set_required_def(_POSIX_1_SOURCE 2) # Define to 2 if the system does not provide POSIX.1 features except with this defined.
+  set_required_def(_MINIX 1)          # Define to 1 if on MINIX.
 endif()
+
+message(STATUS "Checking for XOPEN_SOURCE")
+set(define_xopen_source 1)

 if(CMAKE_SYSTEM MATCHES OpenBSD)
   set(_BSD_SOURCE 1)
 endif(CMAKE_SYSTEM MATCHES OpenBSD)

-set(define_xopen_source 1)
 if(APPLE)
   set(define_xopen_source 0)
 endif()

 if(define_xopen_source)
-  set(_XOPEN_SOURCE 600)
-  set(_XOPEN_SOURCE_EXTENDED 1)
-  set(_POSIX_C_SOURCE 200112L)
+  message(STATUS "Checking for XOPEN_SOURCE - yes")
+  set_required_def(_XOPEN_SOURCE 600)        # Define to the level of X/Open that your system supports
+  set_required_def(_XOPEN_SOURCE_EXTENDED 1) # Define to activate Unix95-and-earlier features
+  set_required_def(_POSIX_C_SOURCE 200112L)  # Define to activate features from IEEE Stds 1003.1-2001
+else()
+  message(STATUS "Checking for XOPEN_SOURCE - no")
 endif()

-set(CMAKE_REQUIRED_DEFINITIONS
-  -D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS}
-  -D_GNU_SOURCE=${_GNU_SOURCE}
-  -D_BSD_TYPES=${_BSD_TYPES}
-  -DNETBSD_SOURCE=${_NETBSD_SOURCE}
-  -D__BSD_VISIBLE=${__BSD_VISIBLE})
-if(HAVE_MINIX_CONFIG_H)
-  list(APPEND CMAKE_REQUIRED_DEFINITIONS
-    -D_POSIX_SOURCE=${_POSIX_SOURCE}
-    -D_POSIX_1_SOURCE=${_POSIX_1_SOURCE}
-    -D_MINIX=${_MINIX}
-    )
-endif(HAVE_MINIX_CONFIG_H)
+endif()
+
 set(CMAKE_EXTRA_INCLUDE_FILES stdio.h)

 add_cond(CMAKE_REQUIRED_LIBRARIES HAVE_LIBM m)


Use GNU install directories, and rpath

Use GNU install directories, and rpath

Use the GNU install directories, and ensure the install rpath is set to
match. Warning - the prefix directory will need to be removed as lib is
always found before any other location (with CMake 2.8.11.1 at least).

Change-Id: I03e8fcd4a18a20bf5f8723c971faa90b50d31dd9

--- cmake/InstallLocation.cmake
+++ cmake/InstallLocation.cmake
@@ -4,27 +4,47 @@
 #
 # These paths attempt to adhere to the FHS, and are similar to those provided
 # by autotools and used in many Linux distributions.
+#
+# Use GNU install directories
+include(GNUInstallDirs)
 if(NOT INSTALL_RUNTIME_DIR)
-  set(INSTALL_RUNTIME_DIR "bin")
+  set(INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}")
 endif()
 if(NOT INSTALL_LIBRARY_DIR)
-  set(INSTALL_LIBRARY_DIR "lib")
+  set(INSTALL_LIBRARY_DIR "${CMAKE_INSTALL_LIBDIR}")
 endif()
 if(NOT INSTALL_ARCHIVE_DIR)
-  set(INSTALL_ARCHIVE_DIR "lib")
+  set(INSTALL_ARCHIVE_DIR "${CMAKE_INSTALL_LIBDIR}")
 endif()
 if(NOT INSTALL_INCLUDE_DIR)
-  set(INSTALL_INCLUDE_DIR "include")
+  set(INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
 endif()
 if(NOT INSTALL_DATA_DIR)
-  set(INSTALL_DATA_DIR "share")
+  set(INSTALL_DATA_DIR "${CMAKE_INSTALL_DATAROOTDIR}")
 endif()
 if(NOT INSTALL_DOC_DIR)
-  set(INSTALL_DOC_DIR "${INSTALL_DATA_DIR}/doc")
+  set(INSTALL_DOC_DIR "${CMAKE_INSTALL_DOCDIR}")
+endif()
+if(NOT INSTALL_MAN_DIR)
+  set(INSTALL_MAN_DIR "${CMAKE_INSTALL_MANDIR}")
+endif()
+if(UNIX AND NOT APPLE)
+  if(NOT INSTALL_XDG_APP_DIR)
+    set(INSTALL_XDG_APPS_DIR "${INSTALL_DATA_DIR}/applications")
+  endif()
+  if(NOT INSTALL_XDG_ICON_DIR)
+    set(INSTALL_XDG_ICON_DIR "${INSTALL_DATA_DIR}/pixmaps")
+  endif()
 endif()

 # Set up RPATH for the project too.
 option(ENABLE_RPATH "Enable rpath support on Linux and Mac" ON)
+if(NOT CMAKE_INSTALL_RPATH)
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
+endif()
+if(APPLE AND NOT CMAKE_INSTALL_NAME_DIR)
+  set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
+endif()
 if(UNIX AND ENABLE_RPATH)
   set(CMAKE_SKIP_BUILD_RPATH FALSE)
   set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)


Squashed '3rdparty/github/cmake-utils/' changes from bade164e..6d68e878

6d68e878 Fix cmake/MyPackageRepair.cmake

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: 6d68e878e29b6a1de968f7f6cdc94da5449aeac3

--- cmake/MyPackageRepair.cmake
+++ cmake/MyPackageRepair.cmake
@@ -12,7 +12,7 @@
     SET (FIXME_CMAKE_SINGLETON TRUE CACHE BOOL "__fixme__.cmake singleton")
     MARK_AS_ADVANCED (FIXME_CMAKE_SINGLETON)
   ENDIF ()
-  IF (HAVE_STDINT_H)
+  IF (NOT HAVE_STDINT_H)
     GET_PROPERTY(source_dir_set GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR SET)
     IF (NOT ${source_dir_set})
       MESSAGE (WARNING "Cannot repair anything if any, property MYPACKAGE_SOURCE_DIR is not set")
@@ -26,6 +26,7 @@
         GET_FILENAME_COMPONENT(_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE ${MYPACKAGE_GENERATED_INCLUDE_DIR} ABSOLUTE)
         INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})
         MESSAGE(STATUS "Appending in ${FIXME_CMAKE}: INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})")
+        FILE(APPEND ${FIXME_CMAKE} "Append to INCLUDE_DIRECTORIES: ${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE}\n")
         FILE(APPEND ${FIXME_CMAKE} "INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})\n")
       ENDIF ()
       SET (STDINT_H_SINGLETON TRUE CACHE BOOL "C stdint.h repair singleton")


Remove tabs

Remove tabs

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -321,9 +321,9 @@
 hunter_default_version(rabbitmq-c VERSION 0.7.0-p1)
 hunter_default_version(randrproto VERSION 1.3.2)
 if(MSVC)
-	hunter_default_version(range-v3 VERSION vcpkg5-p)
-else()
-	hunter_default_version(range-v3 VERSION 0.3.0-p)
+  hunter_default_version(range-v3 VERSION vcpkg5-p)
+else()
+  hunter_default_version(range-v3 VERSION 0.3.0-p)
 endif()
 hunter_default_version(re2 VERSION 2017.11.01-p0)
 hunter_default_version(recastnavigation VERSION 1.4-p0)


Updated configs/default.cmake for xxf86vm and xf86vidmodeproto

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -153,6 +153,7 @@
 hunter_config(xdamage VERSION 1.1.4)
 hunter_config(xext VERSION 1.3.1)
 hunter_config(xextproto VERSION 7.2.1)
+hunter_config(xf86vidmodeproto VERSION 2.3.1)
 hunter_config(xfixes VERSION 5.0.1)
 hunter_config(xgboost VERSION 0.40-p2)
 hunter_config(xorg-macros VERSION 1.17)
@@ -160,6 +161,7 @@
 hunter_config(xrender VERSION 0.9.7)
 hunter_config(xshmfence VERSION 1.2)
 hunter_config(xtrans VERSION 1.2.7)
+hunter_config(xxf86vm VERSION 1.1.2)

 if(MINGW OR MSVC80)
   hunter_config(GTest VERSION 1.7.0-hunter-6)


add PocoCpp to default.cmake

add PocoCpp to default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -67,6 +67,7 @@
 hunter_config(OpenCV-Extra VERSION 3.0.0)
 hunter_config(OpenSSL VERSION 1.0.2h)
 hunter_config(PNG VERSION 1.6.16-p4)
+hunter_config(PocoCpp VERSION 1.7.3)
 hunter_config(PostgreSQL VERSION 9.5.0)
 hunter_config(Protobuf VERSION 3.0.0-beta-2-p1)
 hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-2-p7)


remove the use of the LOCATION CMake variable from r238740.

It caused the following failure:
"Policy CMP0026 is not set: Disallow use of the LOCATION target property."

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -284,9 +284,6 @@
     set(ARG_PRODUCT_NAME "LLVM")
   endif()

-  get_target_property(target_location ${name} LOCATION)
-  get_filename_component(target_filename ${target_location} NAME)
-
   set_property(SOURCE ${resource_file}
                PROPERTY COMPILE_DEFINITIONS
                "RC_VERSION_FIELD_1=${ARG_VERSION_MAJOR}"
@@ -295,7 +292,6 @@
                "RC_VERSION_FIELD_4=0"
                "RC_FILE_VERSION=\"${ARG_VERSION_STRING}\""
                "RC_INTERNAL_NAME=\"${name}\""
-               "RC_ORIGINAL_FILENAME=\"${target_filename}\""
                "RC_PRODUCT_NAME=\"${ARG_PRODUCT_NAME}\""
                "RC_PRODUCT_VERSION=\"${ARG_VERSION_STRING}\"")
 endfunction(set_windows_version_resource_properties)


FIX: Add default module libs to samples when building static configuration.

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -81,6 +81,14 @@
         ${CEGUI_SAMPLEHELPER_LIBNAME}
     )

+    if (NOT BUILD_SHARED_LIBS)
+        target_link_libraries(${CEGUI_TARGET_NAME}
+            "CEGUI${CEGUI_OPTION_DEFAULT_XMLPARSER}"
+            "CEGUI${CEGUI_OPTION_DEFAULT_IMAGECODEC}"
+            ${CEGUI_FALAGARD_WR_LIBNAME}
+        )
+    endif()
+
     if (UNIX AND NOT APPLE AND NOT WIN32)
         install(TARGETS ${CEGUI_TARGET_NAME}
             RUNTIME DESTINATION bin


use CMAKE_CURRENT_SOURCE_DIR to be able to use RaftLib as subproject

--- cmake/CheckGitDep.cmake
+++ cmake/CheckGitDep.cmake
@@ -1,7 +1,7 @@
 ##
 # check out other repos we need
 ##
-set( DEPDIR ${CMAKE_SOURCE_DIR}/git-dep )
+set( DEPDIR ${CMAKE_CURRENT_SOURCE_DIR}/git-dep )

@@ -17,9 +17,9 @@
 foreach( GMOD ${GIT_MODULES} )
  message( INFO " Initializing sub-module ${DEPDIR}/${GMOD} from git repo!" )
  execute_process( COMMAND git submodule init ${DEPDIR}/${GMOD}
-                  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+                  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
  execute_process( COMMAND git submodule update ${DEPDIR}/${GMOD}
-                  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+                  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
  ##
  # build execs if needed
  ##


Set static variables for non-pkgconfig libraries

We use the builtin `find_library` to find library prereqs that don't
provide pkgconfig files.  This function sets the `_LDFLAGS` variable for
us, giving us the location of the library file.

--- cmake/FindPrereqs.cmake
+++ cmake/FindPrereqs.cmake
@@ -69,8 +69,16 @@
     if (USE_CUSTOM_${UPPER_SHORT_NAME})
         include_directories(${${UPPER_SHORT_NAME}_INCLUDE_DIRS})
         link_directories(${${UPPER_SHORT_NAME}_LIBRARY_DIRS})
+        if (NOT ${UPPER_SHORT_NAME}_STATIC_LDFLAGS)
+            set(${UPPER_SHORT_NAME}_STATIC_LDFLAGS
+                ${${UPPER_SHORT_NAME}_LDFLAGS}
+                PARENT_SCOPE)
+        endif (NOT ${UPPER_SHORT_NAME}_STATIC_LDFLAGS)
     else (USE_CUSTOM_${UPPER_SHORT_NAME})
         find_library(${UPPER_SHORT_NAME}_LDFLAGS ${LIB_NAME})
+        set(${UPPER_SHORT_NAME}_STATIC_LDFLAGS
+            ${${UPPER_SHORT_NAME}_LDFLAGS}
+            PARENT_SCOPE)
     endif (USE_CUSTOM_${UPPER_SHORT_NAME})

 endfunction(library_prereq)


FindYamlCpp.cmake: check the availability of the new 0.5 API.

--- cmake/FindYamlCpp.cmake
+++ cmake/FindYamlCpp.cmake
@@ -1,6 +1,11 @@
 set(_yamlcpp_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})

 find_path(YamlCpp_INCLUDE_PATH yaml-cpp/yaml.h)
+
+find_path(YamlCpp_NEW_API yaml-cpp/node/node.h)
+if(YamlCpp_INCLUDE_PATH AND NOT YamlCpp_NEW_API)
+  message(FATAL_ERROR "The new yaml-cpp 0.5 API is not available.")
+endif()

 if (YamlCpp_STATIC)
   if (WIN32)
@@ -10,6 +15,7 @@
   endif (WIN32)
 endif (YamlCpp_STATIC)
 find_library(YamlCpp_LIBRARY NAMES libyaml-cppmt yaml-cpp)
+
 if(YamlCpp_INCLUDE_PATH AND YamlCpp_LIBRARY)
   set(YamlCpp_FOUND TRUE)
 endif(YamlCpp_INCLUDE_PATH AND YamlCpp_LIBRARY)


Do not include TUNDRA_DEP_PATH/include and TUNDRA_DEP_PATH/lib in Mac as well, since the dependency dir structure is same as that on Windows

--- cmake/ModuleSetup.cmake
+++ cmake/ModuleSetup.cmake
@@ -29,7 +29,7 @@
     # Removed from windows due we dont have anything here directly.
     # On linux this might have useful things but still ConfigurePackages should
     # find them properly so essentially this is not needed.
-    if (NOT WIN32)
+    if (NOT WIN32 AND NOT APPLE)
         include_directories (${ENV_TUNDRA_DEP_PATH}/include)
         link_directories (${ENV_TUNDRA_DEP_PATH}/lib)
     endif ()


COMP: Add cmake_minimum_required call to generated try-compile project in VTK/CMake/vtkTestExplicitInstantiation.cmake.  This avoids a warning from CMake 2.6.

--- CMake/vtkTestExplicitInstantiation.cmake
+++ CMake/vtkTestExplicitInstantiation.cmake
@@ -10,6 +10,7 @@
   STRING(ASCII 35 POUND)
   WRITE_FILE(
     ${VTK_BINARY_DIR}/CMakeTmp/TestExplicitInstantiation/CMakeLists.txt
+    "CMAKE_MINIMUM_REQUIRED(VERSION 2.4)\n"
     "PROJECT(EXPLICIT)\n"
     "ADD_LIBRARY(A A.cxx)\n"
     "ADD_EXECUTABLE(B B.cxx)\n"


CMake: grammar

CMake: grammar

--- CMakeModules/MinGWResourceCompiler.cmake
+++ CMakeModules/MinGWResourceCompiler.cmake
@@ -28,7 +28,7 @@
     add_custom_command(OUTPUT ${_OUT}
         COMMAND windres.exe
         ARGS ${_ARGS}
-        COMMENT "Compiling ${_NAME} resource file."
+        COMMENT "Compiling ${_NAME}'s resource file"
         VERBATIM)

     # Set a NAME_RESOURCES variable


Additional debug of documentation for SALOME_ACCUMULATE_ENVIRONMENT macro

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -656,18 +656,21 @@
 #    _${PROJECT_NAME}_EXTRA_ENV.
 #
 # Notes:
-# - If in arguments is set keyword CHECK all argument after checked for directory,
-#   else if NOT_CHECK macro accumulates arguments without checking.
-#   By default all arguments without keyword must be checked.
+# - The arguments list can include optional CHECK or NOCHECK keywords:
+#   * For all arguments following CHECK keyword the macro perform an
+#     additional check (see below); this is the default mode, it is suitable
+#     for path variables (PATH, LD_LIBRARY_PATH, etc).
+#   * For all arguments following NOCHECK keyword, no additional check is
+#     performed.
 #   Checking an argument means that we check:
-#    - that the path actually exists
-#    - that this is not a standard system path (starting with "/usr"). This avoids
+#    - That the path actually exists
+#    - That this is not a standard system path (starting with "/usr"); this avoids
 #   polluting LD_LIBRARY_PATH or PATH with things like "/usr/lib64" ...
 #
 MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar)
   SET(_is_check ON)
   FOREACH(_item ${ARGN})
-    IF(${_item} STREQUAL "NOT_CHECK")
+    IF(${_item} STREQUAL "NOCHECK")
       SET(_is_check OFF)
     ELSEIF(${_item} STREQUAL "CHECK")
       SET(_is_check ON)


Travis clang fix

Travis clang fix

--- src/CMake/BoostConfig.cmake
+++ src/CMake/BoostConfig.cmake
@@ -1,21 +1,21 @@
 #  For more information, please see: http://software.sci.utah.edu
-#
+#
 #  The MIT License
-#
+#
 #  Copyright (c) 2015 Scientific Computing and Imaging Institute,
 #  University of Utah.
-#
-#
+#
+#
 #  Permission is hereby granted, free of charge, to any person obtaining a
 #  copy of this software and associated documentation files (the "Software"),
 #  to deal in the Software without restriction, including without limitation
 #  the rights to use, copy, modify, merge, publish, distribute, sublicense,
 #  and/or sell copies of the Software, and to permit persons to whom the
 #  Software is furnished to do so, subject to the following conditions:
-#
+#
 #  The above copyright notice and this permission notice shall be included
-#  in all copies or substantial portions of the Software.
-#
+#  in all copies or substantial portions of the Software.
+#
 #  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 #  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 #  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -52,6 +52,11 @@

   IF(BUILD_WITH_PYTHON)
     ADD_DEFINITIONS(-DBOOST_PYTHON_STATIC_LIB=1)
+  ENDIF()
+
+  # for travis clang builds--need a narrower test
+  IF(UNIX)
+    ADD_DEFINITIONS(-DBOOST_NO_CXX11_ALLOCATOR)
   ENDIF()

   # TODO: set up 64-bit build detection
@@ -109,10 +114,10 @@
 #            -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
 #            -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
 #            -DCMAKE_ANSI_CFLAGS:STRING="${jpeg_pic}"
-#    )
+#    )
   ENDIF()

-  #  EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR)
+  #  EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR)

   #  IF (${BLDTYPE} MATCHES "Debug")
   #    IF (WIN32 AND NOT MINGW)
@@ -191,4 +196,3 @@

 ENDMACRO()
-


Add CTest files

Add CTest files

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,5 +1,5 @@
 set(CTEST_PROJECT_NAME "ProjectC")
 set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "open.cdash.org")
-set(CTEST_DROP_LOCATION "submit.php?project=PublicDashboard")
+set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
 set(CTEST_DROP_SITE_CDASH TRUE)


refs #4871 use lex1:8080 to submit results to, lets us use /etc/hosts to submit from other machines

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@49611 c7de825b-a66e-492c-adef-691d508d4ae1

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -8,6 +8,6 @@
 set(CTEST_NIGHTLY_START_TIME "23:59:00 EDT")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "192.168.1.114")
+set(CTEST_DROP_SITE "lex1:8080")
 set(CTEST_DROP_LOCATION "/CDash/submit.php?project=tokudb")
 set(CTEST_DROP_SITE_CDASH TRUE)


cmake: remove FindQt5 module

cmake: remove FindQt5 module

Qt5 ships with a Qt5Config.cmake file itself, so a FindQt5.cmake file is
not necessary.

--- src/cmake/Modules/FindQt5.cmake
+++ src/cmake/Modules/FindQt5.cmake
@@ -1,63 +0,0 @@
-
-if (CMAKE_VERSION VERSION_LESS 2.8.9)
-    message(FATAL_ERROR "Qt5 requires at least CMake version 2.8.9")
-endif()
-
-if (NOT Qt5_FIND_COMPONENTS)
-    set(Qt5_NOT_FOUND_MESSAGE "The Qt5 package requires at least one component (${Qt5_FIND_COMPONENTS})")
-    set(Qt5_FOUND False)
-    return()
-endif()
-
-set(_Qt5_FIND_PARTS_REQUIRED)
-if (Qt5_FIND_REQUIRED)
-    set(_Qt5_FIND_PARTS_REQUIRED REQUIRED)
-endif()
-set(_Qt5_FIND_PARTS_QUIET)
-if (Qt5_FIND_QUIETLY)
-    set(_Qt5_FIND_PARTS_QUIET QUIET)
-endif()
-
-if (NOT QT_QMAKE_EXECUTABLE)
-    set(QT_QMAKE_EXECUTABLE qmake)
-endif (NOT QT_QMAKE_EXECUTABLE)
-#MESSAGE("QT_QMAKE_EXECUTABLE='${QT_QMAKE_EXECUTABLE}'")
-
-# verify qt version
-EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QT_VERSION)
-#MESSAGE("QT_VERSION='${QT_VERSION}'")
-if (NOT QT_VERSION MATCHES "5.*")
-    set(Qt5_FOUND FALSE)
-    message(FATAL_ERROR "CMake was unable to find Qt5, put qmake in your path or set QT_QMAKE_EXECUTABLE.")
-  return()
-endif (NOT QT_VERSION MATCHES "5.*")
-
-EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_PLUGINS" OUTPUT_VARIABLE QT_INSTALL_PLUGINS)
-EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_BINS" OUTPUT_VARIABLE QT_INSTALL_BINS)
-EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_LIBS" OUTPUT_VARIABLE QT_INSTALL_LIBS)
-#message("QT_INSTALL_LIBS='${QT_INSTALL_LIBS}'")
-
-get_filename_component(_qt5_install_prefix "${QT_INSTALL_LIBS}/cmake" ABSOLUTE)
-
-set(_Qt5_NOTFOUND_MESSAGE)
-
-foreach(module ${Qt5_FIND_COMPONENTS})
-    find_package(Qt5${module}
-        ${_Qt5_FIND_PARTS_QUIET}
-        ${_Qt5_FIND_PARTS_REQUIRED}
-        PATHS "${_qt5_install_prefix}" NO_DEFAULT_PATH
-    )
-    if (NOT Qt5${module}_FOUND)
-        if (Qt5_FIND_REQUIRED_${module})
-            set(_Qt5_NOTFOUND_MESSAGE "${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \"${module}\" config file at \"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\"\n")
-        elseif(NOT Qt5_FIND_QUIETLY)
-            message(WARNING "Failed to find Qt5 component \"${module}\" config file at \"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\"")
-        endif()
-    endif()
-endforeach()
-
-if (_Qt5_NOTFOUND_MESSAGE)
-    set(Qt5_NOT_FOUND_MESSAGE "${_Qt5_NOTFOUND_MESSAGE}")
-    set(Qt5_FOUND False)
-endif()
-


[FIX] Using more strict GCC flags.

[FIX] Using more strict GCC flags.

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

--- util/cmake/FindSeqAn.cmake
+++ util/cmake/FindSeqAn.cmake
@@ -192,9 +192,9 @@
   # mainly important for 64 bit but does not get into the way on 32 bit either
   # at minimal performance impact.
   if (CMAKE_BUILD_TYPE STREQUAL Debug)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer")
+    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} ${SEQAN_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer")
   elseif (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS_RELEASE} -g -fno-omit-frame-pointer")
+    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} ${SEQAN_CXX_FLAGS_RELEASE} -g -fno-omit-frame-pointer")
   endif ()
 endif ()


matviz: Use the install rules branch

matviz: Use the install rules branch

--- versions.cmake
+++ versions.cmake
@@ -27,5 +27,5 @@
   GIT_TAG 4386042d5d7ef7b7cac12e96660a7dc5a6c5191a) # lookup_table_cleanup

 add_revision(matviz
-  GIT_REPOSITORY https://github.com/cryos/matviz
-  GIT_TAG master)
+  GIT_REPOSITORY https://github.com/mathstuf/matviz
+  GIT_TAG 1d5045b60dbf289a3b021d3f49bee5ccbc783c23) # install rules


Update ParaView

Update ParaView

--- versions.cmake
+++ versions.cmake
@@ -64,7 +64,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "b98aa36a5618c736f7236d221d3bfe04cf7016da")
+  set(_paraview_revision "2cab5606b2ac634e9d7b90595f1f0f906a2c2616")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Add compile flag

Add compile flag

--- CI/main_ci.cmake
+++ CI/main_ci.cmake
@@ -11,7 +11,7 @@
 set (PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}")
 # number of thread used for compilation
 set (CTEST_BUILD_FLAGS "-j8")
-set (CTEST_BUILD_COMMAND "make")
+set (CTEST_BUILD_COMMAND "make ${CTEST_BUILD_FLAGS}")

 set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
 set (CTEST_BUILD_NAME "CI_TEST")


bump version to 0.2.0

bump version to 0.2.0

--- src/CPackConfig.cmake
+++ src/CPackConfig.cmake
@@ -3,8 +3,8 @@
 set(CPACK_PACKAGE_NAME "libtmx0")

 set(CPACK_PACKAGE_VERSION_MAJOR "0")
-set(CPACK_PACKAGE_VERSION_MINOR "1")
-set(CPACK_PACKAGE_VERSION_PATCH "2")
+set(CPACK_PACKAGE_VERSION_MINOR "2")
+set(CPACK_PACKAGE_VERSION_PATCH "0")
 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libtmx")


Final Debug:defined cli Modules Directory

--- AutoTract.cmake
+++ AutoTract.cmake
@@ -20,11 +20,20 @@
   find_package(Slicer REQUIRED)
   include(${Slicer_USE_FILE})
   resetForSlicer( NAMES CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS )
+
+
+  set(INSTALL_RUNTIME_DESTINATION ${Slicer_CLIMODULES_BIN_DIR})
+  set(INSTALL_LIBRARY_DESTINATION ${Slicer_CLIMODULES_LIB_DIR})
+  set(INSTALL_ARCHIVE_DESTINATION ${Slicer_CLIMODULES_LIB_DIR})
+
 endif()

 SETIFEMPTY( ARCHIVE_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/lib/static )
 SETIFEMPTY( LIBRARY_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/lib )
 SETIFEMPTY( RUNTIME_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin )
+
+
+message(STATUS "DDDDD${INSTALL_RUNTIME_DESTINATION}")

 SETIFEMPTY(INSTALL_RUNTIME_DESTINATION bin)
 SETIFEMPTY(INSTALL_LIBRARY_DESTINATION lib)


Fix superbuild

Fix superbuild

--- superbuild/Superbuild.cmake
+++ superbuild/Superbuild.cmake
@@ -37,11 +37,6 @@
   list( APPEND ITKExamples_DEPENDENCIES BREATHE )
 endif()

-if(NOT ITKDoxygenXML_DIR )
-  include( ${CMAKE_SOURCE_DIR}/../cmake/External-ITKDoxygenXML.cmake )
-  list( APPEND ITKExamples_DEPENDENCIES ITKDoxygenXML )
-endif()
-
 ExternalProject_Add( ITK_EXAMPLES
   DEPENDS ${ITKExamples_DEPENDENCIES}
   DOWNLOAD_COMMAND ""


CR #87

CR #87

--- DoxygenRule.cmake
+++ DoxygenRule.cmake
@@ -61,5 +61,5 @@
     DEPENDS doxycopy)
 else()
   add_custom_target(doxygit
-    COMMENT "doxygit target not available, missiing GIT_DOCUMENTATION_REPO")
+    COMMENT "doxygit target not available, missing GIT_DOCUMENTATION_REPO")
 endif()


BUG: Github URLs don't work with http, need https

Only affects users who can't use git:// URLs

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -20,7 +20,7 @@
 option(${CMAKE_PROJECT_NAME}_USE_GIT_PROTOCOL "If behind a firewall turn this off to use http instead." ON)
 set(git_protocol "git")
 if(NOT ${CMAKE_PROJECT_NAME}_USE_GIT_PROTOCOL)
-  set(git_protocol "http")
+  set(git_protocol "https")
 endif()

 find_package(Git REQUIRED)


COMP: In Superbuild.cmake, ZMQ_DIR and OpenIGTLink_DIR are passed to CTK

Also updated few comments

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -204,12 +204,14 @@
     -DCTK_CXX_FLAGS:STRING=${CTK_CXX_FLAGS}
     -DCTK_C_FLAGS:STRING=${CTK_C_FLAGS}
     -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+	  -DZMQ_DIR:PATH=${ZMQ_DIR}                     # FindVTK expects VTK_DIR variable to be defined
+	  -DOpenIGTLink_DIR:PATH=${OpenIGTLink_DIR}     # FindOpenIGTLink expects OpenIGTLink_DIR variable to be defined
     -DCTK_KWSTYLE_EXECUTABLE:FILEPATH=${CTK_KWSTYLE_EXECUTABLE}
-    -DDCMTK_DIR:PATH=${DCMTK_DIR} # FindDCMTK expects DCMTK_DIR
-    -DVTK_DIR:PATH=${VTK_DIR}     # FindVTK expects VTK_DIR
-    -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}    # FindPythonQt expects PYTHON_INCLUDE_DIR
-    -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}        # FindPythonQt expects PYTHON_LIBRARY
-    -DPYTHONQT_INSTALL_DIR:PATH=${PYTHONQT_INSTALL_DIR} # FindPythonQt expects PYTHONQT_INSTALL_DIR
+    -DDCMTK_DIR:PATH=${DCMTK_DIR} # FindDCMTK expects DCMTK_DIR variable to be defined
+    -DVTK_DIR:PATH=${VTK_DIR}     # FindVTK expects VTK_DIR variable to be defined
+    -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}    # FindPythonQt expects PYTHON_INCLUDE_DIR variable to be defined
+    -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}        # FindPythonQt expects PYTHON_LIBRARY variable to be defined
+    -DPYTHONQT_INSTALL_DIR:PATH=${PYTHONQT_INSTALL_DIR} # FindPythonQt expects PYTHONQT_INSTALL_DIR variable to be defined
     -Dlog4cpp_DIR:PATH=${log4cpp_DIR} # Findlog4cpp expects a log4cpp_DIR variable to be defined
   SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
   BINARY_DIR ${CMAKE_BINARY_DIR}/CTK-build


Remove openmp from projects list that is actually built

Summary: Windows is loking for project files but openmp sould not be built. Analogous to python.

Test Plan: Covered by current tests

Reviewers: O1 MITK Core, kislinsk

Reviewed By: O1 MITK Core, kislinsk

Maniphest Tasks: T25420

Differential Revision: https://phabricator.mitk.org/D176

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -53,6 +53,7 @@
 get_property(external_projects GLOBAL PROPERTY MITK_EXTERNAL_PROJECTS)

 list(REMOVE_ITEM external_projects Python)
+list(REMOVE_ITEM external_projects OpenMP)
 if(MITK_CTEST_SCRIPT_MODE)
   # Write a file containing the list of enabled external project targets.
   # This file can be read by a ctest script to separately build projects.


Bump TubTK so VesselView works with the latest TubeTK-experiments scripts

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
-    GIT_TAG "9dfe9f71e45b5bcdb4812b83a2be48f911ab8dd0"
+    GIT_TAG "b8970626ab008d4daf81841b27906a423a1017fe"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


Replace escaped \n characters in macros

Replace escaped \n characters in macros

Cmake goes nuts

--- cmake/CoverallsGenerateGcov.cmake
+++ cmake/CoverallsGenerateGcov.cmake
@@ -261,11 +261,13 @@

 	# Loads the gcov file as a list of lines.
 	# (We first open the file and replace all occurences of [] with _
-	#  because CMake will fail to parse a line containing unmatched brackets...)
+	#  because CMake will fail to parse a line containing unmatched brackets...
+	#  also the \ to escaped \n in macros screws up things.)
 	# https://public.kitware.com/Bug/view.php?id=15369
 	file(READ ${GCOV_FILE} GCOV_CONTENTS)
 	string(REPLACE "[" "_" GCOV_CONTENTS "${GCOV_CONTENTS}")
 	string(REPLACE "]" "_" GCOV_CONTENTS "${GCOV_CONTENTS}")
+	string(REPLACE "\\" "_" GCOV_CONTENTS "${GCOV_CONTENTS}")
 	file(WRITE ${GCOV_FILE}_tmp "${GCOV_CONTENTS}")

 	file(STRINGS ${GCOV_FILE}_tmp GCOV_LINES)


added avr-reset target (to reset the board)

--- cmake/avr-arduino-toolchain.cmake
+++ cmake/avr-arduino-toolchain.cmake
@@ -60,6 +60,9 @@
 add_definitions(-DMCU=${MCU})
 add_definitions(-DF_CPU=${F_CPU})
 add_definitions(-DBAUD=${BAUD})
+
+# add a reset command using avrdude
+add_custom_target(avr-reset COMMAND ${AVRDUDE} -c${PROGRAMMER} -p${MCU})

 # we need a little function to add multiple targets
 function(add_executable_avr NAME)


hopefully fixed the cmake issue

hopefully fixed the cmake issue

--- cmake/avr-arduino-toolchain.cmake
+++ cmake/avr-arduino-toolchain.cmake
@@ -119,7 +119,7 @@
 endif()

 # only prepare the toolchain
-if( DEFINED ARDUINO_SDK_PATH AND IS_DIRECTORY ${ARDUINO_SDK_PATH})
+if(NOT(TARGET arduin-core) AND DEFINED ARDUINO_SDK_PATH AND IS_DIRECTORY ${ARDUINO_SDK_PATH})
     # set the paths
     set(ARDUINO_CORES_PATH ${ARDUINO_SDK_PATH}/hardware/arduino/avr/cores/arduino)
     set(ARDUINO_VARIANTS_PATH ${ARDUINO_SDK_PATH}/hardware/arduino/avr/variants/standard)
@@ -162,12 +162,10 @@
             endif()
         endif()
     endforeach()
-
-    set(ARDUINO_SDK_FOUND TRUE CACHE BOOLEAN "whether the Arduino IDE/SDK is found and configured")
 endif()

 function(add_sketches SKETCHES_PATH)
-    if(DEFINED ARDUINO_SDK_FOUND)
+    if(TARGET arduino-core)
         # finally add all the sketches
         file(GLOB SRC_DIRS "${SKETCHES_PATH}/*/CMakeLists.txt")
         foreach(cmakedir ${SRC_DIRS})
@@ -186,7 +184,7 @@
 set(SKETCH_LIBS "" CACHE INTERNAL "arduino sketch libraries")
 # add a sketch dependency by giving the target and a git url
 function(target_sketch_library TARGET NAME URL)
-    if(DEFINED ARDUINO_SDK_FOUND)
+    if(TARGET arduino-core)
         if(NOT TARGET ${NAME})
             # try to install dependent libraries
             find_package(Git)


[CMake] Fix generated Xcode-project ignoring output directory setting for LLDB.framework

Other generators honor the `LIBRARY_OUTPUT_DIRECTORY` target property, but apparently Xcode doesn't. So we call `set_output_directory()` as `llvm_add_library()` would do and this works.
Note that `LIBRARY_OUTPUT_DIRECTORY` is still necessary, because it's used to store and read the target's absolute build directory (while `LLDB_FRAMEWORK_BUILD_DIR` is relative!).

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

--- cmake/modules/LLDBFramework.cmake
+++ cmake/modules/LLDBFramework.cmake
@@ -24,6 +24,12 @@
   MACOSX_FRAMEWORK_BUNDLE_VERSION ${LLDB_VERSION}
   MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${LLDB_VERSION}
   MACOSX_FRAMEWORK_INFO_PLIST ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist.in
+)
+
+# Defined in AddLLVM.cmake; handles edge cases for multi-config generators
+set_output_directory(liblldb
+  BINARY_DIR ${framework_target_dir}
+  LIBRARY_DIR ${framework_target_dir}
 )

 # Affects the layout of the framework bundle (default is macOS layout).


Build the test binary in the test folder.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -1113,6 +1113,8 @@
   # Get the component from the path. Eg. core to form coreTests test suite name.
   ROOT_PATH_TO_STRING(test_name ${CMAKE_CURRENT_SOURCE_DIR}/Tests/)
   ROOT_ADD_GTEST(${test_name} ${test_files} ${ARGN})
+  # Override the target output folder for to put the binaries in the ${subdir}.
+  set_property(TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${subdir}/)
 endfunction()

 #----------------------------------------------------------------------------
@@ -1128,11 +1130,12 @@
   # FIXME: For better coherence we could restrict the libraries the test suite could link
   # against. For example, tests in Core should link only against libCore. This could be tricky
   # to implement because some ROOT components create more than one library.
-  ROOT_EXECUTABLE(${test_suite} NOINSTALL ${source_files} LIBRARIES ${ARG_LIBRARIES})
+  ROOT_EXECUTABLE(${test_suite} ${source_files} LIBRARIES ${ARG_LIBRARIES})
+  set_property(TARGET ${test_suite} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
   target_link_libraries(${test_suite} gtest gtest_main gmock gmock_main)

   ROOT_PATH_TO_STRING(mangled_name ${test_suite} PATH_SEPARATOR_REPLACEMENT "-")
-  ROOT_ADD_TEST(gtest${mangled_name} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${test_suite})
+  ROOT_ADD_TEST(gtest${mangled_name} COMMAND ${test_suite})
 endfunction()


Added RUN_SERIAL option to ROOT_ADD_TEST(...). Implements ROOT-8383

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -711,6 +711,7 @@
 #                        [OUTPUT outfile] [ERROR errfile] [INPUT infile]
 #                        [ENVIRONMENT var1=val1 var2=val2 ...
 #                        [DEPENDS test1 ...]
+#                        [RUN_SERIAL]
 #                        [TIMEOUT seconds]
 #                        [DEBUG]
 #                        [SOURCE_DIR dir] [BINARY_DIR dir]
@@ -720,7 +721,7 @@
 #                        [PASSRC code])
 #
 function(ROOT_ADD_TEST test)
-  CMAKE_PARSE_ARGUMENTS(ARG "DEBUG;WILLFAIL;CHECKOUT;CHECKERR"
+  CMAKE_PARSE_ARGUMENTS(ARG "DEBUG;WILLFAIL;CHECKOUT;CHECKERR;RUN_SERIAL"
                             "TIMEOUT;BUILD;INPUT;OUTPUT;ERROR;SOURCE_DIR;BINARY_DIR;WORKING_DIR;PROJECT;PASSRC"
                              "COMMAND;COPY_TO_BUILDDIR;DIFFCMD;OUTCNV;OUTCNVCMD;PRECMD;POSTCMD;ENVIRONMENT;COMPILEMACROS;DEPENDS;PASSREGEX;OUTREF;ERRREF;FAILREGEX;LABELS"
                             ${ARGN})
@@ -904,6 +905,10 @@
     set_tests_properties(${test} PROPERTIES LABELS "${ARG_LABELS}")
   endif()

+  if(ARG_RUN_SERIAL)
+    set_property(TEST ${test} PROPERTY RUN_SERIAL true)
+  endif()
+
 endfunction()

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


unify octomap script between 1.5 and master

--- cmakemodules/script_octomap.cmake
+++ cmakemodules/script_octomap.cmake
@@ -34,9 +34,16 @@

 		# Include embedded version headers:
 		include(ExternalProject)
-		# download from GH
+
+		# download from GH or use embedded ZIPed version (used only for old Ubuntu PPAs):
+		IF (EXISTS "${MRPT_SOURCE_DIR}/otherlibs/octomap.zip")
+			SET(OCTOMAP_EP_URL "${MRPT_SOURCE_DIR}/otherlibs/octomap.zip")
+		ELSE()
+			SET(OCTOMAP_EP_URL "https://github.com/MRPT/octomap/archive/devel.zip")
+		ENDIF()
+
 		ExternalProject_Add(EP_octomap
-		  URL               "https://github.com/MRPT/octomap/archive/devel.zip" #TO-DO: Switch back to original repo after next stable release.
+		  URL               "${OCTOMAP_EP_URL}" #TO-DO: Switch back to original repo after next stable release.
 		  SOURCE_DIR        "${MRPT_BINARY_DIR}/otherlibs/octomap/"
 		  CMAKE_ARGS
 			-DBUILD_TESTING=OFF


ENH: Bump TubeTK to version that removes ArrayFire (replaced by cufft)

Also enables building TubeTK's applications.

--- Modules/Remote/TubeTK.remote.cmake
+++ Modules/Remote/TubeTK.remote.cmake
@@ -11,11 +11,11 @@
 #--
 #-- ## Compliance Level 4 star (Very high-quality code, perhaps small community dependance)
 #--   - [ ] Meets all ITK code style standards
-#--   - [ ] No external requirements beyond those needed by ITK proper
-#--   - [ ] Builds and passes tests on all supported platforms within 1 month of each core tagged release
-#--            - [ ] Windows Shared Library Build with Visual Studio
-#--            - [ ] Mac with clang compiller
-#--            - [ ] Linux with gcc compiler
+#--   - [X] No external requirements beyond those needed by ITK proper
+#--   - [X] Builds and passes tests on all supported platforms within 1 month of each core tagged release
+#--            - [X] Windows Shared Library Build with Visual Studio
+#--            - [X] Mac with clang compiller
+#--            - [X] Linux with gcc compiler
 #--   - [X] Active developer community dedicated to maintaining code-base
 #--   - [ ] 75% code coverage demonstrated for testing suite
 #--   - [X] Continuous integration testing performed
@@ -49,5 +49,5 @@
 "
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTubeTK.git
-  GIT_TAG "d9f08724e7b6fa275f501c91bc07d46fd4615e58"
+  GIT_TAG "08f29e55cc0384855d8d2c70b2628c405a7c25d2"
   )


fix boroken OSX build

fix boroken OSX build

--- thirdparty/thirdparty.cmake
+++ thirdparty/thirdparty.cmake
@@ -660,12 +660,16 @@
         WORKING_DIRECTORY ${thirdparties_deflate_directory})
     endif()

+    if(NOT APPLE)
+      # todo: OSX build fails when Nova is found. I think it needs the include dir
+      # punting for now to get the build un-broken
     # Nova is required for sidereal time computation with Indi driver that not report it.
     # This is not critical if it is not present but the hour angle computation will be wrong.
     find_package(Nova)
     if(NOVA_FOUND)
       add_definitions("-DLIBNOVA")
       set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${NOVA_LIBRARIES})
+    endif()
     endif()

     # warning: copied from the indi CMakeLists.txt. This should be updated when


Fix inter-package dependencies

Fix inter-package dependencies

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[x] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation

--- UploadPPA.cmake
+++ UploadPPA.cmake
@@ -1,6 +1,6 @@
 ##
 # Copyright (c) 2010 Daniel Pfeifer <daniel@pfeifer-mail.de>
-#               2011 Stefan Eilemann <eile@eyescale.ch>
+#               2011-2012 Stefan Eilemann <eile@eyescale.ch>
 #
 #  sudo apt-get install devscripts
 ##
@@ -85,14 +85,14 @@
     file(APPEND ${DEBIAN_CONTROL} "${PACKAGE}, ")
   endforeach()

-  file(APPEND ${DEBIAN_CONTROL} "${CPACK_DEBIAN_PACKAGE_DEPENDS}\n"
+  file(APPEND ${DEBIAN_CONTROL} "\n"
     "Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n"
     "${DEB_LONG_DESCRIPTION}"
     )

   foreach(COMPONENT ${CPACK_COMPONENTS_ALL})
     string(TOUPPER ${COMPONENT} UPPER_COMPONENT)
-    set(DEPENDS "${CPACK_DEBIAN_PACKAGE_NAME}")
+    set(DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}")
     foreach(DEP ${CPACK_COMPONENT_${UPPER_COMPONENT}_DEPENDS})
       set(DEPENDS "${DEPENDS}, ${CPACK_DEBIAN_PACKAGE_NAME}-${DEP}")
     endforeach(DEP ${CPACK_COMPONENT_${UPPER_COMPONENT}_DEPENDS})


Refactoring tbag_protobuf__generate_py() cmake method.

--- cmake/TbagFindPackage/FindTbagProtobuf.cmake
+++ cmake/TbagFindPackage/FindTbagProtobuf.cmake
@@ -107,7 +107,7 @@
     tbag_protobuf__generate ("${__sources}" "${__headers}" cpp "${__protos}")
 endmacro ()

-macro (tbag_protobuf__generate_py __sources __headers __protos)
-    tbag_protobuf__generate ("${__sources}" "${__headers}" python "${__protos}")
+macro (tbag_protobuf__generate_py __sources __protos)
+    tbag_protobuf__generate ("${__sources}" __unused_header__ python "${__protos}")
 endmacro ()


BUG: Fix FindKWStyle crash when kwstyle returns empty version info

One of the dashboard machines has a version of KWStyle which returns
only an empty string or whitespace in response to "kwstyle -version". The
cause of this is unknown, but this commit will prevent FindKWStyle.cmake
from crashing in this case.

Change-Id: I093e17642d5a2ed26bb1e4be1960ce66664da787

--- CMake/FindKWStyle.cmake
+++ CMake/FindKWStyle.cmake
@@ -31,12 +31,19 @@
     ERROR_QUIET
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-  string(REPLACE
-    "Version: "
-    ""
-    KWSTYLE_VERSION_STRING
-    ${KWSTYLE_VERSION_STRING}
-    )
+  if(KWSTYLE_VERSION_STRING)
+    # string(REPLACE ..) fails if the input is an empty string
+    string(REPLACE
+      "Version: "
+      ""
+      KWSTYLE_VERSION_STRING
+      ${KWSTYLE_VERSION_STRING}
+      )
+  else(KWSTYLE_VERSION_STRING)
+    # CMake's find_package_handle_standard_args has a bug where the
+    # version empty string ("") is always acceptable
+    set(KWSTYLE_VERSION_STRING "?")
+  endif(KWSTYLE_VERSION_STRING)
 endif(KWSTYLE_EXECUTABLE)

 include(FindPackageHandleStandardArgs)


Added if () block to avoid script variables set to NOT-Found being used in searching

git-svn-id: aa838dfc23441284dd616281de4245daec5d2135@14624 16af8721-9629-0410-8352-f15c8da7e697

--- CMakeModules/FindGLIB.cmake
+++ CMakeModules/FindGLIB.cmake
@@ -83,54 +83,60 @@
     )
 endif()

-set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
+if (GLIBCONFIG_INCLUDE_DIR)

-# Version detection
-file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
-string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
-set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
-string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
-set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
-string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
-set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
-set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
+    set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})

-# Additional Glib components.  We only look for libraries, as not all of them
-# have corresponding headers and all headers are installed alongside the main
-# glib ones.
-foreach (_component ${GLIB_FIND_COMPONENTS})
-    if (${_component} STREQUAL "gio")
-        find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
-        set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
-    elseif (${_component} STREQUAL "gobject")
-        find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
-        set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
-    elseif (${_component} STREQUAL "gmodule")
-        find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
-        set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
-    elseif (${_component} STREQUAL "gthread")
-        find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
-        set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
-    elseif (${_component} STREQUAL "gio-unix")
-        # gio-unix is compiled as part of the gio library, but the include paths
-        # are separate from the shared glib ones. Since this is currently only used
-        # by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
-        pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
-    endif ()
-endforeach ()
+    # Version detection
+    file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
+    string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+    set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
+    string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+    set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
+    string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+    set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
+    set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")

-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
-                                       VERSION_VAR   GLIB_VERSION)
+    # Additional Glib components.  We only look for libraries, as not all of them
+    # have corresponding headers and all headers are installed alongside the main
+    # glib ones.
+    foreach (_component ${GLIB_FIND_COMPONENTS})
+        if (${_component} STREQUAL "gio")
+            find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+            set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
+        elseif (${_component} STREQUAL "gobject")
+            find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+            set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
+        elseif (${_component} STREQUAL "gmodule")
+            find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+            set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
+        elseif (${_component} STREQUAL "gthread")
+            find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+            set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
+        elseif (${_component} STREQUAL "gio-unix")
+            # gio-unix is compiled as part of the gio library, but the include paths
+            # are separate from the shared glib ones. Since this is currently only used
+            # by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
+            pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
+        endif ()
+    endforeach ()

-mark_as_advanced(
-    GLIBCONFIG_INCLUDE_DIR
-    GLIB_GIO_LIBRARIES
-    GLIB_GIO_UNIX_LIBRARIES
-    GLIB_GMODULE_LIBRARIES
-    GLIB_GOBJECT_LIBRARIES
-    GLIB_GTHREAD_LIBRARIES
-    GLIB_INCLUDE_DIR
-    GLIB_INCLUDE_DIRS
-    GLIB_LIBRARIES
-)
+    include(FindPackageHandleStandardArgs)
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
+                                        VERSION_VAR   GLIB_VERSION)
+
+    mark_as_advanced(
+        GLIBCONFIG_INCLUDE_DIR
+        GLIB_GIO_LIBRARIES
+        GLIB_GIO_UNIX_LIBRARIES
+        GLIB_GMODULE_LIBRARIES
+        GLIB_GOBJECT_LIBRARIES
+        GLIB_GTHREAD_LIBRARIES
+        GLIB_INCLUDE_DIR
+        GLIB_INCLUDE_DIRS
+        GLIB_LIBRARIES
+    )
+
+else()
+
+endif ()


ctest: document the intention here

ctest: document the intention here

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- test.cmake
+++ test.cmake
@@ -295,6 +295,8 @@
          ctest_submit(PARTS Update)
       endif()
    endif()
+
+   # enter the following section for Continuous builds only if the CTEST_UPDATE above found changes
    if(NOT ${dashboard_model} STREQUAL "Continuous" OR res GREATER 0)
       if("${COMPILER_VERSION}" MATCHES "(g\\+\\+|GCC|Open64).*4\\.[01234567]\\.")
          file(WRITE "${CTEST_BINARY_DIRECTORY}/abort_reason" "Compiler too old for C++11: ${COMPILER_VERSION}")


remove Qt5*_EXECUTABLE_COMPILE_FLAG

remove Qt5*_EXECUTABLE_COMPILE_FLAG

as it is useless and causes errors with old compilers

--- manageQt5.cmake
+++ manageQt5.cmake
@@ -39,7 +39,7 @@
       message("Adding module ${_module}")
       set(Qt5_INCLUDES ${Qt5_INCLUDES} ${Qt5${_module}_INCLUDE_DIRS} )
       set(Qt5_LIBRARIES ${Qt5_LIBRARIES} ${Qt5${_module}_LIBRARIES} )
-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5${_module}_EXECUTABLE_COMPILE_FLAGS}")
+      #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5${_module}_EXECUTABLE_COMPILE_FLAGS}")
     endforeach()
   endif()
 endmacro()


fixed: typo

fixed: typo

--- share/hugh/cmake/SetupDocumentation.cmake
+++ share/hugh/cmake/SetupDocumentation.cmake
@@ -46,7 +46,7 @@
     COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_CFG_FILE}
     SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_CFG_FILE}
             ${CMAKE_CURRENT_BINARY_DIR}/${CFG_FILE_NAME}
-    COMMENT "Buidling developer documentation")
+    COMMENT "Building developer documentation")

   # build before install
   install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build . --target devdoc)")
@@ -85,7 +85,7 @@
     COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_CFG_FILE}
     SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_CFG_FILE}
             ${CMAKE_CURRENT_BINARY_DIR}/${CFG_FILE_NAME}
-    COMMENT "Buidling user documentation")
+    COMMENT "Building user documentation")

   # build before install
   install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build . --target usrdoc)")


removed -Wpointer-bool-conversion parameter from clang

Not compatible with clang-3.4 on ubuntu 14.04

--- modules/worldengine/nucleus/src/cmake/compiler/clang/settings.cmake
+++ modules/worldengine/nucleus/src/cmake/compiler/clang/settings.cmake
@@ -16,5 +16,5 @@

 # -Wno-narrowing needed to suppress a warning in g3d
 # -Wno-deprecated-register -Wstring-plus-int -Wpointer-bool-conversion are needed to suppress gsoap warnings on Unix systems.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register -Wstring-plus-int -Wpointer-bool-conversion -Wparentheses")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register -Wstring-plus-int -Wparentheses")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG=1")


Now building with DLL CRT on windows

Now building with DLL CRT on windows

--- CMakeModules/CompilerSettings.cmake
+++ CMakeModules/CompilerSettings.cmake
@@ -18,8 +18,11 @@
 ENDIF()

 IF(MSVC)
-	SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} /MT")
-	SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /MT")
+	#These are used to be compatible with Klampt
+	SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} /MD")
+	SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /MD")
+	SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} /MDd")
+	SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /MDd")
 ENDIF()

 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")


Appends enabled plugins list to plugins variable

Also changes from fn_ENABLEDPLIGINS to fn_ENABLEDPLUGINS

--- tests/JavascriptTests.cmake
+++ tests/JavascriptTests.cmake
@@ -124,7 +124,7 @@
     set(testname "web_client_${fn_PLUGIN}.${case}")
     set(plugins ${fn_PLUGIN})
   else()
-    set(plugins '')
+    set(plugins "")
   endif()

   if(fn_ASSETSTORE)
@@ -140,7 +140,7 @@
   endif()

   if(fn_ENABLEDPLUGINS)
-    set(plugins ${fn_ENABLEDPLIGINS})
+    list(APPEND plugins ${fn_ENABLEDPLUGINS})
   endif()

   add_test(


TEST: configure test depends

TEST: configure test depends

--- Packaging/testing.cmake
+++ Packaging/testing.cmake
@@ -43,7 +43,7 @@

 add_test(
-  NAME build_examples
+  NAME Tu_build_examples
   COMMAND ${CMAKE_COMMAND}
   -DSRC_DIR=${CMAKE_SOURCE_DIR}/../Examples
   -P ${pkg_extracted_dir}/tools/build_example.cmake
@@ -51,12 +51,16 @@
   )

 add_test(
-  NAME Tu_uninstall_otb
+  NAME Tu_uninstallOTB
   COMMAND ${pkg_extracted_dir}/tools/uninstall_otb${my_ext}
   WORKING_DIRECTORY ${testing_dir}
   )

+#configure test dependencies..
+set_tests_properties ( Tu_selftester PROPERTIES DEPENDS Tu_install_package)
+set_tests_properties ( Tu_build_examples PROPERTIES DEPENDS Tu_selftester)
+set_tests_properties ( Tu_uninstallOTB PROPERTIES DEPENDS Tu_build_examples)

 #if(UNIX)
   #TODO: add test with shellcheck for script files


Disable some more warnings when compiling with MSVC

--- cmake/modules/DeskvoxHandleOptions.cmake
+++ cmake/modules/DeskvoxHandleOptions.cmake
@@ -27,13 +27,15 @@
     -D_SCL_SECURE_NO_DEPRECATE
     -D_SCL_SECURE_NO_WARNINGS
   )
-
+
   # Disable warning:
   #
   # C4251: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
   # C4275: non-DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
+  # C4481: nonstandard extension used: override specifier 'keyword'
   # C4503: 'identifier' : decorated name length exceeded, name was truncated
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275 /wd4503")
+  # C4512: 'class' : assignment operator could not be generated
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275 /wd4481 /wd4503 /wd4512")

   # Promote to level 1 warnings:
   #


SuperBuild: enable itk shared build on windows

--- SuperBuild/CMake/External_itk.cmake
+++ SuperBuild/CMake/External_itk.cmake
@@ -112,6 +112,10 @@
       -DUSE_FFTWF:BOOL=OFF
       -DUSE_FFTWD:BOOL=OFF
       )
+    if(MSVC AND BUILD_SHARED_LIBS)
+      list(APPEND ITK_SB_CONFIG
+        -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=TRUE)
+    endif()
   else()
     list(APPEND ITK_SB_CONFIG
       -DUSE_FFTWF:BOOL=ON
@@ -123,9 +127,6 @@

   # forward compilation flags
   set(ITK_SB_COMPILATION_FLAGS
-    -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-    -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-    -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
     -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
     -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
     -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}


PKG: add again the OTBFFSforGMM module

PKG: add again the OTBFFSforGMM module

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -131,7 +131,7 @@

 set(OTB_MODULES_CONFIG)
 if(WITH_REMOTE_MODULES)
-  foreach(remote_module SertitObject Mosaic otbGRM)
+  foreach(remote_module SertitObject Mosaic otbGRM OTBFFSforGMM)
     list(APPEND OTB_MODULES_CONFIG -DModule_${remote_module}:BOOL=ON)
   endforeach()
 else()


Add more CMake find related variables including framework options

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -221,7 +221,14 @@
   CMAKE_STRIP_FLAGS

   CMAKE_PREFIX_PATH
+  CMAKE_INCLUDE_PATH
+  CMAKE_LIBRARY_PATH
+  CMAKE_PROGRAM_PATH
+  CMAKE_IGNORE_PATH
+
+  CMAKE_FIND_FRAMEWORK
   CMAKE_FRAMEWORK_PATH
+  CMAKE_SYSTEM_FRAMEWORK_PATH

   CMAKE_DL_LIBS
   CMAKE_THREAD_LIBS_INIT


BUG: Pass system search paths from system build to external builds

This enable the restriction of places searched for distributions
systems such as Homebrew or Anaconda Python to be restricted from
searching the OS system paths.

Change-Id: I697d10bfd345da8c1e3acec259e5685712abbff9

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -198,6 +198,15 @@
   CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO

   CMAKE_STRIP
+
+  CMAKE_PREFIX_PATH
+  CMAKE_FRAMEWORK_PATH
+  CMAKE_SYSTEM_PREFIX_PATH
+  CMAKE_SYSTEM_INCLUDE_PATH
+  CMAKE_SYSTEM_LIBRARY_PATH
+  CMAKE_SYSTEM_PROGRAM_PATH
+  CMAKE_SYSTEM_IGNORE_PATH
+

   CMAKE_GENERATOR
   CMAKE_EXTRA_GENERATOR


Passing more variable from Superbuild to sub projects.

This include variable to valgrid and OSX specific parameters.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -172,6 +172,7 @@
   CMAKE_GENERATOR
   CMAKE_EXTRA_GENERATOR
   MEMORYCHECK_COMMAND_OPTIONS
+  MEMORYCHECK_SUPPRESSIONS_FILE
   MEMORYCHECK_COMMAND
   CMAKE_SHARED_LINKER_FLAGS
   CMAKE_EXE_LINKER_FLAGS
@@ -179,9 +180,17 @@
   SITE
   BUILDNAME )

+if( APPLE )
+  list( APPEND ep_common_list
+    CMAKE_OSX_SYSROOT
+    CMAKE_OSX_DEPLOYMENT_TARGET )
+endif()
+
 VariableListToArgs( ep_common_list ep_common_args )

-list( APPEND ep_common_list CMAKE_OSX_ARCHITECTURES )
+if( APPLE )
+  list( APPEND ep_common_list CMAKE_OSX_ARCHITECTURES )
+endif()
 VariableListToCache( ep_common_list ep_common_cache )

 list( APPEND ep_common_args


ENH: updating SphinxExamples and pointing to GitHub

Change-Id: I9e7f36264663431aa80b3646fa51d11208ab3be5

--- Modules/Remote/SphinxExamples.remote.cmake
+++ Modules/Remote/SphinxExamples.remote.cmake
@@ -1,7 +1,6 @@
 # Contact: Matt McCormick <matt.mccormick@kitware.com>
 itk_fetch_module(SphinxExamples
   "This module builds the examples found at https://itk.org/ITKExamples/"
-  GIT_REPOSITORY https://itk.org/ITKExamples.git
-  # 2016-06-08
-  GIT_TAG b246a37a99b30bca5b890be4a036094d89ae0d52
+  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKExamples.git
+  GIT_TAG 4970ffa55532d80dc01bb553d277288d31a22611
   )


Qt: port linux fix for debian from common-sb

--- projects/qt.cmake
+++ projects/qt.cmake
@@ -26,6 +26,24 @@
 endif()
 set(qt_EXTRA_CONFIGURATION_OPTIONS ""
     CACHE STRING "Extra arguments to be passed to Qt when configuring.")
+
+cmake_dependent_option(qt4_WORK_AROUND_BROKEN_ASSISTANT_BUILD
+  "Work around a build issue in Qt. Use this if you see linker errors with QtHelp and QCLucene." OFF
+    "NOT WIN32" OFF)
+mark_as_advanced(qt4_WORK_AROUND_BROKEN_ASSISTANT_BUILD)
+
+set(qt4_build_commands
+  BUILD_COMMAND   make
+  INSTALL_COMMAND "make install")
+if (qt4_WORK_AROUND_BROKEN_ASSISTANT_BUILD)
+  # This hack is required because Qt's build gets mucked up when we set
+  # LDFLAGS, CXXFLAGS, etc. Installing things makes it work because the files
+  # get placed into the install tree which has rpaths so they get found. Since
+  # it is such a hack, it is an option which off and hidden by default.
+  set(qt4_build_commands
+    BUILD_COMMAND   make install
+    INSTALL_COMMAND "")
+endif ()

 add_external_project_or_use_system(
     qt
@@ -61,6 +79,7 @@
                       ${qt_options}
                       ${qt_EXTRA_CONFIGURATION_OPTIONS}
     ${patch_command}
+    ${qt4_build_commands}
 )

 if ((NOT 64bit_build) AND UNIX AND (NOT APPLE))


added newline at the end of PotgreSQL/hunter.cmake

--- cmake/projects/PostgreSQL/hunter.cmake
+++ cmake/projects/PostgreSQL/hunter.cmake
@@ -24,3 +24,4 @@

 hunter_pick_scheme(DEFAULT url_sha1_autotools)
 hunter_download(PACKAGE_NAME PostgreSQL)
+


Adding support for easybuild modules

Adding support for easybuild modules

Former-commit-id: a73d33d67a15d68dba11af6e6b29536d76283ae3


Fixed OpenSSL library conflict error in civetweb target.

--- external/External.cmake
+++ external/External.cmake
@@ -628,7 +628,7 @@
             SOURCE_DIR "${civetweb_EXT_SOURCE_DIR}"
             CMAKE_ARGS "-DCMAKE_MACOSX_RPATH=${CMAKE_MACOSX_RPATH}"
                        "-DBUILD_SHARED_LIBS=OFF"
-                       "-DCMAKE_C_FLAGS=${EXT_C_FLAGS}"
+                       "-DCMAKE_C_FLAGS=${EXT_C_FLAGS} -I${ressl_EXT_INCLUDE_DIR}"
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"


UNIX fix for PNG

UNIX fix for PNG

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -128,7 +128,6 @@
     PATHS
     /usr/lib
     /usr/local/lib
-    "${VTK_SOURCE_DIR}/IO/PNG"
   )
   FIND_PATH(PNG_INCLUDE_PATH png.h
     /usr/include
@@ -140,7 +139,6 @@
     PATHS
     /usr/lib
     /usr/local/lib
-    "${VTK_SOURCE_DIR}/IO/PNG"
   )
   FIND_PATH(ZLIB_INCLUDE_PATH zlib.h
     /usr/include


deps.dot LF line endings (README.md graph)

hash was different on windows because deps.dot was CRLF
issue https://github.com/smanders/externpro/issues/237

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -633,10 +633,14 @@
   if(EXISTS ${g_READMEsub})
     file(READ ${g_READMEsub} sub)
     file(APPEND ${g_README} ${sub})
+    file(REMOVE ${g_READMEsub})
   endif()
   if(EXISTS ${g_READMEdep})
     file(APPEND ${g_READMEdep} "}\n")
-    file(MD5 ${g_READMEdep} hash)
+    configure_file(${g_READMEdep} ${g_READMEdep}.txt NEWLINE_STYLE LF)
+    file(MD5 ${g_READMEdep}.txt hash)
+    file(READ ${g_READMEdep}.txt depsDotDot)
+    file(REMOVE ${g_READMEdep} ${g_READMEdep}.txt)
     set(user smanders)
     set(branch dev)
     set(mark depgraph_${hash})
@@ -650,7 +654,6 @@
       "<summary></summary>\n"
       "${mark}\n"
       )
-    file(READ ${g_READMEdep} depsDotDot)
     file(APPEND ${g_README}
       "${depsDotDot}"
       "${mark}\n"


XP_GRAPHVIZ options only if 'dot' found

XP_GRAPHVIZ options only if 'dot' found

issue https://github.com/smanders/externpro/issues/344

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1147,59 +1147,63 @@
         endif()
       endif()
     endif() # is a .git repo
-    option(XP_GRAPHVIZ "create a \${CMAKE_BINARY_DIR}/CMakeGraphVizOptions.cmake file" ON)
-    mark_as_advanced(XP_GRAPHVIZ)
-    if(NOT DEFINED XP_GRAPHVIZ_PRIVATE_DEPS)
-      set(NV_GRAPHVIZ_PRIVATE_DEPS ON) # (NV: normal variable)
-    else()
-      set(NV_GRAPHVIZ_PRIVATE_DEPS ${XP_GRAPHVIZ_PRIVATE_DEPS})
-      unset(XP_GRAPHVIZ_PRIVATE_DEPS)
-    endif()
-    cmake_dependent_option(XP_GRAPHVIZ_PRIVATE_DEPS
-      "keep private dependencies in graph" ${NV_GRAPHVIZ_PRIVATE_DEPS}
-      "XP_GRAPHVIZ" ON
-      )
-    mark_as_advanced(XP_GRAPHVIZ_PRIVATE_DEPS)
-    if(XP_GRAPHVIZ)
-      if(NOT XP_GRAPHVIZ_PRIVATE_DEPS)
-        configure_file(${xpThisDir}/graphPvtClean.sh.in graphPvtClean.sh
-          @ONLY NEWLINE_STYLE LF
-          )
-        set(graphPvtClean COMMAND ./graphPvtClean.sh)
-      endif()
-      if(NOT TARGET graph)
-        add_custom_command(OUTPUT graph_cmake
-          COMMAND ${CMAKE_COMMAND} --graphviz=${CMAKE_PROJECT_NAME}.dot .
-	  ${graphPvtClean}
-          COMMAND dot -Tpng -o${CMAKE_PROJECT_NAME}.png ${CMAKE_PROJECT_NAME}.dot
-          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-          COMMENT "Generating ${CMAKE_PROJECT_NAME}.dot and ${CMAKE_PROJECT_NAME}.png..."
-          )
-        add_custom_target(graph SOURCES ${CMAKE_BINARY_DIR}/CMakeGraphVizOptions.cmake DEPENDS graph_cmake)
-        set_property(TARGET graph PROPERTY FOLDER CMakeTargets)
-      endif()
-      set(opts "# Generating Dependency Graphs with CMake\n")
-      set(opts "${opts}# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/Graphviz\n")
-      set(opts "${opts}# https://cmake.org/cmake/help/latest/module/CMakeGraphVizOptions.html\n")
-      set(opts "${opts}# cmake --graphviz=${CMAKE_PROJECT_NAME}.dot ..\n")
-      set(opts "${opts}# dot -Tpng -o${CMAKE_PROJECT_NAME}.png ${CMAKE_PROJECT_NAME}.dot\n")
-      foreach(stringOpt GRAPH_NAME GRAPH_HEADER NODE_PREFIX IGNORE_TARGETS)
-        if(DEFINED GRAPHVIZ_${stringOpt})
-          set(opts "${opts}set(GRAPHVIZ_${stringOpt}")
-          foreach(str ${GRAPHVIZ_${stringOpt}})
-            set(opts "${opts} \"${str}\"")
-          endforeach()
-          set(opts "${opts})\n")
+    find_program(XP_DOT_EXE "dot")
+    mark_as_advanced(XP_DOT_EXE)
+    if(XP_DOT_EXE)
+      option(XP_GRAPHVIZ "create a \${CMAKE_BINARY_DIR}/CMakeGraphVizOptions.cmake file" ON)
+      mark_as_advanced(XP_GRAPHVIZ)
+      if(NOT DEFINED XP_GRAPHVIZ_PRIVATE_DEPS)
+        set(NV_GRAPHVIZ_PRIVATE_DEPS ON) # (NV: normal variable)
+      else()
+        set(NV_GRAPHVIZ_PRIVATE_DEPS ${XP_GRAPHVIZ_PRIVATE_DEPS})
+        unset(XP_GRAPHVIZ_PRIVATE_DEPS)
+      endif()
+      cmake_dependent_option(XP_GRAPHVIZ_PRIVATE_DEPS
+        "keep private dependencies in graph" ${NV_GRAPHVIZ_PRIVATE_DEPS}
+        "XP_GRAPHVIZ" ON
+        )
+      mark_as_advanced(XP_GRAPHVIZ_PRIVATE_DEPS)
+      if(XP_GRAPHVIZ)
+        if(NOT XP_GRAPHVIZ_PRIVATE_DEPS)
+          configure_file(${xpThisDir}/graphPvtClean.sh.in graphPvtClean.sh
+            @ONLY NEWLINE_STYLE LF
+            )
+          set(graphPvtClean COMMAND ./graphPvtClean.sh)
         endif()
-      endforeach()
-      foreach(boolOpt EXECUTABLES STATIC_LIBS SHARED_LIBS MODULE_LIBS INTERFACE_LIBS OBJECT_LIBS UNKNOWN_LIBS
-                      EXTERNAL_LIBS CUSTOM_TARGETS GENERATE_PER_TARGET GENERATE_DEPENDERS)
-        if(DEFINED GRAPHVIZ_${boolOpt})
-          set(opts "${opts}set(GRAPHVIZ_${boolOpt} ${GRAPHVIZ_${boolOpt}})\n")
+        if(NOT TARGET graph)
+          add_custom_command(OUTPUT graph_cmake
+            COMMAND ${CMAKE_COMMAND} --graphviz=${CMAKE_PROJECT_NAME}.dot .
+            ${graphPvtClean}
+            COMMAND dot -Tpng -o${CMAKE_PROJECT_NAME}.png ${CMAKE_PROJECT_NAME}.dot
+            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+            COMMENT "Generating ${CMAKE_PROJECT_NAME}.dot and ${CMAKE_PROJECT_NAME}.png..."
+            )
+          add_custom_target(graph SOURCES ${CMAKE_BINARY_DIR}/CMakeGraphVizOptions.cmake DEPENDS graph_cmake)
+          set_property(TARGET graph PROPERTY FOLDER CMakeTargets)
         endif()
-      endforeach()
-      file(WRITE ${CMAKE_BINARY_DIR}/CMakeGraphVizOptions.cmake ${opts})
-    endif()
+        set(opts "# Generating Dependency Graphs with CMake\n")
+        set(opts "${opts}# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/Graphviz\n")
+        set(opts "${opts}# https://cmake.org/cmake/help/latest/module/CMakeGraphVizOptions.html\n")
+        set(opts "${opts}# cmake --graphviz=${CMAKE_PROJECT_NAME}.dot ..\n")
+        set(opts "${opts}# dot -Tpng -o${CMAKE_PROJECT_NAME}.png ${CMAKE_PROJECT_NAME}.dot\n")
+        foreach(stringOpt GRAPH_NAME GRAPH_HEADER NODE_PREFIX IGNORE_TARGETS)
+          if(DEFINED GRAPHVIZ_${stringOpt})
+            set(opts "${opts}set(GRAPHVIZ_${stringOpt}")
+            foreach(str ${GRAPHVIZ_${stringOpt}})
+              set(opts "${opts} \"${str}\"")
+            endforeach()
+            set(opts "${opts})\n")
+          endif()
+        endforeach()
+        foreach(boolOpt EXECUTABLES STATIC_LIBS SHARED_LIBS MODULE_LIBS INTERFACE_LIBS OBJECT_LIBS UNKNOWN_LIBS
+                        EXTERNAL_LIBS CUSTOM_TARGETS GENERATE_PER_TARGET GENERATE_DEPENDERS)
+          if(DEFINED GRAPHVIZ_${boolOpt})
+            set(opts "${opts}set(GRAPHVIZ_${boolOpt} ${GRAPHVIZ_${boolOpt}})\n")
+          endif()
+        endforeach()
+        file(WRITE ${CMAKE_BINARY_DIR}/CMakeGraphVizOptions.cmake ${opts})
+      endif() # XP_GRAPHVIZ
+    endif() # XP_DOT_EXE
     option(XP_CSCOPE "always update cscope database" OFF)
     mark_as_advanced(XP_CSCOPE)
     if(XP_CSCOPE)


Fix iree_py_library and iree_pyext_module dependency issue (#5907)

The `bindings_python_iree_runtime_runtime` target tries to
depend on `::PyExtRt`. It requires to have a namespaced alias
for `bindings_python_iree_runtime_PyExtRt`.

By default `if()` in CMake dereferences the variable, after the
normal `${}` evaulation. If we have `if($SOME_VAR)`, it will
dereference twice. More details can be seen at:
https://cmake.org/cmake/help/latest/command/if.html#variable-expansion

IREE_MULTIPY_VERSIONS_EFFECTIVE is already gone.

--- build_tools/cmake/iree_python.cmake
+++ build_tools/cmake/iree_python.cmake
@@ -131,6 +131,10 @@
     ${_NAME}
     ${ARG_SRCS}
   )
+
+  # Alias the iree_package_name library to iree::package::name so that we can
+  # refer to this target with the namespaced format.
+  add_library(${_PACKAGE_NS}::${ARG_NAME} ALIAS ${_NAME})

   target_link_libraries(
     ${_NAME}
@@ -228,11 +232,10 @@
     )
   endforeach()

-  # Add PYEXT_DEPS.
-  if(${ARG_PYEXT_DEPS})
-    foreach(V ${IREE_MULTIPY_VERSIONS_EFFECTIVE})
-      add_dependencies(${_NAME} ${ARG_PYEXT_DEPS})
-    endforeach()
+  # Add PYEXT_DEPS if any.
+  if(ARG_PYEXT_DEPS)
+    list(TRANSFORM ARG_PYEXT_DEPS REPLACE "^::" "${_PACKAGE_NS}::")
+    add_dependencies(${_NAME} ${ARG_PYEXT_DEPS})
   endif()
 endfunction()


Reintroduce check for LLKDU source after downloading the prebuilt lib, to avoid adding a build dependency on it.

--- indra/cmake/LLKDU.cmake
+++ indra/cmake/LLKDU.cmake
@@ -3,16 +3,18 @@

 if (INSTALL_PROPRIETARY AND NOT STANDALONE)
   use_prebuilt_binary(kdu)
-  if (WINDOWS)
-    set(KDU_LIBRARY debug kdu_cored optimized kdu_core)
-  else (WINDOWS)
-    set(KDU_LIBRARY kdu)
-  endif (WINDOWS)
+  if (EXISTS ${LIBS_CLOSED_DIR}/llkdu)
+    if (WINDOWS)
+      set(KDU_LIBRARY debug kdu_cored optimized kdu_core)
+    else (WINDOWS)
+      set(KDU_LIBRARY kdu)
+    endif (WINDOWS)

-  set(KDU_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
+    set(KDU_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)

-  set(LLKDU_LIBRARY llkdu)
-  set(LLKDU_STATIC_LIBRARY llkdu_static)
-  set(LLKDU_LIBRARIES ${LLKDU_LIBRARY})
-  set(LLKDU_STATIC_LIBRARIES ${LLKDU_STATIC_LIBRARY})
+    set(LLKDU_LIBRARY llkdu)
+    set(LLKDU_STATIC_LIBRARY llkdu_static)
+    set(LLKDU_LIBRARIES ${LLKDU_LIBRARY})
+    set(LLKDU_STATIC_LIBRARIES ${LLKDU_STATIC_LIBRARY})
+  endif (EXISTS ${LIBS_CLOSED_DIR}/llkdu)
 endif (INSTALL_PROPRIETARY AND NOT STANDALONE)


CyberDWARF makes sense only when targeting asm.js - it will not work in wasm

- let users decide whether they want to use it or not

--- toolchains/emscripten.cmake
+++ toolchains/emscripten.cmake
@@ -10,15 +10,6 @@

 set( TNUN_compiler_debug_symbols -g4 "SHELL:-s DEMANGLE_SUPPORT=1" )
 set( TNUN_linker_debug_symbols   -g4 "SHELL:-s DEMANGLE_SUPPORT=1" )
-
-string( REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION} )
-list( GET VERSION_LIST 0 clang_major_version  )
-
-# if fastcomp backend, enable cyberdwarf debugger
-if ( ${clang_major_version} EQUAL 6 )
-    list( APPEND TNUN_compiler_debug_symbols "SHELL:-s CYBERDWARF=1" )
-    list( APPEND TNUN_linker_debug_symbols   "SHELL:-s CYBERDWARF=1" )
-endif()

 set( TNUN_linker_exceptions_on  "SHELL:-s DISABLE_EXCEPTION_CATCHING=0" )


CMake: Refactor cpp.cmake

CMake: Refactor cpp.cmake


Enable building iOS static lib with MBTiles option off

--- platforms/ios/config.cmake
+++ platforms/ios/config.cmake
@@ -15,10 +15,10 @@
 configure_file(${PROJECT_SOURCE_DIR}/platforms/ios/demo/Info.plist.in ${PROJECT_BINARY_DIR}/Info.plist)

 # Tell SQLiteCpp to not build its own copy of SQLite, we will use the system library instead.
+set(SQLITECPP_INTERNAL_SQLITE OFF CACHE BOOL "")
 if (IOS_SDK_VERSION VERSION_LESS 11.0)
   set(SQLITE_USE_LEGACY_STRUCT ON CACHE BOOL "")
 endif()
-set(SQLITECPP_INTERNAL_SQLITE OFF CACHE BOOL "")

 # Headers must be absolute paths for the copy_if_different command on the
 # static library target, relative paths cause it to fail with an error.
@@ -149,13 +149,15 @@
   $<TARGET_FILE:harfbuzz>
   $<TARGET_FILE:freetype>
   $<TARGET_FILE:icucommon>
-  $<TARGET_FILE:SQLiteCpp>
   $<TARGET_FILE:double-conversion>
   $<TARGET_FILE:miniz>
   "
 )
-if (NOT TANGRAM_USE_JSCORE)
+if(NOT TANGRAM_USE_JSCORE)
   set(TANGRAM_STATIC_DEPENDENCIES "${TANGRAM_STATIC_DEPENDENCIES} $<TARGET_FILE:duktape>")
+endif()
+if(TANGRAM_MBTILES_DATASOURCE)
+  set(TANGRAM_STATIC_DEPENDENCIES "${TANGRAM_STATIC_DEPENDENCIES} $<TARGET_FILE:SQLiteCpp>")
 endif()

 set_target_properties(tangram-static PROPERTIES


cmake/BuildHypdermic: repair HYPODERMIC_LIBRARIES

--- cmake/Modules/BuildHypodermic.cmake
+++ cmake/Modules/BuildHypodermic.cmake
@@ -8,5 +8,5 @@
   SOURCE_DIR <prefix>/src/<name>/hypodermic-master/
 )

-set(HYPODERMIC_LIBRARIES ${HYPODERMIC_INSTALL_DIR}/lib)
+set(HYPODERMIC_LIBRARIES ${HYPODERMIC_INSTALL_DIR}/lib/libhypodermic.so)
 set(HYPODERMIC_INCLUDE_DIRS ${HYPODERMIC_INSTALL_DIR}/include)


CMake: clang: disable -Wmissing-braces if it is broken.

See https://bugs.llvm.org/show_bug.cgi?id=21629
See https://reviews.llvm.org/rL314838

--- cmake/compiler-warnings-clang.cmake
+++ cmake/compiler-warnings-clang.cmake
@@ -51,6 +51,20 @@
   list(APPEND CLANG_DISABLED_WARNING_FLAGS "unreachable-code")
 endif()

+set(CMAKE_REQUIRED_FLAGS_ORIG "${CMAKE_REQUIRED_FLAGS}")
+set(CMAKE_REQUIRED_FLAGS "-c -Wmissing-braces -Werror=missing-braces")
+# see https://bugs.llvm.org/show_bug.cgi?id=21629
+CHECK_CXX_SOURCE_COMPILES(
+"#include <array>
+const std::array<int, 2> test = {0, 0};"
+  CLANG_CXX_FLAG_MISSING_BRACES_WORKS
+)
+set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_ORIG}")
+
+if(NOT CLANG_CXX_FLAG_MISSING_BRACES_WORKS)
+  list(APPEND CLANG_DISABLED_WARNING_FLAGS "missing-braces")
+endif()
+
 if(NOT (UNIX OR APPLE))
   # bogus warnings about std functions...
   list(APPEND CLANG_DISABLED_WARNING_FLAGS "used-but-marked-unused")


ENH: doc

ENH: doc

--- vtkIncludeDirectories.cmake
+++ vtkIncludeDirectories.cmake
@@ -91,6 +91,8 @@

 #-----------------------------------------------------------------------------
 # Include directories from the build tree.
+# ${VTK_BINARY_DIR}/Utilities is needed to access vtksys, which is prefixed
+# (i.e. include "vtksys/DynamicLoader.hxx")
 SET(VTK_INCLUDE_DIRS_BUILD_TREE
   ${VTK_BINARY_DIR}
   ${VTK_BINARY_DIR}/Common


Removed FreeImagePlus cmake find module

Removed FreeImagePlus cmake find module

--- tools/share/cmake/FindFreeImagePlus.cmake
+++ tools/share/cmake/FindFreeImagePlus.cmake
@@ -1,53 +0,0 @@
-#
-# Try to find the FreeImage library and include path.
-# Once done this will define
-#
-# FREEIMAGEPLUS_FOUND
-# FREEIMAGEPLUS_INCLUDE_PATH
-# FREEIMAGEPLUS_LIBRARY
-# FREEIMAGEPLUS_LIBRARIES
-#
-
-IF (WIN32)
-	FIND_PATH( FREEIMAGEPLUS_INCLUDE_PATH FreeImagePlus.h
-		${FREEIMAGE_ROOT_DIR}/include
-		${FREEIMAGE_ROOT_DIR}
-		DOC "The directory where FreeImagePlus.h resides")
-	FIND_LIBRARY( FREEIMAGEPLUS_LIBRARY
-		NAMES FreeImagePlus freeimageplus
-		PATHS
-		${FREEIMAGE_ROOT_DIR}/lib
-		${FREEIMAGE_ROOT_DIR}
-		DOC "The FreeImagePlus library")
-ELSE (WIN32)
-	FIND_PATH( FREEIMAGEPLUS_INCLUDE_PATH FreeImagePlus.h
-		/usr/include
-		/usr/local/include
-		/sw/include
-		/opt/local/include
-		DOC "The directory where FreeImagePlus.h resides")
-	FIND_LIBRARY( FREEIMAGEPLUS_LIBRARY
-		NAMES FreeImagePlus freeimageplus
-		PATHS
-		/usr/lib64
-		/usr/lib
-		/usr/local/lib64
-		/usr/local/lib
-		/sw/lib
-		/opt/local/lib
-		DOC "The FreeImagePlus library")
-ENDIF (WIN32)
-
-SET(FREEIMAGEPLUS_LIBRARIES ${FREEIMAGEPLUS_LIBRARY})
-
-IF (FREEIMAGEPLUS_INCLUDE_PATH AND FREEIMAGEPLUS_LIBRARY)
-	SET( FREEIMAGEPLUS_FOUND TRUE CACHE BOOL "Set to TRUE if FreeImage is found, FALSE otherwise")
-ELSE (FREEIMAGEPLUS_INCLUDE_PATH AND FREEIMAGEPLUS_LIBRARY)
-	SET( FREEIMAGEPLUS_FOUND FALSE CACHE BOOL "Set to TRUE if FreeImage is found, FALSE otherwise")
-ENDIF (FREEIMAGEPLUS_INCLUDE_PATH AND FREEIMAGEPLUS_LIBRARY)
-
-MARK_AS_ADVANCED(
-	FREEIMAGEPLUS_FOUND
-	FREEIMAGEPLUS_LIBRARY
-	FREEIMAGEPLUS_LIBRARIES
-	FREEIMAGEPLUS_INCLUDE_PATH)


Fix extract dep include not found issue

Fix extract dep include not found issue

--- reason.util.cmake
+++ reason.util.cmake
@@ -68,6 +68,9 @@
 function(reason_extract_dep_inc_dirs_to_target TARGET_NAME DEP)
   reason_verbose("  add dep include directories: [dep=${DEP}]")
   get_target_property(DEP_INC_DIRS "${DEP}" "INCLUDE_DIRECTORIES")
+  if("${DEP_INC_DIRS}" STREQUAL "DEP_INC_DIRS-NOTFOUND")
+    return()
+  endif()
   foreach(v IN LISTS DEP_INC_DIRS)
     target_include_directories("${TARGET_NAME}" PRIVATE "${v}")
     reason_verbose("    [private-include=${v}]")


Install ressources according to OGRE_LIB_DIRECTORY .

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -46,10 +46,10 @@
   set(OGRE_MEDIA_PATH "share/OGRE/media")
   set(OGRE_MEDIA_DIR_REL "${CMAKE_INSTALL_PREFIX}/${OGRE_MEDIA_PATH}")
   set(OGRE_MEDIA_DIR_DBG "${CMAKE_INSTALL_PREFIX}/${OGRE_MEDIA_PATH}")
-  set(OGRE_PLUGIN_DIR_REL "${CMAKE_INSTALL_PREFIX}/lib/OGRE")
-  set(OGRE_PLUGIN_DIR_DBG "${CMAKE_INSTALL_PREFIX}/lib/OGRE")
-  set(OGRE_SAMPLES_DIR_REL "${CMAKE_INSTALL_PREFIX}/lib/OGRE/Samples")
-  set(OGRE_SAMPLES_DIR_DBG "${CMAKE_INSTALL_PREFIX}/lib/OGRE/Samples")
+  set(OGRE_PLUGIN_DIR_REL "${CMAKE_INSTALL_PREFIX}/${OGRE_LIB_DIRECTORY}/OGRE")
+  set(OGRE_PLUGIN_DIR_DBG "${CMAKE_INSTALL_PREFIX}/${OGRE_LIB_DIRECTORY}/OGRE")
+  set(OGRE_SAMPLES_DIR_REL "${CMAKE_INSTALL_PREFIX}/${OGRE_LIB_DIRECTORY}/OGRE/Samples")
+  set(OGRE_SAMPLES_DIR_DBG "${CMAKE_INSTALL_PREFIX}/${OGRE_LIB_DIRECTORY}/OGRE/Samples")
   set(OGRE_CFG_INSTALL_PATH "share/OGRE")
 endif ()


Install files from lib64.

Install files from lib64.

--- CMake/itkExternal_FFTW.cmake
+++ CMake/itkExternal_FFTW.cmake
@@ -147,6 +147,14 @@
       "file(GLOB FFTW_LIBS ${ITK_BINARY_DIR}/fftw/lib/*fftw3*)
 file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/lib/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}\"
 TYPE FILE FILES \${FFTW_LIBS})" COMPONENT Development)
+    if(UNIX AND NOT APPLE)
+      if(CMAKE_SIZEOF_VOID_P MATCHES 8)
+        install(CODE
+          "file(GLOB FFTW_LIBS ${ITK_BINARY_DIR}/fftw/lib64/*fftw3*)
+file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/lib/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}\"
+TYPE FILE FILES \${FFTW_LIBS})" COMPONENT Development)
+      endif()
+    endif()
     #
     # copy headers into install tree
     install(CODE


Fix the plugin install path in case of non-Mac installs.

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -53,8 +53,14 @@
         get_filename_component(_item_path \"\${full_path}\" PATH)
       endif()

-      if(_item_path STREQUAL \"\${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}/plugins\"
-         OR (_item_path MATCHES \"\${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}/\" AND _item_name MATCHES \"liborg\") # this is for legacy BlueBerry bundle support
+      if(_bundle_dest_dir)
+        set(_plugins_path \"\${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}/plugins\")
+      else()
+        set(_plugins_path \"\${CMAKE_INSTALL_PREFIX}/bin/plugins\")
+      endif()
+
+      if(_item_path STREQUAL _plugins_path
+         OR (_item_path MATCHES \"\${_plugins_path}/\" AND _item_name MATCHES \"liborg\") # this is for legacy BlueBerry bundle support
         )
         # Only fix plugins
         message(\"override: \${item}\")


testing: Don't look for tests when making an executable

Change-Id: Ib4c263cb6c9dbc97883e1f8276a8a16beb149019

--- CMake/vtkTestingMacros.cmake
+++ CMake/vtkTestingMacros.cmake
@@ -23,7 +23,7 @@
     endforeach()
     if(handled)
       # Do nothing.
-    elseif("x${arg}" MATCHES "^x([^.]*)\\.${source_ext},?(.*)$")
+    elseif(source_ext AND "x${arg}" MATCHES "^x([^.]*)\\.${source_ext},?(.*)$")
       set(name "${CMAKE_MATCH_1}")
       string(REPLACE "," ";" _${name}_options "${CMAKE_MATCH_2}")
       list(APPEND names ${name})
@@ -269,7 +269,7 @@
   set(exe_options
     RENDERING_FACTORY
     )
-  _vtk_test_parse_args("${exe_options}" "cxx" ${ARGN})
+  _vtk_test_parse_args("${exe_options}" "" ${ARGN})
   _vtk_test_set_options("${exe_options}" "" ${options})

   set(test_driver vtkTestDriver.h)
@@ -278,11 +278,7 @@
     set(test_driver ${vtkTestingRendering_SOURCE_DIR}/vtkTestingObjectFactory.h)
   endif()

-  set(extra_sources)
-  foreach(name IN LISTS names)
-    list(APPEND extra_sources
-      ${name}.cxx)
-  endforeach()
+  set(extra_sources ${args})

   if(vtk-module)
     set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN


don't search for bz2d only, also search for non-debug lib bz2

--- CMakeModules/FindBZip2.cmake
+++ CMakeModules/FindBZip2.cmake
@@ -27,7 +27,7 @@

 FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )

-FIND_LIBRARY(BZIP2_LIBRARY NAMES bz2d bzip2 )
+FIND_LIBRARY(BZIP2_LIBRARY NAMES bz2 bz2d bzip2 )
 if(BZip2_FIND_DEBUG)
 	FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bz2d bzip2d )
 endif(BZip2_FIND_DEBUG)


Add the other two build types to the yaml cmake file

--- CMake/External_yamlcpp.cmake
+++ CMake/External_yamlcpp.cmake
@@ -38,6 +38,11 @@
 		"${install_dir}/lib/libyaml-cppmdd${CMAKE_STATIC_LIBRARY_SUFFIX}")
 	set_target_properties(yaml-cpp-lib PROPERTIES IMPORTED_LOCATION_RELEASE
 		"${install_dir}/lib/libyaml-cppmd${CMAKE_STATIC_LIBRARY_SUFFIX}")
+	set_target_properties(yaml-cpp-lib PROPERTIES IMPORTED_LOCATION_RELWITHDEBINFO
+		"${install_dir}/lib/libyaml-cppmd${CMAKE_STATIC_LIBRARY_SUFFIX}")
+	set_target_properties(yaml-cpp-lib PROPERTIES IMPORTED_LOCATION_MINSIZREL
+		"${install_dir}/lib/libyaml-cppmd${CMAKE_STATIC_LIBRARY_SUFFIX}")
+
 else()
 	if(BUILD_SHARED_LIBS)
 		add_library(yaml-cpp-lib SHARED IMPORTED)


cmake: fix syntax error

cmake: fix syntax error

--- CMakeModules/gitscript.cmake
+++ CMakeModules/gitscript.cmake
@@ -22,6 +22,6 @@
 file(READ ${INPUT} CONTENT)
 string(REGEX REPLACE "#TOOLS_GIT_ID#" "${THIS_GIT_ID}" NEW_CONTENT "${CONTENT}")
 file(WRITE "${OUTPUT}.tmp" "${NEW_CONTENT}")
-file(COPY "${OUTPUT}.tmp" "${OUTPUT}.tmp.x" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+file(COPY "${OUTPUT}.tmp" DESTINATION "${OUTPUT}.tmp.x" FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OUTPUT}.tmp.x ${OUTPUT})
 execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${OUTPUT}.tmp ${OUTPUT}.tmp.x)


Skip resources in hidden folders.

Skip resources in hidden folders.

--- sigma_setup.cmake
+++ sigma_setup.cmake
@@ -88,6 +88,11 @@
         get_filename_component(SOURCE_NAME "${SOURCE_FILE}" NAME_WE)
         get_filename_component(SOURCE_EXTENTION "${SOURCE_FILE}" EXT)

+        # Skip files in hidden folders
+        if("${SOURCE_DIRECTORY}" MATCHES ".*\\..*")
+            continue()
+        endif()
+
         if("${SOURCE_EXTENTION}" IN_LIST TEXTURE_EXTENSIONS)
             set(RESOURCE_TYPE "texture")
             set(RESOURCE_COMMAND texcc)


Fixed Google Test not linking.

Fixed Google Test not linking.

--- build/cmake/gtest.cmake
+++ build/cmake/gtest.cmake
@@ -1,10 +1,10 @@
 if(NOT CMAKE_BUILD_TYPE STREQUAL Release)
 	set(GTEST_SOURCE_DIR ${LOCAL_LIBRARY}/gtest)
 	set(GTEST_INCLUDE_DIRS ${GTEST_SOURCE_DIR}/include ${GTEST_SOURCE_DIR})
-	set(GTEST_LIBRARIES "libgtest.a -lpthread")

 	add_library(gtest STATIC ${GTEST_SOURCE_DIR}/src/gtest-all.cc)
 	add_definitions(-DRAINBOW_TEST)
+	set(GTEST_LIBRARY gtest)

 	message(STATUS "Google C++ Testing Framework is enabled")
 endif(NOT CMAKE_BUILD_TYPE STREQUAL Release)


wrong variable set in gitref function

wrong variable set in gitref function

--- scripts/VersionAndGitRef.cmake
+++ scripts/VersionAndGitRef.cmake
@@ -29,6 +29,6 @@
     set(GIT_HASH "NA")
   endif()

-  set(${PROJECT_NAME}_VERSION ${VERSION} PARENT_SCOPE)
+  set(${PROJECT_NAME}_GITREF ${GIT_HASH} PARENT_SCOPE)

 endfunction()


ENH: CI: Enabled cmake packaging in CI script.

--- CI/main_packages.cmake
+++ CI/main_packages.cmake
@@ -20,13 +20,18 @@
 # We are included from main_superbuild.cmake
 # This script is a prototype for the future CI, it may evolve rapidly in a near future

+include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
+
 set ( DEBUG "1" )

 # set ( CTEST_BUILD_CONFIGURATION "Release" )
 # set ( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
 set ( CTEST_BUILD_FLAGS "-j1" )
 set ( CTEST_BUILD_NAME "Packages" )
-# set ( CTEST_SITE "${IMAGE_NAME}" )
+set ( CTEST_SITE "${IMAGE_NAME}" )
+
+# Find the build name and CI profile
+set_dash_build_name()

 # Directory variable
 set ( CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}/Packaging" )
@@ -37,51 +42,63 @@
 # Copy back xdk for RUN_PATH reason
 # We might want to change the name of artifact in main_superbuild
 # file ( COPY "${OTB_SOURCE_DIR}/install/xdk" DESTINATION "${CI_ROOT_DIR}")
-# Packages case:
+# Packages case:
 # SUPERBUILD_BINARY_DIR this is needed for OTB_BINARY_DIR, not sure we need it
 # SUPERBUILD_INSTALL_DIR do we need it? it seems so... We will set it to anything
 # DOWNLOAD_LOCATION
 # OTB_BINARY_DIR
 # CMAKE_INSTALL_PREFIX
-set ( CONFIGURE_OPTIONS
+set ( CONFIGURE_OPTIONS
 "-DCMAKE_PREFIX_PATH=${CTEST_INSTALL_DIRECTORY};\
 -DOTB_BINARY_DIR=${OTB_SOURCE_DIR}/build;\
 -DSUPERBUILD_INSTALL_DIR=${CI_ROOT_DIR}/xdk;\
 -DSUPERBUILD_BINARY_DIR=${OTB_SOURCE_DIR};" )

-ctest_start (Experimental TRACK Experimental)
+# Sources are already checked out : do nothing for update
+set(CTEST_GIT_UPDATE_CUSTOM echo No update)

-ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
-    SOURCE "${CTEST_SOURCE_DIRECTORY}"
-    OPTIONS "${CONFIGURE_OPTIONS}"
-    RETURN_VALUE _configure_rv
-    CAPTURE_CMAKE_ERROR _configure_error
-    )

-if ( NOT _configure_rv EQUAL 0 )
+ctest_start( Experimental TRACK Experimental )
+# TODO: ctest_start( Experimental TRACK CI_Package )
+
+ctest_update( SOURCE "${OTB_SOURCE_DIR}" )
+
+
+ctest_configure(
+  BUILD "${CTEST_BINARY_DIRECTORY}"
+  SOURCE "${CTEST_SOURCE_DIRECTORY}"
+  OPTIONS "${CONFIGURE_OPTIONS}"
+  RETURN_VALUE _configure_rv
+  CAPTURE_CMAKE_ERROR _configure_error
+  )
+
+if( NOT _configure_rv EQUAL 0 )
   ctest_submit()
   message( SEND_ERROR "An error occurs during ctest_configure.")
+  # return()
 endif()

-# ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
-#             RETURN_VALUE _build_rv
-#             CAPTURE_CMAKE_ERROR _build_error
-#             )

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

-# Uncomment when ready for test
-# ctest_test(PARALLEL_LEVEL 8
-#            RETURN_VALUE _test_rv
-#            CAPTURE_CMAKE_ERROR _test_error
-#            )
+if( NOT _build_rv EQUAL 0 )
+  message( SEND_ERROR "An error occurs during ctest_build.")
+endif()

-# if ( NOT _test_rv EQUAL 0 )
-#   ctest_submit()
+
+# ctest_test(
+#   PARALLEL_LEVEL 4
+#   RETURN_VALUE _test_rv
+#   CAPTURE_CMAKE_ERROR _test_error
+#   )
+
+# if( NOT _test_rv EQUAL 0 )
 #   message( SEND_ERROR "An error occurs during ctest_test.")
 # endif()

-# ctest_submit()
+
+ctest_submit()