Added catch to disable MSVC flags for clang (win)

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -145,74 +145,76 @@

          # if the clang msvc-like command line interface is being used
          if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
-             set(CMAKE_CXX_FLAGS
-                     "${CMAKE_CXX_FLAGS}"
-                     " /MD"
-                     " /EHsc"
-                     " /W3"
-                     " /FC"
-                     " /Ox"
-                     " -D_SCL_SECURE_NO_WARNINGS"
-                     )
-             string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-
-             # clang-cl 9 doesn't properly implement an alternative for -isystem <dir>
-             # for system headers, all warnings incurred by eigen must be silenced to
-             # make the build log readable.
-             if (CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 12.0.0)
+             if (NOT TUDAT_DISABLE_MSVC_CLANG_CL_FLAGS)
                  set(CMAKE_CXX_FLAGS
                          "${CMAKE_CXX_FLAGS}"
-                         " -Wno-float-conversion"
-                         " -Wno-unreachable-code-return"
-                         " -Wno-unused-template"
-                         " -Wno-sign-conversion"
-                         " -Wno-undef"
-                         " -Wno-unused-result"
-                         " -Wno-documentation-unknown-command"
-                         " -Wno-missing-prototypes"
-                         " -Wno-missing-noreturn"
-                         " -Wno-deprecated-declarations"
-                         " -Wno-implicit-int-conversion"
-                         " -Wno-shadow-field-in-constructor"
-                         " -Wno-shadow-field"
-                         " -Wno-switch-enum"
-                         " -Wno-cast-align"
-                         " -Wno-float-equal"
-                         " -Wno-deprecated-dynamic-exception-spec"
-                         " -Wno-header-hygiene"
-                         " -Wno-zero-as-null-pointer-constant"
-                         " -Wno-vla-extension"
-                         " -Wno-old-style-cast"
-                         " -Wno-disabled-macro-expansion"
-                         " -Wno-covered-switch-default"
-                         " -Wno-range-loop-analysis"
-                         " -Wno-shadow"
-                         " -Wno-reserved-id-macro"
-                         " -Wno-float-overflow-conversion"
-                         " -Wno-unknown-argument"
-                         " -Wno-extra-semi"
-                         " -Wno-global-constructors"
-                         " -Wno-extra-semi-stmt"
-                         " -Wno-documentation-deprecated-sync"
-                         " -Wno-unused-variable"
-                         " -Wno-shadow-uncaptured-local"
-                         " -Wno-documentation"
-                         " -Wno-deprecated"
-                         " -Wno-unused-macros"
-                         " -Wno-vla"
-                         " -Wno-unreachable-code-break"
-                         " -Wno-implicit-fallthrough"
-                         " -Wno-conditional-uninitialized"
-                         " -Wno-exit-time-destructors"
-                         " -Wno-undefined-func-template"
-                         " -Wno-c++98-compat"
-                         " -Wno-shorten-64-to-32"
-                         " -Wno-c++98-compat-pedantic"
-                         " -Wno-used-but-marked-unused" # : boost unit tests. should be reinabled and sorted out.
-                         " -Wno-newline-eof" # : end of line newline. should be reinabled and so.
-                         " -Wno-return-std-move-in-c++11" # :
+                         " /MD"
+                         " /EHsc"
+                         " /W3"
+                         " /FC"
+                         " /Ox"
+                         " -D_SCL_SECURE_NO_WARNINGS"
                          )
                  string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+                 # clang-cl 9 doesn't properly implement an alternative for -isystem <dir>
+                 # for system headers, all warnings incurred by eigen must be silenced to
+                 # make the build log readable.
+                 if (CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 12.0.0)
+                     set(CMAKE_CXX_FLAGS
+                             "${CMAKE_CXX_FLAGS}"
+                             " -Wno-float-conversion"
+                             " -Wno-unreachable-code-return"
+                             " -Wno-unused-template"
+                             " -Wno-sign-conversion"
+                             " -Wno-undef"
+                             " -Wno-unused-result"
+                             " -Wno-documentation-unknown-command"
+                             " -Wno-missing-prototypes"
+                             " -Wno-missing-noreturn"
+                             " -Wno-deprecated-declarations"
+                             " -Wno-implicit-int-conversion"
+                             " -Wno-shadow-field-in-constructor"
+                             " -Wno-shadow-field"
+                             " -Wno-switch-enum"
+                             " -Wno-cast-align"
+                             " -Wno-float-equal"
+                             " -Wno-deprecated-dynamic-exception-spec"
+                             " -Wno-header-hygiene"
+                             " -Wno-zero-as-null-pointer-constant"
+                             " -Wno-vla-extension"
+                             " -Wno-old-style-cast"
+                             " -Wno-disabled-macro-expansion"
+                             " -Wno-covered-switch-default"
+                             " -Wno-range-loop-analysis"
+                             " -Wno-shadow"
+                             " -Wno-reserved-id-macro"
+                             " -Wno-float-overflow-conversion"
+                             " -Wno-unknown-argument"
+                             " -Wno-extra-semi"
+                             " -Wno-global-constructors"
+                             " -Wno-extra-semi-stmt"
+                             " -Wno-documentation-deprecated-sync"
+                             " -Wno-unused-variable"
+                             " -Wno-shadow-uncaptured-local"
+                             " -Wno-documentation"
+                             " -Wno-deprecated"
+                             " -Wno-unused-macros"
+                             " -Wno-vla"
+                             " -Wno-unreachable-code-break"
+                             " -Wno-implicit-fallthrough"
+                             " -Wno-conditional-uninitialized"
+                             " -Wno-exit-time-destructors"
+                             " -Wno-undefined-func-template"
+                             " -Wno-c++98-compat"
+                             " -Wno-shorten-64-to-32"
+                             " -Wno-c++98-compat-pedantic"
+                             " -Wno-used-but-marked-unused" # : boost unit tests. should be reinabled and sorted out.
+                             " -Wno-newline-eof" # : end of line newline. should be reinabled and so.
+                             " -Wno-return-std-move-in-c++11" # :
+                             )
+                     string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+                 endif ()
              endif ()
          endif ()
          set(CMAKE_CXX_FLAGS_DEBUG "-g")


Typo: MSVC

Typo: MSVC

--- common/cmake/CommonHeader.cmake
+++ common/cmake/CommonHeader.cmake
@@ -30,7 +30,7 @@
 set (CMAKE_SKIP_INSTALL_RULES TRUE)

 include (CheckCXXCompilerFlag)
-if (MVSC)
+if (MSVC)
 	foreach (i IN ITEMS /W4 /W44640)
 		message (STATUS "Checking compiler support for ${i}")
 		check_cxx_compiler_flag (${i} SUPPORTS_i)
@@ -53,6 +53,7 @@
 		else ()
 			message (STATUS "Checking compiler support for ${i} - Failed")
 		endif ()
+		unset (SUPPORTS_i)
 	endforeach ()
 endif ()

@@ -63,8 +64,8 @@
 	list (APPEND CMAKE_FORTRAN_FLAGS ${OpenMP_Fortran_FLAGS})
 endif (OPENMP_FOUND)

-if (MVSC)
+if (MSVC)
 	# So that Visual Studio will define M_PI
 	add_definitions (-D_USE_MATH_DEFINES)
-endif (MVSC)
+endif (MSVC)


ManageFile: Fix on absolute file handling

--- Modules/ManageFile.cmake
+++ Modules/ManageFile.cmake
@@ -72,30 +72,45 @@
        	"LIB" "LIBEXEC"
 	)

-    MACRO(_MANAGE_FILE_INSTALL_FILE_OR_DIR)
+    MACRO(_MANAGE_FILE_SET_FILE_INSTALL_LIST fileType)
+	SET(FILE_INSTALL_${fileType}_LIST "${FILE_INSTALL_${fileType}_LIST}"
+	    CACHE INTERNAL "List of files install as ${fileType}" FORCE
+	    )
+    ENDMACRO(_MANAGE_FILE_SET_FILE_INSTALL_LIST fileType)
+
+    FOREACH(_fLT ${FILE_INSTALL_LIST_TYPES})
+	SET(FILE_INSTALL_${_fLT}_LIST "")
+	_MANAGE_FILE_SET_FILE_INSTALL_LIST(${_fLT})
+    ENDFOREACH(_fLT ${FILE_INSTALL_LIST_TYPES})
+
+
+    MACRO(_MANAGE_FILE_INSTALL_FILE_OR_DIR fileType)
 	FOREACH(_f ${_fileList})
 	    GET_FILENAME_COMPONENT(_a "${_f}" ABSOLUTE)
 	    SET(_absolute "")
 	    STRING(REGEX MATCH "^/" _absolute "${_f}")
-	    MESSAGE("# _f=${_f} _a=${_a} _destDir=${_destDir}")
 	    IF(IS_DIRECTORY "${_a}")
 		INSTALL(DIRECTORY ${_f} DESTINATION "${_destDir}" ${ARGN})
+		IF(_absolute)
+		    GET_FILENAME_COMPONENT(_f "${_f}" NAME)
+		ENDIF(_absolute)
 	    ELSE(IS_DIRECTORY "${_a}")
 		INSTALL(FILES ${_f} DESTINATION "${_destDir}" ${ARGN})
 		IF(_absolute)
-		    GET_FILENAME_COMPONENT(_bF "${_f}" NAME)
-		    LIST(APPEND FILE_INSTALL_${fileType}_LIST
-			"${_destDir}/${_bF}")
-		ELSE(_absolute)
-		    LIST(APPEND FILE_INSTALL_${fileType}_LIST
-			"${_destDir}/${_f}")
+		    GET_FILENAME_COMPONENT(_f "${_f}" NAME)
 		ENDIF(_absolute)
 	    ENDIF(IS_DIRECTORY "${_a}")
+	    IF(_opt_DEST_SUBDIR)
+		LIST(APPEND FILE_INSTALL_${fileType}_LIST
+		    "${_opt_DEST_SUBDIR}/${_f}")
+	    ELSE(_opt_DEST_SUBDIR)
+		LIST(APPEND FILE_INSTALL_${fileType}_LIST
+		    "${_f}")
+	    ENDIF(_opt_DEST_SUBDIR)
 	ENDFOREACH(_f ${_fileList})
-	SET(FILE_INSTALL_${fileType}_LIST "${FILE_INSTALL_${fileType}_LIST}"
-	    CACHE INTERNAL "List of files install as ${fileType}"
-	    )
-    ENDMACRO(_MANAGE_FILE_INSTALL_FILE_OR_DIR)
+	_MANAGE_FILE_SET_FILE_INSTALL_LIST("${fileType}")
+
+    ENDMACRO(_MANAGE_FILE_INSTALL_FILE_OR_DIR fileType)

     MACRO(_MANAGE_FILE_INSTALL_TARGET)
 	SET(_installValidOptions "RUNTIME" "LIBEXEC" "LIBRARY" "ARCHIVE")
@@ -107,15 +122,11 @@
 		LIST(APPEND _installOptions RUNTIME)
 		IF(_oT_RUNTIME)
 		    LIST(APPEND FILE_INSTALL_BIN_LIST ${_f})
-		    SET(FILE_INSTALL_BIN_LIST "${FILE_INSTALL_BIN_LIST}"
-			CACHE INTERNAL "List of files install as BIN"
-			)
+		    _MANAGE_FILE_SET_FILE_INSTALL_LIST("BIN")
 		    LIST(APPEND _installOptions "${_oT_RUNTIME}")
 		ELSEIF(_oT_LIBEXEC)
 		    LIST(APPEND FILE_INSTALL_LIBEXEC_LIST ${_f})
-		    SET(FILE_INSTALL_LIBEXEC_LIST "${FILE_INSTALL_LIBEXEC_LIST}"
-		    	CACHE INTERNAL "List of files install as LIBEXEC"
-		    	)
+		    _MANAGE_FILE_SET_FILE_INSTALL_LIST("LIBEXEC")
 		    LIST(APPEND _installOptions "${_oT_LIBEXEC}")
 		ELSE(_oT_RUNTIME)
 		    M_MSG(${M_ERROR}
@@ -123,9 +134,7 @@
 		ENDIF(_oT_RUNTIME)
 	    ELSEIF(_tP STREQUAL "SHARED_LIBRARY")
 		LIST(APPEND FILE_INSTALL_LIB_LIST ${_f})
-		SET(FILE_INSTALL_LIB_LIST "${FILE_INSTALL_LIB_LIST}"
-		    CACHE INTERNAL "List of files install as LIB"
-		    )
+		_MANAGE_FILE_SET_FILE_INSTALL_LIST("LIB")
 		LIST(APPEND _installOptions "LIBRARY" "${_oT_LIBRARY}")
 	    ELSEIF(_tP STREQUAL "STATIC_LIBRARY")
 		M_MSG(${M_OFF}
@@ -147,32 +156,19 @@

 	IF("${fileType}" STREQUAL "SYSCONF_NO_REPLACE")
 	    SET(_destDir "${SYSCONF_DIR}/${_opt_DEST_SUBDIR}")
-	    _MANAGE_FILE_INSTALL_FILE_OR_DIR()
+	    _MANAGE_FILE_INSTALL_FILE_OR_DIR("${fileType}")
 	ELSEIF("${fileType}" STREQUAL "BIN")
 	    SET(_destDir "${${fileType}_DIR}/${_opt_DEST_SUBDIR}")
 	    INSTALL(PROGRAMS ${_fileList} DESTINATION "${_destDir}" ${_opt_ARGS})
+	    LIST(APPEND FILE_INSTALL_${fileType}_LIST
+		"${_fileList}")
+	    _MANAGE_FILE_SET_FILE_INSTALL_LIST("${fileType}")
 	ELSEIF("${fileType}" STREQUAL "TARGETS")
 	    _MANAGE_FILE_INSTALL_TARGET(${_opt_ARGS})
 	ELSE("${fileType}" STREQUAL "SYSCONF_NO_REPLACE")
 	    SET(_destDir "${${fileType}_DIR}/${_opt_DEST_SUBDIR}")
-	    _MANAGE_FILE_INSTALL_FILE_OR_DIR()
+	    _MANAGE_FILE_INSTALL_FILE_OR_DIR("${fileType}")
 	ENDIF("${fileType}" STREQUAL "SYSCONF_NO_REPLACE")
-
-	IF(_opt_DEST_SUBDIR)
-	    FOREACH(_f ${_fileList})
-		LIST(APPEND FILE_INSTALL_${fileType}_LIST
-		    "${_opt_DEST_SUBDIR}/${_f}")
-	    ENDFOREACH(_f ${_fileList})
-	ELSE(_opt_DEST_SUBDIR)
-	    LIST(APPEND FILE_INSTALL_${fileType}_LIST
-		"${_fileList}")
-	ENDIF(_opt_DEST_SUBDIR)
-	MESSAGE("#2 FILE_INSTALL_${fileType}_LIST=${FILE_INSTALL_${fileType}_LIST}")
-	SET(FILE_INSTALL_${fileType}_LIST
-	    ${FILE_INSTALL_${fileType}_LIST}
-	    CACHE STRING "File install type ${_fLT}" FORCE
-	    )
-	MESSAGE("#3 FILE_INSTALL_${fileType}_LIST=${FILE_INSTALL_${fileType}_LIST}")
     ENDMACRO(MANAGE_FILE_INSTALL fileType)

     FUNCTION(FIND_FILE_ERROR_HANDLING VAR)


extend static flags to CXX

extend static flags to CXX

--- modules/static_linking.cmake
+++ modules/static_linking.cmake
@@ -18,13 +18,13 @@
 if(ENABLE_STATIC_LINKING)
     if(DEFINED CMAKE_Fortran_COMPILER_ID)
         if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
-            set(CMAKE_Fortran_FLAGS "-static ${CMAKE_Fortran_FLAGS}")
+            set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static")
         endif()
         if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
-            set(CMAKE_Fortran_FLAGS "-static -static-libgcc -static-intel ${CMAKE_Fortran_FLAGS}")
+            set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static -static-libgcc -static-intel")
         endif()
         if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
-            set(CMAKE_Fortran_FLAGS "-Bstatic ${CMAKE_Fortran_FLAGS}")
+            set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Bstatic")
         endif()
     endif()

@@ -32,8 +32,11 @@
         if(CMAKE_C_COMPILER_ID MATCHES GNU)
             set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -fpic")
         endif()
-        if(CMAKE_C_COMPILER_ID MATCHES Clang)
-            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Bstatic -fpic")
+    endif()
+
+    if(DEFINED CMAKE_CXX_COMPILER_ID)
+        if(CMAKE_C_COMPILER_ID MATCHES GNU)
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -fpic")
         endif()
     endif()
 endif()


update basholeveldb for snappy fix

update basholeveldb for snappy fix

--- basholeveldb.cmake
+++ basholeveldb.cmake
@@ -13,7 +13,7 @@
 external_source (basholeveldb
     2.0.20
     basholeveldb-2.0.20.tar.gz
-    c111f08e9fc1f474f93a4ecea56cf892)
+    159af0ac581dc7dfa2cf53882096ac01)

 message ("Installing ${basholeveldb_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
 if (${APPLE})


Fixed scoping of flag variables

Fixed scoping of flag variables

--- build/macros.cmake
+++ build/macros.cmake
@@ -194,7 +194,7 @@

 macro(enable_fast_floating_point _enable)
 	get_compiler_name(COMPILER)
-	if(_enable)
+	if(${_enable})
 		if(COMPILER MATCHES "vc")
 			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast")
 		elseif(COMPILER MATCHES "gcc")
@@ -212,7 +212,7 @@
 macro(disable_language_extensions _disable)
 	get_compiler_name(COMPILER)
 	if(COMPILER MATCHES "vc")
-		if(_disable)
+		if(${_disable})
 			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Za")
 			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Za")
 		else()


Also set the *__TRYRUN_OUTPUT cache value to something (#37797)

CMake 3.14 fails in a cross-compilation ARM build and complains
that both both *_EXITCODE and *_EXITCODE__TRYRUN_OUTPUT have
to be set. Doing this re-enables the build.

--- cross/tryrun.cmake
+++ cross/tryrun.cmake
@@ -2,6 +2,7 @@

 macro(set_cache_value)
   set(${ARGV0} ${ARGV1} CACHE STRING "Result from TRY_RUN" FORCE)
+  set(${ARGV0}__TRYRUN_OUTPUT "dummy output" CACHE STRING "Output from TRY_RUN" FORCE)
 endmacro()

 if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf OR


[FIX] Build System: fixed linux package names

--- util/cmake/SetCPackSystemName.cmake
+++ util/cmake/SetCPackSystemName.cmake
@@ -45,7 +45,7 @@

 if (${CPACK_SYSTEM_NAME} MATCHES Windows)
   set(CPACK_SYSTEM_NAME Windows-${CMAKE_SYSTEM_PROCESSOR})
-else (${CPACK_SYSTEM_NAME} MATCHES Darwin)
+elseif (${CPACK_SYSTEM_NAME} MATCHES Darwin)
   set(CPACK_SYSTEM_NAME Mac-${CMAKE_SYSTEM_PROCESSOR})
 endif (${CPACK_SYSTEM_NAME} MATCHES Windows)


Add support for debug and release mode.

Add support for debug and release mode.

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

--- build-aux/cmake/modules/FindQScintilla2.cmake
+++ build-aux/cmake/modules/FindQScintilla2.cmake
@@ -17,46 +17,65 @@
 # This module set two variables:
 #
 #   QSCINTILLA2_LIBRARY: the path to the libraries found.
+#   QSCINTILLA2_LIBRARY_RELEASE: the path to the release libraries found.
+#   QSCINTILLA2_LIBRARY_DEBUG: the path to the debug libraries found.
 #   QSCINTILLA2_INCLUDE_DIR: the include path.
 #
 # These variables are set to <var-name>-NOTFOUND if an error occurs.

-set(QSCINTILLA2_FOUND FALSE)
+if(NOT QSCINTILLA2_LIBRARY)

-# Search for the library.
-if(NOT QSCINTILLA2_LIBRARY)
-  find_library(QSCINTILLA2_LIBRARY
-    NAMES qscintilla2
-    PATHS ${QT_LIBRARY_DIR})
-  if(QSCINTILLA2_LIBRARY)
-    message(STATUS "Found qscintilla2 library: ${QSCINTILLA2_LIBRARY}")
-    set(QSCINTILLA2_FOUND TRUE)
-  else(QSCINTILLA2_LIBRARY)
-    message(SEND_ERROR "no qscintilla2 library found "
+  # Release
+  if(NOT QSCINTILLA2_LIBRARY_RELEASE)
+    find_library(QSCINTILLA2_LIBRARY_RELEASE
+      NAMES qscintilla2
+      PATHS ${QT_LIBRARY_DIR})
+    if(QSCINTILLA2_LIBRARY_RELEASE)
+      message(STATUS "Found qscintilla2 release library: ${QSCINTILLA2_LIBRARY_RELEASE}")
+    endif(QSCINTILLA2_LIBRARY_RELEASE)
+  endif(NOT QSCINTILLA2_LIBRARY_RELEASE)
+  # Debug
+  if(NOT QSCINTILLA2_LIBRARY_DEBUG)
+    find_library(QSCINTILLA2_LIBRARY_DEBUG
+      NAMES qscintilla2d
+      PATHS ${QT_LIBRARY_DIR})
+    if(QSCINTILLA2_LIBRARY_DEBUG)
+      message(STATUS "Found qscintilla2 debug library: ${QSCINTILLA2_LIBRARY_DEBUG}")
+    endif(QSCINTILLA2_LIBRARY_DEBUG)
+  endif(NOT QSCINTILLA2_LIBRARY_DEBUG)
+
+  if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+    if(QSCINTILLA2_LIBRARY_RELEASE OR QSCINTILLA2_LIBRARY_DEBUG)
+      set(QSCINTILLA2_LIBRARY
+	optimized
+	${QSCINTILLA2_LIBRARY_RELEASE}
+	debug
+	${QSCINTILLA2_LIBRARY_DEBUG}
+	)
+    endif(QSCINTILLA2_LIBRARY_RELEASE OR QSCINTILLA2_LIBRARY_DEBUG)
+  else(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+    set(QSCINTILLA2_LIBRARY ${QSCINTILLA2_LIBRARY_RELEASE})
+  endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+
+endif(NOT QSCINTILLA2_LIBRARY)
+
+# Search for the include directory.
+if(NOT QSCINTILLA2_INCLUDE_DIR)
+  find_path(QSCINTILLA2_INCLUDE_DIR
+    NAMES Qsci/qsciapis.h
+    PATHS ${QT_INCLUDE_DIR})
+  if(QSCINTILLA2_INCLUDE_DIR)
+    message(STATUS "Found qscintilla2 headers directory: "
+      "${QSCINTILLA2_INCLUDE_DIR}")
+  else(QSCINTILLA2_INCLUDE_DIR)
+    message(SEND_ERROR "no qscintilla2 headers found "
       "(setting -DQSCINTILLA2_ROOT_DIR=/path/to/qscintilla2 may solve this "
       "problem).")
-  endif(QSCINTILLA2_LIBRARY)
-endif(NOT QSCINTILLA2_LIBRARY)
+    set(QSCINTILLA2_FOUND FALSE)
+  endif(QSCINTILLA2_INCLUDE_DIR)
+endif(NOT QSCINTILLA2_INCLUDE_DIR)

-if(QSCINTILLA2_FOUND)
-  # Search for the include directory.
-  if(NOT QSCINTILLA2_INCLUDE_DIR)
-    find_path(QSCINTILLA2_INCLUDE_DIR
-      NAMES Qsci/qsciapis.h
-      PATHS ${QT_INCLUDE_DIR})
-    if(QSCINTILLA2_INCLUDE_DIR)
-      message(STATUS "Found qscintilla2 headers directory: "
-	"${QSCINTILLA2_INCLUDE_DIR}")
-    else(QSCINTILLA2_INCLUDE_DIR)
-      message(SEND_ERROR "no qscintilla2 headers found "
-	"(setting -DQSCINTILLA2_ROOT_DIR=/path/to/qscintilla2 may solve this "
-	"problem).")
-      set(QSCINTILLA2_FOUND FALSE)
-    endif(QSCINTILLA2_INCLUDE_DIR)
-  endif(NOT QSCINTILLA2_INCLUDE_DIR)
-endif(QSCINTILLA2_FOUND)
-
-if(QSCINTILLA2_FOUND AND QSCINTILLA2_INCLUDE_DIR)
+if(NOT QSCINTILLA2_SCINTILLA_INCLUDE_DIR)
   # Check whether scintilla header are installed (needed because we write our
   # own lexer).
   find_path(QSCINTILLA2_SCINTILLA_INCLUDE_DIR
@@ -65,9 +84,8 @@
   if(QSCINTILLA2_SCINTILLA_INCLUDE_DIR)
     message(STATUS "Found scintilla header directory: "
       "${QSCINTILLA2_SCINTILLA_INCLUDE_DIR}")
-  else()
+  else(QSCINTILLA2_SCINTILLA_INCLUDE_DIR)
     message(SEND_ERROR "no scintilla headers found "
       "(check that your apply our patch before to install QScintilla).")
-    set(QSCINTILLA2_FOUND FALSE)
-  endif()
-endif()
+  endif(QSCINTILLA2_SCINTILLA_INCLUDE_DIR)
+endif(NOT QSCINTILLA2_SCINTILLA_INCLUDE_DIR)


Check scintilla headers.

Check scintilla headers.

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

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

--- build-aux/cmake/modules/FindQScintilla2.cmake
+++ build-aux/cmake/modules/FindQScintilla2.cmake
@@ -56,3 +56,18 @@
   endif(NOT QSCINTILLA2_INCLUDE_DIR)
 endif(QSCINTILLA2_FOUND)

+if(QSCINTILLA2_FOUND AND QSCINTILLA2_INCLUDE_DIR)
+  # Check whether scintilla header are installed (needed because we write our
+  # own lexer).
+  find_path(QSCINTILLA2_SCINTILLA_INCLUDE_DIR
+    NAMES Qsci/scintilla/include/Scintilla.h
+    PATHS ${QSCINTILLA2_INCLUDE_DIR})
+  if(QSCINTILLA2_SCINTILLA_INCLUDE_DIR)
+    message(STATUS "Found scintilla header directory: "
+      "${QSCINTILLA2_SCINTILLA_INCLUDE_DIR}")
+  else()
+    message(FATAL_ERROR "no scintilla headers found "
+      "(check that your apply our patch before to install QScintilla).")
+    set(QSCINTILLA2_FOUND FALSE)
+  endif()
+endif()


Selection of the C++ Standard improved.

Selection of the C++ Standard improved.

--- cmake/CppStd.cmake
+++ cmake/CppStd.cmake
@@ -1,21 +1,3 @@
-set(CPP_STD 14)
-set(CPP_STD_PRE 1y)
-
-if( NOT CMAKE_CROSSCOMPILING )
-    include(CheckCXXCompilerFlag)
-
-    CHECK_CXX_COMPILER_FLAG("-std=c++${CPP_STD}" CPP_STD_SUPPORTED)
-    CHECK_CXX_COMPILER_FLAG("-std=c++${CPP_STD_PRE}" CPP_STD_PRE_SUPPORTED)
-
-    if( CPP_STD_SUPPORTED )
-        add_cxx_flag(-std=c++${CPP_STD})
-    elseif( CPP_STD_PRE_SUPPORTED )
-        add_cxx_flag(-std=c++${CPP_STD_PRE})
-    else()
-        message(WARNING "C++${CPP_STD} not supported by ${CMAKE_CXX_COMPILER}")
-    endif()
-
-else()
-    add_cxx_flag(-std=c++${CPP_STD})
-endif()
-
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -15,16 +15,16 @@
     IF(WIN32)
         IF(   NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC"
            OR NOT ${MSVC_VERSION} EQUAL 1800)
-            MESSAGE(FATAL_ERROR "OpenCOR can only be built using MSVC 2013 on Windows...")
+            MESSAGE(FATAL_ERROR "${PROJECT_NAME} can only be built using MSVC 2013 on Windows...")
         ENDIF()
     ELSEIF(APPLE)
         IF(    NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
            AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
-            MESSAGE(FATAL_ERROR "OpenCOR can only be built using (Apple) Clang on OS X...")
+            MESSAGE(FATAL_ERROR "${PROJECT_NAME} can only be built using (Apple) Clang on OS X...")
         ENDIF()
     ELSE()
         IF(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-            MESSAGE(FATAL_ERROR "OpenCOR can only be built using GCC on Linux...")
+            MESSAGE(FATAL_ERROR "${PROJECT_NAME} can only be built using GCC on Linux...")
         ENDIF()
     ENDIF()

@@ -38,15 +38,15 @@
             RUN_OUTPUT_VARIABLE ARCHITECTURE)

     IF(NOT ARCHITECTURE_COMPILE)
-        MESSAGE(FATAL_ERROR "We could not determine your architecture. Please clean your OpenCOR environment and try again...")
+        MESSAGE(FATAL_ERROR "We could not determine your architecture. Please clean your ${PROJECT_NAME} environment and try again...")
     ELSE()
         IF(APPLE)
             IF(NOT ${ARCHITECTURE} EQUAL 64)
-                MESSAGE(FATAL_ERROR "OpenCOR can only be built in 64-bit mode...")
+                MESSAGE(FATAL_ERROR "${PROJECT_NAME} can only be built in 64-bit mode...")
             ENDIF()
         ELSE()
             IF(NOT ${ARCHITECTURE} EQUAL 32 AND NOT ${ARCHITECTURE} EQUAL 64)
-                MESSAGE(FATAL_ERROR "OpenCOR can only be built in 32-bit or 64-bit mode...")
+                MESSAGE(FATAL_ERROR "${PROJECT_NAME} can only be built in 32-bit or 64-bit mode...")
             ENDIF()
         ENDIF()
     ENDIF()
@@ -56,13 +56,13 @@

     IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
         IF(SHOW_INFORMATION_MESSAGE)
-            MESSAGE("Building a ${ARCHITECTURE}-bit debug version...")
+            SET(BUILD_INFORMATION "Building a ${ARCHITECTURE}-bit debug version of ${PROJECT_NAME}")
         ENDIF()

         SET(RELEASE_MODE FALSE)
     ELSE()
         IF(SHOW_INFORMATION_MESSAGE)
-            MESSAGE("Building a ${ARCHITECTURE}-bit release version...")
+            SET(BUILD_INFORMATION "Building a ${ARCHITECTURE}-bit release version of ${PROJECT_NAME}")
         ENDIF()

         SET(RELEASE_MODE TRUE)
@@ -95,6 +95,7 @@
     SET(QT_BINARY_DIR ${_qt5Widgets_install_prefix}/bin)
     SET(QT_LIBRARY_DIR ${_qt5Widgets_install_prefix}/lib)
     SET(QT_PLUGINS_DIR ${_qt5Widgets_install_prefix}/plugins)
+    SET(QT_VERSION ${Qt5Widgets_VERSION})
     SET(QT_VERSION_MAJOR ${Qt5Widgets_VERSION_MAJOR})
     SET(QT_VERSION_MINOR ${Qt5Widgets_VERSION_MINOR})
     SET(QT_VERSION_PATCH ${Qt5Widgets_VERSION_PATCH})
@@ -274,7 +275,7 @@
         ENDIF()

         IF(SHOW_INFORMATION_MESSAGE)
-            MESSAGE("Building for ${CMAKE_OSX_DEPLOYMENT_TARGET} and later...")
+            SET(BUILD_INFORMATION "${BUILD_INFORMATION} for (Mac) OS X ${CMAKE_OSX_DEPLOYMENT_TARGET} and later")
         ENDIF()
     ENDIF()

@@ -323,6 +324,12 @@
         SET(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks;@executable_path/../PlugIns/${PROJECT_NAME}")
     ELSEIF(NOT WIN32)
         SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../plugins/${PROJECT_NAME}")
+    ENDIF()
+
+    # Show the build information, if allowed
+
+    IF(SHOW_INFORMATION_MESSAGE)
+        MESSAGE("${BUILD_INFORMATION} using Qt ${QT_VERSION}...")
     ENDIF()
 ENDMACRO()


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -258,7 +258,6 @@
     ENDIF()

     # Set the RPATH information on Linux
-    # Note: this prevent us from having to use the uncool LD_LIBRARY_PATH...

     IF(NOT WIN32 AND NOT APPLE)
         SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../plugins/${PROJECT_NAME}")


Add -march=skylake-avx512 to CFLAGS when the target is Skylake

Should fix 1806 and #1801

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -40,6 +40,11 @@
     set(TARGET "BARCELONA")
   endif ()
 endif ()
+
+if (DEFINED TARGET AND ${TARGET} STREQUAL "SKYLAKEX" AND NOT NO_AVX512)
+  set (CCOMMON_OPT "${CCOMMON_OPT} -march=skylake-avx512")
+  set (FCOMMON_OPT "${FCOMMON_OPT} -march=skylake-avx512")
+endif()

 if (DEFINED TARGET)
   message(STATUS "Targeting the ${TARGET} architecture.")


Updated support for XCode 7.2

Updated support for XCode 7.2

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -51,6 +51,11 @@

   if (IOS)
     set_xcode_property(${target} IPHONEOS_DEPLOYMENT_TARGET "8.4")
+    #set_xcode_property(${target} ARCHS "armv7 arm64")
+    set_xcode_property(${target} VALID_ARCHS "armv7 armv7s arm64")
+    set_xcode_property(${target} SUPPORTED_PLATFORMS "iphonesimulator iphoneos")
+    set_xcode_property(${target} ONLY_ACTIVE_ARCH "NO")
+
   else ()
     set_target_properties(${target} PROPERTIES DEFINE_SYMBOL "EXPORTING_DLL")
   endif (IOS)


Disable dll-export warnings on MSVC

Disable dll-export warnings on MSVC

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -65,6 +65,8 @@

     # Disable other warnings
     remove_msvc_warning(4061) # enumerator in switch of enum is not explicitly handled by a case label
+    remove_msvc_warning(4275) # non-dll-export interface as base class of dll-export class
+    remove_msvc_warning(4251) # class <> needs to be dll-export
     remove_msvc_warning(4514) # unreferenced inline function has been removed
     remove_msvc_warning(4582) # constructor is not implicitly called
     remove_msvc_warning(4583) # destructor is not implicitly called


Bump external library versions

Bump external library versions

--- cmake/ExternalTools.cmake
+++ cmake/ExternalTools.cmake
@@ -5,18 +5,18 @@
 # CPM Packages
 ###############

-CPMAddPackage("gh:gabime/spdlog@1.9.2")
+CPMAddPackage("gh:gabime/spdlog@1.10.0")
 CPMAddPackage("gh:ericniebler/range-v3#d800a032132512a54c291ce55a2a43e0460591c7")
 CPMAddPackage("gh:docopt/docopt.cpp#v0.6.3")
-CPMAddPackage("gh:onqtam/doctest#2.4.6")
-CPMAddPackage("gh:mateidavid/zstr#v1.0.5")
-CPMAddPackage("gh:pybind/pybind11#v2.9.1")
+CPMAddPackage("gh:onqtam/doctest#v2.4.8")
+CPMAddPackage("gh:mateidavid/zstr#v1.0.6")
+CPMAddPackage("gh:pybind/pybind11#v2.9.2")
 CPMAddPackage("gh:imneme/pcg-cpp#ffd522e7188bef30a00c74dc7eb9de5faff90092")
 CPMAddPackage("gh:ArashPartow/exprtk#93a9f44f99b910bfe07cd1e933371e83cea3841c")

 CPMAddPackage(
     NAME mpl GITHUB_REPOSITORY rabauke/mpl DOWNLOAD_ONLY YES
-    GIT_TAG afb2fd7525ecd43e5a52d5624f3a4998a4eac52c
+    GIT_TAG ff9512fc61195b6c7e643e234789b0b937d28ee3
 )

 CPMAddPackage(


Remove gengetopt warnings for MSVC

Remove gengetopt warnings for MSVC

--- cmake/FindGengetopt.cmake
+++ cmake/FindGengetopt.cmake
@@ -72,5 +72,8 @@
     IF("${GCCVER}" VERSION_GREATER "4.5.2")
       SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable")
     ENDIF("${GCCVER}" VERSION_GREATER "4.5.2")
+    IF(MSVC)
+      SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES COMPILE_FLAGS "/w")
+    ENDIF(MSVC)
   ENDIF(CMAKE_COMPILER_IS_GNUCXX)
 ENDMACRO (WRAP_GGO)


Avoid using cmake -E copy for multiple files.

--- cmake/OpenSimMacros.cmake
+++ cmake/OpenSimMacros.cmake
@@ -358,13 +358,12 @@
         foreach(DLL IN LISTS DLLS)
             get_filename_component(DLL_NAME ${DLL} NAME)
             list(APPEND DLLS_DEST "${DEST_DIR}/${DLL_NAME}")
-            set(DLL_NAMES "${DLL_NAMES} ${DLL_NAME}")
+            add_custom_command(OUTPUT "${DEST_DIR}/${DLL_NAME}"
+                COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
+                COMMAND ${CMAKE_COMMAND} -E copy ${DLL} ${DEST_DIR}
+                DEPENDS ${DLL}
+                COMMENT "Copying DLL from ${DEP_INSTALL_DIR}/${DLL_NAME} to ${DEST_DIR}.")
         endforeach()
-        add_custom_command(OUTPUT ${DLLS_DEST}
-            COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
-            COMMAND ${CMAKE_COMMAND} -E copy ${DLLS} ${DEST_DIR}
-            DEPENDS ${DLLS}
-            COMMENT "Copying DLLs from ${DEP_INSTALL_DIR} to ${DEST_DIR}:${DLL_NAMES}")
         add_custom_target(Copy_${DEP_NAME}_DLLs ALL DEPENDS ${DLLS_DEST})
         set_target_properties(Copy_${DEP_NAME}_DLLs PROPERTIES
             PROJECT_LABEL "Copy ${DEP_NAME} DLLs")


add pybind.h to inference lib for static link

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -148,4 +148,10 @@
   DSTS ${dst_dir}/${module} ${dst_dir}/${module}/tinyformat
 )

+set(module "pybind")
+copy(pybind_lib
+  SRCS ${src_dir}/${module}/pybind.h
+  DSTS ${dst_dir}/${module}
+)
+
 add_custom_target(inference_lib_dist DEPENDS ${inference_lib_dist_dep})


Avoid newline in date output.

Avoid newline in date output.

--- cmake/mysql_version.cmake
+++ cmake/mysql_version.cmake
@@ -123,7 +123,7 @@
 #  EXECUTE_PROCESS(COMMAND "date" "/T" OUTPUT_VARIABLE TMP_DATE)
 #  STRING(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" MYSQL_COPYRIGHT_YEAR ${TMP_DATE})
 IF(UNIX)
-  EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE MYSQL_COPYRIGHT_YEAR)
+  EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE MYSQL_COPYRIGHT_YEAR OUTPUT_STRIP_TRAILING_WHITESPACE)
 ENDIF()

 # Add version information to the exe and dll files


build: Disable stream processor when bison/flex not found

Signed-off-by: Hiroshi Hatake <a476a6e5b5893650242fbf0b2961500a9bd9032e@clear-code.com>

--- cmake/windows-setup.cmake
+++ cmake/windows-setup.cmake
@@ -73,3 +73,14 @@
 set(FLB_FILTER_NEST            No)
 set(FLB_FILTER_LUA            Yes)
 set(FLB_FILTER_RECORD_MODIFIER Yes)
+
+# Search bison and flex executables
+if(CMAKE_SYSTEM_NAME MATCHES "Windows")
+  find_package(FLEX)
+  find_package(BISON)
+
+  if (NOT (${FLEX_FOUND} AND ${BISON_FOUND}))
+    message(STATUS "flex and bison not found. Disable stream_processor building.")
+    set(FLB_STREAM_PROCESSOR No)
+  endif()
+endif()


build: removed warning to allow sdl to compile

--- data/cmake/CompilerWarnings.cmake
+++ data/cmake/CompilerWarnings.cmake
@@ -3,87 +3,72 @@
 # https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Available.md

 function(set_project_warnings project_name)
-  option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE)
+    option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE)

-  set(MSVC_WARNINGS
-      /W4 # Baseline reasonable warnings
-      /w14242 # 'identfier': conversion from 'type1' to 'type1', possible loss
-              # of data
-      /w14254 # 'operator': conversion from 'type1:field_bits' to
-              # 'type2:field_bits', possible loss of data
-      /w14263 # 'function': member function does not override any base class
-              # virtual member function
-      /w14265 # 'classname': class has virtual functions, but destructor is not
-              # virtual instances of this class may not be destructed correctly
-      /w14287 # 'operator': unsigned/negative constant mismatch
-      /we4289 # nonstandard extension used: 'variable': loop control variable
-              # declared in the for-loop is used outside the for-loop scope
-      /w14296 # 'operator': expression is always 'boolean_value'
-      /w14311 # 'variable': pointer truncation from 'type1' to 'type2'
-      /w14545 # expression before comma evaluates to a function which is missing
-              # an argument list
-      /w14546 # function call before comma missing argument list
-      /w14547 # 'operator': operator before comma has no effect; expected
-              # operator with side-effect
-      /w14549 # 'operator': operator before comma has no effect; did you intend
-              # 'operator'?
-      /w14555 # expression has no effect; expected expression with side- effect
-      /w14619 # pragma warning: there is no warning number 'number'
-      /w14640 # Enable warning on thread un-safe static member initialization
-      /w14826 # Conversion from 'type1' to 'type_2' is sign-extended. This may
-              # cause unexpected runtime behavior.
-      /w14905 # wide string literal cast to 'LPSTR'
-      /w14906 # string literal cast to 'LPWSTR'
-      /w14928 # illegal copy-initialization; more than one user-defined
-              # conversion has been implicitly applied
-  )
+    set(MSVC_WARNINGS
+        /W4 # Baseline reasonable warnings
+        /w14242 # 'identfier': conversion from 'type1' to 'type1', possible loss of data
+        /w14254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
+        /w14263 # 'function': member function does not override any base class virtual member function
+        /w14265 # 'classname': class has virtual functions, but destructor is not virtual instances of this class may not be destructed correctly
+        /w14287 # 'operator': unsigned/negative constant mismatch
+        /we4289 # nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside the for-loop scope
+        /w14296 # 'operator': expression is always 'boolean_value'
+        /w14311 # 'variable': pointer truncation from 'type1' to 'type2'
+        /w14545 # expression before comma evaluates to a function which is missing an argument list
+        /w14546 # function call before comma missing argument list
+        /w14547 # 'operator': operator before comma has no effect; expected operator with side-effect
+        /w14549 # 'operator': operator before comma has no effect; did you intend 'operator'?
+        /w14555 # expression has no effect; expected expression with side- effect
+        /w14619 # pragma warning: there is no warning number 'number'
+        /w14640 # Enable warning on thread un-safe static member initialization
+        /w14826 # Conversion from 'type1' to 'type_2' is sign-extended. This may cause unexpected runtime behavior.
+        /w14905 # wide string literal cast to 'LPSTR'
+        /w14906 # string literal cast to 'LPWSTR'
+        /w14928 # illegal copy-initialization; more than one user-defined conversion has been implicitly applied
+    )

-  set(CLANG_WARNINGS
-      -Wall
-      -Wextra # reasonable and standard
-      -Wshadow # warn the user if a variable declaration shadows one from a
-               # parent context
-      -Wnon-virtual-dtor # warn the user if a class with virtual functions has a
-                         # non-virtual destructor. This helps catch hard to
-                         # track down memory errors
-      -Wold-style-cast # warn for c-style casts
-      -Wcast-align # warn for potential performance problem casts
-      -Wunused # warn on anything being unused
-      -Woverloaded-virtual # warn if you overload (not override) a virtual
-                           # function
-      -Wpedantic # warn if non-standard C++ is used
-      -Wconversion # warn on type conversions that may lose data
-      -Wsign-conversion # warn on sign conversions
-      -Wnull-dereference # warn if a null dereference is detected
-      -Wdouble-promotion # warn if float is implicit promoted to double
-      -Wformat=2 # warn on security issues around functions that format output
-                 # (ie printf)
-  )
+    set(CLANG_WARNINGS
+        -Wall
+        -Wextra # reasonable and standard
+        -Wshadow # warn the user if a variable declaration shadows one from a parent context
+        -Wnon-virtual-dtor # warn the user if a class with virtual functions has a non-virtual destructor. This helps catch hard to track down memory errors
+        # -Wold-style-cast # warn for c-style casts
+        -Wcast-align # warn for potential performance problem casts
+        -Wunused # warn on anything being unused
+        -Woverloaded-virtual # warn if you overload (not override) a virtual function
+        -Wpedantic # warn if non-standard C++ is used
+        # -Wconversion # ??? # warn on type conversions that may lose data
+        # -Wsign-conversion # ??? # warn on sign conversions
+        # -Wlifetime # ???
+        # -Wpedantic # ???
+        -Wno-error=deprecated # ???
+        -Wnull-dereference # warn if a null dereference is detected
+        # -Wdouble-promotion # warn if float is implicit promoted to double
+        -Wformat=2 # warn on security issues around functions that format output (ie printf)
+    )

-  if (WARNINGS_AS_ERRORS)
-    set(CLANG_WARNINGS ${CLANG_WARNINGS} -Werror)
-    set(MSVC_WARNINGS ${MSVC_WARNINGS} /WX)
-  endif()
+    if (WARNINGS_AS_ERRORS)
+        set(CLANG_WARNINGS ${CLANG_WARNINGS} -Werror)
+        set(MSVC_WARNINGS ${MSVC_WARNINGS} /WX)
+    endif()

-  set(GCC_WARNINGS
-      ${CLANG_WARNINGS}
-      -Wmisleading-indentation # warn if identation implies blocks where blocks
-                               # do not exist
-      -Wduplicated-cond # warn if if / else chain has duplicated conditions
-      -Wduplicated-branches # warn if if / else branches have duplicated code
-      -Wlogical-op # warn about logical operations being used where bitwise were
-                   # probably wanted
-      -Wuseless-cast # warn if you perform a cast to the same type
-  )
+    set(GCC_WARNINGS
+        ${CLANG_WARNINGS}
+        -Wmisleading-indentation # warn if identation implies blocks where blocks do not exist
+        -Wduplicated-cond # warn if if / else chain has duplicated conditions
+        -Wduplicated-branches # warn if if / else branches have duplicated code
+        -Wlogical-op # warn about logical operations being used where bitwise were probably wanted
+        -Wuseless-cast # warn if you perform a cast to the same type
+    )

-  if(MSVC)
-    set(PROJECT_WARNINGS ${MSVC_WARNINGS})
-  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-    set(PROJECT_WARNINGS ${CLANG_WARNINGS})
-  else()
-    set(PROJECT_WARNINGS ${GCC_WARNINGS})
-  endif()
+    if(MSVC)
+        set(PROJECT_WARNINGS ${MSVC_WARNINGS})
+    elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+        set(PROJECT_WARNINGS ${CLANG_WARNINGS})
+    else()
+        set(PROJECT_WARNINGS ${GCC_WARNINGS})
+    endif()

-  target_compile_options(${project_name} INTERFACE ${PROJECT_WARNINGS})
-
+    target_compile_options(${project_name} INTERFACE ${PROJECT_WARNINGS})
 endfunction()


Standardized FindJulia.cmake

Standardized FindJulia.cmake

--- modules/FindJulia.cmake
+++ modules/FindJulia.cmake
@@ -1,14 +1,30 @@
-if(NOT JULIA_FOUND)
-  find_program(JULIA_EXECUTABLE julia DOC "Julia executable")
-  if(NOT JULIA_EXECUTABLE)
-    message(FATAL_ERROR "Julia executable not found")
+if(NOT Julia_FOUND)
+  find_program(Julia_EXECUTABLE julia DOC "Julia executable")
+  if(Julia_EXECUTABLE)
+      execute_process(
+          COMMAND ${Julia_EXECUTABLE} -E "Pkg.dir()"
+          OUTPUT_VARIABLE Julia_INSTALL_DIR
+          RESULT_VARIABLE RESULT
+      )
+      if(RESULT EQUAL 0)
+          string(REGEX REPLACE "\"" "" Julia_INSTALL_DIR ${Julia_INSTALL_DIR})
+          set(Julia_INSTALL_DIR ${Julia_INSTALL_DIR}
+              CACHE PATH "Path where Julia packages should be installed.")
+      endif()
+      execute_process(
+          COMMAND ${Julia_EXECUTABLE} --version
+          OUTPUT_VARIABLE Julia_VERSION_STRING
+          RESULT_VARIABLE RESULT
+      )
+      if(RESULT EQUAL 0)
+        string(REGEX REPLACE ".*([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1"
+            Julia_VERSION_STRING ${Julia_VERSION_STRING})
+      endif()
   endif()
-  message(STATUS "[julia] ${JULIA_EXECUTABLE}")
-  exec_program( ${JULIA_EXECUTABLE} ARGS -e "\"println(Pkg.dir())\"" OUTPUT_VARIABLE JULIA_INSTALL)
-  message(STATUS "[julia] package directory: ${JULIA_INSTALL}")
-  if(NOT JULIA_INSTALL)
-    message(FATAL_ERROR "Could not determine julia package directory")
-  endif()
-  set(JULIA_INSTALL ${JULIA_INSTALL} CACHE PATH "Path where Julia packages should be installed.")
-  set(JULIA_FOUND TRUE CACHE INTERNAL "Whethe Julia was found")
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(Julia
+      REQUIRED_VARS Julia_EXECUTABLE Julia_INSTALL_DIR
+      VERSION_VAR Julia_VERSION_STRING
+  )
 endif()


Add support for CMake "required definitions" to modules and libraries.

--- Tools/CMake/basics.cmake
+++ Tools/CMake/basics.cmake
@@ -59,6 +59,32 @@
 # adds a definition
 macro(addDebugDef def)
     set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG "${def}")
+endmacro()
+
+# adds a required definition. Are processed on addExecutable or addStaticLib
+macro(addRequiredDefinition def)
+    #message(STATUS "${PROJECT_NAME} : add def : ${def}")
+    LIST( APPEND ${PROJECT_NAME}_required_definition ${def} )
+endmacro()
+# adds a required debug definition. Are processed on addExecutable or addStaticLib
+macro(addRequiredDebugDefinition def)
+    #message(STATUS "${PROJECT_NAME} : add def : ${def}")
+    LIST( APPEND ${PROJECT_NAME}_required_debug_definition ${def} )
+endmacro()
+
+# add definitions to project
+macro( _processProjectDefinition )
+   foreach( def ${${PROJECT_NAME}_required_definition} )
+       addDef( ${def} )
+   endforeach()
+
+   foreach( def ${${PROJECT_NAME}_required_debug_definition} )
+       addDef( ${def} )
+   endforeach()
+
+   #clear required defs
+   set( ${PROJECT_NAME}_required_definition )
+   set( ${PROJECT_NAME}_required_debug_definition )
 endmacro()

 # adds an include path
@@ -196,6 +222,7 @@

     _processProjectLinks()
     _processProjectLibrary()
+    _processProjectDefinition()
 endmacro()

 # macro to add an executable
@@ -214,6 +241,7 @@

     _processProjectLinks()
     _processProjectLibrary()
+    _processProjectDefinition()
 endmacro()

 macro(setupVersionNumbers)


Modified the library search path suffix for OS X.

--- FindTBB.cmake
+++ FindTBB.cmake
@@ -138,7 +138,7 @@
     # TODO: Check to see which C++ library is being used by the compiler.
     if(NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 13.0)
       # The default C++ library on OS X 10.9 and later is libc++
-      set(TBB_LIB_PATH_SUFFIX "lib/libc++")
+      set(TBB_LIB_PATH_SUFFIX "lib/libc++" "lib")
     else()
       set(TBB_LIB_PATH_SUFFIX "lib")
     endif()


increase it again

increase it again

--- VERSION.cmake
+++ VERSION.cmake
@@ -46,5 +46,5 @@

 SET(LIBSATSOLVER_MAJOR "0")
 SET(LIBSATSOLVER_MINOR "0")
-SET(LIBSATSOLVER_PATCH "23")
+SET(LIBSATSOLVER_PATCH "24")


Remove automatic generation of namespace file.

--- CPM.cmake
+++ CPM.cmake
@@ -73,8 +73,6 @@
 #
 #  CPM_DIR_OF_CPM               - Variable that stores the location of *this*
 #                                 file.
-#  CPM_USING_NS_HEADER_FILE     - Header file containing using directives for
-#                                 all automatically generated header files.
 #  CPM_KV_MOD_VERSION_MAP_*     - A key/value module version mapping.
 #                                 Key: Unique path (no version)
 #                                 Val: The most recently added module version.
@@ -208,25 +206,6 @@
   endif()
 endif()

-# If CPM_UNIQUE_ID exists then use that as the base directory for CPM.
-# Note that we are already in the parent's namespace (we are not in a
-# function), so we directly modify the appropriate GLOBAL variables.
-# This will wipe out any pre-existing include directories.
-if (DEFINED CPM_UNIQUE_ID)
-  set(CPM_AUTOGEN_INCLUDE_DIR "${CPM_DIR_OF_CPM}/include/${CPM_UNIQUE_ID}")
-  set(CPM_USING_NS_HEADER_FILE "${CPM_AUTOGEN_INCLUDE_DIR}/cpm/cpm.h")
-  set(CPM_INCLUDE_DIRS "${CPM_AUTOGEN_INCLUDE_DIR}")
-else()
-  set(CPM_AUTOGEN_INCLUDE_DIR "${CPM_DIR_OF_CPM}/include")
-  set(CPM_USING_NS_HEADER_FILE "${CPM_AUTOGEN_INCLUDE_DIR}/cpm/cpm.h")
-  set(CPM_INCLUDE_DIRS "${CPM_AUTOGEN_INCLUDE_DIR}")
-endif()
-
-# Delete old cpm header file and begin constructing a new one.
-file(REMOVE ${CPM_USING_NS_HEADER_FILE})
-file(APPEND ${CPM_USING_NS_HEADER_FILE} "// This file was automatically generated by CPM.\n")
-file(APPEND ${CPM_USING_NS_HEADER_FILE} "// It includes using directives for all automatically generated namespaces.\n\n")
-
 # Clear out the old CPM_KV_PREPROC_NS_MAP
 foreach(_cpm_kvName IN LISTS CPM_KV_LIST_PREPROC_NS_MAP)
   set(CPM_KV_PREPROC_NS_MAP_${_cpm_kvName})
@@ -824,9 +803,6 @@
   # Set the appropriate preprocessor definition for this module and populate
   # our namespace header file.
   _cpm_check_and_add_preproc(${name} ${name} ${__CPM_FULL_UNID})
-  _cpm_build_preproc_name(${name} __CPM_MODULE_PREPROC)
-  file(APPEND ${CPM_USING_NS_HEADER_FILE} "using namespace ${__CPM_MODULE_PREPROC};\n")
-  set(__CPM_MODULE_PREPROC)

   # Now propogate the version map upwards (we don't really *need* to do this).
   # But makes it clear what we are trying to do.


Fix in CXX_STANDARD definition for modules in Apple and Unix

--- support/cmake/module_definition.cmake
+++ support/cmake/module_definition.cmake
@@ -76,8 +76,8 @@

 # Set the compiler settings that are common to all modules
 function (set_common_compile_settings target_name)
-    set_property(TARGET ${project} PROPERTY CXX_STANDARD 11)
-    set_property(TARGET ${project} PROPERTY CXX_STANDARD_REQUIRED On)
+    set_property(TARGET ${library_name} PROPERTY CXX_STANDARD 11)
+    set_property(TARGET ${library_name} PROPERTY CXX_STANDARD_REQUIRED On)

     if (MSVC)
         target_compile_options(${library_name} PUBLIC


Minor updqte to our common CMake file.

Minor updqte to our common CMake file.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -501,8 +501,7 @@
 MACRO(COPY_FILE_TO_BUILD_DIR DIRNAME FILENAME)
     SET(BUILD_DIR ${CMAKE_FILES_DIR}/../build)
     # Note: we would normally use ${CMAKE_BINARY_DIR}, but we want this macro
-    #       to work for both the main OpenCOR project and the winConsole
-    #       version of the OpenCOR project, so...
+    #       to work for both the main OpenCOR project and winConsole, so...

     IF(NOT EXISTS ${BUILD_DIR}/${DIRNAME})
         ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD


Slight improvement to our CMake INITIALISE_PROJECT() macro [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -28,7 +28,9 @@
             ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/architecture.c
             RUN_OUTPUT_VARIABLE ARCHITECTURE)

-    IF(NOT ${ARCHITECTURE} EQUAL 32 AND NOT ${ARCHITECTURE} EQUAL 64)
+    IF(NOT ARCHITECTURE_COMPILE)
+        MESSAGE(FATAL_ERROR "We could not determine your architecture. Please clean your OpenCOR environment and try again...")
+    ELSEIF(NOT ${ARCHITECTURE} EQUAL 32 AND NOT ${ARCHITECTURE} EQUAL 64)
         MESSAGE(FATAL_ERROR "OpenCOR can only be built in 32-bit or 64-bit mode...")
     ENDIF()


cmake: implement a helper macro to find which lib contains a particular symbol

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -22,9 +22,32 @@

 include(CheckFunctionExists)
 include(CheckIncludeFiles)
+include(CheckLibraryExists)
 include(TestBigEndian)

 test_big_endian(CPU_BIG_ENDIAN)
+
+# Find which library a particular function exists in
+macro(find_symbol fxn libs output_lib_name)
+	string(TOUPPER ${fxn} name)
+	check_function_exists(${fxn} HAVE_${name})
+	if(HAVE_${name})
+		set(${output_lib_name})
+	else()
+		foreach(lib ${libs})
+			string(TOUPPER ${lib} libname)
+			check_library_exists(${lib} ${fxn} "" HAVE_${libname}_${name})
+			if(HAVE_${libname}_${name})
+				set(HAVE_${name} 1)
+				set(${output_lib_name} ${lib})
+				break()
+			endif()
+		endforeach()
+	endif()
+	if(NOT HAVE_${name})
+		message("-- Could not find ${fxn}")
+	endif()
+endmacro()

 check_function_exists(arc4random HAVE_ARC4RANDOM)
 check_function_exists(arc4random_buf HAVE_ARC4RANDOM_BUF)


macros.cmake: Add minor engine ver to SOVERSION (ABI)

By adding the minor version number to the SOVERSION property, this
indicates the ABI compatibility for various software tools to use.

* Add patch level onto target VERSION property

--- cmake/macros.cmake
+++ cmake/macros.cmake
@@ -66,12 +66,15 @@

   add_library( ${target} ${lib_type} ${source} )

+  # The Application Binary Interface (ABI) version; PATCH level versions are
+  # intended **not** to break the ABI version.
   set_target_properties(  ${target} PROPERTIES SOVERSION
-                          ${PROJECT_VERSION_MAJOR}
+                          "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
   )

+  # The Application Programming Interface (API) version
   set_target_properties(  ${target} PROPERTIES VERSION
-                          "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
+                          "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
   )

   set_target_properties( ${target} PROPERTIES DEBUG_POSTFIX "-d" )


`android.cmake`: set `CMAKE_ANDROID_STL_TYPE` to `c++_static`.

	modified:   android.cmake


tweak unix/win32 dirs for bullet in ConfigurePackages

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -457,15 +457,21 @@
     if ("$ENV{BULLET_DIR}" STREQUAL "")
        if (WIN32)
           set(BULLET_DIR ${ENV_NAALI_DEP_PATH}/Bullet)
+	  include_directories(${BULLET_DIR}/include)
+	  include_directories(${BULLET_DIR}/include/ConvexDecomposition)
+	  link_directories(${BULLET_DIR}/lib)
        else() # todo: This should be temporary? Always just use the above directory.
-          set(BULLET_DIR ${ENV_NAALI_DEP_PATH}/bullet-2.77)
+          set(BULLET_DIR ${ENV_NAALI_DEP_PATH})
+	  include_directories(${BULLET_DIR}/include/bullet)
+	  include_directories(${BULLET_DIR}/include/bullet/ConvexDecomposition)
+	  link_directories(${BULLET_DIR}/lib)
        endif()
     else()
        set(BULLET_DIR $ENV{BULLET_DIR})
+       include_directories(${BULLET_DIR}/include)
+       include_directories(${BULLET_DIR}/include/ConvexDecomposition)
+       link_directories(${BULLET_DIR}/lib)
     endif()
-    include_directories(${BULLET_DIR}/include)
-    include_directories(${BULLET_DIR}/include/ConvexDecomposition)
-    link_directories(${BULLET_DIR}/lib)
 endmacro()

 macro(link_package_bullet)


SVN_SILENT made messages (.desktop file)

--- src/vlc.desktop.cmake
+++ src/vlc.desktop.cmake
@@ -21,6 +21,7 @@
 Name[et]=VLC
 Name[fi]=VLC
 Name[hu]=VLC
+Name[kk]=VLC
 Name[ko]=VLC
 Name[nb]=VLC
 Name[nds]=VLC
@@ -53,6 +54,7 @@
 Comment[et]=Phononi VLC taustaprogramm
 Comment[fi]=Phonon VLC-taustaohjelma
 Comment[hu]=Phonon VLC-backend
+Comment[kk]=Phonon VLC тетігі
 Comment[ko]=Phonon VLC 백엔드
 Comment[nb]=Phonon VLC-motor
 Comment[nds]=VLC-Hülpprogramm för Phonon


Depends on ParallelMPI, can't be in StandAlone

Change-Id: I87b111fcb064c08dfa88fb17518b685ffb679c3b

--- Filters/ParallelImaging/module.cmake
+++ Filters/ParallelImaging/module.cmake
@@ -1,7 +1,6 @@
 vtk_module(vtkFiltersParallelImaging
   GROUPS
     Imaging
-    StandAlone
   DEPENDS
     vtkImagingCore
     vtkFiltersImaging


msvc_runtime.cmake: Check for MSVC, not WIN32.

- The flag change here is supposed to target only MSVC builds,
  and not all Windows builds.
- Style tweak to match other CMake files.

Change-Id: I664705e13d810e2d41422eae655b5a68ff244308

--- build/msvc_runtime.cmake
+++ build/msvc_runtime.cmake
@@ -7,18 +7,17 @@
 ##  be found in the AUTHORS file in the root of the source tree.
 cmake_minimum_required(VERSION 2.8)

-if(WIN32)
+if (MSVC)
   # CMake defaults to producing code linked to the DLL MSVC runtime. In libwebm
   # static is typically desired. Force static code generation unless the user
   # running CMake set MSVC_RUNTIME to dll.
-  if(NOT "${MSVC_RUNTIME}" STREQUAL "dll")
-    foreach(flag_var
-            CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
-            CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
-      if(${flag_var} MATCHES "/MD")
+  if (NOT "${MSVC_RUNTIME}" STREQUAL "dll")
+    foreach (flag_var
+             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+      if (${flag_var} MATCHES "/MD")
         string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
-      endif(${flag_var} MATCHES "/MD")
-    endforeach(flag_var)
-  endif(NOT "${MSVC_RUNTIME}" STREQUAL "dll")
-endif(WIN32)
-
+      endif (${flag_var} MATCHES "/MD")
+    endforeach (flag_var)
+  endif ()
+endif ()


fix: openssl.cmake: properly configure win64

* use CMAKE_GENERATOR_PLATFORM (from -A) rather than CMAKE_GENERATOR

--- deps/openssl.cmake
+++ deps/openssl.cmake
@@ -17,7 +17,7 @@
   endif()

   if(WIN32)
-      if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
+      if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64")
         set(OPENSSL_CONFIGURE_COMMAND perl ./Configure VC-WIN64A ${OPENSSL_CONFIG_OPTIONS})
       else()
         set(OPENSSL_CONFIGURE_COMMAND perl ./Configure VC-WIN32 ${OPENSSL_CONFIG_OPTIONS})


[jancy] release 1.6.2

[jancy] release 1.6.2

[axl] release 5.5.2

--- version.cmake
+++ version.cmake
@@ -1,6 +1,6 @@
 set (VERSION_MAJOR     5)
 set (VERSION_MINOR     5)
-set (VERSION_REVISION  1)
+set (VERSION_REVISION  2)
 set (VERSION_TAG)

 set (VERSION_FILE_SUFFIX "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")


GraphControl 3.10.4-2rc Release Candidate 2

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

--- version.cmake
+++ version.cmake
@@ -6,7 +6,7 @@
 set ( HPCC_MINOR 10 )
 set ( HPCC_POINT 4 )
 set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_SEQUENCE 2 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Split off 8.2.30

Split off 8.2.30

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

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 2 )
-set ( HPCC_POINT 29 )
+set ( HPCC_POINT 31 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 7.12.6

Split off 7.12.6

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

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 12 )
-set ( HPCC_POINT 5 )
+set ( HPCC_POINT 7 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 7.12.64

Split off 7.12.64

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

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 12 )
-set ( HPCC_POINT 63 )
+set ( HPCC_POINT 65 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


update alvar version in cmake

update alvar version in cmake

--- version.cmake
+++ version.cmake
@@ -5,8 +5,8 @@

 # set project version
 set(ALVAR_VERSION_MAJOR 2)
-set(ALVAR_VERSION_MINOR 0)
-set(ALVAR_VERSION_PATCH 0)
+set(ALVAR_VERSION_MINOR 1)
+set(ALVAR_VERSION_PATCH 2)

 # denote special version tag
 # examples: a1, a2, a3, b1, b2, b3, rc1, rc2, rc3


[cmake] alt pthread arg value

[cmake] alt pthread arg value

--- buildsystems/cmake/basics/deps-findpackage.cmake
+++ buildsystems/cmake/basics/deps-findpackage.cmake
@@ -29,6 +29,12 @@
 set(THREADS_PREFER_PTHREAD_FLAG TRUE)
 # NEED:(cmake<=3.7):
 # set(THREADS_PTHREAD_ARG "2" CACHE STRING "" FORCE)
+#   BUT:REF:(cross-compiling):
+#     https://cmake.org/pipermail/cmake/2017-August/065957.html
+#     https://github.com/ros2/ros2/issues/427
+#   set(THREADS_PTHREAD_ARG "PLEASE_FILL_OUT-FAILED_TO_RUN" CACHE STRING "Result from TRY_RUN" FORCE)
+## NOTE: assume "pthread" will be available on the target system -- emulate return code of TRY_RUN
+#   set(THREADS_PTHREAD_ARG "0" CACHE STRING "Result from TRY_RUN" FORCE)
 find_package(Threads REQUIRED)


Use native path for R_LIBS

Use native path for R_LIBS

The CMake style path for R_LIBS is not detecting as existing for R, so
it was ignored. Also the trailing slash must be removed on the windows
platform.

--- CMake/sitkAddTest.cmake
+++ CMake/sitkAddTest.cmake
@@ -229,8 +229,9 @@
     ${ARGN}
     )

+  file(TO_NATIVE_PATH "${SimpleITK_BINARY_DIR}/Wrapping/R/R_libs" _native_path)
   set_property(TEST R.${name}
-    PROPERTY ENVIRONMENT R_LIBS=${SimpleITK_BINARY_DIR}/Wrapping/R/R_libs/
+    PROPERTY ENVIRONMENT R_LIBS=${_native_path}
     )
 endfunction()


rebuild on library update restored

rebuild on library update restored

--- CMakeModules/wasm.cmake
+++ CMakeModules/wasm.cmake
@@ -156,7 +156,7 @@
      list(APPEND LIBRARIES ${${lib}_BC_FILENAME})
   endforeach()
   add_custom_command(OUTPUT ${target}.bc
-    DEPENDS ${outfiles} ${ARG_LIBRARIES}
+    DEPENDS ${outfiles} ${ARG_LIBRARIES} ${LIBRARIES}
     COMMAND ${WASM_LLVM_LINK} -only-needed -o ${target}.bc ${outfiles} ${LIBRARIES}
     COMMENT "Linking LLVM bitcode executable ${target}.bc"
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}


Force PV to use C++11 in its build

Force PV to use C++11 in its build

Avoid link errors for incompatible C++ version

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -37,6 +37,7 @@
     -DPQWIDGETS_DISABLE_QTWEBKIT:BOOL=ON
     -DPARAVIEW_ENABLE_FFMPEG:BOOL=ON
     -DModule_vtkGUISupportQtWebkit:BOOL=OFF
+    -DCMAKE_CXX_STANDARD_REQUIRED:STRING=11

     # specify the apple app install prefix. No harm in specifying it for all
     # platforms.


Pass through qhelpgenerator and xmlpatterns executables

This should fix the windows builds.

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -2,6 +2,16 @@
 if (tbb_ENABLED)
   set(VTK_SMP_IMPLEMENTATION_TYPE "TBB")
 endif ()
+
+set(paraview_extra_cmake_args)
+if (QT_HELP_GENERATOR)
+  list(APPEND paraview_extra_cmake_args
+    -DQT_HELP_GENERATOR:FILEPATH=${QT_HELP_GENERATOR})
+endif()
+if (QT_XMLPATTERNS_EXECUTABLE)
+  list(APPEND paraview_extra_cmake_args
+    -DQT_XMLPATTERNS_EXECUTABLE:FILEPATH=${QT_XMLPATTERNS_EXECUTABLE})
+endif()

 add_external_project(paraview
   DEPENDS qt python ffmpeg
@@ -47,6 +57,8 @@
     -DCMAKE_CXX_STANDARD_REQUIRED:STRING=11
     -DVTK_SMP_IMPLEMENTATION_TYPE:STRING=${VTK_SMP_IMPLEMENTATION_TYPE}

+    ${paraview_extra_cmake_args}
+
     # specify the apple app install prefix. No harm in specifying it for all
     # platforms.
     -DMACOSX_APP_INSTALL_PREFIX:PATH=<INSTALL_DIR>/Applications


Increment the fallback version

Increment the fallback version

--- cmake/DetermineTomvizVersion.cmake
+++ cmake/DetermineTomvizVersion.cmake
@@ -7,7 +7,7 @@
 #   tomviz_version
 #   tomviz_version_long

-set(hardcoded_tomviz_version "0.9.1")
+set(hardcoded_tomviz_version "0.9.2")

 function(_set_version_vars versiontext)
   string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)" version_matches "${versiontext}")


define ARROW_ROOT in order to use FindArrow module

--- cmake/Modules/ConfigureArrow.cmake
+++ cmake/Modules/ConfigureArrow.cmake
@@ -21,18 +21,8 @@
     message(FATAL_ERROR "Build step for arrow failed: ${result}")
 endif()

-# Prevent overriding the parent project's compiler/linker
-# settings on Windows
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-
-# Prevent overriding the parent project's compiler/linker
-# settings on Windows
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-
-# Locate the Google Test package.
+# Locate the Arrow package.
 # Requires that you build with:
-#   -DGTEST_ROOT:PATH=/path/to/googletest_install_dir
-set(ARROW_ROOT ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/arrow-install/)
+#   -DARROW_ROOT:PATH=/path/to/arrow_install_dir
+set(ARROW_ROOT ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/arrow-download/arrow-prefix/src/arrow-install/usr/local/)
 message(STATUS "ARROW_ROOT: " ${ARROW_ROOT})
-
-#link_directories(${GTEST_ROOT}/lib/)


[CMake] LLDB should use Clang and Swift CMake packages

This updates LLDB to import the Clang and Swift CMake packages which contain the target exports.

This will allow LLDB to have the transitive library dependency graph available during its target generation.

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -128,10 +128,12 @@
     message("-- Found PythonInterp: ${PYTHON_EXECUTABLE}")
   endif()

-  # Import CMake library targets from LLVM and Clang.
-  if (EXISTS "${LLDB_PATH_TO_CLANG_BUILD}/lib/cmake/clang/ClangConfig.cmake")
-      include("${LLDB_PATH_TO_CLANG_BUILD}/lib/cmake/clang/ClangConfig.cmake")
-  endif()
+  # Start Swift Mods
+  find_package(Clang REQUIRED CONFIG
+    HINTS "${LLDB_PATH_TO_CLANG_BUILD}" NO_DEFAULT_PATH)
+  find_package(Swift REQUIRED CONFIG
+    HINTS "${PATH_TO_SWIFT_BUILD}" NO_DEFAULT_PATH)
+  # End Swift Mods

   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")

@@ -151,10 +153,6 @@
                       "${PATH_TO_SWIFT_BUILD}/include"
                       "${SWIFT_MAIN_INCLUDE_DIR}"
                       "${CMAKE_CURRENT_SOURCE_DIR}/source")
-  link_directories("${LLVM_LIBRARY_DIR}"
-                   "${PATH_TO_CLANG_BUILD}/lib${LLVM_LIBDIR_SUFFIX}"
-                   "${PATH_TO_SWIFT_BUILD}/lib${LLVM_LIBDIR_SUFFIX}"
-                   "${PATH_TO_CMARK_BUILD}/src")

   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})


disabled verbose CUDA PTX compiler flag from release build

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -148,7 +148,7 @@
         endif()

         # PTX compiler options
-        list(APPEND CUDA_NVCC_FLAGS_RELEASE --ptxas-options=-v;)
+        #list(APPEND CUDA_NVCC_FLAGS_RELEASE --ptxas-options=-v;)
     endif ()

     message("===============================================================================")


Fix OpenCV 3.2.0-p0 URL

Fix OpenCV 3.2.0-p0 URL

[skip ci]

--- cmake/projects/OpenCV/hunter.cmake
+++ cmake/projects/OpenCV/hunter.cmake
@@ -84,7 +84,7 @@
     VERSION
     "3.2.0-p0"
     URL
-    "https://github.com/hunter-packages/opencv/archive/v3.2.0-p0.tar.gz"
+    "https://github.com/hunter-packages/opencv/releases/download/v3.2.0-p0/v3.2.0-p0.tar.gz"
     SHA1
     901f98202eb12dc2e1cc7f008204a9fb98ea0b13
 )


Now also cached variables have CPACK prefix.

--- cmake/setup_cached_variables.cmake
+++ cmake/setup_cached_variables.cmake
@@ -410,9 +410,9 @@
 ENDFOREACH()

 # CPack miscellaneous options
-SET(DEAL_II_EXTERNAL_LIBS_TREE "" CACHE PATH
+SET(DEAL_II_CPACK_EXTERNAL_LIBS_TREE "" CACHE PATH
     "Path to tree of external libraries that will be installed in bundle package."
   )
-MARK_AS_ADVANCED(DEAL_II_EXTERNAL_LIBS_TREE)
-
-
+MARK_AS_ADVANCED(DEAL_II_CPACK_EXTERNAL_LIBS_TREE)
+
+


cmake: handle CUDA 9.1 in GCC version check

Summary:
GCC version check is currently being skipped when using the
newly released CUDA 9.1.

This will also handle other CUDA 9.x minor releases if any,
reducing our work if there are such releases like 9.2. This
assumes that the next major CUDA version will be 10.0,
needing adjustment only after such major version is
released.
Closes https://github.com/caffe2/caffe2/pull/1658

Differential Revision: D6659000

Pulled By: pietern

fbshipit-source-id: 79291b5da9d4e8b4f2c7ac82fe2b1e7939438bc9

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -326,13 +326,14 @@
 if(USE_CUDA)
   include(cmake/Cuda.cmake)
   if(HAVE_CUDA)
-    # CUDA 9.0 requires GCC version <= 6
-    if (CUDA_VERSION VERSION_EQUAL 9.0)
+    # CUDA 9.x requires GCC version <= 6
+    if ((CUDA_VERSION VERSION_EQUAL   9.0) OR
+        (CUDA_VERSION VERSION_GREATER 9.0  AND CUDA_VERSION VERSION_LESS 10.0))
       if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
           NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0 AND
           CUDA_HOST_COMPILER STREQUAL CMAKE_C_COMPILER)
         message(FATAL_ERROR
-          "CUDA 9.0 is not compatible with GCC version >= 7. "
+          "CUDA ${CUDA_VERSION} is not compatible with GCC version >= 7. "
           "Use the following option to use another version (for example): \n"
           "  -DCUDA_HOST_COMPILER=/usr/bin/gcc-6\n")
       endif()


Allow argument mismatch for GCC >= 10

Allow argument mismatch for GCC >= 10

--- cmake/FortranFlags.cmake
+++ cmake/FortranFlags.cmake
@@ -4,6 +4,9 @@
     set(CMAKE_Fortran_FLAGS         "${CMAKE_Fortran_FLAGS} -fbacktrace -cpp")
     set(CMAKE_Fortran_FLAGS_DEBUG   "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g")
     set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O3 -ffast-math -funroll-loops -ftree-vectorize")
+    if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 10.0.0)
+        set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
+    endif()
     if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64")
         set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m64")
     endif()


WOrk on libc++ build

WOrk on libc++ build

--- cmake/GetLibStdCXX.cmake
+++ cmake/GetLibStdCXX.cmake
@@ -2,7 +2,7 @@
 include(ProcessorCount)
 ProcessorCount(N)

-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT WIN32)

 	if (NOT EXISTS ${CMAKE_BINARY_DIR}/glibc.tar.xz)
 		message(STATUS "Downloading glibc...")
@@ -45,23 +45,23 @@
 	file(DOWNLOAD http://releases.llvm.org/3.9.1/libcxxabi-3.9.1.src.tar.xz ${CMAKE_BINARY_DIR}/libcxxabi.tar.xz SHOW_PROGRESS)

 	message(STATUS "Extracting libc++abi...")
-	execute_process(${CMAKE_COMMAND} -E tar xf libcxxabi.tar.xz WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+	execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf libcxxabi.tar.xz WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

 	message(STATUS "Building libc++abi...")
 	file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/libcxxabi-3.9.1.src/build)
-	execute_process(${CMAKE_COMMAND} ../ -G${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/lib/chigraph/stdlib -DCMAKE_BUILD_TYPE=Release WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libcxxabi-3.9.1.src/build)
-	execute_process(${CMAKE_COMMAND} --build . --target=install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libcxxabi-3.9.1.src/build)
+	execute_process(COMMAND ${CMAKE_COMMAND} ../ -G${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/lib/chigraph/stdlib -DCMAKE_BUILD_TYPE=Release WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libcxxabi-3.9.1.src/build)
+	execute_process(COMMAND ${CMAKE_COMMAND} --build . --target=install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libcxxabi-3.9.1.src/build)

 	message(STATUS "Downloading libc++...")
 	file(DOWNLOAD http://releases.llvm.org/3.9.1/libcxx-3.9.1.src.tar.xz ${CMAKE_BINARY_DIR}/libcxx.tar.xz SHOW_PROGRESS)

 	message(STATUS "Extracting libc++...")
-	execute_process(${CMAKE_COMMAND} -E tar xf libcxx.tar.xz WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+	execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf libcxx.tar.xz WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

 	message(STATUS "Building libc++abi...")
 	file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/libcxx-3.9.1.src/build)
-	execute_process(${CMAKE_COMMAND} ../ -G${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/lib/chigraph/stdlib -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/libcxx -DCMAKE_BUILD_TYPE=Release WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libcxx-3.9.1.src/build)
-	execute_process(${CMAKE_COMMAND} --build . --target=install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libcxx-3.9.1.src/build)
+	execute_process(COMMAND ${CMAKE_COMMAND} ../ -G${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/lib/chigraph/stdlib -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/libcxx -DCMAKE_BUILD_TYPE=Release WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libcxx-3.9.1.src/build)
+	execute_process(COMMAND ${CMAKE_COMMAND} --build . --target=install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libcxx-3.9.1.src/build)


Adding warning flags to RelWithDebInfo target.

--- cmake/NektarCommon.cmake
+++ cmake/NektarCommon.cmake
@@ -105,13 +105,14 @@
         IF( NOT MSVC )
             SET(CMAKE_CXX_FLAGS_DEBUG
                 "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-deprecated -Wno-sign-compare")
+            SET(CMAKE_CXX_FLAGS_RELEASE
+                    "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-deprecated -Wno-sign-compare")
+            SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
+                    "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wall -Wno-deprecated -Wno-sign-compare")
             IF (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
                 SET(CMAKE_CXX_FLAGS_DEBUG
                     "${CMAKE_CXX_FLAGS_DEBUG} -fpermissive")
             ENDIF()
-
-            SET(CMAKE_CXX_FLAGS_RELEASE
-                    "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-deprecated")
         ENDIF( NOT MSVC)

         SET(CMAKE_CXX_FLAGS_RELEASE


cmake: add global defines to enable useful macros

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -224,6 +224,10 @@
     endif()
     if((NOT OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD AND NOT ${the_module} STREQUAL opencv_world) OR NOT ${BUILD_opencv_world})
       project(${the_module})
+      add_definitions(
+        -D_USE_MATH_DEFINES  # M_PI constant in MSVS
+        -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS  # to use C libraries from C++ code (ffmpeg)
+      )
     endif()
   endif()
 endmacro()


Fix "make test", there are no .shell wrappers in here so don't try to execute them.
However 4 tests fail. Extract:
FAIL!  : MethodTest::checkMediaObjectMethods(currentSourceChanged(const MediaSource&)) 'meta->indexOfSignal(QMetaObject::normalizedSignature(signature.constData())) != -1' returned FALSE. ()
   Loc: [/d/kde/src/t/kdesupport/phonon/phonon/tests/methodtest.cpp(181)]
CCMAIL: kretz@kde.org

svn path=/trunk/kdesupport/phonon/; revision=951797

--- cmake/PhononMacros.cmake
+++ cmake/PhononMacros.cmake
@@ -58,9 +58,9 @@
       set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}.app/Contents/MacOS/${_test_NAME})
    else (Q_WS_MAC AND NOT _nogui)
       # Use .shell wrapper where available, to use uninstalled libs.
-      if (UNIX)
-         set(_executable ${_executable}.shell)
-      endif (UNIX)
+      #if (UNIX)
+      #   set(_executable ${_executable}.shell)
+      #endif (UNIX)
    endif (Q_WS_MAC AND NOT _nogui)

    if (using_qtest AND PHONON_TEST_OUTPUT STREQUAL "xml")


CMake: fixed absolute path of VS redistribution package

* using CMake defined variable MSVC14_REDIST_DIR

--- cmake/globalconfig.cmake
+++ cmake/globalconfig.cmake
@@ -326,14 +326,15 @@
         set(MSVC_ACRO "14")
         set(MSVC_DLLNAMES "msvcp" "concrt" "vccorlib" "vcruntime")
     endif()
+    set(MSVC_REDIST_DIR ${MSVC${MSVC_ACRO}_REDIST_DIR})

     if(IVW_PACKAGE_PROJECT AND BUILD_SHARED_LIBS)
         if(DEFINED MSVC_ACRO)
             foreach(dllname ${MSVC_DLLNAMES})
                 # debug build
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/${dllname}${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
+                install(FILES "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/${dllname}${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
                 # release build
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/${dllname}${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
+                install(FILES "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/${dllname}${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
             endforeach()
         endif()
     endif()
@@ -366,9 +367,9 @@
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
         if(IVW_PACKAGE_PROJECT AND BUILD_SHARED_LIBS)
-            if(WIN32 AND MSVC AND DEFINED MSVC_ACRO)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugOpenMP/vcomp${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.OPENMP/vcomp${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
+            if(WIN32 AND MSVC AND DEFINED MSVC_ACRO AND DEFINED MSVC_REDIST_DIR)
+                install(FILES "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugOpenMP/vcomp${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
+                install(FILES "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.OPENMP/vcomp${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
             endif()
         endif()
     endif()


Added patch for framework/sofa/helper/vector_device.h.

--- CMakeExternals/PatchSOFA-rev9832.cmake
+++ CMakeExternals/PatchSOFA-rev9832.cmake
@@ -1,3 +1,12 @@
+file(STRINGS "framework/sofa/helper/vector_device.h" vector_device_h NEWLINE_CONSUME)
+string(REPLACE "#ifndef SOFA_NO_OPENGL\n    GLu" "    unsigned " vector_device_h ${vector_device_h})
+string(REPLACE "#endif\n    mutable i" "    mutable i" vector_device_h ${vector_device_h})
+string(REPLACE "        if (MemoryManager::SUPPORT_GL_BUFFER && bufferObject)\n" "#ifndef SOFA_NO_OPENGL\n        if (MemoryManager::SUPPORT_GL_BUFFER && bufferObject)\n" vector_device_h ${vector_device_h})
+string(REPLACE "//         else {" "#endif\n//         else {" vector_device_h ${vector_device_h})
+string(REPLACE "P ( GLu" "P ( unsigned " vector_device_h ${vector_device_h})
+set(CONTENTS ${vector_device_h})
+configure_file(${TEMPLATE_FILE} "framework/sofa/helper/vector_device.h" @ONLY)
+
 file(STRINGS "sofa-dependencies.cmake" sofaDependencies_cmake NEWLINE_CONSUME)
 string(REPLACE "add_subdirectory(\"\${SOFA_A" "#add_subdirectory(\"\${SOFA_A" sofaDependencies_cmake "${sofaDependencies_cmake}")
 file(WRITE "sofa-dependencies.cmake" "${sofaDependencies_cmake}")


Fix HAVE_LOCALTIME and HAVE_LOCALTIME_R declarations

--- src/config.h.cmake
+++ src/config.h.cmake
@@ -82,11 +82,11 @@
 /* Define to 1 if you have the <locale.h> header file. */
 #cmakedefine01 HAVE_LOCALE_H

-/* Define to 1 if you have the `localtime' function. */
-#cmakedefine01 HAVE_LOCALTIME
-
-/* Define to 1 if you have the `localtime_r' function. */
-#cmakedefine01 HAVE_LOCALTIME_R
+/* Define if you have the `localtime' function. */
+#cmakedefine HAVE_LOCALTIME
+
+/* Define if you have the `localtime_r' function. */
+#cmakedefine HAVE_LOCALTIME_R

 /* Define if you have C99's lrint function. */
 #cmakedefine01 HAVE_LRINT


Use official OpenCV (no more pods)

Use official OpenCV (no more pods)

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -10,9 +10,16 @@
 set(Eigen_pod_revision 3ec6bbfcb41a9ea74921720d62f86863fdf96217)
 set(Eigen_pod_depends)

-set(opencv-pod_url https://github.com/openhumanoids/opencv-pod.git)
-set(opencv-pod_revision 7f4c81676f887ee64da446f1ba61a3e5ed80f879)
-set(opencv-pod_depends Eigen_pod)
+set(opencv_url https://github.com/Itseez/opencv.git)
+set(opencv_revision 2.4.12.3)
+set(opencv_depends Eigen_pod)
+set(opencv_external_args
+  CMAKE_CACHE_ARGS
+    -DCMAKE_PREFIX_PATH:PATH=${CMAKE_INSTALL_PREFIX}
+    -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
+    -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+    -DWITH_CUDA:BOOL=OFF
+  )

 set(flann-pod_url https://github.com/openhumanoids/flann-pod.git)
 set(flann-pod_revision 9619e03a1d1f8b4b27d370810b9b2ccfe00adf58)
@@ -34,7 +41,7 @@

 set(occ-map_url https://github.com/openhumanoids/occ-map.git)
 set(occ-map_revision 34ab71fa693216d2c0508f0f2680b9a68994f473)
-set(occ-map_depends libbot opencv-pod)
+set(occ-map_depends libbot opencv)

 set(common_utils_url https://github.com/openhumanoids/common_utils.git)
 set(common_utils_revision 7fc252e3b1baf8ec6a19ee812ae114e8ee460dbd)
@@ -111,7 +118,7 @@

 set(libmultisense_url https://bitbucket.org/crl/libmultisense)
 set(libmultisense_hg_tag a57026c)
-set(libmultisense_depends opencv-pod)
+set(libmultisense_depends opencv)
 set(libmultisense_external_args
   CMAKE_CACHE_ARGS
     -DCMAKE_PREFIX_PATH:PATH=${CMAKE_INSTALL_PREFIX}
@@ -150,7 +157,7 @@
 set(externals
   Eigen_pod
   libbot
-  opencv-pod
+  opencv
   flann-pod
   pcl
   octomap-pod


BUG: Propagate make program to KWStyle ExternalProject

Building ITK, configured with the Ninja generator, where the ninja
build program was not in the path resulted in errors when configuring
the KWSytle external project:
  CMake Error: CMake was unable to find a build program corresponding to
  "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select
  a different build tool.

The variable "gen" is not defined in the BuildKWStyle.cmake scope, so
the CMAKE_GENERATOR option is removed. Implicitly ExternalProject
propagates the same generator.

Change-Id: Ie4d05d227633f41300b709853d39533055b07857

--- Utilities/KWStyle/BuildKWStyle.cmake
+++ Utilities/KWStyle/BuildKWStyle.cmake
@@ -42,6 +42,7 @@
   LOG_INSTALL 0
   CMAKE_GENERATOR ${gen}
   CMAKE_ARGS
+    -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}
     -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
     ${CMAKE_CXX_COMPILER_LAUNCHER_FLAG}
     -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}


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   14)
+SET(KWSYS_DATE_STAMP_DAY   15)


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 12)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


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 10)

 # 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
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


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 06)

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


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 02)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   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 04)

 # 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 07)

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


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   08)
+SET(KWSYS_DATE_STAMP_DAY   09)


detect libcxx in clang

detect libcxx in clang

--- conan.cmake
+++ conan.cmake
@@ -97,7 +97,8 @@
                 set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libstdc++)
             endif()
         else()
-            set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libstdc++)
+            conan_cmake_detect_gnu_libcxx(_LIBCXX)
+            set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=${_LIBCXX})
         endif()
     elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
         set(_VISUAL "Visual Studio")


BUG: Reset LIST_OF_IMAGEIO_FORMATS in UseITK.cmake

The list gets appended with multiple calls to include(${ITK_USE_FILE}).

Addresses:

CMake Warning at
/home/matt/bin/ITKExamples-Clang-MinSizeRel/ITK/CMake/UseITK.cmake:202
(message):
  Trying to register ITKIOBMP in factory, but module was not requested
Call Stack (most recent call first):
  /home/matt/bin/ITKExamples-Clang-MinSizeRel/ITK/CMake/UseITK.cmake:175
(ADD_FACTORY_REGISTRATION)
  /home/matt/bin/ITKExamples-Clang-MinSizeRel/ITK/CMake/UseITK.cmake:229
(_configure_FactoryRegisterManager)

src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/CMakeLists.txt:17
(include)

Change-Id: Ia70450188a8588617f129959bddbfa3d8269df5f

--- CMake/UseITK.cmake
+++ CMake/UseITK.cmake
@@ -209,6 +209,7 @@
 foreach(_factory_name ${ITK_FACTORY_LIST})
   string(TOUPPER ${_factory_name} factory_uc)
   string(TOLOWER ${_factory_name} factory_lc)
+  set(LIST_OF_${factory_uc}_FORMATS "")
   foreach(_format ${ITK_${_factory_name}})
     set(Module )
     foreach(_module ${ITK_FACTORY_NAMES})


omit COTIRE_*_INIT variables from generated target script

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2019,7 +2019,12 @@
 	# copy variable definitions to cotire target script
 	get_cmake_property(_vars VARIABLES)
 	string (REGEX MATCHALL "COTIRE_[A-Za-z0-9_]+" _matchVars "${_vars}")
-	# remove COTIRE_VERBOSE which is passed as a CMake define on command line
+	# omit COTIRE_*_INIT variables
+	string (REGEX MATCHALL "COTIRE_[A-Za-z0-9_]+_INIT" _initVars "${_matchVars}")
+	if (_initVars)
+		list (REMOVE_ITEM _matchVars ${_initVars})
+	endif()
+	# omit COTIRE_VERBOSE which is passed as a CMake define on command line
 	list (REMOVE_ITEM _matchVars COTIRE_VERBOSE)
 	set (_contents "")
 	set (_contentsHasGeneratorExpressions FALSE)


CommonLibrary becomes friendly with meta-programming library

--- CommonLibrary.cmake
+++ CommonLibrary.cmake
@@ -50,7 +50,8 @@
       get_filename_component(PUBLIC_HEADER ${PUBLIC_HEADER} NAME)
     endif()
     if(NOT PUBLIC_HEADER MATCHES "defines.+\\.h" AND
-        PUBLIC_HEADER MATCHES ".*\\.h$" )
+        PUBLIC_HEADER MATCHES ".*\\.h$" OR
+        PUBLIC_HEADER MATCHES ".*\\.hpp$")

       file(APPEND ${PROJECT_GENERATED_HEADER}
         "#include <${PROJECT_INCLUDE_NAME}/${PUBLIC_HEADER}>\n")


add support for linking with CW debug and release builds

--- cmake/Modules/FindClockworkClient.cmake
+++ cmake/Modules/FindClockworkClient.cmake
@@ -2,7 +2,11 @@

 find_library(
 	ClockworkClient_LIBRARY
-	PATHS /opt/latproc/iod/stage/lib /opt/latproc/iod/build
+	PATHS
+		/opt/latproc/iod/stage/lib
+		/opt/latproc/iod/build/Release
+		/opt/latproc/iod/build/Debug
+		/opt/latproc/iod/build
 	NAMES cw_client Clockwork
 )


Remove error message

Remove error message

--- cmake/Modules/ReadVersionFromFile.cmake
+++ cmake/Modules/ReadVersionFromFile.cmake
@@ -6,11 +6,6 @@

 function(read_version_from_file filename string_var major_var minor_var patch_var tweak_var)
 	file(STRINGS ${filename} version_string LIMIT_COUNT 1)
-
-	list(LENGTH version_string length)
-	if(length EQUAL 0)
-		message(WARNING "read_version: File ${filename} seems to be empty")
-	endif()

 	set(${string_var} ${version_string} PARENT_SCOPE)


always install env files if project is catkin (updating 0.5.2)

--- cmake/catkin_generate_environment.cmake
+++ cmake/catkin_generate_environment.cmake
@@ -41,7 +41,7 @@
   # installspace
   set(SETUP_DIR ${CMAKE_INSTALL_PREFIX})
   set(CURRENT_WORKSPACE ${CMAKE_INSTALL_PREFIX})
-  if(NOT CATKIN_BUILD_BINARY_PACKAGE)
+  if(NOT CATKIN_BUILD_BINARY_PACKAGE OR "${PROJECT_NAME}" STREQUAL "catkin")
     # install setup.py
     install(PROGRAMS
       ${catkin_EXTRAS_DIR}/templates/setup.py
@@ -54,7 +54,7 @@
     configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/installspace/env.sh
       @ONLY)
-    if(NOT CATKIN_BUILD_BINARY_PACKAGE)
+    if(NOT CATKIN_BUILD_BINARY_PACKAGE OR "${PROJECT_NAME}" STREQUAL "catkin")
       install(PROGRAMS
         ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/installspace/env.sh
         DESTINATION ${CMAKE_INSTALL_PREFIX})
@@ -64,7 +64,7 @@
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.installspace.context.py
       ${catkin_EXTRAS_DIR}/em/setup.sh.em
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/installspace/setup.sh)
-    if(NOT CATKIN_BUILD_BINARY_PACKAGE)
+    if(NOT CATKIN_BUILD_BINARY_PACKAGE OR "${PROJECT_NAME}" STREQUAL "catkin")
       install(FILES
         ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/installspace/setup.sh
         DESTINATION ${CMAKE_INSTALL_PREFIX})
@@ -73,7 +73,7 @@
       configure_file(${catkin_EXTRAS_DIR}/templates/setup.${shell}.in
         ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/installspace/setup.${shell}
         @ONLY)
-      if(NOT CATKIN_BUILD_BINARY_PACKAGE)
+      if(NOT CATKIN_BUILD_BINARY_PACKAGE OR "${PROJECT_NAME}" STREQUAL "catkin")
         install(FILES
           ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/installspace/setup.${shell}
           DESTINATION ${CMAKE_INSTALL_PREFIX})


update for code coverage cmake module

update for code coverage cmake module

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -134,12 +134,11 @@
     ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --directory . --zerocounters
   )

-  ADD_CUSTOM_TARGET(${_targetname}-run
+  ADD_CUSTOM_TARGET(${_targetname}-generate
     COMMAND ${_testrunner} $ARGV3
   )

   ADD_CUSTOM_TARGET(${_targetname}-info
-
     # Capturing lcov counters and generating report
     COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --directory . --capture --output-file ${_outputname}.info
     COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
@@ -149,7 +148,7 @@
 	# Setup target
 	ADD_CUSTOM_TARGET(${_targetname}

-		DEPENDS ${_targetname}-clean ${_targetname}-run ${_targetname}-info
+		DEPENDS ${_targetname}-clean ${_targetname}-generate ${_targetname}-info

 		COMMAND ${CMAKE_COMMAND} -E remove_directory ${_outputname}
 		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info


Set flag when bootstrapped (used by BY to only build required)

--- Buildyard.cmake
+++ Buildyard.cmake
@@ -29,6 +29,7 @@
 endif()

 message(STATUS "Bootstrap Buildyard for missing${FIND_REQUIRED_FAILED}")
+set(BUILDYARD_BOOTSTRAP ON)
 include(GitExternal)

 git_external("${CMAKE_BINARY_DIR}/Buildyard"


COMP: Fix FindMPI module error reporting

--- CMake/FindMPI.cmake
+++ CMake/FindMPI.cmake
@@ -214,7 +214,7 @@
     if (MPI_LIB)
       list(APPEND MPI_LIBRARIES ${MPI_LIB})
     else (MPI_LIB)
-      status(ERROR "Unable to find MPI library ${LIB}")
+      message(ERROR "Unable to find MPI library ${LIB}")
     endif (MPI_LIB)
   endforeach(LIB)
   set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE)


ENH: fix some issues with registry paths

--- CMake/FindTCL.cmake
+++ CMake/FindTCL.cmake
@@ -50,31 +50,35 @@
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)

-GET_FILENAME_COMPONENT(
-  ActiveTcl_CurrentVersion
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
-  NAME)
-
-SET (TCLTK_POSSIBLE_LIB_PATHS
+SET(TCLTK_POSSIBLE_LIB_PATHS
   "${TCL_INCLUDE_PATH_PARENT}/lib"
   "${TK_INCLUDE_PATH_PARENT}/lib"
   "${TCL_LIBRARY_PATH}"
   "${TK_LIBRARY_PATH}"
   "${TCL_TCLSH_PATH_PARENT}/lib"
   "${TK_WISH_PATH_PARENT}/lib"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
-  "$ENV{ProgramFiles}/Tcl/Lib"
-  "C:/Program Files/Tcl/lib"
-  "C:/Tcl/lib"
   /usr/lib
   /usr/local/lib
-)
+  )
+
+IF(WIN32)
+  GET_FILENAME_COMPONENT(
+    ActiveTcl_CurrentVersion
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
+    NAME)
+  SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
+    "$ENV{ProgramFiles}/Tcl/Lib"
+    "C:/Program Files/Tcl/lib"
+    "C:/Tcl/lib"
+    )
+ENDIF(WIN32)

 FIND_LIBRARY(TCL_LIBRARY
   NAMES tcl
@@ -85,7 +89,7 @@
   tcl82 tcl8.2
   tcl80 tcl8.0
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
-)
+  )

 FIND_LIBRARY(TK_LIBRARY
   NAMES tk
@@ -96,7 +100,7 @@
   tk82 tk8.2
   tk80 tk8.0
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
-)
+  )

 CMAKE_FIND_FRAMEWORKS(Tcl)
 CMAKE_FIND_FRAMEWORKS(Tk)
@@ -120,7 +124,7 @@
   ENDIF(NOT TK_INCLUDE_PATH)
 ENDIF(Tk_FRAMEWORKS)

-SET (TCLTK_POSSIBLE_INCLUDE_PATHS
+SET(TCLTK_POSSIBLE_INCLUDE_PATHS
   "${TCL_LIBRARY_PATH_PARENT}/include"
   "${TK_LIBRARY_PATH_PARENT}/include"
   "${TCL_INCLUDE_PATH}"
@@ -129,16 +133,6 @@
   ${TK_FRAMEWORK_INCLUDES}
   "${TCL_TCLSH_PATH_PARENT}/include"
   "${TK_WISH_PATH_PARENT}/include"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include"
-  "$ENV{ProgramFiles}/Tcl/include"
-  "C:/Program Files/Tcl/include"
-  "C:/Tcl/include"
   /usr/include
   /usr/local/include
   /usr/include/tcl8.6
@@ -147,21 +141,42 @@
   /usr/include/tcl8.3
   /usr/include/tcl8.2
   /usr/include/tcl8.0
-)
-
-FIND_PATH(TCL_INCLUDE_PATH tcl.h
-  ${TCLTK_POSSIBLE_INCLUDE_PATHS} NO_DEFAULT_PATH
-)
-FIND_PATH(TCL_INCLUDE_PATH tcl.h
-  ${TCLTK_POSSIBLE_INCLUDE_PATHS}
-)
-
-FIND_PATH(TK_INCLUDE_PATH tk.h
-  ${TCLTK_POSSIBLE_INCLUDE_PATHS} NO_DEFAULT_PATH
-)
-FIND_PATH(TK_INCLUDE_PATH tk.h
-  ${TCLTK_POSSIBLE_INCLUDE_PATHS}
-)
+  )
+
+IF(WIN32)
+  SET(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include"
+    "$ENV{ProgramFiles}/Tcl/include"
+    "C:/Program Files/Tcl/include"
+    "C:/Tcl/include"
+    )
+ENDIF(WIN32)
+
+FIND_PATH(TCL_INCLUDE_PATH
+  NAMES tcl.h
+  PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+  NO_DEFAULT_PATH
+  )
+FIND_PATH(TCL_INCLUDE_PATH
+  NAMES tcl.h
+  PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+  )
+
+FIND_PATH(TK_INCLUDE_PATH
+  NAMES tk.h
+  PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+  NO_DEFAULT_PATH
+  )
+FIND_PATH(TK_INCLUDE_PATH
+  NAMES tk.h
+  PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+  )

 # handle the QUIETLY and REQUIRED arguments and set TCL_FOUND to TRUE if
 # all listed variables are TRUE


ENH: fix advanced bug

ENH: fix advanced bug

--- CMake/FindTCL.cmake
+++ CMake/FindTCL.cmake
@@ -193,8 +193,6 @@
   )

 MARK_AS_ADVANCED(
-  TCL_TCLSH_PATH
-  TK_WISH_PATH
   TCL_INCLUDE_PATH
   TK_INCLUDE_PATH
   TCL_LIBRARY


Only include .h files in common header

Only include .h files in common header

--- CommonLibrary.cmake
+++ CommonLibrary.cmake
@@ -34,7 +34,9 @@
     if(IS_ABSOLUTE ${PUBLIC_HEADER})
       get_filename_component(PUBLIC_HEADER ${PUBLIC_HEADER} NAME)
     endif()
-    if(NOT PUBLIC_HEADER MATCHES "defines.+\\.h")
+    if(NOT PUBLIC_HEADER MATCHES "defines.+\\.h" AND
+        PUBLIC_HEADER MATCHES ".*\\.h$" )
+
       file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${name}.in.h
         "#include <${name}/${PUBLIC_HEADER}>\n")
     endif()


Fixing linking against dynamic libraries on BG/Q

--- CompileConfig.cmake
+++ CompileConfig.cmake
@@ -46,8 +46,9 @@

 elseif(CMAKE_COMPILER_IS_XLCXX)
   # default: Maintain code semantics
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qstrict -qarch=qp -q64")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qstrict -qarch=qp -q64")
+  # Fix to link dynamically. On the next pass should add an if statement: if shared ...
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qstrict -qarch=qp -q64 -qnostaticlink -qnostaticlink=libgcc")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qstrict -qarch=qp -q64 -qnostaticlink -qnostaticlink=libgcc")

   # adding -qnohot to avoid higher order optimization loops
   set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -qnohot")


CHG (#2122): use cmake include path when looking for package config

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -287,7 +287,7 @@
   ENDFOREACH(dependency)

   FOREACH(package ${PACKAGE_DEPENDS})
-    INCLUDE(${MITK_SOURCE_DIR}/CMake/MITK_${package}_Config.cmake)
+    INCLUDE(MITK_${package}_Config)
     #SET(ALL_INCLUDE_DIRECTORIES ${ALL_INCLUDE_DIRECTORIES} ${${package}_INCLUDE_DIRS})
     # SET(ALL_LIBRARIES ${ALL_LIBRARIES} ${${package}_LIBRARIES})
   ENDFOREACH(package)


ENH (#2149): suggest correct module name if cases don't match

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -388,6 +388,13 @@
           LIST(REMOVE_DUPLICATES ${RESULT_VAR})
         ENDIF(${dependency}_IS_ENABLED)
       ELSE(NOT _index EQUAL -1)
+        STRING(TOLOWER ${_dependency_file_name} _lowercase_dependency_file_name)
+        LIST(FIND _ALL_MODULES_LOWERCASE ${_lowercase_dependency_file_name} _index_lower)
+        IF(NOT _index_lower EQUAL -1)
+          LIST(GET _ALL_MODULES ${_index_lower} _real_module_name)
+          STRING(REPLACE "Config.cmake" "" _real_module_name ${_real_module_name})
+          MESSAGE("Warning: case mismatch for module name ${dependency}, did you mean ${_real_module_name} ?")
+        ENDIF(NOT _index_lower EQUAL -1)
         LIST(APPEND ${RESULT_VAR} ${dependency})
         LIST(REMOVE_DUPLICATES ${RESULT_VAR})
       ENDIF(NOT _index EQUAL -1)