Update Suil.cmake

Update Suil.cmake

--- cmake/Suil.cmake
+++ cmake/Suil.cmake
@@ -3,8 +3,9 @@
 ##

 # Enable trace logging on debug builds
+set(PROJECT_DEFINITIONS)
 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-    add_compile_definitions(-DSUIL_DEBUG -DSUIL_TRACE_ENABLED)
+    add_definitions(-DSUIL_DEBUG -DSUIL_TRACE_ENABLED)
 endif()

 if (NOT SUIL_BASE_PATH)


de-screamify ispc.cmake CMake function/macro calls

--- cmake/ispc.cmake
+++ cmake/ispc.cmake
@@ -15,141 +15,141 @@
 ## ======================================================================== ##

 # ISPC versions to look for, in decending order (newest first)
-SET(ISPC_VERSION_WORKING "1.9.1")
-LIST(GET ISPC_VERSION_WORKING -1 ISPC_VERSION_REQUIRED)
+set(ISPC_VERSION_WORKING "1.9.1")
+list(GET ISPC_VERSION_WORKING -1 ISPC_VERSION_REQUIRED)

 IF (NOT ISPC_EXECUTABLE)
-  # try sibling folder as hint for path of ISPC
-  IF (APPLE)
-    SET(ISPC_DIR_SUFFIX "osx")
-  ELSEIF(WIN32)
-    SET(ISPC_DIR_SUFFIX "windows")
-    IF (MSVC_VERSION LESS 1900)
-      LIST(APPEND ISPC_DIR_SUFFIX "windows-vs2013")
-    ELSE()
-      LIST(APPEND ISPC_DIR_SUFFIX "windows-vs2015")
-    ENDIF()
-  ELSE()
-    SET(ISPC_DIR_SUFFIX "linux")
-  ENDIF()
-  FOREACH(ver ${ISPC_VERSION_WORKING})
-    FOREACH(suffix ${ISPC_DIR_SUFFIX})
-      LIST(APPEND ISPC_DIR_HINT ${PROJECT_SOURCE_DIR}/../ispc-v${ver}-${suffix})
-    ENDFOREACH()
-  ENDFOREACH()
-
-  FIND_PROGRAM(ISPC_EXECUTABLE ispc HINTS ${ISPC_DIR_HINT} DOC "Path to the ISPC executable.")
-  IF (NOT ISPC_EXECUTABLE)
-    MESSAGE(STATUS "Could not find ISPC...disabling ISPC examples")
-    SET(TSIMD_ENABLE_ISPC OFF)
-  ELSE()
-    MESSAGE(STATUS "Found Intel SPMD Compiler (ISPC): ${ISPC_EXECUTABLE}")
-  ENDIF()
-ENDIF()
-
-IF(TSIMD_ENABLE_ISPC)
-  IF(NOT ISPC_VERSION)
-    EXECUTE_PROCESS(COMMAND ${ISPC_EXECUTABLE} --version OUTPUT_VARIABLE ISPC_OUTPUT)
-    STRING(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev|knl)? " DUMMY "${ISPC_OUTPUT}")
-    SET(ISPC_VERSION ${CMAKE_MATCH_1})
-
-    IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
-      MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")
-    ENDIF()
-
-    SET(ISPC_VERSION ${ISPC_VERSION} CACHE STRING "ISPC Version")
-    MARK_AS_ADVANCED(ISPC_VERSION)
-    MARK_AS_ADVANCED(ISPC_EXECUTABLE)
-  ENDIF()
-
-  GET_FILENAME_COMPONENT(ISPC_DIR ${ISPC_EXECUTABLE} PATH)
-ENDIF()
+  # Try sibling folder as hint for path of ISPC
+  if (APPLE)
+    set(ISPC_DIR_SUFFIX "osx")
+  elseif(WIN32)
+    set(ISPC_DIR_SUFFIX "windows")
+    if (MSVC_VERSION LESS 1900)
+      list(APPEND ISPC_DIR_SUFFIX "windows-vs2013")
+    else()
+      list(APPEND ISPC_DIR_SUFFIX "windows-vs2015")
+    endif()
+  else()
+    set(ISPC_DIR_SUFFIX "linux")
+  endif()
+  foreach(ver ${ISPC_VERSION_WORKING})
+    foreach(suffix ${ISPC_DIR_SUFFIX})
+      list(APPEND ISPC_DIR_HINT ${PROJECT_SOURCE_DIR}/../ispc-v${ver}-${suffix})
+    endforeach()
+  endforeach()
+
+  find_program(ISPC_EXECUTABLE ispc HINTS ${ISPC_DIR_HINT} DOC "Path to the ISPC executable.")
+  if (NOT ISPC_EXECUTABLE)
+    message(STATUS "Could not find ISPC...disabling ISPC examples")
+    set(TSIMD_ENABLE_ISPC OFF)
+  else()
+    message(STATUS "Found Intel SPMD Compiler (ISPC): ${ISPC_EXECUTABLE}")
+  endif()
+endif()
+
+if(TSIMD_ENABLE_ISPC)
+  if(NOT ISPC_VERSION)
+    execute_process(COMMAND ${ISPC_EXECUTABLE} --version OUTPUT_VARIABLE ISPC_OUTPUT)
+    string(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev|knl)? " DUMMY "${ISPC_OUTPUT}")
+    set(ISPC_VERSION ${CMAKE_MATCH_1})
+
+    if (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
+      message(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")
+    endif()
+
+    set(ISPC_VERSION ${ISPC_VERSION} CACHE STRING "ISPC Version")
+    mark_as_advanced(ISPC_VERSION)
+    mark_as_advanced(ISPC_EXECUTABLE)
+  endif()
+
+  get_filename_component(ISPC_DIR ${ISPC_EXECUTABLE} PATH)
+endif()

 # ##################################################################
 # add macro INCLUDE_DIRECTORIES_ISPC() that allows to specify search
 # paths for ISPC sources
 # ##################################################################
-SET(ISPC_INCLUDE_DIR "")
-MACRO (INCLUDE_DIRECTORIES_ISPC)
-  SET(ISPC_INCLUDE_DIR ${ISPC_INCLUDE_DIR} ${ARGN})
-ENDMACRO ()
-
-MACRO (TSIMD_ISPC_COMPILE)
-  SET(ISPC_ADDITIONAL_ARGS "")
-  SET(ISPC_TARGETS ${TSIMD_ISPC_TARGET_LIST})
-
-  SET(ISPC_TARGET_EXT ${CMAKE_CXX_OUTPUT_EXTENSION})
-  STRING(REPLACE ";" "," ISPC_TARGET_ARGS "${ISPC_TARGETS}")
-
-  IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
-    SET(ISPC_ARCHITECTURE "x86-64")
-  ELSE()
-    SET(ISPC_ARCHITECTURE "x86")
-  ENDIF()
-
-  SET(ISPC_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
-  INCLUDE_DIRECTORIES(${ISPC_TARGET_DIR})
-
-  IF(ISPC_INCLUDE_DIR)
-    STRING(REPLACE ";" ";-I;" ISPC_INCLUDE_DIR_PARMS "${ISPC_INCLUDE_DIR}")
-    SET(ISPC_INCLUDE_DIR_PARMS "-I" ${ISPC_INCLUDE_DIR_PARMS})
-  ENDIF()
-
-  IF (WIN32 OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-    SET(ISPC_OPT_FLAGS -O3)
-  ELSE()
-    SET(ISPC_OPT_FLAGS -O2 -g)
-  ENDIF()
-
-  IF (NOT WIN32)
-    SET(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --pic)
-  ENDIF()
-
-  IF (NOT TSIMD_DEBUG_BUILD)
-    SET(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --opt=disable-assertions)
-  ENDIF()
-
-  SET(ISPC_OBJECTS "")
-
-  FOREACH(src ${ARGN})
-    GET_FILENAME_COMPONENT(fname ${src} NAME_WE)
-    GET_FILENAME_COMPONENT(dir ${src} PATH)
-
-    SET(input ${src})
-    IF ("${dir}" MATCHES "^/") # absolute unix-style path to input
-      SET(outdir "${ISPC_TARGET_DIR}/rebased${dir}")
-    ELSEIF ("${dir}" MATCHES "^[A-Z]:") # absolute DOS-style path to input
-      STRING(REGEX REPLACE "^[A-Z]:" "${ISPC_TARGET_DIR}/rebased/" outdir "${dir}")
-    ELSE() # relative path to input
-      SET(outdir "${ISPC_TARGET_DIR}/local_${dir}")
-      SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src})
-    ENDIF()
-
-    SET(deps "")
-    IF (EXISTS ${outdir}/${fname}.dev.idep)
-      FILE(READ ${outdir}/${fname}.dev.idep contents)
-      STRING(REPLACE " " ";"     contents "${contents}")
-      STRING(REPLACE ";" "\\\\;" contents "${contents}")
-      STRING(REPLACE "\n" ";"    contents "${contents}")
-      FOREACH(dep ${contents})
-        IF (EXISTS ${dep})
-          SET(deps ${deps} ${dep})
-        ENDIF (EXISTS ${dep})
-      ENDFOREACH(dep ${contents})
-    ENDIF ()
-
-    SET(results "${outdir}/${fname}.dev${ISPC_TARGET_EXT}")
+set(ISPC_INCLUDE_DIR "")
+macro (INCLUDE_DIRECTORIES_ISPC)
+  set(ISPC_INCLUDE_DIR ${ISPC_INCLUDE_DIR} ${ARGN})
+endmacro ()
+
+macro (TSIMD_ISPC_COMPILE)
+  set(ISPC_ADDITIONAL_ARGS "")
+  set(ISPC_TARGETS ${TSIMD_ISPC_TARGET_LIST})
+
+  set(ISPC_TARGET_EXT ${CMAKE_CXX_OUTPUT_EXTENSION})
+  string(REPLACE ";" "," ISPC_TARGET_ARGS "${ISPC_TARGETS}")
+
+  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+    set(ISPC_ARCHITECTURE "x86-64")
+  else()
+    set(ISPC_ARCHITECTURE "x86")
+  endif()
+
+  set(ISPC_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
+  include_directories(${ISPC_TARGET_DIR})
+
+  if(ISPC_INCLUDE_DIR)
+    string(REPLACE ";" ";-I;" ISPC_INCLUDE_DIR_PARMS "${ISPC_INCLUDE_DIR}")
+    set(ISPC_INCLUDE_DIR_PARMS "-I" ${ISPC_INCLUDE_DIR_PARMS})
+  endif()
+
+  if (WIN32 OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+    set(ISPC_OPT_FLAGS -O3)
+  else()
+    set(ISPC_OPT_FLAGS -O2 -g)
+  endif()
+
+  if (NOT WIN32)
+    set(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --pic)
+  endif()
+
+  if (NOT TSIMD_DEBUG_BUILD)
+    set(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --opt=disable-assertions)
+  endif()
+
+  set(ISPC_OBJECTS "")
+
+  foreach(src ${ARGN})
+    get_filename_component(fname ${src} NAME_WE)
+    get_filename_component(dir ${src} PATH)
+
+    set(input ${src})
+    if ("${dir}" MATCHES "^/") # absolute unix-style path to input
+      set(outdir "${ISPC_TARGET_DIR}/rebased${dir}")
+    elseif ("${dir}" MATCHES "^[A-Z]:") # absolute DOS-style path to input
+      string(REGEX REPLACE "^[A-Z]:" "${ISPC_TARGET_DIR}/rebased/" outdir "${dir}")
+    else() # relative path to input
+      set(outdir "${ISPC_TARGET_DIR}/local_${dir}")
+      set(input ${CMAKE_CURRENT_SOURCE_DIR}/${src})
+    endif()
+
+    set(deps "")
+    if (EXISTS ${outdir}/${fname}.dev.idep)
+      file(READ ${outdir}/${fname}.dev.idep contents)
+      string(REPLACE " " ";"     contents "${contents}")
+      string(REPLACE ";" "\\\\;" contents "${contents}")
+      string(REPLACE "\n" ";"    contents "${contents}")
+      foreach(dep ${contents})
+        if (EXISTS ${dep})
+          set(deps ${deps} ${dep})
+        endif (EXISTS ${dep})
+      endforeach(dep ${contents})
+    endif ()
+
+    set(results "${outdir}/${fname}.dev${ISPC_TARGET_EXT}")

     # if we have multiple targets add additional object files
-    LIST(LENGTH ISPC_TARGETS NUM_TARGETS)
-    IF (NUM_TARGETS GREATER 1)
-      FOREACH(target ${ISPC_TARGETS})
-        STRING(REPLACE "-i32x16" "" target ${target}) # strip avx512(knl|skx)-i32x16
-        SET(results ${results} "${outdir}/${fname}.dev_${target}${ISPC_TARGET_EXT}")
-      ENDFOREACH()
-    ENDIF()
-
-    ADD_CUSTOM_COMMAND(
+    list(LENGTH ISPC_TARGETS NUM_TARGETS)
+    if (NUM_TARGETS GREATER 1)
+      foreach(target ${ISPC_TARGETS})
+        string(REPLACE "-i32x16" "" target ${target}) # strip avx512(knl|skx)-i32x16
+        set(results ${results} "${outdir}/${fname}.dev_${target}${ISPC_TARGET_EXT}")
+      endforeach()
+    endif()
+
+    add_custom_command(
       OUTPUT ${results} ${ISPC_TARGET_DIR}/${fname}_ispc.h
       COMMAND ${CMAKE_COMMAND} -E make_directory ${outdir}
       COMMAND ${ISPC_EXECUTABLE}
@@ -170,49 +170,49 @@
       COMMENT "Building ISPC object ${outdir}/${fname}.dev${ISPC_TARGET_EXT}"
     )

-    SET(ISPC_OBJECTS ${ISPC_OBJECTS} ${results})
-  ENDFOREACH()
-ENDMACRO()
+    set(ISPC_OBJECTS ${ISPC_OBJECTS} ${results})
+  endforeach()
+endmacro()

 ## Macro configure ISA targets for ispc ##
-MACRO(TSIMD_CONFIGURE_ISPC_ISA)
-  SET(TSIMD_BUILD_ISA "AVX" CACHE STRING
+macro(TSIMD_CONFIGURE_ISPC_ISA)
+  set(TSIMD_BUILD_ISA "AVX" CACHE STRING
       "Target ISA (SSE4, AVX, AVX2, AVX512KNL, AVX512SKX)")
-  STRING(TOUPPER ${TSIMD_BUILD_ISA} TSIMD_BUILD_ISA)
-  SET_PROPERTY(CACHE TSIMD_BUILD_ISA PROPERTY STRINGS
+  string(TOUPPER ${TSIMD_BUILD_ISA} TSIMD_BUILD_ISA)
+  set_property(CACHE TSIMD_BUILD_ISA PROPERTY STRINGS
                SSE4 AVX AVX2 AVX512KNL AVX512SKX)

-  UNSET(TSIMD_ISPC_TARGET_LIST)
-
-  IF (TSIMD_BUILD_ISA STREQUAL "AVX512SKX")
-    SET(TSIMD_ISPC_TARGET_LIST avx512skx-i32x16)
-  ELSEIF (TSIMD_BUILD_ISA STREQUAL "AVX512KNL")
-    SET(TSIMD_ISPC_TARGET_LIST avx512knl-i32x16)
-  ELSEIF (TSIMD_BUILD_ISA STREQUAL "AVX2")
-    SET(TSIMD_ISPC_TARGET_LIST avx2)
-  ELSEIF (TSIMD_BUILD_ISA STREQUAL "AVX")
-    SET(TSIMD_ISPC_TARGET_LIST avx)
-  ELSEIF (TSIMD_BUILD_ISA STREQUAL "SSE4")
-    SET(TSIMD_ISPC_TARGET_LIST sse4)
-  ELSE ()
-    MESSAGE(ERROR "Invalid TSIMD_BUILD_ISA value. "
+  unset(TSIMD_ISPC_TARGET_LIST)
+
+  if (TSIMD_BUILD_ISA STREQUAL "AVX512SKX")
+    set(TSIMD_ISPC_TARGET_LIST avx512skx-i32x16)
+  elseif (TSIMD_BUILD_ISA STREQUAL "AVX512KNL")
+    set(TSIMD_ISPC_TARGET_LIST avx512knl-i32x16)
+  elseif (TSIMD_BUILD_ISA STREQUAL "AVX2")
+    set(TSIMD_ISPC_TARGET_LIST avx2)
+  elseif (TSIMD_BUILD_ISA STREQUAL "AVX")
+    set(TSIMD_ISPC_TARGET_LIST avx)
+  elseif (TSIMD_BUILD_ISA STREQUAL "SSE4")
+    set(TSIMD_ISPC_TARGET_LIST sse4)
+  else ()
+    message(ERROR "Invalid TSIMD_BUILD_ISA value. "
                   "Please select one of ${TSIMD_SUPPORTED_ISAS}")
-  ENDIF()
-ENDMACRO()
-
-MACRO(ISPC_ADD_EXECUTABLE name)
-  SET(ISPC_SOURCES "")
-  SET(OTHER_SOURCES "")
-  FOREACH(src ${ARGN})
-    GET_FILENAME_COMPONENT(ext ${src} EXT)
-    IF (ext STREQUAL ".ispc")
-      IF(TSIMD_ENABLE_ISPC)
-        SET(ISPC_SOURCES ${ISPC_SOURCES} ${src})
-      ENDIF()
-    ELSE ()
-      SET(OTHER_SOURCES ${OTHER_SOURCES} ${src})
-    ENDIF ()
-  ENDFOREACH()
-  TSIMD_ISPC_COMPILE(${ISPC_SOURCES})
-  ADD_EXECUTABLE(${name} ${ISPC_OBJECTS} ${OTHER_SOURCES} ${ISPC_SOURCES})
-ENDMACRO()+  endif()
+endmacro()
+
+macro(ISPC_ADD_EXECUTABLE name)
+  set(ISPC_SOURCES "")
+  set(OTHER_SOURCES "")
+  foreach(src ${ARGN})
+    get_filename_component(ext ${src} EXT)
+    if (ext STREQUAL ".ispc")
+      if(TSIMD_ENABLE_ISPC)
+        set(ISPC_SOURCES ${ISPC_SOURCES} ${src})
+      endif()
+    else ()
+      set(OTHER_SOURCES ${OTHER_SOURCES} ${src})
+    endif ()
+  endforeach()
+  tsimd_ispc_compile(${ISPC_SOURCES})
+  add_executable(${name} ${ISPC_OBJECTS} ${OTHER_SOURCES} ${ISPC_SOURCES})
+endmacro()


i made what hopefully is a final adjustment in portable code to detect whether CMake is using a multi-configuration generator.

--- cmake/trio.cmake
+++ cmake/trio.cmake
@@ -58,7 +58,7 @@
 	set(TRIO_LIBRARY_NAME libtrio.a)
 endif()

-if(${CMAKE_CONFIGURATION_TYPES})
+if("${CMAKE_CONFIGURATION_TYPES}")
 	# there's no official binary distribution for Windows. given the need to
 	# support multi-configuration builds and without any convention for
 	# discovering where libraries for each configuration can be found, i'm
@@ -118,7 +118,7 @@
 	else()
 		message(FATAL_ERROR "i don't know how to compile an external project on this platform.")
 	endif()
-	if(${CMAKE_CONFIGURATION_TYPES})
+	if("${CMAKE_CONFIGURATION_TYPES}")
 		foreach(i ${CMAKE_CONFIGURATION_TYPES})
 			# WORKAROUND: target_link_libraries() doesn't recognize configuration
 			# names. instead, it recognizes keywords which cover categories
@@ -149,7 +149,7 @@

 get_filename_component(TRIO_PREFIX "${TRIO_LIBRARY}" PATH)
 # TODO: i want to cannonize this test into a function.
-if(${CMAKE_CONFIGURATION_TYPES})
+if("${CMAKE_CONFIGURATION_TYPES}")
 	get_filename_component(TRIO_PREFIX "${TRIO_PREFIX}/../.." ABSOLUTE)
 else()
 	get_filename_component(TRIO_PREFIX "${TRIO_PREFIX}/.." ABSOLUTE)


Tweak Ubuntu versions

Tweak Ubuntu versions

--- UploadPPA.cmake
+++ UploadPPA.cmake
@@ -222,8 +222,7 @@

 function(UPLOAD_PPAS)
   upload_ppa(precise)
-  upload_ppa(quantal)
-  upload_ppa(raring)
   upload_ppa(saucy)
+  upload_ppa(trusty)
   add_custom_target(dput DEPENDS ${DPUT_TARGETS})
 endfunction()


Fix cppexpose-config.cmake

Fix cppexpose-config.cmake

--- cppexpose-config.cmake
+++ cppexpose-config.cmake
@@ -49,4 +49,4 @@
 endif()

 # Signal success/failure to CMake
-set(template_FOUND ${MODULE_FOUND})
+set(cppexpose_FOUND ${MODULE_FOUND})


Add ws2_32 to link command line.

Add ws2_32 to link command line.

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

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

--- build-aux/cmake/modules/FindSdkRemote.cmake
+++ build-aux/cmake/modules/FindSdkRemote.cmake
@@ -55,9 +55,9 @@
   endif(NOT SDK_REMOTE_INCLUDE_DIR)

   set(SDK_REMOTE_LIBRARIES ${SDK_REMOTE_LIBRARY})
-  # Add jpeg library
+  # Add dependent libraries.
   if(WIN32)
-    set(SDK_REMOTE_LIBRARIES ${SDK_REMOTE_LIBRARIES} libjpeg)
+    set(SDK_REMOTE_LIBRARIES ${SDK_REMOTE_LIBRARIES} libjpeg ws2_32)
   else()
     set(SDK_REMOTE_LIBRARIES ${SDK_REMOTE_LIBRARIES} jpeg)
   endif()


add openfast regression testing to updated ctest setup


COMP: add include_directories for VPIC.

COMP: add include_directories for VPIC.

--- vtkIncludeDirectories.cmake
+++ vtkIncludeDirectories.cmake
@@ -209,6 +209,9 @@
 VTK_THIRD_PARTY_INCLUDE(Exodus2 vtkexodus2/include)
 VTK_THIRD_PARTY_INCLUDE(MATERIALLIBRARY MaterialLibrary)
 VTK_THIRD_PARTY_INCLUDE(VERDICT verdict)
+IF(VTK_USE_PARALLEL)
+  VTK_THIRD_PARTY_INCLUDE(VPIC VPIC)
+ENDIF(VTK_USE_PARALLEL)
 IF(VTK_USE_OGGTHEORA_ENCODER)
   VTK_THIRD_PARTY_INCLUDE(OGGTHEORA vtkoggtheora/include)
 ENDIF(VTK_USE_OGGTHEORA_ENCODER)


Fix VST3 plugin filename for windows builds with cmake
Closes #340

Signed-off-by: falkTX <d7e5958cbb080ba57e41fb602ade747e1a2da17c@falktx.com>

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -414,7 +414,7 @@
       SUFFIX "")
   elseif(WIN32)
     set_target_properties("${NAME}-vst3" PROPERTIES
-      LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.vst3/Contents/${vst3_arch}-win/$<0:>")
+      LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.vst3/Contents/${vst3_arch}-win/$<0:>" SUFFIX ".vst3")
   else()
     set_target_properties("${NAME}-vst3" PROPERTIES
       LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.vst3/Contents/${vst3_arch}-linux/$<0:>")


pass DAEMON_DIR back to nacl vm build

pass DAEMON_DIR back to nacl vm build

for some reason some nacl vm related build steps are driven by the engine cmake
configuration, hence when the engine is not built as a submodule, the cmake script
has to tell the vm build process where the engine source tree is.

--- cmake/DaemonGame.cmake
+++ cmake/DaemonGame.cmake
@@ -81,6 +81,7 @@
                 CMAKE_ARGS
                     -DFORK=2
                     -DCMAKE_TOOLCHAIN_FILE=${Daemon_SOURCE_DIR}/cmake/toolchain-pnacl.cmake
+                    -DDAEMON_DIR=${Daemon_SOURCE_DIR}
                     -DDEPS_DIR=${DEPS_DIR}
                     -DBUILD_GAME_NACL_NEXE=${BUILD_GAME_NACL_NEXE}
                     -DBUILD_GAME_NACL=1


cmake: use *_LIBRARIES when testing for libbfd version

On openSUSE, binutils has really strangely named libbfd and libopcodes
libraries[1]. This is fine (we can define *_LIBRARIES variables), but the
result is that the LIBBFD_DISASM_FOUR_ARGS_SIGNATURE test will always
fail because CHECK_CXX_SOURCE_COMPILES cannot find the right libraries.

The fix is simple -- just use *_LIBRARIES for CMAKE_REQUIRED_LIBRARIES.
We need to find_library(LibOpcodes) for that test, but that isn't too
bad because CMake caches the result.

[1]: https://bugzilla.suse.com/show_bug.cgi?id=1162312

Signed-off-by: Aleksa Sarai <b305c9b0212d6145eea67bbffd24e29cb79c759c@cyphar.com>

--- cmake/FindLibBfd.cmake
+++ cmake/FindLibBfd.cmake
@@ -6,6 +6,7 @@
 #  LIBBFD_LIBRARIES - Link these to use libbfd
 #  LIBBFD_DEFINITIONS - Compiler switches required for using libbfd
 #  LIBIBERTY_LIBRARIES - libiberty static library (for static compilation)
+#  LIBZ_LIBRARIES - libz static library (for static compilation)

 #if (LIBBFD_LIBRARIES AND LIBBFD_INCLUDE_DIRS)
 #  set (LibBpf_FIND_QUIETLY TRUE)
@@ -50,6 +51,22 @@
     ENV LIBRARY_PATH
     ENV LD_LIBRARY_PATH)

+# libbfd.so is statically linked with libz.a but libbfd.a
+# is not. So if we do a static bpftrace build, we must link in
+# libz.a.
+find_library (LIBZ_LIBRARIES
+  NAMES
+    libz.a
+  PATHS
+    /lib
+    /usr/lib
+    /usr/local/lib
+    /opt/local/lib
+    /usr/lib/x86_64-linux-gnu/
+    /sw/lib
+    ENV LIBRARY_PATH
+    ENV LD_LIBRARY_PATH)
+
 include (FindPackageHandleStandardArgs)

@@ -61,7 +78,18 @@
 mark_as_advanced(LIBBFD_INCLUDE_DIRS LIBBFD_LIBRARIES)

 if(${LIBBFD_FOUND})
-SET(CMAKE_REQUIRED_LIBRARIES bfd opcodes)
+find_package(LibOpcodes)
+SET(CMAKE_REQUIRED_LIBRARIES ${LIBBFD_LIBRARIES} ${LIBOPCODES_LIBRARIES})
+# libbfd.a is not statically linked with libiberty.a or libz.a so we must manually
+# do it. Furthermore, libbfd uses some libc symbols that we must manually
+# link against if we're not using static libc (which includes such symbols).
+if(STATIC_LINKING)
+  list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBIBERTY_LIBRARIES} ${LIBZ_LIBRARIES})
+  if(NOT STATIC_LIBC)
+    set(CMAKE_REQUIRED_FLAGS
+      "-Wl,--start-group -Wl,-Bdynamic -Wl,-Bdynamic -lpthread -Wl,-Bdynamic -ldl")
+  endif()
+endif()
 INCLUDE(CheckCXXSourceCompiles)
 CHECK_CXX_SOURCE_COMPILES("
 #include <string.h>


Fix finding Python 3

Fix finding Python 3

Fix small error in FindPython.cmake that would cause it to break with
Python 3.

--- cmake/FindPython.cmake
+++ cmake/FindPython.cmake
@@ -3,7 +3,7 @@
 find_package(PythonInterp)
 if(PYTHON_EXECUTABLE)
   execute_process(
-    COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print sys.exec_prefix;"
+    COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print(sys.exec_prefix);"
     OUTPUT_VARIABLE PYTHON_PREFIX
     OUTPUT_STRIP_TRAILING_WHITESPACE)
   list(APPEND CMAKE_PREFIX_PATH ${PYTHON_PREFIX})


update SCOREC library list for new packages

--- cmake/FindScorec.cmake
+++ cmake/FindScorec.cmake
@@ -43,16 +43,18 @@
 endif()

 set(SCOREC_LIBS "")
+
 set(SCOREC_LIB_NAMES
-  pcu
-  gmi
   ma
+  spr
+  parma
+  apf_zoltan
   mds
   apf
-  apf_zoltan
-  parma
-  ph
-  spr
+  lion
+  mth
+  gmi
+  pcu
   )

 scorecLibCheck("${SCOREC_LIB_NAMES}" TRUE)


change option name and message content

change option name and message content

--- cmake/LLVMIRUtil.cmake
+++ cmake/LLVMIRUtil.cmake
@@ -20,7 +20,7 @@
 # public (client) interface macros/functions

 function(llvmir_attach_bc_target)
-  set(options LINK_STATIC_LIB)
+  set(options ATTACH_TO_DEPENDENT_STATIC_LIBS)
   set(oneValueArgs TARGET DEPENDS)
   set(multiValueArgs)
   cmake_parse_arguments(LLVMIR_ATTACH
@@ -112,8 +112,8 @@
   llvmir_extract_lang_flags(IN_LANG_FLAGS ${LINKER_LANGUAGE})

   # Link static libraries
-  if(LLVMIR_ATTACH_LINK_STATIC_LIB)
-    message(STATUS "LINK_STATIC_LIB option is turned on. Linking static libraries.")
+  if(LLVMIR_ATTACH_ATTACH_TO_DEPENDENT_STATIC_LIBS)
+    message(STATUS "ATTACH_TO_DEPENDENT_STATIC_LIBS option is turned on. Attaching to dependent static libraries of target ${TRGT}.")

     # Find statically linked libraries, and add the source files for IR generation
     foreach(LINK_LIB ${LINK_LIBRARIES})
@@ -123,7 +123,7 @@
         # Check the library is a static one. For shared libraries, we cannot get the source files for compiling.
         if(${type} STREQUAL "STATIC_LIBRARY")
           get_property(LINK_LIB_FILES TARGET ${LINK_LIB} PROPERTY SOURCES)
-          message(STATUS "Linking Static library: ${LINK_LIB}")
+          message(STATUS "Attaching to dependent static library ${LINK_LIB} of target ${TRGT}.")

           foreach(LINK_LIB_FILE ${LINK_LIB_FILES})
             if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${LINK_LIB_FILE}")
@@ -1034,6 +1034,6 @@
     set_property(SOURCE ${IN_FULL_LLVMIR_FILE} PROPERTY EXTERNAL_OBJECT TRUE)
   endforeach()

-# # postamble
+  ## postamble
 endfunction()


update libpng to version 1.6.36

update libpng to version 1.6.36

--- cmake/get-libpng.cmake
+++ cmake/get-libpng.cmake
@@ -1,13 +1,13 @@
 #------------------------------------------------------------------------------
 # External Project:     libpng
 # Website:              http://www.libpng.org/pub/png/libpng.html
-# Downloads:            https://github.com/glennrp/libpng/archive/v1.6.35.zip
+# Downloads:            https://github.com/glennrp/libpng/archive/v1.6.36.zip
 # Github:               https://github.com/glennrp/libpng
 #------------------------------------------------------------------------------

 include(ExternalProject)

-set(LIBPNG_VERSION "1.6.35")
+set(LIBPNG_VERSION "1.6.36")

 set(LIBPNG_CMAKE_ARGS ${COMMON_CMAKE_ARGS}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
@@ -31,7 +31,7 @@
   DOWNLOAD_DIR        ${DEPENDENCY_DOWNLOAD_DIR}
   DOWNLOAD_NAME       libpng-v${LIBPNG_VERSION}.zip
   URL                 https://github.com/glennrp/libpng/archive/v${LIBPNG_VERSION}.zip
-  URL_MD5             160403f7a8784c300bc75f5e16cecaef
+  URL_MD5             72c2bebf31d9fbd59cfc24d8c5ce49df
   INSTALL_DIR         ${DEPENDENCY_INSTALL_DIR}
   CONFIGURE_COMMAND   ${CMAKE_COMMAND} ${DEPENDENCY_EXTRACT_DIR}/src/libpng
          -G ${CMAKE_GENERATOR}


Add MediaPackage, MediaLive, MediaConvert & MediaStore services.

--- cmake/sdksCommon.cmake
+++ cmake/sdksCommon.cmake
@@ -55,6 +55,11 @@
 list(APPEND C2J_LIST "ds:2015-04-16")
 list(APPEND C2J_LIST "dynamodb:2012-08-10")
 list(APPEND C2J_LIST "dynamodbstreams:2012-08-10")
+list(APPEND C2J_LIST "mediapackage:2017-10-12")
+list(APPEND C2J_LIST "medialive:2017-10-14")
+list(APPEND C2J_LIST "mediaconvert:2017-08-29")
+list(APPEND C2J_LIST "mediastore:2017-09-01")
+list(APPEND C2J_LIST "mediastore-data:2017-09-01")

 if(NOT PLATFORM_ANDROID OR NOT CMAKE_HOST_WIN32)  # ec2 isn't building for android on windows atm due to an internal compiler error, TODO: investigate further
     list(APPEND C2J_LIST "ec2:2016-11-15")


[FIX] FindSeqan now works with Xcode 4.3, use CMAKE_CXX_COMPILER_ID instead CMAKE_CXX_COMPILER to determine the type of compiler

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

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -118,17 +118,17 @@
     # Check whether we compile with CLANG.
     # -----------------------------------------------------------------------
     set (COMPILER_IS_CLANG FALSE)
-    if (CMAKE_CXX_COMPILER MATCHES "clang\\+\\+")
+    if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
       set (COMPILER_IS_CLANG TRUE)
-    endif (CMAKE_CXX_COMPILER MATCHES "clang\\+\\+")
+    endif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")

     # -----------------------------------------------------------------------
     # Fix CMAKE_COMPILER_IS_GNUCXX for MinGW.
     # -----------------------------------------------------------------------

-    if (CMAKE_CXX_COMPILER MATCHES "g\\+\\+")
+    if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
       set (CMAKE_COMPILER_IS_GNUCXX TRUE)
-    endif (CMAKE_CXX_COMPILER MATCHES "g\\+\\+")
+    endif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")

     # -----------------------------------------------------------------------
     # GCC Setup
@@ -205,7 +205,7 @@
     set (PATH_BIN ${CMAKE_CURRENT_BINARY_DIR}/${REL_PATH})
     file (GLOB HEADERS_TMP ${PATH}/seqan/[A-z]*/[A-z]*.h)
     file (GLOB SUPER_HEADERS ${PATH}/seqan/[A-z]*.h)
-
+
     set (SEQAN_INCLUDE_DIR_FOR_${TARGET_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${REL_PATH} ${CMAKE_CURRENT_BINARY_DIR}/${REL_PATH} CACHE INTERNAL "asdf" FORCE)
     # message("SEQAN_INCLUDE_DIR_FOR_${TARGET_NAME} <- ${SEQAN_INCLUDE_DIR_FOR_${TARGET_NAME}}")
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${REL_PATH})
@@ -228,18 +228,19 @@
     if (FORWARDS)
         list (SORT FORWARDS)
     endif (FORWARDS)
-
+
     # ---------------------------------------------------------------------------
     # Forwards Generation.
     # ---------------------------------------------------------------------------
     if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
+	message(STATUS "HALLO")
         file (GLOB BASE_CONTENTS RELATIVE ${PATH}/seqan ${PATH}/seqan/[A-z]*)
         foreach (ENTRY ${BASE_CONTENTS})
             if (IS_DIRECTORY ${PATH}/seqan/${ENTRY})
                 list (APPEND MODULES ${ENTRY})
             endif (IS_DIRECTORY ${PATH}/seqan/${ENTRY})
         endforeach (ENTRY ${SEQAN_BASE_CONTENTS})
-
+
         if (MODULES)
             list (SORT MODULES)
             list (REMOVE_DUPLICATES MODULES)


FW: VideoEncoder: fix keyframe rate config, fix resource computations for JPEG (e.g: MJPEG for 4K video 30fps + MJPEG for still 12MP ~1fps) properly set resources used to allow

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "613d3600d858acd8b742e15293079d880a2d3789")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "e85e15af6f971899d326a37a494bcb25f723a309")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


properly select latest CI

properly select latest CI

--- cmake/Modules/FindLuaBuild/LuaVanilla.cmake
+++ cmake/Modules/FindLuaBuild/LuaVanilla.cmake
@@ -113,11 +113,11 @@
 	# extend version number with prefix
 	if (${CMAKE_MATCH_1} EQUAL 5)
 		if (${CMAKE_MATCH_2} EQUAL 1)
-			set(LUA_VANILLA_VERSION LUA_VANILLA_5.1_LATEST_VERSION)
+			set(LUA_VANILLA_VERSION ${LUA_VANILLA_5.1_LATEST_VERSION})
 		elseif (${CMAKE_MATCH_2} EQUAL 2)
-			set(LUA_VANILLA_VERSION LUA_VANILLA_5.2_LATEST_VERSION)
+			set(LUA_VANILLA_VERSION ${LUA_VANILLA_5.2_LATEST_VERSION})
 		elseif (${CMAKE_MATCH_2} EQUAL 3)
-			set(LUA_VANILLA_VERSION LUA_VANILLA_5.3_LATEST_VERSION)
+			set(LUA_VANILLA_VERSION ${LUA_VANILLA_5.3_LATEST_VERSION})
 		else()
 			# default to whatever the first two
 			# numbers happen to be, plus build 0


Fix compilation of latest TBB on Windows

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1170,7 +1170,7 @@
     set(_tbb_compiler compiler=gcc)
   endif()
   if(MSVC)
-    set(vsdir "vs2012")
+    set(vsdir "vs2013")
     set(TBB_LIBRARIES ${CMAKE_BINARY_DIR}/lib/tbb.lib)
     ExternalProject_Add(
       TBB


[Exp PyROOT] Fixed mistakes introduced in 2a0cd15

2a0cd15 was rebased by hand before the introduction of e0fa6cc, so the
addition of the lines concerning the search for PYTHON_EXECUTABLE was
not considered. This was causing failures with cxx17.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -498,6 +498,7 @@
 unset(PYTHON_INCLUDE_DIR CACHE)
 unset(PYTHON_LIBRARY CACHE)
 unset(CMAKE_INSTALL_PYROOTDIR)
+
 # Python is required by header and manpage generation

 if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
@@ -539,6 +540,7 @@
       # Re-run, now with NumPy, but not required:
       find_package(Python2 COMPONENTS Interpreter Development NumPy)
       # Compat with find_package(PythonInterp), find_package(PythonLibs)
+      set(PYTHON_EXECUTABLE "${Python2_EXECUTABLE}")
       set(PYTHON_INCLUDE_DIRS "${Python2_INCLUDE_DIRS}")
       set(PYTHON_LIBRARIES "${Python2_LIBRARIES}")
       set(PYTHON_VERSION_STRING "${Python2_VERSION}")
@@ -562,6 +564,7 @@
       # Re-run, now with NumPy, but not required:
       find_package(Python COMPONENTS Interpreter Development NumPy)
       # Compat with find_package(PythonInterp), find_package(PythonLibs), find_package(NumPy)
+      set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
       set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}")
       set(PYTHON_LIBRARIES "${Python_LIBRARIES}")
       set(PYTHON_VERSION_STRING "${Python_VERSION}")


ENH: Include netcdf and exodus directories

--- vtkIncludeDirectories.cmake
+++ vtkIncludeDirectories.cmake
@@ -142,6 +142,8 @@
 VTK_THIRD_PARTY_INCLUDE2(EXPAT)
 VTK_THIRD_PARTY_INCLUDE(DICOMParser DICOMParser)
 VTK_THIRD_PARTY_INCLUDE(FREETYPE vtkfreetype/include)
+VTK_THIRD_PARTY_INCLUDE(NetCDF vtknetcdf)
+VTK_THIRD_PARTY_INCLUDE(Exodus2 vtkexodus2/include)

 # Include GUI support
 IF(VTK_USE_GUISUPPORT)


CI: typo in option

CI: typo in option

--- CI/debian-unstable-gcc.cmake
+++ CI/debian-unstable-gcc.cmake
@@ -22,6 +22,6 @@

 set(site_option
 "opencv_INCLUDE_DIR:PATH=/usr/include
- OTB_USE_MPI:BOOL=OFF
- OTB_USE_SHARK:BOOL=OFF
- ")
+OTB_USE_MPI:BOOL=OFF
+OTB_USE_SHARK:BOOL=OFF
+")


[Config] Added guard around newest CMP (CMake policies)

--- config/FindBoost.cmake
+++ config/FindBoost.cmake
@@ -248,7 +248,9 @@
 # Save project's policies
 cmake_policy(PUSH)
 cmake_policy(SET CMP0057 NEW) # if IN_LIST
-cmake_policy(SET CMP0102 NEW) # if mark_as_advanced(non_cache_var)
+if (POLICY CMP0102)
+  cmake_policy(SET CMP0102 NEW) # if mark_as_advanced(non_cache_var)
+endif (POLICY CMP0102)

 function(_boost_get_existing_target component target_var)
   set(names "${component}")
@@ -1644,9 +1646,11 @@
   set(Boost_VERSION_STRING "${Boost_VERSION_MAJOR}.${Boost_VERSION_MINOR}.${Boost_VERSION_PATCH}")

   # Define final Boost_VERSION
-  cmake_policy(GET CMP0093 _Boost_CMP0093
-    PARENT_SCOPE # undocumented, do not use outside of CMake
-  )
+  if (POLICY CMP0093)
+    cmake_policy(GET CMP0093 _Boost_CMP0093
+      PARENT_SCOPE # undocumented, do not use outside of CMake
+    )
+  endif (POLICY CMP0093)
   if("x${_Boost_CMP0093}x" STREQUAL "xNEWx")
     set(Boost_VERSION ${Boost_VERSION_STRING})
   else()


ENH: Exclude ITKGDCM module when system GDCM is ON.

When ITK_USE_SYSTEM_GDCM is set to be ON,ITKGDCM module
should be excluded from building.

--- Modules/ThirdParty/GDCM/itk-module.cmake
+++ Modules/ThirdParty/GDCM/itk-module.cmake
@@ -2,11 +2,19 @@
 href=\"http://sourceforge.net/projects/gdcm/\">GDCM</a> library.
 Grassroots DiCoM is a C++ library for DICOM medical files.")

-itk_module(ITKGDCM
-  DEPENDS
-    ITKZLIB
-    ITKExpat
-    ITKOpenJPEG
-  DESCRIPTION
-    "${DOCUMENTATION}"
-)
+if(ITK_USE_SYSTEM_GDCM)
+  itk_module(ITKGDCM
+    DESCRIPTION
+      "${DOCUMENTATION}"
+    EXCLUDE_FROM_ALL
+    )
+else()
+  itk_module(ITKGDCM
+    DEPENDS
+      ITKZLIB
+      ITKExpat
+      ITKOpenJPEG
+    DESCRIPTION
+      "${DOCUMENTATION}"
+  )
+endif()


Fixed FindVMTK script.

Fixed FindVMTK script.

--- CMake/FindVMTK.cmake
+++ CMake/FindVMTK.cmake
@@ -1,3 +1,6 @@
+include(FindPackageHandleStandardArgs)
+include(SelectLibraryConfigurations)
+
 find_path(VMTK_INCLUDE_DIR
   NAMES vtkvmtkConfigure.h
   PATHS ${MITK_EXTERNAL_PROJECT_PREFIX}
@@ -6,45 +9,39 @@

 set(VMTK_LIBRARY_DIR "${MITK_EXTERNAL_PROJECT_PREFIX}/lib/vmtk")

-find_library(VMTK_COMMON_LIB vtkvmtkCommon ${VMTK_LIBRARY_DIR})
-find_library(VMTK_COMPUTATIONAL_GEOMETRY_LIB vtkvmtkComputationalGeometry ${VMTK_LIBRARY_DIR})
-find_library(VMTK_DIFFERENTIAL_GEOMETRY_LIB vtkvmtkDifferentialGeometry ${VMTK_LIBRARY_DIR})
-find_library(VMTK_IO_LIB vtkvmtkIO ${VMTK_LIBRARY_DIR})
-find_library(VMTK_ITK_LIB vtkvmtkITK ${VMTK_LIBRARY_DIR})
-find_library(VMTK_MISC_LIB vtkvmtkMisc ${VMTK_LIBRARY_DIR})
-find_library(VMTK_SEGMENTATION_LIB vtkvmtkSegmentation ${VMTK_LIBRARY_DIR})
+foreach(lib Common ComputationalGeometry DifferentialGeometry IO ITK Misc Segmentation)
+  string(TOUPPER ${lib} LIB)
+  if(NOT VMTK_${LIB}_LIBRARIES)
+    find_library(VMTK_${LIB}_LIBRARY_RELEASE vtkvmtk${lib} ${VMTK_LIBRARY_DIR})
+    find_library(VMTK_${LIB}_LIBRARY_DEBUG vtkvmtk${lib}d ${VMTK_LIBRARY_DIR})
+    select_library_configurations(VMTK_${LIB})
+  endif()
+endforeach()

 find_package_handle_standard_args(VMTK DEFAULT_MSG
   VMTK_INCLUDE_DIR
-  VMTK_COMMON_LIB
-  VMTK_COMPUTATIONAL_GEOMETRY_LIB
-  VMTK_DIFFERENTIAL_GEOMETRY_LIB
-  VMTK_IO_LIB
-  VMTK_ITK_LIB
-  VMTK_MISC_LIB
-  VMTK_SEGMENTATION_LIB
+  VMTK_COMMON_LIBRARIES
+  VMTK_COMPUTATIONALGEOMETRY_LIBRARIES
+  VMTK_DIFFERENTIALGEOMETRY_LIBRARIES
+  VMTK_IO_LIBRARIES
+  VMTK_ITK_LIBRARIES
+  VMTK_MISC_LIBRARIES
+  VMTK_SEGMENTATION_LIBRARIES
 )

 if(VMTK_FOUND)
   set(VMTK_INCLUDE_DIRS ${VMTK_INCLUDE_DIR})
   set(VMTK_LIBRARIES
-    ${VMTK_COMMON_LIB}
-    ${VMTK_COMPUTATIONAL_GEOMETRY_LIB}
-    ${VMTK_DIFFERENTIAL_GEOMETRY_LIB}
-    ${VMTK_IO_LIB}
-    ${VMTK_ITK_LIB}
-    ${VMTK_MISC_LIB}
-    ${VMTK_SEGMENTATION_LIB}
+    ${VMTK_COMMON_LIBRARIES}
+    ${VMTK_COMPUTATIONALGEOMETRY_LIBRARIES}
+    ${VMTK_DIFFERENTIALGEOMETRY_LIBRARIES}
+    ${VMTK_IO_LIBRARIES}
+    ${VMTK_ITK_LIBRARIES}
+    ${VMTK_MISC_LIBRARIES}
+    ${VMTK_SEGMENTATION_LIBRARIES}
   )
 endif()

 mark_as_advanced(
   VMTK_INCLUDE_DIR
-  VMTK_COMMON_LIB
-  VMTK_COMPUTATIONAL_GEOMETRY_LIB
-  VMTK_DIFFERENTIAL_GEOMETRY_LIB
-  VMTK_IO_LIB
-  VMTK_ITK_LIB
-  VMTK_MISC_LIB
-  VMTK_SEGMENTATION_LIB
 )


DateTimeFormat: updated

DateTimeFormat: updated

--- Modules/DateTimeFormat.cmake
+++ Modules/DateTimeFormat.cmake
@@ -35,5 +35,4 @@

 TODAY(TODAY_CHANGELOG "+%a %b %d %Y" "C")
 TODAY(TODAY_SHORT "+%Y%m%d" "C")
-ENDIF(NOT DEFINED _DATE_TIME_FORMAT_CMAKE_)


use variable CIL_VERSION

use variable CIL_VERSION

--- SuperBuild/External_CCPi-Framework.cmake
+++ SuperBuild/External_CCPi-Framework.cmake
@@ -1,6 +1,6 @@
 #========================================================================
 # Author: Edoardo Pasca
-# Copyright 2018 STFC
+# Copyright 2018-2019 STFC
 #
 # This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) SuperBuild.
 #
@@ -46,7 +46,7 @@
   set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${SUPERBUILD_INSTALL_DIR})
   set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${SUPERBUILD_INSTALL_DIR})

-  set(ENV{CIL_VERSION} 0.10.1)
+  set(ENV{CIL_VERSION} ${CIL_VERSION})
   message("CIL URL " ${${proj}_URL}  )
   message("CIL TAG " ${${proj}_TAG}  )

@@ -90,7 +90,7 @@

     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
-    INSTALL_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=0.10.0 SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe PYTHON=${PYTHON_EXECUTABLE} bash ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/build.sh
+    INSTALL_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${CIL_VERSION} SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe PYTHON=${PYTHON_EXECUTABLE} bash ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/build.sh
     CMAKE_ARGS
         -DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir}
     DEPENDS


modules: different libraries for OpenGL ES 2.0/3.0 in FindMagnum.cmake.

Also apparently not tested at all.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -164,8 +164,10 @@

 if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)
     find_package(OpenGL REQUIRED)
-else()
+elseif(MAGNUM_TARGET_GLES2)
     find_package(OpenGLES2 REQUIRED)
+elseif(MAGNUM_TARGET_GLES3)
+    find_package(OpenGLES3 REQUIRED)
 endif()

 # On Windows and in static builds, *Application libraries need to have
@@ -366,8 +368,10 @@
     ${CORRADE_PLUGINMANAGER_LIBRARIES})
 if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)
     set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGL_gl_LIBRARY})
+elseif(MAGNUM_TARGET_GLES2)
+    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGLES2_LIBRARY})
 else()
-    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGLES2_LIBRARY})
+    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGLES3_LIBRARY})
 endif()

 # Installation dirs


CMake: use ZLIB static when building it

CMake: use ZLIB static when building it

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -7,7 +7,13 @@
 set(THREAD_PREFER_PTHREAD_FLAG TRUE)
 find_package(Threads REQUIRED)

-find_package(ZLIB REQUIRED)
+if(BUILD_ZLIB)
+ find_package(ZLIB REQUIRED CONFIG)
+ set(ZLIB_DEP ZLIB::zlibstatic)
+else()
+ find_package(ZLIB REQUIRED)
+ set(ZLIB_DEP ZLIB::ZLIB)
+endif()
 find_package(absl REQUIRED CONFIG)
 set(GFLAGS_USE_TARGET_NAMESPACE TRUE)
 find_package(gflags REQUIRED CONFIG)
@@ -107,7 +113,7 @@
   $<INSTALL_INTERFACE:include>
   )
 target_link_libraries(${PROJECT_NAME} PUBLIC
-  ZLIB::ZLIB
+  ${ZLIB_DEP}
   absl::base
   absl::random_random
   absl::raw_hash_set


empy needs the python cmake module called first (requires PYTHON_EXECUTABLE defined)

--- cmake/all.cmake
+++ cmake/all.cmake
@@ -45,6 +45,7 @@
     catkin_workspace
     debug_message
     em_expand
+    python # defines PYTHON_EXECUTABLE, required by empy
     empy
     find_program_required
     install_matching_to_share


removing clang warning for when printing flags

--- cmake/ucm.cmake
+++ cmake/ucm.cmake
@@ -62,7 +62,7 @@
 macro(ucm_set_runtime)
     cmake_parse_arguments(ARG "STATIC;DYNAMIC;PRINT_FLAGS" "" "" ${ARGN})

-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ${PRINT_FLAGS} STREQUAL "")
         message(AUTHOR_WARNING "ucm_set_runtime() does not support clang yet!")
     endif()


Ported curl-asio to iOS

Ported curl-asio to iOS

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -1014,8 +1014,8 @@
 ################################################################################
 # curl-asio, an asynchronous CURL wrapper based on Boost Asio.
 # See https://github.com/mologie/curl-asio.
-set(CURL_ASIO_C_FLAGS "-I${LIBCURL_PREFIX}/include ${CMAKE_C_FLAGS}")
-set(CURL_ASIO_CXX_FLAGS "-I${LIBCURL_PREFIX}/include ${CMAKE_CXX_FLAGS}")
+set(CURL_ASIO_C_FLAGS "-I${LIBCURL_PREFIX}/include ${CMAKE_C_FLAGS_WITH_ARCHS}")
+set(CURL_ASIO_CXX_FLAGS "-I${LIBCURL_PREFIX}/include ${CMAKE_CXX_FLAGS_WITH_ARCHS}")
 set(CURL_ASIO_LINKER_FLAGS "${LINKER_FLAGS}")
 foreach (FLAG ${third_party.libcurl})
   set(CURL_ASIO_LINKER_FLAGS "${CURL_ASIO_LINKER_FLAGS} ${FLAG}")
@@ -1028,18 +1028,20 @@
           ${CURL_ASIO_TARGET}
   CMAKE_ARGS
       -DBOOST_ROOT=${BOOST_PREFIX}
+      -DCURL_INCLUDE_DIR=${LIBCURL_PREFIX}/include
+      -DCURL_LIBRARY=${LIBCURL_PREFIX}/lib/libcurl.dylib
       -DBUILD_EXAMPLES=OFF

       -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+      -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
       -DCMAKE_BUILD_TYPE=RELEASE
       -DCMAKE_C_FLAGS=${CURL_ASIO_C_FLAGS}
       -DCMAKE_CXX_FLAGS=${CURL_ASIO_CXX_FLAGS}
       -DCMAKE_SHARED_LINKER_FLAGS=${CURL_ASIO_LINKER_FLAGS}
       -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
       -DCMAKE_OSX_ARCHITECTURES=${ARCHS}
-      -DCMAKE_INSTALL_PREFIX=${CURL_ASIO_PREFIX}
-      -DCURL_ROOT=${LIBCURL_PREFIX})
+      -DCMAKE_INSTALL_PREFIX=${CURL_ASIO_PREFIX})
 add_external_project_step(
   ${CURL_ASIO_TARGET} set_install_names
   COMMAND ${SET_INSTALL_NAMES} ${CMAKE_INSTALL_NAME_TOOL}


COMP: propogate compiler selection & flags to FFTW build

FFTW gets built via a CMake ExternalProject. The actual
build is done via an autoconf configure/make recipe. The
compiler and compiler flags weren't being propagated down into
the FFTW configuration pass; consequently FFTW could get built
with a different compiler and compiler flags than the rest
of ITK.

Change-Id: I81f3b42daf25d95742e5e2ef3a2fcf7e895a6d20

--- CMake/itkExternal_FFTW.cmake
+++ CMake/itkExternal_FFTW.cmake
@@ -39,6 +39,12 @@
   find_package( FFTW )
   link_directories(${FFTW_LIBDIR})
 else(USE_SYSTEM_FFTW)
+  set(FFTW_COMPILER_FLAGS
+    CC=${CMAKE_C_COMPILER}
+    CXX=${CMAKE_CXX_COMPILER}
+    CFLAGS=${CMAKE_C_FLAGS}
+    CXXFLAGS=${CMAKE_CXX_FLAGS})
+
   if(WIN32 AND NOT MINGW)
     message("Can't build fftw as external project on Windows")
     message(ERROR "install fftw and use USE_SYSTEM_FFTW")
@@ -67,6 +73,7 @@
         --disable-fortran
         --enable-float
         --prefix=${ITK_BINARY_DIR}/fftw
+        ${FFTW_COMPILER_FLAGS}
         )
     endif(USE_FFTWF)

@@ -82,6 +89,7 @@
         --disable-fortran
         --disable-float
         --prefix=${ITK_BINARY_DIR}/fftw
+        ${FFTW_COMPILER_FLAGS}
         )
     endif(USE_FFTWD)
     set(FFTW_INCLUDE_PATH ${ITK_BINARY_DIR}/fftw/include)


Fix installation of CTK Qt plugins.

Fix installation of CTK Qt plugins.

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -14,24 +14,21 @@
       list(APPEND _qtplugin_install_destinations bin/plugins/designer)
     endif()

+    set(_ctk_qt_plugin_folder_release)
+    set(_ctk_qt_plugin_folder_debug)
     if(NOT CMAKE_CFG_INTDIR STREQUAL ".")
-      set(_matching_pattern_release FILES_MATCHING PATTERN "*Release*")
-      set(_matching_pattern_debug FILES_MATCHING PATTERN "*Debug*")
-    else()
-      set(_matching_pattern_release )
-      set(_matching_pattern_debug )
+      set(_ctk_qt_plugin_folder_release "Release/")
+      set(_ctk_qt_plugin_folder_debug "Debug/")
     endif()

     foreach(_qtplugin_install_dir ${_qtplugin_install_destinations})
-      install(DIRECTORY "${CTK_QTDESIGNERPLUGINS_DIR}/designer/"
+      install(DIRECTORY "${CTK_QTDESIGNERPLUGINS_DIR}/designer/${_ctk_qt_plugin_folder_release}"
               DESTINATION ${_qtplugin_install_dir}
               CONFIGURATIONS Release
-              ${_matching_pattern_release}
               )
-      install(DIRECTORY "${CTK_QTDESIGNERPLUGINS_DIR}/designer/"
+      install(DIRECTORY "${CTK_QTDESIGNERPLUGINS_DIR}/designer/${_ctk_qt_plugin_folder_debug}"
               DESTINATION ${_qtplugin_install_dir}
               CONFIGURATIONS Debug
-              ${_matching_pattern_debug}
               )
     endforeach()
   endif()


Adding missing dependency on AddLibrary and UT++

--- _cmake/dependencies.cmake
+++ _cmake/dependencies.cmake
@@ -0,0 +1,5 @@
+# include our cmake extensions
+include(_cmake/AddLibrary/Dependencies.cmake)
+
+# external libraries we're going to use.
+include(_cmake/dependencies/UnitTest++.cmake)


Finally fix debian?

Finally fix debian?

--- cmake/ArangoDBMacros.cmake
+++ cmake/ArangoDBMacros.cmake
@@ -267,14 +267,13 @@
     copy "${PROJECT_SOURCE_DIR}/Installation/debian/compat" "${PROJECT_BINARY_DIR}/debian/compat"
   )
   add_custom_command(TARGET prepare_debian POST_BUILD
-    COMMAND "${DH_INSTALLINIT}" -o 2>/dev/null
+    COMMAND fakeroot "${DH_INSTALLINIT}" -o 2>/dev/null
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
   )
   add_custom_command(TARGET prepare_debian POST_BUILD
-    COMMAND "dh_installdeb"
+    COMMAND fakeroot dh_installdeb
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
   )
-  set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postinst;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/preinst;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postrm;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/prerm;")
 endif()

 # General
@@ -302,6 +301,7 @@
 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
 set(CPACK_DEBIAN_COMPRESSION_TYPE "xz")
 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.arangodb.com/")
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postinst;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/preinst;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postrm;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/prerm;")
 set(CPACK_BUNDLE_NAME            "${CPACK_PACKAGE_NAME}")
 configure_file("${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/Info.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
 set(CPACK_BUNDLE_PLIST           "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
@@ -403,7 +403,7 @@
 ################################################################################

 install(
-  DIRECTORY ${PROJECT_BINARY_DIR}/var/log/arangodb3
+  DIRECTORY ${PROJECT_BINARY_DIR}/var/log/arangodb
   DESTINATION ${VARDIR_INSTALL}/log)

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


Add /bigobj flag to allow Debug builds on windows (#3730)

--- cmake/TaichiCXXFlags.cmake
+++ cmake/TaichiCXXFlags.cmake
@@ -20,7 +20,7 @@
 if (MSVC)
     link_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/lib)
     set(CMAKE_CXX_FLAGS
-            "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /std:c++17 /MP /Z7 /D \"_CRT_SECURE_NO_WARNINGS\" /D \"_ENABLE_EXTENDED_ALIGNED_STORAGE\"")
+            "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /std:c++17 /bigobj /MP /Z7 /D \"_CRT_SECURE_NO_WARNINGS\" /D \"_ENABLE_EXTENDED_ALIGNED_STORAGE\"")
 else()
     if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
         message("Clang compiler detected. Using std=c++17.")


[cmake] GetSVN.cmake takes a list of arguments

Summary:
GetSVN.cmake currently takes one or two pairs of <source directory path,
name>, then attempts to get the remote repository URL and source control
revision of the repositories at those one or two paths.

It takes two pairs in order for Clang to get the revision of both
itself, and its dependency LLVM.

For projects that rely upon both LLVM and Clang (Apple's Swift is one
example, but there are others), GetSVN.cmake is used to fetch *three*
revisions: Swift, Clang, and LLVM.

To support this use case, change GetSVN.cmake: instead of taking one or
two pairs (specified via `FIRST_SOURCE_DIR`/`FIRST_NAME`, have it take a list
of pairs (`SOURCE_DIRS`/`NAMES`).

In order to allow Clang to migrate, have GetSVN.cmake support both sets
of arguments for now. The old arguments can be removed once Clang begins
using the new arguments, and Swift can follow when it updates its
copy of LLVM.

Test Plan:
1. Perform a clean build of Clang, verify that `clang --version` still
   prints the correct LLVM and Clang revision information.
2. Modify Clang's CMake to use the new arguments, then perform another
   clean build. `clang --version` should still print the correct
   revision information.

Reviewers: jordan_rose, beanz, probinson

Subscribers: echristo, chapuni, llvm-commits, mgorny

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

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

--- cmake/modules/GetSVN.cmake
+++ cmake/modules/GetSVN.cmake
@@ -1,17 +1,15 @@
 # CMake project that writes Subversion revision information to a header.
 #
 # Input variables:
-#   FIRST_SOURCE_DIR  - First source directory
-#   FIRST_NAME        - The macro prefix for the first repository's info
-#   SECOND_SOURCE_DIR - Second source directory (opt)
-#   SECOND_NAME       - The macro prefix for the second repository's info (opt)
-#   HEADER_FILE       - The header file to write
+#   SOURCE_DIRS - A list of source directories.
+#   NAMES       - A list of macro prefixes for each of the source directories.
+#   HEADER_FILE - The header file to write
 #
-# The output header will contain macros FIRST_REPOSITORY and FIRST_REVISION,
-# and SECOND_REPOSITORY and SECOND_REVISION if requested, where "FIRST" and
-# "SECOND" are substituted with the names specified in the input variables.
+# The output header will contain macros <NAME>_REPOSITORY and <NAME>_REVISION,
+# where "<NAME>" and is substituted with the names specified in the input
+# variables, for each of the SOURCE_DIRS given.

-# Chop off cmake/modules/GetSVN.cmake
+# Chop off cmake/modules/GetSVN.cmake
 get_filename_component(LLVM_DIR "${CMAKE_SCRIPT_MODE_FILE}" PATH)
 get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
 get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
@@ -103,9 +101,37 @@
     "#define ${name}_REPOSITORY \"${repository}\"\n")
 endfunction()

-append_info(${FIRST_NAME} "${FIRST_SOURCE_DIR}")
-if(DEFINED SECOND_SOURCE_DIR)
-  append_info(${SECOND_NAME} "${SECOND_SOURCE_DIR}")
+function(validate_inputs source_dirs names)
+  list(LENGTH source_dirs source_dirs_length)
+  list(LENGTH names names_length)
+  if (NOT source_dirs_length EQUAL names_length)
+    message(FATAL_ERROR
+            "GetSVN.cmake takes two arguments: a list of source directories, "
+            "and a list of names. Expected two lists must be of equal length, "
+            "but got ${source_dirs_length} source directories and "
+            "${names_length} names.")
+  endif()
+endfunction()
+
+if (DEFINED SOURCE_DIRS AND DEFINED NAMES)
+  validate_inputs("${SOURCE_DIRS}" "${NAMES}")
+
+  list(LENGTH SOURCE_DIRS source_dirs_length)
+  math(EXPR source_dirs_max_index ${source_dirs_length}-1)
+  foreach(index RANGE ${source_dirs_max_index})
+    list(GET SOURCE_DIRS ${index} source_dir)
+    list(GET NAMES ${index} name)
+    append_info(${name} ${source_dir})
+  endforeach()
+endif()
+
+# Allow -DFIRST_SOURCE_DIR arguments until Clang migrates to the new
+# -DSOURCE_DIRS argument.
+if(DEFINED FIRST_SOURCE_DIR)
+  append_info(${FIRST_NAME} "${FIRST_SOURCE_DIR}")
+  if(DEFINED SECOND_SOURCE_DIR)
+    append_info(${SECOND_NAME} "${SECOND_SOURCE_DIR}")
+  endif()
 endif()

 # Copy the file only if it has changed.


wip: libsinsp as external project add

wip: libsinsp as external project add

Co-authored-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>
Signed-off-by: Leonardo Di Donato <2012e0ca99d70aa6c893822ff73002216e5dba72@gmail.com>

--- cmake/modules/sysdig.cmake
+++ cmake/modules/sysdig.cmake
@@ -11,9 +11,18 @@
 # specific language governing permissions and limitations under the License.
 #

-# The sysdig git reference (branch name, commit hash, or tag)
-# set(SYSDIG_VERSION "falco/${FALCO_VERSION_MAJOR}.${FALCO_VERSION_MINOR}.${FALCO_VERSION_PATCH}") # todo(leodido, fntlnz) > use this when FALCO_VERSION variable is ok (PR 872)
-set(SYSDIG_VERSION "falco/0.18.0")
+# The sysdig git reference (branch name, commit hash, or tag) set(SYSDIG_VERSION
+# "falco/${FALCO_VERSION_MAJOR}.${FALCO_VERSION_MINOR}.${FALCO_VERSION_PATCH}") # todo(leodido, fntlnz) > use this when
+# FALCO_VERSION variable is ok (PR 872)
+# get_cmake_property(_variableNames VARIABLES)
+# list (SORT _variableNames)
+# foreach (_variableName ${_variableNames})
+#     message(STATUS "${_variableName}=${${_variableName}}")
+# endforeach()
+
+if(NOT SYSDIG_VERSION)
+  set(SYSDIG_VERSION "dev")
+endif()

 ExternalProject_Add(
   sysdig
@@ -25,30 +34,36 @@
   TEST_COMMAND "")

 # Fetch the sysdig source directory
-ExternalProject_Get_property(sysdig SOURCE_DIR)
+ExternalProject_Get_Property(sysdig SOURCE_DIR)
 set(SYSDIG_SOURCE_DIR "${SOURCE_DIR}")
 unset(SOURCE_DIR)
 message(STATUS "Source directory of sysdig: ${SYSDIG_SOURCE_DIR}")
+message(STATUS "Sysdig version: ${SYSDIG_VERSION}")

+
+ExternalProject_Add(
+  libsinsp
+  DEPENDS sysdig
+  DOWNLOAD_COMMAND ""
+  SOURCE_DIR "${SYSDIG_SOURCE_DIR}/userspace/libsinsp"
+  # CMAKE_ARGS "-DB64_INCLUDE=${B64_INCLUDE} -DCURSES_INCLUDE_DIR=${CURSES_INCLUDE_DIR} -DGRPC_INCLUDE=${GRPC_INCLUDE} -DJQ_INCLUDE=${JQ_INCLUDE} -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} -DPROTOBUF_INCLUDE=${PROTOBUF_INCLUDE}"
+  CMAKE_ARGS -DPROTOBUF_INCLUDE=${PROTOBUF_INCLUDE} -DB64_INCLUDE=${B64_INCLUDE} -DJSONCPP_INCLUDE=${JSONCPP_INCLUDE} -DLUAJIT_INCLUDE=${LUAJIT_INCLUDE} -DTBB_INCLUDE_DIR=${TBB_INCLUDE_DIR} -DCURSES_INCLUDE_DIR=${CURSES_INCLUDE_DIR} -DGRPC_INCLUDE=${GRPC_INCLUDE} -DJQ_INCLUDE=${JQ_INCLUDE} -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} -DCURL_INCLUDE_DIR=${CURL_INCLUDE_DIR} -DCURL_LIBRARIES=${CURL_LIBRARIES} -DJSONCPP_LIB=${JSONCPP_LIB} -DTBB_LIB=${TBB_LIB} -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_OPENSSL=OFF -DUSE_BUNDLED_CURL=OFF -DUSE_BUNDLED_TBB=OFF -DUSE_BUNDLED_GRPC=OFF -DGRPC_CPP_PLUGIN=${GRPC_CPP_PLUGIN} -DPROTOC=${PROTOC} -DOPENSSL_LIBRARIES=${OPENSSL_LIBRARIES} -DLUAJIT_LIB=${LUAJIT_LIB}
+)
+
+# list(APPEND CMAKE_MODULE_PATH "${SYSDIG_SOURCE_DIR}/cmake/modules")
 #
-# ExternalProject_Get_property(sysdig BINARY_DIR)
-# set(SYSDIG_BINARY_DIR "${BINARY_DIR}")
-# unset(BINARY_DIR)
-# message(STATUS "Source directory of sysdig: ${SYSDIG_BINARY_DIR}")

-list(APPEND CMAKE_MODULE_PATH "${SYSDIG_SOURCE_DIR}/cmake/modules")
-include(FindMakedev)

-# jsoncpp
-set(JSONCPP_SRC "${SYSDIG_SOURCE_DIR}/userspace/libsinsp/third-party/jsoncpp")
-set(JSONCPP_INCLUDE "${JSONCPP_SRC}")
-set(JSONCPP_LIB_SRC "${JSONCPP_SRC}/jsoncpp.cpp")
+# # jsoncpp
+# set(JSONCPP_SRC "${SYSDIG_SOURCE_DIR}/userspace/libsinsp/third-party/jsoncpp")
+# set(JSONCPP_INCLUDE "${JSONCPP_SRC}")
+# set(JSONCPP_LIB_SRC "${JSONCPP_SRC}/jsoncpp.cpp")

-# Add driver directory
-add_subdirectory("${SYSDIG_SOURCE_DIR}/driver" "${PROJECT_BINARY_DIR}/driver")
+# # Add driver directory
+# add_subdirectory("${SYSDIG_SOURCE_DIR}/driver" "${PROJECT_BINARY_DIR}/driver")

-# Add libscap directory
-add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libscap" "${PROJECT_BINARY_DIR}/userspace/libscap")
+# # Add libscap directory
+# add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libscap" "${PROJECT_BINARY_DIR}/userspace/libscap")

-# Add libsinsp directory
-add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libsinsp" "${PROJECT_BINARY_DIR}/userspace/libsinsp")
+# # Add libsinsp directory
+# add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libsinsp" "${PROJECT_BINARY_DIR}/userspace/libsinsp")


cmake: fi qi_create_lib when using a subfolder

--- cmake/qibuild/target.cmake
+++ cmake/qibuild/target.cmake
@@ -305,7 +305,7 @@
     set(_runtime_out "${QI_SDK_DIR}/${QI_SDK_BIN}")
     set(_lib_out     "${QI_SDK_DIR}/${QI_SDK_LIB}")
   else()
-    set(_runtime_out "${QI_SDK_DIR}/${QI_SDK_BIN}/${ARG_SUBFOLDER}")
+    set(_runtime_out "${QI_SDK_DIR}/${QI_SDK_LIB}/${ARG_SUBFOLDER}")
     set(_lib_out     "${QI_SDK_DIR}/${QI_SDK_LIB}/${ARG_SUBFOLDER}")
   endif()


cmake/smfc_generator: Add include for seastar::sstring

Add the incude for seastar::sstring to the generated flatbuffer header
files.

Signed-off-by: Duarte Nunes <a60e8b7496f7715d71354fe4c06dd24017025bf1@vectorized.io>
Message-Id: <20190518202420.24476-1-a60e8b7496f7715d71354fe4c06dd24017025bf1@vectorized.io>

--- cmake/smfc_generator.cmake
+++ cmake/smfc_generator.cmake
@@ -63,6 +63,8 @@
       ARGS --gen-mutable --cpp-str-type 'seastar::sstring'
       ARGS --cpp-str-flex-ctor
       ARGS -o "${SMFC_GEN_OUTPUT_DIRECTORY}/" "${FILE}"
+      COMMAND sed
+      ARGS -i '/\#include/a\#include \<seastar/core/sstring.hh\>' ${FLATC_OUTPUT}
       COMMENT "Building C++ header for ${FILE}"
       DEPENDS ${FILE}
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})


Correted list of serial ports for lpe target for fmu v2 board

--- boards/px4/fmu-v2/lpe.cmake
+++ boards/px4/fmu-v2/lpe.cmake
@@ -13,10 +13,10 @@
 	#UAVCAN_INTERFACES 2

 	SERIAL_PORTS
-		GPS1:/dev/ttyS0
+		GPS1:/dev/ttyS3
 		TEL1:/dev/ttyS1
 		TEL2:/dev/ttyS2
-		TEL4:/dev/ttyS3
+		TEL4:/dev/ttyS6

 	DRIVERS
 		#barometer # all available barometer drivers


 - копирование бинарников для Qt Assistant

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

--- rdo/packages/cmake/trunk/win32.install.cmake
+++ rdo/packages/cmake/trunk/win32.install.cmake
@@ -14,35 +14,82 @@
 SET(QT_PLUGINS_PLATFORMS_DIR   $ENV{QTDIR}/${QT_PLUGINS_PLATFORMS} )
 SET(QT_PLUGINS_SQLDRIVERS_DIR  $ENV{QTDIR}/${QT_PLUGINS_SQLDRIVERS})

-FIND_FILE(DLL_ICUUC       icuuc51.dll        PATHS ${QT_LIBRARY_DIR})
-FIND_FILE(DLL_ICUIN       icuin51.dll        PATHS ${QT_LIBRARY_DIR})
-FIND_FILE(DLL_ICUDT       icudt51.dll        PATHS ${QT_LIBRARY_DIR})
 #FIND_FILE(DLL_D3DCOMPILER D3DCompiler_43.dll PATHS ${QT_LIBRARY_DIR})
 SET(DLL_D_AND_R
-	${DLL_ICUUC}
-	${DLL_ICUIN}
-	${DLL_ICUDT}
 #	${DLL_D3DCOMPILER}
 )
-
-FIND_FILE(DLL_GLES libEGL.dll    PATHS ${QT_LIBRARY_DIR})
-FIND_FILE(DLL_EGL  libGLESv2.dll PATHS ${QT_LIBRARY_DIR})
-SET(CONFIG_DLL_OPTIONAL
-	${DLL_GLES}
-	${DLL_EGL}
-)
-
-FIND_FILE(DLL_R_QT_CORE     Qt5Core.dll     PATHS ${QT_LIBRARY_DIR})
-FIND_FILE(DLL_D_QT_CORE     Qt5Cored.dll    PATHS ${QT_LIBRARY_DIR})
-FIND_FILE(DLL_R_QT_CUI      Qt5Gui.dll      PATHS ${QT_LIBRARY_DIR})
-FIND_FILE(DLL_D_QT_CUI      Qt5Guid.dll     PATHS ${QT_LIBRARY_DIR})
-FIND_FILE(DLL_R_QT_WIDGETS  Qt5Widgets.dll  PATHS ${QT_LIBRARY_DIR})
-FIND_FILE(DLL_D_QT_WIDGETS  Qt5Widgetsd.dll PATHS ${QT_LIBRARY_DIR})

 FIND_FILE(DLL_R_PLUGINS_QWINDOWS qwindows.dll  PATHS ${QT_PLUGINS_PLATFORMS_DIR})
 FIND_FILE(DLL_D_PLUGINS_QWINDOWS qwindowsd.dll PATHS ${QT_PLUGINS_PLATFORMS_DIR})
 FIND_FILE(DLL_R_PLUGINS_QMINIMAL qminimal.dll  PATHS ${QT_PLUGINS_PLATFORMS_DIR})
 FIND_FILE(DLL_D_PLUGINS_QMINIMAL qminimald.dll PATHS ${QT_PLUGINS_PLATFORMS_DIR})
+
+SET(CONFIG_PLUGINS_PLATFORM_R
+	${DLL_R_PLUGINS_QWINDOWS}
+	${DLL_R_PLUGINS_QMINIMAL}
+)
+
+SET(CONFIG_PLUGINS_PLATFORM_D
+	${DLL_D_PLUGINS_QWINDOWS}
+	${DLL_D_PLUGINS_QMINIMAL}
+)
+
+FIND_FILE(DLL_ICUUC                   icuuc51.dll              PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_ICUIN                   icuin51.dll              PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_ICUDT                   icudt51.dll              PATHS ${QT_LIBRARY_DIR})
+
+FIND_FILE(DLL_R_QT_CORE               Qt5Core.dll              PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_D_QT_CORE               Qt5Cored.dll             PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_CUI                Qt5Gui.dll               PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_D_QT_CUI                Qt5Guid.dll              PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_WIDGETS            Qt5Widgets.dll           PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_D_QT_WIDGETS            Qt5Widgetsd.dll          PATHS ${QT_LIBRARY_DIR})
+
+FIND_FILE(EXE_R_ASSISTANT             assistant.exe            PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_CLUCENE            Qt5CLucene.dll           PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_HELP               Qt5Help.dll              PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_MULTIMEDIA         Qt5Multimedia.dll        PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_MULTIMEDIAWIDGETS  Qt5MultimediaWidgets.dll PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_NETWORK            Qt5Network.dll           PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_OPENGL             Qt5OpenGL.dll            PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_PRINTSUPPORT       Qt5PrintSupport.dll      PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_QML                Qt5Qml.dll               PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_QUICK              Qt5Quick.dll             PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_SENSORS            Qt5Sensors.dll           PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_SQL                Qt5Sql.dll               PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_V8                 Qt5V8.dll                PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_WEBKIT             Qt5WebKit.dll            PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_QT_WEBKITWIDGETS      Qt5WebKitWidgets.dll     PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_R_PLUGINS_QSQLITE       qsqlite.dll              PATHS ${QT_PLUGINS_SQLDRIVERS_DIR})
+SET(CONFIG_ASSISTANT
+	${DLL_ICUUC}
+	${DLL_ICUIN}
+	${DLL_ICUDT}
+	${DLL_R_QT_CORE}
+	${DLL_R_QT_CUI}
+	${DLL_R_QT_WIDGETS}
+	${EXE_R_ASSISTANT}
+	${DLL_R_QT_CLUCENE}
+	${DLL_R_QT_HELP}
+	${DLL_R_QT_MULTIMEDIA}
+	${DLL_R_QT_MULTIMEDIAWIDGETS}
+	${DLL_R_QT_NETWORK}
+	${DLL_R_QT_OPENGL}
+	${DLL_R_QT_PRINTSUPPORT}
+	${DLL_R_QT_QML}
+	${DLL_R_QT_QUICK}
+	${DLL_R_QT_SENSORS}
+	${DLL_R_QT_SQL}
+	${DLL_R_QT_V8}
+	${DLL_R_QT_WEBKIT}
+	${DLL_R_QT_WEBKITWIDGETS}
+)
+SET(CONFIG_ASSISTANT_PLUGINS_PLATFORM
+	${CONFIG_PLUGINS_PLATFORM_R}
+)
+SET(CONFIG_ASSISTANT_PLUGINS_QSQLITE
+	${DLL_R_PLUGINS_QSQLITE}
+)

 IF (MSVC90)
 	FIND_FILE(DLL_R_MSVCP msvcp90.dll)
@@ -56,6 +103,20 @@
 	FIND_FILE(DLL_D_MSVCR msvcr100d.dll)
 ENDIF()

+SET(CONFIG_DLL_R
+	${DLL_D_AND_R}
+	${DLL_R_QT_CORE}
+	${DLL_R_QT_CUI}
+	${DLL_R_QT_WIDGETS}
+	${DLL_R_MSVCR}
+	${DLL_R_MSVCP}
+)
+FILE(COPY ${CONFIG_DLL_R}                      DESTINATION ${CONFIG_DIRECTORY_RELEASE})
+FILE(COPY ${CONFIG_PLUGINS_PLATFORM_R}         DESTINATION ${CONFIG_DIRECTORY_RELEASE}/${QT_PLUGINS_PLATFORMS})
+FILE(COPY ${CONFIG_ASSISTANT}                  DESTINATION ${CONFIG_DIRECTORY_RELEASE})
+FILE(COPY ${CONFIG_ASSISTANT_PLUGINS_PLATFORM} DESTINATION ${CONFIG_DIRECTORY_RELEASE}/${QT_PLUGINS_PLATFORMS})
+FILE(COPY ${CONFIG_ASSISTANT_PLUGINS_QSQLITE}  DESTINATION ${CONFIG_DIRECTORY_RELEASE}/${QT_PLUGINS_SQLDRIVERS})
+
 SET(CONFIG_DLL_D
 	${DLL_D_AND_R}
 	${DLL_D_QT_CORE}
@@ -64,27 +125,18 @@
 	${DLL_D_MSVCR}
 	${DLL_D_MSVCP}
 )
-SET(CONFIG_PLUGINS_PLATFORM_D
-	${DLL_D_PLUGINS_QWINDOWS}
-	${DLL_D_PLUGINS_QMINIMAL}
+FILE(COPY ${CONFIG_DLL_D}                      DESTINATION ${CONFIG_DIRECTORY_DEBUG})
+FILE(COPY ${CONFIG_PLUGINS_PLATFORM_D}         DESTINATION ${CONFIG_DIRECTORY_DEBUG}/${QT_PLUGINS_PLATFORMS})
+FILE(COPY ${CONFIG_ASSISTANT}                  DESTINATION ${CONFIG_DIRECTORY_DEBUG})
+FILE(COPY ${CONFIG_ASSISTANT_PLUGINS_PLATFORM} DESTINATION ${CONFIG_DIRECTORY_DEBUG}/${QT_PLUGINS_PLATFORMS})
+FILE(COPY ${CONFIG_ASSISTANT_PLUGINS_QSQLITE}  DESTINATION ${CONFIG_DIRECTORY_DEBUG}/${QT_PLUGINS_SQLDRIVERS})
+
+FIND_FILE(DLL_GLES libEGL.dll    PATHS ${QT_LIBRARY_DIR})
+FIND_FILE(DLL_EGL  libGLESv2.dll PATHS ${QT_LIBRARY_DIR})
+SET(CONFIG_DLL_OPTIONAL
+	${DLL_GLES}
+	${DLL_EGL}
 )
-FILE(COPY ${CONFIG_DLL_D}              DESTINATION ${CONFIG_DIRECTORY_DEBUG})
-FILE(COPY ${CONFIG_PLUGINS_PLATFORM_D} DESTINATION ${CONFIG_DIRECTORY_DEBUG}/${QT_PLUGINS_PLATFORMS})
-
-SET(CONFIG_DLL_R
-	${DLL_D_AND_R}
-	${DLL_R_QT_CORE}
-	${DLL_R_QT_CUI}
-	${DLL_R_QT_WIDGETS}
-	${DLL_R_MSVCR}
-	${DLL_R_MSVCP}
-)
-SET(CONFIG_PLUGINS_PLATFORM_R
-	${DLL_R_PLUGINS_QWINDOWS}
-	${DLL_R_PLUGINS_QMINIMAL}
-)
-FILE(COPY ${CONFIG_DLL_R}              DESTINATION ${CONFIG_DIRECTORY_RELEASE})
-FILE(COPY ${CONFIG_PLUGINS_PLATFORM_R} DESTINATION ${CONFIG_DIRECTORY_RELEASE}/${QT_PLUGINS_PLATFORMS})

 FOREACH(DLL_FILE_NAME ${CONFIG_DLL_OPTIONAL})
 	IF(DLL_FILE_NAME)


feature: compatible with cuda 11.x

feature: compatible with cuda 11.x

--- cmake/Cuda.cmake
+++ cmake/Cuda.cmake
@@ -1,9 +1,9 @@
 set(main_arch)
-set(known_archs 20 21 30 35 37 50 52 60 61 70 72 75 80)
-set(known_archs8 20 21 30 35 37 50 52 60 61)
-set(known_archs9 30 35 37 50 52 60 61 70 72)
-set(known_archs10 30 35 37 50 52 60 61 70 72 75)
-set(known_archs11 52 60 61 70 72 75 80)
+set(known_archs 30 32 35 37 50 52 53 60 61 62 70 72 75 80 86)
+set(known_archs9 30 32 35 37 50 52 53 60 61 62 70 72)
+set(known_archs10 30 32 35 37 50 52 53 60 61 62 70 72 75)
+set(known_archs11 52 53 60 61 62 70 72 75 80)
+set(known_archs11x 52 53 60 61 62 70 72 75 80 86)

 function (detect_cuda_archs cuda_archs)
   if (NOT CUDA_gpu_detect_output)
@@ -31,7 +31,6 @@
                     ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

     if (__nvcc_res EQUAL 0)
-      string(REPLACE "2.1" "2.1(2.0)" __nvcc_out "${__nvcc_out}")
       set(CUDA_gpu_detect_output ${__nvcc_out} CACHE INTERNAL "Returned GPU architectures from detect_cuda_archs tool" FORCE)
     endif ()
   endif ()
@@ -46,16 +45,20 @@

 function (select_nvcc_arch_flags out_variable)
   if (${CUDA_VERSION_MAJOR} EQUAL 11)
-    set(known_archs ${known_archs11})
+    if (${CUDA_VERSION_MINOR} GREATER 0)
+      set(__known_archs ${known_archs11x})
+    else ()
+      set(__known_archs ${known_archs11})
+    endif ()
   elseif (${CUDA_VERSION_MAJOR} EQUAL 10)
-    set(known_archs ${known_archs10})
+    set(__known_archs ${known_archs10})
   elseif (${CUDA_VERSION_MAJOR} EQUAL 9)
-    set(known_archs ${known_archs9})
-  elseif (${CUDA_VERSION_MAJOR} EQUAL 8)
-    set(known_archs ${known_archs8})
+    set(__known_archs ${known_archs9})
+  else ()
+    set(__known_archs ${known_archs})
   endif ()

-  list(GET known_archs 0 main_arch)
+  list(GET __known_archs 0 main_arch)

   detect_cuda_archs(__cuda_arch)

@@ -66,7 +69,7 @@
   set(__nvcc_ptx_archs "")
   set(__nvcc_archs_readable "")
   foreach (__arch ${__cuda_arch})
-    list(FIND known_archs ${__arch} __arch_index)
+    list(FIND __known_archs ${__arch} __arch_index)
     if (${__arch_index} GREATER -1)
       set(__nvcc_ptx_archs "${__nvcc_ptx_archs},sm_${__arch}")
       list(APPEND __nvcc_archs_readable sm_${__arch})


Remove any inadvertent use of -march=native from DYNAMIC_ARCH builds

from #2143, -march=native precludes use of more specific options like -march=skylake-avx512 in individual kernels, and defeats the purpose of dynamic arch anyway.

--- cmake/arch.cmake
+++ cmake/arch.cmake
@@ -73,7 +73,8 @@
     endif ()
     if (NOT NO_AVX512)
       set(DYNAMIC_CORE ${DYNAMIC_CORE} SKYLAKEX)
-    endif ()
+      string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+   endif ()
     if (DYNAMIC_LIST)
 	set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST})
     endif ()


i made a fix to pods.cmake in libbot/bot2-vis, and am propagating it to drake.  (it really should get propagated everywhere).  the symptom was “no rule to make ___blah__ library” errors, which I have seen a lot.  Here is the commit log from my libbot commit:

resolved strange linking error for X11 libraries on ubuntu.  turned out to be a sort of core logic bug in pods.cmake (target_link_libraries wants a semi-colon delimited list of arguments, but pkg-config --libs returns a white-space delimited list).  ultimately, this was a long, hard battle to make it compile well on mac with homebrew. :)

git-svn-id: cf55bc44fb097054a32fc70455a459c940dbbffc@7719 c9849af7-e679-4ec6-a44e-fc146a885bd3

--- cmake/pods.cmake
+++ cmake/pods.cmake
@@ -388,7 +388,8 @@
     string(STRIP ${_pods_pkg_ldflags} _pods_pkg_ldflags)
     #    message("ldflags: ${_pods_pkg_ldflags}")
     include_directories(${_pods_pkg_include_flags})
-    target_link_libraries(${target} ${_pods_pkg_ldflags})
+    string(REPLACE " " ";" TMP ${_pods_pkg_ldflags}) # convert white-space delimited list to a semi-colon delimited list
+    target_link_libraries(${target} ${TMP})

     # make the target depend on libraries that are cmake targets
     if (_pods_pkg_ldflags)


fix for issue with ExternalProject.cmake.

the kitware team got back to me with a means to address the difficulty i was experiencing with specifying the installation directory for trio. see <http://public.kitware.com/Bug/view.php?id=12357> for full details.

--- cmake/trio.cmake
+++ cmake/trio.cmake
@@ -110,6 +110,10 @@
 			# worry too much about it. when i'm aware that a fix has been
 			# released, i'll reenable tests.
 			#TEST_BEFORE_INSTALL ${TRIO_RUN_TESTS}
+			# the PREFIX keyword argument doesn't propigate to the external
+			# project's CMake configuration, so i specify it here explicitly.
+			# see <http://public.kitware.com/Bug/view.php?id=12357>.
+			CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${TRIO_DEFAULT_PREFIX}
 			# WORKAROUND: the following option needs to be last, as CMake
 			# appears to confuse arguments that follow for part of the
 			# command.


Reverted back to an old version of FindBoost.cmake. It now works on Mac again.
ticket #77

git-svn-id: 4ba210d0a933e3fb1aa9ab096f190cd38965d92a@928 fa922fa7-2fde-0310-acd8-f43f465a7996

--- src/CMake/boost/FindBoost.cmake
+++ src/CMake/boost/FindBoost.cmake
@@ -207,24 +207,8 @@
 	-gcc41-mt
 	-gcc41-mt-s
     )
-
-	set(BOOST_INCLUDE_SEARCH_DIRS
-      $ENV{BOOST_ROOT}/include
-      $ENV{BOOST_ROOT}
-	  /usr
-	  /usr/local
-	  )
-    set(BOOST_LIBRARIES_SEARCH_DIRS
-      $ENV{BOOST_ROOT}/lib
-      $ENV{BOOST_ROOT}
-	  /usr
-	  /usr/local
-	  )
-
   endif (WIN32)

-  MESSAGE(STATUS "Searching for boost: ${BOOST_INCLUDE_SEARCH_DIRS}")
-
   find_path(BOOST_INCLUDE_DIR
     NAMES
       boost/config.hpp
@@ -232,7 +216,6 @@
       ${BOOST_INCLUDE_SEARCH_DIRS}
     PATH_SUFFIXES
       ${BOOST_PATH_SUFFIX}
-	NO_DEFAULT_PATH
   )

   foreach (TMP_BOOST_LIBRARIES_SUFFIX ${BOOST_LIBRARIES_SUFFIXES} "")
@@ -243,7 +226,6 @@
           boost_date_time${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )

       if (BOOST_DATE_TIME_LIBRARY)
@@ -264,7 +246,6 @@
           boost_filesystem${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_FILESYSTEM_LIBRARY)

@@ -274,7 +255,6 @@
           boost_iostreams${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_IOSTREAMS_LIBRARY)

@@ -284,7 +264,6 @@
           boost_prg_exec_monitor${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_PRG_EXEC_MONITOR_LIBRARY)

@@ -294,7 +273,6 @@
           boost_program_options${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_PROGRAM_OPTIONS_LIBRARY)

@@ -304,7 +282,6 @@
           boost_python${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_PYTHON_LIBRARY)

@@ -314,7 +291,6 @@
           boost_regex${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_REGEX_LIBRARY)

@@ -324,7 +300,6 @@
           boost_serialization${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_SERIALIZATION_LIBRARY)

@@ -334,7 +309,6 @@
           boost_signals${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_SIGNALS_LIBRARY)

@@ -349,7 +323,6 @@
           ${_name}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_TEST_EXEC_MONITOR_LIBRARY)

@@ -360,7 +333,6 @@
           boost_thread-mt
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_THREAD_LIBRARY)

@@ -376,7 +348,6 @@
           ${_boost_unit_test_lib_name}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_UNIT_TEST_FRAMEWORK_LIBRARY)

@@ -386,7 +357,6 @@
           boost_wserialization${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
-		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_WSERIALIZATION_LIBRARY)


MOD: Added the possibility to find OIS if stored as Ogre dependency

--- cmake/FindOIS.cmake
+++ cmake/FindOIS.cmake
@@ -14,17 +14,23 @@

 find_path(OIS_H_PATH NAMES OIS.h
-        PATHS ${OIS_PREFIX_PATH}
-        PATH_SUFFIXES OIS include includes)
+          PATHS ${OIS_PREFIX_PATH}
+          PATH_SUFFIXES OIS include includes)
+
+if(NOT OIS_H_PATH)
+    find_path(OIS_H_PATH NAMES OIS.h
+              PATHS ${OIS_PREFIX_PATH}
+              PATH_SUFFIXES OIS include include/OIS)
+endif()

 find_library(OIS_LIB NAMES OIS libOIS
-        PATHS ${OIS_PREFIX_PATH}
-        PATH_SUFFIXES Release lib/Release
-        )
+             PATHS ${OIS_PREFIX_PATH}
+             PATH_SUFFIXES Release lib/Release)
+
 find_library(OIS_LIB_DBG NAMES OIS_d libOIS_d
-        PATHS ${OIS_PREFIX_PATH}
-        PATH_SUFFIXES Debug lib/Debug
-        )
+             PATHS ${OIS_PREFIX_PATH}
+             PATH_SUFFIXES Debug lib/Debug)
+
 mark_as_advanced(OIS_H_PATH OIS_LIB OIS_LIB_DBG)

 find_package_handle_standard_args(OIS DEFAULT_MSG OIS_LIB OIS_H_PATH)


add doc for TBB module

add doc for TBB module

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -1,3 +1,19 @@
+# Find Intel Threading Building Blocks library
+#
+# This module can be used to find TBB headers and libraries
+#
+# The following variables are set
+#
+# TBB_FOUND          - TRUE if TBB is found and work correctly
+# TBB_INCLUDE_DIR    - The directory containing TBB headers, e.g., tbb/tbb.h
+# TBB_LINK_LIBRARIES - TBB libraries that shall be linked to
+#
+# The following variables affect the behavior of this module
+# TBB_ROOT    - The root to the TBB headers and libraries, e.g., /opt/intel/tbb
+#             - Under which one can find include, lib or lib/intel64 etc.
+# TBB_INC_DIR - The path to which CMake shall attempt to find headers first
+# TBB_LIB_DIR - The path to which CMake shall attempt to find libraries first
+
 IF (TBB_FOUND)
     RETURN ()
 ELSE (TBB_FOUND)


Fixed a problem with the cmake install scripts and mingw.

--- cmake/Install.cmake
+++ cmake/Install.cmake
@@ -1,6 +1,6 @@
 # Add the Jatta target
 set(INSTALL_TARGET_LIST "# Jatta")
-if(${Jatta_STATIC})
+if(Jatta_STATIC)

     set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nadd_library(Jatta STATIC IMPORTED)")

@@ -15,7 +15,12 @@
 get_target_property(__LOCATION Jatta LOCATION)
 get_filename_component(__FILENAME "${__LOCATION}" NAME)
 set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(Jatta PROPERTIES IMPORTED_LOCATION \"\${CMAKE_CURRENT_LIST_DIR}/../${Jatta_LIB_DIR}/${__FILENAME}\")")
-set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(Jatta PROPERTIES IMPORTED_IMPLIB \"\${CMAKE_CURRENT_LIST_DIR}/../${Jatta_LIB_DIR}/${__FILENAME}\")")
+
+if(WIN32 AND Jatta_STATIC)
+
+    set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(Jatta PROPERTIES IMPORTED_IMPLIB \"\${CMAKE_CURRENT_LIST_DIR}/../${Jatta_LIB_DIR}/${__FILENAME}\")")
+
+endif()

 # Add an import for each configuration
 foreach(__CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
@@ -27,7 +32,12 @@

         get_filename_component(__FILENAME "${__LOCATION}" NAME)
         set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(Jatta PROPERTIES IMPORTED_LOCATION_${__CONFIGURATION} \"\${CMAKE_CURRENT_LIST_DIR}/../${Jatta_LIB_DIR}/${__FILENAME}\")")
-        set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(Jatta PROPERTIES IMPORTED_IMPLIB_${__CONFIGURATION} \"\${CMAKE_CURRENT_LIST_DIR}/../${Jatta_LIB_DIR}/${__FILENAME}\")")
+
+        if(WIN32 AND NOT Jatta_STATIC)
+
+            set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(Jatta PROPERTIES IMPORTED_IMPLIB_${__CONFIGURATION} \"\${CMAKE_CURRENT_LIST_DIR}/../${Jatta_LIB_DIR}/${__FILENAME}\")")
+
+        endif()

     endif()

@@ -87,7 +97,7 @@
                 set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(${__LIBRARY} PROPERTIES IMPORTED_LOCATION${__CONFIGURATION} \"\${CMAKE_CURRENT_LIST_DIR}/../${Jatta_LIB_DIR}/${__FILENAME}\")")

                 # Special case for MSVC, need to set IMPORTED_IMPLIB too
-                if(MSVC)
+                if(WIN32 AND ${__LIBRARY}_SHARED)

                     set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(${__LIBRARY} PROPERTIES IMPORTED_IMPLIB${__CONFIGURATION} \"\${CMAKE_CURRENT_LIST_DIR}/../${Jatta_LIB_DIR}/${__FILENAME}\")")

@@ -99,7 +109,7 @@
                 set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(${__LIBRARY} PROPERTIES IMPORTED_LOCATION${__CONFIGURATION} \"${__LOCATION}\")")

                 # Special case for MSVC, need to set IMPORTED_IMPLIB too
-                if(MSVC)
+                if(WIN32 AND ${__LIBRARY}_SHARED)

                     set(INSTALL_TARGET_LIST "${INSTALL_TARGET_LIST}\nset_target_properties(${__LIBRARY} PROPERTIES IMPORTED_IMPLIB${__CONFIGURATION} \"${__LOCATION}\")")


Using PythonInterp instead of Python2...

Because Ubuntu's cmake version is old.

--- cmake/duktape.cmake
+++ cmake/duktape.cmake
@@ -19,15 +19,15 @@
     if(DUKTAPE_LIBRARY)
         find_path(DUKTAPE_INCLUDE_DIR name duktape.h)
     else()
-        find_package (Python2 COMPONENTS Interpreter Development)
-        if(Python2_EXECUTABLE)
+        find_package (PythonInterp 2.7 REQUIRED)
+        if(PYTHON_EXECUTABLE)
             file(WRITE ${CMAKE_BINARY_DIR}/find_pyyaml.py "import imp\ntry:\n\timp.find_module('yaml')\n\tprint 'PYYAML-FOUND'\nexcept ImportError:\n\tprint 'PYYAML-NOTFOUND'\n")
-            execute_process ( COMMAND ${Python2_EXECUTABLE} ${CMAKE_BINARY_DIR}/find_pyyaml.py OUTPUT_VARIABLE PYYAML OUTPUT_STRIP_TRAILING_WHITESPACE)
+            execute_process ( COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/find_pyyaml.py OUTPUT_VARIABLE PYYAML OUTPUT_STRIP_TRAILING_WHITESPACE)
             if(NOT PYYAML)
                 message(STATUS "PYYAML module not found, attempting install")
-                execute_process ( COMMAND ${Python2_EXECUTABLE} -m pip install pyyaml RESULT_VARIABLE PIP_INSTALL_RESULT)
+                execute_process ( COMMAND ${PYTHON_EXECUTABLE} -m pip install pyyaml RESULT_VARIABLE PIP_INSTALL_RESULT)
                 if(NOT PIP_INSTALL_RESULT EQUAL 0)
-                    message(FATAL_ERROR "PYYAML instalation failed. Try manual instalation Interpreter found was: ${Python2_EXECUTABLE}")
+                    message(FATAL_ERROR "PYYAML instalation failed. Try manual instalation Interpreter found was: ${PYTHON_EXECUTABLE}")
                 endif()
             endif()
         else()


fptu: find GoogleTest on Windows.

fptu: find GoogleTest on Windows.

--- cmake/testing.cmake
+++ cmake/testing.cmake
@@ -1,114 +1,197 @@
+## Copyright 2010-2017 libfptu authors: please see AUTHORS file.
+##
+## This file is part of libfptu, aka "Fast Positive Tables".
+##
+## libfptu is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## libfptu is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with libfptu.  If not, see <http://www.gnu.org/licenses/>.
+##
+
+# Expected GTest was already found and/or pointed via ${gtest_root},
+# otherwise will search at ${gtest_paths} locations, if defined or default ones.
 find_package(GTest)
-include(ExternalProject)

 if(NOT GTEST_FOUND)
-    message(STATUS "Lookup gtest sources...")
-    find_path(GTEST_CMAKE_PROJ
-        NAMES CMakeLists.txt
-        PATHS /usr/src /usr/local /usr/local/src
-        PATH_SUFFIXES gtest
-        NO_DEFAULT_PATH NO_CMAKE_PATH)
-    message(STATUS "GTEST_CMAKE_PROJ = ${GTEST_CMAKE_PROJ}")
-    if(GTEST_CMAKE_PROJ)
-        externalproject_add(GTEST PREFIX "${CMAKE_BINARY_DIR}/gtest" SOURCE_DIR "${GTEST_CMAKE_PROJ}" INSTALL_COMMAND "" CMAKE_ARGS "-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}")
-        set(GTEST_BUILTIN TRUE)
-        set(GTEST_FOUND "${GTEST_CMAKE_PROJ}")
+  message(STATUS "Lookup GoogleTest sources...")
+  if(NOT gtest_paths)
+    if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+      set(gtest_paths
+        $ENV{SystemDrive}/
+        $ENV{SystemDrive}/Source $ENV{USERPROFILE}/Source $ENV{PUBLIC}/Source
+        $ENV{SystemDrive}/Source/Repos $ENV{USERPROFILE}/Source/Repos $ENV{PUBLIC}/Source/Repos)
+    else()
+      set(gtest_paths /usr/src /usr/local /usr/local/src)
+    endif()
+  endif()
+  # message(STATUS "gtest_paths = ${gtest_paths}")

-        get_filename_component(GTEST_DIR "${GTEST_CMAKE_PROJ}" PATH)
-        if(NOT GTEST_INCLUDE_DIRS)
-            find_path(GTEST_INCLUDE_DIRS gtest/gtest.h "${GTEST_DIR}")
-        endif()
+  find_path(gtest_root
+    NAMES CMakeLists.txt
+    PATHS ${gtest_paths}
+    PATH_SUFFIXES googletest/googletest gtest/googletest gtest
+    NO_DEFAULT_PATH NO_CMAKE_PATH)

-        set(GTEST_LIBDIR "${CMAKE_BINARY_DIR}/gtest/src/GTEST-build")
-	if(BUILD_SHARED_LIBS)
-            set(GTEST_LIBRARIES "${GTEST_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gtest${CMAKE_SHARED_LIBRARY_SUFFIX}")
-            set(GTEST_MAIN_LIBRARIES "${GTEST_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gtest_main${CMAKE_SHARED_LIBRARY_SUFFIX}")
-	else()
-            set(GTEST_LIBRARIES "${GTEST_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            set(GTEST_MAIN_LIBRARIES "${GTEST_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
-	endif()
-        set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
+  if(gtest_root)
+    message(STATUS "Found GoogleTest sources at ${gtest_root}, attach as ExternalProject")
+    unset(GTEST_INCLUDE_DIR CACHE)
+    unset(GTEST_LIBRARY CACHE)
+    unset(GTEST_LIBRARY_DEBUG CACHE)
+    unset(GTEST_MAIN_LIBRARY CACHE)
+    unset(GTEST_MAIN_LIBRARY_DEBUG CACHE)
+    unset(GTEST_BOTH_LIBRARIES CACHE)
+    unset(GTEST_FOUND CACHE)
+
+    include(ExternalProject)
+    externalproject_add(
+      GoogleTest PREFIX "${CMAKE_BINARY_DIR}/gtest"
+      SOURCE_DIR ${gtest_root}
+      INSTALL_COMMAND ""
+      CMAKE_ARGS "-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}" "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" "-Dgtest_force_shared_crt:BOOL=ON"
+      )
+
+    ExternalProject_Get_Property(GoogleTest source_dir)
+    set(GTEST_INCLUDE_DIR ${source_dir}/include)
+    unset(source_dir)
+
+    ExternalProject_Get_Property(GoogleTest binary_dir)
+    if(CMAKE_CONFIGURATION_TYPES)
+      set(binary_dir ${binary_dir}/${CMAKE_BUILD_TYPE})
     endif()
+    if(BUILD_SHARED_LIBS)
+      add_library(gtest SHARED IMPORTED)
+      add_library(gtest_main SHARED IMPORTED)
+      set(GTEST_LIBRARY ${binary_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}gtest${CMAKE_SHARED_LIBRARY_SUFFIX})
+      set(GTEST_MAIN_LIBRARY ${binary_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}gtest_main${CMAKE_SHARED_LIBRARY_SUFFIX})
+      if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+        set_property(TARGET gtest PROPERTY IMPORTED_IMPLIB ${binary_dir}/${CMAKE_IMPORT_LIBRARY_PREFIX}gtest${CMAKE_IMPORT_LIBRARY_SUFFIX})
+        set_property(TARGET gtest_main PROPERTY IMPORTED_IMPLIB ${binary_dir}/${CMAKE_IMPORT_LIBRARY_PREFIX}gtest_main${CMAKE_IMPORT_LIBRARY_SUFFIX})
+      endif()
+    else()
+      add_library(gtest STATIC IMPORTED)
+      add_library(gtest_main STATIC IMPORTED)
+      set(GTEST_LIBRARY ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
+      set(GTEST_MAIN_LIBRARY ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX})
+    endif()
+    unset(binary_dir)
+    add_dependencies(gtest GoogleTest)
+    add_dependencies(gtest_main GoogleTest)
+
+    set_property(TARGET gtest PROPERTY IMPORTED_LOCATION ${GTEST_LIBRARY})
+    set_property(TARGET gtest_main PROPERTY IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY})
+
+    set(GTEST_BOTH_LIBRARIES gtest gtest_main)
+    set(GTEST_FOUND TRUE)
+
+    # message(STATUS "GTEST_INCLUDE_DIR = ${GTEST_INCLUDE_DIR}")
+    # message(STATUS "GTEST_LIBRARY = ${GTEST_LIBRARY}")
+    # message(STATUS "GTEST_MAIN_LIBRARY = ${GTEST_MAIN_LIBRARY}")
+    # message(STATUS "GTEST_BOTH_LIBRARIES = ${GTEST_BOTH_LIBRARIES}")
+  else()
+    message(STATUS "NOT FOUND GoogleTest at paths ${gtest_paths}, testing not be enabled")
+  endif()
 endif()

 if(GTEST_FOUND)
-    include (CTest)
-    enable_testing ()
-    set(UT_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS})
-    set(UT_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
-    if(MEMORYCHECK_COMMAND OR CMAKE_MEMORYCHECK_COMMAND)
-        add_custom_target(test_memcheck
-            COMMAND ${CMAKE_CTEST_COMMAND}
-            --force-new-ctest-process --test-action memcheck
-            COMMAND ${CAT} "${CMAKE_BINARY_DIR}/Testing/Temporary/MemoryChecker.*.log")
-    endif()
+  include(CTest)
+  enable_testing()
+  set(UT_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR})
+  set(UT_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+  if(MEMORYCHECK_COMMAND OR CMAKE_MEMORYCHECK_COMMAND)
+    add_custom_target(test_memcheck
+      COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --test-action memcheck
+      COMMAND ${CAT} "${CMAKE_BINARY_DIR}/Testing/Temporary/MemoryChecker.*.log")
+  endif()
 else()
-    set(UT_INCLUDE_DIRECTORIES "")
-    set(UT_LIBRARIES "")
+  set(UT_INCLUDE_DIRECTORIES "")
+  set(UT_LIBRARIES "")
 endif()

 function(add_gtest name)
-    set(options DISABLED)
-    set(oneValueArgs TIMEOUT PREFIX)
-    set(multiValueArgs SOURCE LIBRARY INCLUDE_DIRECTORY DEPEND)
-    cmake_parse_arguments(params "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+  set(options DISABLED)
+  set(oneValueArgs TIMEOUT PREFIX)
+  set(multiValueArgs SOURCE LIBRARY INCLUDE_DIRECTORY DEPEND DLLPATH)
+  cmake_parse_arguments(params "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-    if(params_UNPARSED_ARGUMENTS)
-        message(FATAL_ERROR "Unknown keywords given to add_gtest(): \"${params_UNPARSED_ARGUMENTS}\".")
+  if(params_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "Unknown keywords given to add_gtest(): \"${params_UNPARSED_ARGUMENTS}\".")
+  endif()
+
+  if(GTEST_FOUND)
+    macro(oops)
+      message(FATAL_ERROR "add_gtest(): Opps, " ${ARGV})
+    endmacro()
+
+    if(NOT params_SOURCE)
+      set(params_SOURCE ${name}.cpp)
     endif()

-    if(GTEST_FOUND)
-        macro(oops)
-            message(FATAL_ERROR "add_gtest(): Opps, " ${ARGV})
-        endmacro()
+    set(target "${params_PREFIX}${name}")
+    add_executable(${target} ${params_SOURCE})

-        if(NOT params_SOURCE)
-            set(params_SOURCE ${name}.cpp)
+    if(params_DEPEND)
+      add_dependencies(${target} ${params_DEPEND})
+    endif()
+
+    target_link_libraries(${target} ${UT_LIBRARIES})
+
+    if(params_LIBRARY)
+      target_link_libraries(${target} ${params_LIBRARY})
+    endif()
+
+    foreach(dep IN LISTS params_LIBRARY GTEST_BOTH_LIBRARIES)
+      get_target_property(type ${dep} TYPE)
+      if(${type} STREQUAL "SHARED_LIBRARY")
+        get_target_property(filename ${dep} IMPORTED_LOCATION)
+        if(NOT filename)
+          set(dir $<TARGET_FILE_DIR:${dep}>)
+          #get_target_property(filename ${dep} LOCATION)
+          #get_filename_component(dir ${filename} DIRECTORY)
+        else()
+          get_filename_component(dir ${filename} DIRECTORY)
         endif()
+        list(APPEND params_DLLPATH ${dir})
+      endif()
+    endforeach(dep)

-        set(target "${params_PREFIX}${name}")
-        add_executable(${target} ${params_SOURCE})
+    if(params_INCLUDE_DIRECTORY)
+      set_target_properties(${target} PROPERTIES INCLUDE_DIRECTORIES ${params_INCLUDE_DIRECTORY})
+    endif()

-        if(GTEST_BUILTIN)
-            add_dependencies(${target} GTEST)
+    if(NOT params_DISABLED)
+      add_test(${name} ${target})
+      if(params_TIMEOUT)
+        if(MEMORYCHECK_COMMAND OR CMAKE_MEMORYCHECK_COMMAND)
+          # FIXME: unless there are any other ideas how to fix the
+          #        timeouts problem when testing under Valgrind.
+          math(EXPR params_TIMEOUT "${params_TIMEOUT} * 42")
         endif()
-
-        if(params_DEPEND)
-            add_dependencies(${target} ${params_DEPEND})
-        endif()
-
-        target_link_libraries(${target} ${UT_LIBRARIES})
-
-        if(params_LIBRARY)
-            target_link_libraries(${target} ${params_LIBRARY})
-        endif()
-
-        if(params_INCLUDE_DIRECTORY)
-            set_target_properties(${target} PROPERTIES INCLUDE_DIRECTORIES ${params_INCLUDE_DIRECTORY})
-        endif()
-
-        if(NOT params_DISABLED)
-            add_test(${name} ${target})
-            if(params_TIMEOUT)
-                if(MEMORYCHECK_COMMAND OR CMAKE_MEMORYCHECK_COMMAND)
-                    # FIXME: unless there are any other ideas how to fix the
-                    #        timeouts problem when testing under Valgrind.
-                    math(EXPR params_TIMEOUT "${params_TIMEOUT} * 42")
-                endif()
-                set_tests_properties(${name} PROPERTIES TIMEOUT ${params_TIMEOUT})
-            endif()
-        endif()
+        set_tests_properties(${name} PROPERTIES TIMEOUT ${params_TIMEOUT})
+      endif()
+      if(params_DLLPATH)
+        list(REMOVE_DUPLICATES params_DLLPATH)
+        set_tests_properties(${name} PROPERTIES ENVIRONMENT "PATH=${params_DLLPATH};$ENV{PATH}")
+      endif()
     endif()
+  endif()
 endfunction(add_gtest)

 function(add_ut name)
-    add_gtest(${name} PREFIX "ut_" ${ARGN})
+  add_gtest(${name} PREFIX "ut_" ${ARGN})
 endfunction(add_ut)

 function(add_long_test name)
-    add_gtest(${name} PREFIX "lt_" DISABLED ${ARGN})
+  add_gtest(${name} PREFIX "lt_" DISABLED ${ARGN})
 endfunction(add_long_test)

 function(add_perf_test name)
-    add_gtest(${name} PREFIX "pt_" DISABLED ${ARGN})
+  add_gtest(${name} PREFIX "pt_" DISABLED ${ARGN})
 endfunction(add_perf_test)


erthink-cmake: fix/support for latest gtest.

--- cmake/testing.cmake
+++ cmake/testing.cmake
@@ -17,6 +17,15 @@
 include(CTest)
 if(BUILD_TESTING)
   cmake_policy(PUSH)
+  if(NOT DEFINED BUILD_GTEST)
+    set(BUILD_GTEST ON CACHE BOOL "Builds the googletest subproject")
+  endif()
+  if(NOT DEFINED BUILD_GMOCK)
+    set(BUILD_GMOCK OFF CACHE BOOL "Builds the googlemock subproject")
+  endif()
+  if(NOT DEFINED INSTALL_GTEST)
+    set(INSTALL_GTEST OFF CACHE BOOL "Enable installation of googletest")
+  endif()

   cmake_policy(SET CMP0042 NEW)
   cmake_policy(SET CMP0054 NEW)
@@ -69,12 +78,17 @@
         if(result)
           message(FATAL_ERROR "Build step for GoogleTest failed: ${result}")
         else()
-          set(gtest_root "${CMAKE_BINARY_DIR}/googletest-src/googletest")
+          set(gtest_root "${CMAKE_BINARY_DIR}/googletest-src")
         endif()
       endif()
     endif()

     if(gtest_root)
+      get_filename_component(gtest_root "${gtest_root}" REALPATH)
+      if(EXISTS "${gtest_root}/../googlemock/CMakeLists.txt"
+          AND EXISTS "${gtest_root}/../CMakeLists.txt")
+        get_filename_component(gtest_root "${gtest_root}/.." ABSOLUTE)
+      endif()
       unset(GTEST_INCLUDE_DIR CACHE)
       unset(GTEST_LIBRARY CACHE)
       unset(GTEST_LIBRARY_DEBUG CACHE)


Use bash from find_package

Use bash from find_package

This fix an issue on freebsd where bash is in /usr/local/bin/

--- Module/FileInformation.cmake
+++ Module/FileInformation.cmake
@@ -60,6 +60,7 @@

 get_filename_component(FileInformation_CMAKE_MODULE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
 set (FileInformation_CMAKE_MODULE_VERSION "1.2.0")
+find_program(BASH bash)

 # private function which invokes platform specific helper script
 function (_invoke_helper_script _command _filePath _outputVar _exitCodeVar)
@@ -79,7 +80,7 @@
 	endif()
 	string (TOLOWER "${_command}" _cmd)
 	execute_process(
-		COMMAND "${_helperScript}" "--${_cmd}" "${_filePath}"
+		COMMAND "${BASH}" "${_helperScript}" "--${_cmd}" "${_filePath}"
 		TIMEOUT 5
 		RESULT_VARIABLE _result
 		OUTPUT_VARIABLE _output


Removing -m32 flag.

Removing -m32 flag.

--- cmake/conf.cmake
+++ cmake/conf.cmake
@@ -7,11 +7,11 @@
 if(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
 	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
 elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
-	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -m32 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden")
-	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -m32 -fvisibility=hidden")
+	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden")
+	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fvisibility=hidden")
 else()
-	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -m32 -std=c++14 -fvisibility=hidden -fvisibility-inlines-hidden")
-	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -m32 -fvisibility=hidden")
+	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++14 -fvisibility=hidden -fvisibility-inlines-hidden")
+	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fvisibility=hidden")
 endif()

 # Define DLLEXPORT and DLLIMPORT


#15: Added paths for finding Qt and OpenCV on Windows.

--- cmake/deps.cmake
+++ cmake/deps.cmake
@@ -1,6 +1,6 @@
 # Qt 5
+# Added some paths to help find the modules on some systems.
 if (NOT WIN32)
-  # Added some paths to help find the modules on some systems.
   set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}
     "/usr/local/opt"
     "/usr/local/opt/qt5"
@@ -9,6 +9,9 @@
     "/usr/local/Qt-5.3.1"
     "/usr/local/Qt-5.3.0"
     "/usr/local/Qt-5.2.1")
+else()
+  set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}
+    "C:/qt-everywhere-opensource-src-5.4.0-w64/qtbase/lib/cmake")
 endif()

 set(CMAKE_AUTOMOC ON) # moc when necessary.
@@ -35,4 +38,8 @@
 endif()

 # OpenCV
+if (WIN32)
+  set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}
+    "C:/opencv/build")
+endif()
 find_package(OpenCV REQUIRED)


cmake: Fix java protoc commands

cmake: Fix java protoc commands

--- cmake/java.cmake
+++ cmake/java.cmake
@@ -36,6 +36,7 @@
   #message(STATUS "protoc java: ${PROTO_JAVA}")
   add_custom_command(
     OUTPUT ${PROTO_JAVA}
+    COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/java/com/google/${PROTO_DIR}
     COMMAND protobuf::protoc
     "--proto_path=${PROJECT_SOURCE_DIR}"
     "--java_out=${PROJECT_BINARY_DIR}/java/com/google/${PROTO_DIR}"


removing deduplicatin of flags

removing deduplicatin of flags

--- build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
+++ build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
@@ -60,7 +60,6 @@
              CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
         if( ${flag_var} )
             separate_arguments(${flag_var})
-            list(REMOVE_DUPLICATES ${flag_var})
             string(REPLACE ";" " " ${flag_var} "${${flag_var}}")
         endif()
     endforeach ()


Custom command depend is automatic

Custom command depend is automatic

--- CMake/GenerateBindings.cmake
+++ CMake/GenerateBindings.cmake
@@ -109,6 +109,6 @@
 		OUTPUT ${BINDING_OUTPUTS}
 		COMMAND lua BindingsProcessor.lua
 		WORKING_DIRECTORY ${BINDINGS_FOLDER}
-		DEPENDS ${BINDING_DEPENDENCIES} lua
+		DEPENDS ${BINDING_DEPENDENCIES}
 	)
 endfunction()


Add SYSTEM to includes of HPX headers

Add SYSTEM to includes of HPX headers

--- cmake/DevBaseExternal.cmake
+++ cmake/DevBaseExternal.cmake
@@ -267,7 +267,10 @@
         message(STATUS "  includes : ${HPX_INCLUDE_DIRS}")
         message(STATUS "  libraries: ${HPX_LIBRARIES}")

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

         # Check whether we are using the same build type as HPX
         if (NOT "${HPX_BUILD_TYPE}" STREQUAL "${CMAKE_BUILD_TYPE}")


Add latex and doxygen to find libs script

--- cmake/FishDetFindLibs.cmake
+++ cmake/FishDetFindLibs.cmake
@@ -58,6 +58,18 @@
   message( FATAL_ERROR "Could not find OpenGL.  Build cannot continue." )
 endif()

+# --- Doxygen ---
+find_package( Doxygen )
+if( NOT DOXYGEN_FOUND )
+  message( WARNING "Could not find Doxygen.  Documentation target will be unavailable." )
+endif()
+
+# --- LATEX ---
+find_package( LATEX )
+if( NOT LATEX_FOUND )
+  message( WARNING "Could not find LATEX.  Documentation target will be unavailable." )
+endif()
+
 # --- Windows ---
 if( MSVC )
   set( WINDOWS_LIBRARIES


More accurate deb package build fix for CUDA 6.5 and newer.

(cherry picked from commit b2790973a32eb662c165a921afe03dbfd2c65269)

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -68,7 +68,7 @@

 if(HAVE_CUDA)
   string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
-  if(${CUDA_VERSION} VERSION_LESS "6.5")
+  if(CUDA_VERSION VERSION_LESS "6.5")
     set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
     set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
   else()
@@ -83,8 +83,8 @@
       set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cublas-dev-${cuda_version_suffix}")
     endif()
   endif()
+
   set(CPACK_COMPONENT_dev_DEPENDS libs)
-
 endif()

 if(NOT OPENCV_CUSTOM_PACKAGE_INFO)


Update SetupTestConfig.cmake

Update SetupTestConfig.cmake

--- cmake/SetupTestConfig.cmake
+++ cmake/SetupTestConfig.cmake
@@ -6,8 +6,8 @@
 #                                                                                #
 ####################################################################################################

-SET(CTEST_PROJECT_NAME    "DCSC08961")
+SET(CTEST_PROJECT_NAME    "DCS08961")
 SET(CTEST_DROP_METHOD     "http")
 SET(CTEST_DROP_SITE       "www.cdash.org")
-SET(CTEST_DROP_LOCATION   "/CDash/submit.php?project=DCSC08961")
+SET(CTEST_DROP_LOCATION   "/CDash/submit.php?project=DCS08961")
 SET(CTEST_DROP_SITE_CDASH TRUE)


Fixed missing $ in testing BOOST_HOME environmental variable.

--- cmake/ThirdPartyBoost.cmake
+++ cmake/ThirdPartyBoost.cmake
@@ -92,7 +92,7 @@

     #If the user has not set BOOST_ROOT, look in a couple common places first.
     IF( NOT BOOST_ROOT )
-        SET(TEST_ENV ENV{BOOST_HOME})
+        SET(TEST_ENV $ENV{BOOST_HOME})
         IF (DEFINED TEST_ENV)
             SET(Boost_NO_SYSTEM_PATHS ON)
             SET(BOOST_ROOT $ENV{BOOST_HOME})


undo spdlog MSVC version change

undo spdlog MSVC version change

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -172,7 +172,7 @@
 hunter_config(renderproto VERSION 0.11.1)
 hunter_config(sm VERSION 1.2.1)
 hunter_config(sparsehash VERSION 2.0.2)
-if(MSVC_VERSION LESS 1800)
+if(MSVC_VERSION LESS 1900)
     # for VS12 - version without support C++11
   hunter_config(spdlog VERSION 1.0.0-p0)
 else()