Add analysis target.

Add analysis target.

Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>

--- make/devices.cmake
+++ make/devices.cmake
@@ -852,6 +852,9 @@
     OUTPUT ${OUT_ROUTE} ${OUT_HLC}
     DEPENDS ${OUT_PLACE} ${OUT_IO} ${VPR_DEPS}
     COMMAND ${VPR_CMD} --route
+    COMMAND
+      ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/vpr_stdout.log
+        ${OUT_LOCAL}/route.log
     WORKING_DIRECTORY ${OUT_LOCAL}
   )
   add_custom_target(${NAME}_route DEPENDS ${OUT_ROUTE})
@@ -863,9 +866,27 @@
       ${OUT_LOCAL}/echo/atom_netlist.cleaned.echo.blif
     DEPENDS ${ECHO_OUT_PLACE} ${ECHO_OUT_IO} ${VPR_DEPS} ${ECHO_DIRECTORY_TARGET}
     COMMAND ${VPR_CMD} --echo_file on --route
+    COMMAND
+      ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/echo/vpr_stdout.log
+        ${OUT_LOCAL}/echo/route.log
     WORKING_DIRECTORY ${OUT_LOCAL}/echo
   )
   add_custom_target(${NAME}_route_echo DEPENDS ${OUT_ROUTE})
+
+  # Generate analysis.
+  #-------------------------------------------------------------------------
+  set(OUT_ANALYSIS ${OUT_LOCAL}/analysis.log)
+  set(OUT_POST_SYNTHESIS_V ${OUT_LOCAL}/top_post_synthesis.v)
+  set(OUT_POST_SYNTHESIS_BLIF ${OUT_LOCAL}/top_post_synthesis.blif)
+  add_custom_command(
+    OUTPUT ${OUT_ANALYSIS} ${OUT_POST_SYNTHESIS_V} ${OUT_POST_SYNTHESIS_BLIF}
+    DEPENDS ${OUT_ROUTE} ${OUT_IO} ${VPR_DEPS}
+    COMMAND ${VPR_CMD} --analysis --gen_post_synthesis_netlist on
+    COMMAND ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/vpr_stdout.log
+        ${OUT_LOCAL}/analysis.log
+    WORKING_DIRECTORY ${OUT_LOCAL}
+    )
+  add_custom_target(${NAME}_analysis DEPENDS ${OUT_ANALYSIS})

   get_target_property_required(NO_BITSTREAM ${ARCH} NO_BITSTREAM)
   if(NOT ${NO_BITSTREAM})
@@ -989,6 +1010,26 @@

     # Add post-synthesis check tests to all_check_tests.
     add_dependencies(all_check_tests ${NAME}_check_eblif)
+
+    add_check_test(
+      NAME ${NAME}_check_post_blif
+      ARCH ${ARCH}
+      READ_GOLD "read_verilog ${SOURCE_FILES} $<SEMICOLON> rename ${TOP} gold"
+      READ_GATE "read_blif -wideports ${OUT_POST_SYNTHESIS_BLIF} $<SEMICOLON> rename ${TOP} gate"
+      EQUIV_CHECK_SCRIPT ${ADD_FPGA_TARGET_EQUIV_CHECK_SCRIPT}
+      DEPENDS ${SOURCE_FILES} ${SOURCE_FILES_DEPS} ${OUT_POST_SYNTHESIS_BLIF}
+      )
+
+    add_dependencies(all_check_tests ${NAME}_check_post_blif)
+
+    add_check_test(
+      NAME ${NAME}_check_post_v
+      ARCH ${ARCH}
+      READ_GOLD "read_verilog ${SOURCE_FILES} $<SEMICOLON> rename ${TOP} gold"
+      READ_GATE "read_verilog ${OUT_POST_SYNTHESIS_V} $<SEMICOLON> rename ${TOP} gate"
+      EQUIV_CHECK_SCRIPT ${ADD_FPGA_TARGET_EQUIV_CHECK_SCRIPT}
+      DEPENDS ${SOURCE_FILES} ${SOURCE_FILES_DEPS} ${OUT_POST_SYNTHESIS_V}
+      )

     add_check_test(
       NAME ${NAME}_check_orig_blif


Disabling X11 check for all Apple platforms. Because it may not always be available on the system.

--HG--
branch : v1-8

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -72,7 +72,7 @@
 macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" TRUE "" "")

 # Find X11
-if (UNIX AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
+if (UNIX AND NOT APPLE)
   find_package(X11)
   macro_log_feature(X11_FOUND "X11" "X Window system" "http://www.x.org" TRUE "" "")
   macro_log_feature(X11_Xt_FOUND "Xt" "X Toolkit" "http://www.x.org" TRUE "" "")


Fix freetype detection on Ubuntu 14.04

Fix freetype detection on Ubuntu 14.04

We now just use the FindFreetype-function that has been available in cmake
for years (at least since 2008).

--- CMake/FindFREETYPE.cmake
+++ CMake/FindFREETYPE.cmake
@@ -1,37 +1,6 @@
 #
 # Find the native FREETYPE includes and library
 #
+# Just use the FindFreetype function available in recent cmake versions.

-# This module defines
-# FREETYPE_INCLUDE_DIR, where to find ft2build.h, ftheader.h, ...
-# FREETYPE_LIBRARIES, the libraries to link against to use FREETYPE.
-# FREETYPE_FOUND, If false, do not try to use FREETYPE.
-
-# also defined, but not for general use are
-# FREETYPE_LIBRARY, where to find the FREETYPE library.
-
-FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h
-  /usr/include/
-  /usr/local/include/
-)
-
-FIND_PATH(FREETYPE_INCLUDE_DIR_FTHEADER freetype/config/ftheader.h
-  /usr/include/freetype2
-  /usr/local/include/freetype2
-)
-
-FIND_LIBRARY(FREETYPE_LIBRARY freetype
-  /usr/lib
-  /usr/local/lib
-)
-
-IF (FREETYPE_LIBRARY)
-  IF (FREETYPE_INCLUDE_DIR_FTHEADER AND FREETYPE_INCLUDE_DIR_FT2BUILD)
-    SET( FREETYPE_FOUND "YES" )
-    SET( FREETYPE_INCLUDE_DIR
-      ${FREETYPE_INCLUDE_DIR_FT2BUILD}
-      ${FREETYPE_INCLUDE_DIR_FTHEADER} )
-    SET( FREETYPE_LIBRARIES ${FREETYPE_LIBRARY} )
-  ENDIF (FREETYPE_INCLUDE_DIR_FTHEADER AND FREETYPE_INCLUDE_DIR_FT2BUILD)
-ENDIF (FREETYPE_LIBRARY)
-
+INCLUDE(FindFreetype)


Use CTK with pre-loaded library version number support.

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag ee445fea)
+    set(revision_tag 6ef9e424)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()
@@ -49,7 +49,7 @@
       BINARY_DIR ${proj}-build
       PREFIX ${proj}-cmake
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 9c41a78e2e2f9c4823c05a82c6d813ae
+      URL_MD5 72aec55dacec47317456841d5f1da446
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


cmake: enforce hidden visibility

cmake: enforce hidden visibility

--- bootstrap/cmake/build-settings.cmake
+++ bootstrap/cmake/build-settings.cmake
@@ -74,3 +74,6 @@
 version_string: ${nany_version_string}
 version_metadata: ${nany_version_metadata}
 ")
+
+set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)


Revert "compile fix for windows"

Revert "compile fix for windows"

This reverts commit 5fc36f54715d181e7948b064a1da8856ec30ff9f.

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -91,9 +91,7 @@
     SET(ISPC_INCLUDE_DIR_PARMS "-I" ${ISPC_INCLUDE_DIR_PARMS})
   ENDIF()

-  IF (WIN32)
-    SET(ISPC_OPT_FLAGS -O3)
-  ELSEIF (${CMAKE_BUILD_TYPE} STREQUAL "Release")
+  IF (${CMAKE_BUILD_TYPE} STREQUAL "Release")
     SET(ISPC_OPT_FLAGS -O3)
   ELSE()
     SET(ISPC_OPT_FLAGS -O2 -g)


[CMake] [Darwin] libclang_rt.eprintf should be built with the same CFLAGS as the other darwin builtin libraries.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -237,11 +237,18 @@
 endfunction()

 function(darwin_add_eprintf_library)
+  cmake_parse_arguments(LIB
+    ""
+    ""
+    "CFLAGS"
+    ${ARGN})
+
   add_library(clang_rt.eprintf STATIC eprintf.c)
   set_target_compile_flags(clang_rt.eprintf
     -isysroot ${DARWIN_osx_SYSROOT}
     ${DARWIN_osx_BUILTIN_MIN_VER_FLAG}
-    -arch i386)
+    -arch i386
+    ${LIB_CFLAGS})
   set_target_properties(clang_rt.eprintf PROPERTIES
       OUTPUT_NAME clang_rt.eprintf${COMPILER_RT_OS_SUFFIX})
   set_target_properties(clang_rt.eprintf PROPERTIES
@@ -322,7 +329,7 @@
     endif()
   endforeach()

-  darwin_add_eprintf_library()
+  darwin_add_eprintf_library(CFLAGS ${CFLAGS})

   # We put the x86 sim slices into the archives for their base OS
   foreach (os ${ARGN})


wxinclude turn off XP_USE_LATEST_BOOST, for now

issue https://github.com/smanders/externpro/issues/203#issue-344659129

--- projects/wxinclude.cmake
+++ projects/wxinclude.cmake
@@ -41,7 +41,7 @@
     @ONLY NEWLINE_STYLE LF
     )
   set(BUILD_CONFIGS Release) # we only need a release executable
-  xpCmakeBuild(wxinclude "${boostTgts}" "-DXP_USE_LATEST_BOOST=ON" wxincludeTargets)
+  xpCmakeBuild(wxinclude "${boostTgts}" "-DXP_USE_LATEST_BOOST=OFF" wxincludeTargets)
   if(DEFINED wxinc_TARGETS)
     xpListAppendIfDne(${wxinc_TARGETS} "${wxincludeTargets}")
     set(${wxinc_TARGETS} "${${wxinc_TARGETS}}" PARENT_SCOPE)


Makefile: Removed copyright and license from RenderScript CMake find module

--HG--
extra : rebase_source : a765f987217839548e4dc0dd5bfa9dc81f22c387

--- cmake/modules/FindRenderScript.cmake
+++ cmake/modules/FindRenderScript.cmake
@@ -40,12 +40,6 @@
 #   NDK_LINK_LIBRARIES
 #     Specifies the NDK link libraries.
 #
-#
-# (c) Oliver Reiche
-#
-# This work is licensed under the Creative Commons Attribution 3.0 Unported
-# License. To view a copy of this license, visit
-# http://creativecommons.org/licenses/by/3.0/.

 INCLUDE (FindPackageHandleStandardArgs)


Do not enable deprecated and unimplemented options with -Dall=ON

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -224,7 +224,6 @@
  set(bonjour_defvalue ON)
  set(dcache_defvalue ON)
  set(fitsio_defvalue ON)
- set(glite_defvalue ON)
  set(fortran_defvalue ON)
  set(gdml_defvalue ON)
  set(gviz_defvalue ON)
@@ -242,9 +241,7 @@
  set(rfio_defvalue ON)
  set(roofit_defvalue ON)
  set(root7_defvalue ON)
- set(sapdb_defvalue ON)
  set(shadowpw_defvalue ON)
- set(srp_defvalue ON)
  set(table_defvalue ON)
  set(unuran_defvalue ON)
  set(vc_defvalue ON)


Reland "[cxxmodules] Enable runtime_cxxmodules on UNIX by default."

Original commit message:
"[cxxmodules] Enable runtime_cxxmodules on UNIX by default.

ROOT has several features which interact with libraries and require implicit
header inclusion. This can be triggered by reading or writing data on disk, or
user actions at the prompt. Often, the headers are immutable and reparsing is
redundant. C++ Modules are designed to minimize the reparsing of the same header
content by providing an efficient on-disk representation of C++ Code. More
information about the C++ modules technology can be found at
README/README.CXXMODULES.md

This undertaking was successful due to the efforts of many people. Especially,
Raphael Isemann, Oksana Shadura and Yuka Takahashi.

We are grateful to Liz Sexton-Kennedy, Peter Elmer, Brian Bockelman and Ken Bloom
for putting (wo)manpower into the project and supporting it.

This work has been supported by an Intel Parallel Computing Center grant,
by U.S.National Science Foundation grants PHY-1450377, ACI-1450323 and
PHY-1624356, andby the U.S. Department of Energy, Office of Science.

Special thanks to Axel Naumann and Philippe Canal for helping and supporting
the technical efforts over the years.

We are thankful to Shahzad Malik Muzaffar, David Lange and Mircho Rodozov
from the CMSSW development team, CERN/EP-SFT and the ROOT team."

This reverts commit 3a80306e8c42942c9767dbad7a771cd8edb5b7ea.

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -150,7 +150,7 @@
 ROOT_BUILD_OPTION(webgui ON "Build Web-based UI components of ROOT (requires C++14 standard or higher)")
 ROOT_BUILD_OPTION(root7 ON "Build ROOT 7 components of ROOT (requires C++14 standard or higher)")
 ROOT_BUILD_OPTION(rpath OFF "Link libraries with built-in RPATH (run-time search path)")
-ROOT_BUILD_OPTION(runtime_cxxmodules OFF "Enable runtime support for C++ modules")
+ROOT_BUILD_OPTION(runtime_cxxmodules ON "Enable runtime support for C++ modules")
 ROOT_BUILD_OPTION(shadowpw OFF "Enable support for shadow passwords")
 ROOT_BUILD_OPTION(shared ON "Use shared 3rd party libraries if possible")
 ROOT_BUILD_OPTION(soversion OFF "Set version number in sonames (recommended)")
@@ -292,14 +292,22 @@
   set(memstat_defvalue OFF)
   set(roofit_defvalue OFF)
   set(roottest_defvalue OFF)
+  set(runtime_cxxmodules_defvalue OFF)
   set(testing_defvalue OFF)
   set(tmva_defvalue OFF)
   set(vdt_defvalue OFF)
   set(x11_defvalue OFF)
 elseif(APPLE)
   set(cocoa_defvalue ON)
+  set(runtime_cxxmodules_defvalue OFF)
   set(x11_defvalue OFF)
 endif()
+
+#---Modules do not play well with c++17 yet----------------------------------------------------
+if(CMAKE_CXX_STANDARD GREATER 14)
+  set(runtime_cxxmodules_defvalue OFF)
+endif()
+

 # Disable RDataFrame on 32-bit UNIX platforms due to ROOT-9236
 if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 4)


Changed source of package for freetype project to tagged commit

--- cmake/projects/freetype/hunter.cmake
+++ cmake/projects/freetype/hunter.cmake
@@ -17,9 +17,9 @@
     VERSION
     "2.6.2"
     URL
-    "https://github.com/hunter-packages/freetype/archive/hunter.tar.gz"
+    "https://github.com/hunter-packages/freetype/archive/v2.6.2-p0.tar.gz"
     SHA1
-    560edf6c2fe1cc67437d6cc2ab909afe7a26bc12
+    d797e30cfa79eb95dc3b67e75fa6d6a3da80d1ae
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)


updates to .gitlab-ci.yml

updates to .gitlab-ci.yml

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -142,4 +142,4 @@
 #IF (NOT CTEST_SKIP_TESTING)
 #  ctest_test()
 #ENDIF()
-#ctest_submit()
+ctest_submit()


Add more warnings.

Add more warnings.

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -34,7 +34,7 @@
   string(REGEX REPLACE "[\r\n]" " " ${_lfs_CFLAGS} "${${_lfs_CFLAGS}}")

   add_definitions(${_lfs_CFLAGS})
-  add_definitions(-Wall -W -Wmissing-prototypes -Wdeclaration-after-statement)
+  add_definitions(-Wall -W -Wmissing-prototypes -Wdeclaration-after-statement -Wreturn-type -Wunused)

   check_cxx_compiler_flag("-fstack-protector" WITH_STACK_PROTECTOR)
   if (WITH_STACK_PROTECTOR)


CMake support

CMake support

--- cmake/dev/generate_msvc_libraries.cmake
+++ cmake/dev/generate_msvc_libraries.cmake
@@ -39,7 +39,7 @@
         PATTERN "*${PROJECT_NAME}*-${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}*"
         )
     install(DIRECTORY ${PROJECT_BINARY_DIR}/../${platform}/cmake/config/
-        DESTINATION lib/${platform}
+        DESTINATION lib/${platform}/${PROJECT_NAME}/cmake
         COMPONENT cmake
         FILES_MATCHING
         PATTERN "*.cmake"


Tar plugin only runs when requested

Tar plugin only runs when requested

Change-Id: If4369e4ed72579298cdffcb633b9efcc6a91ef06

--- cmake/plugins/ExportTar/ExportTar.cmake
+++ cmake/plugins/ExportTar/ExportTar.cmake
@@ -92,36 +92,40 @@

 # collect everything for tar building
 FUNCTION(INTERNAL_BUILD_RELEASE_TAR)
-	# the top level target for building the tar
-	add_custom_target(ExportTar COMMENT "Exporting marked Files into a tar" )
+	#Is there something to copy?
+	IF(NOT ${TARGETS_TO_COPY} STREQUAL "" AND NOT ${FILES_TO_COPY} STREQUAL "" AND NOT ${DIRECTORIES_TO_COPY} STREQUAL "")
+		MESSAGE(STATUS "Adding Tarfile export target")
+		# the top level target for building the tar
+		add_custom_target(ExportTar COMMENT "Exporting marked Files into a tar" )

-	# make files to copy out of targets to copy
-	FOREACH(TARGET_TO_COPY ${TARGETS_TO_COPY})
-		get_target_property(fullFilePath ${TARGET_TO_COPY} LOCATION)
-		get_filename_component(FILENAME "${fullFilePath}" NAME)
-		FOREACH(TARGET_DIR ${${TARGET_TO_COPY}_TARGETDIRS})
-			add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E copy_if_different "${fullFilePath}" "${TARGET_DIR}/${FILENAME}")
-		MESSAGE(STATUS "Adding Tarfile export target")
+		# make files to copy out of targets to copy
+		FOREACH(TARGET_TO_COPY ${TARGETS_TO_COPY})
+			get_target_property(fullFilePath ${TARGET_TO_COPY} LOCATION)
+			get_filename_component(FILENAME "${fullFilePath}" NAME)
+			FOREACH(TARGET_DIR ${${TARGET_TO_COPY}_TARGETDIRS})
+				add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E copy_if_different "${fullFilePath}" "${TARGET_DIR}/${FILENAME}")
+			ENDFOREACH()
 		ENDFOREACH()
-	ENDFOREACH()

-	# go through all directories to be copied
-	FOREACH(DIRECTORY_TO_COPY ${DIRECTORIES_TO_COPY})
-		FOREACH(TARGET_DIR ${${DIRECTORY_TO_COPY}_TARGETDIRS})
-			add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E copy_directory "${DIRECTORY_TO_COPY}" "${TARGET_DIR}")
+		# go through all directories to be copied
+		FOREACH(DIRECTORY_TO_COPY ${DIRECTORIES_TO_COPY})
+			FOREACH(TARGET_DIR ${${DIRECTORY_TO_COPY}_TARGETDIRS})
+				add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E copy_directory "${DIRECTORY_TO_COPY}" "${TARGET_DIR}")
+			ENDFOREACH()
 		ENDFOREACH()
-	ENDFOREACH()

-	# go through all files to include in tar
-	FOREACH(FILE_TO_COPY ${FILES_TO_COPY})
-		FOREACH(TARGET_PATH ${${FILE_TO_COPY}_TARGETPATHS})
-			add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FILE_TO_COPY}" "${TARGET_PATH}")
+		# go through all files to include in tar
+		FOREACH(FILE_TO_COPY ${FILES_TO_COPY})
+			FOREACH(TARGET_PATH ${${FILE_TO_COPY}_TARGETPATHS})
+				add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FILE_TO_COPY}" "${TARGET_PATH}")
+			ENDFOREACH()
 		ENDFOREACH()
-	ENDFOREACH()

-	# tar everything beneath build/export dir
-	add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E tar cvf ${PROJECT_NAME}.tar "${PROJECT_NAME}" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/export/)
+		# tar everything beneath build/export dir
+		add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E tar cvf ${PROJECT_NAME}.tar "${PROJECT_NAME}" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/export/)

-	# copy tar to deliverable folder
-	add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_BINARY_DIR}/export/${PROJECT_NAME}.tar" "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.tar")
+		# copy tar to deliverable folder
+		add_custom_command(TARGET ExportTar COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_BINARY_DIR}/export/${PROJECT_NAME}.tar" "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.tar")
+
+	ENDIF()
 ENDFUNCTION(INTERNAL_BUILD_RELEASE_TAR)


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

--HG--
branch : v1-7
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-7%401761

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

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


COMP: Adding back in a patched FindPythonLibs module to deal with Mac frameworks.

Thanks to David Gobbi for reporting an issue with Python frameworks when using
the CMake find module. This module is a modified form of the CMake module, and
was successfully tested by David Gobbi. If there are no further issues these
changes should be merged upstream to CMake for their next release.

--- CMake/FindPythonLibs.cmake
+++ CMake/FindPythonLibs.cmake
@@ -1,16 +1,178 @@
-# Stub for backwards compatibility - includes the CMake FindPythonLibs module.
-# You should change any includes to read include(FindPythonLibs) so that CMake
-# will search its modules directory if the file is not present in VTK's module\
-# directory. This stub will be removed in a future release.
+# - Find python libraries
+# This module finds if Python is installed and determines where the
+# include files and libraries are. It also determines what the name of
+# the library is. This code sets the following variables:
+#
+#  PYTHONLIBS_FOUND       - have the Python libs been found
+#  PYTHON_LIBRARIES       - path to the python library
+#  PYTHON_INCLUDE_PATH    - path to where Python.h is found (deprecated)
+#  PYTHON_INCLUDE_DIRS    - path to where Python.h is found
+#  PYTHON_DEBUG_LIBRARIES - path to the debug library
+#

-# Issue a warning that the FindPythonLibs module will be removed, include the
-# CMake module instead of directly referencing the file path
-if(NOT _WARNED_ABOUT_FINDPYTHONLIBS_MOVE)
-  set(_WARNED_ABOUT_FINDPYTHONLIBS_MOVE TRUE CACHE BOOL
-    "The FindPythonLibs.cmake copy will be removed in a future VTK release.")
-  mark_as_advanced(_WARNED_ABOUT_FINDPYTHONLIBS_MOVE)
-  message(STATUS "WARNING: This module will be removed in a future VTK release. Please use INCLUDE(FindPythonLibs) to include the CMake module if the VTK copy is not present.")
-endif()
+#=============================================================================
+# Copyright 2001-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+#  License text for the above reference.)

-# Include the FindPythonLibs module bundled with CMake
-include(${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
+INCLUDE(CMakeFindFrameworks)
+# Search for the python framework on Apple.
+CMAKE_FIND_FRAMEWORKS(Python)
+
+FOREACH(_CURRENT_VERSION 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+  STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
+  IF(WIN32)
+    FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
+      NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
+      PATHS
+      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
+      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs )
+  ENDIF(WIN32)
+
+  FIND_LIBRARY(PYTHON_LIBRARY
+    NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
+    PATHS
+      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+    # Avoid finding the .dll in the PATH.  We want the .lib.
+    NO_SYSTEM_ENVIRONMENT_PATH
+  )
+  # Look for the static library in the Python config directory
+  FIND_LIBRARY(PYTHON_LIBRARY
+    NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
+    # Avoid finding the .dll in the PATH.  We want the .lib.
+    NO_SYSTEM_ENVIRONMENT_PATH
+    # This is where the static library is usually located
+    PATH_SUFFIXES python${_CURRENT_VERSION}/config
+  )
+
+  # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
+  # PYTHON_INCLUDE_DIR is not set.
+  IF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+    SET(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
+      "Path to where Python.h is found" FORCE)
+  ENDIF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+
+  SET(PYTHON_FRAMEWORK_INCLUDES)
+  IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+    FOREACH(dir ${Python_FRAMEWORKS})
+      SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
+        ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
+    ENDFOREACH(dir)
+  ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+
+  FIND_PATH(PYTHON_INCLUDE_DIR
+    NAMES Python.h
+    PATHS
+      ${PYTHON_FRAMEWORK_INCLUDES}
+      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
+    PATH_SUFFIXES
+      python${_CURRENT_VERSION}
+  )
+
+  # For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal.
+  SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL
+    "Path to where Python.h is found (deprecated)")
+
+ENDFOREACH(_CURRENT_VERSION)
+
+MARK_AS_ADVANCED(
+  PYTHON_DEBUG_LIBRARY
+  PYTHON_LIBRARY
+  PYTHON_INCLUDE_DIR
+)
+
+# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
+# cache entries because they are meant to specify the location of a single
+# library. We now set the variables listed by the documentation for this
+# module.
+SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
+SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
+SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
+
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
+
+
+# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
+# PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
+# in your sources to initialize the static python modules
+
+GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS
+  GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
+
+FUNCTION(PYTHON_ADD_MODULE _NAME )
+  OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
+  OPTION(PYTHON_MODULE_${_NAME}_BUILD_SHARED "Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
+
+  IF(PYTHON_ENABLE_MODULE_${_NAME})
+    IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+      SET(PY_MODULE_TYPE MODULE)
+    ELSE(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+      SET(PY_MODULE_TYPE STATIC)
+      SET_PROPERTY(GLOBAL  APPEND  PROPERTY  PY_STATIC_MODULES_LIST ${_NAME})
+    ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+
+    SET_PROPERTY(GLOBAL  APPEND  PROPERTY  PY_MODULES_LIST ${_NAME})
+    ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
+#    TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
+
+  ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
+ENDFUNCTION(PYTHON_ADD_MODULE)
+
+FUNCTION(PYTHON_WRITE_MODULES_HEADER _filename)
+
+  GET_PROPERTY(PY_STATIC_MODULES_LIST  GLOBAL  PROPERTY PY_STATIC_MODULES_LIST)
+
+  GET_FILENAME_COMPONENT(_name "${_filename}" NAME)
+  STRING(REPLACE "." "_" _name "${_name}")
+  STRING(TOUPPER ${_name} _name)
+
+  SET(_filenameTmp "${_filename}.in")
+  FILE(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
+  FILE(APPEND ${_filenameTmp}
+"#ifndef ${_name}
+#define ${_name}
+
+#include <Python.h>
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif /* __cplusplus */
+
+")
+
+  FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+    FILE(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
+  ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+
+  FILE(APPEND ${_filenameTmp}
+"#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+")
+
+
+  FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+    FILE(APPEND ${_filenameTmp} "int CMakeLoadPythonModule_${_currentModule}(void) \n{\n  static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
+  ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+
+  FILE(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n")
+  FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+    FILE(APPEND ${_filenameTmp} "  CMakeLoadPythonModule_${_currentModule}();\n")
+  ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+  FILE(APPEND ${_filenameTmp} "}\n#endif\n\n#endif\n")
+
+# with CONFIGURE_FILE() cmake complains that you may not use a file created using FILE(WRITE) as input file for CONFIGURE_FILE()
+  EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
+
+ENDFUNCTION(PYTHON_WRITE_MODULES_HEADER)


Have moved FindXUL.cmake to deprecated

Have moved FindXUL.cmake to deprecated

--- CMakeModules/FindXUL.cmake
+++ CMakeModules/FindXUL.cmake
@@ -1,175 +0,0 @@
-# Locate XUL
-# This module defines
-# XUL_LIBRARIES
-# XUL_FOUND, if false, do not try to link to gdal
-# XUL_INCLUDE_DIR, where to find the headers
-#
-# $XUL_DIR is an environment variable that would
-# correspond to the ./configure --prefix=$XUL_DIR
-#
-# Created by Robert Osfield.
-
-#use pkg-config to find various modues
-INCLUDE(FindPkgConfig OPTIONAL)
-
-IF(PKG_CONFIG_FOUND)
-
-    INCLUDE(FindPkgConfig)
-
-    pkg_check_modules(XULRUNNER_XPCOM xulrunner-xpcom<=1.8.9)
-    pkg_check_modules(XULRUNNER_JS xulrunner-js)
-    pkg_check_modules(XULRUNNER_NSPR xulrunner-nspr)
-    pkg_check_modules(XULRUNNER_NSS xulrunner-nss)
-
-ENDIF(PKG_CONFIG_FOUND)
-
-# Added check to make sure that nsIBaseWindow.h is available, as it's not a standard part the of 1.8.x SDK
-FIND_PATH(NSIBASEWINDOW_INCLUDE_DIR widget/nsIBaseWindow.h
-    PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include/xulrunner
-    /usr/local/include
-    /usr/include/xulrunner
-    /usr/include
-    /sw/include/xulrunner # Fink
-    /sw/include # Fink
-    /opt/local/include/xulrunner # DarwinPorts
-    /opt/local/include # DarwinPorts
-    /opt/csw/include/xulrunner # Blastwave
-    /opt/csw/include # Blastwave
-    /opt/include/xulrunner
-    /opt/include
-    /usr/freeware/include/xulrunner
-    /usr/freeware/include
-)
-
-FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
-    PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include/xulrunner
-    /usr/local/include
-    /usr/include/xulrunner
-    /usr/include
-    /sw/include/xulrunner # Fink
-    /sw/include # Fink
-    /opt/local/include/xulrunner # DarwinPorts
-    /opt/local/include # DarwinPorts
-    /opt/csw/include/xulrunner # Blastwave
-    /opt/csw/include # Blastwave
-    /opt/include/xulrunner
-    /opt/include
-    /usr/freeware/include/xulrunner
-    /usr/freeware/include
-)
-
-FIND_PATH(NSPR_INCLUDE_DIR prtypes.h
-    PATHS ${XULRUNNER_NSPR_INCLUDE_DIRS}
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include/nspr
-    /usr/local/include
-    /usr/include/nspr
-    /usr/include
-    /sw/include/nspr # Fink
-    /sw/include # Fink
-    /opt/local/include/nspr # DarwinPorts
-    /opt/local/include # DarwinPorts
-    /opt/csw/include/nspr # Blastwave
-    /opt/csw/include # Blastwave
-    /opt/include/nspr
-    /opt/include
-    /usr/freeware/include/nspr
-    /usr/freeware/include
-)
-
-FIND_PATH(MOZJS_INCLUDE_DIR jsapi.h
-    PATHS ${XULRUNNER_JS_INCLUDE_DIRS}
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include/mozjs
-    /usr/local/include
-    /usr/include/mozjs
-    /usr/include
-    /sw/include/mozjs # Fink
-    /sw/include # Fink
-    /opt/local/include/mozjs # DarwinPorts
-    /opt/local/include # DarwinPorts
-    /opt/csw/include/mozjs # Blastwave
-    /opt/csw/include # Blastwave
-    /opt/include/mozjs
-    /opt/include
-    /usr/freeware/include/mozjs
-    /usr/freeware/include
-)
-
-FIND_PATH(XUL_DIR
-    NAMES components/appshell.xpt
-    PATHS
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/lib/xulrunner
-    /usr/local/lib
-    /usr/lib/xulrunner
-    /usr/lib
-    /sw/lib/xulrunner
-    /sw/lib
-    /opt/local/lib/xulrunner
-    /opt/local/lib
-    /opt/csw/lib/xulrunner
-    /opt/csw/lib
-    /opt/lib/xulrunner
-    /opt/lib
-    /usr/freeware/lib64/xulrunner
-    /usr/freeware/lib64
-)
-
-MACRO(FIND_XUL_LIBRARY MYLIBRARY MYLIBRARYNAME)
-
-    FIND_LIBRARY(${MYLIBRARY}
-        PATHS ${XULRUNNER_XPCOM_LIBRARY_DIRS}
-        PATHS ${XULRUNNER_JS_LIBRARY_DIRS}
-        PATHS ${XULRUNNER_NSPR_LIBRARY_DIRS}
-        PATHS ${XULRUNNER_NSS_LIBRARY_DIRS}
-        NAMES ${MYLIBRARYNAME}
-        PATHS
-        ~/Library/Frameworks
-        /Library/Frameworks
-        /usr/local/lib/xulrunner
-        /usr/local/lib
-        /usr/lib/xulrunner
-        /usr/lib
-        /sw/lib/xulrunner
-        /sw/lib
-        /opt/local/lib/xulrunner
-        /opt/local/lib
-        /opt/csw/lib/xulrunner
-        /opt/csw/lib
-        /opt/lib/xulrunner
-        /opt/lib
-        /usr/freeware/lib64/xulrunner
-        /usr/freeware/lib64
-    )
-
-ENDMACRO(FIND_XUL_LIBRARY LIBRARY LIBRARYNAME)
-
-
-FIND_XUL_LIBRARY(XUL_LIBRARY xul plds4 plc4 nspr4)
-FIND_XUL_LIBRARY(XUL_MOZJS_LIBRARY mozjs)
-FIND_XUL_LIBRARY(XUL_XPCOM_LIBRARY xpcom)
-FIND_XUL_LIBRARY(XUL_PLUGIN_LIBRARY plds4)
-FIND_XUL_LIBRARY(XUL_NSS_LIBRARY nss3)
-
-
-SET(XUL_FOUND "NO")
-IF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
-
-    SET(XUL_FOUND "YES")
-    SET(XUL_LIBRARIES ${XUL_LIBRARY} ${XUL_MOZJS_LIBRARY} ${XUL_XPCOM_LIBRARY} ${XUL_PLUGIN_LIBRARY} ${XUL_NSS_LIBRARY})
-    SET(XUL_INCLUDE_DIRS ${XUL_INCLUDE_DIR} ${NSPR_INCLUDE_DIR} ${MOZJS_INCLUDE_DIR})
-
-ENDIF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
-
-# MESSAGE("XUL_INCLUDE_DIR " ${XUL_INCLUDE_DIR})
-# MESSAGE("XUL_LIBRARIES " ${XUL_LIBRARIES})


Add support for self-built pkg-config in FindSDL.

--- build/modules/FindSDL.cmake
+++ build/modules/FindSDL.cmake
@@ -67,6 +67,15 @@
 ELSE(WIN32)  # Linux etc
   FIND_PACKAGE(PkgConfig)
   IF(NOT PKG_CONFIG_FOUND)
+    SET(PKG_CONFIG_CANDIDATE_PATH ${DEPENDENCIES_ROOT}/installed-pkg-config/bin)
+    IF(EXISTS ${PKG_CONFIG_CANDIDATE_PATH})
+      FIND_PROGRAM(PKG_CONFIG_EXECUTABLE NAMES pkg-config PATHS ${PKG_CONFIG_CANDIDATE_PATH} DOC "pkg-config executable")
+      IF(PKG_CONFIG_EXECUTABLE)
+        SET(PKG_CONFIG_FOUND 1)
+      ENDIF(PKG_CONFIG_EXECUTABLE)
+    ENDIF()
+  ENDIF()
+  IF(NOT PKG_CONFIG_FOUND)
     MESSAGE("Could not find pkg-config (to search for sdl)")
   ELSE(NOT PKG_CONFIG_FOUND)
     SET(ENV{PKG_CONFIG_PATH} ${sdl_ROOT}/lib/pkgconfig:${sdl_ROOT}/../lib/pkgconfig)


c++ clang: Compile -Wno-null-dereference

This is a mitigation for issue
https://github.com/Microsoft/bond/issues/536. A proper fix is still
needed.

Closes https://github.com/Microsoft/bond/pull/598

--- cmake/Config.cmake
+++ cmake/Config.cmake
@@ -149,6 +149,7 @@
     --std=c++11
     -Wall
     -Werror
+    -Wno-null-dereference
     -Wno-unknown-warning-option
     -Wno-unused-local-typedefs)

@@ -158,6 +159,7 @@
     --std=c++11
     -Wall
     -Werror
+    -Wno-null-dereference
     -Wno-unknown-warning-option
     -Wno-unused-local-typedefs)


fbcode_builder: cmake: propagate thrift include dependencies correctly

Summary:
Update `add_thrift_cpp2_library()` to pass in the correct `-I` flags when
invoking the thrift compiler so that it can find all of the other thrift files
that this library depends on.

D16062657 was a previous attempt to do this, but suffered from a few problems:
- It required all dependencies to be defined before
  `add_thrift_cpp2_library()` was called.  This requires users to carefully
  order their CMake files and subdirectory include ordering.
- It only handled one level of dependencies, and did not propagate include
  paths for deeper dependencies.
- It set the include path for dependencies to the source directory path where
  the dependency was originally built, rather than the directory where the
  thrift file for that dependency would be installed.

This change does require CMake 3.8+.  Previous versions of CMake do not
support using generator expressions to generate multiple arguments for a
custom command.

Reviewed By: strager

Differential Revision: D17005381

fbshipit-source-id: 31190beba94b4d1010445375a5e2791450230f7d

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -17,13 +17,24 @@
 #   The sub-directory where generated headers will be installed.
 #   Defaults to "include" if not specified.  The caller must still call
 #   install() to install the thrift library if desired.
+# - THRIFT_INCLUDE_DIR <path>
+#   The sub-directory where generated headers will be installed.
+#   Defaults to "${INCLUDE_DIR}/thrift-files" if not specified.
+#   The caller must still call install() to install the thrift library if
+#   desired.
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
   set(one_value_args INCLUDE_DIR)
-  set(multi_value_args SERVICES DEPENDS OPTIONS)
+  set(multi_value_args SERVICES DEPENDS OPTIONS THRIFT_INCLUDE_DIR)
   fb_cmake_parse_args(
     ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
   )
+  if(NOT DEFINED ARG_INCLUDE_DIR)
+    set(ARG_INCLUDE_DIR "include")
+  endif()
+  if(NOT DEFINED ARG_THRIFT_INCLUDE_DIR)
+    set(ARG_THRIFT_INCLUDE_DIR "${ARG_INCLUDE_DIR}/thrift-files")
+  endif()

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -39,9 +50,6 @@
     "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
   )
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)
-  if(NOT DEFINED ARG_INCLUDE_DIR)
-    set(ARG_INCLUDE_DIR "include")
-  endif()

   if (NOT "${include_prefix}" STREQUAL "")
     list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
@@ -78,22 +86,21 @@
     )
   endforeach()

-  list(APPEND thrift_include_options -I "${CMAKE_SOURCE_DIR}")
-  foreach(depends IN LISTS ARG_DEPENDS)
-    get_property(thrift_include_directory
-      TARGET ${depends}
-      PROPERTY THRIFT_INCLUDE_DIRECTORY)
-
-    if (thrift_include_directory STREQUAL "")
-      message(STATUS "No thrift dependency found for ${depends}")
-    else()
-      list(
-        APPEND thrift_include_options
-        -I "${thrift_include_directory}"
-      )
-    endif()
-  endforeach()
-
+  # This generator expression gets the list of include directories required
+  # for all of our dependencies.
+  # It requires using COMMAND_EXPAND_LISTS in the add_custom_command() call
+  # below.  COMMAND_EXPAND_LISTS is only available in CMake 3.8+
+  # If we really had to support older versions of CMake we would probably need
+  # to use a wrapper script around the thrift compiler that could take the
+  # include list as a single argument and split it up before invoking the
+  # thrift compiler.
+  if (NOT POLICY CMP0067)
+    message(FATAL_ERROR "add_thrift_cpp2_library() requires CMake 3.8+")
+  endif()
+  set(
+    thrift_include_options
+    "-I;$<JOIN:$<TARGET_PROPERTY:${LIB_NAME}.thrift_includes,INTERFACE_INCLUDE_DIRECTORIES>,;-I;>"
+  )
   file(
     GLOB_RECURSE THRIFT_TEMPLATE_FILES
     FOLLOW_SYMLINKS "${FBTHRIFT_TEMPLATES_DIR}/cpp2/*.mustache"
@@ -104,6 +111,7 @@
     OUTPUT
       ${generated_headers}
       ${generated_sources}
+    COMMAND_EXPAND_LISTS
     COMMAND
       "${CMAKE_COMMAND}" -E make_directory "${output_dir}"
     COMMAND
@@ -111,7 +119,7 @@
       --strict
       --templates "${FBTHRIFT_TEMPLATES_DIR}"
       --gen "mstch_cpp2:${GEN_ARG_STR}"
-      ${thrift_include_options}
+      "${thrift_include_options}"
       -o "${output_dir}"
       "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
     WORKING_DIRECTORY
@@ -159,11 +167,27 @@
     PROPERTY PUBLIC_HEADER ${generated_headers}
   )

+  # Define a dummy interface library to help propagate the thrift include
+  # directories between dependencies.
+  add_library("${LIB_NAME}.thrift_includes" INTERFACE)
+  target_include_directories(
+    "${LIB_NAME}.thrift_includes"
+    INTERFACE
+      "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>"
+      "$<INSTALL_INTERFACE:${ARG_THRIFT_INCLUDE_DIR}>"
+  )
+  foreach(dep IN LISTS ARG_DEPENDS)
+    target_link_libraries(
+      "${LIB_NAME}.thrift_includes"
+      INTERFACE "${dep}.thrift_includes"
+    )
+  endforeach()
+
   set_target_properties(
     "${LIB_NAME}"
     PROPERTIES
-      EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
-      THRIFT_INCLUDE_DIRECTORY "${CMAKE_SOURCE_DIR}"
+      EXPORT_PROPERTIES "THRIFT_INSTALL_DIR"
+      THRIFT_INSTALL_DIR "${ARG_THRIFT_INCLUDE_DIR}/${include_prefix}"
       HEADER_INSTALL_DIR "${ARG_INCLUDE_DIR}/${include_prefix}/gen-cpp2"
   )
 endfunction()


Windows can't handle : in a filename

Windows can't handle : in a filename

--- test.cmake
+++ test.cmake
@@ -54,7 +54,7 @@
 endif()
 string(REPLACE "/" "_" CTEST_BUILD_NAME "${git_branch}: ${CTEST_BUILD_NAME}")
 string(REPLACE "+" "x" CTEST_BUILD_NAME "${CTEST_BUILD_NAME}") # CDash fails to escape '+' correctly in URIs
-string(REGEX REPLACE "[][ ()]" "_" CTEST_BINARY_DIRECTORY "${CTEST_BUILD_NAME}")
+string(REGEX REPLACE "[][ ():]" "_" CTEST_BINARY_DIRECTORY "${CTEST_BUILD_NAME}")
 set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build-${dashboard_model}-${CTEST_BINARY_DIRECTORY}")
 file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")


Indentation

Indentation

--- check-supported-flags.cmake
+++ check-supported-flags.cmake
@@ -4,17 +4,17 @@
 include(compiler-flags.cmake)

 macro(check_supported_flags OUTPUT_VAR)
-CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCXXCompilerFlag_COMMON_PATTERNS)
-foreach(flag ${GCC_EXTRA_WARNINGS} ${CLANG_EXTRA_WARNINGS})
-  set(CMAKE_REQUIRED_DEFINITIONS "-W${flag}")
-  CHECK_CXX_SOURCE_COMPILES("int main() { return 0; }" flag-${flag}-result
-    FAIL_REGEX ${_CheckCXXCompilerFlag_COMMON_PATTERNS})
-  if(${flag-${flag}-result})
-    list(APPEND CXX_ALL_WARNINGS "${flag}")
-  endif()
-endforeach()
+  CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCXXCompilerFlag_COMMON_PATTERNS)
+  foreach(flag ${GCC_EXTRA_WARNINGS} ${CLANG_EXTRA_WARNINGS})
+    set(CMAKE_REQUIRED_DEFINITIONS "-W${flag}")
+    CHECK_CXX_SOURCE_COMPILES("int main() { return 0; }" flag-${flag}-result
+      FAIL_REGEX ${_CheckCXXCompilerFlag_COMMON_PATTERNS})
+    if(${flag-${flag}-result})
+      list(APPEND CXX_ALL_WARNINGS "${flag}")
+    endif()
+  endforeach()

-# flatten the list
-list(INSERT CXX_ALL_WARNINGS 0 "")
-string (REPLACE ";" " -W" ${OUTPUT_VAR} "${CXX_ALL_WARNINGS}")
+  # flatten the list
+  list(INSERT CXX_ALL_WARNINGS 0 "")
+  string (REPLACE ";" " -W" ${OUTPUT_VAR} "${CXX_ALL_WARNINGS}")
 endmacro()


update robotlocomotion-lcmtypes external

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -162,7 +162,7 @@

   ExternalProject_Add(robotlocomotion-lcmtypes
     GIT_REPOSITORY https://github.com/robotlocomotion/lcmtypes
-    GIT_TAG a9f386b
+    GIT_TAG 4bd59a1
     ${cmake3_args}
     CMAKE_CACHE_ARGS
       ${default_cmake_args}


CMAKE_MODULE_PATH to CMAKE_SOURCE_DIR

CMAKE_MODULE_PATH to CMAKE_SOURCE_DIR

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -40,7 +40,7 @@
     set(SIZE_T "unsigned")
 endif(HAVE_SYS_TYPES_H)

-configure_file(${CMAKE_MODULE_PATH}/expat_config.h.cmake ${CMAKE_BINARY_DIR}/expat_config.h)
+configure_file(${CMAKE_SOURCE_DIR}/cmake/expat_config.h.cmake ${CMAKE_BINARY_DIR}/expat_config.h)
 add_definitions(-DHAVE_EXPAT_CONFIG_H)

-configure_file(${CMAKE_MODULE_PATH}/uninstall.cmake.in ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/cmake/uninstall.cmake.in ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)


fix wrong name in to find clang-format

fix wrong name in to find clang-format

--- cmake/FindClangFormat.cmake
+++ cmake/FindClangFormat.cmake
@@ -13,9 +13,9 @@
         PATHS
         "${CLANG_FORMAT_ROOT_DIR}"
         NO_DEFAULT_PATH)
+else()
+    find_program(CLANG_FORMAT_BIN NAMES ${CLANG_FORMAT_BIN_NAME})
 endif()
-
-find_program(CLANG_FORMAT_BIN NAMES ${CLANG_FORMAT_BIN_NAME})

 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(
@@ -26,7 +26,7 @@
 mark_as_advanced(
     CLANG_FORMAT_BIN)

-if(CLANG_FORMAT_FOUND)
+if(ClangFormat_FOUND)
     # A CMake script to find all source files and setup clang-format targets for them
     include(clang-format)
 else()


cmake

cmake

--- cmake/Modules/FindGMP.cmake
+++ cmake/Modules/FindGMP.cmake
@@ -1,77 +1,48 @@
-#-- SFCGAL finder
+#-- GMP finder
 #
 # search variables :
-#     SFCGAL_DIR(cmake/environment) : SFCGAL install directory
-#     SFCGAL_INCLUDE_DIR(cmake) : directory containing SFCGAL.h
-#     SFCGAL_LIBRARY_DIR(cmake) : directory containing SFCGAL libraries
+#     GMP_DIR(cmake/environment) : gmp install directory
+#     GMP_INCLUDE_DIR(cmake) : directory containing gmp.h
+#     GMP_LIBRARY_DIR(cmake) : directory containing gmp libraries
+#
+# find options :
+#     GMP_ENABLE_CXX : search for gmpxx library?
 #
 # defined variables :
-#     SFCGAL_FOUND : true if library found
-#     SFCGAL_INCLUDE_DIRS : full path to SFCGAL libraries
-#     SFCGAL_LIBRARIES : full path to SFCGAL libraries
+#     GMP_FOUND : true if library found
+#     GMP_INCLUDE_DIRS : full path to gmp libraries
+#     GMP_LIBRARIES : full path to gmp libraries
 #

-# -- parse version
-find_path(SFCGAL_INCLUDE_DIR SFCGAL/Kernel.h
-    HINTS $ENV{SFCGAL_DIR} ${SFCGAL_DIR} ${SFCGAL_INCLUDE_DIRS}
+option( GMP_ENABLE_CXX "enable cxx library" OFF )
+
+find_path(GMP_INCLUDE_DIRS gmp.h
+    HINTS $ENV{GMP_DIR} ${GMP_DIR} ${GMP_INCLUDE_DIRS}
     PATH_SUFFIXES include
 )

-# -- parse version
-IF(SFCGAL_INCLUDE_DIR)
-	IF(EXISTS "${SFCGAL_INCLUDE_DIR}/SFCGAL/version.h")
-		FILE(STRINGS "${SFCGAL_INCLUDE_DIR}/SFCGAL/version.h" sfcgal_version_str REGEX "^#define[\t ]+SFCGAL_VERSION[\t ]+\".*\"")
-
-		STRING(REGEX REPLACE "^#define[\t ]+SFCGAL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" SFCGAL_VERSION "${ign_socle_version_str}")
-
-		# from http://www.cmake.org/Wiki/CMakeCompareVersionStrings
-		# Breaks up a string in the form n1.n2.n3 into three parts and stores
-		# them in major, minor, and patch.  version should be a value, not a
-		# variable, while major, minor and patch should be variables.
-		IF(${SFCGAL_VERSION} MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
-			STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" SFCGAL_MAJOR_VERSION "${SFCGAL_VERSION}")
-			STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" SFCGAL_MINOR_VERSION "${SFCGAL_VERSION}")
-			STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" SFCGAL_PATCH_VERSION "${SFCGAL_VERSION}")
-		ELSE()
-			MESSAGE( WARNING "IGN_SOCLE_VERSION (${SFCGAL_VERSION}) doesn't match *.*.* form" )
-		ENDIF()
-
-
-		UNSET(sfcgal_version_str)
-	ELSE()
-		message( WARNING "can't parse SFCGAL version" )
-	ENDIF()
-ENDIF()
-
-
-
-# find library (Release)
-find_library(SFCGAL_LIBRARY NAMES SFCGAL
-	HINTS $ENV{SFCGAL_DIR} ${SFCGAL_DIR}
+find_library(GMP_LIBRARY NAMES gmp gmp-10
+	HINTS $ENV{GMP_DIR} ${GMP_DIR}
 	PATH_SUFFIXES lib
 )
-# find library (Debug)
-find_library(SFCGAL_LIBRARY_DEBUG NAMES SFCGALd
-	HINTS $ENV{SFCGAL_DIR} ${SFCGAL_DIR}
-	PATH_SUFFIXES lib
-)
+set( GMP_LIBRARIES ${GMP_LIBRARY} )

-# set output variables
-set( SFCGAL_INCLUDE_DIRS "${SFCGAL_INCLUDE_DIR}" )
-if ( SFCGAL_LIBRARY_DEBUG )
-	set( SFCGAL_LIBRARIES "optimized;${SFCGAL_LIBRARY};debug;${SFCGAL_LIBRARY_DEBUG} )
-else()
-	set( SFCGAL_LIBRARIES ${SFCGAL_LIBRARY} )
+if( ${GMP_ENABLE_CXX} )
+	find_library(GMP_CXX_LIBRARY NAMES gmpxx gmpxx-4
+		HINTS $ENV{GMP_DIR} ${GMP_DIR}
+		PATH_SUFFIXES lib
+	)
+	set( GMP_LIBRARIES "${GMP_CXX_LIBRARY};${GMP_LIBRARIES}" )
 endif()

 # handle the QUIETLY and REQUIRED arguments and set <NAME>_FOUND to TRUE
 # if all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(
-	SFCGAL DEFAULT_MSG
-    SFCGAL_INCLUDE_DIRS SFCGAL_LIBRARIES
+	GMP DEFAULT_MSG
+    GMP_INCLUDE_DIRS GMP_LIBRARIES
 )

-mark_as_advanced(SFCGAL_INCLUDE_DIRS SFCGAL_LIBRARIES)
+mark_as_advanced(GMP_INCLUDE_DIRS GMP_LIBRARIES)


Add required flag for OS X

Add required flag for OS X

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -482,7 +482,8 @@
 		-Werror=unused-variable
 		-Werror=reorder
 		-Werror=uninitialized
-		-Werror=init-self
+		-Werror=init-self
+		-Wno-unused-const-variable
 		#-Wcast-qual  - generates spurious noreturn attribute warnings,
 		#               try again later
 		#-Wconversion - would be nice, but too many "risky-but-safe"


Improve configuration of MSVC compilation flags

--- cmake/compilerOptions.cmake
+++ cmake/compilerOptions.cmake
@@ -7,16 +7,20 @@

 #Overwrite default flags
 if (MSVC)
-   set (CMAKE_CXX_FLAGS                "/DWIN32 /D_WINDOWS /GR /EHa")
-   set (CMAKE_CXX_FLAGS_DEBUG          "/MDd /Z7 /Ob0 /Od /RTC1 /D_DEBUG")
-   set (CMAKE_CXX_FLAGS_RELEASE        "/MD /O2 /Ob2 /D NDEBUG")
-   set (CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
-   set (CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
-   set (CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+    # /GR   Adds code to check object types at run-time (Needed with dynamic_casts, typeid, etc)
+    # /EHa  Support asynchronous structured exception handling (SEH). TODO -> Change to /EHs or /EHsc
+    # /RTC1 Runtime error checks (https://msdn.microsoft.com/en-us/library/8wtf2dfz(v=vs.120).aspx)
+    # /Zi   Produces PDB(s). It does not affect to optimizations but it implies /debug.
+    set (CMAKE_CXX_FLAGS                "/DWIN32 /D_WINDOWS /GR /EHsc")
+    set (CMAKE_CXX_FLAGS_DEBUG          "/MDd /Zi /Ob0 /Od /RTC1 /D_DEBUG")
+    set (CMAKE_CXX_FLAGS_RELEASE        "/MD /O2 /Ob2 /D NDEBUG")
+    set (CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
+    set (CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+    set (CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})

-   set (CMAKE_EXE_LINKER_FLAGS          "/machine:x64")
-   set (CMAKE_EXE_LINKER_FLAGS_RELEASE  "")
-   set (CMAKE_EXE_LINKER_FLAGS_DEBUG    "/debug")
+    set (CMAKE_EXE_LINKER_FLAGS          "/machine:x64")
+    set (CMAKE_EXE_LINKER_FLAGS_RELEASE  "")
+    set (CMAKE_EXE_LINKER_FLAGS_DEBUG    "/debug")
 else()
     message(FATAL_ERROR "The unique compiler supported is MSVC")
 endif()
@@ -25,7 +29,7 @@
 #set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /Zc:wchar_t")
 set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /wd4503 /wd4251")
 set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /bigobj") # Increases number of sections that an object file can contain
-set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /MP") # Multi-threaded compilations.
+set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /MP")     # Multi-threaded compilations.
 #It applies to compilations, bot not to linking or link-time code gen.

 #set(EXTRA_EXE_LINKER_FLAGS "${EXTRA_EXE_LINKER_FLAGS} /time /verbose:incr") # Debug linking times
@@ -34,18 +38,16 @@
 set(EXTRA_EXE_LINKER_FLAGS_DEBUG "${EXTRA_EXE_LINKER_FLAGS_DEBUG} /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:MSVCRT")

 if (PRODUCE_BETTER_EXES)
-        set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /Gy") # package individual funcions in packaged functions (COMDATs)
-        # This is needed for /OPT. /ZI implies /Gy, but we are not using /ZI
-
-        # Produces PDBs & it implies /DEBUG, but it doesn't affect optimizations
-        set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} /Z7")
-        set(EXTRA_EXE_LINKER_FLAGS "${EXTRA_EXE_LINKER_FLAGS} /INCREMENTAL:NO")
-        set(EXTRA_EXE_LINKER_FLAGS_RELEASE "${EXTRA_EXE_LINKER_FLAGS_RELEASE} /DEBUG") # TODO - probably can be removed
-        set(EXTRA_EXE_LINKER_FLAGS_RELEASE "${EXTRA_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF")
-        #Remove unreferenced functions: function level linking
+    # Produces PDBs & Remove unreferenced functions: function level linking -> disables incremental linking
+    # /Gy is necessary for /OPT
+    set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} /Zi /Gy")
+    set(EXTRA_EXE_LINKER_FLAGS_RELEASE "${EXTRA_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF,ICF")
+    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF,ICF")
 else()
-        #It's better to disable the better EXES for the development process (faster compilations)
-        set(EXTRA_EXE_LINKER_FLAGS "${EXTRA_EXE_LINKER_FLAGS} /INCREMENTAL")
+    set(EXTRA_EXE_LINKER_FLAGS "${EXTRA_EXE_LINKER_FLAGS} /INCREMENTAL")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /INCREMENTAL")
+    set(EXTRA_EXE_LINKER_FLAGS_RELEASE "${EXTRA_EXE_LINKER_FLAGS_RELEASE} /OPT:NOREF,NOICF")
+    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /OPT:NOREF,NOICF")
 endif()

 if(WARNINGS_ANSI_ISO)


remove libraries not directly needed from mlkdnn linkage (#1089)

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -108,8 +108,6 @@
 target_include_directories(libmkldnn SYSTEM INTERFACE ${EXTERNAL_PROJECTS_ROOT}/mkldnn/include)
 target_link_libraries(libmkldnn INTERFACE
     ${EXTERNAL_PROJECTS_ROOT}/mkldnn/lib/libmkldnn${CMAKE_SHARED_LIBRARY_SUFFIX}
-    ${EXTERNAL_PROJECTS_ROOT}/mkldnn/lib/libmklml_intel${CMAKE_SHARED_LIBRARY_SUFFIX}
-    ${EXTERNAL_PROJECTS_ROOT}/mkldnn/lib/libiomp5${CMAKE_SHARED_LIBRARY_SUFFIX}
     )

 install(DIRECTORY ${EXTERNAL_PROJECTS_ROOT}/mkldnn/lib/ DESTINATION ${NGRAPH_INSTALL_LIB})


[lldb] Fix race condition in framework installation

We need the install-liblldb-stripped target to depend on the
lldb-framework target in order for the installation to be guaranteed to
behave correctly, otherwise it's possible for the lldb-framework and
install-liblldb-stripped targets to run in parallel, resulting in
temporary or partially processed files being copied into the framework.
install-liblldb already depends on lldb-framework for this reason.

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

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

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -79,7 +79,7 @@
         # framework, so it must rely on the framework being fully built first.
         if (LLDB_BUILD_FRAMEWORK AND ${name} STREQUAL "liblldb")
           add_dependencies(install-${name} lldb-framework)
-          add_dependencies(install-lldb-framework-stripped lldb-framework)
+          add_dependencies(install-${name}-stripped lldb-framework)
         endif()
       endif()
     endif()


Strip local symbols when using externalized debug info.

When we build LLVM with externalized debug info, all debugging and
symbolication related data is extracted into dSYM files prior to
stripping. As such, there is no need to preserve local symbols in LLVM
binaries after dSYM creation.

This shrinks libLLVM.dylib from 58MB to 55MB on my system.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@258566 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit cf2a93b691e695745271b053136e010007ce0b6f)

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1196,7 +1196,7 @@
     endif()
     add_custom_command(TARGET ${name} POST_BUILD
       COMMAND xcrun dsymutil $<TARGET_FILE:${name}>
-      COMMAND xcrun strip -Sl $<TARGET_FILE:${name}>)
+      COMMAND xcrun strip -Sxl $<TARGET_FILE:${name}>)
   else()
     message(FATAL_ERROR "LLVM_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
   endif()


Removing ommission of tests under Windows

--- cmake_modules/yolo/YOLOProjectAddTestCase.cmake
+++ cmake_modules/yolo/YOLOProjectAddTestCase.cmake
@@ -27,16 +27,7 @@

 if (TUDAT_SKIP_BROKEN_MSVC_CLANG_PRECISION_TESTS)
     # https://github.com/tudat-team/tudat/issues/7
-    set(TEST_TO_BE_SKIPPED ${TEST_TO_BE_SKIPPED}
-            test_basic_astro_OrbitalElementConversions
-            test_basic_astro_TimeConversions
-            test_basic_astro_SphericalOrbitStateConversions
-            test_shape_based_HodographicShaping
-            test_orbit_determination_EstimationInput
-            test_orbit_determination_HybridArcStateEstimation
-            test_propagators_VariationalEquations
-            test_basics_TimeTypes
-            test_io_MultiArrayReader)
+    set(TEST_TO_BE_SKIPPED ${TEST_TO_BE_SKIPPED})
 endif ()


CMake: Bring Boost 1.60 incompatibility to front

Underline that IPCRingBuffer is incompatible with Boost 1.60
Prevent CMake generation and compiling up to IPCRingBuffer which will fail

--- cmake-local/BoostTargets.cmake
+++ cmake-local/BoostTargets.cmake
@@ -18,6 +18,9 @@
 endif()

 find_package(Boost 1.44 COMPONENTS ${required_boost_components} REQUIRED) # Lower version bound of 1.43 for range adapters, 1.44 for Filesystem v3
+if(Boost_VERSION GREATER 105900)
+    message(SEND_ERROR "Using an untested Boost version - inspect the Boost Interprocess release notes/changelog to see if any ABI breaks affect us.")
+endif(Boost_VERSION GREATER 105900)

 if(NEED_BOOST_THREAD)
     add_library(boost_thread INTERFACE)


skipping debug if not found

skipping debug if not found

--- cmake-modules/Findassimp.cmake
+++ cmake-modules/Findassimp.cmake
@@ -39,11 +39,15 @@
 		# release should be assimp-vc140-mt.dll
 		find_library(ASSIMP_LIBRARY_RELEASE				assimp-${ASSIMP_MSVC_VERSION}-mt.lib 			PATHS ${ASSIMP_LIBRARY_DIR})
 		find_library(ASSIMP_LIBRARY_DEBUG				assimp-${ASSIMP_MSVC_VERSION}-mtd.lib			PATHS ${ASSIMP_LIBRARY_DIR})
-
-		set(assimp_LIBRARIES
-			optimized 	${ASSIMP_LIBRARY_RELEASE}
-			debug		${ASSIMP_LIBRARY_DEBUG}
-		)
+
+		if(ASSIMP_LIBRARY_DEBUG)
+      set(assimp_LIBRARIES
+        optimized 	${ASSIMP_LIBRARY_RELEASE}
+        debug		${ASSIMP_LIBRARY_DEBUG}
+      )
+		else()
+      set(assimp_LIBRARIES ${ASSIMP_LIBRARY_RELEASE} )
+		endif()

 		FUNCTION(ASSIMP_COPY_BINARIES TargetDirectory)
 			ADD_CUSTOM_TARGET(AssimpCopyBinaries


fixed wrong regex

fixed wrong regex

--- cmake/OpenCVGenPkgconfig.cmake
+++ cmake/OpenCVGenPkgconfig.cmake
@@ -59,7 +59,7 @@
 if(OpenCV_EXTRA_COMPONENTS)
   foreach(extra_component ${OpenCV_EXTRA_COMPONENTS})

-    if(extra_component MATCHES "-[lL](.*)" OR extra_component MATCHES "[\\/]")
+    if(extra_component MATCHES "^-[lL](.*)" OR extra_component MATCHES "[\\/]")
       set(maybe_l_prefix "")
     else()
       set(maybe_l_prefix "-l")


assuan_sock_nonce_t needs by kleopatra is in assuan-1.0.4
For the moment requires minimun version to 1.0.4
until Marc or Frank created a fix it

svn path=/trunk/KDE/kdepim/; revision=762331

--- cmake/modules/FindAssuan.cmake
+++ cmake/modules/FindAssuan.cmake
@@ -184,12 +184,12 @@

     # if libassuan-config has been found
     if ( _ASSUANCONFIG_EXECUTABLE )
-
+
       message( STATUS "Found libassuan-config at ${_ASSUANCONFIG_EXECUTABLE}" )

       exec_program( ${_ASSUANCONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE ASSUAN_VERSION )

-      set( _ASSUAN_MIN_VERSION "1.0.0" )
+      set( _ASSUAN_MIN_VERSION "1.0.4" )
       macro_ensure_version( ${_ASSUAN_MIN_VERSION} ${ASSUAN_VERSION} _ASSUAN_INSTALLED_VERSION_OK )

       if ( NOT _ASSUAN_INSTALLED_VERSION_OK )


cmake: add path to help find nodejs

cmake: add path to help find nodejs

Helps locate node-v0.12.4 built from source on Fedora 22

Signed-off-by: Justin Brown <5b8a81ebf9a8661a7723d85a1264040bc2a1e8c8@intel.com>
Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- cmake/modules/FindNodejs.cmake
+++ cmake/modules/FindNodejs.cmake
@@ -8,7 +8,7 @@
 include (FindPackageHandleStandardArgs)

 find_path (NODE_ROOT_DIR "node/node.h" "src/node.h"
-  PATHS /usr/include/nodejs /usr/local/include/nodejs)
+  PATHS /usr/include/nodejs /usr/local/include/nodejs /usr/local/include)

 set (NODE_INCLUDE_DIRS
   ${NODE_ROOT_DIR}/src


component is called Phonon4Qt5 not Phonon4Support

--- cmake/modules/FindPhonon.cmake
+++ cmake/modules/FindPhonon.cmake
@@ -19,4 +19,4 @@

 include(FindPackageHandleStandardArgs)

-find_package_handle_standard_args(Phonon4Support  DEFAULT_MSG  Phonon4Qt5_DIR )
+find_package_handle_standard_args(Phonon4Qt5  DEFAULT_MSG  Phonon4Qt5_DIR )


[CMake] REFLEX_GENERATE_DICTIONARY: add USES parameter to pass targets from which include directories and definitions can be obtained

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -116,10 +116,17 @@
 endfunction()

 #---------------------------------------------------------------------------------------------------
-#---REFLEX_GENERATE_DICTIONARY( dictionary headerfiles SELECTION selectionfile OPTIONS opt1 opt2 ...)
+#---REFLEX_GENERATE_DICTIONARY( dictionary headerfiles SELECTION selectionfile OPTIONS opt1 opt2 ...
+#                               DEPENDS dependency1 dependency2 ...
+#                               USES target1 target2 ...
+#                             )
+#
+#  USES takes a list of targets. From the targets the properties INCLUDE_DIRECTORIES and
+#  COMPILE_DEFINITIONS are used to create the appropriate -I and -D flags
+#
 #---------------------------------------------------------------------------------------------------
 macro(REFLEX_GENERATE_DICTIONARY dictionary)
-  CMAKE_PARSE_ARGUMENTS(ARG "" "SELECTION" "OPTIONS;DEPENDS" ${ARGN})
+  CMAKE_PARSE_ARGUMENTS(ARG "" "SELECTION" "OPTIONS;DEPENDS;USES" ${ARGN})
   #---Get List of header files---------------
   set(headerfiles)
   foreach(fp ${ARG_UNPARSED_ARGUMENTS})
@@ -157,25 +164,36 @@
     set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict)
   endif()

-  set(include_dirs -I${CMAKE_CURRENT_SOURCE_DIR})
+  set(include_dirs ${CMAKE_CURRENT_SOURCE_DIR})
   get_directory_property(incdirs INCLUDE_DIRECTORIES)
   foreach(d ${incdirs})
     if(NOT "${d}" MATCHES "^(AFTER|BEFORE|INTERFACE|PRIVATE|PUBLIC|SYSTEM)$")
-      set(include_dirs ${include_dirs} -I${d})
-    endif()
-  endforeach()
-
+      list(APPEND include_dirs ${d})
+    endif()
+  endforeach()
+
+  set(definitions)
   get_directory_property(defs COMPILE_DEFINITIONS)
   foreach( d ${defs})
-   set(definitions ${definitions} -D${d})
+   list(APPEND definitions ${d})
+  endforeach()
+
+  foreach(DEP ${ARG_USES})
+    LIST(APPEND include_dirs $<TARGET_PROPERTY:${DEP},INCLUDE_DIRECTORIES>)
+    LIST(APPEND definitions $<TARGET_PROPERTY:${DEP},COMPILE_DEFINITIONS>)
   endforeach()

   add_custom_command(
     OUTPUT ${gensrcdict} ${rootmapname}
     COMMAND ${ROOT_genreflex_CMD}
     ARGS ${headerfiles} -o ${gensrcdict} ${rootmapopts} --select=${selectionfile}
-         --gccxmlpath=${GCCXML_home}/bin ${ARG_OPTIONS} ${include_dirs} ${definitions}
-    DEPENDS ${headerfiles} ${selectionfile} ${ARG_DEPENDS})
+         --gccxmlpath=${GCCXML_home}/bin ${ARG_OPTIONS}
+         "-I$<JOIN:${include_dirs},;-I>"
+         "$<$<BOOL:$<JOIN:${definitions},>>:-D$<JOIN:${definitions},;-D>>"
+    DEPENDS ${headerfiles} ${selectionfile} ${ARG_DEPENDS}
+
+    COMMAND_EXPAND_LISTS
+    )

   #---roottest compability---------------------------------
   if(CMAKE_ROOTTEST_DICT)


BUG: Installation rules on Windows for niral_utilities tools

On Windows, executable files have the extension ".exe". It needs to be
added to the file name in the installation rules that are specified
manually (niral_utilities tools).

--- DTIProcess.cmake
+++ DTIProcess.cmake
@@ -147,15 +147,18 @@
 option(BUILD_PolyDataMerge "Build PolyDataMerge" ON)
 option(BUILD_CropDTI "Build CropDTI" ON)
 if( BUILD_PolyDataTransform OR BUILD_PolyDataMerge OR BUILD_CropDTI )
+  if(WIN32)
+    set(fileextension .exe)
+  endif()
   set(${PRIMARY_PROJECT_NAME}_DEPENDENCIES niral_utilities)
   if( BUILD_PolyDataMerge )
-    install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/niral_utilities-install/bin/polydatamerge DESTINATION ${INSTALL_RUNTIME_DESTINATION} )
+    install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/niral_utilities-install/bin/polydatamerge${fileextension} DESTINATION ${INSTALL_RUNTIME_DESTINATION} )
   endif()
   if( BUILD_PolyDataTransform )
-    install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/niral_utilities-install/bin/polydatatransform DESTINATION ${INSTALL_RUNTIME_DESTINATION} )
+    install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/niral_utilities-install/bin/polydatatransform${fileextension} DESTINATION ${INSTALL_RUNTIME_DESTINATION} )
   endif()
   if( BUILD_CropDTI )
-    install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/niral_utilities-install/bin/CropDTI DESTINATION ${INSTALL_RUNTIME_DESTINATION} )
+    install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/niral_utilities-install/bin/CropDTI${fileextension} DESTINATION ${INSTALL_RUNTIME_DESTINATION} )
   endif()
 endif()


Moved MSVC_DEBUG_FLAGS out of this project because now that sort of functionality can be injected through on_create_target().

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -16,10 +16,6 @@
   # Optimize debug build to help diagnose release build crashes.
   if (GCC_DEBUG_OPTIMIZATION_LEVEL)
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -${GCC_DEBUG_OPTIMIZATION_LEVEL}")
-  endif ()
-
-  if (MSVC AND MSVC_DEBUG_FLAGS)
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_DEBUG_FLAGS}")
   endif ()

   set(CURRENT_TARGET ${target})


fix incorrect macOS path for OpenImageDenoise binary package

[ci skip]

--- scripts/superbuild/dependencies/dep_oidn.cmake
+++ scripts/superbuild/dependencies/dep_oidn.cmake
@@ -44,7 +44,7 @@
   ExternalProject_Add_StepDependencies(oidn configure tbb ispc)
 else()
   if (APPLE)
-    set(OIDN_URL "https://github.com/OpenImageDenoise/oidn/releases/download/v${BUILD_OIDN_VERSION}/oidn-${BUILD_OIDN_VERSION}.x86_64.macosx.tar.gz")
+    set(OIDN_URL "https://github.com/OpenImageDenoise/oidn/releases/download/v${BUILD_OIDN_VERSION}/oidn-${BUILD_OIDN_VERSION}.x86_64.macos.tar.gz")
   elseif (WIN32)
     set(OIDN_URL "https://github.com/OpenImageDenoise/oidn/releases/download/v${BUILD_OIDN_VERSION}/oidn-${BUILD_OIDN_VERSION}.x64.vc14.windows.zip")
   else()


Fix running tests for certain boost versions

--- cmake/JPetFramework-Utilities.cmake
+++ cmake/JPetFramework-Utilities.cmake
@@ -2,7 +2,7 @@
     add_executable(${TESTNAME}.x EXCLUDE_FROM_ALL ${ARGN})
     target_compile_options(${TESTNAME}.x PRIVATE -Wunused-parameter -Wall)
     target_link_libraries(${TESTNAME}.x JPetFramework::JPetFramework Boost::unit_test_framework)
-    add_test(NAME ${TESTNAME}.x COMMAND ${TESTNAME}.x "--log_level=ERROR --log_format=XML --log_sink=${TESTNAME}.xml --raport_level=no")
+    add_test(NAME ${TESTNAME}.x COMMAND ${TESTNAME}.x --log_level=error --log_format=XML --log_sink=${TESTNAME}.xml)
     set_target_properties(${TESTNAME}.x PROPERTIES FOLDER tests)
     add_dependencies(${TESTNAME}.x link_target)
 endmacro()


Fix PR27875. Parse LIBCXX_CXX_ABI_LIBRARY_PATH as a path not a string

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@271070 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/HandleLibCXXABI.cmake
+++ cmake/Modules/HandleLibCXXABI.cmake
@@ -21,9 +21,11 @@
     CACHE PATH
     "Paths to C++ ABI header directories separated by ';'." FORCE
     )
-
+  set(LIBCXX_CXX_ABI_LIBRARY_PATH "${LIBCXX_CXX_ABI_LIBRARY_PATH}"
+    CACHE PATH
+    "Paths to C++ ABI library directory"
+    )
   set(LIBCXX_CXX_ABI_LIBRARY ${abilib})
-
   set(LIBCXX_ABILIB_FILES ${abifiles})

   file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include")


Updated matthias kretz's OptimizeForArchitecture

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -1,5 +1,23 @@
+# Determine the host CPU feature set and determine the best set of compiler
+# flags to enable all supported SIMD relevant features. Alternatively, the
+# target CPU can be explicitly selected (for generating more generic binaries
+# or for targeting a different system).
+# Compilers provide e.g. the -march=native flag to achieve a similar result.
+# This fails to address the need for building for a different microarchitecture
+# than the current host.
+# The script tries to deduce all settings from the model and family numbers of
+# the CPU instead of reading the CPUID flags from e.g. /proc/cpuinfo. This makes
+# the detection more independent from the CPUID code in the kernel (e.g. avx2 is
+# not listed on older kernels).
+#
+# Usage:
+# OptimizeForArchitecture()
+# If either of Vc_SSE_INTRINSICS_BROKEN, Vc_AVX_INTRINSICS_BROKEN,
+# Vc_AVX2_INTRINSICS_BROKEN is defined and set, the OptimizeForArchitecture
+# macro will consequently disable the relevant features via compiler flags.
+
 #=============================================================================
-# Copyright 2010-2013 Matthias Kretz <kretz@kde.org>
+# Copyright 2010-2015 Matthias Kretz <kretz@kde.org>
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -7,15 +25,12 @@
 #
 #  * Redistributions of source code must retain the above copyright notice,
 #    this list of conditions and the following disclaimer.
-#
 #  * Redistributions in binary form must reproduce the above copyright notice,
 #    this list of conditions and the following disclaimer in the documentation
 #    and/or other materials provided with the distribution.
-#
-#  * The names of Kitware, Inc., the Insight Consortium, or the names of
-#    any consortium members, or of any contributors, may not be used to
-#    endorse or promote products derived from this software without
-#    specific prior written permission.
+#  * Neither the names of contributing organizations nor the
+#    names of its contributors may be used to endorse or promote products
+#    derived from this software without specific prior written permission.
 #
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -31,7 +46,7 @@

 get_filename_component(_currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH)
 include("${_currentDir}/AddCompilerFlag.cmake")
-include(CheckIncludeFile)
+include(CheckIncludeFileCXX)

 macro(_my_find _list _value _ret)
    list(FIND ${_list} "${_value}" _found)
@@ -70,47 +85,58 @@
    endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    if(_vendor_id STREQUAL "GenuineIntel")
       if(_cpu_family EQUAL 6)
-         # Any recent Intel CPU except NetBurst
-         if(_cpu_model EQUAL 70)
+         # taken from the Intel ORM
+         # http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
+         # CPUID Signature Values of Of Recent Intel Microarchitectures
+         # 4E 5E       | Skylake microarchitecture
+         # 3D 47 56    | Broadwell microarchitecture
+         # 3C 45 46 3F | Haswell microarchitecture
+         # 3A 3E       | Ivy Bridge microarchitecture
+         # 2A 2D       | Sandy Bridge microarchitecture
+         # 25 2C 2F    | Intel microarchitecture Westmere
+         # 1A 1E 1F 2E | Intel microarchitecture Nehalem
+         # 17 1D       | Enhanced Intel Core microarchitecture
+         # 0F          | Intel Core microarchitecture
+         #
+         # Values from the Intel SDE:
+         # 5C | Goldmont
+         # 5A | Silvermont
+         # 57 | Knights Landing
+         # 66 | Cannonlake
+         # 55 | Skylake Server
+         # 4E | Skylake Client
+         # 3C | Broadwell (likely a bug in the SDE)
+         # 3C | Haswell
+         if(_cpu_model EQUAL 87)
+            set(TARGET_ARCHITECTURE "knl")  # Knights Landing
+         elseif(_cpu_model EQUAL 92)
+            set(TARGET_ARCHITECTURE "goldmont")
+         elseif(_cpu_model EQUAL 90)
+            set(TARGET_ARCHITECTURE "silvermont")
+         elseif(_cpu_model EQUAL 102)
+            set(TARGET_ARCHITECTURE "cannonlake")
+         elseif(_cpu_model EQUAL 85) # 55
+            set(TARGET_ARCHITECTURE "skylake-avx512")
+         elseif(_cpu_model EQUAL 78 OR _cpu_model EQUAL 94) # 4E, 5E
+            set(TARGET_ARCHITECTURE "skylake")
+         elseif(_cpu_model EQUAL 61 OR _cpu_model EQUAL 71 OR _cpu_model EQUAL 86)
+            set(TARGET_ARCHITECTURE "broadwell")
+         elseif(_cpu_model EQUAL 60 OR _cpu_model EQUAL 69 OR _cpu_model EQUAL 70 OR _cpu_model EQUAL 63)
             set(TARGET_ARCHITECTURE "haswell")
-         elseif(_cpu_model EQUAL 63)
-            set(TARGET_ARCHITECTURE "haswell")
-         elseif(_cpu_model EQUAL 62)
+         elseif(_cpu_model EQUAL 58 OR _cpu_model EQUAL 62)
             set(TARGET_ARCHITECTURE "ivy-bridge")
-         elseif(_cpu_model EQUAL 61)
-            set(TARGET_ARCHITECTURE "broadwell")
-         elseif(_cpu_model EQUAL 60)
-            set(TARGET_ARCHITECTURE "haswell")
-         elseif(_cpu_model EQUAL 60)
-            set(TARGET_ARCHITECTURE "haswell")
-         elseif(_cpu_model EQUAL 58)
-            set(TARGET_ARCHITECTURE "ivy-bridge")
-         elseif(_cpu_model EQUAL 47) # Xeon E7 4860
+         elseif(_cpu_model EQUAL 42 OR _cpu_model EQUAL 45)
+            set(TARGET_ARCHITECTURE "sandy-bridge")
+         elseif(_cpu_model EQUAL 37 OR _cpu_model EQUAL 44 OR _cpu_model EQUAL 47)
             set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 46) # Xeon 7500 series
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 45) # Xeon TNG
-            set(TARGET_ARCHITECTURE "sandy-bridge")
-         elseif(_cpu_model EQUAL 44) # Xeon 5600 series
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 42) # Core TNG
-            set(TARGET_ARCHITECTURE "sandy-bridge")
-         elseif(_cpu_model EQUAL 37) # Core i7/i5/i3
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 31) # Core i7/i5
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 30) # Core i7/i5
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 29)
-            set(TARGET_ARCHITECTURE "penryn")
-         elseif(_cpu_model EQUAL 28)
-            set(TARGET_ARCHITECTURE "atom")
-         elseif(_cpu_model EQUAL 26)
+         elseif(_cpu_model EQUAL 26 OR _cpu_model EQUAL 30 OR _cpu_model EQUAL 31 OR _cpu_model EQUAL 46)
             set(TARGET_ARCHITECTURE "nehalem")
-         elseif(_cpu_model EQUAL 23)
+         elseif(_cpu_model EQUAL 23 OR _cpu_model EQUAL 29)
             set(TARGET_ARCHITECTURE "penryn")
          elseif(_cpu_model EQUAL 15)
             set(TARGET_ARCHITECTURE "merom")
+         elseif(_cpu_model EQUAL 28)
+            set(TARGET_ARCHITECTURE "atom")
          elseif(_cpu_model EQUAL 14)
             set(TARGET_ARCHITECTURE "core")
          elseif(_cpu_model LESS 14)
@@ -152,7 +178,15 @@
 endmacro()

 macro(OptimizeForArchitecture)
-   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"haswell\", \"broadwell\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
+   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. \
+Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used. \
+Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. \
+Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \
+\"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \
+\"haswell\", \"broadwell\", \"skylake\", \"skylake-avx512\", \"cannonlake\", \"silvermont\", \
+\"goldmont\", \"knl\" (Knights Landing), \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \
+\"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \
+\"AMD 14h\", \"AMD 16h\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
       message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
@@ -170,6 +204,58 @@
       message(STATUS "Detected CPU: ${TARGET_ARCHITECTURE}")
    endif(TARGET_ARCHITECTURE STREQUAL "auto")

+   macro(_nehalem)
+      list(APPEND _march_flag_list "nehalem")
+      list(APPEND _march_flag_list "corei7")
+      list(APPEND _march_flag_list "core2")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
+   endmacro()
+   macro(_westmere)
+      list(APPEND _march_flag_list "westmere")
+      _nehalem()
+   endmacro()
+   macro(_sandybridge)
+      list(APPEND _march_flag_list "sandybridge")
+      list(APPEND _march_flag_list "corei7-avx")
+      _westmere()
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx")
+   endmacro()
+   macro(_ivybridge)
+      list(APPEND _march_flag_list "ivybridge")
+      list(APPEND _march_flag_list "core-avx-i")
+      _sandybridge()
+      list(APPEND _available_vector_units_list "rdrnd" "f16c")
+   endmacro()
+   macro(_haswell)
+      list(APPEND _march_flag_list "haswell")
+      list(APPEND _march_flag_list "core-avx2")
+      _ivybridge()
+      list(APPEND _available_vector_units_list "avx2" "fma" "bmi" "bmi2")
+   endmacro()
+   macro(_broadwell)
+      list(APPEND _march_flag_list "broadwell")
+      _haswell()
+   endmacro()
+   macro(_skylake)
+      list(APPEND _march_flag_list "skylake")
+      _broadwell()
+   endmacro()
+   macro(_skylake_avx512)
+      list(APPEND _march_flag_list "skylake-avx512")
+      _skylake()
+      list(APPEND _available_vector_units_list "avx512f" "avx512cd" "avx512dq" "avx512bw" "avx512vl")
+   endmacro()
+   macro(_cannonlake)
+      list(APPEND _march_flag_list "cannonlake")
+      _skylake_avx512()
+      list(APPEND _available_vector_units_list "avx512ifma" "avx512vbmi")
+   endmacro()
+   macro(_knightslanding)
+      list(APPEND _march_flag_list "knl")
+      _broadwell()
+      list(APPEND _available_vector_units_list "avx512f" "avx512pf" "avx512er" "avx512cd")
+   endmacro()
+
    if(TARGET_ARCHITECTURE STREQUAL "core")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3")
@@ -188,38 +274,26 @@
       else()
          message(STATUS "SSE4.1: disabled (auto-detected from this computer's CPU flags)")
       endif()
+   elseif(TARGET_ARCHITECTURE STREQUAL "knl")
+      _knightslanding()
+   elseif(TARGET_ARCHITECTURE STREQUAL "cannonlake")
+      _cannonlake()
+   elseif(TARGET_ARCHITECTURE STREQUAL "skylake-xeon" OR TARGET_ARCHITECTURE STREQUAL "skylake-avx512")
+      _skylake_avx512()
+   elseif(TARGET_ARCHITECTURE STREQUAL "skylake")
+      _skylake()
+   elseif(TARGET_ARCHITECTURE STREQUAL "broadwell")
+      _broadwell()
+   elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
+      _haswell()
+   elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
+      _ivybridge()
+   elseif(TARGET_ARCHITECTURE STREQUAL "sandy-bridge")
+      _sandybridge()
+   elseif(TARGET_ARCHITECTURE STREQUAL "westmere")
+      _westmere()
    elseif(TARGET_ARCHITECTURE STREQUAL "nehalem")
-      list(APPEND _march_flag_list "nehalem")
-      list(APPEND _march_flag_list "corei7")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
-   elseif(TARGET_ARCHITECTURE STREQUAL "westmere")
-      list(APPEND _march_flag_list "westmere")
-      list(APPEND _march_flag_list "corei7")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
-   elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
-      list(APPEND _march_flag_list "core-avx2")
-      list(APPEND _march_flag_list "core-avx-i")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c" "fma")
-   elseif(TARGET_ARCHITECTURE STREQUAL "broadwell")
-      list(APPEND _march_flag_list "core-avx2")
-      list(APPEND _march_flag_list "core-avx-i")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c" "fma")
-   elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
-      list(APPEND _march_flag_list "core-avx-i")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "rdrnd" "f16c")
-   elseif(TARGET_ARCHITECTURE STREQUAL "sandy-bridge")
-      list(APPEND _march_flag_list "sandybridge")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx")
+      _nehalem()
    elseif(TARGET_ARCHITECTURE STREQUAL "atom")
       list(APPEND _march_flag_list "atom")
       list(APPEND _march_flag_list "core2")
@@ -280,113 +354,84 @@
    if(NOT TARGET_ARCHITECTURE STREQUAL "none")
       set(_disable_vector_unit_list)
       set(_enable_vector_unit_list)
-      _my_find(_available_vector_units_list "sse2" SSE2_FOUND)
-      _my_find(_available_vector_units_list "sse3" SSE3_FOUND)
-      _my_find(_available_vector_units_list "ssse3" SSSE3_FOUND)
-      _my_find(_available_vector_units_list "sse4.1" SSE4_1_FOUND)
-      _my_find(_available_vector_units_list "sse4.2" SSE4_2_FOUND)
-      _my_find(_available_vector_units_list "sse4a" SSE4a_FOUND)
       if(DEFINED Vc_AVX_INTRINSICS_BROKEN AND Vc_AVX_INTRINSICS_BROKEN)
-         UserWarning("AVX disabled per default because of old/broken compiler")
-         set(AVX_FOUND false)
-         set(XOP_FOUND false)
-         set(FMA4_FOUND false)
-         set(AVX2_FOUND false)
+         UserWarning("AVX disabled per default because of old/broken toolchain")
+         set(_avx_broken true)
+         set(_avx2_broken true)
+         set(_fma4_broken true)
+         set(_xop_broken true)
       else()
-         _my_find(_available_vector_units_list "avx" AVX_FOUND)
+         set(_avx_broken false)
          if(DEFINED Vc_FMA4_INTRINSICS_BROKEN AND Vc_FMA4_INTRINSICS_BROKEN)
-            UserWarning("FMA4 disabled per default because of old/broken compiler")
-            set(FMA4_FOUND false)
-         else()
-            _my_find(_available_vector_units_list "fma4" FMA4_FOUND)
+            UserWarning("FMA4 disabled per default because of old/broken toolchain")
+            set(_fma4_broken true)
+         else()
+            set(_fma4_broken false)
          endif()
          if(DEFINED Vc_XOP_INTRINSICS_BROKEN AND Vc_XOP_INTRINSICS_BROKEN)
-            UserWarning("XOP disabled per default because of old/broken compiler")
-            set(XOP_FOUND false)
-         else()
-            _my_find(_available_vector_units_list "xop" XOP_FOUND)
+            UserWarning("XOP disabled per default because of old/broken toolchain")
+            set(_xop_broken true)
+         else()
+            set(_xop_broken false)
          endif()
          if(DEFINED Vc_AVX2_INTRINSICS_BROKEN AND Vc_AVX2_INTRINSICS_BROKEN)
-            UserWarning("AVX2 disabled per default because of old/broken compiler")
-            set(AVX2_FOUND false)
-         else()
-            _my_find(_available_vector_units_list "avx2" AVX2_FOUND)
+            UserWarning("AVX2 disabled per default because of old/broken toolchain")
+            set(_avx2_broken true)
+         else()
+            set(_avx2_broken false)
          endif()
       endif()
-      set(USE_SSE2   ${SSE2_FOUND}   CACHE BOOL "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." ${_force})
-      set(USE_SSE3   ${SSE3_FOUND}   CACHE BOOL "Use SSE3. If SSE3 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSSE3  ${SSSE3_FOUND}  CACHE BOOL "Use SSSE3. If SSSE3 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4_1 ${SSE4_1_FOUND} CACHE BOOL "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4_2 ${SSE4_2_FOUND} CACHE BOOL "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4a  ${SSE4a_FOUND}  CACHE BOOL "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." ${_force})
-      set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will double some of the vector sizes relative to SSE." ${_force})
-      set(USE_AVX2   ${AVX2_FOUND}   CACHE BOOL "Use AVX2. This will double all of the vector sizes relative to SSE." ${_force})
-      set(USE_XOP    ${XOP_FOUND}    CACHE BOOL "Use XOP." ${_force})
-      set(USE_FMA4   ${FMA4_FOUND}   CACHE BOOL "Use FMA4." ${_force})
-      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_AVX2 USE_XOP USE_FMA4)
-      if(USE_SSE2)
-         list(APPEND _enable_vector_unit_list "sse2")
-      else(USE_SSE2)
-         list(APPEND _disable_vector_unit_list "sse2")
-      endif(USE_SSE2)
-      if(USE_SSE3)
-         list(APPEND _enable_vector_unit_list "sse3")
-      else(USE_SSE3)
-         list(APPEND _disable_vector_unit_list "sse3")
-      endif(USE_SSE3)
-      if(USE_SSSE3)
-         list(APPEND _enable_vector_unit_list "ssse3")
-      else(USE_SSSE3)
-         list(APPEND _disable_vector_unit_list "ssse3")
-      endif(USE_SSSE3)
-      if(USE_SSE4_1)
-         list(APPEND _enable_vector_unit_list "sse4.1")
-      else(USE_SSE4_1)
-         list(APPEND _disable_vector_unit_list "sse4.1")
-      endif(USE_SSE4_1)
-      if(USE_SSE4_2)
-         list(APPEND _enable_vector_unit_list "sse4.2")
-      else(USE_SSE4_2)
-         list(APPEND _disable_vector_unit_list "sse4.2")
-      endif(USE_SSE4_2)
-      if(USE_SSE4a)
-         list(APPEND _enable_vector_unit_list "sse4a")
-      else(USE_SSE4a)
-         list(APPEND _disable_vector_unit_list "sse4a")
-      endif(USE_SSE4a)
-      if(USE_AVX)
-         list(APPEND _enable_vector_unit_list "avx")
-         # we want SSE intrinsics to result in instructions using the VEX prefix.
-         # Otherwise integer ops (which require the older SSE intrinsics) would
-         # always have a large penalty.
-         list(APPEND _enable_vector_unit_list "sse2avx")
-      else(USE_AVX)
-         list(APPEND _disable_vector_unit_list "avx")
-      endif(USE_AVX)
-      if(USE_XOP)
-         list(APPEND _enable_vector_unit_list "xop")
-      else()
-         list(APPEND _disable_vector_unit_list "xop")
-      endif()
-      if(USE_FMA4)
-         list(APPEND _enable_vector_unit_list "fma4")
-      else()
-         list(APPEND _disable_vector_unit_list "fma4")
-      endif()
-      if(USE_AVX2)
-         list(APPEND _enable_vector_unit_list "avx2")
-      else()
-         list(APPEND _disable_vector_unit_list "avx2")
-      endif()
+
+      macro(_enable_or_disable _name _flag _documentation _broken)
+         if(_broken)
+            set(_found false)
+         else()
+            _my_find(_available_vector_units_list "${_flag}" _found)
+         endif()
+         set(USE_${_name} ${_found} CACHE BOOL "${documentation}" ${_force})
+         mark_as_advanced(USE_${_name})
+         if(USE_${_name})
+            list(APPEND _enable_vector_unit_list "${_flag}")
+         else()
+            list(APPEND _disable_vector_unit_list "${_flag}")
+         endif()
+      endmacro()
+      _enable_or_disable(SSE2 "sse2" "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." false)
+      _enable_or_disable(SSE3 "sse3" "Use SSE3. If SSE3 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSSE3 "ssse3" "Use SSSE3. If SSSE3 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4_1 "sse4.1" "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4_2 "sse4.2" "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4a "sse4a" "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." false)
+      _enable_or_disable(AVX "avx" "Use AVX. This will all floating-point vector sizes relative to SSE." _avx_broken)
+      _enable_or_disable(FMA "fma" "Use FMA." _avx_broken)
+      _enable_or_disable(BMI2 "bmi2" "Use BMI2." _avx_broken)
+      _enable_or_disable(AVX2 "avx2" "Use AVX2. This will double all of the vector sizes relative to SSE." _avx2_broken)
+      _enable_or_disable(XOP "xop" "Use XOP." _xop_broken)
+      _enable_or_disable(FMA4 "fma4" "Use FMA4." _fma4_broken)
+      _enable_or_disable(AVX512F "avx512f" "Use AVX512F. This will double all floating-point vector sizes relative to AVX2." false)
+      _enable_or_disable(AVX512VL "avx512vl" "Use AVX512VL. This enables 128- and 256-bit vector length instructions with EVEX coding (improved write-masking & more vector registers)." _avx2_broken)
+      _enable_or_disable(AVX512PF "avx512pf" "Use AVX512PF. This enables prefetch instructions for gathers and scatters." false)
+      _enable_or_disable(AVX512ER "avx512er" "Use AVX512ER. This enables exponential and reciprocal instructions." false)
+      _enable_or_disable(AVX512CD "avx512cd" "Use AVX512CD." false)
+      _enable_or_disable(AVX512DQ "avx512dq" "Use AVX512DQ." false)
+      _enable_or_disable(AVX512BW "avx512bw" "Use AVX512BW." false)
+      _enable_or_disable(AVX512IFMA "avx512ifma" "Use AVX512IFMA." false)
+      _enable_or_disable(AVX512VBMI "avx512vbmi" "Use AVX512VBMI." false)
+
       if(MSVC)
          # MSVC on 32 bit can select /arch:SSE2 (since 2010 also /arch:AVX)
          # MSVC on 64 bit cannot select anything (should have changed with MSVC 2010)
-         _my_find(_enable_vector_unit_list "avx" _avx)
-         set(_avx_flag FALSE)
-         if(_avx)
-            AddCompilerFlag("/arch:AVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _avx_flag)
-         endif()
-         if(NOT _avx_flag)
+         _my_find(_enable_vector_unit_list "avx2" _found)
+         if(_found)
+            AddCompilerFlag("/arch:AVX2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _found)
+         endif()
+         if(NOT _found)
+            _my_find(_enable_vector_unit_list "avx" _found)
+            if(_found)
+               AddCompilerFlag("/arch:AVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _found)
+            endif()
+         endif()
+         if(NOT _found)
             _my_find(_enable_vector_unit_list "sse2" _found)
             if(_found)
                AddCompilerFlag("/arch:SSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
@@ -404,7 +449,7 @@
          else(_found)
             _my_find(_available_vector_units_list "f16c"    _found)
             if(_found)
-               AddCompilerFlag("-march=native" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+               AddCompilerFlag("-xCORE-AVX-I" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
             else(_found)
                _my_find(_available_vector_units_list "avx"    _found)
                if(_found)
@@ -454,7 +499,7 @@
             endif(_good)
          endforeach(_flag)
          foreach(_flag ${_enable_vector_unit_list})
-            AddCompilerFlag("-m${_flag}" CXX_RESULT _result CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+            AddCompilerFlag("-m${_flag}" CXX_RESULT _result)
             if(_result)
                set(_header FALSE)
                if(_flag STREQUAL "sse3")
@@ -479,7 +524,7 @@
                set(_resultVar "HAVE_${_header}")
                string(REPLACE "." "_" _resultVar "${_resultVar}")
                if(_header)
-                  CHECK_INCLUDE_FILE("${_header}" ${_resultVar} "-m${_flag}")
+                  CHECK_INCLUDE_FILE_CXX("${_header}" ${_resultVar} "-m${_flag}")
                   if(NOT ${_resultVar})
                      set(_useVar "USE_${_flag}")
                      string(TOUPPER "${_useVar}" _useVar)
@@ -490,7 +535,7 @@
                   endif()
                endif()
                if(NOT _header OR ${_resultVar})
-                  set(Vc_ARCHITECTURE_FLAGS "${Vc_ARCHITECTURE_FLAGS} -m${_flag}")
+                  list(APPEND Vc_ARCHITECTURE_FLAGS "-m${_flag}")
                endif()
             endif()
          endforeach(_flag)


cmake fix

cmake fix

--- cmake/SetTargetCompileOptions.cmake
+++ cmake/SetTargetCompileOptions.cmake
@@ -35,7 +35,7 @@
     endif()

     set_target_properties(${TARGETNAME} PROPERTIES CXX_STANDARD 14)
-    target_compile_features(${TARGETNAME} cxx_std_14)
+    target_compile_features(${TARGETNAME} PUBLIC cxx_std_14)

     target_compile_options(${TARGETNAME} PRIVATE ${CXX_FLAGS} ${CXX_WARNINGS} )
     target_compile_options(${TARGETNAME} PRIVATE $<$<CONFIG:Debug>:${CXX_FLAGS_DEBUG}> )


BUG: Only CMAKE_PATCH_VERSION was checked to verify which version of CMAKE was used.

CMAKE_VERSION should be checked to verify that CMake is at least 2.8.3. If CMake is less recent than 2.8.3, we need to include an extra file.


BUG: Tests were not performed if DTIAtlasFiberAnalyzer was built as an extension

--- Common.cmake
+++ Common.cmake
@@ -5,18 +5,16 @@

 #-----------------------------------------------------------------------------
-if( DTIAtlasFiberAnalyzer_BUILD_SLICER_EXTENSION )
-  set(EXTENSION_NAME DTIAtlasFiberAnalyzer)
-  set(EXTENSION_HOMEPAGE "http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/DTIAtlasFiberAnalyzer")
-  set(EXTENSION_CATEGORY "Diffusion")
-  set(EXTENSION_CONTRIBUTORS "Francois Budin (UNC)")
-  set(EXTENSION_DESCRIPTION "This extension provides the tool DTIAtlasFiberAnalyzer integrated in Slicer")
-  set(EXTENSION_ICONURL "http://www.nitrc.org/project/screenshot.php?group_id=312&screenshot_id=575")
-  set(EXTENSION_SCREENSHOTURLS "http://www.nitrc.org/project/screenshot.php?group_id=403&screenshot_id=601 http://www.slicer.org/slicerWiki/images/thumb/9/90/FiberTrack-fibers.png/138px-FiberTrack-fibers.png")
-  set(EXTENSION_STATUS "Beta")
-  set(EXTENSION_DEPENDS "DTIProcess") # Specified as a space separated list or 'NA' if any
-  set(EXTENSION_BUILD_SUBDIRECTORY dti_tract_stat-build )
-endif()
+set(EXTENSION_NAME DTIAtlasFiberAnalyzer)
+set(EXTENSION_HOMEPAGE "http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/DTIAtlasFiberAnalyzer")
+set(EXTENSION_CATEGORY "Diffusion")
+set(EXTENSION_CONTRIBUTORS "Francois Budin (UNC)")
+set(EXTENSION_DESCRIPTION "This extension provides the tool DTIAtlasFiberAnalyzer integrated in Slicer")
+set(EXTENSION_ICONURL "http://www.nitrc.org/project/screenshot.php?group_id=312&screenshot_id=575")
+set(EXTENSION_SCREENSHOTURLS "http://www.nitrc.org/project/screenshot.php?group_id=403&screenshot_id=601 http://www.slicer.org/slicerWiki/images/thumb/9/90/FiberTrack-fibers.png/138px-FiberTrack-fibers.png")
+set(EXTENSION_STATUS "Beta")
+set(EXTENSION_DEPENDS "DTIProcess") # Specified as a space separated list or 'NA' if any
+set(EXTENSION_BUILD_SUBDIRECTORY dti_tract_stat-build )

 find_package(Git REQUIRED)


Add assert_has_property_containing_value.

This assertion checks to see if the property specified has a value
which contains the specified value part of a list.

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -491,6 +491,100 @@

 endfunction (assert_does_not_have_property_with_value)

+function (_item_has_property_containing_value ITEM_TYPE
+                                              ITEM
+                                              PROPERTY
+                                              PROPERTY_TYPE
+                                              COMPARATOR
+                                              VALUE
+                                              RESULT_VARIABLE)
+
+    set (${RESULT_VARIABLE} FALSE PARENT_SCOPE)
+
+    get_property (_property_values
+                  ${ITEM_TYPE} ${ITEM}
+                  PROPERTY ${PROPERTY})
+
+    foreach (PROPERTY_VALUE ${_property_values})
+
+        set (_child_value ${PROPERTY_VALUE})
+        _variable_is (_child_value
+                      ${PROPERTY_TYPE}
+                      ${COMPARATOR}
+                      ${VALUE}
+                      RESULT)
+
+        if (RESULT)
+
+            set (${RESULT_VARIABLE} TRUE PARENT_SCOPE)
+
+        endif (RESULT)
+
+    endforeach ()
+
+endfunction (_item_has_property_containing_value)
+
+# assert_has_property_containing_value
+#
+# Throws a non-fatal error if the ITEM with ITEM_TYPE specified does not
+# have a PROPERTY of PROPERTY_TYPE of which one of the items in the property
+# value's list satisfies COMPARATOR
+function (assert_has_property_containing_value ITEM_TYPE
+                                               ITEM
+                                               PROPERTY
+                                               PROPERTY_TYPE
+                                               COMPARATOR
+                                               VALUE)
+
+    _item_has_property_containing_value (${ITEM_TYPE}
+                                         ${ITEM}
+                                         ${PROPERTY}
+                                         ${PROPERTY_TYPE}
+                                         ${COMPARATOR}
+                                         ${VALUE}
+                                         RESULT)
+
+    if (NOT RESULT)
+
+        message (SEND_ERROR
+                 "Expected ${ITEM_TYPE} ${ITEM} to have property ${PROPERTY} "
+                 " of type ${PROPERTY_TYPE} containing value ${VALUE}")
+
+    endif (NOT RESULT)
+
+endfunction (assert_has_property_containing_value)
+
+# assert_does_not_have_property_containing_value
+#
+# Throws a non-fatal error if the ITEM with ITEM_TYPE specified does not
+# have a PROPERTY of PROPERTY_TYPE of which one of the items in the property
+# value's list satisfies COMPARATOR
+function (assert_does_not_have_property_containing_value ITEM_TYPE
+                                                         ITEM
+                                                         PROPERTY
+                                                         PROPERTY_TYPE
+                                                         COMPARATOR
+                                                         VALUE)
+
+    _item_has_property_containing_value (${ITEM_TYPE}
+                                         ${ITEM}
+                                         ${PROPERTY}
+                                         ${PROPERTY_TYPE}
+                                         ${COMPARATOR}
+                                         ${VALUE}
+                                         RESULT)
+
+    if (RESULT)
+
+        message (SEND_ERROR
+                 "Expected ${ITEM_TYPE} ${ITEM} not to have property "
+                 "${PROPERTY} of type ${PROPERTY_TYPE} containing "
+                 "value ${VALUE}")
+
+    endif (RESULT)
+
+endfunction (assert_does_not_have_property_containing_value)
+
 function (_file_exists FILE RESULT_VARIABLE)

     set (${RESULT_VARIABLE} TRUE PARENT_SCOPE)


COMP: link error with Boost on Windows

COMP: link error with Boost on Windows

--- Modules/ThirdParty/Boost/otb-module-init.cmake
+++ Modules/ThirdParty/Boost/otb-module-init.cmake
@@ -31,3 +31,8 @@
     message(STATUS "Found Boost components: unit_test_framework")
   endif()
 endif() #BUILD_TESTING
+
+if(WIN32)
+  # disable autolinking in boost
+	add_definitions( -DBOOST_ALL_NO_LIB )
+endif()


SK:

SK:

-DOC: removed a comment

--- src/Testing/Dashboard/elxDashboardCommon.cmake
+++ src/Testing/Dashboard/elxDashboardCommon.cmake
@@ -79,7 +79,6 @@
 endif()

 # Support initial checkout if necessary;
-# dashboard_root is working dir?
 if( NOT EXISTS "${CTEST_SOURCE_DIRECTORY}"
     AND NOT DEFINED CTEST_CHECKOUT_COMMAND
     AND CTEST_UPDATE_COMMAND)


cmake development

cmake development

--- lib/common/sources.cmake
+++ lib/common/sources.cmake
@@ -1,8 +1,16 @@
 # $Id$ $Revision$

-SET(common_SRCDIR ${CMAKE_SOURCE_DIR}/lib/common)
-
-INCLUDE_DIRECTORIES(${common_SRCDIR})
+INCLUDE_DIRECTORIES(
+	${top_SRCDIR}
+	${common_SRCDIR}
+	${gvc_SRCDIR}
+	${pack_SRCDIR}
+	${fdpgen_SRCDIR}
+	${pathplan_SRCDIR}
+	${graph_SRCDIR}
+	${cdt_SRCDIR}
+	${gd_SRCDIR}
+)

 ADD_CUSTOM_COMMAND(
 	WORKING_DIRECTORY ${common_SRCDIR}
@@ -19,7 +27,7 @@
 	WORKING_DIRECTORY ${common_SRCDIR}
 	OUTPUT ps.h
 	DEPENDS ps.txt
-	COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/stringize.awk ps.txt > ps.h
+	COMMAND awk -f ${awk_SRCDIR}/stringize.awk ps.txt > ps.h
 )

 ADD_CUSTOM_COMMAND(
@@ -28,8 +36,8 @@
 	DEPENDS color_names
 	DEPENDS brewer_colors
 	COMMAND LC_COLLATE=C sort color_names > color_lib
-	COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/brewer.awk brewer_colors >> color_lib
-	COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/colortbl.awk color_lib > colortbl.h
+	COMMAND awk -f ${awk_SRCDIR}/brewer.awk brewer_colors >> color_lib
+	COMMAND awk -f ${awk_SRCDIR}/colortbl.awk color_lib > colortbl.h
 	COMMAND rm color_lib
 )