COMP: change cmake error to warning (if gtk is activated)

--- SuperBuild/CMake/External_qt4.cmake
+++ SuperBuild/CMake/External_qt4.cmake
@@ -11,7 +11,7 @@
 # endif()

-option(QT4_SB_ENABLE_GTK "Enable GTK+ style with qt using -gtkstlye. Default is OFF" OFF)
+set(QT4_SB_ENABLE_GTK OFF CACHE INTERNAL "Enable GTK+ style with qt using -gtkstlye. Default is OFF")

 if(NOT DEFINED git_protocol)
   set(git_protocol "git")
@@ -34,15 +34,8 @@
     set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-framework")
   else() #Linux
     if(QT4_SB_ENABLE_GTK)
-      message(STATUS "QT4_SB_ENABLE_GTK is activated. QT4 build includes  gtk+ and libfreetype, libpng (dependencies of gtk+ package)")
-      if( NOT USE_SYSTEM_PNG OR
-	  NOT USE_SYSTEM_EXPAT OR
-	  NOT USE_SYSTEM_FREETYPE )
-	message(FATAL_ERROR "cannot use libpng, expat and freetype from superbuild when QT4_SB_ENABLE_GTK is ON.
- eactivate gtk+ theme support in Qt build with 'cmake -DQT4_SB_ENABLE_GTK=OFF'
-OR use system libraries for png, expat and freetype with
-'cmake -DUSE_SYSTEM_PNG=ON -DUSE_SYSTEM_EXPAT USE_SYSTEM_FREETYPE=ON'")
-      endif()
+      message(WARNING "QT4_SB_ENABLE_GTK support is experimental")
+
       set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -sm -xrender -xrandr -gtkstyle")
     else()
       set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-gtkstyle")


SuperBuild: fix broken list of configure options

--- SuperBuild/CMake/External_qt5.cmake
+++ SuperBuild/CMake/External_qt5.cmake
@@ -59,7 +59,7 @@
   -skip qtgamepad  \
   -skip qt3d  \
   -skip qtactiveqt  \
-  -skip qtandroidextras \
+  -skip qtandroidextras \
   -skip qtcanvas3d  \
   -skip qtcharts  \
   -skip qtconnectivity  \
@@ -117,22 +117,22 @@
   # set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -I ${PNG_PNG_INCLUDE_DIR}")
 # endif()

-# if(UNIX)
-#   if(APPLE)
-#     set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-framework")
-#   else() #Linux
-#     if(QT4_SB_ENABLE_GTK)
-#       message(WARNING "QT4_SB_ENABLE_GTK support is experimental")
-#       set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -sm -xrender -xrandr -gtkstyle")
-#     else()
-#       set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-gtkstyle -no-glib -no-fontconfig")
-#     endif()
-#   endif()
-#   #common for all unix
-#   set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-dbus -no-nis -no-javascript-jit -no-icu -v")
-# elseif(MSVC)
-#   set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -mp")
-# endif()
+if(UNIX)
+  if(APPLE)
+    set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-framework")
+  else() #Linux
+#    if(QT5_SB_ENABLE_GTK)
+#      message(WARNING "QT5_SB_ENABLE_GTK support is experimental")
+#      set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -sm -xrender -xrandr -gtkstyle")
+#    else()
+      set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-gtkstyle -no-glib -no-fontconfig")
+#    endif()
+  endif()
+  #common for all unix
+  set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-dbus -no-nis -no-javascript-jit -no-icu -v")
+elseif(MSVC)
+  set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -mp")
+endif()

 if(WIN32)
   set(QT5_BIN_EXT ".exe")


Update superbuild version of Qwt to 6.1.6

--- SuperBuild/CMake/External_qwt.cmake
+++ SuperBuild/CMake/External_qwt.cmake
@@ -55,8 +55,8 @@

 ExternalProject_Add(QWT
   PREFIX QWT
-  URL "http://downloads.sourceforge.net/project/qwt/qwt/6.1.5/qwt-6.1.5.zip"
-  URL_MD5 61a8cae35ab6201d916304ec4a6f06b8
+  URL "http://downloads.sourceforge.net/project/qwt/qwt/6.1.6/qwt-6.1.6.zip"
+  URL_MD5 5f59c0843484afb1462d21444227d6f6
   SOURCE_DIR ${QWT_SB_SRC}
   BINARY_DIR ${QWT_SB_SRC}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


Fixes the installation of the rng files to place them in the lib directory.

--- src/CMake/CyclusModuleMacros.cmake
+++ src/CMake/CyclusModuleMacros.cmake
@@ -20,11 +20,11 @@
     )

   SET(RNG_INCLUDES ${RNG_INCLUDES}
-    "<include href='..${_path}/${_name}.rng'/>"
+    "<include href='../lib${_path}/${_name}.rng'/>"
     PARENT_SCOPE)

   install(FILES "${_name}.rng"
-    DESTINATION cyclus/${_path}
+    DESTINATION cyclus/lib${_path}
     COMPONENT "${_path}.rng"
     )
 endmacro()


Update version configuration to 2.1.1.2

Update version configuration to 2.1.1.2

--- Version.cmake
+++ Version.cmake
@@ -11,7 +11,7 @@
 set(SimpleITK_VERSION_MAJOR 2)
 set(SimpleITK_VERSION_MINOR 1)
 set(SimpleITK_VERSION_PATCH 1)
-set(SimpleITK_VERSION_TWEAK 1)
+set(SimpleITK_VERSION_TWEAK 2)

 include(sitkSourceVersion)


Improve the CMake C++ flag checker

Improve the CMake C++ flag checker

This checks the flag on the compiler AND linker which allows it to work
with flags such as -flto and -fsanitize=address

--- cmake/AddCXXCompilerFlag.cmake
+++ cmake/AddCXXCompilerFlag.cmake
@@ -20,18 +20,17 @@
 include(CheckCXXCompilerFlag)

 function(add_cxx_compiler_flag FLAG)
-  if(ARGV1)
-    set(VARIANT ${ARGV1})
-    string(TOLOWER ${VARIANT} VARIANT)
-    set(VARIANT " ${VARIANT}")
-  endif()
-  string(TOUPPER "HAVE_${FLAG}" SANITIZED_FLAG)
+  string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
+  string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
   string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
   string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
-  check_cxx_compiler_flag(${FLAG} ${SANITIZED_FLAG})
+  set(CMAKE_REQUIRED_FLAGS "${FLAG}")
+  check_cxx_compiler_flag("" ${SANITIZED_FLAG})
   if(${SANITIZED_FLAG})
-    string(REGEX REPLACE "[^A-Za-z_0-9]" "_" VARIANT "${VARIANT}")
-    string(TOUPPER "${VARIANT}" VARIANT)
+    set(VARIANT ${ARGV1})
+    if(ARGV1)
+      string(TOUPPER "_${VARIANT}" VARIANT)
+    endif()
     set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
   endif()
 endfunction()


Only replace fingerprint file when MD5 changes.  Avoids rebuilding several things if nothing has actually changes, as cmake is only looking at timestamps.

--- cmake/FingerPrint-Config.cmake
+++ cmake/FingerPrint-Config.cmake
@@ -1,10 +1,24 @@
 set(OLDFILE ${SOURCE_DIR}/util/fingerprint_impl.hpp)
-if (EXISTS ${OLDFILE})
-	file(REMOVE_RECURSE ${OLDFILE})
-endif()
+set(NEWFILE ${OLDFILE}.tmp)
+set(INFILE ${OLDFILE}.in)
 file(MD5 ${SOURCE_DIR}/prepare.cpp MD5PREPARE)
 file(MD5 ${SOURCE_DIR}/data_structures/static_rtree.hpp MD5RTREE)
 file(MD5 ${SOURCE_DIR}/util/graph_loader.hpp MD5GRAPH)
 file(MD5 ${SOURCE_DIR}/server/data_structures/internal_datafacade.hpp MD5OBJECTS)

-CONFIGURE_FILE(${SOURCE_DIR}/util/fingerprint_impl.hpp.in ${SOURCE_DIR}/util/fingerprint_impl.hpp)
+CONFIGURE_FILE(${INFILE} ${NEWFILE})
+
+file(MD5 ${NEWFILE} MD5NEW)
+
+if (EXISTS ${OLDFILE})
+    file(MD5 ${OLDFILE} MD5OLD)
+    if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
+	    file(REMOVE_RECURSE ${OLDFILE})
+        file(RENAME ${NEWFILE} ${OLDFILE})
+    else()
+        file(REMOVE_RECURSE ${NEWFILE})
+        message(STATUS "Fingerprint unchanged, not regenerating")
+    endif()
+else()
+    file(RENAME ${NEWFILE} ${OLDFILE})
+endif()


remove GCC's -Wunsafe-loop-optimizations

GCC7 will emit warnings when using range-based for loops:
	"warning: missed loop optimization, the loop counter may overflow"
Since it's only complaining about a missed optimization, this warning
can safely be disabled.

--- cmake/HextEnableWarnings.cmake
+++ cmake/HextEnableWarnings.cmake
@@ -23,7 +23,7 @@
     "-Wsign-compare" "-Wsign-promo" "-Wstack-protector" "-Wstrict-aliasing=2"
     "-Wstrict-null-sentinel" "-Wstrict-overflow" "-Wswitch"
     "-Wtrigraphs" "-Wundef" "-Wuninitialized" "-Wunknown-pragmas"
-    "-Wunreachable-code" "-Wunused" "-Wunsafe-loop-optimizations"
+    "-Wunreachable-code" "-Wunused"
     "-Wunused-function" "-Wunused-label" "-Wunused-parameter" "-Wunused-value"
     "-Wunused-variable" "-Wvariadic-macros" "-Wvolatile-register-var"
     "-Wwrite-strings" "-Wmissing-noreturn" "-Wsign-conversion"
@@ -32,6 +32,11 @@
     # "-Wswitch-default": generated ragel code uses switch without default,
     #                     we cannot do anything about that
     # "-Wpadded": also warns when it's impossible to shrink padding
+    # "-Wunsafe-loop-optimizations":
+    #   GCC7 will emit warnings when using range-based for loops:
+    #     "warning: missed loop optimization, the loop counter may overflow"
+    #   Since it's only complaining about a missed optimization, this warning
+    #   can safely be disabled.
   )
 ENDIF(CMAKE_COMPILER_IS_GNUCXX)


cmake: HextEnableWarnings: remove -Wno-unused which is overriden by -Wunused

--- cmake/HextEnableWarnings.cmake
+++ cmake/HextEnableWarnings.cmake
@@ -17,7 +17,7 @@
     "-Wformat=2" "-Wformat-nonliteral" "-Wformat-security" "-Wformat-y2k"
     "-Wimport" "-Winit-self" "-Winvalid-pch" "-Wlogical-op"
     "-Wlong-long" "-Wmissing-braces" "-Wmissing-field-initializers"
-    "-Wmissing-format-attribute" "-Wmissing-include-dirs" "-Wno-unused"
+    "-Wmissing-format-attribute" "-Wmissing-include-dirs"
     "-Woverloaded-virtual" "-Wpacked" "-Wparentheses" "-Wpointer-arith"
     "-Wredundant-decls" "-Wreturn-type" "-Wsequence-point" "-Wshadow"
     "-Wsign-compare" "-Wsign-promo" "-Wstack-protector" "-Wstrict-aliasing=2"


fixed names

fixed names

--- cmake/Modules/FindCsound.cmake
+++ cmake/Modules/FindCsound.cmake
@@ -1,6 +1,6 @@
 # Try to find the Csound library.
 # Once done this will define:
-#  CSOUND_FOUND - System has the Csound l;ibrary
+#  CSOUND_FOUND - System has the Csound library
 #  CSOUND_INCLUDE_DIRS - The Csound include directories.
 #  CSOUND_LIBRARIES - The libraries needed to use the Csound library.

@@ -12,9 +12,9 @@
 endif()

 if(APPLE)
-find_library(LIBLO_LIBRARY NAMES Csound64Lib CsoundLib)
+find_library(CSOUND_LIBRARY NAMES Csound64Lib CsoundLib)
 else()
-find_library(LIBLO_LIBRARY NAMES csound64 csound)
+find_library(CSOUND_LIBRARY NAMES csound64 csound)
 endif()

 include(FindPackageHandleStandardArgs)
@@ -24,5 +24,5 @@
                                   CSOUND_LIBRARY CSOUND_INCLUDE_DIR)
 mark_as_advanced(CSOUND_INCLUDE_DIR CSOUND_LIBRARY)

-set(CSOUND_INCLUDE_DIRS ${LIBLO_INCLUDE_DIR})
+set(CSOUND_INCLUDE_DIRS ${CSOUND_INCLUDE_DIR})
 set(CSOUND_LIBRARIES ${CSOUND_LIBRARY} )


Fix: include libusb-1.0 headers only on non windows plateform

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

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -61,6 +61,8 @@
   message(STATUS "OpeNI disabled because libusb-1.0 not found.")
   set(HAVE_OPENNI OFF)
   return()
+else(NOT WIN32 AND NOT USB_10_FOUND)
+	include_directories(${USB_10_INCLUDE_DIR})
 endif(NOT WIN32 AND NOT USB_10_FOUND)

 if(OPENNI_FOUND)
@@ -68,7 +70,6 @@
   # Add the include directories
   set(OPENNI_INCLUDE_DIRS ${OPENNI_INCLUDE_DIRS})
   include_directories(${OPENNI_INCLUDE_DIRS})
-	include_directories(${USB_10_INCLUDE_DIR})
   message(STATUS "OpenNI found (include: ${OPENNI_INCLUDE_DIRS}, lib: ${OPENNI_LIBRARY})")
 endif(OPENNI_FOUND)


Add option to control building 32-bit iOS slices.

Not building 32-bit slices saves some time during development when doing iOS builds for things that don't particularly care about bitness.

--- cmake/modules/DarwinSDKs.cmake
+++ cmake/modules/DarwinSDKs.cmake
@@ -1,5 +1,15 @@
+option(SWIFT_ENABLE_IOS32
+       "Build 32-bit variants of iOS"
+       TRUE)
+
+if(SWIFT_ENABLE_IOS32)
 set(SUPPORTED_IOS_ARCHS "armv7;armv7s;arm64")
 set(SUPPORTED_IOS_SIMULATOR_ARCHS "i386;x86_64")
+else()
+set(SUPPORTED_IOS_ARCHS "arm64")
+set(SUPPORTED_IOS_SIMULATOR_ARCHS "x86_64")
+endif()
+
 set(SUPPORTED_TVOS_ARCHS "arm64")
 set(SUPPORTED_TVOS_SIMULATOR_ARCHS "x86_64")
 set(SUPPORTED_WATCHOS_ARCHS "armv7k")


Qt Linux: fix missing libs to link

Qt Linux: fix missing libs to link

--- scripts/Qt5Widgets_HunterPlugin_5_5.cmake
+++ scripts/Qt5Widgets_HunterPlugin_5_5.cmake
@@ -259,6 +259,13 @@
         Qt5::Widgets "${_qt5Widgets_install_prefix}/lib/libqtpcre.a"
     )

+    _hunter_plugin_add_interface(Qt5::Widgets "jpeg")
+    _hunter_plugin_add_interface(Qt5::Widgets "png")
+    _hunter_plugin_add_interface(Qt5::Widgets "icuuc")
+
+    # defined: `ucal_close_52`
+    _hunter_plugin_add_interface(Qt5::Widgets "icui18n")
+
     # libs should be set before libQt5PlatformSupport
     # defined: QPlatformMenuItem::activated()
     # (depends on z, libqtharfbuzzng, GL)


Improvements for nativesdk

Improvements for nativesdk

--- host-tools/CommonAPICodeGenFrameworkConfig.cmake
+++ host-tools/CommonAPICodeGenFrameworkConfig.cmake
@@ -1,6 +1,15 @@

 set(LOCAL_MAVEN_REPOSITORY_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/MavenRepo)
-set(SHARED_MAVEN_REPOSITORIES_LOCATION ${CMAKE_INSTALL_PREFIX}/include/MavenRepositories)
+
+set(MAVEN_REPOSITORY_INSTALLATION_LOCATION include/MavenRepositories)
+
+if(NOT DEFINED MAVEN_REPOSITORIES_LOCATION)
+	set(SOURCE_SHARED_MAVEN_REPOSITORIES_LOCATION ${CMAKE_INSTALL_PREFIX}/${MAVEN_REPOSITORY_INSTALLATION_LOCATION})
+else()
+	set(SOURCE_SHARED_MAVEN_REPOSITORIES_LOCATION ${MAVEN_REPOSITORIES_LOCATION})
+endif()
+
+message("Maven repository from other packages located in : ${SOURCE_SHARED_MAVEN_REPOSITORIES_LOCATION}")

 set(MAVEN_OPTIONS "-Dmaven.repo.local=${LOCAL_MAVEN_REPOSITORY_LOCATION}")

@@ -8,12 +17,12 @@

 macro(import_maven_repository PACKAGE_NAME)
     execute_process(
-    	COMMAND cp -r ${SHARED_MAVEN_REPOSITORIES_LOCATION}/${PACKAGE_NAME} ${LOCAL_MAVEN_REPOSITORY_LOCATION}
+    	COMMAND cp -r ${SOURCE_SHARED_MAVEN_REPOSITORIES_LOCATION}/${PACKAGE_NAME} ${LOCAL_MAVEN_REPOSITORY_LOCATION}
     )
 endmacro()

 macro(export_maven_repository PACKAGE_NAME)
-    install(DIRECTORY ${LOCAL_MAVEN_REPOSITORY_LOCATION}/ DESTINATION ${SHARED_MAVEN_REPOSITORIES_LOCATION}/${PACKAGE_NAME})
+    install(DIRECTORY ${LOCAL_MAVEN_REPOSITORY_LOCATION}/ DESTINATION ${MAVEN_REPOSITORY_INSTALLATION_LOCATION}/${PACKAGE_NAME})
 endmacro()

 macro(add_maven_package PACKAGE_NAME PACKAGE_PATH DEPENDENCIES)


Add CHECK_PATH for project_git_clone_3rd_party

--- project/cmake/modules/ProjectBuildTools.cmake
+++ project/cmake/modules/ProjectBuildTools.cmake
@@ -253,7 +253,7 @@
     if (CMAKE_VERSION VERSION_LESS_EQUAL "3.4")
         include(CMakeParseArguments)
     endif ()
-    set(oneValueArgs URL WORKING_DIRECTORY REPO_DIRECTORY DEPTH BRANCH TAG)
+    set(oneValueArgs URL WORKING_DIRECTORY REPO_DIRECTORY DEPTH BRANCH TAG CHECK_PATH)
     cmake_parse_arguments(project_git_clone_3rd_party "" "${oneValueArgs}" "" ${ARGN} )

     if (NOT project_git_clone_3rd_party_URL)
@@ -264,6 +264,9 @@
     endif ()
     if (NOT project_git_clone_3rd_party_WORKING_DIRECTORY)
         get_filename_component(project_git_clone_3rd_party_WORKING_DIRECTORY ${project_git_clone_3rd_party_REPO_DIRECTORY} DIRECTORY)
+    endif ()
+    if (NOT project_git_clone_3rd_party_CHECK_PATH)
+        set (project_git_clone_3rd_party_CHECK_PATH ".git")
     endif ()
     unset (CLONE_OPTIONS)
     unset (UPDATE_OPTIONS)
@@ -287,7 +290,7 @@
     if (NOT GIT_FOUND AND NOT Git_FOUND)
         message(FATAL_ERROR "git not found")
     endif ()
-    if(NOT EXISTS "${project_git_clone_3rd_party_REPO_DIRECTORY}/.git")
+    if(NOT EXISTS "${project_git_clone_3rd_party_REPO_DIRECTORY}/${project_git_clone_3rd_party_CHECK_PATH}")
         if (EXISTS ${project_git_clone_3rd_party_REPO_DIRECTORY})
             file(REMOVE_RECURSE ${project_git_clone_3rd_party_REPO_DIRECTORY})
         endif ()


Fix essential MSI naming.

Fix essential MSI naming.

--- packaging/WiX/CPackWixConfig.cmake
+++ packaging/WiX/CPackWixConfig.cmake
@@ -4,7 +4,7 @@
  SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")
  SET(CPACK_WIX_UI "WixUI_InstallDir")
  MATH(EXPR bits ${CMAKE_SIZEOF_VOID_P}*8)
- SET(CPACK_PACKAGE_FILE_NAME  "mysql-essentials-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}-win${bits}")
+ SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-win${bits}")
 ELSE()
   SET(CPACK_COMPONENTS_USED
     "Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts")


New version: 0.4.14

New version: 0.4.14

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "13")
+SET(HAWKEY_PATCH "14")


- seems like 0.10.13 is already out

- seems like 0.10.13 is already out

--- VERSION.cmake
+++ VERSION.cmake
@@ -46,6 +46,6 @@

 SET(LIBSATSOLVER_MAJOR "0")
 SET(LIBSATSOLVER_MINOR "10")
-SET(LIBSATSOLVER_PATCH "13")
+SET(LIBSATSOLVER_PATCH "14")

-# last released 0.10.11
+# last released 0.10.13


fixed installation of workspace marker (really...)

--- cmake/catkin_generate_environment.cmake
+++ cmake/catkin_generate_environment.cmake
@@ -46,7 +46,7 @@
   if(NOT CATKIN_BUILD_BINARY_PACKAGE OR "${PROJECT_NAME}" STREQUAL "catkin")
     # install workspace marker
     install(FILES
-      ${CMAKE_INSTALL_PREFIX}/CATKIN_WORKSPACE
+      ${catkin_BUILD_PREFIX}/CATKIN_WORKSPACE
       DESTINATION ${CMAKE_INSTALL_PREFIX})
     # install setup.py
     install(PROGRAMS


Fix a little mistakes on compiler flag construction for MSVC and Clang

--- templates/CMake/cpp.cmake
+++ templates/CMake/cpp.cmake
@@ -8,23 +8,36 @@
 set(CMAKE_CXX_STANDARD 14)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
+
+
+# C Compiler Version Requirements
+if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+  if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+    message(FATAL_ERROR "GCC version must be at least 4.4!")
+  endif()
+elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+  if(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.1)
+    message(FATAL_ERROR "Clang version must be at least 3.1!")
+  endif()
+endif()
+
+# C++ Compiler Version Requirements
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
+    message(FATAL_ERROR "GCC version must be at least 4.4!")
+  endif()
+elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
+    message(FATAL_ERROR "Clang version must be at least 3.1!")
+  endif()
+endif()
+

 set(DEFAULT_BUILD_TYPE "Release")
 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
   set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE)
   set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
-endif()
-
-# Version Requirements
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
-    message(FATAL_ERROR "GCC version must be at least 4.4!")
-  endif()
-elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
-    message(FATAL_ERROR "Clang version must be at least 3.1!")
-  endif()
 endif()

@@ -67,7 +80,7 @@
       TARGET_FLAG
       C_FLAGS
       CXX_FLAGS)
-    if(C_FLAGS MATCHES "/W[0-4]")
+    if(TARGET_FLAG MATCHES "/W[0-4]")
       string(REGEX REPLACE "/W[0-4]" "/W4" ${TARGET_FLAG} "${${TARGET_FLAG}}")
     else()
       set("${TARGET_FLAG}" "${${TARGET_FLAG}} /W4")
@@ -369,7 +382,7 @@
       set(CXX_FLAGS_RELEASE "${CXX_FLAGS_RELEASE} -mtune=native -march=native")
       set(CXX_FLAGS_MINSIZEREL "${CXX_FLAGS_MINSIZEREL} -mtune=native -march=native")
     endif()
-  elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+  elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     set(CXX_WARNING_FLAGS "${CLANG_COMMON_WARNING_FLAGS}")
     foreach(WARNING_FLAG
         -Wc++11-compat


Added rmat.cpp and media.cpp to files being built in standalone

--- modules/gapi/cmake/standalone.cmake
+++ modules/gapi/cmake/standalone.cmake
@@ -15,6 +15,8 @@
                          "${FLUID_ROOT}/include/opencv2/gapi/own/*.hpp"
                          "${FLUID_ROOT}/include/opencv2/gapi/fluid/*.hpp")
 file(GLOB FLUID_sources  "${FLUID_ROOT}/src/api/g*.cpp"
+                         "${FLUID_ROOT}/src/api/rmat.cpp"
+                         "${FLUID_ROOT}/src/api/media.cpp"
                          "${FLUID_ROOT}/src/compiler/*.cpp"
                          "${FLUID_ROOT}/src/compiler/passes/*.cpp"
                          "${FLUID_ROOT}/src/executor/*.cpp"


hdf5.cmake: Fix typo cmake option: -DHDF5_BUILD_CPP_LIB

--- hdf5.cmake
+++ hdf5.cmake
@@ -35,7 +35,7 @@
         -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR}
         -DCMAKE_PREFIX_PATH=${BUILDEM_DIR}
         -DHDF5_BUILD_HL_LIB=ON
-        -DHDF_BUILD_CPP_LIB=ON
+        -DHDF5_BUILD_CPP_LIB=ON
         -DBUILD_SHARED_LIBS=ON
         -DHDF5_ENABLE_Z_LIB_SUPPORT=ON
 #        -DBUILD_TESTING=ON


Revert "Revert "[cmake] change Eigen discovery""

This reverts commit 2e8a29f9f02fae28920147e17fc0406a57ca8524
and should work now since we're shipping the FindEigen3
script that's apparently missing from some current
cmake distributions

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -113,15 +113,13 @@
 	list(APPEND DUNE_DEFAULT_LIBS ${BLAS_LIBRARIES})
 endif(HAVE_BLAS)

-pkg_check_modules(EIGEN eigen3)
-set(CMAKE_REQUIRED_INCLUDES ${EIGEN_INCLUDE_DIRS})
-check_include_file_cxx("Eigen/SparseLU" HAVE_EIGEN_SPARSE)
-if(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)
-  include_directories(${EIGEN_INCLUDE_DIRS})
+find_package(Eigen3 3.2.0)
+if(EIGEN3_FOUND)
+  include_directories(${EIGEN3_INCLUDE_DIR})
   set(HAVE_EIGEN 1)
-else(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)
+else(EIGEN3_FOUND)
   set(HAVE_EIGEN 0)
-endif(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)
+endif(EIGEN3_FOUND)

 pkg_check_modules(LIBAMA libama)
 if(LIBAMA_FOUND)


Made binding compilation less verbose

Made binding compilation less verbose

--- modules/matlab/compile.cmake
+++ modules/matlab/compile.cmake
@@ -20,6 +20,9 @@
     return()
 endif()

+# -----------------------------------------------------------------------------
+# Compile
+# -----------------------------------------------------------------------------
 # for each generated source file:
 # 1. check if the file has already been compiled
 # 2. attempt compile if required
@@ -29,7 +32,6 @@
     # strip out the filename
     get_filename_component(FILENAME ${SOURCE_FILE} NAME_WE)
     # compile the source file using mex
-    execute_process(COMMAND echo ${FILENAME})
     if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/+cv/${FILENAME}.${MATLAB_MEXEXT})
         execute_process(
             COMMAND ${MATLAB_MEX_SCRIPT} ${MEX_OPTS} "CXXFLAGS=\$CXXFLAGS ${MEX_CXXFLAGS}" ${MEX_INCLUDE_DIRS_LIST}
@@ -40,6 +42,7 @@
         )
     endif()
     # TODO: If a mex file fails to compile, should we error out?
+    # TODO: Warnings are currently treated as errors...
     if (FAILED)
         message(FATAL_ERROR "Failed to compile ${FILENAME}: ${FAILED}")
     endif()


Djinni now outputs Java or Objective-C bindings only when it is used

--- cmake/include/AnimusDjinni.cmake
+++ cmake/include/AnimusDjinni.cmake
@@ -3,12 +3,17 @@
    set(DJINNI_WITH_JNI ${ANIMUS_WITH_JNI} CACHE BOOL "Build Djinni with JNI support")
    set(DJINNI_STATIC_LIB ON CACHE BOOL "Build Djinni support library as a static library instead of dynamic")
    add_subdirectory(${ANIMUS_DEPS_DIR}/djinni)
-   set(DJINNI_COMMAND ${DJINNI_RUN_PATH}
-      --cpp-out ${ANIMUS_INTERFACE_DIR}
-      --java-out ${ANIMUS_JAVA_DIR}
-      --jni-out ${ANIMUS_JNI_DIR}
-      --objc-out ${ANIMUS_OBJC_DIR}
-      --objcpp-out ${ANIMUS_OBJC_DIR}
+   list(APPEND DJINNI_COMMAND ${DJINNI_RUN_PATH} --cpp-out ${ANIMUS_INTERFACE_DIR})
+   if (DJINNI_WITH_JNI)
+      list(APPEND DJINNI_COMMAND --java-out ${ANIMUS_JAVA_DIR} --jni-out ${ANIMUS_JNI_DIR})
+   endif()
+   if (DJINNI_WITH_OBJC)
+      list(APPEND DJINNI_COMMAND --objc-out ${ANIMUS_OBJC_DIR} --objcpp-out ${ANIMUS_OBJC_DIR})
+   endif()
+   if (ANIMUS_OBJC_TYPE_PREFIX)
+      list(APPEND DJINNI_COMMAND --objc-type-prefix "${ANIMUS_OBJC_TYPE_PREFIX}")
+   endif()
+   list(APPEND DJINNI_COMMAND
       --objcpp-include-cpp-prefix interface/
       --jni-include-cpp-prefix interface/
       --cpp-optional-header "\"<experimental/optional>\""
@@ -16,7 +21,6 @@
       --cpp-namespace ${ANIMUS_CPP_NAMESPACE}
       --java-package ${ANIMUS_JAVA_PACKAGE}
       --jni-namespace ${ANIMUS_JNI_NAMESPACE}
-#      --objc-type-prefix "${ANIMUS_OBJC_TYPE_PREFIX}"
       --objcpp-namespace ${ANIMUS_OBJCPP_NAMESPACE}
       --ident-cpp-enum ${ANIMUS_IDENT_CPP_ENUM}
       --ident-cpp-field ${ANIMUS_IDENT_CPP_FIELD}


build: parallelise build

build: parallelise build

Enable parallel compilation when building Foundation.  We were
previously building Foundation in single threaded mode.  This should
significantly improve builds.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -1,5 +1,6 @@

 include(CMakeParseArguments)
+include(ProcessorCount)

 # Creates an output file map give a target and its list of sources at
 # output_path
@@ -43,6 +44,10 @@
   set(link_flags)

   list(APPEND compile_flags -incremental)
+  ProcessorCount(CPU_COUNT)
+  if(NOT CPU_COUNT EQUAL 0)
+    list(APPEND compile_flags -j;${CPU_COUNT})
+  endif()
   if(AST_TARGET)
     list(APPEND compile_flags -target;${AST_TARGET})
     list(APPEND link_flags -target;${AST_TARGET})


Fix GCC8 issue

Fix GCC8 issue

--- cmake/multiarch_popcnt_bmi.cmake
+++ cmake/multiarch_popcnt_bmi.cmake
@@ -13,9 +13,11 @@
         Error: multiarch_popcnt_bmi not needed!
     #endif
     #if defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)
-        #if __GNUC__ <= 5
-            Error: The linker does not support function multiversioning
-                   for shared libraries.
+        #if __GNUC__ <= 8
+            Error: The GCC5 linker does not support function
+                   multiversioning for shared libraries.
+                   GCC6, GCC7 & GCC8 may cause duplicate symbol
+                   definitions in debug builds.
         #endif
     #endif


Add HDF5 dependency to the Fermi module.

--- inviwo/modules/fermi/depends.cmake
+++ inviwo/modules/fermi/depends.cmake
@@ -2,6 +2,5 @@
 # Dependencies for current module
 # List modules on the format "Inviwo<ModuleName>Module"
 set(dependencies
-    #InviwoOpenGLModule
-    #InviwoBaseGLModule
+    InviwoHDF5Module
 )


Make CMake find/link assimp and bullet better under linux.

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -457,41 +457,50 @@
 endmacro()

 macro(use_package_bullet)
-    if ("$ENV{BULLET_DIR}" STREQUAL "")
-       if (WIN32)
-          set(BULLET_DIR ${ENV_NAALI_DEP_PATH}/Bullet)
-	  include_directories(${BULLET_DIR}/include)
-	  include_directories(${BULLET_DIR}/include/ConvexDecomposition)
-	  link_directories(${BULLET_DIR}/lib)
-       else() # todo: This should be temporary? Always just use the above directory.
-          set(BULLET_DIR ${ENV_NAALI_DEP_PATH})
-	  include_directories(${BULLET_DIR}/include/bullet)
-	  include_directories(${BULLET_DIR}/include/bullet/ConvexDecomposition)
-	  link_directories(${BULLET_DIR}/lib)
-       endif()
-    else()
-       set(BULLET_DIR $ENV{BULLET_DIR})
-       include_directories(${BULLET_DIR}/include)
-       include_directories(${BULLET_DIR}/include/ConvexDecomposition)
-       link_directories(${BULLET_DIR}/lib)
+    if (WIN32)
+        if ("$ENV{BULLET_DIR}" STREQUAL "")
+            set(BULLET_DIR ${ENV_NAALI_DEP_PATH}/Bullet)
+        endif()
+        include_directories(${BULLET_DIR}/include)
+        include_directories(${BULLET_DIR}/include/ConvexDecomposition)
+        link_directories(${BULLET_DIR}/lib)
+    else() # Linux, note: mac will also come here..
+        if ("$ENV{BULLET_DIR}" STREQUAL "")
+            set(BULLET_DIR ${ENV_NAALI_DEP_PATH})
+        endif()
+        include_directories(${BULLET_DIR}/include/bullet)
+        include_directories(${BULLET_DIR}/include/bullet/ConvexDecomposition)
+        link_directories(${BULLET_DIR}/lib)
     endif()
 endmacro()

 macro(link_package_bullet)
-    target_link_libraries(${TARGET_NAME} debug LinearMath_d debug BulletDynamics_d debug BulletCollision_d debug ConvexDecomposition_d)
     target_link_libraries(${TARGET_NAME} optimized LinearMath optimized BulletDynamics optimized BulletCollision optimized ConvexDecomposition)
+    if (WIN32)
+        target_link_libraries(${TARGET_NAME} debug LinearMath_d debug BulletDynamics_d debug BulletCollision_d debug ConvexDecomposition_d)
+    endif()
 endmacro()

 macro(use_package_assimp)
-    if ("$ENV{ASSIMP_DIR}" STREQUAL "")
-       set(ASSIMP_DIR ${ENV_NAALI_DEP_PATH}/assimp)
-    endif()
-    include_directories(${ASSIMP_DIR}/include)
-    link_directories(${ASSIMP_DIR}/lib/assimp_debug_Win32)
-	link_directories(${ASSIMP_DIR}/lib/assimp_release_Win32)
+    if (WIN32)
+        if ("$ENV{ASSIMP_DIR}" STREQUAL "")
+           set(ASSIMP_DIR ${ENV_NAALI_DEP_PATH}/assimp)
+        endif()
+        include_directories(${ASSIMP_DIR}/include)
+        link_directories(${ASSIMP_DIR}/lib/assimp_debug_Win32)
+        link_directories(${ASSIMP_DIR}/lib/assimp_release_Win32)
+    else() # Linux, note: mac will also come here..
+        if ("$ENV{ASSIMP_DIR}" STREQUAL "")
+           set(ASSIMP_DIR ${ENV_NAALI_DEP_PATH})
+        endif()
+        include_directories(${ASSIMP_DIR}/include/assimp)
+        link_directories(${ASSIMP_DIR}/lib)
+    endif()
 endmacro()

 macro(link_package_assimp)
-    target_link_libraries(${TARGET_NAME} debug assimpd)
     target_link_libraries(${TARGET_NAME} optimized assimp)
-endmacro()
+    if (WIN32)
+        target_link_libraries(${TARGET_NAME} debug assimpd)
+    endif()
+endmacro()


Add comment about OpenSSL cmake problem.

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -370,6 +370,8 @@
 endmacro (configure_mumbleclient)

 macro (configure_openssl)
+	# NOTE: This doesn't work with CMake 2.8 Windows version
+	#       CMake 2.6 must be used
     sagase_configure_package(OPENSSL
         NAMES openssl
         COMPONENTS libeay32 ssleay32 ssl


Add test to the application package

Add test to the application package

--- BdeBuildSystem/BdeTargetUtils.cmake
+++ BdeBuildSystem/BdeTargetUtils.cmake
@@ -540,7 +540,11 @@

         # Set up tests and link against the private library
         if (NOT _SKIP_TESTS)
-            bbs_configure_target_tests(${lib_target})
+            bbs_configure_target_tests(${lib_target}
+                                       SOURCES    ${${uor_name}_TEST_SOURCES}
+                                       TEST_DEPS  ${${uor_name}_PCDEPS}
+                                                  ${${uor_name}_TEST_PCDEPS}
+                                       LABELS     "all" ${target})
         endif()
     else()
         # Not a library or an application


[gardening] break long comment lines (#38444)

Takes review feedback from #38415

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -2061,7 +2061,8 @@
         # CMAKE_OSX_ARCHITECTURES to ensure that CMake would
         # not add the -arch flag
         # This is no longer the case when running on Apple Silicon,
-        # when CMake will enforce a default (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)
+        # when CMake will enforce a default (see
+        # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)
         set_property(TARGET ${VARIANT_NAME} PROPERTY OSX_ARCHITECTURES "${arch}")
       endif()
     endforeach()
@@ -2506,7 +2507,8 @@
         # CMAKE_OSX_ARCHITECTURES to ensure that CMake would
         # not add the -arch flag
         # This is no longer the case when running on Apple Silicon,
-        # when CMake will enforce a default (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)
+        # when CMake will enforce a default (see
+        # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)
         set_property(TARGET ${VARIANT_NAME} PROPERTY OSX_ARCHITECTURES "${arch}")

         add_custom_command_target(unused_var2


build: remove `LLVM_LINK_COMPONENTS` in the standard library (NFC)

The standard library does not use the LLVM components.  Remove the
unused parameter support.

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -518,7 +518,6 @@
 #     [LINK_LIBRARIES dep1 ...]
 #     [FRAMEWORK_DEPENDS dep1 ...]
 #     [FRAMEWORK_DEPENDS_WEAK dep1 ...]
-#     [LLVM_LINK_COMPONENTS comp1 ...]
 #     [C_COMPILE_FLAGS flag1...]
 #     [SWIFT_COMPILE_FLAGS flag1...]
 #     [LINK_FLAGS flag1...]
@@ -563,9 +562,6 @@
 #
 # FRAMEWORK_DEPENDS_WEAK
 #   System frameworks this library depends on that should be weakly-linked.
-#
-# LLVM_LINK_COMPONENTS
-#   LLVM components this library depends on.
 #
 # C_COMPILE_FLAGS
 #   Extra compile flags (C, C++, ObjC).
@@ -633,7 +629,6 @@
         INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
         LINK_FLAGS
         LINK_LIBRARIES
-        LLVM_LINK_COMPONENTS
         PRIVATE_LINK_LIBRARIES
         SWIFT_COMPILE_FLAGS
         MODULE_TARGETS)
@@ -1093,11 +1088,6 @@
     endforeach()
   endforeach()

-  if(NOT SWIFTLIB_SINGLE_TARGET_LIBRARY)
-    # Call llvm_config() only for libraries that are part of the compiler.
-    swift_common_llvm_config("${target}" ${SWIFTLIB_SINGLE_LLVM_LINK_COMPONENTS})
-  endif()
-
   # Collect compile and link flags for the static and non-static targets.
   # Don't set PROPERTY COMPILE_FLAGS or LINK_FLAGS directly.
   set(c_compile_flags ${SWIFTLIB_SINGLE_C_COMPILE_FLAGS})
@@ -1353,7 +1343,6 @@
 #     [SWIFT_MODULE_DEPENDS dep1 ...]
 #     [FRAMEWORK_DEPENDS dep1 ...]
 #     [FRAMEWORK_DEPENDS_WEAK dep1 ...]
-#     [LLVM_LINK_COMPONENTS comp1 ...]
 #     [FILE_DEPENDS target1 ...]
 #     [TARGET_SDKS sdk1...]
 #     [C_COMPILE_FLAGS flag1...]
@@ -1431,9 +1420,6 @@
 #
 # FRAMEWORK_DEPENDS_WEAK
 #   System frameworks this library depends on that should be weak-linked
-#
-# LLVM_LINK_COMPONENTS
-#   LLVM components this library depends on.
 #
 # FILE_DEPENDS
 #   Additional files this library depends on.
@@ -1525,7 +1511,6 @@
         INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
         LINK_FLAGS
         LINK_LIBRARIES
-        LLVM_LINK_COMPONENTS
         PRIVATE_LINK_LIBRARIES
         SWIFT_COMPILE_FLAGS
         SWIFT_COMPILE_FLAGS_IOS
@@ -1943,7 +1928,6 @@
         LINK_LIBRARIES ${swiftlib_link_libraries}
         FRAMEWORK_DEPENDS ${swiftlib_framework_depends_flattened}
         FRAMEWORK_DEPENDS_WEAK ${SWIFTLIB_FRAMEWORK_DEPENDS_WEAK}
-        LLVM_LINK_COMPONENTS ${SWIFTLIB_LLVM_LINK_COMPONENTS}
         FILE_DEPENDS ${SWIFTLIB_FILE_DEPENDS} ${swiftlib_module_dependency_targets}
         C_COMPILE_FLAGS ${swiftlib_c_compile_flags_all}
         SWIFT_COMPILE_FLAGS ${swiftlib_swift_compile_flags_all} ${swiftlib_swift_compile_flags_arch} ${swiftlib_swift_compile_private_frameworks_flag}
@@ -2267,8 +2251,7 @@
     SDK)
   set(multiple_parameter_options
     COMPILE_FLAGS
-    DEPENDS
-    LLVM_LINK_COMPONENTS)
+    DEPENDS)
   cmake_parse_arguments(SWIFTEXE_SINGLE
     "${options}"
     "${single_parameter_options}"
@@ -2373,8 +2356,6 @@
       BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
       LIBRARY_DIR ${SWIFT_LIBRARY_OUTPUT_INTDIR})

-  swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_LLVM_LINK_COMPONENTS})
-
   # NOTE(compnerd) use the C linker language to invoke `clang` rather than
   # `clang++` as we explicitly link against the C++ runtime.  We were previously
   # actually passing `-nostdlib++` to avoid the C++ runtime linkage.
@@ -2398,7 +2379,7 @@
   cmake_parse_arguments(SWIFTEXE_TARGET
     "EXCLUDE_FROM_ALL;;BUILD_WITH_STDLIB"
     ""
-    "DEPENDS;LLVM_LINK_COMPONENTS;LINK_LIBRARIES"
+    "DEPENDS;LINK_LIBRARIES"
     ${ARGN})

   set(SWIFTEXE_TARGET_SOURCES ${SWIFTEXE_TARGET_UNPARSED_ARGUMENTS})
@@ -2431,7 +2412,6 @@
           ${VARIANT_NAME}
           ${SWIFTEXE_TARGET_SOURCES}
           DEPENDS ${SWIFTEXE_TARGET_DEPENDS_with_suffix}
-          LLVM_LINK_COMPONENTS ${SWIFTEXE_TARGET_LLVM_LINK_COMPONENTS}
           SDK "${sdk}"
           ARCHITECTURE "${arch}")


source not copied to build

source not copied to build

--- CMake/External_proj4.cmake
+++ CMake/External_proj4.cmake
@@ -35,17 +35,13 @@
       SOURCE_DIR ${proj}/_install
       BINARY_DIR ${PROJ_SB_BUILD_DIR}
       INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
-    CMAKE_CACHE_ARGS
-      -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
-      -DCMAKE_BUILD_TYPE:STRING=Release
-      -DPROJ4_BUILD_DIR:STRING=${PROJ_SB_SRC}/src
+      CMAKE_CACHE_ARGS
+        -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
+        -DCMAKE_BUILD_TYPE:STRING=Release
+        -DPROJ4_BUILD_DIR:STRING=${PROJ_SB_BUILD_DIR}/src
       DEPENDS ${proj}_build
       CMAKE_COMMAND
     )
-
-
-
-

     ExternalProject_Add_Step(${proj}_build copy_source
       COMMAND ${CMAKE_COMMAND} -E copy_directory
@@ -69,14 +65,14 @@
       BUILD_COMMAND $(MAKE)
       INSTALL_COMMAND $(MAKE) install
     )
-
+
     ExternalProject_Add_Step(${proj} copy_source
       COMMAND ${CMAKE_COMMAND} -E copy_directory
         ${PROJ_SB_SRC} ${PROJ_SB_BUILD_DIR}
       DEPENDEES patch update
       DEPENDERS configure
-    )
-
+    )
   endif()
+
   message(STATUS "  Using Proj4 SuperBuild version")
 endif()


CMake: update FeatureSummary

CMake: update FeatureSummary

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -69,6 +69,9 @@
 if (OGRE_BUILD_PLUGIN_OCTREE)
 	set(_plugins "${_plugins}  + Octree scene manager\n")
 endif ()
+if(OGRE_BUILD_PLUGIN_EXRCODEC)
+	set(_plugins "${_plugins}  + OpenEXR image codec\n")
+endif()
 if (OGRE_BUILD_PLUGIN_PCZ)
 	set(_plugins "${_plugins}  + Portal connected zone scene manager\n")
 endif ()
@@ -150,14 +153,11 @@
 if (OGRE_CONFIG_ENABLE_GLES2_CG_SUPPORT)
 	set(_core "${_core}  + Cg for OpenGL ES 2.0\n")
 endif ()
-if (OGRE_CONFIG_ENABLE_GLES2_VAO_SUPPORT)
-	set(_core "${_core}  + VertexArrayObjects for OpenGL ES 2.0\n")
-endif ()
 if (OGRE_CONFIG_ENABLE_GL_STATE_CACHE_SUPPORT)
 	set(_core "${_core}  + StateCacheManager for OpenGL\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_GLES3_SUPPORT)
-	set(_core "${_core}  + OpenGL ES 3.0 Support (EXPERIMENTAL)\n")
+	set(_core "${_core}  + OpenGL ES 3.0 Support [BETA]\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_QUAD_BUFFER_STEREO)
 	set(_core "${_core}  + Quad Buffer Stereo Technology (EXPERIMENTAL)\n")


BUG: Mantis-856: Fix MuParser import script and enhance documentation

--- CMake/ImportMuParser.cmake
+++ CMake/ImportMuParser.cmake
@@ -1,11 +1,14 @@
 message(STATUS "Importing MuParser...")
+find_package(MuParser)

-option(OTB_USE_EXTERNAL_MUPARSER "Use external MuParser library." ON)
+if(MUPARSER_FOUND)
+  option(OTB_USE_EXTERNAL_MUPARSER "Use external MuParser library." ON)
+else()
+  option(OTB_USE_EXTERNAL_MUPARSER "Use external MuParser library." OFF)
+endif()
 mark_as_advanced(OTB_USE_EXTERNAL_MUPARSER)

 if(OTB_USE_EXTERNAL_MUPARSER)
-  find_package(MuParser)
-
   if(MUPARSER_FOUND)
     # Starting with muparser 2.0.0,
     #  intrinsic operators "and", "or", "xor" have been removed
@@ -26,18 +29,23 @@
     unset(CMAKE_REQUIRED_DEFINES)

     if(OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS)
-      message(STATUS "  Testing if muParser has '&&' operator -- yes")
+      message(STATUS "  MuParser version is >= 2.0.0 : "
+                     "uses '&&' and '||' logical operators, and C++ like "
+                     "ternary if-then-else operator")
     else()
-      message(STATUS "  Testing if muParser has '&&' operator -- no")
+      message(STATUS "  MuParser version is < 2.0.0  : "
+                     "uses 'and' and 'or' logical operators, and ternary "
+                     "operator 'if( ; ; )'")
     endif()
   else()
-    message(FATAL_ERROR "Can't build OTB without MuParser. Instal MuParser on your system, or disable the option OTB_USE_EXTERNAL_MUPARSER")
+    message(FATAL_ERROR "Can't build OTB without MuParser. Instal it "
+                        "on your system, or disable the option "
+                        "OTB_USE_EXTERNAL_MUPARSER to use internal one")
   endif()
-
 else()
-
   set(MUPARSER_LIBRARIES otbmuparser)
   unset(OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS) # internal version is < 2.0.0
-  message(STATUS "  Using MuParser internal version (no '&&' operator)")
+  message(STATUS "  Using MuParser internal version : uses 'and' and 'or' "
+                 "logical operators, and ternary operator 'if( ; ; )' ")
 endif()


Remove empty build command and set install command empty. Thus is cannot happen that the dcmtk libraries are installed to some unintended location. Setting dcmtk_dir to dcmtk-build directory

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -52,7 +52,7 @@
     BINARY_DIR ${proj}-build
     PREFIX ${proj}${ep_suffix}
     ${location_args}
-    BUILD_COMMAND ""
+    INSTALL_COMMAND ""
     CMAKE_ARGS
       -DDCMTK_INSTALL_BINDIR:STRING=bin/${CMAKE_CFG_INTDIR}
       -DDCMTK_INSTALL_LIBDIR:STRING=lib/${CMAKE_CFG_INTDIR}
@@ -72,7 +72,7 @@
     DEPENDS
       ${${proj}_DEPENDENCIES}
     )
-  set(DCMTK_DIR ${ep_install_dir})
+  set(DCMTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build)

 else()
   ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})


findovr should look for release library, not just debug library

--- CMakeModules/FindOVR.cmake
+++ CMakeModules/FindOVR.cmake
@@ -5,9 +5,11 @@
 set(CMAKE_INCLUDE_PATH "/home/campus11/kuhl/public-cs4611/ovr_sdk_linux_0.4.4/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
 set(CMAKE_INCLUDE_PATH "/home/campus11/kuhl/public-cs4611/ovr_sdk_linux_0.4.4/LibOVR/Src" ${CMAKE_INCLUDE_PATH})
 # Installed in this directory's parent directory
+set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Release" ${CMAKE_LIBRARY_PATH})
 set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Debug" ${CMAKE_LIBRARY_PATH})
 set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
 set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Src" ${CMAKE_INCLUDE_PATH})
+
 set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.4.4/LibOVR/Lib/Linux/Release/x86_64" ${CMAKE_LIBRARY_PATH})
 set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.4.4/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
 set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.4.4/LibOVR/Src" ${CMAKE_INCLUDE_PATH})


Document satsolver versions of various distributions


ENH: cmake: Update dcmqiBlockSetCMakeOSXVariables based on Slicer r23859

--- CMake/dcmqiBlockSetCMakeOSXVariables.cmake
+++ CMake/dcmqiBlockSetCMakeOSXVariables.cmake
@@ -1,14 +1,11 @@
-###########################################################################
+################################################################################
 #
-#  Library:   CTK
+#  Program: 3D Slicer
 #
 #  Copyright (c) Kitware Inc.
 #
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0.txt
+#  See COPYRIGHT.txt
+#  or http://www.slicer.org/copyright/copyright.txt for details.
 #
 #  Unless required by applicable law or agreed to in writing, software
 #  distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,7 +13,10 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #
-###########################################################################
+#  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
+#  and was partially funded by NIH grant 3P41RR013218-12S1
+#
+################################################################################

 #
 # dcmqiBlockSetCMakeOSXVariables
@@ -44,33 +44,53 @@
   #   8.x == Mac OSX 10.4 (Tiger)
   #   9.x == Mac OSX 10.5 (Leopard)
   #  10.x == Mac OSX 10.6 (Snow Leopard)
-  #  10.x == Mac OSX 10.7 (Lion)
+  #  11.x == Mac OSX 10.7 (Lion)
+  #  12.x == Mac OSX 10.8 (Mountain Lion)
+  #  13.x == Mac OSX 10.9 (Mavericks)
+  #  14.x == Mac OSX 10.10 (Yosemite)
   set(OSX_SDK_104_NAME "Tiger")
   set(OSX_SDK_105_NAME "Leopard")
   set(OSX_SDK_106_NAME "Snow Leopard")
   set(OSX_SDK_107_NAME "Lion")
+  set(OSX_SDK_108_NAME "Mountain Lion")
+  set(OSX_SDK_109_NAME "Mavericks")
+  set(OSX_SDK_1010_NAME "Yosemite")

   set(OSX_SDK_ROOTS
     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
     /Developer/SDKs
     )
-  set(SDK_VERSIONS_TO_CHECK 10.7 10.6 10.5)
-  foreach(SDK_VERSION ${SDK_VERSIONS_TO_CHECK})
-    if(NOT CMAKE_OSX_DEPLOYMENT_TARGET OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
-      foreach(SDK_ROOT ${OSX_SDK_ROOTS})
-        set(TEST_OSX_SYSROOT "${SDK_ROOT}/MacOSX${SDK_VERSION}.sdk")
-        if(EXISTS "${TEST_OSX_SYSROOT}")
-          # Retrieve OSX target name
+
+  # Explicitly set the OSX_SYSROOT to the latest one, as its required
+  #       when the OSX_DEPLOYMENT_TARGET is explicitly set
+  foreach(SDK_ROOT ${OSX_SDK_ROOTS})
+    if( "x${CMAKE_OSX_SYSROOT}x" STREQUAL "xx")
+      file(GLOB SDK_SYSROOTS "${SDK_ROOT}/MacOSX*.sdk")
+
+      if(NOT "x${SDK_SYSROOTS}x" STREQUAL "xx")
+        set(SDK_SYSROOT_NEWEST "")
+        set(SDK_VERSION "0")
+        # find the latest SDK
+        foreach(SDK_ROOT_I ${SDK_SYSROOTS})
+          # extract version from SDK
+          string(REGEX MATCH "MacOSX([0-9]+\\.[0-9]+)\\.sdk" _match "${SDK_ROOT_I}")
+          if("${CMAKE_MATCH_1}" VERSION_GREATER "${SDK_VERSION}")
+            set(SDK_SYSROOT_NEWEST "${SDK_ROOT_I}")
+            set(SDK_VERSION "${CMAKE_MATCH_1}")
+          endif()
+        endforeach()
+
+        if(NOT "x${SDK_SYSROOT_NEWEST}x" STREQUAL "xx")
           string(REPLACE "." "" sdk_version_no_dot ${SDK_VERSION})
           set(OSX_NAME ${OSX_SDK_${sdk_version_no_dot}_NAME})
           set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Force build for 64-bit ${OSX_NAME}." FORCE)
           set(CMAKE_OSX_DEPLOYMENT_TARGET "${SDK_VERSION}" CACHE STRING "Force build for 64-bit ${OSX_NAME}." FORCE)
-          set(CMAKE_OSX_SYSROOT "${TEST_OSX_SYSROOT}" CACHE PATH "Force build for 64-bit ${OSX_NAME}." FORCE)
+          set(CMAKE_OSX_SYSROOT "${SDK_SYSROOT_NEWEST}" CACHE PATH "Force build for 64-bit ${OSX_NAME}." FORCE)
           message(STATUS "Setting OSX_ARCHITECTURES to '${CMAKE_OSX_ARCHITECTURES}' as none was specified.")
-          message(STATUS "Setting OSX_DEPLOYMENT_TARGET to '${SDK_VERSION}' as none was specified.")
-          message(STATUS "Setting OSX_SYSROOT to '${TEST_OSX_SYSROOT}' as none was specified.")
+          message(STATUS "Setting OSX_DEPLOYMENT_TARGET to '${CMAKE_OSX_DEPLOYMENT_TARGET}' as none was specified.")
+          message(STATUS "Setting OSX_SYSROOT to latest '${CMAKE_OSX_SYSROOT}' as none was specified.")
         endif()
-      endforeach()
+      endif()
     endif()
   endforeach()

@@ -79,7 +99,4 @@
       message(FATAL_ERROR "error: CMAKE_OSX_SYSROOT='${CMAKE_OSX_SYSROOT}' does not exist")
     endif()
   endif()
-  mark_as_advanced( CMAKE_OSX_ARCHITECTURES )
-  mark_as_advanced( CMAKE_OSX_DEPLOYMENT_TARGET )
-  mark_as_advanced( CMAKE_OSX_SYSROOT )
 endif()


does not compile boost python

does not compile boost python

--- SuperBuild/External_Boost_configureboost.cmake
+++ SuperBuild/External_Boost_configureboost.cmake
@@ -23,7 +23,7 @@
     WORKING_DIRECTORY ${BUILD_DIR} RESULT_VARIABLE bootstrap_result)
 else(WIN32)
   execute_process(COMMAND ./bootstrap.sh --prefix=${BOOST_INSTALL_DIR}
-    --with-libraries=system,filesystem,thread,program_options,chrono,date_time,atomic,timer,regex,python
+    --with-libraries=system,filesystem,thread,program_options,chrono,date_time,atomic,timer,regex
     #--with-libraries=system,thread,program_options,log,math...
     #--without-libraries=atomic...


macro for binary targets

macro for binary targets

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -28,4 +28,27 @@
 		FILE( GLOB_RECURSE tmp_header "${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/${MODULE}/*.hh" )
 		LIST( APPEND DUNE_HEADERS ${tmp_header} )
 	ENDFOREACH(MODULE)
-ENDMACRO( ADD_DUNE_MODULES )+ENDMACRO( ADD_DUNE_MODULES )
+
+MACRO( ADD_DUNE_EXECUTABLE target sources headers libs )
+	ADD_EXECUTABLE(${target} ${sources} ${headers} ${DUNE_HEADERS} )
+	#for some $@#&& reason these targets DO NOT inherit flags added via TARGET_LINK_LIBRARIES nor INCLUDE_DIRECTORIES
+	#so we need some magic to readd them
+	foreach(arg ${MY_CXX_FLAGS} )
+		set(bar "${bar} ${arg}")
+	endforeach(arg ${MY_CXX_FLAGS} )
+	set_target_properties( ${target} PROPERTIES COMPILE_FLAGS  ${bar} )
+# 	get_target_property(tmp_flags ${target} LINK_FLAGS  )
+# 	if( NOT ${tmp_flags} )
+# 		set( tmp_flags "" )
+# 	endif( NOT ${tmp_flags} )
+# 	message(STATUS ${tmp_flags} )
+# 	set( tmp_flags "${bar} ${tmp_flags}" )
+# 	set_target_properties( ${target} PROPERTIES LINK_FLAGS  ${tmp_flags} )
+
+	add_dependencies( ${target} config_refresh )
+ENDMACRO( ADD_DUNE_EXECUTABLE )
+
+add_custom_target( config_refresh
+				${CMAKE_CURRENT_SOURCE_DIR}/cmake/regen_config_header.sh ${CMAKE_CURRENT_BINARY_DIR}/cmake_config.h
+				)


Still more explicit, and adapt to the style of other similar error
messages

svn path=/trunk/kdesupport/strigi/; revision=643054

--- cmake/FindBZip2.cmake
+++ cmake/FindBZip2.cmake
@@ -35,7 +35,7 @@
   ENDIF (NOT BZip2_FIND_QUIETLY)
 ELSE (BZIP2_FOUND)
   IF (BZip2_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR "Could NOT find BZip2 libraries")
+    MESSAGE(FATAL_ERROR "Could NOT find BZip2. Please install libbz2-dev")
   ENDIF (BZip2_FIND_REQUIRED)
 ENDIF (BZIP2_FOUND)


adjust to the new library naming scheme in iconv-1.12

svn path=/trunk/kdesupport/strigi/; revision=945003

--- cmake/FindIconv.cmake
+++ cmake/FindIconv.cmake
@@ -15,7 +15,7 @@

 FIND_PATH(ICONV_INCLUDE_DIR iconv.h)

-FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c)
+FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)

 IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
    SET(ICONV_FOUND TRUE)


Updated FindMySQL.cmake

Updated FindMySQL.cmake

--- cmake/FindMySQL.cmake
+++ cmake/FindMySQL.cmake
@@ -33,10 +33,10 @@
 			  "C:/Program Files/MySQL/MySQL Connector C 6.1/include"
 			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/MySQL Connector C 6.1/include"
 			  "$ENV{SYSTEMDRIVE}/MySQL/MySQL Connector C 6.1/include"
-#			  "C:/Program Files/MySQL/*/include"
-#			  "$ENV{PROGRAMFILES}/MySQL/*/include"
-#			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/*/include"
-#			  "$ENV{SYSTEMDRIVE}/MySQL/*/include"
+			  "$ENV{PROGRAMFILES}/MySQL/*/include"
+			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/*/include"
+			  "$ENV{SYSTEMDRIVE}/MySQL/*/include"
+			  "C:/Program Files/MySQL/*/include"
 			  )

 	find_path( MYSQL_LIBRARY_PATH
@@ -45,10 +45,10 @@
 			  "C:/Program Files/MySQL/MySQL Connector C 6.1/lib"
 			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/MySQL Connector C 6.1/lib"
 			  "$ENV{SYSTEMDRIVE}/MySQL/MySQL Connector C 6.1/lib"
-#			  "C:/Program Files/MySQL/*/lib"
-#			  "$ENV{PROGRAMFILES}/MySQL/*/lib"
-#			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/*/lib"
-#			  "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
+			  "$ENV{PROGRAMFILES}/MySQL/*/lib"
+			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/*/lib"
+			  "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
+			  "C:/Program Files/MySQL/*/lib"
 			  )

 	find_library( MYSQL_LIBRARY
@@ -57,10 +57,10 @@
 			  "C:/Program Files/MySQL/MySQL Connector C 6.1/lib"
 			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/MySQL Connector C 6.1/lib"
 			  "$ENV{SYSTEMDRIVE}/MySQL/MySQL Connector C 6.1/lib"
-#			  "C:/Program Files/MySQL/*/lib"
-#			  "$ENV{PROGRAMFILES}/MySQL/*/lib"
-#			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/*/lib"
-#			  "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
+			  "$ENV{PROGRAMFILES}/MySQL/*/lib"
+			  "$ENV{${BINDIR32_ENV_NAME}}/MySQL/*/lib"
+			  "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
+			  "C:/Program Files/MySQL/*/lib"
 			  )
 else()
 	find_path( MYSQL_INCLUDE_DIR


Fix cython compiled file dependency generation.

The CMake find_file command usually caches a file location so it can be set by
the user and so redundant searches do not occur.  However, if a file is found in
this case, we still want to perform the search every time.  So, we have to call
the CMake unset command on the variable used.

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -113,6 +113,7 @@

     # Determine dependencies.
     # Add the pxd file will the same name as the given pyx file.
+    unset( corresponding_pxd_file CACHE )
     find_file( corresponding_pxd_file ${pyx_file_basename}.pxd
       PATHS "${pyx_path}" ${cmake_include_directories}
       NO_DEFAULT_PATH )
@@ -135,6 +136,7 @@
         foreach( statement ${extern_from_statements} )
           # Had trouble getting the quote in the regex
           string( REGEX REPLACE "cdef[ ]+extern[ ]+from[ ]+[\"]([^\"]+)[\"].*" "\\1" header "${statement}" )
+          unset( header_location CACHE )
           find_file( header_location ${header} PATHS ${cmake_include_directories} )
           if( header_location )
             list( FIND c_header_dependencies "${header_location}" header_idx )
@@ -160,6 +162,7 @@
         list( REMOVE_DUPLICATES module_dependencies )
         # Add the module to the files to check, if appropriate.
         foreach( module ${module_dependencies} )
+          unset( pxd_location CACHE )
           find_file( pxd_location ${module}.pxd
             PATHS "${pyx_path}" ${cmake_include_directories} NO_DEFAULT_PATH )
           if( pxd_location )


fix build

fix build

--- cmake/XercesDLL.cmake
+++ cmake/XercesDLL.cmake
@@ -50,13 +50,18 @@
 endif()

 if(MSVC)
-  if(BUILD_SHARED_RUNTIME)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MD")
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELESE} /MD")
-  else()
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELESE} /MT")
+  if(NOT BUILD_SHARED_RUNTIME)
+    set(CompilerFlags
+            CMAKE_CXX_FLAGS
+            CMAKE_CXX_FLAGS_DEBUG
+            CMAKE_CXX_FLAGS_RELEASE
+            CMAKE_C_FLAGS
+            CMAKE_C_FLAGS_DEBUG
+            CMAKE_C_FLAGS_RELEASE
+            )
+    foreach(CompilerFlag ${CompilerFlags})
+      string(REPLACE "/MDd" "/MTd" ${CompilerFlag} "${${CompilerFlag}}")
+      string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
+    endforeach()
   endif()
-endif()+endif()


Build system changes for RISCV

Build system changes for RISCV

Summary: Build system changes for RISCV. Makes it possible to build just the RISCV target alone.

Reviewers: asb, apazos, mgrang, beanz

Reviewed By: asb

Subscribers: mgorny, kito-cheng, shiva0217, llvm-commits

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

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -441,6 +441,10 @@
   set(LLVM_NATIVE_ARCH WebAssembly)
 elseif (LLVM_NATIVE_ARCH MATCHES "wasm64")
   set(LLVM_NATIVE_ARCH WebAssembly)
+elseif (LLVM_NATIVE_ARCH MATCHES "riscv32")
+  set(LLVM_NATIVE_ARCH RISCV)
+elseif (LLVM_NATIVE_ARCH MATCHES "riscv64")
+  set(LLVM_NATIVE_ARCH RISCV)
 else ()
   message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
 endif ()


Remove clang-specific libxml2 check from CMake

clang's own CMake setup handles this as of r210308.

The CMAKE_CROSSCOMPILING special-case will no longer be hard-coded. This was
clearly site-specific to someone's local configuration and should be passed in
at configure time if needed with e.g. -DLIBXML2_LIBRARIES=... (the libxml2
target I tried here doesn't even support liblzma so it's *way* off).

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -297,25 +297,6 @@
 else()
   set(ENABLE_PIC 0)
 endif()
-
-find_package(LibXml2)
-if (LIBXML2_FOUND)
-  set(CLANG_HAVE_LIBXML 1)
-  # When cross-compiling, liblzma is not detected as a dependency for libxml2,
-  # which makes linking c-index-test fail. But for native builds, all libraries
-  # are installed and checked by CMake before Makefiles are generated and everything
-  # works according to the plan. However, if a -llzma is added to native builds,
-  # an additional requirement on the static liblzma.a is required, but will not
-  # be checked by CMake, breaking native compilation.
-  # Since this is only pertinent to cross-compilations, and there's no way CMake
-  # can check for every foreign library on every OS, we add the dep and warn the dev.
-  if ( CMAKE_CROSSCOMPILING )
-    if (NOT PC_LIBXML_VERSION VERSION_LESS "2.8.0")
-      message(STATUS "Adding LZMA as a dep to XML2 for cross-compilation, make sure liblzma.a is available.")
-      set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} "-llzma")
-    endif ()
-  endif ()
-endif ()

 check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)


PKG: include share/otb and share/proj in package

--- SuperBuild/CMake/PackageHelper.cmake
+++ SuperBuild/CMake/PackageHelper.cmake
@@ -196,6 +196,13 @@
   ####################### install OSSIM data ###########################
   install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/ossim DESTINATION ${PKG_SHARE_DEST_DIR})

+  ####################### install otb share ###########################
+  install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/otb DESTINATION ${PKG_SHARE_DEST_DIR})
+
+  ####################### install proj share ###########################
+  if(EXISTS ${PKG_SHARE_SOURCE_DIR}/proj)
+    install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/proj DESTINATION ${PKG_SHARE_DEST_DIR})
+  endif()

   ####################### Install otb applications ######################
   install(DIRECTORY "${OTB_APPLICATIONS_DIR}"  DESTINATION ${PKG_OTBLIBS_DIR})


BUG: CMAKE_CACHE_ARGS are forced and hence need explicit define for all variables

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -202,9 +202,9 @@
   -DOTB_WRAP_JAVA:BOOL=${OTB_WRAP_JAVA}
   -DGENERATE_PACKAGE:BOOL=OFF
   -DGENERATE_XDK:BOOL=OFF
-  ${OTB_SB_CONFIG}
   ${OTB_SB_LARGEINPUT_CONFIG}
   ${OTB_ADDITIONAL_CACHE}
+  CMAKE_ARGS ${OTB_SB_CONFIG}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND}
   )


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

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


Fix SVN revision.

Fix SVN revision.

--- util/CPMSVN.cmake
+++ util/CPMSVN.cmake
@@ -42,7 +42,7 @@
       OUTPUT_QUIET
       ERROR_QUIET)
     if (result)
-      set(msg "Command failed: ${result}. ")
+      set(msg "Command failed: ${result}. Repo ${repo}. ")
       set(msg "${msg} '${cmd}'")
       set(msg "Skipping SVN update. ${msg}.")
       message(STATUS "${msg}")
@@ -82,6 +82,6 @@
     set(_svn_cpm_user_pw_args ${_svn_cpm_user_pw_args} "--password=${_CPM_REPO_SVN_PASSWORD}")
   endif()

-  _cpm_ensure_scm_repo_is_current(${use_caching} ${tag} ${repo} ${dir})
+  _cpm_ensure_scm_repo_is_current(${use_caching} ${revision} ${repo} ${dir})
 endmacro()


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

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


COMP: Update AnalyzeObjectMapIO remote for ITKv5.0

Fix compilation issues due to untested code refactorings
when matching ITK v5 coding conventions.

--- Modules/Remote/AnalyzeObjectMapIO.remote.cmake
+++ Modules/Remote/AnalyzeObjectMapIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(AnalyzeObjectMapIO
   "AnalyzeObjectMapIO plugin for ITK. From Insight Journal article with handle: https://hdl.handle.net/1926/593"
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/itkAnalyzeObjectMap.git
-  GIT_TAG 54c3e2dbf0b4259aabe6c430df75171469d7bfee
+  GIT_TAG 7388d866433896368bd3049c396b974433b22cc5
   )


x86: -no-pie -> -fno-pie

x86: -no-pie -> -fno-pie

--- build/cmake/arch-x86.cmake
+++ build/cmake/arch-x86.cmake
@@ -33,7 +33,7 @@
 endif()

 if(GCC)
-  kernel_cflags(-no-pie)
+  kernel_cflags(-fno-pie)
 endif()

 if(EXISTS ${RAPTOR_DIR}/kernel/arch/x86/acpi/include)


Bump openresty to 1.9.7.5 for CVE-2016-4450.

--- build/cmake/versions.cmake
+++ build/cmake/versions.cmake
@@ -57,8 +57,8 @@
 set(NGX_DYUPS_HASH bdf4408599602afa38365a426e126d21)
 set(NGX_TXID_VERSION f1c197cb9c42e364a87fbb28d5508e486592ca42)
 set(NGX_TXID_HASH 408ee86eb6e42e27a51514f711c41d6b)
-set(OPENRESTY_VERSION 1.9.7.4)
-set(OPENRESTY_HASH 6e2d4a39c530524111ea50e3de67043a)
+set(OPENRESTY_VERSION 1.9.7.5)
+set(OPENRESTY_HASH 39af163a12467c45b1c171012eafb6c2)
 set(OPENSSL_VERSION 1.0.2h)
 set(OPENSSL_HASH 1d4007e53aad94a5b2002fe045ee7bb0b3d98f1a47f8b2bc851dcd1c74332919)
 set(PCRE_VERSION 8.38)


[cmake] Use string CONCAT instead of string APPEND in errors

--- other/errors.cmake
+++ other/errors.cmake
@@ -52,7 +52,7 @@
 function (show_wconv_warning)

    set(msg "")
-   string(APPEND msg "WCONV (-Wconversion) is supported ONLY when the "
+   string(CONCAT msg "WCONV (-Wconversion) is supported ONLY when the "
                      "kernel is built with Clang: "
                      "(CC=clang and CMAKE_ARGS='-DKERNEL_SYSCC=1')")

@@ -63,7 +63,7 @@
 function (show_clang_and_syscc_error)

    set(msg "")
-   string(APPEND msg "USE_SYSCC=1 is not supported with Clang. "
+   string(CONCAT msg "USE_SYSCC=1 is not supported with Clang. "
                      "Please use GCC. Note[1]: it is possible to build just "
                      "the kernel with Clang by setting CC=clang the CMake "
                      "variable KERNEL_SYSCC=1. However, the i686 gcc "


GMP: update to 6.1.2

GMP: update to 6.1.2

--- packages/gmp.cmake
+++ packages/gmp.cmake
@@ -1,7 +1,7 @@
 ExternalProject_Add(gmp
     DEPENDS gcc
-    URL "https://gmplib.org/download/gmp/gmp-6.1.1.tar.bz2"
-    URL_HASH SHA256=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
+    URL "https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2"
+    URL_HASH SHA256=5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2
     CONFIGURE_COMMAND ${EXEC} <SOURCE_DIR>/configure
         --host=${TARGET_ARCH}
         --prefix=${MINGW_INSTALL_PREFIX}


Properly escaping '-framework Accelerate' when telling ScaLAPACK what to use

--- cmake/external_projects/ElMath/ScaLAPACK.cmake
+++ cmake/external_projects/ElMath/ScaLAPACK.cmake
@@ -176,10 +176,10 @@
     set(LAPACK_COMMAND -D LAPACK_LIBRARIES=${MATH_LIBS_AT_CONFIG})
   elseif(EL_HAVE_VECLIB AND
          NOT EL_PREFER_OPENBLAS AND NOT EL_PREFER_BLIS_LAPACK)
-    set(LAPACK_COMMAND -D LAPACK_LIBRARIES="-framework vecLib")
+    set(LAPACK_COMMAND -D LAPACK_LIBRARIES:STRING=-framework\ vecLib)
   elseif(EL_HAVE_ACCELERATE AND
          NOT EL_PREFER_OPENBLAS AND NOT EL_PREFER_BLIS_LAPACK)
-    set(LAPACK_COMMAND -D LAPACK_LIBRARIES="-framework Accelerate")
+    set(LAPACK_COMMAND -D LAPACK_LIBRARIES:STRING=-framework\ Accelerate)
   else()
     if((EL_DISABLE_OPENBLAS OR EL_PREFER_BLIS_LAPACK)
        AND NOT EL_DISABLE_BLIS_LAPACK)


 - исправлена перекомпиляция (более правильный вариант)

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@12170 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/bison.cmake
+++ rdo/packages/cmake/trunk/bison.cmake
@@ -15,10 +15,10 @@
 	ENDIF()

 	ADD_CUSTOM_COMMAND(
-		OUTPUT ${GRAMMA_PATH}/rdogram${FILE_TYPE}.cpp ${GRAMMA_PATH}/rdogram${FILE_TYPE}.hpp
+		OUTPUT ${GRAMMA_PATH}/rdogram${FILE_TYPE}.cpp
 		COMMAND set CYGWIN=nodosfilewarning
 		COMMAND set BISON_PKGDATADIR=${BISON_FLEX_DIRECTORY}/share/bison
-		COMMAND ${BISON_EXECUTABLE} ARGS -g -v ${BISON_DEFINE} -p${BISON_NAME} -d -o ${GRAMMA_PATH}/rdogram${FILE_TYPE}.cpp ${GRAMMA_PATH}/rdo${FILE_TYPE}.y
+		COMMAND ${BISON_EXECUTABLE} ARGS -g -v ${BISON_DEFINE} -p${BISON_NAME} -o ${GRAMMA_PATH}/rdogram${FILE_TYPE}.cpp ${GRAMMA_PATH}/rdo${FILE_TYPE}.y
 		DEPENDS ${GRAMMA_PATH}/rdo${FILE_TYPE}.y
 		COMMENT "[BISON][rdo${FILE_TYPE}] Building parser with bison ${BISON_VERSION}"
 		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}


boards: arm: stm32f3 disco has stm32cubeprogrammer as runner

Adds the stm32cubeprogrammer as runner of the stm32f3_disco

Signed-off-by: Francois Ramu <b83adc7f8a23ee911a37fcb61c4033581aae0b7a@st.com>

--- boards/arm/stm32f3_disco/board.cmake
+++ boards/arm/stm32f3_disco/board.cmake
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: Apache-2.0

 board_runner_args(jlink "--device=STM32F303VC" "--speed=4000")
+board_runner_args(stm32cubeprogrammer "--port=swd" "--reset=hw")

 include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
+include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)


i#1873 Android test suite: fix missing device setting for release

Fixes a failure to copy files to the Android device for the release build
test suite.

Review-URL: https://codereview.appspot.com/290400043

--- suite/runsuite.cmake
+++ suite/runsuite.cmake
@@ -297,9 +297,13 @@
     message("adb not found: NOT running Android tests")
   endif ()
   if (ADB)
-    set(android_extra "DR_COPY_TO_DEVICE:BOOL=ON")
+    set(android_extra_dbg "DR_COPY_TO_DEVICE:BOOL=ON")
+    if (TEST_LONG)
+      set(android_extra_rel "DR_COPY_TO_DEVICE:BOOL=ON")
+    endif ()
   else ()
-    set(android_extra "")
+    set(android_extra_dbg "")
+    set(android_extra_rel "")
     set(run_tests OFF) # build tests but don't run them
   endif ()
   testbuild_ex("android-debug-internal-32" OFF "
@@ -307,13 +311,13 @@
     INTERNAL:BOOL=ON
     CMAKE_TOOLCHAIN_FILE:PATH=${CTEST_SOURCE_DIRECTORY}/make/toolchain-android.cmake
     BUILD_TESTS:BOOL=ON
-    DR_COPY_TO_DEVICE:BOOL=ON
-    ${ANDROID_EXTRA}
+    ${android_extra_dbg}
     " OFF OFF "")
   testbuild_ex("android-release-external-32" OFF "
     DEBUG:BOOL=OFF
     INTERNAL:BOOL=OFF
     CMAKE_TOOLCHAIN_FILE:PATH=${CTEST_SOURCE_DIRECTORY}/make/toolchain-android.cmake
+    ${android_extra_rel}
     " OFF OFF "")
   set(run_tests ON)


cmake: Use pkg-config for libsmbclient.

cmake: Use pkg-config for libsmbclient.

--- cmake/Modules/FindLibsmbclient.cmake
+++ cmake/Modules/FindLibsmbclient.cmake
@@ -6,7 +6,7 @@
 #  LIBSMBCLIENT_LIBRARIES - Link these to use Libsmbclient
 #  LIBSMBCLIENT_DEFINITIONS - Compiler switches required for using Libsmbclient
 #
-#  Copyright (c) 2006 Andreas Schneider <anschneider@suse.de>
+#  Copyright (c) 2013 Andreas Schneider <asn@cryptomilk.org>
 #
 #  Redistribution and use is allowed according to the terms of the New
 #  BSD license.
@@ -18,54 +18,40 @@
   # in cache already
   set(LIBSMBCLIENT_FOUND TRUE)
 else (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS)
+  find_package(PkgConfig)
+  if (PKG_CONFIG_FOUND)
+    pkg_check_modules(_LIBSMBCLIENT smbclient)
+  endif (PKG_CONFIG_FOUND)
+
   find_path(LIBSMBCLIENT_INCLUDE_DIR
     NAMES
       libsmbclient.h
     PATHS
-      /usr/include
-      /usr/local/include
-      /opt/local/include
-      /sw/include
+      ${_LIBSMBCLIENT_INCLUDEDIR}
+    PATH_SUFFIXES
+      samba-4.0
   )

   find_library(SMBCLIENT_LIBRARY
     NAMES
       smbclient
     PATHS
-      /usr/lib
-      /usr/local/lib
-      /opt/local/lib
-      /sw/lib
+      ${_LIBSMBCLIENT_LIBDIR}
   )
-
-  if (SMBCLIENT_LIBRARY)
-    set(SMBCLIENT_FOUND TRUE)
-  endif (SMBCLIENT_LIBRARY)

   set(LIBSMBCLIENT_INCLUDE_DIRS
     ${LIBSMBCLIENT_INCLUDE_DIR}
   )

-  if (SMBCLIENT_FOUND)
+  if (SMBCLIENT_LIBRARY)
     set(LIBSMBCLIENT_LIBRARIES
-      ${LIBSMBCLIENT_LIBRARIES}
-      ${SMBCLIENT_LIBRARY}
+        ${LIBSMBCLIENT_LIBRARIES}
+        ${SMBCLIENT_LIBRARY}
     )
-  endif (SMBCLIENT_FOUND)
+  endif (SMBCLIENT_LIBRARY)

-  if (LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES)
-     set(LIBSMBCLIENT_FOUND TRUE)
-  endif (LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES)
-
-  if (LIBSMBCLIENT_FOUND)
-    if (NOT Libsmbclient_FIND_QUIETLY)
-      message(STATUS "Found Libsmbclient: ${LIBSMBCLIENT_LIBRARIES}")
-    endif (NOT Libsmbclient_FIND_QUIETLY)
-  else (LIBSMBCLIENT_FOUND)
-    if (Libsmbclient_FIND_REQUIRED)
-      message(FATAL_ERROR "Could not find Libsmbclient")
-    endif (Libsmbclient_FIND_REQUIRED)
-  endif (LIBSMBCLIENT_FOUND)
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(Libsmbclient DEFAULT_MSG LIBSMBCLIENT_LIBRARIES LIBSMBCLIENT_INCLUDE_DIRS)

   # show the LIBSMBCLIENT_INCLUDE_DIRS and LIBSMBCLIENT_LIBRARIES variables only in the advanced view
   mark_as_advanced(LIBSMBCLIENT_INCLUDE_DIRS LIBSMBCLIENT_LIBRARIES)


#13 ffix cmake for travis

#13 ffix cmake for travis

--- cmake_modules/FindIFCOPENSHELL.cmake
+++ cmake_modules/FindIFCOPENSHELL.cmake
@@ -32,11 +32,11 @@
 		PATHS
 		${IFCOPENSHELL_ROOT}/lib
 	)
-	find_library(IFCOPENSHELL_PARSE_LIBRARIES_DEBUG NAMES IfcParse_d
+	find_library(IFCOPENSHELL_PARSE_LIBRARIES_DEBUG NAMES IfcParse_d IfcParse
 		PATHS
 		${IFCOPENSHELL_ROOT}/lib
 	)
-	find_library(IFCOPENSHELL_GEOM_LIBRARIES_DEBUG NAMES IfcGeom_d
+find_library(IFCOPENSHELL_GEOM_LIBRARIES_DEBUG NAMES IfcGeom_d IfcGeom
 		PATHS
 		${IFCOPENSHELL_ROOT}/lib
 	)
@@ -74,14 +74,14 @@
     	/opt/local/lib/
     )

-	find_library(IFCOPENSHELL_PARSE_LIBRARIES_DEBUG NAMES IfcParse_d
+	find_library(IFCOPENSHELL_PARSE_LIBRARIES_DEBUG NAMES IfcParse_d IfcParse
     	PATHS
     	/usr/lib/
     	/usr/local/lib/
     	/opt/local/lib/
     )

-	find_library(IFCOPENSHELL_GEOM_LIBRARIES_DEBUG NAMES IfcGeom_d
+	find_library(IFCOPENSHELL_GEOM_LIBRARIES_DEBUG NAMES IfcGeom_d IfcGeom
     	PATHS
     	/usr/lib/
     	/usr/local/lib/


[cmake] Include ClangTargets.cmake so that any clang libraries we include get the correct LLVM/Clang dependency ordering.

This means that one can just use LINK_LIBRARIES to get the correct dependency
information without needing to know anything further.

rdar://26154980

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -112,22 +112,35 @@
 endmacro()

 macro(swift_common_standalone_build_config_clang product is_cross_compiling)
-  # Clang
   set(${product}_PATH_TO_CLANG_SOURCE "${PATH_TO_LLVM_SOURCE}/tools/clang"
       CACHE PATH "Path to Clang source code.")
   set(${product}_PATH_TO_CLANG_BUILD "${PATH_TO_LLVM_BUILD}" CACHE PATH
     "Path to the directory where Clang was built or installed.")

-  if(NOT EXISTS "${${product}_PATH_TO_CLANG_SOURCE}/include/clang/AST/Decl.h")
+  set(PATH_TO_CLANG_SOURCE "${${product}_PATH_TO_CLANG_SOURCE}")
+  set(PATH_TO_CLANG_BUILD "${${product}_PATH_TO_CLANG_BUILD}")
+
+  # Add all Clang CMake paths to our cmake module path.
+  set(SWIFT_CLANG_CMAKE_PATHS
+    "${PATH_TO_CLANG_BUILD}/share/clang/cmake")
+  foreach(path ${SWIFT_CLANG_CMAKE_PATHS})
+    list(APPEND CMAKE_MODULE_PATH ${path})
+  endforeach()
+
+  # Then include ClangTargets.cmake. If Clang adds a ClangConfig.cmake, this is
+  # where it will be included. By including ClangTargets.cmake, we at least get
+  # the right dependency ordering for clang libraries.
+  include(ClangTargets)
+
+  if(NOT EXISTS "${PATH_TO_CLANG_SOURCE}/include/clang/AST/Decl.h")
     message(FATAL_ERROR "Please set ${product}_PATH_TO_CLANG_SOURCE to the root directory of Clang's source code.")
   endif()
-  get_filename_component(CLANG_MAIN_SRC_DIR ${${product}_PATH_TO_CLANG_SOURCE}
-    ABSOLUTE)
-
-  if(NOT EXISTS "${${product}_PATH_TO_CLANG_BUILD}/tools/clang/include/clang/Basic/Version.inc")
+  get_filename_component(CLANG_MAIN_SRC_DIR "${PATH_TO_CLANG_SOURCE}" ABSOLUTE)
+
+  if(NOT EXISTS "${PATH_TO_CLANG_BUILD}/tools/clang/include/clang/Basic/Version.inc")
     message(FATAL_ERROR "Please set ${product}_PATH_TO_CLANG_BUILD to a directory containing a Clang build.")
   endif()
-  set(CLANG_BUILD_INCLUDE_DIR "${${product}_PATH_TO_CLANG_BUILD}/tools/clang/include")
+  set(CLANG_BUILD_INCLUDE_DIR "${PATH_TO_CLANG_BUILD}/tools/clang/include")

   if (NOT ${is_cross_compiling})
     set(${product}_NATIVE_CLANG_TOOLS_PATH "${PATH_TO_LLVM_TOOLS_BINARY_DIR}")


Remove trailing whitespaces

Remove trailing whitespaces

--- cmake/modules/CMakeGeneratePkgConfig.cmake
+++ cmake/modules/CMakeGeneratePkgConfig.cmake
@@ -8,12 +8,12 @@

 SET(CMAKE_PKGCONFIG_TEMPLATE "prefix=@PREFIX@
-exec_prefix=@PREFIX@
+exec_prefix=@PREFIX@
 libdir=@LIBDIR_VAR
 includedir=@INCLUDE_VAR@

-Name: @NAME_PROJECT@
-Description: @DESCRIPTION_PROJECT@
+Name: @NAME_PROJECT@
+Description: @DESCRIPTION_PROJECT@
 Version: @VERSION_PROJECT@
 URL: @URL_PROJECT@
 Requires: @REQUIRES_PROJECT@
@@ -25,13 +25,13 @@

 SET(CMAKE_PKGCONFIG_TEMPLATE_BASE "
-prefix=@PREFIX@
+prefix=@PREFIX@
 exec_prefix= \\\${prefix}
 libdir= @LIBDIR_VAR@
 includedir=@INCLUDE_VAR@

-Name: @NAME_PROJECT@
-Description: @DESCRIPTION_PROJECT@
+Name: @NAME_PROJECT@
+Description: @DESCRIPTION_PROJECT@
 Version: @VERSION_PROJECT@
 Requires: @REQUIRES_PROJECT@
 Libs: @LIBS_PROJECT@


MyPackageCheck.cmake: Support of eventual TARGET_TEST_CMAKE_COMMAND

--- cmake/MyPackageCheck.cmake
+++ cmake/MyPackageCheck.cmake
@@ -33,9 +33,14 @@
     ENDFOREACH ()
   ENDIF ()

+  IF (NOT ("x${TARGET_TEST_CMAKE_COMMAND}" STREQUAL "x"))
+    GET_FILENAME_COMPONENT(_target_test_cmake_command ${TARGET_TEST_CMAKE_COMMAND} ABSOLUTE)
+  ELSE ()
+    SET (_target_test_cmake_command "")
+  ENDIF ()
   FOREACH (_name ${name} ${name}_static)
     ADD_TEST (NAME ${_name}
-      COMMAND ${CMAKE_COMMAND} -E env "PATH=${_test_path}" $<TARGET_FILE:${_name}> ${ARGN}
+      COMMAND ${CMAKE_COMMAND} -E env "PATH=${_test_path}" ${_target_test_cmake_command} $<TARGET_FILE:${_name}> ${ARGN}
       WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH})
     ADD_DEPENDENCIES(check ${_name})
   ENDFOREACH ()


Search for uuid to give configure-time warning if it's not there

--HG--
branch : transport_0.3.0_uuid

--- cmake/SearchForStuff.cmake
+++ cmake/SearchForStuff.cmake
@@ -81,6 +81,19 @@
   link_directories(${czmq_LIBRARY_DIRS})
 endif ()

+#################################################
+# Find uuid:
+pkg_check_modules(uuid uuid)
+
+if (NOT uuid_FOUND)
+  message (STATUS "Looking for uuid pkgconfig file - not found")
+  BUILD_ERROR ("uuid not found, Please install uuid")
+else ()
+  message (STATUS "Looking for uuid pkgconfig file - found")
+  include_directories(${uuid_INCLUDE_DIRS})
+  link_directories(${uuid_LIBRARY_DIRS})
+endif ()
+
 ########################################
 # Include man pages stuff
 include (${project_cmake_dir}/Ronn2Man.cmake)


Organize Tink CMake targets into folders for IDEs that support them.

PiperOrigin-RevId: 239196179
GitOrigin-RevId: 8fd030372e78c13ca4535cf25b2c41fd7af4304a

--- cmake/TinkBuildRules.cmake
+++ cmake/TinkBuildRules.cmake
@@ -50,6 +50,8 @@
 endif()

 list(APPEND TINK_INCLUDE_DIRS "${TINK_GENFILE_DIR}")
+
+set(TINK_IDE_FOLDER "Tink")

 # Declare the beginning of a new Tink library namespace.
 #
@@ -121,6 +123,13 @@
     target_link_libraries(${_target_name} PUBLIC ${tink_cc_library_DEPS})
     set_property(TARGET ${_target_name} PROPERTY CXX_STANDARD ${TINK_CXX_STANDARD})
     set_property(TARGET ${_target_name} PROPERTY CXX_STANDARD_REQUIRED true)
+    if (tink_cc_library_PUBLIC)
+      set_property(TARGET ${_target_name}
+                   PROPERTY FOLDER "${TINK_IDE_FOLDER}")
+    else()
+      set_property(TARGET ${_target_name}
+                   PROPERTY FOLDER "${TINK_IDE_FOLDER}/Internal")
+    endif()
   else()
     add_library(${_target_name} INTERFACE)
     target_include_directories(${_target_name} INTERFACE ${TINK_INCLUDE_DIRS})
@@ -167,6 +176,9 @@
     gtest_main
     ${tink_cc_test_DEPS}
   )
+
+  set_property(TARGET ${_target_name}
+               PROPERTY FOLDER "${TINK_IDE_FOLDER}/Tests")

   if (${CMAKE_VERSION} VERSION_LESS 3.10)
     gtest_add_tests(TARGET ${_target_name})


Fixed linking of freetype

Fixed linking of freetype

--- cmake/UseOpenCASCADE.cmake
+++ cmake/UseOpenCASCADE.cmake
@@ -74,7 +74,12 @@
   endif()

   if (OpenCASCADE_WITH_FREETYPE AND NOT OpenCASCADE_BUILD_SHARED_LIBS)
-      find_package(freetype CONFIG REQUIRED)
+      find_package(Freetype REQUIRED)
+      if (NOT TARGET freetype)
+          add_library(freetype UNKNOWN IMPORTED)
+          set_property(TARGET freetype APPEND PROPERTY IMPORTED_LOCATION "${FREETYPE_LIBRARY}")
+      endif()
+
       set_property(TARGET TKService APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES freetype)
   endif()


x11_egl: use quotes to include glesv1_cm directories am: f5e7ab6b79 am: 8f736c4099
am: 4894b68cb9

Change-Id: I7ae6226816fbf14666f32de47232f57e8deb0258

--- targets/x11_egl/x11_egl.cmake
+++ targets/x11_egl/x11_egl.cmake
@@ -38,7 +38,7 @@
 if (GLES1_LIBRARIES)
 	set(DEQP_SUPPORT_GLES1	ON)
 	set(DEQP_GLES1_LIBRARIES ${GLES1_LIBRARIES})
-	set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -L${GLES1_LIBRARY_DIRS})
+	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${GLES1_LIBRARY_DIRS}")
 	if ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
 		# PKG_GLES1_INCLUDE_DIRS empty, see if matching include
 		# path (GLES/gl.h) exists beside library directory


tiny fix

tiny fix

utilize jemalloc again

--- source/ConfigureChecks.cmake
+++ source/ConfigureChecks.cmake
@@ -32,7 +32,7 @@
   ticpp
   luxio
   leveldb
-#jemalloc
+  jemalloc
   json
   ticpp
   am


fix automoc target dependency for Visual Studio generators

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -3000,9 +3000,16 @@
 	else()
 		add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
 	endif()
-	if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
-		# depend on the original target's implicity generated <targetname>_automoc target
-		add_dependencies(${_unityTargetName} ${_target}_automoc)
+	if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+		# depend on original target's automoc target, if it exists
+		if (TARGET ${_target}_automoc)
+			add_dependencies(${_unityTargetName} ${_target}_automoc)
+		endif()
+	else()
+		if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
+			# depend on the original target's implicity generated <targetname>_automoc target
+			add_dependencies(${_unityTargetName} ${_target}_automoc)
+		endif()
 	endif()
 	# copy output location properties
 	set (_outputDirProperties


Removed reference to opencv_highgui library not needed

--- cmake/CMakeModules/FindOpenCV.cmake
+++ cmake/CMakeModules/FindOpenCV.cmake
@@ -41,7 +41,7 @@
 FIND_OPENCV_LIBRARY(OPENCV_CORE_LIBRARY opencv_core)
 FIND_OPENCV_LIBRARY(OPENCV_FEATURES2D_LIBRARY opencv_features2d)
 FIND_OPENCV_LIBRARY(OPENCV_FLANN_LIBRARY opencv_flann)
-FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
+#FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
 FIND_OPENCV_LIBRARY(OPENCV_IMGPROC_LIBRARY opencv_imgproc)
 FIND_OPENCV_LIBRARY(OPENCV_ML_LIBRARY opencv_ml)
 FIND_OPENCV_LIBRARY(OPENCV_OBJDETECT_LIBRARY opencv_objdetect)
@@ -60,7 +60,7 @@
                      ${OPENCV_FEATURES2D_LIBRARY}
                      ${OPENCV_XFEATURES2D_LIBRARY}
                      ${OPENCV_FLANN_LIBRARY}
-                     ${OPENCV_HIGHGUI_LIBRARY}
+#                     ${OPENCV_HIGHGUI_LIBRARY}
                      ${OPENCV_IMGPROC_LIBRARY}
                      ${OPENCV_ML_LIBRARY}
                      ${OPENCV_PHOTO_LIBRARY}
@@ -72,7 +72,7 @@
      OPENCV_FEATURES2D_LIBRARY AND
      OPENCV_XFEATURES2D_LIBRARY AND
      OPENCV_FLANN_LIBRARY AND
-     OPENCV_HIGHGUI_LIBRARY AND
+#     OPENCV_HIGHGUI_LIBRARY AND
      OPENCV_IMGPROC_LIBRARY AND
      OPENCV_ML_LIBRARY AND
      OPENCV_OBJDETECT_LIBRARY AND


cmake: detect Haswell-EP & docs

cmake: detect Haswell-EP & docs

* some documentation for OptimizeForArchitecture
* Intel family 6, model 63 is Haswell

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -1,5 +1,23 @@
+# Determine the host CPU feature set and determine the best set of compiler
+# flags to enable all supported SIMD relevant features. Alternatively, the
+# target CPU can be explicitly selected (for generating more generic binaries
+# or for targeting a different system).
+# Compilers provide e.g. the -march=native flag to achieve a similar result.
+# This fails to address the need for building for a different microarchitecture
+# than the current host.
+# The script tries to deduce all settings from the model and family numbers of
+# the CPU instead of reading the CPUID flags from e.g. /proc/cpuinfo. This makes
+# the detection more independent from the CPUID code in the kernel (e.g. avx2 is
+# not listed on older kernels).
+#
+# Usage:
+# OptimizeForArchitecture()
+# If either of Vc_SSE_INTRINSICS_BROKEN, Vc_AVX_INTRINSICS_BROKEN,
+# Vc_AVX2_INTRINSICS_BROKEN is defined and set, the OptimizeForArchitecture
+# macro will consequently disable the relevant features via compiler flags.
+
 #=============================================================================
-# Copyright 2010-2013 Matthias Kretz <kretz@kde.org>
+# Copyright 2010-2015 Matthias Kretz <kretz@kde.org>
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -71,7 +89,9 @@
    if(_vendor_id STREQUAL "GenuineIntel")
       if(_cpu_family EQUAL 6)
          # Any recent Intel CPU except NetBurst
-         if(_cpu_model EQUAL 62)
+         if(_cpu_model EQUAL 63) # e.g. Xeon E5 2660 v3
+            set(TARGET_ARCHITECTURE "haswell")
+         elseif(_cpu_model EQUAL 62)
             set(TARGET_ARCHITECTURE "ivy-bridge")
          elseif(_cpu_model EQUAL 61)
             set(TARGET_ARCHITECTURE "broadwell")


Use url_sha_openssl_windows scheme

Use url_sha_openssl_windows scheme

--- cmake/projects/OpenSSL/hunter.cmake
+++ cmake/projects/OpenSSL/hunter.cmake
@@ -57,12 +57,17 @@
     b485a818490bd2818b7e948b26656c11fea77782
 )

-string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" _hunter_result)
-if(_hunter_result)
-  set(_hunter_download_scheme url_sha1_openssl_ios)
+if(WIN32)
+  set(_hunter_download_scheme url_sha_openssl_windows)
 else()
-  set(_hunter_download_scheme url_sha1_openssl)
+  string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" _hunter_result)
+  if(_hunter_result)
+    set(_hunter_download_scheme url_sha1_openssl_ios)
+  else()
+    set(_hunter_download_scheme url_sha1_openssl)
+  endif()
 endif()
+
 unset(_hunter_result)

 hunter_download(


component fix - component now always include the include.cmake, even if component was previously built

--- components/configure.cmake
+++ components/configure.cmake
@@ -30,14 +30,14 @@
 # the macro any part of ospray can use to request ospray to
 # include/build a specific component
 MACRO(OSPRAY_BUILD_COMPONENT comp)
+  SET(CURRENT_COMPONENT_DIR ${COMPONENTS_DIR}/${comp})
+  IF(NOT EXISTS ${CURRENT_COMPONENT_DIR})
+    MESSAGE(FATAL_ERROR "Could not find component '${comp}'!")
+  ENDIF()
+
   IF (";${OSPRAY_LIST_OF_ALREADY_BUILT_COMPONENTS};" MATCHES ";${comp};")
     # component already built; nothing to do!
   ELSE()
-    SET(CURRENT_COMPONENT_DIR ${COMPONENTS_DIR}/${comp})
-    IF(NOT EXISTS ${CURRENT_COMPONENT_DIR})
-      MESSAGE(FATAL_ERROR "Could not find component '${comp}'!")
-    ENDIF()
-
     SET(INCLUDED_AS_AN_OSPRAY_COMPONENT ON)
     SET(OSPRAY_LIST_OF_ALREADY_BUILT_COMPONENTS
         ${OSPRAY_LIST_OF_ALREADY_BUILT_COMPONENTS} ${comp}
@@ -54,9 +54,10 @@

     SET(OSPRAY_DEFAULT_COMPONENT ${DEFAULT_COMPONENT})

-    IF(EXISTS ${CURRENT_COMPONENT_DIR}/include.cmake)
-      INCLUDE(${CURRENT_COMPONENT_DIR}/include.cmake)
-    ENDIF()
+  ENDIF()
+
+  IF(EXISTS ${CURRENT_COMPONENT_DIR}/include.cmake)
+    INCLUDE(${CURRENT_COMPONENT_DIR}/include.cmake)
+  ENDIF()

-  ENDIF()
 ENDMACRO()


Use "default" theme for Sphinx < 1.3

Use "default" theme for Sphinx < 1.3

--- salome_adm/cmake_files/FindSphinx.cmake
+++ salome_adm/cmake_files/FindSphinx.cmake
@@ -48,7 +48,7 @@
   STRING(REGEX REPLACE ".* ([0-9.]+)$" "\\1" SPHINX_VERSION "${SPHINX_VERSION}" )
   MESSAGE(STATUS "Sphinx version is ${SPHINX_VERSION}")
   IF(SPHINX_VERSION VERSION_LESS "1.3")
-    SET(SPHINX_THEME "basic")
+    SET(SPHINX_THEME "default")
   ELSE()
     SET(SPHINX_THEME "classic")
   ENDIF()


fix(core): Update FindMbedTLS.cmake (#3872)

--- tools/cmake/FindMbedTLS.cmake
+++ tools/cmake/FindMbedTLS.cmake
@@ -1,8 +1,8 @@
 #check environment variable
-if("$ENV{MBEDTLS_FOLDER_INCLUDE}")
+if(NOT "$ENV{MBEDTLS_FOLDER_INCLUDE}" STREQUAL "")
     set(MBEDTLS_FOLDER_INCLUDE "$ENV{MBEDTLS_FOLDER_INCLUDE}")
 endif()
-if("$ENV{MBEDTLS_FOLDER_LIBRARY}")
+if(NOT "$ENV{MBEDTLS_FOLDER_LIBRARY}" STREQUAL "")
     set(MBEDTLS_FOLDER_LIBRARY "$ENV{MBEDTLS_FOLDER_LIBRARY}")
 endif()


BuildSupport: Require that the user provided a value for BUILDEM_REPO_DIR

--- BuildSupport.cmake
+++ BuildSupport.cmake
@@ -15,9 +15,12 @@

 if (NOT BUILDEM_DIR)
-    message (FATAL_ERROR "ERROR: FlyEM build directory (for all downloads & builds) should be specified via -DBUILDEM_DIR=<path> on cmake command line.")
+    message (FATAL_ERROR "ERROR: BuildEM build directory (for all downloads & builds) should be specified via -DBUILDEM_DIR=<path> on cmake command line.")
 endif ()

+if (NOT BUILDEM_REPO_DIR)
+    message (FATAL_ERROR "ERROR: BUILDEM_REPO_DIR must be specified via your application's CMakeLists.txt file, and must be set to ${BUILDEM_DIR}/src/buildem.")
+endif ()

 # Make sure the main directories for FlyEM build directory are already
 # created so paths won't error out.


cmake: Set TCAM_INTERNAL_ARAVIS to ON

cmake: Set TCAM_INTERNAL_ARAVIS to ON

--- CMakeOptions.cmake
+++ CMakeOptions.cmake
@@ -26,7 +26,7 @@
 option(BUILD_TESTS    "Build tests."                         OFF)

-option(TCAM_INTERNAL_ARAVIS "Use internal aravis dependency instead of system libraries" OFF)
+option(TCAM_INTERNAL_ARAVIS "Use internal aravis dependency instead of system libraries" ON)
 option(TCAM_ARAVIS_USB_VISION "Use aravis usb vision backend. Disables v4l2." OFF)

 if (TCAM_ARAVIS_USB_VISION)


Fixed some issues with git-download and submodules, specifically merging submodules into repo (locally) before running subtree (now insted pointing to local, modified repo instead of remote). Might change so that repo always is cloned to temp dir, modified if needed (like removing unwanted subdirs to decrease size), then merged using git subtree..

--- src/cmake/git-download.cmake
+++ src/cmake/git-download.cmake
@@ -14,12 +14,19 @@
     if(NOT args_WORKING_DIRECTORY)
         set(args_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
     endif()
+
+    #message("Running git-command: git ${args_COMMAND}")

     execute_process(
         COMMAND ${GIT_EXECUTABLE} ${args_COMMAND}
         OUTPUT_VARIABLE GIT_RESULT
+        RESULT_VARIABLE RETURN_CODE
         WORKING_DIRECTORY ${args_WORKING_DIRECTORY}
     )
+
+    if(NOT "${RETURN_CODE}" STREQUAL "0")
+        message(FATAL_ERROR "Failed to run git command.")
+    endif()

     set(${args_OUTPUT_VARIABLE} ${GIT_RESULT} PARENT_SCOPE)
 endfunction()
@@ -105,9 +112,10 @@
         URL
         TAG
         CLONE_DIR
+    )
+    set(multiValueArgs
         SUBMODULES
     )
-    set(multiValueArgs "")
     cmake_parse_arguments(args "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

     # Merge message used by git subtree add/pull
@@ -140,35 +148,35 @@
         return()
     endif()

-    # Submodules can't be pulled with git subtree, so in this case clone
-    # normally to temp-dir, download specified submodules and set git-url to this instead of remote.
-    # Note: Must
+    # Submodules can't be pulled with git subtree, so in this case clone normally to temp-dir,
+    # download specified submodules and set git-url to this instead of remote.
+    # Note: Must merge submodules into main repo
     if(args_SUBMODULES)
         set(TMP_DIR "${CMAKE_BINARY_DIR}/tmp/git-download")
+        message("Submodules detected.\n \
+        \tCloning to temporary directory and merging submodules into repo before running subtree...\n \
+        \tTemp directory: '${TMP_DIR}'")
+
         execute_process(
             COMMAND ${CMAKE_COMMAND} -E remove_directory ${TMP_DIR}
             WORKING_DIRECTORY "${TMP_DIR}/.."
         )

         execute_git(
-            COMMAND clone ${args_URL} "${TMP_DIR}"
-        )
-        execute_process(
-            COMMAND ${GIT_EXECUTABLE} checkout ${args_TAG}
-            WORKING_DIRECTORY "${TMP_DIR}"
-        )
-        execute_process(
-            COMMAND ${GIT_EXECUTABLE} submodule update --init ${args_SUBMODULES}
-            WORKING_DIRECTORY "${TMP_DIR}"
-        )
-
+            COMMAND clone -b ${args_TAG} --single-branch ${args_URL} "${TMP_DIR}"
+        )
+        execute_git(
+            COMMAND submodule update --init ${args_SUBMODULES}
+            WORKING_DIRECTORY "${TMP_DIR}"
+        )
+
+        # Merge submodules into main repo so that subtree merges it all
         execute_git(
             COMMAND rm .gitmodules
             WORKING_DIRECTORY "${TMP_DIR}"
         )
-
-        # Merge submodules into main repo so that subtree merges it all
         foreach(SUBMODULE ${args_SUBMODULES})
+            message("Merging submodule '${SUBMODULE}'")
             execute_git(
                 COMMAND rm --cached ${SUBMODULE}
                 WORKING_DIRECTORY "${TMP_DIR}"
@@ -183,11 +191,17 @@
             COMMAND add -A
             WORKING_DIRECTORY "${TMP_DIR}"
         )
-        execute_git(
-            COMMAND commit -am "git-download: Merged submodules into main repo for use with subtree."
-            WORKING_DIRECTORY "${TMP_DIR}"
-        )
-
+        string(REPLACE ";" " " COMMIT_MESSAGE ${args_SUBMODULES})
+        execute_git(
+            COMMAND commit -m "git-download: Merged submodules ${COMMIT_MESSAGE} into main repo for use with subtree."
+            WORKING_DIRECTORY "${TMP_DIR}"
+        )
+        # Replace current tag (we want the submodules-merge to be part of the tag)
+        execute_git(
+            COMMAND tag -f ${args_TAG}
+            WORKING_DIRECTORY "${TMP_DIR}"
+        )
+
         set(args_URL "${TMP_DIR}/.git")

     endif()


scikit-learn.cmake: Upgraded to 0.14.1 release.

--- scikit-learn.cmake
+++ scikit-learn.cmake
@@ -16,11 +16,10 @@
 include (scipy)

 external_source (scikit-learn
-    0.13.1
-    scikit-learn-0.13.1.tar.gz
-    acba398e1d46274b8470f40d0926e6a4
+    0.14.1
+    scikit-learn-0.14.1.tar.gz
+    790ad23547bb7f428060636628e13491
     http://pypi.python.org/packages/source/s/scikit-learn)
-
 message ("Installing ${scikit-learn_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${scikit-learn_NAME}
     DEPENDS             ${python_NAME} ${cython_NAME} ${numpy_NAME} ${scipy_NAME}


BUG: Factory registration should depend on ITK_BUILD_SHARED

Factory registration was relying on the CMake variable
BUILD_SHARED_LIBS. When building an project requiring
ITK, the project may set BUILD_SHARED_LIBS to a value
that was not the one used when building ITK. This mechanism
should rely on ITK_BUILD_SHARED that is the ITK internal
variable that saves the value of BUILD_SHARED_LIBS
when compiling ITK.

Change-Id: I9e6730a33e45751b532e6b00440fd6efd000f726

--- CMake/UseITK.cmake
+++ CMake/UseITK.cmake
@@ -198,7 +198,7 @@
   if(NOT ${_module_was_requested} EQUAL -1)
     # note: this is an internal CMake variable and should not be used outside ITK
     set(_abi)
-    if(${_module_name}_ENABLE_SHARED AND BUILD_SHARED_LIBS)
+    if(${_module_name}_ENABLE_SHARED AND ITK_BUILD_SHARED)
       set(_abi "ITK_ABI_IMPORT")
     endif()
     set(${_registration_list_var}


Fix FindFS library for gcc-8 (#1333)

Fix FindFS library for gcc-8 (#1333)

--- cmake/FindFS.cmake
+++ cmake/FindFS.cmake
@@ -4,7 +4,7 @@
 #  FILESYSTEM_FOUND    : True if found.

 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR UNIX AND NOT APPLE)
-    FIND_LIBRARY(FILESYSTEM_LIBRARY NAME libstdc++fs.a HINTS $ENV{HOME}/local/lib64 $ENV{HOME}/local/lib /usr/local/lib64 /usr/local/lib /opt/local/lib64 /opt/local/lib /usr/lib64 /usr/lib /usr/lib/gcc/*/*/ /usr/local/Cellar/gcc/*/lib/gcc/*/)
+    FIND_LIBRARY(FILESYSTEM_LIBRARY NAME libstdc++fs.a HINTS $ENV{HOME}/local/lib64 $ENV{HOME}/local/lib /usr/local/lib64 /usr/local/lib /opt/local/lib64 /opt/local/lib /usr/lib64 /usr/lib /usr/lib/gcc/*/8/ /usr/local/Cellar/gcc/*/lib/gcc/*/)
 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     FIND_LIBRARY(FILESYSTEM_LIBRARY NAMES libc++fs.a libc++experimental.a HINTS $ENV{HOME}/local/lib64 $ENV{HOME}/local/lib /usr/local/lib64 /usr/local/lib /opt/local/lib64 /opt/local/lib /usr/lib64 /usr/lib /usr/local/Cellar/llvm/*/lib)
 endif()


cmake: fix get_update_path_command() function

Quotes in the command break setting PATH

Amends 9c8451e9a76f1173d4c7fa4d538e2ed676743110

Change-Id: I2d5b40d9b302007da45c57e2f86856e175263c49
Reviewed-by: Eike Ziller <c142da16c73a95a82d35191bcc55b22835617128@qt.io>

--- cmake/QbsAPI.cmake
+++ cmake/QbsAPI.cmake
@@ -51,7 +51,7 @@
         endif()
         get_filename_component(_QT_LIBRARY_PATH "${_QTCORE_LIBRARY}" DIRECTORY)
         get_target_property(_QBS_LIBRARY_PATH qbscore LIBRARY_OUTPUT_DIRECTORY)
-        set(${var} "set \"PATH=${_QT_LIBRARY_PATH}\;${_QBS_LIBRARY_PATH}\;%PATH%\"" PARENT_SCOPE)
+        set(${var} "PATH=${_QT_LIBRARY_PATH}\;${_QBS_LIBRARY_PATH}\;%PATH%" PARENT_SCOPE)
     else()
         set(${var} "")
     endif()


need the include dir, though

need the include dir, though

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -42,13 +42,13 @@
   # Embree common include directories; others may be added depending on build target.
   # this section could be sooo much cleaner if embree only used
   # fully-qualified include names...
-#  SET(EMBREE_INCLUDE_DIRECTORIES
+  SET(EMBREE_INCLUDE_DIRECTORIES
 #    ${OSPRAY_EMBREE_SOURCE_DIR}/
-#    ${OSPRAY_EMBREE_SOURCE_DIR}/include
+    ${OSPRAY_EMBREE_SOURCE_DIR}/include
 #    ${OSPRAY_EMBREE_SOURCE_DIR}/common
 #    ${OSPRAY_EMBREE_SOURCE_DIR}/
 #    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels
-#    )
+    )

   IF (OSPRAY_TARGET STREQUAL "mic")
     SET(OSPRAY_EXE_SUFFIX ".mic")


Use "--leak-check=full" option in valgrind

--- src/CTestConfig.cmake
+++ src/CTestConfig.cmake
@@ -12,8 +12,8 @@
 # Specify MEMCHECK Option: http://valgrind.org/docs/manual/mc-manual.html
 # Note: We use "--trace-children=yes" to valgrind-ise child processes (follow execve)
 # Note: We turn off "--show-reachable=yes" option.
-SET (VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes")
-SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes")
+SET (VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full ")
+SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full ")

 set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "cmacslab2.modck.cs.cmu.edu")


update april tags svn external to rev 24


fix install location of eigen3.pc file

fix install location of eigen3.pc file

The Eigen_pod svn rev6 has a patch which is supposed to fix the
install location, but it appears that the patch doesn't work anymore.
This commit fixes the install location, but we should work on moving
this fix upstream into the Eigen_pod.

--- software/externals/externals.cmake
+++ software/externals/externals.cmake
@@ -154,3 +154,10 @@
 foreach(external ${externals})
   add_svn_external(${external})
 endforeach()
+
+
+# Eigen will install eigen3.pc to build/share instead of build/lib
+# unless this directory is created before Eigen configures.
+ExternalProject_Add_Step(Eigen_pod make_pkgconfig_dir
+  COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig
+  DEPENDERS configure)


Cleanup and fixed env var to cmake var.

Cleanup and fixed env var to cmake var.

--- CMakeModules/wasm.cmake
+++ CMakeModules/wasm.cmake
@@ -31,9 +31,7 @@

     if(EXISTS "${BINARYEN_ROOT}/bin/s2wasm")

-      set(BINARYEN_BIN $ENV{BINARYEN_ROOT}/bin)
-
-      message(STATUS "BINARYEN_BIN => " ${BINARYEN_BIN})
+      set(BINARYEN_BIN ${BINARYEN_ROOT}/bin)

     endif()

@@ -41,7 +39,7 @@

   if (NOT BINARYEN_BIN)

-    message(STATUS "BINARYEN_BIN not defined looking in PATH => " ${PATH})
+    message(STATUS "BINARYEN_BIN not defined looking in PATH")
     find_path(BINARYEN_BIN
               NAMES s2wasm
               ENV PATH )
@@ -50,9 +48,10 @@
       unset(BINARYEN_BIN)

     endif()
-    message(STATUS "BINARYEN_BIN => " ${BINARYEN_BIN})

   endif()
+
+  message(STATUS "BINARYEN_BIN => " ${BINARYEN_BIN})

 endif()


Added wxWidgets definitions in build configuration file.

--- CMake/TBTKConfigTemplate.cmake
+++ CMake/TBTKConfigTemplate.cmake
@@ -113,6 +113,7 @@
 #	SET(TBTK_LIBRARIES "${TBTK_LIBRARIES} ${wxWidgets_LIBRARIES}")
 	LIST(APPEND TBTK_LIBRARIES ${wxWidgets_LIBRARIES})
 	LINK_DIRECTORIES(${wxWidgets_LIBRARY_DIRS})
+	ADD_DEFINITIONS(${wxWidgets_DEFINITIONS})
 ELSE(wxWidgets_FOUND)
 	MESSAGE("[ ] wxWidgets")
 ENDIF(wxWidgets_FOUND)


build: spidermonkey include dir fix

build: spidermonkey include dir fix

--- CMakeModules/FindSpidermonkey.cmake
+++ CMakeModules/FindSpidermonkey.cmake
@@ -56,7 +56,7 @@
     SPIDERMONKEY_INCLUDE_DIR)

 IF(SPIDERMONKEY_FOUND)
-
+    SET(CMAKE_REQUIRED_INCLUDES ${SPIDERMONKEY_INCLUDE_DIR})
     SET(CMAKE_REQUIRED_DEFINITIONS ${SPIDERMONKEY_DEFINITIONS})
     SET(CMAKE_REQUIRED_LIBRARIES ${SPIDERMONKEY_LIBRARY})
     CHECK_CXX_SOURCE_RUNS(
@@ -74,6 +74,7 @@
             ${SPIDERMONKEY_DEFINITIONS} -DJS_THREADSAFE)
     ENDIF()

+    SET(CMAKE_REQUIRED_INCLUDES ${SPIDERMONKEY_INCLUDE_DIR})
     SET(CMAKE_REQUIRED_DEFINITIONS ${SPIDERMONKEY_DEFINITIONS})
     SET(CMAKE_REQUIRED_LIBRARIES ${SPIDERMONKEY_LIBRARY})
     CHECK_CXX_SOURCE_RUNS(