[CMake][Exp PyROOT] Remove part used for previous MultiPython incremental

This part was here to avoid to specify many variables for the previous
incremental way of build with multiple python versions.

--- cmake/modules/SearchRootCoreDeps.cmake
+++ cmake/modules/SearchRootCoreDeps.cmake
@@ -7,11 +7,6 @@
 #---Check for Python installation-------------------------------------------------------

 message(STATUS "Looking for Python")
-
-if(pyroot_experimental)
-  unset(PYTHON_INCLUDE_DIR CACHE)
-  unset(PYTHON_LIBRARY CACHE)
-endif()

 if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)


Remove unused 'if'

Remove unused 'if'

--- cmake/modules/hunter_add_package.cmake
+++ cmake/modules/hunter_add_package.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, Ruslan Baratov
+# Copyright (c) 2013, 2015 Ruslan Baratov
 # All rights reserved.

 include(CMakeParseArguments) # cmake_parse_arguments
@@ -63,13 +63,11 @@
     )
   endforeach()

-  if(HUNTER_ENABLED)
-    # do not use any variables after this 'foreach', because included files
-    # may call 'hunter_add_package' and rewrite it
-    foreach(x ${_hunter_ap_list})
-      hunter_status_debug("load: ${x}")
-      include("${x}")
-      hunter_status_debug("load: ${x} ... end")
-    endforeach()
-  endif()
+  # do not use any variables after this 'foreach', because included files
+  # may call 'hunter_add_package' and rewrite it
+  foreach(x ${_hunter_ap_list})
+    hunter_status_debug("load: ${x}")
+    include("${x}")
+    hunter_status_debug("load: ${x} ... end")
+  endforeach()
 endmacro()


Get the number of CPU cores correctly.

Get the number of CPU cores correctly.

NUMBER_OF_LOGICAL_CORES is actually the number of logical cores per physical core.

--- cmake/modules/hunter_jobs_number.cmake
+++ cmake/modules/hunter_jobs_number.cmake
@@ -11,9 +11,14 @@
   string(COMPARE EQUAL "${HUNTER_JOBS_NUMBER}" "" use_default_jobs)
   if(use_default_jobs)
     cmake_host_system_information(
-        RESULT jobs_number
+        RESULT l_cores
         QUERY NUMBER_OF_LOGICAL_CORES
     )
+	cmake_host_system_information(
+        RESULT p_cores
+        QUERY NUMBER_OF_PHYSICAL_CORES
+    )
+	math(EXPR jobs_number "${l_cores} * ${p_cores}")
     string(COMPARE EQUAL "${jobs_number}" "0" is_zero)
     if(is_zero)
       hunter_status_debug("Number of logical cores is 0 - forcing 1")


hunter_pick_scheme: remove unused HUNTER_DOWNLOAD_SCHEME_VARIANTS

--- cmake/modules/hunter_pick_scheme.cmake
+++ cmake/modules/hunter_pick_scheme.cmake
@@ -1,21 +1,19 @@
-# Copyright (c) 2014, Ruslan Baratov
+# Copyright (c) 2014-2015, Ruslan Baratov
 # All rights reserved.

 include(CMakeParseArguments) # cmake_parse_arguments

 include(hunter_internal_error)
 include(hunter_test_string_not_empty)
-include(hunter_unsetvar)

 # Set variables:
 #     * HUNTER_DOWNLOAD_SCHEME
 #     * HUNTER_DOWNLOAD_SCHEME_INSTALL
-#     * HUNTER_DOWNLOAD_SCHEME_VARIANTS
 function(hunter_pick_scheme)
   hunter_test_string_not_empty("${CMAKE_GENERATOR}")

   # Note: MSVC_IDE is empty before "project" command
-  hunter_unsetvar(is_combined)
+  set(is_combined NO)
   string(COMPARE EQUAL "${CMAKE_GENERATOR}" "Xcode" is_xcode)
   if(is_xcode)
     set(is_combined YES)
@@ -58,57 +56,6 @@
       HUNTER_DOWNLOAD_SCHEME_INSTALL
   )

-  # set HUNTER_DOWNLOAD_SCHEME_VARIANTS
-  hunter_unsetvar(HUNTER_DOWNLOAD_SCHEME_VARIANTS)
-  string(
-      COMPARE
-      EQUAL
-      "${HUNTER_DOWNLOAD_SCHEME}"
-      "url_sha1_boost_ios_library"
-      is_ios
-  )
-  if(is_ios)
-    set(HUNTER_DOWNLOAD_SCHEME_VARIANTS ios ios_sim ios_universal)
-  endif()
-
-  string(
-      COMPARE
-      EQUAL
-      "${HUNTER_DOWNLOAD_SCHEME}"
-      "url_sha1_release_debug"
-      is_release_debug
-  )
-  if(is_release_debug)
-    set(HUNTER_DOWNLOAD_SCHEME_VARIANTS release debug)
-  endif()
-
-  string(
-      COMPARE
-      EQUAL
-      "${HUNTER_DOWNLOAD_SCHEME}"
-      "url_sha1_release"
-      is_release
-  )
-  if(is_release)
-    set(HUNTER_DOWNLOAD_SCHEME_VARIANTS release)
-  endif()
-
-  string(
-      COMPARE
-      EQUAL
-      "${HUNTER_DOWNLOAD_SCHEME}"
-      "url_sha1_openssl_ios"
-      is_openssl_ios
-  )
-  if(is_openssl_ios)
-    set(
-        HUNTER_DOWNLOAD_SCHEME_VARIANTS
-        ${IPHONEOS_ARCHS}
-        ${IPHONESIMULATOR_ARCHS}
-        ios_universal
-    )
-  endif()
-
   # Forward to parent scope
   set(HUNTER_DOWNLOAD_SCHEME "${HUNTER_DOWNLOAD_SCHEME}" PARENT_SCOPE)
   set(
@@ -116,9 +63,4 @@
       "${HUNTER_DOWNLOAD_SCHEME_INSTALL}"
       PARENT_SCOPE
   )
-  set(
-      HUNTER_DOWNLOAD_SCHEME_VARIANTS
-      "${HUNTER_DOWNLOAD_SCHEME_VARIANTS}"
-      PARENT_SCOPE
-  )
 endfunction()


cmake: make gio more flexible on linux

cmake: make gio more flexible on linux

Change-Id: I6512a91d4a6fdf7d3b83891f60b19cf25e63cf06
Reviewed-on: http://gerrit.aldebaran.lan/36577
Tested-by: gerrit
Reviewed-by: jmassot <635e755e31f4898906fa675e06ba806b9a909933@aldebaran-robotics.com>
Tested-by: jmassot <635e755e31f4898906fa675e06ba806b9a909933@aldebaran-robotics.com>
Reviewed-by: smartin <edaf33f3e53483e687d304aa81a03bb5a17b9ddf@aldebaran-robotics.com>
Tested-by: smartin <edaf33f3e53483e687d304aa81a03bb5a17b9ddf@aldebaran-robotics.com>

--- cmake/qibuild/modules/gio-config.cmake
+++ cmake/qibuild/modules/gio-config.cmake
@@ -5,6 +5,9 @@
 find_package(PkgConfig)
 if(UNIX AND NOT APPLE)
   pkg_check_modules(GIO gio-unix-2.0)
+  if(NOT GIO_FOUND)
+    pkg_check_modules(GIO gio-2.0)
+  endif()
 else()
   pkg_check_modules(GIO gio-2.0)
 endif()


[Build] Added support to read the version from the CMake cache.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -139,6 +139,8 @@
 macro (store_in_cache)
   # Force some variables that could be defined in the command line to be
   # written to cache
+  set (PACKAGE_VERSION "${PACKAGE_VERSION}" CACHE STRING
+  "Version of the project/package")
   set (BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}" CACHE BOOL
 	"Set to OFF to build static libraries" FORCE)
   set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH


traces: convenient flag to not print everything but the most usefull

--- src/bootstrap/libnany/traces.h.cmake
+++ src/bootstrap/libnany/traces.h.cmake
@@ -20,6 +20,9 @@
 	//! Enable all traces (very verbose)
 	static constexpr bool all = false;

+	static constexpr bool recommended = all or false;
+
+

 	//! Print all AST
@@ -35,19 +38,19 @@

 	//! Print ATOM table
-	static constexpr bool printAtomTable = all or false;
+	static constexpr bool printAtomTable = all or recommended or false;

 	//! Print ATOM table
 	static constexpr bool printPreAtomTable = all or false;

 	//! Print classdef table
-	static constexpr bool printClassdefTable = all or false;
+	static constexpr bool printClassdefTable = all or recommended or false;

 	//! Print opcodes generated from AST
-	static constexpr bool printSourceOpcodeSequence = all or false;
+	static constexpr bool printSourceOpcodeSequence = all or recommended or false;

 	//! Print opcodes after program instanciation
-	static constexpr bool printGeneratedOpcodeSequence = all or false;
+	static constexpr bool printGeneratedOpcodeSequence = all or recommended or false;


Fix superfluous and incorrect capnp cmake exports

Some of these variables are already exported by cmake files in capnproto
in third_party. And correctly.

The problem I see in my machine is that capnproto writes the static libs
to prefix/lib64/ but hardcoded CAPNP_LIBRARIES says that they are in the
prefix/lib/ directory. This makes peloton fail to link with capnp static
libs.

Let capnp cmake files in third_party handle it correctly.

--- cmake/External/capnproto.cmake
+++ cmake/External/capnproto.cmake
@@ -44,21 +44,6 @@
       LOG_INSTALL 1
       )

-    set(CAPNP_FOUND TRUE)
-    set(CAPNP_EXECUTABLE ${capnp_INSTALL}/bin/capnp)
-    set(CAPNPC_CXX_EXECUTABLE ${capnp_INSTALL}/bin/capnpc-c++)
-    set(CAPNP_INCLUDE_DIRS ${capnp_INSTALL}/include)
-    set(CAPNP_INCLUDE_DIRECTORY ${capnp_INSTALL}/include)
-    set(CAPNP_LIBRARIES
-      ${capnp_INSTALL}/lib/libcapnp-rpc.a
-      ${capnp_INSTALL}/lib/libcapnp.a
-      ${capnp_INSTALL}/lib/libkj-async.a
-      ${capnp_INSTALL}/lib/libkj.a
-      ${CMAKE_THREAD_LIBS_INIT}
-      )
-    set(CAPNP_LIBRARY_DIRS ${capnp_INSTALL}/lib)
-    set(CAPNP_EXTERNAL TRUE)
-
     list(APPEND external_project_dependencies capnp)

   endif()


PythonApplyPatches: Fix whitespaces when applying patch with git

Failing to do so causes "git apply" to fail. Note that by default "patch"
executable fixes the whitespaces.

See https://git-scm.com/docs/git-apply#git-apply---whitespaceltactiongt

--- cmake/PythonApplyPatches.cmake
+++ cmake/PythonApplyPatches.cmake
@@ -7,7 +7,7 @@
 if(NOT DEFINED PATCH_COMMAND)
   find_package(Git)
   if(Git_FOUND)
-    set(PATCH_COMMAND ${GIT_EXECUTABLE} apply)
+    set(PATCH_COMMAND ${GIT_EXECUTABLE} apply --whitespace=fix)
   else()
     find_package(Patch)
     if(Patch_FOUND)


Fix build directory for documentation

Fix build directory for documentation


Propagate Intel compiler setup to newer versions

This is important, for instance, to turn off warnings about unknown
attributes in LLVM code that the Intel compiler does not understand.
These warnings show up on CDash for builds with ICC 17.

http://cdash.cern.ch/viewBuildError.php?type=1&buildid=370001

--- cmake/modules/SetUpLinux.cmake
+++ cmake/modules/SetUpLinux.cmake
@@ -201,49 +201,29 @@
   message(STATUS "Found ICC major version ${ICC_MAJOR}")
   message(STATUS "Found ICC minor version ${ICC_MINOR}")

-  if(ICC_MAJOR EQUAL 9)
+  if(ICC_MAJOR GREATER 9 OR ICC_MAJOR EQUAL 9)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd1572")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd1572")
   endif()

-  if(ICC_MAJOR EQUAL 10)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd1572")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd1572")
-  endif()
-
-  if(ICC_MAJOR EQUAL 11)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279")
+  if(ICC_MAJOR GREATER 11 OR ICC_MAJOR EQUAL 11)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIT_ENVIRONMENT} -wd279")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIT_ENVIRONMENT} -wd279")
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${BIT_ENVIRONMENT} -Wl,--no-undefined")
   endif()

-  if(ICC_MAJOR EQUAL 12)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${BIT_ENVIRONMENT} -Wl,--no-undefined")
-  endif()
-
-  if(ICC_MAJOR EQUAL 13)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${BIT_ENVIRONMENT} -Wl,--no-undefined")
-  endif()
-
-  if(ICC_MAJOR EQUAL 14)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279 -wd2536 -wd873")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279 -wd2536 -wd873")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${BIT_ENVIRONMENT} -Wl,--no-undefined")
-  endif()
-
-  if(ICC_MAJOR EQUAL 15)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279 -wd2536 -wd873 -wd1292 -wd3373 -wd597 -wd1098 -wd1478")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIT_ENVIRONMENT} -wd1572 -wd279 -wd2536 -wd873")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${BIT_ENVIRONMENT} -Wl,--no-undefined")
+  if(ICC_MAJOR GREATER 14 OR ICC_MAJOR EQUAL 14)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd873 -wd2536")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd873 -wd2536")
+  endif()
+
+  if(ICC_MAJOR GREATER 15 OR ICC_MAJOR EQUAL 15)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd597 -wd1098 -wd1292 -wd1478 -wd3373")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd597 -wd1098 -wd1292 -wd1478 -wd3373")
   endif()

   set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
   set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
-

   # Select flags.
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 -g -DNDEBUG")


Add -DWITH_CRT_DLL to libjpeg-turbo config

See here:
https://github.com/libjpeg-turbo/libjpeg-turbo/blob/4a275cf0805699fb26282ecfb4495458fdb47328/CMakeLists.txt#L297

For whatever reason libjpeg-turbo is defaulting to /MT.
I thought we've all learned to use /MD.

I've noticed major issues with new/delete mismatches with /MT.
This happens if you use libraries that were compiled against different versions of msvcr.
I was mixing vs2012 built dlls with vs2015 built dlls with /MT.
It's best to just avoid /MT.

--- cmakemodules/script_jpeg.cmake
+++ cmakemodules/script_jpeg.cmake
@@ -33,6 +33,7 @@
 			-DENABLE_SHARED=OFF
 			-DCMAKE_POSITION_INDEPENDENT_CODE=ON
 			-DWITH_SIMD=${JPEG_ENABLE_SIMD}
+			-DWITH_CRT_DLL=ON
 		INSTALL_COMMAND   ""
 	)


ENH: moving nightly build place

ENH: moving nightly build place

--- src/Testing/Dashboard/elxDashboard_LKEB_linux64_gcc.cmake
+++ src/Testing/Dashboard/elxDashboard_LKEB_linux64_gcc.cmake
@@ -23,7 +23,7 @@
 set( CTEST_TEST_ARGS PARALLEL_LEVEL 6 ) # parallel testing
 set( CTEST_BUILD_CONFIGURATION Debug )
 set( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
-set( CTEST_DASHBOARD_ROOT "/home/marius/elastix-nightly/build/" )
+set( CTEST_DASHBOARD_ROOT "/home/marius/nightly-builds/elastix/" )

 # Specify the kind of dashboard to submit
 # default: Nightly


LLDBStandalone: Report nice errors on missing vars

Differential Revision: http://reviews.llvm.org/D13819

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

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -23,6 +23,7 @@
     else()
       get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
                              ABSOLUTE)
+      set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
       list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
     endif()
   endif()
@@ -30,15 +31,27 @@
   if (LLDB_PATH_TO_CLANG_SOURCE)
       get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
                              ABSOLUTE)
+      set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
   endif()

   list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake")

-  get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
-                         ABSOLUTE)
+  if (LLDB_PATH_TO_LLVM_BUILD)
+    get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
+                           ABSOLUTE)
+  else()
+    message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_BUILD to the root "
+            "directory of LLVM build or install site.")
+  endif()

-  get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
-                         ABSOLUTE)
+  if (LLDB_PATH_TO_CLANG_BUILD)
+    get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
+                           ABSOLUTE)
+  else()
+    message(FATAL_ERROR "Please set LLDB_PATH_TO_CLANG_BUILD to the root "
+            "directory of Clang build or install site.")
+  endif()
+

   # These variables are used by add_llvm_library.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
@@ -67,10 +80,7 @@

   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")

-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
   set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR})
-
-  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")

   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories("${PATH_TO_LLVM_BUILD}/include"


[cmake] fix typo in cmake function call (#753)

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -727,7 +727,7 @@
     if (ARGS_RESOURCES)
         foreach (resLocation ${ARGS_RESOURCES})
             message(STATUS "[configure_radium_plugin] Installing plugin resources ${resLocation} for ${ARGS_NAME} ")
-            install_plugin_resourcess(
+            install_plugin_resources(
                 TARGET ${ARGS_NAME}
                 DIRECTORY ${resLocation}
                 BUILD_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/Plugins/Resources/${ARGS_NAME}


FAVOR_BSD thing

FAVOR_BSD thing

--- cmake_modules/CompilerConfig.cmake
+++ cmake_modules/CompilerConfig.cmake
@@ -6,11 +6,7 @@
 endif()

 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-
 set(EXTRA_CXX_FLAGS "-Werror -Wall -Wpedantic -Wextra")
-
-set(EXTRA_CXX_FLAGS ${EXTRA_CXX_FLAGS} "-D__FAVOR_BSD") #Not working correctly
-
 set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -flto -O3 -DRELEASE -DNDEBUG")
 #set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -ggdb -flto -fno-omit-frame-pointer -O3 -DRELEASE -DNDEBUG")

@@ -29,10 +25,10 @@

 if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
     message(STATUS "Detected MacOSX")
-    set(EXTRA_CXX_FLAGS ${EXTRA_CXX_FLAGS} -std=c++11)
 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
     message(STATUS "Detected Linux")
     find_library(DL_LIB dl REQUIRED)
+    set(EXTRA_CXX_FLAGS ${EXTRA_CXX_FLAGS} "-D__FAVOR_BSD") #Not working correctly
 else ()
     message(FATAL_ERROR "Unknown system")
 endif ()


FindMPI: fix rogue curly brace

FindMPI: fix rogue curly brace

Introduced in 26290c8a4d27155c89183f46bc8621b14bc192d8.

--- CMake/FindMPI.cmake
+++ CMake/FindMPI.cmake
@@ -136,7 +136,7 @@
 # or if we know it matches the regular compiler.
 foreach (lang C CXX Fortran)
   foreach (id GNU Intel PGI XL)
-    if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID} STREQUAL id)
+    if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID STREQUAL id)
       list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES})
     endif()
     unset(_MPI_${id}_${lang}_COMPILER_NAMES)    # clean up the namespace here


Detect tool dir

Detect tool dir

--- macros.cmake
+++ macros.cmake
@@ -1,4 +1,5 @@
-if(${CMAKE_MAKE_PROGRAM} MATCHES "/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild")
+message(CMAKE_MAKE_PROGRAM: "${CMAKE_MAKE_PROGRAM}")
+if(${CMAKE_MAKE_PROGRAM} MATCHES "xcodebuild")
 	set(TOOLDIR ${CMAKE_BINARY_DIR}/bin/Debug)
 else()
 	set(TOOLDIR ${CMAKE_BINARY_DIR}/bin)


Fixed branding name error in cmgui. https://tracker.physiomeproject.org/show_bug.cgi?id=3079

--- source/configure/version.h.cmake
+++ source/configure/version.h.cmake
@@ -7,7 +7,7 @@
 #if !defined GENERATED_VERSION_H
 #define GENERATED_VERSION_H

-#define CMGUI_NAME_STRING "OpenCMZN(cmgui)"
+#define CMGUI_NAME_STRING "OpenCMISS(cmgui)"
 #define CMGUI_VERSION_STRING "@CMGUI_VERSION_STRING@"
 #define CMGUI_DATETIME_STRING "@CMGUI_DATETIME_STRING@"
 #define CMGUI_COPYRIGHT_STRING "Copyright 1996-2013, Auckland UniServices Ltd."


Add express -mavx and -msse options (and fix a stray = for cooperlake)

--- cmake/cc.cmake
+++ cmake/cc.cmake
@@ -109,10 +109,25 @@
     if (NOT NO_AVX512)
       execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
       if (${GCC_VERSION} VERSION_GREATER 10.1 OR ${GCC_VERSION} VERSION_EQUAL 10.1)
-        set (CCOMMON_OPT = "${CCOMMON_OPT} -march=cooperlake")
+        set (CCOMMON_OPT  "${CCOMMON_OPT} -march=cooperlake")
       else ()
         set (CCOMMON_OPT "${CCOMMON_OPT} -march=skylake-avx512")
       endif()
     endif ()
   endif ()
 endif ()
+
+if (NOT DYNAMIC_ARCH)
+	if (HAVE_AVX2)
+        set (CCOMMON_OPT  "${CCOMMON_OPT} -mavx2")
+	endif ()
+	if (HAVE_AVX)
+        set (CCOMMON_OPT  "${CCOMMON_OPT} -mavx")
+	endif ()
+	if (HAVE_SSE3)
+        set (CCOMMON_OPT  "${CCOMMON_OPT} -msse3")
+	endif ()
+	if (HAVE_SSSE3)
+        set (CCOMMON_OPT  "${CCOMMON_OPT} -mssse3")
+	endif ()
+endif()


samples: net: removed unused common cmake

CONFIG_NET_TESTING never used, removed in this commit.

Signed-off-by: Andrei Gansari <f1330555a90b7a22d81843f3c4366f58b50eae34@nxp.com>

--- samples/net/common/common.cmake
+++ samples/net/common/common.cmake
@@ -1,14 +1 @@
 # Common routines used in net samples
-
-if(CONFIG_NET_TESTING)
-  target_include_directories(
-    app
-    PRIVATE
-    $ENV{ZEPHYR_BASE}/samples/net/common/
-    )
-  target_compile_definitions(
-    app
-    PRIVATE
-    NET_TESTING_SERVER=1
-    )
-endif()


Allow location of binary file downloads to be specified.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -1194,7 +1194,7 @@

 #===============================================================================

-MACRO(RETRIEVE_BINARY_FILE DIRNAME FILENAME SHA1_VALUE)
+MACRO(RETRIEVE_BINARY_FILE_FROM LOCATION DIRNAME FILENAME SHA1_VALUE)
     # Create the destination folder, if needed

     SET(REAL_DIRNAME ${CMAKE_SOURCE_DIR}/${DIRNAME})
@@ -1235,7 +1235,7 @@
         SET(COMPRESSED_FILENAME ${FILENAME}.tar.gz)
         SET(REAL_COMPRESSED_FILENAME ${REAL_DIRNAME}/${COMPRESSED_FILENAME})

-        FILE(DOWNLOAD "http://www.opencor.ws/binaries/${DIRNAME}/${COMPRESSED_FILENAME}" ${REAL_COMPRESSED_FILENAME}
+        FILE(DOWNLOAD "${LOCATION}/${DIRNAME}/${COMPRESSED_FILENAME}" ${REAL_COMPRESSED_FILENAME}
              SHOW_PROGRESS STATUS STATUS)

         # Uncompress the compressed version of the file, should we have managed
@@ -1273,3 +1273,9 @@
         ENDIF()
     ENDIF()
 ENDMACRO()
+
+#===============================================================================
+
+MACRO(RETRIEVE_BINARY_FILE DIRNAME FILENAME SHA1_VALUE)
+    RETRIEVE_BINARY_FILE_FROM("http://www.opencor.ws/binaries" ${DIRNAME} ${FILENAME} ${SHA1_VALUE})
+ENDMACRO()


Some more cleaning up, including moving (rather than copying) a plugin from the build folder to the plugins folder.

--- cmake/plugin.cmake
+++ cmake/plugin.cmake
@@ -89,27 +89,10 @@
     ENDIF()

     ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
-                       COMMAND ${CMAKE_COMMAND} -E copy ${ORIG_PLUGINS_DIR}/${PLUGIN_FILENAME} ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})
-    #---GRY--- NOTE THAT copy SHOULD PROBABLY REPLACED BY rename WHEN PLUGINS REALLY WORK
+                       COMMAND ${CMAKE_COMMAND} -E rename ${ORIG_PLUGINS_DIR}/${PLUGIN_FILENAME} ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})
 ENDMACRO()

 MACRO(PACKAGE_PLUGIN)
-    #---GRY---
-
-    # Deployed location:
-    # ------------------
-    # The plugin is currently deployed in the same location as third-party
-    # libraries, since OpenCOR doesn't currently support plugins as such.
-    # However, once it does, the plugin will have to be deployed in its correct
-    # location, i.e. the "plugins" folder. For the time being, though, the
-    # current approach allows to test things, so...
-
-    # Translation files:
-    # ------------------
-    # There is currently no 'proper' support for the internationalisation of
-    # the plugin. This is therefore something that will have to be added at
-    # some point.
-
     IF(WIN32)
         INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin/plugins)
     ELSEIF(NOT APPLE)


cmake(python): Search six module

cmake(python): Search six module

We still have python2/3 test which depends on six...

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -155,6 +155,7 @@
 # Test
 if(BUILD_TESTING)
   # Look for python module virtualenv
+  search_python_module(six)
   search_python_module(virtualenv)
   # Testing using a vitual environment
   set(VENV_EXECUTABLE ${Python_EXECUTABLE} -m virtualenv)


Fix comment typos in CompilerWarnings

Fix comment typos in CompilerWarnings

--- cmake/CompilerWarnings.cmake
+++ cmake/CompilerWarnings.cmake
@@ -8,7 +8,7 @@

   set(MSVC_WARNINGS
       /W4 # Baseline reasonable warnings
-      /w14242 # 'identfier': conversion from 'type1' to 'type1', possible loss
+      /w14242 # 'identifier': conversion from 'type1' to 'type1', possible loss
               # of data
       /w14254 # 'operator': conversion from 'type1:field_bits' to
               # 'type2:field_bits', possible loss of data
@@ -68,7 +68,7 @@

   set(GCC_WARNINGS
       ${CLANG_WARNINGS}
-      -Wmisleading-indentation # warn if identation implies blocks where blocks
+      -Wmisleading-indentation # warn if indentation implies blocks where blocks
                                # do not exist
       -Wduplicated-cond # warn if if / else chain has duplicated conditions
       -Wduplicated-branches # warn if if / else branches have duplicated code


Uninstall: Remove additional files

Uninstall: Remove additional files

--- cmake/ElektraUninstall.cmake
+++ cmake/ElektraUninstall.cmake
@@ -10,6 +10,10 @@
 endif (NOT EXISTS "${MANIFEST}")

 #message (MANIFEST IS ${MANIFEST})
+
+# =========
+# = Files =
+# =========

 file (READ "${MANIFEST}" files)
 string (REGEX REPLACE "\n" ";" files "${files}")
@@ -28,3 +32,69 @@
 		message (STATUS "File $ENV{DESTDIR}${file} does not exist.")
 	endif (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
 endforeach (file)
+
+# ===============
+# = Directories =
+# ===============
+
+function(remove_directories directories)
+	foreach (directory ${directories})
+		set (dir "$ENV{DESTDIR}${directory}")
+		if (EXISTS "${dir}")
+			message(STATUS "Uninstalling directory ${dir}")
+			exec_program (
+				"${CMAKE_COMMAND}"
+				ARGS "-E remove_directory \"${dir}\""
+				OUTPUT_VARIABLE rm_out
+				RETURN_VALUE rm_retval)
+
+			if (NOT "${rm_retval}" STREQUAL 0)
+				message (FATAL_ERROR "Problem when removing ${dir}")
+			endif (NOT "${rm_retval}" STREQUAL 0)
+		endif (EXISTS "${dir}")
+	endforeach (directory ${directories})
+endfunction(remove_directories)
+
+set (DIRECTORIES
+	"/usr/local/include/elektra"
+	"/usr/local/lib/cmake/Elektra"
+	"/usr/local/lib/elektra"
+	"/usr/local/share/doc/elektra"
+	"/usr/local/share/doc/elektra-api"
+	"/usr/local/share/elektra"
+	"/usr/local/share/share/elektra"
+)
+
+remove_directories ("${DIRECTORIES}")
+
+# The following directories might be empty
+set (REMOVAL_CANDIDATES
+	"/usr/local/bin"
+	"/usr/local/include"
+	"/usr/local/lib/cmake"
+	"/usr/local/lib/lua/5.2"
+	"/usr/local/lib/lua"
+	"/usr/local/lib/pkgconfig"
+	"/usr/local/share/appdata"
+	"/usr/local/share/applications"
+	"/usr/local/share/doc"
+	"/usr/local/share/icons/hicolor/scalable/apps"
+	"/usr/local/share/icons/hicolor/scalable"
+	"/usr/local/share/icons/hicolor"
+	"/usr/local/share/icons"
+	"/usr/local/share/java"
+	"/usr/local/share/man/man1"
+	"/usr/local/share/man/man3"
+	"/usr/local/share/man/man7"
+	"/usr/local/share/man"
+	"/usr/local/share"
+)
+
+foreach (directory ${REMOVAL_CANDIDATES})
+	set (dir "$ENV{DESTDIR}${directory}")
+	file (GLOB content "${dir}/*")
+	list (LENGTH content size)
+	if (size EQUAL 0)
+		remove_directories ("${directory}")
+	endif (size EQUAL 0)
+endforeach (directory in ${REMOVAL_CANDIDATES})


ld.bfd: ensure that ld.bfd is preferred over ld.

Fixes: #32237

When building for native_posix, then host tools are used.
This means that gcc will link using `/usr/bin/ld` per default.

If ld points to lld, then linking will fail.

This commit will first look for ld.bfd, and if found then use
-fuse-ld=bfd for linking. If ld.bfd is not found, then ld is used as
fallback as that will be assumed to be the best working candidate.

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

--- cmake/linker/ld/target.cmake
+++ cmake/linker/ld/target.cmake
@@ -1,6 +1,15 @@
 # SPDX-License-Identifier: Apache-2.0

-find_program(CMAKE_LINKER     ${CROSS_COMPILE}ld      PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
+if(DEFINED TOOLCHAIN_HOME)
+  # When Toolchain home is defined, then we are cross-compiling, so only look
+  # for linker in that path, else we are using host tools.
+  set(LD_SEARCH_PATH PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
+endif()
+
+find_program(CMAKE_LINKER ${CROSS_COMPILE}ld.bfd ${LD_SEARCH_PATH})
+if(NOT CMAKE_LINKER)
+  find_program(CMAKE_LINKER ${CROSS_COMPILE}ld ${LD_SEARCH_PATH})
+endif()

 set_ifndef(LINKERFLAGPREFIX -Wl)

@@ -82,9 +91,15 @@
     ${ARGN}                                                   # input args to parse
   )

+  if(${CMAKE_LINKER} STREQUAL "${CROSS_COMPILE}ld.bfd")
+    # ld.bfd was found so let's explicitly use that for linking, see #32237
+    set(use_linker "-fuse-ld=bfd")
+  endif()
+
   target_link_libraries(
     ${TOOLCHAIN_LD_LINK_ELF_TARGET_ELF}
     ${TOOLCHAIN_LD_LINK_ELF_LIBRARIES_PRE_SCRIPT}
+    ${use_linker}
     ${TOPT}
     ${TOOLCHAIN_LD_LINK_ELF_LINKER_SCRIPT}
     ${TOOLCHAIN_LD_LINK_ELF_LIBRARIES_POST_SCRIPT}


cmake: For overlays, install to sdk-overlay target by default, but don't
hardcode it.

rdar://problem/21952953

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1343,8 +1343,10 @@
     set(SWIFTLIB_IS_STDLIB TRUE)
     set(SWIFTLIB_TARGET_LIBRARY TRUE)

-    # There are no experimental SDK overlays.
-    set(SWIFTLIB_INSTALL_IN_COMPONENT sdk-overlay)
+    # Install to sdk-overlay by default, but don't hardcode it
+    if(NOT SWIFTLIB_INSTALL_IN_COMPONENT)
+      set(SWIFTLIB_INSTALL_IN_COMPONENT sdk-overlay)
+    endif()
   endif()

   # Standard library is always a target library.


Fix misc compiler flags passed to MSVC/clang-cl

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -97,17 +97,18 @@
     ""
     ${ARGN})

-  set(result
-    ${${CFLAGS_RESULT_VAR_NAME}}
-    "-target" "${SWIFT_SDK_${CFLAGS_SDK}_ARCH_${CFLAGS_ARCH}_TRIPLE}")
+  set(result ${${CFLAGS_RESULT_VAR_NAME}})
+
+  # MSVC and clang-cl dont't understand -target.
+  if (NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+     list(APPEND result "-target" "${SWIFT_SDK_${CFLAGS_SDK}_ARCH_${CFLAGS_ARCH}_TRIPLE}")
+  endif()

   is_darwin_based_sdk("${CFLAGS_SDK}" IS_DARWIN)
   if(IS_DARWIN)
     list(APPEND result "-isysroot" "${SWIFT_SDK_${CFLAGS_SDK}_PATH}")
-  else()
-    if(NOT "${SWIFT_SDK_${CFLAGS_SDK}_PATH}" STREQUAL "/")
-      list(APPEND result "--sysroot=${SWIFT_SDK_${CFLAGS_SDK}_PATH}")
-    endif()
+  elseif(NOT SWIFT_COMPILER_IS_MSVC_LIKE AND NOT "${SWIFT_SDK_${CFLAGS_SDK}_PATH}" STREQUAL "/")
+    list(APPEND result "--sysroot=${SWIFT_SDK_${CFLAGS_SDK}_PATH}")
   endif()

   if("${CFLAGS_SDK}" STREQUAL "ANDROID")


Added experimental work around to OS X make install target bug

--- cmake/modules/FindCUDA.cmake
+++ cmake/modules/FindCUDA.cmake
@@ -610,9 +610,12 @@
   else()
     get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
   endif()
-  if(_cuda_path_to_cudart)
-    list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
-  endif()
+  #
+  # EDIT 16/11/13 Removed in an attempt to fix install since XCode 5.0.x
+  #if(_cuda_path_to_cudart)
+  #  list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
+  #endif()
+  #
 endif()

 # 1.1 toolkit on linux doesn't appear to have a separate library on


Fixed misprinted

Fixed misprinted

--- macros.cmake
+++ macros.cmake
@@ -147,7 +147,7 @@
   execute_process(COMMAND pkg-config --libs-only-l ${libraries} OUTPUT_VARIABLE FLL_LIBS RESULT_VARIABLE RV_LIBS)

   if((NOT RV_CFLAGS EQUAL 0) OR (NOT RV_LDFLAGS EQUAL 0) OR (NOT RV_LIBS EQUAL 0))
-    message(FATAL_ERROR "Failed to find one of these libraries: ${libraries}'")
+    message(FATAL_ERROR "Failed to find one of these libraries: ${libraries}")
   endif()

   # Strip leading and trailing whitepspace.


Execute CMake's iree_py_test targets via run_test.sh

Closes https://github.com/google/iree/pull/789

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/789 from iml130:python-run_test 9d91695b39d1d788fd13db7891458c295f3d4750
PiperOrigin-RevId: 296034954

--- bindings/python/build_tools/cmake/iree_py_test.cmake
+++ bindings/python/build_tools/cmake/iree_py_test.cmake
@@ -41,10 +41,10 @@

   add_test(
     NAME ${_NAME}
-    COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${_RULE_SRCS}"
+    COMMAND ${CMAKE_SOURCE_DIR}/build_tools/cmake/run_test.sh ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${_RULE_SRCS}"
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   )
-  set_property(TEST ${_NAME} PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/bindings/python:$ENV{PYTHONPATH}")
+  set_property(TEST ${_NAME} PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/bindings/python:$ENV{PYTHONPATH};TEST_TMPDIR=${_NAME}_test_tmpdir")
   # TODO(marbre): Find out how to add deps to tests.
   #               Similar to _RULE_DATA in iree_lit_test().


ENH : add the OBIA directory in the included path

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -67,6 +67,7 @@
   ${OTB_SOURCE_DIR}/Utilities/otbconfigfile
   ${OTB_SOURCE_DIR}/Utilities/otbknn
   ${OTB_BINARY_DIR}/Code/Visualization
+  ${OTB_SOURCE_DIR}/Code/OBIA
 )

 IF(NOT OTB_USE_EXTERNAL_BOOST)
@@ -297,6 +298,7 @@
   Fusion
   GeospatialAnalysis
   Testing
+  OBIA
   Utilities
   Utilities/ITK
   Utilities/otbsvm


CMake: Remove duplicated define

CMake: Remove duplicated define

--- config.h.cmake
+++ config.h.cmake
@@ -110,11 +110,9 @@

 /* Define to 1 if you have the <poll.h> header file. */
 #cmakedefine HAVE_POLL_H @HAVE_POLL_H@
+
 /* Define to 1 if you have the <port.h> header file. */
 #cmakedefine HAVE_PORT_H @HAVE_PORT_H@
-
-/* Define to 1 if you have the pthreads threading library. */
-#cmakedefine HAVE_PTHREADS @HAVE_PTHREADS@

 /* Define to 1 if you have the <sys/epoll.h> header file. */
 #cmakedefine HAVE_SYS_EPOLL_H @HAVE_SYS_EPOLL_H@


superbuild: Drop unused 'cmb' and 'smtk' project versions

--- superbuild/versions.cmake
+++ superbuild/versions.cmake
@@ -162,14 +162,6 @@
   URL "http://www.paraview.org/files/dependencies/portfwd-0.29.tar.gz"
   URL_MD5 93161c91e12b0d67ca52dc13708a2f2f)

-#------------------------------------------------------------------------------
-# CMB versions
-#------------------------------------------------------------------------------
-add_revision(cmb
-  GIT_REPOSITORY git@www.kitware.com:ERDC/CMB.git
-  GIT_TAG "master"
-  )
-
 add_revision(vxl
   URL http://vtk.org/files/support/vxl_r35313.tar.gz
   URL_MD5 cb7884a8eb0f816a4bb378dc968c8333)
@@ -202,10 +194,6 @@
   URL_MD5 8d77df722a01cc86b292300a007a3282
   )

-add_revision(smtk
-  GIT_REPOSITORY git@www.kitware.com:SMTK.git
-  GIT_TAG master)
-
 add_revision(shiboken
   GIT_REPOSITORY https://github.com/OpenGeoscience/shiboken.git
   GIT_TAG smtk-head)


cmake: Removed pcre dependency from debian package

--- .cmake/Modules/DebConfig.cmake
+++ .cmake/Modules/DebConfig.cmake
@@ -7,12 +7,9 @@
   debhelper
   cmake
   gettext
-  libpcre3-dev
 )

-set(CPACK_DEBIAN_PACKAGE_DEPENDS
-  libpcre3
-)
+set(CPACK_DEBIAN_PACKAGE_DEPENDS)

 set(CPACK_DEBIAN_CMAKE_OPTIONS)
 set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/description.txt")


BUG: Specify CMAKE_GENERATOR for Eigen external project build

On Windows, with the Ninja Generator and a non-default Visual Studio
toolset, the Eigen External Project will fail to build, attempting to
use MSBuild, without the generator specified.

--- CMake/itkExternal_Eigen3.cmake
+++ CMake/itkExternal_Eigen3.cmake
@@ -37,6 +37,7 @@
     "-DCMAKE_INSTALL_PREFIX=${_eigen3_cmake_install_prefix}"
     "-DCMAKE_INSTALL_INCLUDEDIR=${_eigen3_cmake_install_includedir}"
     "-DCMAKE_INSTALL_DATADIR=${_eigen3_cmake_install_datadir}"
+    "-DCMAKE_GENERATOR=${CMAKE_GENERATOR}"
     ${_additional_external_project_args}
     WORKING_DIRECTORY ${_eigen3_build_dir}
     )


Fixed CMake variables for building MITK libraries/applications.

These variables should actually not be used. They are here for backwards
compatibility. We record all include dirs, but do not add link libraries
which people might actually not need to link to.

--- CMake/mitkSetupVariables.cmake
+++ CMake/mitkSetupVariables.cmake
@@ -24,7 +24,12 @@
 endif()

 # build the MITK_INCLUDE_DIRS variable
-set(MITK_INCLUDE_DIRS ${PROJECT_BINARY_DIR})
+set(MITK_INCLUDE_DIRS
+    ${ITK_INCLUDE_DIRS}
+    ${VTK_INCLUDE_DIRS}
+    ${PROJECT_BINARY_DIR} # contains mitkConfig.h and similar files
+    ${MODULES_CONF_DIRS} # contains module *Exports.h files
+   )
 set(CORE_DIRECTORIES Common DataManagement Algorithms IO Rendering Interactions Controllers Service)
 foreach(d ${CORE_DIRECTORIES})
   list(APPEND MITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/Core/Code/${d})
@@ -103,17 +108,12 @@

   set(QMITK_INCLUDE_DIRS
       ${MITK_INCLUDE_DIRS}
-      ${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Qmitk
-      ${PROJECT_BINARY_DIR}/CoreUI/Qmitk
+      ${CMAKE_CURRENT_SOURCE_DIR}/Modules/Qmitk
+      ${PROJECT_BINARY_DIR}/Modules/Qmitk
      )
-
-  foreach(d QmitkApplicationBase QmitkModels QmitkPropertyObservers)
-    list(APPEND QMITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Qmitk/${d})
-  endforeach()
-  list(APPEND QMITK_INCLUDE_DIRS ${QWT_INCLUDE_DIR})

-  set(QMITK_LIBRARIES Qmitk ${MITK_LIBRARIES} ${QT_LIBRARIES})
-  set(QMITK_LINK_DIRECTORIES ${MITK_LINK_DIRECTORIES} ${QT_LIBRARY_DIR})
+  set(QMITK_LIBRARIES Qmitk ${MITK_LIBRARIES})
+  set(QMITK_LINK_DIRECTORIES ${MITK_LINK_DIRECTORIES})
 endif()

 if(MITK_BUILD_ALL_PLUGINS)


Fixed building clFFT external

Fixed building clFFT external

--- CMakeModules/build_clFFT.cmake
+++ CMakeModules/build_clFFT.cmake
@@ -18,17 +18,17 @@
   UPDATE_COMMAND ""
   CONFIGURE_COMMAND ${CMAKE_COMMAND} -Wno-dev "-G${CMAKE_GENERATOR}" <SOURCE_DIR>/src
     -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-    "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -w"
+    "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -w -fPIC"
     -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-    "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} -w"
+    "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} -w -fPIC"
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+    -DBUILD_SHARED_LIBS:BOOL=OFF
     -DBUILD_CLIENT:BOOL=OFF
-    -DBUILD_SHARED_LIBRARY:BOOL=OFF
     -DBUILD_TEST:BOOL=OFF
     -DSUFFIX_LIB:STRING=
     -DUSE_SYSTEM_GTEST:BOOL=ON
-  ${byproducts})
+  )

 ExternalProject_Get_Property(clFFT-external install_dir)
 add_library(clFFT IMPORTED STATIC)


Added messaging library to CMake

Added messaging library to CMake

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -37,7 +37,9 @@
   set(_lib_path "$ENV{NDDSHOME}/lib")
   file(GLOB_RECURSE _libs
     RELATIVE "${_lib_path}"
-    "$ENV{NDDSHOME}/lib/*/libnddscpp.so")
+    "$ENV{NDDSHOME}/lib/*/libnddscpp.so"
+    "$ENV{NDDSHOME}/lib/*/librticonnextmsgcpp.so"
+)

   # remove libraries from non-matching platforms
   set(_i 0)
@@ -80,20 +82,22 @@
   endwhile()

   if("${_libs} " STREQUAL " ")
-    message(FATAL_ERROR "NNDSHOME set to '$ENV{NDDSHOME}' but could not find 'libnddscpp.so' under '${_lib_path}'")
+    message(FATAL_ERROR "NDDSHOME set to '$ENV{NDDSHOME}' but could not find 'libnddscpp.so' under '${_lib_path}'")
   endif()
-  if(_length GREATER 1)
-    message(FATAL_ERROR "NNDSHOME set to '$ENV{NDDSHOME}' but found multiple files named 'libnddscpp.so' under '${_lib_path}': ${_libs}")
+  if(_length GREATER 2)
+    message(FATAL_ERROR "NDDSHOME set to '$ENV{NDDSHOME}' but found multiple files named 'libnddscpp.so' under '${_lib_path}': ${_libs}")
   endif()

-  list(GET _libs 0 _lib)
-  list(APPEND Connext_LIBRARIES "${_lib_path}/${_lib}")
+  list(GET _libs 0 _libndds)
+  list(GET _libs 1 _libmessaging)
+  list(APPEND Connext_LIBRARIES "${_lib_path}/${_libndds}")
+  list(APPEND Connext_LIBRARIES "${_lib_path}/${_libmessaging}")

   get_filename_component(_lib_path "${Connext_LIBRARIES}" DIRECTORY)
   set(Connext_LIBRARY_DIRS "${_lib_path}")

   set(Connext_DEFINITIONS "-DRTI_LINUX" "-DRTI_UNIX")
-  set(Connext_DDSGEN2 "$ENV{NDDSHOME}/scripts/rtiddsgen2")
+  set(Connext_DDSGEN2 "$ENV{NDDSHOME}/bin/rtiddsgen2")
   set(Connext_FOUND TRUE)
 else()
   # try to find_package() it


cmake: added colored output for gcc >= 4.9

--- src/cmake/common-settings.cmake
+++ src/cmake/common-settings.cmake
@@ -175,12 +175,13 @@

 if (NOT MSVC)
 	# Optimisation
-	compile_flag("-O3"                   O3  RELEASE)
-	compile_flag("-fomit-frame-pointer"  FOMIT_FRAME_POINTER  RELEASE RELWITHDEBINFO)
-	compile_flag("-fstrict-aliasing"     STRICT_ALIASING      RELEASE RELWITHDEBINFO)
-	compile_flag("-msse"                 MSSE                 RELEASE RELWITHDEBINFO)
-	compile_flag("-msse2"                MSSE2                RELEASE RELWITHDEBINFO)
-	compile_flag("-fvisibility=hidden"   VISIBILITY_HIDDEN    RELEASE DEBUG RELWITHDEBINFO)
+	compile_flag("-O3"                       O3  RELEASE)
+	compile_flag("-fomit-frame-pointer"      FOMIT_FRAME_POINTER  RELEASE RELWITHDEBINFO)
+	compile_flag("-fstrict-aliasing"         STRICT_ALIASING      RELEASE RELWITHDEBINFO)
+	compile_flag("-msse"                     MSSE                 RELEASE RELWITHDEBINFO)
+	compile_flag("-msse2"                    MSSE2                RELEASE RELWITHDEBINFO)
+	compile_flag("-fvisibility=hidden"       VISIBILITY_HIDDEN    RELEASE DEBUG RELWITHDEBINFO)
+	compile_flag("-fdiagnostics-color=auto"  DIAG_COLORS          RELEASE DEBUG RELWITHDEBINFO)
 	#compile_flag("-mfpmath=sse"          FPMATH_MSSE          RELEASE RELWITHDEBINFO)

 	# link


Do not hardcode version number in oce_config.h.cmake

Its value is automatically set by CMakeLists.txt.

--- oce_config.h.cmake
+++ oce_config.h.cmake
@@ -258,7 +258,7 @@
 #cmakedefine TM_IN_SYS_TIME

 /* Version number of package */
-#define VERSION "0.1.0"
+#define VERSION "@OCE_VERSION@"

 /* Define if your processor stores words with the most significant byte first
    (like Motorola and SPARC, unlike Intel and VAX). */


fix the CMake macros to install generated files correctly

Summary:
Fix the `thrift_generate()` macro to use the correct paths in the `install()`
rule.  Every location that calls `thrift_generate()` in the other
CMakeLists.txt files uses an absolute path for `output_path`, and a relative
path for `include_prefix`.  Because the `install()` functions used `output`
path as the destination directory, this was causing the generated files to
incorrectly be installed as `${prefix}/include/full/path/to/source/repo/...`

e.g., if you had your fbthrift checkout at `/home/user/src/fbthrift`, when you
built and installed from it, all of the generated thrift header files would be
installed under `/usr/local/include/home/user/src/fbthrift/...`

Changing this `install()` rule to use the `include_prefix` as the install
destination seems like the easiest fix.

Reviewed By: wez

Differential Revision: D7479061

fbshipit-source-id: 3492667a1287768ebcb8f0fea16ddf748791e1ff

--- ThriftLibrary.cmake
+++ ThriftLibrary.cmake
@@ -224,10 +224,10 @@
 )
 install(
   DIRECTORY gen-${language}
-  DESTINATION include/${output_path}
+  DESTINATION include/${include_prefix}
   FILES_MATCHING PATTERN "*.h")
 install(
   DIRECTORY gen-${language}
-  DESTINATION include/${output_path}
+  DESTINATION include/${include_prefix}
   FILES_MATCHING PATTERN "*.tcc")
 endmacro()


Show Stack setup.

Show Stack setup.

--- lib/FindStack.cmake
+++ lib/FindStack.cmake
@@ -4,7 +4,6 @@
 IF (STACK_EXECUTABLE)
     EXECUTE_PROCESS(
         COMMAND stack setup
-        OUTPUT_QUIET
     )
     SET(STACK_FOUND TRUE)
 ELSE (STACK_EXECUTABLE)


Fix building against liblttng-ust-dev 2.8+

--- src/pal/src/configure.cmake
+++ src/pal/src/configure.cmake
@@ -33,7 +33,15 @@
 check_include_files(lwp.h HAVE_LWP_H)
 check_include_files(libunwind.h HAVE_LIBUNWIND_H)
 check_include_files(runetype.h HAVE_RUNETYPE_H)
+
+if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
+  set(CMAKE_REQUIRED_FLAGS "-ldl")
+endif()
 check_include_files(lttng/tracepoint.h HAVE_LTTNG_TRACEPOINT_H)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
+  unset(CMAKE_REQUIRED_FLAGS)
+endif()
+
 check_include_files(uuid/uuid.h HAVE_LIBUUID_H)
 check_include_files(sys/sysctl.h HAVE_SYS_SYSCTL_H)
 check_include_files(gnu/lib-names.h HAVE_GNU_LIBNAMES_H)


set compiler ID in ios toolchain

set compiler ID in ios toolchain

--- toolchains/ios.toolchain.cmake
+++ toolchains/ios.toolchain.cmake
@@ -21,8 +21,6 @@
 include( "${CMAKE_CURRENT_LIST_DIR}/apple.cmake" )
 unset( TNUN_native_optimization ) # This makes no sense when cross-compiling.

-add_compile_options( $<$<COMPILE_LANGUAGE:CXX>:-x objective-c++> )
-
 # Standard settings
 set( CMAKE_SYSTEM_NAME      Darwin )
 set( CPACK_SYSTEM_NAME      iOS    )
@@ -30,7 +28,18 @@
 set( CMAKE_SYSTEM_PROCESSOR arm    )
 set( APPLE true )
 set( iOS   true )
+# compatibility with build scripts that rely on ios toolchains defining IOS instead of iOS
+# CMake variables are case sensitive (unlike functions, macros and commands: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#variables
+set( IOS   true )
 set( UNIX  true )
+
+if( NOT ${CMAKE_GENERATOR} MATCHES "Xcode" )
+    message( FATAL_ERROR "iOS toolchain supports only XCode generator" )
+endif()
+
+# Compiler detection is skipped, so we must manually set these variables so code that depend on them can work
+set( CMAKE_CXX_COMPILER_ID "AppleClang" CACHE STRING "C++ compiler id" )
+set( CMAKE_C_COMPILER_ID "AppleClang"  CACHE STRING "C compiler id" )

 set( TNUN_os_suffix iOS )


Compile sodium as C on non-windows

Compile sodium as C on non-windows

--- ext/sodium.cmake
+++ ext/sodium.cmake
@@ -172,7 +172,9 @@
 	libsodium/src/libsodium/sodium/utils.c
 	libsodium/src/libsodium/sodium/version.c)

-SET_SOURCE_FILES_PROPERTIES(${sodium_SOURCES} PROPERTIES LANGUAGE CXX)
+if (WIN32)
+    SET_SOURCE_FILES_PROPERTIES(${sodium_SOURCES} PROPERTIES LANGUAGE CXX)
+endif()

 add_library(sodium
 	${sodium_SOURCES}


Missed an instance of DISABLE -> ENABLE changes

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -17,8 +17,8 @@
   set(OGRE_SET_BUILD_PLATFORM_IPHONE 1)
   set(OGRE_STATIC 1)
   set(OGRE_STATIC_LIB 1)
-  set(OGRE_CONFIG_DISABLE_VIEWPORT_ORIENTATIONMODE FALSE)
-  set(OGRE_CONFIG_DISABLE_PVRTC FALSE)
+  set(OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATIONMODE TRUE)
+  set(OGRE_CONFIG_ENABLE_PVRTC TRUE)
 endif()

 # should we build static libs?


update openthreads library names in OSSIM dependencies

--- CMake/External_ossim.cmake
+++ CMake/External_ossim.cmake
@@ -62,14 +62,14 @@
     list(APPEND ${proj}_DEPENDENCIES JPEG)
   endif()

-  if(USE_SYSTEM_OPENTHREAD)
-    set(OSSIM_SB_OPENTHREAD_CONFIG)
+  if(USE_SYSTEM_OPENTHREADS)
+    set(OSSIM_SB_OPENTHREADS_CONFIG)
   else()
-    set(OSSIM_SB_OPENTHREAD_CONFIG
+    set(OSSIM_SB_OPENTHREADS_CONFIG
       -DOPENTHREADS_INCLUDE_DIR:STRING=${CMAKE_INSTALL_PREFIX}/include
       -DOPENTHREADS_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/libOpenThreads.so
       )
-    list(APPEND ${proj}_DEPENDENCIES OPENTHREAD)
+    list(APPEND ${proj}_DEPENDENCIES OPENTHREADS)
   endif()

     ExternalProject_Add(ossim_cmakemodules
@@ -86,7 +86,7 @@
   if(MSVC)
     #checkout cmakeModules
      set(${proj}_DEPENDENCIES ossim_cmakemodules)
-     list(APPEND ${proj}_DEPENDENCIES OPENTHREAD)
+     list(APPEND ${proj}_DEPENDENCIES OPENTHREADS)
      list(APPEND ${proj}_DEPENDENCIES GEOTIFF)
     #cmake flags for exception handling in c++
     set(OSSIM_CXX_FLAGS /EHsc)
@@ -95,7 +95,7 @@
     set(OSSIM_SB_TIFF_CONFIG)
     set(OSSIM_SB_GEOS_CONFIG)
     set(OSSIM_SB_JPEG_CONFIG)
-    set(OSSIM_SB_OPENTHREAD_CONFIG)
+    set(OSSIM_SB_OPENTHREADS_CONFIG)
     set(OSSIM_SB_GEOTIFF_CONFIG)
     #build geotiff and use it
     #set(OSSIM_SB_GEOTIFF_CONFIG -DGEOTIFF_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/gdal_i.lib)
@@ -107,7 +107,6 @@
     SVN_REVISION -r 23087
     BINARY_DIR ${OSSIM_SB_BUILD_DIR}
     INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
-    CMAKE_GENERATOR "NMake Makefiles"
     CMAKE_CACHE_ARGS
       -DOSSIM_VERSION:STRING=1.8.18-1
       -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
@@ -117,13 +116,10 @@
       ${OSSIM_SB_GEOTIFF_CONFIG}
       ${OSSIM_SB_GEOS_CONFIG}
       ${OSSIM_SB_JPEG_CONFIG}
-      ${OSSIM_SB_OPENTHREAD_CONFIG}
+      ${OSSIM_SB_OPENTHREADS_CONFIG}
       -DBUILD_OSSIM_MPI_SUPPORT:BOOL=OFF
     DEPENDS ${${proj}_DEPENDENCIES}
-    CMAKE_COMMAND
-      # use 'env' because CTest launcher doesn't perform shell interpretation
-      env LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib
-      ${CMAKE_COMMAND}
+    CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )

     ExternalProject_Add_Step(${proj} copy_CMakeModules


Use ONEAPI_ROOT env variable also for looking up MKL Installation

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -11,6 +11,9 @@
 # To use this module call the mklvars.(sh,bat) script before you call cmake. This
 # script is located in the bin folder of your mkl installation. This will set the
 # MKLROOT environment variable which will be used to find the libraries on your system.
+#
+# In case you have oneAPI base toolkit installed, having ONEAPI_ROOT environment variable available
+# also will enable picking Intel oneMKL automatically.
 #
 # Example:
 # set(MKL_THREAD_LAYER "TBB")
@@ -101,6 +104,7 @@
     /opt/intel
     /opt/intel/mkl
     $ENV{MKLROOT}
+    $ENV{ONEAPI_ROOT}/mkl/latest
     /opt/intel/compilers_and_libraries/linux/mkl
   PATH_SUFFIXES
     include
@@ -230,6 +234,7 @@
         /opt/intel/tbb/lib
         /opt/intel/lib
         $ENV{MKLROOT}/lib
+        $ENV{ONEAPI_ROOT}/mkl/latest/lib
         ${ENV_LIBRARY_PATHS}
         /opt/intel/compilers_and_libraries/linux/mkl/lib
       PATH_SUFFIXES
@@ -259,6 +264,7 @@
         /opt/intel/tbb/lib
         /opt/intel/lib
         $ENV{MKLROOT}/lib
+        $ENV{ONEAPI_ROOT}/mkl/latest/lib
         ${ENV_LIBRARY_PATHS}
         /opt/intel/compilers_and_libraries/linux/mkl/lib
       PATH_SUFFIXES


Fix cocoa target on glfw

Fix cocoa target on glfw

--- glfw.cmake
+++ glfw.cmake
@@ -17,7 +17,7 @@
     http://downloads.sourceforge.net/project/glfw/glfw/2.7.7)

 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-    set (MAKE_PLATFORM "Cocoa")
+    set (MAKE_PLATFORM "cocoa")
 elseif (${UNIX})
     set (MAKE_PLATFORM "x11")
 else ()
@@ -41,4 +41,4 @@

 # If we also want to include static libraries, use "make x11-install" without the "dist"

-endif (NOT glfw_NAME)+endif (NOT glfw_NAME)


v2x: fix techmap list handling

v2x: fix techmap list handling

Signed-off-by: Karol Gugala <38af71640571ee4b5093d4f69ffca1ac454f2948@antmicro.com>

--- utils/vlog/tests/v2x_tests.cmake
+++ utils/vlog/tests/v2x_tests.cmake
@@ -187,7 +187,7 @@
     append_file_dependency(TECHMAP_DEPS ${MAP})
   endforeach()

-  if(NOT ${TECHMAP_INPUT} STREQUAL "")
+  if(TECHMAP_INPUT)
     add_custom_command(
       OUTPUT "${MERGED_TECHMAP}"
       DEPENDS ${TECHMAP_DEPS}


cmake changes

cmake changes

--- Modules/DiffusionImaging/files.cmake
+++ Modules/DiffusionImaging/files.cmake
@@ -91,6 +91,7 @@
   # Rendering
   Rendering/mitkDiffusionImageMapper.h
   Rendering/mitkOdfVtkMapper2D.h
+  Rendering/mitkFiberBundleMapper3D.h

   # Reconstruction
   Reconstruction/itkDiffusionQballReconstructionImageFilter.h
@@ -103,6 +104,15 @@
   IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.h
   IODataStructures/FiberBundle/itkSlowPolyLineParametricPath.h
   IODataStructures/TbssImages/mitkTbssImage.h
+
+  # DataStructures -> FiberBundleX
+  IODataStructures/FiberBundleX/mitkFiberBundleX.h
+  IODataStructures/FiberBundleX/mitkFiberBundleXWriter.h
+  IODataStructures/FiberBundleX/mitkFiberBundleXReader.h
+  IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.h
+  IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.h
+  IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.h
+

   # Tractography


Don't apply visibility settings to statically built samples. Fixes linking problems with Xcode 4 and iOS. (Backporting to 1.7)

--HG--
branch : v1-7

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -282,14 +282,16 @@
       endif()
     endif(NOT OGRE_BUILD_PLATFORM_IPHONE)
   endif (APPLE)
-  if (CMAKE_COMPILER_IS_GNUCXX)
-    # add GCC visibility flags to shared library build
-    set_target_properties(${SAMPLENAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
-    set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN}")
-    set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN}")
-    # disable "lib" prefix on Unix
-    set_target_properties(${SAMPLENAME} PROPERTIES PREFIX "")
-  endif (CMAKE_COMPILER_IS_GNUCXX)
+  if(NOT OGRE_STATIC)
+    if (CMAKE_COMPILER_IS_GNUCXX)
+      # add GCC visibility flags to shared library build
+      set_target_properties(${SAMPLENAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
+      set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN}")
+      set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN}")
+      # disable "lib" prefix on Unix
+      set_target_properties(${SAMPLENAME} PROPERTIES PREFIX "")
+    endif (CMAKE_COMPILER_IS_GNUCXX)
+  endif()
   if (OGRE_INSTALL_SAMPLES)
 	ogre_install_target(${SAMPLENAME} ${OGRE_SAMPLE_PATH} FALSE)
   endif()


Remove gcc visibility options under MSVC for plugins too

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -66,11 +66,13 @@
   if (OGRE_STATIC)
     # add static prefix, if compiling static version
     set_target_properties(${PLUGINNAME} PROPERTIES OUTPUT_NAME ${PLUGINNAME}Static)
-  else ()
-    # add GCC visibility flags to shared library build
-    set_target_properties(${PLUGINNAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
-    # disable "lib" prefix on Unix
-    set_target_properties(${PLUGINNAME} PROPERTIES PREFIX "")
+  else (OGRE_STATIC)
+    if (CMAKE_COMPILER_IS_GNUCXX)
+      # add GCC visibility flags to shared library build
+      set_target_properties(${PLUGINNAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
+      # disable "lib" prefix on Unix
+      set_target_properties(${PLUGINNAME} PROPERTIES PREFIX "")
+	endif (CMAKE_COMPILER_IS_GNUCXX)
   endif ()
   install(TARGETS ${PLUGINNAME}
     RUNTIME DESTINATION "bin${OGRE_RELEASE_PATH}"


PERF: Ensure PythonQt python module only have their init function visible.

Ensuring only the required symbols are visible will help speed up the
dynamic loader symbol lookup.

Indeed, here is a quote from [1]:

"When the dynamic loader searches for symbols, it performs string
comparisons with every symbol in the search scope. Reducing the number
of symbols the dynamic loader has to go through to find the desired
symbol improves your app’s performance"

[1] https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryUsageGuidelines.html#//apple_ref/doc/uid/TP40001928-SW22

--- CMake/ctkMacroBuildLibWrapper.cmake
+++ CMake/ctkMacroBuildLibWrapper.cmake
@@ -30,6 +30,31 @@
 #! On the other hand, when CTK is built statically, it creates a
 #! static library providing a initialization function that will allow to load
 #! both (1) and (2).
+
+# Function copied from https://github.com/scikit-build/scikit-build/pull/299
+# XXX Update this CMake module to use function from scikit-build to build the wrapper
+function(_ctk_set_python_extension_symbol_visibility _target)
+  if(PYTHON_VERSION_MAJOR VERSION_GREATER 2)
+    set(_modinit_prefix "PyInit_")
+  else()
+    set(_modinit_prefix "init")
+  endif()
+  if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
+    set_target_properties(${_target} PROPERTIES LINK_FLAGS
+        "/EXPORT:${_modinit_prefix}${_target}"
+    )
+  elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+    set(_script_path
+      ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_target}-version-script.map
+    )
+    file(WRITE ${_script_path}
+               "{global: ${_modinit_prefix}${_target}; local: *; };"
+    )
+    set_property(TARGET ${_target} APPEND_STRING PROPERTY LINK_FLAGS
+        " -Wl,--version-script=${_script_path}"
+    )
+  endif()
+endfunction()

 #! \ingroup CMakeAPI
 macro(ctkMacroBuildLibWrapper)
@@ -122,6 +147,7 @@
       set_target_properties(${lib_name}PythonQt PROPERTIES SUFFIX ".pyd")
     endif()
   endif()
+  _ctk_set_python_extension_symbol_visibility(${lib_name}PythonQt)
   set_target_properties(${lib_name}PythonQt PROPERTIES
     RUNTIME_OUTPUT_DIRECTORY "${MY_RUNTIME_OUTPUT_DIRECTORY}"
     LIBRARY_OUTPUT_DIRECTORY "${MY_LIBRARY_OUTPUT_DIRECTORY}"


Fix librealsense include path finding

Fix librealsense include path finding

--- CMakeModules/FindLibRealSense.cmake
+++ CMakeModules/FindLibRealSense.cmake
@@ -16,9 +16,8 @@
 endif()

 #add a hint so that it can find it without the pkg-config
-find_path(LIBREALSENSE_INCLUDE_DIR rs.h
-    HINTS /usr/include/  /usr/local/include
-    PATH_SUFFIXES librealsense)
+find_path(LIBREALSENSE_INCLUDE_DIR librealsense/rs.h
+    HINTS /usr/include/  /usr/local/include)
 #add a hint so that it can find it without the pkg-config
 find_library(LIBREALSENSE_LIBRARY
     NAMES librealsense.so


updated FindOMPL.cmake

updated FindOMPL.cmake

--HG--
extra : convert_revision : 7541b2d141e33d7e306c6502344804b353c6a96d

--- trunk/doc/dox/FindOMPL.cmake
+++ trunk/doc/dox/FindOMPL.cmake
@@ -24,10 +24,10 @@

 # find the lib
-find_library(OMPL_LIBRARY ompl PATHS ${OMPL_LIB_PATH} PATH_SUFFIXES lib)
+find_library(OMPL_LIBRARY ompl PATHS ${OMPL_LIB_PATH} PATH_SUFFIXES lib build/lib)

 # find include path
-find_path(OMPL_INCLUDE SpaceInformation.h PATHS ${OMPL_INCLUDE_PATH} PATH_SUFFIXES base ompl/base include/ompl/base)
+find_path(OMPL_INCLUDE SpaceInformation.h PATHS ${OMPL_INCLUDE_PATH} PATH_SUFFIXES base ompl/base include/ompl/base src/ompl/base)
 if (OMPL_INCLUDE)
     string(REGEX REPLACE "/ompl/base$" "" OMPL_INCLUDE ${OMPL_INCLUDE})
 else()


Fixed bug introduced in 4d2c42d5600f7a9550c1a906e691ede1a0219476

--HG--
branch : v1-9

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -242,27 +242,27 @@
   if (WIN32)
     # copy the required DLLs to the build directory (configure_file is the only copy-like op I found in CMake)
     if(NOT OGRE_BUILD_PLATFORM_WINRT)
-      install(FILES ${OIS_BINARY_DBG} DESTINATION lib/debug CONFIGURATIONS Debug None "")
-    	install(FILES ${OIS_BINARY_REL} DESTINATION lib/release CONFIGURATIONS Release None "")
-    	install(FILES ${OIS_BINARY_REL} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-    	install(FILES ${OIS_BINARY_REL} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
+      file(COPY ${OIS_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
+    	file(COPY ${OIS_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
+    	file(COPY ${OIS_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
+    	file(COPY ${OIS_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
     endif ()

     if (OGRE_BUILD_PLUGIN_CG)
       # if MinGW or NMake, the release/debug cg.dll's would conflict, so just pick one
       if (MINGW OR (CMAKE_GENERATOR STREQUAL "NMake Makefiles"))
         if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-          install(FILES ${Cg_BINARY_DBG} DESTINATION bin/debug CONFIGURATIONS Debug None "")
+          file(COPY ${Cg_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
         else ()
-          install(FILES ${Cg_BINARY_REL} DESTINATION bin/release CONFIGURATIONS Release None "")
-    			install(FILES ${Cg_BINARY_REL} DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-    			install(FILES ${Cg_BINARY_REL} DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel)
+          file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
+    			file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
+    			file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
         endif ()
       else ()
-        install(FILES ${Cg_BINARY_DBG} DESTINATION bin/debug CONFIGURATIONS Debug None "")
-    		install(FILES ${Cg_BINARY_REL} DESTINATION bin/release CONFIGURATIONS Release None "")
-    		install(FILES ${Cg_BINARY_REL} DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-    		install(FILES ${Cg_BINARY_REL} DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel)
+        file(COPY ${Cg_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
+    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
+    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
+    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
       endif ()
     endif()


Updated build script to work when SuperLU is not found.

--- CMake/Modules/FindSuperLU.cmake
+++ CMake/Modules/FindSuperLU.cmake
@@ -11,7 +11,7 @@
 	PATH_SUFFIXES lib lib32 lib64 SRC
 )

-IF(NOT DEFINED SUPER_LU_INCLUDES-NOTFOUND AND NOT DEFINED SUPER_LU_LIBRARIES-NOTFOUND)
+IF(SUPER_LU_INCLUDES AND SUPER_LU_LIBRARIES)
 	SET(CMAKE_REQUIRED_INCLUDES ${SUPER_LU_INCLUDES})
 	SET(CMAKE_REQUIRED_LIBRARIES ${SUPER_LU_LIBRARIES} lapack blas)
 	INCLUDE(CheckCXXSourceCompiles)
@@ -57,14 +57,13 @@
 		}"
 		SUPER_LU_COMPILED
 	)
-ENDIF(NOT DEFINED SUPER_LU_INCLUDES-NOTFOUND AND NOT DEFINED SUPER_LU_LIBRARIES-NOTFOUND)
-
-IF(${SUPER_LU_COMPILED})
-	INCLUDE(FindPackageHandleStandardArgs)
-	FIND_PACKAGE_HANDLE_STANDARD_ARGS(
-		SuperLU FOUND_VAR SuperLU_FOUND
-		REQUIRED_VARS SUPER_LU_INCLUDES SUPER_LU_LIBRARIES
-	)
-ENDIF(${SUPER_LU_COMPILED})
+	IF(${SUPER_LU_COMPILED})
+		INCLUDE(FindPackageHandleStandardArgs)
+		FIND_PACKAGE_HANDLE_STANDARD_ARGS(
+			SuperLU FOUND_VAR SuperLU_FOUND
+			REQUIRED_VARS SUPER_LU_INCLUDES SUPER_LU_LIBRARIES
+		)
+	ENDIF(${SUPER_LU_COMPILED})
+ENDIF(SUPER_LU_INCLUDES AND SUPER_LU_LIBRARIES)

 #MARK_AS_ADVANCED(SUPER_LU_INCLDUES SUPER_LU_LIBRARIES)


attempt to fix compilation

attempt to fix compilation

--- CMake/hoomd/HOOMDMPISetup.cmake
+++ CMake/hoomd/HOOMDMPISetup.cmake
@@ -14,7 +14,7 @@
         find_path(cereal_INCLUDE_DIR NAMES cereal/cereal.hpp
             PATHS ${CMAKE_INSTALL_PREFIX}/include)
         add_library(cereal INTERFACE IMPORTED)
-        target_include_directories(cereal INTERFACE ${cereal_INCLUDE_DIR})
+        set_target_properties(cereal PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${cereal_INCLUDE_DIR}")
         find_package_message(cereal "Could not find cereal, assuming it is on a default path" "[${cereal_INCLUDE_DIR}]")
     endif()


BUG: GDAL: activate threads support explicitly

--- SuperBuild/CMake/External_gdal.cmake
+++ SuperBuild/CMake/External_gdal.cmake
@@ -101,6 +101,7 @@
     --with-xml2=no
     --with-pg=no
     --with-webp=no
+    --with-threads=yes
     ${GDAL_SB_CONFIG}
     ${GDAL_SB_EXTRA_OPTIONS}
     )


BUG: avoid add_custom_target in FFTW superbuild

--- Superbuild/CMake/External_fftw.cmake
+++ Superbuild/CMake/External_fftw.cmake
@@ -28,6 +28,7 @@
       PREFIX ${proj}
       URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
       URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
+      SOURCE_DIR ${FFTW_SB_BUILD_FLOAT_DIR}
       INSTALL_DIR ${SB_INSTALL_PREFIX}
       CONFIGURE_COMMAND
         ${FFTW_SB_BUILD_FLOAT_DIR}/configure
@@ -48,10 +49,11 @@
     #  )

     # Compile the double version of FFTW
-    ExternalProject_Add(${projDouble}
+    ExternalProject_Add(${proj}
       PREFIX ${proj}
       URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
       URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
+      SOURCE_DIR ${FFTW_SB_BUILD_DOUBLE_DIR}
       INSTALL_DIR ${SB_INSTALL_PREFIX}
       CONFIGURE_COMMAND
         ${FFTW_SB_BUILD_DOUBLE_DIR}/configure
@@ -71,8 +73,7 @@
     #  DEPENDERS configure
     #  )

-    add_custom_target(${proj})
-    add_dependencies(${proj} ${projDouble} ${projFloat})
+    add_dependencies(${proj} ${projFloat})

     set(_SB_${proj}_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)


[FIX,INTERNAL] Making demo target auto-detection ignore hidden .dot files.

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

--- util/cmake/SeqAnBuildSystem.cmake
+++ util/cmake/SeqAnBuildSystem.cmake
@@ -452,9 +452,14 @@
     foreach (ENTRY ${ENTRIES})
         string (REPLACE "/" "_" BIN_NAME "${ENTRY}")
         string (REPLACE "\\" "_" BIN_NAME "${BIN_NAME}")
-        get_filename_component(BIN_NAME "${BIN_NAME}" NAME_WE)
-        add_executable(${PREFIX}${BIN_NAME} ${ENTRY})
-        target_link_libraries (${PREFIX}${BIN_NAME} ${SEQAN_LIBRARIES})
+        get_filename_component (BIN_NAME "${BIN_NAME}" NAME_WE)
+
+        get_filename_component (FILE_NAME "${ENTRY}" NAME)
+        message (STATUS "FILE_NAME ${FILE_NAME}")
+        if (NOT "${FILE_NAME}" MATCHES "^\\.")
+            add_executable(${PREFIX}${BIN_NAME} ${ENTRY})
+            target_link_libraries (${PREFIX}${BIN_NAME} ${SEQAN_LIBRARIES})
+        endif ()
     endforeach (ENTRY ${ENTRIES})
 endmacro (seqan_build_demos_develop)


cmake: make subprojects inherit the processor type

--- .cmake/Modules/Subprojects.cmake
+++ .cmake/Modules/Subprojects.cmake
@@ -45,7 +45,9 @@
       set (ARGS_GENERATOR ${CMAKE_GENERATOR})
     endif ()
     if (CMAKE_TOOLCHAIN_FILE)
-      set (ARGS_OPTS ${ARGS_OPTS} "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
+      set (ARGS_OPTS ${ARGS_OPTS}
+        "-DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}"
+        "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
     endif ()
     set (build_cmds
       CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR>


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


Made it possible to build on Windows.

Made it possible to build on Windows.

--- toolchains/teensy.cmake
+++ toolchains/teensy.cmake
@@ -10,10 +10,20 @@
 set(TEENSY_VERSION 31 CACHE STRING "Set to the Teensy version corresponding to your board (30 or 31 allowed)" FORCE)
 set(CPU_CORE_SPEED 96000000 CACHE STRING "Set to 24000000, 48000000, 72000000 or 96000000 to set CPU core speed" FORCE)

+set(_EXE_EXT)
+
+# TODO - This might not always work...
+set(USER_HOME $ENV{HOME})
+
 if(APPLE)
     set(ARDUINOPATH "/Applications/Arduino.app/Contents/Resources/Java/" CACHE STRING "Path to Arduino installation")
 elseif(UNIX)
     set(ARDUINOPATH "/usr/share/arduino/" CACHE STRING "Path to Arduino installation")
+elseif(WIN32)
+    set(ARDUINOPATH "C:/Program Files (x86)/Arduino/" CACHE STRING "Path to Arduino installation")
+    set(_EXE_EXT ".exe")
+    set(USER_HOME $ENV{HOMEDRIVE}$ENV{HOMEPATH}/Documents)
+    string(REGEX REPLACE "\\\\" "/" USER_HOME ${USER_HOME})
 endif()

@@ -33,8 +43,8 @@
 set(CMAKE_SYSTEM_NAME Generic)

 # specify the cross compiler
-cmake_force_c_compiler(${COMPILERPATH}arm-none-eabi-gcc GNU)
-cmake_force_cxx_compiler(${COMPILERPATH}arm-none-eabi-g++ GNU)
+cmake_force_c_compiler(${COMPILERPATH}arm-none-eabi-gcc${_EXE_EXT} GNU)
+cmake_force_cxx_compiler(${COMPILERPATH}arm-none-eabi-g++${_EXE_EXT} GNU)

 # where is the target environment
 set(CMAKE_FIND_ROOT_PATH ${COMPILERPATH})
@@ -83,7 +93,7 @@
     set_target_properties(${ELFTARGET} PROPERTIES COMPILE_FLAGS "-Wall -g -Os -mcpu=${CPU} -mthumb -nostdlib -MMD -felide-constructors -fno-exceptions -fno-rtti -std=gnu++0x")
     set_target_properties(${ELFTARGET} PROPERTIES COMPILE_DEFINITIONS "${TEENSY_DEFINITIONS}")
     set_target_properties(${ELFTARGET} PROPERTIES INCLUDE_DIRECTORIES "${COREPATH}")
-    set_target_properties(${ELFTARGET} PROPERTIES LINK_FLAGS "-Os -Wl,--gc-sections,--defsym=__rtc_localtime=0 --specs=nano.specs -mcpu=${CPU} -mthumb -T${LINKER_FILE}")
+    set_target_properties(${ELFTARGET} PROPERTIES LINK_FLAGS "-Os -Wl,--gc-sections,--defsym=__rtc_localtime=0 --specs=nano.specs -mcpu=${CPU} -mthumb -T\"${LINKER_FILE}\"")

     add_custom_command(OUTPUT ${TARGET}.hex
                        COMMAND ${COMPILERPATH}arm-none-eabi-size ${ELFTARGET}
@@ -101,9 +111,6 @@
     unset(${TARGET}_LIBRARY_SOURCES CACHE)
     unset(${TARGET}_LIBRARY_INCLUDE_DIRS CACHE)
 endfunction()
-
-# TODO - This might not always work...
-set(USER_HOME $ENV{HOME})

 # Should be called *before* calling teensy_add_executable.
 function(teensy_link_libraries TARGET)


OEL changed the python std lib dir

OEL changed the python std lib dir

--- PyPort/system-python.cmake
+++ PyPort/system-python.cmake
@@ -119,7 +119,7 @@
 	if(PACKAGE_PYTHON)
 		set(PACK_NAMES python expat zlib tinfo sqlite readline ncurses mpdec lzma ffi db5 bz2)
 		find_path(PYTHON_STDLIB_DIR _pydecimal.py
-			PATHS ${PYTHON_HOME}/lib/${PYTHON_VER} ${PYTHON_HOME}/Lib
+			PATHS ${PYTHON_HOME}/lib/${PYTHON_VER} ${PYTHON_HOME}/lib64/${PYTHON_VER} ${PYTHON_HOME}/Lib
 			NO_DEFAULT_PATH
 			CMAKE_FIND_ROOT_PATH_BOTH)
 		if(PYTHON_STDLIB_DIR)


Use MAKE_BUILD_RPATH feature

Use MAKE_BUILD_RPATH feature

--- flags/sanitize_address.cmake
+++ flags/sanitize_address.cmake
@@ -67,10 +67,11 @@
   polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "${_xcode_asan_lib}")
   polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "${_xcode_asan_lib}")

-  # FIXME: http://www.mail-archive.com/cmake-developers@cmake.org/msg17290.html {
-  polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "-Wl,-rpath,${_xcode_asan_lib_dir}")
-  polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "-Wl,-rpath,${_xcode_asan_lib_dir}")
-  # }
+  if(CMAKE_VERSION VERSION_LESS 3.8.0)
+    polly_fatal_error("At least CMake 3.8.0 required (BUILD_RPATH feature)")
+  endif()
+
+  set(CMAKE_BUILD_RPATH "${_xcode_asan_lib_dir}")

   # Hunter copying rules {
   set_property(GLOBAL APPEND PROPERTY HUNTER_COPY_FILES "${_xcode_asan_lib}")


BUG: In ctkMacroWrapPythonQt, update path with python library path to make sure python executable works properly.

When python executable isn't in the path, it's critical to make sure python
library can be found.

--- CMake/ctkMacroWrapPythonQt.cmake
+++ CMake/ctkMacroWrapPythonQt.cmake
@@ -69,10 +69,11 @@
 #
 FUNCTION(ctkMacroWrapPythonQt_reSearchFile python_exe python_library_path regex file is_matching)

-  set(python_cmd "import re\; f = open('${file}', 'r')\;
-res = re.search\(\"${regex}\", f.read(), re.MULTILINE\)\;
-if res == None: print \"FALSE\"
-else: print \"TRUE\"
+  set(python_cmd "import re
+f = open('${file}', 'r')
+res = re.search('${regex}', f.read(), re.MULTILINE)
+if res == None: print 'FALSE'
+else: print 'TRUE'
 ")
   #message("python_cmd: ${python_cmd}")


Remove compute 1.0, 1.1, and 1.2 arches when building for double precision

Since 1.3 is needed for doubles, this makes hoomd build correctly with default settings in the arch list. It might cause some user confusion when the minimum build is 13, but 12 is in the arch list, but only advanced users actually know what the arch list is anyways….

refs #1035

--- CMake/hoomd/HOOMDCUDASetup.cmake
+++ CMake/hoomd/HOOMDCUDASetup.cmake
@@ -38,6 +38,11 @@
         set(CUDA_ARCH_LIST 12 13 20 30 CACHE STRING "List of target sm_ architectures to compile CUDA code for. Separate with semicolons.")
     else()
         set(CUDA_ARCH_LIST 12 13 20 CACHE STRING "List of target sm_ architectures to compile CUDA code for. Separate with semicolons.")
+    endif()
+
+    # if double precision is on, remove incompatible arches
+    if (NOT SINGLE_PRECISION)
+        list(REMOVE_ITEM CUDA_ARCH_LIST 12 11 10)
     endif()

     foreach(_cuda_arch ${CUDA_ARCH_LIST})


Fixed the install path of plugins under Windows.

--- CMakeModules/OsgMacroUtils.cmake
+++ CMakeModules/OsgMacroUtils.cmake
@@ -131,7 +131,7 @@

 #the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
     IF(WIN32)
-        INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION bin )
+        INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib/${OSG_PLUGINS} LIBRARY DESTINATION bin/${OSG_PLUGINS} )
     ELSE(WIN32)
         INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} )
     ENDIF(WIN32)


Include thread tests in CMake.

Include thread tests in CMake.

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -200,6 +200,7 @@
 endif()
 addPath("${srcDir}/platform/test")
 addPath("${srcDir}/platform/threads")
+addPath("${srcDir}/platform/threads/test")
 addPath("${srcDir}/platform/async")
 addPath("${srcDir}/platform/async/test")
 addPath("${srcDir}/platform/input")


同步protobuf配置文件

同步protobuf配置文件

--- 3rd_party/protobuf/protobuf.cmake
+++ 3rd_party/protobuf/protobuf.cmake
@@ -13,20 +13,41 @@
 list(APPEND CMAKE_INCLUDE_PATH "${3RD_PARTY_PROTOBUF_ROOT_DIR}/include")
 list(APPEND CMAKE_LIBRARY_PATH "${3RD_PARTY_PROTOBUF_ROOT_DIR}/lib")
 list(APPEND CMAKE_PROGRAM_PATH "${3RD_PARTY_PROTOBUF_ROOT_DIR}/bin")
+
+# 如果要设置ABI规则（比如GCC使用老的符号规则:-D_GLIBCXX_USE_CXX11_ABI=0） 可以加在PROJECT_COMPILER_ADAPTOR_FLAGS里。但一定要保证编译protobuf和工程中所用的一致
 if(NOT WIN32 AND NOT CYGWIN AND NOT MINGW)
-    set(3RD_PARTY_PROTOBUF_PIE -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC)
+    set(3RD_PARTY_PROTOBUF_PIE -DCMAKE_C_FLAGS="-fPIC ${PROJECT_COMPILER_ADAPTOR_FLAGS}" -DCMAKE_CXX_FLAGS="-fPIC ${PROJECT_COMPILER_ADAPTOR_FLAGS}")
 else()
-    set(3RD_PARTY_PROTOBUF_PIE )
+    set(3RD_PARTY_PROTOBUF_PIE -DCMAKE_C_FLAGS="${PROJECT_COMPILER_ADAPTOR_FLAGS}" -DCMAKE_CXX_FLAGS="${PROJECT_COMPILER_ADAPTOR_FLAGS}")
 endif()

 if (NOT EXISTS ${3RD_PARTY_PROTOBUF_PKG_DIR})
     file(MAKE_DIRECTORY ${3RD_PARTY_PROTOBUF_PKG_DIR})
 endif()

+# MSVC 必须用静态库，而且会被用/MT编译。我们要把默认的/MD改为/MT
+# 使用 /MD protobuf有时候会崩溃，/MT依赖较少不容易出问题
+# 注意protobuf的 RelWithDebInfo 默认使用 /MT 而邮箱工程默认是 /MTd
+if (MSVC)
+    set (3RD_PARTY_PROTOBUF_BUILD_SHARED_LIBS -DBUILD_SHARED_LIBS=OFF)
+    # add_compiler_define(PROTOBUF_USE_DLLS) # MSVC 使用动态库必须加这个选项
+    foreach(flag_var
+        CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+        CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+        if(${flag_var} MATCHES "/MD")
+            string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+        endif(${flag_var} MATCHES "/MD")
+    endforeach(flag_var)
+#else ()
+    # 其他情况使用默认值即可
+    # set (3RD_PARTY_PROTOBUF_BUILD_SHARED_LIBS OFF)
+endif ()
+
+
 FindConfigurePackage(
     PACKAGE Protobuf
     BUILD_WITH_CMAKE
-    CMAKE_FLAGS ${3RD_PARTY_PROTOBUF_PIE}
+    CMAKE_FLAGS ${3RD_PARTY_PROTOBUF_PIE} -Dprotobuf_BUILD_TESTS=OFF ${3RD_PARTY_PROTOBUF_BUILD_SHARED_LIBS}
     WORKING_DIRECTORY "${3RD_PARTY_PROTOBUF_PKG_DIR}"
     PREFIX_DIRECTORY "${3RD_PARTY_PROTOBUF_ROOT_DIR}"
     SRC_DIRECTORY_NAME "protobuf-${3RD_PARTY_PROTOBUF_VERSION}"


From Jorge Ciges, "Update to FindAndroidNDK to make it use the latest Ndk (r5c) automatically.

That fixes compatibilities with some 2.1 devices. And it looks like all goes well."

--- CMakeModules/FindAndroidNDK.cmake
+++ CMakeModules/FindAndroidNDK.cmake
@@ -19,6 +19,11 @@

 IF(NOT ANDROID_NDK)
     FIND_PATH(ANDROID_NDK ndk-build
+    # search for r5c
+        ~/android-ndk-r5c
+        ~/android_develop/android-ndk-r5c
+        ~/ndk-r5c
+        ~/android_develop/ndk-r5c
         # search for r5b
         ~/android-ndk-r5b
         ~/android_develop/android-ndk-r5b


ENH: update ITKMontage: Fix crash when setting tiles from memory

--- Modules/Remote/Montage.remote.cmake
+++ Modules/Remote/Montage.remote.cmake
@@ -2,5 +2,5 @@
 itk_fetch_module(Montage
 "Reconstruction of 3D volumetric dataset from a collection of 2D slices"
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKMontage.git
-  GIT_TAG d5f241c6fffc1a85714cc182f6d3620a283ce2d2
+  GIT_TAG 5869fbd24a16e319d3d7b5fe6df0fd52cd393124
   )


REFAC: update diapotb git tag

REFAC: update diapotb git tag

--- 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 2746e0241022e0d2c5809f362436bc2b36363db4
+  GIT_TAG d55001b44df1a9c4a1c1d542dfd1362003bb0b51
 )


REFACT: Correct GIT_TAG for DiapOTB

REFACT: Correct GIT_TAG 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 9119c2eb062012f7d1c00047d4ca0df24163d61d
+  GIT_TAG 8f6b3a9d1efc1ee99e619d5c408f72a2dfe31753
 )


ENH: ITK_BULD_ALL_MODULES is deprecated and has been replaced by ITK_BUILD_DEFAULT_MODULES

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -122,7 +122,7 @@
       -DITK_USE_SYSTEM_TIFF:BOOL=OFF
       -DITK_USE_SYSTEM_JPEG:BOOL=OFF
       -DITK_USE_SYSTEM_ZLIB:BOOL=OFF
-      -DITK_BUILD_ALL_MODULES:BOOL=ON
+      -DITK_BUILD_DEFAULT_MODULES:BOOL=ON

       ${${proj}_DCMTK_ARGS}
       ${${proj}_WRAP_ARGS}


ENH: Added latest ITKv4 rc release fixes.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -74,7 +74,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git CACHE STRING "" FORCE)
   #set(${proj}_GIT_TAG v4.1rc04 CACHE STRING "" FORCE)
-  set(${proj}_GIT_TAG 4f9f2236d3d952270041b9170f9b2f8a83c3096d CACHE STRING "" FORCE)
+  set(${proj}_GIT_TAG v4.2rc01 CACHE STRING "" FORCE)
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


Updating ITK version to base 4.3rc04

Updating ITK version to base 4.3rc04

Change-Id: I93960fd5a330c0db9d8c2ff5ee6c69775fb479f8

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -15,7 +15,9 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the
-set(ITK_TAG_COMMAND GIT_TAG v4.3rc04 )
+# after v4.3rc04 and including modulus functor fix
+set(ITK_TAG_COMMAND GIT_TAG 1fe07a877fda54dded2bcef33a99b56810a42703
+ )

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


ENH:  Change version to 5.2

ENH:  Change version to 5.2

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -153,7 +153,7 @@
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
   # set(${proj}_REPOSITORY ${git_protocol}://github.com/stnava/ITK.git)
   set(${proj}_GIT_TAG e21a56d1227c5433066237060368cb4532b8a9d2)  # Adaptive denoising module 10/2/2020
-  set(ITK_VERSION_ID ITK-5.1) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID
+  set(ITK_VERSION_ID ITK-5.2 ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}


boards: qemu_cortex_m3: enable icount mode

Enable icount mode for qemu_cortex_m3 platform, The icount shift value
is selectd based on cpu clock frequency of this platform. The virtual
cpu will execute one instruction every 2^shift ns of virtual time.

Signed-off-by: Wentong Wu <a92ffab6ab5ff780cf36418e13a69a97399df0f5@intel.com>

--- boards/arm/qemu_cortex_m3/board.cmake
+++ boards/arm/qemu_cortex_m3/board.cmake
@@ -10,4 +10,7 @@
   -vga none
   )

+if(CONFIG_QEMU_ICOUNT)
+  list(APPEND QEMU_EXTRA_FLAGS -icount shift=6,align=off,sleep=off -rtc clock=vm)
+endif()
 board_set_debugger_ifnset(qemu)


SuperBuild: skip install export.cmake for libpng

--- SuperBuild/CMake/External_png.cmake
+++ SuperBuild/CMake/External_png.cmake
@@ -24,6 +24,7 @@
   -DPNG_TESTS:BOOL=OFF
   -DVERSIONED_OUTPUT_LIB:BOOL=OFF
   -DSKIP_INSTALL_FILES:BOOL=ON
+  -DSKIP_INSTALL_EXPORT:BOOL=ON
   -DSKIP_INSTALL_EXECUTABLES:BOOL=OFF
   ${PNG_SB_CONFIG}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND}


ENH: superbuild: qt4 configure for unix

ENH: superbuild: qt4 configure for unix

--- SuperBuild/CMake/External_qt4.cmake
+++ SuperBuild/CMake/External_qt4.cmake
@@ -58,7 +58,7 @@
       INSTALL_DIR ${SB_INSTALL_PREFIX}
       DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
       CONFIGURE_COMMAND
-        configure -prefix ${CMAKE_WIN_INSTALL_PREFIX} -opensource -confirm-license -release -shared -nomake demos -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script -no-scripttools -no-multimedia -no-webkit -qt-sql-sqlite -plugin-sql-sqlite -no-nis -no-qt3support  -system-zlib -system-libpng -system-libtiff -system-libjpeg -system-sqlite -L ${CMAKE_WIN_INSTALL_PREFIX}\\lib -I ${CMAKE_WIN_INSTALL_PREFIX}\\include
+        ${QT4_SB_SRC}/configure -prefix ${SB_INSTALL_PREFIX} -opensource -confirm-license -release -shared -nomake demos -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script -no-scripttools -no-multimedia -no-webkit -qt-sql-sqlite -plugin-sql-sqlite -no-nis -no-qt3support  -system-zlib -system-libpng -system-libtiff -system-libjpeg -system-sqlite -L ${SB_INSTALL_PREFIX}/lib -I ${SB_INSTALL_PREFIX}/include
       DEPENDS ${${proj}_DEPENDENCIES}
       )
   endif()


SuperBuild: error extra endif()

SuperBuild: error extra endif()

--- SuperBuild/CMake/External_qt4.cmake
+++ SuperBuild/CMake/External_qt4.cmake
@@ -89,6 +89,3 @@
     endif()

     set(_SB_QT_QMAKE_EXECUTABLE ${SB_INSTALL_PREFIX}/bin/qmake)
-
-  endif()
-endif()


wrap CMAKE_CXX_FLAGS_COMMON arguments using strings

Summary:
It can be dangerous to set a CMake variable and not wrap the values as strings at times. The arguments can be forwarded to the compiler in use which will not know how to handle multiple arguments getting treated as one. For an example error using CMake 3.9.6 and Clang 5.0.1, if you do not wrap `CMAKE_CXX_FLAGS_COMMON` using string literals, you will get an error:

```
Problems were encountered while collecting compiler information:
	clang-5.0: error: unknown argument: '-g;-Wall;-Wextra'
```

Closes https://github.com/facebook/folly/pull/746

Reviewed By: simpkins

Differential Revision: D6854510

Pulled By: yfeldblum

fbshipit-source-id: c3ae626033e6733d0ce6f19fc6c06190315bf0db

--- CMake/FollyCompilerUnix.cmake
+++ CMake/FollyCompilerUnix.cmake
@@ -1,4 +1,4 @@
-set(CMAKE_CXX_FLAGS_COMMON -g -Wall -Wextra)
+set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_COMMON}")
 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_COMMON} -O3")


DOC: Remove FindPython3 robust remark

DOC: Remove FindPython3 robust remark

The FindPython3 module has required half a dozen work arounds for broken
behavior and is still causing a failing Windows CI build.

--- CMake/ITKSetPython3Vars.cmake
+++ CMake/ITKSetPython3Vars.cmake
@@ -5,7 +5,6 @@
 # If the cmake variable "PYTHON_DEVELOPMENT_REQUIRED" is set to ON
 # then the development environments are found.

-# Prefer to use more robust FindPython3 module if greater than cmake 3.12.0
 if("${CMAKE_VERSION}" VERSION_LESS_EQUAL "3.12.0")
   # Use of PythonInterp and PythonLibs is deprecated since cmake version 3.12.0
   # Only use deprecated mechanisms for older versions of cmake


Changing Revision Tag Number

Changing Revision Tag Number

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

 if(BUILD_TESTING)

-  set(revision_tag 16389b6f)
+  set(revision_tag c33a2097)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


Update Python tag to fix macosx xcode 4.3.3 build error

See issue #157 and #11 / https://github.com/commontk/PythonQt/compare/654f3249d1cf3f3ff674b2ff6cca7a2ef3517f60...patched-2

--- CMakeExternals/PythonQt.cmake
+++ CMakeExternals/PythonQt.cmake
@@ -44,7 +44,7 @@
         message(FATAL_ERROR "error: Python is required to build ${PROJECT_NAME}")
       endif()

-      set(revision_tag 654f3249d1cf3f3ff674b2ff6cca7a2ef3517f60)
+      set(revision_tag 9104fa924859f4a865016f2138c06ec856f449d4)
       if(${proj}_REVISION_TAG)
         set(revision_tag ${${proj}_REVISION_TAG})
       endif()


Changed FindGLEW to use either shared or static libs but not both

--- CMakeModules/FindGLEWmx.cmake
+++ CMakeModules/FindGLEWmx.cmake
@@ -17,60 +17,65 @@
 OPTION(USE_GLEWmx_STATIC "Use Static GLEWmx Lib" OFF)

 IF (WIN32)
-    FIND_LIBRARY( GLEWmxd_LIBRARY
-        NAMES glewmx GLEWmx glew32mx glew32mx
-        PATHS
-        $ENV{PROGRAMFILES}/GLEW/lib
-        ${GLEW_ROOT_DIR}/lib
-        ${GLEW_ROOT_DIR}
-        ${PROJECT_SOURCE_DIR}/../dependencies/glew/lib
-        PATH_SUFFIXES "Release MX/x64" "lib64"
-        DOC "The GLEWmx library"
-    )
-    FIND_LIBRARY( GLEWmxs_LIBRARY
-        NAMES glewmxs GLEWmxs glew32mxs glew32mxs
-        PATHS
-        $ENV{PROGRAMFILES}/GLEW/lib
-        ${GLEW_ROOT_DIR}/lib
-        ${GLEW_ROOT_DIR}
-        ${PROJECT_SOURCE_DIR}/../dependencies/glew/lib
-        PATH_SUFFIXES "Release MX/x64" "lib64"
-        DOC "The GLEWmxs Static library"
-    )
+	IF (USE_GLEWmx_STATIC)
+		FIND_LIBRARY( GLEWmxs_LIBRARY
+			NAMES glewmxs GLEWmxs glew32mxs glew32mxs
+			PATHS
+			$ENV{PROGRAMFILES}/GLEW/lib
+			${GLEW_ROOT_DIR}/lib
+			${GLEW_ROOT_DIR}
+			${PROJECT_SOURCE_DIR}/../dependencies/glew/lib
+			PATH_SUFFIXES "Release MX/x64" "lib64"
+			DOC "The GLEWmxs Static library"
+		)
+	ELSE (USE_GLEWmx_STATIC)
+		FIND_LIBRARY( GLEWmxd_LIBRARY
+			NAMES glewmx GLEWmx glew32mx glew32mx
+			PATHS
+			$ENV{PROGRAMFILES}/GLEW/lib
+			${GLEW_ROOT_DIR}/lib
+			${GLEW_ROOT_DIR}
+			${PROJECT_SOURCE_DIR}/../dependencies/glew/lib
+			PATH_SUFFIXES "Release MX/x64" "lib64"
+			DOC "The GLEWmx library"
+		)
+	ENDIF (USE_GLEWmx_STATIC)
 ELSE (WIN32)
-    FIND_LIBRARY( GLEWmxd_LIBRARY
-        NAMES GLEWmx glewmx
-        PATHS
-        /usr/lib64
-        /usr/lib
-        /usr/lib/x86_64-linux-gnu
-        /usr/lib/arm-linux-gnueabihf
-        /usr/local/lib64
-        /usr/local/lib
-        /sw/lib
-        /opt/local/lib
-        ${GLEW_ROOT_DIR}/lib
-        NO_DEFAULT_PATH
-        DOC "The GLEWmx library")
-
-    SET(PX ${CMAKE_STATIC_LIBRARY_PREFIX})
-    SET(SX ${CMAKE_STATIC_LIBRARY_SUFFIX})
-    FIND_LIBRARY( GLEWmxs_LIBRARY
-        NAMES ${PX}GLEWmx${SX} ${PX}glewmx${SX}
-        PATHS
-        /usr/lib64
-        /usr/lib
-        /usr/lib/x86_64-linux-gnu
-        /usr/lib/arm-linux-gnueabihf
-        /usr/local/lib64
-        /usr/local/lib
-        /sw/lib
-        /opt/local/lib
-        ${GLEW_ROOT_DIR}/lib
-        NO_DEFAULT_PATH
-        DOC "The GLEWmx library")
-    UNSET(PX)
-    UNSET(SX)
+	IF (USE_GLEWmx_STATIC)
+		SET(PX ${CMAKE_STATIC_LIBRARY_PREFIX})
+		SET(SX ${CMAKE_STATIC_LIBRARY_SUFFIX})
+		FIND_LIBRARY( GLEWmxs_LIBRARY
+			NAMES ${PX}GLEWmx${SX} ${PX}glewmx${SX}
+			PATHS
+			/usr/lib64
+			/usr/lib
+			/usr/lib/x86_64-linux-gnu
+			/usr/lib/arm-linux-gnueabihf
+			/usr/local/lib64
+			/usr/local/lib
+			/sw/lib
+			/opt/local/lib
+			${GLEW_ROOT_DIR}/lib
+			NO_DEFAULT_PATH
+			DOC "The GLEWmx library")
+		UNSET(PX)
+		UNSET(SX)
+	ELSE (USE_GLEWmx_STATIC)
+		FIND_LIBRARY( GLEWmxd_LIBRARY
+			NAMES GLEWmx glewmx
+			PATHS
+			/usr/lib64
+			/usr/lib
+			/usr/lib/x86_64-linux-gnu
+			/usr/lib/arm-linux-gnueabihf
+			/usr/local/lib64
+			/usr/local/lib
+			/sw/lib
+			/opt/local/lib
+			${GLEW_ROOT_DIR}/lib
+			NO_DEFAULT_PATH
+			DOC "The GLEWmx library")
+	ENDIF (USE_GLEWmx_STATIC)
 ENDIF (WIN32)

 IF(USE_GLEWmx_STATIC)


Added KLAMPT_INCLUDE_DIR at top of file

Added KLAMPT_INCLUDE_DIR at top of file

--- CMakeModules/FindKlampt.cmake
+++ CMakeModules/FindKlampt.cmake
@@ -11,6 +11,12 @@

 INCLUDE(KlamptDependencies)
+
+FIND_PATH(KLAMPT_INCLUDE_DIR
+	Klampt/Simulation/ODESimulator.h
+PATHS /usr/include/ /usr/local/include ${KLAMPT_ROOT}/include
+DOC "Directory where Klamp't header files are stored" )
+

 if(WIN32)
   IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -37,12 +43,6 @@
 	      PATHS /usr/local/lib "${KLAMPT_ROOT}/lib")
 endif()

-FIND_PATH(KLAMPT_INCLUDE_DIR
-	Klampt/Simulation/ODESimulator.h
-PATHS /usr/include/ /usr/local/include ${KLAMPT_ROOT}/include
-DOC "Directory where Klamp't header files are stored" )
-
-
 #do the find_package call...
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(KLAMPT "Could not find Klampt " KLAMPT_INCLUDE_DIR KLAMPT_LIBRARY)


build BUGFIX libval cmake module fixed

build BUGFIX libval cmake module fixed

--- CMakeModules/FindLibVAL.cmake
+++ CMakeModules/FindLibVAL.cmake
@@ -56,7 +56,7 @@
   find_library(LIBVAL_LIBRARY
     NAMES
       libval-threads
-      libsres
+      val-threads
     PATHS
       /usr/lib
       /usr/lib64
@@ -66,17 +66,31 @@
       /sw/lib
       ${CMAKE_LIBRARY_PATH}
       ${CMAKE_INSTALL_PREFIX}/lib
-    NAMES_PER_DIR
   )

-  if (LIBVAL_INCLUDE_DIR AND LIBVAL_LIBRARY)
+  find_library(LIBSRES_LIBRARY
+    NAMES
+      libsres
+      sres
+    PATHS
+      /usr/lib
+      /usr/lib64
+      /usr/local/lib
+      /usr/local/lib64
+      /opt/local/lib
+      /sw/lib
+      ${CMAKE_LIBRARY_PATH}
+      ${CMAKE_INSTALL_PREFIX}/lib
+  )
+
+  if (LIBVAL_INCLUDE_DIR AND LIBVAL_LIBRARY AND LIBSRES_LIBRARY)
     set(LIBVAL_FOUND TRUE)
-  else (LIBVAL_INCLUDE_DIR AND LIBVAL_LIBRARY)
+  else (LIBVAL_INCLUDE_DIR AND LIBVAL_LIBRARY AND LIBSRES_LIBRARY)
     set(LIBVAL_FOUND FALSE)
-  endif (LIBVAL_INCLUDE_DIR AND LIBVAL_LIBRARY)
+  endif (LIBVAL_INCLUDE_DIR AND LIBVAL_LIBRARY AND LIBSRES_LIBRARY)

   set(LIBVAL_INCLUDE_DIRS ${LIBVAL_INCLUDE_DIR})
-  set(LIBVAL_LIBRARIES ${LIBVAL_LIBRARY})
+  set(LIBVAL_LIBRARIES ${LIBSRES_LIBRARY} ${LIBVAL_LIBRARY})

   # show the LIBVAL_INCLUDE_DIRS and LIBVAL_LIBRARIES variables only in the advanced view
   mark_as_advanced(LIBVAL_INCLUDE_DIRS LIBVAL_LIBRARIES)


copy vtk python files

copy vtk python files

--- CMake/mitkMacroInstallPython.cmake
+++ CMake/mitkMacroInstallPython.cmake
@@ -1,7 +1,7 @@

 macro(MITK_INSTALL_PYTHON)

-  find_package(VTK REQUIRED)
+find_package(VTK REQUIRED)

 foreach(_lib ${VTK_LIBRARIES})
   # exclude system libs
@@ -42,5 +42,12 @@
   endif()
 endforeach()

+# install vtk python
+install(DIRECTORY ${VTK_DIR}/Wrapping/Python/vtk
+        DESTINATION bin
+        USE_SOURCE_PERMISSIONS
+        COMPONENT Runtime)
+
+
 endmacro(MITK_INSTALL_PYTHON)


Mark boost headers as system includes

Mark boost headers as system includes

This silences compiler warnings within the boost headers. Those are for the boost developers to worry about.

--- CMake/hoomd/HOOMDBoostSetup.cmake
+++ CMake/hoomd/HOOMDBoostSetup.cmake
@@ -51,7 +51,7 @@
 find_package(Boost 1.32.0 COMPONENTS REQUIRED ${REQUIRED_BOOST_COMPONENTS})

 # add include directories
-include_directories(${Boost_INCLUDE_DIR})
+include_directories(SYSTEM ${Boost_INCLUDE_DIR})

 # hide variables the user doesn't need to see
 mark_as_advanced(Boost_LIB_DIAGNOSTIC_DEFINITIONS)


Don't export library targets when VTK_INSTALL_NO_LIBS is ON.

--- CMake/vtkTargetExportMacros.cmake
+++ CMake/vtkTargetExportMacros.cmake
@@ -4,7 +4,9 @@

 MACRO(VTK_ADD_LIBRARY name)
   add_library(${name} ${ARGN})
-  set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${name})
+  if (NOT VTK_INSTALL_NO_LIBRARIES)
+    set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${name})
+  endif (NOT VTK_INSTALL_NO_LIBRARIES)
 ENDMACRO(VTK_ADD_LIBRARY)

 MACRO(VTK_ADD_EXECUTABLE name)


Only install PDB files for configurations that create debug symbols

--- CMakeModules/SplitDebugInfo.cmake
+++ CMakeModules/SplitDebugInfo.cmake
@@ -20,7 +20,8 @@
     set(SPLIT_TOOL_EXISTS OFF)
     if (MSVC)
       install(FILES
-        $<TARGET_PDB_FILE:${_target}>
+        $<$<CONFIG:Debug>:$<TARGET_PDB_FILE:${_target}>>
+        $<$<CONFIG:RelWithDebInfo>:$<TARGET_PDB_FILE:${_target}>>
         DESTINATION ${_destination_dir}
         COMPONENT "${_target}_debug_symbols"
         )


Avoiding link errors with mkl_ccsrmv and friends when disabling MKL despite its detection by CMake

--- cmake/external_projects/ElMath.cmake
+++ cmake/external_projects/ElMath.cmake
@@ -54,69 +54,72 @@

 # Check for MKL
 # ^^^^^^^^^^^^^
-if(EL_HYBRID)
-  set(MKL_LIBS "-mkl=parallel")
-  message(STATUS "Attempting to link MKL using ${MKL_LIBS}")
-  set(CMAKE_REQUIRED_FLAGS ${MKL_LIBS})
-  El_check_function_exists(dpotrf  EL_HAVE_DPOTRF_MKL)
-  El_check_function_exists(dpotrf_ EL_HAVE_DPOTRF_POST_MKL)
-  El_check_function_exists(mkl_dcsrmv EL_HAVE_MKL_DCSRMV)
-  if((EL_HAVE_DPOTRF_MKL OR EL_HAVE_DPOTRF_POST_MKL) AND EL_HAVE_MKL_DCSRMV)
-    set(EL_HAVE_MKL TRUE)
-  endif()
-  unset(CMAKE_REQUIRED_FLAGS)
-else()
-  set(MKL_LIBS "-mkl=cluster")
-  message(STATUS "Attempting to link MKL using ${MKL_LIBS}")
-  set(CMAKE_REQUIRED_FLAGS "${MKL_LIBS} ${MPI_C_COMPILE_FLAGS}")
-  set(CMAKE_REQUIRED_LINKER_FLAGS "${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
-  set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH})
-  set(CMAKE_REQUIRED_LIBRARIES ${MPI_C_LIBRARIES})
-  El_check_function_exists(dpotrf  EL_HAVE_DPOTRF_MKL_CLUSTER)
-  El_check_function_exists(dpotrf_ EL_HAVE_DPOTRF_POST_MKL_CLUSTER)
-  El_check_function_exists(mkl_dcsrmv EL_HAVE_MKL_DCSRMV_CLUSTER)
-  if((EL_HAVE_DPOTRF_MKL_CLUSTER OR EL_HAVE_DPOTRF_POST_MKL_CLUSTER)
-     AND EL_HAVE_MKL_DCSRMV_CLUSTER)
-    set(EL_HAVE_MKL TRUE)
-  endif()
-  unset(CMAKE_REQUIRED_FLAGS)
-  unset(CMAKE_REQUIRED_LINKER_FLAGS)
-  unset(CMAKE_REQUIRED_INCLUDES)
-  unset(CMAKE_REQUIRED_LIBRARIES)
-
-  if(NOT EL_HAVE_MKL)
-    # NOTE: There is a bug in MKL such that, if the following line is used,
-    #       there is sometimes an error of the form
-    #
-    #   Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so.
-    #
-    #        when running the executable. Should this occur, manually specify
-    #
-    #   MATH_LIBS="-L/path/to/mkl/libs -lmkl_rt"
-    #
-    #        e.g.,
-    #
-    #   MATH_LIBS="-L/opt/intel/mkl/lib/intel64 -lmkl_rt"
-    #
-    set(MKL_LIBS "-mkl=sequential")
+if(NOT EL_DISABLE_MKL)
+  if(EL_HYBRID)
+    set(MKL_LIBS "-mkl=parallel")
     message(STATUS "Attempting to link MKL using ${MKL_LIBS}")
     set(CMAKE_REQUIRED_FLAGS ${MKL_LIBS})
-    El_check_function_exists(dpotrf  EL_HAVE_DPOTRF_MKL_SEQ)
-    El_check_function_exists(dpotrf_ EL_HAVE_DPOTRF_POST_MKL_SEQ)
-    El_check_function_exists(mkl_dcsrmv EL_HAVE_MKL_DCSRMV_SEQ)
-    if((EL_HAVE_DPOTRF_MKL_SEQ OR EL_HAVE_DPOTRF_POST_MKL_SEQ)
-       AND EL_HAVE_MKL_DCSRMV_SEQ)
-      set(EL_HAVE_MKL TRUE)
+    El_check_function_exists(dpotrf  EL_HAVE_DPOTRF_MKL)
+    El_check_function_exists(dpotrf_ EL_HAVE_DPOTRF_POST_MKL)
+    El_check_function_exists(mkl_dcsrmv EL_HAVE_MKL_DCSRMV)
+    if((EL_HAVE_DPOTRF_MKL OR EL_HAVE_DPOTRF_POST_MKL) AND EL_HAVE_MKL_DCSRMV)
+      set(EL_FOUND_MKL TRUE)
     endif()
     unset(CMAKE_REQUIRED_FLAGS)
-  endif()
-endif()
-if(EL_HAVE_MKL AND NOT MATH_LIBS_AT_CONFIG
-               AND NOT EL_DISABLE_MKL
-               AND NOT EL_PREFER_APPLE_MATH
-               AND NOT EL_PREFER_OPENBLAS
-               AND NOT EL_PREFER_BLIS_LAPACK)
+  else()
+    set(MKL_LIBS "-mkl=cluster")
+    message(STATUS "Attempting to link MKL using ${MKL_LIBS}")
+    set(CMAKE_REQUIRED_FLAGS "${MKL_LIBS} ${MPI_C_COMPILE_FLAGS}")
+    set(CMAKE_REQUIRED_LINKER_FLAGS "${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
+    set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH})
+    set(CMAKE_REQUIRED_LIBRARIES ${MPI_C_LIBRARIES})
+    El_check_function_exists(dpotrf  EL_HAVE_DPOTRF_MKL_CLUSTER)
+    El_check_function_exists(dpotrf_ EL_HAVE_DPOTRF_POST_MKL_CLUSTER)
+    El_check_function_exists(mkl_dcsrmv EL_HAVE_MKL_DCSRMV_CLUSTER)
+    if((EL_HAVE_DPOTRF_MKL_CLUSTER OR EL_HAVE_DPOTRF_POST_MKL_CLUSTER)
+       AND EL_HAVE_MKL_DCSRMV_CLUSTER)
+      set(EL_FOUND_MKL TRUE)
+    endif()
+    unset(CMAKE_REQUIRED_FLAGS)
+    unset(CMAKE_REQUIRED_LINKER_FLAGS)
+    unset(CMAKE_REQUIRED_INCLUDES)
+    unset(CMAKE_REQUIRED_LIBRARIES)
+
+    if(NOT EL_FOUND_MKL)
+      # NOTE: There is a bug in MKL such that, if the following line is used,
+      #       there is sometimes an error of the form
+      #
+      #   Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so.
+      #
+      #        when running the executable. Should this occur, manually specify
+      #
+      #   MATH_LIBS="-L/path/to/mkl/libs -lmkl_rt"
+      #
+      #        e.g.,
+      #
+      #   MATH_LIBS="-L/opt/intel/mkl/lib/intel64 -lmkl_rt"
+      #
+      set(MKL_LIBS "-mkl=sequential")
+      message(STATUS "Attempting to link MKL using ${MKL_LIBS}")
+      set(CMAKE_REQUIRED_FLAGS ${MKL_LIBS})
+      El_check_function_exists(dpotrf  EL_HAVE_DPOTRF_MKL_SEQ)
+      El_check_function_exists(dpotrf_ EL_HAVE_DPOTRF_POST_MKL_SEQ)
+      El_check_function_exists(mkl_dcsrmv EL_HAVE_MKL_DCSRMV_SEQ)
+      if((EL_HAVE_DPOTRF_MKL_SEQ OR EL_HAVE_DPOTRF_POST_MKL_SEQ)
+         AND EL_HAVE_MKL_DCSRMV_SEQ)
+        set(EL_FOUND_MKL TRUE)
+      endif()
+      unset(CMAKE_REQUIRED_FLAGS)
+    endif()
+  endif()
+endif()
+if(EL_FOUND_MKL AND NOT MATH_LIBS_AT_CONFIG
+                AND NOT EL_DISABLE_MKL
+                AND NOT EL_PREFER_APPLE_MATH
+                AND NOT EL_PREFER_OPENBLAS
+                AND NOT EL_PREFER_BLIS_LAPACK)
   set(MATH_LIBS_AT_CONFIG ${MKL_LIBS})
+  set(EL_HAVE_MKL TRUE)
   message(STATUS "Using Intel MKL via ${MKL_LIBS}")
 endif()