Downgraded string append to string concat for cmake 3.1

--- cmake/FindBoost.cmake
+++ cmake/FindBoost.cmake
@@ -1203,7 +1203,7 @@
   math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
   math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")

-  string(APPEND Boost_ERROR_REASON
+  string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
     "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
   if(Boost_DEBUG)
     message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@@ -1226,16 +1226,16 @@
     endif()
     if(NOT Boost_FOUND)
       # State that we found a version of Boost that is too new or too old.
-      string(APPEND Boost_ERROR_REASON
+      string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
         "\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
       if (Boost_FIND_VERSION_PATCH)
-        string(APPEND Boost_ERROR_REASON
+        string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
           ".${Boost_FIND_VERSION_PATCH}")
       endif ()
       if (NOT Boost_FIND_VERSION_EXACT)
-        string(APPEND Boost_ERROR_REASON " (or newer)")
+        string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON} " (or newer)")
       endif ()
-      string(APPEND Boost_ERROR_REASON ".")
+      string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON} ".")
     endif ()
   else()
     # Caller will accept any Boost version.
@@ -1243,7 +1243,7 @@
   endif()
 else()
   set(Boost_FOUND 0)
-  string(APPEND Boost_ERROR_REASON
+  string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
     "Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
 endif()

@@ -1324,25 +1324,25 @@
   if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC"
           OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
           OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
-    string(APPEND _boost_DEBUG_ABI_TAG "g")
+    string(CONCAT _boost_DEBUG_ABI_TAG ${_boost_DEBUG_ABI_TAG} "g")
   endif()
 endif()
 #  y        using special debug build of python
 if(Boost_USE_DEBUG_PYTHON)
-  string(APPEND _boost_DEBUG_ABI_TAG "y")
+  string(CONCAT _boost_DEBUG_ABI_TAG ${_boost_DEBUG_ABI_TAG} "y")
 endif()
 #  d        using a debug version of your code
-string(APPEND _boost_DEBUG_ABI_TAG "d")
+string(CONCAT _boost_DEBUG_ABI_TAG ${_boost_DEBUG_ABI_TAG} "d")
 #  p        using the STLport standard library rather than the
 #           default one supplied with your compiler
 if(Boost_USE_STLPORT)
-  string(APPEND _boost_RELEASE_ABI_TAG "p")
-  string(APPEND _boost_DEBUG_ABI_TAG "p")
+  string(CONCAT _boost_RELEASE_ABI_TAG ${_boost_RELEASE_ABI_TAG} "p")
+  string(CONCAT _boost_DEBUG_ABI_TAG ${_boost_DEBUG_ABI_TAG} "p")
 endif()
 #  n        using the STLport deprecated "native iostreams" feature
 if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
-  string(APPEND _boost_RELEASE_ABI_TAG "n")
-  string(APPEND _boost_DEBUG_ABI_TAG "n")
+  string(CONCAT _boost_RELEASE_ABI_TAG ${_boost_RELEASE_ABI_TAG} "n")
+  string(CONCAT _boost_DEBUG_ABI_TAG ${_boost_DEBUG_ABI_TAG} "n")
 endif()

 if(Boost_DEBUG)
@@ -1664,25 +1664,25 @@
     set(Boost_FOUND 0)
     # We were unable to find some libraries, so generate a sensible
     # error message that lists the libraries we were unable to find.
-    string(APPEND Boost_ERROR_REASON
+    string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
       "\nCould not find the following")
     if(Boost_USE_STATIC_LIBS)
-      string(APPEND Boost_ERROR_REASON " static")
-    endif()
-    string(APPEND Boost_ERROR_REASON
+      string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON} " static")
+    endif()
+    string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
       " Boost libraries:\n")
     foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
-      string(APPEND Boost_ERROR_REASON
+      string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
         "        ${Boost_NAMESPACE}_${COMPONENT}\n")
     endforeach()

     list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
     list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
     if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
-      string(APPEND Boost_ERROR_REASON
+      string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
         "No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
     else ()
-      string(APPEND Boost_ERROR_REASON
+      string(CONCAT Boost_ERROR_REASON ${Boost_ERROR_REASON}
         "Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
     endif ()
   endif ()
@@ -1706,9 +1706,9 @@
     endif()

     if(EXISTS "${_boost_LIB_DIR}/lib")
-      string(APPEND _boost_LIB_DIR /lib)
+      string(CONCAT _boost_LIB_DIR ${_boost_LIB_DIR} "/lib")
     elseif(EXISTS "${_boost_LIB_DIR}/stage/lib")
-      string(APPEND _boost_LIB_DIR "/stage/lib")
+      string(CONCAT _boost_LIB_DIR ${_boost_LIB_DIR} "/stage/lib")
     else()
       set(_boost_LIB_DIR "")
     endif()


improved searching for eigen3, allow std paths

--- cmake/FindEigen.cmake
+++ cmake/FindEigen.cmake
@@ -87,24 +87,30 @@
 #
 # TODO: Add standard Windows search locations for Eigen.
 LIST(APPEND Eigen_CHECK_INCLUDE_DIRS
-  /usr/local/include/eigen3
-  /usr/local/homebrew/include/eigen3 # Mac OS X
-  /opt/local/var/macports/software/eigen3 # Mac OS X.
-  /opt/local/include/eigen3
-  /usr/include/eigen3)
+  /usr/local/include
+  /usr/local/homebrew/include # Mac OS X
+  /opt/local/var/macports/software # Mac OS X.
+  /opt/local/include
+  /usr/include)

 # Search supplied hint directories first if supplied.
 FIND_PATH(Eigen_INCLUDE_DIR
   NAMES Eigen/Core
   PATHS ${Eigen_INCLUDE_DIR_HINTS}
-  ${Eigen_CHECK_INCLUDE_DIRS})
-IF (NOT Eigen_INCLUDE_DIR OR
-    NOT EXISTS ${Eigen_INCLUDE_DIR})
-  Eigen_REPORT_NOT_FOUND(
-    "Could not find eigen3 include directory, set Eigen_INCLUDE_DIR to "
-    "path to eigen3 include directory, e.g. /usr/local/include/eigen3.")
-ENDIF (NOT Eigen_INCLUDE_DIR OR
-       NOT EXISTS ${Eigen_INCLUDE_DIR})
+  HINTS ${Eigen_CHECK_INCLUDE_DIRS}
+  PATH_SUFFIXES "eigen3"
+  )
+IF (NOT Eigen_INCLUDE_DIR OR NOT EXISTS ${Eigen_INCLUDE_DIR})
+  FIND_PATH(Eigen_INCLUDE_DIR
+            NAMES Eigen/Core
+	    PATH_SUFFIXES "eigen3"
+	    )
+  IF (NOT Eigen_INCLUDE_DIR)
+    Eigen_REPORT_NOT_FOUND(
+      "Could not find eigen3 include directory, set Eigen_INCLUDE_DIR to "
+      "path to eigen3 include directory, e.g. /usr/local/include/eigen3.")
+  ENDIF (NOT Eigen_INCLUDE_DIR)
+ENDIF (NOT Eigen_INCLUDE_DIR OR NOT EXISTS ${Eigen_INCLUDE_DIR})

 # Mark internally as found, then verify. Eigen_REPORT_NOT_FOUND() unsets
 # if called.


Add Sphinx doc to ALL

Add Sphinx doc to ALL

--- cmake/SphinxDoc.cmake
+++ cmake/SphinxDoc.cmake
@@ -64,7 +64,7 @@
             ${COPIED_SPHINX_SOURCES}
     )

-    add_custom_target(${SPHINX_DOCS_TARGET} # ALL
+    add_custom_target(${SPHINX_DOCS_TARGET} ALL
         DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_build/html/index.html
     )
 endfunction()


fixes for build eigen on u1604

fixes for build eigen on u1604

--- cmake/cocl_impl.cmake
+++ cmake/cocl_impl.cmake
@@ -24,11 +24,13 @@
             # (finding this bit about whitespace cost me a world of pain...)
                     #"$<$<BOOL:$<TARGET_PROPERTY:${target_name},COMPILE_FLAGS>>:$<JOIN:$<TARGET_PROPERTY:${target_name},COMPILE_FLAGS>,;>>"
                     # "$<$<BOOL:$<TARGET_PROPERTY:${target_name},INCLUDE_DIRECTORIES>>:-I$<TARGET_PROPERTY:${target_name},INCLUDE_DIRECTORIES>>"
+                    # "$<$<BOOL:$<TARGET_PROPERTY:${target_name},INCLUDE_DIRECTORIES>>:$<JOIN:-I$<TARGET_PROPERTY:${target_name},INCLUDE_DIRECTORIES>,;-I>>"
             add_custom_command(
                 OUTPUT ${target_name}.d/${filename}.o
                 COMMAND
                     ${COCL_PATH}
                     --clang-home ${CLANG_HOME}
+                    "$<$<BOOL:$<TARGET_PROPERTY:${target_name},COMPILE_FLAGS>>:$<JOIN:$<TARGET_PROPERTY:${target_name},COMPILE_FLAGS>,;>>;"
                     "$<$<BOOL:$<TARGET_PROPERTY:${target_name},INCLUDE_DIRECTORIES>>:$<JOIN:-I$<TARGET_PROPERTY:${target_name},INCLUDE_DIRECTORIES>,;-I>>"
                     ${CMAKE_CURRENT_SOURCE_DIR}/${filename}
                     -o ${target_name}.d/${filename}.o


On Darwin, start building the TSan iOS dylib by default.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -328,6 +328,7 @@
         if(DARWIN_${platform}_ARCHS)
           list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform})
           list(APPEND PROFILE_SUPPORTED_OS ${platform})
+          list(APPEND TSAN_SUPPORTED_OS ${platform})
         endif()
         foreach(arch ${DARWIN_${platform}_ARCHS})
           list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})


[asan] Disable CreateSigAltStack from Unix/Signals.inc for asan builds

Summary: Asan fails to UnsetAlternateSignalStack if it set by Unix/Signals.inc

Reviewers: kcc

Subscribers: llvm-commits

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

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -170,7 +170,8 @@
   check_symbol_exists(siglongjmp setjmp.h HAVE_SIGLONGJMP)
   check_symbol_exists(sigsetjmp setjmp.h HAVE_SIGSETJMP)
 endif()
-if( HAVE_SIGNAL_H )
+// AddressSanitizer conflicts with lib/Support/Unix/Signals.inc
+if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*")
   check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK)
 endif()
 if( HAVE_SYS_UIO_H )


Enable -Wthread-safety for Clang and CMake. (#1403)

https://cmake.org/cmake/help/v3.2/variable/CMAKE_LANG_COMPILER_ID.html

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -85,6 +85,10 @@
   google_add_flag(GOOG_CXX_FLAGS "-Werror=switch")
   google_add_flag(GOOG_CXX_FLAGS "-Werror=uninitialized")

+  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
+    google_add_flag(GOOG_CXX_FLAGS "-Wthread-safety")
+  endif()
+
   if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
     set(CMAKE_BUILD_TYPE Release)
   endif()


FIX: In functions.cmake change condition to find if a plugin is out of Sofa tree because else it fails if the plugin begins like Sofa folder.

Former-commit-id: dab28ee621c2f918204668f61535c7db757c18f5

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -422,7 +422,8 @@
                     else()
                         message(STATUS "Adding project '${projectName}'")
                     endif()
-                    if(NOT ${GLOBAL_PROJECT_PATH_${projectName}} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
+
+                    if(NOT ${GLOBAL_PROJECT_PATH_${projectName}/} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR/}")
                         add_subdirectory("${GLOBAL_PROJECT_PATH_${projectName}}" "./build-external/${projectName}")
                     else()
                         add_subdirectory("${GLOBAL_PROJECT_PATH_${projectName}}")


Fix libprotoc.cmake to generate well_known_types_embed.cc

Unfortunate typo. Just one extra ',' symbol, has led to the hidden implicit behavior.

Now everything will be fine.

--- cmake/libprotoc.cmake
+++ cmake/libprotoc.cmake
@@ -94,7 +94,7 @@
   ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.cc
 )

-set(js_well_known_types_sources,
+set(js_well_known_types_sources
   ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/any.js
   ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/struct.js
   ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/timestamp.js


customize nsis package name

customize nsis package name

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@3111 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -36,7 +36,15 @@
     set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES32")
     set(win_system_name win32)
   endif(CMAKE_CL_64)
-  set(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}-${PCL_VERSION}-${win_system_name}")
+  set(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}-${PCL_VERSION}")
+  if(BUILD_all_in_one_installer)
+    set(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}-${PCL_VERSION}-AllInOne")
+  endif(BUILD_all_in_one_installer)
+  if(MSVC10)
+    set(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_PACKAGE_NAME}-msvc2010-${win_system_name}")
+  else(MSVC10)
+    set(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_PACKAGE_NAME}-${win_system_name}")
+  endif(MSVC10)
   # force CPACK_PACKAGE_INSTALL_REGISTRY_KEY because of a known limitation in cmake/cpack to be fixed in next releases
   # http://public.kitware.com/Bug/view.php?id=9094
   # This is to allow a 32bit and a 64bit of PCL to get installed on one system


Fix bug #5

Fix bug #5

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@138 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -123,13 +123,13 @@
 macro(DISSECT_VERSION)
     # Find version components
     string(REGEX REPLACE "^([0-9]+).*" "\\1"
-        PROJECT_MAJOR_VERSION "${PROJECT_VERSION}")
+        PCL_MAJOR_VERSION "${PCL_VERSION}")
     string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1"
-        PROJECT_MINOR_VERSION "${PROJECT_VERSION}")
+        PCL_MINOR_VERSION "${PCL_VERSION}")
     string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1"
-        PROJECT_REVISION_VERSION "${PROJECT_VERSION}")
+        PCL_REVISION_VERSION "${PCL_VERSION}")
     string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1"
-        PROJECT_CANDIDATE_VERSION "${PROJECT_VERSION}")
+        PCL_CANDIDATE_VERSION "${PCL_VERSION}")
 endmacro(DISSECT_VERSION)

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


Propagating usage of check_c_source_compiles instead of check_function_exists in MPI tests

--- cmake/tests/MPI.cmake
+++ cmake/tests/MPI.cmake
@@ -13,9 +13,6 @@
 # fact that MS-MPI uses __stdcall. Thus, it is best to avoid using
 # check_function_exists in favor of check_c_source_compiles.
 # Thanks to Ahn Vo for discovering this issue!
-#
-# TODO: Propagate the usage of check_c_source_compiles beyond MPI_Reduce_scatter
-#       to the rest of this file.

 # Ensure that we have MPI1 by looking for MPI_Reduce_scatter
 # ==========================================================
@@ -59,7 +56,22 @@

 # Ensure that we have MPI2 by looking for MPI_Type_create_struct
 # ==============================================================
-check_function_exists(MPI_Type_create_struct EL_HAVE_MPI_TYPE_CREATE_STRUCT)
+set(MPI_TYPE_CREATE_STRUCT_CODE
+    "#include \"mpi.h\"
+     int main( int argc, char* argv[] )
+     {
+         MPI_Init( &argc, &argv );
+         int count=2;
+         int blockLengths[2];
+         MPI_Aint displs[2];
+         MPI_Datatype types[2];
+         MPI_Datatype newType;
+         MPI_Type_create_struct( count, blockLengths, displs, types, &newType );
+         MPI_Finalize();
+         return 0;
+     }")
+check_c_source_compiles("${MPI_TYPE_CREATE_STRUCT_CODE}"
+  EL_HAVE_MPI_TYPE_CREATE_STRUCT)
 if(NOT EL_HAVE_MPI_TYPE_CREATE_STRUCT)
   message(FATAL_ERROR "Could not find MPI_Type_create_struct")
 endif()
@@ -112,22 +124,91 @@
     "#include \"mpi.h\"
      int main( int argc, char* argv[] )
      {
-         MPI_Init( &argc, &argv );
-         MPI_Datatype floatCpx = MPI_C_FLOAT_COMPLEX;
-         MPI_Datatype doubleCpx = MPI_C_DOUBLE_COMPLEX;
-         MPI_Finalize();
-         return 0;
+       MPI_Init( &argc, &argv );
+       MPI_Datatype floatCpx = MPI_C_FLOAT_COMPLEX;
+       MPI_Datatype doubleCpx = MPI_C_DOUBLE_COMPLEX;
+       MPI_Finalize();
+       return 0;
      }")
 check_c_source_compiles("${MPI_C_COMPLEX_CODE}" EL_HAVE_MPI_C_COMPLEX)

 # Detect support for various optional MPI routines
 # ================================================
-check_function_exists(MPI_Reduce_scatter_block EL_HAVE_MPI_REDUCE_SCATTER_BLOCK)
-check_function_exists(MPI_Iallgather EL_HAVE_MPI3_NONBLOCKING_COLLECTIVES)
-check_function_exists(MPIX_Iallgather EL_HAVE_MPIX_NONBLOCKING_COLLECTIVES)
-check_function_exists(MPI_Init_thread EL_HAVE_MPI_INIT_THREAD)
-check_function_exists(MPI_Query_thread EL_HAVE_MPI_QUERY_THREAD)
-check_function_exists(MPI_Comm_set_errhandler EL_HAVE_MPI_COMM_SET_ERRHANDLER)
+set(MPI_REDUCE_SCATTER_BLOCK_CODE
+    "#include \"mpi.h\"
+     int main( int argc, char* argv[] )
+     {
+       MPI_Init( &argc, &argv );
+       double *a, *b;
+       MPI_Reduce_scatter_block( a, b, 5, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
+       MPI_Finalize();
+       return 0;
+     }")
+check_c_source_compiles("${MPI_REDUCE_SCATTER_BLOCK_CODE}"
+  EL_HAVE_MPI_REDUCE_SCATTER_BLOCK)
+set(MPI_IALLGATHER_CODE
+    "#include \"mpi.h\"
+     int main( int argc, char* argv[] )
+     {
+       MPI_Init( &argc, &argv );
+       double *a, *b;
+       MPI_Request request;
+       MPI_Iallgather
+       ( a, 5, MPI_DOUBLE,
+         b, 5, MPI_DOUBLE, MPI_COMM_WORLD, &request );
+       MPI_Finalize();
+       return 0;
+     }")
+check_c_source_compiles("${MPI_IALLGATHER_CODE}"
+  EL_HAVE_MPI3_NONBLOCKING_COLLECTIVES)
+set(MPIX_IALLGATHER_CODE
+    "#include \"mpi.h\"
+     int main( int argc, char* argv[] )
+     {
+       MPI_Init( &argc, &argv );
+       double *a, *b;
+       MPI_Request request;
+       MPIX_Iallgather
+       ( a, 5, MPI_DOUBLE,
+         b, 5, MPI_DOUBLE, MPI_COMM_WORLD, &request );
+       MPI_Finalize();
+       return 0;
+     }")
+check_c_source_compiles("${MPIX_IALLGATHER_CODE}"
+  EL_HAVE_MPIX_NONBLOCKING_COLLECTIVES)
+set(MPI_INIT_THREAD_CODE
+    "#include \"mpi.h\"
+     int main( int argc, char* argv[] )
+     {
+       int required=MPI_THREAD_SINGLE, provided;
+       MPI_Init_thread( &argc, &argv, required, &provided );
+       MPI_Finalize();
+       return 0;
+     }")
+check_c_source_compiles("${MPI_INIT_THREAD_CODE}" EL_HAVE_MPI_INIT_THREAD)
+set(MPI_QUERY_THREAD_CODE
+    "#include \"mpi.h\"
+     int main( int argc, char* argv[] )
+     {
+       MPI_Init( &argc, &argv );
+       int provided;
+       MPI_Query_thread( &provided );
+       MPI_Finalize();
+       return 0;
+     }")
+check_c_source_compiles("${MPI_QUERY_THREAD_CODE}" EL_HAVE_MPI_QUERY_THREAD )
+set(MPI_COMM_SET_ERRHANDLER_CODE
+    "#include \"mpi.h\"
+     int main( int argc, char* argv[] )
+     {
+       MPI_Init( &argc, &argv );
+       MPI_Errhandler handler;
+       MPI_Comm_set_errhandler( MPI_COMM_WORLD, handler );
+       MPI_Finalize();
+       return 0;
+     }")
+check_c_source_compiles("${MPI_COMM_SET_ERRHANDLER_CODE}"
+  EL_HAVE_MPI_COMM_SET_ERRHANDLER)
 # Detecting MPI_IN_PLACE and MPI_Comm_f2c requires test compilation
 # -----------------------------------------------------------------
 set(MPI_IN_PLACE_CODE


Compiles with OpenCV 3.0.0. Needs testing to verify correctness for both OpenCV3 and OpenCV2.4.x.

--- config/Settings.cmake
+++ config/Settings.cmake
@@ -60,6 +60,11 @@
    #endif()
 endif()

+if(OpenCV_FOUND)
+    if(NOT ${OpenCV_VERSION} VERSION_LESS 3.0.0)
+        add_definitions(-DHAVE_OPENCV3)
+    endif()
+endif()

 # list flatbuffer headers
 set(RFB Geometry.fbs VrepControlPoint.fbs VrepPath.fbs JointState.fbs)


try appveyor with tweak to cmake config.

--- runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake
+++ runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake
@@ -19,11 +19,11 @@
 #
 # next make a build folder e.g. ~/buildfolder/
 # from the buildfolder, run cmake ~/srcfolder; make
-#
+#
 ###############################################################
 # # minimum required CMAKE version
 # CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.2 FATAL_ERROR)
-#
+#
 # LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
 #
 # # compiler must be 11 or 14
@@ -49,7 +49,7 @@
 # add_executable(demo main.cpp ${antlr4cpp_src_files_antlrcpptest})
 # add_dependencies(demo antlr4cpp antlr4cpp_generation_antlrcpptest)
 # target_link_libraries(demo antlr4-runtime)
-#
+#
 ###############################################################

 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.2)
@@ -66,7 +66,7 @@
 # external repository
 # GIT_REPOSITORY     https://github.com/antlr/antlr4.git
 set(ANTLR4CPP_EXTERNAL_REPO "https://github.com/antlr/antlr4.git")
-set(ANTLR4CPP_EXTERNAL_TAG  "4.6")
+set(ANTLR4CPP_EXTERNAL_TAG  "4.6-rc1")

 if(NOT EXISTS "${ANTLR4CPP_JAR_LOCATION}")
   message(FATAL_ERROR "Unable to find antlr tool. ANTLR4CPP_JAR_LOCATION:${ANTLR4CPP_JAR_LOCATION}")
@@ -81,13 +81,13 @@
 # set(ANTLR4CPP_JAR_LOCATION ${ANTLR4CPP_EXTERNAL_ROOT}/${ANTLR4CPP_JAR_NAME})
 #
 # !TODO! Ensure Antlr tool available - copy from internet
-#
+#
 # # !TODO! this shold be calculated based on the tags
 # if (NOT ANTLR4CPP_JAR_NAME)
 #   # default location to find antlr Java binary
 #   set(ANTLR4CPP_JAR_NAME antlr4-4.5.4-SNAPSHOT.jar)
 # endif()
-#
+#
 # if(NOT EXISTS "${ANTLR4CPP_JAR_LOCATION}")
 #   # download Java tool if not installed
 #   ExternalProject_ADD(
@@ -162,20 +162,20 @@

 set(ANTLR4CPP_LIBS "${INSTALL_DIR}/lib")

-# antlr4_shared ${INSTALL_DIR}/lib/libantlr4-runtime.so
-# antlr4_static ${INSTALL_DIR}/lib/libantlr4-runtime.a
+# antlr4_shared ${INSTALL_DIR}/lib/libantlr4-runtime.so
+# antlr4_static ${INSTALL_DIR}/lib/libantlr4-runtime.a

 ############ Generate runtime #################
 # macro to add dependencies to target
 #
-# Param 1 project name
+# Param 1 project name
 # Param 1 namespace (postfix for dependencies)
 # Param 2 Lexer file (full path)
 # Param 3 Parser File (full path)
 #
 # output
 #
-# antlr4cpp_src_files_{namespace} - src files for add_executable
+# antlr4cpp_src_files_{namespace} - src files for add_executable
 # antlr4cpp_include_dirs_{namespace} - include dir for generated headers
 # antlr4cpp_generation_{namespace} - for add_dependencies tracking

@@ -184,18 +184,18 @@
     antlr4cpp_project_namespace
     antlr4cpp_grammar_lexer
     antlr4cpp_grammar_parser)
-
+
   if(EXISTS "${ANTLR4CPP_JAR_LOCATION}")
     message(STATUS "Found antlr tool: ${ANTLR4CPP_JAR_LOCATION}")
   else()
     message(FATAL_ERROR "Unable to find antlr tool. ANTLR4CPP_JAR_LOCATION:${ANTLR4CPP_JAR_LOCATION}")
   endif()
-
+
   add_custom_target("antlr4cpp_generation_${antlr4cpp_project_namespace}"
-    COMMAND
+    COMMAND
     ${CMAKE_COMMAND} -E make_directory ${ANTLR4CPP_GENERATED_SRC_DIR}
     COMMAND
-    "${Java_JAVA_EXECUTABLE}" -jar "${ANTLR4CPP_JAR_LOCATION}" -Werror -Dlanguage=Cpp -listener -visitor -o "${ANTLR4CPP_GENERATED_SRC_DIR}/${antlr4cpp_project_namespace}" -package ${antlr4cpp_project_namespace} "${antlr4cpp_grammar_lexer}" "${antlr4cpp_grammar_parser}"
+    "${Java_JAVA_EXECUTABLE}" -jar "${ANTLR4CPP_JAR_LOCATION}" -Werror -Dlanguage=Cpp -listener -visitor -o "${ANTLR4CPP_GENERATED_SRC_DIR}/${antlr4cpp_project_namespace}" -package ${antlr4cpp_project_namespace} "${antlr4cpp_grammar_lexer}" "${antlr4cpp_grammar_parser}"
     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
     DEPENDS "${antlr4cpp_grammar_lexer}" "${antlr4cpp_grammar_parser}"
     )
@@ -213,9 +213,9 @@
       )
   endforeach(generated_file)
   message(STATUS "Antlr4Cpp  ${antlr4cpp_project_namespace} Generated: ${generated_files}")
-
+
   # export generated include directory
   set(antlr4cpp_include_dirs_${antlr4cpp_project_namespace} ${ANTLR4CPP_GENERATED_SRC_DIR}/${antlr4cpp_project_namespace})
   message(STATUS "Antlr4Cpp ${antlr4cpp_project_namespace} include: ${ANTLR4CPP_GENERATED_SRC_DIR}/${antlr4cpp_project_namespace}")
-
+
 endmacro()


Fix Android build on Windows host system without MKLINK capability.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -465,7 +465,9 @@
     endif ()
     # Create symbolic links in the build tree
     foreach (I CoreData Data)
-        create_symlink (../../Bin/${I} ${CMAKE_SOURCE_DIR}/Android/assets/${I} FALLBACK_TO_COPY)
+        if (NOT EXISTS ${CMAKE_SOURCE_DIR}/Android/assets/${I})
+            create_symlink (${CMAKE_SOURCE_DIR}/Bin/${I} ${CMAKE_SOURCE_DIR}/Android/assets/${I} FALLBACK_TO_COPY)
+        endif ()
     endforeach ()
     foreach (I AndroidManifest.xml build.xml src res assets jni)
         if (EXISTS ${CMAKE_SOURCE_DIR}/Android/${I} AND NOT EXISTS ${CMAKE_BINARY_DIR}/${I})    # No-ops when 'Android' is used as build tree
@@ -689,7 +691,9 @@

     if (ANDROID)
         # Add SDL native init function, SDL_Main() entry point must be defined by one of the source files in ${SOURCE_FILES}
-        find_file (ANDROID_MAIN_C_PATH SDL_android_main.c HINTS ${URHO3D_HOME}/include/${PATH_SUFFIX}/ThirdParty/SDL/android PATH_SUFFIXES ${PATH_SUFFIX} DOC "Path to SDL_android_main.c" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+        find_file (ANDROID_MAIN_C_PATH SDL_android_main.c
+            HINTS ${URHO3D_HOME}/include/${PATH_SUFFIX}/ThirdParty/SDL/android ${CMAKE_SOURCE_DIR}/Source/ThirdParty/SDL/src/main/android
+            DOC "Path to SDL_android_main.c" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
         mark_as_advanced (ANDROID_MAIN_C_PATH)  # Hide it from cmake-gui in non-advanced mode
         if (ANDROID_MAIN_C_PATH)
             list (APPEND SOURCE_FILES ${ANDROID_MAIN_C_PATH})


Fix build system to install/package Emscripten share js and data files.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -1213,6 +1213,7 @@
                 set (SHARED_RESOURCE_JS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_PROJECT_NAME}.js)
                 list (APPEND SOURCE_FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data)
                 set_source_files_properties (${SHARED_RESOURCE_JS} PROPERTIES GENERATED TRUE EMCC_OPTION pre-js)
+                install (FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data DESTINATION ${DEST_BUNDLE_DIR})
             endif ()
         endif ()
     endif ()


support Broadwell

support Broadwell

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -71,7 +71,9 @@
 	if(_vendor_id STREQUAL "GenuineIntel")
 if(_cpu_family EQUAL 6)
 # Any recent Intel CPU except NetBurst
-if(_cpu_model EQUAL 63)
+if(_cpu_model EQUAL 79)
+	set(TARGET_ARCHITECTURE "broadwell")
+    elseif(_cpu_model EQUAL 63)
 	set(TARGET_ARCHITECTURE "haswell")
     elseif(_cpu_model EQUAL 62)
 	set(TARGET_ARCHITECTURE "ivy-bridge")
@@ -168,6 +170,11 @@
 	list(APPEND _march_flag_list "core2")
 	list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
 	elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
+	list(APPEND _march_flag_list "core-avx-i")
+	list(APPEND _march_flag_list "corei7-avx")
+	list(APPEND _march_flag_list "core2")
+	list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c")
+	elseif(TARGET_ARCHITECTURE STREQUAL "broadwell")
 	list(APPEND _march_flag_list "core-avx-i")
 	list(APPEND _march_flag_list "corei7-avx")
 	list(APPEND _march_flag_list "core2")


[cmake] whitespace

[cmake] whitespace

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -71,11 +71,11 @@
 SET( CMAKE_CXX_FLAGS "-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS=1 ${CMAKE_CXX_FLAGS}" )

 SET( CMAKE_CXX_FLAGS_DEBUG
-  "-DDNDEBUG -g3 -ggdb  -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow  -Wundef -Wnon-virtual-dtor -ftemplate-backtrace-limit=0 ${CMAKE_CXX_FLAGS_DEBUG}")
+  "-DDNDEBUG -g3 -ggdb -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Wundef -Wnon-virtual-dtor -ftemplate-backtrace-limit=0 ${CMAKE_CXX_FLAGS_DEBUG}")

 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
         set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING
-        "-Wnon-literal-null-conversion -Wused-but-marked-unused -Wno-tautological-compare -Wfloat-equal -Wdisabled-macro-expansion -Wcovered-switch-default  -Wswitch-enum -Wunreachable-code  -Wshorten-64-to-32 -O0 ${CMAKE_CXX_FLAGS_DEBUG}"
+        "-Wnon-literal-null-conversion -Wused-but-marked-unused -Wno-tautological-compare -Wfloat-equal -Wdisabled-macro-expansion -Wcovered-switch-default -Wswitch-enum -Wunreachable-code -Wshorten-64-to-32 -O0 ${CMAKE_CXX_FLAGS_DEBUG}"
         )
 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
         set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING


eds-M!68 - SetupBuildFlags.cmake: Correct testing of two compiler/linker build flags

Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/68

--- cmake/modules/SetupBuildFlags.cmake
+++ cmake/modules/SetupBuildFlags.cmake
@@ -20,7 +20,7 @@
 		-Wundef
 		-Wwrite-strings
 		-Wno-cast-function-type
-		-no-undefined
+		-Wl,--no-undefined
 		-fno-strict-aliasing
 	)

@@ -34,7 +34,7 @@
 	else(${_maintainer_mode})
 		list(APPEND proposed_flags
 			-Wno-deprecated-declarations
-			-Wno-missing-include-dir)
+			-Wno-missing-include-dirs)
 	endif(${_maintainer_mode})

 	list(APPEND proposed_c_flags


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/pugixml/hunter.cmake
+++ cmake/projects/pugixml/hunter.cmake
@@ -6,6 +6,12 @@
 include(hunter_download)
 include(hunter_pick_scheme)

+hunter_add_version(
+    PACKAGE_NAME pugixml
+    VERSION "1.8.1.2"
+    URL "https://github.com/designerror/pugixml/archive/v1.8.1.2.tar.gz"
+    SHA1 fb2880d383e552c0fb97277821a8ae1db89e997f
+)

 hunter_add_version(
     PACKAGE_NAME pugixml


BUG: 1953, conditionalized deprecation warning

--- CMake/vtkDetermineCompilerFlags.cmake
+++ CMake/vtkDetermineCompilerFlags.cmake
@@ -17,8 +17,12 @@
   ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
 ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")

+# A GCC compiler.
 IF(CMAKE_COMPILER_IS_GNUCXX)
-# A GCC compiler.
+  # Quiet warning about strstream deprecation if appropriate.
+  IF(NOT VTK_LEGACY_REMOVE)
+    SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -Wno-deprecated")
+  ENDIF(NOT VTK_LEGACY_REMOVE)
   IF(WIN32)
 # The platform is gcc on cygwin.
     SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")


SuperBuild: build openssl on windows

SuperBuild: build openssl on windows

--- SuperBuild/CMake/External_openssl.cmake
+++ SuperBuild/CMake/External_openssl.cmake
@@ -19,19 +19,38 @@
   # set proj back to its original value
   set(proj OPENSSL)

-  set(OPENSSL_BUILD_ARCH "linux-x32")
-  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    set(OPENSSL_BUILD_ARCH "linux-x86_64")
-  endif()
+  if(WIN32)
+    set(OPENSSL_BUILD_ARCH "linux-x32")
+    set(OPENSSL_BUILD_ARCH "VC-WIN32")
+    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+      set(OPENSSL_BUILD_ARCH "linux-x86_64")
+      set(OPENSSL_BUILD_ARCH "VC-WIN64A")
+    endif()
+  endif()

   if(MSVC)
-    message(FATAL_ERROR "No build rules added yet.")
+      STRING(REGEX REPLACE "/$" "" CMAKE_WIN_INSTALL_PREFIX ${SB_INSTALL_PREFIX})
+    STRING(REGEX REPLACE "/" "\\\\" CMAKE_WIN_INSTALL_PREFIX ${CMAKE_WIN_INSTALL_PREFIX})
+    ExternalProject_Add(${proj}
+        PREFIX ${proj}
+        URL "https://github.com/openssl/openssl/archive/OpenSSL_1_0_1e.zip"
+        URL_MD5 de0f06b07dad7ec8b220336530be1feb
+        DEPENDS ${${proj}_DEPENDENCIES}
+        BINARY_DIR ${OPENSSL_SB_BUILD_DIR}
+        INSTALL_DIR ${SB_INSTALL_PREFIX}
+        DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
+         PATCH_COMMAND  ${CMAKE_COMMAND} -E copy_directory ${OPENSSL_SB_SRC} ${OPENSSL_SB_BUILD_DIR}
+        CONFIGURE_COMMAND ${CMAKE_COMMAND} -E chdir ${OPENSSL_SB_BUILD_DIR} perl Configure ${OPENSSL_BUILD_ARCH} no-asm  --prefix=${CMAKE_WIN_INSTALL_PREFIX} --openssldir=${CMAKE_WIN_INSTALL_PREFIX}
+      BUILD_COMMAND ms/do_ms.bat
+      INSTALL_COMMAND nmake -f ms/ntdll.mak install
+    )
+
   else(UNIX)
     ExternalProject_Add(${proj}
       PREFIX ${proj}
       DEPENDS ${${proj}_DEPENDENCIES}
-      URL "http://openssl.org/source/openssl-1.0.2c.tar.gz"
-      URL_MD5 8c8d81a9ae7005276e486702edbcd4b6
+      URL "https://github.com/openssl/openssl/archive/OpenSSL_1_0_1e.zip"
+      URL_MD5 de0f06b07dad7ec8b220336530be1feb
       BINARY_DIR ${OPENSSL_SB_BUILD_DIR}
       INSTALL_DIR ${SB_INSTALL_PREFIX}
       DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
@@ -45,7 +64,7 @@

   set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
   if(WIN32)
-    message(FATAL_ERROR "No build rules added yet.")
+    set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl.lib)
   elseif(UNIX)
     set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libssl${CMAKE_SHARED_LIBRARY_SUFFIX})
   endif()


emscripten: add -flto if LTO is enabled

emscripten: add -flto if LTO is enabled

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -114,7 +114,7 @@
 if (FIPS_EMSCRIPTEN_USE_WASM)
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=1")
     if (FIPS_EMSCRIPTEN_LTO_LEVEL GREATER 0)
-        set(EMSC_COMMON_FLAGS "${EMSC_COMMON_FLAGS} -s WASM_OBJECT_FILES=0")
+        set(EMSC_COMMON_FLAGS "${EMSC_COMMON_FLAGS} -flto -s WASM_OBJECT_FILES=0")
     endif()
 else()
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=0")


Param handling: Cull unused params

Param handling: Cull unused params

--- cmake/configs/nuttx_px4fmu-v2_default.cmake
+++ cmake/configs/nuttx_px4fmu-v2_default.cmake
@@ -80,11 +80,10 @@
 	#
 	# Estimation modules (EKF/ SO3 / other filters)
 	#
-	# Too high RAM usage due to static allocations
-	# modules/attitude_estimator_ekf
 	modules/attitude_estimator_q
 	modules/ekf_att_pos_estimator
 	modules/position_estimator_inav
+	modules/local_position_estimator

 	#
 	# Vehicle Control


Update builtin version of VecCore to 0.5.2

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

 if(veccore AND NOT VecCore_FOUND)
-  set(VecCore_VERSION "0.5.1")
+  set(VecCore_VERSION "0.5.2")
   set(VecCore_PROJECT "VecCore-${VecCore_VERSION}")
   set(VecCore_SRC_URI "${lcgpackages}/${VecCore_PROJECT}.tar.gz")
   set(VecCore_DESTDIR "${CMAKE_BINARY_DIR}/externals")
@@ -1388,7 +1388,7 @@

   ExternalProject_Add(VECCORE
     URL     ${VecCore_SRC_URI}
-    URL_HASH SHA256=20f4ab8f599b9d12becc3e27e8dbb0f4ec0aa2de958053eb550020a9c95a6d62
+    URL_HASH SHA256=6c8740342bfa1d9c6ef55a19f57b95674a94e5f9ea156e9b329635718b0b4049
     BUILD_IN_SOURCE 0
     LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
     CMAKE_ARGS -G ${CMAKE_GENERATOR}


ENH: Mark vars advanced

ENH: Mark vars advanced

--- CMake/FindFFMPEG.cmake
+++ CMake/FindFFMPEG.cmake
@@ -86,4 +86,15 @@
   ENDIF(FFMPEG_avcodec_LIBRARY)
 ENDIF(FFMPEG_INCLUDE_DIR)

-
+MARK_AS_ADVANCED(
+  FFMPEG_avcodec_LIBRARY
+  FFMPEG_avformat_LIBRARY
+  FFMPEG_vorbis_LIBRARY
+  FFMPEG_dc1394_LIBRARY
+  FFMPEG_vorbisenc_LIBRARY
+  FFMPEG_theora_LIBRARY
+  FFMPEG_avutil_LIBRARY
+  FFMPEG_dts_LIBRARY
+  FFMPEG_gsm_LIBRARY
+  FFMPEG_z_LIBRARY
+  )


ENH: Update ITK CMake version for 5.1.1

ENH: Update ITK CMake version for 5.1.1

--- CMake/itkVersion.cmake
+++ CMake/itkVersion.cmake
@@ -1,4 +1,4 @@
 # ITK version number components.
 set(ITK_VERSION_MAJOR "5")
 set(ITK_VERSION_MINOR "1")
-set(ITK_VERSION_PATCH "0")
+set(ITK_VERSION_PATCH "1")


Add include path for libtiff

Add include path for libtiff

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -85,15 +85,17 @@
 ENDIF (UNIX)

 #
-# Look for the PNG, zlib, and jpeg libraries and header files
+# Look for the PNG, zlib, jpeg, and tiff libraries and header files
 #
 INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Utilities/zlib)
 INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Utilities/png)
 INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Utilities/jpeg)
+INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Utilities/tiff)
 IF (NOT VTK_LIBRARY_PATH)
   LINK_DIRECTORIES(${VTK_BINARY_DIR}/Utilities/png)
   LINK_DIRECTORIES(${VTK_BINARY_DIR}/Utilities/zlib)
   LINK_DIRECTORIES(${VTK_BINARY_DIR}/Utilities/jpeg)
+  LINK_DIRECTORIES(${VTK_BINARY_DIR}/Utilities/tiff)
 ENDIF (NOT VTK_LIBRARY_PATH)

 #


ARROW-10239: [C++] Add missing zlib dependency to aws-sdk-cpp

Closes #8406 from kou/cpp-aws-sdk-cpp-zlib

Authored-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -249,6 +249,10 @@
   set(ARROW_WITH_PROTOBUF ON)
 endif()

+if(ARROW_S3)
+  set(ARROW_WITH_ZLIB ON)
+endif()
+
 if(NOT ARROW_COMPUTE)
   # utf8proc is only potentially used in kernels for now
   set(ARROW_WITH_UTF8PROC OFF)
@@ -1890,9 +1894,11 @@
   file(MAKE_DIRECTORY "${ZLIB_PREFIX}/include")

   add_library(ZLIB::ZLIB STATIC IMPORTED)
+  set(ZLIB_LIBRARIES ${ZLIB_STATIC_LIB})
+  set(ZLIB_INCLUDE_DIRS "${ZLIB_PREFIX}/include")
   set_target_properties(ZLIB::ZLIB
-                        PROPERTIES IMPORTED_LOCATION "${ZLIB_STATIC_LIB}"
-                                   INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_PREFIX}/include")
+                        PROPERTIES IMPORTED_LOCATION ${ZLIB_LIBRARIES}
+                                   INTERFACE_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS})

   add_dependencies(toolchain zlib_ep)
   add_dependencies(ZLIB::ZLIB zlib_ep)
@@ -2693,6 +2699,10 @@
     ${AWSSDK_COMMON_CMAKE_ARGS} -DBUILD_DEPS=OFF
     -DBUILD_ONLY=config\\$<SEMICOLON>s3\\$<SEMICOLON>transfer\\$<SEMICOLON>identity-management\\$<SEMICOLON>sts
     -DMINIMIZE_SIZE=ON)
+  if(UNIX AND TARGET zlib_ep)
+    list(APPEND AWSSDK_CMAKE_ARGS -DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS}
+                -DZLIB_LIBRARY=${ZLIB_LIBRARIES})
+  endif()

   file(MAKE_DIRECTORY ${AWSSDK_INCLUDE_DIR})

@@ -2783,9 +2793,18 @@
                                        "${CURL_INCLUDE_DIRS}" IMPORTED_LOCATION
                                        "${CURL_LIBRARIES}")
     endif()
-    set_target_properties(aws-cpp-sdk-core
-                          PROPERTIES INTERFACE_LINK_LIBRARIES CURL::libcurl)
-    set_target_properties(CURL::libcurl PROPERTIES INTERFACE_LINK_LIBRARIES OpenSSL::SSL)
+    set_property(TARGET aws-cpp-sdk-core
+                 APPEND
+                 PROPERTY INTERFACE_LINK_LIBRARIES CURL::libcurl)
+    set_property(TARGET CURL::libcurl
+                 APPEND
+                 PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::SSL)
+    if(TARGET zlib_ep)
+      set_property(TARGET aws-cpp-sdk-core
+                   APPEND
+                   PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
+      add_dependencies(awssdk_ep zlib_ep)
+    endif()
   endif()

   # AWSSDK is static-only build


Remove PiToolDir altogether.

Remove PiToolDir altogether.

--- rpi/cmaketc/Toolchain-raspberrypi-arm.cmake
+++ rpi/cmaketc/Toolchain-raspberrypi-arm.cmake
@@ -11,14 +11,12 @@
   return()
 endif()

-SET (PiToolsDir $ENV{PI_TOOL})
-
 # specify the cross compiler
-SET (CMAKE_C_COMPILER $ENV{PI_TOOLS_HOME}/${PiToolsDir}/bin/arm-linux-gnueabihf-gcc)
-SET (CMAKE_CXX_COMPILER $ENV{PI_TOOLS_HOME}/${PiToolsDir}/bin/arm-linux-gnueabihf-g++)
+SET (CMAKE_C_COMPILER $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL}/bin/arm-linux-gnueabihf-gcc)
+SET (CMAKE_CXX_COMPILER $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL}/bin/arm-linux-gnueabihf-g++)

 # where is the target environment
-SET (CMAKE_FIND_ROOT_PATH $ENV{PI_TOOLS_HOME}/${PiToolsDir} $ENV{PI_TOOLS_HOME}/${PiToolsDir}/include)
+SET (CMAKE_FIND_ROOT_PATH $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL} $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL}/include)

 # search for programs in the build host directories
 SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)


fix FindDoubleConversion.cmake to work properly

Summary:
The code in `FindDoubleConversion.cmake` called
`FIND_PACKAGE_HANDLE_STANDARD_ARGS()` with the wrong arguments.  The first
argument must match the package name: since this file is called
`FindDoubleConversion` the first argument must be `DoubleConversion`.

Previously this code was passing in `DOUBLE_CONVERSION`, causing it to set
`DOUBLE_CONVERSION_FOUND` instead of `DoubleConversion_FOUND`.  Since this
module did not set `DoubleConversion_FOUND` the `find_package()` call assumed
it always succeeded, even when the double-conversion library was not found.

Also remove the extra status message.  `FIND_PACKAGE_HANDLE_STANDARD_ARGS()`
already prints out a status message as long as `find_package()` was called
without the `QUIET` argument.

Reviewed By: yfeldblum

Differential Revision: D23588980

fbshipit-source-id: 8c088930b1b01c027403c3e425f1924f6149f72a

--- CMake/FindDoubleConversion.cmake
+++ CMake/FindDoubleConversion.cmake
@@ -23,14 +23,9 @@
 find_library(DOUBLE_CONVERSION_LIBRARY NAMES double-conversion)

 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(
-    DOUBLE_CONVERSION DEFAULT_MSG
-    DOUBLE_CONVERSION_LIBRARY DOUBLE_CONVERSION_INCLUDE_DIR)
-
-if (NOT DOUBLE_CONVERSION_FOUND)
-  message(STATUS "Using third-party bundled double-conversion")
-else()
-  message(STATUS "Found double-conversion: ${DOUBLE_CONVERSION_LIBRARY}")
-endif (NOT DOUBLE_CONVERSION_FOUND)
+find_package_handle_standard_args(
+  DoubleConversion
+  DEFAULT_MSG
+  DOUBLE_CONVERSION_LIBRARY DOUBLE_CONVERSION_INCLUDE_DIR)

 mark_as_advanced(DOUBLE_CONVERSION_INCLUDE_DIR DOUBLE_CONVERSION_LIBRARY)


Do not copy cv_cpu_helper.h to parent if OpenCV is a submodule

--- cmake/OpenCVCompilerOptimizations.cmake
+++ cmake/OpenCVCompilerOptimizations.cmake
@@ -740,7 +740,7 @@
 ")

-  set(__file "${CMAKE_SOURCE_DIR}/modules/core/include/opencv2/core/cv_cpu_helper.h")
+  set(__file "${OpenCV_SOURCE_DIR}/modules/core/include/opencv2/core/cv_cpu_helper.h")
   if(EXISTS "${__file}")
     file(READ "${__file}" __content)
   endif()


Add dependencies to android

Add dependencies to android

--- cmake/play_services_resolver_deps.cmake
+++ cmake/play_services_resolver_deps.cmake
@@ -95,7 +95,7 @@
   if (NOT ${GEN_DEPS_SKIP_INSTALL})
     install(
       FILES "${OUT_FILE}"
-      DESTINATION "Assets/Firebase/Editor/"
+      DESTINATION "Firebase/Editor/"
     )
   endif()


ORC-1102: Upgrade ZSTD to 1.5.2 (#1026)

ORC-1102: Upgrade ZSTD to 1.5.2 (#1026)

### What changes were proposed in this pull request?

This PR aims to upgrade ZSTD to 1.5.2.

### Why are the changes needed?

This will bring the latest bug fixes and improvements.
- https://github.com/facebook/zstd/releases/tag/v1.5.2

### How was this patch tested?

Pass the CIs.

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -15,7 +15,7 @@
 set(ZLIB_VERSION "1.2.11")
 set(GTEST_VERSION "1.8.0")
 set(PROTOBUF_VERSION "3.5.1")
-set(ZSTD_VERSION "1.5.1")
+set(ZSTD_VERSION "1.5.2")

 option(ORC_PREFER_STATIC_PROTOBUF "Prefer static protobuf library, if available" ON)
 option(ORC_PREFER_STATIC_SNAPPY   "Prefer static snappy library, if available"   ON)


Find OIS cmake script fixed for non-MSVC builds.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@371 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/OIS.cmake
+++ CMakeModules/OIS.cmake
@@ -2,12 +2,24 @@
 # Find is already called in the top-level CMakeLists

 macro (FIND_OIS)
+	if (NOT MSVC)
+		find_package (PkgConfig)
+		pkg_search_module (OIS OIS)
+		if (NOT OIS_INCLUDE_DIRS AND NOT OIS_LIBRARIES)
+			message (FATAL_ERROR "OIS not found by pkg-config")
+		endif (NOT OIS_INCLUDE_DIRS AND NOT OIS_LIBRARIES)
+		separate_arguments (OIS_INCLUDE_DIRS)
+		separate_arguments (OIS_LIBRARIES)
+	endif (NOT MSVC)
 endmacro (FIND_OIS)

 macro (INCLUDE_OIS)
 	if (MSVC)
 		include_directories (${REX_DEP_PATH}/ois/includes)
 		link_directories (${REX_DEP_PATH}/ois/dll)
+	else (MSVC)
+		include_directories (${OIS_INCLUDE_DIRS})
+		link_directories (${OIS_LIBDIR})
 	endif (MSVC)
 endmacro (INCLUDE_OIS)

@@ -16,5 +28,7 @@
 		target_link_libraries (${TARGET_NAME}
 			debug OIS_d
 			optimized OIS)
+	else (MSVC)
+		target_link_libraries (${TARGET_NAME} ${OIS_LIBRARIES})
 	endif (MSVC)
-endmacro (LINK_OIS)+endmacro (LINK_OIS)


Mark DPKGSHLIBDEPS as advanced.

Mark DPKGSHLIBDEPS as advanced.

--- pkg/CMakeCommon.cmake
+++ pkg/CMakeCommon.cmake
@@ -134,6 +134,7 @@
 find_program(DPKG "dpkg")
 mark_as_advanced(DPKG)
 find_program(DPKGSHLIBDEPS "dpkg-shlibdeps")
+mark_as_advanced(DPKGSHLIBDEPS)
 if (DPKG)
     if (NOT DPKGSHLIBDEPS)
         MESSAGE(FATAL_ERROR "dpkg-shlibdeps program not found but is required.")


Add object compilation rule for COGCXX

Add object compilation rule for COGCXX

--- cmake/Modules/CMakeCOGCXXInformation.cmake
+++ cmake/Modules/CMakeCOGCXXInformation.cmake
@@ -17,4 +17,11 @@

 message( STATUS "CMakeCOGCXXInformation.cmake" )

+# object extension
 set( CMAKE_COGCXX_OUTPUT_EXTENSION .cog )
+
+# object compilation
+set(
+    CMAKE_COGCXX_COMPILE_OBJECT
+    "<CMAKE_COGCXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> <SOURCE>"
+)


- Add OpenVR as default option on Win32

- Add OpenVR as default option on Win32

--- cmake/Preload/x86_64-windows-generic.cmake
+++ cmake/Preload/x86_64-windows-generic.cmake
@@ -0,0 +1 @@
+set ( COFFEE_BUILD_OPENVR ON CACHE BOOL "" )


Switch to ITK 4.8

Switch to ITK 4.8

--- cmake/externals/projects_modules/ITK.cmake
+++ cmake/externals/projects_modules/ITK.cmake
@@ -49,9 +49,9 @@
 ## Define repository where get the sources
 ## #############################################################################

-set(tag "v4.6.0")
+set(tag "v4.8.0")
 if (NOT DEFINED ${ep}_SOURCE_DIR)
-    set(location GIT_REPOSITORY "git://itk.org/ITK.git" GIT_TAG ${tag})
+    set(location GIT_REPOSITORY "${GITHUB_PREFIX}InsightSoftwareConsortium/ITK.git" GIT_TAG ${tag})
 endif()


support MSVC 19.11 compiler

support MSVC 19.11 compiler

--- cmake/modules/hunter_setup_msvc.cmake
+++ cmake/modules/hunter_setup_msvc.cmake
@@ -41,7 +41,7 @@
     string(COMPARE EQUAL "${MSVC_VERSION}" "1700" _vs_11_2012)
     string(COMPARE EQUAL "${MSVC_VERSION}" "1800" _vs_12_2013)
     string(COMPARE EQUAL "${MSVC_VERSION}" "1900" _vs_14_2015)
-    string(COMPARE EQUAL "${MSVC_VERSION}" "1910" _vs_15_2017)
+    string(REGEX MATCH "^191[01]$" _vs_15_2017 "${MSVC_VERSION}")

     if(_vs_8_2005)
       set(HUNTER_MSVC_VERSION "8")


Update Boost dependency

Update Boost dependency

--- cmake/TPLs/FindTPLBoostOrg.cmake
+++ cmake/TPLs/FindTPLBoostOrg.cmake
@@ -3,8 +3,13 @@

 TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES(
   BoostOrg
-  REQUIRED_HEADERS boost/version.hpp boost/mpl/at.hpp
-  REQUIRED_LIBS_NAMES boost_mpi boost_serialization
+  REQUIRED_HEADERS boost/property_tree/json_parser.hpp
+                   boost/property_tree/ptree.hpp
+                   boost/math/tools/polynomial.hpp
+                   boost/math/tools/rational.hpp
+                   boost/geometry.hpp
+                   boost/range.hpp
+                   boost/current_function.hpp
   )

 # Use CMake FindBoost module to check version is sufficient


Add support for Apple Silicon in SwiftSupport.cmake (#293)

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -12,6 +12,8 @@
   if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
     set("${result_var_name}" "x86_64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
+    set("${result_var_name}" "aarch64" PARENT_SCOPE)
+  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
     set("${result_var_name}" "aarch64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64")
     set("${result_var_name}" "powerpc64" PARENT_SCOPE)


[minor]

[minor]

--- testing/run_tests.sh.cmake
+++ testing/run_tests.sh.cmake
@@ -535,6 +535,7 @@
 		np_target=1
 		if [ "$TARGET" = "mpi" -o "$TARGET" = "mpi-cuda" ]; then
 		    np_target=$MPI_PROC_DIM
+		    echo "[EXECUTE] Trying with process configurations: $np_target"
 		fi
 		for np in $np_target; do
 		    if execute $SHORTNAME $TARGET $np $DIM; then


use old boost

use old boost

fixes last commit
issue https://github.com/smanders/externpro/issues/202

--- projects/use/usexp-boost-config.cmake
+++ projects/use/usexp-boost-config.cmake
@@ -3,7 +3,7 @@
 get_filename_component(XP_ROOTDIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE)
 get_filename_component(XP_ROOTDIR ${XP_ROOTDIR} ABSOLUTE) # remove relative parts
 string(TOUPPER ${prj} PRJ)
-set(XP_USE_LATEST_BOOST ON)
+set(XP_USE_LATEST_BOOST OFF)
 if(NOT DEFINED XP_USE_LATEST_BOOST)
   option(XP_USE_LATEST_BOOST "build with boost @BOOST_NEWVER@ instead of @BOOST_OLDVER@" OFF)
 endif()


FIX: I've no idea why TCL_LIBRARY and TK_LIBRARY are exported this way, but I think they should be ADVANCED

--- vtkGenerateVTKConfig.cmake
+++ vtkGenerateVTKConfig.cmake
@@ -110,6 +110,7 @@
     "IF(NOT TK_LIBRARY)\n"
     "  SET(TK_LIBRARY \"${TK_LIBRARY}\" CACHE FILEPATH \"Location of Tk library imported from VTK.  This may mean your project is depending on VTK to get this setting.  Consider using FindTCL.cmake.\")\n"
     "ENDIF(NOT TK_LIBRARY)\n"
+    "MARK_AS_ADVANCED(TCL_LIBRARY TK_LIBRARY)\n"
     APPEND
   )
 ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.4)


Fixed cmake macro for windows.

Fixed cmake macro for windows.

--- cmake/BALLMacros.cmake
+++ cmake/BALLMacros.cmake
@@ -191,13 +191,15 @@
 ENDMACRO()

 MACRO(BALL_COMBINE_LIBS RESULT OPTIMIZED_LIBS DEBUG_LIBS)
+	SET(OPTIMIZED_LIBS "${OPTIMIZED_LIBS}")
+	SET(DEBUG_LIBS "${DEBUG_LIBS}")
 	IF (OPTIMIZED_LIBS AND DEBUG_LIBS)
-		SET(${RESULT} optimized "${OPTIMIZED_LIBS}" debug "${DEBUG_LIBS}")
+		SET(${${RESULT}} optimized "${OPTIMIZED_LIBS}" debug "${DEBUG_LIBS}")
 	ELSEIF(OPTIMIZED_LIBS)
-		SET(${RESULT} "${OPTIMIZED_LIBS}")
+		SET(${${RESULT}} "${OPTIMIZED_LIBS}")
 	ELSEIF(DEBUG_LIBS)
-		SET(${RESULT} "${DEBUG_LIBS}")
+		SET(${${RESULT}} "${DEBUG_LIBS}")
 	ELSE()
-		SET(${RESULT})
+		SET(${${RESULT}})
 	ENDIF()
 ENDMACRO()


Convert CMake flags lists to strings.

Convert CMake flags lists to strings.

--- cmake/BuildFlags.cmake
+++ cmake/BuildFlags.cmake
@@ -31,6 +31,11 @@
     -g            #*Produce debugging information in the operating system’s native format.
   )
 endif()
+
+# Convert lists to space-separated strings
+list(JOIN CMAKE_CXX_FLAGS " " CMAKE_CXX_FLAGS)
+list(JOIN CMAKE_CXX_FLAGS_RELEASE " " CMAKE_CXX_FLAGS_RELEASE)
+list(JOIN CMAKE_CXX_FLAGS_DEBUG " " CMAKE_CXX_FLAGS_DEBUG)

 # Add specific flags for use in
 add_library(cse_common_interface INTERFACE)


fix for CYCLUS_ROOT_DIR

fix for CYCLUS_ROOT_DIR

--- cmake/FindCyclus.cmake
+++ cmake/FindCyclus.cmake
@@ -16,15 +16,17 @@
         MESSAGE(STATUS "\t\tThe environment variable CYCLUS_ROOT_DIR: $ENV{CYCLUS_ROOT_DIR}")
     ENDIF(NOT DEFINED CYCLUS_ROOT_DIR)
 ELSE(DEFINED ENV{CYCLUS_ROOT_DIR})
-    FIND_PROGRAM(CYCLUS_BIN cyclus)
-    MESSAGE("cyclus bin dir: ${CYCLUS_BIN}")
-    IF(CYCLUS_BIN)
-        EXECUTE_PROCESS(COMMAND cyclus --install-path
-            OUTPUT_VARIABLE CYCLUS_ROOT_DIR
-            OUTPUT_STRIP_TRAILING_WHITESPACE)
-    ELSE(CYCLUS_BIN)
-        SET(CYCLUS_ROOT_DIR "$ENV{HOME}/.local")
-    ENDIF(CYCLUS_BIN)
+    IF(NOT DEFINED CYCLUS_ROOT_DIR)
+        FIND_PROGRAM(CYCLUS_BIN cyclus)
+        MESSAGE("cyclus bin dir: ${CYCLUS_BIN}")
+        IF(CYCLUS_BIN)
+            EXECUTE_PROCESS(COMMAND cyclus --install-path
+                OUTPUT_VARIABLE CYCLUS_ROOT_DIR
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
+        ELSE(CYCLUS_BIN)
+            SET(CYCLUS_ROOT_DIR "$ENV{HOME}/.local")
+        ENDIF(CYCLUS_BIN)
+    ENDIF(NOT DEFINED CYCLUS_ROOT_DIR)
 ENDIF(DEFINED ENV{CYCLUS_ROOT_DIR})

 # Let the user know if we're using a hint


fix FindFFmpeg.cmake: locating avcodec not using pkgconfig variable

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

 # avcodec
 find_path(AVCODEC_INCLUDE_DIR libavcodec/avcodec.h PATHS ${AVCODEC_INCLUDE_DIRS})
-find_library(AVCODEC_LIBRARY avcodec PATHS $ {AVCODEC_LIBRARY_DIRS})
+find_library(AVCODEC_LIBRARY avcodec PATHS ${AVCODEC_LIBRARY_DIRS})

 # avutil
 find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h PATHS ${AVUTIL_INCLUDE_DIRS})


Fixed bug that caused THEORA_FOUND to be always set to false

--- cmake/FindTheora.cmake
+++ cmake/FindTheora.cmake
@@ -41,13 +41,13 @@
 MARK_AS_ADVANCED(THEORA_INCLUDE_DIR)

 # Look for the library.
-FIND_LIBRARY(THEORA_LIBRARIES NAMES theora)
-MARK_AS_ADVANCED(THEORA_LIBRARIES)
+FIND_LIBRARY(THEORA_LIBRARY NAMES theora)
+MARK_AS_ADVANCED(THEORA_LIBRARY)

 # handle the QUIETLY and REQUIRED arguments and set THEORA_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(THEORA DEFAULT_MSG THEORA_LIBRARY THEORA_INCLUDE_DIR)

-SET(THEORA_LIBRARY ${THEORA_LIBRARIES})
+SET(THEORA_LIBRARIES ${THEORA_LIBRARY})


add md5sum for gtest archive

add md5sum for gtest archive

--- cmake/TestHelper.cmake
+++ cmake/TestHelper.cmake
@@ -11,6 +11,7 @@
 ExternalProject_Add(
     gtest160
     URL ${CMAKE_CURRENT_SOURCE_DIR}/build-common/vendor/gtest-1.6.0.zip
+    URL_MD5 "4577b49f2973c90bf9ba69aa8166b786"
     INSTALL_COMMAND ""
     BINARY_DIR ${GTEST_LIB_DIR}
     )


cmake: remove incorrect statement from doc

The function zephyr_append_cmake_library works with
libraries that does not have source files.

This change removes an incorrect statement related
to that.

Signed-off-by: Håkon Øye Amundsen <4238ca2ac515887d8a25d5e30932b12519303bf7@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -446,8 +446,7 @@
 # Add the existing CMake library 'library' to the global list of
 # Zephyr CMake libraries. This is done automatically by the
 # constructor but must called explicitly on CMake libraries that do
-# not use a zephyr library constructor, but have source files that
-# need to be included in the build.
+# not use a zephyr library constructor.
 function(zephyr_append_cmake_library library)
   set_property(GLOBAL APPEND PROPERTY ZEPHYR_LIBS ${library})
 endfunction()


cmake: added libavutil to required libraries for ffmpeg (fixes unresolved symbol _av_free error)

--- cmake/FindFFmpeg.cmake
+++ cmake/FindFFmpeg.cmake
@@ -1 +1 @@
-pkg_check_modules(FFMPEG libavcodec)
+pkg_check_modules(FFMPEG libavcodec libavutil)


cmake: CMake linker functions implemented

This commit introduces zephyr_linker CMake functions for creation of
linker scripts.

The linker functions supports the following features:
- Configuration of memory sections
- Configuration of memory groups
- Creation of output sections
- Configuration of input section the should go into output section and
  how those should be treated, such as sorting, keep, priority.
- Defining linker symbols
- Specifying Kernel VMA to support virtual linking on x86

Overview of functions and macros introduce with this commit:
- pow2round
- zephyr_linker
- zephyr_linker_memory
- zephyr_linker_memory_ifdef
- zephyr_linker_group
- zephyr_linker_section
- zephyr_linker_section_ifdef
- zephyr_iterable_section
- zephyr_linker_section_obj_level
- zephyr_linker_section_configure
- zephyr_linker_symbol
- zephyr_linker_property_append

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

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -21,6 +21,8 @@
 # 3.5. File system management
 # 4. Devicetree extensions
 # 4.1 dt_*
+# 5. Zephyr linker functions
+# 5.1. zephyr_linker*

 ########################################################
 # 1. Zephyr-aware extensions
@@ -1246,6 +1248,38 @@
   else()
     set(${ok} 0 PARENT_SCOPE)
   endif()
+endfunction()
+
+# Function to round number to next power of two.
+#
+# Usage:
+#   pow2round(<variable>)
+#
+# Example:
+# set(test 2)
+# pow2round(test)
+# # test is still 2
+#
+# set(test 5)
+# pow2round(test)
+# # test is now 8
+#
+# Arguments:
+# n   = Variable containing the number to round
+function(pow2round n)
+  math(EXPR x "${${n}} & (${${n}} - 1)")
+  if(${x} EQUAL 0)
+    return()
+  endif()
+
+  math(EXPR ${n} "${${n}} | (${${n}} >> 1)")
+  math(EXPR ${n} "${${n}} | (${${n}} >> 2)")
+  math(EXPR ${n} "${${n}} | (${${n}} >> 4)")
+  math(EXPR ${n} "${${n}} | (${${n}} >> 8)")
+  math(EXPR ${n} "${${n}} | (${${n}} >> 16)")
+  math(EXPR ${n} "${${n}} | (${${n}} >> 32)")
+  math(EXPR ${n} "${${n}} + 1")
+  set(${n} ${${n}} PARENT_SCOPE)
 endfunction()

 ########################################################
@@ -2809,3 +2843,618 @@
     set(${var} ${${var}} PARENT_SCOPE)
   endif()
 endfunction()
+
+########################################################
+# 5. Zephyr linker function
+########################################################
+# 5.1. zephyr_linker*
+#
+# The following methods are for defining linker structure using CMake functions.
+#
+# This allows Zephyr developers to define linker sections and their content and
+# have this configuration rendered into an appropriate linker script based on
+# the toolchain in use.
+# For example:
+# ld linker scripts with GNU ld
+# ARM scatter files with ARM linker.
+#
+# Example usage:
+# zephyr_linker_section(
+#   NAME my_data
+#   VMA  RAM
+#   LMA  FLASH
+# )
+#
+# and to configure special input sections for the section
+# zephyr_linker_section_configure(
+#   SECTION my_data
+#   INPUT   "my_custom_data"
+#   KEEP
+# )
+
+
+# Usage:
+#   zephyr_linker([FORMAT <format>]
+#     [ENTRY <entry symbol>]
+#   )
+#
+# Zephyr linker general settings.
+# This function specifies general settings for the linker script to be generated.
+#
+# FORMAT <format>:            The output format of the linked executable.
+# ENTRY <entry symbolformat>: The code entry symbol.
+#
+function(zephyr_linker)
+  set(single_args "ENTRY;FORMAT")
+  cmake_parse_arguments(LINKER "" "${single_args}" "" ${ARGN})
+
+  if(LINKER_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "zephyr_linker(${ARGV0} ...) given unknown "
+                        "arguments: ${LINKER_UNPARSED_ARGUMENTS}"
+    )
+  endif()
+
+  if(DEFINED LINKER_FORMAT)
+    get_property(format_defined TARGET linker PROPERTY FORMAT SET)
+    if(format_defined)
+      message(FATAL_ERROR "zephyr_linker(FORMAT ...) already configured.")
+    else()
+      set_property(TARGET linker PROPERTY FORMAT ${LINKER_FORMAT})
+    endif()
+  endif()
+
+  if(DEFINED LINKER_ENTRY)
+    get_property(entry_defined TARGET linker PROPERTY ENTRY SET)
+    if(entry_defined)
+      message(FATAL_ERROR "zephyr_linker(ENTRY ...) already configured.")
+    else()
+      set_property(TARGET linker PROPERTY ENTRY ${LINKER_ENTRY})
+    endif()
+  endif()
+endfunction()
+
+# Usage:
+#   zephyr_linker_memory(NAME <name> START <address> SIZE <size> FLAGS <flags>)
+#
+# Zephyr linker memory.
+# This function specifies a memory region for the platform in use.
+#
+# Note:
+#   This function should generally be called with values obtained from
+#   devicetree or Kconfig.
+#
+# NAME <name>    : Name of the memory region, for example FLASH.
+# START <address>: Start address of the memory region.
+#                  Start address can be given as decimal or hex value.
+# SIZE <size>    : Size of the memory region.
+#                  Size can be given as decimal value, hex value, or decimal with postfix k or m.
+#                  All the following are valid values:
+#                    1048576, 0x10000, 1024k, 1024K, 1m, and 1M.
+# FLAGS <flags>  : Flags describing properties of the memory region.
+#                  Currently supported:
+#                  r: Read-only region
+#                  w: Read-write region
+#                  x: Executable region
+#                  The flags r and x, or w and x may be combined like: rx, wx.
+function(zephyr_linker_memory)
+  set(single_args "FLAGS;NAME;SIZE;START")
+  cmake_parse_arguments(MEMORY "" "${single_args}" "" ${ARGN})
+
+  if(MEMORY_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "zephyr_linker_memory(${ARGV0} ...) given unknown "
+                        "arguments: ${MEMORY_UNPARSED_ARGUMENTS}"
+    )
+  endif()
+
+  foreach(arg ${single_args})
+    if(NOT DEFINED MEMORY_${arg})
+      message(FATAL_ERROR "zephyr_linker_memory(${ARGV0} ...) missing required "
+                          "argument: ${arg}"
+      )
+    endif()
+  endforeach()
+
+  set(MEMORY)
+  zephyr_linker_arg_val_list(MEMORY "${single_args}")
+
+  string(REPLACE ";" "\;" MEMORY "${MEMORY}")
+  set_property(TARGET linker
+               APPEND PROPERTY MEMORY_REGIONS "{${MEMORY}}"
+  )
+endfunction()
+
+# Usage:
+#   zephyr_linker_memory_ifdef(<setting> NAME <name> START <address> SIZE <size> FLAGS <flags>)
+#
+# Will create memory region if <setting> is enabled.
+#
+# <setting>: Setting to check for True value before invoking
+#            zephyr_linker_memory()
+#
+# See zephyr_linker_memory() description for other supported arguments.
+#
+macro(zephyr_linker_memory_ifdef feature_toggle)
+  if(${${feature_toggle}})
+    zephyr_linker_memory(${ARGN})
+  endif()
+endmacro()
+
+# Usage:
+#   zephyr_linker_group(NAME <name> [VMA <region|group>] [LMA <region|group>])
+#   zephyr_linker_group(NAME <name> GROUP <group>)
+#
+# Zephyr linker group.
+# This function specifies a group inside a memory region or another group.
+#
+# The group ensures that all section inside the group are located together inside
+# the specified group.
+#
+# This also allows for section placement inside a given group without the section
+# itself needing the precise knowledge regarding the exact memory region this
+# section will be placed in, as that will be determined by the group setup.
+#
+# Each group will define the following linker symbols:
+# __<name>_start      : Start address of the group
+# __<name>_end        : End address of the group
+# __<name>_size       : Size of the group
+#
+# Note: <name> will be converted to lower casing for linker symbols definitions.
+#
+# NAME <name>         : Name of the group.
+# VMA <region|group>  : VMA Memory region or group to be used for this group.
+#                       If a group is used then the VMA region of that group will be used.
+# LMA <region|group>  : Memory region or group to be used for this group.
+# GROUP <group>       : Place the new group inside the existing group <group>
+#
+# Note: VMA and LMA are mutual exclusive with GROUP
+#
+# Example:
+#   zephyr_linker_memory(NAME memA START ... SIZE ... FLAGS ...)
+#   zephyr_linker_group(NAME groupA LMA memA)
+#   zephyr_linker_group(NAME groupB LMA groupA)
+#
+# will create two groups in same memory region as groupB will inherit the LMA
+# from groupA:
+#
+# +-----------------+
+# | memory region A |
+# |                 |
+# | +-------------+ |
+# | | groupA      | |
+# | +-------------+ |
+# |                 |
+# | +-------------+ |
+# | | groupB      | |
+# | +-------------+ |
+# |                 |
+# +-----------------+
+#
+# whereas
+#   zephyr_linker_memory(NAME memA START ... SIZE ... FLAGS ...)
+#   zephyr_linker_group(NAME groupA LMA memA)
+#   zephyr_linker_group(NAME groupB GROUP groupA)
+#
+# will create groupB inside groupA:
+#
+# +---------------------+
+# | memory region A     |
+# |                     |
+# | +-----------------+ |
+# | | groupA          | |
+# | |                 | |
+# | | +-------------+ | |
+# | | | groupB      | | |
+# | | +-------------+ | |
+# | |                 | |
+# | +-----------------+ |
+# |                     |
+# +---------------------+
+function(zephyr_linker_group)
+  set(single_args "NAME;GROUP;LMA;VMA")
+  cmake_parse_arguments(GROUP "" "${single_args}" "" ${ARGN})
+
+  if(GROUP_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "zephyr_linker_group(${ARGV0} ...) given unknown "
+                        "arguments: ${GROUP_UNPARSED_ARGUMENTS}"
+    )
+  endif()
+
+  if(DEFINED GROUP_GROUP AND (DEFINED GROUP_VMA OR DEFINED GROUP_LMA))
+    message(FATAL_ERROR "zephyr_linker_group(GROUP ...) cannot be used with "
+                        "VMA or LMA"
+    )
+  endif()
+
+  set(GROUP)
+  zephyr_linker_arg_val_list(GROUP "${single_args}")
+
+  string(REPLACE ";" "\;" GROUP "${GROUP}")
+  set_property(TARGET linker
+               APPEND PROPERTY GROUPS "{${GROUP}}"
+  )
+endfunction()
+
+# Usage:
+#   zephyr_linker_section(NAME <name> [GROUP <group>]
+#                         [VMA <region|group>] [LMA <region|group>]
+#                         [ADDRESS <address>] [ALIGN <alignment>]
+#                         [SUBALIGN <alignment>] [FLAGS <flags>]
+#                         [HIDDEN] [NOINPUT] [NOINIT]
+#                         [PASS <no> [<no>...]
+#   )
+#
+# Zephyr linker output section.
+# This function specifies an output section for the linker.
+#
+# When using zephyr_linker_section(NAME <name>) an output section with <name>
+# will be configured. This section will default include input sections of the
+# same name, unless NOINPUT is specified.
+# This means the section named `foo` will default include the sections matching
+# `foo` and `foo.*`
+# Each output section will define the following linker symbols:
+# __<name>_start      : Start address of the section
+# __<name>_end        : End address of the section
+# __<name>_size       : Size of the section
+# __<name>_load_start : Load address of the section, if VMA = LMA then this
+#                       value will be identical to `__<name>_start`
+#
+# The location of the output section can be controlled using LMA, VMA, and
+# address parameters
+#
+# NAME <name>         : Name of the output section.
+# VMA <region|group>  : VMA Memory region or group where code / data is located runtime (VMA)
+#                       If <group> is used here it means the section will use the
+#                       same VMA memory region as <group> but will not be placed
+#                       inside the group itself, see also GROUP argument.
+# KVMA <region|group> : Kernel VMA Memory region or group where code / data is located runtime (VMA)
+#                       When MMU is active and Kernel VM base and offset is different
+#                       from SRAM base and offset, then the region defined by KVMA will
+#                       be used as VMA.
+#                       If <group> is used here it means the section will use the
+#                       same VMA memory region as <group> but will not be placed
+#                       inside the group itself, see also GROUP argument.
+# LMA <region|group>  : Memory region or group where code / data is loaded (LMA)
+#                       If VMA is different from LMA, the code / data will be loaded
+#                       from LMA into VMA at bootup, this is usually the case for
+#                       global or static variables that are loaded in rom and copied
+#                       to ram at boot time.
+#                       If <group> is used here it means the section will use the
+#                       same LMA memory region as <group> but will not be placed
+#                       inside the group itself, see also GROUP argument.
+# GROUP <group>       : Place this section inside the group <group>
+# ADDRESS <address>   : Specific address to use for this section.
+# ALIGN_WITH_INPUT    : The alignment difference between VMA and LMA is kept
+#                       intact for this section.
+# ALIGN <alignment>   : Align the execution address with alignment.
+# SUBALIGN <alignment>: Align input sections with alignment value.
+# ENDALIGN <alignment>: Align the end so that next output section will start aligned.
+#                       This only has effect on Scatter scripts.
+#  Note: Regarding all alignment attributes. Not all linkers may handle alignment
+#        in identical way. For example the Scatter file will align both load and
+#        execution address (LMA and VMA) to be aligned when given the ALIGN attribute.
+# NOINPUT             : No default input sections will be defined, to setup input
+#                       sections for section <name>, the corresponding
+#                       `zephyr_linker_section_configure()` must be used.
+# PASS <no> [<no> ..] : Linker pass iteration where this section should be active.
+#                       Default a section will be present during all linker passes
+#                       But in cases a section shall only be present at a specific
+#                       pass, this argument can be used. For example to only have
+#                       this section present on the first linker pass, use `PASS 1`.
+#
+# Note: VMA and LMA are mutual exclusive with GROUP
+#
+function(zephyr_linker_section)
+  set(options     "ALIGN_WITH_INPUT;HIDDEN;NOINIT;NOINPUT")
+  set(single_args "ADDRESS;ALIGN;ENDALIGN;GROUP;KVMA;LMA;NAME;SUBALIGN;TYPE;VMA")
+  set(multi_args  "PASS")
+  cmake_parse_arguments(SECTION "${options}" "${single_args}" "${multi_args}" ${ARGN})
+
+  if(SECTION_UNPARSED_ARGUMENTS)
+    message(WARNING "zephyr_linker_section(${ARGV0} ...) given unknown "
+                    "arguments: ${SECTION_UNPARSED_ARGUMENTS}"
+    )
+  endif()
+
+  if(DEFINED SECTION_GROUP AND (DEFINED SECTION_VMA OR DEFINED SECTION_LMA))
+    message(FATAL_ERROR "zephyr_linker_section(GROUP ...) cannot be used with "
+                        "VMA or LMA"
+    )
+  endif()
+
+  if(DEFINED SECTION_KVMA)
+    # If KVMA is set and the Kernel virtual memory settings reqs are met, we
+    # substitute the VMA setting with the specified KVMA value.
+    if(CONFIG_MMU)
+      math(EXPR KERNEL_MEM_VM_OFFSET
+           "(${CONFIG_KERNEL_VM_BASE} + ${CONFIG_KERNEL_VM_OFFSET})\
+            - (${CONFIG_SRAM_BASE_ADDRESS} + ${CONFIG_SRAM_OFFSET})"
+      )
+
+      if(NOT (${KERNEL_MEM_VM_OFFSET} EQUAL 0))
+        set(SECTION_VMA ${SECTION_KVMA})
+        set(SECTION_KVMA)
+      endif()
+    endif()
+  endif()
+
+  set(SECTION)
+  zephyr_linker_arg_val_list(SECTION "${single_args}")
+  zephyr_linker_arg_val_list(SECTION "${options}")
+  zephyr_linker_arg_val_list(SECTION "${multi_args}")
+
+  string(REPLACE ";" "\;" SECTION "${SECTION}")
+  set_property(TARGET linker
+               APPEND PROPERTY SECTIONS "{${SECTION}}"
+  )
+endfunction()
+
+# Usage:
+#   zephyr_linker_section_ifdef(<setting>
+#                               NAME <name> [VMA <region>] [LMA <region>]
+#                               [ADDRESS <address>] [ALIGN <alignment>]
+#                               [SUBALIGN <alignment>] [FLAGS <flags>]
+#                               [HIDDEN] [NOINPUT] [NOINIT]
+#                               [PASS <no> [<no>...]
+#   )
+#
+# Will create an output section if <setting> is enabled.
+#
+# <setting>: Setting to check for True value before invoking
+#            zephyr_linker_section()
+#
+# See zephyr_linker_section() description for other supported arguments.
+#
+macro(zephyr_linker_section_ifdef feature_toggle)
+  if(${${feature_toggle}})
+    zephyr_linker_section(${ARGN})
+  endif()
+endmacro()
+
+# Usage:
+#   zephyr_iterable_section(NAME <name> [GROUP <group>]
+#                           [VMA <region|group>] [LMA <region|group>]
+#                           [ALIGN_WITH_INPUT] [SUBALIGN <alignment>]
+#   )
+#
+#
+# Define an output section which will set up an iterable area
+# of equally-sized data structures. For use with Z_STRUCT_SECTION_ITERABLE.
+# Input sections will be sorted by name in lexicographical order.
+#
+# Each list for an input section will define the following linker symbols:
+# _<name>_list_start: Start of the iterable list
+# _<name>_list_end  : End of the iterable list
+#
+# The output section will be named `<name>_area` and define the following linker
+# symbols:
+# __<name>_area_start      : Start address of the section
+# __<name>_area_end        : End address of the section
+# __<name>_area_size       : Size of the section
+# __<name>_area_load_start : Load address of the section, if VMA = LMA then this
+#                            value will be identical to `__<name>_area_start`
+#
+# NAME <name>         : Name of the struct type, the output section be named
+#                       accordingly as: <name>_area.
+# VMA <region|group>  : VMA Memory region where code / data is located runtime (VMA)
+# LMA <region|group>  : Memory region where code / data is loaded (LMA)
+#                       If VMA is different from LMA, the code / data will be loaded
+#                       from LMA into VMA at bootup, this is usually the case for
+#                       global or static variables that are loaded in rom and copied
+#                       to ram at boot time.
+# GROUP <group>       : Place this section inside the group <group>
+# ADDRESS <address>   : Specific address to use for this section.
+# ALIGN_WITH_INPUT    : The alignment difference between VMA and LMA is kept
+#                       intact for this section.
+# SUBALIGN <alignment>: Force input alignment with size <alignment>
+#  Note: Regarding all alignment attributes. Not all linkers may handle alignment
+#        in identical way. For example the Scatter file will align both load and
+#        execution address (LMA and VMA) to be aligned when given the ALIGN attribute.
+#/
+function(zephyr_iterable_section)
+  # ToDo - Should we use ROM, RAM, etc as arguments ?
+  set(options     "ALIGN_WITH_INPUT")
+  set(single_args "GROUP;LMA;NAME;SUBALIGN;VMA")
+  set(multi_args  "")
+  set(align_input)
+  cmake_parse_arguments(SECTION "${options}" "${single_args}" "${multi_args}" ${ARGN})
+
+  if(NOT DEFINED SECTION_NAME)
+    message(FATAL_ERROR "zephyr_iterable_section(${ARGV0} ...) missing "
+                        "required argument: NAME"
+    )
+  endif()
+
+  if(NOT DEFINED SECTION_SUBALIGN)
+    message(FATAL_ERROR "zephyr_iterable_section(${ARGV0} ...) missing "
+                        "required argument: SUBALIGN"
+    )
+  endif()
+
+  if(SECTION_ALIGN_WITH_INPUT)
+    set(align_input ALIGN_WITH_INPUT)
+  endif()
+
+  zephyr_linker_section(
+    NAME ${SECTION_NAME}_area
+    GROUP "${SECTION_GROUP}"
+    VMA "${SECTION_VMA}" LMA "${SECTION_LMA}"
+    NOINPUT ${align_input} SUBALIGN ${SECTION_SUBALIGN}
+  )
+  zephyr_linker_section_configure(
+    SECTION ${SECTION_NAME}_area
+    INPUT "._${SECTION_NAME}.static.*"
+    SYMBOLS _${SECTION_NAME}_list_start _${SECTION_NAME}_list_end
+    KEEP SORT NAME
+  )
+endfunction()
+
+# Usage:
+#   zephyr_linker_section_obj_level(SECTION <section> LEVEL <level>)
+#
+# generate a symbol to mark the start of the objects array for
+# the specified object and level, then link all of those objects
+# (sorted by priority). Ensure the objects aren't discarded if there is
+# no direct reference to them.
+#
+# This is useful content such as struct devices.
+#
+# For example: zephyr_linker_section_obj_level(SECTION init LEVEL PRE_KERNEL_1)
+# will create an input section matching `.z_init_PRE_KERNEL_1?_` and
+# `.z_init_PRE_KERNEL_1??_`.
+#
+# SECTION <section>: Section in which the objects shall be placed
+# LEVEL <level>    : Priority level, all input sections matching the level
+#                    will be sorted.
+#
+function(zephyr_linker_section_obj_level)
+  set(single_args "SECTION;LEVEL")
+  cmake_parse_arguments(OBJ "" "${single_args}" "" ${ARGN})
+
+  if(NOT DEFINED OBJ_SECTION)
+    message(FATAL_ERROR "zephyr_linker_section_obj_level(${ARGV0} ...) "
+                        "missing required argument: SECTION"
+    )
+  endif()
+
+  if(NOT DEFINED OBJ_LEVEL)
+    message(FATAL_ERROR "zephyr_linker_section_obj_level(${ARGV0} ...) "
+                        "missing required argument: LEVEL"
+    )
+  endif()
+
+  zephyr_linker_section_configure(
+    SECTION ${OBJ_SECTION}
+    INPUT ".z_${OBJ_SECTION}_${OBJ_LEVEL}?_"
+    SYMBOLS __${OBJ_SECTION}_${OBJ_LEVEL}_start
+    KEEP SORT NAME
+  )
+  zephyr_linker_section_configure(
+    SECTION ${OBJ_SECTION}
+    INPUT ".z_${OBJ_SECTION}_${OBJ_LEVEL}??_"
+    KEEP SORT NAME
+  )
+endfunction()
+
+# Usage:
+#   zephyr_linker_section_configure(SECTION <section> [ALIGN <alignment>]
+#                                   [PASS <no>] [PRIO <no>] [SORT <sort>]
+#                                   [ANY] [FIRST] [KEEP]
+#   )
+#
+# Configure an output section with additional input sections.
+# An output section can be configured with additional input sections besides its
+# default section.
+# For example, adding the input section `foo` to the output section bar, with KEEP
+# attribute, then call:
+#   zephyr_linker_section_configure(SECTION bar INPUT foo KEEP)
+#
+# ALIGN <alignment>   : Will align the input section placement inside the load
+#                       region with <alignment>
+# FIRST               : The first input section in the list should be marked as
+#                       first section in output.
+# SORT <NAME>         : Sort the input sections according to <type>.
+#                       Currently only `NAME` is supported.
+# KEEP                : Do no eliminate input section during linking
+# PRIO                : The priority of the input section. Per default, input
+#                       sections order is not guaranteed by all linkers, but
+#                       using priority, then Zephyr CMake linker will create
+#                       sections so order can be guaranteed. All unprioritized
+#                       sections will internally be given a CMake process order
+#                       priority counting from 100, so first unprioritized section
+#                       is handles internal pri0 100, next 101, and so on.
+#                       To ensure a specific input section come before those,
+#                       you may use `PRIO 50`, `PRIO 20` and so on.
+#                       To ensure an input section is at the end, it is advised
+#                       to use `PRIO 200` and above.
+# PASS <no>           : The call should only be considered for linker pass number <no>.
+#                       For example, `PASS 1` means the call is only effective
+#                       on first linker pass iteration. `PASS 2` on second iteration,
+#                       and so on.
+# FLAGS <flags>       : Special section flags such as "+RO", +XO, "+ZI".
+# ANY                 : ANY section flag in scatter file.
+#                       The FLAGS and ANY arguments only has effect for scatter files.
+#
+function(zephyr_linker_section_configure)
+  set(options     "ANY;FIRST;KEEP")
+  set(single_args "ALIGN;OFFSET;PASS;PRIO;SECTION;SORT")
+  set(multi_args  "FLAGS;INPUT;SYMBOLS")
+  cmake_parse_arguments(SECTION "${options}" "${single_args}" "${multi_args}" ${ARGN})
+
+  if(SECTION_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "zephyr_linker_section_configure(${ARGV0} ...) given unknown arguments: ${SECTION_UNPARSED_ARGUMENTS}")
+  endif()
+
+  if(DEFINED SECTION_SYMBOLS)
+    list(LENGTH SECTION_SYMBOLS symbols_count)
+    if(${symbols_count} GREATER 2)
+      message(FATAL_ERROR "zephyr_linker_section_configure(SYMBOLS [start_sym [end_sym]]) takes maximum two symbol names (start and end).")
+
+    endif()
+  endif()
+
+  set(SECTION)
+  zephyr_linker_arg_val_list(SECTION "${single_args}")
+  zephyr_linker_arg_val_list(SECTION "${options}")
+  zephyr_linker_arg_val_list(SECTION "${multi_args}")
+
+  string(REPLACE ";" "\;" SECTION "${SECTION}")
+  set_property(TARGET linker
+               APPEND PROPERTY SECTION_SETTINGS "{${SECTION}}"
+  )
+endfunction()
+
+# Usage:
+#   zephyr_linker_symbol(SYMBOL <name> EXPR <expr>)
+#
+# Add additional user defined symbol to the generated linker script.
+#
+# SYMBOL <name>: Symbol name to be available.
+# EXPR <expr>  : Expression that defines the symbol. Due to linker limitations
+#                all expressions should only contain simple math, such as
+#                `+, -, *` and similar. The expression will go directly into the
+#                linker, and all `%<symbol>%` will be replaced with the referred
+#                symbol.
+#
+# Example:
+#   To create a new symbol `bar` pointing to the start VMA address of section
+#   `foo` + 1024, one can write:
+#     zephyr_linker_symbol(SYMBOL bar EXPR "(%foo% + 1024)")
+#
+function(zephyr_linker_symbol)
+  set(single_args "EXPR;SYMBOL")
+  cmake_parse_arguments(SYMBOL "" "${single_args}" "" ${ARGN})
+
+  if(SECTION_UNPARSED_ARGUMENTS)
+    message(WARNING "zephyr_linker_symbol(${ARGV0} ...) given unknown "
+                    "arguments: ${SECTION_UNPARSED_ARGUMENTS}"
+    )
+  endif()
+
+  set(SYMBOL)
+  zephyr_linker_arg_val_list(SYMBOL "${single_args}")
+
+  string(REPLACE ";" "\;" SYMBOL "${SYMBOL}")
+  set_property(TARGET linker
+               APPEND PROPERTY SYMBOLS "{${SYMBOL}}"
+  )
+endfunction()
+
+# Internal helper macro for zephyr_linker*() functions.
+# The macro will create a list of argument-value pairs for defined arguments
+# that can be passed on to linker script generators and processed as a CMake
+# function call using cmake_parse_arguments.
+#
+# For example, having the following argument and value:
+# FOO: bar
+# BAZ: <undefined>
+# QUX: option set
+#
+# will create a list as: "FOO;bar;QUX:TRUE" which can then be parsed as argument
+# list later.
+macro(zephyr_linker_arg_val_list list arguments)
+  foreach(arg ${arguments})
+    if(DEFINED ${list}_${arg})
+      list(APPEND ${list} ${arg} "${${list}_${arg}}")
+    endif()
+  endforeach()
+endmacro()


Seperate the CMake cc_test based on target platform

Most of the tests are platform specific, so defining them as cc_test, cc_test_on_ios, etc, instead of all in cc_test is a more sensible approach.

PiperOrigin-RevId: 260042373

--- cmake/test_rules.cmake
+++ cmake/test_rules.cmake
@@ -23,34 +23,15 @@
 # Defines a new test executable target with the given target name, sources, and
 # dependencies.  Implicitly adds DEPENDS on gtest and gtest_main.
 function(cc_test name)
-  set(multi DEPENDS SOURCES INCLUDES DEFINES
-      ANDROID_DEPENDS ANDROID_SOURCES ANDROID_INCLUDES ANDROID_DEFINES
-      IOS_DEPENDS IOS_SOURCES IOS_INCLUDES IOS_DEFINES
-      DESKTOP_DEPENDS DESKTOP_SOURCES DESKTOP_INCLUDES DESKTOP_DEFINES)
+  if (ANDROID OR IOS)
+    return()
+  endif()
+
+  set(multi DEPENDS SOURCES INCLUDES DEFINES)
   # Parse the arguments into cc_test_SOURCES and cc_test_DEPENDS.
   cmake_parse_arguments(cc_test "" "" "${multi}" ${ARGN})

   list(APPEND cc_test_DEPENDS gmock gtest gtest_main)
-  if (ANDROID)
-    list(APPEND cc_test_SOURCES "${cc_test_ANDROID_SOURCES}")
-    list(APPEND cc_test_DEPENDS "${cc_test_ANDROID_DEPENDS}")
-    list(APPEND cc_test_INCLUDES "${cc_test_ANDROID_INCLUDES}")
-    list(APPEND cc_test_DEFINES "${cc_test_ANDROID_DEFINES}")
-  elseif (IOS)
-    list(APPEND cc_test_SOURCES "${cc_test_IOS_SOURCES}")
-    list(APPEND cc_test_DEPENDS
-         "${cc_test_IOS_DEPENDS}"
-         "-framework CoreFoundation"
-         "-framework Foundation"
-    )
-    list(APPEND cc_test_INCLUDES "${cc_test_IOS_INCLUDES}")
-    list(APPEND cc_test_DEFINES "${cc_test_IOS_DEFINES}")
-  else()
-    list(APPEND cc_test_SOURCES "${cc_test_DESKTOP_SOURCES}")
-    list(APPEND cc_test_DEPENDS "${cc_test_DESKTOP_DEPENDS}")
-    list(APPEND cc_test_INCLUDES "${cc_test_DESKTOP_INCLUDES}")
-    list(APPEND cc_test_DEFINES "${cc_test_DESKTOP_DEFINES}")
-  endif()

   add_executable(${name} ${cc_test_SOURCES})
   add_test(${name} ${name})
@@ -65,4 +46,45 @@
       -DINTERNAL_EXPERIMENTAL=1
       ${cc_test_DEFINES}
   )
-endfunction()+endfunction()
+
+# cc_test_on_ios(
+#   target
+#   SOURCES sources...
+#   DEPENDS libraries...
+# )
+#
+# Defines a new test executable target with the given target name, sources, and
+# dependencies.  Implicitly adds DEPENDS on gtest, gtest_main, Foundation and
+# CoreFoundation frameworks.
+function(cc_test_on_ios name)
+  if (NOT IOS)
+    return()
+  endif()
+
+  set(multi DEPENDS SOURCES INCLUDES DEFINES)
+  # Parse the arguments into cc_test_SOURCES and cc_test_DEPENDS.
+  cmake_parse_arguments(cc_test "" "" "${multi}" ${ARGN})
+
+  list(APPEND cc_test_DEPENDS
+       gmock
+       gtest
+       gtest_main
+       "-framework CoreFoundation"
+       "-framework Foundation"
+  )
+
+  add_executable(${name} ${cc_test_SOURCES})
+  add_test(${name} ${name})
+  target_include_directories(${name}
+    PRIVATE
+      ${FIREBASE_SOURCE_DIR}
+      ${cc_test_INCLUDES}
+  )
+  target_link_libraries(${name} PRIVATE ${cc_test_DEPENDS})
+  target_compile_definitions(${name}
+    PRIVATE
+      -DINTERNAL_EXPERIMENTAL=1
+      ${cc_test_DEFINES}
+  )
+endfunction()


Update Math.cmake

Update Math.cmake

Adding ``CMAKE_EXE_LINKER_FLAGS`` into the required flags when testing for BLAS/LAPACK support (primarily so that ``/SAFESEH:NO`` is properly added when using MSVC).

--- cmake/tests/Math.cmake
+++ cmake/tests/Math.cmake
@@ -111,7 +111,7 @@
   # ----------
   # NOTE: MATH_LIBS may involve MPI functionality (e.g., ScaLAPACK) and so
   #       MPI flags should be added for the detection
-  set(CMAKE_REQUIRED_FLAGS "${MPI_C_COMPILE_FLAGS} ${MPI_LINK_FLAGS}")
+  set(CMAKE_REQUIRED_FLAGS "${MPI_C_COMPILE_FLAGS} ${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
   set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH})
   set(CMAKE_REQUIRED_LIBRARIES ${MATH_LIBS} ${MPI_C_LIBRARIES})
   if(EL_BLAS_SUFFIX)


cmake/unit_tests: Add cURL include dir

cmake/unit_tests: Add cURL include dir

This fixes Windows build error.

--- cmake/unit_tests.cmake
+++ cmake/unit_tests.cmake
@@ -1,5 +1,6 @@
 include_directories(${CMAKE_SOURCE_DIR}/core)
 include_directories(${CMAKE_SOURCE_DIR}/third_party/mavlink/include)
+include_directories(${CURL_INCLUDE_DIRS})

 add_executable(unit_tests_runner
     ${UNIT_TEST_SOURCES}


Version: Update development date

Version: Update development date

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


special case for OBJECT_LIBRARY, necessary in Ubuntu 16

--- compcmake/joedbc.cmake
+++ compcmake/joedbc.cmake
@@ -65,8 +65,13 @@
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  add_dependencies(${target} all_joedbc)
  target_include_directories(${target} PUBLIC ${JOEDB_DIR}/../src)
- target_link_libraries(${target} ${JOEDB_LIB})
- if (libssh_FOUND)
-  target_link_libraries(${target} ${LIBSSH_LIBRARIES})
+ get_target_property(target_type ${target} TYPE)
+ message("-- ${target}: ${target_type}")
+
+ if (NOT "${target_type}" STREQUAL "OBJECT_LIBRARY")
+  target_link_libraries(${target} ${JOEDB_LIB})
+  if (libssh_FOUND)
+   target_link_libraries(${target} ${LIBSSH_LIBRARIES})
+  endif()
  endif()
 endfunction()


Remove caching of variables holding full install paths. Closes #28

--- CMake/IRTKInstallDirs.cmake
+++ CMake/IRTKInstallDirs.cmake
@@ -23,11 +23,11 @@
             MANDIR
             DOCDIR)
   set(IRTK_INSTALL_${dir} "${CMAKE_INSTALL_${dir}}" CACHE PATH "")
-  set(IRTK_INSTALL_FULL_${dir} "${CMAKE_INSTALL_FULL_${dir}}" CACHE PATH "")
+  set(IRTK_INSTALL_FULL_${dir} "${CMAKE_INSTALL_FULL_${dir}}")
 endforeach()

 set(IRTK_INSTALL_CMAKEDIR "${IRTK_INSTALL_LIBDIR}/cmake/IRTK" CACHE PATH "")
-set(IRTK_INSTALL_FULL_CMAKEDIR "${IRTK_INSTALL_FULL_LIBDIR}/cmake/IRTK" CACHE PATH "")
+set(IRTK_INSTALL_FULL_CMAKEDIR "${IRTK_INSTALL_FULL_LIBDIR}/cmake/IRTK")

 set(IRTK_INSTALL_EXAMPLEDIR "${IRTK_INSTALL_DOCDIR}/examples" CACHE PATH "")
-set(IRTK_INSTALL_FULL_EXAMPLEDIR "${IRTK_INSTALL_FULL_DOCDIR}/examples" CACHE PATH "")
+set(IRTK_INSTALL_FULL_EXAMPLEDIR "${IRTK_INSTALL_FULL_DOCDIR}/examples")


COMP: Prefer modern CMake visibility settings

When available, prefer to use the modern cmake
set_target_property() mechanism for setting
export visibility of libaries.

The add_compiler_export_flags function is obsolete. Use the
CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target properties
instead.

Change-Id: Ibcf8b493bd8cba021e12e14bf18a7b46ae7e6e0a

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -170,9 +170,20 @@
     if (BUILD_SHARED_LIBS)
       # export flags are only added when building shared libs, they cause
       # mismatched visibility warnings when building statically.
-      add_compiler_export_flags(my_abi_flags)
-      set_property(TARGET ${itk-module} APPEND
-        PROPERTY COMPILE_FLAGS "${my_abi_flags}")
+      if(CMAKE_VERSION VERSION_LESS 2.8.12)
+        # future DEPRECATION notice from cmake:
+        #      "The add_compiler_export_flags function is obsolete.
+        #       Use the CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN
+        #       target properties instead."
+        add_compiler_export_flags(my_abi_flags)
+        set_property(TARGET ${itk-module} APPEND
+          PROPERTY COMPILE_FLAGS "${my_abi_flags}")
+      else()
+        # Prefer to use target properties supported by newer cmake
+        set_target_properties(${itk-module} PROPERTIES CXX_VISIBILITY_PRESET hidden)
+        set_target_properties(${itk-module} PROPERTIES C_VISIBILITY_PRESET hidden)
+        set_target_properties(${itk-module} PROPERTIES VISIBILITY_INLINES_HIDDEN 1)
+      endif()
     endif()
   endif()


Need to check for static targets before adding abi visibility flags.

If shared libraries are getting built there may still be some
libraries that are set to be built statically. I added in a check
to see if the target was a static library before adding in extra
compile flags.

Change-Id: I0c3de83964faef78a421824e07f0180742848b9f

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -588,11 +588,12 @@

   # Generate the export macro header for symbol visibility/Windows DLL declspec
   generate_export_header(${vtk-module} EXPORT_FILE_NAME ${vtk-module}Module.h)
-  if (BUILD_SHARED_LIBS)
+  get_property(_buildtype TARGET ${vtk-module} PROPERTY TYPE)
+  if (NOT "${_buildtype}" STREQUAL STATIC_LIBRARY)
     # export flags are only added when building shared libs, they cause
     # mismatched visibility warnings when building statically since not all
     # libraries that VTK builds don't set visibility flags. Until we get a
-    # time to do that, we skip visibility flags for static builds.
+    # time to do that, we skip visibility flags for static libraries.
     add_compiler_export_flags(my_abi_flags)
     set_property(TARGET ${vtk-module} APPEND
       PROPERTY COMPILE_FLAGS "${my_abi_flags}")


Changed OpenCV download

Changed OpenCV download

--- CMakeExternals/OpenCV.cmake
+++ CMakeExternals/OpenCV.cmake
@@ -26,7 +26,8 @@

       list(APPEND additional_cmake_args
          -DBUILD_opencv_python:BOOL=ON
-         -DBUILD_NEW_PYTHON_SUPPORT:BOOL=ON
+         -DBUILD_opencv_python3:BOOL=ON
+         #-DBUILD_NEW_PYTHON_SUPPORT:BOOL=ON
          -DPYTHON_DEBUG_LIBRARY:FILEPATH=${PYTHON_DEBUG_LIBRARY}
          -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}
          -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
@@ -39,7 +40,9 @@
     else()
       list(APPEND additional_cmake_args
          -DBUILD_opencv_python:BOOL=OFF
-         -DBUILD_NEW_PYTHON_SUPPORT:BOOL=OFF
+         -DBUILD_opencv_python3:BOOL=OFF
+         -DBUILD_opencv_python_bindings_generator:BOOL=OFF
+         #-DBUILD_NEW_PYTHON_SUPPORT:BOOL=OFF
           )
     endif()

@@ -59,9 +62,8 @@
       )
     endif()

-    set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/opencv-2.4.13.5.tar.gz)
-    set(opencv_url_md5 6cbe56ffb9ab1424fc2f5e78f46c82a8)
-
+    set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/opencv-3.4.1.zip)
+    set(opencv_url_md5 8464ce888f4c283895626950bada1e44)
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       URL ${opencv_url}
@@ -76,6 +78,7 @@
         -DBUILD_EXAMPLES:BOOL=OFF
         -DBUILD_DOXYGEN_DOCS:BOOL=OFF
         -DWITH_CUDA:BOOL=OFF
+        -DWITH_VTK:BOOL=OFF
         ${additional_cmake_args}
       CMAKE_CACHE_ARGS
         ${ep_common_cache_args}


Conform to Covise FindGLEW.cmake script

Conform to Covise FindGLEW.cmake script

Define variable GLEW_INCLUDE_DIR instead of GLEW_INCLUDE_PATH

git-svn-id: a0a066a1d7ce87c7a04dae20f169ad0cd8bda35d@1137 04231f92-3938-0410-9931-e931ac552b4f

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

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

-IF (GLEW_INCLUDE_PATH)
+IF (GLEW_INCLUDE_DIR)
 	SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ELSE (GLEW_INCLUDE_PATH)
+ELSE (GLEW_INCLUDE_DIR)
 	SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ENDIF (GLEW_INCLUDE_PATH)
+ENDIF (GLEW_INCLUDE_DIR)

 MARK_AS_ADVANCED( GLEW_FOUND )


CHG: moved QmitkTransferFunctionWidget from functionalities to Qmitk base library

--- QFunctionalities/QmitkVolumeVisualization/QmitkVolumeVisualization.cmake
+++ QFunctionalities/QmitkVolumeVisualization/QmitkVolumeVisualization.cmake
@@ -1,7 +1,7 @@
 INCLUDE_DIRECTORIES( ${IP_ROOT}/Functionalities/QmitkVolumeVisualization)

 # VolumeVisualization
-INCLUDE(${IP_ROOT}/AppModules/QmitkTransferFunctionWidget/QmitkTransferFunctionWidget.cmake)
+# INCLUDE(${IP_ROOT}/AppModules/QmitkTransferFunctionWidget/QmitkTransferFunctionWidget.cmake)

 SET( APPMOD_H ${APPMOD_H} ${IP_ROOT}/Functionalities/QmitkVolumeVisualization/QmitkVolumeVisualization.h )
 SET( APPMOD_MOC_H ${APPMOD_MOC_H} ${IP_ROOT}/Functionalities/QmitkVolumeVisualization/QmitkVolumeVisualization.h )


add the possibility to externally configure the amount of memory that will be allocated by emscripten to run tulip.js

--- src/emscripten/wrap_compiled_code.cmake
+++ src/emscripten/wrap_compiled_code.cmake
@@ -12,6 +12,7 @@
 FILE(APPEND ${JSFILE} "  if(tulipConf.modulePrefixURL) tulip.modulePrefixURL = tulipConf.modulePrefixURL;")
 FILE(APPEND ${JSFILE} "  if(tulipConf.filePackagePrefixURL) tulip.filePackagePrefixURL = tulipConf.filePackagePrefixURL;")
 FILE(APPEND ${JSFILE} "  if(tulipConf.memoryInitializerPrefixURL) tulip.memoryInitializerPrefixURL = tulipConf.memoryInitializerPrefixURL;")
+FILE(APPEND ${JSFILE} "  if(tulipConf.TOTAL_MEMORY) tulip.TOTAL_MEMORY = tulipConf.TOTAL_MEMORY;")
 FILE(APPEND ${JSFILE} "  if(!tulip.modulePrefixURL) tulip.modulePrefixURL = scriptPath;")
 FILE(APPEND ${JSFILE} "  if(!tulip.filePackagePrefixURL) tulip.filePackagePrefixURL = scriptPath;")
 FILE(APPEND ${JSFILE} "  if(!tulip.memoryInitializerPrefixURL) tulip.memoryInitializerPrefixURL = scriptPath;")


cmake development

cmake development

--- lib/cdt/sources.cmake
+++ lib/cdt/sources.cmake
@@ -1,8 +1,9 @@
 # $Id$ $Revision$

-SET(cdt_SRCDIR ${CMAKE_SOURCE_DIR}/lib/cdt)
-
-INCLUDE_DIRECTORIES(${cdt_SRCDIR})
+INCLUDE_DIRECTORIES(
+	${cdt_SRCDIR}
+	${top_SRCDIR}
+)

 SET(cdt_SRCS
 	${cdt_SRCDIR}/dtclose.c


Find (non-optimzed :-( ) lapack on windows.

--- cmake/FindLAPACK.cmake
+++ cmake/FindLAPACK.cmake
@@ -175,7 +175,7 @@
       ""
       "mkl_lapack"
       "${BLAS_LIBRARIES}"
-      "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+      "ENV LAPACK_LIB_DIR"
       )
     endif()

@@ -189,7 +189,7 @@
       ""
       "acml"
       "${BLAS_LIBRARIES}"
-      "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+      "ENV LAPACK_LIB_DIR"
       )
     endif()

@@ -203,7 +203,7 @@
       ""
       "Accelerate"
       "${BLAS_LIBRARIES}"
-      "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+      "ENV LAPACK_LIB_DIR"
       )
     endif()

@@ -216,24 +216,41 @@
       ""
       "vecLib"
       "${BLAS_LIBRARIES}"
-      "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+      "ENV LAPACK_LIB_DIR"
       )
     endif ( NOT LAPACK_LIBRARIES )

     # Generic LAPACK library?
     # This configuration *must* be the last try as this library is notably slow.
     if ( NOT LAPACK_LIBRARIES )
-      check_lapack_libraries(
-      LAPACK_DEFINITIONS
-      LAPACK_LIBRARIES
-      LAPACK
-      cheev
-      ""
-      "lapack"
-      #     "${BLAS_LIBRARIES}"
-      "c:/BALL_devel/Windows/Contrib/lib/blas.lib"
-      "ENV LAPACK_LIB_DIR"
-      )
+      if (NOT WIN32)
+				check_lapack_libraries(
+				LAPACK_DEFINITIONS
+				LAPACK_LIBRARIES
+				LAPACK
+				cheev
+				""
+				"lapack"
+				"${BLAS_LIBRARIES}"
+				"ENV LAPACK_LIB_DIR"
+				)
+			else ()
+# lapack_win32 needs blas_win32
+			find_library(BLAS_WIN32_LIBRARY blas_win32)
+			check_lapack_libraries(
+				LAPACK_DEFINITIONS
+				LAPACK_LIBRARIES
+				LAPACK
+				cheev
+				""
+				"lapack_win32"
+				"${BLAS_WIN32_LIBRARIES}"
+				"ENV LAPACK_LIB_DIR"
+				)
+			IF (LAPACK_LIBRARIES)
+				LIST(APPEND LAPACK_LIBRARIES ${BLAS_WIN32_LIBRARY})
+			ENDIF()
+			endif()
     endif()

   if(LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)


Search for 64-bit opencl based on size of void pointer

--- cmake/FindOpenCL.cmake
+++ cmake/FindOpenCL.cmake
@@ -100,11 +100,12 @@

 cmake_pop_check_state( )

-# Search for 64bit libs if FIND_LIBRARY_USE_LIB64_PATHS is set to true in the global environment, 32bit libs else
-get_property( LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS )
-if( LIB64 )
+# Search for 64bit/32bit libs
+if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+  set(LIB64 ON)
   message( STATUS "FindOpenCL searching for 64-bit libraries" )
 else( )
+  set(LIB64 OFF)
   message( STATUS "FindOpenCL searching for 32-bit libraries" )
 endif( )


PAR: install PARfiles (if they were created)

--- cmake/GenParFile.cmake
+++ cmake/GenParFile.cmake
@@ -74,4 +74,7 @@
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
   )

+  # Install target
+  install(FILES ${PARDIR}/../${PARMODULE}.par DESTINATION PARfiles OPTIONAL)
+
 endfunction()


fix typo in path in CMakeLists.txt

fix typo in path in CMakeLists.txt

--- cmake/dd-testing.cmake
+++ cmake/dd-testing.cmake
@@ -4,5 +4,5 @@

 include(CTest)

-configure_file(${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in
+configure_file(${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake.in
                ${CMAKE_BINARY_DIR}/CTestCustom.cmake COPYONLY)


doc: cmake: fixed 'strip_prefix' inconsistency

The `zephyr_get_xxx` API for option fetching
enables prefix stripping.  For some reason
the main API docs named it 'SKIP_PREFIX' instead.

Signed-off-by: Timor Gruber <3f3101741141981608547ca3da49edac614958b9@gmail.com>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -133,7 +133,7 @@
 # includes, options).
 #
 # The naming convention follows:
-# zephyr_get_${build_information}_for_lang${format}(lang x [SKIP_PREFIX])
+# zephyr_get_${build_information}_for_lang${format}(lang x [STRIP_PREFIX])
 # Where
 #  the argument 'x' is written with the result
 # and
@@ -152,11 +152,11 @@
 #   - CXX
 #   - ASM
 #
-# SKIP_PREFIX
+# STRIP_PREFIX
 #
 # By default the result will be returned ready to be passed directly
 # to a compiler, e.g. prefixed with -D, or -I, but it is possible to
-# omit this prefix by specifying 'SKIP_PREFIX' . This option has no
+# omit this prefix by specifying 'STRIP_PREFIX' . This option has no
 # effect for 'compile_options'.
 #
 # e.g.


Fix permission (#942)

Fix permission (#942)