Do not build niche components by default, enable http server and RooFit

- the http server since it is used for json serialisation, notebooks and elsewhere.
- RooFit is widely adopted

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -65,9 +65,9 @@
 ROOT_BUILD_OPTION(alien OFF "AliEn support, requires libgapiUI from ALICE")
 ROOT_BUILD_OPTION(asimage ON "Image processing support, requires libAfterImage")
 ROOT_BUILD_OPTION(astiff ON "Include tiff support in image processing")
-ROOT_BUILD_OPTION(bonjour ON "Bonjour support, requires libdns_sd and/or Avahi")
+ROOT_BUILD_OPTION(bonjour OFF "Bonjour support, requires libdns_sd and/or Avahi")
 ROOT_BUILD_OPTION(builtin_afterimage ON "Build included libAfterImage, or use system libAfterImage")
-ROOT_BUILD_OPTION(builtin_cfitsio OFF "Build the FITSIO library internally (downloading tarfile from the Web)")
+ROOT_BUILD_OPTION(builtin_cfitsio ON "Build the FITSIO library internally (downloading tarfile from the Web)")
 ROOT_BUILD_OPTION(builtin_davix OFF "Build the Davix library internally (downloading tarfile from the Web)")
 ROOT_BUILD_OPTION(builtin_fftw3 OFF "Build the FFTW3 library internally (downloading tarfile from the Web)")
 ROOT_BUILD_OPTION(builtin_freetype OFF "Build included libfreetype, or use system libfreetype")
@@ -93,7 +93,7 @@
 else()
   ROOT_BUILD_OPTION(ccache OFF "Enable ccache usage for speeding up builds")
 endif()
-ROOT_BUILD_OPTION(chirp ON "Chirp support (Condor remote I/O), requires libchirp_client")
+ROOT_BUILD_OPTION(chirp OFF "Chirp support (Condor remote I/O), requires libchirp_client")
 ROOT_BUILD_OPTION(cling ON "Enable new CLING C++ interpreter")
 ROOT_BUILD_OPTION(cocoa OFF "Use native Cocoa/Quartz graphics backend (MacOS X only)")
 ROOT_BUILD_OPTION(cuda OFF "Use CUDA if it is found in the system")
@@ -102,37 +102,37 @@
 #ROOT_BUILD_OPTION(cxx17 OFF "Build using C++17 compatible mode, requires gcc >= 7.1.0 or clang")
 ROOT_BUILD_OPTION(cxxmodules OFF "Compile with C++ modules enabled.")
 ROOT_BUILD_OPTION(davix ON "DavIx library for HTTP/WEBDAV access")
-ROOT_BUILD_OPTION(dcache ON "dCache support, requires libdcap from DESY")
+ROOT_BUILD_OPTION(dcache OFF "dCache support, requires libdcap from DESY")
 ROOT_BUILD_OPTION(exceptions ON "Turn on compiler exception handling capability")
 ROOT_BUILD_OPTION(explicitlink ON "Explicitly link with all dependent libraries")
 ROOT_BUILD_OPTION(fftw3 ON "Fast Fourier Transform support, requires libfftw3")
-ROOT_BUILD_OPTION(fitsio ON "Read images and data from FITS files, requires cfitsio")
-ROOT_BUILD_OPTION(fortran ON "Enable the Fortran components of ROOT")
+ROOT_BUILD_OPTION(fitsio OFF "Read images and data from FITS files, requires cfitsio")
+ROOT_BUILD_OPTION(fortran OFF "Enable the Fortran components of ROOT")
 set(gcctoolchain "" CACHE PATH "Path for the gcctoolchain in case not the system gcc is used to build clang/LLVM")
-ROOT_BUILD_OPTION(gdml OFF "GDML writer and reader")
+ROOT_BUILD_OPTION(gdml ON "GDML writer and reader")
 ROOT_BUILD_OPTION(genvector ON "Build the new libGenVector library")
 ROOT_BUILD_OPTION(geocad OFF "ROOT-CAD Interface")
 ROOT_BUILD_OPTION(gfal ON "GFAL support, requires libgfal")
-ROOT_BUILD_OPTION(glite ON "gLite support, requires libglite-api-wrapper v.3 from GSI (https://subversion.gsi.de/trac/dgrid/wiki)")
+ROOT_BUILD_OPTION(glite OFF "gLite support, requires libglite-api-wrapper v.3 from GSI (https://subversion.gsi.de/trac/dgrid/wiki)")
 ROOT_BUILD_OPTION(globus OFF "Globus authentication support, requires Globus toolkit")
 ROOT_BUILD_OPTION(gnuinstall OFF "Perform installation following the GNU guidelines")
 ROOT_BUILD_OPTION(gsl_shared OFF "Enable linking against shared libraries for GSL (default no)")
-ROOT_BUILD_OPTION(gviz ON "Graphs visualization support, requires graphviz")
-ROOT_BUILD_OPTION(hdfs ON "HDFS support; requires libhdfs from HDFS >= 0.19.1")
-ROOT_BUILD_OPTION(http OFF "HTTP Server support")
+ROOT_BUILD_OPTION(gviz OFF "Graphs visualization support, requires graphviz")
+ROOT_BUILD_OPTION(hdfs OFF "HDFS support; requires libhdfs from HDFS >= 0.19.1")
+ROOT_BUILD_OPTION(http ON "HTTP Server support")
 ROOT_BUILD_OPTION(imt ON "Implicit multi-threading support")
 ROOT_BUILD_OPTION(jemalloc OFF "Using the jemalloc allocator")
-ROOT_BUILD_OPTION(krb5 ON "Kerberos5 support, requires Kerberos libs")
-ROOT_BUILD_OPTION(ldap ON "LDAP support, requires (Open)LDAP libs")
+ROOT_BUILD_OPTION(krb5 OFF "Kerberos5 support, requires Kerberos libs")
+ROOT_BUILD_OPTION(ldap OFF "LDAP support, requires (Open)LDAP libs")
 ROOT_BUILD_OPTION(libcxx OFF "Build using libc++, requires cxx11 option (MacOS X only, for the time being)")
 ROOT_BUILD_OPTION(macos_native OFF "Disable looking for libraries, includes and binaries in locations other than a native installation (MacOS only)")
 ROOT_BUILD_OPTION(mathmore ON "Build the new libMathMore extended math library, requires GSL (vers. >= 1.8)")
 ROOT_BUILD_OPTION(memory_termination OFF "Free internal ROOT memory before process termination (experimental, used for leak checking)")
-ROOT_BUILD_OPTION(memstat ON "A memory statistics utility, helps to detect memory leaks")
+ROOT_BUILD_OPTION(memstat OFF "A memory statistics utility, helps to detect memory leaks")
 ROOT_BUILD_OPTION(minuit2 OFF "Build the new libMinuit2 minimizer library")
-ROOT_BUILD_OPTION(monalisa ON "Monalisa monitoring support, requires libapmoncpp")
+ROOT_BUILD_OPTION(monalisa OFF "Monalisa monitoring support, requires libapmoncpp")
 ROOT_BUILD_OPTION(mysql ON "MySQL support, requires libmysqlclient")
-ROOT_BUILD_OPTION(odbc ON "ODBC support, requires libiodbc or libodbc")
+ROOT_BUILD_OPTION(odbc OFF "ODBC support, requires libiodbc or libodbc")
 ROOT_BUILD_OPTION(opengl ON "OpenGL support, requires libGL and libGLU")
 ROOT_BUILD_OPTION(oracle ON "Oracle support, requires libocci")
 ROOT_BUILD_OPTION(pch ON)
@@ -145,18 +145,18 @@
 ROOT_BUILD_OPTION(qt OFF "Qt graphics backend, requires libqt >= 4.8")
 ROOT_BUILD_OPTION(qtgsi OFF "GSI's Qt integration, requires libqt >= 4.8")
 ROOT_BUILD_OPTION(r OFF "R ROOT bindings, requires R, Rcpp and RInside")
-ROOT_BUILD_OPTION(rfio ON "RFIO support, requires libshift from CASTOR >= 1.5.2")
-ROOT_BUILD_OPTION(roofit OFF "Build the libRooFit advanced fitting package")
+ROOT_BUILD_OPTION(rfio OFF "RFIO support, requires libshift from CASTOR >= 1.5.2")
+ROOT_BUILD_OPTION(roofit ON "Build the libRooFit advanced fitting package")
 ROOT_BUILD_OPTION(root7 OFF "Build the ROOT 7 interface prototype, requires >= cxx14")
 ROOT_BUILD_OPTION(rpath OFF "Set run-time library load path on executables and shared libraries (at installation area)")
 ROOT_BUILD_OPTION(ruby OFF "Ruby ROOT bindings, requires ruby >= 1.8")
 ROOT_BUILD_OPTION(runtime_cxxmodules OFF "Enable runtime support for C++ modules.")
-ROOT_BUILD_OPTION(sapdb ON "MaxDB/SapDB support, requires libsqlod and libsqlrte")
-ROOT_BUILD_OPTION(shadowpw ON "Shadow password support")
+ROOT_BUILD_OPTION(sapdb OFF "MaxDB/SapDB support, requires libsqlod and libsqlrte")
+ROOT_BUILD_OPTION(shadowpw OFF "Shadow password support")
 ROOT_BUILD_OPTION(shared ON "Use shared 3rd party libraries if possible")
 ROOT_BUILD_OPTION(soversion OFF "Set version number in sonames (recommended)")
 ROOT_BUILD_OPTION(sqlite ON "SQLite support, requires libsqlite3")
-ROOT_BUILD_OPTION(srp ON "SRP support, requires SRP source tree")
+ROOT_BUILD_OPTION(srp OFF "SRP support, requires SRP source tree")
 ROOT_BUILD_OPTION(ssl ON "SSL encryption support, requires openssl")
 ROOT_BUILD_OPTION(table OFF "Build libTable contrib library")
 ROOT_BUILD_OPTION(tcmalloc OFF "Using the tcmalloc allocator")


fix pointer to 32-bit flatc

fix pointer to 32-bit flatc

--- CMake/FlatBuffersConfig.cmake
+++ CMake/FlatBuffersConfig.cmake
@@ -31,7 +31,7 @@
 SET(FLATBUFFERS_INCLUDE_DIR "${FlatBuffers_ROOT}/include")

 IF("${RADIANT_BUILD_PLATFORM}" STREQUAL "x86")
-  SET(FLATBUFFERS_FLATC_EXECUTABLE "${FlatBuffers_ROOT}/build/Release/flatc.exe")
+  SET(FLATBUFFERS_FLATC_EXECUTABLE "${FlatBuffers_ROOT}/build/x86/Release/flatc.exe")
 ELSE()
   SET(FLATBUFFERS_FLATC_EXECUTABLE "${FlatBuffers_ROOT}/build/x64/Release/flatc.exe")
 ENDIF()


CELIX-393: add_bundle does not work with target libraries.

--- cmake/cmake_celix/Packaging.cmake
+++ cmake/cmake_celix/Packaging.cmake
@@ -262,9 +262,18 @@
         #do nothing
     else() #ACTIVATOR
         bundle_private_libs(${BUNDLE_TARGET_NAME} ${BUNDLE_ACTIVATOR})
-        get_filename_component(ACT_NAME ${BUNDLE_ACTIVATOR} NAME)
-        set_target_properties(${BUNDLE_TARGET_NAME} PROPERTIES "BUNDLE_ACTIVATOR" ${ACT_NAME})
-    endif()
+
+        if(TARGET ${BUNDLE_ACTIVATOR})
+            set_target_properties(${BUNDLE_TARGET_NAME} PROPERTIES "BUNDLE_ACTIVATOR" "$<TARGET_SONAME_FILE_NAME:${BUNDLE_ACTIVATOR}>")
+        elseif(IS_ABSOLUTE ${BUNDLE_ACTIVATOR} AND EXISTS${BUNDLE_ACTIVATOR})
+            get_filename_component(ACT_NAME ${BUNDLE_ACTIVATOR} NAME)
+            set_target_properties(${BUNDLE_TARGET_NAME} PROPERTIES "BUNDLE_ACTIVATOR" "${ACT_NAME}>")
+        else()
+            message(FATAL_ERROR "Provided library (${BUNDLE_ACTIVATOR}) is not a target nor a absolute path to an existing library")
+        endif()
+
+    endif()
+

     bundle_private_libs(${BUNDLE_TARGET_NAME} ${BUNDLE_PRIVATE_LIBRARIES})
     bundle_export_libs(${BUNDLE_TARGET_NAME} ${BUNDLE_EXPORT_LIBRARIES})


cmake: enable conan package option handling

--- cmake/modules/ConanPackages.cmake
+++ cmake/modules/ConanPackages.cmake
@@ -3,7 +3,8 @@
 function(install_conan_packages)
   set(OPTIONS SYSTEM_HEADERS)
   set(SV_ARGUMENTS LIBCXX CONANFILE)
-  cmake_parse_arguments(INSTALL_CONAN "${OPTIONS}" "${SV_ARGUMENTS}" "" ${ARGN})
+  set(MV_ARGUMENTS PKGOPTS)
+  cmake_parse_arguments(INSTALL_CONAN "${OPTIONS}" "${SV_ARGUMENTS}" "${MV_ARGUMENTS}" ${ARGN})

   if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
     set(_COMPILER "gcc")
@@ -46,24 +47,29 @@
     endif()
   endif()

+  if(DEFINED INSTALL_CONAN_PKGOPTS)
+    foreach(OPT ${INSTALL_CONAN_PKGOPTS})
+      set(_OPTIONS ${_OPTIONS} -o ${OPT})
+    endforeach()
+  endif()
+
   message(STATUS "Conan: current conanfile: ${_CONANFILE}")

-  if(NOT EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
-    message(STATUS "Conan: installing packages")
-    get_filename_component(_CONANFILE "${_CONANFILE}" DIRECTORY)
-    execute_process(COMMAND conan
-      install
-      --build=missing
-      --generator=cmake
-      -s compiler=${_COMPILER}
-      -s compiler.version=${_COMPILER_VERSION}
-      -s compiler.libcxx=${_LIBCXX}
-      ${_CONANFILE}
-      OUTPUT_FILE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}_conan_install.log"
-      RESULT_VARIABLE _RESULT)
-    if(${_RESULT})
-      message(FATAL_ERROR "Conan: failed to install packages. Check ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_conan_install.log")
-    endif()
+  message(STATUS "Conan: installing packages")
+  get_filename_component(_CONANFILE "${_CONANFILE}" DIRECTORY)
+  execute_process(COMMAND conan
+    install
+    --build=missing
+    --generator=cmake
+    -s compiler=${_COMPILER}
+    -s compiler.version=${_COMPILER_VERSION}
+    -s compiler.libcxx=${_LIBCXX}
+    ${_OPTIONS}
+    ${_CONANFILE}
+    OUTPUT_FILE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}_conan_install.log"
+    RESULT_VARIABLE _RESULT)
+  if(${_RESULT})
+    message(FATAL_ERROR "Conan: failed to install packages. Check ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_conan_install.log")
   endif()

   include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")


Sugar 1.3.0

Sugar 1.3.0

--- cmake/projects/Sugar/hunter.cmake
+++ cmake/projects/Sugar/hunter.cmake
@@ -4,7 +4,7 @@
 # !!! DO NOT PLACE HEADER GUARDS HERE !!!

 include(hunter_add_version)
-include(hunter_cmake_args)
+include(hunter_cacheable)
 include(hunter_download)
 include(hunter_pick_scheme)

@@ -12,185 +12,13 @@
     PACKAGE_NAME
     Sugar
     VERSION
-    "1.0.0"
+    "1.3.0"
     URL
-    "https://github.com/ruslo/sugar/archive/v1.0.0.tar.gz"
+    "https://github.com/ruslo/sugar/archive/v1.3.0.tar.gz"
     SHA1
-    3f1360e447dd23d3db9ce010e217053deb6aebde
+    155a48bbb588c34afc73dbc6ee87737b8f53f749
 )

-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.1"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.1.tar.gz"
-    SHA1
-    1a8e29badc0e97913996e5228dc9b1788284e416
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.2"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.2.tar.gz"
-    SHA1
-    393a2c190f76f52b253089d0a03c08de562a8622
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.3"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.3.tar.gz"
-    SHA1
-    d0929748df6c4cc7126863d5799018e513c73f27
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.4"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.4.tar.gz"
-    SHA1
-    f5547294647ed386e7bed7fc489f1ba53ab30b57
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.5"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.5.tar.gz"
-    SHA1
-    0b410ec9576be60ac86bf81cf74def4b79efd342
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.6"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.6.tar.gz"
-    SHA1
-    6979695f6802b2c980e453dc2eb3ca1ab6bb9fe0
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.7"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.7.tar.gz"
-    SHA1
-    a364edec71e6d52b809efba833e3041402d2a267
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.8"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.8.tar.gz"
-    SHA1
-    eca1cd13c0399c50c257dcb679c04ca8177307b8
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.9"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.9.tar.gz"
-    SHA1
-    fca4165caa3faa2ec88e207ea009927020e443cb
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.10"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.10.tar.gz"
-    SHA1
-    ca73f6599986089968b112394e9bc7cbb253c574
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.0.11"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.0.11.tar.gz"
-    SHA1
-    ce98a7090a7fbc0197310c7299746568fddf6a43
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.1.0"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.1.0.tar.gz"
-    SHA1
-    29bf1bb1f9920781ab17e8a5c9e329f308be03a8
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.2.0"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.2.0.tar.gz"
-    SHA1
-    cf9e625d6cadcae3c391cdb799171fd4889bc086
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.2.1"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.2.1.tar.gz"
-    SHA1
-    7943038d1c3a418ae1a91ca95ec839cf06f166da
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    Sugar
-    VERSION
-    "1.2.2"
-    URL
-    "https://github.com/ruslo/sugar/archive/v1.2.2.tar.gz"
-    SHA1
-    f33ac0045d6ee4582d41f5290010802ad72fe2fa
-)
-
-# Usually there is no need to specify 'LICENSE' explicitly (one of the defaults).
-# Here it's used to update Hunter cache.
-hunter_cmake_args(
-    Sugar
-    CMAKE_ARGS
-    "HUNTER_INSTALL_LICENSE_FILES=LICENSE"
-)
-
-hunter_pick_scheme(DEFAULT url_sha1_unpack)
+hunter_pick_scheme(DEFAULT url_sha1_cmake)
+hunter_cacheable(Sugar)
 hunter_download(PACKAGE_NAME Sugar)


Use hidden visibility with GCC and Clang am: 0fa7ebccc4
am: 13641fa112

Change-Id: I730cf0e31e73bd1c8925e5bb850992a3d9170053

--- framework/delibs/cmake/CFlags.cmake
+++ framework/delibs/cmake/CFlags.cmake
@@ -53,6 +53,11 @@
 	# Turn on -Wstrict-overflow=5 and check all warnings before removing
 	set(CMAKE_C_FLAGS			"${CMAKE_C_FLAGS} -fwrapv")
 	set(CMAKE_CXX_FLAGS			"${CMAKE_CXX_FLAGS} -fwrapv")
+
+	# Force compiler to not export any symbols.
+	# Any static libraries build are linked into the standalone executable binaries.
+	set(CMAKE_C_FLAGS			"${CMAKE_C_FLAGS} -fvisibility=hidden")
+	set(CMAKE_CXX_FLAGS			"${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
 elseif (DE_COMPILER_IS_MSC)
 	# Compiler flags for msc


cmake: support QUIET argument for find_package

The CMake function `find_package()` supports the flag QUIET.
QUIET will disable informational printing within CMakes own
find_package function.

To align with CMakes find_package, this commit will honor the QUIET flag
and disable informational printing related to package lookup.

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

--- share/zephyr-package/cmake/ZephyrConfig.cmake
+++ share/zephyr-package/cmake/ZephyrConfig.cmake
@@ -10,15 +10,30 @@
 # Set Zephyr base to environment setting.
 # It will be empty if not set in environment.

+# Internal Zephyr CMake package message macro.
+#
+# This macro is only intended to be used within the Zephyr CMake package.
+# The function `find_package()` supports an optional QUIET argument, and to
+# honor that argument, the package_message() macro will not print messages when
+# said flag has been given.
+#
+# Arguments to zephyr_package_message() are identical to regular CMake message()
+# function.
+macro(zephyr_package_message)
+  if(NOT Zephyr_FIND_QUIETLY)
+    message(${ARGN})
+  endif()
+endmacro()
+
 macro(include_boilerplate location)
   set(Zephyr_DIR ${ZEPHYR_BASE}/share/zephyr-package/cmake CACHE PATH
       "The directory containing a CMake configuration file for Zephyr." FORCE
   )
   list(PREPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/cmake/modules)
   if(ZEPHYR_UNITTEST)
-    message(DEPRECATION "The ZephyrUnittest CMake package has been deprecated.\n"
-                        "ZephyrUnittest has been replaced with Zephyr CMake module 'unittest' \n"
-                        "and can be loaded as: 'find_package(Zephyr COMPONENTS unittest)'"
+    zephyr_package_message(DEPRECATION "The ZephyrUnittest CMake package has been deprecated.\n"
+                           "ZephyrUnittest has been replaced with Zephyr CMake module 'unittest' \n"
+                           "and can be loaded as: 'find_package(Zephyr COMPONENTS unittest)'"
     )
     set(ZephyrUnittest_FOUND True)
     set(Zephyr_FIND_COMPONENTS unittest)
@@ -47,10 +62,10 @@
     # and make them more visible to users. This does result in them being output
     # to stderr, but that is an implementation detail of cmake.
     if(components_length EQUAL 0)
-      message(NOTICE "Loading Zephyr default modules (${location}).")
+      zephyr_package_message(NOTICE "Loading Zephyr default modules (${location}).")
       include(zephyr_default NO_POLICY_SCOPE)
     else()
-      message(NOTICE "Loading Zephyr module(s) (${location}): ${Zephyr_FIND_COMPONENTS}")
+      zephyr_package_message(NOTICE "Loading Zephyr module(s) (${location}): ${Zephyr_FIND_COMPONENTS}")
       foreach(component ${Zephyr_FIND_COMPONENTS})
         if(${component} MATCHES "^\([^:]*\):\(.*\)$")
           string(REPLACE "," ";" SUB_COMPONENTS ${CMAKE_MATCH_2})
@@ -60,8 +75,8 @@
       endforeach()
     endif()
   else()
-    message(DEPRECATION "The NO_BOILERPLATE setting has been deprecated.\n"
-                        "Please use: 'find_package(Zephyr COMPONENTS <components>)'"
+    zephyr_package_message(DEPRECATION "The NO_BOILERPLATE setting has been deprecated.\n"
+                           "Please use: 'find_package(Zephyr COMPONENTS <components>)'"
     )
   endif()
 endmacro()


Tell source code whether we use assembler optimizations.

--- cmake/Modules/AR_CompilerSettings.cmake
+++ cmake/Modules/AR_CompilerSettings.cmake
@@ -78,4 +78,7 @@
 message(STATUS "Building with SSE 4.2 optimizations enabled: ${EnableSSE}")
 if(EnableSSE AND NOT MSVC)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
+  add_definitions("-DASM_OPTIMIZATIONS=1")
+else()
+  add_definitions("-DASM_OPTIMIZATIONS=0")
 endif()


Remove -DWIN32 for Msys since that is a Posix environment

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -56,7 +56,3 @@
         add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
     endif (MSVC)
 endif (WIN32)
-
-if (MSYS)
-   add_definitions(-DWIN32)
-endif (MSYS)


posix_eagle_default: define fix for POSIX eagle

--- cmake/configs/posix_eagle_default.cmake
+++ cmake/configs/posix_eagle_default.cmake
@@ -7,7 +7,7 @@

 # This definition allows to differentiate if this just the usual POSIX build
 # or if it is for the Snapdragon.
-set(added_definitions
+add_definitions(
 	-D__PX4_POSIX_EAGLE
 	)


Breakpad now successfully compiles on appveyor

--- cmake/modules/BuildGoogleBreakpad.cmake
+++ cmake/modules/BuildGoogleBreakpad.cmake
@@ -13,9 +13,11 @@
     SOURCE_DIR ${CMAKE_THIRD_PARTY_DIR}/breakpad
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${CMAKE_THIRD_PARTY_DIR}/breakpad/src/tools/gyp/gyp.bat --no-circular-check ${CMAKE_THIRD_PARTY_DIR}/breakpad/src/client/windows/breakpad_client.gyp
-    BUILD_COMMAND msbuild <SOURCE_DIR>/src/client/windows/handler/exception_handler.vcxproj /nologo /t:rebuild /m:2 /property:Configuration=${CONFIGURATION_TYPE}
+    BUILD_COMMAND msbuild <SOURCE_DIR>/src/client/windows/handler/exception_handler.vcxproj /nologo /t:rebuild /m:2 /property:Configuration=${CONFIGURATION_TYPE} /property:WindowsTargetPlatformVersion=10.0.14393.0
     INSTALL_COMMAND ""
   )
+
+  #TODO figure out how to build this without the "/property:WindowsTargetPlatformVersion=10.0.14393.0" setting

   ExternalProject_Add_Step(
     breakpad


By comparing the 2.4.8 and 2.6.0 versions of the corresponding Fortran file,
found additional variables that had to be defined and a few other minor
changes required for CMake-2.6.0.  Note, these additional variables do not
interfere with 2.4.8 so the PLplot Ada bindings and examples now work
equally well for both CMake-2.4.8 and 2.6.0.

svn path=/trunk/; revision=8499

--- cmake/modules/CMakeAdaInformation.cmake
+++ cmake/modules/CMakeAdaInformation.cmake
@@ -41,9 +41,9 @@
   SET(CMAKE_SHARED_LIBRARY_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
 ENDIF(NOT CMAKE_SHARED_LIBRARY_Ada_FLAGS)

-IF(NOT CMAKE_SHARED_LIBRARY_LINK_Ada_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Ada_FLAGS)
   SET(CMAKE_SHARED_LIBRARY_LINK_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_Ada_FLAGS)
+ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Ada_FLAGS)

 IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG)
   SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
@@ -52,6 +52,10 @@
 IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP)
   SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
 ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP)
+
+IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Ada_FLAG)
+  SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_Ada_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
+ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Ada_FLAG)

 # repeat for modules
 IF(NOT CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS)
@@ -70,6 +74,22 @@
   SET(CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP})
 ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP)

+IF(NOT CMAKE_EXECUTABLE_RUNTIME_Ada_FLAG)
+  SET(CMAKE_EXECUTABLE_RUNTIME_Ada_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG})
+ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_Ada_FLAG)
+
+IF(NOT CMAKE_EXECUTABLE_RUNTIME_Ada_FLAG_SEP)
+  SET(CMAKE_EXECUTABLE_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP})
+ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_Ada_FLAG_SEP)
+
+IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_Ada_FLAG)
+  SET(CMAKE_EXECUTABLE_RPATH_LINK_Ada_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Ada_FLAG})
+ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_Ada_FLAG)
+
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Ada_WITH_RUNTIME_PATH)
+  SET(CMAKE_SHARED_LIBRARY_LINK_Ada_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
+ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Ada_WITH_RUNTIME_PATH)
+
 IF(NOT CMAKE_INCLUDE_FLAG_Ada)
   SET(CMAKE_INCLUDE_FLAG_Ada ${CMAKE_INCLUDE_FLAG_C})
 ENDIF(NOT CMAKE_INCLUDE_FLAG_Ada)
@@ -85,7 +105,12 @@

 SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")

-SET (CMAKE_Ada_FLAGS "$ENV{FFLAGS} ${CMAKE_Ada_FLAGS_INIT}" CACHE STRING
+SET(CMAKE_Ada_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Ada_FLAGS_INIT}")
+# avoid just having a space as the initial value for the cache
+IF(CMAKE_Ada_FLAGS_INIT STREQUAL " ")
+  SET(CMAKE_Ada_FLAGS_INIT)
+ENDIF(CMAKE_Ada_FLAGS_INIT STREQUAL " ")
+SET (CMAKE_Ada_FLAGS "${CMAKE_Ada_FLAGS_INIT}" CACHE STRING
      "Flags for Ada compiler.")

 INCLUDE(CMakeCommonLanguageInclude)


COMP: Expose ELASTIX_DIR setting in CMake cache if UseElastix.cmake is not found

--- Modules/Components/Elastix/ModuleElastix.cmake
+++ Modules/Components/Elastix/ModuleElastix.cmake
@@ -9,9 +9,14 @@
   set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
 endif()

+# Find UseElastix.cmake
 if( NOT EXISTS ${ELASTIX_USE_FILE} )
-  option( ELASTIX_USE_FILE "NOT_FOUND" )
-  message( FATAL_ERROR "${MODULE} could not find ELASTIX_USE_FILE. Use the SuperBuild or manually point the ELASTIX_USE_FILE CMake variable to the UseElastix.cmake file in the root of your local elastix build tree." )
+  set( ELASTIX_USE_FILE ${ELASTIX_DIR}/UseElastix.cmake )
+endif()
+
+if( NOT EXISTS ${ELASTIX_USE_FILE} )
+  set( ELASTIX_DIR "" CACHE PATH "Path to elastix build folder" )
+  message(FATAL_ERROR "Could not find UseElastix.cmake. Point ELASTIX_DIR to folder containing UseElastix.cmake or use SuperBuild.")
 endif()

 # Export include files


COMP: add messages when we look for Boost two times

--- Modules/ThirdParty/Boost/otb-module-init.cmake
+++ Modules/ThirdParty/Boost/otb-module-init.cmake
@@ -3,12 +3,14 @@
 endif()

 # Required
+message(STATUS "Looking for required Boost headers")
 find_package ( Boost
   1.35.0
   REQUIRED
   )

 # Optional components
+message(STATUS "Looking for optional Boost commponents : ${OTB_Boost_OPTIONAL_COMPONENTS}")
 find_package ( Boost
   1.35.0
   COMPONENTS ${OTB_Boost_OPTIONAL_COMPONENTS}


Set `CMAKE_ANDROID_ARCH_ABI` to `arm64-v8a`.

	modified:   android.cmake


Updated to C++ 14.

Updated to C++ 14.

--- cmake/CompilerConfig.cmake
+++ cmake/CompilerConfig.cmake
@@ -4,7 +4,7 @@
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 if(NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 11)
-  set(CMAKE_CXX_STANDARD 11)
+  set(CMAKE_CXX_STANDARD 14)
 endif()

 set(CMAKE_POSITION_INDEPENDENT_CODE ON)


Added additional hints for DS linked libraries

--- cmake/FindDataSpaces.cmake
+++ cmake/FindDataSpaces.cmake
@@ -42,32 +42,40 @@
 	    OUTPUT_VARIABLE DSPACES_CONFIG_STRING
 	    ERROR_QUIET
 	    OUTPUT_STRIP_TRAILING_WHITESPACE)
-      string(REPLACE "-L"  ""   LINK_LIBS_ALL   ${DSPACES_CONFIG_STRING})
-      string(REPLACE " -l"  ";"   LINK_LIBS   ${LINK_LIBS_ALL})
+      string(REPLACE "-L"  " "   LINK_LIBS_ALL   ${DSPACES_CONFIG_STRING})
+      string(REPLACE " -l"  " "   LINK_LIBS_B   ${LINK_LIBS_ALL})
+      string(REPLACE " "  ";"   LINK_LIBS   ${LINK_LIBS_B})
 	  set(DATASPACES_LIBRARIES)
 	  set(DATASPACES_LIBRARY_HINT)
 	  foreach(LOOP_VAR ${LINK_LIBS})
-	    STRING(FIND ${LOOP_VAR} "/" HINT_FLG)
+	    STRING(FIND ${LOOP_VAR} "-u" DEL_FLG)
+	    if(("${DEL_FLG}" EQUAL "-1"))
+	        STRING(FIND ${LOOP_VAR} "/" HINT_FLG)
 		if(NOT("${HINT_FLG}" EQUAL "-1"))
-		  string(REPLACE "-L" ";" INCLUDE_DIR ${LOOP_VAR})
-		  list(APPEND DATASPACES_LIBRARY_HINT ${LOOP_VAR})
+		    list(APPEND DATASPACES_LIBRARY_HINT ${LOOP_VAR})
 		else()
-		  unset(LOCAL_LIBRARY CACHE)
-		  STRING(FIND ${LOOP_VAR} "stdc++" CPP_FLG)
-		  if("${CPP_FLG}" EQUAL "-1")
-		    find_library(LOCAL_LIBRARY NAMES "${LOOP_VAR}" HINTS ${DATASPACES_LIBRARY_HINT})
-			list(APPEND DATASPACES_LIBRARIES ${LOCAL_LIBRARY})
-		  endif()
+		    unset(LOCAL_LIBRARY CACHE)
+		    unset(LOCAL_LIBRARY-NOTFOUND CACHE)
+		    STRING(FIND ${LOOP_VAR} "stdc++" CPP_FLG)
+		    if("${CPP_FLG}" EQUAL "-1")
+		        find_library(LOCAL_LIBRARY NAMES "${LOOP_VAR}" HINTS ${DATASPACES_LIBRARY_HINT})
+		        if(LOCAL_LIBRARY)
+			    list(APPEND DATASPACES_LIBRARIES ${LOCAL_LIBRARY})
+		        else()
+			    list(APPEND DATASPACES_LIBRARIES ${LOOP_VAR})
+		        endif()
+		    endif()
 		endif()
-      endforeach()
-	  execute_process(COMMAND ${DSPACES_CONF} -v
+	      endif()
+  	    endforeach()
+	execute_process(COMMAND ${DSPACES_CONF} -v
         RESULT_VARIABLE RESULT_VAR
         OUTPUT_VARIABLE DATASPACES_VERSION
         ERROR_QUIET
         OUTPUT_STRIP_TRAILING_WHITESPACE)
-	endif ()
+    endif ()

-	 set(DATASPACES_INCLUDE_OPTS HINTS ${DATASPACES_ROOT}/include)
+    set(DATASPACES_INCLUDE_OPTS HINTS ${DATASPACES_ROOT}/include)

   endif()


Finish FindLibTooling.cmake.

Finish FindLibTooling.cmake.

--- cmake/FindLibTooling.cmake
+++ cmake/FindLibTooling.cmake
@@ -2,18 +2,72 @@
 # tools using Clang's LibTooling.

 # Once done, the following variables will be defined:
-# - LibTooling_FOUND - system has LibTooling libraries
-# - LibTooling_INCLUDE_DIRS - include directories
-# - LibTooling_LIBRARIES - libraries to link
+# - LIBTOOLING_FOUND - system has LibTooling libraries
+# - LIBTOOLING_INCLUDE_DIRS - include directories
+# - LIBTOOLING_LIBRARIES - libraries to link
+
+# Set the libraries that need to be found:
+set(LIBTOOLING_REQUIRED_LIBS
+    "clangTooling" "clangFrontend" "clangSerialization" "clangDriver"
+    "clangRewriteFrontend" "clangRewriteCore" "clangParse" "clangSema"
+    "clangAnalysis" "clangAST" "clangASTMatchers" "clangEdit" "clangLex"
+    "clangBasic")

 # First, find LLVM
-find_program(LLVM_CONFIG_EXECUTABLE llvm-config DOC "llvm-config executable")
-if(LLVM_CONFIG_EXECUTABLE-NOTFOUND)
+find_program(LLVM_CONFIG_EXECUTABLE "llvm-config" DOC "llvm-config executable")
+mark_as_advanced(LLVM_CONFIG_EXECUTABLE)
+if(LLVM_CONFIG_EXECUTABLE)
+  message(STATUS "llvm-config executable found: ${LLVM_CONFIG_EXECUTABLE}")
+else()
   message(FATAL_ERROR "The `llvm-config` executable was not found. Please "
                       "install LLVM/clang and/or make it available to CMake.")
-else()
-  message(STATUS "llvm-config executable found: ${LLVM_CONFIG_EXECUTABLE}")
 endif()

-# Get auxiliary macros
-include(LibFindMacros)
+# Get version
+execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--version"
+    OUTPUT_VARIABLE LIBTOOLING_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+message(STATUS "LibTooling version: ${LIBTOOLING_VERSION}")
+
+# Get include dir
+execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--includedir"
+    OUTPUT_VARIABLE LIBTOOLING_INCLUDE_DIR
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+message(STATUS "LibTooling include directory: ${LIBTOOLING_INCLUDE_DIR}")
+
+# Get library dir
+execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--libdir"
+    OUTPUT_VARIABLE LIBTOOLING_LIBRARY_DIR
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+message(STATUS "LibTooling library directory: ${LIBTOOLING_LIBRARY_DIR}")
+
+# Find all required libraries
+foreach(_lib ${LIBTOOLING_REQUIRED_LIBS})
+  set(varname "${_lib}_LIBRARY")
+  find_library(${varname} NAME ${_lib} HINTS ${LIBTOOLING_LIBRARY_DIR})
+  mark_as_advanced(${varname})
+  if(${varname})
+    message(STATUS "Found library `${_lib}`: ${${varname}}")
+    set(LIBTOOLING_LIBRARY ${LIBTOOLING_LIBRARY} ${${varname}})
+  else()
+    message(FATAL_ERROR "The library `${_lib}` was not found.")
+  endif()
+endforeach()
+
+# Set include directories and libraries
+set(LIBTOOLING_INCLUDE_DIRS ${LIBTOOLING_INCLUDE_DIR})
+set(LIBTOOLING_LIBRARIES ${LIBTOOLING_LIBRARY})
+
+# Handle standard variables
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibTooling
+    REQUIRED_VARS LIBTOOLING_LIBRARY LIBTOOLING_INCLUDE_DIR
+    VERSION_VAR LIBTOOLING_VERSION)
+mark_as_advanced(LIBTOOLING_FOUND LIBTOOLING_LIBRARY LIBTOOLING_INCLUDE_DIR)
+
+# Save vars to cache that should be user-modifiable
+set(LIBTOOLING_FOUND ${LIBTOOLING_FOUND}
+    CACHE INTERNAL "Save if LibTooling was found.")
+set(LIBTOOLING_LIBRARY ${LIBTOOLING_LIBRARY}
+    CACHE FILEPATH "The LibTooling libraries.")
+set(LIBTOOLING_INCLUDE_DIR ${LIBTOOLING_INCLUDE_DIR}
+    CACHE FILEPATH "The LibTooling include directory.")


cmake: do not cache libusb library if libusb-1.0 headers not found

Library found might be an older libusb version.

Closes #158

Former-commit-id: 12783e1cfd3902954a9513ca1baf53433add742a

--- cmake/Findlibusb-1.0.cmake
+++ cmake/Findlibusb-1.0.cmake
@@ -87,6 +87,7 @@
 	  message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}")
 	endif (NOT libusb_1_FIND_QUIETLY)
   else (LIBUSB_1_FOUND)
+	unset(LIBUSB_1_LIBRARY CACHE)
 	if (libusb_1_FIND_REQUIRED)
 	  message(FATAL_ERROR "Could not find libusb")
 	endif (libusb_1_FIND_REQUIRED)


Fix czmq version needed. Current is 2.2.6

--HG--
branch : correct_czmq_version

--- cmake/SearchForStuff.cmake
+++ cmake/SearchForStuff.cmake
@@ -70,7 +70,7 @@

 #################################################
 # Find czmq.:
-pkg_check_modules(czmq libczmq>=3.0.0)
+pkg_check_modules(czmq libczmq>=2.0.0)

 if (NOT czmq_FOUND)
   message (STATUS "Looking for czmq pkgconfig file - not found")


Remove objective-c flags

Remove objective-c flags

--- cmake/compiler-flags.cmake
+++ cmake/compiler-flags.cmake
@@ -18,8 +18,7 @@
   zero-as-null-pointer-constant

 #experimentals as of gcc-7
-  aggregate-return
-  assign-intercept
+  #aggregate-return # way too exciting
   duplicated-cond
   format-signedness
   invalid-pch


Appveyor:

Appveyor:

-Update OpenAL-Soft to Version 1.18.1 for windows

--- cmake/get-openalsoft.cmake
+++ cmake/get-openalsoft.cmake
@@ -10,7 +10,7 @@

 INCLUDE(ExternalProject)

-set(OPENALSOFT_VERSION "1.17.2")
+set(OPENALSOFT_VERSION "1.18.1")

 # For win32 it's faster to download the pre-compiled development binaries.
 if (WIN32)
@@ -20,7 +20,7 @@
         PREFIX ${DEPENDENCY_EXTRACT_DIR}
         DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
         URL http://kcat.strangesoft.net/openal-binaries/openal-soft-${OPENALSOFT_VERSION}-bin.zip
-        URL_MD5 5f5a0484f8fcc808fead0cd23fd557b4
+        URL_MD5 2bb29a4f20892cce233546839752a221
         INSTALL_DIR ${DEPENDENCY_INSTALL_DIR}
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""
@@ -53,7 +53,7 @@
         PREFIX ${DEPENDENCY_EXTRACT_DIR}
         DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
         URL http://kcat.strangesoft.net/openal-releases/openal-soft-${OPENALSOFT_VERSION}.tar.bz2
-        URL_MD5 1764e0d8fec499589b47ebc724e0913d
+        URL_MD5 04796baf3dcf1d30df631e79d9f96dd7
         INSTALL_DIR ${DEPENDENCY_INSTALL_DIR}
         CMAKE_ARGS ${OPENALSOFT_CMAKE_ARGS}
     )


Add another major version number pattern in find_program (fix to https://github.com/ros/catkin/issues/461)

I'm not sure if this is the best patch for the targetted issue, since I'm not an expert with `cmake`. But this seems to find `nosetests-2.7` on my `QNX`.

--- cmake/test/nosetests.cmake
+++ cmake/test/nosetests.cmake
@@ -88,7 +88,7 @@
 find_program(NOSETESTS nosetests)
 if(NOT nosetests_path)
   # retry with name including major version number
-  find_program(NOSETESTS nosetests2)
+  find_program(NOSETESTS NAMES nosetests2 nosetests-2)
 endif()
 if(NOT NOSETESTS)
   message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python-nose')")


Fix circular dependencies between target and command

this patch could have unknown issues
at least, it was tested with `pkgj`, `jav`, `vitashell` and
`vita-savemgr`

* pkgj: test passed with `ninja` & `make` without any changes
* jav: should change the `kernel_module/CMakeLists.txt`

    ```
    diff --git a/kernel_module/CMakeLists.txt b/kernel_module/CMakeLists.txt
    index 6ad41f1..71de302 100644
    --- a/kernel_module/CMakeLists.txt
    +++ b/kernel_module/CMakeLists.txt
    @@ -41,7 +41,7 @@ add_custom_target("${SELF_C}.target"

     add_custom_command(
       OUTPUT "${SELF_C}"
    -  DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${SELF}"
    +  DEPENDS "${SELF}"
       COMMAND xxd -i "${SELF}" "${SELF_C}"
       COMMENT "Converting ${SELF} to ${SELF_C}"
     )
    ```

* vitashell:
    test passed with `make` without any changes,
    but `ninja` needs to change multiple CMakeLists.txt

    first, I didn't fix the release & send command it's out of the patch
    second, only fixed apth detection code of stub lib files

    after patch, both `ninja` and `make` are passed.

    ```
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index 610a865..fab6163 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -146,7 +146,7 @@ add_dependencies(VitaShell patch.skprx)
     add_dependencies(VitaShell usbdevice.skprx)

     target_link_libraries(VitaShell
    -  ${CMAKE_CURRENT_BINARY_DIR}/modules/user/vitashell_user_stubs/libVitaShellUser_stub_weak.a
    +  ${CMAKE_CURRENT_BINARY_DIR}/modules/user/libVitaShellUser_stub_weak.a
       ftpvita
       vita2d
       vorbisfile
    @@ -212,20 +212,20 @@ vita_create_vpk(VitaShell.vpk ${VITA_TITLEID} eboot.bin
     )

     # for network update
    -add_custom_target(release
    -  COMMAND cp eboot.bin ../release/eboot.bin
    -  COMMAND cp VitaShell.vpk_param.sfo ../release/param.sfo
    -  COMMAND cp VitaShell.vpk ../release/VitaShell.vpk
    -  COMMAND cp ../pkg/sce_sys/livearea/contents/template.xml ../release/template.xml
    -  DEPENDS eboot.bin
    -  DEPENDS VitaShell.vpk
    -  DEPENDS VitaShell.vpk_param.sfo
    -)
    -
    -add_custom_target(send
    -  COMMAND curl -T eboot.bin ftp://$(PSVITAIP):1337/ux0:/app/${VITA_TITLEID}/
    -  DEPENDS eboot.bin
    -)
    +#add_custom_target(release
    +#  COMMAND cp eboot.bin ../release/eboot.bin
    +#  COMMAND cp VitaShell.vpk_param.sfo ../release/param.sfo
    +#  COMMAND cp VitaShell.vpk ../release/VitaShell.vpk
    +#  COMMAND cp ../pkg/sce_sys/livearea/contents/template.xml ../release/template.xml
    +#  DEPENDS eboot.bin
    +#  DEPENDS VitaShell.vpk
    +#  DEPENDS VitaShell.vpk_param.sfo
    +#)
    +
    +#add_custom_target(send
    +#  COMMAND curl -T eboot.bin ftp://$(PSVITAIP):1337/ux0:/app/${VITA_TITLEID}/
    +#  DEPENDS eboot.bin
    +#)

     add_custom_target(copy
       COMMAND cp eboot.bin G:/app/${VITA_TITLEID}/eboot.bin
    diff --git a/modules/user/CMakeLists.txt b/modules/user/CMakeLists.txt
    index caae297..2bf26d5 100644
    --- a/modules/user/CMakeLists.txt
    +++ b/modules/user/CMakeLists.txt
    @@ -24,8 +24,13 @@ add_executable(user

     add_dependencies(user vitashell_kernel_stubs)

    +get_filename_component( kernel_stub
    +  ${CMAKE_CURRENT_BINARY_DIR}/../kernel/libVitaShellKernel2_stub.a
    +  ABSOLUTE
    +)
    +
     target_link_libraries(user
    -  ${CMAKE_CURRENT_BINARY_DIR}/../kernel/vitashell_kernel_stubs/libVitaShellKernel2_stub.a
    +  ${kernel_stub}
       SceLibKernel_stub
       SceIofilemgr_stub
    )
    ```

* vita-savemgr: test passed with `ninja` & `make` without any changes

resolve #134

--- cmake_toolchain/vita.cmake
+++ cmake_toolchain/vita.cmake
@@ -75,10 +75,12 @@
     COMMENT "Converting to Sony ELF ${sourcefile}.velf" VERBATIM
   )

+  set(self_outfile ${CMAKE_CURRENT_BINARY_DIR}/${target}.out)
+
   ## SELF command
   separate_arguments(VITA_MAKE_FSELF_FLAGS)
-  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}
-    COMMAND ${VITA_MAKE_FSELF} ${VITA_MAKE_FSELF_FLAGS} ${CMAKE_CURRENT_BINARY_DIR}/${sourcefile}.velf ${CMAKE_CURRENT_BINARY_DIR}/${target}
+  add_custom_command(OUTPUT ${self_outfile}
+    COMMAND ${VITA_MAKE_FSELF} ${VITA_MAKE_FSELF_FLAGS} ${CMAKE_CURRENT_BINARY_DIR}/${sourcefile}.velf ${self_outfile}
     DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${sourcefile}.velf
     COMMENT "Creating SELF ${target}"
   )
@@ -86,8 +88,10 @@
   ## SELF target
   add_custom_target(${target}
     ALL
-    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${target}
-  )
+    DEPENDS ${self_outfile}
+    COMMAND ${CMAKE_COMMAND} -E copy ${self_outfile} ${target}
+  )
+
   if(TARGET ${source})
     add_dependencies(${target} ${source})
   endif()
@@ -132,11 +136,15 @@
   endif()
   get_filename_component(sourcefile ${sourcepath} NAME)

+  set(target_yml ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}.yml)
+
   ## ELF EXPORT command
   separate_arguments(VITA_ELF_EXPORT_FLAGS)
   get_filename_component(fconfig ${config} ABSOLUTE)
-  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}.yml
-    COMMAND ${VITA_ELF_EXPORT} ${kind} ${VITA_ELF_EXPORT_FLAGS} ${sourcepath} ${fconfig} ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}.yml
+  file(READ ${fconfig} fconfig_content)
+  string(REGEX REPLACE ":.+" "" target-lib ${fconfig_content})
+  add_custom_command(OUTPUT ${target_yml}
+    COMMAND ${VITA_ELF_EXPORT} ${kind} ${VITA_ELF_EXPORT_FLAGS} ${sourcepath} ${fconfig} ${target_yml}
     DEPENDS ${sourcepath}
     DEPENDS ${fconfig}
     COMMENT "Generating imports YAML for ${sourcefile}"
@@ -146,11 +154,38 @@
   separate_arguments(VITA_LIBS_GEN_FLAGS)
   add_custom_target(${target-dir}
     ALL
-    COMMAND ${VITA_LIBS_GEN} ${VITA_LIBS_GEN_FLAGS} ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}.yml ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}
+    COMMAND ${VITA_LIBS_GEN} ${VITA_LIBS_GEN_FLAGS} ${target_yml} ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}
     COMMAND make -C ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}
     DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}.yml
     COMMENT "Building stubs ${target-dir}"
   )
+
+  set(stub_lib lib${target-lib}_stub.a)
+  set(stub_weak_lib lib${target-lib}_stub_weak.a)
+
+  if(${CMAKE_GENERATOR} MATCHES ".*Ninja.*")
+    add_custom_target(${stub_lib}
+      ALL
+      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}/${stub_lib} ${stub_lib}
+      DEPENDS ${target-dir}
+    )
+    add_custom_target(${stub_weak_lib}
+      ALL
+      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}/${stub_weak_lib} ${stub_weak_lib}
+      DEPENDS ${target-dir}
+    )
+  else()
+    add_custom_command(TARGET ${target-dir}
+      POST_BUILD
+      COMMAND ${CMAKE_COMMAND} -E copy
+        ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}/${stub_lib}
+        ${CMAKE_CURRENT_BINARY_DIR}/${stub_lib}
+      COMMAND ${CMAKE_COMMAND} -E copy
+        ${CMAKE_CURRENT_BINARY_DIR}/${target-dir}/${stub_weak_lib}
+        ${CMAKE_CURRENT_BINARY_DIR}/${stub_weak_lib}
+    )
+  endif()
+
   if(TARGET ${source})
     add_dependencies(${target-dir} ${source})
   endif()
@@ -228,10 +263,12 @@
     COMMENT "Generating param.sfo for ${target}"
   )

+  set(vpk_outfile ${CMAKE_CURRENT_BINARY_DIR}/${target}.out)
+
   ## VPK command
   separate_arguments(VITA_PACK_VPK_FLAGS)
-  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}
-    COMMAND ${VITA_PACK_VPK} ${VITA_PACK_VPK_FLAGS} -s ${CMAKE_CURRENT_BINARY_DIR}/${target}_param.sfo -b ${sourcepath} ${CMAKE_CURRENT_BINARY_DIR}/${target}
+  add_custom_command(OUTPUT ${vpk_outfile}
+    COMMAND ${VITA_PACK_VPK} ${VITA_PACK_VPK_FLAGS} -s ${CMAKE_CURRENT_BINARY_DIR}/${target}_param.sfo -b ${sourcepath} ${vpk_outfile}
     DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${target}_param.sfo
     DEPENDS ${sourcepath}
     DEPENDS ${resources}
@@ -241,8 +278,10 @@
   ## VPK target
   add_custom_target(${target}
     ALL
-    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${target}
-  )
+    DEPENDS ${vpk_outfile}
+    COMMAND ${CMAKE_COMMAND} -E copy ${vpk_outfile} ${target}
+  )
+
   if(TARGET ${eboot})
     add_dependencies(${target} ${eboot})
   endif()


Add Solaris sparc  Sun Studio flags

Add Solaris sparc  Sun Studio flags

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -73,18 +73,29 @@
     IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
       IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
         IF(CMAKE_SIZEOF_VOIDP EQUAL 4)
-          # 32 bit - optinmization is -xO2
+          # Solaris x86
           SET(CMAKE_C_FLAGS_RELWITHDEBINFO
             "-g -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
           SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
             "-g0 -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
         ELSE()
-          # 64 bit - optimization is -xO3
+          #  Solaris x64
           SET(CMAKE_C_FLAGS_RELWITHDEBINFO
             "-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
           SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
             "-g0 -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
          ENDIF()
+       ELSE()
+
+          IF(CMAKE_SIZEOF_VOIDP EQUAL 4)
+            # Solaris sparc 32 bit
+            SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-g -xO3 -Xa -xstrconst -mt -xarch=sparc")
+            SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt -xarch=sparc")
+          ELSE()
+            # Solaris sparc 64 bit
+            SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-g -xO3 -Xa -xstrconst -mt")
+            SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt")
+          ENDIF()
        ENDIF()
     ENDIF()
   ENDIF()


Dependency fixes

Dependency fixes

--- external/UseOsgEarth.cmake
+++ external/UseOsgEarth.cmake
@@ -10,7 +10,6 @@
 set(OSGEARTH_GENERATOR ${CMAKE_GENERATOR})

 set(OSGEARTH_ARGS
-     -DCMAKE_CXX_FLAGS:STRING=${OSGEARTH_CXX_FLAGS}
 	   -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
      -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/osg/osgPlugins-3.3.0
      -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/osg/osgPlugins-3.3.0


[CMAKE] Add compiler flags to properties rather than CFLAGS/CXXFLAGS

Summary:
This change the behavior of the `add_(<LANG>_)compiler_flags` macros.
Rather than editing the CFLAGS and/or CXXFLAGS, it adds the flag to the
`COMPILE_OPTIONS` property of the targets in the calling directory and
below that are added after this command is invoked.

The final goal is to avoid changing the CFLAGS/CXXFLAGS, because they
are not linked to target properties and are used in every build,
including the cmake checks such as `check_cxx_source_compiles()`.

Depends on D4948.

Test Plan:
  ninja all check check-security
Run the Gitian builds.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D4947

--- cmake/modules/AddCompilerFlags.cmake
+++ cmake/modules/AddCompilerFlags.cmake
@@ -30,12 +30,21 @@
 	set(${TARGET} ${${TARGET}} PARENT_SCOPE)
 endfunction()

+function(add_compiler_flags_for_language LANGUAGE)
+	foreach(f ${ARGN})
+		check_compiler_flag(FLAG_IS_SUPPORTED ${LANGUAGE} ${f})
+		if(${FLAG_IS_SUPPORTED})
+			add_compile_options($<$<COMPILE_LANGUAGE:${LANGUAGE}>:${f}>)
+		endif()
+	endforeach()
+endfunction()
+
 macro(add_c_compiler_flags)
-	add_compiler_flags_to_var(CMAKE_C_FLAGS C ${ARGN})
+	add_compiler_flags_for_language(C ${ARGN})
 endmacro()

 macro(add_cxx_compiler_flags)
-	add_compiler_flags_to_var(CMAKE_CXX_FLAGS CXX ${ARGN})
+	add_compiler_flags_for_language(CXX ${ARGN})
 endmacro()

 macro(add_compiler_flags)


CMake: RS_TARGET_API is sufficient for Android 4.4

--- cmake/modules/FindRenderScript.cmake
+++ cmake/modules/FindRenderScript.cmake
@@ -1,4 +1,4 @@
-# Module for locating RenderScript.
+# Module for locating Renderscript.
 #
 # Customizable variables:
 #   ANDROID_SOURCE_DIR
@@ -29,19 +29,19 @@
 #
 # Read-only variables:
 #   RENDERSCRIPT_FOUND
-#     Indicates whether RenderScript has been found.
+#     Indicates whether Renderscript has been found.
 #
 #   RS_COMPILER
-#     Specifies the RenderScript compiler executable.
+#     Specifies the Renderscript compiler executable.
 #
 #   RS_FLAGS
-#     Specifies the RenderScript compiler flags.
+#     Specifies the Renderscript compiler flags.
 #
 #   RS_INCLUDE_DIRS
-#     Specifies the RenderScript include directories.
+#     Specifies the Renderscript include directories.
 #
 #   RS_SOURCES
-#     RenderScript source files.
+#     Renderscript source files.
 #
 #   NDK_CXX_COMPILER
 #     Specifies the NDK C++ compiler executable.
@@ -85,15 +85,38 @@
 SET(NDK_CXX_EXECUTABLE NDK_CXX_EXECUTABLE-NOTFOUND)
 SET(NDK_LIBRARY_DIR NDK_LIBRARY_DIR-NOTFOUND)

+IF (RS_TARGET_API STREQUAL "")
+  SET(RS_TARGET_API "0")
+ENDIF ()
+
+IF (${RS_TARGET_API} GREATER 18)
+
+# For Android 4.4 we just need a target API version and the corresponding NDK
+# version installed, which includes the static Renderscript C++ library.
+# (Embedded OpenCL can be omitted for, because it is not available anyway.)
+FIND_PROGRAM(NDK_BUILD_EXECUTABLE
+  NAMES ndk-build
+  DOC "NDK build executable")
+
+FIND_LIBRARY(RS_STATIC_LIBRARY
+  NAME libRScpp_static.a
+  HINTS "${NDK_BUILD_EXECUTABLE}/../platforms/android-${RS_TARGET_API}/arch-arm/usr/lib/rs/"
+  DOC "Renderscript static library")
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (Renderscript REQUIRED_VARS
+  NDK_BUILD_EXECUTABLE RS_STATIC_LIBRARY)
+
+ELSE (${RS_TARGET_API} GREATER 18)
+
 FIND_PATH(RS_INCLUDE_DIR
   NAMES frameworks/rs/scriptc/rs_core.rsh
   HINTS ${ANDROID_SOURCE_DIR}
-  DOC "RenderScript include directory")
+  DOC "Renderscript include directory")

 FIND_PROGRAM(RS_EXECUTABLE
   NAME llvm-rs-cc
   HINTS ${ANDROID_SOURCE_DIR}/out/host/${HOST_TYPE}/bin
-  DOC "RenderScript compiler executable")
+  DOC "Renderscript compiler executable")

 SET (RS_FLAGS -allow-rs-prefix -reflect-c++ -target-api ${RS_TARGET_API} -o ./)

@@ -129,7 +152,7 @@

 MARK_AS_ADVANCED (RS_INCLUDE_DIR RS_EXECUTABLE NDK_CXX_EXECUTABLE NDK_LIBRARY_DIR)

-FIND_PACKAGE_HANDLE_STANDARD_ARGS (RenderScript REQUIRED_VARS
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (Renderscript REQUIRED_VARS
     ANDROID_SOURCE_DIR TARGET_NAME HOST_TYPE NDK_TOOLCHAIN_DIR RS_TARGET_API
     RS_INCLUDE_DIR RS_EXECUTABLE NDK_CXX_EXECUTABLE NDK_LIBRARY_DIR)

@@ -212,3 +235,5 @@
   ENDFOREACH ()
 ENDMACRO ()

+ENDIF (${RS_TARGET_API} GREATER 18)
+


cmake: if not configured by user, enable c++14 for root7

Show correspondent status message

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -308,12 +308,12 @@
 if(root7)
   if(NOT CMAKE_CXX_STANDARD)
       set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++14 standard used with root7")
-  endif()
-  if(NOT CMAKE_CXX_STANDARD GREATER 11)
+      message(STATUS "Enable C++14 for compilation of root7 components")
+  elseif(NOT CMAKE_CXX_STANDARD GREATER 11)
       message(FATAL_ERROR ">>> C++14 standard required with root7")
    endif()
    if(NOT webui AND NOT webui_disabled)
-      set(webui ON CACHE BOOL "(webui build automatically when root7 is enabled)" FORCE)
+      set(webui ON CACHE BOOL "(webui built automatically when root7 is enabled)" FORCE)
    endif()
 endif()


Update ITK version along 4.13 release branch

This patch contains numerous CMake configuration warning fixes.

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

-set(ITK_GIT_TAG "8bbd7e7ac6ee71932bfb4b00a34c70f1ac02f7e7" CACHE
-  STRING "Tag in ITK git repo") # release-4.13
+set(ITK_GIT_TAG "8862e36ad879b46d6cb3e8682852d78d5673accd" CACHE STRING "Tag in ITK git repo") # along release-4.13
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


BUG : VTK repository broken, changed to github repository

--- SuperBuild/External_VTK.cmake
+++ SuperBuild/External_VTK.cmake
@@ -192,7 +192,7 @@
   ### --- End Project specific additions
   # if(USE_VTKv6)
   set(${proj}_GIT_TAG "v7.0.0")
-  set(${proj}_REPOSITORY ${git_protocol}://vtk.org/VTK.git)
+  set(${proj}_REPOSITORY ${git_protocol}://github.com/Kitware/VTK.git)
   # else()
   #   set(${proj}_REPOSITORY ${git_protocol}://github.com/BRAINSia/VTK.git)
   #   set(${proj}_GIT_TAG "FixClangFailure_VTK5.10_release")


debug python target was missing _d

debug python target was missing _d

--- PyPort/system-python.cmake
+++ PyPort/system-python.cmake
@@ -92,7 +92,7 @@
 			#FIXME:
 			# Appveyor does not have the debug libraries. Point to our copy that we have put into GIT. This issue will be fixed on next Image Release
 			# Remove this and python37_d.lib from GIT when the Appveyor image catches up.
-			message("No debug python lib hack")
+			message("Hack to work around missing Python debug library")

 			if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")	# 64 Bit
 				set(platform "x64")
@@ -109,6 +109,6 @@

 	#set a variable to use for linking
-	set(PYTHON_LIBRARIES debug python_target optimized python_target )
+	set(PYTHON_LIBRARIES debug python_target_d optimized python_target )

 endif()


Adjusts the CMAKE install script to not install the E/C-related template files if that's not set as a flag.

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -726,7 +726,34 @@

 if(TORQUE_TEMPLATE)
     message("Prepare Template(${TORQUE_TEMPLATE}) install...")
-    INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game"                 DESTINATION "${TORQUE_APP_DIR}")
+    file(GLOB_RECURSE INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/*")
+
+    IF( NOT TORQUE_EXPERIMENTAL_EC)
+        list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/art/art.module.taml")
+        list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/art/shapes/actors/Soldier/soldier.asset.taml")
+        list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/scripts.module.taml")
+
+        foreach(ITEM ${INSTALL_FILES_AND_DIRS})
+            get_filename_component( dir ${ITEM} DIRECTORY )
+            get_filename_component( fileName ${ITEM} NAME )
+            if( ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/server/components
+                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/server/components/game
+                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/server/components/input
+                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/server/gameObjects
+                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/tools/componentEditor
+                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/tools/componentEditor/gui
+                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/tools/componentEditor/scripts )
+                list(REMOVE_ITEM INSTALL_FILES_AND_DIRS ${dir}/${fileName})
+            ENDIF()
+        endforeach()
+    ENDIF()
+
+    foreach(ITEM ${INSTALL_FILES_AND_DIRS})
+        get_filename_component( dir ${ITEM} DIRECTORY )
+        STRING(REGEX REPLACE "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/" "${TORQUE_APP_DIR}/" INSTALL_DIR ${dir})
+        install( FILES ${ITEM} DESTINATION ${INSTALL_DIR} )
+    endforeach()
+
     if(WIN32)
         INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/cleanShaders.bat"     DESTINATION "${TORQUE_APP_DIR}")
         INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeleteCachedDTSs.bat" DESTINATION "${TORQUE_APP_DIR}")


* BugFix: Correct compiler warnings induced by adding -msse to the compiler commandline on non-x86 devices.

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -29,14 +29,25 @@
     #set(CXX_FLAG32 "-m32") #uncomment for build x32 on OSx64

     if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors -Wno-return-type-c-linkage -Wno-unused-local-typedef ${TORQUE_ADDITIONAL_LINKER_FLAGS}")
-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors -Wno-return-type-c-linkage -Wno-unused-local-typedef ${TORQUE_ADDITIONAL_LINKER_FLAGS}")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAG32} -Wundef -pipe -Wfatal-errors -Wno-return-type-c-linkage -Wno-unused-local-typedef ${TORQUE_ADDITIONAL_LINKER_FLAGS}")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -pipe -Wfatal-errors -Wno-return-type-c-linkage -Wno-unused-local-typedef ${TORQUE_ADDITIONAL_LINKER_FLAGS}")
+
+        # Only use SSE on x86 devices
+        if (TORQUE_CPU_X32 OR TORQUE_CPU_X64)
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse")
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
+        endif()
     else()
-    # default compiler flags
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors -no-pie ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$ORIGIN'")
-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$ORIGIN'")
-
-   endif()
+        # default compiler flags
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAG32} -Wundef -pipe -Wfatal-errors -no-pie ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$ORIGIN'")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -pipe -Wfatal-errors ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$ORIGIN'")
+
+        # Only use SSE on x86 devices
+        if (TORQUE_CPU_X32 OR TORQUE_CPU_X64)
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse")
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
+        endif()
+    endif()

     set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 endif()


small fix on dsn.cmake

small fix on dsn.cmake

--- bin/dsn.cmake
+++ bin/dsn.cmake
@@ -355,7 +355,7 @@
     endif()

     ms_add_project("${MY_PROJ_LANG}" "${MY_PROJ_TYPE}" "${MY_PROJ_NAME}" "${MY_PROJ_SRC}" "${MY_PROJ_INC_PATH}" "${MY_PROJ_LIBS}" "${MY_PROJ_LIB_PATH}" "${MY_BINPLACES}" "${MY_DO_INSTALL}")
-    if(DSN_SERIALIZATION_TYPE STREQUAL "thrift")
+    if(DSN_BUILD_RUNTIME AND (DSN_SERIALIZATION_TYPE STREQUAL "thrift"))
         add_dependencies(${MY_PROJ_NAME} libthrift)
     endif()
 endfunction(dsn_add_project)


Comment a message output.

Comment a message output.

--- bin/dsn.cmake
+++ bin/dsn.cmake
@@ -260,7 +260,7 @@
                 set(TEMP_LIBS dsn.dev.cpp dsn.core)
             endif()
             set(MY_PROJ_LIBS ${MY_PROJ_LIBS} ${MY_BOOST_LIBS} ${TEMP_LIBS})
-			message(STATUS "MY_PROJ_LIBS = ${MY_PROJ_LIBS}")
+			#message(STATUS "MY_PROJ_LIBS = ${MY_PROJ_LIBS}")
         endif()
      endif()


refactor

refactor

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -322,7 +322,7 @@
 	include_directories(..)
 	include_directories(h)
 	foreach(INCLUDE_DIR ${CMAKI_INCLUDE_DIRS})
-		target_include_directories(${_EXECUTABLE_NAME} ${INCLUDE_DIR})
+		include_directories(${INCLUDE_DIR})
 	endforeach()
 	if(HAVE_PTHREADS)
 		add_compile_options(-pthread)
@@ -357,7 +357,7 @@
 	include_directories(..)
 	include_directories(h)
 	foreach(INCLUDE_DIR ${CMAKI_INCLUDE_DIRS})
-		target_include_directories(${_LIBRARY_NAME} ${INCLUDE_DIR})
+		include_directories(${INCLUDE_DIR})
 	endforeach()
 	if(HAVE_PTHREADS)
 		add_compile_options(-pthread)
@@ -384,7 +384,7 @@
 	cmaki_parse_parameters(${ARGV})
 	set(_TEST_NAME ${_MAIN_NAME})
 	foreach(INCLUDE_DIR ${CMAKI_INCLUDE_DIRS})
-		target_include_directories(${_TEST_NAME}_exe ${INCLUDE_DIR})
+		include_directories(${INCLUDE_DIR})
 	endforeach()
 	add_compile_options(-pthread)
 	add_executable(${_TEST_NAME}_exe ${_SOURCES})


fix(cmake): Use VENDOR_SOURCES instead of SOURCES

--- vendor.cmake
+++ vendor.cmake
@@ -1,6 +1,6 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

-set(SOURCES ${SOURCES}
+set(VENDOR_SOURCES ${VENDOR_SOURCES}
             ${CMAKE_CURRENT_LIST_DIR}/src/plugin.h
             ${CMAKE_CURRENT_LIST_DIR}/src/core/device.h
             ${CMAKE_CURRENT_LIST_DIR}/src/core/units.h


Revert "CMake: Silence warning w654 with icc: "overloaded virtual function is only partially overriden" - I assume this is intended..."

No not intended and we schould fix it..

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@32814 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_compiler_flags_intel.cmake
+++ deal.II/cmake/setup_compiler_flags_intel.cmake
@@ -91,7 +91,6 @@
 #           references; however, it's the only useful way to do
 #           so if you need an invalid value for a reference)
 #   -w383  value copied to temporary, reference to temporary used
-#   -w654  overloaded virtual function is only partially overriden
 #   -w981  operands are evaluated in unspecified order
 #   -w1418 external function definition with no prior declaration
 #          (happens in boost)
@@ -111,7 +110,6 @@
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd279")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd327")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd383")
-ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd654")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd981")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1418")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1478")


FIX (#4432): removed components, added "Release" intermediate dir

works now for ExtApp Windows with CPack

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -437,7 +437,7 @@
      RUNTIME DESTINATION bin
    )
   ELSE()
-   INSTALL(TARGETS ${_install_TARGETS} ${_install_EXECUTABLES}
+   INSTALL(TARGETS ${_install_TARGETS} ${_install_EXECUTABLES} CONFIGURATIONS Release
      BUNDLE DESTINATION .
      RUNTIME DESTINATION bin
      # LIBRARY DESTINATION lib/mitk/
@@ -466,8 +466,8 @@
   SET(intermediate_dir Release)
 ENDIF()
 SET(DIRS
-  ${VTK_RUNTIME_LIBRARY_DIRS}
-  ${ITK_LIBRARY_DIRS}
+  ${VTK_RUNTIME_LIBRARY_DIRS}/${intermediate_dir}
+  ${ITK_LIBRARY_DIRS}/${intermediate_dir}
   ${QT_LIBRARY_DIR}
   ${MITK_BINARY_DIR}/bin/${intermediate_dir}
   ${_install_LIBRARY_DIRS}
@@ -490,14 +490,14 @@
   INSTALL(DIRECTORY "${QT_PLUGINS_DIR}"
           DESTINATION ${plugin_dest_dir}
 		  CONFIGURATIONS Release
-		  COMPONENT Runtime
+
 		  FILES_MATCHING REGEX "[^d]4\\.dll$"
 		  )

   INSTALL(DIRECTORY "${QT_PLUGINS_DIR}"
           DESTINATION ${plugin_dest_dir}
 		  CONFIGURATIONS Debug
-		  COMPONENT Runtime
+
 		  FILES_MATCHING PATTERN "*d4.dll"
 		  )

@@ -506,7 +506,7 @@
   # this inserts some cmake code into the install script to write the file
   INSTALL(CODE "
       file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"\")
-      " COMPONENT Runtime)
+      ")

@@ -589,7 +589,7 @@
     SET(CMAKE_MODULE_PATH ${MITK_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
     include(BundleUtilities)
     fixup_bundle(\"${_target_location}\" \"\${PLUGINS}\" \"\${PLUGIN_DIRS}\")
-    " COMPONENT Runtime)
+    ")

 ELSE(_install_GLOB_PLUGINS)

@@ -598,7 +598,7 @@
     SET(CMAKE_MODULE_PATH ${MITK_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
     include(BundleUtilities)
     fixup_bundle(\"${_target_location}\" \"${_install_PLUGINS}\" \"${DIRS}\")
-    " COMPONENT Runtime)
+    ")

 ENDIF(_install_GLOB_PLUGINS)


ios: link against libfreerdp-client-combined.a

--- client/iOS/iFreeRDP.xcodeproj/project.pbxproj.cmake
+++ client/iOS/iFreeRDP.xcodeproj/project.pbxproj.cmake
@@ -118,6 +118,7 @@
 		C495F01816B937F90041304E /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01616B937F90041304E /* libssl.a */; };
 		C495F01A16B938210041304E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01916B938210041304E /* Security.framework */; };
 		C495F01E16B938CB0041304E /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01D16B938CA0041304E /* SystemConfiguration.framework */; };
+		C4B6A8821701979900AA836E /* libfreerdp-client-combined.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */; };
 		C4C31C6F16BAD1890087BB12 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C4C31C6E16BAD1890087BB12 /* Default-568h@2x.png */; };
 /* End PBXBuildFile section */

@@ -280,6 +281,7 @@
 		C495F01616B937F90041304E /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = @FREERDP_IOS_EXTERNAL_SSL_PATH@/lib/libssl.a; sourceTree = "<group>"; };
 		C495F01916B938210041304E /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
 		C495F01D16B938CA0041304E /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+		C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfreerdp-client-combined.a"; path = "../common/libfreerdp-client-combined.a"; sourceTree = "<group>"; };
 		C4C31C6E16BAD1890087BB12 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Resources/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
 /* End PBXFileReference section */

@@ -297,6 +299,7 @@
 				C495EE3816B8372D0041304E /* CoreGraphics.framework in Frameworks */,
 				C495F01A16B938210041304E /* Security.framework in Frameworks */,
 				C495F01E16B938CB0041304E /* SystemConfiguration.framework in Frameworks */,
+				C4B6A8821701979900AA836E /* libfreerdp-client-combined.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -323,6 +326,7 @@
 		C495EE3216B8372D0041304E /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */,
 				C495EFAA16B912C40041304E /* libfreerdp.a */,
 				C495EFAD16B913980041304E /* libwinpr.a */,
 				C495F01516B937F80041304E /* libcrypto.a */,
@@ -744,9 +748,7 @@
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"DEBUG=1",
-				);
+				GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNINITIALIZED_AUTOS = YES;


Fix installing .pdb files on Windows.

Fix installing .pdb files on Windows.

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -191,25 +191,7 @@
 endfunction(ogre_config_lib)

 function(ogre_config_component LIBNAME)
-  ogre_config_common(${LIBNAME})
-  ogre_install_target(${LIBNAME} "" TRUE)
-
-  if (MINGW)
-	# remove lib prefix from DLL outputs
-	set_target_properties(${LIBNAME} PROPERTIES PREFIX "")
-  endif ()
-
-  if (OGRE_INSTALL_PDB)
-    # install debug pdb files
-    install(FILES ${OGRE_BINARY_DIR}/lib${OGRE_DEBUG_PATH}/${LIBNAME}_d.pdb
-	  DESTINATION bin${OGRE_DEBUG_PATH}
-	  CONFIGURATIONS Debug
-	)
-	install(FILES ${OGRE_BINARY_DIR}/lib${OGRE_RELWDBG_PATH}/${LIBNAME}.pdb
-	  DESTINATION bin${OGRE_RELWDBG_PATH}
-	  CONFIGURATIONS RelWithDebInfo
-	)
-  endif ()
+  ogre_config_lib(${LIBNAME} FALSE)
 endfunction(ogre_config_component)

@@ -296,7 +278,7 @@

 function(ogre_config_sample_exe SAMPLENAME)
   ogre_config_sample_common(${SAMPLENAME})
-  if (OGRE_INSTALL_PDB)
+  if (OGRE_INSTALL_PDB AND OGRE_INSTALL_SAMPLES)
 	  # install debug pdb files - no _d on exe
 	  install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${SAMPLENAME}.pdb
 		  DESTINATION bin${OGRE_DEBUG_PATH}
@@ -311,7 +293,7 @@

 function(ogre_config_sample_lib SAMPLENAME)
   ogre_config_sample_common(${SAMPLENAME})
-  if (OGRE_INSTALL_PDB)
+  if (OGRE_INSTALL_PDB AND OGRE_INSTALL_SAMPLES)
 	  # install debug pdb files - with a _d on lib
 	  install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${SAMPLENAME}_d.pdb
 		  DESTINATION bin${OGRE_DEBUG_PATH}


CMake on OS X - symlink the frameworks into each .app to make them pseudo-local (real apps would copy)

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -130,9 +130,25 @@
     set_property(TARGET ${SAMPLENAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
   endif ()

-  # On OS X, create .app bundle
   if (APPLE)
+    # On OS X, create .app bundle
     set_property(TARGET ${SAMPLENAME} PROPERTY MACOSX_BUNDLE TRUE)
+    # also, symlink frameworks so .app is standalone
+    # NOTE: $(CONFIGURATION) is not resolvable at CMake run time, it's only
+    # valid at build time (hence parenthesis rather than braces)
+    set (OGRE_SAMPLE_CONTENTS_PATH
+      ${CMAKE_BINARY_DIR}/bin/$(CONFIGURATION)/${SAMPLENAME}.app/Contents)
+    add_custom_command(TARGET ${SAMPLENAME} POST_BUILD
+      COMMAND mkdir ARGS -p ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks
+      COMMAND ln ARGS -s -f ${CMAKE_BINARY_DIR}/lib/$(CONFIGURATION)/Ogre.framework
+        ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
+      COMMAND ln ARGS -s -f ${CMAKE_SOURCE_DIR}/Dependencies/Cg.framework
+        ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
+      COMMAND ln ARGS -s -f ${CMAKE_SOURCE_DIR}/Dependencies/CEGUI.framework
+        ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
+    )
+
+
   endif ()

   if (OGRE_INSTALL_SAMPLES)


[iOS] Use Dwarf debug info format in debug builds rather than Dwarf with dSYM to speed up compilation (Apple does the same in iOS templates)

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -178,6 +178,7 @@
     set_target_properties(${TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_UNROLL_LOOPS "YES")
     set_target_properties(${TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
     set_target_properties(${TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
+    set_target_properties(${TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf$<$<NOT:$<CONFIG:Debug>>:-with-dsym>")
   endif(OGRE_BUILD_PLATFORM_APPLE_IOS)

   if(NOT OGRE_STATIC AND (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"))


ffmpeg use script: libraries ordered by dependency

* issue https://github.com/smanders/externpro/issues/17#issuecomment-353437620

--- projects/use/usexp-ffmpeg-config.cmake
+++ projects/use/usexp-ffmpeg-config.cmake
@@ -16,13 +16,13 @@
 set(reqVars ${PRJ}_INCLUDE_DIR)
 if(WIN32)
   set(${PRJ}_LIBRARIES
+    avdevice${ver}.lib
+    avformat${ver}.lib
+    avfilter${ver}.lib
     avcodec${ver}.lib
-    avdevice${ver}.lib
-    avfilter${ver}.lib
-    avformat${ver}.lib
-    avutil${ver}.lib
     swresample${ver}.lib
     swscale${ver}.lib
+    avutil${ver}.lib
     )
   link_directories(${XP_ROOTDIR}/lib)
   set(${PRJ}_DLLS


modules: updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -3,7 +3,7 @@
 # Basic usage:
 #  find_package(Corrade [REQUIRED])
 # This module tries to find Corrade library and then defines:
-#  CORRADE_FOUND                    - True if Corrade library is found
+#  CORRADE_FOUND                    - True if Corrade is found
 #  CORRADE_INCLUDE_DIR              - Root include dir
 #  CORRADE_INTERCONNECT_LIBRARIES   - Interconnect library and dependent
 #   libraries
@@ -14,9 +14,14 @@
 #  CORRADE_TESTSUITE_LIBRARIES      - TestSuite library and dependent
 #   libraries
 #  CORRADE_RC_EXECUTABLE            - Resource compiler executable
+# The package is found if either debug or release version of each library is
+# found. If both debug and release libraries are found, proper version is
+# chosen based on actual build configuration of the project (i.e. Debug build
+# is linked to debug libraries, Release build to release libraries).
+#
 # Corrade configures the compiler to use C++11 standard. Additionally you can
-# use CORRADE_CXX_FLAGS to enable additional pedantic set of warnings and enable
-# hidden visibility by default.
+# use CORRADE_CXX_FLAGS to enable additional pedantic set of warnings and
+# enable hidden visibility by default.
 #
 # Features of found Corrade library are exposed in these variables:
 #  CORRADE_GCC47_COMPATIBILITY  - Defined if compiled with compatibility
@@ -83,7 +88,7 @@
 # The macro adds preprocessor directive CORRADE_STATIC_PLUGIN. Additional
 # libraries can be linked in via target_link_libraries(plugin_name ...). If
 # install_dir is set to CMAKE_CURRENT_BINARY_DIR (e.g. for testing purposes),
-# no installation is performed.
+# no installation rules are added.
 #
 #
 # Additionally these variables are defined for internal usage:
@@ -93,6 +98,9 @@
 #  CORRADE_PLUGINMANAGER_LIBRARY    - Plugin manager library (w/o
 #   dependencies)
 #  CORRADE_TESTSUITE_LIBRARY        - TestSuite library (w/o dependencies)
+#  CORRADE_*_LIBRARY_DEBUG          - Debug version of given library, if found
+#  CORRADE_*_LIBRARY_RELEASE        - Release version of given library, if
+#                                     found
 #

 #
@@ -121,10 +129,28 @@
 #

 # Libraries
-find_library(CORRADE_INTERCONNECT_LIBRARY CorradeInterconnect)
-find_library(CORRADE_UTILITY_LIBRARY CorradeUtility)
-find_library(CORRADE_PLUGINMANAGER_LIBRARY CorradePluginManager)
-find_library(CORRADE_TESTSUITE_LIBRARY CorradeTestSuite)
+foreach(_component Interconnect Utility PluginManager TestSuite)
+    string(TOUPPER ${_component} _COMPONENT)
+
+    # Try to find both debug and release version
+    find_library(CORRADE_${_COMPONENT}_LIBRARY_DEBUG Corrade${_component}-d)
+    find_library(CORRADE_${_COMPONENT}_LIBRARY_RELEASE Corrade${_component})
+
+    # Set the _LIBRARY variable based on what was found
+    if(CORRADE_${_COMPONENT}_LIBRARY_DEBUG AND CORRADE_${_COMPONENT}_LIBRARY_RELEASE)
+        set(CORRADE_${_COMPONENT}_LIBRARY
+            debug ${CORRADE_${_COMPONENT}_LIBRARY_DEBUG}
+            optimized ${CORRADE_${_COMPONENT}_LIBRARY_RELEASE})
+    elseif(CORRADE_${_COMPONENT}_LIBRARY_DEBUG)
+        set(CORRADE_${_COMPONENT}_LIBRARY ${CORRADE_${_COMPONENT}_LIBRARY_DEBUG})
+    elseif(CORRADE_${_COMPONENT}_LIBRARY_RELEASE)
+        set(CORRADE_${_COMPONENT}_LIBRARY ${CORRADE_${_COMPONENT}_LIBRARY_RELEASE})
+    endif()
+
+    mark_as_advanced(CORRADE_${_COMPONENT}_LIBRARY_DEBUG
+        CORRADE_${_COMPONENT}_LIBRARY_RELEASE
+        CORRADE_${_COMPONENT}_LIBRARY)
+endforeach()

 # RC executable
 find_program(CORRADE_RC_EXECUTABLE corrade-rc)
@@ -222,11 +248,7 @@
     set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARIES} log)
 endif()

-mark_as_advanced(CORRADE_UTILITY_LIBRARY
-    CORRADE_INTERCONNECT_LIBRARY
-    CORRADE_PLUGINMANAGER_LIBRARY
-    CORRADE_TESTSUITE_LIBRARY
-    _CORRADE_INCLUDE_DIR
+mark_as_advanced(_CORRADE_INCLUDE_DIR
     _CORRADE_MODULE_DIR)

 # Add Corrade dir to include path if this is deprecated build


Put print_info in the ArrayFire_BINARY_DIR for all Operating systems

The windows runtime binary directory is different than other operating
systems. This causes issues with the print_info command in the
CTEST_CUSTOM_POST_TEST command because it is located in a different
location on windows. This sets the runtime output directory to the
same location on all OSs for print_info

--- CMakeModules/CTestCustom.cmake
+++ CMakeModules/CTestCustom.cmake
@@ -7,7 +7,11 @@

 set(CTEST_CUSTOM_ERROR_POST_CONTEXT 50)
 set(CTEST_CUSTOM_ERROR_PRE_CONTEXT 50)
-set(CTEST_CUSTOM_POST_TEST ./test/print_info)
+if(WIN32)
+  set(CTEST_CUSTOM_POST_TEST ./bin/print_info.exe)
+else()
+  set(CTEST_CUSTOM_POST_TEST ./test/print_info)
+endif()

 list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
   "test"


Updating DAE support for vc141 (VisualStudio2017), aligned with 3rdParty package

--- CMakeModules/FindCOLLADA.cmake
+++ CMakeModules/FindCOLLADA.cmake
@@ -29,9 +29,12 @@
 ELSEIF(MINGW)
     SET(COLLADA_BUILDNAME "mingw")
     SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
-ELSEIF((MSVC_VERSION GREATER 1900) OR (MSVC_VERSION EQUAL 1900))
+ELSEIF(MSVC_VERSION GREATER_EQUAL 1910)
     SET(COLLADA_BUILDNAME "vc14")
-    SET(COLLADA_BOOST_BUILDNAME "vc140")
+    SET(COLLADA_BOOST_BUILDNAME "vc141")
+ELSEIF(MSVC_VERSION EQUAL 1900)
+    SET(COLLADA_BUILDNAME "vc14")
+    SET(COLLADA_BOOST_BUILDNAME "vc140")
 ELSEIF(MSVC_VERSION EQUAL 1800)
     SET(COLLADA_BUILDNAME "vc12")
     SET(COLLADA_BOOST_BUILDNAME "vc120")


Silence debug output

Silence debug output

--- CMakeModules/clang-tools.cmake
+++ CMakeModules/clang-tools.cmake
@@ -5,7 +5,6 @@
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
     OUTPUT_VARIABLE ALL_CXX_SOURCE_FILES
     )
-message(STATUS ${ALL_CXX_SOURCE_FILES})
 ############ clang-tidy ############

 # Try to find clang-format and add target if successful


Set the correct branch to use for DiapOTB

--- Modules/Remote/diapotb.remote.cmake
+++ Modules/Remote/diapotb.remote.cmake
@@ -22,5 +22,5 @@
 otb_fetch_module(DiapOTBModule
   "OTB module for SAR processing in Diapason."
   GIT_REPOSITORY https://gitlab.orfeo-toolbox.org/remote_modules/diapotb.git
-  GIT_TAG f84b85352abb75ff3eefafdf0480fcde7fa06173
+  GIT_TAG 3a058ebdf2a1dc18d5136f322324837065d5ef75
 )


ENH: Use KWMedical's MinimalPathExtraction module, works with older itk

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -50,8 +50,8 @@
 set( LIBSVM_HASH_OR_TAG 9e2dd8a5fd032b429c07ce2778c8716117812bc5 )

 set( MinimalPathExtraction_URL
-  ${git_protocol}://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction.git )
-set( MinimalPathExtraction_HASH_OR_TAG 611676c916310b05ea6c5e6b7804df72f8d20807 )
+  ${git_protocol}://github.com/KitwareMedical/ITKMinimalPathExtraction.git )
+set( MinimalPathExtraction_HASH_OR_TAG 51b1c2c97e9f12fb38039e8546612c452b512695 )

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


COMP: Update ITK to address itk::NumericTraits::Zero build errors.

This includes
InsightSoftwareConsortium/ITK@5aa604c9942612957dd0d6f2bf8f2fbca928885b
which should address dashboard build errors like:

   TubeTK-Debug/TubeTK-build/ITKModules/MinimalPathExtraction/test/MinimalPathTest.h:211:
   undefined reference to `itk::NumericTraits::Zero'

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -87,7 +87,7 @@

 # Insight Segmentation and Registration Toolkit
 set( ITK_URL ${github_protocol}://github.com/Slicer/ITK.git )
-set( ITK_HASH_OR_TAG 9fa8f6333a4d66f31f26527b2eb23e170a0e6e16 )
+set( ITK_HASH_OR_TAG 58a7203f9ec431f9fe71ac087d0bd7e02b495634 )

 # Slicer Execution Model
 set( SlicerExecutionModel_URL


FIX: PluginFramework: Fix changed variable behavior due to changing the macro to a function.

--- CMake/ctkFunctionGeneratePluginManifest.cmake
+++ CMake/ctkFunctionGeneratePluginManifest.cmake
@@ -88,6 +88,8 @@
   FILE(WRITE "${_manifest_filepath}" "${_manifest_content}")
   FILE(WRITE "${_manifest_qrc_filepath}" "${_manifest_qrc_content}")

-  QT4_ADD_RESOURCES(${QRC_SRCS} ${_manifest_qrc_filepath})
+  QT4_ADD_RESOURCES(_qrc_src ${_manifest_qrc_filepath})
+
+  SET(${QRC_SRCS} ${${QRC_SRCS}} ${_qrc_src} PARENT_SCOPE)

 ENDFUNCTION()


Corrected Boost_LIBRARY_DIRS to Boost_LIBRARY_DIR.

--- CMake/mitkFunctionGetLibrarySearchPaths.cmake
+++ CMake/mitkFunctionGetLibrarySearchPaths.cmake
@@ -24,7 +24,7 @@
     list(APPEND _dir_candidates ${CTK_PYTHONQT_INSTALL_DIR}/bin)
   endif()
   if(MITK_USE_Boost AND MITK_USE_Boost_LIBRARIES AND NOT MITK_USE_SYSTEM_Boost)
-    list(APPEND _dir_candidates ${Boost_LIBRARY_DIRS})
+    list(APPEND _dir_candidates ${Boost_LIBRARY_DIR})
   endif()
   if(ACVD_DIR)
     list(APPEND _dir_candidates ${ACVD_DIR}/bin)


Fix OpenMP support for Clang on macOS

Fix OpenMP support for Clang on macOS

--- CMake/Common.cmake
+++ CMake/Common.cmake
@@ -36,8 +36,12 @@
 if(USE_OpenMP)
 	FIND_PACKAGE(OpenMP)
 	if(OPENMP_FOUND)
-		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
-		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+		if (CMAKE_VERSION VERSION_GREATER "3.8")
+			link_libraries(OpenMP::OpenMP_CXX)
+		else()
+			SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+			SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+		endif()
 	endif()
 endif()


Bugfix: when crosscompiling for Windows, use `-DASIO_STANDALONE`.

This fixes the bug:

[ 29%] Building CXX object CMakeFiles/ylikuutio.dir/code/ylikuutio/network/tcp_connection.cpp.obj
In file included from /home/someuser/code/ylikuutio/external/asio/asio/include/asio/associated_allocator.hpp:18:0,
                 from /home/someuser/code/ylikuutio/external/asio/asio/include/asio.hpp:18,
                 from /home/someuser/code/ylikuutio/code/ylikuutio/network/tcp_connection.hpp:2,
                 from /home/someuser/code/ylikuutio/code/ylikuutio/network/tcp_connection.cpp:1:
/home/someuser/code/ylikuutio/external/asio/asio/include/asio/detail/config.hpp:26:29: fatal error: boost/config.hpp: No such file or directory
 # include <boost/config.hpp>
                             ^
compilation terminated.
CMakeFiles/ylikuutio.dir/build.make:963: recipe for target 'CMakeFiles/ylikuutio.dir/code/ylikuutio/network/tcp_connection.cpp.obj' failed
make[2]: *** [CMakeFiles/ylikuutio.dir/code/ylikuutio/network/tcp_connection.cpp.obj] Error 1
CMakeFiles/Makefile2:332: recipe for target 'CMakeFiles/ylikuutio.dir/all' failed
make[1]: *** [CMakeFiles/ylikuutio.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

However, crosscompiling Asio from Linux to Windows still does not work.

[  9%] Building CXX object CMakeFiles/ylikuutio.dir/code/ylikuutio/network/tcp_connection.cpp.obj
In file included from /home/someuser/code/ylikuutio/external/asio/asio/include/asio/associated_allocator.hpp:18:0,
                 from /home/someuser/code/ylikuutio/external/asio/asio/include/asio.hpp:18,
                 from /home/someuser/code/ylikuutio/code/ylikuutio/network/tcp_connection.hpp:2,
                 from /home/someuser/code/ylikuutio/code/ylikuutio/network/tcp_connection.cpp:1:
/home/someuser/code/ylikuutio/external/asio/asio/include/asio/detail/config.hpp:867:5: warning: #warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. [-Wcpp]
 #   warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
     ^~~~~~~
/home/someuser/code/ylikuutio/external/asio/asio/include/asio/detail/config.hpp:868:5: warning: #warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line. [-Wcpp]
 #   warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line.
     ^~~~~~~
/home/someuser/code/ylikuutio/external/asio/asio/include/asio/detail/config.hpp:869:5: warning: #warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). [-Wcpp]
 #   warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).
     ^~~~~~~
In file included from /home/someuser/code/ylikuutio/external/asio/asio/include/asio/use_future.hpp:138:0,
                 from /home/someuser/code/ylikuutio/external/asio/asio/include/asio.hpp:129,
                 from /home/someuser/code/ylikuutio/code/ylikuutio/network/tcp_connection.hpp:2,
                 from /home/someuser/code/ylikuutio/code/ylikuutio/network/tcp_connection.cpp:1:
/home/someuser/code/ylikuutio/external/asio/asio/include/asio/impl/use_future.hpp: In function ‘void asio::detail::promise_invoke_and_set(std::promise<void>&, F&, Args&& ...)’:
/home/someuser/code/ylikuutio/external/asio/asio/include/asio/impl/use_future.hpp:62:6: error: invalid use of incomplete type ‘class std::promise<void>’
     p.set_value();
      ^

(the rest of the compiler error message above is cut off by me)

This is probably caused by the lack of support of `std::promise` in
MinGW's g++ (`/usr/bin/x86_64-w64-mingw32-g++`).

	modified:   w64.cmake

--- w64.cmake
+++ w64.cmake
@@ -21,7 +21,7 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

-set(CMAKE_CXX_FLAGS "-std=c++11 -static-libgcc -static-libstdc++ -static -O3 -s")
+set(CMAKE_CXX_FLAGS "-DASIO_STANDALONE -std=c++11 -static-libgcc -static-libstdc++ -static -O3 -s")
 set(CMAKE_C_FLAGS "-static-libgcc -static-libstdc++ -static -O3 -s")
 set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-static-libgcc -static-libstdc++ -static -O3 -s")
 set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-std=c++11 -static-libgcc -static-libstdc++ -static -O3 -s")


exclude 24 pixels

exclude 24 pixels

--- KF5KirigamiMacros.cmake
+++ KF5KirigamiMacros.cmake
@@ -24,9 +24,7 @@
         if (NOT EXISTS ${path})
              file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/32/${icon}.svg )
             if (NOT EXISTS ${path})
-                file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/24/${icon}.svg )
-                if (NOT EXISTS ${path})
-                    file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/22/${icon}.svg )
+                file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/22/${icon}.svg )
                 endif()
             endif()
         endif()


Trying to use C++11 [ci skip].

Trying to use C++11 [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -195,10 +195,6 @@

         SET(CMAKE_OSX_DEPLOYMENT_TARGET ${OLDEST_OS_X_VERSION_NUMBER})
         SET(CMAKE_OSX_SYSROOT ${OLDEST_SDK_PATH})
-SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
-SET(CMAKE_OSX_SYSROOT /Users/Alan/SDKs/MacOSX.platform/MacOSX10.7.sdk)
-MESSAGE(">>> CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
-MESSAGE(">>> CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT}")
     ENDIF()

     # Location of our plugins so that we don't have to deploy OpenCOR on


Slight update to our common CMake file.

Slight update to our common CMake file.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -46,18 +46,21 @@
     # By default, we are building a release version of OpenCOR, unless we are
     # explicitly asked for a debug version

-    IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+    IF(   "${CMAKE_BUILD_TYPE}" STREQUAL ""
+       OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+        IF(SHOW_INFORMATION_MESSAGE)
+            SET(BUILD_INFORMATION "Building a release version of ${CMAKE_PROJECT_NAME}")
+        ENDIF()
+
+        SET(RELEASE_MODE TRUE)
+    ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
         IF(SHOW_INFORMATION_MESSAGE)
             SET(BUILD_INFORMATION "Building a debug version of ${CMAKE_PROJECT_NAME}")
         ENDIF()

         SET(RELEASE_MODE FALSE)
     ELSE()
-        IF(SHOW_INFORMATION_MESSAGE)
-            SET(BUILD_INFORMATION "Building a release version of ${CMAKE_PROJECT_NAME}")
-        ENDIF()
-
-        SET(RELEASE_MODE TRUE)
+        MESSAGE(FATAL_ERROR "${CMAKE_PROJECT_NAME} can only be built in release or debug mode...")
     ENDIF()

     # Required packages


Address review comments

Address review comments

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -39,12 +39,6 @@
 #------------------------------------------------------------------------------
 function(drake_setup_java_for_matlab)
   if(NOT MATLAB_JVM_VERSION)
-    if(NOT MATLAB_EXECUTABLE)
-      message(WARNING
-        "Could not determine MATLAB JVM version because MATLAB executable was not set")
-      return()
-    endif()
-
     # Set arguments for running MATLAB
     set(_args -nodesktop -nodisplay -nosplash)
     set(_input_file /dev/null)
@@ -57,10 +51,13 @@
     # Ask matlab for its JVM version
     execute_process(
       COMMAND "${MATLAB_EXECUTABLE}" ${_args} -logfile "${_logfile}" -r "version -java,quit"
-      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" TIMEOUT 300
-      RESULT_VARIABLE _result OUTPUT_QUIET INPUT_FILE ${_input_file})
+      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+      TIMEOUT 300
+      RESULT_VARIABLE _result
+      OUTPUT_QUIET
+      INPUT_FILE ${_input_file})

-    if(NOT _result AND EXISTS ${_logfile})
+    if(_result EQUAL 0 AND EXISTS ${_logfile})
       file(READ ${_logfile} _output)

       # Test for a valid result


fix broken CMake logic

fix broken CMake logic

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -50,6 +50,7 @@
 MACRO(OSPRAY_CHECK_COMPILER_SUPPORT ISA)
   IF (${ISA} STREQUAL "AVX512" AND NOT OSPRAY)
     OSPRAY_WARN_ONCE(MISSING_AVX512 "OSPRay Currently requires ICC for KNL support. Disabling KNL ISA target.")
+    SET(OSPRAY_EMBREE_ENABLE_${ISA} false)
   ELSEIF (OSPRAY_EMBREE_ENABLE_${ISA} AND NOT OSPRAY_COMPILER_SUPPORTS_${ISA})
     OSPRAY_WARN_ONCE(MISSING_${ISA} "Need at least version ${GCC_VERSION_REQUIRED_${ISA}} of gcc for ${ISA}. Disabling ${ISA}.\nTo compile for ${ISA}, please switch to either 'ICC'-compiler, or upgrade your gcc version.")
     SET(OSPRAY_EMBREE_ENABLE_${ISA} false)


Adjust code coverage module

Adjust code coverage module

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -101,7 +101,8 @@
 	""
 	CACHE STRING "Flags used by the shared libraries linker during coverage builds."
 	FORCE )
-SET(COVERAGE_SOURCE_DIR "${PROJECT_BINARY_DIR}/src")
+SET(COVERAGE_BINARY_DIR "${PROJECT_BINARY_DIR}/src")
+SET(COVERAGE_BASE_DIR "${PROJECT_SOURCE_DIR}")
 set(COVERAGE_INFO_FILE "${PROJECT_BINARY_DIR}/gen/coverage.info")
 MARK_AS_ADVANCED(
 	CMAKE_CXX_FLAGS_COVERAGE
@@ -149,7 +150,7 @@
   ADD_CUSTOM_TARGET(${SETUP_TARGET_FOR_COVERAGE_TARGET}_clean
     # Cleanup lcov
     COMMENT "Cleaning coverage info"
-    COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --directory ${COVERAGE_SOURCE_DIR} --zerocounters
+    COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --directory ${COVERAGE_BINARY_DIR} --zerocounters
   )

   ADD_CUSTOM_TARGET(${SETUP_TARGET_FOR_COVERAGE_TARGET}_generate
@@ -167,10 +168,7 @@
 	DEPENDS ${SETUP_TARGET_FOR_COVERAGE_TARGET}_generate_clean
 	COMMENT "Gathering coverage info"
     # Capturing lcov counters and generating report
-    COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} -q --directory ${COVERAGE_SOURCE_DIR} --capture --output-file ${COVERAGE_INFO_FILE}
-    COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} -q --remove ${COVERAGE_INFO_FILE} "/usr/include/*" --output-file ${COVERAGE_INFO_FILE}.cleaned
-    COMMAND ${CMAKE_COMMAND} -E copy ${COVERAGE_INFO_FILE}.cleaned ${COVERAGE_INFO_FILE}
-    COMMAND ${CMAKE_COMMAND} -E remove ${COVERAGE_INFO_FILE}.cleaned
+    COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} -q --directory ${COVERAGE_BINARY_DIR} --base-directory ${COVERAGE_BASE_DIR} --no-external --capture --output-file ${COVERAGE_INFO_FILE}
   )

 	if (COVERALLS_PATH)


COMP: Fix order of find_packages

COMP: Fix order of find_packages

When find_package(SlicerExecutionModel) preceeds find_package(ITK),
then the component list for ITK_INCLUDE_LIST gets truncated (to only
the components that SlicerExecutionModel needs).

--- DTIPrepTools.cmake
+++ DTIPrepTools.cmake
@@ -1,3 +1,6 @@
+set(MODULE_NAME ${EXTENSION_NAME}) # Do not use 'project()'
+set(MODULE_TITLE ${MODULE_NAME})
+
 macro(INSTALL_EXECUTABLE)
   set(options )
   set( oneValueArgs OUTPUT_DIR )
@@ -15,6 +18,33 @@
   endforeach()
 endmacro()

+#-----------------------------------------------------------------------------
+# Update CMake module path
+#------------------------------------------------------------------------------
+set(CMAKE_MODULE_PATH
+  ${${PROJECT_NAME}_SOURCE_DIR}/CMake
+  ${${PROJECT_NAME}_BINARY_DIR}/CMake
+  ${CMAKE_MODULE_PATH}
+  )
+
+#-----------------------------------------------------------------------------
+set(expected_ITK_VERSION_MAJOR ${ITK_VERSION_MAJOR})
+find_package(ITK NO_MODULE REQUIRED)
+if(${ITK_VERSION_MAJOR} VERSION_LESS ${expected_ITK_VERSION_MAJOR})
+  # Note: Since ITKv3 doesn't include a ITKConfigVersion.cmake file, let's check the version
+  #       explicitly instead of passing the version as an argument to find_package() command.
+  message(FATAL_ERROR "Could not find a configuration file for package \"ITK\" that is compatible "
+                      "with requested version \"${expected_ITK_VERSION_MAJOR}\".\n"
+                      "The following configuration files were considered but not accepted:\n"
+                      "  ${ITK_CONFIG}, version: ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}\n")
+endif()
+
+include(${ITK_USE_FILE})
+
+#-----------------------------------------------------------------------------
+find_package(VTK NO_MODULE REQUIRED)
+include(${VTK_USE_FILE})
+

 #-----------------------------------------------------------------------------
 find_package(SlicerExecutionModel NO_MODULE REQUIRED GenerateCLP)
@@ -23,9 +53,6 @@
 include(${SlicerExecutionModel_CMAKE_DIR}/SEMMacroBuildCLI.cmake)

 include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
-
-set(MODULE_NAME ${EXTENSION_NAME}) # Do not use 'project()'
-set(MODULE_TITLE ${MODULE_NAME})

 if(USE_ANTS)
   # find ANTS includes
@@ -70,33 +97,6 @@
 #include_directories(${CMAKE_INSTALL_PREFIX}/MultiImageRegistration/Source)
 #include_directories(${CMAKE_INSTALL_PREFIX}/MultiImageRegistration/Source/Common)

-#-----------------------------------------------------------------------------
-# Update CMake module path
-#------------------------------------------------------------------------------
-set(CMAKE_MODULE_PATH
-  ${${PROJECT_NAME}_SOURCE_DIR}/CMake
-  ${${PROJECT_NAME}_BINARY_DIR}/CMake
-  ${CMAKE_MODULE_PATH}
-  )
-
-#-----------------------------------------------------------------------------
-set(expected_ITK_VERSION_MAJOR ${ITK_VERSION_MAJOR})
-find_package(ITK NO_MODULE REQUIRED)
-if(${ITK_VERSION_MAJOR} VERSION_LESS ${expected_ITK_VERSION_MAJOR})
-  # Note: Since ITKv3 doesn't include a ITKConfigVersion.cmake file, let's check the version
-  #       explicitly instead of passing the version as an argument to find_package() command.
-  message(FATAL_ERROR "Could not find a configuration file for package \"ITK\" that is compatible "
-                      "with requested version \"${expected_ITK_VERSION_MAJOR}\".\n"
-                      "The following configuration files were considered but not accepted:\n"
-                      "  ${ITK_CONFIG}, version: ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}\n")
-endif()
-
-include(${ITK_USE_FILE})
-
-#-----------------------------------------------------------------------------
-find_package(VTK NO_MODULE REQUIRED)
-include(${VTK_USE_FILE})
-
 #-----------------------------------------------------------------------
 # Setup locations to find externally maintained test data.
 #-----------------------------------------------------------------------
@@ -120,24 +120,6 @@
 #include(ExternalData)

 set(TestData_DIR ${CMAKE_CURRENT_SOURCE_DIR}/TestData)
-
-if(USE_ANTS)
-  # find ANTS includes
-  # HACK:
-  #set( BOOST_INCLUDE_DIR  /Shared/sinapse/sharedopt/20130601/RHEL6/DTIPrep/BRAINSTools-build/Boost)
-  #set( ANTS_SOURCE_DIR    /Shared/sinapse/sharedopt/20130601/RHEL6/DTIPrep/BRAINSTools-build/ANTS )
-  #message( STATUS "XXXXXXXXXXXXX ${BOOST_INCLUDE_DIR} XXXXXXX")
-  include_directories(${BOOST_INCLUDE_DIR})
-  include_directories(${ANTs_SOURCE_DIR}/Temporary)
-  include_directories(${ANTs_SOURCE_DIR}/Tensor)
-  include_directories(${ANTs_SOURCE_DIR}/Utilities)
-  include_directories(${ANTs_SOURCE_DIR}/Examples)
-  include_directories(${ANTs_SOURCE_DIR}/ImageRegistration)
-#  link_directories(${BRAINSTools_LIBRARY_PATH} ${BRAINSTools_CLI_ARCHIVE_OUTPUT_DIRECTORY})
-  link_directories(${ANTs_LIBRARY_DIR} ${BRAINSTools_LIBRARY_PATH})
-  set(ANTs_LIBS antsUtilities)
-endif()
-

 if( DTIPrep_BUILD_SLICER_EXTENSION )
   unsetForSlicer( NAMES SlicerExecutionModel_DIR ITK_DIR VTK_DIR CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS ITK_LIBRARIES )


Add author/copyright

Add author/copyright

--- FindOpenMesh.cmake
+++ FindOpenMesh.cmake
@@ -1,3 +1,4 @@
+# Copyright (c) 2014 Stefan.Eilemann@epfl.ch

 find_path(_openMesh_INCLUDE_DIR OpenMesh/Core/Geometry/Config.hh
   HINTS ${OPENMESH_ROOT}/include


RPM_SPEC_STRING_ADD_DIRECTIVE: Append additional new line

--- Modules/ManageRPM.cmake
+++ Modules/ManageRPM.cmake
@@ -259,6 +259,7 @@
 	IF(NOT content STREQUAL "")
 	    STRING_APPEND(_str "\n${content}")
 	ENDIF(NOT content STREQUAL "")
+	STRING_APPEND(_str "\n")
 	RPM_SPEC_STRING_ADD(${var} "${_str}" ${ARGN})
 	SET(${var} "${${var}}" PARENT_SCOPE)
     ENDFUNCTION(RPM_SPEC_STRING_ADD_DIRECTIVE var directive attribute content)


Force suffix .so on all platforms

Force suffix .so on all platforms

--- cmake/ALICE_CMake.cmake
+++ cmake/ALICE_CMake.cmake
@@ -430,6 +430,7 @@
   include_directories(${CMAKE_INCLUDE_EXPORT_DIRECTORY})

   add_library(${PACKAGE} SHARED ${PCS} ${PFS} ${PS} ${PDS})
+  set_target_properties(${PACKAGE} PROPERTIES SUFFIX .so)

   if(PELIBS OR SHLIB)


Copy the header files without subdirectories

--- cmake/ALICE_CMake.cmake
+++ cmake/ALICE_CMake.cmake
@@ -540,10 +540,11 @@
     set(HEADERS ${EXPORT})
     set(_headersdep)
     foreach(header ${HEADERS})
-      add_custom_command(OUTPUT ${PEXPORTDEST}/${header}
-                         COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/${MODULE}/${header} ${PEXPORTDEST}/${header}
+      get_filename_component( header_name ${header} NAME )
+      add_custom_command(OUTPUT ${PEXPORTDEST}/${header_name}
+                         COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/${MODULE}/${header} ${PEXPORTDEST}/${header_name}
 			 DEPENDS ${CMAKE_SOURCE_DIR}/${MODULE}/${header})
-      list(APPEND _headersdep ${PEXPORTDEST}/${header})
+      list(APPEND _headersdep ${PEXPORTDEST}/${header_name})
       install(FILES ${header} DESTINATION include)
     endforeach(header)
     add_custom_target(${PACKAGE}-headers DEPENDS ${_headersdep})


Fix possible build warnings.

Fix possible build warnings.

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -481,7 +481,7 @@

     cegui_gather_files()

-    include_directories(${Boost_INCLUDE_DIR})
+    include_directories(SYSTEM ${Boost_INCLUDE_DIR})

     ###########################################################################
     #                     Statically Linked Executable