Disable test submission if CTEST_SUBMIT_URL is undefined.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -235,7 +235,9 @@
 endif()
 ctest_build()
 ctest_test(STOP_ON_FAILURE)
-ctest_submit(PARTS Start Update Configure Build Test Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+if(DEFINED ${CTEST_SUBMIT_URL})
+    ctest_submit(PARTS Start Update Configure Build Test Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+endif()

 # Coverage
 if(CC_NAME STREQUAL "gcc")
@@ -319,7 +321,9 @@
         exec_program(chmod $ENV{HOME} ARGS +x codecov.io)
         exec_program($ENV{HOME}/codecov.io ${CTEST_SOURCE_DIRECTORY} ARGS -X gcov -s ${CTEST_BINARY_DIRECTORY})
     endif()
-    ctest_submit(PARTS Start Update Configure Build Test Coverage Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    if(DEFINED ${CTEST_SUBMIT_URL})
+        ctest_submit(PARTS Start Update Configure Build Test Coverage Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    endif()
 endif()

 # Static analysis
@@ -340,7 +344,9 @@
         ctest_configure(OPTIONS "-DKD_BUILD_TESTS=0;-DCI_FLAGS=${CC_ANALYSE_FLAGS}")
     endif()
     ctest_build()
-    ctest_submit(PARTS Start Update Configure Build Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    if(DEFINED ${CTEST_SUBMIT_URL})
+        ctest_submit(PARTS Start Update Configure Build Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    endif()
 endif()

 # Dynamic analysis (Valgrind)
@@ -364,7 +370,9 @@
     ctest_build()
     ctest_test(STOP_ON_FAILURE)
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    if(DEFINED ${CTEST_SUBMIT_URL})
+        ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    endif()
     set(CTEST_MEMORYCHECK_COMMAND "")
     set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "")
 endif()
@@ -425,7 +433,9 @@
     ctest_build()
     ctest_test(STOP_ON_FAILURE)
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    if(DEFINED ${CTEST_SUBMIT_URL})
+        ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    endif()
 endif()

 # Dynamic analysis (MSan)
@@ -453,7 +463,9 @@
     ctest_build()
     ctest_test(STOP_ON_FAILURE)
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    if(DEFINED ${CTEST_SUBMIT_URL})
+        ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    endif()
 endif()

 # Dynamic analysis(TSan)
@@ -492,7 +504,9 @@
     ctest_build()
     ctest_test(STOP_ON_FAILURE)
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    if(DEFINED ${CTEST_SUBMIT_URL})
+        ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    endif()
 endif()

 # Dynamic analysis (UBSan)
@@ -526,5 +540,7 @@
     ctest_build()
     ctest_test(STOP_ON_FAILURE)
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    if(DEFINED ${CTEST_SUBMIT_URL})
+        ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
+    endif()
 endif()


Use UrbiOpenSSL.

Use UrbiOpenSSL.

	* build-aux/cmake/modules/FindSdkEngine.cmake: Here.

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

--- build-aux/cmake/modules/FindSdkEngine.cmake
+++ build-aux/cmake/modules/FindSdkEngine.cmake
@@ -22,7 +22,7 @@
 ##-----------------------------------------------------------------

 # Dependencies
-find_package(OpenSSL REQUIRED)
+find_package(UrbiOpenSSL REQUIRED)

 set(PACKAGE_FULLNAME "URBI SDK Engine")

@@ -78,8 +78,8 @@
 package_header(${CMAKE_CURRENT_LIST_FILE})

 # Add dependencies to the SDK engine
-list(APPEND ${PACKAGE_NAME}_LIBRARIES ${OPENSSL_LIBRARIES})
-list(APPEND ${PACKAGE_NAME}_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIRS})
+list(APPEND ${PACKAGE_NAME}_LIBRARIES ${URBI_OPEN_SSL_LIBRARIES})
+list(APPEND ${PACKAGE_NAME}_INCLUDE_DIRS ${URBI_OPEN_SSL_INCLUDE_DIRS})

 # Places to look for the library/dll
 list(APPEND ${PACKAGE_NAME}_ADDITIONAL_DEBUG_PATHS


pass std=c++11 directly to nvcc

pass std=c++11 directly to nvcc

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -112,6 +112,7 @@
 if(HAVE_CUDA)
   SET(CUDA_PROPAGATE_HOST_FLAGS OFF)
   LIST(APPEND CUDA_NVCC_FLAGS -Xcompiler -std=c++11)
+  LIST(APPEND CUDA_NVCC_FLAGS -std=c++11)
   LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_52,code=sm_52)
 endif()


Mark boost headers as SYSTEM

Mark boost headers as SYSTEM

--- cmake/DevBaseMacro.cmake
+++ cmake/DevBaseMacro.cmake
@@ -205,10 +205,12 @@
         PRIVATE
             BOOST_ALL_DYN_LINK
     )
+    target_include_directories(${TEST_EXE_NAME} SYSTEM
+        PRIVATE
+            ${Boost_INCLUDE_DIRS})
     target_include_directories(${TEST_EXE_NAME}
         PRIVATE
-            ${ADD_UNIT_TEST_INCLUDE_DIRS}
-            ${Boost_INCLUDE_DIRS})
+            ${ADD_UNIT_TEST_INCLUDE_DIRS})
     target_link_libraries(${TEST_EXE_NAME}
         PRIVATE
             ${ADD_UNIT_TEST_LINK_LIBRARIES}


really disable swig when turned off

really disable swig when turned off

--- cmake/ElektraCache.cmake
+++ cmake/ElektraCache.cmake
@@ -215,6 +215,9 @@
 if (BUILD_SWIG)
 	option (BUILD_SWIG_PYTHON "Enable the SWIG bindings for Python" OFF)
 	option (BUILD_SWIG_LUA    "Enable the SWIG bindings for Lua" OFF)
+else (BUILD_SWIG)
+	set (BUILD_SWIG_PYTHON OFF CACHE BOOL "Enable the SWIG bindings for Python" FORCE)
+	set (BUILD_SWIG_LUA    OFF CACHE BOOL "Enable the SWIG bindings for Lua" FORCE)
 endif (BUILD_SWIG)

 #


look for ft2build.h in /usr/include/freetype2

--- cmake/FindFREETYPE.cmake
+++ cmake/FindFREETYPE.cmake
@@ -14,6 +14,7 @@

 FIND_PATH(FREETYPE_INCLUDE_DIR ft2build.h
   /usr/local/include
+  /usr/include/freetype2
   /usr/include
    $ENV{MINGDIR}/include
 )
@@ -52,4 +53,4 @@
 MARK_AS_ADVANCED(
   FREETYPE_LIBRARY
   FREETYPE_INCLUDE_DIR
-  )+  )


Correct wrong default (better solution).

--- cmake/externals/Qt.cmake
+++ cmake/externals/Qt.cmake
@@ -5,11 +5,10 @@

     set(default ON)
     if (WIN32)
-        set(defaulf OFF)
+        #set(defaulf OFF)
     endif()

-    #PackageInit(Qt Qt4 QT ${default})
-    PackageInit(Qt Qt4 QT ON)
+    PackageInit(Qt Qt4 QT ${default})
     if (TARGET Qt)
         return()
     endif()


Better AVX512 test case

Better AVX512 test case

--- cmake/system_check.cmake
+++ cmake/system_check.cmake
@@ -67,7 +67,7 @@
 endif()

 if (X86_64 OR X86)
-  file(WRITE ${PROJECT_BINARY_DIR}/avx512.tmp "void main(void){ __asm__ volatile(\"vaddps %zmm1, %zmm0, %zmm0\"); }")
+  file(WRITE ${PROJECT_BINARY_DIR}/avx512.tmp "int main(void){ __asm__ volatile(\"vbroadcastss -4 * 4(%rsi), %zmm2\"); }")
 execute_process(COMMAND ${CMAKE_C_COMPILER} -v -o ${PROJECT_BINARY_DIR}/avx512.o -x c ${PROJECT_BINARY_DIR}/avx512.tmp RESULT_VARIABLE NO_AVX512)
 if (NO_AVX512 EQUAL 1)
 set (CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512")


Updated FW

Updated FW

--- 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 "5a4001ab6618e113eb14ef5020a4773dce48e981")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "7039346f5bdc77912a9241d3cf5d11b8779ba62e")

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


Use builtin OpenSSL for builtin XRootD, if needed

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -914,6 +914,17 @@
   set(XROOTD_LIBRARIES ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdUtils${CMAKE_SHARED_LIBRARY_SUFFIX}
                        ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdClient${CMAKE_SHARED_LIBRARY_SUFFIX}
                        ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdCl${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+  if(builtin_openssl)
+    set(XROOTD_OPENSSL_OPTS
+      -DOPENSSL_VERSION:STRING=${OPENSSL_VERSION}
+      -DOPENSSL_INCLUDE_DIR:PATH=${OPENSSL_INCLUDE_DIR}
+      -DOPENSSL_INCLUDE_DIRS:PATH=${OPENSSL_INCLUDE_DIR}
+      -DOPENSSL_LIBRARY:PATH=${OPENSSL_LIBRARY}
+      -DOPENSSL_LIBRARIES:PATH=${OPENSSL_LIBRARIES}
+    )
+  endif()
+
   ExternalProject_Add(
     XROOTD
     URL ${XROOTD_SRC_URI}
@@ -928,11 +939,17 @@
                -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
                -DENABLE_PYTHON=OFF
                -DENABLE_CEPH=OFF
+               ${XROOTD_OPENSSL_OPTS}
     INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install
             COMMAND ${CMAKE_COMMAND} -E copy_directory <INSTALL_DIR>/include/xrootd <INSTALL_DIR>/include
     LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
     BUILD_BYPRODUCTS ${XROOTD_LIBRARIES}
   )
+
+  if(builtin_openssl)
+    add_dependencies(XROOTD OPENSSL)
+  endif()
+
   # We cannot call find_package(XROOTD) becuase the package is not yet built. So, we need to emulate what it defines....
   set(XROOTD_INCLUDE_DIRS ${XROOTD_ROOTDIR}/include/xrootd ${XROOTD_ROOTDIR}/include/xrootd/private)
   set(XROOTD_NOMAIN TRUE)


Fix the use and builtin of Vdt

Fix the use and builtin of Vdt

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1263,18 +1263,17 @@
 if(vdt OR builtin_vdt)
   if(NOT builtin_vdt)
     message(STATUS "Looking for VDT")
-    find_package(Vdt 0.3.9 CONFIG QUIET)
-    if(NOT Vdt_FOUND)
+    find_package(Vdt)
+    if(NOT VDT_FOUND)
       if(fail-on-missing)
         message(FATAL_ERROR "VDT not found. Ensure that the installation of VDT is in the CMAKE_PREFIX_PATH")
       else()
         message(STATUS "VDT not found. Ensure that the installation of VDT is in the CMAKE_PREFIX_PATH")
-        message(STATUS "              Alternatively, you can also enable the option 'builtin_vdt' to build the VDT libraries internally")
-        message(STATUS "              For the time being switching OFF 'vdt' option")
+        message(STATUS "               Alternatively, you can also enable the option 'builtin_vdt' to build the VDT libraries internally")
+        message(STATUS "               For the time being switching OFF 'vdt' option")
         set(vdt OFF CACHE BOOL "" FORCE)
       endif()
     endif()
-    set(Vdt_INCLUDE_DIRS ${Vdt_INCLUDE_DIR})
   endif()
   if(builtin_vdt)
     set(vdt_version 0.3.9)
@@ -1285,8 +1284,12 @@
       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
     )
-    set(Vdt_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include)
-    set(Vdt_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
+    set(VDT_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include)
+    set(VDT_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}vdt${CMAKE_SHARED_LIBRARY_SUFFIX})
+    install(FILES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}vdt${CMAKE_SHARED_LIBRARY_SUFFIX}
+            DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
+    install(DIRECTORY ${CMAKE_BINARY_DIR}/include/vdt
+            DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
     set(vdt ON CACHE BOOL "" FORCE)
   endif()
 endif()


VWR-23839 Pulseaudio support is crashing web media on some new Linux distros

--- indra/cmake/PulseAudio.cmake
+++ indra/cmake/PulseAudio.cmake
@@ -1,7 +1,7 @@
 # -*- cmake -*-
 include(Prebuilt)

-set(PULSEAUDIO ON CACHE BOOL "Build with PulseAudio support, if available.")
+set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.")

 if (PULSEAUDIO)
   if (STANDALONE)


ManageArchive: fixed ignore file matching

--- Modules/ManageArchive.cmake
+++ Modules/ManageArchive.cmake
@@ -86,23 +86,24 @@
     #     So no need to call it again.
     FUNCTION(SOURCE_ARCHIVE_GET_CONTENTS )
 	SET(_fileList "")
-	FILE(GLOB_RECURSE _ls "*")
+	FILE(GLOB_RECURSE _ls FOLLOW_SYMLINKS "*" )
 	STRING(REPLACE "\\\\" "\\" _ignore_files "${SOURCE_ARCHIVE_IGNORE_FILES}")
 	FOREACH(_file ${_ls})
 	    SET(_matched 0)
 	    FOREACH(filePattern ${_ignore_files})
 		M_MSG(${M_INFO3} "_file=${_file} filePattern=${filePattern}")
+
 		IF(_file MATCHES "${filePattern}")
 		    SET(_matched 1)
 		    BREAK()
 		ENDIF(_file MATCHES "${filePattern}")
 	    ENDFOREACH(filePattern ${_ignore_files})
 	    IF(NOT _matched)
-		FILE(RELATIVE_PATH _file ${CMAKE_SOURCE_DIR} "${_file}")
-		LIST(APPEND _fileList "${_file}")
+		FILE(RELATIVE_PATH _f ${CMAKE_SOURCE_DIR} "${_file}")
+		LIST(APPEND _fileList "${_f}")
 	    ENDIF(NOT _matched)
 	ENDFOREACH(_file ${_ls})
-	SET(SOURCE_ARCHIVE_CONTENTS ${_fileList} CACHE STRING "Source archive file list" FORCE)
+	SET(SOURCE_ARCHIVE_CONTENTS ${_fileList} CACHE INTERNAL "Source archive file list")
 	M_MSG(${M_INFO2} "SOURCE_ARCHIVE_CONTENTS=${SOURCE_ARCHIVE_CONTENTS}")
     ENDFUNCTION(SOURCE_ARCHIVE_GET_CONTENTS)

@@ -110,11 +111,9 @@
 	STRING(REPLACE "\\\\" "\\" ${var} "${cmrgx}")
     ENDMACRO(CMAKE_REGEX_TO_REGEX var cmrgx)

-    MACRO(SOURCE_ARCHIVE_GET_IGNORE_LIST)
-	SET(_valid_options "GITIGNORE" "INCLUDE")
-	VARIABLE_PARSE_ARGN(_opt _valid_options ${ARGN})
-	IF(_opt_GITIGNORE)
-	    FILE(STRINGS "${_opt_GITIGNORE}" _content REGEX "^[^#]")
+    MACRO(SOURCE_ARCHIVE_GET_IGNORE_LIST _ignoreListVar _includeListVar)
+	IF(${_ignoreListVar})
+	    FILE(STRINGS "${${_ignoreListVar}}" _content REGEX "^[^#]")
 	    FOREACH(_s ${_content})
 		STRING(STRIP "${_s}" _s)
 		STRING(LENGTH "${_s}" _l)
@@ -124,20 +123,20 @@
 		    LIST(APPEND SOURCE_ARCHIVE_IGNORE_FILES "${_cmrgx}")
 		ENDIF(_l GREATER 0)
 	    ENDFOREACH(_s ${_content})
-	ENDIF(_opt_GITIGNORE)
+	ENDIF(${_ignoreListVar})

 	## regex match one of include files
 	## then remove that line
 	FOREACH(_ignore_pattern ${SOURCE_ARCHIVE_IGNORE_FILES})
 	    CMAKE_REGEX_TO_REGEX(_ip "${_ignore_pattern}")
-	    FOREACH(_i ${_opt_INCLUDE})
+	    FOREACH(_i ${${_includeListVar}})
 		STRING(REGEX MATCH "${_ip}" _ret "${_i}")
 		IF(_ret)
 		    LIST(REMOVE_ITEM SOURCE_ARCHIVE_IGNORE_FILES "${_ignore_pattern}")
 		ENDIF(_ret)
-	    ENDFOREACH(_i ${_opt_INCLUDE})
+	    ENDFOREACH(_i ${${_includeListVar}})
 	ENDFOREACH(_ignore_pattern ${SOURCE_ARCHIVE_IGNORE_FILES})
-    ENDMACRO(SOURCE_ARCHIVE_GET_IGNORE_LIST)
+    ENDMACRO(SOURCE_ARCHIVE_GET_IGNORE_LIST _ignoreListVar _includeListVar)

     MACRO(PACK_SOURCE_CPACK var)
 	SET(_valid_options "GENERATOR" "INCLUDE" "GITIGNORE")
@@ -172,9 +171,7 @@
 	SET(SOURCE_ARCHIVE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}.${SOURCE_ARCHIVE_FILE_EXTENSION}" CACHE STRING "Source archive name" FORCE)
 	SET(${var} "${SOURCE_ARCHIVE_NAME}")

-	VARIABLE_TO_ARGN(_ignore_list_opts "_opt" "INCLUDE" "GITIGNORE")
-	SOURCE_ARCHIVE_GET_IGNORE_LIST( ${_ignore_list_opts})
-
+	SOURCE_ARCHIVE_GET_IGNORE_LIST(_opt_GITIGNORE _opt_INCLUDE)
 	LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${SOURCE_ARCHIVE_IGNORE_FILES})
 	SOURCE_ARCHIVE_GET_CONTENTS()
 	SET(SOURCE_ARCHIVE_CONTENTS_ABSOLUTE "")
@@ -228,14 +225,18 @@
 	    SET(_own_file 1)
 	    SET(_own 1)
 	ENDIF(NOT _outputFile STREQUAL "${_source_archive_file}")
-	SET(SOURCE_ARCHIVE_FILE "${_outputDir_real}/${_outputFile}"
+	GET_FILENAME_COMPONENT(SOURCE_ARCHIVE_FILE
+	    "${_outputDir_real}/${_outputFile}" ABSOLUTE)
+	SET(SOURCE_ARCHIVE_FILE ${SOURCE_ARCHIVE_FILE}
 	    CACHE FILEPATH "Source archive file" FORCE)
+	SET(SOURCE_ARCHIVE_NAME "${_outputFile}"
+	    CACHE FILEPATH "Source archive name" FORCE)

 	SET(_dep_list ${SOURCE_ARCHIVE_CONTENTS_ABSOLUTE})
 	## If own directory,
 	IF(_own_dir)
 	    ### Need to create it
-	    ADD_CUSTOM_COMMAND(OUTPUT _outputDir_real
+	    ADD_CUSTOM_COMMAND(OUTPUT ${_outputDir_real}
 		COMMAND ${CMAKE_COMMAND} -E make_directory ${_outputDir_real}
 		COMMENT "Create dir for source archive output."
 		)
@@ -245,19 +246,21 @@
 	## If own, need to move to it.
 	IF(_own)
 	    ADD_CUSTOM_TARGET_COMMAND(pack_src
-		OUTPUT "${SOURCE_ARCHIVE_FILE}"
-		COMMAND make package_source
-		COMMAND ${CMAKE_COMMAND} -E copy "${SOURCE_ARCHIVE_NAME}" "${SOURCE_ARCHIVE_FILE}"
-		COMMAND ${CMAKE_COMMAND} -E remove "${SOURCE_ARCHIVE_NAME}"
-		DEPENDS  ${_dep_list}
-		COMMENT "Packing the source as: ${SOURCE_ARCHIVE_FILE}"
+	    	OUTPUT ${SOURCE_ARCHIVE_FILE}
+	    	COMMAND make package_source
+	    	COMMAND ${CMAKE_COMMAND} -E copy "${_source_archive_file}" "${SOURCE_ARCHIVE_FILE}"
+	    	COMMAND ${CMAKE_COMMAND} -E remove "${_source_archive_file}"
+	    	DEPENDS  ${_dep_list}
+	    	COMMENT "Packing the source as: ${SOURCE_ARCHIVE_FILE}"
+		VERBATIM
 		)
 	ELSE(_own)
 	    ADD_CUSTOM_TARGET_COMMAND(pack_src
-		OUTPUT "${SOURCE_ARCHIVE_FILE}"
+		OUTPUT ${SOURCE_ARCHIVE_FILE}
 		COMMAND make package_source
 		DEPENDS  ${_dep_list}
 		COMMENT "Packing the source as: ${SOURCE_ARCHIVE_FILE}"
+		VERBATIM
 		)
 	ENDIF(_own)


generated files track changes to reference source files

--- cmake/sed.cmake
+++ cmake/sed.cmake
@@ -6,5 +6,6 @@
                      COMMAND CMAKE -Dinput_file="${input_file}"
                                    -Doutput_file="${output_file}"
                                    -Dreplacement_pairs="${ARGN}"
-                                   -P ${SED_SCRIPT})
+                                   -P ${SED_SCRIPT}
+                     DEPENDS "${input_file}")
 endfunction()


SuperBuild: Jpeg needs automake 1.15

SuperBuild: Jpeg needs automake 1.15

--- SuperBuild/CMake/External_jpeg.cmake
+++ SuperBuild/CMake/External_jpeg.cmake
@@ -15,8 +15,8 @@
   if(WIN32)
     ExternalProject_Add(${proj}
       PREFIX ${proj}
-      URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.2/libjpeg-turbo-1.4.2.tar.gz/download"
-      URL_MD5 86b0d5f7507c2e6c21c00219162c3c44
+      URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.1/libjpeg-turbo-1.4.1.tar.gz"
+      URL_MD5 b1f6b84859a16b8ebdcda951fa07c3f2
       SOURCE_DIR ${JPEG_SB_SRC}
       BINARY_DIR ${JPEG_SB_BUILD_DIR}
       INSTALL_DIR ${SB_INSTALL_PREFIX}
@@ -34,8 +34,8 @@

       ExternalProject_Add(${proj}
         PREFIX ${proj}
-        URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.2/libjpeg-turbo-1.4.2.tar.gz/download"
-        URL_MD5 86b0d5f7507c2e6c21c00219162c3c44
+        URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.1/libjpeg-turbo-1.4.1.tar.gz"
+        URL_MD5 b1f6b84859a16b8ebdcda951fa07c3f2
         BINARY_DIR ${JPEG_SB_BUILD_DIR}
         INSTALL_DIR ${SB_INSTALL_PREFIX}
         DOWNLOAD_DIR ${DOWNLOAD_LOCATION}


Don't repeat previous contents of compiler command

--- PolysquareToolingUtil.cmake
+++ PolysquareToolingUtil.cmake
@@ -524,6 +524,7 @@
              "${COMPILATION_DB_FILE_CONTENTS}\n{\n"
              "\"directory\": \"${CMAKE_CURRENT_BINARY_DIR}\",\n"
              "\"command\": \"")
+        unset (COMPILER_COMMAND_LINE)

         # Compiler and language options
         if (LANGUAGE STREQUAL "CXX")


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2009)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 11)
+SET(KWSYS_DATE_STAMP_MONTH 12)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Print ctest variables being set in Azure build script

--- Testing/CI/Azure/azure.cmake
+++ Testing/CI/Azure/azure.cmake
@@ -12,9 +12,11 @@
     if (ARGV2 STREQUAL "REQUIRED")
       message(FATAL_ERROR "Required environment variable \"${env_var}\" not defined.")
     elseif (ARGV2 STREQUAL "DEFAULT")
+      message("Setting \"${var}\" to default \"${ARGV3}\".")
       set(${var} ${ARGV3} PARENT_SCOPE)
     endif()
   else()
+    message("Setting \"${var}\" to \"$ENV{${env_var}}\" from environment.")
     set(${var} $ENV{${env_var}} PARENT_SCOPE)
   endif()
 endfunction()


ENH: Removing old file.  It is now called vtkGenerateVTKConfig.cmake.


rp2/micropy_rules.cmake: Fix makemoduledefs vpath to work with abs path.

In particular the firmware can now be built in a build directory that lives
outside the source tree, and the py/modarray.c file will still be found.

See issue #6837.

Signed-off-by: Damien George <99e6b749acbfbe2a596df99e91d24d6e1fdbee00@micropython.org>

--- ports/rp2/micropy_rules.cmake
+++ ports/rp2/micropy_rules.cmake
@@ -24,11 +24,10 @@
 )

 # Generate moduledefs.h
-# This is currently hard-coded to support modarray.c only, because makemoduledefs.py doesn't support absolute paths

 add_custom_command(
     OUTPUT ${MPY_MODULEDEFS}
-    COMMAND python3 ${MPY_PY_DIR}/makemoduledefs.py --vpath="." ../../../py/modarray.c > ${MPY_MODULEDEFS}
+    COMMAND python3 ${MPY_PY_DIR}/makemoduledefs.py --vpath="/" ${SOURCE_QSTR} > ${MPY_MODULEDEFS}
     DEPENDS ${MPY_MPVERSION}
         ${SOURCE_QSTR}
 )


SuperBuild: make sure shark library goes to install/lib

--- SuperBuild/CMake/External_shark.cmake
+++ SuperBuild/CMake/External_shark.cmake
@@ -45,6 +45,7 @@
   -DENABLE_HDF5:BOOL=OFF
   -DENABLE_CBLAS:BOOL=OFF
   -DENABLE_OPENMP:BOOL=${OTB_USE_OPENMP}
+  -DSHARK_INSTALL_LIB_DIR:STRING=lib/
   ${SHARK_SB_CONFIG}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND}
   LOG_DOWNLOAD 1


build test-innocuous

build test-innocuous

--- eugenics/test_list.cmake
+++ eugenics/test_list.cmake
@@ -5,7 +5,7 @@
 # add_executable("test-jv_algorithm" src/test_jv_algorithm.cc ${SRCS})
 add_executable("test-visualize" src/test_visualize.cc ${SRCS})
 add_executable("test-genetic" src/test_genetic.cc ${SRCS})
-# add_executable("test-innocuous" src/test_innocuous.cc ${SRCS})
+add_executable("test-innocuous" src/test_innocuous.cc ${SRCS})

 # linking
 target_link_libraries("test-getopts" gtest gtest_main)
@@ -14,4 +14,4 @@
 # target_link_libraries("test-jv_algorithm" gtest gtest_main)
 target_link_libraries("test-visualize" gtest gtest_main)
 target_link_libraries("test-genetic" gtest gtest_main)
-# target_link_libraries("test-innocuous" gtest gtest_main)
+target_link_libraries("test-innocuous" gtest gtest_main)


ENH: Updating the "Bugs" link in the top bar of the Dashboard to match the      URL of the new MANTIS bug tracker that is replacing phpBugTracker.

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -33,7 +33,7 @@
 SET (DOXYGEN_URL "http://${DROP_SITE}/Insight/Doxygen/html/" )

 SET (USE_GNATS "On")
-SET (GNATS_WEB_URL "http://${DROP_SITE}/Bug/query.php?projects=6&status%5B%5D=1&status%5B%5D=2&status%5B%5D=3&status%5B%5D=4&status%5B%5D=6&op=doquery")
+SET (GNATS_WEB_URL "http://${DROP_SITE}/Bug")

 # Continuous email delivery variables
 SET (CONTINUOUS_FROM "lorensen@nycap.rr.com")


backend: minor cleaning in compile_proto.cmake

--- backend/src/cmake/compile_proto.cmake
+++ backend/src/cmake/compile_proto.cmake
@@ -22,7 +22,6 @@
             -I ${PROTO_DIR}
             --grpc_out=.
             --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN_BINARY}
-            --cpp_out=.
             ${PROTO_DIR}/${COMPONENT_NAME}/${COMPONENT_NAME}.proto
     )


and one more try

and one more try

--- Toolchain-mingw32.cmake
+++ Toolchain-mingw32.cmake
@@ -6,18 +6,19 @@

 # Which compilers to use for C and C++, and location of target
 # environment.
-if(EXISTS /usr/i586-mingw32msvc)
+if(EXISTS /usr/i686-w64-mingw32)
+# First look in standard location as used by Debian/Ubuntu/etc.
+set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
+set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
+set(CMAKE_AR:FILEPATH /usr/bin/i686-w64-mingw32-ar)
+set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
+elseif(EXISTS /usr/i586-mingw32msvc)
 # First look in standard location as used by Debian/Ubuntu/etc.
 set(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
 set(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
 set(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
 set(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
-elseif(EXISTS /usr/i686-w64-mingw32)
-# First look in standard location as used by Debian/Ubuntu/etc.
-set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
-set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
-set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
-set(CMAKE_AR:FILEPATH /usr/bin/i686-w64-mingw32-ar)
 elseif(EXISTS /opt/mingw)
 # You can get a MinGW environment using the script at <http://mxe.cc>.
 # It downloads and builds MinGW and most of the dependencies for you.


Remove unneeded file

Remove unneeded file

--- examples/clients/selfcontained/CMakeBoostHelper.cmake
+++ examples/clients/selfcontained/CMakeBoostHelper.cmake
@@ -1,28 +0,0 @@
-# Help CMake find recent Boost MSVC binaries without manual configuration.
-if(MSVC AND (NOT Boost_INCLUDE_DIR OR NOT Boost_LIBRARY_DIR))
-    math(EXPR _vs_ver "${MSVC_VERSION} / 100 - 6")
-    if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
-        set(_libdir "lib64-msvc-${_vs_ver}.0")
-    else()
-        set(_libdir "lib32-msvc-${_vs_ver}.0")
-    endif()
-
-    set(_haslibs)
-    if(EXISTS "c:/local")
-        file(GLOB _possibilities "c:/local/boost*")
-        list(REVERSE _possibilities)
-        foreach(DIR ${_possibilities})
-            if(EXISTS "${DIR}/${_libdir}")
-                list(APPEND _haslibs "${DIR}")
-            endif()
-        endforeach()
-        if(_haslibs)
-            list(APPEND CMAKE_PREFIX_PATH ${_haslibs})
-            find_package(Boost QUIET)
-            if(Boost_FOUND AND NOT Boost_LIBRARY_DIR)
-                set(BOOST_ROOT "${Boost_INCLUDE_DIR}" CACHE PATH "")
-                set(BOOST_LIBRARYDIR "${Boost_INCLUDE_DIR}/${_libdir}" CACHE PATH "")
-            endif()
-        endif()
-    endif()
-endif()


fbcode_builder: add a license header to FBBuildOptions.cmake

Summary:
Add a license header to satisfy the open source linter. Use the same
header the other .cmake files have.

Reviewed By: mhlakhani

Differential Revision: D17404782

fbshipit-source-id: 66679d72c9e680f8bb8b27869e981a046b3520cf

--- build/fbcode_builder/CMake/FBBuildOptions.cmake
+++ build/fbcode_builder/CMake/FBBuildOptions.cmake
@@ -1,3 +1,5 @@
+# Copyright (c) Facebook, Inc. and its affiliates.
+
 function (fb_activate_static_library_option)
   option(USE_STATIC_DEPS_ON_UNIX
     "If enabled, use static dependencies on unix systems. This is generally discouraged."


Mac: Assume LLVM is the only option.

Mac: Assume LLVM is the only option.

--- build/cmake/Unix.cmake
+++ build/cmake/Unix.cmake
@@ -33,7 +33,10 @@
 	set(CMAKE_C_FLAGS   "-pipe ${RAINBOW_CSTD} -w ${RAINBOW_COMMON_CFLAGS}")
 	set(CMAKE_CXX_FLAGS "-pipe ${RAINBOW_CXXSTD} ${RAINBOW_CXX_WARNINGS} ${RAINBOW_COMMON_CFLAGS}")

-	if(NOT APPLE)
+	if(APPLE)
+		find_library(CORESERVICES_LIBRARY CoreServices REQUIRED)
+		set(PLATFORM_LIBRARIES ${CORESERVICES_LIBRARY})
+	else()
 		# Debug- and release-specific flags
 		set(CMAKE_CXX_FLAGS_DEBUG   "-g -O0 -ftrapv")
 		set(CMAKE_CXX_FLAGS_RELEASE "-Os -D_FORTIFY_SOURCE=2")
@@ -43,11 +46,5 @@
 			set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,now -Wl,-z,relro -pie -pthread")
 			set(PLATFORM_LIBRARIES m rt stdc++)
 		endif()
-	else()
-		if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
-		endif()
-		find_library(CORESERVICES_LIBRARY CoreServices REQUIRED)
-		set(PLATFORM_LIBRARIES ${CORESERVICES_LIBRARY} c++)
 	endif()
 endif()


Remove dependency to boost_chrono for boost version less than 1.49

Change-Id: I181b9c30e669bf1aa4fbada063b7400b9893a0ef
Reviewed-on: http://gerrit.aldebaran.lan:8080/10101
Reviewed-by: cgestes <ddb78fe00abb42f91254c16a0860e38eb0781789@aldebaran-robotics.com>
Tested-by: proullon <ffff9135679d397f48dd743107119b1f6fc32d3d@aldebaran-robotics.com>

--- cmake/qibuild/modules/boost_thread-config.cmake
+++ cmake/qibuild/modules/boost_thread-config.cmake
@@ -11,5 +11,8 @@
 if(UNIX)
   list(APPEND _deps PTHREAD)
 endif()
-list(APPEND _deps BOOST_CHRONO)
+#boost threads depends on chrono starting from version 1.50
+if (Boost_VERSION GREATER "104900")
+  list(APPEND _deps BOOST_CHRONO)
+endif()
 qi_set_global(BOOST_THREAD_DEPENDS ${_deps})


fix: Include Depends.cmake *after* standard dependencies are resolved [BASIS]

--- CMake/Basis/ProjectTools.cmake
+++ CMake/Basis/ProjectTools.cmake
@@ -2001,16 +2001,6 @@
   set (CMAKE_MODULE_PATH "${PROJECT_CONFIG_DIR}" ${CMAKE_MODULE_PATH})

   # --------------------------------------------------------------------------
-  # Depends.cmake
-
-  # This file is in particular of interest if a dependency is required if
-  # certain modules are enabled, but not others.
-
-  # Attention: This function is used before the Directories.cmake.in and
-  #            Settings.cmake.in files were configured and included.
-  include ("${PROJECT_CONFIG_DIR}/Depends.cmake" OPTIONAL)
-
-  # --------------------------------------------------------------------------
   # required dependencies
   foreach (P IN LISTS PROJECT_DEPENDS)
     basis_find_package ("${P}" REQUIRED)
@@ -2099,6 +2089,14 @@
   endif ()

   unset (P)
+
+  # --------------------------------------------------------------------------
+  # Depends.cmake
+  #
+  # This file is in particular of interest if an additional dependency is
+  # required or may optionally be used if certain modules are enabled or
+  # an optional dependency was found.
+  include ("${PROJECT_CONFIG_DIR}/Depends.cmake" OPTIONAL)

   set (BASIS_SET_TARGET_PROPERTIES_IMPORT FALSE) # see set_target_properties()
 endmacro ()


Updated FindPython.cmake to recognize more possible path sufixes.

--- CMake/Modules/FindPython.cmake
+++ CMake/Modules/FindPython.cmake
@@ -3,11 +3,11 @@
 FIND_PATH(
 	PYTHON_INCLUDES
 	NAMES Python.h
-	PATH_SUFFIXES python3.0 python3.1 python3.2 python3.4 python3.5 python3.6 python3.7 python3.8
+	PATH_SUFFIXES python3.0 python3.1 python3.2 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.0m python3.1m python3.2m python3.3m python3.4m python3.5m python3.6m python3.7m python3.8m python3.9m python3.0d python3.1d python3.2d python3.3d python3.4d python3.5d python3.6d python3.7d python3.8d python3.9d python3.0u python3.1u python3.2u python3.3u python3.4u python3.5u python3.6u python3.7u python3.8u python3.9u
 )
 FIND_LIBRARY(
 	PYTHON_LIBRARIES
-	NAMES python3.0m python3.1 python3.2 python3.4 python3.5 python3.6 python3.7 python3.8 python3.0m python3.1m python3.2m python3.4m python3.5m python3.6m python3.7m python3.8m python3.0m python3.1d python3.2d python3.4d python3.5d python3.6d python3.7d python3.8d python3.0m python3.1u python3.2u python3.4u python3.5u python3.6u python3.7u python3.8u
+	NAMES python3.0 python3.1 python3.2 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.0m python3.1m python3.2m python3.3m python3.4m python3.5m python3.6m python3.7m python3.8m python3.9m python3.0d python3.1d python3.2d python3.3d python3.4d python3.5d python3.6d python3.7d python3.8d python3.9d python3.0u python3.1u python3.2u python3.3u python3.4u python3.5u python3.6u python3.7u python3.8u python3.9u
 	PATH_SUFFIXES lib lib32 lib64
 )
 IF(("${PYTHON_INCLUDES}" MATCHES "PYTHON_INCLUDES-NOTFOUND") OR ("${PYTHON_LIBRARIES}" MATCHES "PYTHON_LIBRARIES-NOTFOUND"))


Updated master version to 2013.12.99

Updated master version to 2013.12.99

--- CMake/mitkSetupVariables.cmake
+++ CMake/mitkSetupVariables.cmake
@@ -6,7 +6,7 @@

 # MITK_VERSION
 set(MITK_VERSION_MAJOR "2013")
-set(MITK_VERSION_MINOR "09")
+set(MITK_VERSION_MINOR "12")
 set(MITK_VERSION_PATCH "99")
 set(MITK_VERSION_STRING "${MITK_VERSION_MAJOR}.${MITK_VERSION_MINOR}.${MITK_VERSION_PATCH}")
 if(MITK_VERSION_PATCH STREQUAL "99")


FindGROMACS.cmake: added another error

FindGROMACS.cmake: added another error

--- CMakeModules/FindGROMACS.cmake
+++ CMakeModules/FindGROMACS.cmake
@@ -39,6 +39,9 @@
 if(GMX_DOUBLE AND NOT "${GROMACS_PKG}" MATCHES "_d$")
   message(FATAL_ERROR "GMX_DOUBLE was true, but I was asked to find ${GROMACS_PKG} (without _d at the end) - unlogical!")
 endif(GMX_DOUBLE AND NOT "${GROMACS_PKG}" MATCHES "_d$")
+if(NOT GMX_DOUBLE AND "${GROMACS_PKG}" MATCHES "_d$")
+  message(FATAL_ERROR "GMX_DOUBLE was false, but I was asked to find ${GROMACS_PKG} (with _d at the end) - unlogical!")
+endif(NOT GMX_DOUBLE AND "${GROMACS_PKG}" MATCHES "_d$")

 pkg_check_modules(PC_GROMACS ${GROMACS_PKG})
 if (GMX_DOUBLE)


fpta-cmake: fallback to '%ci' if '%cI' not available from git < 2.0

--- cmake.fpta/utils.cmake
+++ cmake.fpta/utils.cmake
@@ -61,7 +61,14 @@
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
       RESULT_VARIABLE rc)
     if(rc OR "${name}_GIT_TIMESTAMP" STREQUAL "%cI")
-      message(FATAL_ERROR "Please install latest version of git ('show --no-patch --format=%cI HEAD' failed)")
+      execute_process(COMMAND ${GIT} show --no-patch --format=%ci HEAD
+        OUTPUT_VARIABLE ${name}_GIT_TIMESTAMP
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        RESULT_VARIABLE rc)
+      if(rc OR "${name}_GIT_TIMESTAMP" STREQUAL "%ci")
+        message(FATAL_ERROR "Please install latest version of git ('show --no-patch --format=%cI HEAD' failed)")
+      endif()
     endif()

     execute_process(COMMAND ${GIT} show --no-patch --format=%T HEAD


Fixed BALL_COMBINE_LIBS macro in cmake.

Fixed BALL_COMBINE_LIBS macro in cmake.

--- cmake/BALLMacros.cmake
+++ cmake/BALLMacros.cmake
@@ -196,12 +196,8 @@
 	SET(OPTIMIZED_LIBS "${OPTIMIZED_LIBS}")
 	SET(DEBUG_LIBS "${DEBUG_LIBS}")
 	IF (OPTIMIZED_LIBS AND DEBUG_LIBS)
-		SET(${${RESULT}} optimized "${OPTIMIZED_LIBS}" debug "${DEBUG_LIBS}")
-	ELSEIF(OPTIMIZED_LIBS)
-		SET(${${RESULT}} "${OPTIMIZED_LIBS}")
-	ELSEIF(DEBUG_LIBS)
-		SET(${${RESULT}} "${DEBUG_LIBS}")
+		SET(${RESULT} optimized "${OPTIMIZED_LIBS}" debug "${DEBUG_LIBS}")
 	ELSE()
-		SET(${${RESULT}})
+		SET(${RESULT} "${OPTIMIZED_LIBS} ${DEBUG_LIBS}")
 	ENDIF()
 ENDMACRO()


VS2008 dev+

VS2008 dev+

--- cmake/BuildPCRE2.cmake
+++ cmake/BuildPCRE2.cmake
@@ -17,7 +17,7 @@
   -DWIN32:BOOL=${WIN32}
   -DTARGET_TEST_SYSTEM:STRING=${TARGET_TEST_SYSTEM}
   -DTARGET_TEST_CMAKE_COMMAND:STRING=${TARGET_TEST_SYSTEM_COMMAND}
-  -DCMAKE_PROJECT_INCLUDE:PATH=${FIXME_CMAKE_ABSOLUTE}
+  -DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=${FIXME_CMAKE_ABSOLUTE}
   )

 #
@@ -43,6 +43,9 @@
 # On Unix this is make
 # On Unix this is nmake, usually lowercase (I have never seen this with capital letter(s))
 #
+MESSAGE(STATUS "Starting ExternalProject_Add for PCRE2 with:")
+MESSAGE(STATUS "CMAKE_ARGS=${_PCRE2_CMAKE_ARGS}")
+MESSAGE(STATUS "CMAKE_CACHE_ARGS=${_CMAKE_CACHE_ARGS}")
 IF ("${CMAKE_MAKE_PROGRAM}" MATCHES ".*make")
   EXTERNALPROJECT_ADD(pcre2
     URL "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23-patched.tar.gz"


Find Spglib under different name

Find Spglib under different name

I'm not entirely sure where the only listed name cmake searches for
originates from, but vanilla upstream only installs a libsymspg.

--- cmake/FindSpglib.cmake
+++ cmake/FindSpglib.cmake
@@ -7,7 +7,7 @@
 #  SPGLIB_LIBRARY      - The Spglib library
 #
 find_path(SPGLIB_INCLUDE_DIR spglib/spglib.h)
-find_library(SPGLIB_LIBRARY NAMES spglib)
+find_library(SPGLIB_LIBRARY NAMES spglib symspg)

 set(SPGLIB_INCLUDE_DIRS "${SPGLIB_INCLUDE_DIR}")


cmake: fallback to normal include dirs for vulkan

For some reason INTERFACE_SYSTEM_INCLUDE_DIRECTORIES does NOT work
with Visual Studio (tested with VS2015 and CMake 3.11.1).

--- cmake/FindVulkan.cmake
+++ cmake/FindVulkan.cmake
@@ -32,7 +32,9 @@
 if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan)
     add_library(Vulkan::Vulkan INTERFACE IMPORTED)
     set_target_properties(Vulkan::Vulkan PROPERTIES
-        INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${VULKAN_INCLUDE_DIR}"
+        INTERFACE_INCLUDE_DIRECTORIES "${VULKAN_INCLUDE_DIR}"
+        # FIXME For some reason this does NOT work with Visual Studio (it should)
+        # INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${VULKAN_INCLUDE_DIR}"
         # IMPORTED_LOCATION "${VULKAN_LIBRARY}"
     )
 endif()


cmake: allow users to give runner args at cmake time

If the BOARD_RUNNER_ARGS_${runner_id} variable contains anything, add
it to the global property of the same name with all the final runner
args from board_runner_args() and friends.

This allows use cases like this:

  west build ... -- -DBOARD_RUNNER_ARGS_jlink="--some-jlink-arg"

The ${runner_id} part is the runner's name converted to a C
identifier, i.e. with special characters changed to underscores.

So e.g. the 'dfu-util' runner would use BOARD_RUNNER_ARGS_dfu_util.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -815,8 +815,11 @@
     # Default arguments from the common runner file come first.
     ${ARGN}
     # Arguments explicitly given with board_runner_args() come
-    # last, so they take precedence.
+    # next, so they take precedence over the common runner file.
     ${explicit}
+    # Arguments given via the CMake cache come last of all. Users
+    # can provide variables in this way from the CMake command line.
+    ${BOARD_RUNNER_ARGS_${runner_id}}
     )

   # Add the finalized runner to the global property list.


COMP: added support for gcc 6.4 with CUDA 9

--- cmake/nvcc-check.cmake
+++ cmake/nvcc-check.cmake
@@ -46,10 +46,13 @@
   if((CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCC) OR APPLE)
     # Compatible gcc can be checked in host_config.h
     set(GCC_PATH "")
-    if(${CUDA_VERSION} VERSION_GREATER "6.99")
+    if(${CUDA_VERSION} VERSION_GREATER "8.99")
+      FIND_GCC(GCC_PATH "6" "4")
+    endif()
+    if(NOT GCC_PATH AND ${CUDA_VERSION} VERSION_GREATER "6.99")
       FIND_GCC(GCC_PATH "4" "9")
     endif()
-    if(${CUDA_VERSION} VERSION_GREATER "5.4.99")
+    if(NOT GCC_PATH AND ${CUDA_VERSION} VERSION_GREATER "5.4.99")
       FIND_GCC(GCC_PATH "4" "8")
     endif()
     if(NOT GCC_PATH AND ${CUDA_VERSION} VERSION_GREATER "5.4.99")


Fixed Clang compiler detection.

Fixed Clang compiler detection.

--- cmake/Config.cmake
+++ cmake/Config.cmake
@@ -51,12 +51,10 @@
     set(COMPILER "MSVC")
 elseif(MINGW)
     set(COMPILER "MINGW")
-elseif(CMAKE_COMPILER_IS_GNUCXX)
-    if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-        set(COMPILER "Clang")
-    elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-        set(COMPILER "GCC")
-    endif()
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    set(COMPILER "Clang")
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+    set(COMPILER "GCC")
 else()
     message(FATAL_ERROR "Unsupported compiler.")
 endif()


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -761,9 +761,6 @@

 MACRO(OS_X_QT_DEPENDENCIES FILENAME QT_DEPENDENCIES)
     # Retrieve the file's full-path Qt dependencies as a list
-    # Note: some people may be using grep with coloring (e.g. they have
-    #       export GREP_OPTIONS='--color=always' in their profile), hence we ask
-    #       for coloring never to be used...

     SET(QT_LIBRARY_DIR_FOR_GREP "\t${QT_LIBRARY_DIR}/")


Fixes an issue with our tests now that we have modified our build system.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -486,16 +486,12 @@
                        COMMAND ${CMAKE_COMMAND} -E copy ${PLUGIN_BUILD_DIR}/${PLUGIN_FILENAME}
                                                         ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})

-    # On Windows, make a copy of the plugin to our main build directory, since
-    # this is where it will be on Linux and OS X and where any test which
-    # requires the plugin will expect it to be, but this is not where MSVC
-    # generates the plugin, so...
-
-    IF(WIN32)
-        ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
-                           COMMAND ${CMAKE_COMMAND} -E copy ${PLUGIN_BUILD_DIR}/${PLUGIN_FILENAME}
-                                                            ${PROJECT_BUILD_DIR}/${PLUGIN_FILENAME})
-    ENDIF()
+    # Also copy the plugin to our main build directory, since this is where any
+    # test that requires the plugin will expect it to be
+
+    ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
+                       COMMAND ${CMAKE_COMMAND} -E copy ${PLUGIN_BUILD_DIR}/${PLUGIN_FILENAME}
+                                                        ${PROJECT_BUILD_DIR}/${PLUGIN_FILENAME})

     # A few OS X specific things


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -231,8 +231,8 @@
         ADD_DEFINITIONS(-DENABLE_SAMPLES)
     ENDIF()

-    # On OS X, make sure that we support 10.7 and later, unless a deployment
-    # target has been specified
+    # On OS X, make sure that we support 10.7 and later, unless a specific
+    # deployment target has been specified

     IF(APPLE)
         IF("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")


CMake: hide more distracting variables (#285).

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -46,6 +46,9 @@
     mark_as_advanced(CMAKE_OSX_SYSROOT)
   endif()
   if(WIN32)
+    mark_as_advanced(LIBXML2_INCLUDE_DIR)
+    mark_as_advanced(LIBXML2_LIBRARY)
+    mark_as_advanced(LIBXML2_XMLLINT_EXECUTABLE)
     mark_as_advanced(LibXml2_DIR)
   else()
     mark_as_advanced(pkgcfg_lib_PC_LIBXML_xml2)


[FIX,PROFILING] Add USE_PAPI configuration to config.cmake (#8567)

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -311,3 +311,11 @@
 # - OFF: disable ccache
 # - /path/to/ccache: use specific path to ccache
 set(USE_CCACHE AUTO)
+
+# Whether to enable PAPI support in profiling. PAPI provides access to hardware
+# counters while profiling.
+# Possible values:
+# - ON: enable PAPI support. Will search PKG_CONFIG_PATH for a papi.pc
+# - OFF: disable PAPI support.
+# - /path/to/folder/containing/: Path to folder containing papi.pc.
+set(USE_PAPI OFF)


Add shared library (#110)

Add shared library (#110)

libtuv-DCO-1.0-Signed-off-by: Hosung Kim hs852.kim@samsung.com

--- cmake/libtuv.cmake
+++ cmake/libtuv.cmake
@@ -58,6 +58,16 @@
     LIBRARY_OUTPUT_DIRECTORY "${LIB_OUT}"
     RUNTIME_OUTPUT_DIRECTORY "${BIN_OUT}")

+# build tuv shared library
+set(TARGETSHAREDLIBNAME tuv_shared)
+add_library(${TARGETSHAREDLIBNAME} SHARED ${LIB_TUV_SRCFILES})
+target_include_directories(${TARGETSHAREDLIBNAME} SYSTEM PRIVATE ${TARGET_INC})
+target_include_directories(${TARGETSHAREDLIBNAME} PUBLIC ${LIB_TUV_INCDIRS})
+set_target_properties(${TARGETSHAREDLIBNAME} PROPERTIES
+    LIBRARY_OUTPUT_DIRECTORY "${LIB_OUT}"
+    COMPILE_FLAGS -fPIC
+    OUTPUT_NAME tuv)
+
 if(DEFINED COPY_TARGET_LIB)
   add_custom_command(TARGET ${TARGETLIBNAME} POST_BUILD
       COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${TARGETLIBNAME}>


Bumped version number

Bumped version number

--- version.cmake
+++ version.cmake
@@ -1 +1 @@
-set(autowiring_VERSION 0.4.0)
+set(autowiring_VERSION 0.4.1)


Nagios Monitoring 7.10.6-1 Gold

Nagios Monitoring 7.10.6-1 Gold

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -6,6 +6,6 @@
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 10 )
 set ( HPCC_POINT 6 )
-set ( HPCC_MATURITY "rc" )
+set ( HPCC_MATURITY "release" )
 set ( HPCC_SEQUENCE 1 )
 ###


Update version to 2.1.1

Update version to 2.1.1

--- Version.cmake
+++ Version.cmake
@@ -10,7 +10,7 @@

 set(SimpleITK_VERSION_MAJOR 2)
 set(SimpleITK_VERSION_MINOR 1)
-set(SimpleITK_VERSION_PATCH 0)
+set(SimpleITK_VERSION_PATCH 1)
 #set(SimpleITK_VERSION_TWEAK "")


Disable Python version warning when WRAP_PYTHON is disabled.

--- CMake/sitkLanguageOptions.cmake
+++ CMake/sitkLanguageOptions.cmake
@@ -81,11 +81,6 @@
 endif()

 if ( PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND
-    AND PYTHON_VERSION_STRING VERSION_LESS 2.7 )
-  message( WARNING "Python version less than 2.7: \"${PYTHON_VERSION_STRING}\"." )
-endif()
-
-if ( PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND
     AND (PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING) )
   set( WRAP_PYTHON_DEFAULT ${WRAP_DEFAULT} )
 else()
@@ -93,6 +88,10 @@
 endif()

 option( WRAP_PYTHON "Wrap Python" ${WRAP_PYTHON_DEFAULT} )
+
+if ( WRAP_PYTHON AND PYTHON_VERSION_STRING VERSION_LESS 2.7 )
+  message( WARNING "Python version less than 2.7: \"${PYTHON_VERSION_STRING}\"." )
+endif()

 if ( WRAP_PYTHON )
   list( APPEND SITK_LANGUAGES_VARS


COMP: Mingw QtMobility: use proper make command on MinGW systems

--- CMakeExternals/QtMobility.cmake
+++ CMakeExternals/QtMobility.cmake
@@ -42,6 +42,10 @@
   SET(qtmobility_install_cmd)
   IF(UNIX OR MINGW)
     SET(qtmobility_make_cmd make)
+	IF(MINGW AND NOT MSYS)
+	  SET(qtmobility_make_cmd mingw32-make)
+	ENDIF()
+
     SET(qtmobility_config_args -${qtmobility_build_type} -libdir ${CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY} -no-docs -modules ${qtmobility_modules})
     SET(qtmobility_install_cmd ${qtmobility_make_cmd} install)
   ELSEIF(WIN32)


tweak a ffew options

tweak a ffew options

--- CMakeModules/build_DeepCL.cmake
+++ CMakeModules/build_DeepCL.cmake
@@ -8,6 +8,9 @@
     CMAKE_CACHE_ARGS
     -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
     -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
+    -DLIBPNGPP_AVAILABLE:BOOL=OFF
+    -DLIBJPEG_AVAILABLE:BOOL=OFF
+    -DBUILD_LUA_WRAPPERS:BOOL=OFF
     )

 ADD_LIBRARY(DeepCL SHARED IMPORTED)


Fixed building clBLAS external

Fixed building clBLAS external

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

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


[SWIG] don't set SWIG_VERSION

[SWIG] don't set SWIG_VERSION

This variable isn't used, and in any case would have to
be set in version_config.cmake if we ever need it.

--- SuperBuild/External_SWIG.cmake
+++ SuperBuild/External_SWIG.cmake
@@ -77,7 +77,6 @@
   )

   set( SWIG_EXECUTABLE ${SWIG_Install_Dir}/bin/swig )
-  set( SWIG_VERSION "3.0.12" )

   endif(WIN32)


Activated all tests again, they should work now.

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -8,7 +8,7 @@
    mitkNavigationDataLandmarkTransformFilterTest.cpp
    mitkNavigationDataObjectVisualizationFilterTest.cpp
    mitkNavigationDataTest.cpp
-   # mitkNavigationDataRecorderTest.cpp # see bug 16349
+   mitkNavigationDataRecorderTest.cpp # see bug 16349
    mitkNavigationDataReferenceTransformFilterTest.cpp
    mitkNavigationDataSequentialPlayerTest.cpp
    mitkNavigationDataSourceTest.cpp
@@ -23,18 +23,18 @@
    mitkTrackingVolumeGeneratorTest.cpp
    mitkTrackingDeviceTest.cpp
    mitkTrackingToolTest.cpp
-   mitkVirtualTrackingDeviceTest.cpp # see bug 16385
+   mitkVirtualTrackingDeviceTest.cpp
    mitkNavigationDataPlayerTest.cpp # see bug 11636 (extend this test by microservices)
-   mitkTrackingDeviceSourceTest.cpp # see bug 16385
+   mitkTrackingDeviceSourceTest.cpp
    mitkTrackingDeviceSourceConfiguratorTest.cpp
    mitkNavigationDataEvaluationFilterTest.cpp
    mitkTrackingTypesTest.cpp

    # ------------------ Navigation Tool Management Tests -------------------
-   mitkNavigationToolStorageTest.cpp # see bug 16385
-   mitkNavigationToolTest.cpp # see bug 16385
-   # mitkNavigationToolReaderAndWriterTest.cpp # see bug 16350
-   # mitkNavigationToolStorageSerializerAndDeserializerTest.cpp # see bug 16351
+   mitkNavigationToolStorageTest.cpp
+   mitkNavigationToolTest.cpp
+   mitkNavigationToolReaderAndWriterTest.cpp # see bug 16350
+   mitkNavigationToolStorageSerializerAndDeserializerTest.cpp # see bug 16351
    # -----------------------------------------------------------------------
 )


Removed debugging symbols from actual Biicode build

--- biicode.cmake
+++ biicode.cmake
@@ -1,6 +1,6 @@
 # If we're on GCC, set the c++11 compilation flag.
 IF (CMAKE_COMPILER_IS_GNUCXX)
-        SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11")
+        SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 ENDIF (CMAKE_COMPILER_IS_GNUCXX)

 ADD_BII_TARGETS()


Bump to 1.7.10

Bump to 1.7.10

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(LIBREPO_MAJOR "1")
 SET(LIBREPO_MINOR "7")
-SET(LIBREPO_PATCH "9")
+SET(LIBREPO_PATCH "10")


Generating for android working

Generating for android working

--- builder.cmake
+++ builder.cmake
@@ -26,8 +26,7 @@
     message (FATAL_ERROR ${MSG})
 endif ()

-set (CMAKE_GENERATED_COMMAND "\"${CMAKE_COMMAND}\" ${CUSTOM_ARGS_${T}} -DPACKAGES=\"${PACKAGE_DIRS}\" -DCMAKE_BUILD_TYPE=Debug -DKRAL_PATH=\"${KRAL_PATH}\" -DPLATFORM=\"${PLATFORM_${T}}\" -G \"${PROJECT_TYPE_${T}}\" \"${PROJECT_DIR_${T}}\" -DCUSTOM_COMPILER_OPTS=\"\"")
-
+set (CMAKE_GENERATED_COMMAND "\"${CMAKE_COMMAND}\" ${CUSTOM_ARGS_${T}} ")
 if ("${PLATFORM_${T}}" STREQUAL "android")
     # Determine android target number
     set (ANDROID_BINARY "android")
@@ -38,7 +37,9 @@
     endif()
     string(REGEX MATCH "id: (.*) or.*${API_LEVEL_${T}}" ALT_MATCH ${ALT_OUTPUT})
     set(ANDROID_TARGET "${CMAKE_MATCH_1}")
+    set (CMAKE_GENERATED_COMMAND "${CMAKE_GENERATED_COMMAND} -DANDROID_TARGET=${ANDROID_TARGET} -DCMAKE_TOOLCHAIN_FILE=${KRAL_PATH}/android-cmake/toolchain/android.toolchain.cmake -DANDROID_NDK=$ENV{NDK} -DANDROID_API_LEVEL=${API_LEVEL_${T}}")
 endif()
+set (CMAKE_GENERATED_COMMAND "${CMAKE_GENERATED_COMMAND} -DPACKAGES=\"${PACKAGE_DIRS}\" -DCMAKE_BUILD_TYPE=Debug -DKRAL_PATH=\"${KRAL_PATH}\" -DPLATFORM=\"${PLATFORM_${T}}\" -G \"${PROJECT_TYPE_${T}}\" \"${PROJECT_DIR_${T}}\" -DCUSTOM_COMPILER_OPTS=\"\"")

 if (GENERATE)
     file(REMOVE_RECURSE "${PROJECTS_ROOT_DIR}/${BUILD_DIR_${T}}")
@@ -47,6 +48,7 @@
     exec_program ("${CMAKE_COMMAND}" ARGS -E chdir ${PROJECTS_ROOT_DIR}/${BUILD_DIR_${T}} ${CMAKE_GENERATED_COMMAND})
 elseif (UPDATE)
     exec_program ("${CMAKE_COMMAND}" ARGS -E chdir ${PROJECTS_ROOT_DIR}/${BUILD_DIR_${T}}
+
             \"${CMAKE_COMMAND}\" ${CUSTOM_ARGS_${T}} -DPACKAGES=\"${PACKAGE_DIRS}\" -DCMAKE_BUILD_TYPE=Debug -DKRAL_PATH=\"${KRAL_PATH}\" -DPLATFORM=\"${PLATFORM_${T}}\" -G \"${PROJECT_TYPE_${T}}\" \"${PROJECT_DIR_${T}}\" -DCUSTOM_COMPILER_OPTS=\"\")
 elseif (COMPILE)
     exec_program ("${CMAKE_COMMAND}" ARGS -E chdir ${PROJECTS_ROOT_DIR}/${BUILD_DIR_${T}}


Attempt to suppress valgrind warnings on Travis

- don't understand why cmake on travis doesn't pick up the memcheck.supp
file. It works on my local machine.

--- src/CTestConfig.cmake
+++ src/CTestConfig.cmake
@@ -12,9 +12,10 @@
 # Specify MEMCHECK Option: http://valgrind.org/docs/manual/mc-manual.html
 # Note: We use "--trace-children=yes" to valgrind-ise child processes (follow execve)
 # Note: We turn off "--show-reachable=yes" option.
-SET (MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_SOURCE_DIR}/memcheck.supp")
-SET (VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes")
-SET (MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes")
+#set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/memcheck.supp)
+file(TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}/memcheck.supp"  MEMORYCHECK_SUPPRESSIONS_FILE)
+set(VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes")
+set(MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes")

 set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "cmacslab2.modck.cs.cmu.edu")


BUG : ITK repo broken and changed to https://github.com/InsightSoftwareConsortium/ITK

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -167,7 +167,7 @@
       ${${proj}_CMAKE_ADDITIONAL_OPTIONS}
     )
   ### --- End Project specific additions
-  set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
+  set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK)
   set(${proj}_GIT_TAG c5138560409c75408ff76bccff938f21e5dcafc6)
   set(ITK_VERSION_ID ITK-4.12)


Disable warnings for gtest

Disable warnings for gtest

(thanks to Felix for the hint)

--- cmake/Modules/LibAddTest.cmake
+++ cmake/Modules/LibAddTest.cmake
@@ -21,7 +21,7 @@

 	if (GOOGLETEST_FOUND)
 		add_subdirectory(${GOOGLETEST_ROOT} ${CMAKE_CURRENT_BINARY_DIR}/gtest)
-		include_directories(${GOOGLETEST_ROOT}/include ${GOOGLETEST_ROOT})
+		include_directories(SYSTEM ${GOOGLETEST_ROOT}/include)

 		set_property (TARGET gtest PROPERTY COMPILE_FLAGS "-w" )
 		set_property (TARGET gtest_main PROPERTY COMPILE_FLAGS "-w" )
@@ -32,7 +32,6 @@

 macro (add_gtest source)
-	include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
 	set (SOURCES ${HDR_FILES} ${source}.cpp)
 	add_executable (${source} ${SOURCES})


Add pthread as this dependency was introduced by libFuzzer

--- cmake/external/libfuzzer.cmake
+++ cmake/external/libfuzzer.cmake
@@ -26,6 +26,8 @@
   add_dependencies(${lib} ${LIBFUZZER_TARGET})
 endforeach(lib)

+list(APPEND LIBFUZZER_LIBRARIES pthread)
+
 include (ExternalProject)
 ExternalProject_Add(${LIBFUZZER_TARGET}
     PREFIX ${LIBFUZZER_TARGET}


Added aravis version 0.6

Added aravis version 0.6

--- cmake/modules/FindAravis.cmake
+++ cmake/modules/FindAravis.cmake
@@ -20,16 +20,20 @@
 	${aravis_PKGCONF_INCLUDE_DIRS}
 	/usr/local/include
 	/usr/local/include/aravis-0.4
+	/usr/local/include/aravis-0.6
 	/usr/include
 	/usr/include/aravis-0.4
+	/usr/include/aravis-0.6
 )

 # Finally the library itself
 find_library(aravis_LIBRARY
 	NAMES
 	libaravis-0.4
+	libaravis-0.6
 	aravis
 	aravis-0.4
+	aravis-0.6
 	libaravis
 	PATHS
 	${aravis_PKGCONF_LIBRARY_DIRS}


cmake/modules: add support for building against an untagged XRootD version

Useful for testing changes.

--- cmake/modules/FindXROOTD.cmake
+++ cmake/modules/FindXROOTD.cmake
@@ -26,19 +26,23 @@
 if (XROOTD_INCLUDE_DIR)
   file(STRINGS ${XROOTD_INCLUDE_DIR}/XrdVersion.hh xrdvers REGEX "^#define XrdVERSION ")
   string(REGEX REPLACE "#define[ ]+XrdVERSION[ ]+" "" xrdvers ${xrdvers})
-  string(REGEX REPLACE "[^v\\.]+" "" xrdversdots ${xrdvers})
-  if (${xrdversdots} STREQUAL "v..")
-    # Regular version string; parse it out
-    string(REGEX MATCH "[0-9\\.]+" xrdvers ${xrdvers})
-    string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\1" xrdversmajor ${xrdvers})
-    string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\2" xrdversminor ${xrdvers})
-    string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\3" xrdverspatch ${xrdvers})
-    math(EXPR xrdversnum ${xrdversmajor}*100000000+${xrdversminor}*10000+${xrdverspatch})
+  if (${xrdvers} STREQUAL "\"unknown\"")
+    math(EXPR xrdversnum 1000000000)
   else ()
-    # Old version string: we keep only the first numerics, i.e. the date
-    string(REGEX REPLACE "[v\"]" "" xrdvers ${xrdvers})
-    string(SUBSTRING ${xrdvers} 0 8 xrdversnum)
-  endif ()
+    string(REGEX REPLACE "[^v\\.]+" "" xrdversdots ${xrdvers})
+    if (${xrdversdots} STREQUAL "v..")
+       # Regular version string; parse it out
+       string(REGEX MATCH "[0-9\\.]+" xrdvers ${xrdvers})
+       string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\1" xrdversmajor ${xrdvers})
+       string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\2" xrdversminor ${xrdvers})
+       string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\3" xrdverspatch ${xrdvers})
+       math(EXPR xrdversnum ${xrdversmajor}*100000000+${xrdversminor}*10000+${xrdverspatch})
+    else ()
+       # Old version string: we keep only the first numerics, i.e. the date
+       string(REGEX REPLACE "[v\"]" "" xrdvers ${xrdvers})
+       string(SUBSTRING ${xrdvers} 0 8 xrdversnum)
+    endif ()
+  endif()
   if ( ${xrdversnum} EQUAL 300030000 )
      SET(XROOTD_FOUND FALSE)
      message(WARNING " >>> Cannot build with XRootD version 3.3.0: please install >=3.3.1 or <= 3.2.x")
@@ -51,7 +55,11 @@
   # Set include dirs and compiler macro variable

   if(NOT XROOTD_FIND_QUIETLY )
-    message(STATUS "Found Xrootd version num: ${xrdvers} (setting -DROOTXRDVERS=${xrdversnum})")
+    if (${xrdvers} STREQUAL "\"unknown\"")
+       message(STATUS "Found untagged Xrootd version: assuming very recent (setting -DROOTXRDVERS=${xrdversnum})")
+    else ()
+       message(STATUS "Found Xrootd version num: ${xrdvers} (setting -DROOTXRDVERS=${xrdversnum})")
+    endif()
   endif()
   set(XROOTD_CFLAGS "-DROOTXRDVERS=${xrdversnum}")


[cmake] Reduce copy-paste by moving the common code in a function.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -769,35 +769,9 @@
     if(NOT TARGET ROOT::${library})
       add_library(ROOT::${library} ALIAS ${library})
     endif()
-
-    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc)
-      target_include_directories(${library}
-        PRIVATE
-          ${CMAKE_CURRENT_SOURCE_DIR}/inc
-        INTERFACE
-          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
-      )
-    endif()
-
-    if(root7 AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc)
-      target_include_directories(${library}
-        PRIVATE
-          ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc
-        INTERFACE
-          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/v7/inc>
-      )
-    endif()
-
-    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res)
-      target_include_directories(${library}
-        PRIVATE
-          ${CMAKE_CURRENT_SOURCE_DIR}/res
-      )
-    endif()
-
-    # needed for generated headers like RConfigure.h and ROOT/RConfig.hxx
-    target_include_directories(${library} PRIVATE ${CMAKE_BINARY_DIR}/include)
-  endif()
+  endif()
+
+  ROOT_ADD_INCLUDE_DIRECTORIES(${library})

   if(TARGET G__${library})
     add_dependencies(${library} G__${library})
@@ -844,17 +818,9 @@
 endfunction()

 #---------------------------------------------------------------------------------------------------
-#---ROOT_OBJECT_LIBRARY( <name> source1 source2 ... BUILTINS dep1 dep2 ...)
-#---------------------------------------------------------------------------------------------------
-function(ROOT_OBJECT_LIBRARY library)
-  CMAKE_PARSE_ARGUMENTS(ARG "" "" "BUILTINS"  ${ARGN})
-  ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS})
-  add_library( ${library} OBJECT ${lib_srcs})
-  if(lib_srcs MATCHES "(^|/)(G__[^.]*)[.]cxx.*")
-     add_dependencies(${library} ${CMAKE_MATCH_2})
-  endif()
-  add_dependencies(${library} move_headers)
-
+#---ROOT_ADD_INCLUDE_DIRECTORIES( library )
+#---------------------------------------------------------------------------------------------------
+function(ROOT_ADD_INCLUDE_DIRECTORIES library)
   if(PROJECT_NAME STREQUAL "ROOT")
     if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc)
       target_include_directories(${library}
@@ -884,6 +850,22 @@
     # needed for generated headers like RConfigure.h and ROOT/RConfig.hxx
     target_include_directories(${library} PRIVATE ${CMAKE_BINARY_DIR}/include)
   endif()
+
+endfunction(ROOT_ADD_INCLUDE_DIRECTORIES)
+
+#---------------------------------------------------------------------------------------------------
+#---ROOT_OBJECT_LIBRARY( <name> source1 source2 ... BUILTINS dep1 dep2 ...)
+#---------------------------------------------------------------------------------------------------
+function(ROOT_OBJECT_LIBRARY library)
+  CMAKE_PARSE_ARGUMENTS(ARG "" "" "BUILTINS"  ${ARGN})
+  ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS})
+  add_library( ${library} OBJECT ${lib_srcs})
+  if(lib_srcs MATCHES "(^|/)(G__[^.]*)[.]cxx.*")
+     add_dependencies(${library} ${CMAKE_MATCH_2})
+  endif()
+  add_dependencies(${library} move_headers)
+
+  ROOT_ADD_INCLUDE_DIRECTORIES(${library})

   #--- Only for building shared libraries
   set_property(TARGET ${library} PROPERTY POSITION_INDEPENDENT_CODE 1)
@@ -947,35 +929,7 @@
   # macros.
   set_target_properties(${library} PROPERTIES DEFINE_SYMBOL "")

-  if(PROJECT_NAME STREQUAL "ROOT")
-    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc)
-      target_include_directories(${library}
-        PRIVATE
-          ${CMAKE_CURRENT_SOURCE_DIR}/inc
-        INTERFACE
-          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
-      )
-    endif()
-
-    if(root7 AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc)
-      target_include_directories(${library}
-        PRIVATE
-          ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc
-        INTERFACE
-          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/v7/inc>
-      )
-    endif()
-
-    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res)
-      target_include_directories(${library}
-        PRIVATE
-          ${CMAKE_CURRENT_SOURCE_DIR}/res
-      )
-    endif()
-
-    # needed for generated headers like RConfigure.h and ROOT/RConfig.hxx
-    target_include_directories(${library} PRIVATE ${CMAKE_BINARY_DIR}/include)
-  endif()
+  ROOT_ADD_INCLUDE_DIRECTORIES(${library})

   target_link_libraries(${library} PUBLIC ${ARG_LIBRARIES})
   #----Installation details-------------------------------------------------------


Use all-keyword style in ROOT_MODULE_LIBRARY()

Follow changes from commit fe4ffa754ca3a8805791a3fb2d7458be617b836d,
but for ROOT_MODULE_LIBRARY(). Otherwise, when it's used, CMake will
complain about mixing all-keyword with no-keyword linking.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -893,7 +893,7 @@
   # macros.
   set_target_properties(${library} PROPERTIES DEFINE_SYMBOL "")

-  target_link_libraries(${library} ${ARG_LIBRARIES})
+  target_link_libraries(${library} PUBLIC ${ARG_LIBRARIES})
   #----Installation details-------------------------------------------------------
   install(TARGETS ${library} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
                              LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries


Make cmake_link_flags macro much more robust.
pkg_check_pkgconfig macro processes its link_flags with cmake_link_flags macro.

svn path=/trunk/; revision=8177

--- cmake/modules/pkg-config.cmake
+++ cmake/modules/pkg-config.cmake
@@ -62,7 +62,8 @@
 macro(pkg_check_pkgconfig _package _include_DIR _link_DIR _link_FLAGS _cflags)
   # Similar to legacy pkgconfig only these results are derived
   # from pkg_check_modules and therefore are returned as lists rather than
-  # blank-delimited strings.
+  # blank-delimited strings.  Also, the _link_FLAGS value is converted
+  # to the preferred CMake form via the cmake_link_flags macro.

   # N.B. if using this macro in more than one context, cache clashes will
   # occur unless optional trailing prefix argument is specified to distinguish
@@ -76,7 +77,7 @@
   if (${_prefix}_FOUND)
     set(${_include_DIR} ${${_prefix}_INCLUDE_DIRS})
     set(${_link_DIR}    ${${_prefix}_LIBRARY_DIRS})
-    set(${_link_FLAGS}  ${${_prefix}_LDFLAGS})
+    cmake_link_flags(${_link_FLAGS}  "${${_prefix}_LDFLAGS}")
     set(${_cflags}      ${${_prefix}_CFLAGS})
     set(_return_VALUE 0)
   else(${_prefix}_FOUND)
@@ -150,58 +151,73 @@
   # may not be the case for windows.
   # N.B. ${_link_flags_in} must be a string and not a list.

-  #message("(original link flags) = ${_link_flags_in}")
-  # Convert link flags to a list.
-  string(REGEX REPLACE " " ";" _link_flags_list "${_link_flags_in}")
-  # Extract list of directories from -L options.
-  list(LENGTH _link_flags_list _link_flags_length)
-  math(EXPR _link_flags_length "${_link_flags_length} - 1")
-  set(_index_list)
-  set(_link_directory_list)
-  foreach(_list_index RANGE ${_link_flags_length})
-    list(GET _link_flags_list ${_list_index} _list_element)
-    string(REGEX REPLACE "^-L" "" _list_element1 ${_list_element})
-    if(_list_element STREQUAL "-L${_list_element1}")
-      list(APPEND _index_list ${_list_index})
-      list(APPEND _link_directory_list ${_list_element1})
-    endif(_list_element STREQUAL "-L${_list_element1}")
-  endforeach(_list_index RANGE ${_link_flags_length})
-  # Remove -L options from list.
-  list(REMOVE_AT _link_flags_list ${_index_list})
-  #message("_link_directory_list = ${_link_directory_list}")
-  #message("_link_flags_list (without -L options) = ${_link_flags_list}")
-
-  # Derive ${_link_flags_out} from _link_flags_list with -l options
-  # replaced by complete pathname of library.
-  list(LENGTH _link_flags_list _link_flags_length)
-  math(EXPR _link_flags_length "${_link_flags_length} - 1")
-  set(${_link_flags_out})
-  foreach(_list_index RANGE ${_link_flags_length})
-    list(GET _link_flags_list ${_list_index} _list_element)
-    string(REGEX REPLACE "^-l" "" _list_element1 ${_list_element})
-    if(_list_element STREQUAL "-l${_list_element1}")
-      set(_library_pathname "_library_pathname-NOTFOUND")
-      find_library(
-       _library_pathname
-       ${_list_element1}
-       PATHS ${_link_directory_list}
-       NO_DEFAULT_PATH
-      )
-      if(NOT _library_pathname)
-        message(
-	"Cannot find library corresponding to linker option ${_list_element}"
-	)
-        message(
-	"original link flags delivered by pkg-config = ${_link_flags_in}"
-	)
-        message(FATAL_ERROR "FATAL ERROR in cmake_link_flags macro")
-      endif(NOT _library_pathname)
-      list(APPEND ${_link_flags_out} ${_library_pathname})
-    else(_list_element STREQUAL "-L${_list_element1}")
-      # link options that are not -L or -l passed through in correct order
-      # in ${_link_flags_out}.
-      list(APPEND ${_link_flags_out} ${_list_element})
-    endif(_list_element STREQUAL "-l${_list_element1}")
-  endforeach(_list_index RANGE ${_link_flags_length})
-  #message("${_link_flags_out} = ${${_link_flags_out}}")
+  if("${_link_flags_in}" STREQUAL "")
+    set(${_link_flags_out})
+  else("${_link_flags_in}" STREQUAL ""})
+    #message("(original link flags) = ${_link_flags_in}")
+    # Convert link flags to a list.
+    string(REGEX REPLACE " " ";" _link_flags_list "${_link_flags_in}")
+    # Extract list of directories from -L options.
+    list(LENGTH _link_flags_list _link_flags_length)
+    math(EXPR _link_flags_length "${_link_flags_length} - 1")
+    set(_index_list)
+    set(_link_directory_list)
+    foreach(_list_index RANGE ${_link_flags_length})
+      list(GET _link_flags_list ${_list_index} _list_element)
+      string(REGEX REPLACE "^-L" "" _list_element1 ${_list_element})
+      if(_list_element STREQUAL "-L${_list_element1}")
+        list(APPEND _index_list ${_list_index})
+        list(APPEND _link_directory_list ${_list_element1})
+      endif(_list_element STREQUAL "-L${_list_element1}")
+    endforeach(_list_index RANGE ${_link_flags_length})
+    #message("_index_list = ${_index_list}")
+    if("${_index_list}" STREQUAL "")
+    else("${_index_list}" STREQUAL "")
+      # Remove -L options from list.
+      list(REMOVE_AT _link_flags_list ${_index_list})
+    endif("${_index_list}" STREQUAL "")
+    #message("_link_directory_list = ${_link_directory_list}")
+    #message("_link_flags_list (without -L options) = ${_link_flags_list}")
+
+    # Derive ${_link_flags_out} from _link_flags_list with -l options
+    # replaced by complete pathname of library.
+    list(LENGTH _link_flags_list _link_flags_length)
+    math(EXPR _link_flags_length "${_link_flags_length} - 1")
+    set(${_link_flags_out})
+    foreach(_list_index RANGE ${_link_flags_length})
+      list(GET _link_flags_list ${_list_index} _list_element)
+      string(REGEX REPLACE "^-l" "" _list_element1 ${_list_element})
+      if(_list_element STREQUAL "-l${_list_element1}")
+        set(_library_pathname "_library_pathname-NOTFOUND")
+        find_library(
+         _library_pathname
+         ${_list_element1}
+         PATHS ${_link_directory_list}
+         NO_DEFAULT_PATH
+        )
+	# Try second time (without NO_DEFAULT_PATH) just in case pkg-config
+	# specified some system libraries without corresponding -L options.
+        find_library(
+         _library_pathname
+         ${_list_element1}
+         PATHS ${_link_directory_list}
+        )
+        if(NOT _library_pathname)
+          message(
+  	"Cannot find library corresponding to linker option ${_list_element}"
+  	)
+          message(
+  	"original link flags delivered by pkg-config = ${_link_flags_in}"
+  	)
+          message(FATAL_ERROR "FATAL ERROR in cmake_link_flags macro")
+        endif(NOT _library_pathname)
+        list(APPEND ${_link_flags_out} ${_library_pathname})
+      else(_list_element STREQUAL "-L${_list_element1}")
+        # link options that are not -L or -l passed through in correct order
+        # in ${_link_flags_out}.
+        list(APPEND ${_link_flags_out} ${_list_element})
+      endif(_list_element STREQUAL "-l${_list_element1}")
+    endforeach(_list_index RANGE ${_link_flags_length})
+    #message("${_link_flags_out} = ${${_link_flags_out}}")
+  endif("${_link_flags_in}" STREQUAL "")
 endmacro(cmake_link_flags)


Separated finding libraries and including them based on build type

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -46,6 +46,7 @@
   mark_as_advanced(DCMTK_DIR)
 endif()

+# Find all libraries, store debug and release separately
 foreach(lib
     dcmdata
     dcmimage
@@ -64,7 +65,7 @@
     ofstd)

   # Find Release libraries
-  find_library(DCMTK_${lib}_LIBRARY
+  find_library(DCMTK_${lib}_LIBRARY_RELEASE
     ${lib}
     PATHS
     ${DCMTK_DIR}/${lib}/libsrc
@@ -75,15 +76,7 @@
     ${DCMTK_DIR}/dcmjpeg/lib${lib}/Release
     NO_DEFAULT_PATH
     )
-
-  mark_as_advanced(DCMTK_${lib}_LIBRARY)

-  #message("** DCMTKs ${lib} found at ${DCMTK_${lib}_LIBRARY}")
-
-  if(DCMTK_${lib}_LIBRARY)
-    list(APPEND DCMTK_LIBRARIES_RELEASE optimized ${DCMTK_${lib}_LIBRARY})
-  endif()
-
   # Find Debug libraries
   find_library(DCMTK_${lib}_LIBRARY_DEBUG
     ${lib}
@@ -97,16 +90,39 @@
     NO_DEFAULT_PATH
     )

+  mark_as_advanced(DCMTK_${lib}_LIBRARY_RELEASE)
   mark_as_advanced(DCMTK_${lib}_LIBRARY_DEBUG)
-
-  if(DCMTK_${lib}_LIBRARY_DEBUG)
-    list(APPEND DCMTK_LIBRARIES_DEBUG debug ${DCMTK_${lib}_LIBRARY_DEBUG})
-  endif()

 endforeach()

-#depending on build type set debug or release
-list(APPEND DCMTK_LIBRARIES ${DCMTK_LIBRARIES_RELEASE} ${DCMTK_LIBRARIES_DEBUG} )
+# Add libraries to variable according to build type
+# this is done as a separate loop for transparencies sake
+foreach(lib
+    dcmdata
+    dcmimage
+    dcmimgle
+    dcmjpeg
+    dcmnet
+    dcmpstat
+    dcmqrdb
+    dcmsign
+    dcmsr
+    dcmtls
+    ijg12
+    ijg16
+    ijg8
+    oflog
+    ofstd)
+
+  if(DCMTK_${lib}_LIBRARY_RELEASE)
+    list(APPEND DCMTK_LIBRARIES optimized ${DCMTK_${lib}_LIBRARY_RELEASE})
+  endif()
+
+  if(DCMTK_${lib}_LIBRARY_DEBUG)
+    list(APPEND DCMTK_LIBRARIES debug ${DCMTK_${lib}_LIBRARY_DEBUG})
+  endif()
+
+endforeach()

 set(DCMTK_config_TEST_HEADER osconfig.h)
 set(DCMTK_dcmdata_TEST_HEADER dctypes.h)


Move aom_dsp.cmake lib list updates into setup_aom_dsp_targets().

Change-Id: I5eb53ef88fb136bf8e06aa2cdc2c1feae9bec956

--- aom_dsp/aom_dsp.cmake
+++ aom_dsp/aom_dsp.cmake
@@ -272,28 +272,22 @@
       "${AOM_ROOT}/aom_dsp/x86/obmc_variance_sse4.c")
 endif ()

-set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_common)
-
-if (CONFIG_DECODERS)
-  set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_decoder)
-endif ()
-if (CONFIG_ENCODERS)
-  set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_encoder)
-endif ()
-
 # Creates aom_dsp build targets. Must not be called until after libaom target
 # has been created.
 function (setup_aom_dsp_targets)
   add_library(aom_dsp_common OBJECT ${AOM_DSP_COMMON_SOURCES})
+  set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_common)
   target_sources(aom PUBLIC $<TARGET_OBJECTS:aom_dsp_common>)

   if (CONFIG_DECODERS)
     add_library(aom_dsp_decoder OBJECT ${AOM_DSP_DECODER_SOURCES})
+    set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_decoder)
     target_sources(aom PUBLIC $<TARGET_OBJECTS:aom_dsp_decoder>)
   endif ()

   if (CONFIG_ENCODERS)
     add_library(aom_dsp_encoder OBJECT ${AOM_DSP_ENCODER_SOURCES})
+    set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_encoder)
     target_sources(aom PUBLIC $<TARGET_OBJECTS:aom_dsp_encoder>)
   endif ()


Changed doygen configuration.

Changed doygen configuration.

--- Doxyfile.cmake
+++ Doxyfile.cmake
@@ -129,7 +129,7 @@
 # path before files name in the file list and in the header files. If set
 # to NO the shortest path that makes the file name unique will be used.

-FULL_PATH_NAMES        = YES
+FULL_PATH_NAMES        = NO

 # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
 # can be used to strip a user-defined part of the path. Stripping is


CMake: pthread is used only on Unix.

CMake: pthread is used only on Unix.

--- SetFlags.cmake
+++ SetFlags.cmake
@@ -63,12 +63,16 @@

 	else()
 		# Let gcc / clang know that we're compiling a multi-threaded app:
-		add_flags_cxx("-pthread")
+		if (UNIX)
+			add_flags_cxx("-pthread")
+		endif()
+
+		# Make CLang use C++11, otherwise MSVC2008-supported extensions don't work ("override" keyword etc.):
 		if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-			set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS}         -std=c++11")
-			set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}   -std=c++11")
+			set(CMAKE_CXX_FLAGS          "${CMAKE_CXX_FLAGS}          -std=c++11")
+			set(CMAKE_CXX_FLAGS_DEBUG    "${CMAKE_CXX_FLAGS_DEBUG}    -std=c++11")
 			set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -std=c++11")
-			set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11")
+			set(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE}  -std=c++11")
 		endif()

 		# We use a signed char (fixes #640 on RasPi)


Sync package version of double-conversion between bazel and cmake (#20017)

* Sync package version of double-conversion between bazel and cmake

This fix tries to sync package version of double-conversion between
bazel and cmake.

The double-conversion package was added in 12102 and was reverted
in PR 15133. At that time the package version was 5664746 for both
bazel and cmake.

Later on, the double-conversion was re-introduced in PR 18746. The
package version of double-conversion in bazel has been advanced
to 3992066a95b823efc8ccc1baf82a1cfc73f6e9b8 but the version in cmake
remains the old 5664746.

This fix updates the double-conversion version in cmake so that
it is synced with the version (3992066a95b823efc8ccc1baf82a1cfc73f6e9b8) used in bazel.

Signed-off-by: Yong Tang <765086fe2e0c1f980161f127fec596800f327f62@outlook.com>

* Change the target path of libdouble-conversion.a

Signed-off-by: Yong Tang <765086fe2e0c1f980161f127fec596800f327f62@outlook.com>

--- tensorflow/contrib/cmake/external/double_conversion.cmake
+++ tensorflow/contrib/cmake/external/double_conversion.cmake
@@ -16,15 +16,15 @@

 set(double_conversion_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/double_conversion/src/double_conversion)
 set(double_conversion_URL https://github.com/google/double-conversion.git)
-set(double_conversion_TAG 5664746)
+set(double_conversion_TAG 3992066a95b823efc8ccc1baf82a1cfc73f6e9b8)
 set(double_conversion_BUILD ${double_conversion_INCLUDE_DIR})
 set(double_conversion_LIBRARIES ${double_conversion_BUILD}/double-conversion/libdouble-conversion.so)
 set(double_conversion_INCLUDES ${double_conversion_BUILD})

 if(WIN32)
-  set(double_conversion_STATIC_LIBRARIES ${double_conversion_BUILD}/double-conversion/$(Configuration)/double-conversion.lib)
+  set(double_conversion_STATIC_LIBRARIES ${double_conversion_BUILD}/$(Configuration)/double-conversion.lib)
 else()
-  set(double_conversion_STATIC_LIBRARIES ${double_conversion_BUILD}/double-conversion/libdouble-conversion.a)
+  set(double_conversion_STATIC_LIBRARIES ${double_conversion_BUILD}/libdouble-conversion.a)
 endif()

 set(double_conversion_HEADERS


Remove FindSeqAn.cmake

Remove FindSeqAn.cmake

--- cmake/FindSeqAn.cmake
+++ cmake/FindSeqAn.cmake
@@ -1,449 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-#
-# This CMake module will try to find SeqAn and its dependencies.  You can use
-# it the same way you would use any other CMake module.
-#
-#   find_package(SeqAn [REQUIRED] ...)
-#
-# You can control the exact behaviour by setting the following variables.  The
-# defaults are given after the variable name.
-#
-#   SEQAN_FIND_DEPENDENCIES   -- DEFAULT
-#   SEQAN_FIND_ENABLE_TESTING -- TRUE if ${CMAKE_BUILD_TYPE} == "Debug", FALSE
-#                                otherwise.
-#
-# For example:
-#
-#   set (SEQAN_FIND_DEPENDENCIES ZLIB BZip2)
-#   find_package (SeqAn)
-#
-# The first variable is either "ALL", "DEFAULT" or a list of dependency names
-# and gives the names of the dependencies to search for.  The other two
-# variables can be used to forcibly enabling/disabling the debug and testing
-# mode.
-#
-# Valid dependencies are:
-#
-#   ALL     -- Forcibly enable all dependencies.
-#   DEFAULT -- Enable default dependencies (zlib, OpenMP if available)
-#   NONE    -- Disable all dependencies.
-#
-#   ZLIB    -- zlib compression library
-#   BZip2   -- libbz2 compression library
-#   OpenMP  -- OpenMP language extensions to C/C++
-#   CUDA    -- CUDA language extensions to C/C++
-#
-#
-# Once the search has been performed, the following variables will be set.
-#
-#  SEQAN_FOUND           -- Indicate whether SeqAn was found.
-#
-# These variables are flags that indicate whether the various dependencies
-# of the SeqAn library were found.
-#
-#  SEQAN_HAS_ZLIB
-#  SEQAN_HAS_BZIP2
-#  SEQAN_HAS_OPENMP
-#  SEQAN_HAS_CUDA
-#
-# These variables give lists that are to be passed to the
-# include_directories(), target_link_libraries(), and add_definitions()
-# functions.
-#
-#  SEQAN_INCLUDE_DIRS
-#  SEQAN_LIBRARIES
-#  SEQAN_DEFINITIONS
-#
-# Additionally, the following two variables are set.  The first contains
-# the include paths for SeqAn, the second for dependencies.  This allows to
-# include the dependency headers using include_directories (SYSTEM ...),
-# such that warnings from these headers do not appear in the nightly builds.
-#
-#  SEQAN_INCLUDE_DIRS_MAIN
-#  SEQAN_INCLUDE_DIRS_DEPS
-#
-# The C++ compiler flags to set.
-#
-#  SEQAN_CXX_FLAGS
-#
-# The following variables give the version of the SeqAn library, its
-# major, minor, and the patch version part of the version string.
-#
-#  SEQAN_VERSION_STRING
-#  SEQAN_VERSION_MAJOR
-#  SEQAN_VERSION_MINOR
-#  SEQAN_VERSION_PATCH
-#
-# ============================================================================
-
-include(FindPackageMessage)
-include(CheckIncludeFiles)
-
-# ----------------------------------------------------------------------------
-# Define Constants.
-# ----------------------------------------------------------------------------
-
-set(_SEQAN_DEFAULT_LIBRARIES ZLIB OpenMP)
-set(_SEQAN_ALL_LIBRARIES     ZLIB BZip2 OpenMP CUDA)
-
-# ----------------------------------------------------------------------------
-# Set variables SEQAN_FIND_* to their default unless they have been set.
-# ----------------------------------------------------------------------------
-
-# SEQAN_FIND_DEPENDENCIES
-if (NOT SEQAN_FIND_DEPENDENCIES)
-  set(SEQAN_FIND_DEPENDENCIES "DEFAULT")
-endif ()
-if (SEQAN_FIND_DEPENDENCIES STREQUAL "DEFAULT")
-  set(SEQAN_FIND_DEPENDENCIES ${_SEQAN_DEFAULT_LIBRARIES})
-elseif (SEQAN_FIND_DEPENDENCIES STREQUAL "ALL")
-  set(SEQAN_FIND_DEPENDENCIES ${_SEQAN_ALL_LIBRARIES})
-elseif (SEQAN_FIND_DEPENDENCIES STREQUAL "NONE")
-  set(SEQAN_FIND_DEPENDENCIES)
-endif ()
-
-# SEQAN_FIND_ENABLE_TESTING
-if (NOT SEQAN_FIND_ENABLE_TESTING)
-  set(SEQAN_FIND_ENABLE_TESTING "FALSE")
-endif ()
-
-# ----------------------------------------------------------------------------
-# Compile-specific settings and workarounds around missing CMake features.
-# ----------------------------------------------------------------------------
-
-# Recognize Clang compiler.
-
-set (COMPILER_IS_CLANG FALSE)
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  set (COMPILER_IS_CLANG TRUE)
-endif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-
-# Fix CMAKE_COMPILER_IS_GNUCXX for MinGW.
-
-if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-  set (CMAKE_COMPILER_IS_GNUCXX TRUE)
-endif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-
-# GCC Setup
-
-if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-  # Tune warnings for GCC.
-  set (CMAKE_CXX_WARNING_LEVEL 4)
-  # NOTE: First location to set SEQAN_CXX_FLAGS at the moment.  If you write
-  # to the variable for the first time earlier, update this line to append to
-  # the variable instead of overwriting.
-  set (SEQAN_CXX_FLAGS "-W -Wall -Wno-long-long -fstrict-aliasing -Wstrict-aliasing")
-  set (SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64)
-
-  # Determine GCC version.
-  EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
-               ARGS --version
-               OUTPUT_VARIABLE __GCC_VERSION)
-  # Remove all but first line.
-  STRING(REGEX REPLACE "([^\n]+).*" "\\1" __GCC_VERSION ${__GCC_VERSION})
-  # Find out version (3 or 2 components).
-  STRING(REGEX REPLACE ".*([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3"
-         __GCC_VERSION ${__GCC_VERSION})
-  STRING(REGEX REPLACE ".*([0-9])\\.([0-9]).*" "\\1\\20"
-         _GCC_VERSION ${__GCC_VERSION})
-
-  # Add -Wno-longlong if the GCC version is < 4.0.0.  Add -pedantic flag but
-  # disable warnings for variadic macros with GCC >= 4.0.0.  Earlier versions
-  # warn because of anonymous variadic macros in pedantic mode but do not have
-  # a flag to disable these warnings.
-  if (400 GREATER _GCC_VERSION)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -Wno-long-long")
-  else (400 GREATER _GCC_VERSION)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -pedantic -Wno-variadic-macros")
-  endif (400 GREATER _GCC_VERSION)
-
-  # Force GCC to keep the frame pointer when debugging is enabled.  This is
-  # mainly important for 64 bit but does not get into the way on 32 bit either
-  # at minimal performance impact.
-  if (CMAKE_BUILD_TYPE STREQUAL Debug)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} ${SEQAN_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer")
-  elseif (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} ${SEQAN_CXX_FLAGS_RELEASE} -g -fno-omit-frame-pointer")
-  endif ()
-endif ()
-
-# Windows Setup
-
-if (WIN32)
-  # Always set NOMINMAX such that <Windows.h> does not define min/max as
-  # macros.
-  add_definitions (-DNOMINMAX)
-endif (WIN32)
-
-# Visual Studio Setup
-if (MSVC)
-  # Enable intrinics (e.g. _interlockedIncrease)
-  set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /EHsc /Oi")
-  # Warning level 3 for MSVC is disabled for now to see how much really bad warnings there are.
-  #set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /W3)
-
-  # TODO(holtgrew): This rather belongs into the SeqAn build system and notso much into FindSeqAn.cmake.
-
-  # Force to always compile with W2.
-  add_definitions (/W2)
-
-  # Disable warnings about unsecure (although standard) functions.
-  add_definitions (-D_SCL_SECURE_NO_WARNINGS)
-endif (MSVC)
-
-# ----------------------------------------------------------------------------
-# Search for directory seqan.
-# ----------------------------------------------------------------------------
-
-option (SEQAN_USE_SEQAN_BUILD_SYSTEM "Whether or not to expect the SeqAn build system." OFF)
-
-if (SEQAN_USE_SEQAN_BUILD_SYSTEM)
-  # When using the SeqAn build system, we scan all entries in
-  # CMAKE_INCLUDE_PATH for a subdirectory seqan and add all paths to the
-  # variable SEQAN_INCLUDE_DIRS_MAIN.
-  set (_SEQAN_INCLUDE_DIRS "")
-  foreach (_SEQAN_BASEDIR ${CMAKE_INCLUDE_PATH})
-    if (EXISTS ${_SEQAN_BASEDIR}/seqan)
-      get_filename_component(_SEQAN_BASEDIR "${_SEQAN_BASEDIR}" ABSOLUTE)
-      set(_SEQAN_INCLUDE_DIRS ${_SEQAN_INCLUDE_DIRS} ${_SEQAN_BASEDIR})
-    endif (EXISTS ${_SEQAN_BASEDIR}/seqan)
-  endforeach (_SEQAN_BASEDIR ${CMAKE_INCLUDE_PATH})
-
-  if (_SEQAN_INCLUDE_DIRS)
-    set(SEQAN_FOUND        TRUE)
-    set(SEQAN_INCLUDE_DIRS_MAIN ${SEQAN_INCLUDE_DIRS_MAIN} ${_SEQAN_INCLUDE_DIRS})
-  else (_SEQAN_INCLUDE_DIRS)
-    set(SEQAN_FOUND        FALSE)
-  endif (_SEQAN_INCLUDE_DIRS)
-else (SEQAN_USE_SEQAN_BUILD_SYSTEM)
-  # When NOT using the SeqAn build system then we only look for one directory
-  # with subdirectory seqan and thus only one library.
-  find_path(_SEQAN_BASEDIR "seqan" PATHS ${SEQAN_INCLUDE_PATH})
-  mark_as_advanced(_SEQAN_BASEDIR)
-  if (_SEQAN_BASEDIR)
-    set(SEQAN_FOUND        TRUE)
-    set(SEQAN_INCLUDE_DIRS_MAIN ${SEQAN_INCLUDE_DIRS_MAIN} ${_SEQAN_BASEDIR})
-  else ()
-    set(SEQAN_FOUND        FALSE)
-  endif ()
-endif (SEQAN_USE_SEQAN_BUILD_SYSTEM)
-
-# ----------------------------------------------------------------------------
-# Set defines for debug and testing.
-# ----------------------------------------------------------------------------
-
-if (SEQAN_FIND_ENABLE_TESTING)
-  set(SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} -DSEQAN_ENABLE_TESTING=1)
-else ()
-  set(SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} -DSEQAN_ENABLE_TESTING=0)
-endif ()
-
-# ----------------------------------------------------------------------------
-# Search for dependencies.
-# ----------------------------------------------------------------------------
-
-# librt, libpthread -- implicit, on Linux only
-
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-  set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} rt pthread)
-elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-  set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} pthread)
-  set (SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} "-D_GLIBCXX_USE_C99=1")
-endif ()
-
-# libexecinfo -- implicit
-
-check_include_files(execinfo.h _SEQAN_HAVE_EXECINFO)
-mark_as_advanced(_SEQAN_HAVE_EXECINFO)
-if (_SEQAN_HAVE_EXECINFO)
-  set(SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} "-DSEQAN_HAS_EXECINFO=1")
-  if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-    set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} execinfo)
-  endif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-endif (_SEQAN_HAVE_EXECINFO)
-
-
-# libstdc++ -- implicit, Mac only (clang seems not to do this automatically)
-
-if (APPLE)
-  set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} stdc++)
-endif (APPLE)
-
-# ZLIB
-
-list(FIND SEQAN_FIND_DEPENDENCIES "ZLIB" _SEQAN_FIND_ZLIB)
-mark_as_advanced(_SEQAN_FIND_ZLIB)
-
-set (SEQAN_HAS_ZLIB FALSE)
-if (NOT _SEQAN_FIND_ZLIB EQUAL -1)
-  find_package(ZLIB QUIET)
-  if (ZLIB_FOUND)
-    set (SEQAN_HAS_ZLIB     TRUE)
-    set (SEQAN_LIBRARIES         ${SEQAN_LIBRARIES}         ${ZLIB_LIBRARIES})
-    set (SEQAN_INCLUDE_DIRS_DEPS ${SEQAN_INCLUDE_DIRS_DEPS} ${ZLIB_INCLUDE_DIRS})
-    set (SEQAN_DEFINITIONS       ${SEQAN_DEFINITIONS}       "-DSEQAN_HAS_ZLIB=1")
-  endif ()
-endif ()
-
-# BZip2
-
-list(FIND SEQAN_FIND_DEPENDENCIES "BZip2" _SEQAN_FIND_BZIP2)
-mark_as_advanced(_SEQAN_FIND_BZIP2)
-
-set (SEQAN_HAS_BZIP2 FALSE)
-if (NOT _SEQAN_FIND_BZIP2 EQUAL -1)
-  find_package(BZip2 QUIET)
-  if (BZIP2_FOUND)
-    set (SEQAN_HAS_BZIP2    TRUE)
-    set (SEQAN_LIBRARIES         ${SEQAN_LIBRARIES}         ${BZIP2_LIBRARIES})
-    set (SEQAN_INCLUDE_DIRS_DEPS ${SEQAN_INCLUDE_DIRS_DEPS} ${BZIP2_INCLUDE_DIRS})
-    set (SEQAN_DEFINITIONS       ${SEQAN_DEFINITIONS}       "-DSEQAN_HAS_BZIP2=1")
-  endif ()
-endif()
-
-# OpenMP
-
-list(FIND SEQAN_FIND_DEPENDENCIES "OpenMP" _SEQAN_FIND_OPENMP)
-mark_as_advanced(_SEQAN_FIND_OPENMP)
-
-set (SEQAN_HAS_OPENMP FALSE)
-if (NOT _SEQAN_FIND_OPENMP EQUAL -1)
-  find_package(OpenMP QUIET)
-  # Note that in the following, we do not check for OPENMP_FOUND since this is
-  # only true if both C and C++ compiler support OpenMP.  This is not the case
-  # if the user has a compiler without OpenMP support by default and overrides
-  # only the C++ compiler (e.g. on winter 2013's Mac Os X).
-  if (OpenMP_CXX_FLAGS)
-    set (SEQAN_HAS_OPENMP   TRUE)
-    set (SEQAN_LIBRARIES         ${SEQAN_LIBRARIES}         ${OpenMP_LIBRARIES})
-    set (SEQAN_INCLUDE_DIRS_DEPS ${SEQAN_INCLUDE_DIRS_DEPS} ${OpenMP_INCLUDE_DIRS})
-    set (SEQAN_DEFINITIONS       ${SEQAN_DEFINITIONS}       "-DSEQAN_HAS_OPENMP=1")
-    set (SEQAN_CXX_FLAGS        "${SEQAN_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-  endif ()
-endif ()
-
-# CUDA
-
-list(FIND SEQAN_FIND_DEPENDENCIES "CUDA" _SEQAN_FIND_CUDA)
-mark_as_advanced(_SEQAN_FIND_CUDA)
-
-set (SEQAN_HAS_CUDA FALSE)
-if (SEQAN_ENABLE_CUDA AND NOT _SEQAN_FIND_CUDA EQUAL -1)
-  find_package(CUDA QUIET)
-  if (CUDA_FOUND)
-    set (SEQAN_HAS_CUDA TRUE)
-  endif ()
-endif (SEQAN_ENABLE_CUDA AND NOT _SEQAN_FIND_CUDA EQUAL -1)
-
-# Build SEQAN_INCLUDE_DIRS from SEQAN_INCLUDE_DIRS_MAIN and SEQAN_INCLUDE_DIRS_DEPS
-
-set (SEQAN_INCLUDE_DIRS ${SEQAN_INCLUDE_DIRS_MAIN} ${SEQAN_INCLUDE_DIRS_DEPS})
-
-# ----------------------------------------------------------------------------
-# Determine and set SEQAN_VERSION_* variables.
-# ----------------------------------------------------------------------------
-
-if (NOT DEFINED SEQAN_VERSION_STRING)
-  if (NOT CMAKE_CURRENT_LIST_DIR)  # CMAKE_CURRENT_LIST_DIR only from cmake 2.8.3.
-    get_filename_component (CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-  endif (NOT CMAKE_CURRENT_LIST_DIR)
-
-  try_run (_SEQAN_RUN_RESULT
-           _SEQAN_COMPILE_RESULT
-           ${CMAKE_BINARY_DIR}/CMakeFiles/SeqAnVersion
-           ${CMAKE_CURRENT_LIST_DIR}/SeqAnVersion.cpp
-           CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${SEQAN_INCLUDE_DIRS_MAIN}"
-           COMPILE_OUTPUT_VARIABLE _COMPILE_OUTPUT
-           RUN_OUTPUT_VARIABLE _RUN_OUTPUT)
-  if (NOT _RUN_OUTPUT)
-    message ("")
-    message ("ERROR: Could not determine SeqAn version.")
-    message ("COMPILE OUTPUT:")
-    message (${_COMPILE_OUTPUT})
-  endif (NOT _RUN_OUTPUT)
-
-  string (REGEX REPLACE ".*SEQAN_VERSION_MAJOR:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_MAJOR ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_MINOR:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_MINOR ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_PATCH:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_PATCH ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_PRE_RELEASE:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_PRE_RELEASE ${_RUN_OUTPUT})
-
-  if (SEQAN_VERSION_PRE_RELEASE EQUAL 1)
-    set (_SEQAN_VERSION_DEVELOPMENT "TRUE")
-  else ()
-    set (_SEQAN_VERSION_DEVELOPMENT "FALSE")
-  endif ()
-
-  set (_SEQAN_VERSION_STRING "${_SEQAN_VERSION_MAJOR}.${_SEQAN_VERSION_MINOR}.${_SEQAN_VERSION_PATCH}")
-  if (_SEQAN_VERSION_DEVELOPMENT)
-    set (_SEQAN_VERSION_STRING "${_SEQAN_VERSION_STRING}_dev")
-  endif ()
-
-  # Cache results.
-  set (SEQAN_VERSION_MAJOR "${_SEQAN_VERSION_MAJOR}" CACHE INTERNAL "SeqAn major version.")
-  set (SEQAN_VERSION_MINOR "${_SEQAN_VERSION_MINOR}" CACHE INTERNAL "SeqAn minor version.")
-  set (SEQAN_VERSION_PATCH "${_SEQAN_VERSION_PATCH}" CACHE INTERNAL "SeqAn patch version.")
-  set (SEQAN_VERSION_PRE_RELEASE "${_SEQAN_VERSION_PRE_RELEASE}" CACHE INTERNAL "Whether version is a pre-release version version.")
-  set (SEQAN_VERSION_STRING "${_SEQAN_VERSION_STRING}" CACHE INTERNAL "SeqAn version string.")
-
-  message (STATUS "  Determined version is ${SEQAN_VERSION_STRING}")
-endif (NOT DEFINED SEQAN_VERSION_STRING)
-
-# ----------------------------------------------------------------------------
-# Print Variables
-# ----------------------------------------------------------------------------
-
-if (SEQAN_FIND_DEBUG)
-  message("Result for ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")
-  message("")
-  message("  CMAKE_BUILD_TYPE           ${CMAKE_BUILD_TYPE}")
-  message("  CMAKE_SOURCE_DIR           ${CMAKE_SOURCE_DIR}")
-  message("  CMAKE_INCLUDE_PATH         ${CMAKE_INCLUDE_PATH}")
-  message("  _SEQAN_BASEDIR             ${_SEQAN_BASEDIR}")
-  message("")
-  message("  SEQAN_FOUND                ${SEQAN_FOUND}")
-  message("  SEQAN_HAS_ZLIB             ${SEQAN_HAS_ZLIB}")
-  message("  SEQAN_HAS_BZIP2            ${SEQAN_HAS_BZIP2}")
-  message("  SEQAN_HAS_OPENMP           ${SEQAN_HAS_OPENMP}")
-  message("  SEQAN_HAS_CUDA             ${SEQAN_HAS_CUDA}")
-  message("")
-  message("  SEQAN_INCLUDE_DIRS         ${SEQAN_INCLUDE_DIRS}")
-  message("  SEQAN_INCLUDE_DIRS_DEPS    ${SEQAN_INCLUDE_DIRS_DEPS}")
-  message("  SEQAN_INCLUDE_DIRS_MAIN    ${SEQAN_INCLUDE_DIRS_MAIN}")
-  message("  SEQAN_LIBRARIES            ${SEQAN_LIBRARIES}")
-  message("  SEQAN_DEFINITIONS          ${SEQAN_DEFINITIONS}")
-  message("  SEQAN_CXX_FLAGS            ${SEQAN_CXX_FLAGS}")
-  message("")
-  message("  SEQAN_VERSION_STRING       ${SEQAN_VERSION_STRING}")
-  message("  SEQAN_VERSION_MAJOR        ${SEQAN_VERSION_MAJOR}")
-  message("  SEQAN_VERSION_MINORG       ${SEQAN_VERSION_MINOR}")
-  message("  SEQAN_VERSION_PATCH        ${SEQAN_VERSION_PATCH}")
-endif ()