Next try

Next try

--- cmake/FindEmbree.cmake
+++ cmake/FindEmbree.cmake
@@ -10,9 +10,9 @@
   return()
 endif()

-SET(Embree_FOUND FALSE)
-SET(Embree_INCLUDE_DIRS)
-SET(Embree_LIBRARIES)
+SET(EMBREE_FOUND FALSE)
+SET(EMBREE_INCLUDE_DIRS)
+SET(EMBREE_LIBRARIES)

 set(_def_search_paths
   ~/Library/Frameworks
@@ -23,129 +23,148 @@
   /usr
   "${CMAKE_LIBRARY_PATH}"
   "${EMBREE_DIR}"
-  "${Embree_DIR}"
+  "${EMBREE_DIR}"
 )

-find_path(Embree_INCLUDE_DIR embree3/rtcore.h
+find_path(EMBREE_INCLUDE_DIR embree3/rtcore.h
   HINTS
-    ENV Embree_HOME EMBREE_HOME
+    ENV EMBREE_HOME EMBREE_HOME
   PATH_SUFFIXES include/ local/include/
   PATHS ${_def_search_paths}
 )

-get_filename_component(_Embree_ROOT_DIR ${Embree_INCLUDE_DIR} DIRECTORY)
+get_filename_component(_EMBREE_ROOT_DIR ${EMBREE_INCLUDE_DIR} DIRECTORY)

 # Extract the version
-if(Embree_INCLUDE_DIR)
-  set(Embree_INCLUDE_DIRS "${Embree_INCLUDE_DIR}")
+if(EMBREE_INCLUDE_DIR)
+  set(EMBREE_INCLUDE_DIRS "${EMBREE_INCLUDE_DIR}")

-  file(READ "${Embree_INCLUDE_DIRS}/embree3/rtcore_config.h" _version_file)
+  file(READ "${EMBREE_INCLUDE_DIRS}/embree3/rtcore_config.h" _version_file)
   string(REGEX REPLACE ".*#define RTC_VERSION_MAJOR ([0-9]+).*" "\\1"
-      Embree_VERSION_MAJOR "${_version_file}")
+      EMBREE_VERSION_MAJOR "${_version_file}")
   string(REGEX REPLACE ".*#define RTC_VERSION_MINOR ([0-9]+).*" "\\1"
-      Embree_VERSION_MINOR "${_version_file}")
+      EMBREE_VERSION_MINOR "${_version_file}")
   string(REGEX REPLACE ".*#define RTC_VERSION_PATCH ([0-9]+).*" "\\1"
-      Embree_VERSION_PATCH "${_version_file}")
-  set(Embree_VERSION "${Embree_VERSION_MAJOR}.${Embree_VERSION_MINOR}.${Embree_VERSION_PATCH}")
+      EMBREE_VERSION_PATCH "${_version_file}")
+  set(EMBREE_VERSION "${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}.${EMBREE_VERSION_PATCH}")
 endif()

-function(_Embree_FIND_LIB setname)
+function(_EMBREE_FIND_LIB setname)
   find_library(${setname}
     NAMES ${ARGN}
     HINTS
-      ENV Embree_HOME EMBREE_HOME
+      ENV EMBREE_HOME EMBREE_HOME
     PATH_SUFFIXES lib
-    PATHS ${_def_search_paths} "${_Embree_ROOT_DIR}"
+    PATHS ${_def_search_paths} "${_EMBREE_ROOT_DIR}"
   )
 endfunction()

 # Allowed components
-set(_Embree_COMPONENTS
+set(_EMBREE_COMPONENTS
   Embree
 )

-set(_Embree_Embree_DEPS )
-set(_Embree_Embree_LIBNAMES embree3)
+set(_EMBREE_Embree_DEPS )
+set(_EMBREE_Embree_LIBNAMES embree3)

 # If COMPONENTS are not given, set it to default
-if(NOT Embree_FIND_COMPONENTS)
-  set(Embree_FIND_COMPONENTS ${_Embree_COMPONENTS})
+if(NOT EMBREE_FIND_COMPONENTS)
+  set(EMBREE_FIND_COMPONENTS ${_EMBREE_COMPONENTS})
 endif()

-foreach(component ${Embree_FIND_COMPONENTS})
-  if(NOT ${component} IN_LIST _Embree_COMPONENTS)
+foreach(component ${EMBREE_FIND_COMPONENTS})
+  if(NOT ${component} IN_LIST _EMBREE_COMPONENTS)
     message(ERROR "Unknown component ${component}")
   endif()

   set(_release_names )
   set(_debug_names )
-  foreach(_n ${_Embree_${component}_LIBNAMES})
+  foreach(_n ${_EMBREE_${component}_LIBNAMES})
     set(_release_names ${_release_names} "${_n}")
     set(_debug_names ${_debug_names} "${_n}d" "${_n}_d")
   endforeach(_n)

-  _Embree_FIND_LIB(Embree_${component}_LIBRARY_RELEASE ${_release_names})
-  if(Embree_${component}_LIBRARY_RELEASE)
-    _Embree_FIND_LIB(Embree_${component}_LIBRARY_DEBUG ${_debug_names} ${_release_names})
-    if(NOT Embree_${component}_LIBRARY_DEBUG)
-      set(Embree_${component}_LIBRARY_DEBUG "${Embree_${component}_LIBRARY_RELEASE}")
+  _EMBREE_FIND_LIB(EMBREE_${component}_LIBRARY_RELEASE ${_release_names})
+  if(EMBREE_${component}_LIBRARY_RELEASE)
+    _EMBREE_FIND_LIB(EMBREE_${component}_LIBRARY_DEBUG ${_debug_names} ${_release_names})
+    if(NOT EMBREE_${component}_LIBRARY_DEBUG)
+      set(EMBREE_${component}_LIBRARY_DEBUG "${EMBREE_${component}_LIBRARY_RELEASE}")
     endif()

-    if(NOT "${Embree_${component}_LIBRARY_RELEASE}" STREQUAL "${Embree_${component}_LIBRARY_DEBUG}")
-      set(Embree_${component}_LIBRARY
-        optimized "${Embree_${component}_LIBRARY_RELEASE}" debug "${Embree_${component}_LIBRARY_DEBUG}")
+    if(NOT "${EMBREE_${component}_LIBRARY_RELEASE}" STREQUAL "${EMBREE_${component}_LIBRARY_DEBUG}")
+      set(EMBREE_${component}_LIBRARY
+        optimized "${EMBREE_${component}_LIBRARY_RELEASE}" debug "${EMBREE_${component}_LIBRARY_DEBUG}")
     else()
-      set(Embree_${component}_LIBRARY "${Embree_${component}_LIBRARY_RELEASE}")
+      set(EMBREE_${component}_LIBRARY "${EMBREE_${component}_LIBRARY_RELEASE}")
     endif()

-    if(Embree_${component}_LIBRARY AND EXISTS "${Embree_${component}_LIBRARY}")
-      set(Embree_${component}_FOUND TRUE)
+    if(EMBREE_${component}_LIBRARY AND EXISTS "${EMBREE_${component}_LIBRARY}")
+      set(EMBREE_${component}_FOUND TRUE)
     endif()

-    set(Embree_LIBRARIES ${Embree_LIBRARIES} ${Embree_${component}_LIBRARY})
+    set(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} ${EMBREE_${component}_LIBRARY})
   endif()

-  mark_as_advanced(Embree_${component}_LIBRARY_RELEASE Embree_${component}_LIBRARY_DEBUG)
+  mark_as_advanced(EMBREE_${component}_LIBRARY_RELEASE EMBREE_${component}_LIBRARY_DEBUG)
 endforeach(component)

 # Setup targets
-foreach(component ${Embree_FIND_COMPONENTS})
-  if(Embree_${component}_FOUND)
+foreach(component ${EMBREE_FIND_COMPONENTS})
+  if(EMBREE_${component}_FOUND)
     set(_deps )

-    foreach(dependency ${_Embree_${component}_DEPS})
+    foreach(dependency ${_EMBREE_${component}_DEPS})
       set(_deps ${_deps} Embree::${component})
     endforeach(dependency)

     add_library(Embree::${component} SHARED IMPORTED)
     set_target_properties(Embree::${component} PROPERTIES
-      IMPORTED_LOCATION_RELEASE         "${Embree_${component}_LIBRARY_RELEASE}"
-      IMPORTED_LOCATION_MINSIZEREL      "${Embree_${component}_LIBRARY_RELEASE}"
-      IMPORTED_LOCATION_RELWITHDEBINFO  "${Embree_${component}_LIBRARY_DEBUG}"
-      IMPORTED_LOCATION_DEBUG           "${Embree_${component}_LIBRARY_DEBUG}"
+      IMPORTED_LOCATION_RELEASE         "${EMBREE_${component}_LIBRARY_RELEASE}"
+      IMPORTED_LOCATION_MINSIZEREL      "${EMBREE_${component}_LIBRARY_RELEASE}"
+      IMPORTED_LOCATION_RELWITHDEBINFO  "${EMBREE_${component}_LIBRARY_DEBUG}"
+      IMPORTED_LOCATION_DEBUG           "${EMBREE_${component}_LIBRARY_DEBUG}"
       ## TODO: Set this to a proper value (on windows -> dll)
-      IMPORTED_IMPLIB_RELEASE           "${Embree_${component}_LIBRARY_RELEASE}"
-      IMPORTED_IMPLIB_MINSIZEREL        "${Embree_${component}_LIBRARY_RELEASE}"
-      IMPORTED_IMPLIB_RELWITHDEBINFO    "${Embree_${component}_LIBRARY_DEBUG}"
-      IMPORTED_IMPLIB_DEBUG             "${Embree_${component}_LIBRARY_DEBUG}"
+      IMPORTED_IMPLIB_RELEASE           "${EMBREE_${component}_LIBRARY_RELEASE}"
+      IMPORTED_IMPLIB_MINSIZEREL        "${EMBREE_${component}_LIBRARY_RELEASE}"
+      IMPORTED_IMPLIB_RELWITHDEBINFO    "${EMBREE_${component}_LIBRARY_DEBUG}"
+      IMPORTED_IMPLIB_DEBUG             "${EMBREE_${component}_LIBRARY_DEBUG}"
       INTERFACE_LINK_LIBRARIES          "${_deps}"
-      INTERFACE_INCLUDE_DIRECTORIES     "${Embree_INCLUDE_DIRS}"
+      INTERFACE_INCLUDE_DIRECTORIES     "${EMBREE_INCLUDE_DIRS}"
     )
   endif()
 endforeach(component)

-if (Embree_INCLUDE_DIRS AND Embree_LIBRARIES)
-	set(Embree_FOUND TRUE)
+if (EMBREE_INCLUDE_DIRS AND EMBREE_LIBRARIES)
+	set(EMBREE_FOUND TRUE)
 endif()

-if(Embree_FOUND AND NOT Embree_FIND_QUIETLY)
-  message(STATUS "Embree version: ${Embree_VERSION}")
+if(NOT EMBREE_FOUND)
+  find_package(Embree QUIET NO_MODULE)
+  add_library(Embree::Embree SHARED IMPORTED)
+
+  set_target_properties(Embree::Embree PROPERTIES
+    IMPORTED_LOCATION_RELEASE         "${EMBREE_LIBRARY}"
+    IMPORTED_LOCATION_MINSIZEREL      "${EMBREE_LIBRARY}"
+    IMPORTED_LOCATION_RELWITHDEBINFO  "${EMBREE_LIBRARY}"
+    IMPORTED_LOCATION_DEBUG           "${EMBREE_LIBRARY}"
+    IMPORTED_IMPLIB_RELEASE           "${EMBREE_LIBRARY}"
+    IMPORTED_IMPLIB_MINSIZEREL        "${EMBREE_LIBRARY}"
+    IMPORTED_IMPLIB_RELWITHDEBINFO    "${EMBREE_LIBRARY}"
+    IMPORTED_IMPLIB_DEBUG             "${EMBREE_LIBRARY}"
+    INTERFACE_INCLUDE_DIRECTORIES     "${EMBREE_INCLUDE_DIRS}"
+  )
 endif()

+if(EMBREE_FOUND AND NOT EMBREE_FIND_QUIETLY)
+  message(STATUS "Embree version: ${EMBREE_VERSION}")
+endif()
+
+set(Embree_FOUND ${EMBREE_FOUND})
+
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Embree
-  VERSION_VAR Embree_VERSION
-  REQUIRED_VARS Embree_LIBRARIES Embree_INCLUDE_DIRS
+find_package_handle_standard_args(EMBREE
+  VERSION_VAR EMBREE_VERSION
+  REQUIRED_VARS EMBREE_LIBRARIES EMBREE_INCLUDE_DIRS
   HANDLE_COMPONENTS)

-mark_as_advanced(Embree_INCLUDE_DIR)+mark_as_advanced(EMBREE_INCLUDE_DIR)


Fixed FindMatlab.cmake to find R2012b.

Fixed FindMatlab.cmake to find R2012b.

--- cmake/FindMatlab.cmake
+++ cmake/FindMatlab.cmake
@@ -29,7 +29,7 @@
 #   http://public.kitware.com/Bug/view.php?id=8207
 #

-set(LIB_NAMES mex mat mx eng)
+set(LIB_NAMES mex mat mx eng)

 SET(MATLAB_FOUND FALSE)
 IF(WIN32)
@@ -73,7 +73,7 @@
       SET(MATLAB_ROOT /opt/matlab)
     ENDIF($ENV{MATLAB_ROOT})
   ENDIF(NOT MATLAB_ROOT)
-
+
   IF(CMAKE_SIZEOF_VOID_P EQUAL 4)

     # ==== x86 ====
@@ -82,24 +82,26 @@
       /usr/local/MATLAB/R2011a/bin/glnx86
       /usr/local/MATLAB/R2011b/bin/glnx86
       /usr/local/MATLAB/R2012a/bin/glnx86
+      /usr/local/MATLAB/R2012b/bin/glnx86
     )
-
+
     foreach (lib ${LIB_NAMES})
         string(TOUPPER ${lib} _LIB)
-        find_library(MATLAB_${_LIB}_LIBRARY ${lib}
+        find_library(MATLAB_${_LIB}_LIBRARY ${lib}
             HINTS $ENV{MATLAB_ROOT}/bin/glnx86/
             PATHS ${MATLAB_LIB_PATHS}
         )
     endforeach ()
-
+
   ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
-
+
     # ==== x86_64 ====
     set(MATLAB_LIB_PATHS
       /usr/local/MATLAB/R2010b/bin/glnxa64
       /usr/local/MATLAB/R2011a/bin/glnxa64
       /usr/local/MATLAB/R2011b/bin/glnxa64
       /usr/local/MATLAB/R2012a/bin/glnxa64
+      /usr/local/MATLAB/R2012b/bin/glnxa64
       /usr/local/matlab/bin/glnxa64
       /data/MATLAB/R2012a/bin/glnxa64
       /Applications/MATLAB_R2011a.app/bin/maci64
@@ -109,19 +111,19 @@

     foreach (lib ${LIB_NAMES})
         string(TOUPPER ${lib} _LIB)
-        find_library(MATLAB_${_LIB}_LIBRARY ${lib}
+        find_library(MATLAB_${_LIB}_LIBRARY ${lib}
             HINTS $ENV{MATLAB_ROOT}/bin/glnxa64/
             PATHS ${MATLAB_LIB_PATHS}
         )
     endforeach ()
-
+
   ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)

   # HACK: find_library doesnt seem to be able to find versioned libraries... :(
-  if (NOT APPLE)
+  if (NOT APPLE)
     find_file(MATLAB_QT_QTCORE_LIBRARY libQtCore.so.4
         HINTS $ENV{MATLAB_ROOT}/bin/glnxa64/
-        PATHS ${MATLAB_LIB_PATHS}
+        PATHS ${MATLAB_LIB_PATHS}
         NO_DEFAULT_PATH)
   else ()
     find_package(Qt4 4.6 QUIET)
@@ -137,6 +139,7 @@
     /usr/local/MATLAB/R2011a/extern/include
     /usr/local/MATLAB/R2011b/extern/include
     /usr/local/MATLAB/R2012a/extern/include
+    /usr/local/MATLAB/R2012b/extern/include
     /usr/local/matlab/extern/include
     /data/MATLAB/R2011b/extern/include
     /data/MATLAB/R2012a/extern/include
@@ -158,7 +161,7 @@
 ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)

 # Find the MATLAB binary path
-find_path(MATLAB_BINARY_DIR mex
+find_path(MATLAB_BINARY_DIR mex
     HINTS
     $ENV{MATLAB_ROOT}
     PATHS
@@ -166,6 +169,7 @@
     /usr/local/MATLAB/2011a/bin
     /usr/local/MATLAB/2011b/bin
     /usr/local/MATLAB/2012a/bin
+    /usr/local/MATLAB/2012b/bin
     /data/MATLAB/R2012a/bin
     /Applications/MATLAB_R2011a.app/bin
     /Applications/MATLAB_R2012a.app/bin


updates for opencv3 cmake

updates for opencv3 cmake

--- cmake/FindOpenCV.cmake
+++ cmake/FindOpenCV.cmake
@@ -202,14 +202,12 @@
     ${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH})

   IF (NOT OpenCV_FIND_COMPONENTS)
-    IF (OPENCV_VERSION VERION_GREATER 3.0)
+    IF (OPENCV_VERSION VERSION_GREATER 3.0)
       SET (OpenCV_FIND_COMPONENTS calib3d core features2d flann highgui
         imgcodecs imgproc ml objdetect shape superres video videoio)
-    ELSEIF (OPENCV_VERSION VERSION_GREATER 2.1)
+    ELSE (OPENCV_VERSION VERSION_GREATER 3.0)
       SET (OpenCV_FIND_COMPONENTS calib3d contrib core features2d flann highgui
         imgproc legacy ml objdetect video gpu)
-    ELSE (OPENCV_VERSION VERSION_GREATER 3.0)
-      SET (OpenCV_FIND_COMPONENTS cxcore cv ml highgui cvaux)
     ENDIF (OPENCV_VERSION VERSION_GREATER 3.0)
   ENDIF (NOT OpenCV_FIND_COMPONENTS)


include FindPhononInternal in phonon finder

this previously happened in phonon's cmake config which is wrong and bad
and stuff, so it is now moved to the finders used in the backends

--- cmake/FindPhonon.cmake
+++ cmake/FindPhonon.cmake
@@ -7,8 +7,10 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

 find_package(Phonon NO_MODULE)
-if(PHONON_FOUND)
+
+if(PHONON_BUILDSYSTEM_DIR)
     set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PHONON_BUILDSYSTEM_DIR})
+    include(${PHONON_BUILDSYSTEM_DIR}/FindPhononInternal.cmake )
 endif()

 include(FindPackageHandleStandardArgs)


fixed assertion for gtest libraries

fixed assertion for gtest libraries

--- cmake/test/gtest.cmake
+++ cmake/test/gtest.cmake
@@ -36,7 +36,7 @@
   include_directories(${GTEST_INCLUDE_DIRS})
   link_directories(${GTEST_LIBRARY_DIRS})
   add_executable(${target} EXCLUDE_FROM_ALL ${_gtest_DEFAULT_ARGS})
-  assert(${GTEST_LIBRARIES})
+  assert(GTEST_LIBRARIES)
   target_link_libraries(${target} ${GTEST_LIBRARIES} ${THREADS_LIBRARY})

   # make sure gtest is built before the test target


BUG: Fix BridgeNumPy signed / unsigned short correspondance.

By bumping the BridgeNumPy module, we fixed the signed / unsigned short
correspondance with the appropriate NumPy type.  They were reversed before.

Change-Id: I6397c327874bcd59cc51617fca54bd97cce5ff5e

--- Modules/Remote/BridgeNumPy.remote.cmake
+++ Modules/Remote/BridgeNumPy.remote.cmake
@@ -12,5 +12,5 @@
   See http://insight-journal.org/browse/publication/85
       http://hdl.handle.net/1926/188"
   GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKBridgeNumPy.git
-  GIT_TAG 0de6ece97d4146031f72767f242862d3be868782
+  GIT_TAG f645d226d3f2980c48fd15a9240ae0ce23deb046
   )


CMake: the CL_DISABLE_HALF checks printed scary-looking errors

This silences the checks (most compiler/device combos don't support
halfs anyway)

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -242,7 +242,7 @@
 ####################################################################

 # try compile with any compiler (supplied as argument)
-macro(custom_try_compile_any COMPILER SUFFIX SOURCE RES_VAR)
+macro(custom_try_compile_any SILENT COMPILER SUFFIX SOURCE RES_VAR)
   string(RANDOM RNDNAME)
   set(RANDOM_FILENAME "${CMAKE_BINARY_DIR}/compile_test_${RNDNAME}.${SUFFIX}")
   file(WRITE "${RANDOM_FILENAME}" "${SOURCE}")
@@ -250,7 +250,7 @@
   math(EXPR LSIZE "${ARGC} - 4")

   execute_process(COMMAND "${COMPILER}" ${ARGN} "${RANDOM_FILENAME}" RESULT_VARIABLE ${RES_VAR} OUTPUT_VARIABLE OV ERROR_VARIABLE EV)
-  if(${${RES_VAR}})
+  if(${${RES_VAR}} AND (NOT ${SILENT}))
     message(STATUS " ########## The command: ")
     string(REPLACE ";" " " ARGN_STR "${ARGN}")
     message(STATUS "${COMPILER} ${ARGN_STR} ${RANDOM_FILENAME}")
@@ -276,7 +276,20 @@
   ${SOURCE2}

   }")
-  custom_try_compile_any("${COMPILER}" ${SUFFIX} "${SOURCE_PROG}" ${RES_VAR} ${ARGN})
+  custom_try_compile_any(FALSE "${COMPILER}" ${SUFFIX} "${SOURCE_PROG}" ${RES_VAR} ${ARGN})
+endmacro()
+
+# convenience c/c++ source wrapper
+macro(custom_try_compile_c_cxx_silent COMPILER SUFFIX SOURCE1 SOURCE2 RES_VAR)
+  set(SOURCE_PROG "
+  ${SOURCE1}
+
+  int main(int argc, char** argv) {
+
+  ${SOURCE2}
+
+  }")
+  custom_try_compile_any(TRUE "${COMPILER}" ${SUFFIX} "${SOURCE_PROG}" ${RES_VAR} ${ARGN})
 endmacro()

 # clang++ try-compile macro
@@ -583,14 +596,15 @@

 if(NOT DEFINED ${CL_DISABLE_HALF})
   set(CL_DISABLE_HALF 0)
-  # TODO -march=CPU flags !
-  custom_try_compile_c_cxx("${CLANG}" "c" "__fp16 callfp16(__fp16 a) { return a * (__fp16)1.8; };" "__fp16 x=callfp16((__fp16)argc);" RESV -c ${CLANG_TARGET_OPTION}${LLC_TRIPLE} ${CLANG_MARCH_FLAG}${LLC_HOST_CPU})
+  message(STATUS "Checking fp16 support")
+  custom_try_compile_c_cxx_silent("${CLANG}" "c" "__fp16 callfp16(__fp16 a) { return a * (__fp16)1.8; };" "__fp16 x=callfp16((__fp16)argc);" RESV -c ${CLANG_TARGET_OPTION}${LLC_TRIPLE} ${CLANG_MARCH_FLAG}${LLC_HOST_CPU})
   if(RESV)
     set(CL_DISABLE_HALF 1)
   endif()
 endif()

 set(CL_DISABLE_HALF "${CL_DISABLE_HALF}" CACHE BOOL "Disable cl_khr_fp16 because fp16 is not supported")
+message(STATUS "fp16 disabled: ${CL_DISABLE_HALF}")

 ####################################################################


enh: Use ThirdParty/LBFGS by default if available

--- CMake/Config/Depends.cmake
+++ CMake/Config/Depends.cmake
@@ -55,14 +55,18 @@
 # Directory with source files of third-party libraries
 set(MIRTK_THIRDPARTY_DIR "${MIRTK_SOURCE_DIR}/ThirdParty")

+
 # ------------------------------------------------------------------------------
 # libLBFGS (optional)
-if (WITH_LibLBFGS)
+set(LibLBFGS_SOURCE_DIR "${MIRTK_THIRDPARTY_DIR}/LBFGS")

-  # Third-party source directory
-  set(LibLBFGS_SOURCE_DIR "${MIRTK_THIRDPARTY_DIR}/LBFGS")
+# Set default for WITH_LibLBFGS option
+if (NOT DEFINED WITH_LibLBFGS_DEFAULT AND EXISTS "${LibLBFGS_SOURCE_DIR}/CMakeLists.txt")
+  set(WITH_LibLBFGS_DEFAULT ON)
+endif ()

-  # When third-party submodule is available and library is needed
+# When third-party submodule is available and library is needed
+if ((DEFINED WITH_LibLBFGS AND WITH_LibLBFGS) OR (NOT DEFINED WITH_LibLBFGS AND WITH_LibLBFGS_DEFAULT))
   basis_check_if_package_is_needed_by_modules(is_needed LibLBFGS)
   if (is_needed AND EXISTS "${LibLBFGS_SOURCE_DIR}/CMakeLists.txt")
     message(STATUS "Configuring module ThirdParty/LBFGS...")
@@ -70,8 +74,8 @@
     set(LibLBFGS_FOUND       TRUE)
     set(LibLBFGS_INCLUDE_DIR "${LibLBFGS_INCLUDE_DIR}")
     set(LibLBFGS_LIBRARIES   liblbfgs)
+    set(LibLBFGS_DIR        "${MIRTK_BINARY_DIR}/ThirdParty/LBFGS")
     message(STATUS "Configuring module ThirdParty/LBFGS... - done")
   endif ()
   unset(is_needed)
-
 endif ()


Fix OGRE_LIB_SUFFIX for upper case build type This fixes the build when using an upper case build type such as "Debug"

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -157,7 +157,7 @@
 if (OGRE_STATIC)
   set(OGRE_LIB_SUFFIX "${OGRE_LIB_SUFFIX}Static")
 endif ()
-if (OGRE_BUILD_TYPE STREQUAL "debug" AND NOT APPLE)
+if (BUILD_TYPE_LOWER STREQUAL "debug" AND NOT APPLE)
   set(OGRE_LIB_SUFFIX "${OGRE_LIB_SUFFIX}_d")
 endif ()


Increment version to 3.3.1

Increment version to 3.3.1

--- CMakeModules/Version.cmake
+++ CMakeModules/Version.cmake
@@ -3,7 +3,7 @@
 #
 SET(AF_VERSION_MAJOR "3")
 SET(AF_VERSION_MINOR "3")
-SET(AF_VERSION_PATCH "0")
+SET(AF_VERSION_PATCH "1")

 SET(AF_VERSION "${AF_VERSION_MAJOR}.${AF_VERSION_MINOR}.${AF_VERSION_PATCH}")
 SET(AF_API_VERSION_CURRENT ${AF_VERSION_MAJOR}${AF_VERSION_MINOR})


BUG: fix missing ITK include for wrapping

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -162,7 +162,7 @@
         ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/vxl/vcl
         ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/vxl/core
         ${OTB_BINARY_DIR}/Utilities/ITK/Utilities
-        ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/itkExtHdrs
+        ${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/itkExtHdrs
         )
 ENDIF(OTB_USE_EXTERNAL_ITK)


fix cuda arch detection (#24036)

fix cuda arch detection (#24036)

--- cmake/cuda.cmake
+++ cmake/cuda.cmake
@@ -26,7 +26,9 @@
     set(cufile ${PROJECT_BINARY_DIR}/detect_cuda_archs.cu)

     file(WRITE ${cufile} ""
-      "#include <cstdio>\n"
+      "#include \"stdio.h\"\n"
+      "#include \"cuda.h\"\n"
+      "#include \"cuda_runtime.h\"\n"
       "int main() {\n"
       "  int count = 0;\n"
       "  if (cudaSuccess != cudaGetDeviceCount(&count)) return -1;\n"
@@ -34,12 +36,12 @@
       "  for (int device = 0; device < count; ++device) {\n"
       "    cudaDeviceProp prop;\n"
       "    if (cudaSuccess == cudaGetDeviceProperties(&prop, device))\n"
-      "      std::printf(\"%d.%d \", prop.major, prop.minor);\n"
+      "      printf(\"%d.%d \", prop.major, prop.minor);\n"
       "  }\n"
       "  return 0;\n"
       "}\n")

-    execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}" "-ccbin=${CUDA_HOST_COMPILER}"
+    execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}"
                     "--run" "${cufile}"
                     WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                     RESULT_VARIABLE nvcc_res OUTPUT_VARIABLE nvcc_out


OSPRay wants NDEBUG in config RelWithDebInfo

--- cmake/msvc.cmake
+++ cmake/msvc.cmake
@@ -28,9 +28,6 @@
   STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
 ENDIF()

-# remove define NDEBUG and instead set define DEBUG for config RelWithDebInfo
-STRING(REPLACE "NDEBUG" "DEBUG" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
-
 # these flags apply ONLY to how embree is built; the rest of the ospray C++ code is ISA-agnostic
 # the /QxXXX flags are meant for the Intel Compiler, MSVC ignores them
 SET(OSPRAY_ARCH_SSE3  "/arch:SSE3 /QxSSE3")


Updated EC2 API version.

Updated EC2 API version.

--- cmake/sdks.cmake
+++ cmake/sdks.cmake
@@ -37,7 +37,7 @@
 list(APPEND C2J_LIST "ds:2015-04-16")
 list(APPEND C2J_LIST "dynamodb:2012-08-10")
 if(NOT PLATFORM_ANDROID OR NOT CMAKE_HOST_WIN32)  # ec2 isn't building for android on windows atm due to an internal compiler error, TODO: investigate further
-    list(APPEND C2J_LIST "ec2:2015-10-01")
+    list(APPEND C2J_LIST "ec2:2016-09-15")
 endif()
 list(APPEND C2J_LIST "ecr:2015-09-21")
 list(APPEND C2J_LIST "ecs:2014-11-13")


Add cpp defines for supported C++11 features

--- TestCPP11.cmake
+++ TestCPP11.cmake
@@ -84,6 +84,7 @@

   if(CXX_${TEST_CPP11_NAME}_SUPPORTED)
     set(TEST_CPP11_PASSED "${TEST_CPP11_PASSED} ${TEST_CPP11_name}")
+    add_definitions(-DCXX_${TEST_CPP11_NAME}_SUPPORTED)
   else()
     set(TEST_CPP11_FAILED "${TEST_CPP11_FAILED} ${TEST_CPP11_name}")
     #message("${TEST_CPP11_name} failed: ${output}")


Fix pollution of c flags

Fix pollution of c flags

--- setup.cmake
+++ setup.cmake
@@ -5,7 +5,8 @@
 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 #LINUX OR OSX
-add_compile_options(-std=c++1z -Wall -Wextra -pedantic-errors -fexceptions -Wno-unused-value -Wno-invalid-offsetof -Wnonnull -Wformat=2 -Wformat-security  -Wformat-nonliteral -Winit-self -Werror -Wswitch-default -Wstrict-overflow=1 -Wcast-align  -Wcast-qual -Wdisabled-optimization -Winit-self -march=native -fno-omit-frame-pointer -Wno-unknown-pragmas )
+set(CMAKE_CXX_FLAGS "-std=c++1z ${CMAKE_CXX_FLAGS}")
+add_compile_options(-Wall -Wextra -pedantic-errors -fexceptions -Wno-unused-value -Wno-invalid-offsetof -Wnonnull -Wformat=2 -Wformat-security  -Wformat-nonliteral -Winit-self -Werror -Wswitch-default -Wstrict-overflow=1 -Wcast-align  -Wcast-qual -Wdisabled-optimization -Winit-self -march=native -fno-omit-frame-pointer -Wno-unknown-pragmas )
 add_compile_options(--param ssp-buffer-size=4 )
 add_compile_options(-fvisibility=hidden)
 add_compile_options(-fvisibility-inlines-hidden)


MAINT: clean packaging information.

MAINT: clean packaging information.

--- cmake/DOInstall.cmake
+++ cmake/DOInstall.cmake
@@ -5,17 +5,16 @@

 # Eigen 3
 do_message("Installing Eigen")
-install(DIRECTORY ${Eigen3_DIR}/Eigen
+install(DIRECTORY ${DO_ThirdParty_DIR}/eigen
         DESTINATION include
         COMPONENT Eigen3)
 set(CPACK_COMPONENT_Eigen3_REQUIRED 1)

 # DO++ source files
 install(FILES ${DO_DIR}/COPYING.README
-              ${DO_DIR}/COPYING.MPL2
+              ${DO_DIR}/COPYING.MPL2
               ${DO_DIR}/CPACK_PACKAGING.README
               ${DO_DIR}/CMakeLists.txt
-              ${DO_DIR}/Doxyfile.in
         DESTINATION .
         COMPONENT Sources)
 install(DIRECTORY ${DO_DIR}/cmake
@@ -48,17 +47,6 @@
             DESTINATION include/DO
             COMPONENT ${component}
             FILES_MATCHING PATTERN "*.hpp")
-    # Install dynamic libraries
-    # if (NOT ${DO_${component}_LIBRARIES} STREQUAL "") # This is how I check if the library is not header-only...
-        # install(TARGETS DO_${component}
-                # ARCHIVE DESTINATION lib
-                # COMPONENT ${component})
-        # install(TARGETS DO_${component}_SHARED
-                # LIBRARY DESTINATION bin
-                # ARCHIVE DESTINATION bin
-                # RUNTIME DESTINATION bin
-                # COMPONENT ${component})
-    # endif ()
 endforeach (component)

@@ -80,18 +68,22 @@

 # List all available components for installation.
 set(CPACK_COMPONENTS_ALL Eigen3 Sources Core Graphics Libraries)
-# Create windows package with NSIS.
-set(CPACK_GENERATOR NSIS)
-set(CPACK_PACKAGE_NAME "DO++")
-set(CPACK_PACKAGE_VENDOR "David Ok")
+
+set(CPACK_PACKAGE_NAME "DO_Sara")
+set(CPACK_PACKAGE_VENDOR "DO-CV")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
-    "DO++ - Basic set of libraries for computer vision")
-# License
+  "DO-CV - An easy-to-use C++ set of libraries for computer vision")
 set(CPACK_RESOURCE_FILE_LICENSE "${DO_DIR}/COPYING.README")
-
-# Put version.
+set(CPACK_PACKAGE_CONTACT "David OK")
+
 set(CPACK_PACKAGE_VERSION_MAJOR "${DO_VERSION_MAJOR}")
 set(CPACK_PACKAGE_VERSION_MINOR "${DO_VERSION_MINOR}")
 set(CPACK_PACKAGE_VERSION_PATCH "${DO_VERSION_PATCH}")
 set(CPACK_PACKAGE_VERSION "${DO_VERSION}")
 set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}-${DO_VERSION}")
+
+if (WIN32)
+  set(CPACK_GENERATOR NSIS)
+elseif (UNIX)
+  set(CPACK_GENERATOR "DEB")
+endif()


Revert "Set a different var for checking I686, because LLVM_NATIVE_ARCH is"

This reverts commit 38a6db6397364ee91b04afea2cdcb1b5b4d252bf.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -159,7 +159,7 @@
   find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)
   set(LLVM_LIBXML2_ENABLED 0)
   set(LIBXML2_FOUND 0)
-  if((LLVM_ENABLE_LIBXML2) AND (CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) AND (NOT LLVM_ARCH_I686))
+  if((LLVM_ENABLE_LIBXML2) AND (CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) AND (NOT LLVM_NATIVE_ARCH MATCHES "i686"))
     find_package(LibXml2)
     if (LIBXML2_FOUND)
       set(LLVM_LIBXML2_ENABLED 1)
@@ -382,10 +382,6 @@
 if( LLVM_NATIVE_ARCH STREQUAL "host" )
   string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOST_TRIPLE})
 endif ()
-
-set(LLVM_ARCH_I686 0)
-if (LLVM_NATIVE_ARCH MATCHES "i686")
-  set(LLVM_ARCH_I686 1)

 if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86")
   set(LLVM_NATIVE_ARCH X86)


fix checking the undefined sanitizer in gcc 4.9+

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -15,6 +15,9 @@

 set(CMAKE_REQUIRED_FLAGS "-fsanitize=undefined")
 CHECK_CXX_SOURCE_COMPILES("${NANOCV_TEST_PROGRAM}" COMPILER_SUPPORTS_SANITIZE_UNDEFINED)
+
+set(CMAKE_REQUIRED_FLAGS "-fsanitize=vptr")
+CHECK_CXX_SOURCE_COMPILES("${NANOCV_TEST_PROGRAM}" COMPILER_SUPPORTS_SANITIZE_VPTR)

 set(CMAKE_REQUIRED_FLAGS "-fsanitize=leak")
 CHECK_CXX_SOURCE_COMPILES("${NANOCV_TEST_PROGRAM}" COMPILER_SUPPORTS_SANITIZE_LEAK)
@@ -65,7 +68,9 @@
                 endif()
                 if(COMPILER_SUPPORTS_SANITIZE_UNDEFINED)
                         set(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
+                        if(COMPILER_SUPPORT_SANITIZE_VPTR)
                         set(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} -fno-sanitize=vptr")
+                        endif()
                 endif()
                 if(COMPILER_SUPPORTS_SANITIZE_LEAK)
                         set(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} -fsanitize=leak")


Switch imagecodec to SDL2

Switch imagecodec to SDL2

--- cmake/get-cegui.cmake
+++ cmake/get-cegui.cmake
@@ -21,8 +21,8 @@
     -DCEGUI_BUILD_IMAGECODEC_DEVIL:BOOL=OFF
     -DCEGUI_BUILD_IMAGECODEC_FREEIMAGE:BOOL=OFF
     -DCEGUI_BUILD_IMAGECODEC_PVR:BOOL=OFF
-    -DCEGUI_BUILD_IMAGECODEC_SDL2:BOOL=OFF
-    -DCEGUI_BUILD_IMAGECODEC_SILLY:BOOL=ON
+    -DCEGUI_BUILD_IMAGECODEC_SDL2:BOOL=ON
+    -DCEGUI_BUILD_IMAGECODEC_SILLY:BOOL=OFF
     -DCEGUI_BUILD_IMAGECODEC_STB:BOOL=OFF
     -DCEGUI_BUILD_IMAGECODEC_TGA:BOOL=OFF
     -DCEGUI_BUILD_LUA_GENERATOR:BOOL=OFF
@@ -43,11 +43,12 @@
     -DCEGUI_BUILD_XMLPARSER_RAPIDXML:BOOL=OFF
     -DCEGUI_BUILD_XMLPARSER_TINYXML:BOOL=OFF
     -DCEGUI_BUILD_XMLPARSER_XERCES:BOOL=OFF
+    -DCEGUI_OPTION_DEFAULT_IMAGECODEC="SDL2ImageCodec"
 )

 ExternalProject_Add(
   cegui
-  DEPENDS             libpng expat glew glfw glm pcre sdl2
+  DEPENDS             libpng expat glew glfw glm pcre sdl2 sdl2-image
   PREFIX              ${DEPENDENCY_EXTRACT_DIR}
   DOWNLOAD_DIR        ${DEPENDENCY_DOWNLOAD_DIR}
   URL                 https://sourceforge.net/projects/crayzedsgui/files/CEGUI%20Mk-2/0.8/cegui-0.8.7.tar.bz2/download


Remove useless GTK2 module

Remove useless GTK2 module

--- cmaked/FindGTK2.cmake
+++ cmaked/FindGTK2.cmake
@@ -1,453 +0,0 @@
-# - Try to find GTK2
-# Once done this will define
-#
-#  GTK2_FOUND - System has Boost
-#  GTK2_INCLUDE_DIRS - GTK2 include directory
-#  GTK2_LIBRARIES - Link these to use GTK2
-#  GTK2_LIBRARY_DIRS - The path to where the GTK2 library files are.
-#  GTK2_DEFINITIONS - Compiler switches required for using GTK2
-#
-#  Copyright (c) 2007 Andreas Schneider <mail@cynapses.org>
-#
-#  Redistribution and use is allowed according to the terms of the New
-#  BSD license.
-#  For details see
-#  http://cmake-modules.googlecode.com/svn/trunk/Modules/COPYING-CMAKE-SCRIPTS
-#
-
-set(GTK2_DEBUG ON)
-
-macro(GTK2_DEBUG_MESSAGE _message)
-  if (GTK2_DEBUG)
-    message(STATUS "(DEBUG) ${_message}")
-  endif (GTK2_DEBUG)
-endmacro(GTK2_DEBUG_MESSAGE _message)
-
-if (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
-  # in cache already
-  set(GTK2_FOUND TRUE)
-else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
-  if (UNIX)
-    # use pkg-config to get the directories and then use these values
-    # in the FIND_PATH() and FIND_LIBRARY() calls
-    include(UsePkgConfig)
-
-    pkgconfig(gtk+-2.0 _GTK2IncDir _GTK2LinkDir _GTK2LinkFlags _GTK2Cflags)
-
-    find_path(GTK2_GTK_INCLUDE_DIR
-      NAMES
-        gtk/gtk.h
-      PATHS
-        $ENV{GTK2_HOME}
-        ${_GTK2IncDir}
-        /usr/include/gtk-2.0
-        /usr/local/include/gtk-2.0
-        /opt/include/gtk-2.0
-        /opt/gnome/include/gtk-2.0
-        /sw/include/gtk-2.0
-    )
-    gtk2_debug_message("GTK2_GTK_INCLUDE_DIR is ${GTK2_GTK_INCLUDE_DIR}")
-
-    # Some Linux distributions (e.g. Red Hat) have glibconfig.h
-    # and glib.h in different directories, so we need to look
-    # for both.
-    #  - Atanas Georgiev <atanas@cs.columbia.edu>
-    pkgconfig(glib-2.0 _GLIB2IncDir _GLIB2LinkDir _GLIB2LinkFlags _GLIB2Cflags)
-    pkgconfig(gmodule-2.0 _GMODULE2IncDir _GMODULE2LinkDir _GMODULE2LinkFlags _GMODULE2Cflags)
-
-    find_path(GTK2_GLIBCONFIG_INCLUDE_DIR
-      NAMES
-        glibconfig.h
-      PATHS
-        ${_GLIB2IncDir}
-        ${_GMODULE2IncDir}
-        /opt/gnome/lib64/glib-2.0/include
-        /opt/gnome/lib/glib-2.0/include
-        /opt/lib/glib-2.0/include
-        /usr/lib64/glib-2.0/include
-        /usr/lib/glib-2.0/include
-        /sw/lib/glib-2.0/include
-    )
-    gtk2_debug_message("GTK2_GLIBCONFIG_INCLUDE_DIR is ${GTK2_GLIBCONFIG_INCLUDE_DIR}")
-
-    find_path(GTK2_GLIB_INCLUDE_DIR
-      NAMES
-        glib.h
-      PATHS
-        ${_GLIB2IncDir}
-        ${_GMODULE2IncDir}
-        /opt/include/glib-2.0
-        /opt/gnome/include/glib-2.0
-        /usr/include/glib-2.0
-        /sw/include/glib-2.0
-    )
-    gtk2_debug_message("GTK2_GLIB_INCLUDE_DIR is ${GTK2_GLIB_INCLUDE_DIR}")
-
-    pkgconfig(gdk-2.0 _GDK2IncDir _GDK2LinkDir _GDK2LinkFlags _GDK2Cflags)
-
-    find_path(GTK2_GDK_INCLUDE_DIR
-      NAMES
-        gdkconfig.h
-      PATHS
-        ${_GDK2IncDir}
-        /opt/gnome/lib/gtk-2.0/include
-        /opt/gnome/lib64/gtk-2.0/include
-        /opt/lib/gtk-2.0/include
-        /usr/lib/gtk-2.0/include
-        /usr/lib64/gtk-2.0/include
-        /sw/lib/gtk-2.0/include
-    )
-    gtk2_debug_message("GTK2_GDK_INCLUDE_DIR is ${GTK2_GDK_INCLUDE_DIR}")
-
-    find_path(GTK2_GTKGL_INCLUDE_DIR
-      NAMES
-        gtkgl/gtkglarea.h
-      PATHS
-        ${_GLIB2IncDir}
-        /usr/include
-        /usr/local/include
-        /usr/openwin/share/include
-        /opt/gnome/include
-        /opt/include
-        /sw/include
-    )
-    gtk2_debug_message("GTK2_GTKGL_INCLUDE_DIR is ${GTK2_GTKGL_INCLUDE_DIR}")
-
-    pkgconfig(libglade-2.0 _GLADEIncDir _GLADELinkDir _GLADELinkFlags _GLADECflags)
-
-    find_path(GTK2_GLADE_INCLUDE_DIR
-      NAMES
-        glade/glade.h
-      PATHS
-        ${_GLADEIncDir}
-        /opt/gnome/include/libglade-2.0
-        /usr/include/libglade-2.0
-        /opt/include/libglade-2.0
-        /sw/include/libglade-2.0
-    )
-    gtk2_debug_message("GTK2_GLADE_INCLUDE_DIR is ${GTK2_GLADE_INCLUDE_DIR}")
-
-    pkgconfig(pango _PANGOIncDir _PANGOLinkDir _PANGOLinkFlags _PANGOCflags)
-
-    find_path(GTK2_PANGO_INCLUDE_DIR
-      NAMES
-        pango/pango.h
-      PATHS
-        ${_PANGOIncDir}
-        /usr/include/pango-1.0
-        /opt/gnome/include/pango-1.0
-        /opt/include/pango-1.0
-        /sw/include/pango-1.0
-    )
-    gtk2_debug_message("GTK2_PANGO_INCLUDE_DIR is ${GTK2_PANGO_INCLUDE_DIR}")
-
-    pkgconfig(cairo _CAIROIncDir _CAIROLinkDir _CAIROLinkFlags _CAIROCflags)
-
-    find_path(GTK2_CAIRO_INCLUDE_DIR
-      NAMES
-        cairo.h
-      PATHS
-        ${_CAIROIncDir}
-        /opt/gnome/include/cairo
-        /usr/include
-        /usr/include/cairo
-        /opt/include
-        /opt/include/cairo
-        /sw/include
-        /sw/include/cairo
-    )
-    gtk2_debug_message("GTK2_CAIRO_INCLUDE_DIR is ${GTK2_CAIRO_INCLUDE_DIR}")
-
-    pkgconfig(atk _ATKIncDir _ATKLinkDir _ATKLinkFlags _ATKCflags)
-
-    find_path(GTK2_ATK_INCLUDE_DIR
-      NAMES
-        atk/atk.h
-      PATHS
-        ${_ATKIncDir}
-        /opt/gnome/include/atk-1.0
-        /usr/include/atk-1.0
-        /opt/include/atk-1.0
-        /sw/include/atk-1.0
-    )
-    gtk2_debug_message("GTK2_ATK_INCLUDE_DIR is ${GTK2_ATK_INCLUDE_DIR}")
-
-    find_library(GTK2_GTK_LIBRARY
-      NAMES
-        gtk-x11-2.0
-      PATHS
-        ${_GTK2LinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GTK_LIBRARY is ${GTK2_GTK_LIBRARY}")
-
-    find_library(GTK2_GDK_LIBRARY
-      NAMES
-        gdk-x11-2.0
-      PATHS
-        ${_GDK2LinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GDK_LIBRARY is ${GTK2_GDK_LIBRARY}")
-
-    find_library(GTK2_GDK_PIXBUF_LIBRARY
-      NAMES
-        gdk_pixbuf-2.0
-      PATHS
-        ${_GDK2LinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GDK_PIXBUF_LIBRARY is ${GTK2_GDK_PIXBUF_LIBRARY}")
-
-    find_library(GTK2_GMODULE_LIBRARY
-      NAMES
-        gmodule-2.0
-      PATHS
-        ${_GMODULE2LinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GMODULE_LIBRARY is ${GTK2_GMODULE_LIBRARY}")
-
-    find_library(GTK2_GTHREAD_LIBRARY
-      NAMES
-        gthread-2.0
-      PATHS
-        ${_GTK2LinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GTHREAD_LIBRARY is ${GTK2_GTHREAD_LIBRARY}")
-
-    find_library(GTK2_GOBJECT_LIBRARY
-      NAMES
-        gobject-2.0
-      PATHS
-        ${_GTK2LinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GOBJECT_LIBRARY is ${GTK2_GOBJECT_LIBRARY}")
-
-    find_library(GTK2_GLIB_LIBRARY
-      NAMES
-        glib-2.0
-      PATHS
-        ${_GLIB2LinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GLIB_LIBRARY is ${GTK2_GLIB_LIBRARY}")
-
-    find_library(GTK2_GTKGL_LIBRARY
-      NAMES
-        gtkgl
-      PATHS
-        ${_GTK2LinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GTKGL_LIBRARY is ${GTK2_GTKGL_LIBRARY}")
-
-    find_library(GTK2_GLADE_LIBRARY
-      NAMES
-        glade-2.0
-      PATHS
-        ${_GLADELinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_GLADE_LIBRARY is ${GTK2_GLADE_LIBRARY}")
-
-    find_library(GTK2_PANGO_LIBRARY
-      NAMES
-        pango-1.0
-      PATHS
-        ${_PANGOLinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_PANGO_LIBRARY}")
-
-    find_library(GTK2_CAIRO_LIBRARY
-      NAMES
-        pangocairo-1.0
-      PATHS
-        ${_CAIROLinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_CAIRO_LIBRARY}")
-
-    find_library(GTK2_ATK_LIBRARY
-      NAMES
-        atk-1.0
-      PATHS
-        ${_ATKinkDir}
-        /usr/lib
-        /usr/local/lib
-        /usr/openwin/lib
-        /usr/X11R6/lib
-        /opt/gnome/lib
-        /opt/lib
-        /sw/lib
-    )
-    gtk2_debug_message("GTK2_ATK_LIBRARY is ${GTK2_ATK_LIBRARY}")
-
-    set(GTK2_INCLUDE_DIRS
-      ${GTK2_GTK_INCLUDE_DIR}
-      ${GTK2_GLIBCONFIG_INCLUDE_DIR}
-      ${GTK2_GLIB_INCLUDE_DIR}
-      ${GTK2_GDK_INCLUDE_DIR}
-      ${GTK2_GLADE_INCLUDE_DIR}
-      ${GTK2_PANGO_INCLUDE_DIR}
-      ${GTK2_CAIRO_INCLUDE_DIR}
-      ${GTK2_ATK_INCLUDE_DIR}
-    )
-
-    if (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
-      if (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
-        if (GTK2_GMODULE_LIBRARY)
-          if (GTK2_GTHREAD_LIBRARY)
-            if (GTK2_GOBJECT_LIBRARY)
-              if (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR)
-                if (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
-                  if (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
-                    if (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
-
-                      # set GTK2 libraries
-                      set (GTK2_LIBRARIES
-                        ${GTK2_GTK_LIBRARY}
-                        ${GTK2_GDK_LIBRARY}
-                        ${GTK2_GDK_PIXBUF_LIBRARY}
-                        ${GTK2_GMODULE_LIBRARY}
-                        ${GTK2_GTHREAD_LIBRARY}
-                        ${GTK2_GOBJECT_LIBRARY}
-                        ${GTK2_GLADE_LIBRARY}
-                        ${GTK2_PANGO_LIBRARY}
-                        ${GTK2_CAIRO_LIBRARY}
-                        ${GTK2_ATK_LIBRARY}
-                      )
-
-                      # check for gtkgl support
-                      if (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR)
-                        set(GTK2_GTKGL_FOUND TRUE)
-
-                        set(GTK2_INCLUDE_DIRS
-                          ${GTK2_INCLUDE_DIR}
-                          ${GTK2_GTKGL_INCLUDE_DIR}
-                        )
-
-                        set(GTK2_LIBRARIES
-                          ${GTK2_LIBRARIES}
-                          ${GTK2_GTKGL_LIBRARY}
-                        )
-                      endif (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR)
-
-                    else (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
-                      message(SEND_ERROR "Could not find ATK")
-                    endif (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
-                  else (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
-                    message(SEND_ERROR "Could not find CAIRO")
-                  endif (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
-                else (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
-                  message(SEND_ERROR "Could not find PANGO")
-                endif (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
-              else (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR)
-                message(SEND_ERROR "Could not find GLADE")
-              endif (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR)
-            else (GTK2_GOBJECT_LIBRARY)
-              message(SEND_ERROR "Could not find GOBJECT")
-            endif (GTK2_GOBJECT_LIBRARY)
-          else (GTK2_GTHREAD_LIBRARY)
-            message(SEND_ERROR "Could not find GTHREAD")
-          endif (GTK2_GTHREAD_LIBRARY)
-        else (GTK2_GMODULE_LIBRARY)
-          message(SEND_ERROR "Could not find GMODULE")
-        endif (GTK2_GMODULE_LIBRARY)
-      else (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
-        message(SEND_ERROR "Could not find GDK (GDK_PIXBUF)")
-      endif (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
-    else (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
-      message(SEND_ERROR "Could not find GTK2-X11")
-    endif (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
-
-
-    if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
-       set(GTK2_FOUND TRUE)
-    endif (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
-
-    if (GTK2_FOUND)
-      if (NOT GTK2_FIND_QUIETLY)
-        message(STATUS "Found GTK2: ${GTK2_LIBRARIES}")
-      endif (NOT GTK2_FIND_QUIETLY)
-    else (GTK2_FOUND)
-      if (GTK2_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find GTK2")
-      endif (GTK2_FIND_REQUIRED)
-    endif (GTK2_FOUND)
-
-    # show the GTK2_INCLUDE_DIRS and GTK2_LIBRARIES variables only in the advanced view
-    mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES)
-
-  endif (UNIX)
-endif (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
-


Fixing CMake scripts for LLVM.

Fixing CMake scripts for LLVM.

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

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -16,9 +16,17 @@
          "Used to get the directory to util, for example." FORCE)

     # -----------------------------------------------------------------------
+    # Check whether we compile with CLANG.
+    # -----------------------------------------------------------------------
+    set (COMPILER_IS_CLANG FALSE)
+    if (CMAKE_CXX_COMPILER MATCHES "clang\\+\\+")
+      set (COMPILER_IS_CLANG TRUE)
+    endif (CMAKE_CXX_COMPILER MATCHES "clang\\+\\+")
+
+    # -----------------------------------------------------------------------
     # GCC Setup
     # -----------------------------------------------------------------------
-    if (CMAKE_COMPILER_IS_GNUCXX)
+    if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
         # For the GCC, enable warnings.
         set (CMAKE_CXX_WARNING_LEVEL 4)
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wno-long-long -fstrict-aliasing -Wstrict-aliasing")
@@ -51,7 +59,7 @@

         # Pass CXX flags to flags.
         #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSEQAN_CXX_FLAGS_=\"${CMAKE_CXX_FLAGS}\"")
-    endif (CMAKE_COMPILER_IS_GNUCXX)
+    endif (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)

     # -----------------------------------------------------------------------
     # Visual Studio Setup
@@ -106,7 +114,7 @@
     # ---------------------------------------------------------------------------
     # Forwards Generation.
     # ---------------------------------------------------------------------------
-    if (CMAKE_COMPILER_IS_GNUCXX)
+    if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
         file (GLOB BASE_CONTENTS RELATIVE ${PATH}/seqan ${PATH}/seqan/[A-z]*)
         foreach (ENTRY ${BASE_CONTENTS})
             if (IS_DIRECTORY ${PATH}/seqan/${ENTRY})
@@ -134,7 +142,7 @@
             #    COMMAND ${PYTHON_EXECUTABLE} ${SEQAN_ROOT_SOURCE_DIR}/util/bin/build_forwards.py ${PATH}/seqan all
             #    DEPENDS ${HEADERS})")
         endif (MODULES)
-    endif (CMAKE_COMPILER_IS_GNUCXX)
+    endif (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)

     # ---------------------------------------------------------------------------
     # GUI Setup Stuff.
@@ -198,7 +206,7 @@
 #   of this target to subsequently targets added by seqan_add_test will
 #   be added.
 # * Setting definitions SEQAN_ENABLE_DEBUG=1 and SEQAN_ENABLE_TESTING=1.
-# * If the ${MODEL} variable is NightlyCoverage or ExperimentalCoverage,
+# * If the ${MODEL} variable is NightlyCoverage OR ExperimentalCoverage,
 #   and the compiler is GCC C++ then symbols for test coverate are added.

 macro (seqan_setup_tests TEST_TARGET)
@@ -216,16 +224,16 @@

     # Conditionally enable coverage mode.
     if (MODEL STREQUAL "NightlyCoverage")
-        if (CMAKE_COMPILER_IS_GNUCXX)
+        if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
             set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
-        endif (CMAKE_COMPILER_IS_GNUCXX)
+        endif (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
     endif (MODEL STREQUAL "NightlyCoverage")
     if (MODEL STREQUAL "ExperimentalCoverage")
-        if (CMAKE_COMPILER_IS_GNUCXX)
+        if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
             set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
-        endif (CMAKE_COMPILER_IS_GNUCXX)
+        endif (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
     endif (MODEL STREQUAL "ExperimentalCoverage")
 endmacro (seqan_setup_tests)


don't build ospcommon tests

don't build ospcommon tests

--- scripts/superbuild/dependencies/dep_ospcommon.cmake
+++ scripts/superbuild/dependencies/dep_ospcommon.cmake
@@ -38,6 +38,7 @@
     -DCMAKE_INSTALL_DOCDIR=doc
     -DCMAKE_INSTALL_BINDIR=bin
     -DCMAKE_BUILD_TYPE=Release
+    -DBUILD_TESTING=OFF
     $<$<BOOL:${BUILD_TBB_FROM_SOURCE}>:-DOSPCOMMON_TBB_ROOT=${TBB_PATH}>
   BUILD_COMMAND ${DEFAULT_BUILD_COMMAND}
   BUILD_ALWAYS OFF


build: handle directories for unified build

The directory paths would collide with a cross-compiled unified build of
LLVM and swift.  Adjust the directories to work in that environment.

--- cmake/modules/SwiftWindowsSupport.cmake
+++ cmake/modules/SwiftWindowsSupport.cmake
@@ -76,12 +76,12 @@
   set(UCRTVersion $ENV{UCRTVersion})

   # TODO(compnerd) use a target to avoid re-creating this file all the time
-  configure_file("${CMAKE_SOURCE_DIR}/utils/WindowsSDKVFSOverlay.yaml.in"
-                 "${CMAKE_BINARY_DIR}/windows-sdk-vfs-overlay.yaml"
+  configure_file("${SWIFT_SOURCE_DIR}/utils/WindowsSDKVFSOverlay.yaml.in"
+                 "${CMAKE_CURRENT_BINARY_DIR}/windows-sdk-vfs-overlay.yaml"
                  @ONLY)

   set(${flags}
-      -Xclang;-ivfsoverlay;-Xclang;"${CMAKE_BINARY_DIR}/windows-sdk-vfs-overlay.yaml"
+        -Xclang;-ivfsoverlay;-Xclang;"${CMAKE_CURRENT_BINARY_DIR}/windows-sdk-vfs-overlay.yaml"
       PARENT_SCOPE)
 endfunction()


PARQUET-941: Stop needless Boost static library detection

If PARQUET_BOOST_USE_SHARED is enabled (default), we never use Boost
static libraries. So we doesn't need to detect Boost static libraries as
a required dependency.

Boost packages on CentOS 7 doesn't provide static libraries. So we can't
build with Boost packages on CentOS 7 by the required dependency.

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

Closes #287 from kou/stop-needless-boost-static-library-detection and squashes the following commits:

de11e70 [Kouhei Sutou] Stop needless Boost static library detection

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -25,32 +25,37 @@
 set(ARROW_VERSION "15b874e47e3975c5240290ec7ed105bf8d1b56bc")

 # find boost headers and libs
-# Find shared Boost libraries.
 set(Boost_DEBUG TRUE)
 set(Boost_USE_MULTITHREADED ON)
-set(Boost_USE_STATIC_LIBS ON)
-find_package(Boost COMPONENTS regex REQUIRED)
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
-  set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG})
-else()
-  set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE})
-endif()
-
-# Find static Boost libraries.
-set(Boost_USE_STATIC_LIBS OFF)
-find_package(Boost COMPONENTS regex REQUIRED)
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
-  set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG})
-else()
-  set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE})
+if (PARQUET_BOOST_USE_SHARED)
+  # Find shared Boost libraries.
+  set(Boost_USE_STATIC_LIBS OFF)
+  find_package(Boost COMPONENTS regex REQUIRED)
+  if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
+    set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG})
+  else()
+    set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE})
+  endif()
+else()
+  # Find static Boost libraries.
+  set(Boost_USE_STATIC_LIBS ON)
+  find_package(Boost COMPONENTS regex REQUIRED)
+  if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
+    set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG})
+  else()
+    set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE})
+  endif()
 endif()

 message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIRS})
 message(STATUS "Boost libraries: " ${Boost_LIBRARIES})
-add_library(boost_static_regex STATIC IMPORTED)
-set_target_properties(boost_static_regex PROPERTIES IMPORTED_LOCATION ${BOOST_STATIC_REGEX_LIBRARY})
-add_library(boost_shared_regex SHARED IMPORTED)
-set_target_properties(boost_shared_regex PROPERTIES IMPORTED_LOCATION ${BOOST_SHARED_REGEX_LIBRARY})
+if (PARQUET_BOOST_USE_SHARED)
+  add_library(boost_shared_regex SHARED IMPORTED)
+  set_target_properties(boost_shared_regex PROPERTIES IMPORTED_LOCATION ${BOOST_SHARED_REGEX_LIBRARY})
+else()
+  add_library(boost_static_regex STATIC IMPORTED)
+  set_target_properties(boost_static_regex PROPERTIES IMPORTED_LOCATION ${BOOST_STATIC_REGEX_LIBRARY})
+endif()

 include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
 set(LIBS ${LIBS} ${Boost_LIBRARIES})


Added function to get git info from working repo.

--- cmake_modules/component_functions.cmake
+++ cmake_modules/component_functions.cmake
@@ -701,3 +701,32 @@
         string(REPLACE "\\" "\\\\" RESULT "${RESULT}")
     endif()
 endmacro(esc_backslash RESULT)
+
+#
+# Query git for the info regarding this code base.
+#
+function(get_git_tag)
+
+    #
+    # Get the current branch tag from git
+    #
+    execute_process(
+      COMMAND git rev-parse --abbrev-ref HEAD
+      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+      OUTPUT_VARIABLE TAG
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+    set(GIT_TAG ${TAG} CACHE STRING "Name of this git branch" FORCE)
+
+    #
+    # Get the hash associated with this branch
+    #
+    execute_process(
+      COMMAND git rev-parse ${GIT_TAG}
+      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+      OUTPUT_VARIABLE HASH
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+    set(GIT_HASH ${HASH} CACHE STRING "Hash for this git branch" FORCE)
+
+endfunction(get_git_tag)


[CMake] Fixing haswell filtering.

[CMake] Fixing haswell filtering.

Turns out this wasn't working at all.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -89,8 +89,8 @@
   string(REGEX MATCH "hw.cpusubtype: ([0-9]*)"
          SUBTYPE_MATCHED "${SUBTYPE}")
   set(HASWELL_SUPPORTED Off)
-  if(ARCHES_MATCHED)
-    if(CMAKE_MATCH_1 GREATER_OR_EQUAL_TO 8)
+  if(SUBTYPE_MATCHED)
+    if(${CMAKE_MATCH_1} GREATER 7)
       set(HASWELL_SUPPORTED On)
     endif()
   endif()


Adding gflags for glog and ceres

Adding gflags for glog and ceres

Former-commit-id: 80ece683e24ff20c45b3b3789d6a586dab32b17a

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

     get_target_property(GFLAGS_INCLUDE_DIR gflags INTERFACE_INCLUDE_DIRECTORIES)
     get_target_property(GFLAGS_LIBRARIES   gflags LOCATION)


Clang: Force absolute paths This helps with some diagnostics tools as we have various compile units in different paths.

--- cmake/px4_add_common_flags.cmake
+++ cmake/px4_add_common_flags.cmake
@@ -92,10 +92,12 @@
 		)

 	# compiler specific flags
-	if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+	if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang"))

 		# force color for clang (needed for clang + ccache)
 		add_compile_options(-fcolor-diagnostics)
+		# force absolute paths
+		add_compile_options(-fdiagnostics-absolute-paths)

 		# QuRT 6.4.X compiler identifies as Clang but does not support this option
 		if (NOT "${PX4_PLATFORM}" STREQUAL "qurt")


Optional components in install target

Optional components in install target

--- share/DisCODeMacros.cmake
+++ share/DisCODeMacros.cmake
@@ -115,8 +115,11 @@
 	install(
 	    TARGETS ${COMP_NAME}
 		RUNTIME DESTINATION bin COMPONENT components
+		OPTIONAL
 		LIBRARY DESTINATION lib COMPONENT components
+		OPTIONAL
 		ARCHIVE DESTINATION lib
+		OPTIONAL
 	)
 ENDMACRO(INSTALL_COMPONENT)

@@ -169,4 +172,4 @@

 		EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E remove ${LOCATION}/${DATASET}.rar)
 	ENDIF()
-ENDMACRO(GET_DATASET)+ENDMACRO(GET_DATASET)


COMP: Add dependency on the Strain module

For itkBlockMatchingStrainWindowDisplacementCalculator.h

--- itk-module.cmake
+++ itk-module.cmake
@@ -14,6 +14,7 @@
     ITKIOImageBase
     ITKTransform
     ITKRegistrationCommon
+    Strain
     ${_fft_depends}
   PRIVATE_DEPENDS
     ITKHDF5


fbcode_builder: cmake: propagate thrift include dependencies correctly

Summary:
Update `add_thrift_cpp2_library()` to pass in the correct `-I` flags when
invoking the thrift compiler so that it can find all of the other thrift files
that this library depends on.

D16062657 was a previous attempt to do this, but suffered from a few problems:
- It required all dependencies to be defined before
  `add_thrift_cpp2_library()` was called.  This requires users to carefully
  order their CMake files and subdirectory include ordering.
- It only handled one level of dependencies, and did not propagate include
  paths for deeper dependencies.
- It set the include path for dependencies to the source directory path where
  the dependency was originally built, rather than the directory where the
  thrift file for that dependency would be installed.

This change does require CMake 3.8+.  Previous versions of CMake do not
support using generator expressions to generate multiple arguments for a
custom command.

Reviewed By: strager

Differential Revision: D17005381

fbshipit-source-id: 31190beba94b4d1010445375a5e2791450230f7d

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -17,13 +17,24 @@
 #   The sub-directory where generated headers will be installed.
 #   Defaults to "include" if not specified.  The caller must still call
 #   install() to install the thrift library if desired.
+# - THRIFT_INCLUDE_DIR <path>
+#   The sub-directory where generated headers will be installed.
+#   Defaults to "${INCLUDE_DIR}/thrift-files" if not specified.
+#   The caller must still call install() to install the thrift library if
+#   desired.
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
   set(one_value_args INCLUDE_DIR)
-  set(multi_value_args SERVICES DEPENDS OPTIONS)
+  set(multi_value_args SERVICES DEPENDS OPTIONS THRIFT_INCLUDE_DIR)
   fb_cmake_parse_args(
     ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
   )
+  if(NOT DEFINED ARG_INCLUDE_DIR)
+    set(ARG_INCLUDE_DIR "include")
+  endif()
+  if(NOT DEFINED ARG_THRIFT_INCLUDE_DIR)
+    set(ARG_THRIFT_INCLUDE_DIR "${ARG_INCLUDE_DIR}/thrift-files")
+  endif()

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -39,9 +50,6 @@
     "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
   )
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)
-  if(NOT DEFINED ARG_INCLUDE_DIR)
-    set(ARG_INCLUDE_DIR "include")
-  endif()

   if (NOT "${include_prefix}" STREQUAL "")
     list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
@@ -78,22 +86,21 @@
     )
   endforeach()

-  list(APPEND thrift_include_options -I "${CMAKE_SOURCE_DIR}")
-  foreach(depends IN LISTS ARG_DEPENDS)
-    get_property(thrift_include_directory
-      TARGET ${depends}
-      PROPERTY THRIFT_INCLUDE_DIRECTORY)
-
-    if (thrift_include_directory STREQUAL "")
-      message(STATUS "No thrift dependency found for ${depends}")
-    else()
-      list(
-        APPEND thrift_include_options
-        -I "${thrift_include_directory}"
-      )
-    endif()
-  endforeach()
-
+  # This generator expression gets the list of include directories required
+  # for all of our dependencies.
+  # It requires using COMMAND_EXPAND_LISTS in the add_custom_command() call
+  # below.  COMMAND_EXPAND_LISTS is only available in CMake 3.8+
+  # If we really had to support older versions of CMake we would probably need
+  # to use a wrapper script around the thrift compiler that could take the
+  # include list as a single argument and split it up before invoking the
+  # thrift compiler.
+  if (NOT POLICY CMP0067)
+    message(FATAL_ERROR "add_thrift_cpp2_library() requires CMake 3.8+")
+  endif()
+  set(
+    thrift_include_options
+    "-I;$<JOIN:$<TARGET_PROPERTY:${LIB_NAME}.thrift_includes,INTERFACE_INCLUDE_DIRECTORIES>,;-I;>"
+  )
   file(
     GLOB_RECURSE THRIFT_TEMPLATE_FILES
     FOLLOW_SYMLINKS "${FBTHRIFT_TEMPLATES_DIR}/cpp2/*.mustache"
@@ -104,6 +111,7 @@
     OUTPUT
       ${generated_headers}
       ${generated_sources}
+    COMMAND_EXPAND_LISTS
     COMMAND
       "${CMAKE_COMMAND}" -E make_directory "${output_dir}"
     COMMAND
@@ -111,7 +119,7 @@
       --strict
       --templates "${FBTHRIFT_TEMPLATES_DIR}"
       --gen "mstch_cpp2:${GEN_ARG_STR}"
-      ${thrift_include_options}
+      "${thrift_include_options}"
       -o "${output_dir}"
       "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
     WORKING_DIRECTORY
@@ -159,11 +167,27 @@
     PROPERTY PUBLIC_HEADER ${generated_headers}
   )

+  # Define a dummy interface library to help propagate the thrift include
+  # directories between dependencies.
+  add_library("${LIB_NAME}.thrift_includes" INTERFACE)
+  target_include_directories(
+    "${LIB_NAME}.thrift_includes"
+    INTERFACE
+      "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>"
+      "$<INSTALL_INTERFACE:${ARG_THRIFT_INCLUDE_DIR}>"
+  )
+  foreach(dep IN LISTS ARG_DEPENDS)
+    target_link_libraries(
+      "${LIB_NAME}.thrift_includes"
+      INTERFACE "${dep}.thrift_includes"
+    )
+  endforeach()
+
   set_target_properties(
     "${LIB_NAME}"
     PROPERTIES
-      EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
-      THRIFT_INCLUDE_DIRECTORY "${CMAKE_SOURCE_DIR}"
+      EXPORT_PROPERTIES "THRIFT_INSTALL_DIR"
+      THRIFT_INSTALL_DIR "${ARG_THRIFT_INCLUDE_DIR}/${include_prefix}"
       HEADER_INSTALL_DIR "${ARG_INCLUDE_DIR}/${include_prefix}/gen-cpp2"
   )
 endfunction()


Fix FindCAF module for static CAF builds

--- cmake/FindCAF.cmake
+++ cmake/FindCAF.cmake
@@ -20,6 +20,11 @@

 if(CAF_FIND_COMPONENTS STREQUAL "")
   message(FATAL_ERROR "FindCAF requires at least one COMPONENT.")
+endif()
+
+set(suffix "")
+if(NOT BUILD_SHARED_LIBS)
+  set(suffix "_static")
 endif()

 # iterate over user-defined components
@@ -83,7 +88,7 @@
       endif ()
       find_library(CAF_LIBRARY_${UPPERCOMP}
                    NAMES
-                     "caf_${comp}"
+                     "caf_${comp}${suffix}"
                    HINTS
                      ${library_hints}
                      /usr/lib
@@ -121,33 +126,33 @@
 if (CAF_core_FOUND AND NOT TARGET caf::core)
   add_library(caf::core UNKNOWN IMPORTED)
   set_target_properties(caf::core PROPERTIES
-    IMPORTED_LOCATION "${CAF_LIBRARY_CORE}")
-  set_target_properties(caf::core PROPERTIES
+    IMPORTED_LOCATION "${CAF_LIBRARY_CORE}"
     INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_CORE}")
 endif ()
 if (CAF_io_FOUND AND NOT TARGET caf::io)
   add_library(caf::io UNKNOWN IMPORTED)
   set_target_properties(caf::io PROPERTIES
-    IMPORTED_LOCATION "${CAF_LIBRARY_IO}")
-  set_target_properties(caf::io PROPERTIES
-      INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_IO}")
+    IMPORTED_LOCATION "${CAF_LIBRARY_IO}"
+    INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_IO}"
+    INTERFACE_LINK_LIBRARIES "caf::core")
 endif ()
 if (CAF_openssl_FOUND AND NOT TARGET caf::openssl)
   add_library(caf::openssl UNKNOWN IMPORTED)
   set_target_properties(caf::openssl PROPERTIES
-    IMPORTED_LOCATION "${CAF_LIBRARY_OPENSSL}")
-  set_target_properties(caf::openssl PROPERTIES
-    INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_OPENSSL}")
+    IMPORTED_LOCATION "${CAF_LIBRARY_OPENSSL}"
+    INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_OPENSSL}"
+    INTERFACE_LINK_LIBRARIES "caf::core;caf::io")
 endif ()
 if (CAF_opencl_FOUND AND NOT TARGET caf::opencl)
   add_library(caf::opencl UNKNOWN IMPORTED)
   set_target_properties(caf::opencl PROPERTIES
-    IMPORTED_LOCATION "${CAF_LIBRARY_OPENCL}")
-  set_target_properties(caf::opencl PROPERTIES
-    INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_OPENCL}")
+    IMPORTED_LOCATION "${CAF_LIBRARY_OPENCL}"
+    INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_OPENCL}"
+    INTERFACE_LINK_LIBRARIES "caf::core")
 endif ()
 if (CAF_test_FOUND AND NOT TARGET caf::test)
   add_library(caf::test INTERFACE IMPORTED)
   set_target_properties(caf::test PROPERTIES
-    INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_TEST}")
+    INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_TEST}"
+    INTERFACE_LINK_LIBRARIES "caf::core")
 endif ()


FindHIP: Handle remove_item from empty lists

Change-Id: I6adf31b32edeae9e8454b1a2528064cf3985fca1

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -514,7 +514,7 @@
     # Separate the sources from the options
     HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _nvcc_options ${ARGN})
     HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files _source_files ${_sources} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options})
-    list(REMOVE_ITEM _sources ${_source_files})
+    list(REMOVE_ITEM _sources "${_source_files}")
     if("x${HCC_HOME}" STREQUAL "x")
         set(HCC_HOME "/opt/rocm/hcc")
     endif()
@@ -530,7 +530,7 @@
     # Separate the sources from the options
     HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _nvcc_options ${ARGN})
     HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files _source_files ${_sources} ${_cmake_options} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options})
-    list(REMOVE_ITEM _sources ${_source_files})
+    list(REMOVE_ITEM _sources "${_source_files}")
     add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
     set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE ${HIP_C_OR_CXX})
 endmacro()


Remove CMake find module for stb

Remove CMake find module for stb

stb is handled by Conan

--- cmake/Findstb.cmake
+++ cmake/Findstb.cmake
@@ -1,75 +0,0 @@
-##  Finds the Stb utility library on your computer.
-#
-#   If Stb is not found on your computer, this script also gives the option to
-#   download the library and build it from source.
-#
-#   This script exports the following parameters for use if you find the Stb
-#   package:
-#   - Stb_FOUND: Whether Stb has been found on your computer (or built from
-#     source).
-#   - Stb_INCLUDE_DIRS: The directory where the header files of Stb are located.
-
-#First try to find a PackageConfig for this library.
-find_package(PkgConfig QUIET)
-pkg_check_modules(PC_Stb QUIET Stb)
-
-find_path(Stb_INCLUDE_DIRS stb/stb_image_resize.h #Search for something that is a little less prone to false positives than just stb.h.
-    HINTS ${PC_Stb_INCLUDEDIR} ${PC_Stb_INCLUDE_DIRS}
-    PATHS "$ENV{PROGRAMFILES}" "$ENV{PROGRAMW6432}" "/usr/include"
-    PATH_SUFFIXES include/stb stb include
-)
-
-include(FindPackageHandleStandardArgs)
-set(_stb_find_required ${Stb_FIND_REQUIRED}) #Temporarily set to optional so that we don't get a message when it's not found but you want to build from source.
-set(_stb_find_quietly ${Stb_FIND_QUIETLY})
-set(Stb_FIND_REQUIRED FALSE)
-set(Stb_FIND_QUIETLY TRUE)
-find_package_handle_standard_args(Stb DEFAULT_MSG Stb_INCLUDE_DIRS)
-set(Stb_FIND_REQUIRED ${_stb_find_required})
-set(Stb_FIND_QUIETLY ${_stb_find_quietly})
-
-set(CuraEngine_Download_Stb FALSE)
-if(Stb_FOUND) #Found an existing installation.
-    if(NOT Stb_FIND_QUIETLY)
-        message(STATUS "Found Stb installation at: ${Stb_INCLUDE_DIRS}")
-    endif()
-else()
-    #Then optionally clone Stb ourselves.
-    option(BUILD_Stb "Build Stb from source." ON) #This is a lie actually, since Stb is header-only and doesn't need any building. We don't build the docs or tests.
-    if(BUILD_Stb)
-        if(NOT Stb_FIND_QUIETLY)
-            message(STATUS "Building Stb from source.")
-        endif()
-
-        include(ExternalProject)
-        # Stb's commits in early February seems to cause the engine to fail compilation on Mac.
-        ExternalProject_Add(stb
-            GIT_REPOSITORY "https://github.com/nothings/stb.git"
-            GIT_TAG d5d052c806eee2ca1f858cb58b2f062d9fa25b90
-            UPDATE_DISCONNECTED TRUE
-            CONFIGURE_COMMAND "" #We don't want to actually go and build/test/generate it. Just need to download the headers.
-            BUILD_COMMAND ""
-            INSTALL_COMMAND "" #Assume that the user doesn't want to install all dependencies on his system. We just need to get them for building the application.
-        )
-        set(CuraEngine_Download_Stb TRUE)
-        set(Stb_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/stb-prefix/src/stb")
-        set(Stb_FOUND TRUE)
-        if(NOT Stb_FIND_QUIETLY)
-            message(STATUS "Created Stb installation at: ${Stb_INCLUDE_DIRS}")
-        endif()
-    elseif(NOT Stb_FIND_QUIETLY) #Don't have an installation but don't want us to build it either? Screw you, then.
-        if(Stb_FIND_REQUIRED)
-            message(FATAL_ERROR "Could NOT find Stb.")
-        else()
-            message(WARNING "Could NOT find Stb.")
-        endif()
-    endif()
-endif()
-
-mark_as_advanced(Stb_INCLUDE_DIRS)
-add_library(stb::stb INTERFACE)
-target_include_directories(stb::stb
-        PUBLIC
-        $<BUILD_INTERFACE:${Stb_INCLUDE_DIRS}>
-        $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
-        )


Turned off CMAKE option "TREAT_WARNINGS_AS_ERRORS"

* This option is for devs and can be turned on as default as soon as we deliver AE without any warnings.

--- cmake/Options.cmake
+++ cmake/Options.cmake
@@ -20,7 +20,7 @@
 set(ASCEMU_TOOLS_PATH "tools" CACHE PATH "The directory where you want the tools installed.")
 option(BUILD_WITH_WARNINGS "Enable/Disable warnings on compilation" ON)
 option(USE_PCH "Enable precompiled headers - it will reduce compilation time" ON)
-option(TREAT_WARNINGS_AS_ERRORS "Treats warnings as errors" ON)
+option(TREAT_WARNINGS_AS_ERRORS "Treats warnings as errors" OFF)

 if(NOT USE_PCH)
     set(ASCEMU_COMMENT_PCH //)


removing unused SOFA_QT4 compiler definition.
It was used to differentiate compilation with Qt3 or Qt4. (reverted from commit 7c4000daff62da8d4911bbdaf74dbb1aed4d265b [formerly 3a9b9588ecf2be067648046ab4a070d96cf43140])

Former-commit-id: 146c447ee6cc5223a913694c0ad663da648f2918

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -54,6 +54,7 @@
 ### the ENV{QTDIR} MUST BE DEFINED in order to find Qt (giving a path in find_package does not work)
 sofa_option(SOFA-EXTERNAL_QT_PATH PATH "${QTDIR}" "Qt dir path")
 sofa_option(SOFA-EXTERNAL_QT5_PATH PATH "${QTDIR}" "Qt5 dir path")
+list(APPEND compilerDefines SOFA_QT4)

 ## boost
 set(MINIBOOST_PATH "${SOFA_EXTLIBS_DIR}/miniBoost")


cram: Added MSVC-specific output directories to PATH

--- .cmake/Modules/Cram.cmake
+++ .cmake/Modules/Cram.cmake
@@ -3,8 +3,11 @@
 # For details see the LICENSE file distributed with Criterion.

 set(PATH_VAR
+  "${PROJECT_BINARY_DIR}/Debug"
   "${PROJECT_BINARY_DIR}/samples"
+  "${PROJECT_BINARY_DIR}/samples/Debug"
   "${PROJECT_BINARY_DIR}/samples/tests"
+  "${PROJECT_BINARY_DIR}/samples/tests/Debug"
   "${PROJECT_BINARY_DIR}/external/lib"
   "${PROJECT_BINARY_DIR}/external/bin"
 )


Unsetting variables some python packages can be found on second pass

--- scripts/PythonPackage.cmake
+++ scripts/PythonPackage.cmake
@@ -48,6 +48,10 @@
         set(${PACKAGE}_FIND_QUIETLY FALSE)
         set(${PACKAGE_UPPER}_FIND_QUIETLY FALSE)
     endif()
+    # Unset prior variables
+    unset(${PACKAGE}_LOCATION CACHE)
+    unset(${PACKAGE}_FOUND CACHE)
+    unset(${PACKAGE_UPPER}_FOUND CACHE)

     execute_process(
         COMMAND ${LOCALPYTHON} -c


disable USE_DRC_PLANE_SEG for superbuild

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -305,6 +305,7 @@
     -DUSE_PORTMIDI:BOOL=OFF
     -DUSE_DRC:BOOL=OFF
     -DUSE_DRC_MAPS:BOOL=OFF
+    -DUSE_DRC_PLANE_SEG:BOOL=OFF
     -DUSE_DRAKE:BOOL=OFF
     -DUSE_LCM_GL:BOOL=${USE_LIBBOT}
     -DUSE_LIBBOT:BOOL=${USE_LIBBOT}


Remove the now unused alsa cmake script

Remove the now unused alsa cmake script

--- cmake/FindAlsa.cmake
+++ cmake/FindAlsa.cmake
@@ -1,69 +0,0 @@
-# Alsa check, based on libkmid/configure.in.in.
-# Only the support for Alsa >= 0.9.x was included; 0.5.x was dropped (but feel free to re-add it if you need it)
-# It defines ...
-# It offers the following macros:
-#  ALSA_CONFIGURE_FILE(config_header) - generate a config.h, typical usage:
-#                                       ALSA_CONFIGURE_FILE(${CMAKE_BINARY_DIR}/config-alsa.h)
-#  ALSA_VERSION_STRING(version_string)  looks for alsa/version.h and reads the version string into
-#                                       the first argument passed to the macro
-
-# Copyright (c) 2006, David Faure, <faure@kde.org>
-# Copyright (c) 2007, Matthias Kretz <kretz@kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-include(CheckIncludeFiles)
-include(CheckIncludeFileCXX)
-include(CheckLibraryExists)
-
-# Already done by toplevel
-find_library(ASOUND_LIBRARY asound)
-set(ASOUND_LIBRARY_DIR "")
-if(ASOUND_LIBRARY)
-   get_filename_component(ASOUND_LIBRARY_DIR ${ASOUND_LIBRARY} PATH)
-endif(ASOUND_LIBRARY)
-
-check_library_exists(asound snd_seq_create_simple_port "${ASOUND_LIBRARY_DIR}" HAVE_LIBASOUND2)
-if(HAVE_LIBASOUND2)
-    message(STATUS "Found ALSA: ${ASOUND_LIBRARY}")
-else(HAVE_LIBASOUND2)
-    message(STATUS "ALSA not found")
-endif(HAVE_LIBASOUND2)
-set(ALSA_FOUND ${HAVE_LIBASOUND2})
-
-find_path(ALSA_INCLUDES alsa/version.h)
-
-macro(ALSA_VERSION_STRING _result)
-    # check for version in alsa/version.h
-    if(ALSA_INCLUDES)
-        file(READ "${ALSA_INCLUDES}/alsa/version.h" _ALSA_VERSION_CONTENT)
-        string(REGEX REPLACE ".*SND_LIB_VERSION_STR.*\"(.*)\".*" "\\1" ${_result} ${_ALSA_VERSION_CONTENT})
-    else(ALSA_INCLUDES)
-        message(STATUS "ALSA version not known. ALSA output will probably not work correctly.")
-    endif(ALSA_INCLUDES)
-endmacro(ALSA_VERSION_STRING _result)
-
-
-get_filename_component(_FIND_ALSA_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
-macro(ALSA_CONFIGURE_FILE _destFile)
-    check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
-    check_include_files(machine/soundcard.h HAVE_MACHINE_SOUNDCARD_H)
-
-    check_include_files(linux/awe_voice.h HAVE_LINUX_AWE_VOICE_H)
-    check_include_files(awe_voice.h HAVE_AWE_VOICE_H)
-    check_include_files(/usr/src/sys/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_I386_ISA_SOUND_AWE_VOICE_H)
-    check_include_files(/usr/src/sys/gnu/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_GNU_I386_ISA_SOUND_AWE_VOICE_H)
-
-    check_include_file_cxx(sys/asoundlib.h HAVE_SYS_ASOUNDLIB_H)
-    check_include_file_cxx(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H)
-
-    check_library_exists(asound snd_pcm_resume "${ASOUND_LIBRARY_DIR}" ASOUND_HAS_SND_PCM_RESUME)
-    if(ASOUND_HAS_SND_PCM_RESUME)
-        set(HAVE_SND_PCM_RESUME 1)
-    endif(ASOUND_HAS_SND_PCM_RESUME)
-
-    configure_file(${_FIND_ALSA_MODULE_DIR}/config-alsa.h.cmake ${_destFile})
-endmacro(ALSA_CONFIGURE_FILE _destFile)
-
-mark_as_advanced(ALSA_INCLUDES ASOUND_LIBRARY)


changed GLEW_INCLUDE_PATH to standard GLEW_INCLUDE_DIR and removed GLEW_FOUND as CACHE variable

--- cmake/FindGLEW.cmake
+++ cmake/FindGLEW.cmake
@@ -3,12 +3,12 @@
 # Once done this will define
 #
 # GLEW_FOUND
-# GLEW_INCLUDE_PATH
+# GLEW_INCLUDE_DIR
 # GLEW_LIBRARY
 #

 IF (WIN32)
-    FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
+    FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
         $ENV{PROGRAMFILES}/GLEW/include
         ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
         DOC "The directory where GL/glew.h resides")
@@ -20,7 +20,7 @@
         ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
         DOC "The GLEW library")
 ELSE (WIN32)
-    FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
+    FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
         /usr/include
         /usr/local/include
         /sw/include
@@ -38,10 +38,10 @@
         DOC "The GLEW library")
 ENDIF (WIN32)

-IF (GLEW_INCLUDE_PATH)
-    SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ELSE (GLEW_INCLUDE_PATH)
-    SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ENDIF (GLEW_INCLUDE_PATH)
+# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDE_DIR)

-MARK_AS_ADVANCED( GLEW_FOUND )
+MARK_AS_ADVANCED(GLEW_INCLUDE_DIR)
+MARK_AS_ADVANCED(GLEW_LIBRARY)


turn on optimisation for release builds on linux

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -1,6 +1,7 @@

 if( UNIX )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fPIC" )
+  set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3")
 else()
   add_definitions( -D_WIN32_WINNT=0x601 )
   add_definitions( -D_CRT_SECURE_NO_WARNINGS )


cmake: add make_span support to external span lib


added md5sum for sdl2 package

added md5sum for sdl2 package

--- cmake/get-sdl2.cmake
+++ cmake/get-sdl2.cmake
@@ -20,7 +20,7 @@
     PREFIX ${DEPENDENCY_EXTRACT_DIR}
     DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
     URL http://libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz
-    URL_MD5 1
+    URL_MD5 d4055424d556b4a908aa76fad63abd3c
     #CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${DEPENDENCY_INSTALL_DIR}
     INSTALL_DIR ${DEPENDENCY_INSTALL_DIR}
     CMAKE_ARGS ${SDL2_CMAKE_ARGS}


CMake: Fix so LINUX can be used to check OS.

--- cmake/platform.cmake
+++ cmake/platform.cmake
@@ -5,6 +5,9 @@
   include(mac)
 endif()

+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  SET(LINUX 1)
+endif()
 if (LINUX)
   include(linux)
 endif()


Add TCORE Generic in prebuild.cmake

Add TCORE Generic in prebuild.cmake

During the cross-compilation on x64 host with MSVC for ARMv8, the
build fails as there is no define directives for Generic core.

--- cmake/prebuild.cmake
+++ cmake/prebuild.cmake
@@ -581,6 +581,15 @@
     set(ZGEMM_UNROLL_M 8)
     set(ZGEMM_UNROLL_N 2)
     set(SYMV_P 8)
+  elseif ("${TCORE}" STREQUAL "GENERIC")
+    file(APPEND ${TARGET_CONF_TEMP}
+      "#define L1_DATA_SIZE 32768\n"
+      "#define L1_DATA_LINESIZE 128\n"
+      "#define L2_SIZE 524288\n"
+      "#define L2_LINESIZE 128 \n"
+      "#define DTB_DEFAULT_ENTRIES 128\n"
+      "#define DTB_SIZE 4096\n"
+      "#define L2_ASSOCIATIVE 8\n")
   endif()
   set(SBGEMM_UNROLL_M 8)
   set(SBGEMM_UNROLL_N 4)


More :bug:

More :bug:

--- scripts/EnvironmentScript.cmake
+++ scripts/EnvironmentScript.cmake
@@ -28,7 +28,7 @@
 # Adds many paths to a path file
 function(_add_to_a_path THISFILE)
     foreach(path ${ARGN})
-        _add_to_a_path_single("${THISFILE}" "${these_files}")
+        _add_to_a_path_single("${THISFILE}" "${path}")
     endforeach()
 endfunction()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/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   09)
+SET(KWSYS_DATE_STAMP_DAY   10)


debug travis 9

debug travis 9

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -167,7 +167,7 @@
         # For debugging with lldb
         $<$<CONFIG:Debug>:
             -g
-            -v
+            # -v
         >

     )


Switched to C++14

Switched to C++14

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -19,7 +19,7 @@

 set(DEFAULT_PROJECT_OPTIONS
     DEBUG_POSTFIX             "_d"
-    CXX_STANDARD              11
+    CXX_STANDARD              14
     LINKER_LANGUAGE           "CXX"
     POSITION_INDEPENDENT_CODE ON
     CXX_VISIBILITY_PRESET     "hidden"


Refactor RubyNarray package detector

Refactor RubyNarray package detector

--- cmake/FindRubyNArray.cmake
+++ cmake/FindRubyNArray.cmake
@@ -1,22 +1,45 @@
 FIND_PACKAGE(Ruby REQUIRED)

-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r narray -e "print 'true'"
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r narray -e "print 'true'"
 	OUTPUT_VARIABLE RUBY_HAS_NARRAY
 	ERROR_QUIET)

 # find vendor arch dir
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"
-	OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR
-	ERROR_QUIET)
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']".
+    OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR
+    ERROR_QUIET)

-FIND_PATH(RUBY_NARRAY_INCLUDE_DIR narray.h
-	HINTS ${RUBY_VENDOR_ARCH_DIR} ${RUBY_LIBRARY} ${RUBY_POSSIBLE_LIB_DIR})
+find_program(GEM_EXECUTABLE NAMES gem)

-FIND_FILE(RUBY_NARRAY_LIBRARY NAMES narray.bundle narray.so
-	HINTS ${RUBY_VENDOR_ARCH_DIR} ${RUBY_LIBRARY} ${RUBY_POSSIBLE_LIB_DIR})
+if (GEM_EXECUTABLE)
+	EXECUTE_PROCESS(COMMAND ${GEM_EXECUTABLE} which narray
+		OUTPUT_VARIABLE RUBY_NARRAY_PATH
+		ERROR_QUIET)
+
+	if(RUBY_NARRAY_PATH)
+		SET(RUBY_HAS_NARRAY 1)
+		STRING(REGEX REPLACE "(.*)/narray.*$" "\\1" RUBY_NARRAY_PATH ${RUBY_NARRAY_PATH})
+
+		FIND_PATH(RUBY_NARRAY_INCLUDE_DIR narray.h
+			HINTS ${RUBY_NARRAY_PATH})
+
+		FIND_FILE(RUBY_NARRAY_LIBRARY NAMES narray.bundle narray.so
+			HINTS ${RUBY_NARRAY_PATH})
+	endif()
+endif()
+
+if (NOT RUBY_NARRAY_INCLUDE_DIR)
+	FIND_PATH(RUBY_NARRAY_INCLUDE_DIR narray.h
+		HINTS ${RUBY_VENDOR_ARCH_DIR} ${RUBY_LIBRARY} ${RUBY_POSSIBLE_LIB_DIR})
+endif()
+
+if (NOT RUBY_NARRAY_LIBRARY)
+	FIND_FILE(RUBY_NARRAY_LIBRARY NAMES narray.bundle narray.so
+		HINTS ${RUBY_VENDOR_ARCH_DIR} ${RUBY_LIBRARY} ${RUBY_POSSIBLE_LIB_DIR})
+endif()

 INCLUDE (FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(RubyNArray DEFAULT_MSG
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(RubyNArray DEFAULT_MSG
 	RUBY_HAS_NARRAY RUBY_NARRAY_INCLUDE_DIR RUBY_NARRAY_LIBRARY)

 MARK_AS_ADVANCED(RUBY_NARRAY_INCLUDE_DIR RUBY_NARRAY_LIBRARY)


cmake/Macros: add some install commands

cmake/Macros: add some install commands

--- cmake/Modules/Macros.cmake
+++ cmake/Modules/Macros.cmake
@@ -46,11 +46,24 @@
   endif()
 endfunction()

+function(add_copy_target_step target)
+  get_target_property(target_loc ${target} LOCATION)
+  add_copy_target_file_step(${target} ${target_loc})
+endfunction()
+
 function(install_external_library target)
   foreach(file ${ARGN})
     install(CODE "get_filename_component(resolved_file \"${file}\" REALPATH)\n get_filename_component(file_name \"${file}\" NAME)\n file(INSTALL DESTINATION ${LIB_INSTALL_DIR} TYPE FILE RENAME \${file_name} FILES \"\${resolved_file}\" )")
     add_copy_target_file_step(${target} "${file}")
   endforeach()
+endfunction()
+
+function(install_library target)
+  # dlls are runtime targets, import libs are archive, but we don't need them
+  install(TARGETS "${target}"
+          RUNTIME DESTINATION "${LIB_INSTALL_DIR}"
+          LIBRARY DESTINATION "${LIB_INSTALL_DIR}")
+  add_copy_target_step(${target})
 endfunction()

 #######################################################################################################################


Reapply change

Reapply change

--- cmake/ThirdPartyFFTW.cmake
+++ cmake/ThirdPartyFFTW.cmake
@@ -28,6 +28,5 @@
         MESSAGE(STATUS "Build FFTW: ${TPDIST}/lib/lib${FFTW_LIB}.so")
     ELSE ()
         INCLUDE (FindFFTW)
-        INCLUDE_DIRECTORIES(${FFTW_INCLUDE_DIR})
     ENDIF()
 ENDIF( NEKTAR_USE_FFTW )


Fix cmake format issue.

Fix cmake format issue.

--- cmake/external_rules.cmake
+++ cmake/external_rules.cmake
@@ -125,6 +125,7 @@
   message("CMake toolchain file: ${CMAKE_TOOLCHAIN_FILE}")

   set(CMAKE_SUBBUILD_OPTIONS)
+
   if (CMAKE_BUILD_TYPE)
     # If Release or Debug were specified, pass it along.
     set(CMAKE_SUBBUILD_OPTIONS
@@ -144,15 +145,16 @@
     if(MSVC_RUNTIME_LIBRARY_STATIC)
       if (CMAKE_BUILD_TYPE STREQUALS "Debug")
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MTd")
-      else()  // build type
+      else()
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MT")
-      endif()  // build type
-    else()  // runtime library
+      endif()
+    else()
       if (CMAKE_BUILD_TYPE STREQUALS "Debug")
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MDd")
-      else()  // build type
+      else()  # build type
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MD")
-      endif()  // build type
+      endif()
+    endif()
     set(CMAKE_SUBBUILD_OPTIONS
         ${CMAKE_SUBBUILD_OPTIONS}
         -DCMAKE_C_FLAGS=${SUBBUILD_MSVC_RUNTIME_FLAG}


Don't use if(DESKTOP) in external_rules.cmake

--- cmake/external_rules.cmake
+++ cmake/external_rules.cmake
@@ -93,7 +93,7 @@
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external
   )

-  if(DESKTOP)
+  if(NOT ANDROID AND NOT IOS)
     # CMake's find_package(OpenSSL) doesn't quite work right with BoringSSL unless the header
     # file contains OPENSSL_VERSION_NUMBER.
     file(READ ${PROJECT_BINARY_DIR}/external/src/boringssl/src/include/openssl/opensslv.h TMP_HEADER_CONTENTS)
@@ -125,7 +125,7 @@
       -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}"
       -G "${CMAKE_GENERATOR}")

-  if(DESKTOP)
+  if(NOT ANDROID AND NOT IOS)
     execute_process(
       COMMAND ${ENV_COMMAND} cmake ${CMAKE_SUBBUILD_OPTIONS} ../boringssl/src
       WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external/src/boringssl-build
@@ -148,7 +148,7 @@
     if (boringssl_build_status AND NOT boringssl_build_status EQUAL 0)
       message(FATAL_ERROR "BoringSSL build failed: ${boringssl_build_status}")
     endif()
-   endif()
+  endif()
 endfunction()

 # Populates directory variables for the given name to the location that name


added a TODO

added a TODO

--- cmake/modules/FindVW.cmake
+++ cmake/modules/FindVW.cmake
@@ -59,6 +59,8 @@
   message(STATUS "VW uses boost version: ${VW_BOOST_VERSION}")
 endif()

+# TODO Rather than trying to detect the exact boost version, simply compare detected boost to VW boost and
+# Error if they don't match.
 find_package(Boost "${VW_BOOST_MAJOR_VERSION}.${VW_BOOST_MINOR_VERSION}.${VW_BOOST_SUBMINOR_VERSION}" EXACT REQUIRED)

 if (NOT Boost_FOUND)


Tweak comments

Tweak comments

svn path=/trunk/; revision=6912

--- cmake/modules/plplot.cmake
+++ cmake/modules/plplot.cmake
@@ -40,7 +40,7 @@
 option(BUILD_TEST "Compile examples in the build tree and enable ctest" OFF)

 # =======================================================================
-# System checks for headers etc
+# Headers
 # =======================================================================

 # AC_HEADER_STDC is gross overkill since the current PLplot code only uses
@@ -113,6 +113,18 @@
 # is done by AC_HEADER_DIRENT here until that changes.
 set(NEED_SYS_TYPE_H ON)

+#=======================================================================
+# Typedefs
+#=======================================================================
+
+# ToDo
+# Some X11 headers require "caddr_t" even on systems that claim POSIX.1
+# compliance, which is illegal.  This makes it impossible to compile
+# programs that include X11 headers if _POSIX_SOURCE is defined.  I work
+# around this potential problem by just defining caddr_t to 'char *' on all
+# systems (unless it is set already), whether it will be needed or not.
+# AC_CHECK_TYPE(caddr_t, char *)
+
 # Test signal handler return type (mimics AC_TYPE_SIGNAL)
 include(TestSignalType)


Fix: boost optional components finding break the build on UNIX

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@4037 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -14,18 +14,16 @@
 # Disable the config mode of find_package(Boost)
 set(Boost_NO_BOOST_CMAKE ON)

-# Optional boost modules
-find_package(Boost 1.40.0 COMPONENTS mpi serialization)
-
 # Required boost modules
 find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time iostreams)

 if(Boost_FOUND)
   set(BOOST_FOUND TRUE)
+	# Optional boost modules
+	find_package(Boost 1.40.0 COMPONENTS mpi serialization)
   # Obtain diagnostic information about Boost's automatic linking outputted
   # during compilation time.
   add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
-
   include_directories(${Boost_INCLUDE_DIRS})
   link_directories(${Boost_LIBRARY_DIRS})
 endif(Boost_FOUND)


Move copying nuclear.py across to be in the same context, this will make warnings about duplicate targets and things so needs to be fixed.

--- nuclear/module/NUClearModule.cmake
+++ nuclear/module/NUClearModule.cmake
@@ -1,13 +1,4 @@
 INCLUDE(CMakeParseArguments)
-
-# This makes a link for nuclear.py so it can be used by python modules
-FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/python/nuclear")
-ADD_CUSTOM_COMMAND(
-    OUTPUT "${PROJECT_BINARY_DIR}/python/nuclear/nuclear.py"
-    COMMAND ${CMAKE_COMMAND} -E create_symlink "${NUCLEAR_ROLES_DIR}/module/python/nuclear.py" "${PROJECT_BINARY_DIR}/python/nuclear/nuclear.py"
-    DEPENDS "${NUCLEAR_ROLES_DIR}/module/python/nuclear.py"
-    COMMENT "Creating a symbolic link for nuclear.py"
-)

 FUNCTION(NUCLEAR_MODULE)

@@ -64,6 +55,15 @@
         FIND_PACKAGE(PythonInterp 3 REQUIRED)
         FIND_PACKAGE(pybind11 REQUIRED)
         FIND_PACKAGE(PythonLibsNew 3 REQUIRED)
+
+        # This makes a link for nuclear.py so it can be used by python modules
+        FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/python/nuclear")
+        ADD_CUSTOM_COMMAND(
+            OUTPUT "${PROJECT_BINARY_DIR}/python/nuclear/nuclear.py"
+            COMMAND ${CMAKE_COMMAND} -E create_symlink "${NUCLEAR_ROLES_DIR}/module/python/nuclear.py" "${PROJECT_BINARY_DIR}/python/nuclear/nuclear.py"
+            DEPENDS "${NUCLEAR_ROLES_DIR}/module/python/nuclear.py"
+            COMMENT "Creating a symbolic link for nuclear.py"
+        )

         # Now copy all our python files across to the python directory of output
         FILE(GLOB_RECURSE python_files "${CMAKE_CURRENT_SOURCE_DIR}/src/**.py")


[msvc] Add support for building with visual studio 2015(x86/x64) and 2013(x86)

--- src/cmake/precompiled_libs.cmake
+++ src/cmake/precompiled_libs.cmake
@@ -15,11 +15,23 @@
 if(APPLE)
 	set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal")
 elseif(WIN32)
-	if(NOT MSVC12 OR NOT CMAKE_CL_64)
-		# TODO(sergey): Would be cool to support GCC/CLang as well.
-		message(FATAL_ERROR "Currently only Visual Studio 2013 64bit is supported")
+	if(CMAKE_CL_64)
+		if(MSVC12)
+			set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/win64_vc12")
+		elseif(MSVC14)
+			set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/win64_vc14")
+		else()
+			message(FATAL_ERROR "Unsupported Visual Studio Version")
+		endif()
+	else()
+		if(MSVC12)
+			set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/windows_vc12")
+		elseif(MSVC14)
+			set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/windows_vc14")
+		else()
+			message(FATAL_ERROR "Unsupported Visual Studio Version")
+		endif()
 	endif()
-	set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/win64_vc12")
 endif()

 ###########################################################################


Add workaround for android builds.

Add workaround for android builds.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -229,7 +229,7 @@
 ctest_update()
 ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
 if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE} AND DEFINED ENV{CMAKE_ANDROID_ARCH_ABI})
-    ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE} -DCMAKE_ANDROID_ARCH_ABI=$ENV{CMAKE_ANDROID_ARCH_ABI}")
+    ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}" "-DCMAKE_ANDROID_ARCH_ABI=$ENV{CMAKE_ANDROID_ARCH_ABI}")
 elseif(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
     ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
 else()


Upgrade Poco to version 1.9

Upgrade Poco to version 1.9

--- CMakeExternals/Poco.cmake
+++ CMakeExternals/Poco.cmake
@@ -24,8 +24,8 @@

     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
-      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/poco-1.6.1-all.tar.gz
-      URL_MD5 05961d10195d0f760b707752e88938e9
+      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/poco-1.9.0.tar.gz
+      URL_MD5 1011839033f72de138f0c523c2caa121
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
         ${ep_common_args}


Force LF: internal_deps.id

Force LF: internal_deps.id

--- cmake/modules/hunter_create_cache_meta_directory.cmake
+++ cmake/modules/hunter_create_cache_meta_directory.cmake
@@ -71,14 +71,28 @@

   # }

-  # Save internal-dependencies information
+  # Save internal-dependencies information {
+
   set(internal_deps_id "${HUNTER_PACKAGE_HOME_DIR}/internal_deps.id")
-  file(WRITE "${internal_deps_id}" "${HUNTER_PACKAGE_INTERNAL_DEPS_ID}")
+  set(internal_deps_id_nolf "${internal_deps_id}.NOLF")
+  file(WRITE "${internal_deps_id_nolf}" "${HUNTER_PACKAGE_INTERNAL_DEPS_ID}")
+
+  # About '@ONLY': no substitutions expected but COPYONLY can't be
+  # used with NEWLINE_STYLE
+  configure_file(
+      "${internal_deps_id_nolf}"
+      "${internal_deps_id}"
+      @ONLY
+      NEWLINE_STYLE LF
+  )
+
   file(SHA1 "${internal_deps_id}" internal_deps_sha1)
   hunter_make_directory(
       "${cache_meta_dir}" "${internal_deps_sha1}" cache_meta_dir
   )
   file(COPY "${internal_deps_id}" DESTINATION "${cache_meta_dir}")

+  # }
+
   set("${result}" "${cache_meta_dir}" PARENT_SCOPE)
 endfunction()


Fixed error in FindMatplotlib.cmake

Fixed error in FindMatplotlib.cmake

--- cMake/FindMatplotlib.cmake
+++ cMake/FindMatplotlib.cmake
@@ -38,8 +38,8 @@
         list(GET _MATPLOTLIB_VERSION_LIST 0 MATPLOTLIB_VERSION_MAJOR)
         list(GET _MATPLOTLIB_VERSION_LIST 1 MATPLOTLIB_VERSION_MINOR)
         list(GET _MATPLOTLIB_VERSION_LIST 2 MATPLOTLIB_VERSION_PATCH)
-        math(EXPR MATPLOTLIB_VERSION_DECIMAL
-            "(${MATPLOTLIB_VERSION_MAJOR} * 10000) + (${MATPLOTLIB_VERSION_MINOR} * 100) + ${MATPLOTLIB_VERSION_PATCH}")
+        #math(EXPR MATPLOTLIB_VERSION_DECIMAL
+        #    "(${MATPLOTLIB_VERSION_MAJOR} * 10000) + (${MATPLOTLIB_VERSION_MINOR} * 100) + ${MATPLOTLIB_VERSION_PATCH}")
     ELSE()
         set(MATPLOTLIB_FOUND FALSE)
     ENDIF()


Use environment variables for Canopy cross compile

--- canopy-cross-compile.cmake
+++ canopy-cross-compile.cmake
@@ -6,14 +6,14 @@
 #  cmake .. -DCMAKE_TOOLCHAIN_FILE=../canopy-cross-compile.cmake
 #

-set(CROSS_PATH "/usr/arm-linux-gnueabi")
+set(CROSS_PATH $ENV{CANOPY_CROSS_PATH})

 # Target operating system name.
 set(CMAKE_SYSTEM_NAME Linux)

 # Name of C compiler.
-set(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabi-gcc")
-set(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabi-g++")
+set(CMAKE_C_COMPILER $ENV{CC})
+set(CMAKE_CXX_COMPILER $ENV{CXX})

 # Where to look for the target environment. (More paths can be added here)
 set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")


COMP: using ITK_DELETED_FUNCTION, and more consistent override specifier

Change-Id: I6ad30709912cdb708067dae0bb1feadcf0b0bce5

--- Modules/Remote/MorphologicalContourInterpolation.remote.cmake
+++ Modules/Remote/MorphologicalContourInterpolation.remote.cmake
@@ -14,5 +14,5 @@
 This work is supported by NIH grant R01 EB014346
 'Continued development and maintenance of the ITK-SNAP 3D image segmentation software'."
   GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/ITKMorphologicalContourInterpolation.git
-  GIT_TAG 608853faf597c38132eaff8586f1f9c5c31f70aa
+  GIT_TAG 97acd59ea7697731ef4d01ba330097326fdb6bf8
   )


fix: super builds when compiling static libraries (#4282)

By default gRPC compiles a C# extension shared library (`.so`) even if
all the dependencies (like Abseil) are compiled statically. In some
platforms that just breaks (mixing PIC code and non-PIC code
results in an error). Since we do not use this extension I think the
simplest thing is to disable it for super builds.

--- super/external/grpc.cmake
+++ super/external/grpc.cmake
@@ -46,6 +46,7 @@
                    -DCMAKE_INSTALL_RPATH=${GOOGLE_CLOUD_CPP_INSTALL_RPATH}
                    -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
                    -DgRPC_BUILD_TESTS=OFF
+                   -DgRPC_BUILD_CSHARP_EXT=OFF
                    -DgRPC_ABSL_PROVIDER=package
                    -DgRPC_CARES_PROVIDER=package
                    -DgRPC_PROTOBUF_PROVIDER=package


cmake: add support for c++17

cmake: add support for c++17

--- src/cmake/common-settings.cmake
+++ src/cmake/common-settings.cmake
@@ -88,14 +88,19 @@

 include(CheckCXXCompilerFlag)
 if(NOT MSVC)
+	check_cxx_compiler_flag("-std=gnu++17"   YUNI_HAS_GNU17_SUPPORT)
 	check_cxx_compiler_flag("-std=gnu++14"   YUNI_HAS_GNU14_SUPPORT)
 	check_cxx_compiler_flag("-std=gnu++11"   YUNI_HAS_GNU11_SUPPORT)
+	check_cxx_compiler_flag("-std=c++17"     YUNI_HAS_CPP17_SUPPORT)
 	check_cxx_compiler_flag("-std=c++14"     YUNI_HAS_CPP14_SUPPORT)
 	check_cxx_compiler_flag("-std=c++11"     YUNI_HAS_CPP11_SUPPORT)
 	check_cxx_compiler_flag("-std=c++0x"     YUNI_HAS_GCC_CPP0X_SUPPORT)
 	check_cxx_compiler_flag("-stdlib=libc++" YUNI_HAS_LIB_CPP11_SUPPORT) # clang, Apple gcc...
 	if (NOT APPLE)
-		if (YUNI_HAS_GNU14_SUPPORT)
+		if (YUNI_HAS_GNU17_SUPPORT)
+			set(YUNI_COMMON_CXX_OPTIONS  "${YUNI_COMMON_CXX_OPTIONS} -std=gnu++17")
+			set(YUNI_CPP_STD "-std=gnu++17" CACHE STRING "c++std" FORCE)
+		elseif (YUNI_HAS_GNU14_SUPPORT)
 			set(YUNI_COMMON_CXX_OPTIONS  "${YUNI_COMMON_CXX_OPTIONS} -std=gnu++14")
 			set(YUNI_CPP_STD "-std=gnu++14" CACHE STRING "c++std" FORCE)
 		elseif (YUNI_HAS_GNU11_SUPPORT)
@@ -106,7 +111,10 @@
 			set(YUNI_CPP_STD "-std=c++0x" CACHE STRING "c++std" FORCE)
 		endif()
 	else()
-		if (YUNI_HAS_CPP14_SUPPORT)
+		if (YUNI_HAS_CPP17_SUPPORT)
+			set(YUNI_COMMON_CXX_OPTIONS  "${YUNI_COMMON_CXX_OPTIONS} -std=c++17")
+			set(YUNI_CPP_STD "-std=c++17" CACHE STRING "c++std" FORCE)
+		elseif (YUNI_HAS_CPP14_SUPPORT)
 			set(YUNI_COMMON_CXX_OPTIONS  "${YUNI_COMMON_CXX_OPTIONS} -std=c++14")
 			set(YUNI_CPP_STD "-std=c++14" CACHE STRING "c++std" FORCE)
 		elseif (YUNI_HAS_CPP11_SUPPORT)


Bump version of pybind11 that we auto-download (#2436)

--- src/cmake/pythonutils.cmake
+++ src/cmake/pythonutils.cmake
@@ -57,7 +57,7 @@

 option (BUILD_PYBIND11_FORCE "Force local download/build of Pybind11 even if installed" OFF)
 option (BUILD_MISSING_PYBIND11 "Local download/build of Pybind11 if not installed" ON)
-set (BUILD_PYBIND11_VERSION "v2.4.2" CACHE STRING "Preferred pybind11 version, of downloading/building our own")
+set (BUILD_PYBIND11_VERSION "v2.4.3" CACHE STRING "Preferred pybind11 version, of downloading/building our own")
 set (BUILD_PYBIND11_MINIMUM_VERSION "2.2.0")

 macro (find_or_download_pybind11)


Fix flann build problems with recent CMakes

--- Superbuild/versions.cmake
+++ Superbuild/versions.cmake
@@ -65,8 +65,8 @@
     GIT_TAG master)

 superbuild_set_revision(flann
-  GIT_REPOSITORY https://github.com/mariusmuja/flann.git
-  GIT_TAG 1.9.1)
+  GIT_REPOSITORY https://gitlab.kitware.com/gabriel.devillers/flann.git
+  GIT_TAG 1.9.1-patched)

 superbuild_set_revision(opencv
   GIT_REPOSITORY https://github.com/opencv/opencv.git


cmake: cpp.cmake cleanup

cmake: cpp.cmake cleanup

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -1,8 +1,6 @@
 if(NOT BUILD_CXX)
   return()
 endif()
-
-

 # Main Target
 add_library(${PROJECT_NAME} "")
@@ -100,7 +98,6 @@
 # Compile options
 set_target_properties(${PROJECT_NAME} PROPERTIES
   CXX_STANDARD 20
-  CXX_STANDARD 17
   CXX_STANDARD_REQUIRED ON
   CXX_EXTENSIONS OFF
   )


allow OpenSSL 0.9.8 again

allow OpenSSL 0.9.8 again

this disables the check, added in d937916c06

Applications shouldn't police OpenSSL versions that users are using.
And 0.9.8 on Mac OS X seems to have new fixes, despite being "0.9.8"

--- cmake/ssl.cmake
+++ cmake/ssl.cmake
@@ -181,7 +181,7 @@
       )
       MESSAGE(STATUS "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}")
      ENDIF()
-     IF(OPENSSL_MAJOR_VERSION GREATER 0)
+     IF(TRUE) #OPENSSL_MAJOR_VERSION GREATER 0)
       SET(SSL_SOURCES "")
       SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
       IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")


cmake: drop unconditional forcing of CMAKE_SKIP_RPATH=TRUE

CMake "cache" entry for CMAKE_SKIP_RPATH is in the end of this file

--- platforms/linux/gnu.toolchain.cmake
+++ platforms/linux/gnu.toolchain.cmake
@@ -55,8 +55,6 @@
     unset(__variableNames)
   endmacro()
 endif() # IN_TRY_COMPILE
-
-set(CMAKE_SKIP_RPATH TRUE)

 if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
   set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)


Added a debug statement

Added a debug statement

--- cmake/MyPackageStart.cmake
+++ cmake/MyPackageStart.cmake
@@ -101,6 +101,10 @@
       ENDIF ()
       ADD_DEFINITIONS("-D${_definition}")
     ENDFOREACH ()
+  ELSE ()
+    IF (MYPACKAGE_DEBUG)
+      MESSAGE (STATUS "[${PROJECT_NAME}-START-STATUS] CMAKE_C_COMPILER_ID does not match MSVC: ${CMAKE_C_COMPILER_ID}")
+    ENDIF ()
   ENDIF ()
   #
   # Prepare output directories