Use virgil-sdk lib v3.0.1

Use virgil-sdk lib v3.0.1

--- cmake/virgil.cmake
+++ cmake/virgil.cmake
@@ -130,7 +130,7 @@
         if (NOT TARGET ${VIRGIL}_project)
             ExternalProject_Add (${VIRGIL}_project
                 GIT_REPOSITORY "https://github.com/VirgilSecurity/virgil-sdk-cpp.git"
-                GIT_TAG "v3.0.0"
+                GIT_TAG "v3.0.1"
                 PREFIX "${CMAKE_CURRENT_BINARY_DIR}/ext/virgil-sdk"
                 CMAKE_ARGS ${CMAKE_ARGS}
             )


FindGlog: Add support for 'glogd' Debug library (#1479)

Summary:
Glog v0.4.0 when configured with Debug build type adds a 'd' suffix to
the library file. This results in FindGlog.cmake failing to locate it.

Update FindGlog.cmake to use check for 'glogd', and use
select_library_configurations() to set GLOG_LIBRARY to the correct
found filename.

(Note: this has no effect if a non-Debug type is used.)

Pull Request resolved: https://github.com/facebook/folly/pull/1479

Reviewed By: yfeldblum

Differential Revision: D24503510

Pulled By: Orvid

fbshipit-source-id: 705df05a4a3d7df2df8af3bb66c319fb044adbce

--- build/fbcode_builder/CMake/FindGlog.cmake
+++ build/fbcode_builder/CMake/FindGlog.cmake
@@ -7,12 +7,17 @@
 # GLOG_LIBRARIES - link these to use Glog

 include(FindPackageHandleStandardArgs)
+include(SelectLibraryConfigurations)

-find_library(GLOG_LIBRARY glog
+find_library(GLOG_LIBRARY_RELEASE glog
+  PATHS ${GLOG_LIBRARYDIR})
+find_library(GLOG_LIBRARY_DEBUG glogd
   PATHS ${GLOG_LIBRARYDIR})

 find_path(GLOG_INCLUDE_DIR glog/logging.h
   PATHS ${GLOG_INCLUDEDIR})
+
+select_library_configurations(GLOG)

 find_package_handle_standard_args(glog DEFAULT_MSG
   GLOG_LIBRARY


COMP/CHG: increased testing timeout

COMP/CHG: increased testing timeout

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -6,7 +6,7 @@
 SET (DROP_SITE "http://makalu:8081")
 SET (DROP_LOCATION "MITK")
 SET (NIGHTLY_START_TIME "21:00:00 CET")
-SET (DART_TESTING_TIMEOUT 600)
+SET (DART_TESTING_TIMEOUT 900)

 IF(FALSE)


Delete Dart/CVS

Delete Dart/CVS

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -10,7 +10,7 @@
 #SET (DROP_SITE_USER "ftpuser")
 #SET (DROP_SITE_PASSWORD "public")

-SET (DROP_SITE_MODE "active")
+#SET (DROP_SITE_MODE "active")

 SET (TRIGGER_SITE "http://${DROP_SITE}/cgi-bin/Submit-Orfeotoolbox-TestingResults.cgi")


change FindEigen script, such that clsquare version is found first

--- FindEigen3.cmake
+++ FindEigen3.cmake
@@ -63,10 +63,10 @@

   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
       PATHS
+      ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Eigen3
       ${CMAKE_INSTALL_PREFIX}/include
       ${KDE4_INCLUDE_DIR}
       $ENV{HOME}/local/include
-      ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Eigen3
       PATH_SUFFIXES eigen3 eigen
   )


keep sync with upstream treejuce project

--- cmake/FindTREEJUCE.cmake
+++ cmake/FindTREEJUCE.cmake
@@ -3,9 +3,20 @@
 include(GNUInstallDirs)

 set(TREEJUCE_SEARCH_PREFIX "" CACHE PATH "additional path to search for treejuce")
+set(TREEJUCE_SEARCH_PREFIX_BIN "" CACHE PATH "additional path to search for treejuce programs")
 set(TREEJUCE_SEARCH_PREFIX_INC "" CACHE PATH "additional path to search for treejuce headers")
 set(TREEJUCE_SEARCH_PREFIX_LIB "" CACHE PATH "additional path to search for treejuce library")
 set(TREEJUCE_SEARCH_STATIC 0 CACHE BOOL "search static library instead of shared library")
+
+#
+# find binary builder
+#
+find_program(TREEJUCE_BIN_BUILDER treejuce_bin_builder
+    HINTS
+        ${TREEJUCE_SEARCH_PREFIX_BIN}
+        ${TREEJUCE_SEARCH_PREFIX}/${CMAKE_INSTALL_BINDIR}
+        ${TREEJUCE_SEARCH_PREFIX}/bin
+)

 #
 # find header directory
@@ -39,5 +50,8 @@
 # finalize
 #
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TREEJUCE
-    REQUIRED_VARS TREEJUCE_INCLUDE_DIR TREEJUCE_LIBRARIES
+    REQUIRED_VARS
+        TREEJUCE_BIN_BUILDER
+        TREEJUCE_INCLUDE_DIR
+        TREEJUCE_LIBRARIES
 )


Fixed typo

Fixed typo

--- cmake/ModulePython.cmake
+++ cmake/ModulePython.cmake
@@ -15,8 +15,8 @@
         find_package(PythonInterp ${FAST_Python_Version} EXACT REQUIRED)
         if(FAST_Python_Library AND FAST_Python_Include)
             set(PYTHON_LIBRARIES ${FAST_Python_Library})
-            set(PYTHON_INCLUDE_DIR ${FAST_Python_Include})
-            message("Manually set Python library and include to: ${PYTHON_LIBRARY} ${PYTHON_INCLUDE_DIR}")
+            set(PYTHON_INCLUDE_DIRS ${FAST_Python_Include})
+            message("Manually set Python library and include to: ${PYTHON_LIBRARIES} ${PYTHON_INCLUDE_DIRS}")
         else()
             find_package(PythonLibs ${FAST_Python_Version} EXACT REQUIRED)
         endif()


fix ocv_add_module CMake macro:

fix ocv_add_module CMake macro:

it tries to remove 'opencv_' prefix from 'name' variable, but
it creates new variable with the same name as module

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -106,7 +106,6 @@
 #   ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_gpu)
 macro(ocv_add_module _name)
   string(TOLOWER "${_name}" name)
-  string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
   set(the_module opencv_${name})

   # the first pass - collect modules info, the second pass - create targets


Add cmake variable ALPAKA_OFFLOAD_MAX_BLOCK_SIZE

--- cmake/alpakaCommon.cmake
+++ cmake/alpakaCommon.cmake
@@ -105,6 +105,7 @@
     add_library(alpaka::alpaka ALIAS alpaka)
 endif()

+set(ALPAKA_OFFLOAD_MAX_BLOCK_SIZE "256" CACHE STRING "Maximum number threads per block to be suggested by any target offloading backends ANY_BT_OMP5 and ANY_BT_OACC.")
 option(ALPAKA_DEBUG_OFFLOAD_ASSUME_HOST "Allow host-only contructs like assert in offload code in debug mode." ON)
 set(ALPAKA_BLOCK_SHARED_DYN_MEMBER_ALLOC_KIB "30" CACHE STRING "Kibibytes (1024B) of memory to allocate for block shared memory for backends requiring static allocation (includes CPU_B_OMP2_T_SEQ, CPU_B_TBB_T_SEQ, CPU_B_SEQ_T_SEQ)")

@@ -779,6 +780,7 @@
 if(ALPAKA_DEBUG_OFFLOAD_ASSUME_HOST)
    target_compile_definitions(alpaka INTERFACE "ALPAKA_DEBUG_OFFLOAD_ASSUME_HOST")
 endif()
+target_compile_definitions(alpaka INTERFACE "ALPAKA_OFFLOAD_MAX_BLOCK_SIZE=${ALPAKA_OFFLOAD_MAX_BLOCK_SIZE}")
 target_compile_definitions(alpaka INTERFACE "ALPAKA_BLOCK_SHARED_DYN_MEMBER_ALLOC_KIB=${ALPAKA_BLOCK_SHARED_DYN_MEMBER_ALLOC_KIB}")

 if(ALPAKA_CI)


prefer std=gnu++0x on msw so wx does not fail

--- cmake/compat_flags.cmake
+++ cmake/compat_flags.cmake
@@ -4,29 +4,34 @@

 # try to use compiler flag -std=c++11
 include(TestCXXAcceptsFlag)
-CHECK_CXX_ACCEPTS_FLAG("-std=c++11" CXX_FLAG_CXX11)
-if(CXX_FLAG_CXX11)
-	set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11")
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
-	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 ")
-	set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -std=c++11 ")
-	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 ")
-	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=c++11 ")
-	set(CXX_STD0X_FLAGS "-std=c++11")
-else()
-	# try to use compiler flag -std=c++0x for older compilers
-	CHECK_CXX_ACCEPTS_FLAG("-std=c++0x" CXX_FLAG_CXX0X)
-	if(CXX_FLAG_CXX0X)
-		set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++0x" )
-		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ")
-		set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++0x ")
-		set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -std=c++0x ")
-		set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++0x ")
-		set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=c++0x ")
-	set(CXX_STD0X_FLAGS "-std=c++0x")
-	endif(CXX_FLAG_CXX0X)
-endif(CXX_FLAG_CXX11)
+MACRO(AddSTDFlag FLAG)
+	set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG} ")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG} ")
+	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG} ")
+	set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${FLAG} ")
+	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAG} ")
+	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${FLAG} ")
+	set(CXX_STD0X_FLAGS "${FLAG}" )
+ENDMACRO(AddSTDFlag FLAG)
+
+if(WIN32)
+	CHECK_CXX_ACCEPTS_FLAG("-std=gnu++0x" CXX_FLAG_GXX0X)
+	if(CXX_FLAG_GXX0X)
+		AddSTDFlag("-std=gnu++0x")
+	endif(CXX_FLAG_GXX0X)
+else(WIN32)
+	CHECK_CXX_ACCEPTS_FLAG("-std=c++11" CXX_FLAG_CXX11)
+	if(CXX_FLAG_CXX11)
+		AddSTDFlag("-std=c++11")
+	else()
+		# try to use compiler flag -std=c++0x for older compilers
+		CHECK_CXX_ACCEPTS_FLAG("-std=c++0x" CXX_FLAG_CXX0X)
+		if(CXX_FLAG_CXX0X)
+			AddSTDFlag("-std=c++0x")
+		endif(CXX_FLAG_CXX0X)
+	endif(CXX_FLAG_CXX11)
+endif(WIN32)

 if(NOT CXX_STD0X_FLAGS)
 	message(FATAL "you need a c++11 compatible compiler")
-endif()+endif()


Update ctest_script.cmake

Update ctest_script.cmake

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -220,7 +220,7 @@
     -DGISMO_EXTRA_DEBUG=OFF
     -DGISMO_BUILD_PCH=OFF
     #-DGISMO_PLAINDOX=ON
-    -DNOSNIPPETS=ON
+    -DNOSNIPPETS=OFF
     )
 endif()


better output for script

better output for script

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -68,6 +68,7 @@
 ##   CTEST_TEST_TIMEOUT
 ##   CXXNAME
 ##   DO_COVERAGE
+##   DO_TESTS
 ##   DROP_LOCATION
 ##   DROP_METHOD
 ##   DROP_SITE
@@ -157,6 +158,10 @@
 # also to be changed
 if (NOT DEFINED DO_COVERAGE)
   set(DO_COVERAGE FALSE)
+endif()
+
+if (NOT DEFINED DO_TESTS)
+  set(DO_TESTS TRUE)
 endif()

 if(DEFINED CNAME)
@@ -582,13 +587,13 @@
     set(CTEST_LABELS_FOR_SUBPROJECTS ${LABELS_FOR_SUBPROJECTS}) #labels/subprojects
   endif()

+  message("Configuring")
   if(DEFINED KEEPCONFIG)
     ctest_configure(RETURN_VALUE confResult)
   else()
     ctest_configure(OPTIONS "${CMAKE_ARGS};${SUBM_ARGS};-DCTEST_USE_LAUNCHERS=${CTEST_USE_LAUNCHERS};-DBUILD_TESTING=ON;-DDART_TESTING_TIMEOUT=${CTEST_TEST_TIMEOUT}"  RETURN_VALUE confResult)
   endif()
-
-  #ctest_submit(PARTS Configure Update  RETRY_COUNT 3 RETRY_DELAY 3)
+
   if(EXISTS ${CTEST_BINARY_DIRECTORY}/gitstatus.txt)
     set(CTEST_NOTES_FILES ${CTEST_BINARY_DIRECTORY}/gitstatus.txt)
     #list(APPEND CTEST_NOTES_FILES "file")
@@ -612,13 +617,14 @@
       endif()
       ctest_build(TARGET ${subproject} APPEND)
       ctest_submit(PARTS Build  RETRY_COUNT 3 RETRY_DELAY 3)
-      ctest_test(INCLUDE_LABEL "${subproject}" PARALLEL_LEVEL ${CTEST_TEST_JOBS} RETURN_VALUE testResult)
-      if (narg GREATER 0 AND NOT testResult EQUAL 0)
-	set(${ARGV0} -1)
-      endif()
-
-      ctest_submit(PARTS Test  RETRY_COUNT 3 RETRY_DELAY 3)
-
+      if (DO_TESTS)
+	ctest_test(INCLUDE_LABEL "${subproject}" PARALLEL_LEVEL ${CTEST_TEST_JOBS} RETURN_VALUE testResult)
+	if (narg GREATER 0 AND NOT testResult EQUAL 0)
+	  set(${ARGV0} -1)
+	endif()
+	ctest_submit(PARTS Test  RETRY_COUNT 3 RETRY_DELAY 3)
+      endif()
+
       if(DO_COVERAGE)
         ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}" LABELS "${subproject}" APPEND)
         ctest_submit(PARTS Coverage  RETRY_COUNT 3 RETRY_DELAY 3)
@@ -634,29 +640,33 @@
   else() # No subprojects

+    message("Building")
     if("x${CTEST_CMAKE_GENERATOR}" STREQUAL "xNinja")
       ctest_build(TARGET UnitTestPP APPEND) # for older versions of ninja
     endif()
     ctest_submit(PARTS Build  RETRY_COUNT 3 RETRY_DELAY 3)
     ctest_build(APPEND)
     ctest_submit(PARTS Build  RETRY_COUNT 3 RETRY_DELAY 3)
+    message("Building unittests")
     ctest_build(TARGET unittests APPEND)
     ctest_submit(PARTS Build  RETRY_COUNT 3 RETRY_DELAY 3)
-    ctest_test(PARALLEL_LEVEL ${CTEST_TEST_JOBS} RETURN_VALUE testResult)
-    if (narg GREATER 0 AND NOT testResult EQUAL 0)
-      set(${ARGV0} -1)
-    endif()
-
+    if (DO_TESTS)
+      message("Testing")
+      ctest_test(PARALLEL_LEVEL ${CTEST_TEST_JOBS} RETURN_VALUE testResult)
+      if (narg GREATER 0 AND NOT testResult EQUAL 0)
+	set(${ARGV0} -1)
+      endif()
     ctest_submit(PARTS Test  RETRY_COUNT 3 RETRY_DELAY 3)
-
+  endif()
+
     if(DO_COVERAGE)
-      #message("Running coverage..")
+      message("Running Coverage")
       ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
       ctest_submit(PARTS Coverage  RETRY_COUNT 3 RETRY_DELAY 3)
     endif()

     if(NOT "x${CTEST_MEMORYCHECK_TYPE}" STREQUAL "xNone")
-      #message("Running memcheck..")
+      message("Running Memcheck")
       ctest_memcheck()
       ctest_submit(PARTS MemCheck  RETRY_COUNT 3 RETRY_DELAY 3)
     endif()


do LINK_PUBLIC in situations where PDAL_EMBED_BOOST isn't on

--- cmake/pdal_options.cmake
+++ cmake/pdal_options.cmake
@@ -61,7 +61,13 @@

 if (CMAKE_VERSION VERSION_GREATER 2.8.10)
     set(PDAL_LINKAGE "PUBLIC;general")
-    set(BOOST_LINKAGE "LINK_PRIVATE;general")
+
+    if (PDAL_EMBED_BOOST)
+        set(BOOST_LINKAGE "LINK_PRIVATE;general")
+    else()
+        set(BOOST_LINKAGE "LINK_PUBLIC;general")
+    endif()
+
 else()
     set(PDAL_LINKAGE "")
     set(BOOST_LINKAGE "")


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/puffin-stream/hunter.cmake
+++ cmake/projects/puffin-stream/hunter.cmake
@@ -5,6 +5,17 @@
 include(hunter_pick_scheme)

 # List of versions here...
+
+hunter_add_version(
+    PACKAGE_NAME
+    puffin-stream
+    VERSION
+    "0.2.0.0"
+    URL
+    "https://github.com/designerror/puffin-stream/archive/v0.2.0.0.tar.gz"
+    SHA1
+    9c4b5eb6deead3964fe622d84c39de0f7a7f8a99
+)

 hunter_add_version(
     PACKAGE_NAME


Make the moduleregistration file not depend on the absolute path

--- support/cmake/module_definition.cmake
+++ support/cmake/module_definition.cmake
@@ -189,8 +189,11 @@
 function (write_module_name module_name)
     string(TOLOWER ${module_name} module_name_lower)

+    set(MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${module_name_lower}module.h)
+    string(REPLACE "${OPENSPACE_BASE_DIR}/" "" MODULE_PATH ${MODULE_PATH})
+
     file(WRITE ${CMAKE_BINARY_DIR}/modules/${module_name_lower}/modulename.cmake
         "set(MODULE_NAME ${module_name}Module)\n"
-        "set(MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${module_name_lower}module.h)"
+        "set(MODULE_PATH ${MODULE_PATH})"
     )
 endfunction ()


cmake: verify googletest release hash when downloading

--- cmake/HextExternalProjectGoogleTest.cmake
+++ cmake/HextExternalProjectGoogleTest.cmake
@@ -4,6 +4,7 @@
 ExternalProject_Add(
     googletest
     URL https://github.com/google/googletest/archive/release-1.7.0.tar.gz
+    URL_HASH SHA512=c623d5720c4ed574e95158529872815ecff478c03bdcee8b79c9b042a603533f93fe55f939bcfe2cd745ce340fd626ad6d9a95981596f1a4d05053d874cd1dfc
     TIMEOUT 10

     UPDATE_COMMAND ""


ffmpeg-config.cmake: clean finder

ffmpeg-config.cmake: clean finder

Change-Id: Ic52bfbfc5fbc5832587c04cd8dff1b080955ba7a

--- cmake/qibuild/modules/ffmpeg-config.cmake
+++ cmake/qibuild/modules/ffmpeg-config.cmake
@@ -3,14 +3,7 @@
 ## found in the COPYING file.

 clean(FFMPEG)
-fpath(FFMPEG avcodec.h PATH_SUFFIXES libavcodec)
-fpath(FFMPEG avdevice.h PATH_SUFFIXES libavdevice)
-fpath(FFMPEG avfilter.h PATH_SUFFIXES libavfilter)
-fpath(FFMPEG avformat.h PATH_SUFFIXES libavformat)
-fpath(FFMPEG avresample.h PATH_SUFFIXES libavresample)
-fpath(FFMPEG avutil.h PATH_SUFFIXES libavutil)
-fpath(FFMPEG swresample.h PATH_SUFFIXES libswresample)
-fpath(FFMPEG swscale.h PATH_SUFFIXES libswscale)
+fpath(FFMPEG libavcodec/avcodec.h)

 flib(FFMPEG NAMES avcodec)
 flib(FFMPEG NAMES avfilter)


updated source_group_relative

updated source_group_relative

--- cmake/cmake/targets/source_group_relative.cmake
+++ cmake/cmake/targets/source_group_relative.cmake
@@ -9,9 +9,15 @@
     path_relative("${base_dir}" "${parent_dir}")
     ans(relative_dir_path)

-    string(REPLACE "/" "\\" relative_dir_path "${relative_dir_path}" )
-    source_group(${relative_dir_path} FILES ${file})
+    if(NOT "${relative_dir_path}" STREQUAL ".")
+        string(REPLACE "../" "" relative_dir_path "${relative_dir_path}")
+        string(REPLACE "/" "\\" relative_dir_path "${relative_dir_path}" )
+
+        source_group(${relative_dir_path} FILES ${file})

+    endif()
+
+


Add _PKGCONFIG_FILENAME variable

Add _PKGCONFIG_FILENAME variable

--- common/CommonAPICodeGenCommonConfig.cmake
+++ common/CommonAPICodeGenCommonConfig.cmake
@@ -63,6 +63,7 @@
     add_definitions(${${PKGCONFIG_FILENAME}_PKG_CFLAGS})
     link_directories(${${PKGCONFIG_FILENAME}_PKG_LIBRARY_DIRS})
     set(${variableName}_LIBRARIES -Wl,--no-as-needed ${${PKGCONFIG_FILENAME}_PKG_LIBRARIES} -Wl,--as-needed)
+    set(${variableName}_PKGCONFIG_FILENAME ${PKGCONFIG_FILENAME})

     message("CommonAPI libraries for ${interface} : ${${variableName}_LIBRARIES}")


Fixed SDL looking for unneeded library

Fixed SDL looking for unneeded library

--- SDL2Config.cmake
+++ SDL2Config.cmake
@@ -53,16 +53,6 @@
   PATH_SUFFIXES x64 x86
 )

-if(NOT SDL2_BUILDING_LIBRARY)
-  find_library(SDL2MAIN_LIBRARY
-    NAMES SDL2main
-    HINTS
-      ${PC_SDL2_LIBDIR}
-      ${PC_SDL2_LIBRARY_DIRS}
-    PATH_SUFFIXES x64 x86
-  )
-endif()
-
 if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h")
   file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$")
   file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$")


Improved handling of -j and superbuild issues with MITK source changes.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -236,26 +236,30 @@
 # MITK
 #-----------------------------------------------------------------------------

-#MESSAGE(STATUS SUPERBUILD_EXCLUDE_MITKBUILD_TARGET:${SUPERBUILD_EXCLUDE_MITKBUILD_TARGET})
+IF(CMAKE_GENERATOR MATCHES ".*Makefiles.*")
+  SET(mitk_build_cmd "$(MAKE)")
+ELSE()
+  SET(mitk_build_cmd ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/MITK-build --config ${CMAKE_CFG_INTDIR})
+ENDIF()
+
 IF(NOT DEFINED SUPERBUILD_EXCLUDE_MITKBUILD_TARGET OR NOT SUPERBUILD_EXCLUDE_MITKBUILD_TARGET)
-  SET(proj MITK-build)
-  ExternalProject_Add(${proj}
-    DOWNLOAD_COMMAND ""
-    CMAKE_GENERATOR ${gen}
-    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
-    BINARY_DIR MITK-build
-    INSTALL_COMMAND ""
-    DEPENDS
-      "MITK-Configure"
-    )
-ENDIF()
-
-#-----------------------------------------------------------------------------
-# Custom target allowing to drive the build of MITK project itself
+  SET(MITKBUILD_TARGET_ALL_OPTION "ALL")
+ELSE()
+  SET(MITKBUILD_TARGET_ALL_OPTION "")
+ENDIF()
+
+ADD_CUSTOM_TARGET(MITK-build ${MITKBUILD_TARGET_ALL_OPTION}
+  COMMAND ${mitk_build_cmd}
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/MITK-build
+  DEPENDS MITK-Configure
+  )
+
+#-----------------------------------------------------------------------------
+# Custom target allowing to drive the build of the MITK project itself
 #-----------------------------------------------------------------------------

 ADD_CUSTOM_TARGET(MITK
-  COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/MITK-build
+  COMMAND ${mitk_build_cmd}
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/MITK-build
 )


added BUILD_CIL_LITE option

added BUILD_CIL_LITE option

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -167,7 +167,8 @@
 option(BUILD_Gadgetron "Build Gadgetron" ${build_Gadgetron_default})
 option(BUILD_siemens_to_ismrmrd "Build siemens_to_ismrmrd" OFF)
 option(BUILD_petmr_rd_tools "Build petmr_rd_tools" OFF)
-option(BUILD_CIL "Build CCPi CIL Modules" OFF)
+option(BUILD_CIL "Build CCPi CIL Modules and ASTRA engine" OFF)
+option(BUILD_CIL_LITE "Build CCPi CIL Modules" OFF)
 option(BUILD_NIFTYREG "Build NIFTYREG" ON)

 option(BUILD_SIRF_Registration "Build SIRFS's registration functionality" ${BUILD_NIFTYREG})
@@ -219,15 +220,19 @@
   set (BUILD_CIL OFF)
 endif()
 if (APPLE)
-  if (BUILD_CIL)
+  if (BUILD_CIL or BUILD_CIL_LITE)
     message(FATAL_ERROR "CIL Modules are not tested on OSX and will be disabled")
   else()
     message(WARNING "CIL Modules are not tested on OSX and will be disabled")
   endif()
   set(BUILD_CIL OFF)
+  set(BUILD_CIL_LITE OFF)
 endif()
 if (BUILD_CIL)
-  list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES CCPi-Regularisation-Toolkit CCPi-Astra CCPi-Framework CCPi-FrameworkPlugins)
+  list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES CCPi-Regularisation-Toolkit CCPi-Astra CCPi-Framework CCPi-FrameworkPlugins TomoPhantom)
+endif()
+if (BUILD_CIL_LITE)
+  list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES CCPi-Regularisation-Toolkit CCPi-Framework CCPi-FrameworkPlugins)
 endif()

 if (BUILD_SIRF_Registration)


cmake cuda: add libcuda.so find paths, and produce error if it is not found.

--- cmake/Cuda.cmake
+++ cmake/Cuda.cmake
@@ -180,9 +180,12 @@
                               ${CUDA_curand_LIBRARY} ${CUDA_CUBLAS_LIBRARIES})

 # find libcuda.so and lbnvrtc.so
+# For libcuda.so, we will find it under lib, lib64, and then the
+# stubs folder, in case we are building on a system that does not
+# have cuda driver installed.
 find_library(CUDA_CUDA_LIB cuda
     PATHS ${CUDA_TOOLKIT_ROOT_DIR}
-    PATH_SUFFIXES lib lib64)
+    PATH_SUFFIXES lib lib64 lib/stubs lib64/stubs)
 find_library(CUDA_NVRTC_LIB nvrtc
     PATHS ${CUDA_TOOLKIT_ROOT_DIR}
     PATH_SUFFIXES lib lib64)
@@ -191,13 +194,18 @@
 caffe2_select_nvcc_arch_flags(NVCC_FLAGS_EXTRA)
 list(APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_EXTRA})
 message(STATUS "Added CUDA NVCC flags for: ${NVCC_FLAGS_EXTRA_readable}")
+
 if(CUDA_CUDA_LIB)
     message(STATUS "Found libcuda: ${CUDA_CUDA_LIB}")
     list(APPEND Caffe2_LINKER_LIBS ${CUDA_CUDA_LIB})
+else()
+    message(FATAL_ERROR "Cannot find libcuda.so. Please file an issue on https://github.com/caffe2/caffe2 with your build output.")
 endif()
 if(CUDA_NVRTC_LIB)
   message(STATUS "Found libnvrtc: ${CUDA_NVRTC_LIB}")
   list(APPEND Caffe2_LINKER_LIBS ${CUDA_NVRTC_LIB})
+else()
+    message(FATAL_ERROR "Cannot find libnvrtc.so. Please file an issue on https://github.com/caffe2/caffe2 with your build output.")
 endif()

 # disable some nvcc diagnostic that apears in boost, glog, glags, opencv, etc.


fixed warning message for glut on stampede

--- cmake/glut.cmake
+++ cmake/glut.cmake
@@ -22,7 +22,7 @@
 		IF (${GLUT_LIBRARY} STREQUAL "GLUT_LIBRARY-NOTFOUND")
 			MESSAGE("-- Could not find GLUT library, even after trying additional search dirs")
 		ELSE()
-			@MESSAGE("-- Extended search *DID* find GLUT library in ${GLUT_LIBRARY}")
+			#MESSAGE("-- Extended search *DID* find GLUT library in ${GLUT_LIBRARY}")
 			SET(GLUT_FOUND ON)
 		ENDIF()
 	ENDIF()


fix cmake MESSAGE_ONCE macro for multi-line messages

--- cmake/misc.cmake
+++ cmake/misc.cmake
@@ -1,6 +1,13 @@
-FUNCTION(MESSAGE_ONCE id out)
-  IF(NOT __msg1_${id} STREQUAL "${out}")
+IF ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.7")
+  FUNCTION(MESSAGE_ONCE id out)
     MESSAGE(STATUS "${out}")
-  ENDIF()
-  SET(__msg1_${id} "${out}" CACHE INTERNAL "")
-ENDFUNCTION()
+  ENDFUNCTION()
+ELSE()
+  FUNCTION(MESSAGE_ONCE id out)
+    STRING(MD5 hash "${out}")
+    IF(NOT __msg1_${id} STREQUAL "${hash}")
+      MESSAGE(STATUS "${out}")
+    ENDIF()
+    SET(__msg1_${id} ${hash} CACHE INTERNAL "")
+  ENDFUNCTION()
+ENDIF()


Uncomment broken/unnecessary SDGenerator tests

--- source/TEST/cmake/BALLTestExecutables.cmake
+++ source/TEST/cmake/BALLTestExecutables.cmake
@@ -234,9 +234,9 @@
 	UCK_test
 	BuildBondsProcessor_test
 	DockResult_test
-	MoleculeAssembler_test
-	SDGenerator_test
-	RingAnalyser_test
+#	MoleculeAssembler_test
+#	SDGenerator_test
+#	RingAnalyser_test
 	ResidueRotamerSet_test
 	RotamerLibrary_test
 )


Fix boost finding to work on OSX 10.6

Fix boost finding to work on OSX 10.6

--- build/modules/FindBoost.cmake
+++ build/modules/FindBoost.cmake
@@ -438,12 +438,14 @@
         )
       STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.[0-9]" "\\1\\2"
         _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
+      SET(_other_boost_COMPILER xxxdoesnotexistxx)
       IF(APPLE)
         IF(Boost_MINOR_VERSION)
           IF(${Boost_MINOR_VERSION} GREATER 35)
             # In Boost 1.36.0 and newer, the mangled compiler name used
             # on Mac OS X/Darwin is "xgcc".
             SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
+            SET(_other_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
           ELSE(${Boost_MINOR_VERSION} GREATER 35)
             # In Boost <= 1.35.0, there is no mangled compiler name for
             # the Mac OS X/Darwin version of GCC.
@@ -499,6 +501,8 @@
     FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
         NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
+	       ${Boost_LIB_PREFIX}boost_${COMPONENT}${_other_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
+               ${Boost_LIB_PREFIX}boost_${COMPONENT}${_other_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}
@@ -509,6 +513,8 @@
     FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
         NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
+               ${Boost_LIB_PREFIX}boost_${COMPONENT}${_other_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
+               ${Boost_LIB_PREFIX}boost_${COMPONENT}${_other_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}
@@ -519,6 +525,8 @@
       FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
           NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
+                 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_other_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
+                 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_other_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}
@@ -529,6 +537,8 @@
       FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
           NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
+                 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_other_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
+                 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_other_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}


Check if gstreamer-gl-1.0 libraries and headers exist and if
do, define HAVE_GST_GL_LIBS macro.

Signed-off-by: Gopal, Puunithaaraj <10308ab826b56f8bbce1ec0c10bd609cace363da@intel.com>

--- cmake/FindBaseDependencies.cmake
+++ cmake/FindBaseDependencies.cmake
@@ -25,7 +25,7 @@
   pkg_check_modules (GSTREAMER            REQUIRED gstreamer-1.0>=1.4)
   pkg_check_modules (GSTREAMER_VIDEO      REQUIRED gstreamer-video-1.0>=1.4)
   pkg_check_modules (GSTREAMER_ALLOCATORS REQUIRED gstreamer-allocators-1.0)
-
+  pkg_check_modules (GSTREAMER_GL	  gstreamer-gl-1.0)
   set(GST_LIBS "")
   if(GSTREAMER_FOUND)
     list(APPEND GST_LIBS ${GSTREAMER_LIBRARIES})
@@ -40,6 +40,12 @@
   if(GSTREAMER_ALLOCATORS_FOUND)
     list(APPEND GST_LIBS ${GSTREAMER_ALLOCATORS_LIBRARIES})
     include_directories (${GSTREAMER_ALLOCATORS_INCLUDE_DIRS})
+  endif()
+
+  if(GSTREAMER_GL_FOUND)
+    list(APPEND GST_LIBS ${GSTREAMER_GL_LIBRARIES})
+    include_directories (${GSTREAMER_GL_INCLUDE_LIBRARIES})
+    add_definitions(-DHAVE_GST_GL_LIBS)
   endif()
   set(${libs} ${GST_LIBS} PARENT_SCOPE)
 endfunction(FindGstreamer)


make sure the directory for symlink exists

--- cmake/Modules/LibAddMacros.cmake
+++ cmake/Modules/LibAddMacros.cmake
@@ -27,7 +27,17 @@

 	install(CODE "
 		message (STATUS \"Installing symlink: \$ENV{DESTDIR}${LIB_INSTALL_DIR}/${dest} -> ${src}\")
-		execute_process (COMMAND ln -f -s \"${src}\" \"\$ENV{DESTDIR}${LIB_INSTALL_DIR}/${dest}\"
+		execute_process (COMMAND \"${CMAKE_COMMAND}\" -E make_directory
+			\"\$ENV{DESTDIR}${LIB_INSTALL_DIR}\"
+			RESULT_VARIABLE RET
+			)
+		if (RET)
+			message (WARNING \"Could not create directory\")
+		endif ()
+		execute_process (COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
+			\"${src}\"
+			\"${dest}\"
+			WORKING_DIRECTORY \"\$ENV{DESTDIR}${LIB_INSTALL_DIR}\"
 			RESULT_VARIABLE RET
 			)
 		if (RET)


add readme_* to dependencies

add readme_* to dependencies

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -56,6 +56,8 @@
 	add_headers(ARG_SOURCES)
 	add_library (${PLUGIN_OBJS} OBJECT ${ARG_SOURCES})

+	add_dependencies(${PLUGIN_OBJS} readme_${PLUGIN_SHORT_NAME}.c)
+
 	#message ("generate readme for ${PLUGIN_SHORT_NAME}")
 	generate_readme (${PLUGIN_SHORT_NAME})


fix for CMake on experimental.zorba-xquery.com

--- cmake_modules/FindGraphviz.cmake
+++ cmake_modules/FindGraphviz.cmake
@@ -25,57 +25,66 @@

 IF(GRAPHVIZ_LIBRARY)
-GET_FILENAME_COMPONENT(GRAPHVIZ_LIBRARY_DIR_ ${GRAPHVIZ_LIBRARY} PATH)
-
-FIND_LIBRARY(
-  GVC_LIBRARY
-  NAMES gvc
-  PATHS ${GRAPHVIZ_LIBRARY_DIR_} ${GVC_LIBRARY_DIR})
-
-FIND_LIBRARY(
-  CDT_LIBRARY
-  NAMES cdt
-  PATHS ${GRAPHVIZ_LIBRARY_DIR_} ${CDT_LIBRARY_DIR})
-
-FIND_LIBRARY(
-  PATHPLAN_LIBRARY
-  NAMES pathplan
-  PATHS ${GRAPHVIZ_LIBRARY_DIR_} ${PATHPLAN_LIBRARY_DIR})
-
-# for expat and libz and xdot, we have to make sure that we use the library that is used by gvc
-GET_FILENAME_COMPONENT(GVC_DIR ${GVC_LIBRARY} PATH)
-FIND_LIBRARY(
-  Z_LIBRARY
-  NAMES z
-  HINTS ${GVC_DIR})
-
-FIND_LIBRARY(
-  EXPAT_LIBRARY
-  NAMES expat
-  HINTS ${GVC_DIR})
-
-# On Mac, libgvc has a dependency to libxdot. Therefore, the library is search here to enable the install command in coreSDK/OSX.cmake
-FIND_LIBRARY(
-  XDOT_LIBRARY
-  NAMES xdot
-  HINTS ${GVC_DIR})
-
+  GET_FILENAME_COMPONENT(GRAPHVIZ_LIBRARY_DIR_ ${GRAPHVIZ_LIBRARY} PATH)
+
+  FIND_LIBRARY(
+    GVC_LIBRARY
+    NAMES gvc
+    PATHS ${GRAPHVIZ_LIBRARY_DIR_} ${GVC_LIBRARY_DIR})
+
+  FIND_LIBRARY(
+    CDT_LIBRARY
+    NAMES cdt
+    PATHS ${GRAPHVIZ_LIBRARY_DIR_} ${CDT_LIBRARY_DIR})
+
+  FIND_LIBRARY(
+    PATHPLAN_LIBRARY
+    NAMES pathplan
+    PATHS ${GRAPHVIZ_LIBRARY_DIR_} ${PATHPLAN_LIBRARY_DIR})
+
+  # for expat and libz and xdot, we have to make sure that we use the library that is used by gvc
+  GET_FILENAME_COMPONENT(GVC_DIR ${GVC_LIBRARY} PATH)
+  FIND_LIBRARY(
+    Z_LIBRARY
+    NAMES z
+    HINTS ${GVC_DIR})
+
+  FIND_LIBRARY(
+    EXPAT_LIBRARY
+    NAMES expat
+    HINTS ${GVC_DIR})
+
+  # On Mac, libgvc has a dependency to libxdot. Therefore, the library is search here to enable the install command in coreSDK/OSX.cmake
+  FIND_LIBRARY(
+    XDOT_LIBRARY
+    NAMES xdot
+    HINTS ${GVC_DIR})
+
 ENDIF(GRAPHVIZ_LIBRARY)

-IF (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY AND (EXPAT_LIBRARY OR WIN32) AND (Z_LIBRARY OR WIN32))
+IF (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY)
    SET(GRAPHVIZ_FOUND TRUE)
    SET(GRAPHVIZ_LIBRARIES "${GRAPHVIZ_LIBRARY}" "${GVC_LIBRARY}" "${CDT_LIBRARY}" "${PATHPLAN_LIBRARY}")
-   IF(EXPAT_LIBRARY)
-     LIST(APPEND GRAPHVIZ_LIBRARIES "${EXPAT_LIBRARY}")
-   ENDIF(EXPAT_LIBRARY)
    IF(Z_LIBRARY)
-     LIST(APPEND GRAPHVIZ_LIBRARIES "${Z_LIBRARY}")
    ENDIF(Z_LIBRARY)

    SET(GRAPHVIZ_INCLUDE_DIRS "${GRAPHVIZ_INCLUDE}")
-ELSE (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY AND (EXPAT_LIBRARY OR WIN32) AND (Z_LIBRARY OR WIN32))
+ELSE (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY)
    SET(GRAPHVIZ_FOUND FALSE)
-ENDIF (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY AND (EXPAT_LIBRARY OR WIN32) AND (Z_LIBRARY OR WIN32))
+ENDIF (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY)
+
+IF (GRAPHVIZ_FOUND)
+  IF (EXPAT_LIBRARY OR WIN32)
+    LIST(APPEND GRAPHVIZ_LIBRARIES "${EXPAT_LIBRARY}")
+  ELSE (EXPAT_LIBRARY OR WIN32)
+    SET(GRAPHVIZ_FOUND FALSE)
+  ENDIF (EXPAT_LIBRARY OR WIN32)
+  IF (EXPAT_LIBRARY OR WIN32)
+     LIST(APPEND GRAPHVIZ_LIBRARIES "${Z_LIBRARY}")
+  ELSE (EXPAT_LIBRARY OR WIN32)
+    SET(GRAPHVIZ_FOUND FALSE)
+  ENDIF (EXPAT_LIBRARY OR WIN32)
+ENDIF (GRAPHVIZ_FOUND)

 IF(GRAPHVIZ_FOUND)
   IF(NOT GRAPHVIZ_FIND_QUIETLY)


Increment to version 0.3.4

Increment to version 0.3.4

--- conf/LiboroVersion.cmake
+++ conf/LiboroVersion.cmake
@@ -4,4 +4,4 @@

 SET(CPACK_PACKAGE_VERSION_MAJOR "0")
 SET(CPACK_PACKAGE_VERSION_MINOR "3")
-SET(CPACK_PACKAGE_VERSION_PATCH "2")
+SET(CPACK_PACKAGE_VERSION_PATCH "4")


use ament_target_dependencies()

use ament_target_dependencies()

--- cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake
+++ cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake
@@ -49,18 +49,15 @@
 target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
   PUBLIC
   ${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_cpp
-  ${rosidl_generator_cpp_INCLUDE_DIRS}
 )
-target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix}
-  ${rosidl_typesupport_introspection_cpp_LIBRARIES})
 foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
-  target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
-    PUBLIC
-    ${${_pkg_name}_INCLUDE_DIRS}
-  )
-  target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix}
-    ${${_pkg_name}_LIBRARIES})
+  ament_target_dependencies(
+    ${rosidl_generate_interfaces_TARGET}${_target_suffix}
+    ${_pkg_name})
 endforeach()
+ament_target_dependencies(${rosidl_generate_interfaces_TARGET}${_target_suffix}
+  "rosidl_generator_cpp"
+  "rosidl_typesupport_introspection_cpp")

 add_dependencies(
   ${rosidl_generate_interfaces_TARGET}


Coverage script now updates CMAKE_CONFIGURATION_TYPES

--- cmake/Coverage.cmake
+++ cmake/Coverage.cmake
@@ -1,14 +1,9 @@
 #
 # CMake module that detects if the compilers support coverage
 #
-# If this is the case, the build type Coverage is set up for coverage, and COVERAGE_SUPPORTED is set to true
-# Typical usage is the following :
-#
-#    include(Coverage)
-#    if(COVERAGE_SUPPORTED AND CMAKE_CONFIGURATION_TYPES)
-#       # Modify this only if using a multi-config generator, some modules rely on this variable to detect those generators.
-#		list(APPEND CMAKE_CONFIGURATION_TYPES Coverage)
-#    endif()
+# If this is the case, the build type Coverage is set up for coverage, and COVERAGE_SUPPORTED is set to true.
+# By default the Coverage build type is added to CMAKE_CONFIGURATION_TYPES on multi-config generators.
+# This can be controlled through the COVERAGE_IN_CONFIGURATION_TYPES option.
 #

 # License:
@@ -35,13 +30,13 @@
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.

+include(CMakeDependentOption)
+
 set(COVERAGE_COMPILER_FLAGS  "-g -O0 --coverage" CACHE INTERNAL "")
 set(COVERAGE_LINKER_FLAGS    "--coverage"        CACHE INTERNAL "")

-
 get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)

-#message(STATUS "Checking coverage support for ${ENABLED_LANGUAGES}")
 foreach(_LANG IN LISTS ENABLED_LANGUAGES)
 	include(Check${_LANG}CompilerFlag OPTIONAL)
 	set(CMAKE_REQUIRED_LIBRARIES ${COVERAGE_LINKER_FLAGS}) # This is ugly, but better than rewriting/fixing check_<LANG>_compiler_flag
@@ -78,6 +73,38 @@
 	)
 	mark_as_advanced(
 		CMAKE_EXE_LINKER_FLAGS_COVERAGE
-		CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+		CMAKE_SHARED_LINKER_FLAGS_COVERAGE
 	)
+endif()
+
+
+cmake_dependent_option(COVERAGE_IN_CONFIGURATION_TYPES
+    "Should the Coverage target be in the CMAKE_CONFIGURATION_TYPES list if supported ?" ON
+    "CMAKE_CONFIGURATION_TYPES;COVERAGE_SUPPORTED" OFF # No need for this option if we are not using a multi-config generator
+)
+
+if(COVERAGE_IN_CONFIGURATION_TYPES)
+	# Modify this only if using a multi-config generator, some modules rely on this variable to detect those generators.
+	if(CMAKE_CONFIGURATION_TYPES AND COVERAGE_SUPPORTED)
+		list(APPEND CMAKE_CONFIGURATION_TYPES Coverage)
+		list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
+		set(CMAKE_CONFIGURATION_TYPES
+			"${CMAKE_CONFIGURATION_TYPES}"
+			CACHE STRING
+			"Semicolon separated list of supported configuration types, only supports ${CMAKE_CONFIGURATION_TYPES} anything else will be ignored."
+			FORCE
+		)
+	endif()
+else()
+	if(Coverage IN_LIST CMAKE_CONFIGURATION_TYPES)
+		message(STATUS "Removing Coverage configuration type (COVERAGE_IN_CONFIGURATION_TYPES is OFF)")
+		list(REMOVE_ITEM CMAKE_CONFIGURATION_TYPES Coverage)
+		list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
+		set(CMAKE_CONFIGURATION_TYPES
+			"${CMAKE_CONFIGURATION_TYPES}"
+			CACHE STRING
+			"Semicolon separated list of supported configuration types, only supports ${CMAKE_CONFIGURATION_TYPES} anything else will be ignored."
+			FORCE
+		)
+	endif()
 endif()


Bugfix in FindGcov.cmake.

Bugfix in FindGcov.cmake.

--- cmake/FindGcov.cmake
+++ cmake/FindGcov.cmake
@@ -51,6 +51,7 @@
 				# set additional parameters
 				set(GCOV_${CMAKE_${LANG}_COMPILER_ID}_PARAMS "gcov" CACHE
 					STRING "Additional parameters for llvm-cov.")
+				mark_as_advanced(GCOV_${CMAKE_${LANG}_COMPILER_ID}_PARAMS)
 			endif ()
 		endif ()

@@ -59,12 +60,13 @@
 			set(GCOV_${CMAKE_${LANG}_COMPILER_ID}_BIN "${GCOV_BIN}" CACHE STRING
 				"${LANG} gcov binary.")
 			mark_as_advanced(GCOV_${CMAKE_${LANG}_COMPILER_ID}_BIN)
-			unset(GCOV_BIN)

 			if (NOT CMAKE_REQUIRED_QUIET)
 				message("-- Found gcov evaluation for "
 				"${CMAKE_${LANG}_COMPILER_ID}: ${GCOV_BIN}")
 			endif()
+
+			unset(GCOV_BIN CACHE)
 		endif ()
 	endif ()
 endforeach ()


Support Ogre with Boost < 1.50, slight formatting changes to FindOGRE

--- cmake/FindOgre.cmake
+++ cmake/FindOgre.cmake
@@ -6,59 +6,58 @@

 set(ENV_OGRE_HOME $ENV{OGRE_HOME})
 if (ENV_OGRE_HOME)
-  string( REGEX REPLACE "\\\\" "/" ENV_OGRE_HOME ${ENV_OGRE_HOME} )
+    string( REGEX REPLACE "\\\\" "/" ENV_OGRE_HOME ${ENV_OGRE_HOME} )
 endif ()
-
+
 set(ENV_OGRE_SDK $ENV{OGRE_SDK})
 if (ENV_OGRE_SDK)
-  string( REGEX REPLACE "\\\\" "/" ENV_OGRE_SDK ${ENV_OGRE_SDK} )
+    string( REGEX REPLACE "\\\\" "/" ENV_OGRE_SDK ${ENV_OGRE_SDK} )
 endif ()

 set(OGRE_PREFIX_PATH
-  ${OGRE_HOME} ${OGRE_SDK} ${ENV_OGRE_HOME} ${ENV_OGRE_SDK}
+    ${OGRE_HOME} ${OGRE_SDK} ${ENV_OGRE_HOME} ${ENV_OGRE_SDK}
 )

 set(OGRE_PATH_SUFFIXES
-  ${OGRE_PATH_SUFFIXES} include OgreMain/include
+    ${OGRE_PATH_SUFFIXES} include OgreMain/include
 )

 # Find the Ogre include headers.
-find_path(OGRE_H_PATH
-          NAMES Ogre.h
-          PATHS ${OGRE_PREFIX_PATH}
+find_path(OGRE_H_PATH
+          NAMES Ogre.h
+          PATHS ${OGRE_PREFIX_PATH}
           PATH_SUFFIXES ${OGRE_PATH_SUFFIXES} OGRE)

 # Also find the build settings Ogre header.
-find_path(OGRE_H_BUILD_SETTINGS_PATH
-          NAMES OgreBuildSettings.h
-          PATHS ${OGRE_PREFIX_PATH}
+find_path(OGRE_H_BUILD_SETTINGS_PATH
+          NAMES OgreBuildSettings.h
+          PATHS ${OGRE_PREFIX_PATH}
           PATH_SUFFIXES ${OGRE_PATH_SUFFIXES} OGRE)

 # Find the release and debug libraries.
 find_library(OGRE_LIB NAMES OgreMain
-  PATHS ${OGRE_PREFIX_PATH}
-  PATH_SUFFIXES Release lib/Release
+    PATHS ${OGRE_PREFIX_PATH}
+    PATH_SUFFIXES Release lib/Release
 )
 find_library(OGRE_LIB_DBG NAMES OgreMain_d
-  PATHS ${OGRE_PREFIX_PATH}
-  PATH_SUFFIXES Debug lib/Debug
+    PATHS ${OGRE_PREFIX_PATH}
+    PATH_SUFFIXES Debug lib/Debug
 )
 mark_as_advanced(OGRE_H_PATH OGRE_H_BUILD_SETTINGS_PATH OGRE_LIB OGRE_LIB_DBG)

 # If the Ogre build settings file was found, parse it to identify the Ogre Thread provider.
 # Basically test to see whether ${OGRE_H_BUILD_SETTINGS_PATH} is not OGRE_H_BUILD_SETTINGS_PATH-NOTFOUND
 if (OGRE_H_BUILD_SETTINGS_PATH)
-  DETERMINE_OGRE_THREAD_PROVIDER(OGRE_THREAD_PROVIDER ${OGRE_H_BUILD_SETTINGS_PATH}/OgreBuildSettings.h)
+    determine_ogre_thread_provider(OGRE_THREAD_PROVIDER ${OGRE_H_BUILD_SETTINGS_PATH}/OgreBuildSettings.h)
 endif ()

 find_package_handle_standard_args(OGRE DEFAULT_MSG OGRE_LIB OGRE_H_PATH OGRE_H_BUILD_SETTINGS_PATH)

 # set up output vars
 if (OGRE_FOUND)
-
     # Set-up the directory (actually: list of directories that should be added to the inclusion list).
     set (OGRE_INCLUDE_DIR ${OGRE_H_PATH};${OGRE_H_BUILD_SETTINGS_PATH})
-
+
     # Set-up the list of directories for the OGRE libraries to link against in the Ogre related components.
     set (OGRE_LIBRARIES ${OGRE_LIB})
     if (OGRE_LIB_DBG)
@@ -67,27 +66,28 @@

     # Ogre was found. If the thread provider is boost, also search for the boost libs.
     if ("${OGRE_THREAD_PROVIDER}" STREQUAL "1")
-      # find_package(Boost 1.51 COMPONENTS python unit_test_framework system thread date_time chrono)
-      set(Boost_USE_STATIC_LIBS        ON)
-      set(Boost_USE_MULTITHREADED      ON)
-      set(Boost_USE_STATIC_RUNTIME    OFF)
-      find_package(Boost COMPONENTS thread QUIET)
-      find_package(Boost COMPONENTS system QUIET)
-      find_package(Boost COMPONENTS date_time QUIET)
-      find_package(Boost COMPONENTS chrono QUIET)
-      find_package_handle_standard_args(OGRE DEFAULT_MSG OGRE_LIB OGRE_H_PATH OGRE_H_BUILD_SETTINGS_PATH)
-
-      # Add the Boost directories
-      set (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR};${Boost_INCLUDE_DIR})
+        if (Boost_VERSION LESS 105000) # boost thread transitionally requires boost system since Boost 1.50
+            find_package(Boost COMPONENTS thread)

-      # Add the Boost libraries.
-      if (OGRE_LIBRARIES)
-          set (OGRE_LIBRARIES ${OGRE_LIBRARIES};${Boost_THREAD_LIBRARY_RELEASE};${Boost_SYSTEM_LIBRARY_RELEASE};${Boost_DATE_TIME_LIBRARY_RELEASE};${Boost_CHRONO_LIBRARY_RELEASE})
-      endif ()
-
-      if (OGRE_LIBRARIES_DBG)
-          set (OGRE_LIBRARIES_DBG ${OGRE_LIBRARIES_DBG};${Boost_THREAD_LIBRARY_DEBUG};${Boost_SYSTEM_LIBRARY_DEBUG};${Boost_DATE_TIME_LIBRARY_DEBUG};${Boost_CHRONO_LIBRARY_DEBUG})
-      endif()
+            set(Boost_SYSTEM_LIBRARY_RELEASE "")
+            set(Boost_SYSTEM_LIBRARY_DEBUG "")
+        else()
+            find_package(Boost COMPONENTS thread system)
+        endif()
+
+        find_package_handle_standard_args(OGRE DEFAULT_MSG OGRE_LIB OGRE_H_PATH OGRE_H_BUILD_SETTINGS_PATH)
+
+        # Add the Boost directories
+        set(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR};${Boost_INCLUDE_DIR})
+
+        # Add the Boost libraries.
+        if (OGRE_LIBRARIES)
+          set (OGRE_LIBRARIES ${OGRE_LIBRARIES};${Boost_THREAD_LIBRARY_RELEASE};${Boost_SYSTEM_LIBRARY_RELEASE})
+        endif()
+
+        if (OGRE_LIBRARIES_DBG)
+          set (OGRE_LIBRARIES_DBG ${OGRE_LIBRARIES_DBG};${Boost_THREAD_LIBRARY_DEBUG};${Boost_SYSTEM_LIBRARY_DEBUG})
+        endif()
     endif()

     file (STRINGS "${OGRE_H_PATH}/OgrePrerequisites.h" _CEGUIOGREVERSIONDEFINES REGEX ".*#define OGRE_VERSION_.*[0-9]+")


Add warning exclusions for compiling Google Protobufs.

--- cmake/SetFlags.cmake
+++ cmake/SetFlags.cmake
@@ -39,6 +39,12 @@
 		set(F_WARN "${F_WARN} -Wno-undefined-reinterpret-cast")
 		set(F_WARN "${F_WARN} -Wno-disabled-macro-expansion")

+		# Needed for Google's protobuf library.
+		set(F_WARN "${F_WARN} -Wno-reserved-id-macro")
+		set(F_WARN "${F_WARN} -Wno-missing-variable-declarations")
+		set(F_WARN "${F_WARN} -Wno-shorten-64-to-32")
+		set(F_WARN "${F_WARN} -Wno-unused-macros")
+
 		set(F_DBG "${F_WARN} -std=c++1y -g -O0 -fno-omit-frame-pointer")
 		set(F_DBG "${F_DBG} -fstack-protector-strong")


disable MSVC noise

disable MSVC noise

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -263,6 +263,9 @@
          AddCompilerFlag("/wd4996") # Disable warning about strdup vs. _strdup
          AddCompilerFlag("/wd4244") # Disable warning "conversion from 'unsigned int' to 'float', possible loss of data"
          AddCompilerFlag("/wd4146") # Disable warning "unary minus operator applied to unsigned type, result still unsigned"
+         AddCompilerFlag("/wd4227") # Disable warning "anachronism used : qualifiers on reference are ignored" (this is about 'restrict' usage on references, stupid MSVC)
+         AddCompilerFlag("/wd4722") # Disable warning "destructor never returns, potential memory leak" (warns about ~_UnitTest_Global_Object which we don't care about)
+         AddCompilerFlag("/wd4748") # Disable warning "/GS can not protect parameters and local variables from local buffer overrun because optimizations are disabled in function" (I don't get it)
          add_definitions(-D_CRT_SECURE_NO_WARNINGS)
       endif()


only report really failing tests as failed

--- cmake/checkgdb.cmake
+++ cmake/checkgdb.cmake
@@ -1,5 +1,6 @@
 execute_process(COMMAND ${EXECUTABLE} ${FILE} ${ARGS} RESULT_VARIABLE RESULT)
-if (RESULT)
+string(TOUPPER "${RESULT}" RESULT)
+if (RESULT MATCHES ".*THE FOLLOWING TESTS FAILED.*")
 	#if (GDB_COMMAND AND GDB_SCRIPT)
 	#	execute_process(COMMAND ${GDB_COMMAND}
 	#		--command=${GDB_SCRIPT}


fptu: re-fix GCC's LTO-toolset finding (add name/suffix combination).

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -169,13 +169,13 @@

     get_filename_component(gcc_dir ${CMAKE_C_COMPILER} DIRECTORY)
     if(NOT CMAKE_GCC_AR)
-      find_program(CMAKE_GCC_AR NAMES gcc${gcc_suffix}-ar PATHS ${gcc_dir} NO_DEFAULT_PATH)
+      find_program(CMAKE_GCC_AR NAMES gcc${gcc_suffix}-ar gcc-ar${gcc_suffix} PATHS ${gcc_dir} NO_DEFAULT_PATH)
     endif()
     if(NOT CMAKE_GCC_NM)
-      find_program(CMAKE_GCC_NM NAMES gcc${gcc_suffix}-nm PATHS ${gcc_dir} NO_DEFAULT_PATH)
+      find_program(CMAKE_GCC_NM NAMES gcc${gcc_suffix}-nm gcc-nm${gcc_suffix} PATHS ${gcc_dir} NO_DEFAULT_PATH)
     endif()
     if(NOT CMAKE_GCC_RANLIB)
-      find_program(CMAKE_GCC_RANLIB NAMES gcc${gcc_suffix}-ranlib PATHS ${gcc_dir} NO_DEFAULT_PATH)
+      find_program(CMAKE_GCC_RANLIB NAMES gcc${gcc_suffix}-ranlib gcc-ranlib${gcc_suffix} PATHS ${gcc_dir} NO_DEFAULT_PATH)
     endif()

     unset(gcc_dir)


Changed dtkBuild so that .lib files go to the lib directory, not the bin one.

*.dlls and *.exe go to bin, *.lib go to the lib directory. CMake takes care of defining .dlls as executables not libraries.

--- cmake/dtkBuild.cmake
+++ cmake/dtkBuild.cmake
@@ -69,7 +69,7 @@
 if(WIN32)
   set(${PROJECT_NAME}_ARCHIVE_OUTPUT_DIRECTORY lib)
   set(${PROJECT_NAME}_RUNTIME_OUTPUT_DIRECTORY bin)
-  set(${PROJECT_NAME}_LIBRARY_OUTPUT_DIRECTORY bin)
+  set(${PROJECT_NAME}_LIBRARY_OUTPUT_DIRECTORY lib)
 else(WIN32)
   set(${PROJECT_NAME}_ARCHIVE_OUTPUT_DIRECTORY lib)
   set(${PROJECT_NAME}_RUNTIME_OUTPUT_DIRECTORY bin)


Fix typos.

Fix typos.

--- cmake/findflex.cmake
+++ cmake/findflex.cmake
@@ -109,10 +109,10 @@

   MACRO(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
     IF(NOT FLEX_${FlexTarget}_OUTPUTS)
-      MESSAGE(SEND_ERROR "Flex target `${FlexTarget}' does not exists.")
+      MESSAGE(SEND_ERROR "Flex target `${FlexTarget}' does not exist.")
     ENDIF(NOT FLEX_${FlexTarget}_OUTPUTS)
     IF(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
-      MESSAGE(SEND_ERROR "Bison target `${BisonTarget}' does not exists.")
+      MESSAGE(SEND_ERROR "Bison target `${BisonTarget}' does not exist.")
     ENDIF(NOT BISON_${BisonTarget}_OUTPUT_HEADER)

     SET_SOURCE_FILES_PROPERTIES(${FLEX_${FlexTarget}_OUTPUTS}


Fix source path when used as a sub-module

Addresses issue #1 where DownloadProject.CMakeLists.cmake.in needs
to have the full path specified so it can be found regardless from where
download_project() is called.

--- DownloadProject.cmake
+++ DownloadProject.cmake
@@ -66,6 +66,8 @@
 #========================================================================================

+set(_DownloadProjectDir "${CMAKE_CURRENT_LIST_DIR}")
+
 include(CMakeParseArguments)

 function(download_project)
@@ -106,7 +108,8 @@
     # Create and build a separate CMake project to carry out the download.
     # If we've already previously done these steps, they will not cause
     # anything to be updated, so extra rebuilds of the project won't occur.
-    configure_file(DownloadProject.CMakeLists.cmake.in ${DL_ARGS_PROJ}-download/CMakeLists.txt)
+    configure_file("${_DownloadProjectDir}/DownloadProject.CMakeLists.cmake.in"
+                   ${DL_ARGS_PROJ}-download/CMakeLists.txt)
     execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
                     ${OUTPUT_QUIET}
                     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${DL_ARGS_PROJ}-download"


pw_build/cmake: Deprecates IMPLEMENTS_FACADE(S)

Deprecates the IMPLEMENTS_FACADES argument of pw_add_module_library
and IMPLEMENTS_FACADE argument of pw_pw_auto_add_simple_module
with the intent of being more consistent with GN and Bazel and more
explicit on what the build rules do.

Change-Id: Ifc7888a05ddfebe155835a6f32942c7363a1caef
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117475
Commit-Queue: Auto-Submit <14637eda5603879df170705285bf30f5996692f0@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -76,6 +76,9 @@
   endforeach()
 endmacro()

+# This method is deprecated, please use pw_add_module_library, pw_add_facade,
+# and pw_add_test.
+#
 # Automatically creates a library and test targets for the files in a module.
 # This function is only suitable for simple modules that meet the following
 # requirements:
@@ -86,7 +89,7 @@
 #    - exactly one source .cc file,
 #    - optionally, one .c source with the same base name as the .cc file,
 #    - only a dependency on the main module library.
-#  - The module is not a facade.
+#  - The module is not a facade and does not implement facades.
 #
 # Modules that do not meet these requirements may not use
 # pw_auto_add_simple_module. Instead, define the module's libraries and tests
@@ -102,14 +105,13 @@
 #
 # Args:
 #
-#   IMPLEMENTS_FACADE - this module implements the specified facade
 #   PUBLIC_DEPS - public pw_target_link_targets arguments
 #   PRIVATE_DEPS - private pw_target_link_targets arguments
 #
 function(pw_auto_add_simple_module MODULE)
   pw_parse_arguments_strict(pw_auto_add_simple_module 1
       ""
-      "IMPLEMENTS_FACADE"
+      ""
       "PUBLIC_DEPS;PRIVATE_DEPS;TEST_DEPS"
   )

@@ -123,15 +125,7 @@

   file(GLOB_RECURSE headers *.h)

-  if(arg_IMPLEMENTS_FACADE)
-    set(groups backends)
-  else()
-    set(groups modules "${MODULE}")
-  endif()
-
   pw_add_module_library("${MODULE}"
-    IMPLEMENTS_FACADES
-      ${arg_IMPLEMENTS_FACADE}
     PUBLIC_DEPS
       ${arg_PUBLIC_DEPS}
     PRIVATE_DEPS
@@ -148,7 +142,8 @@
       ${arg_PRIVATE_DEPS}
       ${arg_TEST_DEPS}
     GROUPS
-      ${groups}
+      modules
+      "${MODULE}"
   )
 endfunction(pw_auto_add_simple_module)

@@ -449,7 +444,6 @@
 #
 # Optional Args:
 #
-#   IMPLEMENTS_FACADES - which facades this module library implements
 #   SOURCES - source files for this library
 #   HEADERS - header files for this library
 #   PUBLIC_DEPS - public pw_target_link_targets arguments
@@ -464,7 +458,7 @@
 #   PRIVATE_LINK_OPTIONS - private target_link_options arguments
 #
 function(pw_add_module_library NAME)
-  _pw_add_library_multi_value_args(multi_value_args IMPLEMENTS_FACADES)
+  _pw_add_library_multi_value_args(multi_value_args)
   pw_parse_arguments_strict(pw_add_module_library 1 "" "" "${multi_value_args}")

   _pw_check_name_is_relative_to_root("${NAME}" "$ENV{PW_ROOT}"
@@ -518,18 +512,6 @@
   if("${arg_PUBLIC_INCLUDES}" STREQUAL "")
     target_include_directories("${NAME}" ${public_or_interface} public)
   endif("${arg_PUBLIC_INCLUDES}" STREQUAL "")
-
-  if(NOT "${arg_IMPLEMENTS_FACADES}" STREQUAL "")
-    # TODO(b/235273746): Deprecate this legacy implicit PUBLIC_INCLUDES.
-    if("${arg_PUBLIC_INCLUDES}" STREQUAL "")
-      target_include_directories(
-        "${NAME}" ${public_or_interface} public_overrides)
-    endif("${arg_PUBLIC_INCLUDES}" STREQUAL "")
-
-    set(facades ${arg_IMPLEMENTS_FACADES})
-    list(TRANSFORM facades APPEND ".facade")
-    pw_target_link_targets("${NAME}" ${public_or_interface} ${facades})
-  endif(NOT "${arg_IMPLEMENTS_FACADES}" STREQUAL "")
 endfunction(pw_add_module_library)

 # Declares a module as a facade.
@@ -539,8 +521,8 @@
 # module that implements the facade depends on a library named
 # MODULE_NAME.facade.
 #
-# pw_add_module_facade accepts the same arguments as pw_add_module_library,
-# except for IMPLEMENTS_FACADES. It also requires the following argument:
+# pw_add_module_facade accepts the same arguments as pw_add_module_library.
+# It also accepts the following argument:
 #
 #  BACKEND - The name of the facade's backend variable.
 function(pw_add_module_facade NAME)


fixing FindQhull on Windows

fixing FindQhull on Windows

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@765 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindQhull.cmake
+++ cmake/Modules/FindQhull.cmake
@@ -10,7 +10,7 @@
 set(QHULL_MAJOR_VERSION 6)

 find_path(QHULL_INCLUDE_DIR
-		  NAMES libqhull.h qhull.h
+		  NAMES libqhull/libqhull.h qhull.h
           HINTS ${QHULL_ROOT} "$ENV{PROGRAMFILES}/qhull 6.2.0.1373/include"
           PATH_SUFFIXES qhull src/libqhull libqhull)


Comment out errors in PrecompiledHeader.cmake

--- cmake/PrecompiledHeader.cmake
+++ cmake/PrecompiledHeader.cmake
@@ -80,10 +80,10 @@

   get_filename_component(_input_we ${_input} NAME_WE)
   if(NOT _PCH_SOURCE_CXX)
-    set(_PCH_SOURCE_CXX "aperture/${_input_we}.cpp")
+    set(_PCH_SOURCE_CXX "${_input_we}.cpp")
   endif()
   if(NOT _PCH_SOURCE_C)
-    set(_PCH_SOURCE_C "aperture/${_input_we}.c")
+    set(_PCH_SOURCE_C "${_input_we}.c")
   endif()

   if(MSVC)
@@ -146,12 +146,12 @@
       endif()
     endforeach()

-    if(_pch_source_cxx_needed AND NOT _pch_source_cxx_found)
-      message(FATAL_ERROR "A source file ${_PCH_SOURCE_CXX} for ${_input} is required for MSVC builds. Can be set with the SOURCE_CXX option.")
-    endif()
-    if(_pch_source_c_needed AND NOT _pch_source_c_found)
-      message(FATAL_ERROR "A source file ${_PCH_SOURCE_C} for ${_input} is required for MSVC builds. Can be set with the SOURCE_C option.")
-    endif()
+#    if(_pch_source_cxx_needed AND NOT _pch_source_cxx_found)
+#      message(FATAL_ERROR "A source file ${_PCH_SOURCE_CXX} for ${_input} is required for MSVC builds. Can be set with the SOURCE_CXX option.")
+#    endif()
+#    if(_pch_source_c_needed AND NOT _pch_source_c_found)
+#      message(FATAL_ERROR "A source file ${_PCH_SOURCE_C} for ${_input} is required for MSVC builds. Can be set with the SOURCE_C option.")
+#    endif()
   endif(MSVC)

   if(CMAKE_COMPILER_IS_GNUCXX)


cmake: update musl bundle

cmake: update musl bundle

--- cmake/cross_compiled_libraries.cmake
+++ cmake/cross_compiled_libraries.cmake
@@ -18,8 +18,8 @@
 	include(ExternalProject)
 	ExternalProject_Add(PrecompiledLibraries
 			    PREFIX precompiled
-			    URL https://github.com/hioa-cs/IncludeOS/releases/download/v0.12.0-rc.2/IncludeOS_dependencies_v0-12-0_musl_libunwind_threaded.tar.gz
-			    URL_HASH SHA1=5a9daff15ed7b0fcd2a96f3c07ebef5aabf93371
+			    URL https://github.com/hioa-cs/IncludeOS/releases/download/v0.12.0-rc.2/IncludeOS_dependencies_v0-12-0_musl_libunwind_singlethreaded.tar.gz
+			    URL_HASH SHA1=febb731b35130431871d46476ce673781e9ce8db
 			    CONFIGURE_COMMAND ""
 			    BUILD_COMMAND ""
 			    UPDATE_COMMAND ""


Update nnp git URL and branch (#705)

Update nnp git URL and branch (#705)

* update nnp transformer path

--- cmake/external_nnp_transformer.cmake
+++ cmake/external_nnp_transformer.cmake
@@ -33,7 +33,7 @@
     if (DEFINED CUSTOM_NNP_TRANSFORMER_GIT_REPOSITORY)
         set(NNP_TRANSFORMER_GIT_REPOSITORY ${CUSTOM_NNP_TRANSFORMER_GIT_REPOSITORY})
     else()
-        set(NNP_TRANSFORMER_GIT_REPOSITORY git@github.com:NervanaSystems/argon-transformer.git)
+        set(NNP_TRANSFORMER_GIT_REPOSITORY https://github.com/NervanaSystems/nnp-transformer.git)
     endif()

     # Set nnp_transformer tag
@@ -44,7 +44,7 @@
     #   commit.
     # - After we have ngraph CI job for nnp transformer, ngraph master will be compatible with
     #   nnp transformer guaranteed by CI.
-    set(NNP_TRANSFORMER_GIT_TAG cpp-master)
+    set(NNP_TRANSFORMER_GIT_TAG master)

     # Determines where nnp-transformer will be located
     set(NNP_TRANSFORMER_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/nnp_transformer)


added frameworks support to crypto.prf

added frameworks support to crypto.prf

--- crypto.prf.cmake
+++ crypto.prf.cmake
@@ -2,12 +2,25 @@
 QCA_LIBDIR = @CRYPTO_PRF_RELATIVE_PATH@@QCA_LIBRARY_INSTALL_DIR@

 CONFIG *= qt
-INCLUDEPATH += $$QCA_INCDIR/QtCrypto
-LIBS += -L$$QCA_LIBDIR

-LINKAGE = -l@QCA_LIB_NAME@
-CONFIG(debug, debug|release) {
-	windows:LINKAGE = -l@QCA_LIB_NAME@d
-	mac:LINKAGE = -l@QCA_LIB_NAME@_debug
+LINKAGE =
+
+exists($$QCA_LIBDIR/qca.framework) {
+	QMAKE_CXXFLAGS += -F$$QCA_LIBDIR
+	LIBS *= -F$$QCA_LIBDIR
+	INCLUDEPATH += $$QCA_LIBDIR/qca.framework/Headers
+	LINKAGE = -framework qca
 }
+
+# else, link normally
+isEmpty(LINKAGE) {
+	INCLUDEPATH += $$QCA_INCDIR/QtCrypto
+	LIBS += -L$$QCA_LIBDIR
+	LINKAGE = -lqca
+	CONFIG(debug, debug|release) {
+		windows:LINKAGE = -lqcad
+		mac:LINKAGE = -lqca_debug
+	}
+}
+
 LIBS += $$LINKAGE


[FIX] remove double-include of seqan cmake module

--- util/cmake/SeqAnSimdUtility.cmake
+++ util/cmake/SeqAnSimdUtility.cmake
@@ -88,7 +88,6 @@
 #         (e.g. sse4, avx2, avx512_knl, avx512_skx, avx512_cnl)
 #

-find_package (SeqAn CONFIG REQUIRED)
 find_package (SDE)
 find_package (Umesimd)


r9259/sofa : FIX: SofaPreconditioner does not include csparse directories twice anymore

Former-commit-id: 3cd65891bbb086c5f84387bc0959acdc0f903164

--- modules/sofa/component/SofaPreconditioner.cmake
+++ modules/sofa/component/SofaPreconditioner.cmake
@@ -18,7 +18,6 @@
     linearsolver/WarpPreconditioner.inl
     linearsolver/PrecomputedWarpPreconditioner.h
     linearsolver/PrecomputedWarpPreconditioner.inl
-
     )

 set(SOURCE_FILES
@@ -30,11 +29,7 @@
     linearsolver/SSORPreconditioner.cpp
     linearsolver/WarpPreconditioner.cpp
     linearsolver/PrecomputedWarpPreconditioner.cpp
-
     )
-
-
-include_directories("${SOFA_EXTLIBS_DIR}/csparse")

 add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})


Add 'fwrapv' compile option.

Add 'fwrapv' compile option.

--- compileoptions.cmake
+++ compileoptions.cmake
@@ -6,6 +6,10 @@
   add_compile_options(-fms-extensions )
   #-fms-compatibility      Enable full Microsoft Visual C++ compatibility
   #-fms-extensions         Accept some non-standard constructs supported by the Microsoft compiler
+
+  # Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around
+  # using twos-complement representation (this is normally undefined according to the C++ spec).
+  add_compile_options(-fwrapv)

   if(CLR_CMAKE_PLATFORM_DARWIN)
     # We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2)


build: fix PCH stub files generation optimization


FIX (#2203): register logging backend in module testdrivers

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -344,8 +344,13 @@
 IF(BUILD_TESTING)
   INCLUDE(files.cmake)
   INCLUDE_DIRECTORIES(.)
+
+  SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "mitk::LogBackend::Register();")
+  SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN "mitk::LogBackend::Unregister();")
+
   CREATE_TEST_SOURCELIST(MODULETEST_SOURCE ${MODULE_NAME}TestDriver.cpp
     ${MODULE_TESTS} ${MODULE_IMAGE_TESTS} ${MODULE_CUSTOM_TESTS}
+    EXTRA_INCLUDE mitkLog.h
   )
   SET(TESTDRIVER ${MODULE_NAME}TestDriver)
   ADD_EXECUTABLE(${TESTDRIVER} ${MODULETEST_SOURCE})


Removed debugging message.

Removed debugging message.

--- mongodb_store/cmake/FindMongoClient.cmake
+++ mongodb_store/cmake/FindMongoClient.cmake
@@ -60,7 +60,6 @@
   find_package(Boost REQUIRED COMPONENTS system thread program_options filesystem)
   find_package(OpenSSL REQUIRED)
   set(MongoClient_LIBRARIES ${MongoClient_LIBRARIES} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
-  message("MONGOGNGNGNG: " ${MongoClient_LIBRARIES})
 endif(MongoClient_LIBRARIES)

 if(MongoClient_INCLUDE_DIR AND MongoClient_LIBRARIES)


Added a remove_flags macro in cmake.

Added a remove_flags macro in cmake.

Signed-off-by: Étienne Schmitt <25d5031dc1a1d443222aec9a4e916501ae23c255@inria.fr>

--- cmake/utilities.cmake
+++ cmake/utilities.cmake
@@ -7,6 +7,13 @@
 	list(REMOVE_DUPLICATES string)
 	string(REPLACE ";" " " string "${string}")
 	set(${_var} ${string} PARENT_SCOPE)
+endfunction()
+
+function(remove_flags _var)
+    string(REPLACE " " ";" flags "${${_var}}")
+    list(REMOVE_ITEM flags ${ARGN})
+    string(REPLACE ";" " " flags "${flags}")
+    set(${_var} ${flags} PARENT_SCOPE)
 endfunction()

 #!


Remove HAVE_TM_GMTOFF because it is not used

--- config-kopete.h.cmake
+++ config-kopete.h.cmake
@@ -7,9 +7,6 @@

 /* Define to compile with GSM SMS support */
 /* #undef INCLUDE_SMSGSM */
-
-/* Define if you have a tm_gmtoff member in struct tm */
-#define HAVE_TM_GMTOFF 1

 /* Defines if you have GL (Mesa, OpenGL, ...) */
 #define HAVE_GL 1


Add space when print verbose

Add space when print verbose

--- reason.util.cmake
+++ reason.util.cmake
@@ -108,7 +108,7 @@

   list(FIND REASON_EXCLUDE_LINK_DEPENDENCY "${DEP}" DEP_IN_EXCLUDE)
   if("${DEP_IN_EXCLUDE}" STREQUAL "-1")
-    reason_verbose("exclude dependency: [dep=${DEP}"]")
+    reason_verbose("  exclude dependency: [dep=${DEP}]")
     return()
   endif()


botan: Update filename for bundle

botan: Update filename for bundle

--- cmake/botan.cmake
+++ cmake/botan.cmake
@@ -4,7 +4,7 @@
 include(ExternalProject)
 ExternalProject_Add(botan
         PREFIX botan
-        URL https://github.com/includeos/botan/releases/download/inc-2.0/botan-includeos.tar.gz
+        URL https://github.com/includeos/botan/releases/download/inc-2.0/botan-includeos-i686.tar.gz
         URL_HASH MD5=5ef7f26047f8fe17219f62755938621d
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""


Added patch for SOFA to be able to compile on Fedora Core 18.

--- CMakeExternals/PatchSOFA-rev8935.cmake
+++ CMakeExternals/PatchSOFA-rev8935.cmake
@@ -4,4 +4,10 @@
   string(REGEX REPLACE "<(Open)?GL(UT)?/" "<" sourceCode ${sourceCode})
   set(CONTENTS ${sourceCode})
   configure_file(${TEMPLATE_FILE} ${sourceFile} @ONLY)
-endforeach()+endforeach()
+
+set(sourceFile "modules/sofa/component/linearsolver/SSORPreconditioner.inl")
+file(STRINGS ${sourceFile} sourceCode NEWLINE_CONSUME)
+string(REGEX REPLACE "getM" "this->getM" sourceCode ${sourceCode})
+set(CONTENTS ${sourceCode})
+configure_file(${TEMPLATE_FILE} ${sourceFile} @ONLY)


Disable a few more things that we don't need from Qt.

--- projects/qt.cmake
+++ projects/qt.cmake
@@ -43,8 +43,11 @@
                       -no-xinerama
                       -no-scripttools
                       -no-svg
+                      -no-declarative
                       -no-declarative-debug
                       -no-xvideo
+                      -no-script
+                      -no-cups
                       -opensource
                       -qt-libjpeg
                       -qt-libtiff


handle CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -576,6 +576,21 @@
 		set (_linkedTargets "")
 		cotire_get_target_usage_requirements(${_target} _linkedTargets)
 		foreach (_linkedTarget ${_linkedTargets})
+			get_target_property(_linkedTargetType ${_linkedTarget} TYPE)
+			if (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE AND NOT CMAKE_VERSION VERSION_LESS "3.4.0" AND
+				_linkedTargetType MATCHES "(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+				# CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE refers to CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR
+				# at the time, when the target was created. These correspond to the target properties BINARY_DIR and SOURCE_DIR
+				# which are only available with CMake 3.4 or later.
+				get_target_property(_targetDirs ${_linkedTarget} BINARY_DIR)
+				if (_targetDirs)
+					list (APPEND _dirs ${_targetDirs})
+				endif()
+				get_target_property(_targetDirs ${_linkedTarget} SOURCE_DIR)
+				if (_targetDirs)
+					list (APPEND _dirs ${_targetDirs})
+				endif()
+			endif()
 			get_target_property(_targetDirs ${_linkedTarget} INTERFACE_INCLUDE_DIRECTORIES)
 			if (_targetDirs)
 				list (APPEND _dirs ${_targetDirs})


SVN_SILENT made messages (.desktop file) - always resolve ours

In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"

--- src/vlc.desktop.cmake
+++ src/vlc.desktop.cmake
@@ -16,6 +16,7 @@
 Name[de]=VLC
 Name[en_GB]=VLC
 Name[es]=VLC
+Name[eu]=VLC
 Name[fi]=VLC
 Name[fr]=VLC
 Name[gl]=VLC
@@ -42,6 +43,7 @@
 Comment[de]=Phonon-Treiber für VLC
 Comment[en_GB]=Phonon VLC backend
 Comment[es]=Motor VLC para Phonon
+Comment[eu]=Phonon VLC bizkarraldekoa
 Comment[fi]=Phonon VLC -taustajärjestelmä
 Comment[fr]=Module VLC pour Phonon
 Comment[gl]=Infraestrutura de VLC para Phonon


add missing files

add missing files


bedtime

bedtime

--- src/FindGSL.cmake
+++ src/FindGSL.cmake
@@ -1,178 +0,0 @@
-# Try to find gnu scientific library GSL
-# See
-# http://www.gnu.org/software/gsl/  and
-# http://gnuwin32.sourceforge.net/packages/gsl.htm
-#
-# Once run this will define:
-#
-# GSL_FOUND       = system has GSL lib
-#
-# GSL_LIBRARIES   = full path to the libraries
-#    on Unix/Linux with additional linker flags from "gsl-config --libs"
-#
-# CMAKE_GSL_CXX_FLAGS  = Unix compiler flags for GSL, essentially "`gsl-config --cxxflags`"
-#
-# GSL_INCLUDE_DIR      = where to find headers
-#
-# GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix
-# GSL_EXE_LINKER_FLAGS = rpath on Unix
-#
-# Felix Woelk 07/2004
-# Jan Woetzel
-#
-# www.mip.informatik.uni-kiel.de
-# --------------------------------
-
-IF(WIN32)
-# JW tested with gsl-1.8, Windows XP, MSVS 7.1, MSVS 8.0
-SET(GSL_POSSIBLE_ROOT_DIRS
-${GSL_ROOT_DIR}
-$ENV{GSL_ROOT_DIR}
-${GSL_DIR}
-${GSL_HOME}
-$ENV{GSL_DIR}
-$ENV{GSL_HOME}
-$ENV{EXTERN_LIBS_DIR}/gsl
-$ENV{EXTRA}
-# "C:/home/jw/source2/gsl-1.8"
-)
-FIND_PATH(GSL_INCLUDE_DIR
-NAMES gsl/gsl_cdf.h gsl/gsl_randist.h
-PATHS ${GSL_POSSIBLE_ROOT_DIRS}
-PATH_SUFFIXES include
-DOC "GSL header include dir"
-)
-
-FIND_LIBRARY(GSL_GSL_LIBRARY
-NAMES gsl libgsl
-PATHS  ${GSL_POSSIBLE_ROOT_DIRS}
-PATH_SUFFIXES lib
-DOC "GSL library dir" )
-
-FIND_LIBRARY(GSL_GSLCBLAS_LIBRARY
-NAMES gslcblas libgslcblas
-PATHS  ${GSL_POSSIBLE_ROOT_DIRS}
-PATH_SUFFIXES lib
-DOC "GSL cblas library dir" )
-
-SET(GSL_LIBRARIES ${GSL_GSL_LIBRARY})
-
-#MESSAGE("DBG\n"
-#  "GSL_GSL_LIBRARY=${GSL_GSL_LIBRARY}\n"
-#  "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n"
-#  "GSL_LIBRARIES=${GSL_LIBRARIES}")
-
-
-ELSE(WIN32)
-
-IF(UNIX)
-SET(GSL_CONFIG_PREFER_PATH
- "$ENV{GSL_DIR}/bin"
- "$ENV{GSL_DIR}"
- "$ENV{GSL_HOME}/bin"
- "$ENV{GSL_HOME}"
- CACHE STRING "preferred path to GSL (gsl-config)")
-FIND_PROGRAM(GSL_CONFIG gsl-config
- ${GSL_CONFIG_PREFER_PATH}
- /usr/bin/
- )
-# MESSAGE("DBG GSL_CONFIG ${GSL_CONFIG}")
-
-IF (GSL_CONFIG)
-
- MESSAGE(STATUS "GSL using gsl-config ${GSL_CONFIG}")
- # set CXXFLAGS to be fed into CXX_FLAGS by the user:
- EXEC_PROGRAM(${GSL_CONFIG}
-   ARGS --cflags
-   OUTPUT_VARIABLE  GSL_CXX_FLAGS )
- #SET(GSL_CXX_FLAGS "`${GSL_CONFIG} --cflags`")
-
- # set INCLUDE_DIRS to prefix+include
- EXEC_PROGRAM(${GSL_CONFIG}
-   ARGS --prefix
-   OUTPUT_VARIABLE GSL_PREFIX)
- SET(GSL_INCLUDE_DIR ${GSL_PREFIX}/include CACHE STRING INTERNAL)
-
- # set link libraries and link flags
-
- #SET(GSL_LIBRARIES "`${GSL_CONFIG} --libs`")
-
- # extract link dirs for rpath
- EXEC_PROGRAM(${GSL_CONFIG}
-   ARGS --libs
-   OUTPUT_VARIABLE  GSL_CONFIG_LIBS )
- SET(GSL_LIBRARIES "${GSL_CONFIG_LIBS}")
-
- # split off the link dirs (for rpath)
- # use regular expression to match wildcard equivalent "-L*"
- # with  is a space or a semicolon
- STRING(REGEX MATCHALL "[-][L]([^ ;])+"
-   GSL_LINK_DIRECTORIES_WITH_PREFIX
-   "${GSL_CONFIG_LIBS}" )
- #      MESSAGE("DBG  GSL_LINK_DIRECTORIES_WITH_PREFIX=${GSL_LINK_DIRECTORIES_WITH_PREFIX}")
-
- # remove prefix -L because we need the pure directory for LINK_DIRECTORIES
-
- IF (GSL_LINK_DIRECTORIES_WITH_PREFIX)
-   STRING(REGEX REPLACE "[-][L]" "" GSL_LINK_DIRECTORIES ${GSL_LINK_DIRECTORIES_WITH_PREFIX} )
- ENDIF (GSL_LINK_DIRECTORIES_WITH_PREFIX)
- SET(GSL_EXE_LINKER_FLAGS "-Wl,-rpath,${GSL_LINK_DIRECTORIES}" CACHE STRING INTERNAL)
- #      MESSAGE("DBG  GSL_LINK_DIRECTORIES=${GSL_LINK_DIRECTORIES}")
- #      MESSAGE("DBG  GSL_EXE_LINKER_FLAGS=${GSL_EXE_LINKER_FLAGS}")
-
- #      ADD_DEFINITIONS("-DHAVE_GSL")
- #      SET(GSL_DEFINITIONS "-DHAVE_GSL")
- MARK_AS_ADVANCED(
-   GSL_CXX_FLAGS
-   GSL_INCLUDE_DIR
-   GSL_LIBRARIES
-   GSL_LINK_DIRECTORIES
-   GSL_DEFINITIONS
-)
- MESSAGE(STATUS "Using GSL from ${GSL_PREFIX}")
-
-ELSE(GSL_CONFIG)
-
- INCLUDE(UsePkgConfig) #needed for PKGCONFIG(...)
-
- MESSAGE(STATUS "GSL using pkgconfig")
- #      PKGCONFIG(gsl includedir libdir linkflags cflags)
- PKGCONFIG(gsl GSL_INCLUDE_DIR GSL_LINK_DIRECTORIES GSL_LIBRARIES GSL_CXX_FLAGS)
- IF(GSL_INCLUDE_DIR)
-MARK_AS_ADVANCED(
-     GSL_CXX_FLAGS
-     GSL_INCLUDE_DIR
-     GSL_LIBRARIES
-     GSL_LINK_DIRECTORIES
-)
-
- ELSE(GSL_INCLUDE_DIR)
-MESSAGE("FindGSL.cmake: gsl-config/pkg-config gsl not found. Please set it manually. GSL_CONFIG=${GSL_CONFIG}")
- ENDIF(GSL_INCLUDE_DIR)
-
-ENDIF(GSL_CONFIG)
-
-ENDIF(UNIX)
-ENDIF(WIN32)
-
-
-IF(GSL_LIBRARIES)
-IF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS)
-
-SET(GSL_FOUND 1)
-
-ENDIF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS)
-ENDIF(GSL_LIBRARIES)
-
-
-# ==========================================
-IF(NOT GSL_FOUND)
-# make FIND_PACKAGE friendly
-IF(NOT GSL_FIND_QUIETLY)
-IF(GSL_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "GSL required, please specify it's location.")
-ELSE(GSL_FIND_REQUIRED)
- MESSAGE(STATUS       "ERROR: GSL was not found.")
-ENDIF(GSL_FIND_REQUIRED)
-ENDIF(NOT GSL_FIND_QUIETLY)
-ENDIF(NOT GSL_FOUND)


BUG: Change EXTENSION_BUILD_SUBDIRECTORY to .

--- DTIPrepTools.cmake
+++ DTIPrepTools.cmake
@@ -196,7 +196,7 @@
   set(EXTENSION_DESCRIPTION "DTIPrep performs a "Study-specific Protocol" based automatic pipeline for DWI/DTI quality control and preparation")
   set(EXTENSION_ICONURL "https://www.nitrc.org/project/list_screenshots.php?group_id=283&screenshot_id=216")
   set(EXTENSION_DEPENDS "NA") # Specified as a space separated list or 'NA' if any
-  set(EXTENSION_BUILD_SUBDIRECTORY DTIPrep-build/DTIPrepTools-build)
+  set(EXTENSION_BUILD_SUBDIRECTORY ".")

   unsetForSlicer( NAMES SlicerExecutionModel_DIR ITK_DIR VTK_DIR CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS ITK_LIBRARIES )
   find_package(Slicer REQUIRED)


Enable compiler warnings for GCC

Enable compiler warnings for GCC

--- prosoft/core/config/cmake/config_compiler.cmake
+++ prosoft/core/config/cmake/config_compiler.cmake
@@ -71,11 +71,11 @@
         target_compile_options(${TARGET_NAME} PRIVATE "-Wenum-conversion")
     endif()

-    # GCC 5.1 only has -Wint-conversion for C/Obj-C while Clang doesn't complain for C++
-    if(PSCLANG)
+    # GCC complains about -Wint-conversion for C++ while Clang doesn't care.
+    if(${CMAKE_VERSION} VERSION_GREATER 3.2) # COMPILE_LANGUAGE requires 3.3+
         check_c_compiler_flag(-Wint-conversion HAS_INT_CONVERSION_WARNING)
         if(HAS_INT_CONVERSION_WARNING)
-            target_compile_options(${TARGET_NAME} PRIVATE "-Wint-conversion")
+            target_compile_options(${TARGET_NAME} PRIVATE $<$<COMPILE_LANGUAGE:C>:-Wint-conversion>)
         endif()
     endif()

@@ -104,13 +104,11 @@
     endif()

     include(CheckCXXCompilerFlag)
-    if(PSCLANG)
+    if(${CMAKE_VERSION} VERSION_GREATER 3.2) # COMPILE_LANGUAGE requires 3.3+
         # GCC errors when C++ warnings are given for non-C++ sources (C). Clang does not care.
-        # Unfortunately Cmake has no target-level CXX_FLAGS only the global CMAKE_CXX_FLAGS.
-        # We'd have to use regex on the source file list to set the flag for each C++ file -- a pain.
         check_cxx_compiler_flag(-Woverloaded-virtual HAS_OVERLOADED_VIRTUAL_WARNING)
         if(HAS_OVERLOADED_VIRTUAL_WARNING)
-            target_compile_options(${TARGET_NAME} PRIVATE "-Woverloaded-virtual")
+            target_compile_options(${TARGET_NAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>)
         endif()
     endif()
 endmacro()


test: in Base.cmake, check-uptodate is valid only if the deffile does exist

The only case where it does not is in the test suite

--- lib/orogen/templates/config/Base.cmake
+++ lib/orogen/templates/config/Base.cmake
@@ -10,8 +10,10 @@
     COMMENT "oroGen specification file changed. Run make regen first."
     COMMAND /bin/false)

+<% if File.file?(component.deffile) %>
 add_custom_target(check-uptodate ALL
     DEPENDS "${PROJECT_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/<%= File.basename(component.deffile) %>")
+<% end %>

 # In Orogen components, the build target is specified at generation time
 set(OROCOS_TARGET "<%= component.orocos_target %>")


Generate correct alias for pg asyn tests

--- Server/sql/create/set_db_options.cmake
+++ Server/sql/create/set_db_options.cmake
@@ -3,9 +3,9 @@
 build_db_options(LOBBY)

 if(DB_AUTHN_DSN)
-    set(_TEST_DATABASE ${DB_AUTHN_DSN})
+    set(_TEST_DATABASE "main=${DB_AUTHN_DSN}")
 elseif(DB_LOBBY_DSN)
-    set(_TEST_DATABASE ${DB_LOBBY_DSN})
+    set(_TEST_DATABASE "main=${DB_LOBBY_DSN}")
 endif()

 if(_TEST_DATABASE)


Changes by K. Smith (ksmith37@nd.edu) to properly handle include files in ROOT_GENERATE_DICTIONARY() macro See https://root.cern.ch/phpBB3/viewtopic.php?f=3&t=17589

--- etc/cmake/FindROOT.cmake
+++ etc/cmake/FindROOT.cmake
@@ -5,7 +5,9 @@
 # ROOT_INCLUDE_DIR    PATH to the include directory
 # ROOT_LIBRARIES      Most common libraries
 # ROOT_LIBRARY_DIR    PATH to the library directory
-
+#
+# Updated by K. Smith (ksmith37@nd.edu) to properly handle
+#  dependncies in ROOT_GENERATE_DICTIONARY

 find_program(ROOT_CONFIG_EXECUTABLE root-config
   PATHS $ENV{ROOTSYS}/bin)
@@ -38,17 +40,15 @@
   #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lThread -lMinuit -lHtml -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lProof)
   #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lProofPlayer -lMLP -lSpectrum -lEve -lRGL -lGed -lXMLParser -lPhysics)
   set(ROOT_LIBRARY_DIR ${ROOTSYS}/lib)
-
-  # Make variables changeble to the advanced user
-  mark_as_advanced(ROOT_CONFIG_EXECUTABLE)
-
-  if(NOT ROOT_FIND_QUIETLY)
-    message(STATUS "Found ROOT ${ROOT_VERSION} in ${ROOTSYS}")
-  endif()
 endif()

+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ROOT DEFAULT_MSG ROOT_CONFIG_EXECUTABLE
+    ROOTSYS ROOT_VERSION ROOT_INCLUDE_DIR ROOT_LIBRARIES	ROOT_LIBRARY_DIR)

-include(CMakeMacroParseArguments)
+mark_as_advanced(ROOT_CONFIG_EXECUTABLE)
+
+include(CMakeParseArguments)
 find_program(ROOTCINT_EXECUTABLE rootcint PATHS $ENV{ROOTSYS}/bin)
 find_program(GENREFLEX_EXECUTABLE genreflex PATHS $ENV{ROOTSYS}/bin)
 find_package(GCCXML)
@@ -60,6 +60,12 @@
 #                                    OPTIONS opt1...)
 function(ROOT_GENERATE_DICTIONARY dictionary)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "LINKDEF;OPTIONS" "" ${ARGN})
+  #---Get the list of include directories------------------
+  get_directory_property(incdirs INCLUDE_DIRECTORIES)
+  set(includedirs)
+  foreach( d ${incdirs})
+  	set(includedirs ${includedirs} -I${d})
+  endforeach()
   #---Get the list of header files-------------------------
   set(headerfiles)
   foreach(fp ${ARG_UNPARSED_ARGUMENTS})
@@ -67,37 +73,29 @@
     if(files)
       foreach(f ${files})
         if(NOT f MATCHES LinkDef)
-          set(headerfiles ${headerfiles} ${f})
+          find_file(headerFile ${f} PATHS ${incdirs})
+          set(headerfiles ${headerfiles} ${headerFile})
+          unset(headerFile CACHE)
         endif()
       endforeach()
     else()
-      set(headerfiles ${headerfiles} ${fp})
+      find_file(headerFile ${fp} PATHS ${incdirs})
+      set(headerfiles ${headerfiles} ${headerFile})
+      unset(headerFile CACHE)
     endif()
-  endforeach()
-  #---Get the list of include directories------------------
-  get_directory_property(incdirs INCLUDE_DIRECTORIES)
-  set(includedirs)
-  foreach( d ${incdirs})
-   set(includedirs ${includedirs} -I${d})
   endforeach()
   #---Get LinkDef.h file------------------------------------
   set(linkdefs)
   foreach( f ${ARG_LINKDEF})
-    if( IS_ABSOLUTE ${f})
-      set(linkdefs ${linkdefs} ${f})
-    else()
-      if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inc/${f})
-        set(linkdefs ${linkdefs} ${CMAKE_CURRENT_SOURCE_DIR}/inc/${f})
-      else()
-        set(linkdefs ${linkdefs} ${CMAKE_CURRENT_SOURCE_DIR}/${f})
-      endif()
-    endif()
+    find_file(linkFile ${f} PATHS ${incdirs})
+    set(linkdefs ${linkdefs} ${linkFile})
+    unset(linkFile CACHE)
   endforeach()
   #---call rootcint------------------------------------------
   add_custom_command(OUTPUT ${dictionary}.cxx ${dictionary}.h
                      COMMAND ${ROOTCINT_EXECUTABLE} -cint -f  ${dictionary}.cxx
                                           -c ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs}
-                     DEPENDS ${headerfiles} ${linkdefs})
+                     DEPENDS ${headerfiles} ${linkdefs} VERBATIM)
 endfunction()

 #----------------------------------------------------------------------------


Fixed usage of potentially undefined variable.

--- Applications/PluginGenerator/ProjectTemplate/CMakeExternals/MITK.cmake
+++ Applications/PluginGenerator/ProjectTemplate/CMakeExternals/MITK.cmake
@@ -61,7 +61,7 @@
     MITK_USE_Python
    )

-  if(MITK_USE_QT)
+  if(MITK_USE_QT AND NOT DESIRED_QT_VERSION MATCHES "5")
     # Look for Qt at the superbuild level, to catch missing Qt libs early
     find_package(Qt4 4.7 REQUIRED)
   endif()
@@ -209,7 +209,7 @@
     message(FATAL_ERROR "VTK packages do not match:\n   ${MY_PROJECT_NAME}: ${my_vtk_dir}\n  MITK: ${VTK_DIR}")
   endif()

-  if(my_qmake_executable AND NOT my_qmake_executable STREQUAL ${MITK_QMAKE_EXECUTABLE})
+  if(my_qmake_executable AND ${MITK_QMAKE_EXECUTABLE} AND NOT my_qmake_executable STREQUAL ${MITK_QMAKE_EXECUTABLE})
     message(FATAL_ERROR "Qt qmake does not match:\n   ${MY_PROJECT_NAME}: ${my_qmake_executable}\n  MITK: ${MITK_QMAKE_EXECUTABLE}")
   endif()


ENH: CI: PKG: Splitted-out super-build packaging from build.

--- CI/main_superbuild.cmake
+++ CI/main_superbuild.cmake
@@ -205,4 +205,4 @@
 # Artifacts can only be in project dir...
 # file ( COPY "${XDK_PATH}" DESTINATION "${OTB_SOURCE_DIR}/install")

-include ( "${CMAKE_CURRENT_LIST_DIR}/main_packages.cmake" )
+# include ( "${CMAKE_CURRENT_LIST_DIR}/main_packages.cmake" )


ENH: CI: Added debug messages in CI/main_superbuild.cmake.

--- CI/main_superbuild.cmake
+++ CI/main_superbuild.cmake
@@ -79,8 +79,18 @@
 execute_process(
   COMMAND ${CMAKE_COMMAND} "-E" "tar" "xf"
   "${CI_PROJ_DIR}/superbuild-artifact/SuperBuild_Install.tar"
+  RESULT_VARIABLE tar_res
+  OUTPUT_VARIABLE tar_out
+  ERROR_VARIABLE tar_err
   WORKING_DIRECTORY ${CI_ROOT_DIR}
   )
+
+if ( DEBUG )
+  message( "${CMAKE_COMMAND} -E tar xf ${CI_PROJ_DIR}/superbuild-artifact/SuperBuild_Install.tar")
+  message( "tar_res: '${clone_res}'" )
+  message( "tar_out: '${tar_out}'" )
+  message( "tar_err: '${tar_err}'" )
+endif()

 set( XDK_PATH "${CI_ROOT_DIR}/xdk")


[iOS] Search OGRE_DEPENDENCIES_DIR variable for libraries on iOS too.

--HG--
branch : v1-9

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -18,6 +18,8 @@
 getenv_path(OGRE_DEPENDENCIES_DIR)
 if(OGRE_BUILD_PLATFORM_APPLE_IOS)
   set(OGRE_DEP_SEARCH_PATH
+    ${OGRE_DEPENDENCIES_DIR}
+    ${ENV_OGRE_DEPENDENCIES_DIR}
     "${OGRE_BINARY_DIR}/iOSDependencies"
     "${OGRE_SOURCE_DIR}/iOSDependencies"
     "${OGRE_BINARY_DIR}/../iOSDependencies"


[fixed] warning instead of error when cannot discover version

--- cmake/BOTG.cmake
+++ cmake/BOTG.cmake
@@ -269,10 +269,15 @@
    SET (CMAKE_REQUIRED_DEFINITIONS "${save_defs}")
 ENDMACRO()
 #-------------------------------------------------------------------------------
-FUNCTION( BOTG_MinimumCompilerVersion lang compiler version )
+FUNCTION( BOTG_MinimumCompilerVersion lang compiler min_version )
     BOTG_CompilerMatches( ${lang} ${compiler} found )
-    IF( ${found} AND CMAKE_${lang}_COMPILER_VERSION VERSION_LESS ${version} )
-        MESSAGE( FATAL_ERROR "compiler=${compiler} for lang=${lang} is required to have minimum version=${version} but found ${CMAKE_${lang}_COMPILER_VERSION}")
+    IF( ${found} )
+        SET(version "${CMAKE_${lang}_COMPILER_VERSION}")
+        IF( "${version}" STREQUAL "" )
+            MESSAGE( WARNING "CMAKE_${lang}_COMPILER_VERSION could not be discovered!")
+        ELSEIF( CMAKE_${lang}_COMPILER_VERSION VERSION_LESS ${min_version} )
+            MESSAGE( FATAL_ERROR "compiler=${compiler} for lang=${lang} is required to have minimum version=${min_version} but found ${version}!")
+        ENDIF()
     ENDIF()
 ENDFUNCTION()
 #-------------------------------------------------------------------------------


fix build for older versions of CUDA

fix build for older versions of CUDA

--- cmake/Cuda.cmake
+++ cmake/Cuda.cmake
@@ -1,6 +1,7 @@
 # Known NVIDIA GPU achitectures Caffe2 can be compiled for.
 # This list will be used for CUDA_ARCH_NAME = All option
 set(Caffe2_known_gpu_archs "20 21(20) 30 35 50 52 60 61")
+set(Caffe2_known_gpu_archs7 "20 21(20) 30 35 50 52")

 ################################################################################################
 # A function for automatic detection of GPUs installed  (if autodetection is enabled)
@@ -169,6 +170,11 @@

 set(HAVE_CUDA TRUE)
 message(STATUS "CUDA detected: " ${CUDA_VERSION})
+if (${CUDA_VERSION} LESS 8.0)
+  set(Caffe2_known_gpu_archs ${Caffe2_known_gpu_archs7})
+  list(APPEND CUDA_NVCC_FLAGS "-D_MWAITXINTRIN_H_INCLUDED")
+  list(APPEND CUDA_NVCC_FLAGS "-D__STRICT_ANSI__")
+endif()
 include_directories(SYSTEM ${CUDA_INCLUDE_DIRS})
 list(APPEND Caffe2_LINKER_LIBS ${CUDA_CUDART_LIBRARY}
                               ${CUDA_curand_LIBRARY} ${CUDA_CUBLAS_LIBRARIES})


cmake: cmake: Fix java function

cmake: cmake: Fix java function

--- cmake/java.cmake
+++ cmake/java.cmake
@@ -315,15 +315,15 @@
     ${TEST_PATH}/pom.xml
     @ONLY)

-  add_custom_target(java_sample_${TEST_NAME} ALL
+  add_custom_target(java_test_${TEST_NAME} ALL
     DEPENDS ${TEST_PATH}/pom.xml
     COMMAND ${MAVEN_EXECUTABLE} compile
     WORKING_DIRECTORY ${TEST_PATH})
-  add_dependencies(java_sample_${TEST_NAME} java_package)
+  add_dependencies(java_test_${TEST_NAME} java_package)

   if(BUILD_TESTING)
     add_test(
-      NAME java_tests_${TEST_NAME}
+      NAME java_${COMPONENT_NAME}_${TEST_NAME}
       COMMAND ${MAVEN_EXECUTABLE} test
       WORKING_DIRECTORY ${TEST_PATH})
   endif()


:bug: Caching of external projects

:bug: Caching of external projects

When and how to do find_package was not completely correct.

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -82,6 +82,7 @@

 # Looks for a lookup package file and includes it.
 macro(lookup_package package)
+    string(TOUPPER "${package}" PACKAGE)
     set(solitos "DOWNLOAD_BY_DEFAULT;REQUIRED;QUIET;KEEP;NOFIND;CHECK_EXTERNAL")
     set(multiplos "ARGUMENTS;COMPONENTS")
     cmake_parse_arguments(${package} "${solitos}" "" "${multiplos}" ${ARGN})
@@ -105,9 +106,8 @@
     if(${package}_DOWNLOAD_BY_DEFAULT AND NOT recursive)
         if(${package}_CHECK_EXTERNAL)
             set(do_rootchange TRUE)
-        else()
-            set(dolook FALSE)
-        endif()
+        endif()
+        set(dolook FALSE)
     endif()
     if(${package}_NOFIND)
         set(dolook FALSE)
@@ -120,10 +120,10 @@
     set(quiet "")
     if(${package}_QIET)
         set(quiet QUIET)
-    elseif(NOT recursive AND NOT do_rootchange)
+    elseif(NOT recursive)
         set(quiet QUIET)
     endif()
-    if(dolook)
+    if(dolook OR do_rootchange)
         if(do_rootchange)
             _set_root_path("${EXTERNAL_ROOT}" ONLY)
         endif()
@@ -133,12 +133,15 @@
         if(do_rootchange)
             _unset_root_path()
             unset(do_rootchange)
+            if(${PACKAGE}_FOUND OR ${PACKAGE_UPPER}_FOUND)
+                message(STATUS "Found ${package} in external "
+                    "projects directory ${EXTERNAL_ROO}")
+            endif()
         endif()
     endif()
     # Sets lower and upper case versions.
     # Otherwise some package will be registered as not found.
     # This is a problem with changing cmake practices.
-    string(TOUPPER "${package}" PACKAGE)
     if(${PACKAGE}_FOUND AND NOT "${package}" STREQUAL "${PACKAGE}")
         set(${package}_FOUND ${${PACKAGE}_FOUND})
     endif()


Remove -stdlib=libc++ for c++11

Remove -stdlib=libc++ for c++11

Likely not necessary anymore

Closes #4

--- scripts/AddCPP11Flags.cmake
+++ scripts/AddCPP11Flags.cmake
@@ -44,11 +44,6 @@
     set(CXX11_FLAGS "${CXX11_FLAGS} -std=c++0x")
 endif(has_std_gnupp11)

-check_cxx_compiler_flag(-stdlib=libc++ has_stdlib_libcpp)
-if(has_stdlib_libcpp)
-    set(CXX11_FLAGS "${CXX11_FLAGS} -stdlib=libc++")
-endif(has_stdlib_libcpp)
-
 if(MSVC)
   set(MSWINDOBE TRUE)
   add_definitions(/EHsc)


Enhance Emscripten toolchain file to support ccache (but disabled). It can only be enabled later when Emscripten has fixed https://github.com/kripken/emscripten/issues/3365.

--- CMake/Toolchains/emscripten.toolchain.cmake
+++ CMake/Toolchains/emscripten.toolchain.cmake
@@ -45,8 +45,23 @@
 if (CMAKE_HOST_WIN32)
     set (TOOL_EXT .bat)
 endif ()
-set (CMAKE_C_COMPILER   ${EMSCRIPTEN_ROOT_PATH}/emcc${TOOL_EXT}     CACHE PATH "C compiler")
-set (CMAKE_CXX_COMPILER ${EMSCRIPTEN_ROOT_PATH}/em++${TOOL_EXT}     CACHE PATH "C++ compiler")
+set (COMPILER_PATH ${EMSCRIPTEN_ROOT_PATH})
+if ($ENV{USE_CCACHE} AND NOT CMAKE_HOST_WIN32 AND FALSE)    # Disable ccache support for now until Emscripten has fixed https://github.com/kripken/emscripten/issues/3365
+    if (NOT $ENV{PATH} MATCHES ${EMSCRIPTEN_ROOT_PATH})
+        message (FATAL_ERROR "The bin directory containing the compiler toolchain (${EMSCRIPTEN_ROOT_PATH}) has not been added in the PATH environment variable. "
+            "This is required to enable ccache support for Emscripten compiler toolchain.")
+    endif ()
+    execute_process (COMMAND which ccache RESULT_VARIABLE EXIT_CODE OUTPUT_VARIABLE CCACHE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+    if (NOT EXIT_CODE EQUAL 0)
+        set (CCACHE /usr/bin/ccache)
+    endif ()
+    foreach (name emcc em++)
+        execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink ${CCACHE} ${CMAKE_BINARY_DIR}/${name})
+    endforeach ()
+    set (COMPILER_PATH ${CMAKE_BINARY_DIR})
+endif ()
+set (CMAKE_C_COMPILER   ${COMPILER_PATH}/emcc${TOOL_EXT}            CACHE PATH "C compiler")
+set (CMAKE_CXX_COMPILER ${COMPILER_PATH}/em++${TOOL_EXT}            CACHE PATH "C++ compiler")
 set (CMAKE_AR           ${EMSCRIPTEN_ROOT_PATH}/emar${TOOL_EXT}     CACHE PATH "archive")
 set (CMAKE_RANLIB       ${EMSCRIPTEN_ROOT_PATH}/emranlib${TOOL_EXT} CACHE PATH "ranlib")
 # Specific to Emscripten


Fixed needed options in hoomd_config.h

Fixed needed options in hoomd_config.h

git-svn-id: 42ad145e53d7314eb83f2e7cbbc363618536741c@2169 fa922fa7-2fde-0310-acd8-f43f465a7996


Push ParaView forward to master from today

Adds needed changes for view configuration.

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


toolchain_wrappers: fix symbiflow prefix

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- xc/common/cmake/install.cmake
+++ xc/common/cmake/install.cmake
@@ -23,7 +23,15 @@
   get_target_property_required(DOC_PRJ ${ARCH} DOC_PRJ)
   get_target_property_required(DOC_PRJ_DB ${ARCH} DOC_PRJ_DB)

-  set(WRAPPERS env generate_constraints pack place route synth write_bitstream write_fasm)
+  set(WRAPPERS
+    env
+    symbiflow_generate_constraints
+    symbiflow_pack
+    symbiflow_place
+    symbiflow_route
+    symbiflow_synth
+    symbiflow_write_bitstream
+    symbiflow_write_fasm)
   set(TOOLCHAIN_WRAPPERS)

   foreach(WRAPPER ${WRAPPERS})


Tell the user that we makeinfo a file.

Tell the user that we makeinfo a file.

	* build-aux/cmake/modules/Makeinfo.cmake: Do that.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/Makeinfo.cmake
+++ build-aux/cmake/modules/Makeinfo.cmake
@@ -82,6 +82,8 @@
     message(SEND_ERROR
       "'${MAKEINFO_EXECUTABLE}' failed to build '${input}' to '${output}'")
     message(STATUS "Makeinfo error begins:\n${err}\nMakeinfo error ends.")
+  else(ret)
+    message(STATUS "Makeinfo '${opts}' '${input}' to '${output}'")
   endif(ret)
 endfunction(MAKEINFO_FILE)


find openCL under linux automatically (tested for cuda)

--- CMake/FindOpenCL.cmake
+++ CMake/FindOpenCL.cmake
@@ -54,13 +54,12 @@
         FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" ENV OpenCL_INCPATH)
         FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" ENV OpenCL_INCPATH)

-    ELSE (WIN32)
+    ELSE ()

         # Unix style platforms
-        FIND_LIBRARY(OPENCL_LIBRARIES OpenCL
-            PATHS ENV LD_LIBRARY_PATH ENV OpenCL_LIBPATH
+        FIND_LIBRARY(OPENCL_LIBRARIES libOpenCL.so
+            PATHS "/usr/local/cuda/lib64" "/opt/AMDAPP/lib64"  ENV LD_LIBRARY_PATH ENV OpenCL_LIBPATH
             )
-
         GET_FILENAME_COMPONENT(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH)
         GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)

@@ -70,9 +69,9 @@
         FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include" "/opt/AMDAPP/include" ENV OpenCL_INCPATH)
         FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include" "/opt/AMDAPP/include" ENV OpenCL_INCPATH)

-    ENDIF (WIN32)
+    ENDIF ()

-ENDIF (APPLE)
+ENDIF ()

 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS)


build: need to search for libxml/xpath.h not xpath.h

--- CMakeModules/FindLibXml2.cmake
+++ CMakeModules/FindLibXml2.cmake
@@ -49,7 +49,7 @@
    SET(LIBXML2_CFLAGS ${PC_LIBXML_CFLAGS_OTHER})
 ENDIF (NOT WIN32)

-FIND_PATH(LIBXML2_INCLUDE_DIR xpath.h
+FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h
    HINTS
    ${PC_LIBXML_INCLUDEDIR}
    ${PC_LIBXML_INCLUDE_DIRS}


MS:

MS:

-ENH: adding HINTS to find program for svn for my machine, which has svn not in the path but in a cygwin install.

--- src/Testing/Dashboard/elxDashboardCommon.cmake
+++ src/Testing/Dashboard/elxDashboardCommon.cmake
@@ -72,8 +72,9 @@
 make_directory(${CTEST_BINARY_DIRECTORY})

 # Look for a Subversion command-line client.
-if(NOT DEFINED CTEST_UPDATE_COMMAND)
-  find_program(CTEST_UPDATE_COMMAND svn)
+if( NOT DEFINED CTEST_UPDATE_COMMAND )
+  find_program( CTEST_UPDATE_COMMAND svn
+    HINTS "C:/cygwin/bin/" )
 endif()

 # Support initial checkout if necessary;


Alphabetizing filter list for documentation purposes.

--- TransformationPhaseFilters/SourceList.cmake
+++ TransformationPhaseFilters/SourceList.cmake
@@ -18,9 +18,9 @@
 # List your public filters here

 set(_PublicFilters
+  FindCSLBoundaries
   InsertTransformationPhases
   TiDwellFatigueCrystallographicAnalysis
-  FindCSLBoundaries
 )


modified behavior fo WkTestData, since IDE runs tests from the project root, the path might be different... a bit annoying... more generic solution needs to be developped

--- dist/WkTest.cmake
+++ dist/WkTest.cmake
@@ -121,11 +121,17 @@

 #
 # WkTestData( test_name [ datafile1 [ datafile2 [ ... ] ] ] )
+# Copy the data associated to test from the test directory in the source_path,
+# to the binary_path, at the root
 #
 MACRO (WkTestData test_name )

 	foreach ( test_data ${ARGN} )
-		ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${WKCMAKE_TEST_DIR}/${test_data} ${PROJECT_BINARY_DIR}/${WKCMAKE_TEST_DIR}/${test_data} COMMENT "Copying ${PROJECT_SOURCE_DIR}/${WKCMAKE_TEST_DIR}/${test_data} to ${PROJECT_BINARY_DIR}/${WKCMAKE_TEST_DIR}/${test_data}" )
+		ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${WKCMAKE_TEST_DIR}/${test_data} ${PROJECT_BINARY_DIR}/${WKCMAKE_TEST_DIR}/${test_data} COMMENT "Copying ${PROJECT_SOURCE_DIR}/${test_data} to ${PROJECT_BINARY_DIR}/${test_data}" )
+#
+# Not this since in the IDE the tests is run from the project root...
+#
+#		ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${WKCMAKE_TEST_DIR}/${test_data} ${PROJECT_BINARY_DIR}/${WKCMAKE_TEST_DIR}/${test_data} COMMENT "Copying ${PROJECT_SOURCE_DIR}/${WKCMAKE_TEST_DIR}/${test_data} to ${PROJECT_BINARY_DIR}/${WKCMAKE_TEST_DIR}/${test_data}" )
 	endforeach ( test_data ${ARGN} )

 ENDMACRO (WkTestData data_path)


Update the comment about PV SHA

Update the comment about PV SHA

--- versions.cmake
+++ versions.cmake
@@ -79,7 +79,7 @@
 if(USE_PARAVIEW_MASTER)
   set(_paraview_revision "master")
 else()
-  # Test the revision with OpenGL2 rendering before updating, update often!
+  # Test the revision locally before proposing a move
   set(_paraview_revision "f700a4d7f32ccb7e31f1da6e6fd1c6188dac2feb")
 endif()
 add_revision(paraview


[CMAKE] Use proper version numbers for the shared libraries

Summary:
The shared libraries used to have 0.0.0 as a version number as it was
the value set for the autotools build.
This diff sets the correct version number and name the files the usual
way depending on the platform (cmake defaults).

The result is as follow for a lib `lib` (M=major, m=minor, p=patch):
 - Linux: lib.so (symlink) => lib.so.M (symlink) => lib.so.M.m.p
 - OSX: lib.dylib (symlink) => lib.dylib.M (symlink) => lib.dylib.M.m.p
 - Windows: lib.dll with embededd version info.

Depends on D7569.

Test Plan:
For each platform:
  ninja
Check the libbitcoinconsensus library version and name is compliant with
the above definition.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

--- cmake/modules/InstallationHelper.cmake
+++ cmake/modules/InstallationHelper.cmake
@@ -109,7 +109,7 @@
 function(install_shared_library NAME)
 	cmake_parse_arguments(ARG
 		"EXCLUDE_FROM_ALL"
-		""
+		"DESCRIPTION"
 		"PUBLIC_HEADER"
 		${ARGN}
 	)
@@ -130,28 +130,19 @@
 		set_property(TARGET ${_shared_name} PROPERTY PUBLIC_HEADER ${ARG_PUBLIC_HEADER})
 	endif()

-	if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-		# FIXME For compatibility reason with autotools, the version is set
-		# to 0.0.0 (major being actually 0). This is obviously wrong and the
-		# version of the library should reflect the version of the release.
-		# On platforms other than linux, only the major version (0) is used.
-		# Replace the VERSION line with the statement below to set the
-		# correct version:
-		# set(_properties VERSION "${CMAKE_PROJECT_VERSION}")
-		list(APPEND _properties VERSION "${CMAKE_PROJECT_VERSION_MAJOR}.0.0")
-	else()
-		list(APPEND _properties VERSION "${CMAKE_PROJECT_VERSION_MAJOR}")
-	endif()
-
-	# For autotools compatibility, rename the library to ${OUTPUT_NAME}-0.dll
 	if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
-		list(APPEND _properties OUTPUT_NAME "${NAME}-${CMAKE_PROJECT_VERSION_MAJOR}")
 		# DLL_EXPORT is defined by libtool, and is expected by some sources.
 		target_compile_definitions(${_shared_name} PRIVATE DLL_EXPORT)
-	else()
-		list(APPEND _properties OUTPUT_NAME "${NAME}")
-	endif()
-
+
+		include(WindowsVersionInfo)
+		if(ARG_DESCRIPTION)
+			set(DESCRIPTION DESCRIPTION "${ARG_DESCRIPTION}")
+		endif()
+		generate_windows_version_info(${_shared_name} ${DESCRIPTION})
+	endif()
+
+	list(APPEND _properties OUTPUT_NAME "${NAME}")
+	list(APPEND _properties VERSION "${CMAKE_PROJECT_VERSION}")
 	list(APPEND _properties SOVERSION "${CMAKE_PROJECT_VERSION_MAJOR}")

 	set_target_properties(${_shared_name} PROPERTIES ${_properties})


updated cmake script used to combine xml

--- cmake/oskar_settings_xml_utility.cmake
+++ cmake/oskar_settings_xml_utility.cmake
@@ -66,4 +66,20 @@
     message(STATUS "Writing combined settings XML file: ${xml_file}")
     file(WRITE ${xml_file} "${xml_}")

+    # Write a C header with the combined xml as a string
+    set(xml_file ${CMAKE_CURRENT_BINARY_DIR}/${name_}_xml_all.h)
+    string(REPLACE "\"" "\\\"" xml_h_ "${xml_}")
+    string(REPLACE "\n" " \\\n" xml_h_ "${xml_h_}")
+    set(xml_h_
+"
+#ifndef OSKAR_XML_H_
+#define OSKAR_XML_H_
+
+#define OSKAR_XML_STR \\
+\"${xml_h_}\"
+
+#endif /* OSKAR_XML_H_ */
+")
+    file(WRITE ${xml_file} "${xml_h_}")
+
 endmacro()