Fix for ROOT-8293 - CMake does not find Castor libraries

--- cmake/modules/FindCastor.cmake
+++ cmake/modules/FindCastor.cmake
@@ -1,67 +1,44 @@
-# - Try to find CASTOR
-#  (See http://savannah.cern.ch/files/?group=castor)
-#  Check for rfio_api.h, stager_api.h for CASTOR 2 and libshift
-#
+#  Try to find CASTOR
+#  Check for rfio_api.h for CASTOR 2 and libshift
+#  Defines:
 #  CASTOR_INCLUDE_DIR - where to find rfio_api.h, etc.
-#  CASTOR_LIBRARIES   - List of libraries when using ....
-#  CASTOR_FOUND       - True if CASTOR 2  libraries found.
+#  CASTOR_<component>_LIBRARY
+#  CASTOR_<component>_FOUND
+#  CASTOR_LIBRARIES   - List of libraries when using castor (not cached)
+#  CASTOR_VERSION     - Castor version (not cached)
+#  CASTOR_FOUND       - True if CASTOR libraries found.

-set(CASTOR_FOUND FALSE)
-set(CASTOR_LIBRARIES)
+# Enforce a minimal list of libraries
+list(APPEND CASTOR_FIND_COMPONENTS shift rfio common client ns)
+list(REMOVE_DUPLICATES CASTOR_FIND_COMPONENTS)

-if(CASTOR_INCLUDE_DIR)
-  set(CASTOR_FIND_QUIETLY 1)
-endif()
+set(locations ${CASTOR_DIR} $ENV{CASTOR_DIR} /cern/pro /cern/new /cern/old /opt/shift)

-find_path(CASTOR_INCLUDE_DIR NAMES rfio_api.h PATHS
-  ${CASTOR_DIR}/include $ENV{CASTOR_DIR}/include
-  /cern/pro/include
-  /cern/new/include
-  /cern/old/include
-  /opt/shift/include
-  /usr/local/shift/include
-  /usr/include/shift
-  /usr/local/include/shift
-  PATH_SUFFIXES shift
-)
+find_path(CASTOR_INCLUDE_DIR rfio_api.h HINTS ${locations} PATH_SUFFIXES include include/shift)

+# Obtain the version
 if(CASTOR_INCLUDE_DIR)
   file(READ ${CASTOR_INCLUDE_DIR}/patchlevel.h contents)
   string(REGEX MATCH   "BASEVERSION[ ]*[\"][ ]*([^ \"]+)" cont ${contents})
   string(REGEX REPLACE "BASEVERSION[ ]*[\"][ ]*([^ \"]+)" "\\1" CASTOR_VERSION ${cont})
 endif()

-set(locations ${CASTOR_DIR} $ENV{CASTOR_DIR}
-              /cern/pro /cern/new /cern/old
-              /opt/shift /usr/local/shift
-              /usr/lib/shift /usr/local/lib/shift
-)
+# Find all the libraires
+foreach(component ${CASTOR_FIND_COMPONENTS})
+  if(component STREQUAL shift) # libshift.so is the only one without the prefix 'castor'
+    set(name ${component})
+  else()
+    set(name castor${component})
+  endif()
+  find_library(CASTOR_${component}_LIBRARY NAMES ${name} HINTS ${locations} PATH_SUFFIXES lib lib/shift)
+  if (CASTOR_${component}_LIBRARY)
+    set(CASTOR_${component}_FOUND 1)
+    list(APPEND CASTOR_LIBRARIES ${CASTOR_${component}_LIBRARY})
+    mark_as_advanced(CASTOR_${component}_LIBRARY)
+  endif()
+endforeach()

-find_library(CASTOR_shift_LIBRARY NAMES shift shiftmd HINTS ${locations})
-find_library(CASTOR_rfio_LIBRARY NAMES castorrfio HINTS ${locations})
-find_library(CASTOR_common_LIBRARY NAMES castorcommon HINTS ${locations})
-find_library(CASTOR_client_LIBRARY NAMES castorclient castorClient HINTS ${locations})
-find_library(CASTOR_ns_LIBRARY NAMES castorns HINTS ${locations})
-
-if(CASTOR_shift_LIBRARY)
-  message(STATUS "Found Castor LIB AT ${CASTOR_shift_LIBRARY}")
-  set(CASTOR_LIBRARIES ${CASTOR_LIBRARIES} ${CASTOR_shift_LIBRARY})
-endif()
-
-if(CASTOR_INCLUDE_DIR AND CASTOR_LIBRARIES)
-  set(CASTOR_FOUND TRUE)
-  if(NOT CASTOR_FIND_QUIETLY)
-    message(STATUS "Found Castor version ${CASTOR_VERSION} at ${CASTOR_INCLUDE_DIR}")
-  endif()
-endif()
-
-mark_as_advanced(
-  CASTOR_shift_LIBRARY
-  CASTOR_rfio_LIBRARY
-  CASTOR_common_LIBRARY
-  CASTOR_client_LIBRARY
-  CASTOR_ns_LIBRARY
-  CASTOR_INCLUDE_DIR
-)
-
-
+# Handle the QUIETLY and REQUIRED arguments and set CASTOR_FOUND to TRUE if all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CASTOR DEFAULT_MSG CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR)
+mark_as_advanced(CASTOR_INCLUDE_DIR)


[cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

Summary:
To make this build work, I needed to add detection code for the pthread
library. This is necessary, because we have direct calls to these
libraries (instead of going through llvm) and in the standalone build we
cannot rely on llvm to detect these for us. In a standalone non-dylib
build this was accidentaly working because these libraries were pulled
in as an interface dependency of the .a files, but in a dylib build
these are no longer part of the link interface, and so we need to add
them explicitly.

Reviewers: krytarowski, zturner

Subscribers: lldb-commits, mgorny

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

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

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -346,13 +346,17 @@

 endif()

-if (HAVE_LIBPTHREAD)
-  list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
-
-if (HAVE_LIBDL)
-  list(APPEND system_libs ${CMAKE_DL_LIBS})
-endif()
+if( WIN32 AND NOT CYGWIN )
+  set(PURE_WINDOWS 1)
+endif()
+
+if(NOT PURE_WINDOWS)
+  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+  find_package(Threads REQUIRED)
+  list(APPEND system_libs ${CMAKE_THREAD_LIBS_INIT})
+endif()
+
+list(APPEND system_libs ${CMAKE_DL_LIBS})

 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.


Make Qt 5.6.0-alpha available (not a default version)

--- cmake/projects/Qt/hunter.cmake
+++ cmake/projects/Qt/hunter.cmake
@@ -41,6 +41,17 @@
     a54e70921daba9dada49a2f0f05ce49a062d9d86
 )

+hunter_add_version(
+    PACKAGE_NAME
+    Qt
+    VERSION
+    "5.6.0-alpha"
+    URL
+    "http://download.qt.io/development_releases/qt/5.6/5.6.0-alpha/single/qt-everywhere-opensource-src-5.6.0-alpha.7z"
+    SHA1
+    d902b7df94219d2ed2f5c868839c85ce9daa056a
+)
+
 hunter_cacheable(Qt)

 if(NOT APPLE AND NOT WIN32)


I failed badly.

I failed badly.

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

--- deal.II/cmake/checks/check_for_cxx_features.cmake
+++ deal.II/cmake/checks/check_for_cxx_features.cmake
@@ -35,7 +35,7 @@

     IF(DEAL_II_HAVE_CXX11_FLAG)
       # We have found a CXX11_FLAG that the compiler understands
-      SET(DEAL_II_CXX11_FLAG "${test_flag}")
+      SET(DEAL_II_CXX11_FLAG "${test_flag}" CACHE INTERNAL "")
       BREAK()
     ELSE()
       # Remove test result from cache and try the next flag in the list


Adding install rule for the XML DTD Files

--- Resources/CMake/MXAInstall.cmake
+++ Resources/CMake/MXAInstall.cmake
@@ -48,7 +48,7 @@
 CONFIGURE_FILE(${MXA_CMAKE_DIR}/InstallMXASupportLibraries.cmake.in
                 ${PROJECT_BINARY_DIR}/InstallMXASupportLibraries.cmake @ONLY IMMEDIATE)

-SET (MXA_INSTALLED_RESOURCES
+SET (MXA_CMAKE_INSTALLED_RESOURCES
         ${PROJECT_BINARY_DIR}/UseMXADataModel.cmake
         ${PROJECT_BINARY_DIR}/InstallMXASupportLibraries.cmake
         ${MXA_CMAKE_DIR}/ConfigureChecks.cmake
@@ -64,9 +64,20 @@
         ${MXA_CMAKE_DIR}/GenerateVersionString.cpp
 )

-INSTALL (FILES ${MXA_INSTALLED_RESOURCES}
+INSTALL (FILES ${MXA_CMAKE_INSTALLED_RESOURCES}
         DESTINATION share/MXADataModel/Resources/CMake
         COMPONENT Resources)
+
+
+SET (MXA_XML_INSTALLED_RESOURCES
+        ${MXA_RESOURCES_DIR}/XML/ModelTemplate.xml
+        ${MXA_RESOURCES_DIR}/XML/mxa_0.4.dtd
+        ${MXA_RESOURCES_DIR}/XML/mxa_import.dtd
+)
+
+INSTALL (FILES ${MXA_XML_INSTALLED_RESOURCES}
+        DESTINATION doc/MXADataModel/xml
+        COMPONENT Documentation)

 SET (MISC_DOCS
   ${MXADataModel_SOURCE_DIR}/License.txt


CastXML 0.2.1

CastXML 0.2.1

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,7 +1,7 @@
 # CastXML version number components.
 set(CastXML_VERSION_MAJOR 0)
 set(CastXML_VERSION_MINOR 2)
-set(CastXML_VERSION_PATCH 0)
+set(CastXML_VERSION_PATCH 1)
 set(CastXML_VERSION_RC 0)
 set(CastXML_VERSION_IS_DIRTY 0)


configure_qt4 macro: comment out QtDeclarative stuff.

Conflicts:

	cmake/ConfigurePackages.cmake

--- cmake/ConfigurePackages.cmake
+++ cmake/ConfigurePackages.cmake
@@ -68,27 +68,25 @@

 # On Android, pthread library does not exist. Remove it if mistakenly added to boost libraries
 if (ANDROID)
-    list(REMOVE_ITEM Boost_LIBRARIES "pthread")
+    list(REMOVE_ITEM Boost_LIBRARIES "pthread")
 endif()

 endmacro (configure_boost)

-macro (configure_qt4)
+macro(configure_qt4)
     if (NOT ANDROID)
-        sagase_configure_package (QT4
+        sagase_configure_package(QT4
             NAMES Qt4 4.6.1
-            COMPONENTS QtCore QtGui QtWebkit QtScript QtScriptTools QtXml QtNetwork QtUiTools QtDeclarative
-	    PREFIXES ${ENV_QT_DIR} ${ENV_TUNDRA_DEP_PATH})
+            COMPONENTS QtCore QtGui QtWebkit QtScript QtScriptTools QtXml QtNetwork QtUiTools
+        PREFIXES ${ENV_QT_DIR} ${ENV_TUNDRA_DEP_PATH})
     else()
         find_package(Qt4 COMPONENTS QtCore QtGui QtXml QtNetwork QtScript QtUiTools)
     endif()

     # FindQt4.cmake
     if (QT4_FOUND AND QT_USE_FILE)
-
-        include (${QT_USE_FILE})
-
-        set (QT4_INCLUDE_DIRS
+        include(${QT_USE_FILE})
+        set(QT4_INCLUDE_DIRS
             ${QT_INCLUDE_DIR}
             ${QT_QTCORE_INCLUDE_DIR}
             ${QT_QTGUI_INCLUDE_DIR}
@@ -96,20 +94,17 @@
             ${QT_QTNETWORK_INCLUDE_DIR}
             ${QT_QTXML_INCLUDE_DIR}
             ${QT_QTSCRIPT_INCLUDE_DIR}
-            ${QT_DECLARATIVE_INCLUDE_DIR}
             ${QT_QTWEBKIT_INCLUDE_DIR})
-
+#            ${QT_DECLARATIVE_INCLUDE_DIR}
 #            ${QT_QTSCRIPTTOOLS_INCLUDE_DIR}
 #            ${QT_PHONON_INCLUDE_DIR}

-        set (QT4_LIBRARY_DIR
-            ${QT_LIBRARY_DIR})
-
-	if (ANDROID)
-            set (QT4_LIBRARIES
-                ${QT_LIBRARIES})
-        else ()
-            set (QT4_LIBRARIES
+        set(QT4_LIBRARY_DIR ${QT_LIBRARY_DIR})
+
+        if (ANDROID)
+            set(QT4_LIBRARIES ${QT_LIBRARIES})
+        else()
+            set(QT4_LIBRARIES
                 ${QT_LIBRARIES}
                 ${QT_QTCORE_LIBRARY}
                 ${QT_QTGUI_LIBRARY}
@@ -117,18 +112,14 @@
                 ${QT_QTNETWORK_LIBRARY}
                 ${QT_QTXML_LIBRARY}
                 ${QT_QTSCRIPT_LIBRARY}
-                ${QT_DECLARATIVE_LIBRARY}
-                ${QT_QTWEBKIT_LIBRARY})
-
-#            ${QT_QTSCRIPTTOOLS_LIBRARY}
-#            ${QT_PHONON_LIBRARY}
-
-	endif()
-
-    endif ()
-
-    sagase_configure_report (QT4)
-endmacro (configure_qt4)
+                ${QT_QTWEBKIT_LIBRARY})
+#                ${QT_DECLARATIVE_LIBRARY}
+#                ${QT_QTSCRIPTTOOLS_LIBRARY}
+#                ${QT_PHONON_LIBRARY}
+        endif()
+    endif ()
+    sagase_configure_report(QT4)
+endmacro(configure_qt4)

 macro (configure_python)
     sagase_configure_package (PYTHON


Apply a slightly modified patch from talljimbo's bug report in numexpr

--- cmake/FindPythonLibsNew.cmake
+++ cmake/FindPythonLibsNew.cmake
@@ -12,7 +12,11 @@
 #
 #  PYTHON_INCLUDE_PATH        - path to where Python.h is found (deprecated)
 #
-# A function PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is defined to build modules for python.
+# A function PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is defined
+# to build modules for python.
+#
+# Thanks to talljimbo for the patch adding the 'LDVERSION' config
+# variable usage.

 #=============================================================================
 # Copyright 2001-2009 Kitware, Inc.
@@ -66,6 +70,9 @@
 # According to http://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter
 # testing whether sys has the gettotalrefcount function is a reliable, cross-platform
 # way to detect a CPython debug interpreter.
+#
+# The library suffix is from the config var LDVERSION sometimes, otherwise
+# VERSION. VERSION will typically be like "2.7" on unix, and "27" on windows.
 execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
     "from distutils import sysconfig as s;import sys;import struct;
 print('.'.join(str(v) for v in sys.version_info));
@@ -75,6 +82,7 @@
 print(s.get_config_var('SO'));
 print(hasattr(sys, 'gettotalrefcount')+0);
 print(struct.calcsize('@P'));
+print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION'));
 "
     RESULT_VARIABLE _PYTHON_SUCCESS
     OUTPUT_VARIABLE _PYTHON_VALUES
@@ -100,6 +108,7 @@
 list(GET _PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION)
 list(GET _PYTHON_VALUES 5 PYTHON_IS_DEBUG)
 list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P)
+list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX)

 # Make sure the Python has the same pointer-size as the chosen compiler
 # Skip the check on OS X, it doesn't have CMAKE_SIZEOF_VOID_P defined
@@ -133,14 +142,13 @@

 if(CMAKE_HOST_WIN32)
     set(PYTHON_LIBRARY
-        "${PYTHON_PREFIX}/libs/Python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.lib")
+        "${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
 elseif(APPLE)
     # Seems to require "-undefined dynamic_lookup" instead of linking
     # against the .dylib, otherwise it crashes. This flag is added
     # below
-    set(PYTHON_LIBRARY "")
-#    set(PYTHON_LIBRARY
-#        "${PYTHON_PREFIX}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.dylib")
+    set(PYTHON_LIBRARY
+        "${PYTHON_PREFIX}/lib/libpython${PYTHON_LIBRARY_SUFFIX}.dylib")
 else()
     if(${PYTHON_SIZEOF_VOID_P} MATCHES 8)
         set(_PYTHON_LIBS_SEARCH "${PYTHON_PREFIX}/lib64" "${PYTHON_PREFIX}/lib")
@@ -151,8 +159,7 @@
     # Probably this needs to be more involved. It would be nice if the config
     # information the python interpreter itself gave us were more complete.
     find_library(PYTHON_LIBRARY
-        NAMES "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
-            "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}m"
+        NAMES "python${PYTHON_LIBRARY_SUFFIX}"
         PATHS ${_PYTHON_LIBS_SEARCH}
         NO_DEFAULT_PATH)
     message(STATUS "Found Python lib ${PYTHON_LIBRARY}")
@@ -206,14 +213,7 @@

     SET_PROPERTY(GLOBAL  APPEND  PROPERTY  PY_MODULES_LIST ${_NAME})
     ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
-    IF(APPLE)
-      # On OS X, linking against the Python libraries causes
-      # segfaults, so do this dynamic lookup instead.
-      SET_TARGET_PROPERTIES(${_NAME} PROPERTIES LINK_FLAGS
-                          "-undefined dynamic_lookup")
-    ELSE()
-      TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
-    ENDIF()
+    TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})

     IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
       SET_TARGET_PROPERTIES(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")


[CMake] compiler-versions.cmake: bump required clang version up to 3.9

This way, both the gcc (5), and clang (3.9) have full openmp 4.0 support.

--- cmake/compiler-versions.cmake
+++ cmake/compiler-versions.cmake
@@ -1,4 +1,4 @@
-# want C++14 support.
+# want C++14 support, openmp 4.0 support.

 if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
   message(FATAL_ERROR "GNU C compiler version ${CMAKE_C_COMPILER_VERSION} is too old. Need 5.0+")
@@ -8,26 +8,29 @@
   message(FATAL_ERROR "GNU C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is too old. Need 5.0+")
 endif()

-if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 3.5)
-  message(FATAL_ERROR "LLVM Clang C compiler version ${CMAKE_C_COMPILER_VERSION} is too old. Need 3.5+")
+if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 3.9)
+  message(FATAL_ERROR "LLVM Clang C compiler version ${CMAKE_C_COMPILER_VERSION} is too old. Need 3.9+")
 endif()

-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
-  message(FATAL_ERROR "LLVM Clang C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is too old. Need 3.5+")
+if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.9)
+  message(FATAL_ERROR "LLVM Clang C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is too old. Need 3.9+")
 endif()

-# if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
-#   message(WARNING "Support for GNU C compiler version ${CMAKE_C_COMPILER_VERSION} is soft-deprecated. Consider upgrading to 5.0+")
+
+# C++17 ?
+
+# if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 7)
+#   message(WARNING "Support for GNU C compiler version ${CMAKE_C_COMPILER_VERSION} is soft-deprecated. Consider upgrading to 7+")
 # endif()

-# if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
-#   message(WARNING "Support for GNU C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is soft-deprecated. Consider upgrading to 5.0+")
+# if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7)
+#   message(WARNING "Support for GNU C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is soft-deprecated. Consider upgrading to 7+")
 # endif()

-# if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 3.5)
-#   message(WARNING "LLVM Clang C compiler version ${CMAKE_C_COMPILER_VERSION} is soft-deprecated. Consider upgrading to 3.5+")
+# if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
+#   message(WARNING "LLVM Clang C compiler version ${CMAKE_C_COMPILER_VERSION} is soft-deprecated. Consider upgrading to 4.0+")
 # endif()

-# if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
-#   message(WARNING "LLVM Clang C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is soft-deprecated. Consider upgrading to 3.5+")
+# if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
+#   message(WARNING "LLVM Clang C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is soft-deprecated. Consider upgrading to 4.0+")
 # endif()


Make CMake fail if json-c is required, but not found

--- cmake/deps.cmake
+++ cmake/deps.cmake
@@ -61,7 +61,7 @@
 endif(WITH_CAPABILITIES)

 if(WITH_STATUS_SOCKET)
-  pkg_check_modules(JSONC json-c)
+  pkg_check_modules(JSONC REQUIRED json-c)
 else(WITH_STATUS_SOCKET)
   set(JSONC_INCLUDE_DIRS "")
   set(JSONC_CFLAGS_OTHER "")


Add COMMENT for FFIG cmake custom command (#330)

--- cmake/ffig.cmake
+++ cmake/ffig.cmake
@@ -88,7 +88,8 @@
   add_custom_command(OUTPUT ${ffig_outputs}
     COMMAND ${PYTHON_EXECUTABLE} -m ffig ${ffig_invocation}
     DEPENDS ${input} ${FFIG_SOURCE}
-    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    COMMENT "Generating FFIG bindings for ${input}: ${ffig_outputs}")

   # FIXME: This is a bit ugly. The header is copied next to the generated bindings.
   file(COPY ${input} DESTINATION ${ffig_output_dir}/)


Update utils

Update utils

--- cmake/util.cmake
+++ cmake/util.cmake
@@ -113,24 +113,24 @@
     endif()
 endmacro()

-function(get_prefix prefix)
-  if(BUILD_STATIC_LIBS)
-  set(STATIC_PREFIX "static-")
-    if(ANDROID)
-      set(STATIC_PREFIX "${STATIC_PREFIX}android-${ANDROID_ABI}-")
-    elseif(IOS)
-      set(STATIC_PREFIX "${STATIC_PREFIX}${IOS_PLATFORM}${IOS_ARCH}-${ANDROID_ABI}-")
+function(get_prefix prefix IS_STATIC)
+  if(IS_STATIC)
+    set(STATIC_PREFIX "static-")
+      if(ANDROID)
+        set(STATIC_PREFIX "${STATIC_PREFIX}android-${ANDROID_ABI}-")
+      elseif(IOS)
+        set(STATIC_PREFIX "${STATIC_PREFIX}ios-${IOS_ARCH}-")
+      endif()
     endif()
-  endif()
   set(${prefix} ${STATIC_PREFIX} PARENT_SCOPE)
 endfunction()

 function(get_cpack_filename ver name)
     get_compiler_version(COMPILER)
-    get_prefix(STATIC_PREFIX)
+    get_prefix(STATIC_PREFIX BUILD_STATIC_LIBS)

-    set(${name} ${PACKAGE_NAME}-${ver}-${STATIC_PREFIX}${COMPILER} PARENT_SCOPE)
+    set(${name} ${PROJECT_NAME}-${ver}-${STATIC_PREFIX}${COMPILER} PARENT_SCOPE)
 endfunction()

 function(get_compiler_version ver)


Remove RPATH entries from installed external plug-ins.

--- BlueBerry/CMake/MacroInstallCTKPlugin.cmake
+++ BlueBerry/CMake/MacroInstallCTKPlugin.cmake
@@ -13,12 +13,24 @@
     IF(_is_imported)
       GET_TARGET_PROPERTY(_import_loc_debug ${_install_target} IMPORTED_LOCATION_DEBUG)
       GET_TARGET_PROPERTY(_import_loc_release ${_install_target} IMPORTED_LOCATION_RELEASE)
+      GET_FILENAME_COMPONENT(_target_filename_debug "${_import_loc_debug}" NAME)
+      GET_FILENAME_COMPONENT(_target_filename_release "${_import_loc_release}" NAME)
       INSTALL(FILES ${_import_loc_debug}
               DESTINATION ${_INSTALL_DESTINATION}
               CONFIGURATIONS Debug)
       INSTALL(FILES ${_import_loc_release}
               DESTINATION ${_INSTALL_DESTINATION}
               CONFIGURATIONS Release)
+      IF(UNIX)
+        IF(_target_filename_debug)
+          INSTALL(CODE "FILE(RPATH_REMOVE
+                             FILE \"\${CMAKE_INSTALL_PREFIX}/${_INSTALL_DESTINATION}/${_target_filename_debug}\")")
+        ENDIF()
+        IF(_target_filename_release)
+          INSTALL(CODE "FILE(RPATH_CHANGE
+                             FILE \"\${CMAKE_INSTALL_PREFIX}/${_INSTALL_DESTINATION}/${_target_filename_release}\")")
+        ENDIF()
+      ENDIF()
     ELSE()
       INSTALL(TARGETS ${_install_target}
               RUNTIME DESTINATION ${_INSTALL_DESTINATION}


FIX: include(FindPythonInterp)

FIX: include(FindPythonInterp)

--- cmake/Modules/FindPythonModule.cmake
+++ cmake/Modules/FindPythonModule.cmake
@@ -4,6 +4,7 @@
 function(find_python_module module)
 	string(TOUPPER ${module} module_upper)
 	if(NOT PYTHON_${module_upper})
+		include (FindPythonInterp)
 		if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
 			set(PY_${module}_FIND_REQUIRED TRUE)
 		endif()


Fix a few variable settings in AddPBJTarget.cmake.

--- build/modules/AddPBJTarget.cmake
+++ build/modules/AddPBJTarget.cmake
@@ -59,11 +59,13 @@
     IF(${FILE} MATCHES ".*[.]pbj")
       STRING(REPLACE ".pbj" "" FILE ${FILE})
     ENDIF()
+
+    SET(PBJ_PBJCS_FILE)
+
     SET(PBJ_PBJ_FILE ${PBJ_INPUTDIR}/${FILE}.pbj)
     SET(PBJ_PROTO_FILE ${PBJ_OUTPUTDIR}/${PBJ_PLUGINNAME_UNDERSCORE}${FILE}.proto)
     SET(PBJ_PROTO_FILES ${PBJ_PROTO_FILES} ${PBJ_PROTO_FILE})
     SET(PBJ_PBJ_FILES ${PBJ_PBJ_FILES} ${PBJ_PBJ_FILE})
-    SET(PBJ_PBJCS_FILES ${PBJ_PBJCS_FILES} ${PBJ_PBJCS_FILE})
     SET(PBJ_PBJHPP_FILE ${PBJ_OUTPUTDIR}/${PBJ_PLUGINNAME_UNDERSCORE}${FILE}.pbj.hpp)

     SET(PBJ_ALL_OUTPUTS)
@@ -86,6 +88,7 @@
     IF(PBJ_GENERATE_CSHARP)
       MESSAGE(STATUS "Building C# protobuf: ${FILE}")
       SET(PBJ_PBJCS_FILE ${ScriptsRoot}/csharp/protocol/${FILE}.pbj.cs)
+      SET(PBJ_PBJCS_FILES ${PBJ_PBJCS_FILES} ${PBJ_PBJCS_FILE})
       SET(PBJ_CS_FILE ${ScriptsRoot}/csharp/protocol/${FILE}.cs)
       SET(PBJ_CS_FILES ${PBJ_CS_FILES} ${PBJ_CS_FILE})
       SET(PBJ_OUTPUTS ${PBJ_CS_FILE} ${PBJ_PBJCS_FILE})


FindOGRE.cmake now detects Boost even when Ogre is not statically compiled.

--HG--
branch : v1-9

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -290,7 +290,7 @@
       set(OGRE_DEPS_FOUND FALSE)
 	endif ()
   endif ()
-
+endif()
   if (OGRE_CONFIG_THREADS)
     if (OGRE_CONFIG_THREAD_PROVIDER EQUAL 1)
       if (OGRE_STATIC)
@@ -301,7 +301,7 @@
       endif()

       set(OGRE_BOOST_COMPONENTS thread date_time)
-
+      find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
       if(Boost_FOUND AND Boost_VERSION GREATER 104900)
         if(Boost_VERSION GREATER 105300)
             set(OGRE_BOOST_COMPONENTS thread date_time system atomic chrono)
@@ -335,7 +335,7 @@
       endif ()
     endif ()
   endif ()
-
+if (OGRE_STATIC)
   if (NOT OGRE_DEPS_FOUND)
     pkg_message(OGRE "Could not find all required dependencies for the Ogre package.")
     set(OGRE_FOUND FALSE)


[OGRE-395] Resolved issue finding OS X framework in FindOgre

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -154,7 +154,7 @@
   RenderSystem_Direct3D11 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GL3Plus RenderSystem_GLES RenderSystem_GLES2)
 set(OGRE_RESET_VARS
   OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR
-  OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG
+  OGRE_FRAMEWORK_INCLUDES OGRE_FRAMEWORK_PATH OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG
   OGRE_PLUGIN_DIR_DBG OGRE_PLUGIN_DIR_REL OGRE_MEDIA_DIR)
 foreach (comp ${OGRE_COMPONENTS})
   set(OGRE_RESET_VARS ${OGRE_RESET_VARS}
@@ -169,8 +169,16 @@
 	# try to locate Ogre via pkg-config
 	use_pkgconfig(OGRE_PKGC "OGRE${OGRE_LIB_SUFFIX}")

-	# try to find framework on OSX
-	findpkg_framework(Ogre)
+	# Set the framework search path for OS X
+    set(OGRE_FRAMEWORK_SEARCH_PATH
+      ${CMAKE_FRAMEWORK_PATH}
+      ~/Library/Frameworks
+      /Library/Frameworks
+      /System/Library/Frameworks
+      /Network/Library/Frameworks
+      ${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/Release
+      ${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/Debug
+    )
 else()
 	set(OGRE_LIBRARY_FWK "")
 endif()
@@ -232,7 +240,7 @@
   set(OGRE_LIBRARY "NOTFOUND")
 endif ()

-set(OGRE_INCLUDE_DIR ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INCLUDE_DIR})
+set(OGRE_INCLUDE_DIR ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INCLUDE_DIR} ${OGRE_FRAMEWORK_INCLUDES})
 list(REMOVE_DUPLICATES OGRE_INCLUDE_DIR)
 findpkg_finish(OGRE)
 add_parent_dir(OGRE_INCLUDE_DIRS OGRE_INCLUDE_DIR)
@@ -381,8 +389,8 @@
   find_path(OGRE_${COMPONENT}_INCLUDE_DIR NAMES ${HEADER} HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES ${COMPONENT} OGRE/${COMPONENT} Components/${COMPONENT}/include)
   set(OGRE_${COMPONENT}_LIBRARY_NAMES "Ogre${COMPONENT}${OGRE_LIB_SUFFIX}")
   get_debug_names(OGRE_${COMPONENT}_LIBRARY_NAMES)
-  find_library(OGRE_${COMPONENT}_LIBRARY_REL NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
-  find_library(OGRE_${COMPONENT}_LIBRARY_DBG NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "Debug")
+  find_library(OGRE_${COMPONENT}_LIBRARY_REL NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} ${OGRE_FRAMEWORK_PATH} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
+  find_library(OGRE_${COMPONENT}_LIBRARY_DBG NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} ${OGRE_FRAMEWORK_PATH} PATH_SUFFIXES "" "Debug")
   make_library_set(OGRE_${COMPONENT}_LIBRARY)
   findpkg_finish(OGRE_${COMPONENT})
   if (OGRE_${COMPONENT}_FOUND)
@@ -436,9 +444,9 @@
   get_debug_names(OGRE_${PLUGIN}_LIBRARY_NAMES)
   set(OGRE_${PLUGIN}_LIBRARY_FWK ${OGRE_LIBRARY_FWK})
   find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES}
-    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt Release Release/opt RelWithDebInfo RelWithDebInfo/opt MinSizeRel MinSizeRel/opt)
+    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} ${OGRE_FRAMEWORK_PATH} PATH_SUFFIXES "" OGRE opt Release Release/opt RelWithDebInfo RelWithDebInfo/opt MinSizeRel MinSizeRel/opt)
   find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG}
-    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt Debug Debug/opt)
+    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} ${OGRE_FRAMEWORK_PATH} PATH_SUFFIXES "" OGRE opt Debug Debug/opt)
   make_library_set(OGRE_${PLUGIN}_LIBRARY)

   if (OGRE_${PLUGIN}_LIBRARY OR OGRE_${PLUGIN}_INCLUDE_DIR)


FindRadium now exports assimp lib

FindRadium now exports assimp lib

* Use List instead of string to handles libraries
* Add assimp lib in FindRadium (because with assimp it won't compil) but not tested yet, seems like assimp lib are not compiled in the same dir as radium lib.

--- CMakeModules/FindRadium.cmake
+++ CMakeModules/FindRadium.cmake
@@ -60,18 +60,25 @@
             )
     ENDIF()

+    FIND_LIBRARY ( ASSIMP_LIBRARIES
+        NAMES assimp assimp32.lib assimp.lib libassimp.a
+        PATHS ${RADIUM_ROOT_DIR}/${CMAKE_BUILD_TYPE}/lib
+        ${RADIUM_ROOT_DIR}/lib
+        )
+
     SET ( Radium_FOUND TRUE )
     SET( RADIUM_LIBRARIES )
-    IF ( RA_CORE_LIB AND RA_ENGINE_LIB AND RA_GUIBASE_LIB)
+    IF ( RA_CORE_LIB AND RA_ENGINE_LIB AND RA_GUIBASE_LIB AND ASSIMP_LIBRARIES)
        LIST(APPEND RADIUM_LIBRARIES "${RA_CORE_LIB}" "${RA_ENGINE_LIB}" "${RA_GUIBASE_LIB}")
        SET ( Radium_Libs_FOUND TRUE)
-    ENDIF ( RA_CORE_LIB AND RA_ENGINE_LIB AND RA_GUIBASE_LIB)
+    ENDIF ( RA_CORE_LIB AND RA_ENGINE_LIB AND RA_GUIBASE_LIB AND ASSIMP_LIBRARIES)
 ENDIF( RADIUM_ROOT_DIR)

 IF ( Radium_FOUND )
     IF(NOT Radium_FIND_QUIETLY)
       MESSAGE ( STATUS "Found Radium Engine: ${RADIUM_ROOT_DIR}")
-      MESSAGE ( STATUS " ---  Radium libs: ${RADIUM_LIBRARIES}")
+      MESSAGE ( STATUS "      Radium libs: ${RADIUM_LIBRARIES}")
+      MESSAGE ( STATUS "      Assimp libs: ${ASSIMP_LIBRARIES}")
     ENDIF(NOT Radium_FIND_QUIETLY)
     IF (NOT Radium_Libs_FOUND)
         MESSAGE( WARNING "Could not find Radium libraries. You must compile them first")


Use some useful convenience variables defined by the tcl build
configuration to keep track of and enforce consistent version numbers
for Tcl/Tk and iTcl/iTk.

svn path=/trunk/; revision=12634

--- cmake/build_projects/tk/bp.cmake
+++ cmake/build_projects/tk/bp.cmake
@@ -56,7 +56,7 @@
 set(BP_PACKAGE tk)

 # Data that is related to downloads.
-set(${BP_PACKAGE}_URL  http://downloads.sourceforge.net/tcl/tk8.6.1-src.tar.gz)
+set(${BP_PACKAGE}_URL http://downloads.sourceforge.net/project/tcl/Tcl/${TCL_TK_VERSION}/tk${TCL_TK_VERSION}-src.tar.gz)
 set(${BP_PACKAGE}_DOWNLOAD_HASH_TYPE MD5)
 set(${BP_PACKAGE}_DOWNLOAD_HASH 63f21c3a0e0cefbd854b4eb29b129ac6)

@@ -110,8 +110,8 @@
   ${EP_BASE}/Stamp/build_${BP_PACKAGE}/build_${BP_PACKAGE}-install
   COMMAND echo "Install-tree fixups"
   COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} install-private-headers
-  COMMAND ${LN_EXECUTABLE} -v -sf wish8.6 ${BP_CMAKE_INSTALL_PREFIX}/bin/wish
-  COMMAND ${CHMOD_EXECUTABLE} -v ${SO_NUMERICAL_PERMISSIONS} ${BP_CMAKE_INSTALL_PREFIX}/lib/libtk8.6.so
+  COMMAND ${LN_EXECUTABLE} -v -sf wish${TCL_TK_LIBVERSION} ${BP_CMAKE_INSTALL_PREFIX}/bin/wish
+  COMMAND ${CHMOD_EXECUTABLE} -v ${SO_NUMERICAL_PERMISSIONS} ${BP_CMAKE_INSTALL_PREFIX}/lib/libtk${TCL_TK_LIBVERSION}.so
   APPEND
   )


cmake: run dtc after gen_defines.py and friends

Curently, any and all devicetree syntax errors are being handled by
dtc, because it runs before gen_defines.py. This means that any
improvements we make to devicetree error handling and reporting in
dtlib or edtlib will never be noticed by users that have dtc
installed.

(This also has the unfortunate effect of hiding dtlib error reporting
from me, since my systems all have dtc installed.)

Move dtc to after gen_defines.py, so that initial error handling and
warnings all come from python. If DTC has some additional warnings or
errors to report, let them come last. They will still halt the build
if anything is wrong.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -183,6 +183,49 @@
     )

   #
+  # Run gen_defines.py to create a header file, zephyr.dts, and edt.pickle.
+  #
+
+  string(REPLACE ";" " " EXTRA_DTC_FLAGS_RAW "${EXTRA_DTC_FLAGS}")
+  set(CMD_EXTRACT ${PYTHON_EXECUTABLE} ${GEN_DEFINES_SCRIPT}
+  --dts ${BOARD}.dts.pre.tmp
+  --dtc-flags '${EXTRA_DTC_FLAGS_RAW}'
+  --bindings-dirs ${DTS_ROOT_BINDINGS}
+  --header-out ${DEVICETREE_UNFIXED_H}
+  --device-header-out ${DEVICE_EXTERN_H}
+  --dts-out ${ZEPHYR_DTS} # As a debugging aid
+  --edt-pickle-out ${EDT_PICKLE}
+  ${EXTRA_GEN_DEFINES_ARGS}
+  )
+
+  execute_process(
+    COMMAND ${CMD_EXTRACT}
+    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+    RESULT_VARIABLE ret
+    )
+  if(NOT "${ret}" STREQUAL "0")
+    message(FATAL_ERROR "gen_defines.py failed with return code: ${ret}")
+  else()
+    message(STATUS "Generated zephyr.dts: ${ZEPHYR_DTS}")
+    message(STATUS "Generated devicetree_unfixed.h: ${DEVICETREE_UNFIXED_H}")
+    message(STATUS "Generated device_extern.h: ${DEVICE_EXTERN_H}")
+  endif()
+
+  execute_process(
+    COMMAND ${PYTHON_EXECUTABLE} ${DTS_CMAKE_SCRIPT}
+    --edt-pickle ${EDT_PICKLE}
+    --cmake-out ${DTS_CMAKE}
+    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+    RESULT_VARIABLE ret
+    )
+  if(NOT "${ret}" STREQUAL "0")
+    message(FATAL_ERROR "gen_dts_cmake.py failed with return code: ${ret}")
+  else()
+    message(STATUS "Including generated dts.cmake file: ${DTS_CMAKE}")
+    include(${DTS_CMAKE})
+  endif()
+
+  #
   # Run the C devicetree compiler on *.dts.pre.tmp, just to catch any
   # warnings/errors from it. dtlib and edtlib parse the devicetree files
   # themselves, so we don't rely on the C compiler otherwise.
@@ -225,50 +268,6 @@
     message(FATAL_ERROR "command failed with return code: ${ret}")
   endif()
   endif(DTC)
-
-  #
-  # Run gen_defines.py to create a header file, zephyr.dts, and edt.pickle.
-  #
-
-  string(REPLACE ";" " " EXTRA_DTC_FLAGS_RAW "${EXTRA_DTC_FLAGS}")
-  set(CMD_EXTRACT ${PYTHON_EXECUTABLE} ${GEN_DEFINES_SCRIPT}
-  --dts ${BOARD}.dts.pre.tmp
-  --dtc-flags '${EXTRA_DTC_FLAGS_RAW}'
-  --bindings-dirs ${DTS_ROOT_BINDINGS}
-  --header-out ${DEVICETREE_UNFIXED_H}
-  --device-header-out ${DEVICE_EXTERN_H}
-  --dts-out ${ZEPHYR_DTS} # As a debugging aid
-  --edt-pickle-out ${EDT_PICKLE}
-  ${EXTRA_GEN_DEFINES_ARGS}
-  )
-
-  execute_process(
-    COMMAND ${CMD_EXTRACT}
-    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
-    RESULT_VARIABLE ret
-    )
-  if(NOT "${ret}" STREQUAL "0")
-    message(FATAL_ERROR "gen_defines.py failed with return code: ${ret}")
-  else()
-    message(STATUS "Generated zephyr.dts: ${ZEPHYR_DTS}")
-    message(STATUS "Generated devicetree_unfixed.h: ${DEVICETREE_UNFIXED_H}")
-    message(STATUS "Generated device_extern.h: ${DEVICE_EXTERN_H}")
-  endif()
-
-  execute_process(
-    COMMAND ${PYTHON_EXECUTABLE} ${DTS_CMAKE_SCRIPT}
-    --edt-pickle ${EDT_PICKLE}
-    --cmake-out ${DTS_CMAKE}
-    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
-    RESULT_VARIABLE ret
-    )
-  if(NOT "${ret}" STREQUAL "0")
-    message(FATAL_ERROR "gen_dts_cmake.py failed with return code: ${ret}")
-  else()
-    message(STATUS "Including generated dts.cmake file: ${DTS_CMAKE}")
-    include(${DTS_CMAKE})
-  endif()
-
 else()
   file(WRITE ${DEVICETREE_UNFIXED_H} "/* WARNING. THIS FILE IS AUTO-GENERATED. DO NOT MODIFY! */")
   file(WRITE ${DEVICE_EXTERN_H} "/* WARNING. THIS FILE IS AUTO-GENERATED. DO NOT MODIFY! */")


Quiet for FindNumPy

Quiet for FindNumPy

--- FindNumPy.cmake
+++ FindNumPy.cmake
@@ -4,6 +4,13 @@
 # will be set by this script

 cmake_minimum_required(VERSION 2.6)
+
+if(NUMPY_FIND_QUIETLY)
+  find_package(PythonInterp)
+else()
+  find_package(PythonInterp QUIET)
+  set(_numpy_out 1)
+endif()

 if (PYTHON_EXECUTABLE)
   # write a python script that finds the numpy path
@@ -14,8 +21,8 @@
   exec_program("${PYTHON_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR}
     ARGS "FindNumpyPath.py"
     OUTPUT_VARIABLE NUMPY_PATH)
-else(PYTHON_EXECUTABLE)
-  message("Python executable not found.")
+elseif(_numpy_out)
+  message(STATUS "Python executable not found.")
 endif(PYTHON_EXECUTABLE)

 find_path(PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h
@@ -31,6 +38,4 @@
 endif(PYTHON_NUMPY_INCLUDE_DIR)

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Numpy DEFAULT_MSG
-        PYTHON_NUMPY_INCLUDE_DIR)
-
+find_package_handle_standard_args(Numpy DEFAULT_MSG PYTHON_NUMPY_INCLUDE_DIR)


use ThriftCppLibrary.cmake from fbcode_builder

Summary:
Update fboss to use `ThriftCppLibrary.cmake` directly from fbcode_builder
rather than maintaining its own copy of this file.

Reviewed By: chadaustin

Differential Revision: D17005421

fbshipit-source-id: a64df426118df6088b47f09410dad7b8b7e79a43

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -1,6 +1,4 @@
 # Copyright (c) Facebook, Inc. and its affiliates.
-# NOTE: If you change this file, fbcode/fboss/github/ThriftCppLibrary.cmake also
-# needs to be changed.  TODO: this should be handled via shipit.

 include(FBCMakeParseArgs)


DOC: added a comment block for deactivating tests in the core

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -1,5 +1,25 @@
 # tests with no extra command line parameter
 set(MODULE_TESTS
+  # IMPORTANT: If you plan to deactivate / comment out a test please write a bug number to the commented out line of code.
+  #
+  #     Example: #mitkMyTest #this test is commented out because of bug 12345
+  #
+  # It is important that the bug is open and that the test will be activated again before the bug is closed. This assures that
+  # no test is forgotten after it was commented out. If there is no bug for your current problem, please add a new one and
+  # mark it as critical.
+
+  ################## DISABLED TESTS #################################################
+  #mitkAbstractTransformGeometryTest.cpp #seems as tested class mitkExternAbstractTransformGeometry doesnt exist any more
+  #mitkStateMachineContainerTest.cpp #rewrite test, indirect since no longer exported Bug 14529
+  #mitkRegistrationBaseTest.cpp #tested class  mitkRegistrationBase doesn't exist any more
+  #mitkSegmentationInterpolationTest.cpp #file doesn't exist!
+  #mitkPipelineSmartPointerCorrectnessTest.cpp #file doesn't exist!
+  #mitkITKThreadingTest.cpp #test outdated because itk::Semaphore was removed from ITK
+  #mitkAbstractTransformPlaneGeometryTest.cpp #mitkVtkAbstractTransformPlaneGeometry doesn't exist any more
+  #mitkTestUtilSharedLibrary.cpp #Linker problem with this test...
+  #mitkTextOverlay2DSymbolsRenderingTest.cpp #Implementation of the tested feature is not finished yet. Ask Christoph or see bug 15104 for details.
+
+  ################# RUNNING TESTS ###################################################
   mitkAccessByItkTest.cpp
   mitkCoreObjectFactoryTest.cpp
   mitkMaterialTest.cpp
@@ -74,17 +94,6 @@
   mitkInteractionEventTest.cpp
   mitkLookupTableTest.cpp
   mitkSTLFileReaderTest.cpp
-
-  ################## DISABLED TESTS #################################################
-  #mitkAbstractTransformGeometryTest.cpp #seems as tested class mitkExternAbstractTransformGeometry doesnt exist any more
-  #mitkStateMachineContainerTest.cpp #rewrite test, indirect since no longer exported Bug 14529
-  #mitkRegistrationBaseTest.cpp #tested class  mitkRegistrationBase doesn't exist any more
-  #mitkSegmentationInterpolationTest.cpp #file doesn't exist!
-  #mitkPipelineSmartPointerCorrectnessTest.cpp #file doesn't exist!
-  #mitkITKThreadingTest.cpp #test outdated because itk::Semaphore was removed from ITK
-  #mitkAbstractTransformPlaneGeometryTest.cpp #mitkVtkAbstractTransformPlaneGeometry doesn't exist any more
-  #mitkTestUtilSharedLibrary.cpp #Linker problem with this test...
-  #mitkTextOverlay2DSymbolsRenderingTest.cpp #Implementation of the tested feature is not finished yet. Ask Christoph or see bug 15104 for details.
 )

 # test with image filename as an extra command line parameter


STYLE: Use installation path for ITKTransformTools

--- SuperBuild/External_ITKTransformTools.cmake
+++ SuperBuild/External_ITKTransformTools.cmake
@@ -58,7 +58,7 @@
     DEPENDS
       ${${proj}_DEPENDENCIES}
     )
-  set(${extProjName}_DIR ${EXTERNAL_BINARY_DIRECTORY}/${proj}-build)
+  set(${extProjName}_DIR ${EXTERNAL_BINARY_DIRECTORY}/${proj}-install/lib/cmake/ITKTransformTools)

 else()
   if(${USE_SYSTEM_${extProjName}})


upgraded protobuf to v.3.6.1

upgraded protobuf to v.3.6.1

--- tensorflow/contrib/cmake/external/protobuf.cmake
+++ tensorflow/contrib/cmake/external/protobuf.cmake
@@ -16,7 +16,7 @@

 set(PROTOBUF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/src)
 set(PROTOBUF_URL https://github.com/google/protobuf.git)
-set(PROTOBUF_TAG v3.6.0)
+set(PROTOBUF_TAG v3.6.1)

 if(WIN32)
   if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")


tpu contrib fix (#16321)

tpu contrib fix (#16321)

--- tensorflow/contrib/cmake/tf_core_framework.cmake
+++ tensorflow/contrib/cmake/tf_core_framework.cmake
@@ -126,7 +126,9 @@
 file(GLOB_RECURSE tf_protos_cc_srcs RELATIVE ${tensorflow_source_dir}
     "${tensorflow_source_dir}/tensorflow/core/*.proto"
     "${tensorflow_source_dir}/tensorflow/contrib/boosted_trees/proto/*.proto"
-)
+    "${tensorflow_source_dir}/tensorflow/contrib/tpu/proto/*.proto"
+)
+
 RELATIVE_PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS
     ${tensorflow_source_dir} ${tf_protos_cc_srcs}
 )


Implement quiet for FindLunchbox

Implement quiet for FindLunchbox

--- FindLunchbox.cmake
+++ FindLunchbox.cmake
@@ -27,13 +27,13 @@
 #
 #==================================
 #
-# - Find LunchBox
-# This module searches for the LunchBox library
-#    See http://www.liblunchBox.net
+# - Find Lunchbox
+# This module searches for the Lunchbox library
+#    See https://github.com/Eyescale/Lunchbox
 #
 #==================================
 #
-# The following environment variables are respected for finding LunchBox.
+# The following environment variables are respected for finding Lunchbox.
 # CMAKE_PREFIX_PATH can also be used for this (see find_library() CMake
 # documentation).
 #
@@ -42,20 +42,20 @@
 #
 # This module defines the following output variables:
 #
-#    LUNCHBOX_FOUND - Was LunchBox and all of the specified components found?
+#    LUNCHBOX_FOUND - Was Lunchbox and all of the specified components found?
 #
-#    LUNCHBOX_VERSION - The version of LunchBox which was found
+#    LUNCHBOX_VERSION - The version of Lunchbox which was found
 #
-#    LUNCHBOX_VERSION_ABI - The DSO version of LunchBox which was found
+#    LUNCHBOX_VERSION_ABI - The DSO version of Lunchbox which was found
 #
 #    LUNCHBOX_INCLUDE_DIRS - Where to find the headers
 #
-#    LUNCHBOX_LIBRARIES - The LunchBox libraries
+#    LUNCHBOX_LIBRARIES - The Lunchbox libraries
 #
 #==================================
 # Example Usage:
 #
-#  find_package(LunchBox 0.3.0 REQUIRED)
+#  find_package(Lunchbox 0.3.0 REQUIRED)
 #  include_directories(${LUNCHBOX_INCLUDE_DIRS})
 #
 #  add_executable(foo foo.cc)
@@ -63,75 +63,81 @@
 #
 #==================================
 # Naming convention:
-#  Local variables of the form _lunchBox_foo
-#  Input variables of the form LunchBox_FOO
+#  Local variables of the form _lunchbox_foo
+#  Input variables of the form Lunchbox_FOO
 #  Output variables of the form LUNCHBOX_FOO
 #

 #
 # find and parse lunchbox/version.h
-find_path(_lunchBox_INCLUDE_DIR lunchbox/version.h
+find_path(_lunchbox_INCLUDE_DIR lunchbox/version.h
   HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{LUNCHBOX_ROOT} ${LUNCHBOX_ROOT}
   PATH_SUFFIXES include
   PATHS /usr /usr/local /opt/local /opt
   )

-if(LunchBox_FIND_REQUIRED)
-  set(_lunchBox_version_output_type FATAL_ERROR)
+if(Lunchbox_FIND_REQUIRED)
+  set(_lunchbox_version_output_type FATAL_ERROR)
+  set(_lunchbox_output 1)
 else()
-  set(_lunchBox_version_output_type STATUS)
+  set(_lunchbox_version_output_type STATUS)
+  if(NOT Lunchbox_FIND_QUIETLY)
+    set(_lunchbox_output 1)
+  endif()
 endif()

 # Try to ascertain the version...
-if(_lunchBox_INCLUDE_DIR)
-  set(_lunchBox_Version_file "${_lunchBox_INCLUDE_DIR}/lunchbox/version.h")
-  if("${_lunchBox_INCLUDE_DIR}" MATCHES "\\.framework$" AND
-      NOT EXISTS "${_lunchBox_Version_file}")
-    set(_lunchBox_Version_file "${_lunchBox_INCLUDE_DIR}/Headers/version.h")
+if(_lunchbox_INCLUDE_DIR)
+  set(_lunchbox_Version_file "${_lunchbox_INCLUDE_DIR}/lunchbox/version.h")
+  if("${_lunchbox_INCLUDE_DIR}" MATCHES "\\.framework$" AND
+      NOT EXISTS "${_lunchbox_Version_file}")
+    set(_lunchbox_Version_file "${_lunchbox_INCLUDE_DIR}/Headers/version.h")
   endif()

-  if(EXISTS "${_lunchBox_Version_file}")
-    file(READ "${_lunchBox_Version_file}" _lunchBox_Version_contents)
+  if(EXISTS "${_lunchbox_Version_file}")
+    file(READ "${_lunchbox_Version_file}" _lunchbox_Version_contents)
   else()
-    set(_lunchBox_Version_contents "unknown")
+    set(_lunchbox_Version_contents "unknown")
   endif()

-  if(_lunchBox_Version_contents MATCHES ".*define LUNCHBOX_VERSION_MAJOR[ \t]+([0-9]+).*")
+  if(_lunchbox_Version_contents MATCHES ".*define LUNCHBOX_VERSION_MAJOR[ \t]+([0-9]+).*")
     string(REGEX REPLACE ".*define LUNCHBOX_VERSION_MAJOR[ \t]+([0-9]+).*"
-      "\\1" LUNCHBOX_VERSION_MAJOR ${_lunchBox_Version_contents})
+      "\\1" LUNCHBOX_VERSION_MAJOR ${_lunchbox_Version_contents})
     string(REGEX REPLACE ".*define LUNCHBOX_VERSION_MINOR[ \t]+([0-9]+).*"
-      "\\1" LUNCHBOX_VERSION_MINOR ${_lunchBox_Version_contents})
+      "\\1" LUNCHBOX_VERSION_MINOR ${_lunchbox_Version_contents})
     string(REGEX REPLACE ".*define LUNCHBOX_VERSION_PATCH[ \t]+([0-9]+).*"
-      "\\1" LUNCHBOX_VERSION_PATCH ${_lunchBox_Version_contents})
+      "\\1" LUNCHBOX_VERSION_PATCH ${_lunchbox_Version_contents})
     string(REGEX REPLACE ".*define LUNCHBOX_VERSION_ABI[ \t]+([0-9]+).*"
-      "\\1" LUNCHBOX_VERSION_ABI ${_lunchBox_Version_contents})
+      "\\1" LUNCHBOX_VERSION_ABI ${_lunchbox_Version_contents})
     set(LUNCHBOX_VERSION "${LUNCHBOX_VERSION_MAJOR}.${LUNCHBOX_VERSION_MINOR}.${LUNCHBOX_VERSION_PATCH}"
-      CACHE INTERNAL "The version of LunchBox which was detected")
+      CACHE INTERNAL "The version of Lunchbox which was detected")
   endif()
 else()
-  set(_lunchBox_EPIC_FAIL TRUE)
-  message(${_lunchBox_version_output_type}
-    "Can't find LunchBox header file version.h.")
+  set(_lunchbox_EPIC_FAIL TRUE)
+  if(_lunchbox_output)
+    message(${_lunchbox_version_output_type}
+      "Can't find Lunchbox header file version.h.")
+  endif()
 endif()

 #
 # Version checking
 #
-if(LunchBox_FIND_VERSION AND LUNCHBOX_VERSION)
-  if(LunchBox_FIND_VERSION_EXACT)
-    if(NOT LUNCHBOX_VERSION VERSION_EQUAL ${LunchBox_FIND_VERSION})
-      set(_lunchBox_version_not_exact TRUE)
+if(Lunchbox_FIND_VERSION AND LUNCHBOX_VERSION)
+  if(Lunchbox_FIND_VERSION_EXACT)
+    if(NOT LUNCHBOX_VERSION VERSION_EQUAL ${Lunchbox_FIND_VERSION})
+      set(_lunchbox_version_not_exact TRUE)
     endif()
   else()
     # version is too low
-    if(NOT LUNCHBOX_VERSION VERSION_EQUAL ${LunchBox_FIND_VERSION} AND
-        NOT LUNCHBOX_VERSION VERSION_GREATER ${LunchBox_FIND_VERSION})
-      set(_lunchBox_version_not_high_enough TRUE)
+    if(NOT LUNCHBOX_VERSION VERSION_EQUAL ${Lunchbox_FIND_VERSION} AND
+        NOT LUNCHBOX_VERSION VERSION_GREATER ${Lunchbox_FIND_VERSION})
+      set(_lunchbox_version_not_high_enough TRUE)
     endif()
   endif()
 endif()

-find_library(_lunchBox_LIBRARY lunchbox
+find_library(_lunchbox_LIBRARY lunchbox
   HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{LUNCHBOX_ROOT} ${LUNCHBOX_ROOT}
   PATH_SUFFIXES lib
   PATHS /usr /usr/local /opt/local /opt
@@ -139,42 +145,48 @@

 # Inform the users with an error message based on what version they
 # have vs. what version was required.
-if(_lunchBox_version_not_high_enough)
-  set(_lunchBox_EPIC_FAIL TRUE)
-  message(${_lunchBox_version_output_type}
-    "Version ${LunchBox_FIND_VERSION} or higher of LunchBox is required. "
-    "Version ${LUNCHBOX_VERSION} was found in ${_lunchBox_INCLUDE_DIR}.")
-elseif(_lunchBox_version_not_exact)
-  set(_lunchBox_EPIC_FAIL TRUE)
-  message(${_lunchBox_version_output_type}
-    "Version ${LunchBox_FIND_VERSION} of LunchBox is required exactly. "
-    "Version ${LUNCHBOX_VERSION} was found.")
+if(_lunchbox_version_not_high_enough)
+  set(_lunchbox_EPIC_FAIL TRUE)
+  if(_lunchbox_output)
+    message(${_lunchbox_version_output_type}
+      "Version ${Lunchbox_FIND_VERSION} or higher of Lunchbox is required. "
+      "Version ${LUNCHBOX_VERSION} was found in ${_lunchbox_INCLUDE_DIR}.")
+  endif()
+elseif(_lunchbox_version_not_exact)
+  set(_lunchbox_EPIC_FAIL TRUE)
+  if(_lunchbox_output)
+    message(${_lunchbox_version_output_type}
+      "Version ${Lunchbox_FIND_VERSION} of Lunchbox is required exactly. "
+      "Version ${LUNCHBOX_VERSION} was found.")
+  endif()
 else()
-  if(LunchBox_FIND_REQUIRED)
-    if(_lunchBox_LIBRARY MATCHES "_lunchBox_LIBRARY-NOTFOUND")
-      message(FATAL_ERROR "Missing the LunchBox library.\n"
+  if(Lunchbox_FIND_REQUIRED)
+    if(_lunchbox_LIBRARY MATCHES "_lunchbox_LIBRARY-NOTFOUND")
+      message(FATAL_ERROR "Missing the Lunchbox library.\n"
         "Consider using CMAKE_PREFIX_PATH or the LUNCHBOX_ROOT environment variable. "
         "See the ${CMAKE_CURRENT_LIST_FILE} for more details.")
     endif()
   endif()
   include(FindPackageHandleStandardArgs)
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(LunchBox DEFAULT_MSG
-                                    _lunchBox_LIBRARY _lunchBox_INCLUDE_DIR)
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lunchbox DEFAULT_MSG
+                                    _lunchbox_LIBRARY _lunchbox_INCLUDE_DIR)
 endif()

-if(_lunchBox_EPIC_FAIL)
+if(_lunchbox_EPIC_FAIL)
     # Zero out everything, we didn't meet version requirements
     set(LUNCHBOX_FOUND FALSE)
-    set(_lunchBox_LIBRARY)
-    set(_lunchBox_INCLUDE_DIR)
+    set(_lunchbox_LIBRARY)
+    set(_lunchbox_INCLUDE_DIR)
 endif()

-set(LUNCHBOX_INCLUDE_DIRS ${_lunchBox_INCLUDE_DIR})
-set(LUNCHBOX_LIBRARIES ${_lunchBox_LIBRARY})
-get_filename_component(LUNCHBOX_LIBRARY_DIR ${_lunchBox_LIBRARY} PATH)
+set(LUNCHBOX_INCLUDE_DIRS ${_lunchbox_INCLUDE_DIR})
+set(LUNCHBOX_LIBRARIES ${_lunchbox_LIBRARY})
+get_filename_component(LUNCHBOX_LIBRARY_DIR ${_lunchbox_LIBRARY} PATH)

 if(LUNCHBOX_FOUND)
-  message(STATUS "Found LunchBox ${LUNCHBOX_VERSION}/${LUNCHBOX_VERSION_ABI} in "
-    "${LUNCHBOX_INCLUDE_DIRS};${LUNCHBOX_LIBRARIES}")
+  if(_lunchbox_output)
+    message(STATUS "Found Lunchbox ${LUNCHBOX_VERSION}/${LUNCHBOX_VERSION_ABI}"
+      " in ${LUNCHBOX_INCLUDE_DIRS};${LUNCHBOX_LIBRARIES}")
+  endif()
 endif()


CMake: Remove broken configuration

CMake: Remove broken configuration

--- cmake/configure/configure_opencascade.cmake
+++ cmake/configure/configure_opencascade.cmake
@@ -17,12 +17,4 @@
 # Configuration for the OpenCASCADE library:
 #

-MACRO(FEATURE_OPENCASCADE_CONFIGURE_EXTERNAL)
-  #
-  # Disable a bunch of warnings caused by OpenCascade headers:
-  #
-  ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-extra")
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(OPENCASCADE)


[cmake] Turn on builtin_xrootd if external xrootd not found

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -835,8 +835,7 @@
 endif()

 #---Check for Xrootd support---------------------------------------------------------
-if(xrootd)
-  if(NOT builtin_xrootd)
+if(xrootd AND NOT builtin_xrootd)
     message(STATUS "Looking for XROOTD")
     find_package(XROOTD)
     if(NOT XROOTD_FOUND)
@@ -845,18 +844,12 @@
                             "or inlcude the installation of XROOTD in the CMAKE_PREFIX_PATH. "
                             "Alternatively, you can also enable the option 'builtin_xrootd' to build XROOTD internally")
       else()
-        message(STATUS "XROOTD not found. Set environment variable XRDSYS to point to your XROOTD installation")
-        message(STATUS "                  Alternatively, you can also enable the option 'builtin_xrootd' to build XROOTD internally")
-        message(STATUS "                  For the time being switching OFF 'xrootd' option")
-        set(xrootd OFF CACHE BOOL "Disabled because external XROOTD not found and builtin_xrootd disabled (${xrootd_description})" FORCE)
-        if(alien)
-          set(alien OFF CACHE BOOL "Disabled because external XROOTD not found and builtin_xrootd disabled (${alien_description})" FORCE)
-        endif()
+        message(STATUS "XROOTD not found, enabling 'builtin_xrootd' option")
+        set(builtin_xrootd ON CACHE BOOL "Enabled because xrootd is enabled, but external xrootd was not found (${xrootd_description})" FORCE)
       endif()
     else()
       set(XROOTD_VERSIONNUM ${xrdversnum})  # variable used internally
     endif()
-  endif()
 endif()

 if(builtin_xrootd)


Pass ROOT CMake variables to LZ4 build.

Pass ROOT CMake variables to LZ4 build.

This ensures that the LZ4 internal build is built with the same
compiler as the rest of ROOT.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -256,7 +256,7 @@
     URL ${lcgpackages}/lz4-${lz4_version}.tar.gz
     URL_MD5 c9610c5ce97eb431dddddf0073d919b9
     INSTALL_DIR ${CMAKE_BINARY_DIR}
-    CONFIGURE_COMMAND  /bin/sh -c "PREFIX=<INSTALL_DIR> make cmake"
+    CONFIGURE_COMMAND  /bin/sh -c "PREFIX=<INSTALL_DIR> CMAKE_PARAMS='-DCMAKE_C_COMPILER=\\\"${CMAKE_C_COMPILER}\\\" -DCMAKE_C_FLAGS=\\\"${CMAKE_C_FLAGS}\\\" -DCMAKE_OSX_SYSROOT=\\\"${CMAKE_OSX_SYSROOT}\\\"' make cmake"
     BUILD_COMMAND /bin/sh -c "PREFIX=<INSTALL_DIR> MOREFLAGS=-fPIC make"
     INSTALL_COMMAND /bin/sh -c "PREFIX=<INSTALL_DIR> make install"
     LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1


Fix options in hunter_dump_cmake_flags

Fix options in hunter_dump_cmake_flags

--- cmake/modules/hunter_dump_cmake_flags.cmake
+++ cmake/modules/hunter_dump_cmake_flags.cmake
@@ -12,7 +12,7 @@
 # * OpenSSL
 # * odb-boost
 function(hunter_dump_cmake_flags)
-  cmake_parse_arguments(x "SKIP_INCLUDES" "SKIP_PIC" "CPPFLAGS" "" "${ARGV}")
+  cmake_parse_arguments(x "SKIP_INCLUDES;SKIP_PIC" "CPPFLAGS" "" "${ARGV}")
   # -> x_SKIP_INCLUDES
   # -> x_SKIP_PIC
   # -> x_CPPFLAGS


Better conformity to find_package requirements

--- cmake/OpenCVFindMatlab.cmake
+++ cmake/OpenCVFindMatlab.cmake
@@ -113,21 +113,6 @@
   # get the mex shell script
   find_file(MATLAB_MEX_SCRIPT NAMES mex mex.bat PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)

-  # verify that everything has been found successfully
-  if (MATLAB_LIB_MX AND MATLAB_LIB_MEX AND MATLAB_LIB_MAT AND MATLAB_INCLUDE_DIRS AND MATLAB_MEX_SCRIPT)
-    set(MATLAB_FOUND TRUE)
-  else()
-    unset(MATLAB_LIB_MX)
-    unset(MATLAB_LIB_MEX)
-    unset(MATLAB_LIB_MAT)
-    unset(MATLAB_LIBS)
-    unset(MATLAB_LIBRARY_DIRS)
-    unset(MATLAB_INCLUDE_DIRS)
-    unset(MATLAB_ROOT_DIR)
-    unset(MATLAB_MEXEXT)
-    unset(MATLAB_MEX_SCRIPT)
-    unset(MATLAB_ARCH)
-  endif()
 endMACRO()

@@ -148,6 +133,8 @@
   if (MATLAB_ROOT_DIR)
     locate_matlab_components(${MATLAB_ROOT_DIR})
   endif()
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Matlab DEFAULT_MSG MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS
+                                           MATLAB_LIBS MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH)

   # if Matlab was not found, unset the local variables
   if (NOT MATLAB_FOUND)


AddSwift.cmake: Install into resource dir based on TARGET_LIBRARY

not IS_STDLIB. There are other non-stdlib libraries that can go
into the platform resource directory, such as libswiftRemoteMirror.dylib.

rdar://problem/26435454

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1224,7 +1224,7 @@
         message(FATAL_ERROR "internal error: the variable should be non-empty")
       endif()

-      if(SWIFTLIB_IS_STDLIB)
+      if(SWIFTLIB_TARGET_LIBRARY)
         if(SWIFTLIB_SHARED)
           set(resource_dir "swift")
           set(file_permissions


Cmake changes for -llog and -latomic III

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1505,6 +1505,12 @@
           if("${lib}" STREQUAL "ICU_UC")
             list(APPEND swiftlib_private_link_libraries_targets
                  "${SWIFT_${sdk}_ICU_UC}")
+            // temporary fix for atomic needing to be
+            // after object files for libswiftCore.so
+            if("${sdk}" STREQUAL "ANDROID")
+              list(APPEND swiftlib_private_link_libraries_targets
+                   "-latomic")
+            endif()
           elseif("${lib}" STREQUAL "ICU_I18N")
             list(APPEND swiftlib_private_link_libraries_targets
                  "${SWIFT_${sdk}_ICU_I18N}")


Do not mark install area variables as advanced.  This makes it much more
obvious to ccmake users when there are unintended inconsistencies between
these variables caused by a stale cache or failing to use
-DCMAKE_INSTALL_PREFIX as a ccmake command-line option.

svn path=/trunk/; revision=7412

--- cmake/modules/instdirs.cmake
+++ cmake/modules/instdirs.cmake
@@ -71,16 +71,6 @@
 CACHE PATH "install location for man documentation"
 )

-mark_as_advanced(
-CMAKE_INSTALL_EXEC_PREFIX
-CMAKE_INSTALL_BINDIR
-CMAKE_INSTALL_DATADIR
-CMAKE_INSTALL_LIBDIR
-CMAKE_INSTALL_INCLUDEDIR
-CMAKE_INSTALL_INFODIR
-CMAKE_INSTALL_MANDIR
-)
-
 # Configured PLplot install locations determined from user-updatable
 # cached values above.


CMake: src-dependencies: do look for openmp 4.0 specifically.

There was a change between openmp3.1 and openmp40
wrt the predetermination of variables.
In particular, that affects const variables.
Since default(none) is used, they "used" to be determined as shared.
Now they won't be.

--- cmake/src-dependencies.cmake
+++ cmake/src-dependencies.cmake
@@ -22,7 +22,19 @@
 unset(HAVE_OPENMP)
 if(WITH_OPENMP)
   message(STATUS "Looking for OpenMP")
-  find_package(OpenMP)
+
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
+     CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
+    # Clang has an option to specify the OpenMP standard to use. Specify it.
+    set(OPENMP_VERSION_SPECIFIER "-fopenmp-version=40")
+  endif()
+
+  set(CMAKE_CXX_FLAGS_SAVE "${CMAKE_CXX_FLAGS}")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENMP_VERSION_SPECIFIER}")
+
+  find_package(OpenMP 4.0)
+
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")

   if(NOT OPENMP_FOUND)
     message(SEND_ERROR "Did not find OpenMP! Either make it find OpenMP, "
@@ -44,6 +56,7 @@

   if(NOT USE_BUNDLED_LLVMOPENMP)
     target_link_libraries(rawspeed PUBLIC OpenMP::OpenMP_CXX)
+    target_compile_options(rawspeed PUBLIC ${OPENMP_VERSION_SPECIFIER})
   else()
     include(LLVMOpenMP)

@@ -51,6 +64,7 @@

     add_dependencies(dependencies omp)
     target_compile_options(rawspeed PUBLIC $<TARGET_PROPERTY:OpenMP::OpenMP_CXX,INTERFACE_COMPILE_OPTIONS>) # compile time only!
+    target_compile_options(rawspeed PUBLIC ${OPENMP_VERSION_SPECIFIER})
     target_link_libraries(rawspeed PUBLIC omp) # newly built runtime library
   endif()


added: config workaround for clang 3.4+ and boost < 1.56 (upd)

--- share/hugh/cmake/CMakeAddons_SetupVariables.cmake
+++ share/hugh/cmake/CMakeAddons_SetupVariables.cmake
@@ -62,6 +62,7 @@
   find_package(Boost ${BOOST_MINIMUM_VERSION} QUIET)

   if (Boost_VERSION VERSION_LESS 105060)
+    message(STATUS "Adding CLANG 3.4+/boost < 1.65 workaround")
     add_definitions(-DBOOST_HAS_INT128)
   endif()
 endif()


Change message to reflect the actual tool that is to be found.

--- make/UseRPMTools.cmake
+++ make/UseRPMTools.cmake
@@ -27,12 +27,12 @@
     DOC "The RPM builder tool")

   IF (RPMTools_RPMBUILD_EXECUTABLE)
-    MESSAGE(STATUS "Looking for RPMTools... - found rpmuild is ${RPMTools_RPMBUILD_EXECUTABLE}")
+    MESSAGE(STATUS "Looking for rpmbuild... - found rpmuild is ${RPMTools_RPMBUILD_EXECUTABLE}")
     SET(RPMTools_RPMBUILD_FOUND "YES")
     GET_FILENAME_COMPONENT(RPMTools_BINARY_DIRS ${RPMTools_RPMBUILD_EXECUTABLE} PATH)
   ELSE (RPMTools_RPMBUILD_EXECUTABLE)
     SET(RPMTools_RPMBUILD_FOUND "NO")
-    MESSAGE(STATUS "Looking for RPMTools... - rpmbuild NOT FOUND")
+    MESSAGE(STATUS "Looking for rpmbuild... - rpmbuild NOT FOUND")
   ENDIF (RPMTools_RPMBUILD_EXECUTABLE)

   # Detect if CPack was included or not


Actually allow to enable the threading option on Emscripten platform. Define the required compiler & linker flag when enabled.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -134,7 +134,12 @@
 option (URHO3D_PACKAGING "Enable resources packaging support, on Emscripten default to 1, on other platforms default to 0" ${EMSCRIPTEN})
 option (URHO3D_PROFILING "Enable profiling support" TRUE)
 option (URHO3D_LOGGING "Enable logging support" TRUE)
-cmake_dependent_option (URHO3D_THREADING "Enable threading support" TRUE "NOT EMSCRIPTEN" FALSE)
+# Emscripten thread support is yet experimental; default false
+if (NOT EMSCRIPTEN)
+    option (URHO3D_THREADING "Enable threading support" TRUE)
+else ()
+    option (URHO3D_THREADING "Enable threading support" FALSE)
+endif ()
 option (URHO3D_TESTING "Enable testing support")
 if (URHO3D_TESTING)
     if (EMSCRIPTEN)
@@ -574,6 +579,11 @@
             # Emscripten-specific setup
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-warn-absolute-paths -Wno-unknown-warning-option")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-warn-absolute-paths -Wno-unknown-warning-option")
+            if (URHO3D_THREADING)
+                set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_PTHREADS=1")
+                set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_PTHREADS=1")
+                set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s USE_PTHREADS=1")
+            endif ()
             # Prior to version 1.31.3 emcc does not consistently add the cpp standard and remove Emscripten-specific compiler flags
             # before passing on the work to the underlying LLVM/Clang compiler, this has resulted in preprocessing error when enabling the PCH and ccache
             # (See https://github.com/kripken/emscripten/issues/3365 for more detail)


Fix a typo. Sorry. Related to commit 0d3de0117eac06f27e524a045852d4c5bf8ae63c.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -1234,16 +1234,14 @@
             elseif (NOT APPLE AND NOT RPI)
                 list (APPEND LIBS GL)
             endif ()
-        else ()
-            if (DIRECT3D_FOUND)
-                # Check if the libs are using absolute path
-                list (GET DIRECT3D_LIBRARIES 0 FIRST_LIB)
-                if (IS_ABSOLUTE ${FIRST_LIB})
-                    list (APPEND ABSOLUTE_PATH_LIIBS ${DIRECT3D_LIBRARIES})
-                else ()
-                    # Assume the libraries are found from default directories
-                    list (APPEND LIBS ${DIRECT3D_LIBRARIES})
-                endif ()
+        elseif (DIRECT3D_LIBRARIES)
+            # Check if the libs are using absolute path
+            list (GET DIRECT3D_LIBRARIES 0 FIRST_LIB)
+            if (IS_ABSOLUTE ${FIRST_LIB})
+                list (APPEND ABSOLUTE_PATH_LIBS ${DIRECT3D_LIBRARIES})
+            else ()
+                # Assume the libraries are found from default directories
+                list (APPEND LIBS ${DIRECT3D_LIBRARIES})
             endif ()
         endif ()


copy of cmake from VantageShared

copy of cmake from VantageShared

* sdClassifiedRepo (with some details omitted) function
* classified_src, classified_exclusive_src macros
* sdSetFlags macro

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

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1297,6 +1297,54 @@
   endif()
 endfunction()

+function(sdClassifiedRepo repo hash dir)
+  # details from VantageShared removed...
+  if(${repo} STREQUAL "isr.git")
+    if(EXISTS ${repo_path}/${repo} AND IS_DIRECTORY ${repo_path}/${repo})
+      set(CLASSIFIED_BUILD ON PARENT_SCOPE)
+      message(STATUS "=====================================================================")
+      message(STATUS " Classified repo found. Classified build configuration proceeding... ")
+      message(STATUS "=====================================================================")
+      xpGitCheckout(${repo_path}/${repo} ${hash} ${dir})
+      add_definitions(-DCLASS_BUILD)
+    else()
+      message(STATUS "Unclassified build, repo not accessible: ${repo_path}/${repo}")
+    endif()
+  elseif(EXISTS ${repo_path}/${repo} AND IS_DIRECTORY ${repo_path}/${repo})
+    xpGitCheckout(${repo_path}/${repo} ${hash} ${dir})
+  endif()
+endfunction()
+
+macro(classified_src srcGroup srcList)
+  file(RELATIVE_PATH rel_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+  foreach(f ${srcList})
+    if(EXISTS ${clas_repo}/${rel_path}/${f})
+      list(APPEND ${srcGroup} ${clas_repo}/${rel_path}/${f})
+      message(STATUS " CLAS: ${clas_repo}/${rel_path}/${f}")
+    else()
+      list(APPEND ${srcGroup} ${f})
+      if(EXISTS ${clas_repo})
+        message(STATUS " UNCLAS: ${CMAKE_CURRENT_SOURCE_DIR}/${f}")
+      endif()
+    endif()
+  endforeach()
+endmacro()
+
+macro(classified_exclusive_src srcGroup srcList)
+  file(RELATIVE_PATH rel_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+  if(EXISTS ${clas_repo}/${rel_path} AND IS_DIRECTORY ${clas_repo}/${rel_path})
+    include_directories(${clas_repo}/${rel_path})
+  endif()
+  foreach(f ${srcList})
+    if(EXISTS ${clas_repo}/${rel_path}/${f})
+      list(APPEND ${srcGroup} ${clas_repo}/${rel_path}/${f})
+      message(STATUS " CLAS_EXCL: ${clas_repo}/${rel_path}/${f}")
+    elseif(EXISTS ${clas_repo})
+      message(STATUS " MISSING: ${clas_repo}/${rel_path}/${f}")
+    endif()
+  endforeach()
+endmacro()
+
 function(xpPostBuildCopy theTarget copyList toPath)
   if(IS_ABSOLUTE ${toPath}) # absolute toPath
     set(dest ${toPath})
@@ -1752,3 +1800,122 @@
     endif() # C++ (GNUCXX OR Clang)
   endif()
 endmacro()
+
+macro(sdSetFlags) # set preprocessor, compiler, linker flags
+  enable_testing()
+  set_property(GLOBAL PROPERTY USE_FOLDERS ON) # enables Solution Folders
+  ######
+  option(SD_GENERATE_TESTTOOLS "include test tool projects" ON)
+  if(SD_GENERATE_TESTTOOLS)
+    set(TESTTOOL) # will be part of main solution
+  else()
+    set(TESTTOOL EXCLUDE_FROM_ALL) # generated, but not part of main solution
+  endif()
+  ######
+  option(SD_GENERATE_UNITTESTS "include unit test projects" ON)
+  if(SD_GENERATE_UNITTESTS)
+    set(UNITTEST) # will be part of main solution
+  else()
+    set(UNITTEST EXCLUDE_FROM_ALL) # generated, but not part of main solution
+  endif()
+  ######
+  xpCommonFlags()
+  xpEnableWarnings()
+  if(MSVC)
+    add_definitions(
+      -D_CRT_NONSTDC_NO_DEPRECATE
+      -D_CRT_SECURE_NO_WARNINGS
+      -D_SCL_SECURE_NO_WARNINGS
+      -D_WINSOCK_DEPRECATED_NO_WARNINGS
+      -D_WIN32_WINNT=0x0502 #(Windows Server 2003 target)
+      -DWIN32_LEAN_AND_MEAN
+      -DCURL_STATICLIB # Tell cURL not to __declspec(dllimport) its symbols.
+      )
+    xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS_DEBUG "/MANIFEST:NO")
+    # Remove Linker > System > Stack Reserve Size setting
+    string(REPLACE "/STACK:10000000" "" CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
+    # Add Linker > System > Enable Large Addresses
+    xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "/LARGEADDRESSAWARE")
+    option(SD_BUILD_VERBOSE "use verbose compiler and linker options" OFF)
+    if(SD_BUILD_VERBOSE)
+      # Report the build times
+      xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "/time")
+      # Report the linker version (32/64-bit: x86_amd64/amd64)
+      xpStringAppendIfDne(CMAKE_CXX_FLAGS "/Bv")
+    endif()
+    if(MSVC12)
+      # Remove unreferenced data and functions
+      # http://blogs.msdn.com/b/vcblog/archive/2014/03/25/linker-enhancements-in-visual-studio-2013-update-2-ctp2.aspx
+      xpStringAppendIfDne(CMAKE_CXX_FLAGS "/Zc:inline")
+    endif()
+    # Increase the number of sections that an object file can contain
+    # https://msdn.microsoft.com/en-us/library/ms173499.aspx
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/bigobj")
+    # Treat Warnings As Errors
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/WX")
+    # Treat the following warnings as errors (above and beyond Warning Level 3)
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/we4238") # don't take address of temporaries
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/we4239") # don't bind temporaries to non-const references
+    # Disable the following warnings
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/wd4503") # decorated name length exceeded, name was truncated
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/wd4351") # new behavior: elements of array will be default initialized
+  elseif(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+    include(CheckCCompilerFlag)
+    include(CheckCXXCompilerFlag)
+    option(SD_USE_ASAN "use address sanitizer" OFF)
+    if(SD_USE_ASAN)
+      xpStringAppendIfDne(CMAKE_CXX_FLAGS "-fsanitize=address")
+      add_definitions(-DSD_USE_ASAN)
+    endif()
+    check_cxx_compiler_flag("-O0" has_O0)
+    if(has_O0)
+      xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "-O0")
+    endif()
+    if(CMAKE_COMPILER_IS_GNUCXX)
+      # Have all executables look in the current directory for shared libraries
+      # so the user or installers don't need to update LD_LIBRARY_PATH or equivalent.
+      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-R,\$ORIGIN")
+      set(CMAKE_INSTALL_RPATH "\$ORIGIN")
+    endif()
+    option(SD_TREAT_WARNING_AS_ERROR "treat GCC warnings as errors" ON)
+    if(SD_TREAT_WARNING_AS_ERROR)
+      check_cxx_compiler_flag("-Werror" has_Werror)
+      if(has_Werror)
+        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-Werror")
+      endif()
+      check_c_compiler_flag("-Werror" has_c_Werror)
+      if(has_c_Werror)
+        xpStringAppendIfDne(CMAKE_C_FLAGS "-Werror")
+      endif()
+    endif()
+    option(SD_COVERAGE "compile for gcov code coverage in debug configuration" OFF)
+    if(SD_COVERAGE)
+      xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "--coverage")
+    endif()
+    if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
+      # Makes symbols in executables inaccessible from plugins.
+      xpStringRemoveIfExists(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-rdynamic")
+      # Makes symbols hidden by default in shared libraries.  This allows
+      # SDL-developed plugins compiled against different versions of
+      # VantageShared to coexist without using each other's symbols.
+      check_cxx_compiler_flag("-fvisibility=hidden" has_visibility)
+      if(has_visibility)
+        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-fvisibility=hidden")
+      endif()
+      # Prevents symbols from external static libraries from being visible
+      # in the shared libraries that use them.  This allows
+      # SDL-developed plugins compiled against different versions of third-
+      # party libraries to coexist without using each other's symbols.
+      check_cxx_compiler_flag("-Wl,--exclude-libs,ALL" has_exclude)
+      if(has_exclude)
+        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-Wl,--exclude-libs,ALL")
+      endif()
+    endif()
+    if(NOT CMAKE_BUILD_TYPE) # if not specified, default to "Release"
+      set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+        FORCE
+        )
+    endif()
+  endif()
+endmacro()


remove compiler checks inside xpSetMsvcFlags, xpSetGccFlags

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

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1802,106 +1802,102 @@
 endmacro()

 macro(xpSetMsvcFlags)
-  if(MSVC)
-    add_definitions(
-      -D_CRT_NONSTDC_NO_DEPRECATE
-      -D_CRT_SECURE_NO_WARNINGS
-      -D_SCL_SECURE_NO_WARNINGS
-      -D_WINSOCK_DEPRECATED_NO_WARNINGS
-      -D_WIN32_WINNT=0x0502 #(Windows Server 2003 target)
-      -DWIN32_LEAN_AND_MEAN
-      -DCURL_STATICLIB # Tell cURL not to __declspec(dllimport) its symbols.
+  add_definitions(
+    -D_CRT_NONSTDC_NO_DEPRECATE
+    -D_CRT_SECURE_NO_WARNINGS
+    -D_SCL_SECURE_NO_WARNINGS
+    -D_WINSOCK_DEPRECATED_NO_WARNINGS
+    -D_WIN32_WINNT=0x0502 #(Windows Server 2003 target)
+    -DWIN32_LEAN_AND_MEAN
+    -DCURL_STATICLIB # Tell cURL not to __declspec(dllimport) its symbols.
+    )
+  xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS_DEBUG "/MANIFEST:NO")
+  # Remove Linker > System > Stack Reserve Size setting
+  string(REPLACE "/STACK:10000000" "" CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
+  # Add Linker > System > Enable Large Addresses
+  xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "/LARGEADDRESSAWARE")
+  option(SD_BUILD_VERBOSE "use verbose compiler and linker options" OFF)
+  if(SD_BUILD_VERBOSE)
+    # Report the build times
+    xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "/time")
+    # Report the linker version (32/64-bit: x86_amd64/amd64)
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/Bv")
+  endif()
+  if(MSVC12)
+    # Remove unreferenced data and functions
+    # http://blogs.msdn.com/b/vcblog/archive/2014/03/25/linker-enhancements-in-visual-studio-2013-update-2-ctp2.aspx
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/Zc:inline")
+  endif()
+  # Increase the number of sections that an object file can contain
+  # https://msdn.microsoft.com/en-us/library/ms173499.aspx
+  xpStringAppendIfDne(CMAKE_CXX_FLAGS "/bigobj")
+  # Treat Warnings As Errors
+  xpStringAppendIfDne(CMAKE_CXX_FLAGS "/WX")
+  # Treat the following warnings as errors (above and beyond Warning Level 3)
+  xpStringAppendIfDne(CMAKE_CXX_FLAGS "/we4238") # don't take address of temporaries
+  xpStringAppendIfDne(CMAKE_CXX_FLAGS "/we4239") # don't bind temporaries to non-const references
+  # Disable the following warnings
+  xpStringAppendIfDne(CMAKE_CXX_FLAGS "/wd4503") # decorated name length exceeded, name was truncated
+  xpStringAppendIfDne(CMAKE_CXX_FLAGS "/wd4351") # new behavior: elements of array will be default initialized
+endmacro()
+
+macro(xpSetGccFlags)
+  include(CheckCCompilerFlag)
+  include(CheckCXXCompilerFlag)
+  option(SD_USE_ASAN "use address sanitizer" OFF)
+  if(SD_USE_ASAN)
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS "-fsanitize=address")
+    add_definitions(-DSD_USE_ASAN)
+  endif()
+  check_cxx_compiler_flag("-O0" has_O0)
+  if(has_O0)
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "-O0")
+  endif()
+  if(CMAKE_COMPILER_IS_GNUCXX)
+    # Have all executables look in the current directory for shared libraries
+    # so the user or installers don't need to update LD_LIBRARY_PATH or equivalent.
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-R,\$ORIGIN")
+    set(CMAKE_INSTALL_RPATH "\$ORIGIN")
+  endif()
+  option(SD_TREAT_WARNING_AS_ERROR "treat GCC warnings as errors" ON)
+  if(SD_TREAT_WARNING_AS_ERROR)
+    check_cxx_compiler_flag("-Werror" has_Werror)
+    if(has_Werror)
+      xpStringAppendIfDne(CMAKE_CXX_FLAGS "-Werror")
+    endif()
+    check_c_compiler_flag("-Werror" has_c_Werror)
+    if(has_c_Werror)
+      xpStringAppendIfDne(CMAKE_C_FLAGS "-Werror")
+    endif()
+  endif()
+  option(SD_COVERAGE "compile for gcov code coverage in debug configuration" OFF)
+  if(SD_COVERAGE)
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "--coverage")
+  endif()
+  if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
+    # Makes symbols in executables inaccessible from plugins.
+    xpStringRemoveIfExists(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-rdynamic")
+    # Makes symbols hidden by default in shared libraries.  This allows
+    # SDL-developed plugins compiled against different versions of
+    # VantageShared to coexist without using each other's symbols.
+    check_cxx_compiler_flag("-fvisibility=hidden" has_visibility)
+    if(has_visibility)
+      xpStringAppendIfDne(CMAKE_CXX_FLAGS "-fvisibility=hidden")
+    endif()
+    # Prevents symbols from external static libraries from being visible
+    # in the shared libraries that use them.  This allows
+    # SDL-developed plugins compiled against different versions of third-
+    # party libraries to coexist without using each other's symbols.
+    check_cxx_compiler_flag("-Wl,--exclude-libs,ALL" has_exclude)
+    if(has_exclude)
+      xpStringAppendIfDne(CMAKE_CXX_FLAGS "-Wl,--exclude-libs,ALL")
+    endif()
+  endif()
+  if(NOT CMAKE_BUILD_TYPE) # if not specified, default to "Release"
+    set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+      FORCE
       )
-    xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS_DEBUG "/MANIFEST:NO")
-    # Remove Linker > System > Stack Reserve Size setting
-    string(REPLACE "/STACK:10000000" "" CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
-    # Add Linker > System > Enable Large Addresses
-    xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "/LARGEADDRESSAWARE")
-    option(SD_BUILD_VERBOSE "use verbose compiler and linker options" OFF)
-    if(SD_BUILD_VERBOSE)
-      # Report the build times
-      xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "/time")
-      # Report the linker version (32/64-bit: x86_amd64/amd64)
-      xpStringAppendIfDne(CMAKE_CXX_FLAGS "/Bv")
-    endif()
-    if(MSVC12)
-      # Remove unreferenced data and functions
-      # http://blogs.msdn.com/b/vcblog/archive/2014/03/25/linker-enhancements-in-visual-studio-2013-update-2-ctp2.aspx
-      xpStringAppendIfDne(CMAKE_CXX_FLAGS "/Zc:inline")
-    endif()
-    # Increase the number of sections that an object file can contain
-    # https://msdn.microsoft.com/en-us/library/ms173499.aspx
-    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/bigobj")
-    # Treat Warnings As Errors
-    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/WX")
-    # Treat the following warnings as errors (above and beyond Warning Level 3)
-    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/we4238") # don't take address of temporaries
-    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/we4239") # don't bind temporaries to non-const references
-    # Disable the following warnings
-    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/wd4503") # decorated name length exceeded, name was truncated
-    xpStringAppendIfDne(CMAKE_CXX_FLAGS "/wd4351") # new behavior: elements of array will be default initialized
-  endif()
-endmacro()
-
-macro(xpSetGccFlags)
-  if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
-    include(CheckCCompilerFlag)
-    include(CheckCXXCompilerFlag)
-    option(SD_USE_ASAN "use address sanitizer" OFF)
-    if(SD_USE_ASAN)
-      xpStringAppendIfDne(CMAKE_CXX_FLAGS "-fsanitize=address")
-      add_definitions(-DSD_USE_ASAN)
-    endif()
-    check_cxx_compiler_flag("-O0" has_O0)
-    if(has_O0)
-      xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "-O0")
-    endif()
-    if(CMAKE_COMPILER_IS_GNUCXX)
-      # Have all executables look in the current directory for shared libraries
-      # so the user or installers don't need to update LD_LIBRARY_PATH or equivalent.
-      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-R,\$ORIGIN")
-      set(CMAKE_INSTALL_RPATH "\$ORIGIN")
-    endif()
-    option(SD_TREAT_WARNING_AS_ERROR "treat GCC warnings as errors" ON)
-    if(SD_TREAT_WARNING_AS_ERROR)
-      check_cxx_compiler_flag("-Werror" has_Werror)
-      if(has_Werror)
-        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-Werror")
-      endif()
-      check_c_compiler_flag("-Werror" has_c_Werror)
-      if(has_c_Werror)
-        xpStringAppendIfDne(CMAKE_C_FLAGS "-Werror")
-      endif()
-    endif()
-    option(SD_COVERAGE "compile for gcov code coverage in debug configuration" OFF)
-    if(SD_COVERAGE)
-      xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "--coverage")
-    endif()
-    if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
-      # Makes symbols in executables inaccessible from plugins.
-      xpStringRemoveIfExists(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-rdynamic")
-      # Makes symbols hidden by default in shared libraries.  This allows
-      # SDL-developed plugins compiled against different versions of
-      # VantageShared to coexist without using each other's symbols.
-      check_cxx_compiler_flag("-fvisibility=hidden" has_visibility)
-      if(has_visibility)
-        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-fvisibility=hidden")
-      endif()
-      # Prevents symbols from external static libraries from being visible
-      # in the shared libraries that use them.  This allows
-      # SDL-developed plugins compiled against different versions of third-
-      # party libraries to coexist without using each other's symbols.
-      check_cxx_compiler_flag("-Wl,--exclude-libs,ALL" has_exclude)
-      if(has_exclude)
-        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-Wl,--exclude-libs,ALL")
-      endif()
-    endif()
-    if(NOT CMAKE_BUILD_TYPE) # if not specified, default to "Release"
-      set(CMAKE_BUILD_TYPE "Release" CACHE STRING
-        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
-        FORCE
-        )
-    endif()
   endif()
 endmacro()


Fixed nosetest command in CMakeLists.txt.

--- catkin.cmake
+++ catkin.cmake
@@ -81,5 +81,5 @@

 # Tests
 if(CATKIN_ENABLE_TESTING)
-    cmake_add_nosetests(tests/test_Planner.py)
+    catkin_add_nosetests(tests/test_Planner.py)
 endif(CATKIN_ENABLE_TESTING)


ENH: getting rid of mandatory vtk download

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -91,7 +91,7 @@
 set(ITK_EXTERNAL_NAME ITKv${ITK_VERSION_MAJOR})

 #set(${LOCAL_PROJECT_NAME}_DEPENDENCIES ${ITK_EXTERNAL_NAME} VTK SlicerExecutionModel)
-set(${LOCAL_PROJECT_NAME}_DEPENDENCIES ${ITK_EXTERNAL_NAME} VTK)
+set(${LOCAL_PROJECT_NAME}_DEPENDENCIES ${ITK_EXTERNAL_NAME} )

 if(BUILD_STYLE_UTILS)
   list(APPEND ${LOCAL_PROJECT_NAME}_DEPENDENCIES Cppcheck KWStyle Uncrustify)


extension building test

extension building test

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -7,13 +7,14 @@
 if (DEFINED ${LOCAL_PROJECT_NAME}_BUILD_SLICER_EXTENSION)
   message(STATUS "-----------------------------BUILD_SLICER_EXTENSION defined------------------------------ Slicer_DIR : ${Slicer_DIR} ")

-  if (${LOCAL_PROJECT_NAME}_BUILD_SLICER_EXTENSION)
-    find_package(Slicer REQUIRED)
-    include(${Slicer_USE_FILE})
-    if (Slicer_REQUIRED_QT_VERSION VERSION_GREATER "4.9")
-      set(_qt_version "5")
-    endif()
+
+  find_package(Slicer REQUIRED)
+  include(${Slicer_USE_FILE})
+  message(STATUS "-----------------------------BUILD_SLICER_EXTENSION defined------------------------------ Slicer found !")
+  if (Slicer_REQUIRED_QT_VERSION VERSION_GREATER "4.9")
+    set(_qt_version "5")
   endif()
+

   set(extension_args "")


Don't clear the CTK_EXTERNAL_LIBRARY_DIRS variable.

This variable has been set in the external project's CMake files,
included from the top-level CMakeLists.txt script.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -25,12 +25,11 @@
 #-----------------------------------------------------------------------------

 #-----------------------------------------------------------------------------
-# Declare CTK_EXTERNAL_LIBRARY_DIRS variable - This variable stores
+# The CTK_EXTERNAL_LIBRARY_DIRS variable stores
 # the library output directory associated with the different external project
 # It's then used in CMake/LastConfigureStep/CTKGenerateCTKConfig.cmake to
 # configure CTKConfig.cmake.in
 # This variable would then be exposed to project building against CTK
-set(CTK_EXTERNAL_LIBRARY_DIRS)

 #-----------------------------------------------------------------------------
 # Make sure ${CTK_BINARY_DIR}/CTK-build/bin exists


Fixed and simplified build with static Sofia-SIP.

--- FindSofia.cmake
+++ FindSofia.cmake
@@ -97,9 +97,13 @@
 			"${SOFIA_SOURCE_DIR}/libsofia-sip-ua/.libs")
 		if (WIN32)
 			if (SOFIA_PTW32_STATIC)
-				set (_sofia_hints ${_sofia_hints} "${SOFIA_SOURCE_DIR}/win32/pthread/x64/LibR")
+				set (_sofia_hints ${_sofia_hints}
+					"${SOFIA_SOURCE_DIR}/win32/pthread/x64/LibR"
+					"${SOFIA_SOURCE_DIR}/win32/pthread/x64/Release")
 			else (SOFIA_PTW32_STATIC)
-				set (_sofia_hints ${_sofia_hints} "${SOFIA_SOURCE_DIR}/win32/pthread/x64/Release")
+				set (_sofia_hints ${_sofia_hints}
+					"${SOFIA_SOURCE_DIR}/win32/pthread/x64/Release"
+					"${SOFIA_SOURCE_DIR}/win32/pthread/x64/LibR")
 			endif (SOFIA_PTW32_STATIC)
 		endif (WIN32)
 	endif (SOFIA_SOURCE_DIR)
@@ -137,6 +141,9 @@
 		if (OPENSSL_LIBRARIES)
 			set (SOFIA_LIBRARIES ${SOFIA_LIBRARIES} ${OPENSSL_LIBRARIES})
 		endif (OPENSSL_LIBRARIES)
+		if (UNIX)
+			set (SOFIA_LIBRARIES ${SOFIA_LIBRARIES} rt)
+		endif (UNIX)
 	endif (NOT SOFIA_LIBRARIES)
 	set (SOFIA_DEFINES -DLIBSOFIA_SIP_UA_STATIC)
 	if (WIN32 AND SOFIA_PTW32_STATIC)


Fix cmake windows build of native audio standalone

Signed-off-by: falkTX <d7e5958cbb080ba57e41fb602ade747e1a2da17c@falktx.com>

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -238,6 +238,8 @@
       "${APPLE_COREAUDIO_FRAMEWORK}"
       "${APPLE_COREFOUNDATION_FRAMEWORK}"
       "${APPLE_COREMIDI_FRAMEWORK}")
+  elseif(WIN32)
+    target_link_libraries("${NAME}-jack" PRIVATE "dsound" "ole32" "winmm")
   endif()
 endfunction()


Let Travis-CI find the OpenCL version

Let Travis-CI find the OpenCL version

--- cmake/FindOpenCL.cmake
+++ cmake/FindOpenCL.cmake
@@ -75,7 +75,7 @@

 find_path(OpenCL_INCLUDE_DIR
   NAMES
-    cl.h
+    CL/cl.h OpenCL/cl.h
   PATHS
     ENV "PROGRAMFILES(X86)"
     ENV AMDAPPSDKROOT
@@ -84,7 +84,6 @@
     ENV CUDA_PATH
     ENV ATISTREAMSDKROOT

-    /usr/include/CL
   PATH_SUFFIXES
     include
     OpenCL/common/inc


Fix OpenSL library name

Fix OpenSL library name

--- cmake/FindOpenSL.cmake
+++ cmake/FindOpenSL.cmake
@@ -46,7 +46,7 @@
           DOC "The OpenSL Android include directory"
 )

-find_library(OPENSL_LIBRARY NAMES OpenSL
+find_library(OPENSL_LIBRARY NAMES OpenSLES
              DOC "The OpenSL library"
 )


cmake: support absolute path in zephyr_code_relocate() function

Fixes: #27288

The Zephyr CMake function `zephyr_code_relocate()` would treat any file
argument as relative to `CMAKE_CURRENT_SOURCE_DIR` even if an absolute
path is provided.

A file with absolute path would thus become
`${CMAKE_CURRENT_SOURCE_DIR}/<absolute-path>/<file>` which leads to a
non existing file.

This is fixed by checking if path argument is a relative path, and only
use `CMAKE_CURRENT_SOURCE_DIR` in such case.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -1012,9 +1012,12 @@
 # Helper function for CONFIG_CODE_DATA_RELOCATION
 # Call this function with 2 arguments file and then memory location
 function(zephyr_code_relocate file location)
+  if(NOT IS_ABSOLUTE ${file})
+    set(file ${CMAKE_CURRENT_SOURCE_DIR}/${file})
+  endif()
   set_property(TARGET code_data_relocation_target
     APPEND PROPERTY COMPILE_DEFINITIONS
-    "${location}:${CMAKE_CURRENT_SOURCE_DIR}/${file}")
+    "${location}:${file}")
 endfunction()

 # Usage:


Version check problem

Version check problem

--- cmake/nvcc-check.cmake
+++ cmake/nvcc-check.cmake
@@ -1,58 +1,57 @@
-######################################################################
-# Based on a script by James Shackleford in Plastimatch.org
-# Modified by Simon Rit
-#
-# Currently, nvcc works with gcc-4.3 and gcc-4.4 for CUDA 4.x
-#
-# This script:
-#   * Checks the version of default gcc
-#   * If CUDA 4.x, we look for gcc-4.4
-#   * If not found or CUDA<4, we look for gcc-4.3 on the system
-#   * If found we tell nvcc to use it
-#   * If not found, fatal error
-######################################################################
-
-# This function searches for gcc version x.y (arguments 2 and 3 of the macro)
-# Return the result in argument 1, empty if not found
-FUNCTION(FIND_GCC GCC_PATH GCC_MAJOR GCC_MINOR)
-
-  # Search for gcc-x.y
-  FIND_PROGRAM(EXACT_GCC "gcc-${GCC_MAJOR}.${GCC_MINOR}")
-  IF(EXACT_GCC)
-    SET(GCC_PATH "${EXACT_GCC}" PARENT_SCOPE)
-  ELSE(EXACT_GCC)
-    # gcc-x.y not found, check default gcc
-    FIND_PROGRAM(DEFAULT_GCC gcc)
-    EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)
-
-    # Get major and minor revs
-    STRING(REGEX REPLACE "([0-9]+).[0-9]+.[0-9]+" "\\1" GCCVER_MAJOR "${GCCVER}")
-    STRING(REGEX REPLACE "[0-9]+.([0-9]+).[0-9]+" "\\1" GCCVER_MINOR "${GCCVER}")
-    STRING(REGEX REPLACE "[0-9]+.[0-9]+.([0-9]+)" "\\1" GCCVER_PATCH "${GCCVER}")
-
-    # Check that adequate
-    IF("${GCCVER_MAJOR}" MATCHES "${GCC_MAJOR}" AND "${GCCVER_MINOR}" MATCHES "${GCC_MINOR}")
-        SET(GCC_PATH ${DEFAULT_GCC} PARENT_SCOPE)
-    ENDIF(GCCVER_MAJOR MATCHES GCC_MAJOR AND GCCVER_MINOR MATCHES GCC_MINOR)
-  ENDIF(EXACT_GCC)
-
-ENDFUNCTION(FIND_GCC)
-
-# Main code dealing with each version of cuda
-IF(CUDA_FOUND AND CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCC)
-  SET(GCC_PATH "")
-  IF(CUDA_VERSION_MAJOR MATCHES "4")
-    FIND_GCC(GCC_PATH "4" "4")
-  ENDIF(CUDA_VERSION_MAJOR MATCHES "4")
-  IF(NOT GCC_PATH OR CUDA_VERSION_MAJOR LESS "3")
-    FIND_GCC(GCC_PATH "4" "3")
-  ENDIF(NOT GCC_PATH OR CUDA_VERSION_MAJOR LESS "3")
-
-  IF(GCC_PATH)
-    MESSAGE(STATUS "nvcc-check: Found adequate gcc (${GCC_PATH})... telling nvcc to use it!")
-    SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --compiler-bindir=${GCC_PATH})
-  ELSE(GCC_PATH)
-    MESSAGE(FATAL_ERROR "nvcc-check: Please install adequate gcc for cuda (gcc-4.3 or gcc-4.4 for Cuda 4).\nNote that gcc-4.x can be installed side-by-side with your current version of gcc.\n")
-  ENDIF(GCC_PATH)
-ENDIF(CUDA_FOUND AND CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCC)
-
+######################################################################
+# Based on a script by James Shackleford in Plastimatch.org
+# Modified by Simon Rit
+#
+# Currently, nvcc works with gcc-4.3 and gcc-4.4 for CUDA 4.x
+#
+# This script:
+#   * Checks the version of default gcc
+#   * If CUDA 4.x, we look for gcc-4.4
+#   * If not found or CUDA<4, we look for gcc-4.3 on the system
+#   * If found we tell nvcc to use it
+#   * If not found, fatal error
+######################################################################
+
+# This function searches for gcc version x.y (arguments 2 and 3 of the macro)
+# Return the result in argument 1, empty if not found
+FUNCTION(FIND_GCC GCC_PATH GCC_MAJOR GCC_MINOR)
+
+  # Search for gcc-x.y
+  FIND_PROGRAM(EXACT_GCC "gcc-${GCC_MAJOR}.${GCC_MINOR}")
+  IF(EXACT_GCC)
+    SET(GCC_PATH "${EXACT_GCC}" PARENT_SCOPE)
+  ELSE(EXACT_GCC)
+    # gcc-x.y not found, check default gcc
+    FIND_PROGRAM(DEFAULT_GCC gcc)
+    EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)
+
+    # Get major and minor revs
+    STRING(REGEX REPLACE "([0-9]+).[0-9]+" "\\1" GCCVER_MAJOR "${GCCVER}")
+    STRING(REGEX REPLACE "[0-9]+.([0-9]+)" "\\1" GCCVER_MINOR "${GCCVER}")
+
+    # Check that adequate
+    IF("${GCCVER_MAJOR}" MATCHES "${GCC_MAJOR}" AND "${GCCVER_MINOR}" MATCHES "${GCC_MINOR}")
+        SET(GCC_PATH ${DEFAULT_GCC} PARENT_SCOPE)
+    ENDIF()
+  ENDIF(EXACT_GCC)
+
+ENDFUNCTION(FIND_GCC)
+
+# Main code dealing with each version of cuda
+IF(CUDA_FOUND AND CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+  SET(GCC_PATH "")
+  IF(CUDA_VERSION_MAJOR MATCHES "4")
+    FIND_GCC(GCC_PATH "4" "4")
+  ENDIF(CUDA_VERSION_MAJOR MATCHES "4")
+  IF(NOT GCC_PATH OR CUDA_VERSION_MAJOR LESS "3")
+    FIND_GCC(GCC_PATH "4" "3")
+  ENDIF(NOT GCC_PATH OR CUDA_VERSION_MAJOR LESS "3")
+
+  IF(GCC_PATH)
+    MESSAGE(STATUS "nvcc-check: Found adequate gcc (${GCC_PATH})... telling nvcc to use it!")
+    SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --compiler-bindir=${GCC_PATH})
+  ELSE(GCC_PATH)
+    MESSAGE(FATAL_ERROR "nvcc-check: Please install adequate gcc for cuda (gcc-4.3 or gcc-4.4 for Cuda 4).\nNote that gcc-4.x can be installed side-by-side with your current version of gcc.\n")
+  ENDIF(GCC_PATH)
+ENDIF(CUDA_FOUND AND CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+


Fix microbit loadable format    => needs to be ihex

--- Source/PLT/target/microbit/config.cmake
+++ Source/PLT/target/microbit/config.cmake
@@ -59,7 +59,7 @@

 set(CMAKE_C_LINK_EXECUTABLE
     "${PLT_prefix}ld ${PLT_ld_flags} <OBJECTS> -o <TARGET> <LINK_LIBRARIES>; \
-     ${CMAKE_OBJCOPY} -O binary <TARGET> <TARGET>.bin; \
+     ${CMAKE_OBJCOPY} -O ihex <TARGET> <TARGET>.hex; \
      ${CMAKE_OBJDUMP} -d <TARGET>; \
      ${CMAKE_SIZE} <TARGET>")


Updated build byproduct

Updated build byproduct

--- cmake/modules/Build-sqlpp11-connector-mysql.cmake
+++ cmake/modules/Build-sqlpp11-connector-mysql.cmake
@@ -2,8 +2,8 @@

 if(WIN32)
   set(_byproducts
-    ${SQLPP11_MYSQL_INSTALL_DIR}/bin/sqlpp11-ddl2cpp.exe
-    ${SQLPP11_MYSQL_INSTALL_DIR}/lib/libsqlpp-mysql.lib
+    ${SQLPP11_MYSQL_INSTALL_DIR}/bin/sqlpp11-ddl2cpp
+    ${SQLPP11_MYSQL_INSTALL_DIR}/lib/sqlpp-mysql.lib
   )
   ExternalProject_Add(
     sqlpp11-connector-mysql


fbcode_builder: update ThriftCppLibrary to use fb_cmake_parse_args()

Summary:
Change ThriftCppLibrary to use `fb_cmake_parse_args()`

This code doesn't really care much about handling empty arguments, so we could
use the standard `cmake_parse_arguments()` function here instead of
`fb_cmake_parse_args()`.  However, it is slightly more convenient that
`fb_cmake_parse_args()` automatically errors out on unhandled arguments, so
that we don't have to check for this ourselves.

Reviewed By: wez

Differential Revision: D16738445

fbshipit-source-id: 67b9761f2ceaf7665bd336290bb44af32fec6f4a

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -1,34 +1,13 @@
 # Copyright (c) Facebook, Inc. and its affiliates.
 # NOTE: If you change this file, fbcode/fboss/github/ThriftCppLibrary.cmake also
 # needs to be changed.  TODO: this should be handled via shipit.
+
+include(FBCMakeParseArgs)
+
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
-  set(SERVICES)
-  set(DEPENDS)
-  set(GEN_ARGS)
-  set(mode "UNSET")
-  foreach(arg IN LISTS ARGN)
-    if("${arg}" STREQUAL "SERVICES")
-      set(mode "SERVICES")
-    elseif("${arg}" STREQUAL "DEPENDS")
-      set(mode "DEPENDS")
-    elseif("${arg}" STREQUAL "OPTIONS")
-      set(mode "OPTIONS")
-    else()
-      if("${mode}" STREQUAL "SERVICES")
-        list(APPEND SERVICES "${arg}")
-      elseif("${mode}" STREQUAL "DEPENDS")
-        list(APPEND DEPENDS "${arg}")
-      elseif("${mode}" STREQUAL "OPTIONS")
-        list(APPEND GEN_ARGS "${arg}")
-      else()
-        message(
-          FATAL_ERROR
-          "expected SERVICES, DEPENDS, or OPTIONS argument, found ${arg}"
-        )
-      endif()
-    endif()
-  endforeach()
+  set(multi_value_args SERVICES DEPENDS OPTIONS)
+  fb_cmake_parse_args(ARG "" "" "${multi_value_args}" "${ARGN}")

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -42,11 +21,11 @@
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)

   if (NOT "${include_prefix}" STREQUAL "")
-    list(APPEND GEN_ARGS "include_prefix=${include_prefix}")
+    list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
   endif()
   # CMake 3.12 is finally getting a list(JOIN) function, but until then
   # treating the list as a string and replacing the semicolons is good enough.
-  string(REPLACE ";" "," GEN_ARG_STR "${GEN_ARGS}")
+  string(REPLACE ";" "," GEN_ARG_STR "${ARG_OPTIONS}")

   # Compute the list of generated files
   list(APPEND generated_headers
@@ -61,7 +40,7 @@
     ${output_dir}/gen-cpp2/${base}_data.cpp
     ${output_dir}/gen-cpp2/${base}_types.cpp
   )
-  foreach(service IN LISTS SERVICES)
+  foreach(service IN LISTS ARG_SERVICES)
     list(APPEND generated_headers
       ${output_dir}/gen-cpp2/${service}.h
       ${output_dir}/gen-cpp2/${service}.tcc
@@ -77,7 +56,7 @@
   endforeach()

   list(APPEND thrift_include_options -I ${CMAKE_SOURCE_DIR})
-  foreach(depends IN LISTS DEPENDS)
+  foreach(depends IN LISTS ARG_DEPENDS)
     get_property(thrift_include_directory
       TARGET ${depends}
       PROPERTY THRIFT_INCLUDE_DIRECTORY)
@@ -114,7 +93,7 @@
     MAIN_DEPENDENCY
       ${THRIFT_FILE}
     DEPENDS
-      ${DEPENDS}
+      ${ARG_DEPENDS}
   )

   # Now emit the library rule to compile the sources
@@ -139,7 +118,7 @@
   target_link_libraries(
     ${LIB_NAME}
     PUBLIC
-      ${DEPENDS}
+      ${ARG_DEPENDS}
       FBThrift::thriftcpp2
       Folly::folly
   )


update

update

--- modules/zlib.cmake
+++ modules/zlib.cmake
@@ -5,11 +5,14 @@
   # C4131: 'function' : uses old-style declarator
   # C4210: nonstandard extension used : function given file scope
   # C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data
+  set(CMAKE_OLD_C_FLAGS ${CMAKE_C_FLAGS})
+  set(CMAKE_OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
   if(CMAKE_MAKE_PROGRAM MATCHES "(MSBuild|devenv|msdev|nmake)")
-    set(CMAKE_OLD_C_FLAGS ${CMAKE_C_FLAGS})
-    set(CMAKE_OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4131 /wd4210 /wd4244")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4127 /wd4131 /wd4210 /wd4244")
+  elseif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
   endif()

   # Set module options
@@ -34,9 +37,7 @@
   set_target_properties(example minigzip PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)

   # Restore default warnings
-  if(CMAKE_MAKE_PROGRAM MATCHES "(MSBuild|devenv|msdev|nmake)")
-    set(CMAKE_C_FLAGS ${CMAKE_OLD_C_FLAGS})
-    set(CMAKE_CXX_FLAGS ${CMAKE_OLD_CXX_FLAGS})
-  endif()
+  set(CMAKE_C_FLAGS ${CMAKE_OLD_C_FLAGS})
+  set(CMAKE_CXX_FLAGS ${CMAKE_OLD_CXX_FLAGS})

 endif()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

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


fbcode_builder: fix install_fb_python_library() to work with old CMake versions

Summary:
Update install_fb_python_library() to work with CMake versions older than 3.7.

Previously the code used a generator expression in the directory argument
supplied to `install(DIRECTORY)`.  Support for generators in this parameter
was only added in CMake 3.5, but it was buggy and did not correctly handle
absolute paths until 3.7.

This updates the code to avoid using a generator expression.  This does
require that the corresponding `add_fb_python_library()` statement appear
before the `install_fb_python_library()` statement, but this seems like a
pretty reasonable restriction.

Reviewed By: chadaustin

Differential Revision: D17103597

fbshipit-source-id: 54d6af93a3f530373cfe3137db99436d8484f308

--- build/fbcode_builder/CMake/FBPythonBinary.cmake
+++ build/fbcode_builder/CMake/FBPythonBinary.cmake
@@ -369,10 +369,9 @@

   # Copy the intermediate install directory generated at build time into
   # the desired install location.
-  set(dest_dir "$<TARGET_PROPERTY:${LIB_NAME}.py_lib_install,INSTALL_DIR>")
-  set(
-    build_install_dir
-    "$<TARGET_PROPERTY:${LIB_NAME}.py_lib_install,BUILD_INSTALL_DIR>"
+  get_target_property(dest_dir "${LIB_NAME}.py_lib_install" "INSTALL_DIR")
+  get_target_property(
+    build_install_dir "${LIB_NAME}.py_lib_install" "BUILD_INSTALL_DIR"
   )
   install(
     DIRECTORY "${build_install_dir}/${LIB_NAME}"