Fixed flatbuffers_EXT_INCLUDE_DIR cmake macro bug.

--- external/External.cmake
+++ external/External.cmake
@@ -175,7 +175,7 @@
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
                        "-DZLIB_INCLUDE_DIR=${zlib_EXT_INCLUDE_DIR}"
                        "-DZLIB_STATIC_LIB=${zlib_EXT_STATIC_LIB}"
-            #--Output lminiziping-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -257,7 +257,7 @@
                        "-DFT_WITH_PNG=OFF"
                        "-DFT_WITH_ZLIB=OFF"
                        "-DFT_WITH_BZIP2=OFF"
-            #--Output lfreetypeing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -298,7 +298,7 @@
                        "-DLUA_INIT=LUA_INIT"
                        "-DLUA_USE_RELATIVE_LOADLIB=OFF"
                        "-DLUA_DIR="
-            #--Output lluajiting-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -332,7 +332,7 @@
                        "-DCMAKE_C_FLAGS=${EXT_C_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output lbzip2ing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -367,7 +367,7 @@
                        "-DCMAKE_C_FLAGS=${EXT_C_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output llzmaing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -434,7 +434,7 @@
                        "-DOPENSSL_VERSION=${ressl_EXT_VERSION_STR}"
                        "-DHAVE_LIBCRYPTO=1"
                        "-DHAVE_PKCS5_PBKDF2_HMAC_SHA1=1"
-            #--Output larchiveing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -474,7 +474,7 @@
                        "-DNNG_ENABLE_STATS=ON"
                        "-DNNG_ENABLE_NNGCAT=OFF"
                        "-DNNG_ENABLE_COVERAGE=OFF"
-            #--Output lnnging-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -512,7 +512,7 @@
                        "-DGLFW_BUILD_DOCS=OFF"
                        "-DGLFW_INSTALL=ON"
                        "-DGLFW_VULKAN_STATIC=OFF"
-            #--Output lglfwing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -545,7 +545,7 @@
                        "-DCMAKE_C_FLAGS=${EXT_C_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output lsqlite3ing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -584,7 +584,7 @@
                        "-DENABLE_DATE_TESTING=OFF"
                        "-DDISABLE_STRING_VIEW=OFF"
                        "-DCMAKE_CXX_STANDARD=14"
-            #--Output ldateing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -617,7 +617,7 @@
                        "-DCMAKE_C_FLAGS=${EXT_C_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output llmdbing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -670,7 +670,7 @@
                        "-DCIVETWEB_ALLOW_WARNINGS=ON"
                        "-DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=OFF"
                        "-DCIVETWEB_ENABLE_SSL=ON"
-            #--Output lcivetwebing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -710,7 +710,7 @@
                        "-DBLEND2D_DIR=${blend2d_EXT_SOURCE_DIR}"
                        "-DBLEND2D_TEST=OFF"
                        "-DBLEND2D_STATIC=ON"
-            #--Output lblend2ding-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -749,7 +749,7 @@
                        "-DDYNAMIC_ARCH=OFF"
                        "-DDYNAMIC_OLDER=OFF"
                        "-DBUILD_RELAPACK=OFF"
-            #--Output lopenblasing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -786,7 +786,7 @@
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output licuing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -820,7 +820,7 @@
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output ldemangleing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -839,8 +839,8 @@
 set (flatbuffers_EXT_BIN_DIR     "${EXT_INSTALL_DIR}/bin")
 set (flatbuffers_EXT_COMPILER    "${flatbuffers_EXT_BIN_DIR}/flatc${CMAKE_EXECUTABLE_SUFFIX}")
 set (flatbuffers_EXT_HASH        "${flatbuffers_EXT_BIN_DIR}/flathash${CMAKE_EXECUTABLE_SUFFIX}")
-set (flatbuffers_EXT_INCLUDE_DIR "${EXT_INSTALL_DIR}/include/flatbuffers")
-set (flatbuffers_EXT_HEADER      "${flatbuffers_EXT_INCLUDE_DIR}/flatbuffers.h")
+set (flatbuffers_EXT_INCLUDE_DIR "${EXT_INSTALL_DIR}/include")
+set (flatbuffers_EXT_HEADER      "${flatbuffers_EXT_INCLUDE_DIR}/flatbuffers/flatbuffers.h")
 set (flatbuffers_EXT_STATIC_LIB  "${EXT_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}flatbuffers${CMAKE_STATIC_LIBRARY_SUFFIX}")
 set (flatbuffers_EXT_LIBRARIES   "${flatbuffers_EXT_STATIC_LIB}")
 exists_files (flatbuffers_EXT_EXISTS
@@ -861,7 +861,7 @@
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output lflatbuffersing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -896,7 +896,7 @@
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output llfdsing-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -930,7 +930,7 @@
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output lhttp_parsering-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -964,7 +964,7 @@
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output llemoning-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
@@ -998,7 +998,7 @@
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"
-            #--Output lgtesting-------------
+            #--Output logging-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1


fix typo in Linux 32-bit build

fix typo in Linux 32-bit build

--- cmake-toolchains/linux.cmake
+++ cmake-toolchains/linux.cmake
@@ -50,7 +50,7 @@
 if (FIPS_LINUX_MACH32)
     set(CMAKE_CXX_FLASG "${CMAKE_CXX_FLAGS} -m32")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS -m32")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
 endif()

 if (FIPS_GCC)


Stripping pg dependency from libpqxx finder

--- cmake/Modules/FindPqxx.cmake
+++ cmake/Modules/FindPqxx.cmake
@@ -1,9 +1,3 @@
-if( Pqxx_FIND_REQUIRED )
-  find_package( PostgreSQL REQUIRED )
-else()
-  find_package( PostgreSQL )
-endif()
-
 # Find PostGreSQL C++ library and header file
 # Sets
 #   PQXX_FOUND         to 0 or 1 depending on result
@@ -53,10 +47,10 @@
     endif()
   endif()

-  if( PostgreSQL_FOUND AND PQXX_HEADER_DIR AND PQXX_LIBRARY )
+  if( PQXX_HEADER_DIR AND PQXX_LIBRARY )
     set( PQXX_FOUND TRUE CACHE BOOL "PQXX found" FORCE )
-    set( PQXX_INCLUDE_DIRS "${PQXX_HEADER_DIR};${PostgreSQL_INCLUDE_DIRS}" CACHE STRING "Include directories for PostGreSQL C++ library"  FORCE )
-    set( PQXX_LIBRARIES "${PQXX_LIBRARY};${PostgreSQL_LIBRARIES}" CACHE STRING "Link libraries for PostGreSQL C++ interface" FORCE )
+    set( PQXX_INCLUDE_DIRS "${PQXX_HEADER_DIR}" CACHE STRING "Include directories for PostGreSQL C++ library"  FORCE )
+    set( PQXX_LIBRARIES "${PQXX_LIBRARY}" CACHE STRING "Link libraries for PostGreSQL C++ interface" FORCE )

     mark_as_advanced( PQXX_INCLUDE_DIRS PQXX_LIBRARIES )
   endif()
@@ -69,13 +63,6 @@

 if( NOT TARGET Pqxx::Pqxx AND PQXX_FOUND )
   add_library( Pqxx::Pqxx INTERFACE IMPORTED )
-  target_include_directories( Pqxx::Pqxx INTERFACE ${PQXX_HEADER_PATH} )
-
-  if( TARGET PostgreSQL::PostgreSQL )
-    target_link_libraries( Pqxx::Pqxx INTERFACE ${PQXX_LIBRARY} PostgreSQL::PostgreSQL )
-  else()
-    # Support outdated cmake versions
-    target_link_libraries( Pqxx::Pqxx INTERFACE ${PQXX_LIBRARIES} )
-    target_include_directories( Pqxx::Pqxx INTERFACE ${PQXX_INCLUDE_DIRS} )
-  endif()
+  target_include_directories( Pqxx::Pqxx INTERFACE ${PQXX_INCLUDE_DIRS} )
+  target_link_libraries( Pqxx::Pqxx INTERFACE ${PQXX_LIBRARIES} )
 endif()


Incorporated more changes from jgopper/arduino-cmake

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1140,33 +1140,34 @@
 	file(WRITE ${SKETCH_CPP} "// automatically generated by arduino-cmake\n")
     file(READ  ${MAIN_SKETCH_PATH} MAIN_SKETCH)

-    string(FIND "${MAIN_SKETCH}" "#include" FIRST_INCLUDE_OFFSET REVERSE)
-    if ("${FIRST_INCLUDE_OFFSET}" STREQUAL "-1")
-        set(FIRST_INCLUDE_OFFSET 0)
+    # find first statement
+    string(REGEX MATCH "[\n]([_a-zA-Z0-9]+[ ]+)?[_a-zA-Z0-9]+([(][_a-zA-Z0-9]+[)])?[;]" FIRST_STATEMENT "${MAIN_SKETCH}")
+    string(FIND "${MAIN_SKETCH}" "${FIRST_STATEMENT}" FIRST_STATEMENT_POSITION)
+    if ("${FIRST_STATEMENT_POSITION}" STREQUAL "-1")
+        set(FIRST_STATEMENT_POSITION 0)
     endif()
     string(LENGTH "${MAIN_SKETCH}" MAIN_SKETCH_LENGTH)
-    math(EXPR LENGTH_STR1 "${MAIN_SKETCH_LENGTH}-(${FIRST_INCLUDE_OFFSET})")
-    string(SUBSTRING "${MAIN_SKETCH}" ${FIRST_INCLUDE_OFFSET} ${LENGTH_STR1} STR1)
-    #message("STR1:\n${STR1}")
-
-    math(EXPR POS3 "${FIRST_INCLUDE_OFFSET}")
-    string(SUBSTRING "${MAIN_SKETCH}" 0 ${FIRST_INCLUDE_OFFSET} SKETCH_HEAD)
-#    message(STATUS "SKETCH_HEAD:\n${SKETCH_HEAD}")
+    math(EXPR LENGTH_STR1 "${MAIN_SKETCH_LENGTH}-(${FIRST_STATEMENT_POSITION})")
+    string(SUBSTRING "${MAIN_SKETCH}" ${FIRST_STATEMENT_POSITION} ${LENGTH_STR1} STR1)
+    #message(STATUS "STR1:\n${STR1}")
+
+    string(SUBSTRING "${MAIN_SKETCH}" 0 ${FIRST_STATEMENT_POSITION} SKETCH_HEAD)
+    #message(STATUS "SKETCH_HEAD:\n${SKETCH_HEAD}")

 	# find the body of the main pde
-    math(EXPR BODY_LENGTH "${MAIN_SKETCH_LENGTH}-${FIRST_INCLUDE_OFFSET}-1")
-    string(SUBSTRING "${MAIN_SKETCH}" "${FIRST_INCLUDE_OFFSET}+1" "${BODY_LENGTH}" SKETCH_BODY)
-#    #message(STATUS "BODY:\n${SKETCH_BODY}")
+    math(EXPR BODY_LENGTH "${MAIN_SKETCH_LENGTH}-${FIRST_STATEMENT_POSITION}-1")
+    string(SUBSTRING "${MAIN_SKETCH}" "${FIRST_STATEMENT_POSITION}+1" "${BODY_LENGTH}" SKETCH_BODY)
+    #message(STATUS "BODY:\n${SKETCH_BODY}")

 	# write the file head
     file(APPEND ${SKETCH_CPP} "\n")
+    file(APPEND ${SKETCH_CPP} "${SKETCH_HEAD}")
     if(ARDUINO_SDK_VERSION VERSION_LESS 1.0)
         file(APPEND ${SKETCH_CPP} "#include \"WProgram.h\"\n")
     else()
         file(APPEND ${SKETCH_CPP} "#include \"Arduino.h\"\n")
     endif()
     file(APPEND ${SKETCH_CPP} "\n")
-    file(APPEND ${SKETCH_CPP} "${SKETCH_HEAD}")

     # Find function prototypes
     foreach(SKETCH_SOURCE_PATH ${SKETCH_SOURCES} ${MAIN_SKETCH_PATH})


added external directory

added external directory

--- cmake/ViennaGridCommon.cmake
+++ cmake/ViennaGridCommon.cmake
@@ -36,6 +36,7 @@
 mark_as_advanced(ENABLE_PEDANTIC_FLAGS)

 include_directories(${PROJECT_SOURCE_DIR})
+INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/external/")

 # Set high warning level on GCC
 if(ENABLE_PEDANTIC_FLAGS)


fix check if metapackage has CMakeLists (regression from cb5564734d5b4ae3284b109b286fc4c543bb5493)

--- cmake/catkin_workspace.cmake
+++ cmake/catkin_workspace.cmake
@@ -52,11 +52,11 @@
         configure_file(${catkin_EXTRAS_DIR}/templates/metapackage.cmake.in
           ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/metapackages/${name}/CMakeLists.txt
           @ONLY)
-        if(EXISTS ${path}/CMakeLists.txt)
+        if(EXISTS ${CMAKE_SOURCE_DIR}/${path}/CMakeLists.txt)
           # compare CMakeLists.txt with standard content
           file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/metapackages/${name}/CMakeLists.txt generated_cmakelists)
           file(STRINGS ${path}/CMakeLists.txt existing_cmakelists)
-          if(NOT ${generated_cmakelists} STREQUAL ${existing_cmakelists})
+          if(NOT "${generated_cmakelists}" STREQUAL "${existing_cmakelists}")
             set(CATKIN_NONHOMOGENEOUS_WORKSPACE TRUE)
             message("WARNING: The CMakeLists.txt of the metapackage '${name}' contains non standard content. Use the content of the following file instead: ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/metapackages/${name}/CMakeLists.txt")
           endif()
@@ -93,7 +93,7 @@
       list(GET CATKIN_ORDERED_PACKAGES_BUILD_TYPE ${index} build_type)
       if(${is_meta})
         message(STATUS "+++ processing catkin metapackage: '${name}'")
-        if(EXISTS ${path}/CMakeLists.txt)
+        if(EXISTS ${CMAKE_SOURCE_DIR}/${path}/CMakeLists.txt)
           message(STATUS "==> add_subdirectory(${path})")
           add_subdirectory(${path})
         else()


[clang] Create install targets for non-shared libraries

I don't see a reason for these to not have install targets created,
which in turn allows them to be bundled in distributions. This doesn't
affect the "install" target, since that just runs all CMake install
rules (and we were already creating install rules for these).

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@354140 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddClang.cmake
+++ cmake/modules/AddClang.cmake
@@ -103,7 +103,7 @@
         ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
         RUNTIME DESTINATION bin)

-      if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
+      if (NOT CMAKE_CONFIGURATION_TYPES)
         add_llvm_install_targets(install-${name}
                                  DEPENDS ${name}
                                  COMPONENT ${name})


CMake: set the 'header' property on .def and .td files

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -488,6 +488,10 @@

     file(GLOB_RECURSE SWIFTLIB_SINGLE_TDS
       ${SWIFT_SOURCE_DIR}/include/swift${dir}/*.td)
+
+    set_source_files_properties(${SWIFTLIB_SINGLE_HEADERS} ${SWIFTLIB_SINGLE_TDS}
+      PROPERTIES
+      HEADER_FILE_ONLY true)
     source_group("TableGen descriptions" FILES ${SWIFTLIB_SINGLE_TDS})

     set(SWIFTLIB_SINGLE_SOURCES ${SWIFTLIB_SINGLE_SOURCES} ${SWIFTLIB_SINGLE_HEADERS} ${SWIFTLIB_SINGLE_TDS})


Fix build with PHP.

Fix build with PHP.

--- cmake_modules/FindPHP5.cmake
+++ cmake_modules/FindPHP5.cmake
@@ -102,6 +102,8 @@
     __object_init
     __zend_hash_add_or_update
     _php_strtolower
+    _executor_globals
+    _call_user_function
     )
     SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
       "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")


Fix the php bindings with php 5.3.

Fix the php bindings with php 5.3.

--- cmake_modules/FindPHP5.cmake
+++ cmake_modules/FindPHP5.cmake
@@ -52,6 +52,7 @@
    "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
   FOREACH(symbol
     _convert_to_boolean
+    _gc_remove_zval_from_buffer
     _zend_throw_exception
     _zend_register_long_constant
     _zend_get_constant


BUG: JIRA-745: avoid flann module

BUG: JIRA-745: avoid flann module

--- CMake/External_OpenCV.cmake
+++ CMake/External_OpenCV.cmake
@@ -38,6 +38,7 @@
       -DBUILD_TESTS:BOOL=OFF
       -DBUILD_TIFF:BOOL=OFF
       -DBUILD_ZLIB:BOOL=OFF
+      -DBUILD_opencv_flann:BOOL=OFF
     DEPENDS ${${proj}_DEPENDENCIES}
     )


run linux python compile steps in shell scripts and set the right environment variables PYTHONHOME and LD_PATH

--- CMakeExternals/Python.cmake
+++ CMakeExternals/Python.cmake
@@ -146,25 +146,42 @@
       set(PYTHON_INCLUDE_DIR "${Python_DIR}/include/python${MITK_PYTHON_MAJOR_VERSION}.${MITK_PYTHON_MINOR_VERSION}")
       set(PYTHON_LIBRARY "${Python_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}python${MITK_PYTHON_MAJOR_VERSION}.${MITK_PYTHON_MINOR_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
       set(MITK_PYTHON_SITE_DIR "${Python_DIR}/lib/python${MITK_PYTHON_MAJOR_VERSION}.${MITK_PYTHON_MINOR_VERSION}/site-packages")
+
+      # linux custom compile step, set the environment variables and python home to the right
+      # path. Other runtimes can mess up the paths of the installation and the stripped executable
+      # used to compile links to the wrong library in /usr/lib
+      set(_python_compile_step ${CMAKE_BINARY_DIR}/${proj}-cmake/${proj}_compile_step.sh)
+      file(WRITE ${_python_compile_step}
+         "#!/bin/bash
+         export PYTHONHOME=${Python_DIR}
+         export LD_LIBRARY_PATH=${Python_DIR}/lib
+         ${PYTHON_EXECUTABLE} -m compileall
+
+         ")
+      # pre compile all *.py files in the runtime after install step
+      ExternalProject_Add_Step(${proj} compile_step
+        COMMAND sh ${_python_compile_step}
+        WORKING_DIRECTORY ${Python_DIR}
+        DEPENDEES install
+      )
+
+      # use the python executable in the build dir for unix systems. The stripped
+      # ones will cause conflicts if system libraries are present during the build/configure process
+      # of opencv, since they will try to lookup the sys path first if no lib is directly
+      # linked with it s path into the executable
+      set(PYTHON_EXECUTABLE "${CMAKE_BINARY_DIR}/${proj}-build/bin/python${CMAKE_EXECUTABLE_SUFFIX}")
     else()
       set(PYTHON_EXECUTABLE "${Python_DIR}/bin/python${CMAKE_EXECUTABLE_SUFFIX}")
       set(PYTHON_INCLUDE_DIR "${Python_DIR}/include")
       set(PYTHON_LIBRARY "${Python_DIR}/libs/python${MITK_PYTHON_MAJOR_VERSION}${MITK_PYTHON_MINOR_VERSION}.lib")
       set(MITK_PYTHON_SITE_DIR "${Python_DIR}/Lib/site-packages")
-    endif()

-    # pre compile all *.py files in the runtime after install step
-    ExternalProject_Add_Step(${proj} compile_step
-      COMMAND ${PYTHON_EXECUTABLE} -m compileall
-      DEPENDEES install
-    )
-
-    # use the python executable in the build dir for unix systems. The stripped
-    # ones will cause conflicts if system libraries are present during the build/configure process
-    # of opencv, since they will try to lookup the sys path first if no lib is directly
-    # linked with it s path into the executable
-    if(UNIX)
-      set(PYTHON_EXECUTABLE "${CMAKE_BINARY_DIR}/${proj}-build/bin/python${CMAKE_EXECUTABLE_SUFFIX}")
+      # pre compile all *.py files in the runtime after install step
+      ExternalProject_Add_Step(${proj} compile_step
+        COMMAND ${PYTHON_EXECUTABLE} -m compileall
+        WORKING_DIRECTORY ${Python_DIR}
+        DEPENDEES install
+      )
     endif()

   else()


fixes for CMakeModules/FindJPEG.cmake

fixes for CMakeModules/FindJPEG.cmake

libjpeg.h does not include stdio.h, so we need to help it on
some systems.

also fix a discrepancy between HAVE_LIBJPEG_H and HAVE_JPEGLIB_H.

--- CMakeModules/FindJPEG.cmake
+++ CMakeModules/FindJPEG.cmake
@@ -9,7 +9,7 @@
 # to locate include and library files
 #
 include(CheckLibraryExists)
-include(CheckIncludeFile)
+include(CheckIncludeFiles)

 set(JPEG_INCLUDE_DIR CACHE STRING "Location of JPEG include files")
 set(JPEG_LIBRARY_DIR CACHE STRING "Location of JPEG library files")
@@ -18,7 +18,7 @@
   set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR})
 endif(JPEG_INCLUDE_DIR)

-check_include_file(jpeglib.h HAVE_JPEGLIB_H)
+check_include_files("stdio.h;jpeglib.h" HAVE_JPEGLIB_H)

 find_library(JPEG_LIBRARY NAMES jpeg libjpeg PATHS ${JPEG_LIBRARY_DIR})
 if(JPEG_LIBRARY)
@@ -37,4 +37,4 @@
 endif(WIN32 AND HAVE_JPEG_LIBRARY)

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(JPEG DEFAULT_MSG HAVE_JPEG_LIBRARY HAVE_LIBJPEG_H)
+find_package_handle_standard_args(JPEG DEFAULT_MSG HAVE_JPEG_LIBRARY HAVE_JPEGLIB_H)


Add QT5_INSTALL_PREFIX to MITK-Configure cache args.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -356,6 +356,14 @@
           -DPython_DIR:PATH=${Python_DIR}
           -DNumpy_DIR:PATH=${Numpy_DIR}
         )
+  endif()
+endif()
+
+if(MITK_USE_QT)
+  if(DESIRED_QT_VERSION MATCHES "5")
+    list(APPEND mitk_optional_cache_args
+      -DQT5_INSTALL_PREFIX:PATH=${QT5_INSTALL_PREFIX}
+    )
   endif()
 endif()


FIX (#6517): make superbuild work again

FIX (#6517): make superbuild work again

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -215,7 +215,6 @@
     -DMITK_USE_BLUEBERRY:BOOL=${MITK_USE_BLUEBERRY}
     -DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
     -DMITK_BUILD_TUTORIAL:BOOL=${MITK_BUILD_TUTORIAL}
-    -DMITK_USE_SUPERBUILD:BOOL=${MITK_USE_SUPERBUILD}
     -DMITK_USE_GDCMIO:BOOL=${MITK_USE_GDCMIO}
     -DMITK_USE_DCMTK:BOOL=${MITK_USE_DCMTK}
     -DMITK_USE_QT:BOOL=${MITK_USE_QT}


Update Range v3 version

Update Range v3 version

--- cmake/modules/jegp_find_dependencies.cmake
+++ cmake/modules/jegp_find_dependencies.cmake
@@ -6,7 +6,7 @@

 FetchContent_GetProperties(range-v3)
 if(NOT range-v3_POPULATED)
-    find_package(range-v3 0.3.6 QUIET)
+    find_package(range-v3 0.4.0 QUIET)
     if(NOT range-v3_FOUND)
         FetchContent_Populate(range-v3)
         add_subdirectory(${range-v3_SOURCE_DIR} ${range-v3_BINARY_DIR})


Quieten setting up a git repo from CMake

--- GitExternal.cmake
+++ GitExternal.cmake
@@ -27,9 +27,11 @@
     foreach(GIT_EXTERNAL_RESET_FILE ${GIT_EXTERNAL_RESET})
       execute_process(
         COMMAND "${GIT_EXECUTABLE}" reset -q "${GIT_EXTERNAL_RESET_FILE}"
+        RESULT_VARIABLE nok ERROR_VARIABLE error
         WORKING_DIRECTORY "${DIR}")
       execute_process(
         COMMAND "${GIT_EXECUTABLE}" checkout -q -- "${GIT_EXTERNAL_RESET_FILE}"
+        RESULT_VARIABLE nok ERROR_VARIABLE error
         WORKING_DIRECTORY "${DIR}")
     endforeach()


Update superbuild version of ITK

Update superbuild version of ITK

closes #951.

This update contains a patch to fix the RelabelComponentImageFilter's
behavior with filter the size of labels.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -53,7 +53,7 @@
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

 # post v5.1rc01
-set(_DEFAULT_ITK_GIT_TAG "c342c6aedcebb2252e07a8e37892da965d6acff5")
+set(_DEFAULT_ITK_GIT_TAG "bcd762e7bd743341c2dce84852ced49d8292f293")
 set(ITK_GIT_TAG "${_DEFAULT_ITK_GIT_TAG}" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


Update ITK superbuild version to 5.3rc02

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -61,7 +61,7 @@
 mark_as_advanced(ITK_GIT_REPOSITORY)
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

-set(_DEFAULT_ITK_GIT_TAG "v5.3rc01")
+set(_DEFAULT_ITK_GIT_TAG "v5.3rc02")
 set(ITK_GIT_TAG "${_DEFAULT_ITK_GIT_TAG}" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


Updating ITK superbuild version to 4.5

Updating ITK superbuild version to 4.5

Change-Id: Ibbef4497af6e2b416493b0ef17946f163644fb48

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -26,7 +26,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG  v4.5rc03 )
+set(ITK_TAG_COMMAND GIT_TAG  v4.5 )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


Bugfix

Bugfix

git-svn-id: 59f82343654cec32357d3b049d399063e4e4cfc7@30947 0785d39b-7218-0410-832d-ea1e28bc413d

--- tests/run_testsuite.cmake
+++ tests/run_testsuite.cmake
@@ -357,7 +357,7 @@

 CTEST_START(Experimental TRACK ${TRACK})

-CTEST_CONFIGURE(OPTIONS "${_options}" NUMBER_ERRORS _res)
+CTEST_CONFIGURE(OPTIONS "${_options}" RETURN_VALUE _res)

 IF("${_res}" STREQUAL "0")
   # Only run the build stage if configure was successful:


export the imported targets, this is also how this package links its own library

--- rmw_fastrtps_cpp/rmw_fastrtps_cpp-extras.cmake
+++ rmw_fastrtps_cpp/rmw_fastrtps_cpp-extras.cmake
@@ -20,4 +20,4 @@
 find_package(FastRTPS REQUIRED MODULE)

 list(APPEND rmw_fastrtps_cpp_INCLUDE_DIRS ${FastRTPS_INCLUDE_DIR})
-list(APPEND rmw_fastrtps_cpp_LIBRARIES ${FastRTPS_LIBRARIES})
+list(APPEND rmw_fastrtps_cpp_LIBRARIES fastcdr fastrtps)


[R-package] add conda dir for LIBR_CORE_LIBRARY (fixes #3045) (#3046)

* [R-package] add conda dir for LIBR_CORE_LIBRARY (fixes #3045)

* empty commit

--- R-package/src/cmake/modules/FindLibR.cmake
+++ R-package/src/cmake/modules/FindLibR.cmake
@@ -176,7 +176,7 @@
 set(LIBR_INCLUDE_DIRS ${LIBR_INCLUDE_DIRS} CACHE PATH "R include directory")

 # where is R.so / R.dll / libR.so likely to be found?
-set(LIBR_PATH_HINTS "${CMAKE_CURRENT_BINARY_DIR}" "${LIBR_HOME}/bin/${R_ARCH}" "${LIBR_HOME}/bin" "${LIBR_LIBRARIES}")
+set(LIBR_PATH_HINTS "${CMAKE_CURRENT_BINARY_DIR}" "${LIBR_HOME}/lib" "${LIBR_HOME}/bin/${R_ARCH}" "${LIBR_HOME}/bin" "${LIBR_LIBRARIES}")

 # look for the core R library
 find_library(


More work.

More work.

--- ModularDeps.cmake
+++ ModularDeps.cmake
@@ -40,7 +40,8 @@
   add_subdirectory("${PROJECT_SOURCE_DIR}/deps/${DEP_NAME}")

   # Mark the dependency as satisfied.
-  set(${DEP_NAME}_DEP_SATISFIED YES PARENT_SCOPE)
+  set(${DEP_NAME}_DEP_SATISFIED YES CACHE)
+  mark_as_advanced(${DEP_NAME}_DEP_SATISFIED)
 endfunction()

 # Mark as included.


Base compiler options of major compiler versions

Instead of using OS releases as the boundries for compiler options use the
major version of gcc to determine which options are appropriate for that
compiler.


Improve CPM support for emscripten.

Improve CPM support for emscripten.

--- CPM.cmake
+++ CPM.cmake
@@ -1254,8 +1254,18 @@

   # Add the project's source code.
   if (NOT DEFINED CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID})
-    # Ensure we do not build dynamic libraries.
-    set(BUILD_SHARED_LIBS OFF)
+    # A curiosity when using emscripten on unix: we want shared libraries, not
+    # static libraries. Otherwise em++ will complain about an empty library.
+    # Use EMCC_DEBUG=1 to debug emcc or em++ errors.
+    if (UNIX)
+      if (EMSCRIPTEN)
+        set(BUILD_SHARED_LIBS ON)
+      else()
+        set(BUILD_SHARED_LIBS OFF)
+      endif()
+    else()
+      set(BUILD_SHARED_LIBS OFF)
+    endif()

     # The following call to add_subdirectory will propogate CPM_EXPORTED_MODULES
     # up to us. We don't want to clear our parent's variable. So we save it


modified ctest drop site

modified ctest drop site

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -19,7 +19,7 @@

 set(CTEST_DROP_METHOD "http")
 #set(CTEST_DROP_SITE "swr-ivb-lnx-01")
-set(CTEST_DROP_SITE "10.123.110.91")
+set(CTEST_DROP_SITE "10.123.110.90")
 set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Embree")
 set(CTEST_DROP_SITE_CDASH TRUE)


Use relative path.

Use relative path.

--- lib/smooth/idf_utils.cmake
+++ lib/smooth/idf_utils.cmake
@@ -38,7 +38,7 @@
     if(${CMAKE_CXX_COMPILER} MATCHES "xtensa")
         target_compile_definitions(${target} PUBLIC ESP_PLATFORM)

-        idf_build_component("${CMAKE_SOURCE_DIR}/lib/smooth/smooth_idf_component")
+        idf_build_component("smooth_idf_component")

         idf_build_process(esp32
                 COMPONENTS ${smooth_req_comps} smooth_idf_component


Add Pascal to all cuda architectures

Add Pascal to all cuda architectures

The known gpu architectures were missing the Pascal sm_60 and sm_61 compute capabilities. When building for this GPU, but on a separate machine, like a CI server or inside a docker image, caffe would be built for at most capability sm_50 and crash when run on the Pascal GPU.

--- cmake/Cuda.cmake
+++ cmake/Cuda.cmake
@@ -4,7 +4,7 @@

 # Known NVIDIA GPU achitectures Caffe can be compiled for.
 # This list will be used for CUDA_ARCH_NAME = All option
-set(Caffe_known_gpu_archs "20 21(20) 30 35 50")
+set(Caffe_known_gpu_archs "20 21(20) 30 35 50 60 61")

 ################################################################################################
 # A function for automatic detection of GPUs installed  (if autodetection is enabled)
@@ -56,7 +56,7 @@
 #   caffe_select_nvcc_arch_flags(out_variable)
 function(caffe_select_nvcc_arch_flags out_variable)
   # List of arch names
-  set(__archs_names "Fermi" "Kepler" "Maxwell" "All" "Manual")
+  set(__archs_names "Fermi" "Kepler" "Maxwell" "Pascal" "All" "Manual")
   set(__archs_name_default "All")
   if(NOT CMAKE_CROSSCOMPILING)
     list(APPEND __archs_names "Auto")
@@ -89,6 +89,8 @@
     set(__cuda_arch_bin "30 35")
   elseif(${CUDA_ARCH_NAME} STREQUAL "Maxwell")
     set(__cuda_arch_bin "50")
+  elseif(${CUDA_ARCH_NAME} STREQUAL "Pascal")
+    set(__cuda_arch_bin "60 61")
   elseif(${CUDA_ARCH_NAME} STREQUAL "All")
     set(__cuda_arch_bin ${Caffe_known_gpu_archs})
   elseif(${CUDA_ARCH_NAME} STREQUAL "Auto")


update Gadgetron version

update Gadgetron version

--- version_config.cmake
+++ version_config.cmake
@@ -91,7 +91,7 @@

 ## Gadgetron
 set(DEFAULT_Gadgetron_URL https://github.com/gadgetron/gadgetron )
-set(DEFAULT_Gadgetron_TAG d8b0d6df5ad120195d818a7d34656fd9e8efd05b)
+set(DEFAULT_Gadgetron_TAG e03b8a254eb25ff158175ac453500aa8b3c6199c)

 option (DEVEL_BUILD "Developer Build" OFF)
 mark_as_advanced(DEVEL_BUILD)


Rename tracing -> xray

Rename tracing -> xray

--- cmake/sdks.cmake
+++ cmake/sdks.cmake
@@ -91,10 +91,10 @@
 list(APPEND C2J_LIST "sts:2011-06-15")
 list(APPEND C2J_LIST "support:2013-04-15")
 list(APPEND C2J_LIST "snowball:2016-06-30")
-list(APPEND C2J_LIST "tracing:2016-04-12")
 list(APPEND C2J_LIST "swf:2012-01-25")
 list(APPEND C2J_LIST "waf:2015-08-24")
 list(APPEND C2J_LIST "workspaces:2015-04-08")
+list(APPEND C2J_LIST "xray:2016-04-12")
 list(APPEND C2J_LIST "cognito-idp:2016-04-18")
 list(APPEND C2J_LIST "application-autoscaling:2016-02-06")
 list(APPEND C2J_LIST "servicecatalog:2015-12-10")


cmake: pass an extra #define to test files built to process input files

This will let us combine test.c and test-file.c.

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

--- cmake/test.cmake
+++ cmake/test.cmake
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+# Copyright (c) 2016-2019 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -40,6 +40,14 @@
 	)
 endmacro()

+macro(build_test_bin_files name)
+	build_test_bin(${name})
+
+	set_source_files_properties("test_${name}.c" PROPERTIES
+		COMPILE_FLAGS "-DUSE_FILENAME_ARGS"
+	)
+endmacro()
+
 macro(build_test_bin_and_run name)
 	build_test_bin(${name})
 	add_test(NAME "${name}"
@@ -51,7 +59,7 @@
 endmacro()

 macro(build_test_bin_and_run_files name files)
-	build_test_bin(${name})
+	build_test_bin_files(${name})
 	file(GLOB TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${files})
 	foreach(TEST ${TESTS})
 		add_test(NAME "${name}:${TEST}"


Generate version.str file

Generate version.str file

--- cmake/util.cmake
+++ cmake/util.cmake
@@ -49,7 +49,10 @@
     set(${major} ${XML_MAJOR_VERSION} PARENT_SCOPE)
     set(${minor} ${XML_MINOR_VERSION} PARENT_SCOPE)
     set(${rev} ${XML_MICRO_VERSION} PARENT_SCOPE)
-
+
+    # Store version string in file for installer needs
+    file(TIMESTAMP ${CMAKE_CURRENT_SOURCE_DIR}/lib/expat.h VERSION_DATETIME "%Y-%m-%d %H:%M:%S" UTC)
+    file(WRITE ${CMAKE_BINARY_DIR}/version.str "${XML_MAJOR_VERSION}.${XML_MINOR_VERSION}.${XML_MICRO_VERSION}\n${VERSION_DATETIME}")
 endfunction(check_version)

 function(report_version name ver)


STYLE: Change where to find niral_utilities

--- SuperBuild/External_niral_utilities.cmake
+++ SuperBuild/External_niral_utilities.cmake
@@ -98,7 +98,7 @@
     DEPENDS
       ${${proj}_DEPENDENCIES}
   )
-  set(${extProjName}_DIR ${EXTERNAL_BINARY_DIRECTORY}/${proj}-build)
+  set(${extProjName}_DIR ${EXTERNAL_BINARY_DIRECTORY}/${proj}-install/lib/CMake/${proj})
 else()
   if(${USE_SYSTEM_${extProjName}})
     find_package(${extProjName} REQUIRED)


Fix FindAtomSpace when looking for atomspace libraries in non-standard locations

--- lib/FindAtomSpace.cmake
+++ lib/FindAtomSpace.cmake
@@ -14,46 +14,46 @@
    /usr/lib/opencog /usr/lib64/opencog /usr/local/lib/opencog /usr/local/lib64/opencog)

 find_library(ATOMSPACE_LIBRARY atomspace
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_atomspaceutils_LIBRARY atomspaceutils
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_atomutils_LIBRARY atomutils
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_clearbox_LIBRARY clearbox
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_execution_LIBRARY execution
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_lambda_LIBRARY lambda
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_persist_LIBRARY persist
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_persist-sql_LIBRARY persist-sql
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_persist-zmq_LIBRARY persist-zmq
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_zmqatoms_LIBRARY zmqatoms
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_PythonEval_LIBRARY PythonEval
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_query_LIBRARY query
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_ruleengine_LIBRARY ruleengine
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_smob_LIBRARY smob
-   PATH ${ATOMSPACE_LIBPATH})
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 set(ATOMSPACE_LIBRARIES
 	${ATOMSPACE_LIBRARY}


Update paraview version

Update paraview version

--- versions.cmake
+++ versions.cmake
@@ -92,7 +92,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "b9f78c78c5f8f6b6a7387712db230b6c83922a0c")
+  set(_paraview_revision "2cf8d322c548f833e102e1c9e380d145717c189a")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Move gtest to third_party folder

Move gtest to third_party folder

--- cmake/gtest.cmake
+++ cmake/gtest.cmake
@@ -1,7 +1,7 @@

 add_subdirectory("third_party/googltest-1.8.0" "gtest")
 target_include_directories("gtest" PUBLIC "${gtest_SOURCE_DIR}/include")
-set_property(TARGET "gtest" PROPERTY FOLDER "gtest")
-set_property(TARGET "gtest_main" PROPERTY FOLDER "gtest")
-set_property(TARGET "gmock" PROPERTY FOLDER "gtest")
-set_property(TARGET "gmock_main" PROPERTY FOLDER "gtest")
+set_property(TARGET "gtest" PROPERTY FOLDER "third_party")
+set_property(TARGET "gtest_main" PROPERTY FOLDER "third_party")
+set_property(TARGET "gmock" PROPERTY FOLDER "third_party")
+set_property(TARGET "gmock_main" PROPERTY FOLDER "third_party")


fixup: Keep CMake coding style with whitespace after command name

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -66,7 +66,7 @@
   endif ()
   if (NOT DEFINED GFLAGS_${varname})
     if (DEFINED ${varname})
-      set(GFLAGS_${varname} "${${varname}}")
+      set (GFLAGS_${varname} "${${varname}}")
     else ()
       if (GFLAGS_IS_SUBPROJECT AND "${ARGC}" EQUAL 5)
         set (GFLAGS_${varname} "${ARGV4}")


Delete new_project_files.cmake

Delete new_project_files.cmake

--- new_project_files.cmake
+++ new_project_files.cmake
@@ -1,30 +0,0 @@
-# ---- ./cake-project.cmake ----
-set(CAKE_BINARY_DIR_PREFIX ${CMAKE_CURRENT_LIST_DIR}/build)
-set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}.install)
-set(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
-set(CAKE_PKG_CONFIGURATION_TYPES Debug Release)
-set(scm_reg_root https://scm.kishonti.net/raw/admin/kishonti_pkg_registry.git/master)
-set(CAKE_PKG_REGISTRIES ${scm_reg_root}/dependencies.cmake ${scm_reg_root}/urls.cmake)
-
-# ---- ./cake-install-deps.cmake ----
-if(ME_WITH_PNG)
-  cake_pkg(INSTALL NAME PNG)
-endif()
-
-# ---- ./user.cake-project.cmake ----
-list(APPEND CMAKE_ARGS -G "Visual Studio 12 2013 Win64" -DBOOST_LIBRARYDIR=c:/Users/tamas.kenez/lib64)
-list(APPEND CAKE_PREFIX_PATH ${HOME}/vs12_64_pkg/install)
-set(CAKE_PKG_PROJECT_DIR ${HOME}/vs12_64_pkg)
-
-
-# ---- ${HOME}/vs2013_64_pkg ----
-set(CAKE_BINARY_DIR_PREFIX ${CMAKE_CURRENT_LIST_DIR}/build)
-set(CAKE_SOURCE_DIR_PREFIX ${CMAKE_CURRENT_LIST_DIR}/src)
-set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/install)
-set(CMAKE_PREFIX_PATH ${CAKE_INSTALL_PREFIX})
-set(CAKE_PKG_CONFIGURATION_TYPES Debug Release)
-set(scm_reg_root https://scm.kishonti.net/raw/admin/kishonti_pkg_registry.git/master)
-set(CAKE_PKG_REGISTRIES ${scm_reg_root}/dependencies.cmake ${scm_reg_root}/urls.cmake)
-set(CMAKE_ARGS -G "Visual Studio 12 2013 Win64")
-
-


Disable PThreads with GTest

Disable PThreads with GTest

--- CMake/External_GTest.cmake
+++ CMake/External_GTest.cmake
@@ -130,6 +130,7 @@
   CMAKE_CACHE_ARGS
     ${ep_common_args}
     ${ep_extra_args}
+    -Dgtest_disable_pthreads:BOOL=ON
     -DBUILD_SHARED_LIBS:BOOL=OFF
     -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=<BINARY_DIR>/lib
   INSTALL_COMMAND


multiple tags per test in cmake build

multiple tags per test in cmake build

Reviewed By: Orvid

Differential Revision: D27537202

fbshipit-source-id: d1aa8ad81f3749129dd6f1795e788a0e55d9f06a

--- CMake/FollyFunctions.cmake
+++ CMake/FollyFunctions.cmake
@@ -202,7 +202,7 @@
           set(test_${cur_test}_content_dir)
           set(test_${cur_test}_headers)
           set(test_${cur_test}_sources)
-          set(test_${cur_test}_tag "NONE")
+          set(test_${cur_test}_tag)

           set(argumentState 0)
           while (currentArg LESS ${ARGC})
@@ -221,13 +221,13 @@
               break()
             elseif (argumentState EQUAL 0)
               if ("x${ARGV${currentArg}}" STREQUAL "xBROKEN")
-                set(test_${cur_test}_tag "BROKEN")
+                list(APPEND test_${cur_test}_tag "BROKEN")
               elseif ("x${ARGV${currentArg}}" STREQUAL "xHANGING")
-                set(test_${cur_test}_tag "HANGING")
+                list(APPEND test_${cur_test}_tag "HANGING")
               elseif ("x${ARGV${currentArg}}" STREQUAL "xSLOW")
-                set(test_${cur_test}_tag "SLOW")
+                list(APPEND test_${cur_test}_tag "SLOW")
               elseif ("x${ARGV${currentArg}}" STREQUAL "xWINDOWS_DISABLED")
-                set(test_${cur_test}_tag "WINDOWS_DISABLED")
+                list(APPEND test_${cur_test}_tag "WINDOWS_DISABLED")
               else()
                 message(FATAL_ERROR "Unknown test tag '${ARGV${currentArg}}'!")
               endif()
@@ -264,11 +264,13 @@

   set(cur_test 0)
   while (cur_test LESS test_count)
-    if ("x${test_${cur_test}_tag}" STREQUAL "xNONE" OR
-        ("x${test_${cur_test}_tag}" STREQUAL "xBROKEN" AND BUILD_BROKEN_TESTS) OR
-        ("x${test_${cur_test}_tag}" STREQUAL "xSLOW" AND BUILD_SLOW_TESTS) OR
-        ("x${test_${cur_test}_tag}" STREQUAL "xHANGING" AND BUILD_HANGING_TESTS) OR
-        ("x${test_${cur_test}_tag}" STREQUAL "xWINDOWS_DISABLED" AND NOT WIN32)
+    if (
+      1
+      # TODO: Use IN_LIST after cmake 3.3
+      AND (test_${cur_test}_tag MATCHES "\\bBROKEN\\b" OR BUILD_BROKEN_TESTS)
+      AND (test_${cur_test}_tag MATCHES "\\bSLOW\\b" OR BUILD_SLOW_TESTS)
+      AND (test_${cur_test}_tag MATCHES "\\bHANGING\\b" OR BUILD_HANGING_TESTS)
+      AND (test_${cur_test}_tag MATCHES "\\bWINDOWS_DISABLED\\b" OR NOT WIN32)
     )
       set(cur_test_name ${test_${cur_test}_name})
       set(cur_dir_name ${directory_${test_${cur_test}_directory}_name})


Increment version to 3.1.3

Increment version to 3.1.3

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

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


CMake: Set VS_DEBUGGER_WORKING_DIRECTORY. CMake: Legacy way of defining URHO3D_DEBUG now that is done properly in the target.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -82,8 +82,8 @@
 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEST_LIBRARY_DIR})
 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEST_ARCHIVE_DIR})

-set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DURHO3D_DEBUG")
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DURHO3D_DEBUG")
+set (VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+
 if (NOT DEFINED URHO3D_64BIT)
     if (CMAKE_SIZEOF_VOID_P MATCHES 8)
         set(URHO3D_64BIT ON)


Fixed issue with CUDA linking error on some systems.

--- CMake/TBTKConfigTemplate.cmake
+++ CMake/TBTKConfigTemplate.cmake
@@ -52,9 +52,8 @@

 IF(CUDA_FOUND)
 	TBTK_MESSAGE("[X] CUDA")
-#	SET(TBTK_LIBRARIES "${TBTK_LIBRARIES} -lcudart -lcusparse")
-	LIST(APPEND TBTK_LIBRARIES "cudart")
-	LIST(APPEND TBTK_LIBRARIES "cusparse")
+	LIST(APPEND TBTK_LIBRARIES ${CUDA_LIBRARIES})
+	LIST(APPEND TBTK_LIBRARIES ${CUDA_cusparse_LIBRARY})
 	ADD_DEFINITIONS(-DTBTK_CUDA_ENABLED)
 ELSE(CUDA_FOUND)
 	TBTK_MESSAGE("[ ] CUDA")


Changes to find OpenBLAS as lapack and lapacke alternative

- Needed when liblapack or liblapacke are not symlinked to libopenblas

--- CMakeModules/FindLAPACKE.cmake
+++ CMakeModules/FindLAPACKE.cmake
@@ -27,7 +27,7 @@
       IF (NOT ${PC_LIB}_LIBRARY)
         MESSAGE(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_LAPACKE_LIBRARY_DIRS}")
       ENDIF (NOT ${PC_LIB}_LIBRARY)
-      LIST(APPEND LAPACKE_LIB ${${PC_LIB}_LIBRARY})
+      LIST(APPEND LAPACKE_LIB ${${PC_LIB}_LIBRARY})
     ENDFOREACH(PC_LIB)

     FIND_PATH(
@@ -78,7 +78,7 @@
     ELSE()
         FIND_LIBRARY(
             LAPACKE_LIB
-            NAMES "lapacke" "liblapacke"
+            NAMES "lapacke" "liblapacke" "openblas"
             PATHS
             ${PC_LAPACKE_LIBRARY_DIRS}
             ${LIB_INSTALL_DIR}
@@ -92,7 +92,7 @@
             )
         FIND_LIBRARY(
            LAPACK_LIB
-            NAMES "lapack" "liblapack"
+            NAMES "lapack" "liblapack" "openblas"
             PATHS
             ${PC_LAPACKE_LIBRARY_DIRS}
             ${LIB_INSTALL_DIR}


Added missing "libwinpthread-1.dll" library to MINGW build.

This change makes it possible to run the executables in the "out" directory without using QtCreator.

--- CMakeScripts/Windeployqt.cmake
+++ CMakeScripts/Windeployqt.cmake
@@ -91,7 +91,7 @@
     if( MINGW )
         message( STATUS "    Installing system-libraries: MinGW DLLs." )
         get_filename_component( Mingw_Path ${CMAKE_CXX_COMPILER} PATH )
-        set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${Mingw_Path}/libgcc_s_dw2-1.dll ${Mingw_Path}/libstdc++-6.dll )
+        set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${Mingw_Path}/libgcc_s_dw2-1.dll ${Mingw_Path}/libstdc++-6.dll ${Mingw_Path}/libwinpthread-1.dll )
     endif( MINGW )
     # windeployqt doesn't work correctly with the system runtime libraries,
     # so we fall back to one of CMake's own modules for copying them over


Avoid clang error "unknown warning option '-Wno-maybe-uninitialized'"

--- CommonCompilerConfig.cmake
+++ CommonCompilerConfig.cmake
@@ -254,7 +254,7 @@
   endif()

   set(shared_compile_flags "${shared_compile_flags} ${stdlib_common} -fdiagnostics-show-option")
-  set (internal_compiler_warning_flags "${internal_compiler_warning_flags} -Werror -Wextra -Wreturn-type -Wunused -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -Wno-maybe-uninitialized")
+  set (internal_compiler_warning_flags "${internal_compiler_warning_flags} -Werror -Wextra -Wreturn-type -Wunused -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers")
   set (external_compiler_warning_flags "${external_compiler_warning_flags} -Wno-unused-variable -Wno-unused-parameter -Wno-incompatible-pointer-types -Wno-deprecated-declarations")

   CHECK_CXX_COMPILER_FLAG(-m${BITNESS} compiler_supports_machine_option)
@@ -277,6 +277,15 @@
   endif()

   set(shared_linker_flags_unoptimized "${shared_linker_flags_unoptimized} ${stdlib_common} ${stdlib_cxx}")
+endif()
+
+if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+  # "maybe-uninitialized" has lots of false positives:
+  # http://stackoverflow.com/a/14132910/396534
+  #
+  # For example, in GroupBy.hpp it warns that "KeyType key;" might
+  # never be assigned anything, which is not true.
+  set (internal_compiler_warning_flags "${internal_compiler_warning_flags} -Wno-maybe-uninitialized")
 endif()

 # Don't allow undefined symbols when linking executables


Fix bug 285: Feature summary was incorrect if OGRE_CONFIG_ALLOCATOR=1.

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -133,7 +133,7 @@
 endmacro ()

 # allocator settings
-if (OGRE_CONFIG_ALlOCATOR EQUAL 1)
+if (OGRE_CONFIG_ALLOCATOR EQUAL 1)
 	set(_allocator "standard")
 elseif (OGRE_CONFIG_ALLOCATOR EQUAL 2)
 	set(_allocator "nedmalloc")


Update WinCUDASupport.cmake

Update WinCUDASupport.cmake

--- CMake/WinCUDASupport.cmake
+++ CMake/WinCUDASupport.cmake
@@ -2,7 +2,7 @@
     if(WIN32)
         set(cuda_path "$ENV{CUDA_PATH}")
         if (cuda_path)
-            message(STATUS "Creating target to copy CUDA DLLs to module binary folder.")
+            message(STATUS "Creating target to copy CUDA DLLs to module's binary folder.")
             file(TO_CMAKE_PATH "${cuda_path}/nvvm/bin" cuda_dll_path)
             message(STATUS "Searching CUDA DLLs in: ${cuda_dll_path}")
             file(GLOB cuda_dll "${cuda_dll_path}/nvvm64*.dll")
@@ -16,4 +16,4 @@
             endif()
         endif()
     endif(WIN32)
-endfunction(win_cuda_support)+endfunction(win_cuda_support)


COMP Fixed Eigen project creation. Eigen update was not always performed.

--- CMakeExternals/Eigen.cmake
+++ CMakeExternals/Eigen.cmake
@@ -14,16 +14,14 @@
 if(NOT DEFINED Eigen_DIR)

   ExternalProject_Add(${proj}
-     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
-     BINARY_DIR ${proj}-cmake
+     PREFIX ${CMAKE_BINARY_DIR}/${proj}-cmake
      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/Eigen-3.2.2-headers-only.tar.gz
      URL_MD5 d0a7fe82ab7bd39bf577afebe287aa20
      CMAKE_ARGS
-       -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/${proj}-install
-     INSTALL_DIR ${proj}-install
-    )
+       -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/${proj}-src
+)

-  set(Eigen_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-install)
+  set(Eigen_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-src)

 else()


improve 72b2c9e9b45a to make it work with OpenSUSE again

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -31,30 +31,29 @@
 # if all listed variables are TRUE
 find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR)

-option(GSL_USES_CBLAS "If GSL needs to be linked against cblas" OFF)
-if (GSL_USES_CBLAS)
-  find_library(GSLCBLAS_LIBRARY NAMES gslcblas cblas HINTS ${PC_GSL_LIBRARY_DIRS} )
-  find_package_handle_standard_args(GSL DEFAULT_MSG GSLCBLAS_LIBRARY)
-  if (GSL_FOUND)
-    include(CheckLibraryExists)
-    check_library_exists("${GSLCBLAS_LIBRARY};${MATH_LIBRARIES}" cblas_dsyrk "" FOUND_DSYRK)
-    if(NOT FOUND_DSYRK)
-      message(FATAL_ERROR "Could not find cblas_dsyrk in ${GSLCBLAS_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of libcblas in GSLCBLAS_LIBRARY by hand (i.e. -DGSLCBLAS_LIBRARY='/path/to/libcblas.so;/path/to/libm.so')! If your gsl was build against an different version of cblas, specify it in GSLCBLAS_LIBRARY")
-    endif(NOT FOUND_DSYRK)
-  endif(GSL_FOUND)
-else()
-  set(GSLCBLAS_LIBRARY)
-endif (GSL_USES_CBLAS)
-
-set(GSL_LIBRARIES "${GSL_LIBRARY};${GSLCBLAS_LIBRARY}")
+set(GSL_LIBRARIES "${GSL_LIBRARY}")
 set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )

 if (GSL_FOUND)
+  include(CheckLibraryExists)
   #adding MATH_LIBRARIES here to allow static libs, this does not harm us as we are anyway using it
   check_library_exists("${GSL_LIBRARIES};${MATH_LIBRARIES}" gsl_linalg_QR_decomp "" FOUND_QR_DECOMP)
   if(NOT FOUND_QR_DECOMP)
-    message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong.  If you are using a static lib (.a) make sure you have specified all dependencies of libgsl in GSL_LIBRARY by hand (i.e. -DGSL_LIBRARY='/path/to/libgsl.so;/path/to/libm.so') !")
+    #Some distributions like OpenSUSE need cblas in the linker flags, too
+    find_library(GSLCBLAS_LIBRARY NAMES gslcblas cblas HINTS ${PC_GSL_LIBRARY_DIRS} )
+    find_package_handle_standard_args(GSLCBLAS DEFAULT_MSG GSLCBLAS_LIBRARY)
+    if (GSLCBLAS_FOUND)
+      check_library_exists("${GSLCBLAS_LIBRARY};${MATH_LIBRARIES}" cblas_dsyrk "" FOUND_DSYRK)
+      if(NOT FOUND_DSYRK)
+        message(FATAL_ERROR "Could not find cblas_dsyrk in ${GSLCBLAS_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of libcblas in GSLCBLAS_LIBRARY by hand (i.e. -DGSLCBLAS_LIBRARY='/path/to/libcblas.so;/path/to/libm.so')! If your gsl was build against an different version of cblas, specify it in GSLCBLAS_LIBRARY")
+      endif(NOT FOUND_DSYRK)
+      set(GSL_LIBRARIES "${GSL_LIBRARY};${GSLCBLAS_LIBRARY}")
+      check_library_exists("${GSL_LIBRARIES};${MATH_LIBRARIES}" gsl_linalg_QR_lssolve "" FOUND_QR_DECOMP_AGAIN)
+    endif(GSLCBLAS_FOUND)
   endif(NOT FOUND_QR_DECOMP)
+  if(NOT FOUND_QR_DECOMP AND NOT FOUND_QR_DECOMP_AGAIN)
+      message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong.  If you are using a static lib (.a) make sure you have specified all dependencies of libgsl in GSL_LIBRARY by hand (i.e. -DGSL_LIBRARY='/path/to/libgsl.so;/path/to/libm.so') !")
+  endif(NOT FOUND_QR_DECOMP AND NOT FOUND_QR_DECOMP_AGAIN)
 endif (GSL_FOUND)

 mark_as_advanced(GSL_INCLUDE_DIR GSL_LIBRARY)


Trying to find lapacke on ci

Trying to find lapacke on ci

Former-commit-id: 32cf61401cf1257ab977cb046f95b6ed6b5b4c21

--- cmake-modules/SetupDependenciesFetch.cmake
+++ cmake-modules/SetupDependenciesFetch.cmake
@@ -3,7 +3,7 @@
     list(INSERT CMAKE_MODULE_PATH 0  ${PROJECT_SOURCE_DIR}/cmake-modules)
     # Make sure find_package looks for the packages we just built instead of rebuilding them
     # when we rerun the cmake config.
-    list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_INSTALL_PREFIX})
+    list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})

     ##############################################################################
     ###  Optional OpenMP support                                               ###


fix tinyxml finder

fix tinyxml finder

Change-Id: Iaff7a0993ea6ef9f2115db61bc065816dde3ba5d

--- cmake/qibuild/modules/tinyxml-config.cmake
+++ cmake/qibuild/modules/tinyxml-config.cmake
@@ -3,9 +3,8 @@
 ## found in the COPYING file.

 clean(TINYXML)
-fpath(TINYXML tinyxml.h)
-fpath(TINYXML tinystr.h)
-
+fpath(TINYXML tinyxml/tinyxml.h)
+fpath(TINYXML tinyxml/tinystr.h)
 flib(TINYXML NAMES tinyxml)
 export_lib(TINYXML)


use openmp targets again

use openmp targets again

--- cmake/Dependencies_core.cmake
+++ cmake/Dependencies_core.cmake
@@ -75,15 +75,15 @@

     #openmp
-    #find_package(OpenMP REQUIRED)
-    #PackageHelperTarget(OpenMP::OpenMP_CXX OPENMP_FOUND)
+    find_package(OpenMP REQUIRED)
+    PackageHelperTarget(OpenMP::OpenMP_CXX OPENMP_FOUND)

-    find_package(OpenMP REQUIRED)
-    if (OPENMP_FOUND)
-        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
-        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-    endif()
-    PackageHelper(OpenMP ${OPENMP_FOUND} "${OPENMP_INCLUDE_DIRS}" "${OPENMP_LIBRARIES}")
+#    find_package(OpenMP REQUIRED)
+#    if (OPENMP_FOUND)
+#        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+#        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+#    endif()
+#    PackageHelper(OpenMP ${OPENMP_FOUND} "${OPENMP_INCLUDE_DIRS}" "${OPENMP_LIBRARIES}")

 #libfreeimage


Find static genericLogger library [ci skip]

--- cmake/FindgenericLogger.cmake
+++ cmake/FindgenericLogger.cmake
@@ -15,13 +15,23 @@
 #
 #   GENERICLOGGER_LIBRARIES
 #     Points to the genericLogger libraries that should be passed to
-#     target_link_libararies.
+#     target_link_libraries in dynamic mode.
+#
+#   GENERICLOGGER_LIBRARIES_STATIC
+#     Points to the genericLogger libraries static that should be passed to
+#     target_link_libraries in static mode.
 #
 #   GENERICLOGGER_LINK_FLAGS
 #     Linker flags when building linking against genericLogger. Defaults to "libgenericLogger". Take care, this is a list.
 #
+#   GENERICLOGGER_STATIC_LINK_FLAGS
+#     Linker flags when building linking against static genericLogger. Defaults to "libgenericLogger_static". Take care, this is a list.
+#
 #   GENERICLOGGER_LDFLAGS
 #     Stringified version of GENERICLOGGER_LINK_FLAGS
+#
+#   GENERICLOGGER_STATIC_LDFLAGS
+#     Stringified version of GENERICLOGGER_STATIC_LINK_FLAGS
 #
 INCLUDE (CMakeParseArguments)
 INCLUDE (FindPackageHandleStandardArgs)
@@ -70,7 +80,6 @@
     )
 ENDIF (GENERICLOGGER_ROOT_DIR)

-# Use at least the data library
 IF (NOT GENERICLOGGER_FIND_COMPONENTS)
   SET (GENERICLOGGER_FIND_COMPONENTS genericLogger)
 ENDIF (NOT GENERICLOGGER_FIND_COMPONENTS)
@@ -82,19 +91,32 @@
     SET (_GENERICLOGGER_COMPONENT_POSSIBLE_DEBUG_NAMES ${_GENERICLOGGER_COMPONENT_BASE}d)
     SET (_GENERICLOGGER_COMPONENT_POSSIBLE_RELEASE_NAMES ${_GENERICLOGGER_COMPONENT_BASE})

+    SET (_GENERICLOGGER_STATIC_COMPONENT_BASE "${_GENERICLOGGER_COMPONENT}_static")
+    SET (_GENERICLOGGER_STATIC_COMPONENT_POSSIBLE_DEBUG_NAMES ${_GENERICLOGGER_STATIC_COMPONENT_BASE}d)
+    SET (_GENERICLOGGER_STATIC_COMPONENT_POSSIBLE_RELEASE_NAMES ${_GENERICLOGGER_STATIC_COMPONENT_BASE})
+
     STRING (TOUPPER ${_GENERICLOGGER_COMPONENT} _GENERICLOGGER_COMPONENT_UPPER)
     SET (_GENERICLOGGER_LIBRARY_BASE GENERICLOGGER_${_GENERICLOGGER_COMPONENT_UPPER}_LIBRARY)
+    SET (_GENERICLOGGER_STATIC_LIBRARY_BASE GENERICLOGGER_STATIC_${_GENERICLOGGER_COMPONENT_UPPER}_LIBRARY)

     IF (GENERICLOGGER_ROOT_DIR)
       FIND_LIBRARY (${_GENERICLOGGER_LIBRARY_BASE}_DEBUG
 	NAMES ${_GENERICLOGGER_COMPONENT_POSSIBLE_DEBUG_NAMES}
 	PATHS ${GENERICLOGGER_ROOT_DIR} PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
 	NO_DEFAULT_PATH)
+      FIND_LIBRARY (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG
+	NAMES ${_GENERICLOGGER_STATIC_COMPONENT_POSSIBLE_DEBUG_NAMES}
+	PATHS ${GENERICLOGGER_ROOT_DIR} PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
+	NO_DEFAULT_PATH)
     ELSE (GENERICLOGGER_ROOT_DIR)
       FIND_LIBRARY (${_GENERICLOGGER_LIBRARY_BASE}_DEBUG
 	NAMES ${_GENERICLOGGER_COMPONENT_POSSIBLE_DEBUG_NAMES}
 	PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
 	)
+      FIND_LIBRARY (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG
+	NAMES ${_GENERICLOGGER_COMPONENT_STATIC_POSSIBLE_DEBUG_NAMES}
+	PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
+	)
     ENDIF (GENERICLOGGER_ROOT_DIR)

     IF (GENERICLOGGER_ROOT_DIR)
@@ -102,9 +124,17 @@
 	NAMES ${_GENERICLOGGER_COMPONENT_POSSIBLE_RELEASE_NAMES}
 	PATHS ${GENERICLOGGER_ROOT_DIR} PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
 	NO_DEFAULT_PATH)
+      FIND_LIBRARY (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE
+	NAMES ${_GENERICLOGGER_STATIC_COMPONENT_POSSIBLE_RELEASE_NAMES}
+	PATHS ${GENERICLOGGER_ROOT_DIR} PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
+	NO_DEFAULT_PATH)
     ELSE (ICU_ROOT_DIR)
       FIND_LIBRARY (${_GENERICLOGGER_LIBRARY_BASE}_RELEASE
 	NAMES ${_GENERICLOGGER_COMPONENT_POSSIBLE_RELEASE_NAMES}
+	PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
+	)
+      FIND_LIBRARY (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE
+	NAMES ${_GENERICLOGGER_STATIC_COMPONENT_POSSIBLE_RELEASE_NAMES}
 	PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
 	)
     ENDIF (GENERICLOGGER_ROOT_DIR)
@@ -128,26 +158,52 @@
       SET (GENERICLOGGER_${__COMPONENT_UPPER}_FOUND FALSE)
     ENDIF (${_GENERICLOGGER_LIBRARY_BASE}_DEBUG AND ${_GENERICLOGGER_LIBRARY_BASE}_RELEASE)

+    IF (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG AND ${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE)
+      SET (${_GENERICLOGGER_STATIC_LIBRARY_BASE}
+        debug ${${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG}
+        optimized ${${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE})
+      # Debug only
+    ELSEIF (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG)
+      SET (${_GENERICLOGGER_STATIC_LIBRARY_BASE} ${${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG})
+      # Release only
+    ELSEIF (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE)
+      SET (${_GENERICLOGGER_STATIC_LIBRARY_BASE} ${${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE})
+    ELSE (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG AND ${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE)
+      # Component missing: record it for a later report
+      LIST (APPEND _GENERICLOGGER_STATIC_MISSING_COMPONENTS ${_GENERICLOGGER_COMPONENT})
+      SET (GENERICLOGGER_STATIC_${__COMPONENT_UPPER}_FOUND FALSE)
+    ENDIF (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG AND ${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE)
+
     MARK_AS_ADVANCED (${_GENERICLOGGER_LIBRARY_BASE}_DEBUG ${_GENERICLOGGER_LIBRARY_BASE}_RELEASE)
+    MARK_AS_ADVANCED (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG ${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE)

     # Make sure only libraries that have been actually found are registered
     IF (${_GENERICLOGGER_LIBRARY_BASE})
       LIST (APPEND _GENERICLOGGER_LIBRARIES ${${_GENERICLOGGER_LIBRARY_BASE}})
     ENDIF (${_GENERICLOGGER_LIBRARY_BASE})
+
+    IF (${_GENERICLOGGER_STATIC_LIBRARY_BASE})
+      LIST (APPEND _GENERICLOGGER_STATIC_LIBRARIES ${${_GENERICLOGGER_STATIC_LIBRARY_BASE}})
+    ENDIF (${_GENERICLOGGER_STATIC_LIBRARY_BASE})
+
   ENDFOREACH (_GENERICLOGGER_COMPONENT)

-  IF (NOT DEFINED _GENERICLOGGER_MISSING_COMPONENTS)
+  IF (NOT DEFINED _GENERICLOGGER_MISSING_COMPONENTS AND NOT DEFINED _GENERICLOGGER_STATIC_MISSING_COMPONENTS)
     # Success: all components were found
     SET (GENERICLOGGER_INCLUDE_DIRS "${GENERICLOGGER_INCLUDE_DIR}")
     SET (GENERICLOGGER_LIBRARIES ${_GENERICLOGGER_LIBRARIES})
-  ELSE (NOT DEFINED _GENERICLOGGER_MISSING_COMPONENTS)
+    SET (GENERICLOGGER_STATIC_LIBRARIES ${_GENERICLOGGER_STATIC_LIBRARIES})
+  ELSE ()
     MESSAGE (STATUS "Several GENERICLOGGER components were not found:")

     # Display missing components indented, each on a separate line
     FOREACH (_GENERICLOGGER_MISSING_COMPONENT ${_GENERICLOGGER_MISSING_COMPONENTS})
       MESSAGE (STATUS "  " ${_GENERICLOGGER_MISSING_COMPONENT})
-    ENDFOREACH (_GENERICLOGGER_MISSING_COMPONENT ${_GENERICLOGGER_MISSING_COMPONENTS})
-  ENDIF (NOT DEFINED _GENERICLOGGER_MISSING_COMPONENTS)
+    ENDFOREACH ()
+    FOREACH (_GENERICLOGGER_STATIC_MISSING_COMPONENT ${_GENERICLOGGER_STATIC_MISSING_COMPONENTS})
+      MESSAGE (STATUS "  " ${_GENERICLOGGER_STATIC_MISSING_COMPONENT})
+    ENDFOREACH ()
+  ENDIF ()

   #
   # Simulate hopefully correct flags based on heuristic discovery
@@ -164,6 +220,10 @@
     SET (_GENERICLOGGER_LINK_FLAGS ${GENERICLOGGER_LIBRARIES})
   ENDIF ()

+  IF (NOT _GENERICLOGGER_STATIC_LINK_FLAGS)
+    SET (_GENERICLOGGER_STATIC_LINK_FLAGS ${GENERICLOGGER_STATIC_LIBRARIES})
+  ENDIF ()
+
 ENDIF (GENERICLOGGER_INCLUDE_DIR)

 SET (_GENERICLOGGER_LDFLAGS " ")
@@ -171,6 +231,11 @@
   SET (_GENERICLOGGER_LDFLAGS "${_GENERICLOGGER_LDFLAGS} ${_genericlogger_link_flag}")
 ENDFOREACH ()

+SET (_GENERICLOGGER_STATIC_LDFLAGS " ")
+FOREACH (_genericlogger_static_link_flag ${_GENERICLOGGER_STATIC_LINK_FLAGS})
+  SET (_GENERICLOGGER_STATIC_LDFLAGS "${_GENERICLOGGER_STATIC_LDFLAGS} ${_genericlogger_static_link_flag}")
+ENDFOREACH ()
+
 MARK_AS_ADVANCED (GENERICLOGGER_ROOT_DIR GENERICLOGGER_INCLUDE_DIR)

 FIND_PACKAGE_HANDLE_STANDARD_ARGS (GENERICLOGGER
@@ -178,14 +243,16 @@
   GENERICLOGGER_INCLUDE_DIR
   GENERICLOGGER_LIBRARIES)

-IF (_GENERICLOGGER_LINK_FLAGS)
+IF (_GENERICLOGGER_LINK_FLAGS AND _GENERICLOGGER_STATIC_LINK_FLAGS)
   SET (GENERICLOGGER_FOUND 1 CACHE STRING "GENERICLOGGER is found")
 ENDIF ()

-SET (GENERICLOGGER_C_FLAGS_SHARED   "${_GENERICLOGGER_C_FLAGS_SHARED}"   CACHE STRING "C flags when compiling against shared GENERICLOGGER")
-SET (GENERICLOGGER_CXX_FLAGS_SHARED "${_GENERICLOGGER_CXX_FLAGS_SHARED}" CACHE STRING "C flags when compiling against shared GENERICLOGGER")
-SET (GENERICLOGGER_LINK_FLAGS       "${_GENERICLOGGER_LINK_FLAGS}"       CACHE STRING "Linker flags when linking against GENERICLOGGER")
-SET (GENERICLOGGER_LDFLAGS          "${_GENERICLOGGER_LDFLAGS}"          CACHE STRING "Stringified version of GENERICLOGGER_LINK_FLAGS")
+SET (GENERICLOGGER_C_FLAGS_SHARED    "${_GENERICLOGGER_C_FLAGS_SHARED}"    CACHE STRING "C flags when compiling against shared GENERICLOGGER")
+SET (GENERICLOGGER_CXX_FLAGS_SHARED  "${_GENERICLOGGER_CXX_FLAGS_SHARED}"  CACHE STRING "C flags when compiling against shared GENERICLOGGER")
+SET (GENERICLOGGER_LINK_FLAGS        "${_GENERICLOGGER_LINK_FLAGS}"        CACHE STRING "Linker flags when linking against GENERICLOGGER")
+SET (GENERICLOGGER_LDFLAGS           "${_GENERICLOGGER_LDFLAGS}"           CACHE STRING "Stringified version of GENERICLOGGER_LINK_FLAGS")
+SET (GENERICLOGGER_STATIC_LINK_FLAGS "${_GENERICLOGGER_STATIC_LINK_FLAGS}" CACHE STRING "Linker flags when linking against static GENERICLOGGER")
+SET (GENERICLOGGER_STATIC_LDFLAGS    "${_GENERICLOGGER_STATIC_LDFLAGS}"    CACHE STRING "Stringified version of GENERICLOGGER_STATIC_LINK_FLAGS")

 IF(GENERICLOGGER_FOUND)
   MESSAGE(STATUS "-----------------------------------------")
@@ -196,8 +263,11 @@
   MESSAGE(STATUS "   CXX_FLAGS_SHARED: ${GENERICLOGGER_CXX_FLAGS_SHARED}")
   MESSAGE(STATUS "        INCLUDE_DIR: ${GENERICLOGGER_INCLUDE_DIR}")
   MESSAGE(STATUS "          LIBRARIES: ${GENERICLOGGER_LIBRARIES}")
+  MESSAGE(STATUS "   STATIC LIBRARIES: ${GENERICLOGGER_STATIC_LIBRARIES}")
   MESSAGE(STATUS "         LINK_FLAGS: ${GENERICLOGGER_LINK_FLAGS}")
+  MESSAGE(STATUS "  STATIC LINK_FLAGS: ${GENERICLOGGER_STATIC_LINK_FLAGS}")
   MESSAGE(STATUS "            LDFLAGS: ${GENERICLOGGER_LDFLAGS}")
+  MESSAGE(STATUS "     STATIC LDFLAGS: ${GENERICLOGGER_STATIC_LDFLAGS}")
   MESSAGE(STATUS "-----------------------------------------")
 ENDIF()

@@ -206,4 +276,7 @@
   GENERICLOGGER_C_FLAGS_SHARED
   GENERICLOGGER_CXX_FLAGS_SHARED
   GENERICLOGGER_LINK_FLAGS
-  GENERICLOGGER_LDFLAGS)
+  GENERICLOGGER_LDFLAGS
+  GENERICLOGGER_STATIC_LINK_FLAGS
+  GENERICLOGGER_STATIC_LDFLAGS
+  )


CMake: Remove find module for PEGTL

CMake: Remove find module for PEGTL

--- cmake/Modules/FindPEGTL.cmake
+++ cmake/Modules/FindPEGTL.cmake
@@ -1,32 +0,0 @@
-# Try to find PEGTL
-# =================
-
-# This find script defines the following variables:
-#
-# - `PEGTL_FOUND`:         System has PEGTL
-# - `PEGTL_INCLUDE_DIRS`:  The PEGTL include directories
-# - `PEGTL_VERSION`:       The PEGTL version
-#
-# .
-
-find_path (PEGTL_INCLUDE_DIR NAMES tao/pegtl.hpp PATH_SUFFIXES tao)
-
-set (PEGTL_VERSION 0)
-if (EXISTS "${PEGTL_INCLUDE_DIR}/tao/pegtl/version.hpp")
-	file (STRINGS "${PEGTL_INCLUDE_DIR}/tao/pegtl/version.hpp" PEGTL_VERSION REGEX "#define TAO_PEGTL_VERSION \".+\"" LIMIT_COUNT 1)
-	string (REGEX
-		REPLACE ".*\"(.+)\""
-			"\\1"
-			PEGTL_VERSION
-			${PEGTL_VERSION})
-endif (EXISTS "${PEGTL_INCLUDE_DIR}/tao/pegtl/version.hpp")
-
-include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (PEGTL
-				   REQUIRED_VARS
-				   PEGTL_INCLUDE_DIR
-				   VERSION_VAR
-				   PEGTL_VERSION)
-
-mark_as_advanced (PEGTL_INCLUDE_DIR)
-set (PEGTL_INCLUDE_DIRS ${PEGTL_INCLUDE_DIR})


fix a lot of warnings -Wunused-but-set-variable and Wunused-variable when compile openBlas

--- cmake/external/openblas.cmake
+++ cmake/external/openblas.cmake
@@ -29,7 +29,7 @@
         "${CBLAS_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}openblas${CMAKE_STATIC_LIBRARY_SUFFIX}"
         CACHE FILEPATH "openblas library." FORCE)

-    SET(OPENBLAS_CC "${CMAKE_C_COMPILER}")
+    SET(OPENBLAS_CC "${CMAKE_C_COMPILER} -Wno-unused-but-set-variable -Wno-unused-variable")

     IF(CMAKE_CROSSCOMPILING)
         SET(OPTIONAL_ARGS HOSTCC=${HOST_C_COMPILER})


Fix cmake find protobuf problem

Fix cmake find protobuf problem

--- cmake/external/protobuf.cmake
+++ cmake/external/protobuf.cmake
@@ -15,6 +15,14 @@
 INCLUDE(ExternalProject)

 FIND_PACKAGE(Protobuf 3.1)
+
+IF(PROTOBUF_FOUND)
+    EXEC_PROGRAM(${PROTOBUF_PROTOC_EXECUTABLE} ARGS --version OUTPUT_VARIABLE PROTOBUF_VERSION)
+    STRING(REGEX MATCH "[0-9]+.[0-9]+" PROTOBUF_VERSION "${PROTOBUF_VERSION}")
+    IF (${PROTOBUF_VERSION} VERSION_LESS "3.1.0")
+        SET(PROTOBUF_FOUND OFF)
+    ENDIF()
+ENDIF(PROTOBUF_FOUND)

 IF(NOT PROTOBUF_FOUND)
     SET(PROTOBUF_SOURCES_DIR ${THIRD_PARTY_PATH}/protobuf)


cmake: Ignore LDFLAGS and AFLAGS from environment

Zephyr does not use CFLAGS, CXXFLAGS, CPPFLAGS if they are defined in
the environment but provides the option to pass them via extra cmake
flags.

The option is also for seen to pass AFLAGS and LDFLAGS as extra cmake
flags but both of them are not ignored if they are defined in the
environment which could lead to unexpected behaviour.

As such lineup the behaviour between all the flags and ignore them, and
generate a warning, if they are defined in the environment.

Signed-off-by: Jan Van Winkel <d648848808a4d751aff880668aa63d2d9d94a5a4@dxplore.eu>

--- cmake/generic_toolchain.cmake
+++ cmake/generic_toolchain.cmake
@@ -12,7 +12,7 @@
 zephyr_file(APPLICATION_ROOT TOOLCHAIN_ROOT)

 # Don't inherit compiler flags from the environment
-foreach(var CFLAGS CXXFLAGS CPPFLAGS)
+foreach(var AFLAGS CFLAGS CXXFLAGS CPPFLAGS LDFLAGS)
   if(DEFINED ENV{${var}})
     message(WARNING "The environment variable '${var}' was set to $ENV{${var}},
 but Zephyr ignores flags from the environment. Use 'cmake -DEXTRA_${var}=$ENV{${var}}' instead.")


Ensure that DAVIX variables are maked as advance

--- cmake/modules/FindDavix.cmake
+++ cmake/modules/FindDavix.cmake
@@ -14,6 +14,6 @@

 # Handle the QUIETLY and REQUIRED arguments and set DAVIX_FOUND to TRUE if all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(DAVIX DEFAULT_MSG DAVIX_INCLUDE_DIRS DAVIX_LIBRARIES)
+find_package_handle_standard_args(DAVIX DEFAULT_MSG DAVIX_INCLUDE_DIR DAVIX_LIBRARY)

-mark_as_advanced(DAVIX_FOUND DAVIX_INCLUDE_DIRS DAVIX_LIBRARIES)
+mark_as_advanced(DAVIX_FOUND DAVIX_INCLUDE_DIR DAVIX_LIBRARY)


clean-up ParMetis from CMake config system

--- cmake/modules/FindMETIS.cmake
+++ cmake/modules/FindMETIS.cmake
@@ -45,21 +45,6 @@
     build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libmetis
   )

-#
-# Sanity check: Only search the parmetis library in the same directory as
-# the metis library...
-#
-GET_FILENAME_COMPONENT(_path "${METIS_LIBRARY}" PATH)
-DEAL_II_FIND_LIBRARY(PARMETIS_LIBRARY
-  NAMES parmetis
-  HINTS ${_path}
-  NO_DEFAULT_PATH
-  NO_CMAKE_ENVIRONMENT_PATH
-  NO_CMAKE_PATH
-  NO_SYSTEM_ENVIRONMENT_PATH
-  NO_CMAKE_SYSTEM_PATH
-  NO_CMAKE_FIND_ROOT_PATH
-  )

 DEAL_II_FIND_PATH(METIS_INCLUDE_DIR metis.h
   HINTS ${METIS_DIR}
@@ -98,12 +83,11 @@

 DEAL_II_PACKAGE_HANDLE(METIS
   LIBRARIES
-    OPTIONAL PARMETIS_LIBRARY
     REQUIRED METIS_LIBRARY
     OPTIONAL MPI_C_LIBRARIES
   INCLUDE_DIRS
     REQUIRED METIS_INCLUDE_DIR
   USER_INCLUDE_DIRS
     REQUIRED METIS_INCLUDE_DIR
-  CLEAR METIS_LIBRARY PARMETIS_LIBRARY METIS_INCLUDE_DIR
+  CLEAR METIS_LIBRARY METIS_INCLUDE_DIR
   )


ManageDependency: Make changes suitable for more generic *nix build.     e.g. FEDORA_NAME -> PACKAGE_NAME

--- Modules/ManageDependency.cmake
+++ Modules/ManageDependency.cmake
@@ -80,6 +80,7 @@

 SET(MANAGE_DEPENDENCY_PACKAGE_INSTALL_CMD yum -y install
     CACHE STRING "Package exist command"
+    )

 ## This need to be here, otherwise the variable won't be available
 ## the 2nd time called.
@@ -94,11 +95,11 @@
     VARIABLE_PARSE_ARGN(_opt _validOptions ${ARGN})
     SET(_dirty 0)

-    IF(${listVar}_${var}_PACKAGE_NAME STREQUAL "")
+    IF("${${listVar}_${var}_PACKAGE_NAME}" STREQUAL "")
 	IF(_opt_PACKAGE_NAME)
 	    IF(DEFINED _opt_DEVEL)
 		M_MSG(${M_ERROR} "PACKAGE_NAME cannot use with DEVEL")
-	    ENDIF())
+	    ENDIF()
 	    SET(${listVar}_${var}_PACKAGE_NAME "${_opt_PACKAGE_NAME}")
 	ELSE(_opt_PACKAGE_NAME)
 	    STRING(TOLOWER "${var}" ${listVar}_${var}_PACKAGE_NAME)
@@ -114,7 +115,7 @@
     IF(DEFINED _opt_REQUIRED)
 	SET(_verbose "${M_ERROR}")
 	SET(_required "REQUIRED")
-        SET(_progNotFoundMsg
+	SET(_progNotFoundMsg
 	    "Program names ${_opt_PROGRAM_NAMES} not found, install ${pkgName}")
     ELSE(DEFINED _opt_REQUIRED)
 	SET(_verbose "${M_OFF}")
@@ -159,7 +160,7 @@
     LIST(GET MANAGE_DEPENDENCY_PACKAGE_EXISTS_CMD 0 pkgExistsCmd)
     FIND_PROGRAM_ERROR_HANDLING(PKG_EXISTSRPM_CMD
 	ERROR_VAR pkgExistsCmdMissing
-	ERROR_MSG "ManageDependency: Program "${pkgExistsCmd}" not found, dependency check disabled."
+	ERROR_MSG "ManageDependency: Program ${pkgExistsCmd} not found, dependency check disabled."
 	VERBOSE_LEVEL ${M_OFF}
 	FIND_ARGS ${pkgExistsCmd}
 	)
@@ -178,7 +179,7 @@
     ENDIF()

     ## PKG_CONFIG
-    IF(${listVar}_${var}_PKG_CONFIG STREQUAL "")
+    IF("${${listVar}_${var}_PKG_CONFIG}" STREQUAL "")
 	IF(_opt_PKG_CONFIG)
 	    SET(${listVar}_${var}_PKG_CONFIG "${_opt_PKG_CONFIG}"
 		CACHE STRING "${listVar}_${var}_PKG_CONFIG")
@@ -223,7 +224,7 @@
 		M_MSG(${M_INFO1} "${var}_${_u}=${${var}_${_u}}")
 	    ENDFOREACH(_v)
 	ENDIF(NOT pkgconfigFailed)
-    ENDIF(pkgCong)
+    ENDIF(pkgConf)

     ## Insert when it's not duplicated
     IF(NOT _dirty)


Allow wxWidgets_DEFINITIONS to be a blank-delimited string (cmake 2.4.8) or
a list (cmake cvs version).

svn path=/trunk/; revision=8321

--- cmake/modules/wxwidgets.cmake
+++ cmake/modules/wxwidgets.cmake
@@ -39,9 +39,18 @@
 endif(PLD_wxwidgets)

 if(PLD_wxwidgets)
+  #message("wxWidgets_INCLUDE_DIRS = ${wxWidgets_INCLUDE_DIRS}")
+  #message("wxWidgets_DEFINITIONS = ${wxWidgets_DEFINITIONS}")
   string(REGEX REPLACE ";" " -I"
   wxwidgets_COMPILE_FLAGS
-  "-I${wxWidgets_INCLUDE_DIRS} ${wxWidgets_DEFINITIONS}"
+  "-I${wxWidgets_INCLUDE_DIRS}"
+  )
+  # For case (cvs version of CMake as of 2008-03-23, but not cmake-2.4.8)
+  # when wxWidgets_DEFINITIONS is a list.
+  string(REGEX REPLACE ";" " "
+  wxwidgets_COMPILE_FLAGS
+  ${wxwidgets_COMPILE_FLAGS}
+  " ${wxWidgets_DEFINITIONS}"
   )
   set(wxwidgets_LINK_FLAGS ${wxWidgets_LIBRARIES})
   if(WITH_FREETYPE)


Clear ARROW_FOUND

Clear ARROW_FOUND

--- cmake_scripts/FindArrow.cmake
+++ cmake_scripts/FindArrow.cmake
@@ -24,6 +24,8 @@
 #  ARROW_FOUND, whether arrow has been found

 include(FindPkgConfig)
+
+unset(ARROW_FOUND)

 if ("$ENV{ARROW_HOME}" STREQUAL "")
   pkg_check_modules(ARROW arrow)


One more debug message

One more debug message

--- tools/cmake/create_distro.cmake
+++ tools/cmake/create_distro.cmake
@@ -25,7 +25,6 @@
 	get_property(PROP_IS_DEFINED TARGET ${SOURCE} PROPERTY ${PROPERTY} SET)
 	if(PROP_IS_DEFINED)
 		get_property(PROP_VALUE TARGET ${SOURCE} PROPERTY ${PROPERTY})
-		#message("Copying ${PROPERTY} from ${SOURCE} -> ${DESTINATION}: ${PROP_VALUE} ")
 		set_property(TARGET ${DESTINATION} APPEND PROPERTY ${PROPERTY} "${PROP_VALUE}")
 	endif()
 endfunction(copy_append_property)
@@ -65,7 +64,7 @@
 				endif()
 			endif()
 		endforeach()
-
+
 	endwhile()

 endfunction(mbed_create_distro)


Hah! I finally found the undocumented feature of how to run parallel builds with the ctest dartboard. This wil really cut down on build times.

git-svn-id: 9be72bd8b79bf6944680671de68cae08993c9086@1733 fa922fa7-2fde-0310-acd8-f43f465a7996

--- src/scripts/ctest_hoomd.cmake
+++ src/scripts/ctest_hoomd.cmake
@@ -95,6 +95,7 @@

 SET (CTEST_INITIAL_CACHE "
 CMAKE_GENERATOR:INTERNAL=Unix Makefiles
+MAKECOMMAND:STRING=/usr/bin/make -i -j 6
 BUILDNAME:STRING=${BUILDNAME}
 SITE:STRING=${SITE_NAME}
 CMAKE_BUILD_TYPE:STRING=Debug


windows build fix (when built externally)

--- Component.cmake
+++ Component.cmake
@@ -164,7 +164,7 @@
 set (COOL_NG_WINCP_EVENT_SOURCES_SRCS     ${COOL_NG_HOME}/lib/src/async/wincp/event_sources.cpp )
 set (COOL_NG_WINCP_EVENT_SOURCES_HEADERS  ${COOL_NG_HOME}/lib/src/async/wincp/event_sources.h )
 set (COOL_NG_WINCP_EXECUTOR_SRCS          ${COOL_NG_HOME}/lib/src/async/wincp/executor.cpp)
-set (COOL_NG_WINCP_EXECUTOR_HEADERS       ${COOL_NG_HOME}/lib/src/async/wincp/executor.h lib/src/async/wincp/critical_section.h)
+set (COOL_NG_WINCP_EXECUTOR_HEADERS       ${COOL_NG_HOME}/lib/src/async/wincp/executor.h ${COOL_NG_HOME}/lib/src/async/wincp/critical_section.h)

 if ( NOT WINDOWS )
   set (COOL_NG_EXECUTOR_FILES ${COOL_NG_GCD_EXECUTOR_SRCS} ${COOL_NG_GCD_EXECUTOR_HEADERS})


AndroidのNDKパス, BoostLibraryパスは環境変数で設定するようにした

--- Android.cmake
+++ Android.cmake
@@ -1,10 +1,36 @@
 set(UNIX 1)
 add_definitions(-DUNIX)

-set(BOOST_PATH "/opt/boost/${ANDROID_ARCH_LONG}")
+# 環境変数のチェックとディレクトリの存在確認
+set(BOOST_PATH $ENV{BOOST_PATH})
+set(ANDROID_NDK_ROOT $ENV{ANDROID_NDK_ROOT})
+set(ANDROID_VER $ENV{ANDROID_VER})
+
+message(STATUS ">>-- enviroment variables check --<<")
+message(STATUS "BOOST_PATH: ${BOOST_PATH}")
+message(STATUS "ANDROID_NDK_ROOT: ${ANDROID_NDK_ROOT}")
+message(STATUS "ANDROID_VER: ${ANDROID_VER}")
+if((NOT IS_DIRECTORY ${BOOST_PATH})
+	OR (NOT IS_DIRECTORY ${ANDROID_NDK_ROOT})
+	OR (NOT DEFINED ANDROID_VER)
+	OR ("${ANDROID_VER}" LESS "1"))
+	message(FATAL_ERROR "
+		Some required enviroment values are not defined or invalid.
+		Example:
+			BOOST_PATH = /opt/boost/arm
+			ANDROID_NDK_ROOT = /opt/android-ndk
+			ANDROID_VER = 10")
+endif()
+message(STATUS ">>-- enviroment variables ok --<<")
+
+# Boost library ディレクトリが存在するか確認
+set(BOOST_PATH "${BOOST_PATH}/${ANDROID_ARCH_LONG}")
+message(STATUS "BOOST_PATH(actual): ${BOOST_PATH}")
+if(NOT IS_DIRECTORY ${BOOST_PATH})
+	message(FATAL_ERROR "${BOOST_PATH} is not exist.")
+endif()
+
 set(ANDROID_PLATFORM "linux-x86_64")
-set(ANDROID_NDK_ROOT "/opt/adt-bundle-${ANDROID_PLATFORM}/ndk")
-set(ANDROID_VER "9")
 set(TOOL_PREFIX ${ANDROID_ARCH_LONG})

 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-${ANDROID_ARCH_SHORT}")


Migrate CDash drop site / submission URL

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,9 +1,5 @@
 set(CTEST_PROJECT_NAME_SUPERBUILD "MITK-superbuild")
 set(CTEST_PROJECT_NAME "MITK")
-set(CTEST_NIGHTLY_START_TIME "23:00:00 EDT")
+set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")

-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "cdash.mitk.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=MITK")
-set(CTEST_DROP_SITE_CDASH TRUE)
-
+set(CTEST_SUBMIT_URL "https://cdash.mitk.org/submit.php?project=MITK")


updated SIRF_TAG to v2.2.0

updated SIRF_TAG to v2.2.0

--- version_config.cmake
+++ version_config.cmake
@@ -191,7 +191,7 @@
   set(DEFAULT_ACE_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG v2.2.0-rc.1)
+  set(DEFAULT_SIRF_TAG v2.2.0)

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


CMake: Always rebuild the runtimes when the source files change. (#112)

* CMake: Always rebuild the runtimes when the source files change.

* Whitespace fix

--- cmake/BCCompiler/CMakeBCInformation.cmake
+++ cmake/BCCompiler/CMakeBCInformation.cmake
@@ -66,4 +66,8 @@
     add_executable("${target_name}" ${source_file_list})
     target_compile_definitions("${target_name}" PRIVATE ${definitions})
     set_target_properties("${target_name}" PROPERTIES SUFFIX ".bc")
+
+    foreach (source_file ${sourcefile_list})
+        add_dependencies("${target_name}" "${source_file}")
+    endforeach ()
 endfunction ()


Fix typo in FindGTestSources.cmake

Fix typo in FindGTestSources.cmake

--- cmake/find-modules/FindGTestSources.cmake
+++ cmake/find-modules/FindGTestSources.cmake
@@ -56,7 +56,7 @@
     # should be non-cache variables, but CMP0077 strikes in
     set(BUILD_GMOCK OFF CACHE BOOL "")
     set(BUILD_GTEST ON CACHE BOOL "")
-    set(INSTALL_GTEST OF CACHE BOOL "")
+    set(INSTALL_GTEST OFF CACHE BOOL "")
     mark_as_advanced(BUILD_GMOCK BUILD_GTEST INSTALL_GTEST)
 endif()


DMC-792 Add MSVC detection in cmake

DMC-792 Add MSVC detection in cmake

--- cmake/modules/ReleaseDebugAutoFlags.cmake
+++ cmake/modules/ReleaseDebugAutoFlags.cmake
@@ -1,12 +1,20 @@
 ## debug / release autoManagement

+if(MSVC)
+    set(CMAKE_C_FLAGS_RELEASE  "-O2")
+    set(CMAKE_C_FLAGS_DEBUG  "-Wall")
+    set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -Wall")

-set(CMAKE_C_FLAGS_RELEASE  "-O2")
-set(CMAKE_C_FLAGS_DEBUG  "-g -Wall -Wextra -pedantic -fstack-protector-all")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO " -Wall -g -O2")
+    set(CMAKE_CXX_FLAGS_RELEASE  "-O2")
+    set(CMAKE_CXX_FLAGS_DEBUG  "-Wall")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -Wall")
+else()
+    set(CMAKE_C_FLAGS_RELEASE  "-O2")
+    set(CMAKE_C_FLAGS_DEBUG  "-g -Wall -Wextra -pedantic -fstack-protector-all")
+    set(CMAKE_C_FLAGS_RELWITHDEBINFO " -Wall -g -O2")

-
-set(CMAKE_CXX_FLAGS_RELEASE  "-O2")
-set(CMAKE_CXX_FLAGS_DEBUG  "-g -Wall -Wextra  -fstack-protector-all ")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -Wall -g -O2")
+    set(CMAKE_CXX_FLAGS_RELEASE  "-O2")
+    set(CMAKE_CXX_FLAGS_DEBUG  "-g -Wall -Wextra  -fstack-protector-all ")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -Wall -g -O2")
+endif()


Correct liblua name for Debian

Correct liblua name for Debian

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -370,7 +370,7 @@
 		SET(LIBS ${LIBS} zip)
 	ENDIF (NOT LIBZIP_BUILTIN)
 	IF (NOT LIBLUA_BUILTIN)
-		SET(LIBS ${LIBS} lua)
+		SET(LIBS ${LIBS} lua5.1)
 	ENDIF (NOT LIBLUA_BUILTIN)
 	IF(X11)
 		SET(LIBS ${LIBS} X11)


cleanup in cmake

cleanup in cmake

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -304,13 +304,7 @@
 	SET(LIBS ${LIBS} /usr/lib/libboost_filesystem-mt.a /usr/lib/libboost_signals-mt.a /usr/lib/libboost_system-mt.a)

 ELSE(BOOST_LINK_STATIC)
-	SET(BOOST_LIB_SUFFIX)
-	EXEC_PROGRAM(cat ARGS /etc/debian_version OUTPUT_VARIABLE DEBIAN_VERSION)
-	IF(DEBIAN_VERSION)
-		SET(BOOST_LIB_SUFFIX "-mt")
-	ENDIF(DEBIAN_VERSION)
-
-	SET(LIBS ${LIBS} boost_filesystem${BOOST_LIB_SUFFIX} boost_signals${BOOST_LIB_SUFFIX})
+	SET(LIBS ${LIBS} boost_filesystem-mt boost_signals-mt)
 ENDIF(BOOST_LINK_STATIC)

 SET(LIBS ${LIBS} curl alut openal vorbisfile)


[FIX] Installing include/seqan.h for libraries but not for apps.

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

--- util/cmake/SeqAnBuildSystem.cmake
+++ util/cmake/SeqAnBuildSystem.cmake
@@ -216,17 +216,12 @@
         file (GLOB HEADERS
               RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
               include/seqan/[A-z]*/[A-z]*.h
-              include/seqan/[A-z]*.h)
+              include/seqan/[A-z]*.h
+              include/seqan.h)
         foreach (HEADER ${HEADERS})
             get_filename_component (_DESTINATION ${HEADER} PATH)
             install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER} DESTINATION ${_DESTINATION})
         endforeach ()
-    endif ()
-
-    # Install global super header from extras.
-    get_filename_component (_PART_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
-    if (${_PART_NAME} STREQUAL "extras" AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan.h)
-      install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan.h DESTINATION include)
     endif ()

     # Get list of header and super header files.


Use target output name for exporting typesupport library (#625)

Signed-off-by: Jonathan Selling <f3463de45bebf6e0d4fc267a0c77793bb2ae4734@neyarobotics.com>

--- rosidl_cmake/cmake/rosidl_export_typesupport_libraries.cmake
+++ rosidl_cmake/cmake/rosidl_export_typesupport_libraries.cmake
@@ -45,7 +45,13 @@
           "not-imported targets")
       endif()

-      list(APPEND _ROSIDL_CMAKE_EXPORT_TYPESUPPORT_LIBRARIES "${library_suffix}:${_lib}")
+      get_target_property(_lib_name "${_lib}" OUTPUT_NAME)
+
+      if(NOT _lib_name)
+        set(_lib_name ${_lib})
+      endif()
+
+      list(APPEND _ROSIDL_CMAKE_EXPORT_TYPESUPPORT_LIBRARIES "${library_suffix}:${_lib_name}")
     endforeach()
   endif()
 endmacro()


[cmake] fix alembic finder

[cmake] fix alembic finder

poparteu/openMVG#2 poparteu/openMVG#19

--- src/cmakeFindModules/FindAlembic.cmake
+++ src/cmakeFindModules/FindAlembic.cmake
@@ -34,11 +34,11 @@
         $ENV{ALEMBIC_ILMBASE_ROOT}/lib
         $ENV{ALEMBIC_ILMBASE_ROOT}/lib64
         $ENV{ILMBASE_LIBRARY_DIR}
-    NO_DEFAULT_PATH)
+    )

-FIND_LIBRARY(ABC_ILMBASE_IEX Iex PATHS ${ABC_ILMBASE_LIBS_PATH} NO_DEFAULT_PATH)
-FIND_LIBRARY(ABC_ILMBASE_IEXMATH IexMath PATHS ${ABC_ILMBASE_LIBS_PATH} NO_DEFAULT_PATH)
-FIND_LIBRARY(ABC_ILMBASE_HALF Half PATHS ${ABC_ILMBASE_LIBS_PATH} NO_DEFAULT_PATH)
+FIND_LIBRARY(ABC_ILMBASE_IEX Iex PATHS ${ABC_ILMBASE_LIBS_PATH})
+FIND_LIBRARY(ABC_ILMBASE_IEXMATH IexMath PATHS ${ABC_ILMBASE_LIBS_PATH})
+FIND_LIBRARY(ABC_ILMBASE_HALF Half PATHS ${ABC_ILMBASE_LIBS_PATH})
 SET(ABC_ILMBASE_LIBS ${ABC_ILMBASE_IEX} ${ABC_ILMBASE_IEXMATH} ${ABC_ILMBASE_HALF})

 # OpenEXR
@@ -49,7 +49,7 @@
         $ENV{ALEMBIC_OPENEXR_ROOT}/lib
         $ENV{ALEMBIC_OPENEXR_ROOT}/lib64
         $ENV{OPENEXR_LIBRARY_DIR}
-    NO_DEFAULT_PATH)
+    )

 ################################################################################
 # HDF5 libraries used in alembic
@@ -63,7 +63,7 @@
         $ENV{ALEMBIC_HDF5_ROOT}/lib
         $ENV{ALEMBIC_HDF5_ROOT}/lib64
         $ENV{HDF5_LIBRARY_DIR}
-       NO_DEFAULT_PATH)
+       )
 FIND_LIBRARY(ABC_HDF5 hdf5 PATHS ${ABC_HDF5_LIBS_PATH})
 FIND_LIBRARY(ABC_HDF5_HL hdf5_hl PATHS ${ABC_HDF5_LIBS_PATH})
 SET(ABC_HDF5_LIBS ${ABC_HDF5} ${ABC_HDF5_HL})
@@ -79,8 +79,7 @@
         ${ALEMBIC_ROOT}/include
     PATH_SUFFIXES
         alembic
-    NO_DEFAULT_PATH
-)
+    )
 # message(STATUS "ABC_OPENEXR_LIBS ${ABC_OPENEXR_LIBS}")

 #
@@ -89,7 +88,7 @@

 # try to find the all-in-one library
 message(STATUS "trying to found the all-in-one libAlembic.so")
-FIND_LIBRARY(ABC_ALL_IN_ONE libAlembic
+FIND_LIBRARY(ABC_LIBRARY_ALLINONE Alembic
     PATHS
         ${ALEMBIC_ROOT}/lib
         ${ALEMBIC_ROOT}/lib/static
@@ -99,15 +98,16 @@
         $ENV{ALEMBIC_ROOT}/lib64
         $ENV{ALEMBIC_LIBRARY_DIR}
         $ENV{ALEMBIC_LIBRARY_DIR}/static
-    NO_DEFAULT_PATH)
-# message(STATUS "ABC_ALL_IN_ONE ${ABC_ALL_IN_ONE}")
-if( EXISTS ${ABC_ALL_IN_ONE})
-    message(STATUS "found the all-in-one libAlembic")
-    SET(ABC_CORE_LIBS ${ABC_ALL_IN_ONE} )
+    )
+# message(STATUS "ABC_LIBRARY_ALLINONE ${ABC_LIBRARY_ALLINONE}")
+if( EXISTS ${ABC_LIBRARY_ALLINONE})
+    message(STATUS "found the all-in-one libAlembic: ${ABC_LIBRARY_ALLINONE}")
+    SET(ABC_CORE_LIBS ${ABC_LIBRARY_ALLINONE})
+    GET_FILENAME_COMPONENT(ABC_LIBRARY_DIR ${ABC_LIBRARY_ALLINONE} DIRECTORY)
 else()
-    message(STATUS "all-in-one not found, try finding individual ones")
+    message(STATUS "all-in-one not found, try finding individual ones --  ${ABC_LIBRARY_ALLINONE}")

-    FIND_PATH(ABC_LIBRARY_DIR libAlembicAbc.so libAlembicAbc.a
+    FIND_LIBRARY(ABC_LIBRARY AlembicAbc
         PATHS
             ${ALEMBIC_ROOT}/lib
             ${ALEMBIC_ROOT}/lib/static
@@ -115,7 +115,9 @@
             $ENV{ALEMBIC_ROOT}/lib
             $ENV{ALEMBIC_ROOT}/lib64
             $ENV{ALEMBIC_LIBRARY_DIR}
-        NO_DEFAULT_PATH)
+        )
+    GET_FILENAME_COMPONENT(ABC_LIBRARY_DIR ${ABC_LIBRARY} DIRECTORY)
+
     #FIND_LIBRARY(ABC_COLLECTION libAlembicAbcCollection.so PATHS ${ABC_LIBRARY_DIR})
     #FIND_LIBRARY(ABC_COREFACTORY libAlembicAbcCoreFactory.so PATHS ${ABC_LIBRARY_DIR})
     #FIND_LIBRARY(ABC_COREOGAWA libAlembicAbcCoreOgawa.so PATHS ${ABC_LIBRARY_DIR})
@@ -123,23 +125,24 @@
     #FIND_LIBRARY(ABC_OGAWA libAlembicOgawa.so PATHS ${ABC_LIBRARY_DIR})
     #FIND_LIBRARY(ABC_OPENGL libAlembicAbcOpenGL.so PATHS ${ABC_LIBRARY_DIR})
     #FIND_LIBRARY(ABC_WFOBJCONVERT libAbcWFObjConvert.so PATHS ${ABC_LIBRARY_DIR})
-    FIND_LIBRARY(ABC libAlembicAbc.so PATHS ${ABC_LIBRARY_DIR})
-    FIND_LIBRARY(ABC_COREABSTRACT libAlembicAbcCoreAbstract.so PATHS ${ABC_LIBRARY_DIR})
-    FIND_LIBRARY(ABC_COREHDF5 libAlembicAbcCoreHDF5.so PATHS ${ABC_LIBRARY_DIR})
-    FIND_LIBRARY(ABC_GEOM libAlembicAbcGeom.so PATHS ${ABC_LIBRARY_DIR})
-    FIND_LIBRARY(ABC_UTIL libAlembicUtil.so PATHS ${ABC_LIBRARY_DIR})
-    SET(ABC_CORE_LIBS ${ABC_GEOM} ${ABC} ${ABC_COREHDF5} ${ABC_COREABSTRACT} ${ABC_UTIL})
+    FIND_LIBRARY(ABC_COREABSTRACT AlembicAbcCoreAbstract PATHS ${ABC_LIBRARY_DIR})
+    FIND_LIBRARY(ABC_COREHDF5 AlembicAbcCoreHDF5 PATHS ${ABC_LIBRARY_DIR})
+    FIND_LIBRARY(ABC_GEOM AlembicAbcGeom PATHS ${ABC_LIBRARY_DIR})
+    FIND_LIBRARY(ABC_UTIL AlembicUtil PATHS ${ABC_LIBRARY_DIR})
+    SET(ABC_CORE_LIBS ${ABC_LIBRARY} ${ABC_GEOM} ${ABC} ${ABC_COREHDF5} ${ABC_COREABSTRACT} ${ABC_UTIL})
 endif()

 SET(ABC_LIBRARIES ${ABC_CORE_LIBS} ${ABC_HDF5_LIBS} "-ldl" ${ABC_OPENEXR_LIBS} ${ABC_ILMBASE_LIBS})
 SET(ABC_INCLUDE_DIR ${ABC_INCLUDE_DIR} ${ABC_HALF_INCLUDE_DIR})

+message(STATUS "ABC_LIBRARIES: ${ABC_LIBRARIES}")
+message(STATUS "ABC_INCLUDE_DIR: ${ABC_INCLUDE_DIR}")
+
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS("Alembic" DEFAULT_MSG ABC_LIBRARIES ABC_LIBRARY_DIR ABC_INCLUDE_DIR ABC_HDF5_LIBS)

-
 if (ALEMBIC_FOUND)
-mark_as_advanced(ABC_LIBRARY_DIR ABC_HDF5_LIBS_PATH ABC_ILMBASE_LIBS_PATH)
+    mark_as_advanced(ABC_LIBRARY_DIR ABC_HDF5_LIBS_PATH ABC_ILMBASE_LIBS_PATH)
     message("Found Alembic - will build alembic exporter")
 else()
     message("Alembic NOT FOUND")


use git repository in ExternalProject_Add

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -12,13 +12,14 @@
 set(MITK-Data_DEPENDS ${proj})

 if(BUILD_TESTING)
-  set(revision_tag b8db25fb) # first 8 characters of hash-tag
+
+  set(revision_tag 808005fc) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}
     SOURCE_DIR ${proj}
-    URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/mitk-data_${revision_tag}.tar.gz
-    UPDATE_COMMAND ""
+    GIT_REPOSITORY https://phabricator.mitk.org/diffusion/MD/mitk-data.git
+    GIT_TAG ${revision_tag}
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
     INSTALL_COMMAND ""


Rename eigen alignment option to EIGEN3_DONT_ALIGN

Keep the cmake option similar to the eigen option (EIGEN_DONT_ALIGN),
just make it EIGEN3_DONT_ALIGN so it groups with the other eigen cmake
options. Also, make it advanced, this usually shouldn't be changed.

--- CMake/SurgSimBuildFlags.cmake
+++ CMake/SurgSimBuildFlags.cmake
@@ -123,7 +123,8 @@
 	add_definitions( -D_POSIX_C_SOURCE=200809L )  # request POSIX APIs
 endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")

-option(EIGEN_ALIGNMENT "Enables vector alignment in Eigen " ON)
-if(NOT EIGEN_ALIGNMENT)
+option(EIGEN3_DONT_ALIGN "Disable alignment of vectors in Eigen " OFF)
+mark_as_advanced(EIGEN3_DONT_ALIGN)
+if(EIGEN3_DONT_ALIGN)
 	add_definitions( -DEIGEN_DONT_ALIGN )
-endif(NOT EIGEN_ALIGNMENT)
+endif(EIGEN3_DONT_ALIGN)


COMP: added correct Hash-Value

COMP: added correct Hash-Value

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag 578a7578)
+  set(revision_tag d01e488b)
   #if(${proj}_REVISION_TAG)
   #  set(revision_tag ${${proj}_REVISION_TAG})
   #endif()


CMake: Find Freetype changed to search from higher version to lower - now it OgreMain links with 2311 source if found (need to delete cache entries)

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype freetype219 freetype235 freetype238 freetype239 freetype2311)
+set(FREETYPE_LIBRARY_NAMES freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


Propogate Eigen dependency downstream

Propogate Eigen dependency downstream

--- mui-config.cmake
+++ mui-config.cmake
@@ -1,2 +1,4 @@
+include(CMakeFindDependencyMacro)
+find_dependency(Eigen3)
 get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
 include("${SELF_DIR}/muiTargets.cmake")


deal with python debug lib for windows

deal with python debug lib for windows

--- PyPort/system-python.cmake
+++ PyPort/system-python.cmake
@@ -59,19 +59,56 @@
 		message("Warning: Python version unknown")
 	endif()

+	if(WIN32)
+		set(PYTHON_DEBUG_POSTFIX "_d")
+	endif()
+
 	#import the python lib
-	find_library(PYTHON_LIB NAMES ${PYTHON_VER} lib${PYTHON_VER} libpython${PYTHON_NUM} python${PYTHON_NUM}
+	find_library(PYTHON_LIBRARY_RELEASE
+		NAMES ${PYTHON_VER}
+			lib${PYTHON_VER}
+			libpython${PYTHON_NUM}
+			python${PYTHON_NUM}
+		PATHS ${PYTHON_HOME}/lib ${PYTHON_HOME}/libs ${PYTHON_HOME}/local/lib ${PYTHON_HOME}/lib64 ${PYTHON_HOME}/local/lib64
+		PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE}
+		NO_DEFAULT_PATH
+		CMAKE_FIND_ROOT_PATH_BOTH)
+	add_library(python_target UNKNOWN IMPORTED)
+	set_property(TARGET python_target PROPERTY IMPORTED_LOCATION "${PYTHON_LIBRARY_RELEASE}")
+
+	#import the debug python lib
+	find_library(PYTHON_LIBRARY_DEBUG
+		NAMES ${PYTHON_VER}${PYTHON_DEBUG_POSTFIX}
+			lib${PYTHON_VER}${PYTHON_DEBUG_POSTFIX}
+			libpython${PYTHON_NUM}${PYTHON_DEBUG_POSTFIX}
+			python${PYTHON_NUM}${PYTHON_DEBUG_POSTFIX}
 		PATHS ${PYTHON_HOME}/lib ${PYTHON_HOME}/libs ${PYTHON_HOME}/local/lib ${PYTHON_HOME}/lib64 ${PYTHON_HOME}/local/lib64
 		PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE}
 		NO_DEFAULT_PATH
 		CMAKE_FIND_ROOT_PATH_BOTH)

-	add_library(python_target UNKNOWN IMPORTED)
-	set_property(TARGET python_target PROPERTY IMPORTED_LOCATION "${PYTHON_LIB}")
+	if(WIN32)
+		if (NOT PYTHON_LIBRARY_DEBUG)
+			#FIXME:
+			# Appveyor does not have the debug libraries. Point to our copy that we have put into GIT. This issue will be fixed on next Image Release
+			# Remove this and python37_d.lib from GIT when the Appveyor image catches up.
+			message("No debug python lib hack")
+
+			if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")	# 64 Bit
+				set(platform "x64")
+			else()
+				set(platform "x86")
+			endif()
+
+			set(PYTHON_LIBRARY_DEBUG "${CMAKE_SOURCE_DIR}/PyPort/${platform}/python37_d.lib")
+		endif()
+	endif()
+
+	add_library(python_target_d UNKNOWN IMPORTED)
+	set_property(TARGET python_target_d PROPERTY IMPORTED_LOCATION "${PYTHON_LIBRARY_DEBUG}")
+
+
 	#set a variable to use for linking
 	set(PYTHON_LIBRARIES debug python_target optimized python_target )

-	set(PYTHON_LIBRARY_DEBUG "${PYTHON_LIB}")
-	set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIB}")
-
 endif()


Add additional BOOST versions

Add additional BOOST versions


Updated FindFFI

Updated FindFFI

--- cmake/Modules/FindFFI.cmake
+++ cmake/Modules/FindFFI.cmake
@@ -1,4 +1,4 @@
-
+# Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
 # regarding copyright ownership.  The ASF licenses this file
@@ -15,7 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.

-
 # - Try to find libffi define the variables for the binaries/headers and include
 #
 # Once done this will define
@@ -30,51 +29,62 @@
         #set brew location for pkg-config
         set(ENV{PKG_CONFIG_PATH} "/usr/local/opt/libffi/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
     endif ()
-    pkg_check_modules(LIBFFI REQUIRED libffi)
+    pkg_check_modules(PC_LIBFFI QUIET libffi>=3.2.1)

     #use found LIBFFI pkg config info to search for the abs path fo the libffi lib.
     #Note that the abs path info  is not present in the pkg-config results (only the -l and -L arguments)
-    find_library(FFI_ABS_LIB NAMES ffi PATHS ${LIBFFI_LIBRARY_DIRS} ${LIBFFI_LIBDIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH NO_CMAKE_PATH NO_CMAKE_SYSTEM_PATH)
-    if (NOT FFI_ABS_LIB)
-	    message(FATAL_ERROR "Cannot find abs path of libffi based on pkgconfig results. Tried to find libffi @ '${LIBFFI_LIBRARY_DIRS}' and '${LIBFFI_LIBDIR}'")
-    endif ()
-
-    add_library(ffi::lib SHARED IMPORTED)
-    set_target_properties(ffi::lib PROPERTIES
-        IMPORTED_LOCATION "${FFI_ABS_LIB}"
-        INTERFACE_INCLUDE_DIRECTORIES "${LIBFFI_INCLUDE_DIRS}"
+    find_library(FFI_ABS_LIB NAMES ffi
+        PATHS ${PC_LIBFFI_LIBRARY_DIRS} ${PC_LIBFFI_LIBDIR}
+        NO_DEFAULT_PATH
+        NO_PACKAGE_ROOT_PATH
+        NO_CMAKE_PATH
+        NO_CMAKE_SYSTEM_PATH
     )

+    if (NOT FFI_ABS_LIB)
+        message(WARNING "Cannot find abs path of libffi based on pkgconfig results. Tried to find libffi @ '${PC_LIBFFI_LIBRARY_DIRS}' and '${PC_LIBFFI_LIBDIR}'")
+    else()
+        set(LIBFFI_LIB_ADDED TRUE)
+        add_library(ffi::lib SHARED IMPORTED)
+        set_target_properties(ffi::lib PROPERTIES
+            IMPORTED_LOCATION "${FFI_ABS_LIB}"
+            INTERFACE_INCLUDE_DIRECTORIES "${PC_LIBFFI_INCLUDE_DIRS}"
+        )
+    endif()
+
     unset(FFI_ABS_LIB)
-else()
+endif()
+
+if (NOT LIBFFI_LIB_ADDED)
     mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)

     find_library(FFI_LIBRARY NAMES ffi libffi
-            PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local
-            PATH_SUFFIXES lib lib64 x86_64-linux-gnu lib/x86_64-linux-gnu
-            HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS}
+        PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local
+        PATH_SUFFIXES lib lib64 x86_64-linux-gnu lib/x86_64-linux-gnu
+        HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS}
     )

     find_path(FFI_INCLUDE_DIR ffi.h
-            PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local
-            PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu x86_64-linux-gnu
-            HINTS ${PC_LIBFFI_INCLUDEDIR} ${PC_LIBFFI_INCLUDE_DIRS}
+         PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local
+         PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu x86_64-linux-gnu
+         HINTS ${PC_LIBFFI_INCLUDEDIR} ${PC_LIBFFI_INCLUDE_DIRS}
     )

     include(FindPackageHandleStandardArgs)
     # handle the QUIETLY and REQUIRED arguments and set FFI_FOUND to TRUE
     # if all listed variables are TRUE
-    find_package_handle_standard_args(FFI  DEFAULT_MSG
+    find_package_handle_standard_args(FFI DEFAULT_MSG
                                       FFI_LIBRARY FFI_INCLUDE_DIR)
-    mark_as_advanced(FFI_INCLUDE_DIR FFI_LIBRARY)
+    mark_as_advanced(FFI_INCLUDE_DIR FFI_LIBRARY)

     if(FFI_FOUND)
         set(FFI_LIBRARIES ${FFI_LIBRARY})
         set(FFI_INCLUDE_DIRS ${FFI_INCLUDE_DIR})
+
         add_library(ffi::lib SHARED IMPORTED)
         set_target_properties(ffi::lib PROPERTIES
-                IMPORTED_LOCATION "${FFI_LIBRARY}"
-                INTERFACE_INCLUDE_DIRECTORIES "${FFI_INCLUDE_DIR}"
+            IMPORTED_LOCATION "${FFI_LIBRARY}"
+            INTERFACE_INCLUDE_DIRECTORIES "${FFI_INCLUDE_DIR}"
         )
     endif()
-endif ()
+endif()


Squashed '3rdparty/github/cmake-utils-remote/' changes from 25ce7aa..09fb2f1

09fb2f1 Install of export file

git-subtree-dir: 3rdparty/github/cmake-utils-remote
git-subtree-split: 09fb2f1cedb15ae589b536398325e515cf7a6c8f

--- cmake/MyPackageExport.cmake
+++ cmake/MyPackageExport.cmake
@@ -10,5 +10,7 @@
     EXPORT_FILE_NAME "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h"
     STATIC_DEFINE ${PROJECT_NAME}_STATIC)
   ADD_CUSTOM_TARGET(${PROJECT_NAME}Export SOURCES "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
+  INSTALL(FILES ${_file} DESTINATION ${_dir})
+  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION ${PROJECT_NAME})

 ENDMACRO()


TBB Debug Release

TBB Debug Release

OpenCV fails to detect tbb on a debug build if the platform has only installed
debug libraries.  This PR adds an additional check to the tbb detect logic for
systems that only install tbb debug and not both tbb debug and release.


Update default.cmake

Update default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -24,7 +24,7 @@

 # NOTE: no names with spaces!

-hunter_config(vmime VERSION 0.9.2.2)
+hunter_config(vmime VERSION 0.9.3.0)
 hunter_config(gloox VERSION 1.0.20-p5)
 hunter_config(wdc VERSION 1.0.1-hunter-p1)
 hunter_config(pugixml VERSION 1.8.1)