Release RTF 1.4.0

Release RTF 1.4.0

--- conf/RTFVersion.cmake
+++ conf/RTFVersion.cmake
@@ -8,8 +8,8 @@
 ## manually increase tweak number when required. Set to zero when
 # bumping VERSION_PATCH
 set(RTF_VERSION_MAJOR "1")
-set(RTF_VERSION_MINOR "3")
-set(RTF_VERSION_PATCH "4")
+set(RTF_VERSION_MINOR "4")
+set(RTF_VERSION_PATCH "0")
 set(RTF_VERSION_TWEAK "")
 set(RTF_VERSION_STRING "")


HGVersion.cmake: fix quoting and whitespace problems.

Tested on Windows and Mac.

--- tools/cmake/HGVersion.cmake
+++ tools/cmake/HGVersion.cmake
@@ -4,22 +4,14 @@
 message(STATUS "GETTING HG VERSION")
 #message( STATUS PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} )

-#exec_program( hg ${PROJECT_SOURCE_DIR} ARGS paths OUTPUT_VARIABLE ${PROJECT_NAME}_HGPATHS )
-#message( STATUS "${PROJECT_NAME}_HGPATHS=${${PROJECT_NAME}_HGPATHS}}" )
-exec_program( hg ${PROJECT_SOURCE_DIR} ARGS tip --template='{rev}:{node|short}\n' OUTPUT_VARIABLE __HGTIP__ )
+execute_process(
+    COMMAND hg tip --template "{rev}:{node|short}"
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    OUTPUT_VARIABLE __HGTIP__
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
 message(STATUS "__HGTIP__=${__HGTIP__}")

-#SET( CHANGESET  "\"" ${__HGTIP__} "\"" )
-SET( CHANGESET  "\""  "\"" )
-
-#string( REPLACE "\n" ";" __HGTIP__ ${__HGTIP__} )
-#foreach(HGTIP ${__HGTIP__})
-#    string(SUBSTRING "${HGTIP}" 0 11 HGTIPSTART)
-#    if (HGTIPSTART MATCHES "changeset: ")
-#        SET( CHANGESET  "\"" ${HGTIP} "\"" )
-#        message(STATUS "${HGTIP}")
-#    endif()
-#endforeach()
+SET( CHANGESET  "\"" ${__HGTIP__} "\"" )

 add_custom_target(buildheader ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/buildtime.h)
 file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/buildtime.h )


COMP: niral_utilitiesExternalProject: Conditionally specify CMAKE_BUNDLE_OUTPUT_DIRECTORY

This helps reduce the number of warning related to unused CMake variables
when configuring the project on a platform different from macOS.

--- CMake/niral_utilitiesExternalProject.cmake
+++ CMake/niral_utilitiesExternalProject.cmake
@@ -31,6 +31,12 @@
   set( ${proj}_REPOSITORY ${_ep_GIT_REPOSITORY})
   set( ${proj}_GIT_TAG ${_ep_GIT_TAG} )

+  if(APPLE)
+    list(APPEND _ep_ADDITIONAL_OPTIONS
+      -DCMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH=${CMAKE_BUNDLE_OUTPUT_DIRECTORY}
+      )
+  endif()
+
   ExternalProject_Add(${projectname}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}
@@ -58,7 +64,6 @@
       -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
       -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
       -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-      -DCMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH=${CMAKE_BUNDLE_OUTPUT_DIRECTORY}
       -DCTEST_NEW_FORMAT:BOOL=${CTEST_NEW_FORMAT}
       -DMEMORYCHECK_COMMAND_OPTIONS:STRING=${MEMORYCHECK_COMMAND_OPTIONS}
       -DMEMORYCHECK_COMMAND:PATH=${MEMORYCHECK_COMMAND}


Added dependency on ICU

Added dependency on ICU

--- resqliteun.cmake
+++ resqliteun.cmake
@@ -7,14 +7,64 @@
 # pileInclude() from pile_support.cmake module.
 include(pile_support)

+
+# find ICU dll components
+macro    (regexliteFindIcuDll
+          _libs_to_find
+          _append_to)
+
+  string(REPLACE "." ";" _ver_comps "${ICU_VERSION}")
+  # message(STATUS "_ver_comps = ${_ver_comps}")
+
+  list(GET _ver_comps 0 _ver_major11)
+  # message(STATUS "_ver_major11 = ${_ver_major11}")
+
+  foreach(_iter_lib ${_libs_to_find})
+      # message(STATUS "_iter_lib = ${_iter_lib}")
+      get_filename_component(_base_name "${_iter_lib}" NAME_WE )
+      # message(STATUS "_base_name = ${_base_name}")
+      # message(STATUS "NAMES = ${_base_name}${_ver_major11}.dll ${_base_name}${ICU_VERSION}.dll ${_base_name}.dll")
+      # message(STATUS "ICU_ICUINFO_EXECUTABLE = ${ICU_ICUINFO_EXECUTABLE}")
+      unset(_iter_dll CACHE)
+      find_file(_iter_dll
+          NAMES "${_base_name}${_ver_major11}.dll" "${_base_name}${ICU_VERSION}.dll" "${_base_name}.dll"
+          PATHS "${ICU_ICUINFO_EXECUTABLE}/..")
+      # message(STATUS "_iter_dll = ${_iter_dll}")
+
+      if (NOT _iter_dll)
+          message(FATAL_ERROR "Cannot find ${_base_name} library in ICU package")
+      endif ()
+      list(APPEND ${_append_to} ${_iter_dll})
+      unset(_iter_dll CACHE)
+  endforeach()
+  unset(_ver_comps)
+endmacro()
+
+
 # initialize this module
 macro    (resqliteunInit
-          ref_cnt_use_mode)
+          resqliteun_use_mode)

     # default name
     if (NOT RESQLITEUN_INIT_NAME)
         set(RESQLITEUN_INIT_NAME "ReSqliteUn")
     endif ()
+
+    find_package(ICU 58 REQUIRED
+        COMPONENTS uc i18n dt)
+
+    set(RESQLITEUN_LIBRARIES
+        ${ICU_UC_LIBRARIES}
+        ${ICU_I18N_LIBRARIES}
+        ${ICU_DT_LIBRARIES})
+
+    if (WIN32)
+        regexliteFindIcuDll("${ICU_UC_LIBRARIES};${ICU_I18N_LIBRARIES};${ICU_DT_LIBRARIES}" REGEXLITE_DLLS)
+        # message(STATUS "REGEXLITE_DLLS = ${REGEXLITE_DLLS}")
+    endif()
+
+    set(RESQLITEUN_INCLUDES
+        ${ICU_INCLUDE_DIRS})

     # compose the list of headers and sources
     set(RESQLITEUN_HEADERS
@@ -31,9 +81,9 @@
         "${RESQLITEUN_INIT_NAME}"
         "0;0;1;d"
         "ON"
-        "${ref_cnt_use_mode}"
+        "${resqliteun_use_mode}"
         ""
-        "category1"
-        "tag1;tag2")
+        "database"
+        "sqlite")

 endmacro ()


Remove an obsolete test in configure_1_threads.cmake:

With -pthread all necessary preprocessor definitions should be already set.

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

--- deal.II/cmake/configure/configure_1_threads.cmake
+++ deal.II/cmake/configure/configure_1_threads.cmake
@@ -86,27 +86,6 @@

     ENDIF()

-    #
-    # In some cases, -threads (or whatever else command line option)
-    # switches on some preprocessor flags. If this is not the case,
-    # then define them explicitely.
-    #
-    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #if !defined (_REENTRANT) && !defined (_THREAD_SAFE)
-      # error Neither _REENTRANT nor _THREAD_SAFE were defined.
-        nonsense
-      #endif
-      int main(){ return 0; }
-      "
-      DEAL_II_HAVE_MT_DEFINITIONS)
-    STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-
-    IF(NOT DEAL_II_HAVE_MT_DEFINITIONS)
-      LIST(APPEND DEAL_II_DEFINITIONS "_REENTRANT" "_THREAD_SAFE")
-    ENDIF()
-
   ENDIF(Threads_FOUND)
 ENDMACRO()


Enable linker warnings as errors (#222)

Enable linker warnings as errors (#222)

--- Overlays/Windows/cmake/build_options.cmake
+++ Overlays/Windows/cmake/build_options.cmake
@@ -94,6 +94,7 @@
 # Linker options
 foreach(type EXE SHARED STATIC)
   set(CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS} /ignore:4221")
+  set(CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS} /WX")

   # Enable link time code generation
   if(NOT "${CMAKE_${type}_LINKER_FLAGS_RELEASE}" MATCHES "/LTCG")


Cross platform patching

Cross platform patching

--- cmake/AWSSDKConfig.cmake
+++ cmake/AWSSDKConfig.cmake
@@ -176,7 +176,7 @@
         if (NOT LIB_PATH)
             message(FATAL_ERROR "Couldn't find library aws-cpp-sdk-${SVC}")
         endif()
-        execute_process(COMMAND cp ${LIB_PATH} ${DEST_DIR})
+        file(COPY ${LIB_PATH} DESTINATION ${DEST_DIR})
         unset(LIB_PATH CACHE)
     endforeach()
 endmacro(AWSSDK_CPY_DYN_LIBS)


add feature: enable cpu features when use cuda

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -30,88 +30,89 @@
     endif ()
   else ()
     set(USE_CUDA OFF)
-    message(WARNING "Could not find CUDA, using CPU")
+    message(WARNING "Could not find CUDA, disable it")
   endif ()
 endif ()

-if (NOT ${USE_CUDA})
-  if (${USE_Eigen})
+if (${USE_Eigen})
+  find_package(Eigen QUIET)
+  if (NOT Eigen_FOUND)
+    message(STATUS "Could not find eigen library, build it from source")
+    download_external("${PROJECT_SOURCE_DIR}/cmake/external/DownloadEigen.cmake"
+                      "${CMAKE_BINARY_DIR}/eigen-download")
     find_package(Eigen QUIET)
-    if (NOT Eigen_FOUND)
-      message(STATUS "Could not find eigen library, build it from source")
-      download_external("${PROJECT_SOURCE_DIR}/cmake/external/DownloadEigen.cmake"
-                        "${CMAKE_BINARY_DIR}/eigen-download")
-      find_package(Eigen QUIET)
+  endif ()
+  if (Eigen_FOUND)
+    include_directories(SYSTEM ${Eigen_INCLUDE_DIRS})
+    message(STATUS "Found Eigen: ${Eigen_INCLUDE_DIRS} (found version ${Eigen_VERSION})")
+    add_definitions(-DUSE_Eigen)
+  else ()
+    set(USE_Eigen OFF)
+    message(WARNING "Could not find Eigen, disable it")
+  endif ()
+endif ()
+
+if (${USE_BLAS})
+  if (${BLAS} STREQUAL "OpenBLAS" OR ${BLAS} STREQUAL "openblas")
+    find_package(OpenBLAS QUIET)
+    if (OpenBLAS_FOUND)
+      include_directories(SYSTEM ${OpenBLAS_INCLUDE_DIRS})
+      list(APPEND Shadow_LINKER_LIBS ${OpenBLAS_LIBRARIES})
+      message(STATUS "Found OpenBLAS: ${OpenBLAS_INCLUDE_DIRS}, ${OpenBLAS_LIBRARIES} (found version ${OpenBLAS_VERSION})")
+      add_definitions(-DUSE_OpenBLAS)
+    else ()
+      set(USE_BLAS OFF)
+      message(WARNING "Could not find OpenBLAS, disable it")
     endif ()
-    if (Eigen_FOUND)
-      include_directories(SYSTEM ${Eigen_INCLUDE_DIRS})
-      message(STATUS "Found Eigen: ${Eigen_INCLUDE_DIRS} (found version ${Eigen_VERSION})")
-      add_definitions(-DUSE_Eigen)
+  elseif (${BLAS} STREQUAL "MKL" OR ${BLAS} STREQUAL "mkl")
+    find_package(MKL QUIET)
+    if (MKL_FOUND)
+      include_directories(SYSTEM ${MKL_INCLUDE_DIRS})
+      list(APPEND Shadow_LINKER_LIBS ${MKL_LIBRARIES})
+      message(STATUS "Found MKL: ${MKL_INCLUDE_DIRS}, ${MKL_LIBRARIES} (found version ${MKL_VERSION})")
+      add_definitions(-DUSE_MKL)
     else ()
-      set(USE_Eigen OFF)
-      message(WARNING "Could not find Eigen, disable it")
+      set(USE_BLAS OFF)
+      message(WARNING "Could not find MKL, disable it")
     endif ()
   endif ()
-  if (${USE_BLAS})
-    if (${BLAS} STREQUAL "OpenBLAS" OR ${BLAS} STREQUAL "openblas")
-      find_package(OpenBLAS QUIET)
-      if (OpenBLAS_FOUND)
-        include_directories(SYSTEM ${OpenBLAS_INCLUDE_DIRS})
-        list(APPEND Shadow_LINKER_LIBS ${OpenBLAS_LIBRARIES})
-        message(STATUS "Found OpenBLAS: ${OpenBLAS_INCLUDE_DIRS}, ${OpenBLAS_LIBRARIES} (found version ${OpenBLAS_VERSION})")
-        add_definitions(-DUSE_OpenBLAS)
-      else ()
-        set(USE_BLAS OFF)
-        message(WARNING "Could not find OpenBLAS, disable it")
-      endif ()
-    elseif (${BLAS} STREQUAL "MKL" OR ${BLAS} STREQUAL "mkl")
-      find_package(MKL QUIET)
-      if (MKL_FOUND)
-        include_directories(SYSTEM ${MKL_INCLUDE_DIRS})
-        list(APPEND Shadow_LINKER_LIBS ${MKL_LIBRARIES})
-        message(STATUS "Found MKL: ${MKL_INCLUDE_DIRS}, ${MKL_LIBRARIES} (found version ${MKL_VERSION})")
-        add_definitions(-DUSE_MKL)
-      else ()
-        set(USE_BLAS OFF)
-        message(WARNING "Could not find MKL, disable it")
-      endif ()
-    endif ()
+endif ()
+
+if (${USE_NNPACK})
+  find_package(NNPACK QUIET)
+  if (NOT NNPACK_FOUND)
+    message(STATUS "Could not find nnpack library, build it from source")
+    download_external("${PROJECT_SOURCE_DIR}/cmake/external/DownloadNNPACK.cmake"
+                      "${CMAKE_BINARY_DIR}/nnpack-download")
+    find_package(NNPACK QUIET)
   endif ()
-  if (${USE_NNPACK})
-    find_package(NNPACK QUIET)
-    if (NOT NNPACK_FOUND)
-      message(STATUS "Could not find nnpack library, build it from source")
-      download_external("${PROJECT_SOURCE_DIR}/cmake/external/DownloadNNPACK.cmake"
-                        "${CMAKE_BINARY_DIR}/nnpack-download")
-      find_package(NNPACK QUIET)
-    endif ()
-    if (NNPACK_FOUND)
-      include_directories(SYSTEM ${NNPACK_INCLUDE_DIRS})
-      list(APPEND Shadow_LINKER_LIBS ${NNPACK_LIBRARIES})
-      message(STATUS "Found NNPACK: ${NNPACK_INCLUDE_DIRS}, ${NNPACK_LIBRARIES}")
-      add_definitions(-DUSE_NNPACK)
-    else ()
-      set(USE_NNPACK OFF)
-      message(WARNING "Could not find NNPACK, disable it")
-    endif ()
+  if (NNPACK_FOUND)
+    include_directories(SYSTEM ${NNPACK_INCLUDE_DIRS})
+    list(APPEND Shadow_LINKER_LIBS ${NNPACK_LIBRARIES})
+    message(STATUS "Found NNPACK: ${NNPACK_INCLUDE_DIRS}, ${NNPACK_LIBRARIES}")
+    add_definitions(-DUSE_NNPACK)
+  else ()
+    set(USE_NNPACK OFF)
+    message(WARNING "Could not find NNPACK, disable it")
   endif ()
-  if (${USE_DNNL})
+endif ()
+
+if (${USE_DNNL})
+  find_package(DNNL QUIET)
+  if (NOT DNNL_FOUND)
+    message(STATUS "Could not find dnnl library, build it from source")
+    download_external("${PROJECT_SOURCE_DIR}/cmake/external/DownloadDNNL.cmake"
+                      "${CMAKE_BINARY_DIR}/dnnl-download")
     find_package(DNNL QUIET)
-    if (NOT DNNL_FOUND)
-      message(STATUS "Could not find dnnl library, build it from source")
-      download_external("${PROJECT_SOURCE_DIR}/cmake/external/DownloadDNNL.cmake"
-                        "${CMAKE_BINARY_DIR}/dnnl-download")
-      find_package(DNNL QUIET)
-    endif ()
-    if (DNNL_FOUND)
-      include_directories(SYSTEM ${DNNL_INCLUDE_DIRS})
-      list(APPEND Shadow_LINKER_LIBS ${DNNL_LIBRARIES})
-      message(STATUS "Found DNNL: ${DNNL_INCLUDE_DIRS}, ${DNNL_LIBRARIES} (found version ${DNNL_VERSION})")
-      add_definitions(-DUSE_DNNL)
-    else ()
-      set(USE_DNNL OFF)
-      message(WARNING "Could not find DNNL, disable it")
-    endif ()
+  endif ()
+  if (DNNL_FOUND)
+    include_directories(SYSTEM ${DNNL_INCLUDE_DIRS})
+    list(APPEND Shadow_LINKER_LIBS ${DNNL_LIBRARIES})
+    message(STATUS "Found DNNL: ${DNNL_INCLUDE_DIRS}, ${DNNL_LIBRARIES} (found version ${DNNL_VERSION})")
+    add_definitions(-DUSE_DNNL)
+  else ()
+    set(USE_DNNL OFF)
+    message(WARNING "Could not find DNNL, disable it")
   endif ()
 endif ()


FindFreeRTOS is now working with STM32H7 targets

--- cmake/FindFreeRTOS.cmake
+++ cmake/FindFreeRTOS.cmake
@@ -72,7 +72,7 @@
     find_path(FreeRTOS_${PORT}_PATH
         NAMES portmacro.h
         PATHS "${FREERTOS_PATH}" "${FREERTOS_PATH}/FreeRTOS"
-        PATH_SUFFIXES "Source/portable/GCC/${PORT}"
+        PATH_SUFFIXES "Source/portable/GCC/${PORT}"  "Source/portable/GCC/${PORT}/r0p1"
         NO_DEFAULT_PATH
     )
     list(APPEND FreeRTOS_INCLUDE_DIRS "${FreeRTOS_${PORT}_PATH}")


Fixed OpenH264 detection script.

Fixed OpenH264 detection script.

--- cmake/FindOpenH264.cmake
+++ cmake/FindOpenH264.cmake
@@ -1,5 +1,7 @@
 # - Try to find the OpenH264 library
 # Once done this will define
+#
+#  OPENH264_ROOT - A list of search hints
 #
 #  OPENH264_FOUND - system has OpenH264
 #  OPENH264_INCLUDE_DIR - the OpenH264 include directory
@@ -9,8 +11,11 @@
 	set(OPENH264_FIND_QUIETLY TRUE)
 endif (OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)

-find_path(OPENH264_INCLUDE_DIR NAMES wels/codec_api.h wels/codec_app_def.h wels/codec_def.h)
-find_library(OPENH264_LIBRARY openh264)
+find_path(OPENH264_INCLUDE_DIR NAMES wels/codec_api.h wels/codec_app_def.h wels/codec_def.h HINTS ${OPENH264_ROOT})
+find_library(OPENH264_LIBRARY NAMES openh264 welsdec PATH_SUFFIXES lib HINTS ${OPENH264_ROOT})
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenH264 DEFAULT_MSG OPENH264_LIBRARY OPENH264_INCLUDE_DIR)

 if (OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)
 	set(OPENH264_FOUND TRUE)


FIX: add any as interface dep

FIX: add any as interface dep

--- cmake/external/any.cmake
+++ cmake/external/any.cmake
@@ -5,7 +5,7 @@
 INCLUDE_DIRECTORIES(${ANY_SOURCE_DIR}/src/linb_any)

 ExternalProject_Add(
-    linb_any
+    extern_lib_any
     ${EXTERNAL_PROJECT_LOG_ARGS}
     GIT_REPOSITORY  "https://github.com/thelink2012/any.git"
     GIT_TAG         "8fef1e93710a0edf8d7658999e284a1142c4c020"
@@ -17,5 +17,8 @@
     TEST_COMMAND      ""
 )

+ADD_LIBRARY(lib_any INTERFACE)
+ADD_DEPENDENCIES(lib_any extern_lib_any)
+
 add_definitions(-DANY_IMPL_ANY_CAST_MOVEABLE)
-LIST(APPEND external_project_dependencies linb_any)+LIST(APPEND external_project_dependencies extern_lib_any)


[axl] typo in import_latex.cmake

[axl] typo in import_latex.cmake

--- cmake/import_latex.cmake
+++ cmake/import_latex.cmake
@@ -1,11 +1,11 @@
 #..............................................................................

 if (NOT PDFLATEX_EXE)
-	axl_find_executable (PDFLATEX_EXE pdflagtex)
+	axl_find_executable (PDFLATEX_EXE pdflatex)

 	if (PDFLATEX_EXE)
 		message (STATUS "Pdflatex found at: ${PDFLATEX_EXE}")
-	endif ()
+	endif ()
 endif ()

 if (EXISTS ${PDFLATEX_EXE})


build: gRPC fixes for the bundled path

build: gRPC fixes for the bundled path

Signed-off-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>

--- cmake/modules/gRPC.cmake
+++ cmake/modules/gRPC.cmake
@@ -11,15 +11,21 @@
 # specific language governing permissions and limitations under the License.
 #

-option(BUILD_STATIC_GRPC
+option(USE_BUNDLED_DEPS
        "Build a static version of gRPC (useful for building in Operating Systems that don't have the gRPC package)" OFF)

-if(NOT BUILD_STATIC_GRPC)
+if(NOT USE_BUNDLED_DEPS)

   # zlib
   include(FindZLIB)
   set(ZLIB_INCLUDE "${ZLIB_INCLUDE_DIRS}")
   set(ZLIB_LIB "${ZLIB_LIBRARIES}")
+
+  if(ZLIB_INCLUDE AND ZLIB_LIB)
+    message(STATUS "Found zlib: ${PROTOC}, include: ${PROTOBUF_INCLUDE}, lib: ${PROTOBUF_LIB}")
+  else()
+    message(FATAL_ERROR "Couldn't find system protobuf")
+  endif()

   # protobuf
   find_program(PROTOC NAMES protoc)
@@ -32,9 +38,8 @@
   else()
     message(FATAL_ERROR "Couldn't find system protobuf")
   endif()
-
-  # gRPC
-  # todo(fntlnz, leodido): check that gRPC version is greater or equal than 1.8.0
+
+  # gRPC todo(fntlnz, leodido): check that gRPC version is greater or equal than 1.8.0
   find_path(GRPCXX_INCLUDE NAMES grpc++/grpc++.h)
   if(GRPCXX_INCLUDE)
     set(GRPC_INCLUDE ${GRPCXX_INCLUDE})
@@ -63,41 +68,54 @@
   endif()
   message(STATUS "Found pkg-config executable: ${PKG_CONFIG_EXECUTABLE}")
   set(GRPC_SRC "${PROJECT_BINARY_DIR}/grpc-prefix/src/grpc")
-  message(STATUS "Using bundled grpc in '${GRPC_SRC}'")
   set(GRPC_INCLUDE "${GRPC_SRC}/include")
   set(GRPC_LIB "${GRPC_SRC}/libs/opt/libgrpc.a")
   set(GRPCPP_LIB "${GRPC_SRC}/libs/opt/libgrpc++.a")
   set(GRPC_CPP_PLUGIN "${GRPC_SRC}/bins/opt/grpc_cpp_plugin")
-  # we tell gRPC to compile protobuf for us because
-  # when a gRPC package is not available, like on CentOS,
-  # it's very likely that protobuf will be very outdated
+
+  # we tell gRPC to compile protobuf for us because when a gRPC package is not available, like on CentOS, it's very
+  # likely that protobuf will be very outdated
   set(PROTOBUF_INCLUDE "${GRPC_SRC}/third_party/protobuf/src")
   set(PROTOC "${PROTOBUF_INCLUDE}/protoc")
   set(PROTOBUF_LIB "${PROTOBUF_INCLUDE}/.libs/libprotobuf.a")
-  # we tell gRPC to compile zlib for us because
-  # when a gRPC package is not available, like on CentOS,
-  # it's very likely that zlib will be very outdated
+  # we tell gRPC to compile zlib for us because when a gRPC package is not available, like on CentOS, it's very likely
+  # that zlib will be very outdated
   set(ZLIB_INCLUDE "${GRPC_SRC}/third_party/zlib")
   set(ZLIB_LIB "${ZLIB_INCLUDE}/libz.a")
-  # get_filename_component(PROTOC_DIR ${PROTOC} PATH)
+
+  message(STATUS "Using bundled gRPC in '${GRPC_SRC}'")
+  message(
+    STATUS
+      "Bundled gRPC comes with ---> protobuf: compiler: ${PROTOC}, include: ${PROTOBUF_INCLUDE}, lib: ${PROTOBUF_LIB}")
+  message(STATUS "Bundled gRPC comes with ---> zlib: include: ${ZLIB_INCLUDE}, lib: ${ZLIB_LIB}}")
+  message(STATUS "Bundled gRPC comes with ---> grpC cpp plugin: include: ${GRPC_CPP_PLUGIN}")
+
+  get_filename_component(PROTOC_DIR ${PROTOC} PATH)
+
+  include(ProcessorCount)
+  ProcessorCount(N)
+  if(NOT N EQUAL 0)
+    set(GRPC_BUILD_FLAGS -j${N})
+  endif()
+
+  # "cd ${ZLIB_INCLUDE} && ./configure && make"
   ExternalProject_Add(
     grpc
     GIT_REPOSITORY https://github.com/grpc/grpc.git
-    GIT_TAG v1.25.0
+    GIT_TAG v1.8.1
     GIT_SUBMODULES ""
+    BUILD_IN_SOURCE 1
+    BUILD_BYPRODUCTS ${GRPC_LIB} ${GRPCPP_LIB}
+    INSTALL_COMMAND ""
+    CONFIGURE_COMMAND ""
     BUILD_COMMAND
       CFLAGS=-Wno-implicit-fallthrough
-      LDFLAGS=-static
       HAS_SYSTEM_ZLIB=false
       HAS_SYSTEM_PROTOBUF=false
-      HAS_SYSTEM_CARES=false
-      CONFIGURE_COMMAND sh  -c "cd ${ZLIB_INCLUDE} && ./configure && make"
-      make
+      LDFLAGS=-static
+      PATH=${PROTOC_DIR}:$ENV{PATH}
+      make ${GRPC_BUILD_FLAGS}
       grpc_cpp_plugin
       static_cxx
-      static_c
-    BUILD_IN_SOURCE 1
-    BUILD_BYPRODUCTS ${GRPC_LIB} ${GRPCPP_LIB}
-    INSTALL_COMMAND "")
-
+      static_c)
 endif()


cmake: Use `release-*` as stable branch identifier

--- cmake/package-name.cmake
+++ cmake/package-name.cmake
@@ -127,7 +127,7 @@
         git_commit_count(GIT_COMMIT_COUNT)
         git_branch(GIT_BRANCH)

-        if ("${GIT_BRANCH}" STREQUAL "master")
+        if ("${GIT_BRANCH}" STREQUAL "master" OR GIT_BRANCH MATCHES "^release-*")
           set(${return_value}
             "${name}_${version}.${GIT_COMMIT_COUNT}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}${distribution}${build_type}" PARENT_SCOPE)
         else ()
@@ -135,7 +135,7 @@
             "${name}_${version}.${GIT_COMMIT_COUNT}~${GIT_BRANCH}_${GIT_COMMIT_HASH}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}${distribution}${build_type}"
             PARENT_SCOPE)

-        endif ("${GIT_BRANCH}" STREQUAL "master")
+        endif ("${GIT_BRANCH}" STREQUAL "master" OR GIT_BRANCH MATCHES "^release-*")

       else () # this will be the case when users download the github zip and compiles on deb systems


cmake-modules :
 * updated VRPN lookup script for Linux, should not include both libvrpn.a and libvrpnserver.a

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@2551 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/cmake-modules/FindThirdPartyVRPN.cmake
+++ trunk/cmake-modules/FindThirdPartyVRPN.cmake
@@ -9,14 +9,16 @@
 	MESSAGE(STATUS "  Found VRPN...")
 	INCLUDE_DIRECTORIES(${PATH_VRPN}/include)

-	FIND_LIBRARY(LIB_VRPN vrpn PATHS ${PATH_VRPN}/lib NO_DEFAULT_PATH)
-	FIND_LIBRARY(LIB_VRPN vrpn PATHS ${PATH_VRPN}/lib)
-	IF(LIB_VRPN)
-		MESSAGE(STATUS "    [  OK  ] lib ${LIB_VRPN}")
-		TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${LIB_VRPN})
-	ELSE(LIB_VRPN)
-		MESSAGE(STATUS "    [FAILED] lib vrpn")
-	ENDIF(LIB_VRPN)
+	IF(WIN32)
+		FIND_LIBRARY(LIB_VRPN vrpn PATHS ${PATH_VRPN}/lib NO_DEFAULT_PATH)
+		FIND_LIBRARY(LIB_VRPN vrpn PATHS ${PATH_VRPN}/lib)
+		IF(LIB_VRPN)
+			MESSAGE(STATUS "    [  OK  ] lib ${LIB_VRPN}")
+			TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${LIB_VRPN})
+		ELSE(LIB_VRPN)
+			MESSAGE(STATUS "    [FAILED] lib vrpn")
+		ENDIF(LIB_VRPN)
+	ENDIF(WIN32)

 	IF(UNIX)
 		FIND_LIBRARY(LIB_VRPNSERVER vrpnserver PATHS ${PATH_VRPN}/lib NO_DEFAULT_PATH)


Minor fix for iOS projects.

Minor fix for iOS projects.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -6,6 +6,8 @@
 endif ()

 macro(create_library target)
+set (CMAKE_OSX_ARCHITECTURES "armv7 arm64")
+
   set(CURRENT_TARGET ${target})
   #message(WARNING "*${PROJECT_NAME} STREQUAL ${target}*")
   if (NOT "${PROJECT_NAME}" STREQUAL ${target})


version 0.2.0

version 0.2.0

--- src/PluginConfig.cmake
+++ src/PluginConfig.cmake
@@ -5,7 +5,7 @@
 #
 #\**********************************************************/

-set(PLUGIN_VERSION "0.1.5")
+set(PLUGIN_VERSION "0.2.0")
 set(PLUGIN_NAME "FBVLC")
 set(PLUGIN_PREFIX "FBVLC")
 set(PLUGIN_DESCRIPTION "VLC Web Plugin (powered by FireBreath)")
@@ -19,9 +19,9 @@
 # 1) place vlc into FBVLC\Win\WiX\vlc-${VLC_VERSION}
 # 2) uncomment following
 if(APPLE)
-    set(VLC_VERSION "2.1.4")
+    set(VLC_VERSION "2.1.5")
 else()
-    set(VLC_VERSION "2.1.3")
+    set(VLC_VERSION "2.1.5")
 endif()
 # 3) run prepXXXX.cmd from FireBreath


Added flatbuffers_generate_headers and flatbuffers_generate_binary_files cmake functions. (#5830)

flatbuffers_generate_headers is a function that can be used to generate Flatbuffers headers and binary headers. It uses named argument flags to wrap all the flags relevant to C++ header generation that flatc uses. It generates an interface library that can be added as a dependency of other targets.

flatbuffers_generate_binary_files is a function that can be used to generate Flatbuffers binaries. It uses named argument flags to wrap all the flags relevant to C++ binary generation from JSON file that flatc uses. It generates an interface library that can be added as a dependency of other targets.

--- CMake/BuildFlatBuffers.cmake
+++ CMake/BuildFlatBuffers.cmake
@@ -95,7 +95,7 @@
       set(generated_include ${generated_includes_dir}/${filename}_generated.h)
       add_custom_command(
         OUTPUT ${generated_include}
-        COMMAND ${FLATC} ${FLATC_SCHEMA_ARGS}
+        COMMAND ${FLATC} ${FLATC_ARGS}
         -o ${generated_includes_dir}
         ${include_params}
         -c ${schema}
@@ -150,3 +150,249 @@
       ${copy_text_schemas_dir})
   endif()
 endfunction()
+
+# Creates a target that can be linked against that generates flatbuffer headers.
+#
+# This function takes a target name and a list of schemas. You can also specify
+# other flagc flags using the FLAGS option to change the behavior of the flatc
+# tool.
+#
+# Arguments:
+#   TARGET: The name of the target to generate.
+#   SCHEMAS: The list of schema files to generate code for.
+#   BINARY_SCHEMAS_DIR: The directory in which to generate binary schemas.
+#       Binary schemas will only be generated if a path is provided.
+#   INCLUDE: Search for includes in the specified paths. (Use this instead of
+#       "-I <path>" and the FLAGS option so that CMake is aware of the
+#       directories that need to be searched).
+#   FLAGS: A list of any additional flags that you would like to pass to flatc.
+#
+# Example:
+#
+#     flatbuffers_generate_headers(
+#         TARGET my_generated_headers_target
+#         SCHEMAS ${MY_SCHEMA_FILES}
+#         BINARY_SCHEMAS_DIR "${MY_BINARY_SCHEMA_DIRECTORY}"
+#         FLAGS
+#           --include-prefix "${MY_INCLUDE_PREFIX}"
+#           --gen-object-api)
+#
+#     target_link_libraries(MyExecutableTarget
+#         PRIVATE my_generated_headers_target
+#     )
+function(flatbuffers_generate_headers)
+  # Parse function arguments.
+  set(options)
+  set(one_value_args
+    "TARGET"
+    "BINARY_SCHEMAS_DIR")
+  set(multi_value_args
+    "SCHEMAS"
+    "INCLUDE"
+    "FLAGS")
+  cmake_parse_arguments(
+    PARSE_ARGV 0
+    FLATBUFFERS_GENERATE_HEADERS
+    "${options}"
+    "${one_value_args}"
+    "${multi_value_args}")
+
+  # Test if including from FindFlatBuffers
+  if(FLATBUFFERS_FLATC_EXECUTABLE)
+    set(FLATC_TARGET "")
+    set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE})
+  else()
+    set(FLATC_TARGET flatc)
+    set(FLATC flatc)
+  endif()
+
+  set(working_dir "${CMAKE_CURRENT_SOURCE_DIR}")
+
+  # Generate the include files parameters.
+  set(include_params "")
+  foreach (include_dir ${FLATBUFFERS_GENERATE_HEADERS_INCLUDE})
+    set(include_params -I ${include_dir} ${include_params})
+  endforeach()
+
+  # Create a directory to place the generated code.
+  set(generated_target_dir "${CMAKE_CURRENT_BINARY_DIR}/${FLATBUFFERS_GENERATE_HEADERS_TARGET}")
+  set(generated_include_dir "${generated_target_dir}")
+  if (NOT ${FLATBUFFERS_GENERATE_HEADERS_INCLUDE_PREFIX} STREQUAL "")
+    set(generated_include_dir "${generated_include_dir}/${FLATBUFFERS_GENERATE_HEADERS_INCLUDE_PREFIX}")
+  endif()
+
+  # Create rules to generate the code for each schema.
+  foreach(schema ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS})
+    get_filename_component(filename ${schema} NAME_WE)
+    set(generated_include "${generated_include_dir}/${filename}_generated.h")
+    add_custom_command(
+      OUTPUT ${generated_include}
+      COMMAND ${FLATC} ${FLATC_ARGS}
+      -o ${generated_include_dir}
+      ${include_params}
+      -c ${schema}
+      ${FLATBUFFERS_GENERATE_HEADERS_FLAGS}
+      DEPENDS ${FLATC_TARGET} ${schema}
+      WORKING_DIRECTORY "${working_dir}")
+    list(APPEND all_generated_header_files ${generated_include})
+
+    # Geneate the binary flatbuffers schemas if instructed to.
+    if (NOT ${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR} STREQUAL "")
+      set(binary_schema
+          "${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR}/${filename}.bfbs")
+      add_custom_command(
+        OUTPUT ${binary_schema}
+        COMMAND ${FLATC} -b --schema
+        -o ${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR}
+        ${include_params}
+        ${schema}
+        DEPENDS ${FLATC_TARGET} ${schema}
+        WORKING_DIRECTORY "${working_dir}")
+      list(APPEND all_generated_binary_files ${binary_schema})
+    endif()
+  endforeach()
+
+  # Set up interface library
+  add_library(${FLATBUFFERS_GENERATE_HEADERS_TARGET} INTERFACE)
+  target_sources(
+    ${FLATBUFFERS_GENERATE_HEADERS_TARGET}
+    INTERFACE
+      ${all_generated_header_files}
+      ${all_generated_binary_files}
+      ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS})
+  add_dependencies(
+    ${FLATBUFFERS_GENERATE_HEADERS_TARGET}
+    ${FLATC}
+    ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS})
+  target_include_directories(
+    ${FLATBUFFERS_GENERATE_HEADERS_TARGET}
+    INTERFACE ${generated_target_dir})
+
+  # Organize file layout for IDEs.
+  source_group(
+    TREE "${generated_target_dir}"
+    PREFIX "Flatbuffers/Generated/Headers Files"
+    FILES ${all_generated_header_files})
+  source_group(
+    TREE ${working_dir}
+    PREFIX "Flatbuffers/Schemas"
+    FILES ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS})
+  if (NOT ${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR} STREQUAL "")
+    source_group(
+      TREE "${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR}"
+      PREFIX "Flatbuffers/Generated/Binary Schemas"
+      FILES ${all_generated_binary_files})
+  endif()
+endfunction()
+
+# Creates a target that can be linked against that generates flatbuffer binaries
+# from json files.
+#
+# This function takes a target name and a list of schemas and Json files. You
+# can also specify other flagc flags and options to change the behavior of the
+# flatc compiler. Flags are named the same as they would be in the flatc tool
+# except ALL_CAPS. For example, --strict-json would be passed in as STRICT_JSON.
+#
+# Adding this target to your executable ensurses that the flatbuffer binaries
+# are compiled before your executable is run.
+#
+# Arguments:
+#   TARGET: The name of the target to generate.
+#   JSON_FILES: The list of json files to compile to flatbuffers binaries.
+#   SCHEMA: The flatbuffers schema of the Json files to be compiled.
+#   INCLUDE: Search for includes in the specified paths. (Use this instead of
+#       "-I <path>" and the FLAGS option so that CMake is aware of the
+#       directories that need to be searched).
+#   OUTPUT_DIR: The directly where the generated flatbuffers binaries should be
+#       placed.
+#   FLAGS: A list of any additional flags that you would like to pass to flatc.
+#
+# Example:
+#
+#     flatbuffers_generate_binary_files(
+#         TARGET my_binary_data
+#         SCHEMA "${MY_SCHEMA_DIR}/my_example_schema.fbs"
+#         JSON_FILES ${MY_JSON_FILES}
+#         OUTPUT_DIR "${MY_BINARY_DATA_DIRECTORY}"
+#         FLAGS --strict-json)
+#
+#     target_link_libraries(MyExecutableTarget
+#         PRIVATE my_binary_data
+#     )
+function(flatbuffers_generate_binary_files)
+  # Parse function arguments.
+  set(options)
+  set(one_value_args
+    "TARGET"
+    "SCHEMA"
+    "OUTPUT_DIR")
+  set(multi_value_args
+    "JSON_FILES"
+    "INCLUDE"
+    "FLAGS")
+  cmake_parse_arguments(
+    PARSE_ARGV 0
+    FLATBUFFERS_GENERATE_BINARY_FILES
+    "${options}"
+    "${one_value_args}"
+    "${multi_value_args}")
+
+  # Test if including from FindFlatBuffers
+  if(FLATBUFFERS_FLATC_EXECUTABLE)
+    set(FLATC_TARGET "")
+    set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE})
+  else()
+    set(FLATC_TARGET flatc)
+    set(FLATC flatc)
+  endif()
+
+  set(working_dir "${CMAKE_CURRENT_SOURCE_DIR}")
+
+  # Generate the include files parameters.
+  set(include_params "")
+  foreach (include_dir ${FLATBUFFERS_GENERATE_BINARY_FILES_INCLUDE})
+    set(include_params -I ${include_dir} ${include_params})
+  endforeach()
+
+  # Create rules to generate the flatbuffers binary for each json file.
+  foreach(json_file ${FLATBUFFERS_GENERATE_BINARY_FILES_JSON_FILES})
+    get_filename_component(filename ${json_file} NAME_WE)
+    set(generated_binary_file "${FLATBUFFERS_GENERATE_BINARY_FILES_OUTPUT_DIR}/${filename}.bin")
+    add_custom_command(
+      OUTPUT ${generated_binary_file}
+      COMMAND ${FLATC} ${FLATC_ARGS}
+      -o ${FLATBUFFERS_GENERATE_BINARY_FILES_OUTPUT_DIR}
+      ${include_params}
+      -b ${FLATBUFFERS_GENERATE_BINARY_FILES_SCHEMA} ${json_file}
+      ${FLATBUFFERS_GENERATE_BINARY_FILES_FLAGS}
+      DEPENDS ${FLATC_TARGET} ${json_file}
+      WORKING_DIRECTORY "${working_dir}")
+      list(APPEND all_generated_binary_files ${generated_binary_file})
+  endforeach()
+
+  # Set up interface library
+  add_library(${FLATBUFFERS_GENERATE_BINARY_FILES_TARGET} INTERFACE)
+  target_sources(
+    ${FLATBUFFERS_GENERATE_BINARY_FILES_TARGET}
+    INTERFACE
+      ${all_generated_binary_files}
+      ${FLATBUFFERS_GENERATE_BINARY_FILES_JSON_FILES}
+      ${FLATBUFFERS_GENERATE_BINARY_FILES_SCHEMA})
+  add_dependencies(
+    ${FLATBUFFERS_GENERATE_BINARY_FILES_TARGET}
+    ${FLATC})
+
+  # Organize file layout for IDEs.
+  source_group(
+    TREE ${working_dir}
+    PREFIX "Flatbuffers/JSON Files"
+    FILES ${FLATBUFFERS_GENERATE_BINARY_FILES_JSON_FILES})
+  source_group(
+    TREE ${working_dir}
+    PREFIX "Flatbuffers/Schemas"
+    FILES ${FLATBUFFERS_GENERATE_BINARY_FILES_SCHEMA})
+  source_group(
+    TREE ${FLATBUFFERS_GENERATE_BINARY_FILES_OUTPUT_DIR}
+    PREFIX "Flatbuffers/Generated/Binary Files"
+    FILES ${all_generated_binary_files})
+endfunction()


Remove unnecessary additions in PolycodeInclude

--- CMake/PolycodeIncludes.cmake
+++ CMake/PolycodeIncludes.cmake
@@ -1,12 +1,3 @@
-# If the following short ugly mess is not present, failures can occur with -G "Unix Makefiles".
-# FIXME: cmake should be finding ALL of the following things by way of CMAKE_PREFIX_PATH
-IF (MINGW)
-SET(OGG_LIBRARY libogg)
-SET(OGG_INCLUDE_DIR ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/include)
-SET(PNG_LIBRARY png)
-SET(PNG_PNG_INCLUDE_DIR ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/include)
-ENDIF()
-
 # platform specific defines and include directories for win and sdl
 IF(MSVC OR MINGW)
     ADD_DEFINITIONS(/D_UNICODE /DUNICODE)


Add VTK_LIBRARY_DIRS as link directory when appropriate

--- CMake/ctkMacroBuildLib.cmake
+++ CMake/ctkMacroBuildLib.cmake
@@ -120,10 +120,16 @@
       LIST(APPEND my_EXTRA_PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${PYTHONQT_LIBRARIES})
       # Should we link against VTK
       IF(CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK)
-        LINK_DIRECTORIES(${VTK_LIBRARY_DIRS})
         LIST(APPEND my_EXTRA_PYTHON_LIBRARIES vtkCommon vtkPythonCore)
       ENDIF()
     ENDIF()
+  ENDIF()
+
+  # The current library might not be wrapped. Nevertheless, if one of its dependent library
+  # is linked using vtkCommon or vtkPythonCore, VTK_LIBRARY_DIRS should be added
+  # as a link directories.
+  IF(CTK_WRAP_PYTHONQT_LIGHT AND CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK)
+    LINK_DIRECTORIES(${VTK_LIBRARY_DIRS})
   ENDIF()

   ADD_LIBRARY(${lib_name} ${MY_LIBRARY_TYPE}


hgversion.cmake avoid the case the .hg is not there

--- CMakeModules/hgversion.cmake
+++ CMakeModules/hgversion.cmake
@@ -1,12 +1,12 @@
 set(CMAKE_MODULE_PATH ${TOP_SOURCE_DIR}/CMakeModules)
 find_package(Mercurial)
-if (MERCURIAL_FOUND)
+if (MERCURIAL_FOUND AND IS_DIRECTORY ${TOP_SOURCE_DIR}/.hg)
   MERCURIAL_HG_INFO(${TOP_SOURCE_DIR} TOOLS)
   MESSAGE("Current revision is ${TOOLS_HG_ID}")
   set (TOOLS_HG_ID "hgid: ${TOOLS_HG_ID}")
-else(MERCURIAL_FOUND)
+else (MERCURIAL_FOUND AND IS_DIRECTORY ${TOP_SOURCE_DIR}/.hg)
   set (TOOLS_HG_ID)
-endif(MERCURIAL_FOUND)
+endif (MERCURIAL_FOUND AND IS_DIRECTORY ${TOP_SOURCE_DIR}/.hg)
 set (HG_HEADER "hgversion.h")
 set (NEW_HG_HEADER "new_hgversion.h")
 file(WRITE ${NEW_HG_HEADER} "static const std::string hgversion = \"${TOOLS_HG_ID}\";\n")


BUG: A fix for using sys installed GDCM.

When ITK_USE_SYS_GDCM is on, "include ${GDCM_USE_FILE}"
was missing from the itk-module-init.cmake, which could
cause "not found" linking error in external applications.

Change-Id: If01993ebd1d1ee3d6a20c849ea56944c766ea260

--- Modules/ThirdParty/GDCM/itk-module-init.cmake
+++ Modules/ThirdParty/GDCM/itk-module-init.cmake
@@ -3,4 +3,5 @@

 if(ITK_USE_SYSTEM_GDCM)
   find_package(GDCM REQUIRED)
+  include(${GDCM_USE_FILE})
 endif()


videoio: added gst-audio dependency

videoio: added gst-audio dependency

--- modules/videoio/cmake/detect_gstreamer.cmake
+++ modules/videoio/cmake/detect_gstreamer.cmake
@@ -93,11 +93,12 @@
   ocv_check_modules(GSTREAMER_riff gstreamer-riff-1.0)
   ocv_check_modules(GSTREAMER_pbutils gstreamer-pbutils-1.0)
   ocv_check_modules(GSTREAMER_video gstreamer-video-1.0)
-  if(GSTREAMER_base_FOUND AND GSTREAMER_app_FOUND AND GSTREAMER_riff_FOUND AND GSTREAMER_pbutils_FOUND AND GSTREAMER_video_FOUND)
+  ocv_check_modules(GSTREAMER_audio gstreamer-audio-1.0)
+  if(GSTREAMER_base_FOUND AND GSTREAMER_app_FOUND AND GSTREAMER_riff_FOUND AND GSTREAMER_pbutils_FOUND AND GSTREAMER_video_FOUND AND GSTREAMER_audio_FOUND)
     set(HAVE_GSTREAMER TRUE)
     set(GSTREAMER_VERSION ${GSTREAMER_base_VERSION})  # informational
-    set(GSTREAMER_LIBRARIES ${GSTREAMER_base_LIBRARIES} ${GSTREAMER_app_LIBRARIES} ${GSTREAMER_riff_LIBRARIES} ${GSTREAMER_pbutils_LIBRARIES} ${GSTREAMER_video_LIBRARIES})
-    set(GSTREAMER_INCLUDE_DIRS ${GSTREAMER_base_INCLUDE_DIRS} ${GSTREAMER_app_INCLUDE_DIRS} ${GSTREAMER_riff_INCLUDE_DIRS} ${GSTREAMER_pbutils_INCLUDE_DIRS} ${GSTREAMER_video_INCLUDE_DIRS})
+    set(GSTREAMER_LIBRARIES ${GSTREAMER_base_LIBRARIES} ${GSTREAMER_app_LIBRARIES} ${GSTREAMER_riff_LIBRARIES} ${GSTREAMER_pbutils_LIBRARIES} ${GSTREAMER_video_LIBRARIES} ${GSTREAMER_audio_LIBRARIES})
+    set(GSTREAMER_INCLUDE_DIRS ${GSTREAMER_base_INCLUDE_DIRS} ${GSTREAMER_app_INCLUDE_DIRS} ${GSTREAMER_riff_INCLUDE_DIRS} ${GSTREAMER_pbutils_INCLUDE_DIRS} ${GSTREAMER_video_INCLUDE_DIRS} ${GSTREAMER_audio_INCLUDE_DIRS})
   endif()
 endif()


Also search for LabJack's exodriver in /usr and /usr/lib

--- CMake/FindLabJack.cmake
+++ CMake/FindLabJack.cmake
@@ -11,7 +11,7 @@
 # Attempt to define LABJACK_INCLUDE_DIR if undefined
 find_path(LABJACK_INCLUDE_DIR
 	NAMES LabJackUD.h labjackusb.h
-	PATHS "$ENV{LABJACK_SDK}" "/usr/local"
+	PATHS "$ENV{LABJACK_SDK}" "/usr/local" "/usr"
 	PATH_SUFFIXES "include"
 	NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH
 )
@@ -22,7 +22,7 @@

 find_library(LABJACK_LIBRARY
 	NAMES LabJackUD labjackusb
-	HINTS ${LABJACK_ROOT_DIR} "/usr/local/lib"
+	HINTS ${LABJACK_ROOT_DIR} "/usr/local/lib" "/usr/lib"
 	NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH
 )
 mark_as_advanced(LABJACK_LIBRARY)


cmake: Remove unused lapackSetup CMake module

It became obsolete following commit 7cd1f592b

--- CMake/lapackSetup.cmake
+++ CMake/lapackSetup.cmake
@@ -1,59 +0,0 @@
-# sets the following variables
-# LAPACK_FOUND         - Set to true when lapack is found.
-# LAPACK_INCLUDE_DIR   - Include directory for lapack headers.
-# LAPACK_LIBRARY_DIR   - Link directory for lapack libraries.
-# LAPACK_LIBRARIES     - list of lapack libraries
-
-find_path(LAPACK_LIBRARY_DIR liblapack.a
-  ${NeuroLib_LIBS_PATH}
-  /usr/lib /opt/local/lib /usr/local/lib /tools/lib  /usr/lib64
-  DOC " directory for lapack, where liblapack can be found"
-  )
-
-if(LAPACK_LIBRARY_DIR)
-  set(LAPACK_FOUND 1)
-  set(LAPACK_INCLUDE_DIR ${LAPACK_LIBRARY_DIR}/../include)
-
-  if(WIN32)
-    set(LAPACK_LIBRARIES
-      lapack
-      blas
-      )
-  endif()
-  if(CMAKE_SYSTEM MATCHES "Darwin*")
-    set(LAPACK_LIBRARIES
-      lapack
-      blas
-      )
-  endif()
-  if(CMAKE_SYSTEM MATCHES "Sun*")
-    set(LAPACK_LIBRARIES
-      lapack
-      blas
-      I77
-      F77
-      )
-  endif()
-  if(CMAKE_SYSTEM MATCHES "Linux*")
-	exec_program(gcc ARGS --version OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION)
-	if(CMAKE_C_COMPILER_VERSION MATCHES ".*4\\.[0-9]\\.[0-9].*")
-		set(GCC_FORTRAN_LIBRARY gfortran)
-	else()
-		set(GCC_FORTRAN_LIBRARY g2c)
-	endif()
-    set(LAPACK_LIBRARIES
-      lapack
-      blas
-      ${GCC_FORTRAN_LIBRARY}
-      )
-  endif()
-
-else()
-  message(FATAL_ERROR "LAPACK library not found!\n" "Please go to http://www.ia.unc.edu/dev/tutorials/InstallLib")
-  set(LAPACK_INCLUDE_DIR NOT_FOUND)
-  set(LAPACK_FOUND 0)
-endif()
-
-include_directories(${LAPACK_INCLUDE_DIR})
-link_directories(${LAPACK_LIBRARY_DIR})
-link_libraries(${LAPACK_LIBRARIES})


Set VTK_PYTHON_WRAPPED correctly.

Set VTK_PYTHON_WRAPPED correctly.

Commit b26e66f9 introduced a bug where VTK_PYTHON_WRAPPED global property wasn't
being set correctly. It included modules that weren't being Python wrapped due
to the newly added variables. This caused static builds to fail miserably.
Fixing the logic and also cleanin up the setting of those global properties
closer to the code that actually does the wrapping to avoid such oversight  in
future.

Change-Id: I9884820680f496f2e22ddb287f345e7ff606451e

--- CMake/vtkWrapping.cmake
+++ CMake/vtkWrapping.cmake
@@ -24,18 +24,10 @@
 function(vtk_add_wrapping module_name module_srcs module_hdrs)
   if(NOT ${module_name}_EXCLUDE_FROM_WRAPPING)
     set(_wrap_module FALSE)
-    if(VTK_WRAP_PYTHON)
+    if(VTK_WRAP_PYTHON OR VTK_WRAP_TCL OR VTK_WRAP_JAVA)
       set(_wrap_module TRUE)
-      set_property(GLOBAL APPEND PROPERTY VTK_PYTHON_WRAPPED ${module_name})
     endif()
-    if(VTK_WRAP_TCL)
-      set(_wrap_module TRUE)
-      set_property(GLOBAL APPEND PROPERTY VTK_TCL_WRAPPED ${module_name})
-    endif()
-    if(VTK_WRAP_JAVA)
-      set(_wrap_module TRUE)
-      set_property(GLOBAL APPEND PROPERTY VTK_JAVA_WRAPPED ${module_name})
-    endif()
+
     if(_wrap_module)
       # The list of include dirs to pass to wrapper tool command lines
       set(VTK_WRAP_INCLUDE_DIRS)
@@ -59,13 +51,16 @@
       # Now to wrap the languages that are on.
       if(VTK_WRAP_PYTHON)
         if (${module_name}_WRAP_PYTHON)
+          set_property(GLOBAL APPEND PROPERTY VTK_PYTHON_WRAPPED ${module_name})
           vtk_add_python_wrapping(${module_name} "${module_srcs}" "${module_hdrs}")
         endif()
       endif()
       if(VTK_WRAP_TCL)
+        set_property(GLOBAL APPEND PROPERTY VTK_TCL_WRAPPED ${module_name})
         vtk_add_tcl_wrapping(${module_name} "${module_srcs}" "${module_hdrs}")
       endif()
       if(VTK_WRAP_JAVA)
+        set_property(GLOBAL APPEND PROPERTY VTK_JAVA_WRAPPED ${module_name})
         vtk_add_java_wrapping(${module_name} "${module_srcs}" "${module_hdrs}")
       endif()
     endif()


[CMake] Need to filter ${arch}/*.c builtins as well as ${arch}/*.S builtins.

This was broken in r248542 when I refactored this to support builtins where ${arch} didn't match the directory prefix (i.e. armv7s).

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@252365 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -220,7 +220,7 @@
     list(FIND ${excluded_list} ${_name_we} _found)
     if(_found ${filter_action} ${filter_value})
       list(REMOVE_ITEM intermediate ${_file})
-    elseif(${_file} MATCHES ".*/.*\\.S")
+    elseif(${_file} MATCHES ".*/.*\\.S" OR ${_file} MATCHES ".*/.*\\.c")
       get_filename_component(_name ${_file} NAME)
       string(REPLACE ".S" ".c" _cname "${_name}")
       list(REMOVE_ITEM intermediate ${_cname})


cmake: emit warnings about unsupported options if turned ON only

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -605,7 +605,9 @@
       option(${variable} "${description}" ${__value})
     endif()
   else()
-    if(DEFINED ${variable} AND NOT OPENCV_HIDE_WARNING_UNSUPPORTED_OPTION)
+    if(DEFINED ${variable} AND "${${variable}}"  # emit warnings about turned ON options only.
+        AND NOT (OPENCV_HIDE_WARNING_UNSUPPORTED_OPTION OR "$ENV{OPENCV_HIDE_WARNING_UNSUPPORTED_OPTION}")
+    )
       message(WARNING "Unexpected option: ${variable} (=${${variable}})\nCondition: IF (${__condition})")
     endif()
     if(OPENCV_UNSET_UNSUPPORTED_OPTION)


cleanups to test.cmake

cleanups to test.cmake

--- common/cmake/test.cmake
+++ common/cmake/test.cmake
@@ -30,28 +30,25 @@
   SET(EMBREE_MODEL_DIR ${EMBREE_TESTING_MODEL_DIR})
 ENDIF()

-MACRO (ADD_EMBREE_NORMAL_TEST name reference executable args)
+MACRO (ADD_EMBREE_NORMAL_CPP_TEST name reference executable args)
   IF (BUILD_TESTING)
     ADD_TEST(NAME ${name}
              WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
              COMMAND ${executable} --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
   ENDIF()
-
-  IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
-    IF (BUILD_TESTING)
-      ADD_TEST(NAME ${name}_ispc
-               WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
-               COMMAND ${executable}_ispc --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
-    ENDIF()
-  ENDIF()
 ENDMACRO()

-MACRO (ADD_EMBREE_TEST_WITHOUT_ISPC name)
-  IF (BUILD_TESTING)
-    ADD_TEST(NAME ${name}
+MACRO (ADD_EMBREE_NORMAL_ISPC_TEST name reference executable args)
+  IF (BUILD_TESTING AND EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
+    ADD_TEST(NAME ${name}_ispc
              WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
-             COMMAND ${executable} --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
-  ENDIF()
+             COMMAND ${executable}_ispc --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
+  ENDIF()
+ENDMACRO()
+
+MACRO (ADD_EMBREE_NORMAL_TEST name reference executable args)
+  ADD_EMBREE_NORMAL_CPP_TEST(${name} ${reference} ${executable} "${args}")
+  ADD_EMBREE_NORMAL_ISPC_TEST(${name} ${reference} ${executable} "${args}")
 ENDMACRO()

 MACRO (ADD_EMBREE_TEST name)


added all scenes to test, large scenes are only added when host machine has more han 10GB of memory

--- common/cmake/test.cmake
+++ common/cmake/test.cmake
@@ -21,6 +21,8 @@
 INCLUDE(CTest)

 IF (BUILD_TESTING)
+
+  CMAKE_HOST_SYSTEM_INFORMATION(RESULT memory QUERY TOTAL_PHYSICAL_MEMORY)

   SET(BUILD_TESTING_MODEL_DIR "${PROJECT_SOURCE_DIR}/models" CACHE FILEPATH "Path to the folder containing the Embree models for regression testing.")

@@ -43,13 +45,11 @@
   FILE(READ "${BUILD_TESTING_MODEL_DIR}/embree-models-large.txt" models_large)
   STRING(REGEX REPLACE "\n" ";" models_large "${models_large}")

-  SET(models ${models_small_win32}) # FIXME: configure all models
+  SET(models ${models_small_x64})
+  IF (${memory} GREATER 10000)
+    SET(models ${models} ${models_large})
+  ENDIF()

-  #if platform == 'Win32': models += models_small_win32
-  #else:                   models += models_small_x64
-  #if platform == 'x64' and OS != 'macosx':
-  #  models += models_large
-
   MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)

     ADD_TEST(NAME ${name}


Revert "COMP: update find_package for boost"

This reverts commit e883243c2f4b728699e45e1930301acb0acbeeb6.

--- Modules/ThirdParty/Boost/otb-module-init.cmake
+++ Modules/ThirdParty/Boost/otb-module-init.cmake
@@ -1,20 +1,19 @@
 # Required
 message(STATUS "Looking for required Boost headers")
+find_package ( Boost
+  1.35.0
+  REQUIRED
+  )

-# Mandatory components
-# - date_time -> ossim plugins
-set(OTB_Boost_COMPONENTS date_time)
 # Optional components
 # Boost (OPTIONAL_COMPONENTS does not work with Boost find_package)
 # unit_test_framework component is used only in GdalAdapters module
 if (BUILD_TESTING)
-  list(APPEND OTB_Boost_COMPONENTS unit_test_framework)
+  set(OTB_Boost_OPTIONAL_COMPONENTS unit_test_framework)
+  message(STATUS "Looking for optional Boost components : ${OTB_Boost_OPTIONAL_COMPONENTS}")
+  find_package ( Boost
+    QUIET
+    1.35.0
+    COMPONENTS ${OTB_Boost_OPTIONAL_COMPONENTS}
+    )
 endif()
-
-#Quiet find package to avoid message "Could not find boost" because unit_testing_framework is not installed
-#message(STATUS "Looking for optional Boost components : ${OTB_Boost_OPTIONAL_COMPONENTS}")
-find_package ( Boost
-  REQUIRED
-  1.35.0
-  COMPONENTS ${OTB_Boost_COMPONENTS}
-  )


Only compile GeometricFit_test if FFTW is present.

--- source/TEST/cmake/BALLTestExecutables.cmake
+++ source/TEST/cmake/BALLTestExecutables.cmake
@@ -112,7 +112,6 @@
 	Genes_test
 	GeneticAlgorithm_test
 	GeneticIndividual_test
-	GeometricFit_test
 	GridAnalysis_test
 	MolDB_test
 	Parameter_test
@@ -124,6 +123,12 @@
 	StaticLigandFragment_test
 	StructurePreparer_test
 )
+
+IF(BALL_HAS_FFTW)
+	LIST(APPEND BALL_DOCKING_TESTS
+		GeometricFit_test
+	)
+ENDIF()

 SET(BALL_SCORING_TESTS
 	CHPI_test


Install perf tests, fix test naming

Install perf tests, fix test naming

--- CommonCPPCTest.cmake
+++ CommonCPPCTest.cmake
@@ -88,6 +88,8 @@
   if("${NAME}" MATCHES "^perf" OR "${NAME}" MATCHES "perf-")
     list(APPEND ALL_CPP_PERF_TESTS ${TEST_NAME})
     set(TEST_LABELS ${PROJECT_NAME}-perf)
+    install(TARGETS ${TEST_NAME} DESTINATION share/${PROJECT_NAME}/benchmarks
+      COMPONENT apps)
   else()
     list(APPEND ALL_CPP_TESTS ${TEST_NAME})
     set(TEST_LABELS ${PROJECT_NAME}-unit)
@@ -102,7 +104,7 @@

 foreach(FILE ${TEST_FILES})
   string(REGEX REPLACE "\\.(c|cpp)$" "" NAME ${FILE})
-  string(REGEX REPLACE "[./]" "_" NAME ${NAME})
+  string(REGEX REPLACE "[./]" "-" NAME ${NAME})
   source_group(\\ FILES ${FILE})

   if(MSVC)


Help consuming projects find Eigen if they're building against a build tree.

--- cmake-local/osvrConfigBuildTreePaths.cmake
+++ cmake-local/osvrConfigBuildTreePaths.cmake
@@ -16,6 +16,11 @@
     list(APPEND CMAKE_PREFIX_PATH "${OpenCV_DIR_IMPORTED}")
 endif()

+# Likewise for our vendored header-only libraries - just Eigen for now.
+if(NOT EIGEN3_FOUND)
+    list(APPEND CMAKE_PREFIX_PATH "@OSVR_VENDORED_EIGEN_ROOT@")
+endif()
+
 # Help out with boost.
 if(NOT BOOST_FOUND)
     include("${CMAKE_CURRENT_LIST_DIR}/CMakeBoostHelper.cmake" OPTIONAL)


cmake: Define BSD.

cmake: Define BSD.

--- cmake/Modules/DefinePlatformDefaults.cmake
+++ cmake/Modules/DefinePlatformDefaults.cmake
@@ -6,14 +6,17 @@

 if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
     set(FREEBSD TRUE)
+    set(BSD TRUE)
 endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")

 if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
     set(OPENBSD TRUE)
+    set(BSD TRUE)
 endif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")

 if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
     set(NETBSD TRUE)
+    set(BSD TRUE)
 endif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")

 if (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")


[cmake] Turns out ClangTargets.cmake can also be in $CLANG_BUILD/lib/cmake/clang.

LLVM's cmake path has this extra path (for LLVM) as well. I should have followed
its example. = /.

rdar://26154980

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -122,7 +122,8 @@

   # Add all Clang CMake paths to our cmake module path.
   set(SWIFT_CLANG_CMAKE_PATHS
-    "${PATH_TO_CLANG_BUILD}/share/clang/cmake")
+    "${PATH_TO_CLANG_BUILD}/share/clang/cmake"
+    "${PATH_TO_CLANG_BUILD}/lib/cmake/clang")
   foreach(path ${SWIFT_CLANG_CMAKE_PATHS})
     list(APPEND CMAKE_MODULE_PATH ${path})
   endforeach()


add -fPIC flag to Intel CC flags for static linking

--- cmake/CCompilers.cmake
+++ cmake/CCompilers.cmake
@@ -57,6 +57,10 @@
             "${CMAKE_C_FLAGS} -openmp"
             )
     endif()
+
+    if(ENABLE_STATIC_LINKING)
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+    endif()
 endif()

 if(CMAKE_C_COMPILER_ID MATCHES PGI)


Fix detection of Eigen3

Fix detection of Eigen3

--- cmake/FindEigen3.cmake
+++ cmake/FindEigen3.cmake
@@ -68,6 +68,17 @@
       PATH_SUFFIXES eigen3 eigen
     )

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


cmake: Add missing space

cmake: Add missing space

--- cmake/FindOpenVR.cmake
+++ cmake/FindOpenVR.cmake
@@ -6,7 +6,7 @@

 if(WIN32)
 	find_library(OpenVR_LIBRARY_TEMP "openvr_api" PATH_SUFFIXES lib/win32 PATHS ${OpenVR_ROOT_DIR})
-	find_file(OpenVR_DYLIB "openvr_api.dll"PATH_SUFFIXES bin/win32 PATHS ${OpenVR_ROOT_DIR} NO_DEFAULT_PATH)
+	find_file(OpenVR_DYLIB "openvr_api.dll" PATH_SUFFIXES bin/win32 PATHS ${OpenVR_ROOT_DIR} NO_DEFAULT_PATH)
 endif()

 if(OpenVR_LIBRARY_TEMP)


Find python in target architecture directory

--- cmake/FindPython.cmake
+++ cmake/FindPython.cmake
@@ -26,6 +26,7 @@
         python${PYTHON_VERSION}
         python${PYTHON_VERSION}m
     PATHS ${PYTHON_LIB_PATH}
+    PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE}
     NO_DEFAULT_PATH
     NO_SYSTEM_ENVIRONMENT_PATH
     )


cmake: Bump MIN_WEST_VERSION to 0.7.1

cmake: Bump MIN_WEST_VERSION to 0.7.1

Updated WEST_DIR requires version >= 0.7.0

Signed-off-by: Emil Hammarstrom <e456169284bdecdfbe793037ecbdc5d671b9c3a2@gmail.com>

--- cmake/host-tools.cmake
+++ cmake/host-tools.cmake
@@ -12,7 +12,7 @@
 else()
   # If west is found, make sure its version matches the minimum
   # required one.
-  set(MIN_WEST_VERSION 0.6.0)
+  set(MIN_WEST_VERSION 0.7.1)
   execute_process(
     COMMAND
     ${PYTHON_EXECUTABLE}
@@ -38,13 +38,11 @@
   # even after output is one line.
   message(STATUS "Found west: ${WEST} (found suitable version \"${west_version}\", minimum required is \"${MIN_WEST_VERSION}\")")

-  if (${west_version} VERSION_GREATER_EQUAL "0.7.1")
-    execute_process(
-      COMMAND ${WEST}  topdir
-      OUTPUT_VARIABLE  WEST_TOPDIR
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-      )
-  endif()
+  execute_process(
+    COMMAND ${WEST}  topdir
+    OUTPUT_VARIABLE  WEST_TOPDIR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
 endif()

 # dtc is an optional dependency. Search for it on PATH and in


Add support for Route 53 Auto Naming service (ServiceDiscovery)

--- cmake/sdksCommon.cmake
+++ cmake/sdksCommon.cmake
@@ -133,6 +133,7 @@
 list(APPEND C2J_LIST "sdb:2009-04-15")
 list(APPEND C2J_LIST "serverlessrepo:2017-09-08")
 list(APPEND C2J_LIST "servicecatalog:2015-12-10")
+list(APPEND C2J_LIST "servicediscovery:2017-03-14")
 list(APPEND C2J_LIST "shield:2016-06-02")
 list(APPEND C2J_LIST "sms:2016-10-24")
 list(APPEND C2J_LIST "snowball:2016-06-30")


modified test target hierarchie to not build all tests when running only a subset of tests

--- cmake/test/tests.cmake
+++ cmake/test/tests.cmake
@@ -64,5 +64,5 @@
     COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE}
     ${catkin_EXTRAS_DIR}/test/run_tests.py --results ${results} ${working_dir_arg} ${_testing_COMMAND})
   add_dependencies(run_tests_${PROJECT_NAME}_${type} run_tests_${PROJECT_NAME}_${type}_${name})
-  add_dependencies(run_tests_${PROJECT_NAME}_${type}_${name} tests)
+  add_dependencies(run_tests_${PROJECT_NAME}_${type}_${name})
 endfunction()


reset -O2 for Debug mode

reset -O2 for Debug mode

--- common/cmake/icc.cmake
+++ common/cmake/icc.cmake
@@ -26,7 +26,7 @@
 SET(CMAKE_CXX_COMPILER "icpc")
 SET(CMAKE_C_COMPILER "icc")
 SET(CMAKE_CXX_FLAGS "-Wall -fPIC -std=c++11 -no-ansi-alias -static-intel -fasm-blocks")
-SET(CMAKE_CXX_FLAGS_DEBUG          "-DDEBUG  -g -O0")
+SET(CMAKE_CXX_FLAGS_DEBUG          "-DDEBUG  -g -O2")
 SET(CMAKE_CXX_FLAGS_RELEASE        "-DNDEBUG    -O3 -restrict")
 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -g -O3 -restrict")
 SET(CMAKE_EXE_LINKER_FLAGS "")


Fix FindCTDopts.cmake if CTDopts is not installed.

String variables should be quoted to avoid cases where an empty variable
is treated as if not present.

--- cmake/FindCTDopts.cmake
+++ cmake/FindCTDopts.cmake
@@ -10,7 +10,7 @@
 	# CTDopts is a module, so we don't need to find a script, rather, just make sure it is properly installed
 	FIND_FILE(_find_ctdopts_py FindCTDopts.py PATHS ${CMAKE_MODULE_PATH})
 	EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_ctdopts_py} OUTPUT_VARIABLE stdout ERROR_VARIABLE stderr RESULT_VARIABLE exit_code OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
-	STRING(STRIP ${stdout} stdout)
+	STRING(STRIP "${stdout}" stdout)
 	IF((stdout STREQUAL "CTDopts seems to be working.") AND (exit_code EQUAL 0))
     	SET(CTDOPTS_MODULE TRUE)
 	ELSE()


Fix CMake CursesW finding routine

Fix CMake CursesW finding routine

--- cmake/FindCursesW.cmake
+++ cmake/FindCursesW.cmake
@@ -29,7 +29,7 @@
 FIND_LIBRARY(CURSESW_CURSESW_LIBRARY NAMES cursesw )
 FIND_LIBRARY(CURSESW_NCURSESW_LIBRARY NAMES ncursesw )

-IF(CURSESW_NCURSESW_LIBRARY  AND NOT  CURSESW_CURSESW_LIBRARY)
+IF(CURSESW_NCURSESW_LIBRARY AND ((NOT CURSESW_CURSESW_LIBRARY) OR CURSES_NEED_NCURSES))
   SET(CURSESW_USE_NCURSESW TRUE)
 ENDIF()


Ugly fix for being compatible with superbuild

--- cmake/FindTinyXML.cmake
+++ cmake/FindTinyXML.cmake
@@ -1,74 +1,124 @@
-##################################################################################################
-#
-# CMake script for finding TinyXML.
-#
-# Input variables:
-#
-# - TinyXML_ROOT_DIR (optional): When specified, header files and libraries will be searched for in
-#     ${TinyXML_ROOT_DIR}/include
-#     ${TinyXML_ROOT_DIR}/libs
-#   respectively, and the default CMake search order will be ignored. When unspecified, the default
-#   CMake search order is used.
-#   This variable can be specified either as a CMake or environment variable. If both are set,
-#   preference is given to the CMake variable.
-#   Use this variable for finding packages installed in a nonstandard location, or for enforcing
-#   that one of multiple package installations is picked up.
-#
-#
-# Cache variables (not intended to be used in CMakeLists.txt files)
-#
-# - TinyXML_INCLUDE_DIR: Absolute path to package headers.
-# - TinyXML_LIBRARY: Absolute path to library.
-#
-#
-# Output variables:
-#
-# - TinyXML_FOUND: Boolean that indicates if the package was found
-# - TinyXML_INCLUDE_DIRS: Paths to the necessary header files
-# - TinyXML_LIBRARIES: Package libraries
-#
-#
-# Example usage:
-#
-#  find_package(TinyXML)
-#  if(NOT TinyXML_FOUND)
-#    # Error handling
-#  endif()
-#  ...
-#  include_directories(${TinyXML_INCLUDE_DIRS} ...)
-#  ...
-#  target_link_libraries(my_target ${TinyXML_LIBRARIES})
-#
-##################################################################################################

-# Get package location hint from environment variable (if any)
-if(NOT TinyXML_ROOT_DIR AND DEFINED ENV{TinyXML_ROOT_DIR})
-  set(TinyXML_ROOT_DIR "$ENV{TinyXML_ROOT_DIR}" CACHE PATH
-      "TinyXML base directory location (optional, used for nonstandard installation paths)")
+
+if(DEFINED __STANDARD_FIND_MODULE_INCLUDED)
+  return()
 endif()
+set(__STANDARD_FIND_MODULE_INCLUDED TRUE)

-# Search path for nonstandard package locations
-if(TinyXML_ROOT_DIR)
-  set(TinyXML_INCLUDE_PATH PATHS "${TinyXML_ROOT_DIR}/include" NO_DEFAULT_PATH)
-  set(TinyXML_LIBRARY_PATH PATHS "${TinyXML_ROOT_DIR}/lib"     NO_DEFAULT_PATH)
+
+include(FindPackageHandleStandardArgs)
+include(CMakeParseArguments)
+include(SelectLibraryConfigurations)
+include(ExtractVersion)
+
+macro(STANDARD_FIND_MODULE _name _pkgconfig_name)
+    string(TOUPPER ${_name} _NAME)
+    cmake_parse_arguments(_OPT_${_NAME} "NOT_REQUIRED;SKIP_CMAKE_CONFIG;SKIP_PKG_CONFIG" "" "" "${ARGN}")
+
+    # Try to use CMake Config file to locate the package
+    if(NOT _OPT_${_NAME}_SKIP_CMAKE_CONFIG)
+        set(_${_name}_FIND_QUIETLY ${${_name}_FIND_QUIETLY})
+        find_package(${_name} QUIET NO_MODULE)
+        set(${_name}_FIND_QUIETLY ${_${_name}_FIND_QUIETLY})
+        mark_as_advanced(${_name}_DIR)
+
+        if(${_name}_FOUND)
+            find_package_handle_standard_args(${_name} CONFIG_MODE)
+        endif()
+    endif()
+
+    if(NOT ${_name}_FOUND AND NOT _OPT_${_NAME}_SKIP_PKG_CONFIG)
+        # No CMake Config file was found. Try using PkgConfig
+        find_package(PkgConfig QUIET)
+        if(PKG_CONFIG_FOUND)
+
+            if(${_name}_FIND_VERSION)
+                if(${_name}_FIND_VERSION_EXACT)
+                    pkg_check_modules(_PC_${_NAME} QUIET ${_pkgconfig_name}=${${_name}_FIND_VERSION})
+                else(${_name}_FIND_VERSION_EXACT)
+                    pkg_check_modules(_PC_${_NAME} QUIET ${_pkgconfig_name}>=${${_name}_FIND_VERSION})
+                endif(${_name}_FIND_VERSION_EXACT)
+            else(${_name}_FIND_VERSION)
+                pkg_check_modules(_PC_${_NAME} QUIET ${_pkgconfig_name})
+            endif(${_name}_FIND_VERSION)
+
+
+            if(_PC_${_NAME}_FOUND)
+                set(${_name}_INCLUDE_DIRS ${_PC_${_NAME}_INCLUDE_DIRS} CACHE PATH "${_name} include directory")
+                set(${_name}_DEFINITIONS ${_PC_${_NAME}_CFLAGS_OTHER} CACHE STRING "Additional compiler flags for ${_name}")
+
+                set(${_name}_LIBRARIES)
+                foreach(_library IN ITEMS ${_PC_${_NAME}_LIBRARIES})
+                    string(TOUPPER ${_library} _LIBRARY)
+                    find_library(${_name}_${_LIBRARY}_LIBRARY_RELEASE
+                                 NAMES ${_library}
+                                 PATHS ${_PC_${_NAME}_LIBRARY_DIRS})
+                    list(APPEND ${_name}_LIBRARIES ${${_name}_${_LIBRARY}_LIBRARY_RELEASE})
+                    select_library_configurations(${_name}_${_LIBRARY})
+                    if(STANDARD_FIND_MODULE_DEBUG OR STANDARD_FIND_MODULE_DEBUG_${_name})
+                        message(STATUS "${_name}_${_LIBRARY}_FOUND = ${${_name}_${_LIBRARY}_FOUND}")
+                        message(STATUS "${_name}_${_LIBRARY}_LIBRARY_RELEASE = ${${_name}_${_LIBRARY}_LIBRARY_RELEASE}")
+                        message(STATUS "${_name}_${_LIBRARY}_LIBRARY_DEBUG = ${${_name}_${_LIBRARY}_LIBRARY_DEBUG}")
+                        message(STATUS "${_name}_${_LIBRARY}_LIBRARY = ${${_name}_${_LIBRARY}_LIBRARY}")
+                    endif()
+                endforeach()
+
+                set(${_name}_VERSION ${_PC_${_NAME}_VERSION})
+
+            endif(_PC_${_NAME}_FOUND)
+
+            mark_as_advanced(${_name}_INCLUDE_DIRS
+                             ${_name}_DEFINITIONS)
+
+            # If NOT_REQUIRED unset the _FIND_REQUIRED variable and save it for later
+            if(_OPT_${_NAME}_NOT_REQUIRED AND DEFINED ${_name}_FIND_REQUIRED)
+                set(_${_name}_FIND_REQUIRED ${${_name}_FIND_REQUIRED})
+                set(_${_name}_FIND_QUIETLY ${${_name}_FIND_QUIETLY})
+                unset(${_name}_FIND_REQUIRED)
+                set(${_name}_FIND_QUIETLY 1)
+            endif()
+
+            find_package_handle_standard_args(${_name} DEFAULT_MSG ${_name}_LIBRARIES)
+
+            # If NOT_REQUIRED reset the _FIND_REQUIRED variable
+            if(_OPT_${_NAME}_NOT_REQUIRED AND DEFINED _${_name}_FIND_REQUIRED)
+                set(${_name}_FIND_REQUIRED ${_${_name}_FIND_REQUIRED})
+                set(${_name}_FIND_QUIETLY ${_${_name}_FIND_QUIETLY})
+            endif()
+
+        endif()
+    endif()
+
+    # ${_name}_FOUND is uppercase after find_package_handle_standard_args
+    set(${_name}_FOUND ${${_NAME}_FOUND})
+
+    # Extract version numbers
+    if(${_name}_FOUND)
+        extract_version(${_name})
+    endif()
+
+
+    # Print some debug output if either STANDARD_FIND_MODULE_DEBUG
+    # or STANDARD_FIND_MODULE_DEBUG_${_name} is set to TRUE
+    if(STANDARD_FIND_MODULE_DEBUG OR STANDARD_FIND_MODULE_DEBUG_${_name})
+        message(STATUS "${_name}_FOUND = ${${_name}_FOUND}")
+        message(STATUS "${_name}_INCLUDE_DIRS = ${${_name}_INCLUDE_DIRS}")
+        message(STATUS "${_name}_LIBRARIES = ${${_name}_LIBRARIES}")
+        message(STATUS "${_name}_DEFINITIONS = ${${_name}_DEFINITIONS}")
+        message(STATUS "${_name}_VERSION = ${${_name}_VERSION}")
+        message(STATUS "${_name}_MAJOR_VERSION = ${${_name}_MAJOR_VERSION}")
+        message(STATUS "${_name}_MINOR_VERSION = ${${_name}_MINOR_VERSION}")
+        message(STATUS "${_name}_PATCH_VERSION = ${${_name}_PATCH_VERSION}")
+        message(STATUS "${_name}_TWEAK_VERSION = ${${_name}_TWEAK_VERSION}")
+    endif()
+
+endmacro()
+
+
+standard_find_module(TinyXML tinyxml)
+
+# Set package properties if FeatureSummary was included
+if(COMMAND set_package_properties)
+    set_package_properties(TinyXML PROPERTIES DESCRIPTION "A small, simple XML parser for the C++ language"
+                                              URL "http://www.grinninglizard.com/tinyxml/index.html")
 endif()
-
-# Find headers and libraries
-find_path(TinyXML_INCLUDE_DIR NAMES tinyxml.h PATH_SUFFIXES "tinyxml" ${TinyXML_INCLUDE_PATH})
-find_library(TinyXML_LIBRARY  NAMES tinyxml   PATH_SUFFIXES "tinyxml" ${TinyXML_LIBRARY_PATH})
-
-mark_as_advanced(TinyXML_INCLUDE_DIR
-                 TinyXML_LIBRARY)
-
-# Output variables generation
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(TinyXML DEFAULT_MSG TinyXML_LIBRARY
-                                                      TinyXML_INCLUDE_DIR)
-
-set(TinyXML_FOUND ${TINYXML_FOUND}) # Enforce case-correctness: Set appropriately cased variable...
-unset(TINYXML_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args
-
-if(TinyXML_FOUND)
-  set(TinyXML_INCLUDE_DIRS ${TinyXML_INCLUDE_DIR})
-  set(TinyXML_LIBRARIES ${TinyXML_LIBRARY})
-endif()


Fixed SFML dependency library error in MSVC.

--- cmake/TbagModules.cmake
+++ cmake/TbagModules.cmake
@@ -626,7 +626,7 @@
     tbag_modules__add_whole_archive (${sfml_graphics_EXT_STATIC_LIB})

     if (WIN32)
-        # TODO: Windows
+        list (APPEND TBAG_PROJECT_LDFLAGS winmm.lib, gdi32.lib)
     elseif (UNIX)
         if (APPLE)
             list (APPEND TBAG_PROJECT_LDFLAGS -ObjC


static build with MS libs; remove vc11 support from cmake

--- Build.cmake
+++ Build.cmake
@@ -43,29 +43,15 @@
        set(CMAKE_CXX_FLAGS "-Wall -Wunused -std=c++11  -pthread -D_GLIBCXX_USE_NANOSLEEP")
    ELSEIF (MINGW)
        set(CMAKE_CXX_FLAGS "-Wall -Wunused -std=c++11  -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD")
+       set(PLATFORM_LINK_LIBRIES dbghelp)
    ELSE()
        set(PLATFORM_LINK_LIBRIES rt)
        set(CMAKE_CXX_FLAGS "-Wall -rdynamic -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD")
    ENDIF()
-ENDIF()
-
-
-IF (MSVC OR MINGW)
-  set(PLATFORM_LINK_LIBRIES dbghelp)
-      # VC11 bug: http://code.google.com/p/googletest/issues/detail?id=408
-      #          add_definition(-D_VARIADIC_MAX=10)
-      # https://github.com/anhstudios/swganh/pull/186/files
-      ADD_DEFINITIONS (/D_VARIADIC_MAX=10)
-      MESSAGE(STATUS "- MSVC: Set variadic max to 10 for MSVC compatibility")
-      # Remember to set set target properties if using GTEST similar to done below on target "unit_test"
-      # "set_target_properties(unit_test  PROPERTIES COMPILE_DEFINITIONS "GTEST_USE_OWN_TR1_TUPLE=0")
-   MESSAGE("")
-   MESSAGE("Windows: Run cmake with the appropriate Visual Studio generator")
-   MESSAGE("The generator is one number below the official version number. I.e. VS2013 -> Generator 'Visual Studio 12'")
-   MESSAGE("I.e. if VS2013: Please run the command [cmake -DCMAKE_BUILD_TYPE=Release -G \"Visual Studio 12\" ..]")
-   MESSAGE("if cmake finishes OK, do 'msbuild g3log.sln /p:Configuration=Release'")
-   MESSAGE("then run 'Release\\g3log-FATAL-*' examples")
-   MESSAGE("")
+ELSEIF(MSVC)
+   set(PLATFORM_LINK_LIBRIES dbghelp)
+   set(CMAKE_CXX_FLAGS_RELEASE "/MT")
+   set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
 ENDIF()

    # GENERIC STEPS


BUG: Temporarily removed ctest_update(), hoping to fix "ERROR: script returned exit code 255"

--- CTest.cmake
+++ CTest.cmake
@@ -48,8 +48,6 @@
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_SOURCE_DIRECTORY}\"")

 ctest_start("Nightly")
-# Added ctest_update() to ensure that the commit SHA will be passed to CDash, and GitHub.
-# TODO Find out if and/or why this triggers "ERROR: script returned exit code 255"
-ctest_update()
+# TODO Add ctest_update() to ensure that the commit SHA will be passed to CDash, and GitHub.
 ctest_test()
 ctest_submit( PARTS Test )


updated for Maya 2016 linux

updated for Maya 2016 linux

--- dev/cmake/FindMaya.cmake
+++ dev/cmake/FindMaya.cmake
@@ -34,7 +34,6 @@

 FIND_PATH( MAYA_LOCATION include/maya/MLibrary.h
   "$ENV{MAYA_LOCATION}"
-  "$ENV{MAYA_LOCATION}/devkit/"
   "$ENV{MAYA_LOCATION}/../../devkit/"
   DOC "Root directory of Maya"
   )


Improve FindOptiX.cmake logic (#997)

Improve FindOptiX.cmake logic (#997)

--- src/cmake/modules/FindOptiX.cmake
+++ src/cmake/modules/FindOptiX.cmake
@@ -39,13 +39,14 @@
     find_library(${name}_LIBRARY
         NAMES ${name}.${version} ${name}
         )
+    if (${name}_LIBRARY STREQUAL "${name}_LIBRARY-NOTFOUND")
+        if (WIN32)
+            set (${name}_LIBRARY "${OPTIXHOME}/lib64/${name}.${version}.lib")
+        else ()
+            set (${name}_LIBRARY "${OPTIXHOME}/lib64/lib${name}.so")
+        endif ()
+    endif()
 endmacro()
-
-OPTIX_find_api_library(optix 1)
-OPTIX_find_api_library(optixu 1)
-OPTIX_find_api_library(optix_prime 1)
-
-set (OPTIX_LIBRARIES ${optix_LIBRARY} ${optixu_LIBRARY} ${optix_prime_LIBRARY})

 # Pull out the API version from optix.h
 file(STRINGS ${OPTIX_INCLUDE_DIR}/optix.h OPTIX_VERSION_LINE LIMIT_COUNT 1 REGEX OPTIX_VERSION)
@@ -54,6 +55,12 @@
 math(EXPR OPTIX_VERSION_MINOR "(${OPTIX_VERSION_STRING}%10000)/100")
 math(EXPR OPTIX_VERSION_MICRO "${OPTIX_VERSION_STRING}%100")
 set(OPTIX_VERSION "${OPTIX_VERSION_MAJOR}.${OPTIX_VERSION_MINOR}.${OPTIX_VERSION_MICRO}")
+
+OPTIX_find_api_library(optix ${OPTIX_VERSION})
+OPTIX_find_api_library(optixu ${OPTIX_VERSION})
+OPTIX_find_api_library(optix_prime ${OPTIX_VERSION})
+
+set (OPTIX_LIBRARIES ${optix_LIBRARY})

 message (STATUS "OptiX version = ${OPTIX_VERSION}")
 if (NOT OptiX_FIND_QUIETLY)


Icons now built in by default. Should maybe be separate libraries for each size to minimize size, though optimizer can probably deal to the unused ones. See issue #2

--- ugui.cmake
+++ ugui.cmake
@@ -20,6 +20,14 @@
 	${CMAKE_CURRENT_LIST_DIR}/source/fonts/robotomono_regular_18.c
 	)

+set(UGUI_ICONS
+	${CMAKE_CURRENT_LIST_DIR}/source/icons/icons_1x.c
+	${CMAKE_CURRENT_LIST_DIR}/source/icons/icons_2x.c
+	${CMAKE_CURRENT_LIST_DIR}/source/icons/icons_4x.c
+	${CMAKE_CURRENT_LIST_DIR}/source/icons/icons_6x.c
+	${CMAKE_CURRENT_LIST_DIR}/source/icons/icons_8x.c
+	)
+
 include_directories(${CMAKE_CURRENT_LIST_DIR})

-add_library(libugui ${UGUI_SOURCES} ${UGUI_FONTS} ${UGUI_WIDGETS})
+add_library(libugui ${UGUI_SOURCES} ${UGUI_FONTS} ${UGUI_ICONS} ${UGUI_WIDGETS})


xpSourceListAppend enhancements

xpSourceListAppend enhancements

* see issue https://github.com/smanders/externpro/issues/124
* filter binary files from masterSrcList before cscope

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -863,8 +863,6 @@
   if(EXISTS ${_dir}/CMakeLists.txt)
     list(APPEND masterSrcList ${_dir}/CMakeLists.txt)
   endif()
-  file(GLOB msvcFiles "${_dir}/*.sln" "${_dir}/*.vcxproj" "${_dir}/*.vcxproj.filters")
-  list(APPEND masterSrcList ${msvcFiles})
   if(${ARGC} GREATER 0)
     foreach(f ${ARGN})
       # remove any relative parts with get_filename_component call
@@ -882,20 +880,22 @@
       ${_dir}/*clang-format
       ${_dir}/README.md
       )
-    list(APPEND masterSrcList ${miscFiles})
-    file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-    string(REPLACE "/" "" custTgt .CMake${relPath})
-    add_custom_target(${custTgt} SOURCES ${miscFiles}) # creates utility project in MSVC
-    set_property(TARGET ${custTgt} PROPERTY FOLDER ${folder})
-  endif()
-  if(EXISTS ${_dir}/.codereview)
-    file(GLOB crFiles "${_dir}/.codereview/*")
-    list(APPEND masterSrcList ${crFiles})
-    file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-    string(REPLACE "/" "" custTgt .codereview${relPath})
-    if(NOT TARGET ${custTgt})
-      add_custom_target(${custTgt} SOURCES ${crFiles}) # creates utility project in MSVC
+    if(miscFiles)
+      list(APPEND masterSrcList ${miscFiles})
+      file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+      string(REPLACE "/" "" custTgt .CMake${relPath})
+      add_custom_target(${custTgt} SOURCES ${miscFiles}) # creates utility project in MSVC
       set_property(TARGET ${custTgt} PROPERTY FOLDER ${folder})
+    endif()
+    if(EXISTS ${_dir}/.codereview)
+      file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+      string(REPLACE "/" "" custTgt .codereview${relPath})
+      if(NOT TARGET ${custTgt})
+        file(GLOB crFiles "${_dir}/.codereview/*")
+        list(APPEND masterSrcList ${crFiles})
+        add_custom_target(${custTgt} SOURCES ${crFiles}) # creates utility project in MSVC
+        set_property(TARGET ${custTgt} PROPERTY FOLDER ${folder})
+      endif()
     endif()
   endif()
   if(NOT ${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
@@ -914,10 +914,27 @@
         xpGlobFiles(fmtFiles ${item} *.c *.h *.cpp *.hpp *.cu *.cuh *.proto)
       endforeach()
       list(REMOVE_ITEM repoFiles ${masterSrcList})
+      if(NOT DEFINED XP_CMAKE_REPO_INSYNC)
+        option(XP_CMAKE_REPO_INSYNC "cmake error if repo and cmake are not in sync" OFF)
+      endif()
       if(repoFiles)
-        string(REPLACE ";" "\n" repoFiles "${repoFiles}")
-        file(WRITE ${CMAKE_BINARY_DIR}/notincmake.txt ${repoFiles}\n)
+        string(REPLACE ";" "\n" repoFilesTxt "${repoFiles}")
+        file(WRITE ${CMAKE_BINARY_DIR}/notincmake.txt ${repoFilesTxt}\n)
         list(APPEND masterSrcList ${CMAKE_BINARY_DIR}/notincmake.txt)
+        if(XP_CMAKE_REPO_INSYNC)
+          message("")
+          message(STATUS "***** FILE(S) IN REPO, BUT NOT IN CMAKE *****")
+          foreach(abs ${repoFiles})
+            string(REPLACE ${CMAKE_SOURCE_DIR}/ "" rel ${abs})
+            message(STATUS ${rel})
+          endforeach()
+          message("")
+          message(FATAL_ERROR "repo and cmake are out of sync, see file(s) listed above. "
+            "See also \"${CMAKE_BINARY_DIR}/notincmake.txt\"."
+            )
+        endif()
+      elseif(EXISTS ${CMAKE_BINARY_DIR}/notincmake.txt)
+        file(REMOVE ${CMAKE_BINARY_DIR}/notincmake.txt)
       endif()
       ####
       # Windows can't handle passing very many files to clang-format
@@ -945,6 +962,9 @@
       if(NOT ${len} EQUAL 0)
         file(REMOVE ${cscope_files})
       endif()
+      foreach(extn bmp docx gif ICO ico jpeg jpg ntf pdf png rtf vsd xcf xlsx zip)
+        list(FILTER masterSrcList EXCLUDE REGEX "(.*).${extn}$")
+      endforeach()
       string(REPLACE ";" "\n" cscopeFileList "${masterSrcList}")
       file(WRITE ${CMAKE_BINARY_DIR}/cscope.files ${cscopeFileList}\n)
       message(STATUS "Generating cscope database")


- More comments for i686 toolchain file

- More comments for i686 toolchain file

--- cmake/Toolchains/linux-i686.toolchain.cmake
+++ cmake/Toolchains/linux-i686.toolchain.cmake
@@ -1,3 +1,8 @@
+#
+# This toolchain is used for cross-compiling 32-bit on 64-bit systems
+# This is not used for native compiling!
+#
+
 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_SYSTEM_VERSION 1)
 set(CMAKE_SYSTEM_PROCESSOR "i686")


[BuildSystem] Fetch xrootd tarball from lcg web site rather than xrootd's

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -871,7 +871,7 @@
 if(builtin_xrootd)
   set(XROOTD_VERSION 4.8.2)
   set(XROOTD_VERSIONNUM 400060001)
-  set(XROOTD_SRC_URI http://xrootd.org/download/v${XROOTD_VERSION}/xrootd-${XROOTD_VERSION}.tar.gz)
+  set(XROOTD_SRC_URI ${lcgpackages}/xrootd-${XROOTD_VERSION}.tar.gz)
   set(XROOTD_DESTDIR ${CMAKE_BINARY_DIR})
   set(XROOTD_ROOTDIR ${XROOTD_DESTDIR})
   message(STATUS "Downloading and building XROOTD version ${xrootd_version}")


On Mac High Sierra OpenGL was not found when build with the X11 backend.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -522,9 +522,9 @@
 if(opengl)
   message(STATUS "Looking for OpenGL")
   if(APPLE AND NOT cocoa)
-    find_path(OPENGL_INCLUDE_DIR GL/gl.h  PATHS /usr/X11R6/include)
-    find_library(OPENGL_gl_LIBRARY NAMES GL PATHS /usr/X11R6/lib)
-    find_library(OPENGL_glu_LIBRARY NAMES GLU PATHS /usr/X11R6/lib)
+    find_path(OPENGL_INCLUDE_DIR GL/gl.h  PATHS /usr/X11R6/include /opt/X11/include)
+    find_library(OPENGL_gl_LIBRARY NAMES GL PATHS /usr/X11R6/lib /opt/X11/lib)
+    find_library(OPENGL_glu_LIBRARY NAMES GLU PATHS /usr/X11R6/lib /opt/X11/lib)
     find_package_handle_standard_args(OpenGL REQUIRED_VARS OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY)
     set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
     mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_glu_LIBRARY OPENGL_gl_LIBRARY)


FIX (#3983): evaluate MOC_H_FILES for test drivers

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -377,9 +377,15 @@
 MACRO(MITK_CREATE_MODULE_TESTS)
 MACRO_PARSE_ARGUMENTS(MODULE_TEST "EXTRA_DRIVER_INIT;EXTRA_DRIVER_INCLUDE" "" ${ARGN})
 IF(BUILD_TESTING AND MODULE_IS_ENABLED)
+  SET(OLD_MOC_H_FILES ${MOC_H_FILES})
+  SET(MOC_H_FILES)
   INCLUDE(files.cmake)
   INCLUDE_DIRECTORIES(.)

+  IF(DEFINED MOC_H_FILES)
+    QT4_WRAP_CPP(MODULE_TEST_GENERATED_MOC_CPP ${MOC_H_FILES})
+  ENDIF(DEFINED MOC_H_FILES)
+
   SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "mitk::LogBackend::Register(); ${MODULE_TEST_EXTRA_DRIVER_INIT};")
   SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN "mitk::LogBackend::Unregister();")
   IF(NOT MODULE_TEST_EXTRA_DRIVER_INCLUDE)
@@ -391,7 +397,7 @@
     EXTRA_INCLUDE ${MODULE_TEST_EXTRA_DRIVER_INCLUDE}
   )
   SET(TESTDRIVER ${MODULE_NAME}TestDriver)
-  ADD_EXECUTABLE(${TESTDRIVER} ${MODULETEST_SOURCE})
+  ADD_EXECUTABLE(${TESTDRIVER} ${MODULETEST_SOURCE} ${MODULE_TEST_GENERATED_MOC_CPP})
   TARGET_LINK_LIBRARIES(${TESTDRIVER} ${MODULE_PROVIDES} ${ALL_LIBRARIES})
   #
   # Now tell CMake which tests should be run. This is done automatically
@@ -423,6 +429,7 @@
     ENDIF(EXISTS ${IMAGE_FULL_PATH})
   ENDFOREACH( image )

+  SET(MOC_H_FILES ${OLD_MOC_H_FILES})
 ENDIF(BUILD_TESTING AND MODULE_IS_ENABLED)

 ENDMACRO(MITK_CREATE_MODULE_TESTS)


Fixes issue 1262

Fixes issue 1262

Build paths in windows can now contain spaces

SVN-Revision: 2273

--- make/ntdll_imports.cmake
+++ make/ntdll_imports.cmake
@@ -71,5 +71,5 @@
   else ()
     set(ntimp_dep "${ntimp_lib}")
   endif ()
-  set(ntimp_flags "${ntimp_lib}")
+  set(ntimp_flags "\"${ntimp_lib}\"")
 endif (WIN32)


Fix typo in previous.

Fix typo in previous.

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -154,7 +154,7 @@
         SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_CXX_FLAGS}")
       ENDIF()
     ENDIF()
-    SET(WITH_SSL)
+    SET(WITH_SSL no)
   ENDIF()

   # Linux flags


fix typos in update_ macros

fix typos in update_ macros

--- src/private.cmake
+++ src/private.cmake
@@ -4,7 +4,7 @@
 		set(CAKE_BINARY_DIR_PREFIX ${_ubdp_v})
 	else()
 		if(NOT "${CAKE_BINARY_DIR_PREFIX}" STREQUAL "${_ubdp_v}")
-			cake_message(FATAL_ERROR "${_ubdp_source} is trying to override the value of CAKE_BINARY_DIR_PREFIX to ${_ubdp_v} which is already set to ${CAKE_BINARY_DIR_PREFIX}")
+			cake_message(FATAL_ERROR "${_updb_source} is trying to override the value of CAKE_BINARY_DIR_PREFIX to ${_ubdp_v} which is already set to ${CAKE_BINARY_DIR_PREFIX}")
 		endif()
 	endif()
 endmacro()
@@ -15,18 +15,18 @@
 		set(CAKE_BINARY_DIR ${_ubdp_v})
 	elseif((IS_ABSOLUTE "${CAKE_BINARY_DIR}" AND IS_ABSOLUTE "${_ubdp_v}") OR (NOT IS_ABSOLUTE "${CAKE_BINARY_DIR}" AND NOT IS_ABSOLUTE "${_ubdp_v}"))
 		if(NOT "${CAKE_BINARY_DIR}" STREQUAL "${_ubdp_v}")
-			cake_message(FATAL_ERROR "${_ubdp_source} is trying to override the value of CAKE_BINARY_DIR_PREFIX to ${_ubdp_v} which is already set to ${CAKE_BINARY_DIR_PREFIX}")
+			cake_message(FATAL_ERROR "${_updb_source} is trying to override the value of CAKE_BINARY_DIR to ${_ubdp_v} which is already set to ${CAKE_BINARY_DIR}")
 		endif()
 	endif()
 endmacro()

 # update CAKE_GENERATE_ALWAYS is it's still undefined
-macro(update_generate_always _ubdp_v _ubdp_source)
+macro(update_generate_always _ubdp_v _updb_source)
 	if(NOT DEFINED CAKE_GENERATE_ALWAYS)
 		set(CAKE_GENERATE_ALWAYS ${_ubdp_v})
 	else()
 		if((CAKE_GENERATE_ALWAYS AND NOT "${_ubdp_v}") OR (NOT CAKE_GENERATE_ALWAYS AND "${_ubdp_v}"))
-			cake_message(FATAL_ERROR "${_ubdp_source} is trying to override the value of CAKE_GENERATE_ALWAYS to ${_ubdp_v} which is already set to ${CAKE_GENERATE_ALWAYS}")
+			cake_message(FATAL_ERROR "${_updb_source} is trying to override the value of CAKE_GENERATE_ALWAYS to ${_ubdp_v} which is already set to ${CAKE_GENERATE_ALWAYS}")
 		endif()
 	endif()
 endmacro()


SVN_SILENT made messages (.desktop file) - always resolve ours

In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"

--- src/vlc.desktop.cmake
+++ src/vlc.desktop.cmake
@@ -10,6 +10,7 @@
 InitialPreference=20

 Name=VLC
+Name[ast]=VLC
 Name[bg]=VLC
 Name[bs]=VLC
 Name[ca]=VLC


Fix build

Fix build

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -288,7 +288,6 @@
 )

 # 2. add code to find each individual dependency
-list(REMOVE_DUPLICATES ${UPPER_PROJECT_NAME}_DEPENDENT_LIBRARIES)
 foreach(_dependent ${${UPPER_PROJECT_NAME}_DEPENDENT_LIBRARIES})
   string(TOUPPER ${_dependent} _DEPENDENT)
   # Check if the dependant project uses mixed case or upper case for its name


ENH: test pkg examples with RelWithDebInfo

--- Packaging/Files/build_examples.cmake
+++ Packaging/Files/build_examples.cmake
@@ -38,6 +38,7 @@
 execute_process(
   COMMAND ${CMAKE_COMMAND}
   -DCMAKE_INSTALL_PREFIX=${PKG_DIR}
+  -DCMAKE_BUILD_TYPE=RelWithDebInfo
   ${SRC_DIR}
   WORKING_DIRECTORY ${TEST_DIR}
   RESULT_VARIABLE configure_rv
@@ -56,6 +57,7 @@
 # the code is written in a way that it is easy to stuff these two
 # into a cmake foreach
 execute_process(COMMAND ${CMAKE_COMMAND}
+  --config RelWithDebInfo
   --build ${TEST_DIR}
   --target HelloWorldOTB
   WORKING_DIRECTORY ${TEST_DIR}
@@ -72,6 +74,7 @@
 endif()

 execute_process(COMMAND ${CMAKE_COMMAND}
+  --config RelWithDebInfo
   --build ${TEST_DIR}
   --target Pipeline
   WORKING_DIRECTORY ${TEST_DIR}


iOS: HOPEFULLY FIXING LIBZ ISSUES WITH DUE TO XCODE 7+

--- core/cmake/sketch.cmake
+++ core/cmake/sketch.cmake
@@ -37,7 +37,7 @@

 elseif (PLATFORM MATCHES ios)
   set(ZLIB_INCLUDE_DIRS "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include")
-  set(ZLIB_LIBRARIES "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libz.dylib")
+  set(ZLIB_LIBRARIES "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libz.tbd")

 else()
   find_package(ZLIB)


Fix icc/icpc flags.

Fix icc/icpc flags.

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -154,9 +154,13 @@
     IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
       SET(OPT_FLG "-O3 -unroll2 -ip")
       SET(DBG_FLG "")
-      SET(COMMON_CFLAGS   "-static-intel -static-libgcc -g -mieee-fp -restrict -no-ftz -no-opt-prefetch")
-      SET(COMMON_CXXFLAGS "-static-intel -static-libgcc -g -mieee-fp -restrict -no-ftz -no-opt-prefetch")
+      SET(COMMON_CFLAGS   "-static-intel -static-libgcc -g -mp -restrict")
+      SET(COMMON_CXXFLAGS "${COMMON_CFLAGS} -fno-implicit-templates -fno-exceptions -fno-rtti")
       SET(WITH_SSL no)
+      IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
+        SET(COMMON_CFLAGS   "${COMMON_CFLAGS} -no-ftz -no-prefetch")
+        SET(COMMON_CXXFLAGS "${COMMON_CXXFLAGS} -no-ftz -no-prefetch")
+      ENDIF()
     ENDIF()
   ENDIF()


Revert r276256 - Attempt to fix clang-cmake-mips after r268977.

It didn't fix the problem on the buildbot. CAN_TARGET_mips64 is still true.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@276258 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/builtin-config-ix.cmake
+++ cmake/builtin-config-ix.cmake
@@ -2,12 +2,6 @@

 # Make all the tests only check the compiler
 set(TEST_COMPILE_ONLY On)
-# Temporary fix for Mips buildbots this broke. It's the linker that rejects
-# inappropriate multilibs on this system.
-check_compile_definition("__mips__" "" IS_MIPS_HOST)
-if(IS_MIPS_HOST)
-  set(TEST_COMPILE_ONLY OFF)
-endif()

 builtin_check_c_compiler_flag(-fPIC                 COMPILER_RT_HAS_FPIC_FLAG)
 builtin_check_c_compiler_flag(-fPIE                 COMPILER_RT_HAS_FPIE_FLAG)


Remove inclusion of CheckCXXSourceRuns from environmentchecks.cmake.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -13,7 +13,6 @@
 # limitations under the License.cmake_minimum_required (VERSION 3.1)

 include(CheckCXXCompilerFlag)
-include(CheckCXXSourceRuns)

 get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)


fix for FindOPTIX.cmake

fix for FindOPTIX.cmake

--- cmake/modules/FindOPTIX.cmake
+++ cmake/modules/FindOPTIX.cmake
@@ -65,6 +65,7 @@
             /usr/local/include
             /sw/include
             /opt/local/include
+            /opt/optix/include
             NO_DEFAULT_PATH
             DOC "The directory where optix.h resides"
     )
@@ -80,6 +81,7 @@
             /usr/local/lib
             /sw/lib
             /opt/local/lib
+            /opt/optix/lib64
             NO_DEFAULT_PATH
             DOC "The optix library")
 endif ()


Linker flag adjustments.

Linker flag adjustments.

--- cmake_modules/LPSCommon.cmake
+++ cmake_modules/LPSCommon.cmake
@@ -209,12 +209,11 @@

     if(WIN64MSVC)
        set(LPS_CXX_FLAGS "/D_USRDLL ${MP} /GR /nologo /DWIN32 /D_WINDOWS /W1 /EHsc ${OPTIMIZATION} /D_HDF5USEDLL_" CACHE STRING "C++ Compiler Flags")
-       set(LPS_SHARED_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /MACHINE:X64" CACHE STRING "Linker Flags")
-
+       set(LPS_SHARED_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /MACHINE:X64" CACHE STRING "Linker Flags for Shared Libs")
+       set(LPS_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /MACHINE:X64" CACHE STRING "Linker Flags for Executables")
     elseif(WIN64INTEL)
        set(LPS_CXX_FLAGS "/D_USRDLL ${MP} /GR /nologo /DWIN32 /D_WINDOWS /W1 /wd2651 /EHsc ${OPTIMIZATION} /Qprof-gen:srcpos /D_HDF5USEDLL_" CACHE STRING "C++ Compiler Flags")
        set(LPS_SHARED_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /MACHINE:X64" CACHE STRING "Linker Flags")
-
     elseif(LINUX64INTEL)
         if(ENABLE_COVERAGE)
             if(INTELWARN)
@@ -251,8 +250,12 @@
              set(CMAKE_CXX_FLAGS_DEBUG-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=1\" /MDd" CACHE
                 STRING "Flags used by the C++ compiler for Debug-contracts builds" FORCE)
         endif()
+
         set(CMAKE_SHARED_LINKER_FLAGS_DEBUG-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /DEBUG" CACHE
             STRING "Flags used by the linker for shared libraries for Debug-contracts builds" FORCE)
+        set(CMAKE_EXE_LINKER_FLAGS_DEBUG-CONTRACTS "${LPS_EXE_LINKER_FLAGS} /DEBUG" CACHE
+            STRING "Flags used by the linker for executables for Debug-contracts builds")
+
     else()
         if(${USE_VTK})
             set(CMAKE_CXX_FLAGS_DEBUG-CONTRACTS "${LPS_CXX_FLAGS} -g -DUSE_VTK " CACHE
@@ -261,6 +264,8 @@
             set(CMAKE_CXX_FLAGS_DEBUG-CONTRACTS "${LPS_CXX_FLAGS} -g" CACHE
                 STRING "Flags used by the C++ compiler for Debug-contracts builds" FORCE)
         endif()
+        set(CMAKE_EXE_LINKER_FLAGS_DEBUG-CONTRACTS ${CMAKE_EXE_LINKER_FLAGS}  CACHE
+            STRING "Flags used by the linker for executables for Debug-contracts builds")
     endif()

     mark_as_advanced(CMAKE_CXX_FLAGS_DEBUG-CONTRACTS
@@ -283,7 +288,9 @@

      set(CMAKE_SHARED_LINKER_FLAGS_DEBUG-NO-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /DEBUG" CACHE
          STRING "Flags used by the linker for shared libraries for Debug-contracts builds" FORCE)
-
+     set(CMAKE_EXE_LINKER_FLAGS_DEBUG-NO-CONTRACTS "${LPS_EXE_LINKER_FLAGS} /DEBUG" CACHE
+         STRING "Flags used by the linker for executables for Debug-contracts builds")
+
     else()
         if(${USE_VTK})
             set(CMAKE_CXX_FLAGS_DEBUG-NO-CONTRACTS "${LPS_CXX_FLAGS} -g -DNDEBUG -DUSE_VTK" CACHE
@@ -309,14 +316,14 @@
                 STRING "Flags used by the C++ compiler for Release-contracts builds" FORCE)
         endif()

-        set(CMAKE_EXE_LINKER_FLAGS_RELEASE-CONTRACTS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD"  CACHE
+        set(CMAKE_EXE_LINKER_FLAGS_RELEASE-CONTRACTS "${LPS_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD"  CACHE
             STRING "Flags used by the linker for executables for Release-contracts builds" FORCE)
         set(CMAKE_SHARED_LINKER_FLAGS_RELEASE-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD" CACHE
             STRING "Flags used by the linker for shared libraries for Release-contracts builds" FORCE)
     else()
         set(CMAKE_CXX_FLAGS_RELEASE-CONTRACTS "${LPS_CXX_FLAGS}" CACHE
             STRING "Flags used by the C++ compiler for Release-contracts builds" FORCE)
-        set(CMAKE_EXE_LINKER_FLAGS_RELEASE-CONTRACTS "${CMAKE_EXE_LINKER_FLAGS}"  CACHE
+        set(CMAKE_EXE_LINKER_FLAGS_RELEASE-CONTRACTS "${LPS_EXE_LINKER_FLAGS}"  CACHE
             STRING "Flags used by the linker for executables for Release-contracts builds" FORCE)
         set(CMAKE_SHARED_LINKER_FLAGS_RELEASE-CONTRACTS "${LPS_SHARED_LINKER_FLAGS}" CACHE
             STRING "Flags used by the linker for shared libraries for Release-contracts builds" FORCE)


modules: EGL is not Sdl2Application dependency on WebGL.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -394,8 +394,8 @@
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()

-            # Find also EGL library, if on ES
-            if(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_DESKTOP_GLES)
+            # Find also EGL library, if on ES (and not on WebGL)
+            if(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_DESKTOP_GLES AND NOT MAGNUM_TARGET_WEBGL)
                 find_package(EGL)
                 if(EGL_FOUND)
                     list(APPEND _MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY})


ENH: remove superbuild gdal dependency to libfreexl

--- SuperBuild/CMake/External_gdal.cmake
+++ SuperBuild/CMake/External_gdal.cmake
@@ -101,6 +101,7 @@
     --with-pg=no
     --with-webp=no
     --with-threads=yes
+    --with-freexl=no
     ${GDAL_SB_CONFIG}
     ${GDAL_SB_EXTRA_OPTIONS}
     )


Revert "ENH: update gdal in superbuild to 1.11.4"

This reverts commit 75e8e40f7b5adf796c7a5d1d555a5ed193d8c419.

--- SuperBuild/CMake/External_gdal.cmake
+++ SuperBuild/CMake/External_gdal.cmake
@@ -35,8 +35,8 @@

     ExternalProject_Add(GDAL
       PREFIX GDAL
-      URL "http://download.osgeo.org/gdal/1.11.4/gdal-1.11.4.tar.gz"
-      URL_MD5 e9a966f0f5a88c43da47faf78a865952
+      URL "http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz"
+      URL_MD5 866a46f72b1feadd60310206439c1a76
       SOURCE_DIR ${GDAL_SB_SRC}
       BINARY_DIR ${GDAL_SB_SRC}
       INSTALL_DIR ${SB_INSTALL_PREFIX}
@@ -80,8 +80,8 @@

     ExternalProject_Add(GDAL
        PREFIX GDAL
-       URL "http://download.osgeo.org/gdal/1.11.4/gdal-1.11.4.tar.gz"
-       URL_MD5 e9a966f0f5a88c43da47faf78a865952
+       URL "http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz"
+       URL_MD5 866a46f72b1feadd60310206439c1a76
        SOURCE_DIR ${GDAL_SB_SRC}
        BINARY_DIR ${GDAL_SB_SRC}
        INSTALL_DIR ${SB_INSTALL_PREFIX}


Explicitly list dependencies in download modules

--- boost.cmake
+++ boost.cmake
@@ -10,10 +10,7 @@
 include (SetBuildDir)
 include (CacheDownload)

-# Make sure we've done "include (python)" to download/build python before boost
-if (NOT python_NAME)
-    message (FATAL_ERROR "Before including boost, you must include python!")
-endif ()
+include (python)

 set (boost_RELEASE  1_51_0)
 set (boost_NAME     "boost_${boost_RELEASE}")
@@ -23,6 +20,7 @@
 set_src_dir (boost ${boost_NAME})

 ExternalProject_Add(${boost_NAME}
+    DEPENDS ${python_NAME}
     PREFIX ${FLYEM_BUILD_DIR}
     URL ${boost_URL}
     UPDATE_COMMAND ""


Build: Remove nonsensical argument

Build: Remove nonsensical argument

--- cmake/Modules/FindYajl.cmake
+++ cmake/Modules/FindYajl.cmake
@@ -12,7 +12,7 @@
 find_path (YAJL_INCLUDE_DIR yajl/yajl_common.h)

 set (YAJL_NAMES ${YAJL_NAMES} yajl libyajl)
-find_library (YAJL_LIBRARY NAMES ${YAJL_NAMES} PATH)
+find_library (YAJL_LIBRARY NAMES ${YAJL_NAMES})

 include (FindPackageHandleStandardArgs)
 find_package_handle_standard_args (Yajl DEFAULT_MSG YAJL_LIBRARY YAJL_INCLUDE_DIR)


[CMake] Always use @rpath for XCTest

[CMake] Always use @rpath for XCTest

rdar://problem/23942371

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -915,8 +915,12 @@

   if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
     set(install_name_dir "@rpath")
+
     if(SWIFTLIB_SINGLE_IS_STDLIB)
-      set(install_name_dir "${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
+      # Always use @rpath for XCTest.
+      if(NOT "${module_name}" STREQUAL "XCTest")
+        set(install_name_dir "${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
+      endif()
     endif()

     set_target_properties("${target}"


disable vectorization on intel compilers because they produce wrong code. See issue 156.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@31760 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_compiler_flags_intel.cmake
+++ deal.II/cmake/setup_compiler_flags_intel.cmake
@@ -128,6 +128,12 @@
   #

   ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O2")
+  # in intel (at least 13.1 and 14), vectorization causes
+  # wrong code. See https://code.google.com/p/dealii/issues/detail?id=156
+  # or tests/hp/solution_transfer.cc
+  # A work-around is to disable all vectorization.
+  ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-no-vec")
+

   # equivalent to -fno-strict-aliasing:
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-no-ansi-alias")


projects no longer need project-config.cmake files.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -115,7 +115,11 @@
   if (LOCAL_TARGET)
     foreach (library_name ${ARGN})
       #          message(WARNING "${PROJECT_NAME} require ${library_name}")
-      find_package(${library_name} REQUIRED)
+      if (${library_name}_includes)
+        include_directories(${${library_name}_includes})
+      else ()
+        find_package(${library_name} REQUIRED)
+      endif ()

       if (TARGET ${library_name})
         if (IOS)
@@ -178,13 +182,20 @@

     project(${project_name})

-    if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-      set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR})
+    if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${project_name}-config.cmake")
+      if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+        set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR})
+      else ()
+        set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
+      endif ()
+
+      include(${project_name}-config.cmake OPTIONAL)
+
     else ()
-      set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
-    endif ()
-
-    include(${project_name}-config.cmake OPTIONAL)
+      message(${project_name}_includes " ${CMAKE_CURRENT_LIST_DIR}/source")
+      set(${project_name}_includes "${CMAKE_CURRENT_LIST_DIR}/source" PARENT_SCOPE)
+      include_directories(${CMAKE_CURRENT_LIST_DIR}/source)
+    endif ()

   endmacro(add_project)

@@ -202,7 +213,6 @@
   endmacro(require_package)

 endif ()
-

 macro(add name)
   add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${name})


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

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