ManageDependency: REQUIRED actually check the rpm package existance

--- Modules/ManageDependency.cmake
+++ Modules/ManageDependency.cmake
@@ -2,16 +2,20 @@
 # This module handle dependencies by using pkg-config and/or
 # search the executable.
 #
-# Includes:
-#   ManageFile
-#   ManageVersion
+# Included Modules:
+# - ManageFile
+# - ManageVariable
 #
 # Defines following functions:
-#   MANAGE_DEPENDENCY(listVar var [VER ver [EXACT]] [REQUIRED]
-#     [PROGRAM_NAMES name1 ...] [PKG_CONFIG pkgConfigName]
-#     [FEDORA_NAME fedoraPkgName] [DEVEL]
+#   MANAGE_DEPENDENCY(<listVar> <var> [VER <ver> [EXACT]] [REQUIRED]
+#     [PROGRAM_NAMES <name1> ...] [PKG_CONFIG <pkgConfigName>]
+#     [FEDORA_NAME <fedoraPkgName>] [DEVEL]
 #     )
-#     - Add a new dependency.
+#     - Add a new dependency to a list.
+#       The dependency will also be searched.
+#       If found, ${var}_FOUND is set as 1.
+#       If not found:
+#         + If REQUIRED is specified: a M_ERROR message will be printed. #	    + If REQUIRED is not specified: a M_OFF message will be printed.
 #       * Parameters:
 #         + listVar: List variable store a kind of dependencies.
 #           Recognized lists:
@@ -21,12 +25,18 @@
 #           - REQUIRES_PREUN: Dependencies before the package uninstall
 #           - REQUIRES_POST:  Dependencies after the package install
 #           - REQUIRES_POSTUN:Dependencies after the package uninstall
-#         + var: Main variable. It recommend to use uppercase name,
-#           such as GETTEXT
+#         + var: Main variable. Uppercase variable name is recommended,
+#           (e.g. GETTEXT)
 #         + VER ver [EXACT]: Minimum version.
 #           Specify the exact version by providing "EXACT".
-#         + REQUIRED: Specify that this dependency is required.
+#         + REQUIRED: The dependency is required at build time.
+#           If specified, this dependency will be searched:
+#             - if found, ${var}_FOUND is set as 1.
+#	      - if not found, an error message will be printed and
+#	        build stop at build stage.
+#	    If not specified, this
 #         + PROGRAM_NAMES name1 ...: Executable to be found.
+#           name2 and others are aliases to name1.
 #           If found, ${var}_EXECUTABLE is defined as the full path
 #           to the executable; if not found; the whole dependency is
 #           deemed as not found.
@@ -55,45 +65,77 @@
 FUNCTION(MANAGE_DEPENDENCY listVar var)
     SET(_validOptions "VER" "EXACT" "REQUIRED"
 	"PROGRAM_NAMES" "PKG_CONFIG" "FEDORA_NAME" "DEVEL")
-    VARIABLE_PARSE_ARGN(${var} _validOptions ${ARGN})
-    UNSET(_ver)
-    UNSET(_rel)
-    IF(DEFINED ${var}_REQUIRED)
+    VARIABLE_PARSE_ARGN(_opt _validOptions ${ARGN})
+    SET(_dirty 0)
+
+    IF(DEFINED _opt_REQUIRED)
 	SET(_verbose "${M_ERROR}")
 	SET(_required "REQUIRED")
-    ELSE(DEFINED ${var}_REQUIRED)
+        SET(_progNotFoundMsg
+	    "Program names ${_opt_PROGRAM_NAMES} not found, install ${var}")
+    ELSE(DEFINED _opt_REQUIRED)
 	SET(_verbose "${M_OFF}")
 	SET(_required "")
-    ENDIF(DEFINED ${var}_REQUIRED)
-    IF(${var}_VER)
-	SET(_ver "${${var}_VER}")
-	IF(DEFINED ${var}_EXACT)
+	SET(_progNotFoundMsg
+	    "Program names ${_opt_PROGRAM_NAMES} not found, ${var} support disabled")
+    ENDIF(DEFINED _opt_REQUIRED)
+    IF(_opt_VER)
+	IF(DEFINED _opt_EXACT)
 	    SET(_rel "=")
 	    SET(_exact "EXACT")
-	ELSE(DEFINED ${var}_EXACT)
+	ELSE(DEFINED _opt_EXACT)
 	    SET(_rel ">=")
 	    SET(_exact "")
-	ENDIF(DEFINED ${var}_EXACT)
-    ENDIF(${var}_VER)
+	ENDIF(DEFINED _opt_EXACT)
+    ENDIF(_opt_VER)

-    IF(${var}_PROGRAM_NAMES)
-	MESSAGE(STATUS "checking for program '${${var}_PROGRAM_NAMES}'")
-	FIND_PROGRAM(${var}_EXECUTABLE NAMES "${${var}_PROGRAM_NAMES}"
-	    DOC "${var} executable"
-	    )
-	IF(${var}_EXECUTABLE-NOTFOUND)
-	    M_MSG("${_verbose}" "Cannot found ${${var}_PROGRAM_NAMES} in path.")
-	ELSE(${var}_EXECUTABLE-NOTFOUND)
-	    MESSAGE(STATUS "   found ${${var}_EXECUTABLE}")
-	ENDIF(${var}_EXECUTABLE-NOTFOUND)
+    IF(_opt_PROGRAM_NAMES)
+	M_MSG(${M_INFO2} "ManageDependency: finding program names ${_opt_PROGRAM_NAMES}")
 	FIND_PROGRAM_ERROR_HANDLING(${var}_EXECUTABLE
+	    ERROR_VAR _dirty
+	    ERROR_MSG "${_progNotFoundMsg}"
 	    VERBOSE_LEVEL "${_verbose}"
-	    "${${var}_PROGRAM_NAMES}"
+	    FIND_ARGS NAMES "${_opt_PROGRAM_NAMES}"
 	    )
 	MARK_AS_ADVANCED(${var}_EXECUTABLE)
-    ENDIF(${var}_PROGRAM_NAMES)
+    ENDIF(_opt_PROGRAM_NAMES)

-    IF(${var}_PKG_CONFIG)
+    IF(_opt_FEDORA_NAME)
+	SET(_name "${_opt_FEDORA_NAME}")
+    ELSE(_opt_FEDORA_NAME)
+	STRING(TOLOWER "${var}" _name)
+    ENDIF(_opt_FEDORA_NAME)
+
+    IF(DEFINED _opt_DEVEL)
+	SET(_name "${_name}-devel")
+    ENDIF(DEFINED _opt_DEVEL)
+    IF("${_opt_VER}" STREQUAL "")
+	SET(_newDep  "${_name}")
+    ELSE("${_opt_VER}" STREQUAL "")
+	SET(_newDep  "${_name} ${_rel} ${_opt_VER}")
+    ENDIF("${_opt_VER}" STREQUAL "")
+    IF(CMAKE_FEDORA_ENABLE_FEDORA_BUILD)
+	SET(_rpm_missing 0)
+	FIND_PROGRAM_ERROR_HANDLING(RPM_CMD
+	    ERROR_VAR _rpm_missing
+	    ERROR_MSG "Program rpm not found, dependency check disabled."
+	    VERBOSE_LEVEL ${M_OFF}
+	    FIND_ARGS "rpm"
+	    )
+	IF(NOT _rpm_missing)
+	    EXECUTE_PROCESS(COMMAND ${RPM_CMD} -q ${_name}
+		RESULT_VARIABLE _rpm_ret
+		OUTPUT_QUIET
+		ERROR_QUIET
+		)
+	    IF(_rpm_ret)
+		## Dependency not found
+		M_MSG(${_verbose} "RPM ${_name} is not installed")
+	    ENDIF(_rpm_ret)
+	ENDIF(NOT _rpm_missing)
+    ENDIF(CMAKE_FEDORA_ENABLE_FEDORA_BUILD)
+
+    IF(_opt_PKG_CONFIG)
 	IF(PKG_CONFIG_EXECUTABLE)
 	    LIST(FIND ${listVar} "pkgconfig" _index)
 	    IF(_index EQUAL -1)
@@ -103,9 +145,9 @@
 	    M_MSG(${M_ERROR} "pkgconfig is required with ${var}")
 	ENDIF(PKG_CONFIG_EXECUTABLE)
 	PKG_CHECK_MODULES(${var} ${_required}
-	    "${${var}_PKG_CONFIG}${_rel}${_ver}")
+	    "${_opt_PKG_CONFIG}${_rel}${_opt_VER}")
 	EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE}
-	    --print-variables "${${var}_PKG_CONFIG}"
+	    --print-variables "${_opt_PKG_CONFIG}"
 	    OUTPUT_VARIABLE _variables
 	    OUTPUT_STRIP_TRAILING_WHITESPACE
 	    RESULT_VARIABLE _ret
@@ -115,7 +157,7 @@
 	    FOREACH(_v ${${var}_VARIABLES})
 		STRING(TOUPPER "${_v}" _u)
 		EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE}
-		    --variable "${_v}" "${${var}_PKG_CONFIG}"
+		    --variable "${_v}" "${_opt_PKG_CONFIG}"
 		    OUTPUT_VARIABLE ${var}_${_u}
 		    OUTPUT_STRIP_TRAILING_WHITESPACE
 		    )
@@ -123,30 +165,15 @@
 		    CACHE INTERNAL "pkgconfig ${var}_${u}")
 		MARK_AS_ADVANCED(${var}_${_u})
 		M_MSG(${M_INFO1} "${var}_${_u}=${${var}_${_u}}")
-	    ENDFOREACH(_v ${var}_VARIABLES)
+	    ENDFOREACH(_v)
 	ENDIF(NOT _ret)
-    ENDIF(${var}_PKG_CONFIG)
-
-    IF(${var}_FEDORA_NAME)
-	SET(_name "${${var}_FEDORA_NAME}")
-    ELSE(${var}_FEDORA_NAME)
-	STRING(TOLOWER "${var}" _name)
-    ENDIF(${var}_FEDORA_NAME)
-
-    IF(DEFINED ${var}_DEVEL)
-	SET(_name "${_name}-devel")
-    ENDIF(DEFINED ${var}_DEVEL)
-    IF("${_ver}" STREQUAL "")
-	SET(_newDep  "${_name}")
-    ELSE("${_ver}" STREQUAL "")
-	SET(_newDep  "${_name} ${_rel} ${_ver}")
-    ENDIF("${_ver}" STREQUAL "")
+    ENDIF(_opt_PKG_CONFIG)

     ## Insert when it's not duplicated
     LIST(FIND ${listVar} "${_newDep}" _index)
     IF(_index EQUAL -1)
 	LIST(APPEND ${listVar} "${_newDep}")
+	SET(${listVar} "${${listVar}}" PARENT_SCOPE)
     ENDIF(_index EQUAL -1)
-    SET(${listVar} "${${listVar}}" PARENT_SCOPE)
 ENDFUNCTION(MANAGE_DEPENDENCY)


holybro_can-gps-v1: Add UAVCAN CAN2 Support

--- boards/holybro/can-gps-v1/default.cmake
+++ boards/holybro/can-gps-v1/default.cmake
@@ -27,7 +27,7 @@
 	ARCHITECTURE cortex-m4
 	CONSTRAINED_MEMORY
 	ROMFSROOT cannode
-	UAVCAN_INTERFACES 1
+	UAVCAN_INTERFACES 2
 	DRIVERS
 		adc/board_adc
 		barometer/bmp388


Pass-on BOOST_ROOT

Pass-on BOOST_ROOT

--- SuperBuild/External_SIRF.cmake
+++ SuperBuild/External_SIRF.cmake
@@ -71,6 +71,7 @@
         -DCMAKE_INSTALL_PREFIX=${SIRF_Install_Dir}
         -DBOOST_INCLUDEDIR=${BOOST_ROOT}/include/
         -DBOOST_LIBRARYDIR=${BOOST_LIBRARY_DIR}
+        -DBOOST_ROOT=${BOOST_ROOT}
         -DMATLAB_ROOT=${MATLAB_ROOT}
         -DSTIR_DIR=${STIR_DIR}
         -DHDF5_ROOT=${HDF5_ROOT}


ENH: Updated for Slicer 4.5

ENH: Updated for Slicer 4.5

--- SuperBuild/External_VMTK.cmake
+++ SuperBuild/External_VMTK.cmake
@@ -23,8 +23,8 @@

   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
-    GIT_REPOSITORY "${git_protocol}://github.com/VMTK/vmtk.git"
-    GIT_TAG "e3924f9d3d8ddd419ed6683f3e7a3fdacb6069db"
+    GIT_REPOSITORY "${git_protocol}://github.com/lassoan/vmtk.git"
+    GIT_TAG "master"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${proj}-build
     CMAKE_CACHE_ARGS
@@ -65,6 +65,7 @@
       -DUSE_SYSTEM_ITK:BOOL=ON
       -DITK_DIR:PATH=${ITK_DIR}
       -DVTK_DIR:PATH=${VTK_DIR}
+      -DPYTHON_LIBRARY:PATH=${PYTHON_LIBRARY}
     INSTALL_COMMAND ""
     DEPENDS
       ${${proj}_DEPENDS}


ENH: no need for warning when disabling HDF tests. a status message is sufficient

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -47,7 +47,7 @@
     IF ( ${GDAL_FORMATS} MATCHES "hdf" )
        SET(CHECK_GDAL_BUILDED_WITH_HDF 1 CACHE INTERNAL "GDAL_BUILDED_WITH_HDF" FORCE)
     ELSE ( ${GDAL_FORMATS} MATCHES "hdf")
-       MESSAGE(WARNING "CHECK_GDAL_BUILDED_WITH_HDF test failed : GDAL is not built with hdf support. So the HDF tests will be deactivated. Formats supported by your GDAL: " [ ${GDAL_FORMATS} ] )
+       MESSAGE(STATUS "CHECK_GDAL_BUILDED_WITH_HDF test failed : GDAL is not built with hdf support. So the HDF tests will be deactivated. Formats supported by your GDAL: " [ ${GDAL_FORMATS} ] )
        SET(CHECK_GDAL_BUILDED_WITH_HDF 0 CACHE INTERNAL "GDAL_BUILDED_WITH_HDF" FORCE)
     ENDIF(${GDAL_FORMATS} MATCHES "hdf")


VWR-20911 FOLLOWUP fixed indentation (cmake files use spaces only) (transplanted from d02b22278d5b0a0386b3a7c25221b2069bc02963)

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -62,12 +62,12 @@
     set(ARCH x86_64)
   else (WORD_SIZE EQUAL 32)
     if(CMAKE_SIZEOF_VOID_P MATCHES 4)
- 		set(ARCH i686)
-		set(WORD_SIZE 32)
-	else(CMAKE_SIZEOF_VOID_P MATCHES 4)
-		set(ARCH x86_64)
-		set(WORD_SIZE 64)
-	endif(CMAKE_SIZEOF_VOID_P MATCHES 4)
+      set(ARCH i686)
+      set(WORD_SIZE 32)
+    else(CMAKE_SIZEOF_VOID_P MATCHES 4)
+      set(ARCH x86_64)
+      set(WORD_SIZE 64)
+    endif(CMAKE_SIZEOF_VOID_P MATCHES 4)
   endif (WORD_SIZE EQUAL 32)

   set(LL_ARCH ${ARCH}_linux)


adding dgemm specific kernels to CL2.0 build mechanism

--- src/library/bingen.cmake
+++ src/library/bingen.cmake
@@ -18,6 +18,8 @@
 ${CLTEMPLATE_PATH}/sgemm_gcn_bigMatrices.cl
 ${CLTEMPLATE_PATH}/sgemm_hawaiiSplit64_32.cl
 ${CLTEMPLATE_PATH}/dtrsm_gpu192.cl
+${CLTEMPLATE_PATH}/dgemm_hawai.cl
+${CLTEMPLATE_PATH}/dgemm_gcn_SmallMatrices.cl
 )

@@ -29,10 +31,7 @@

 set (BIN_CL_TEMPLATES_HAWAII_CL1
-${CLTEMPLATE_PATH}/dgemm_hawai.cl
 ${CLTEMPLATE_PATH}/dtrsm_gpu.cl
-${CLTEMPLATE_PATH}/dgemm_hawaiiChannelConfilct.cl
-${CLTEMPLATE_PATH}/dgemm_gcn_SmallMatrices.cl
 )

 MESSAGE("run bingen")


Changed BUILD_TEST CMake variable type from STRING to BOOL

--- Config.cmake
+++ Config.cmake
@@ -14,7 +14,7 @@
 # Set the default test build option to false
 if(NOT BUILD_TEST)
     set(BUILD_TEST FALSE
-        CACHE STRING "TRUE to build the unit tests (requires the Boost Test Library), FALSE otherwise."
+        CACHE BOOL "TRUE to build the unit tests (requires the Boost Test Library), FALSE otherwise."
     )
 endif()


- Add VERSION file to installed files

- Add VERSION file to installed files

--- cmake/Modules/BuildFlags.cmake
+++ cmake/Modules/BuildFlags.cmake
@@ -12,8 +12,6 @@
         )

     string ( REGEX REPLACE "\n$" "" COFFEE_VERSION_CODE "${COFFEE_VERSION_CODE}" )
-
-    message ( "${COFFEE_VERSION_CODE}" )

     set ( COFFEE_VERSION_CODE "${COFFEE_VERSION_CODE}"
         CACHE STRING "" )
@@ -36,7 +34,16 @@
         "${COFFEE_VERSION_CODE}.${CBUILDTIME}-${GIT_HASH}"
         CACHE STRING ""
         )
+
+    file ( WRITE "${CMAKE_BINARY_DIR}/VERSION.${PROJECT_NAME}"
+        "${COFFEE_VERSION_CODE}"
+        )
 endif()
+
+install (
+    FILES "${CMAKE_BINARY_DIR}/VERSION.${PROJECT_NAME}"
+    DESTINATION share
+    )

 add_definitions( -DCOFFEE_BUILD_STRING="${COFFEE_BUILD_STRING}" )


set DOC_INSTALL_DIR and LIB_INSTALL_DIR for RapidJSON

--- cmake/external/RapidJSON.cmake
+++ cmake/external/RapidJSON.cmake
@@ -7,8 +7,8 @@
 	URL https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz
 	URL_MD5 badd12c511e081fec6c89c43a7027bce
 	CMAKE_ARGS -DINCLUDE_INSTALL_DIR:PATH=${RAPIDJSON_INCLUDE_DIR}
-		-DDOC_INSTALL_DIR:PATH=${THIRD_PARTY_INCLUDE_DIR}
-		-DLIB_INSTALL_DIR:PATH=${THIRD_PARTY_INCLUDE_DIR}
+		-DDOC_INSTALL_DIR:PATH=${RAPIDJSON_INCLUDE_DIR}
+		-DLIB_INSTALL_DIR:PATH=${RAPIDJSON_INCLUDE_DIR}
 		-DRAPIDJSON_BUILD_DOC:BOOL=OFF
 		-DRAPIDJSON_BUILD_EXAMPLES:BOOL=OFF
 		-DRAPIDJSON_BUILD_TESTS:BOOL=OFF


update firestore version to one with nanopb 0.3.9.6

Firestore had to be updated from nanopb 0.3.9.5 to 0.3.9.6
in order for it to build with python3. This prevented builds of
firebase-cpp-sdk when we included firestore with python3

--- cmake/external/firestore.cmake
+++ cmake/external/firestore.cmake
@@ -18,12 +18,10 @@
   return()
 endif()

-# Pin to the first revision that includes these changes:
-# https://github.com/firebase/firebase-ios-sdk/pull/5807.
-#
-# This should be released with the next version after Firestore-1.15.0.
-set(version 05026f3df92cdee7b91fccc72a7195be2618acdf)
-
+# Using a firestore version that has been updated to use
+# nanopb 0.3.9.6 instead of 0.3.9.5. This was necessary
+# because nanopb 0.3.9.5 doesn't build with python3.
+set(version f33276f5305bb81b67e006f50b14f4a2adc3cb60)
 ExternalProject_Add(
   firestore


set dir for continuous build

set dir for continuous build

git-svn-id: 8b72b58fb31a931b6e9a2bd3bb08bc6614045fb1@3492 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- test/openVibeTests.cmake
+++ test/openVibeTests.cmake
@@ -56,7 +56,8 @@
 ENDIF(${CTEST_SCRIPT_ARG} MATCHES Continuous)

 IF(${MODEL} MATCHES Continuous)
-	set(OV-ROOT-DIR              "/tmp/con.ov")
+	set(OV-ROOT-DIR              "con.ov")
+	file(MAKE_DIRECTORY ${OV-ROOT-DIR})
 ELSE(${MODEL} MATCHES Continuous)
 	# create a temporary directory with very short name to host build
 	exec_program("mktemp" ARGS "--tmpdir -d ov.XXX" OUTPUT_VARIABLE OV-ROOT-DIR)


Fix a typo.

Fix a typo.

--- doc/www-data.in/download.cmake
+++ doc/www-data.in/download.cmake
@@ -60,7 +60,7 @@
         # For Ubuntu:
         cat > /etc/apt/sources.list.d/tarantool.list <<- EOF
         deb http://tarantool.org/dist/master/ubuntu/ $release main
-        deb-src http://tarantool.org/dist/mater/ubuntu/ $release main
+        deb-src http://tarantool.org/dist/master/ubuntu/ $release main
         EOF

         sudo apt-get update


Force bundled ZWO lib use

Force bundled ZWO lib use

Applies patch to fix https://github.com/OpenPHDGuiding/phd2/issues/650 on ARM

--- thirdparty/thirdparty.cmake
+++ thirdparty/thirdparty.cmake
@@ -1218,16 +1218,18 @@
  endif()

   find_path(ZWO_INCLUDE_DIR ASICamera2.h
-    PATHS
-    ${PHD_PROJECT_ROOT_DIR}/cameras
+     NO_DEFAULT_PATHS
+     PATHS ${PHD_PROJECT_ROOT_DIR}/cameras
   )

   find_library(asiCamera2
                 NAMES ASICamera2
+                NO_DEFAULT_PATHS
                 PATHS ${PHD_PROJECT_ROOT_DIR}/cameras/zwolibs/${arch})
   if(NOT asiCamera2)
     message(FATAL_ERROR "Cannot find the asiCamera2 drivers")
   endif()
+  message(STATUS "Found ASICamera2 lib ${asiCamera2}")
   set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${asiCamera2})

   if(IS_DIRECTORY ${PHD_PROJECT_ROOT_DIR}/cameras/qhyccdlibs/linux/${qhyarch})


rm libiglboolean

rm libiglboolean

--- cmake/FindLIBIGL.cmake
+++ cmake/FindLIBIGL.cmake
@@ -85,11 +85,6 @@
   endif(LIBCOMISO_FOUND)

   if(CGAL_FOUND)
-    FIND_LIBRARY( LIBIGLBOOLEAN_LIBRARY NAMES iglboolean PATHS ${LIBIGL_LIB_DIRS})
-    if(NOT LIBIGLBOOLEAN_LIBRARY)
-      message(FATAL_ERROR "could NOT find libiglboolean ")
-    endif(NOT LIBIGLBOOLEAN_LIBRARY)
-    set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLBOOLEAN_LIBRARY})

     FIND_LIBRARY( LIBIGLCGAL_LIBRARY NAMES iglcgal PATHS ${LIBIGL_LIB_DIRS})
     if(NOT LIBIGLCGAL_LIBRARY)


missing parenthesis

missing parenthesis

--- cmake/ThunderEgg.cmake
+++ cmake/ThunderEgg.cmake
@@ -48,7 +48,7 @@
   INTERFACE_LINK_LIBRARIES "FFTW::FFTW;P4EST::P4EST;SC::SC;MPI::MPI_CXX"
 )
 if(TARGET BLAS::BLAS AND TARGET LAPACK::LAPACK)
-  target_link_libraries(ThunderEgg::ThunderEgg INTERFACE BLAS::BLAS LAPACK::LAPACK
+  target_link_libraries(ThunderEgg::ThunderEgg INTERFACE BLAS::BLAS LAPACK::LAPACK)
 endif()

 add_dependencies(ThunderEgg::ThunderEgg ThunderEgg)


Change clang-tidy not found from ERROR to WARNING (dev)

--- cmake/clang-tidy.cmake
+++ cmake/clang-tidy.cmake
@@ -3,7 +3,7 @@
 if(ENABLE_CLANG_TIDY)
     find_program(CLANG_TIDY "clang-tidy")
     if(NOT CLANG_TIDY)
-        message(SEND_ERROR "clang-tidy not found.")
+        message(AUTHOR_WARNING "clang-tidy not found.")
     else()
         message(STATUS "Configuring clang-tidy")


cmake: add zephyr_link_libraries_ifdef

cmake: add zephyr_link_libraries_ifdef

Link libraries only when config is defined.

Signed-off-by: Anas Nashif <0d9952ec84ac43c159f6b7e7ed99a9080c00dd6e@intel.com>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -676,6 +676,12 @@
 function(zephyr_cc_option_ifdef feature_toggle)
   if(${${feature_toggle}})
     zephyr_cc_option(${ARGN})
+  endif()
+endfunction()
+
+function(zephyr_ld_option_ifdef feature_toggle)
+  if(${${feature_toggle}})
+    zephyr_ld_options(${ARGN})
   endif()
 endfunction()


Fix if statement for memqt device.

Fix if statement for memqt device.

svn path=/trunk/; revision=11214

--- cmake/modules/qt.cmake
+++ cmake/modules/qt.cmake
@@ -53,7 +53,7 @@

 if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt OR PLD_memqt)
   set(ANY_QT_DEVICE ON)
-endif(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt)
+endif(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt OR PLD_memqt)

 if(ANY_QT_DEVICE)
   if(NOT CMAKE_CXX_COMPILER_WORKS)


Removed hardcoded path in FindCURL module

--- source/raptor/FindCURL.cmake
+++ source/raptor/FindCURL.cmake
@@ -31,7 +31,6 @@
 find_path(CURL_INCLUDE_DIR NAMES curl.h
     PATHS
     /usr/local/opt/curl/include/curl  # Homebrew
-    /Users/bryan/anaconda/include/curl  # Anaconda #FIXIT: Not correct
     /usr/include/curl  # Linux
     NO_DEFAULT_PATH )

@@ -50,7 +49,6 @@

     PATHS
     /usr/local/opt/curl/lib # Homebrew path
-    /Users/bryan/anaconda/lib  # Anaconda #FIXIT: Not correct
     /usr/lib/i386-linux-gnu  #Linux 32
     /usr/lib/x86_64-linux-gnu #Linux 64
     NO_DEFAULT_PATH )


fixed cilkrts related compile warning

fixed cilkrts related compile warning

--- common/cmake/icc.cmake
+++ common/cmake/icc.cmake
@@ -30,7 +30,7 @@
 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG  -DTBB_USE_DEBUG -g -O3 -restrict -no-inline-max-total-size -inline-factor=200")

 # enable -static-intel and avoid to export ICC specific symbols from Embree
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -no-intel-extensions")
 IF (APPLE)
   SET(CMAKE_SHARED_LINKER_FLAGS -Wl,-exported_symbols_list,${PROJECT_SOURCE_DIR}/kernels/export.macosx.map)
 ELSE()


BuildUtils.cmake: improved custom target configuration by having custom_pre_configure_target and custom_post_configure_target functions

--- BuildUtils.cmake
+++ BuildUtils.cmake
@@ -58,8 +58,8 @@

 function(set_common_target_properties TARGET)

-    if(COMMAND custom_configure_target)
-        custom_configure_target(${TARGET})
+    if(COMMAND custom_pre_configure_target)
+        custom_pre_configure_target(${TARGET})
         if(TARGET_CONFIGURATION_COMPLETE)
             return()
         endif()
@@ -128,6 +128,11 @@
             XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 10.0
         )
     endif()
+
+    if(COMMAND custom_post_configure_target)
+        custom_post_configure_target(${TARGET})
+    endif()
+
 endfunction()

 function(find_targets_in_directory _RESULT _DIR)


propagating LIBPYLONCAM_LIBDIR to PARENT_SCOPE

--- cmake/FindPylon.cmake
+++ cmake/FindPylon.cmake
@@ -25,6 +25,7 @@
       LIBPYLONCAM_LIBRARIES ${LIBPYLONCAM_LIBRARIES})
     string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX}
       LIBPYLONCAM_LIBDIR ${LIBPYLONCAM_LIBDIR})
+    set(LIBPYLONCAM_LIBDIR ${LIBPYLONCAM_LIBDIR} PARENT_SCOPE)
   endif()

   find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES)


update cmake find gsl

update cmake find gsl

--- cmake/SetupTPLs.cmake
+++ cmake/SetupTPLs.cmake
@@ -51,7 +51,10 @@

 #### GNU Scientific Library ##################################################
 if(ENABLE_GSL)
-    find_package(GSL REQUIRED PATHS ${GSL_DIR})
+    if(DEFINED GSL_DIR)
+        set(GSL_ROOT_DIR ${GSL_DIR})
+    endif()
+    find_package(GSL REQUIRED)
     add_definitions(-DWITH_GSL)
 ENDIF()


Adding a target_link_libraries call to address issue #1 on OS X.

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -242,6 +242,7 @@
   compile_pyx( ${_name} generated_file ${pyx_module_sources} )
   include_directories( ${PYTHON_INCLUDE_DIRS} )
   python_add_module( ${_name} ${generated_file} ${other_module_sources} )
+  target_link_libraries( ${_name} ${PYTHON_LIBRARIES} )
 endfunction()

 include( CMakeParseArguments )


Remove some unused cmake standard library includes.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -4,13 +4,10 @@
 endif()

 include(CheckIncludeFile)
-include(CheckIncludeFileCXX)
 include(CheckLibraryExists)
 include(CheckSymbolExists)
 include(CheckFunctionExists)
 include(CheckCCompilerFlag)
-include(CheckCXXSourceCompiles)
-include(TestBigEndian)

 include(CheckCompilerVersion)
 include(HandleLLVMStdlib)


Use SDK version 10.0.17763.

Use SDK version 10.0.17763.

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -2,7 +2,7 @@
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/msvc)
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/msvc/build)
 message("Generating project files...")
-execute_process(COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -T v142 -A Win32
+execute_process(COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -T v142 -A Win32 -D CMAKE_SYSTEM_VERSION=10.0.17763.0
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/msvc/build
   RESULT_VARIABLE success
 )


MDEV-8978 Specify GPL version in RPM metadata

The License field in the MariaDB RPM packages is GPL. This does not tell
the version of GPL and might confuse tools and users that rely on this
field.

Best practice in the RPM world is to use "GPLv2" for the GPL 2.0
license.

The commit switches the license field of the RPM packages to GPLv2.

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -31,7 +31,7 @@
 SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")

 SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")
-SET(CPACK_RPM_PACKAGE_LICENSE "GPL")
+SET(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
 SET(CPACK_RPM_PACKAGE_RELOCATABLE FALSE)
 SET(CPACK_RPM_PACKAGE_GROUP "Applications/Databases")
 SET(CPACK_RPM_PACKAGE_URL "http://mariadb.org")


ENH: use_system_x options not adavanced anymore

--- SuperBuild/CMake/SuperBuild_Macro.cmake
+++ SuperBuild/CMake/SuperBuild_Macro.cmake
@@ -8,7 +8,6 @@
     "  Use a system build of ${NEW_SYSLIB_PROJECT}."
     ${NEW_SYSLIB_DEFAULT}
     )
-  mark_as_advanced(USE_SYSTEM_${NEW_SYSLIB_PROJECT})
   set(SYSTEM_${NEW_SYSLIB_PROJECT}_CMAKE_CACHE)
 endmacro(SETUP_SYSTEM_LIBRARY)


Reuse MARBLE_PLUGIN_INSTALL_PATH.

Reuse MARBLE_PLUGIN_INSTALL_PATH.

Do not handle KDE vs Qt build specially wrt plugin install path. Also
enables non-system installation for QTONLY=OFF width designer plugins.

--- MarbleMacros.cmake
+++ MarbleMacros.cmake
@@ -88,7 +88,7 @@
                                            ${QT_QTMAIN_LIBRARY}
                                            ${${_target_name}_LIBS}
                                            marblewidget )
-    install( TARGETS ${_target_name} DESTINATION ${QT_PLUGINS_DIR}/designer )
+    install( TARGETS ${_target_name} DESTINATION ${MARBLE_PLUGIN_INSTALL_PATH}/designer )
 else( QTONLY )
     kde4_add_plugin( ${_target_name} ${_src} )
     target_link_libraries( ${_target_name} ${QT_QTCORE_LIBRARY}
@@ -103,7 +103,7 @@
                                            ${QT_QTMAIN_LIBRARY}
                                            ${${_target_name}_LIBS}
                                            marblewidget )
-    install( TARGETS ${_target_name} DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/designer )
+    install( TARGETS ${_target_name} DESTINATION ${MARBLE_PLUGIN_INSTALL_PATH}/plugins/designer )
 endif( QTONLY )

 set_target_properties( ${_target_name} PROPERTIES


incremental linking is a WIP...

incremental linking is a WIP...

--- src/cmake/flags.cmake
+++ src/cmake/flags.cmake
@@ -26,6 +26,10 @@
         set(CMAKE_CXX_ARCHIVE_CREATE "${CMAKE_CXX_ARCHIVE_CREATE} ${LTO_PLUGIN}")
         set(CMAKE_CXX_ARCHIVE_FINISH "${CMAKE_CXX_ARCHIVE_FINISH} ${LTO_PLUGIN}")
     endif()
+    # enable incremental linking for gcc in debug mode
+    #if(DEFINED CMAKE_BUILD_TYPE AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+    #    set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-use-linker-plugin -Wl,--incremental")
+    #endif()
 endif()


Add openmp to FFTW

Add openmp to FFTW

--- modules/FindFFTW3.cmake
+++ modules/FindFFTW3.cmake
@@ -35,6 +35,7 @@
 list(FIND FFTW3_FIND_COMPONENTS DOUBLE LOOK_FOR_DOUBLE)
 list(FIND FFTW3_FIND_COMPONENTS LONGDOUBLE LOOK_FOR_LONGDOUBLE)
 list(FIND FFTW3_FIND_COMPONENTS THREADED LOOK_FOR_THREADED)
+list(FIND FFTW3_FIND_COMPONENTS OPENMP LOOK_FOR_OPENMP)

 if(WIN32)
   set(HINT_DIRS ${FFTW3_DIRECTORY} $ENV{FFTW3_DIRECTORY})
@@ -92,6 +93,10 @@
   #   # FIXME What's the case for windows?
   #   find_library(FFTW3_THREADED_LIBRARY NAMES libfftw3l-3 HINTS ${HINT_DIRS})
   # endif()
+  # if(LOOK_FOR_OPENMP GREATER -1)
+  #   # FIXME What's the case for windows?
+  #   find_library(FFTW3_OPENMP_LIBRARY NAMES libfftw3l-3 HINTS ${HINT_DIRS})
+  # endif()
 else()
   set(HINT_DIRS ${PC_FFTW3_LIBDIR} ${PC_FFTW3_LIBRARY_DIRS}
                 $ENV{FFTW3_LIBRARY_DIR} ${FFTW3_LIBRARY_DIR} )
@@ -105,7 +110,10 @@
     find_library(FFTW3_LONGDOUBLE_LIBRARY NAMES fftw3l HINTS ${HINT_DIRS})
   endif()
   if(LOOK_FOR_THREADED GREATER -1)
-    find_library(FFTW3_THREADED_LIBRARY NAMES fftw3f_threads HINTS ${HINT_DIRS})
+    find_library(FFTW3_THREADED_LIBRARY NAMES fftw3_threads HINTS ${HINT_DIRS})
+  endif()
+  if(LOOK_FOR_OPENMP GREATER -1)
+    find_library(FFTW3_OPENMP_LIBRARY NAMES fftw3_omp HINTS ${HINT_DIRS})
   endif()
 endif(WIN32)

@@ -124,10 +132,14 @@
   set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_LONGDOUBLE_LIBRARY})
   set(FFTW3_LONGDOUBLE_FOUND TRUE)
 endif(FFTW3_LONGDOUBLE_LIBRARY MATCHES fftw3l)
-if(FFTW3_THREADED_LIBRARY MATCHES fftw3l)
+if(FFTW3_THREADED_LIBRARY MATCHES fftw3_threads)
   set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_THREADED_LIBRARY})
   set(FFTW3_THREADED_FOUND TRUE)
-endif(FFTW3_THREADED_LIBRARY MATCHES fftw3f_threads)
+endif(FFTW3_THREADED_LIBRARY MATCHES fftw3_threads)
+if(FFTW3_OPENMP_LIBRARY MATCHES fftw3_omp)
+  set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_OPENMP_LIBRARY})
+  set(FFTW3_OPENMP_FOUND TRUE)
+endif(FFTW3_OPENMP_LIBRARY MATCHES fftw3_omp)

 if(FFTW3_SINGLE_FOUND AND FFTW3_INCLUDE_DIR)
     find_version(FFTW3_VERSION_STRING ${FFTW3_SINGLE_LIBRARY} f)
@@ -137,6 +149,8 @@
     find_version(FFTW3_VERSION_STRING ${FFTW3_LONGDOUBLE_LIBRARY} "l")
 elseif(FFTW3_THREADED_FOUND AND FFTW3_INCLUDE_DIR)  # TODO What happens when you ask for double and threaded?
     find_version(FFTW3_VERSION_STRING ${FFTW3_THREADED_LIBRARY} "t") # TODO is this ok?
+elseif(FFTW3_OPENMP_FOUND AND FFTW3_INCLUDE_DIR)  # TODO What happens when you ask for double and openmp?
+    find_version(FFTW3_VERSION_STRING ${FFTW3_OPENMP_LIBRARY} "t") # TODO is this ok?
 endif()

 include(FindPackageHandleStandardArgs)
@@ -179,14 +193,24 @@
       INTERFACE_INCLUDE_DIRECTORIES "${FFTW3_INCLUDE_DIR}")
   endif()
   # TODO do I need this?
-  # if(FFTW3_THREADED_LIBRARY MATCHES fftw3_threads)
-  #   if(FFTW3_THREADED_LIBRARY MATCHES "\.a$")
-  #     add_library(fftw3::threaded STATIC IMPORTED GLOBAL)
-  #   else()
-  #     add_library(fftw3::threaded SHARED IMPORTED GLOBAL)
-  #   endif()
-  #   set_target_properties(fftw3::threaded PROPERTIES
-  #     IMPORTED_LOCATION "${FFTW3_THREADED_LIBRARY}"
-  #     INTERFACE_INCLUDE_DIRECTORIES "${FFTW3_INCLUDE_DIR}")
-  # endif()
-endif()
+  if(FFTW3_THREADED_LIBRARY MATCHES fftw3f_threads)
+    if(FFTW3_THREADED_LIBRARY MATCHES "\.a$")
+      add_library(fftw3::threaded STATIC IMPORTED GLOBAL)
+    else()
+      add_library(fftw3::threaded SHARED IMPORTED GLOBAL)
+    endif()
+    set_target_properties(fftw3::threaded PROPERTIES
+      IMPORTED_LOCATION "${FFTW3_THREADED_LIBRARY}"
+      INTERFACE_INCLUDE_DIRECTORIES "${FFTW3_INCLUDE_DIR}")
+  endif()
+  if(FFTW3_OPENMP_LIBRARY MATCHES fftw3f_omp)
+    if(FFTW3_OPENMP_LIBRARY MATCHES "\.a$")
+      add_library(fftw3::openmp STATIC IMPORTED GLOBAL)
+    else()
+      add_library(fftw3::openmp SHARED IMPORTED GLOBAL)
+    endif()
+    set_target_properties(fftw3::openmp PROPERTIES
+      IMPORTED_LOCATION "${FFTW3_OPENMP_LIBRARY}"
+      INTERFACE_INCLUDE_DIRECTORIES "${FFTW3_INCLUDE_DIR}")
+  endif()
+endif()


Add 12.10 to PPA upload list

Add 12.10 to PPA upload list

--- UploadPPA.cmake
+++ UploadPPA.cmake
@@ -54,7 +54,7 @@
   set(DEB_LONG_DESCRIPTION "${DEB_LONG_DESCRIPTION} ${LINE}\n")
 endforeach(LINE ${DESC_LINES})

-function(UPLOAD_PPA UBUNTU_NAME)
+function(UPLOAD_PPA UBUNTU_NAME)
   set(DEBIAN_BASE_DIR ${CMAKE_BINARY_DIR}/Debian/${UBUNTU_NAME})
   file(REMOVE_RECURSE ${DEBIAN_BASE_DIR})
   set(DEBIAN_SOURCE_DIR
@@ -79,7 +79,7 @@

   foreach(DEP ${CPACK_DEBIAN_BUILD_DEPENDS})
     file(APPEND ${DEBIAN_CONTROL} "${DEP}, ")
-  endforeach(DEP ${CPACK_DEBIAN_BUILD_DEPENDS})
+  endforeach(DEP ${CPACK_DEBIAN_BUILD_DEPENDS})

   file(APPEND ${DEBIAN_CONTROL} "cmake\n"
     "Standards-Version: 3.9.1\n"
@@ -217,5 +217,6 @@
 function(UPLOAD_PPAS)
   upload_ppa(oneiric)
   upload_ppa(precise)
+  upload_ppa(quantal)
   add_custom_target(dput DEPENDS ${DPUT_TARGETS})
 endfunction()


Do not specify install prefix for pygments

Specifying the install prefix breaks the windows build, with it
complaining that the install prefix is not in the python path.

However, it appears to install it to the correct location without
the install prefix. Linux also appears to install it to the
correct location without the install prefix. Just need to make sure
it installs to the correct location on mac, then...

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/pygments.cmake
+++ projects/pygments.cmake
@@ -21,6 +21,5 @@
   INSTALL_COMMAND
     ${install_command_env}
   ${pv_python_executable} setup.py install
-     --prefix=<INSTALL_DIR>
   ${process_environment}
 )


Add test suite check for trailing spaces

SVN-Revision: 2544

--- suite/runsuite.cmake
+++ suite/runsuite.cmake
@@ -132,6 +132,15 @@
 # check for them unless we switch to perl or python or something
 # to get the diff and check it.

+# Check for trailing space.  This is a diff with an initial column for +-,
+# so a blank line will have one space: thus we rule that out.
+string(REGEX MATCH "[^\n] \n" match "${diff_contents}")
+if (NOT "${match}" STREQUAL "")
+  # Get more context
+  string(REGEX MATCH "\n[^\n]+ \n" match "${diff_contents}")
+  message(FATAL_ERROR "ERROR: diff contains trailing spaces: ${match}")
+endif ()
+
 ##################################################


Add re-install target.

Add re-install target.

	* build-aux/cmake/modules/Init.cmake: Here.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/Init.cmake
+++ build-aux/cmake/modules/Init.cmake
@@ -33,4 +33,11 @@
   COMMENT "Clean installation directory."
   )

+# Add re-install target
+add_custom_target(re-install
+  COMMAND ${CMAKE_BUILD_TOOL} install
+  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+  COMMENT "Re-install")
+add_dependencies(re-install clean-install)
+
 endif(NOT DEFINED INIT_CMAKE)


Fix version generation

Fix version generation

This adds version generation in a more portable manner, requiring only
Git for the most basic meta-data. This allows us to generate versions
properly on Windows without requiring a full GNU coreutils installation

Change-Id: Ic10b9a4a76071c8b3cbeb4a8032ecb6ca5a61c31
Reviewed-on: http://review.couchbase.org/43420
Tested-by: Mark Nunberg <e7d42768707bf23038325b0b68d4b577e5f6064a@haskalah.org>
Reviewed-by: Subhashni Balakrishnan <7129c8e37b832c7bd362ff375532d24b98ef5162@gmail.com>

--- cmake/Modules/GetVersionInfo.cmake
+++ cmake/Modules/GetVersionInfo.cmake
@@ -9,23 +9,19 @@

 ## Try git first ##
 FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe)
+MACRO(RUNGIT outvar)
+    EXECUTE_PROCESS(COMMAND git ${ARGN}
+        OUTPUT_VARIABLE ${outvar}
+        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+        OUTPUT_STRIP_TRAILING_WHITESPACE)
+ENDMACRO()
+
 if (GIT_EXECUTABLE)
-    EXECUTE_PROCESS(
-        COMMAND git describe
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        OUTPUT_VARIABLE LCB_REVDESCRIBE)
-    EXECUTE_PROCESS(
-        COMMAND git describe
-        COMMAND tr - _
-        COMMAND tr -d \n
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        OUTPUT_VARIABLE LCB_VERSION)
+    RUNGIT(LCB_REVDESCRIBE describe)
+    STRING(REPLACE "-" "_" LCB_VERSION "${LCB_REVDESCRIBE}")
     MESSAGE(STATUS "Sanitized VERSION=${LCB_VERSION}")
-    EXECUTE_PROCESS(
-        COMMAND git rev-parse HEAD
-        COMMAND tr -d \n
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        OUTPUT_VARIABLE LCB_VERSION_CHANGESET)
+    RUNGIT(LCB_VERSION_CHANGESET rev-parse HEAD)
+
     EXECUTE_PROCESS(
         COMMAND echo ${LCB_VERSION}
         COMMAND awk -F. "{printf \"0x%0.2d%0.2d%0.2d\", $1, $2, $3}"


Simplifying CMake dependency handling

Simplifying CMake dependency handling

* Update FindMKL.cmake module
* Separate find/cmake package manager mode
* Fixed conan build
* Fixed gfortan linking
* Fixed OpenBLAS interface libs

Former-commit-id: 7db87a8bc29cecf043501f9ebe1ee10d238bdd21

--- cmake/SetupDependenciesCMake.cmake
+++ cmake/SetupDependenciesCMake.cmake
@@ -65,6 +65,23 @@
         install_package(OpenBLAS "${DMRG_DEPS_INSTALL_DIR}" "${OpenBLAS_CMAKE_OPTIONS}")
         find_package(OpenBLAS 0.3.8 HINTS ${DMRG_DEPS_INSTALL_DIR} NO_DEFAULT_PATH REQUIRED)
     endif()
+    if(TARGET OpenBLAS::OpenBLAS)
+        target_link_libraries(OpenBLAS::OpenBLAS INTERFACE gfortran::gfortran Threads::Threads)
+        target_compile_definitions(OpenBLAS::OpenBLAS INTERFACE OPENBLAS_AVAILABLE)
+        # Fix for OpenBLAS 0.3.9, which otherwise includes <complex> inside of an extern "C" scope.
+        target_compile_definitions(OpenBLAS::OpenBLAS INTERFACE lapack_complex_float=std::complex<float>)
+        target_compile_definitions(OpenBLAS::OpenBLAS INTERFACE lapack_complex_double=std::complex<double>)
+        #For convenience, define these targes
+        if(NOT TARGET BLAS::BLAS)
+            add_library(BLAS::BLAS                  INTERFACE IMPORTED)
+            target_link_libraries(BLAS::BLAS        INTERFACE OpenBLAS::OpenBLAS)
+        endif()
+        if(NOT TARGET LAPACK::LAPACK)
+            add_library(LAPACK::LAPACK              INTERFACE IMPORTED)
+            target_link_libraries(LAPACK::LAPACK    INTERFACE OpenBLAS::OpenBLAS)
+        endif()
+    endif()
+

     # Starting from here there should definitely be blas library that includes lapacke
     # Lapacke is needed by arpack++, included in MKL or OpenBLAS


Making comments correct

Making comments correct

svn path=/trunk/extragear/base/PolicyKit-kde/polkit-qt/; revision=926481

--- cmake/modules/FindQPolicyKit.cmake
+++ cmake/modules/FindQPolicyKit.cmake
@@ -1,10 +1,10 @@
 # - Try to find QPolicyKit
 # Once done this will define
 #
-#  QPACKAGEKIT_FOUND - system has QPackageKit
-#  QPACKAGEKIT_INCLUDE_DIR - the QPackageKit include directory
-#  QPACKAGEKIT_LIB - Link these to use QPackageKit
-#  QPACKAGEKIT_DEFINITIONS - Compiler switches required for using QPackageKit
+#  QPOLICYKIT_FOUND - system has QPackageKit
+#  QPOLICYKIT_INCLUDE_DIR - the QPackageKit include directory
+#  QPOLICYKIT_LIB - Link these to use QPackageKit
+#  QPOLICYKIT_DEFINITIONS - Compiler switches required for using QPackageKit

 # Copyright (c) 2008, Adrien Bustany, <madcat@mymadcat.com>
 # Copyright (c) 2009, Daniel Nicoletti, <dantti85-pk@yahoo.com.br>


[CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds

Summary:
This line is unnecessary because add_llvm_executable will handle
linking the correct LLVM libraries for you. LLDB standalone builds are totally
fine without this.

In the best case, having this line here is harmless. In the worst case it can
cause link issues.

If you build lldb-server for android using the standalone build, this line
will cause LLVM_LIBRARY_DIR to be the first place you look for libraries.
This is an issue because if you built libc++, it will try to link against
that one instead of the one from the android NDK.  Meanwhile, the LLVM libraries
you're linking against were linked against the libc++ from the NDK.

Ideally, we would take advantage of the AFTER option for link_directories(), but
that was not available in LLDB's minimum supported version of CMake (CMake 3.4.3).

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

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

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -21,7 +21,6 @@

   set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
   set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
-  set(LLVM_LIBRARY_DIR ${LLVM_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR} CACHE PATH "Path to LLVM build tree")

   set(lit_file_name "llvm-lit")
@@ -95,8 +94,6 @@
     "${LLVM_INCLUDE_DIRS}"
     "${CLANG_INCLUDE_DIRS}")

-  link_directories("${LLVM_LIBRARY_DIR}")
-
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
   set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})


cmake: readability

cmake: readability

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -477,40 +477,40 @@
   file(WRITE "${_sdk_file}" "${_sdk_code}")

+  # OK, this one is tricky.
+  # with qibuild, when you have a target named "foo", you always prefix
+  # the variables concerning the foo target with the upper-case name
+  # of the target (FOO_INCLUDE_DIRS, FOO_DEFINITIONS, FOO_DEPENDS....)
+
+  # previously, when using toc/t001chain, you could stage a library
+  # with whatever named you wanted. For instance, you could use:
+  # stage_lib(foo LIBFOO)
+
+  # In order to preserve backward compatibility, (for instance use_lib(bar LIBFOO)
+  # MUST continue to work), when we stumble upon this kind of call in compat/compat.cmake,
+  # we create two different modules.
+
+  # one is still called foo-config.cmake, the other one is a copy of foo-config.cmake,
+  # named libfoo-config.cmake, where every occurrence of "FOO" is replaced by
+  # LIBFOO.
+  # This way, only the *names* of the values changed, but not their value, so
+  # LIBFOO_DEPENDS is the same as FOO_DEPENDS
+
+  # TODO: this little final hack is not very safe. Maybe a better way to do it will
+  # be to generate a file looking like
+
+  #   message(STAUS "Usage of
+  #       use_lib(... LIBFOO)
+  #   is deprecated, please use
+  #       qi_use_lib(.. foo)
+  #   find_package(foo)
+  #   ")
+  #
+  #   set(LIBFOO_DEPENDS ${FOO_DEPENDS}
+  #   set(LIBFOO_INLUDE_DIRS ${FOO_INCLUDE_DIRS}
+  #
+  #
   if(_staged_name)
-    # OK, this one is tricky.
-    # with qibuild, when you have a target named "foo", you always prefix
-    # the variables concerning the foo target with the upper-case name
-    # of the target (FOO_INCLUDE_DIRS, FOO_DEFINITIONS, FOO_DEPENDS....)
-
-    # previously, when using toc/t001chain, you could stage a library
-    # with whatever named you wanted. For instance, you could use:
-    # stage_lib(foo LIBFOO)
-
-    # In order to preserve backward compatibility, (for instance use_lib(bar LIBFOO)
-    # MUST continue to work), when we stumble upon this kind of call in compat/compat.cmake,
-    # we create two different modules.
-
-    # one is still called foo-config.cmake, the other one is a copy of foo-config.cmake,
-    # named libfoo-config.cmake, where every occurrence of "FOO" is replaced by
-    # LIBFOO.
-    # This way, only the *names* of the values changed, but not their value, so
-    # LIBFOO_DEPENDS is the same as FOO_DEPENDS
-
-    # TODO: this little final hack is not very safe. Maybe a better way to do it will
-    # be to generate a file looking like
-
-    #   message(STAUS "Usage of
-    #       use_lib(... LIBFOO)
-    #   is deprecated, please use
-    #       qi_use_lib(.. foo)
-    #   find_package(foo)
-    #   ")
-    #
-    #   set(LIBFOO_DEPENDS ${FOO_DEPENDS}
-    #   set(LIBFOO_INLUDE_DIRS ${FOO_INCLUDE_DIRS}
-    #
-    #
     set(_warning_message
 "
 message(WARNING \${CMAKE_CURRENT_LIST_FILE}\"


refs #5127 enable debug mode for jemalloc

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

--- cmake_modules/TokuThirdParty.cmake
+++ cmake_modules/TokuThirdParty.cmake
@@ -8,11 +8,15 @@
 if (NOT EXISTS "${JEMALLOC_SOURCE_DIR}/configure")
   message(FATAL_ERROR "Can't find jemalloc sources.  Please check them out to ${JEMALLOC_SOURCE_DIR} or modify TOKU_SVNROOT (${TOKU_SVNROOT}) or JEMALLOC_SOURCE_DIR.")
 endif ()
+set(jemalloc_configure_opts "CC=${CMAKE_C_COMPILER}")
+if (NOT CMAKE_BUILD_TYPE MATCHES Release)
+  list(APPEND jemalloc_configure_opts --enable-debug)
+endif ()
 ExternalProject_Add(build_jemalloc
   PREFIX jemalloc
   SOURCE_DIR "${JEMALLOC_SOURCE_DIR}"
   CONFIGURE_COMMAND
-      "${JEMALLOC_SOURCE_DIR}/configure" "CC=${CMAKE_C_COMPILER}"
+      "${JEMALLOC_SOURCE_DIR}/configure" ${jemalloc_configure_opts}
       "--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc"
   )


suitesparse sync

suitesparse sync

--- cmakemodules/FindSuiteSparse.cmake
+++ cmakemodules/FindSuiteSparse.cmake
@@ -68,9 +68,12 @@
 endif()

 ## set default verbosity
-if(NOT SuiteSparse_VERBOSE)
+## Process the CMake automatically-generated var: SuiteSparse_FIND_QUIETLY: supersedes *_VERBOSE.
+if(NOT SuiteSparse_VERBOSE OR SuiteSparse_FIND_QUIETLY)
 	set(SuiteSparse_VERBOSE OFF)
-else()
+endif()
+
+if(SuiteSparse_VERBOSE)
 	message(STATUS "Start to FindSuiteSparse.cmake :")
 endif()

@@ -256,6 +259,7 @@
 	## set the final SuiteSparse_FOUND based on all previous components found (status)
 	foreach(componentToCheck ${SuiteSparse_FOUND_LIST})
 		set(SuiteSparse_FOUND ON)
+		MESSAGE(STATUS "final check: ${componentToCheck}")
 		if(NOT ${componentToCheck})
 			set(SuiteSparse_FOUND OFF)
 			break() ## one component not found is enought to failed
@@ -299,8 +303,11 @@
 		PATH_SUFFIXES	Release Debug
 	)
 	if(NOT SuiteSparse_BLAS_LIBRARY)
-		message(SEND_ERROR "   Failed to find SuiteSparse_BLAS_LIBRARY.Set it manually or set the SuiteSparse_BLAS_DIR to looking for it inside.")
-		set(SuiteSparse_BLAS_DIR "$ENV{SuiteSparse_BLAS_DIR}" CACHE PATH "blas root directory")
+		if (SuiteSparse_VERBOSE)
+			# Send all msgs as "STATUS": We'll send an error at the bottom, only if "REQUIRED" is set.
+			message(STATUS "   Failed to find SuiteSparse_BLAS_LIBRARY.Set it manually or set the SuiteSparse_BLAS_DIR to looking for it inside.")
+		endif()
+			set(SuiteSparse_BLAS_DIR "$ENV{SuiteSparse_BLAS_DIR}" CACHE PATH "blas root directory")
 	else()
 		if(DEFINED SuiteSparse_BLAS_DIR)
 			mark_as_advanced(SuiteSparse_BLAS_DIR)
@@ -320,7 +327,10 @@
 		PATH_SUFFIXES	Release Debug
 	)
 	if(NOT SuiteSparse_LAPACK_LIBRARY)
-		message(SEND_ERROR "   Failed to find SuiteSparse_LAPACK_LIBRARY.Set it manually or set the SuiteSparse_LAPACK_DIR to looking for it inside.")
+		if (SuiteSparse_VERBOSE)
+			# Send all msgs as "STATUS": We'll send an error at the bottom, only if "REQUIRED" is set.
+			message(STATUS "   Failed to find SuiteSparse_LAPACK_LIBRARY.Set it manually or set the SuiteSparse_LAPACK_DIR to looking for it inside.")
+		endif()
 		set(SuiteSparse_LAPACK_DIR "$ENV{SuiteSparse_LAPACK_DIR}" CACHE PATH "lapack root directory")
 	else()
 		if(DEFINED SuiteSparse_LAPACK_DIR)
@@ -411,3 +421,16 @@
 if(SuiteSparse_VERBOSE)
 	message(STATUS "Finish to FindSuiteSparse.cmake => SuiteSparse_FOUND=${SuiteSparse_FOUND}")
 endif()
+
+## Show error if not found and _REQUIRED
+IF(NOT SuiteSparse_FOUND)
+  # make FIND_PACKAGE friendly
+  IF(NOT SuiteSparse_FIND_QUIETLY)
+    IF(SuiteSparse_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR
+        "SuiteSparse required but some headers or libs not found.")
+    ELSE()
+      MESSAGE(STATUS "ERROR: SuiteSparse was not found.")
+    ENDIF()
+  ENDIF()
+ENDIF()


Qt 5.9 Windows: Link Dwmapi

Qt 5.9 Windows: Link Dwmapi


COMP: add a OTB_USE_LIBSVM option

COMP: add a OTB_USE_LIBSVM option

--- Modules/ThirdParty/LibSVM/otb-module.cmake
+++ Modules/ThirdParty/LibSVM/otb-module.cmake
@@ -8,3 +8,5 @@
   DESCRIPTION
     "${DOCUMENTATION}"
   )
+
+otb_module_activation_option("Enable libSVM dependent modules" ON)


SuperBuild: openjpeg: disable optimization patch on msvc

--- SuperBuild/CMake/External_openjpeg.cmake
+++ SuperBuild/CMake/External_openjpeg.cmake
@@ -52,4 +52,8 @@
 SUPERBUILD_UPDATE_CMAKE_VARIABLES(OPENJPEG FALSE)

 #Apply patches to openjpeg (for now Even Roualt optim)
+#cannot apply on windows.
+#There is an issue with CLRF and patch from github
+if(NOT MSVC)
 SUPERBUILD_PATCH_SOURCE(OPENJPEG)
+endif()


removed auto-generated file

removed auto-generated file

--- frontends/CsoundAC/cmake_install.cmake
+++ frontends/CsoundAC/cmake_install.cmake
@@ -1,34 +0,0 @@
-# Install script for directory: /home/jpff/Sourceforge/csound/New/csound6/frontends/CsoundAC
-
-# Set the install prefix
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  SET(CMAKE_INSTALL_PREFIX "/usr/local")
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  IF(BUILD_TYPE)
-    STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  ELSE(BUILD_TYPE)
-    SET(CMAKE_INSTALL_CONFIG_NAME "Debug")
-  ENDIF(BUILD_TYPE)
-  MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-
-# Set the component getting installed.
-IF(NOT CMAKE_INSTALL_COMPONENT)
-  IF(COMPONENT)
-    MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
-    SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  ELSE(COMPONENT)
-    SET(CMAKE_INSTALL_COMPONENT)
-  ENDIF(COMPONENT)
-ENDIF(NOT CMAKE_INSTALL_COMPONENT)
-
-# Install shared libraries without execute permission?
-IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  SET(CMAKE_INSTALL_SO_NO_EXE "0")
-ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-


deps-linux newer openSSL

deps-linux newer openSSL

--- deps/deps-linux.cmake
+++ deps/deps-linux.cmake
@@ -26,8 +26,8 @@

 ExternalProject_Add(dep_libopenssl
     EXCLUDE_FROM_ALL 1
-    URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.tar.gz"
-    URL_HASH SHA256=8e9516b8635bb9113c51a7b5b27f9027692a56b104e75b709e588c3ffd6a0422
+    URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz"
+    URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d
     BUILD_IN_SOURCE 1
     CONFIGURE_COMMAND ./config
         "--prefix=${DESTDIR}/usr/local"


modules: fix finding of SDL2 on OSX.

modules: fix finding of SDL2 on OSX.

See the file comment for details.

--- modules/FindSDL2.cmake
+++ modules/FindSDL2.cmake
@@ -37,7 +37,13 @@
 if(CORRADE_TARGET_EMSCRIPTEN)
     set(_SDL2_PATH_SUFFIXES SDL)
 else()
-    find_library(SDL2_LIBRARY SDL2
+    find_library(SDL2_LIBRARY
+        # Compiling SDL2 from scratch on OSX creates dead libSDL2.so symlink
+        # which CMake somehow prefers before the SDL2-2.0.dylib file. Making
+        # the dylib first so it is preferred.
+        NAMES SDL2-2.0 SDL2
+
+        # Precompiled libraries for Windows are in x86/x64 subdirectories
         PATH_SUFFIXES lib/x86 lib/x64)
     set(SDL2_LIBRARY_NEEDED SDL2_LIBRARY)
     set(_SDL2_PATH_SUFFIXES SDL2)


Fixed variable setting for Cray DRC detection

--- cmake/DetectOptions.cmake
+++ cmake/DetectOptions.cmake
@@ -210,7 +210,7 @@
   if(LIBFABRIC_FOUND)
     set(ADIOS2_SST_HAVE_LIBFABRIC TRUE)
     find_package(CrayDRC)
-    if(CRAY_DRC_FOUND)
+    if(CrayDRC_FOUND)
       set(ADIOS2_SST_HAVE_CRAY_DRC TRUE)
     endif()
   endif()


Switch to new Qt experimental

Switch to new Qt experimental

--- cmake/Hunter/config.cmake
+++ cmake/Hunter/config.cmake
@@ -34,7 +34,7 @@
 hunter_config(cereal VERSION 1.1.2-p5)
 hunter_config(OpenCV VERSION 3.0.0-p6 CMAKE_ARGS "${OPENCV_CMAKE_ARGS}")
 hunter_config(spdlog VERSION 1.0.0-p0)
-hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-2-p0)
+hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-2-p1)
 hunter_config(BoostCompute VERSION 0.5-p0)

 #  CMAKE_ARGS


Adding package prefix to the location of the package created by CPack.  This is to make it easier for the buildbot to upload the package and sync. it with the physiomeproject website.  https://tracker.physiomeproject.org/show_bug.cgi?id=3439

--- cmake/ZincPackaging.cmake
+++ cmake/ZincPackaging.cmake
@@ -44,6 +44,7 @@

 message(STATUS "'zinc-${ZINC_VERSION}-${ZINC_ARCHITECTURE}-${ZINC_SYSTEM}'" )
 SET( CPACK_PACKAGE_FILE_NAME "zinc-${ZINC_VERSION}-${ZINC_ARCHITECTURE}-${ZINC_SYSTEM}" )
+SET( CPACK_OUTPUT_FILE_PREFIX "package" )

 INCLUDE(CPack)


Limit MSVC concurrent build tasks

Limit MSVC concurrent build tasks

--- cmake/compiler/msvc.cmake
+++ cmake/compiler/msvc.cmake
@@ -33,7 +33,7 @@

 target_compile_options(continuable-features-flags
   INTERFACE
-    /MP
+    /MP2
     /bigobj
     /permissive-)


Force landscape mode for Android apps (for now)

--- cmake/oryol_android.cmake
+++ cmake/oryol_android.cmake
@@ -35,6 +35,7 @@
         "  <application android:label=\"${target}\" android:hasCode=\"false\">\n"
         "    <activity android:name=\"android.app.NativeActivity\"\n"
         "      android:label=\"${target}\"\n"
+        "      android:screenOrientation=\"landscape\"\n"
         "      android:configChanges=\"orientation|keyboardHidden\">\n"
         "      <meta-data android:name=\"android.app.lib_name\" android:value=\"${target}\"/>\n"
         "      <intent-filter>\n"


Handle c++11 host flag in FindTbagCUDA cmake file.

--- cmake/TbagFindPackage/FindTbagCUDA.cmake
+++ cmake/TbagFindPackage/FindTbagCUDA.cmake
@@ -16,7 +16,7 @@
 #///  - ${CUDA_HOST_COMPILER}
 #///  - ${CUDA_NVCC_FLAGS}
 #///  - ${CUDA_NVCC_FLAGS_<CONFIG>}
-#///  - ${CUDA_PROPAGATE_HOST_FLAGS}
+#///  - ${CUDA_PROPAGATE_HOST_FLAGS}    (Default ON) ${CMAKE_{C,CXX}_FLAGS} to -Xcompiler flag.
 #///  - ${CUDA_SEPARABLE_COMPILATION}
 #///  - ${CUDA_VERBOSE_BUILD}
 #///
@@ -181,7 +181,9 @@
     set (${__result}_readable ${__nvcc_archs_readable} PARENT_SCOPE)
 endfunction ()

-find_package (CUDA 5.5 QUIET)
+############ FIND ############
+find_package (CUDA 5.5 QUIET)#
+##############################

 # cmake 2.8.7 compartibility which doesn't search for curand.
 find_cuda_helper_libs (curand)
@@ -199,3 +201,16 @@
 #    set (CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} \"-DBOOST_NOINLINE=__attribute__((noinline))\" ")
 #endif ()

+## See: cmake revision 48040c1 - Merge topic 'FindCUDA.cmake/C++11Flags'
+if (CMAKE_VERSION VERSION_LESS "3.2.2")
+    # Process the C++11 flag.
+    # cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
+    if ("${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+11")
+        # Add the c++11 flag to nvcc if it isn't already present.  Note that we only look at
+        # the main flag instead of the configuration specific flags.
+        if (NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std;c\\+\\+11" )
+            list (APPEND CUDA_NVCC_FLAGS --std c++11)
+        endif ()
+    endif ()
+endif ()
+


Fix CMake option DAEMON_CBSE_PYTHON_PATH

It didn't do anything because the conditional was wrong.

--- cmake/DaemonCBSE.cmake
+++ cmake/DaemonCBSE.cmake
@@ -25,10 +25,10 @@
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 # Allow overriding the python path with a cached variable.
-set(DAEMON_CBSE_PYTHON_PATH "NOTFOUND" CACHE FILEPATH "")
-if (NOT ${DAEMON_CBSE_PYTHON_PATH})
+set(DAEMON_CBSE_PYTHON_PATH "NOTFOUND" CACHE FILEPATH "Python executable for CBSE code generation")
+if (NOT DAEMON_CBSE_PYTHON_PATH)
     find_package(Python REQUIRED)
-set(DAEMON_CBSE_PYTHON_PATH "${Python_EXECUTABLE}" CACHE FILEPATH "" FORCE)
+    set(DAEMON_CBSE_PYTHON_PATH "${Python_EXECUTABLE}" CACHE FILEPATH "Python executable for CBSE code generation" FORCE)
 endif()
 message(STATUS "Using CBSE Python executable: ${DAEMON_CBSE_PYTHON_PATH}")


htslib installs to /usr/local by default. Update path hints.

--- cmake/FindHTSlib.cmake
+++ cmake/FindHTSlib.cmake
@@ -10,6 +10,7 @@
     $ENV{HTLSIB_ROOT}
     /gsc/pkg/bio/htslib
     /usr
+    /usr/local
 )

 set(_htslib_ver_path "htslib-${htslib_FIND_VERSION}")


Allow setting GOOGLETEST_PATH cmake argument. Fixes #867 (#868)

In `cmake/GoogleTest.cmake`, GOOGLETEST_PATH is default-initialized, but that init forgot to
account for the fact that the patch is explicitly supposed to be user-configurable.
By passing `CACHE` to `set()` we avoid that error.

--- cmake/GoogleTest.cmake
+++ cmake/GoogleTest.cmake
@@ -2,7 +2,7 @@
 set(GOOGLETEST_PREFIX "${benchmark_BINARY_DIR}/third_party/googletest")
 configure_file(${benchmark_SOURCE_DIR}/cmake/GoogleTest.cmake.in ${GOOGLETEST_PREFIX}/CMakeLists.txt @ONLY)

-set(GOOGLETEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/googletest") # Mind the quotes
+set(GOOGLETEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/googletest" CACHE PATH "") # Mind the quotes
 execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
   -DALLOW_DOWNLOADING_GOOGLETEST=${BENCHMARK_DOWNLOAD_DEPENDENCIES} -DGOOGLETEST_PATH:PATH=${GOOGLETEST_PATH} .
   RESULT_VARIABLE result


cmake: Add new generate_inc_file_for_gen_target function

Add a variant on generate_inc_file_for_target in which the user can
specify the target that the generated file will depend on.  This allows
exposing that target to other possible places where a dependency on the
generated file existing might be needed.

Signed-off-by: Kumar Gala <a5e5248af4cd4f0ed8c515f61d40a6e2db46a66e@linaro.org>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -329,14 +329,27 @@
     )
 endfunction()

+function(generate_inc_file_for_gen_target
+    target          # The cmake target that depends on the generated file
+    source_file     # The source file to be converted to hex
+    generated_file  # The generated file
+    gen_target      # The generated file target we depend on
+                    # Any additional arguments are passed on to file2hex.py
+    )
+  generate_inc_file(${source_file} ${generated_file} ${ARGN})
+
+  # Ensure 'generated_file' is generated before 'target' by creating a
+  # dependency between the two targets
+
+  add_dependencies(${target} ${gen_target})
+endfunction()
+
 function(generate_inc_file_for_target
     target          # The cmake target that depends on the generated file
     source_file     # The source file to be converted to hex
     generated_file  # The generated file
                     # Any additional arguments are passed on to file2hex.py
     )
-  generate_inc_file(${source_file} ${generated_file} ${ARGN})
-
   # Ensure 'generated_file' is generated before 'target' by creating a
   # 'custom_target' for it and setting up a dependency between the two
   # targets
@@ -355,7 +368,7 @@
   set(generated_target_name "gen_${basename}_${random_chars}")

   add_custom_target(${generated_target_name} DEPENDS ${generated_file})
-  add_dependencies(${target} ${generated_target_name})
+  generate_inc_file_for_gen_target(${target} ${source_file} ${generated_file} ${generated_target_name} ${ARGN})
 endfunction()

 # 1.2 zephyr_library_*


cmake: generate_inc: Change how the target name is constructed

The generate_inc_file_for_target() extension is a useful wrapper
around the more low-level generate_inc_file(). It takes care of
ensuring that the generated file correctly depends on it's source.

To do so it needs to name and define a custom_target, the name must be
unique, so it was constructed based on the path to the generated file,
but this caused multiple issues.

The intention was that the path of the file would help identify the
target, in hindsight, identifying the target has proven to not be
important.

This patch fixes #5466 by using a random string to construct the
target name instead of the path to the generated file.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -301,12 +301,17 @@
   # targets

   # But first create a unique name for the custom target
-  # Replace / with _ (driver/serial => driver_serial) and . with _
-  set(generated_target_name ${generated_file})
-
-  string(REPLACE "/" "_" generated_target_name ${generated_target_name})
-  string(REPLACE "." "_" generated_target_name ${generated_target_name})
-  string(REPLACE "@" "_" generated_target_name ${generated_target_name})
+  string(
+    RANDOM
+    LENGTH 8
+    random_chars
+    )
+
+  get_filename_component(basename ${generated_file} NAME)
+  string(REPLACE "." "_" basename ${basename})
+  string(REPLACE "@" "_" basename ${basename})
+
+  set(generated_target_name "gen_${basename}_${random_chars}")

   add_custom_target(${generated_target_name} DEPENDS ${generated_file})
   add_dependencies(${target} ${generated_target_name})


cpp11.cmake logic correct

cpp11.cmake logic correct

--- cmakefiles/cpp11.cmake
+++ cmakefiles/cpp11.cmake
@@ -14,7 +14,7 @@

    elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
        # require at least clang 3.2
-      if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
+      if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.3)
          set(COMPILER_VERSION_CHK 1)
       endif()


COMP: added endif removed by merging

COMP: added endif removed by merging

--- CMake/mitkFunctionGetLibrarySearchPaths.cmake
+++ CMake/mitkFunctionGetLibrarySearchPaths.cmake
@@ -59,6 +59,7 @@
     endif()
     if(SOFA_DIR)
       list(APPEND _dir_candidates "${SOFA_DIR}/bin")
+    endif()
     if(Python_DIR)
       list(APPEND _dir_candidates "${Python_DIR}/bin")
     endif()
@@ -75,6 +76,7 @@
     endif()
     if(SOFA_DIR)
       list(APPEND _dir_candidates "${SOFA_DIR}/lib")
+    endif()
     if(Python_DIR)
       list(APPEND _dir_candidates "${Python_DIR}/lib")
     endif()


Determine the Qt5 library search path for the generated batch scripts.

--- CMake/mitkFunctionGetLibrarySearchPaths.cmake
+++ CMake/mitkFunctionGetLibrarySearchPaths.cmake
@@ -1,7 +1,36 @@
 function(mitkFunctionGetLibrarySearchPaths search_path intermediate_dir)

-  set(_dir_candidates ${MITK_VTK_LIBRARY_DIRS} ${MITK_ITK_LIBRARY_DIRS} ${QT_LIBRARY_DIR}
-                      ${QT_LIBRARY_DIR}/../bin ${MITK_BINARY_DIR}/bin ${MITK_BINARY_DIR}/bin/plugins)
+  set(_dir_candidates ${MITK_VTK_LIBRARY_DIRS} ${MITK_ITK_LIBRARY_DIRS}
+                      ${MITK_BINARY_DIR}/bin ${MITK_BINARY_DIR}/bin/plugins)
+
+  # Determine the Qt4/5 library installation prefix
+  set(_qmake_location )
+  if(MITK_USE_Qt4)
+    set(_qmake_location ${QT_QMAKE_EXECUTABLE})
+  elseif(MITK_USE_Qt5 AND TARGET ${Qt5Core_QMAKE_EXECUTABLE})
+    get_property(_qmake_location TARGET ${Qt5Core_QMAKE_EXECUTABLE}
+                 PROPERTY IMPORT_LOCATION)
+  endif()
+  if(_qmake_location)
+    if(NOT _qt_install_libs)
+      if(WIN32)
+        execute_process(COMMAND ${_qmake_location} -query QT_INSTALL_BINS
+                        OUTPUT_VARIABLE _qt_install_libs
+                        OUTPUT_STRIP_TRAILING_WHITESPACE)
+      else()
+        execute_process(COMMAND ${_qmake_location} -query QT_INSTALL_LIBS
+                        OUTPUT_VARIABLE _qt_install_libs
+                        OUTPUT_STRIP_TRAILING_WHITESPACE)
+      endif()
+      file(TO_CMAKE_PATH "${_qt_install_libs}" _qt_install_libs)
+      set(_qt_install_libs ${_qt_install_libs} CACHE INTERNAL "Qt library installation prefix" FORCE)
+    endif()
+    if(_qt_install_libs)
+      list(APPEND _dir_candidates ${_qt_install_libs})
+    endif()
+  elseif(MITK_USE_QT)
+    message(WARNING "The qmake executable could not be found.")
+  endif()

   get_property(_additional_paths GLOBAL PROPERTY MITK_ADDITIONAL_LIBRARY_SEARCH_PATHS)
   if(_additional_paths)


updated STIR and SIRF version tags

updated STIR and SIRF version tags

Using an explicit SIRF hash for now. will have to change once tagged

--- version_config.cmake
+++ version_config.cmake
@@ -86,11 +86,11 @@
   set(DEFAULT_ISMRMRD_TAG master)

 else()
-  set(DEFAULT_SIRF_TAG v0.9.0)
+  set(DEFAULT_SIRF_TAG 359fca23b26a37821ba1961b87480f41efd6eda8)

   ## STIR
-  set(DEFAULT_STIR_URL https://github.com/CCPPETMR/STIR )
-  set(DEFAULT_STIR_TAG 8bf37d9d7fdde7cb3a98a6f848d93827dbd98a18)
+  set(DEFAULT_STIR_URL https://github.com/UCL/STIR )
+  set(DEFAULT_STIR_TAG 41651b3a2007c58cbf1f7706bb2e269a21e870b1)

   ## Gadgetron
   set(DEFAULT_Gadgetron_URL https://github.com/CCPPETMR/gadgetron )


update SIRF TAG

update SIRF TAG

--- version_config.cmake
+++ version_config.cmake
@@ -187,7 +187,7 @@
   set(DEFAULT_CCPi-Astra_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG v2.1.0-rc.3)
+  set(DEFAULT_SIRF_TAG v2.1.0)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )


Mark the cmake cache variables for experimental as advanced

--- cmake/modules/FindPhonon.cmake
+++ cmake/modules/FindPhonon.cmake
@@ -100,5 +100,11 @@
    endif(PHONON_FOUND)

-   mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY PHONON_INCLUDES)
+   mark_as_advanced(
+        PHONON_INCLUDE_DIR
+        PHONON_INCLUDE_DIR_EXPERIMENTAL
+        PHONON_LIBRARY
+        PHONON_LIBRARY_EXPERIMENTAL
+        PHONON_INCLUDES
+   )
 endif(PHONON_FOUND)


Better FindXROOTD.cmake to cope with different versions

--- cmake/modules/FindXROOTD.cmake
+++ cmake/modules/FindXROOTD.cmake
@@ -83,13 +83,20 @@
       list(APPEND XROOTD_LIBRARIES ${XROOTD_XrdNetUtil_LIBRARY})
     endif ()
   else()
-    foreach(l XrdMain XrdUtils XrdClient XrdCl)
+    foreach(l XrdMain XrdUtils XrdClient)
       find_library(XROOTD_${l}_LIBRARY
          NAMES ${l}
          HINTS ${searchpath}
          PATH_SUFFIXES lib)
       list(APPEND XROOTD_LIBRARIES ${XROOTD_${l}_LIBRARY})
     endforeach()
+    if(${xrdversnum} GREATER 300030000)
+      find_library(XROOTD_XrdCl_LIBRARY
+         NAMES XrdCl
+         HINTS ${searchpath}
+         PATH_SUFFIXES lib)
+      list(APPEND XROOTD_LIBRARIES ${XROOTD_XrdCl_LIBRARY})
+    endif()
   endif()

   if(XROOTD_LIBRARIES)
@@ -107,7 +114,8 @@
                  XROOTD_XrdMain_LIBRARY
                  XROOTD_XrdUtils_LIBRARY
                  XROOTD_XrdClient_LIBRARY
-                 XROOTD_XrdNetUtils_LIBRARY
+                 XROOTD_XrdCl_LIBRARY
+                 XROOTD_XrdNetUtil_LIBRARY
                  XROOTD_XrdNet_LIBRARY
                  XROOTD_XrdSys_LIBRARY
                  XROOTD_XrdOuc_LIBRARY


CMake: Also print GMSH_EXE in detailed.log

--- cmake/setup_write_config.cmake
+++ cmake/setup_write_config.cmake
@@ -230,7 +230,7 @@
     # Print the feature configuration:
     #
     FOREACH(_var2
-      C_COMPILER CXX_COMPILER Fortran_COMPILER
+      C_COMPILER CXX_COMPILER Fortran_COMPILER EXE
       ${DEAL_II_STRING_SUFFIXES} ${DEAL_II_LIST_SUFFIXES}
       )
       IF(DEFINED ${_feature}_${_var2})


add all certtest cases to the test file

add all certtest cases to the test file

--- ctest/CTestTestfile.cmake
+++ ctest/CTestTestfile.cmake
@@ -1,6 +1,26 @@
-
 add_test(Test01 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test01 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
-#set_tests_properties(Test01 PROPERTIES ENVIRONMENT "CTEST_OUTPUT_ON_FAILURE=1" TIMEOUT 1000 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" LABELS "regression")
-#add_test(Test02 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test02 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
-#add_test(Test03 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test03 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
-#add_test(Test04 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test04 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test02 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test02 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test03 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test03 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test04 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test04 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test05 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test05 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test06 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test06 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test07 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test07 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test08 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test08 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test09 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test09 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test10 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test10 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test11 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test11 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test12 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test12 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test13 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test13 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test14 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test14 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test15 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test15 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test16 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test16 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test17 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test17 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test18 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test18 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test19 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test19 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test20 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test20 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test21 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test21 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test22 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test22 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test23 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test23 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test24 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test24 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test25 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test25 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+add_test(Test26 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test26 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)


[UPD] FindMatlab.cmake: possibility to force the compilation of MEX functions in 32-bit mode under MacOS X to release the library for the Matlab Mac student version (32-bit mode only).

git-svn-id: ed06c97986a68fa016311908f99ed1538fbb9b5d@1639 93be6e1e-6fcc-11de-baec-69240fdc299a

--- CMake/FindMatlab.cmake
+++ CMake/FindMatlab.cmake
@@ -131,15 +131,26 @@
           SET(MATLAB_MEXFILE_EXT mexmaci)
         ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES ppc)
     ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
-      IF(EXISTS "${MATLAB_ROOT}/bin/maci64/")
-        SET(MATLAB_LIBRARIES_PATHS "${MATLAB_ROOT}/bin/maci64")
-        SET(MATLAB_MEXFILE_EXT mexmaci64)
-      ELSE(EXISTS "${MATLAB_ROOT}/bin/maci64/")
-        MESSAGE("You use a Matlab 32 bits version on a 64 bits OS. BTK will be compiled in 32 bits to be useable with your Matlab version.")
+      # To force the compilation in 32-bit
+      IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+        MESSAGE("The compilation of the Matlab MEX functions is forced to 32-bit mode as the architecture is set to i386.")
+        SET(FORCE_COMPILE_32BIT_MODE 1)
+      ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+        IF(EXISTS "${MATLAB_ROOT}/bin/maci64/")
+          SET(MATLAB_LIBRARIES_PATHS "${MATLAB_ROOT}/bin/maci64")
+          SET(MATLAB_MEXFILE_EXT mexmaci64)
+          SET(FORCE_COMPILE_32BIT_MODE 0)
+        ELSE(EXISTS "${MATLAB_ROOT}/bin/maci64/")
+          MESSAGE("You use a Matlab 32-bit version on a 64-bit OS. BTK will be compiled in 32-bit to be useable with your Matlab version.")
+          SET(FORCE_COMPILE_32BIT_MODE 1)
+        ENDIF(EXISTS "${MATLAB_ROOT}/bin/maci64/")
+      ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+      IF(FORCE_COMPILE_32BIT_MODE)
         SET(MATLAB_LIBRARIES_PATHS "${MATLAB_ROOT}/bin/maci")
         SET(MATLAB_MEXFILE_EXT mexmaci)
-        SET(CMAKE_CXX_FLAGS "-m32" CACHE STRING "Flags used by the compiler during all build types." FORCE)
-      ENDIF(EXISTS "${MATLAB_ROOT}/bin/maci64/")
+        SET(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -m32" CACHE STRING "Flags used by the compiler during all build types." FORCE)
+        SET(CMAKE_C_FLAGS "-O3 -DNDEBUG -m32" CACHE STRING "Flags used by the compiler during all build types." FORCE)
+      ENDIF(FORCE_COMPILE_32BIT_MODE)
     ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)

     SET(LIBMEX "libmex.dylib")


[FIX] Resolve issue 18: Octave not found even though it is installed (linux).

git-svn-id: ed06c97986a68fa016311908f99ed1538fbb9b5d@778 93be6e1e-6fcc-11de-baec-69240fdc299a

--- CMake/FindOctave.cmake
+++ CMake/FindOctave.cmake
@@ -38,7 +38,6 @@
   SET(LIBOCTAVE "liboctave")
   SET(LIBCRUFT "libcruft")
 ELSE(WIN32)
-  # MEX files extension
   IF(APPLE)
     FILE(GLOB OCTAVE_PATHS "/Applications/Octave*")
     FIND_PATH(OCTAVE_ROOT "Contents/Resources/bin/octave" ${OCTAVE_PATHS})
@@ -50,7 +49,6 @@
     SET(LIBOCTAVE "liboctave.dylib")
     SET(LIBCRUFT "libcruft.dylib")
   ELSE(APPLE)
-    SET(OCTAVE_ROOT "")
     FILE(GLOB OCTAVE_LOCAL_PATHS "/usr/local/lib/octave-*")
     FILE(GLOB OCTAVE_USR_PATHS "/usr/lib/octave-*")

@@ -123,7 +121,13 @@
 ENDMACRO(OCTAVE_MEX_CREATE)

 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Octave DEFAULT_MSG OCTAVE_ROOT OCTAVE_INCLUDE_DIR OCTAVE_OCTINTERP_LIBRARY OCTAVE_OCTAVE_LIBRARY OCTAVE_CRUFT_LIBRARY)
+
+# The variable OCTAVE_ROOT is only relevant for WIN32
+IF(WIN32)
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Octave DEFAULT_MSG OCTAVE_ROOT OCTAVE_INCLUDE_DIR OCTAVE_OCTINTERP_LIBRARY OCTAVE_OCTAVE_LIBRARY OCTAVE_CRUFT_LIBRARY)
+ELSE(WIN32)
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Octave DEFAULT_MSG OCTAVE_INCLUDE_DIR OCTAVE_OCTINTERP_LIBRARY OCTAVE_OCTAVE_LIBRARY OCTAVE_CRUFT_LIBRARY)
+ENDIF(WIN32)

 MARK_AS_ADVANCED(
   OCTAVE_OCTINTERP_LIBRARY


Remove discovery of WinDDK setupapi library since it is not used and might not always be installed.

--- CMake/FindWinDDK.cmake
+++ CMake/FindWinDDK.cmake
@@ -10,9 +10,8 @@
 #

 IF (NOT DEFINED WINDDK_FOUND)
-
 	# If WINDDK_DIR was defined in the environment, use it.
-	IF (NOT DEFINED WINDDK_DIR AND NOT $ENV{WINDDK_DIR} STREQUAL "")
+	IF (NOT DEFINED WINDDK_DIR AND NOT "$ENV{WINDDK_DIR}" STREQUAL "")
 		SET(WINDDK_DIR $ENV{WINDDK_DIR})
 	ENDIF()

@@ -57,10 +56,8 @@
 SET(WINDDK_LIBRARY_SEARCH_DIRS "${WINDDK_DIR}/lib/win7/i386")
 FIND_LIBRARY(WINDDK_HID_LIBRARY hid.lib
   	PATHS ${WINDDK_LIBRARY_SEARCH_DIRS})
-FIND_LIBRARY(WINDDK_SETUPAPI_LIBRARY setupapi
-  	PATHS ${WINDDK_LIBRARY_SEARCH_DIRS})
-SET(WINDDK_WIN7_X86_LIBS "${WINDDK_HID_LIBRARY}" "${WINDDK_SETUPAPI_LIBRARY}"
-	CACHE STRING "MS WinDDK Win7-x86 libraries")
+SET(WINDDK_WIN7_X86_LIBS "${WINDDK_HID_LIBRARY}"
+	CACHE STRING "MS WinDDK Win7-x86 libraries" FORCE)
 UNSET(WINDDK_LIBRARY_SEARCH_DIRS CACHE)
 UNSET(WINDDK_HID_LIBRARY CACHE)
 UNSET(WINDDK_SETUPAPI_LIBRARY CACHE)
@@ -70,10 +67,8 @@
 SET(WINDDK_LIBRARY_SEARCH_DIRS "${WINDDK_DIR}/lib/win7/amd64")
 FIND_LIBRARY(WINDDK_HID_LIBRARY hid.lib
   	PATHS ${WINDDK_LIBRARY_SEARCH_DIRS})
-FIND_LIBRARY(WINDDK_SETUPAPI_LIBRARY setupapi
-  	PATHS ${WINDDK_LIBRARY_SEARCH_DIRS})
-SET(WINDDK_WIN7_X64_LIBS "${WINDDK_HID_LIBRARY}" "${WINDDK_SETUPAPI_LIBRARY}"
-	CACHE STRING "MS WinDDK Win7-x64 libraries")
+SET(WINDDK_WIN7_X64_LIBS "${WINDDK_HID_LIBRARY}"
+	CACHE STRING "MS WinDDK Win7-x64 libraries" FORCE)
 UNSET(WINDDK_LIBRARY_SEARCH_DIRS CACHE)
 UNSET(WINDDK_HID_LIBRARY CACHE)
 UNSET(WINDDK_SETUPAPI_LIBRARY CACHE)
@@ -83,10 +78,8 @@
 SET(WINDDK_LIBRARY_SEARCH_DIRS "${WINDDK_DIR}/lib/wxp/i386")
 FIND_LIBRARY(WINDDK_HID_LIBRARY hid.lib
   	PATHS ${WINDDK_LIBRARY_SEARCH_DIRS})
-FIND_LIBRARY(WINDDK_SETUPAPI_LIBRARY setupapi
-  	PATHS ${WINDDK_LIBRARY_SEARCH_DIRS})
-SET(WINDDK_WINXP_X64_LIBS "${WINDDK_HID_LIBRARY}" "${WINDDK_SETUPAPI_LIBRARY}"
-	CACHE STRING "MS WinDDK WinXP-x86 libraries")
+SET(WINDDK_WINXP_X64_LIBS "${WINDDK_HID_LIBRARY}"
+	CACHE STRING "MS WinDDK WinXP-x86 libraries" FORCE)
 UNSET(WINDDK_LIBRARY_SEARCH_DIRS CACHE)
 UNSET(WINDDK_HID_LIBRARY CACHE)
 UNSET(WINDDK_SETUPAPI_LIBRARY CACHE)


ENH: Set the InsightSoftwareConsortium repo as the remote.

Set the InsightSoftwareConsortium repository fork:
https://github.com/InsightSoftwareConsortium/ITKSplitComponents

as the reference for fetching this remote module instead of:
https://github.com/thewtex/ITKSplitComponents

Change-Id: Ib82fadd2c0328c9e43ee9102ed02774023b4b783

--- Modules/Remote/SplitComponents.remote.cmake
+++ Modules/Remote/SplitComponents.remote.cmake
@@ -4,6 +4,6 @@
 itk::SplitComponentsImageFilter.  This filter generates component images from an
 itk::Image of, for example, itk::Vector, itk::CovariantVector, or
 itk::SymmetricSecondRankTensor. https://hdl.handle.net/10380/3230"
-  GIT_REPOSITORY ${git_protocol}://github.com/thewtex/ITKSplitComponents/
+  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKSplitComponents.git
   GIT_TAG cbdffce3996cb4a1de856bde99cfc4cf7f99cd5b
   )


Updated SpirePM.cmake file.

Updated SpirePM.cmake file.

Now spire is an imported static library.

--- src/CMake/SpirePM.cmake
+++ src/CMake/SpirePM.cmake
@@ -322,8 +322,17 @@
   # This target property is used to place compiled modules where they belong.
   set_target_properties(${name} PROPERTIES SPIRE_MODULE_OUTPUT_DIRECTORY "${_SPM_BASE_OUTPUT_DIR}")

+  # Setup imported library.
+  set(spire_library_name Spire)
+  set(spire_library_target_name SpireCoreLibraryTarget)
+  set(spire_library_path
+    "${_SPM_CORE_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${spire_library_name}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+  add_library(${spire_library_target_name} STATIC IMPORTED GLOBAL)
+  add_dependencies(${spire_library_target_name} ${name})
+  set_property(TARGET ${spire_library_target_name} PROPERTY IMPORTED_LOCATION "${spire_library_path}")
+
   # Library path for the core module.
-  set(SPIRE_LIBRARIES ${SPIRE_LIBRARIES} Spire PARENT_SCOPE)
+  set(SPIRE_LIBRARIES ${SPIRE_LIBRARIES} "${spire_library_target_name}" PARENT_SCOPE)
   set(SPIRE_LIBRARY_DIRS ${SPIRE_LIBRARY_DIRS} "${_SPM_CORE_OUTPUT_DIR}" PARENT_SCOPE)

   # Retrieving properties from external projects will retrieve their fully
@@ -340,7 +349,7 @@

   Spire_BuildCoreThirdPartyIncludes(spire_third_party_dirs ${SOURCE_DIR})
   set(SPIRE_3RDPARTY_INCLUDE_DIRS ${spire_third_party_dirs})
-  set(SPIRE_3RDPARTY_INCLUDE_DIRS ${SPIRE_3RDPARTY_INCLUDE_DIRS} PARENT_SCOPE)
+  set(SPIRE_3RDPARTY_INCLUDE_DIRS "${SPIRE_3RDPARTY_INCLUDE_DIRS}" PARENT_SCOPE)

   # Also set a target property containing all of the includes needed for the
   # core spire library. This is used by modules in order.
@@ -470,8 +479,17 @@
   # for our module has been placed in the appropriate location and we can
   # lookup the results using SpireExt/{target_name}.

+  # Setup imported library.
+  set(spire_library_name ${MODULE_STATIC_LIB_NAME})
+  set(spire_library_target_name ${MODULE_STATIC_LIB_NAME})
+  set(spire_library_path
+    "${MODULE_BIN_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${spire_library_name}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+  add_library(${spire_library_target_name} STATIC IMPORTED GLOBAL)
+  add_dependencies(${spire_library_target_name} ${target_name})
+  set_property(TARGET ${spire_library_target_name} PROPERTY IMPORTED_LOCATION "${spire_library_path}")
+
   # Ensure this module can be found during the linking process.
-  set(SPIRE_LIBRARIES ${SPIRE_LIBRARIES} ${MODULE_STATIC_LIB_NAME} PARENT_SCOPE)
+  set(SPIRE_LIBRARIES ${SPIRE_LIBRARIES} "${MODULE_STATIC_LIB_NAME}" PARENT_SCOPE)
   set(SPIRE_LIBRARY_DIRS ${SPIRE_LIBRARY_DIRS} "${MODULE_BIN_OUTPUT_DIR}" PARENT_SCOPE)

   # We do depend on the spire source being available before we compile our,


fixing issues with project name and dependencies detection

--- dist/WkBuild.cmake
+++ dist/WkBuild.cmake
@@ -36,12 +36,9 @@
 include ( CMake/WkCompilerSetup.cmake )

 macro(WKProject project_name_arg)
-	#stores the name of the project in the cache scope, to be used in others WkMacro calls.
-	#for safety reasons, cannot be changed interactively.
-	set(PROJECT_NAME ${project_name_arg} CACHE STRING "The name of the project and the main target alltogether" FORCE )
-	mark_as_advanced(PROJECT_NAME)
-	project(${PROJECT_NAME} ${ARGN})
+	project(${project_name_arg} ${ARGN})
 	WkCompilerSetup( )
+	#TODO : fix problem on recursive project announcements... ( source dependencies for example )
 endmacro(WKProject PROJECT_NAME)

 MACRO(MERGE ALIST BLIST OUTPUT)
@@ -114,10 +111,16 @@
 		endif(CHECK_MEM_LEAKS)
 	endif (CMAKE_BUILD_TYPE STREQUAL Release)

-		#Building dependencies recursively.
-		file(GLOB ${PROJECT_NAME}_source_depends RELATIVE ${PROJECT_SOURCE_DIR} ext/* )
-
-		message ( STATUS " Dependencies detected : ${${PROJECT_NAME}_source_depends}" )
+		#Building dependencies recursively ( not looking into hidden directories (beginning with '.' or '..')
+
+		file(GLOB ${PROJECT_NAME}_sourcedir_depends RELATIVE ${PROJECT_SOURCE_DIR} ext/[^.]* )
+		#to get rid of the ext/ prefix
+		set(${PROJECT_NAME}_source_depends)
+		foreach ( looparg ${${PROJECT_NAME}_sourcedir_depends} )
+			get_filename_component( dependency_project ${looparg} NAME)
+			list( APPEND ${PROJECT_NAME}_source_depends ${dependency_project} )
+		endforeach ( looparg )
+		message ( STATUS "Dependencies detected : ${${PROJECT_NAME}_source_depends}" )

 		if ( ${PROJECT_NAME}_source_depends )
 			set(${PROJECT_NAME}_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
@@ -133,9 +136,7 @@
 			endforeach ( looparg )
 			#MESSAGE ( STATUS "Back to configuring ${PROJECT_NAME} build" )
 			set( BUILD_SHARED_LIBS ${${PROJECT_NAME}_BUILD_SHARED_LIBS} )
-		endif ( ${PROJECT_NAME}_source_depends )
-#	ENDIF(${project_type} STREQUAL "EXECUTABLE")
-
+		endif ( ${PROJECT_NAME}_source_depends )

 	#Defining target

@@ -149,14 +150,10 @@
 	#	-source for the unmodified ones,
 	#	-and in source/src for internal ones)
 	INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/CMake ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src)
-
-   #Including dependencies' headers
-   #
-        #IF ( ${ARGC} GREATER 2 )
-    #            FOREACH ( looparg ${ARGN} )
-    #                    INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ext/${looparg}/include)
-    #            ENDFOREACH ( looparg )
-    #    ENDIF ( ${ARGC} GREATER 2  )
+	foreach ( looparg ${${PROJECT_NAME}_source_depends} )
+		include_directories( ext/${looparg}_build/include )
+		message ( "include_directories( ext/${looparg}_build/include ) " )
+	endforeach ( looparg)

 	#TODO : find a simpler way than this complex merge...
 	MERGE("${HEADERS}" "${SOURCES}" SOURCES)
@@ -183,9 +180,11 @@
 	#

 	IF ( ${PROJECT_NAME}_source_depends )
-		FOREACH ( looparg ${project_source_depends} )
+		FOREACH ( looparg ${${PROJECT_NAME}_source_depends} )
 			IF(${project_type} STREQUAL "LIBRARY")
 				# CMake doesnt support convenience lib right now
+				TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${looparg})
+				ADD_DEPENDENCIES(${PROJECT_NAME} ${looparg})
 			ENDIF(${project_type} STREQUAL "LIBRARY")
 			IF(${project_type} STREQUAL "EXECUTABLE")
 				TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${looparg})


Update FW - adding the RGB scaling factor for the RGB-depth center alignment

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "e42bf9d072c4f97f8c75d9ef8779e9dff919ee72")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "823893894f2ee5d5bc4d1ebf6bb920a58fa1e231")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Adsk Contrib - Fix a bug with the Vc++ compilation flags. (#1419)

Signed-off-by: Patrick Hodoul <2019e9a13f1419b080c92fd66770378d8ba52d2b@autodesk.com>

--- share/cmake/utils/CompilerFlags.cmake
+++ share/cmake/utils/CompilerFlags.cmake
@@ -22,10 +22,12 @@
         )
     endif()

+    # Explicitely specify the default warning level i.e. /W3.
+    # Note: Do not use /Wall (i.e. /W4) which adds 'informational' warnings.
+    set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} /W3")
+
     if(OCIO_WARNING_AS_ERROR)
         set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} /WX")
-    else()
-        set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} /Wall")
     endif()

 elseif(USE_CLANG)


Remove nested parenthesis, not supported on CMake 2.6 (only 2.8)

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


Refactored the catch-specific stuff out of add_test_internal

--- src/cmake/testing.cmake
+++ src/cmake/testing.cmake
@@ -5,8 +5,10 @@
     set(oneValueArgs
         TEST_TARGET
         TEST_NAME
+        REPORT_FILE
     )
     set(multiValueArgs
+        TEST_ARGS
         SOURCES
         INCLUDE_DIRS
         TAGS
@@ -32,37 +34,47 @@
             fakeit
     )

-    set(REPORT_FILE "${arg_TEST_NAME}.xml")
     add_test(
         NAME ${arg_TEST_NAME}
-        COMMAND ${arg_TEST_NAME} --reporter junit --out ${REPORT_FILE}
+        COMMAND ${arg_TEST_NAME} ${arg_TEST_ARGS}
     )
     set_tests_properties(${arg_TEST_NAME} PROPERTIES LABELS ${arg_TAGS})

     get_target_property(OUT_DIR ${arg_TEST_NAME} BINARY_DIR)
     install(
-        FILES "${OUT_DIR}/${REPORT_FILE}"
+        FILES "${OUT_DIR}/${arg_REPORT_FILE}"
         DESTINATION ./reports
         OPTIONAL
     )

     message("- Test '${arg_TEST_NAME}' setup for target '${arg_TEST_TARGET}'.\n
-    \tTarget found at: \"${OUT_DIR}\".\n \
-    \tReport found at: \"${OUT_DIR}/${REPORT_FILE}\"\n
-    \tTags: \"${arg_TAGS}\".\n"
+    \tTarget found at: \"${OUT_DIR}\"\n \
+    \tReport found at: \"${OUT_DIR}/${arg_REPORT_FILE}\n \
+    \tTags: \"${arg_TAGS}\"\n"
     )

 endfunction()

+function(add_catch_test)
+    set(oneValueArgs
+        TEST_NAME
+    )
+    cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+    add_test_internal( ${ARGV}
+        TEST_ARGS --reporter junit --out "${arg_TEST_NAME}.xml"
+        REPORT_FILE "${arg_TEST_NAME}.xml"
+    )
+endfunction()

 function(add_unit_test)
-    add_test_internal(${ARGV} TAGS "unit")
+    add_catch_test(${ARGV} TAGS "unit")
 endfunction()

 function(add_integration_test)
-    add_test_internal(${ARGV} TAGS "integration")
+    add_catch_test(${ARGV} TAGS "integration")
 endfunction()

 function(add_performance_test)
-    add_test_internal(${ARGV} TAGS "performance")
+    add_catch_test(${ARGV} TAGS "performance")
 endfunction()


CMake: fixed minor bug: when a _ROOT_DIR variable was set by the user after having run CMake once, it was not taken into account (because of CMake cache persistency).

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -465,8 +465,8 @@
   ELSE()
      SET(_var_already_there FALSE)
   ENDIF()
-  #   Make cache entry
-  SET(${pkg_UC}_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory")
+  #   Make cache entry, giving precedence to the env variable
+  SET(${pkg_UC}_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory" FORCE)

   ##
   ## 2. Find package - try CONFIG mode first (i.e. looking for XYZ-config.cmake)


Fix problem with the PY compiling.

Fix problem with the PY compiling.

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -111,14 +111,12 @@
   ENDIF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS)
   FOREACH(file ${file_list})
     SET(PREFIX "")
-    IF(IS_ABSOLUTE ${file})
-      GET_FILENAME_COMPONENT(file_name ${file} NAME)
-    ELSE()
-      SET(file_name ${file})
+    GET_FILENAME_COMPONENT(file_name ${file} NAME)
+    IF(NOT IS_ABSOLUTE ${file})
       IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY)
-	SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/")
+	    SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/")
       ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY)
-    ENDIF(IS_ABSOLUTE ${file})
+    ENDIF(NOT IS_ABSOLUTE ${file})
     INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS})
     GET_FILENAME_COMPONENT(ext ${file} EXT)
     IF(ext STREQUAL .py)


[CMake] Add missing Python packages to build scripts (#6145)

* [CMake] Add tensorflow.python.ops.losses.*

Fixes Windows PIP tests.

* [CMake] Add `tf.contrib.compiler` Python package

* Add `tf.contrib.input_pipeline`.

* Add `tf.contrib.legacy_seq2seq`

--- tensorflow/contrib/cmake/tf_python.cmake
+++ tensorflow/contrib/cmake/tf_python.cmake
@@ -188,6 +188,7 @@
 add_python_module("tensorflow/python/lib/core")
 add_python_module("tensorflow/python/lib/io")
 add_python_module("tensorflow/python/ops")
+add_python_module("tensorflow/python/ops/losses")
 add_python_module("tensorflow/python/platform")
 add_python_module("tensorflow/python/platform/default")
 add_python_module("tensorflow/python/platform/summary")
@@ -220,6 +221,7 @@
 add_python_module("tensorflow/contrib/bayesflow/python")
 add_python_module("tensorflow/contrib/bayesflow/python/kernel_tests")
 add_python_module("tensorflow/contrib/bayesflow/python/ops")
+add_python_module("tensorflow/contrib/compiler")
 add_python_module("tensorflow/contrib/copy_graph")
 add_python_module("tensorflow/contrib/copy_graph/python")
 add_python_module("tensorflow/contrib/copy_graph/python/util")
@@ -261,6 +263,9 @@
 add_python_module("tensorflow/contrib/grid_rnn/python")
 add_python_module("tensorflow/contrib/grid_rnn/python/kernel_tests")
 add_python_module("tensorflow/contrib/grid_rnn/python/ops")
+add_python_module("tensorflow/contrib/input_pipeline")
+add_python_module("tensorflow/contrib/input_pipeline/python")
+add_python_module("tensorflow/contrib/input_pipeline/python/ops")
 add_python_module("tensorflow/contrib/integrate")
 add_python_module("tensorflow/contrib/integrate/python")
 add_python_module("tensorflow/contrib/integrate/python/ops")
@@ -301,6 +306,7 @@
 add_python_module("tensorflow/contrib/learn/python/learn/tests")
 add_python_module("tensorflow/contrib/learn/python/learn/tests/dataframe")
 add_python_module("tensorflow/contrib/learn/python/learn/utils")
+add_python_module("tensorflow/contrib/legacy_seq2seq")
 add_python_module("tensorflow/contrib/linalg")
 add_python_module("tensorflow/contrib/linalg/python")
 add_python_module("tensorflow/contrib/linalg/python/ops")


knet -DLINUX -> -DUNIX

knet -DLINUX -> -DUNIX

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -150,9 +150,9 @@
 macro (configure_ogre)
     if ("$ENV{OGRE_HOME}" STREQUAL "" OR NOT WIN32)
         if (APPLE)
-    	FIND_LIBRARY(OGRE_LIBRARY NAMES Ogre)
-    	set (OGRE_INCLUDE_DIRS ${OGRE_LIBRARY}/Headers)
-    	set (OGRE_LIBRARIES ${OGRE_LIBRARY})
+    	  FIND_LIBRARY(OGRE_LIBRARY NAMES Ogre)
+    	  set (OGRE_INCLUDE_DIRS ${OGRE_LIBRARY}/Headers)
+    	  set (OGRE_LIBRARIES ${OGRE_LIBRARY})
         else ()
             sagase_configure_package (OGRE
             NAMES Ogre OgreSDK ogre OGRE
@@ -446,7 +446,7 @@
     include_directories(${KNET_DIR}/include)
     link_directories(${KNET_DIR}/lib)
     if (UNIX)
-        add_definitions(-DLINUX)
+        add_definitions(-DUNIX)
     endif()
     add_definitions(-DKNET_USE_BOOST)
 endmacro()


Reverted accidental custom config.

Reverted accidental custom config.

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -390,7 +390,6 @@

 macro(use_package_knet)
     set(KNET_DIR ${ENV_NAALI_DEP_PATH}/kNet)
-    set(KNET_DIR C:/Projects/kNet)
     include_directories(${KNET_DIR}/include)
     link_directories(${KNET_DIR}/lib)
 endmacro()


Android: add missing ANDROID_GET_ABI_RAWNAME macro from OpenCV

--- os/android.toolchain.cmake
+++ os/android.toolchain.cmake
@@ -1580,6 +1580,19 @@
  set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
 endmacro()

+macro( ANDROID_GET_ABI_RAWNAME TOOLCHAIN_FLAG VAR )
+ if( "${TOOLCHAIN_FLAG}" STREQUAL "ARMEABI" )
+  set( ${VAR} "armeabi" )
+ elseif( "${TOOLCHAIN_FLAG}" STREQUAL "ARMEABI_V7A" )
+  set( ${VAR} "armeabi-v7a" )
+ elseif( "${TOOLCHAIN_FLAG}" STREQUAL "X86" )
+  set( ${VAR} "x86" )
+ elseif( "${TOOLCHAIN_FLAG}" STREQUAL "MIPS" )
+  set( ${VAR} "mips" )
+ else()
+  set( ${VAR} "unknown" )
+ endif()
+endmacro()

 # export toolchain settings for the try_compile() command
 if( NOT _CMAKE_IN_TRY_COMPILE )


s,message(STATUS,polly_status_print,

--- find/FindLibcxx.cmake
+++ find/FindLibcxx.cmake
@@ -14,6 +14,7 @@
 endif()

 include(polly_fatal_error)
+include(polly_status_print)

 if(NOT LIBCXX_ROOT)
   polly_fatal_error(
@@ -25,7 +26,7 @@
   return()
 endif()

-message(STATUS "Libcxx root: ${LIBCXX_ROOT}")
+polly_status_print("Libcxx root: ${LIBCXX_ROOT}")

 set(
     Libcxx_INCLUDE_DIRS
@@ -34,10 +35,10 @@

 set(_find_libcxx_save_find_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
 if(Libcxx_USE_STATIC_LIBS)
-  message(STATUS "Libcxx static libraries: ON")
+  polly_status_print("Libcxx static libraries: ON")
   set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
 else()
-  message(STATUS "Libcxx static libraries: OFF")
+  polly_status_print("Libcxx static libraries: OFF")
   set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
 endif()

@@ -46,7 +47,7 @@
 if(CMAKE_DEBUG_POSTFIX)
   set(_find_libcxx_debug_name c++${CMAKE_DEBUG_POSTFIX})
 else()
-  message(WARNING "CMAKE_DEBUG_POSTFIX is empty, no Debug library variant")
+  polly_status_print("CMAKE_DEBUG_POSTFIX is empty, no Debug library variant")
   set(_find_libcxx_debug_name c++)
 endif()


Android: added filtering of unwanted Android Studio toolchain file flags.

--- toolchains/android-studio.toolchain.cmake
+++ toolchains/android-studio.toolchain.cmake
@@ -21,6 +21,22 @@
 set( TNUN_os_suffix Android )

 set( CMAKE_CROSSCOMPILING true )
+
+# Remove unwanted flags from the official toolchain file
+string( REPLACE "-funwind-tables"          ""    ANDROID_COMPILER_FLAGS         "${ANDROID_COMPILER_FLAGS}" )
+string( REPLACE "-funwind-tables"          ""    CMAKE_C_FLAGS                  "${CMAKE_C_FLAGS}  "        )
+string( REPLACE "-funwind-tables"          ""    CMAKE_CXX_FLAGS                "${CMAKE_CXX_FLAGS}"        )
+string( REPLACE "-funwind-tables"          ""    CMAKE_ASM_FLAGS                "${CMAKE_ASM_FLAGS}"        )
+
+string( REPLACE "-fstack-protector-strong" ""    ANDROID_COMPILER_FLAGS         "${ANDROID_COMPILER_FLAGS}" )
+string( REPLACE "-fstack-protector-strong" ""    CMAKE_C_FLAGS                  "${CMAKE_C_FLAGS}  "        )
+string( REPLACE "-fstack-protector-strong" ""    CMAKE_CXX_FLAGS                "${CMAKE_CXX_FLAGS}"        )
+string( REPLACE "-fstack-protector-strong" ""    CMAKE_ASM_FLAGS                "${CMAKE_ASM_FLAGS}"        )
+
+string( REPLACE "-O2"                      "-O3" ANDROID_COMPILER_FLAGS_RELEASE "${ANDROID_COMPILER_FLAGS_RELEASE}" )
+string( REPLACE "-O2"                      "-O3" CMAKE_C_FLAGS_RELEASE          "${CMAKE_C_FLAGS_RELEASE}  "        )
+string( REPLACE "-O2"                      "-O3" CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE}"        )
+string( REPLACE "-O2"                      "-O3" CMAKE_ASM_FLAGS_RELEASE        "${CMAKE_ASM_FLAGS_RELEASE}"        )

 if("${ANDROID_TOOLCHAIN}" STREQUAL "clang")
     include( "${CMAKE_CURRENT_LIST_DIR}/clang.cmake" )


BUG: Fixing issue with STREQUAL

BUG: Fixing issue with STREQUAL

--- Utilities/KWStyle/KWStyle.cmake
+++ Utilities/KWStyle/KWStyle.cmake
@@ -46,7 +46,7 @@
   ELSE(KWSTYLE_LONG_VERSION LESS KWSTYLE_REQ_VERSION)
     SET(KWSTYLE_FOUND 1)
   ENDIF(KWSTYLE_LONG_VERSION LESS KWSTYLE_REQ_VERSION)
-ENDIF(${KWSTYLE_VERSION_TEXT} STREQUAL "Version: Not defined")
+ENDIF(KWSTYLE_VERSION_TEXT STREQUAL "Version: Not defined")

 IF(KWSTYLE_FOUND)
 #


pass unparsed argument of ament_auto_package() to ament_package() (#194)

Signed-off-by: Dirk Thomas <19795c8185177e940eedd30ceb2b716a54a3d5dc@users.noreply.github.com>


Working coverage for plugins

Working coverage for plugins

--- tests/PythonTests.cmake
+++ tests/PythonTests.cmake
@@ -34,27 +34,27 @@

   if(fn_PLUGIN)
     set(name "server_${fn_PLUGIN}.${case}")
-    set(cwd "${PROJECT_SOURCE_DIR}/plugins/${fn_PLUGIN}")
     set(module plugin_tests.${case}_test)
-    set(pythonpath "${PROJECT_SOURCE_DIR}")
+    set(pythonpath "${PROJECT_SOURCE_DIR}/plugins/${fn_PLUGIN}")
+    set(other_covg ",${PROJECT_SOURCE_DIR}/plugins/${fn_PLUGIN}/server")
   else()
-    set(cwd "${PROJECT_SOURCE_DIR}")
     set(module tests.cases.${case}_test)
     set(pythonpath "")
+    set(other_covg "")
   endif()

   if(PYTHON_COVERAGE)
     add_test(
       NAME ${name}
-      WORKING_DIRECTORY ${cwd}
+      WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
       COMMAND "${PYTHON_COVERAGE_EXECUTABLE}" run -p --append "--rcfile=${py_coverage_rc}"
-              --source=girder -m unittest -v ${module}
+              "--source=girder${other_covg}" -m unittest -v ${module}
     )
   else()
     add_test(
       NAME ${name}
-      WORKING_DIRECTORY ${cwd}
+      WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
       COMMAND "${PYTHON_EXECUTABLE}" -m unittest -v ${module}
     )
   endif()


STYLE: SlicerExecutionModel: remove unneeded option

[ci skip]

--- CMakeExternals/SlicerExecutionModel.cmake
+++ CMakeExternals/SlicerExecutionModel.cmake
@@ -46,8 +46,6 @@
       -DSlicerExecutionModel_LIBRARY_PROPERTIES:STRING=${DCMQI_LIBRARY_PROPERTIES}
       -DSlicerExecutionModel_INSTALL_BIN_DIR:PATH=${DCMQI_INSTALL_BIN_DIR}
       -DSlicerExecutionModel_INSTALL_LIB_DIR:PATH=${DCMQI_INSTALL_LIB_DIR}
-      #-DSlicerExecutionModel_INSTALL_SHARE_DIR:PATH=${Slicer_INSTALL_ROOT}share/${SlicerExecutionModel}
-      -DSlicerExecutionModel_INSTALL_NO_DEVELOPMENT:BOOL=${Slicer_INSTALL_NO_DEVELOPMENT}
       -DSlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${PROJECT_NAME_LC}-build/${DCMQI_INSTALL_BIN_DIR}
       -DSlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${PROJECT_NAME_LC}-build/${DCMQI_INSTALL_BIN_DIR}
       -DSlicerExecutionModel_DEFAULT_CLI_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${PROJECT_NAME_LC}-build/${DCMQI_INSTALL_LIB_DIR}


[cmake] fix DEF file generation for numerics-test

--- cmake/WindowsLibrarySetup.cmake
+++ cmake/WindowsLibrarySetup.cmake
@@ -16,7 +16,7 @@
         | egrep ' "(D|T|B)" ' | cut -f 3 -d ' ' | sed  's,^_,,' | sed '1iEXPORTS' > ${SHARED_LIB_WE}.def
         ) # gruik gruik
     ELSE()
-      ADD_CUSTOM_COMMAND(TARGET ${COMPONENT}
+      ADD_CUSTOM_COMMAND(TARGET ${TARGET}
         PRE_BUILD
         COMMAND ${CMAKE_NM} ARGS @${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TARGET}.dir/objects1.rsp
         | bash ${CMAKE_SOURCE_DIR}/cmake/export_filter.sh > ${SHARED_LIB_WE}.def


MDEV-13836 mariadb_config & mysql_config output differ

compile C/C with system zlib, when the server uses system zlib

--- cmake/mariadb_connector_c.cmake
+++ cmake/mariadb_connector_c.cmake
@@ -7,10 +7,8 @@
 SET(CONC_WITH_SIGNCODE ${SIGNCODE})
 SET(SIGN_OPTIONS ${SIGNTOOL_PARAMETERS})

-IF(TARGET zlib)
-  GET_PROPERTY(ZLIB_LIBRARY_LOCATION TARGET zlib PROPERTY LOCATION)
-ELSE()
-  SET(ZLIB_LIBRARY_LOCATION ${ZLIB_LIBRARY})
+IF(NOT TARGET zlib)
+  SET(CONC_WITH_EXTERNAL_ZLIB ON)
 ENDIF()

 IF(SSL_DEFINES MATCHES "YASSL")