remove old file

remove old file

--- cmake/AddAlgorithms.cmake
+++ cmake/AddAlgorithms.cmake
@@ -1,29 +0,0 @@
-FUNCTION (ADD_ALGORITHMS basename exes algs compile_flags ld_flags)
-    FOREACH (exe ${exes})
-        STRING (TOUPPER "-DUSE_${exe}" flags)
-        FOREACH (alg ${algs})
-            SET (exe_name ${basename}-${alg}-${exe})
-            ADD_EXECUTABLE (${exe_name} ${basename}-${alg}.cpp)
-
-            IF (${exe} STREQUAL "omp")
-                SET_TARGET_PROPERTIES (${exe_name} PROPERTIES COMPILE_FLAGS
-                    "${compile_flags} ${flags} ${OpenMP_CXX_FLAGS}")
-            ELSE (${exe} STREQUAL "omp")
-                SET_TARGET_PROPERTIES (${exe_name} PROPERTIES COMPILE_FLAGS
-                    "${compile_flags} ${flags}")
-            ENDIF (${exe} STREQUAL "omp")
-
-            IF (${exe} STREQUAL "tbb")
-                TARGET_LINK_LIBRARIES (${exe_name}
-                    ${ld_flags} ${TBB_LINK_LIBRARIES})
-            ELSEIF (${exe} STREQUAL "omp")
-                TARGET_LINK_LIBRARIES (${exe_name}
-                    ${ld_flags} ${OpenMP_LINK_LIBRARIES})
-            ELSE (${exe} STREQUAL "tbb")
-                TARGET_LINK_LIBRARIES (${exe_name} ${ld_flags})
-            ENDIF (${exe} STREQUAL "tbb")
-
-            ADD_DEPENDENCIES (${basename} ${exe_name})
-        ENDFOREACH(alg)
-    ENDFOREACH (exe)
-ENDFUNCTION (ADD_ALGORITHMS)


Remove a few more warnings on windows

Remove a few more warnings on windows

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -124,8 +124,10 @@

     # Disable other warnings
     remove_msvc_warning(4061) # enumerator in switch of enum is not explicitly handled by a case label
+    remove_msvc_warning(4127) # conditional expression is constant
     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(4503) # mangled name too long was truncated
     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


Make Python search versions user-settable

--- cmake/DetectOptions.cmake
+++ cmake/DetectOptions.cmake
@@ -109,7 +109,10 @@
     set(python_find_args REQUIRED)
   endif()
   if(SHARED_LIBS_SUPPORTED AND ADIOS2_ENABLE_PIC)
-    set(Python_ADDITIONAL_VERSIONS 3 2.7)
+    set(Python_ADDITIONAL_VERSIONS "3;2.7"
+      CACHE STRING "Python versions to search for"
+    )
+    mark_as_advanced(Python_ADDITIONAL_VERSIONS)
     list(APPEND python_find_args COMPONENTS Interp Libs numpy)
     if(ADIOS2_HAVE_MPI)
       list(APPEND python_find_args "mpi4py\\\;mpi4py/mpi4py.h")


Fix flags issue between gcc and nvcc

Fix flags issue between gcc and nvcc

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -10,7 +10,7 @@
   # GCS 2011.03.16
   # Make nvcc less whiny
   if (CMAKE_COMPILER_IS_GNUCC)
-    set (CUDA_PROPAGATE_HOST_FLAGS OFF)
+    set (CUDA_PROPAGATE_HOST_FLAGS CACHE BOOL OFF)
   endif ()

   # GCS 2012-05-11:  We need to propagate cxx flags to nvcc, but
@@ -19,7 +19,7 @@
     string (REPLACE "-ftest-coverage" "" TMP "${CMAKE_CXX_FLAGS}")
     string (REPLACE "-ftemplate-depth-50" "" TMP "${TMP}")
     string (REPLACE " " "," TMP "${TMP}")
-    set (CUDA_CXX_FLAGS ${TMP})
+    set (CUDA_CXX_FLAGS ${CUDA_CXX_FLAGS} ${TMP})
   endif ()

   # GCS 2012-05-07: Workaround for poor, troubled FindCUDA


add version and cmakecache in inference_lib

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -162,4 +162,24 @@
   DSTS ${dst_dir}/${module}
 )

+# CMakeCache Info
+copy(cmake_cache
+  SRCS ${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt
+  DSTS ${CMAKE_INSTALL_PREFIX})
+
 add_custom_target(inference_lib_dist DEPENDS ${inference_lib_dist_dep})
+
+# paddle fluid version
+execute_process(
+  COMMAND ${GIT_EXECUTABLE} log --pretty=format:%H -1
+  OUTPUT_VARIABLE PADDLE_GIT_COMMIT)
+set(version_file ${CMAKE_INSTALL_PREFIX}/version.txt)
+file(WRITE ${version_file}
+  "GIT COMMIT ID: ${PADDLE_GIT_COMMIT}\n"
+  "WITH_MKL: ${WITH_MKL}\n"
+  "WITH_GPU: ${WITH_GPU}\n")
+if(WITH_GPU)
+  file(APPEND ${version_file}
+    "CUDA version: ${CUDA_VERSION}\n"
+    "CUDNN version: v${CUDNN_MAJOR_VERSION}\n")
+endif()


add mkldnn to paddle lib

add mkldnn to paddle lib

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -98,6 +98,14 @@
     )
 endif()

+if(WITH_MKLDNN)
+  set(dst_dir "${CMAKE_INSTALL_PREFIX}/third_party/install/")
+  copy(mkldnn_lib
+    SRCS ${MKLDNN_INSTALL_DIR}
+    DSTS ${dst_dir}
+  )
+endif()
+
 if(NOT MOBILE_INFERENCE AND NOT RPI)
   set(dst_dir "${CMAKE_INSTALL_PREFIX}/third_party/install/snappy")
   copy(snappy_lib


Fix GLFW find script

Fix GLFW find script

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -1,10 +1,11 @@

 # GLFW_FOUND
 # GLFW_INCLUDE_DIR
-# GLFW_LIBRARY_RELEASE
-# GLFW_LIBRARY_DEBUG
-# GLFW_LIBRARIES
+# GLFW_LIBRARY
+
 # GLFW_BINARY (win32 only)
+
+include(FindPackageHandleStandardArgs)

 find_path(GLFW_INCLUDE_DIR GLFW/glfw3.h
@@ -25,9 +26,6 @@
     DOC "The directory where GLFW/glfw.h resides")

 find_library(GLFW_LIBRARY_RELEASE NAMES glfw3 glfw glfw3dll glfwdll
-
-    HINTS
-    ${GLFW_INCLUDE_DIR}/..

     PATHS
     $ENV{GLFW_DIR}
@@ -52,9 +50,6 @@
     DOC "The GLFW library")

 find_library(GLFW_LIBRARY_DEBUG NAMES glfw3d glfwd glfw3ddll glfwddll
-
-    HINTS
-    ${GLFW_INCLUDE_DIR}/..

     PATHS
     $ENV{GLFW_DIR}


Adjust FindSDL2 to hopefully be able to find the framework on Mac.

--- cmake/FindSDL2.cmake
+++ cmake/FindSDL2.cmake
@@ -56,6 +56,41 @@

 include(FindPackageHandleStandardArgs)

+find_library(SDL2_LIBRARY
+	NAMES
+	SDL2
+	HINTS
+	${SDL2_LIB_HINTS}
+	PATHS
+	${SDL2_ROOT_DIR}
+	ENV SDL2DIR
+	PATH_SUFFIXES lib SDL2 ${SDL2_LIB_PATH_SUFFIX})
+
+set(_sdl2_framework FALSE)
+# Some special-casing if we've found/been given a framework.
+# Handles whether we're given the library inside the framework or the framework itself.
+if(APPLE AND "${SDL2_LIBRARY}" MATCHES "/([^/]+)\\.framework(/.*)$")
+	set(_sdl2_framework TRUE)
+	set(SDL2_FRAMEWORK "${SDL2_LIBRARY}")
+	# Move up in the directory tree as required to get the framework directory.
+	while("${SDL2_FRAMEWORK}" MATCHES "/([^/]+)\\.framework(/.*)$" AND NOT "${SDL2_FRAMEWORK}" MATCHES "/([^/]+)\\.framework$")
+		get_filename_component(SDL2_FRAMEWORK "${SDL2_FRAMEWORK}" DIRECTORY)
+	endwhile()
+	if("${SDL2_FRAMEWORK}" MATCHES "/([^/]+)\\.framework$")
+		set(SDL2_FRAMEWORK_NAME ${CMAKE_MATCH_1})
+		# If we found a framework, do a search for the header ahead of time that will be more likely to get the framework header.
+		find_path(SDL2_INCLUDE_DIR
+			NAMES
+			SDL_haptic.h # this file was introduced with SDL2
+			HINTS
+			"${SDL2_FRAMEWORK}/Headers/")
+	else()
+		# For some reason we couldn't get the framework directory itself.
+		# Shouldn't happen, but might if something is weird.
+		unset(SDL2_FRAMEWORK)
+	endif()
+endif()
+
 find_path(SDL2_INCLUDE_DIR
 	NAMES
 	SDL_haptic.h # this file was introduced with SDL2
@@ -64,16 +99,8 @@
 	PATHS
 	${SDL2_ROOT_DIR}
 	ENV SDL2DIR
-	PATH_SUFFIXES include include/sdl2)
-find_library(SDL2_LIBRARY
-	NAMES
-	SDL2
-	HINTS
-	${SDL2_LIB_HINTS}
-	PATHS
-	${SDL2_ROOT_DIR}
-	ENV SDL2DIR
-	PATH_SUFFIXES lib ${SDL2_LIB_PATH_SUFFIX})
+	PATH_SUFFIXES include include/sdl2 include/SDL2 SDL2)
+
 if(WIN32 AND SDL2_LIBRARY)
 	find_file(SDL2_RUNTIME_LIBRARY
 		NAMES
@@ -87,7 +114,8 @@
 		PATH_SUFFIXES bin lib ${SDL2_LIB_PATH_SUFFIX})
 endif()

-if(WIN32 OR ANDROID OR IOS)
+
+if(WIN32 OR ANDROID OR IOS OR (APPLE AND NOT _sdl2_framework))
 	set(SDL2_EXTRA_REQUIRED SDL2_SDLMAIN_LIBRARY)
 	find_library(SDL2_SDLMAIN_LIBRARY
 		NAMES
@@ -98,6 +126,27 @@
 		PATH_SUFFIXES lib ${SDL2_LIB_PATH_SUFFIX})
 endif()

+if(APPLE)
+	# Need Cocoa here, should always be a framework
+	# Code inspired by similar code in CMake's stock FindGLUT.cmake
+	find_library(SDL2_COCOA_LIBRARY Cocoa)
+
+	list(APPEND SDL2_EXTRA_REQUIRED SDL2_COCOA_LIBRARY)
+	if(SDL2_COCOA_LIBRARY AND NOT TARGET SDL2::Cocoa)
+		add_library(SDL2::Cocoa UNKNOWN IMPORTED)
+		if(SDL2_COCOA_LIBRARY MATCHES "/([^/]+)\\.framework$")
+			# Should always be true, but...
+			# This takes the basename of the framework, without the extension,
+			# and sets it (as a child of the framework) as the imported location for the target.
+			set_target_properties(SDL2::Cocoa PROPERTIES
+				IMPORTED_LOCATION "${SDL2_COCOA_LIBRARY}/${CMAKE_MATCH_1}")
+		else()
+			# Handle the unlikely case Cocoa is just a normal library (or we found the library inside of the framework)
+			set_target_properties(SDL2::Cocoa PROPERTIES
+				IMPORTED_LOCATION "${SDL2_COCOA_LIBRARY}")
+		endif()
+	endif()
+endif()

 if(MINGW AND NOT SDL2PC_FOUND)
 	find_library(SDL2_MINGW_LIBRARY mingw32)
@@ -119,55 +168,81 @@
 	${SDL2_EXTRA_REQUIRED})

 if(SDL2_FOUND)
-	if(WIN32 AND SDL2_RUNTIME_LIBRARY)
-		set(SDL2_DYNAMIC TRUE)
-		add_library(SDL2::SDL2 SHARED IMPORTED)
-		set_target_properties(SDL2::SDL2
-			PROPERTIES
-			IMPORTED_IMPLIB "${SDL2_LIBRARY}"
-			IMPORTED_LOCATION "${SDL2_RUNTIME_LIBRARY}"
-			INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
-		)
-	else()
-		add_library(SDL2::SDL2 STATIC IMPORTED)
-		set_target_properties(SDL2::SDL2
-			PROPERTIES
-			IMPORTED_LOCATION "${SDL2_LIBRARY}"
-			INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
-		)
-	endif()
-	add_library(SDL2::SDL2main INTERFACE IMPORTED)
-	set(SDL2MAIN_LIBRARIES SDL2::SDL2)
-	if(SDL2_SDLMAIN_LIBRARY)
-		add_library(SDL2::SDL2main_real STATIC IMPORTED)
-		set_target_properties(SDL2::SDL2main_real
-			PROPERTIES
-			IMPORTED_LOCATION "${SDL2_SDLMAIN_LIBRARY}")
-		list(APPEND SDL2MAIN_LIBRARIES SDL2::SDL2main_real)
-	endif()
-	if(MINGW)
-		# MinGW requires some additional libraries to appear earlier in the link line.
-		if(SDL2PC_LIBRARIES)
-			# Use pkgconfig-suggested extra libraries if available.
-			list(REMOVE_ITEM SDL2PC_LIBRARIES SDL2main SDL2)
-			set(SDL2MAIN_LIBRARIES ${SDL2PC_LIBRARIES} ${SDL2MAIN_LIBRARIES})
+	if(NOT TARGET SDL2::SDL2)
+		# Create SDL2::SDL2
+		if(WIN32 AND SDL2_RUNTIME_LIBRARY)
+			set(SDL2_DYNAMIC TRUE)
+			add_library(SDL2::SDL2 SHARED IMPORTED)
+			set_target_properties(SDL2::SDL2
+				PROPERTIES
+				IMPORTED_IMPLIB "${SDL2_LIBRARY}"
+				IMPORTED_LOCATION "${SDL2_RUNTIME_LIBRARY}"
+				INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
+			)
 		else()
-			# fall back to extra libraries specified in pkg-config in
-			# an official binary distro of SDL2 for MinGW I downloaded
-			if(SDL2_MINGW_LIBRARY)
-				set(SDL2MAIN_LIBRARIES ${SDL2_MINGW_LIBRARY} ${SDL2MAIN_LIBRARIES})
+			add_library(SDL2::SDL2 UNKNOWN IMPORTED)
+			if(SDL2_FRAMEWORK AND SDL2_FRAMEWORK_NAME)
+				# Handle the case that SDL2 is a framework and we were able to decompose it above.
+				set_target_properties(SDL2::SDL2 PROPERTIES
+					IMPORTED_LOCATION "${SDL2_FRAMEWORK}/${SDL2_FRAMEWORK_NAME}")
+			elseif(_sdl2_framework AND SDL2_LIBRARY MATCHES "/([^/]+)\\.framework$")
+				# Handle the case that SDL2 is a framework and SDL_LIBRARY is just the framework itself.
+
+				# This takes the basename of the framework, without the extension,
+				# and sets it (as a child of the framework) as the imported location for the target.
+				# This is the library symlink inside of the framework.
+				set_target_properties(SDL2::SDL2 PROPERTIES
+					IMPORTED_LOCATION "${SDL2_LIBRARY}/${CMAKE_MATCH_1}")
+			else()
+				# Handle non-frameworks (including non-Mac), as well as the case that we're given the library inside of the framework
+				set_target_properties(SDL2::SDL2 PROPERTIES
+					IMPORTED_LOCATION "${SDL2_LIBRARY}")
 			endif()
-			if(SDL2_MWINDOWS_LIBRARY)
-				set(SDL2MAIN_LIBRARIES ${SDL2_MWINDOWS_LIBRARY} ${SDL2MAIN_LIBRARIES})
+			set_target_properties(SDL2::SDL2
+				PROPERTIES
+				INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
+			)
+		endif()
+
+		if(TARGET SDL2::Cocoa)
+			set_property(TARGET SDL2::SDL2 APPEND
+				PROPERTY INTERFACE_LINK_LIBRARIES SDL2::Cocoa)
+		endif()
+
+		# Compute what to do with SDL2main
+		set(SDL2MAIN_LIBRARIES SDL2::SDL2)
+		add_library(SDL2::SDL2main INTERFACE IMPORTED)
+		if(SDL2_SDLMAIN_LIBRARY)
+			add_library(SDL2::SDL2main_real STATIC IMPORTED)
+			set_target_properties(SDL2::SDL2main_real
+				PROPERTIES
+				IMPORTED_LOCATION "${SDL2_SDLMAIN_LIBRARY}")
+			list(APPEND SDL2MAIN_LIBRARIES SDL2::SDL2main_real)
+		endif()
+		if(MINGW)
+			# MinGW requires some additional libraries to appear earlier in the link line.
+			if(SDL2PC_LIBRARIES)
+				# Use pkgconfig-suggested extra libraries if available.
+				list(REMOVE_ITEM SDL2PC_LIBRARIES SDL2main SDL2)
+				set(SDL2MAIN_LIBRARIES ${SDL2PC_LIBRARIES} ${SDL2MAIN_LIBRARIES})
+			else()
+				# fall back to extra libraries specified in pkg-config in
+				# an official binary distro of SDL2 for MinGW I downloaded
+				if(SDL2_MINGW_LIBRARY)
+					set(SDL2MAIN_LIBRARIES ${SDL2_MINGW_LIBRARY} ${SDL2MAIN_LIBRARIES})
+				endif()
+				if(SDL2_MWINDOWS_LIBRARY)
+					set(SDL2MAIN_LIBRARIES ${SDL2_MWINDOWS_LIBRARY} ${SDL2MAIN_LIBRARIES})
+				endif()
 			endif()
+			set_target_properties(SDL2::SDL2main
+				PROPERTIES
+				INTERFACE_COMPILE_DEFINITIONS "main=SDL_main")
 		endif()
 		set_target_properties(SDL2::SDL2main
 			PROPERTIES
-			INTERFACE_COMPILE_DEFINITIONS "main=SDL_main")
-	endif()
-	set_target_properties(SDL2::SDL2main
-		PROPERTIES
-		INTERFACE_LINK_LIBRARIES "${SDL2MAIN_LIBRARIES}")
+			INTERFACE_LINK_LIBRARIES "${SDL2MAIN_LIBRARIES}")
+	endif()
 	mark_as_advanced(SDL2_ROOT_DIR)
 endif()

@@ -175,5 +250,6 @@
 	SDL2_RUNTIME_LIBRARY
 	SDL2_INCLUDE_DIR
 	SDL2_SDLMAIN_LIBRARY
+	SDL2_COCOA_LIBRARY
 	SDL2_MINGW_LIBRARY
 	SDL2_MWINDOWS_LIBRARY)


cmake fix

cmake fix

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@8565 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -89,8 +89,8 @@
 if (NOT DEFINED CMAKE_CXX_STANDARD)
     set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "")
 endif()
-set(CMAKE_CXX_STANDARD_REQUIRED OFF)
-set(CMAKE_CXX_EXTENSIONS OFF)
+#set(CMAKE_CXX_STANDARD_REQUIRED OFF)
+#set(CMAKE_CXX_EXTENSIONS OFF)

 if (CMAKE_VERSION VERSION_LESS "3.1" AND CMAKE_COMPILER_IS_GNUCC)


output terser log messages when using Visual Studio IDE

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2156,7 +2156,11 @@
 		if (_targetScript)
 			cotire_set_cmd_to_prologue(_cmds)
 			list (APPEND _cmds -P "${COTIRE_CMAKE_MODULE_FILE}" "precompile" "${_targetScript}" "${_prefixFile}" "${_pchFile}" "${_hostFile}")
-			file (RELATIVE_PATH _pchFileRelPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
+			if (MSVC_IDE)
+				file (TO_NATIVE_PATH "${_pchFile}" _pchFileLogPath)
+			else()
+				file (RELATIVE_PATH _pchFileLogPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
+			endif()
 			if (COTIRE_DEBUG)
 				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
 			endif()
@@ -2167,7 +2171,7 @@
 				DEPENDS "${_prefixFile}"
 				IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
 				WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
-				COMMENT "Building ${_language} precompiled header ${_pchFileRelPath}"
+				COMMENT "Building ${_language} precompiled header ${_pchFileLogPath}"
 				VERBATIM)
 		endif()
 	endif()
@@ -2252,19 +2256,23 @@
 		message (STATUS "add_custom_command: OUTPUT ${_joinedFile} COMMAND ${_prefixCmd} DEPENDS ${_files}")
 	endif()
 	set_property (SOURCE "${_joinedFile}" PROPERTY GENERATED TRUE)
-	file (RELATIVE_PATH _joinedFileRelPath "${CMAKE_BINARY_DIR}" "${_joinedFile}")
+	if (MSVC_IDE)
+		file (TO_NATIVE_PATH "${_joinedFile}" _joinedFileLogPath)
+	else()
+		file (RELATIVE_PATH _joinedFileLogPath "${CMAKE_BINARY_DIR}" "${_joinedFile}")
+	endif()
 	get_filename_component(_joinedFileBaseName "${_joinedFile}" NAME_WE)
 	get_filename_component(_joinedFileExt "${_joinedFile}" EXT)
 	if (_language AND _joinedFileBaseName MATCHES "${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}$")
-		set (_comment "Generating ${_language} unity source ${_joinedFileRelPath}")
+		set (_comment "Generating ${_language} unity source ${_joinedFileLogPath}")
 	elseif (_language AND _joinedFileBaseName MATCHES "${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}$")
 		if (_joinedFileExt MATCHES "^\\.c")
-			set (_comment "Generating ${_language} prefix source ${_joinedFileRelPath}")
-		else()
-			set (_comment "Generating ${_language} prefix header ${_joinedFileRelPath}")
+			set (_comment "Generating ${_language} prefix source ${_joinedFileLogPath}")
+		else()
+			set (_comment "Generating ${_language} prefix header ${_joinedFileLogPath}")
 		endif()
 	else()
-		set (_comment "Generating ${_joinedFileRelPath}")
+		set (_comment "Generating ${_joinedFileLogPath}")
 	endif()
 	add_custom_command(
 		OUTPUT "${_joinedFile}"
@@ -2365,7 +2373,11 @@
 			# CMake 3.1.0 supports generator expressions in arguments to DEPENDS
 			set (_unityCmdDepends "${_targetConfigScript}")
 		endif()
-		file (RELATIVE_PATH _unityFileRelPath "${CMAKE_BINARY_DIR}" "${_unityFile}")
+		if (MSVC_IDE)
+			file (TO_NATIVE_PATH "${_unityFile}" _unityFileLogPath)
+		else()
+			file (RELATIVE_PATH _unityFileLogPath "${CMAKE_BINARY_DIR}" "${_unityFile}")
+		endif()
 		if (COTIRE_DEBUG)
 			message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_unityCmdDepends}")
 		endif()
@@ -2373,7 +2385,7 @@
 			OUTPUT "${_unityFile}"
 			COMMAND ${_unityCmd}
 			DEPENDS ${_unityCmdDepends}
-			COMMENT "Generating ${_language} unity source ${_unityFileRelPath}"
+			COMMENT "Generating ${_language} unity source ${_unityFileLogPath}"
 			WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 			VERBATIM)
 		list (APPEND ${_cmdsVar} COMMAND ${_unityCmd})
@@ -2391,12 +2403,16 @@
 	if (COTIRE_DEBUG)
 		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources}")
 	endif()
-	file (RELATIVE_PATH _prefixFileRelPath "${CMAKE_BINARY_DIR}" "${_prefixFile}")
+	if (MSVC_IDE)
+		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileLogPath)
+	else()
+		file (RELATIVE_PATH _prefixFileLogPath "${CMAKE_BINARY_DIR}" "${_prefixFile}")
+	endif()
 	get_filename_component(_prefixFileExt "${_prefixFile}" EXT)
 	if (_prefixFileExt MATCHES "^\\.c")
-		set (_comment "Generating ${_language} prefix source ${_prefixFileRelPath}")
+		set (_comment "Generating ${_language} prefix source ${_prefixFileLogPath}")
 	else()
-		set (_comment "Generating ${_language} prefix header ${_prefixFileRelPath}")
+		set (_comment "Generating ${_language} prefix header ${_prefixFileLogPath}")
 	endif()
 	# prevent pre-processing errors upon generating the prefix header when a target's generated include file does not yet exist
 	# we do not add a file-level dependency for the target's generated files though, because we only want to depend on their existence


BUG: Mantis-1260: forward PYTHON_INCLUDE_DIR and PYTHON_LIBRARY from SuperBuild to OTB

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -63,6 +63,11 @@
 if(OTB_WRAP_PYTHON OR OTB_WRAP_JAVA)
   ADD_SUPERBUILD_CMAKE_VAR(OTB SWIG_EXECUTABLE)
   ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OTB SWIG)
+endif()
+
+if(OTB_WRAP_PYTHON)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB PYTHON_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB PYTHON_LIBRARY)
 endif()

 if(OTB_USE_QT4)


BUG: fix escape character in External_qt4

--- SuperBuild/CMake/External_qt4.cmake
+++ SuperBuild/CMake/External_qt4.cmake
@@ -44,12 +44,13 @@
   file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX} QT4_INSTALL_PREFIX_NATIVE)
   file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX}/include QT4_INCLUDE_PREFIX_NATIVE)
   file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX}/lib QT4_LIB_PREFIX_NATIVE)
+  file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX}/include/freetype2 QT4_INCLUDE_FREETYPE_NATIVE)
 endif()

 #Common options for all cases
 set(QT4_SB_CONFIG
 "-prefix ${QT4_INSTALL_PREFIX_NATIVE} -L ${QT4_LIB_PREFIX_NATIVE} \
--I ${QT4_INCLUDE_PREFIX_NATIVE} -I ${QT4_INCLUDE_PREFIX_NATIVE}\freetype2 \
+-I ${QT4_INCLUDE_PREFIX_NATIVE} -I ${QT4_INCLUDE_FREETYPE_NATIVE} \
 -opensource -confirm-license -release -shared -nomake demos \
 -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script \
 -no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative \


pass gadgetron variables as cached (#308)

--- SuperBuild/External_Gadgetron.cmake
+++ SuperBuild/External_Gadgetron.cmake
@@ -90,22 +90,22 @@
     TMP_DIR ${${proj}_TMP_DIR}

     CMAKE_ARGS
-      -DBUILD_PYTHON_SUPPORT=${Gadgetron_BUILD_PYTHON_SUPPORT}
-      -DBUILD_MATLAB_SUPPORT=${Gadgetron_BUILD_MATLAB_SUPPORT}
-      -DCMAKE_PREFIX_PATH=${SUPERBUILD_INSTALL_DIR}
-      -DCMAKE_LIBRARY_PATH=${SUPERBUILD_INSTALL_DIR}/lib
-      -DCMAKE_INCLUDE_PATH=${SUPERBUILD_INSTALL_DIR}/include
-      -DCMAKE_INSTALL_PREFIX=${Gadgetron_Install_Dir}
-      -DBOOST_INCLUDEDIR=${BOOST_ROOT}/include/
-      -DBOOST_LIBRARYDIR=${BOOST_LIBRARY_DIR}
-      -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
-      -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS}
-      -DPYTHON_LIBRARY=${PYTHON_LIBRARIES}
-      -DGTEST_ROOT=${GTEST_ROOT}
+      -DBUILD_PYTHON_SUPPORT:BOOL=${Gadgetron_BUILD_PYTHON_SUPPORT}
+      -DBUILD_MATLAB_SUPPORT:BOOL=${Gadgetron_BUILD_MATLAB_SUPPORT}
+      -DCMAKE_PREFIX_PATH:PATH=${SUPERBUILD_INSTALL_DIR}
+      -DCMAKE_LIBRARY_PATH:PATH=${SUPERBUILD_INSTALL_DIR}/lib
+      -DCMAKE_INCLUDE_PATH:PATH=${SUPERBUILD_INSTALL_DIR}/include
+      -DCMAKE_INSTALL_PREFIX:PATH=${Gadgetron_Install_Dir}
+      -DBOOST_INCLUDEDIR:PATH=${BOOST_ROOT}/include/
+      -DBOOST_LIBRARYDIR:PATH=${BOOST_LIBRARY_DIR}
+      -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}
+      -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIRS}
+      -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARIES}
+      -DGTEST_ROOT:PATH=${GTEST_ROOT}
       ${HDF5_CMAKE_ARGS}
-      -DISMRMRD_DIR=${ISMRMRD_DIR}
+      -DISMRMRD_DIR:PATH=${ISMRMRD_DIR}
       -DUSE_MKL:BOOL=${Gadgetron_USE_MKL}
-      -DUSE_CUDA=${${proj}_USE_CUDA}
+      -DUSE_CUDA:BOOL=${${proj}_USE_CUDA}
       -DCBLAS_INCLUDE_DIR:PATH=${CBLAS_INCLUDE_DIR}
       -DCBLAS_LIBRARY:FILEPATH=${CBLAS_LIBRARY}
 	  INSTALL_DIR ${Gadgetron_Install_Dir}


cmake: Fix configure check for ntohll and htonll.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -57,14 +57,6 @@
     message(STATUS "WARNING: Without wspiapi.h, this build will only work on Windows XP and newer versions")
   endif (NOT HAVE_WSPIAPI_H)
   check_include_files("winsock2.h;ws2tcpip.h" HAVE_WS2TCPIP_H)
-  if (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)
-    set(HAVE_GETADDRINFO TRUE)
-    set(HAVE_GETHOSTBYNAME TRUE)
-    set(HAVE_NTOHLL TRUE)
-    set(HAVE_HTONLL TRUE)
-  endif (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)
-
-  set(HAVE_SELECT TRUE)
 endif (WIN32)

 set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
@@ -107,6 +99,8 @@
 check_function_exists(poll HAVE_POLL)
 check_function_exists(select HAVE_SELECT)
 check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+check_function_exists(ntohll HAVE_NTOHLL)
+check_function_exists(htonll HAVE_HTONLL)

 if (WIN32)
     check_function_exists(_strtoui64 HAVE__STRTOUI64)
@@ -115,6 +109,17 @@
     check_function_exists(_vsnprintf HAVE__VSNPRINTF)
     check_function_exists(_snprintf HAVE__SNPRINTF)
     check_function_exists(_snprintf_s HAVE__SNPRINTF_S)
+
+    if (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)
+        set(HAVE_GETADDRINFO TRUE)
+        set(HAVE_GETHOSTBYNAME TRUE)
+        if (MSVC)
+            set(HAVE_NTOHLL TRUE)
+            set(HAVE_HTONLL TRUE)
+        endif (MSVC)
+    endif (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)
+
+    set(HAVE_SELECT TRUE)
 endif (WIN32)

 if (UNIX)
@@ -122,7 +127,7 @@
         # libsocket (Solaris)
         check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
         if (HAVE_LIBSOCKET)
-            set(HAVE_GETADDRINFO 1)
+            set(HAVE_GETADDRINFO TRUE)
             set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
         endif (HAVE_LIBSOCKET)


BUG: Delete a line gone wrong

BUG: Delete a line gone wrong

--- DTIAtlasBuilder.cmake
+++ DTIAtlasBuilder.cmake
@@ -1,4 +1,4 @@
-DTIAtlasBuilder.cmakecmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8)
 CMAKE_POLICY(VERSION 2.8)

 #======================================================================================


Delete Settings.cmake

Delete Settings.cmake

--- Settings.cmake
+++ Settings.cmake
@@ -1,20 +0,0 @@
-# This file is part of libigl, a simple c++ geometry processing library.
-#
-# Copyright (C) 2015 Qingnan Zhou <qnzhou@gmail.com>
-#
-# This Source Code Form is subject to the terms of the Mozilla Public License
-# v. 2.0. If a copy of the MPL was not distributed with this file, You can
-# obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file is based on PyMesh's unit test setup.
-
-# Set TEST_DIR definition
-add_definitions(-DTEST_DIR="${PROJECT_SOURCE_DIR}")
-
-# Include current directory
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-
-# Add googletest googlemock support
-enable_testing()
-add_subdirectory(${PROJECT_SOURCE_DIR}/external/googletest/googlemock
-    ${CMAKE_CURRENT_BINARY_DIR}/gtest)


[fixed] include for usage in other packages

--- TPLsList.cmake
+++ TPLsList.cmake
@@ -1,4 +1,4 @@
-INCLUDE(src/BOTG_TPLS.cmake)
+INCLUDE(${BOTG_ROOT_DIR}/src/BOTG_TPLS.cmake)

 SET(tpl_def )
 FOREACH( tpl_loc ${BOTG_TPLS} )


Cosmetics: clean up

Cosmetics: clean up

--- cmake/Modules/FindFZAPI.cmake
+++ cmake/Modules/FindFZAPI.cmake
@@ -6,17 +6,13 @@
 # FZAPI_INCLUDE_DIRS - Directories containing the FZAPI include files.
 # FZAPI_LIBRARIES - Libraries needed to use FZAPI.

-#MESSAGE("Searching for Fotonic in: ${FZ_API_DIR}")
-
 if(FZ_API_DIR)
   # Find include dirs
-  #MESSAGE("Searching Fotonic includes: ${FZ_API_DIR}")
   find_path(FZAPI_INCLUDE_DIR fz_api.h
     PATHS "${FZ_API_DIR}" NO_DEFAULT_PATH
     DOC "Fotonic include directories")

   # Find libraries
-  #MESSAGE("Searching Fotonic libs: ${FZ_API_DIR}/Release")
   find_library(FZAPI_LIBS fotonic_fz_api
     HINTS "${FZ_API_DIR}/Release" NO_DEFAULT_PATH
     DOC "Fotonic libraries")
@@ -24,9 +20,6 @@
   set(FZ_API_DIR "default value" CACHE FILEPATH "directory of Fotonic API")
 endif()

-#MESSAGE("FZAPI_INCLUDE_DIR: ${FZAPI_INCLUDE_DIR}")
-#MESSAGE("FZAPI_LIBS: ${FZAPI_LIBS}")
-
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(FZAPI DEFAULT_MSG
                                   FZAPI_LIBS FZAPI_INCLUDE_DIR)


FindLibEv.cmake: change license to BSD with permission

--- cmake/Modules/FindLibEv.cmake
+++ cmake/Modules/FindLibEv.cmake
@@ -1,16 +1,3 @@
-# EOS - The CERN Disk Storage System
-# Copyright (C) 2015 CERN/Switzerland
-# This program is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free Software
-# Foundation, either version 3 of the License, or (at your option) any later
-# version. This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see http://www.gnu.org/licenses/.
-#
 # Try to find libev
 # Once done, this will define
 #


Fix building of ros1_bridge against newer roscpp. (#98)

The comment in the code mostly explains it, but because of changes
to upstream catkin/roscpp, we need to expand the types of things
we look at for linking.  With this patch, building against
roscpp kinetic 1.12.7 and 1.12.12 works.

Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@osrfoundation.org>

--- cmake/find_ros1_package.cmake
+++ cmake/find_ros1_package.cmake
@@ -29,6 +29,16 @@
   pkg_check_modules(ros1_${name} ${_required} ${name})
   if(ros1_${name}_FOUND)
     set(_libraries "${ros1_${name}_LIBRARIES}")
+    # Prior to catkin 0.7.7, dependent libraries in the pkg-config file were always generated
+    # in the form "-l:/absolute/path/to/library".  Because of the leading "-l", this made
+    # them show up in ${ros1_${name}_LIBRARIES}.  catkin 0.7.7 and later has changed this to
+    # just be an absolute path (of the form "/absolute/path/to/library"), so we now have to
+    # look through the LDFLAGS_OTHER and add those to the libraries that we need to link with.
+    foreach(_flag ${ros1_${name}_LDFLAGS_OTHER})
+      if(IS_ABSOLUTE ${_flag})
+        list(APPEND _libraries "${_flag}")
+      endif()
+    endforeach()
     set(_library_dirs "${ros1_${name}_LIBRARY_DIRS}")
     set(ros1_${name}_LIBRARIES "")
     set(ros1_${name}_LIBRARY_DIRS "")


bug in seqan cmake module

bug in seqan cmake module

--- cmake/modules/FindSeqAn.cmake
+++ cmake/modules/FindSeqAn.cmake
@@ -392,28 +392,28 @@
     message (${_COMPILE_OUTPUT})
   endif (NOT _RUN_OUTPUT)

-  string (REGEX REPLACE ".*SEQAN_VERSION_MAJOR:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_MAJOR ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_MINOR:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_MINOR ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_PATCH:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_PATCH ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_PRE_RELEASE:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_PRE_RELEASE ${_RUN_OUTPUT})
-
-  if (SEQAN_VERSION_PRE_RELEASE EQUAL 1)
-    set (_SEQAN_VERSION_DEVELOPMENT "TRUE")
-  else ()
-    set (_SEQAN_VERSION_DEVELOPMENT "FALSE")
-  endif ()
-
-  set (_SEQAN_VERSION_STRING "${_SEQAN_VERSION_MAJOR}.${_SEQAN_VERSION_MINOR}.${_SEQAN_VERSION_PATCH}")
-  if (_SEQAN_VERSION_DEVELOPMENT)
-    set (_SEQAN_VERSION_STRING "${_SEQAN_VERSION_STRING}_dev")
-  endif ()
-
-  # Cache results.
-  set (SEQAN_VERSION_MAJOR "${_SEQAN_VERSION_MAJOR}" CACHE INTERNAL "SeqAn major version.")
-  set (SEQAN_VERSION_MINOR "${_SEQAN_VERSION_MINOR}" CACHE INTERNAL "SeqAn minor version.")
-  set (SEQAN_VERSION_PATCH "${_SEQAN_VERSION_PATCH}" CACHE INTERNAL "SeqAn patch version.")
-  set (SEQAN_VERSION_PRE_RELEASE "${_SEQAN_VERSION_PRE_RELEASE}" CACHE INTERNAL "Whether version is a pre-release version version.")
-  set (SEQAN_VERSION_STRING "${_SEQAN_VERSION_STRING}" CACHE INTERNAL "SeqAn version string.")
+#  string (REGEX REPLACE ".*SEQAN_VERSION_MAJOR:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_MAJOR ${_RUN_OUTPUT})
+#  string (REGEX REPLACE ".*SEQAN_VERSION_MINOR:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_MINOR ${_RUN_OUTPUT})
+#  string (REGEX REPLACE ".*SEQAN_VERSION_PATCH:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_PATCH ${_RUN_OUTPUT})
+#  string (REGEX REPLACE ".*SEQAN_VERSION_PRE_RELEASE:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_PRE_RELEASE ${_RUN_OUTPUT})
+#
+#  if (SEQAN_VERSION_PRE_RELEASE EQUAL 1)
+#    set (_SEQAN_VERSION_DEVELOPMENT "TRUE")
+#  else ()
+#    set (_SEQAN_VERSION_DEVELOPMENT "FALSE")
+#  endif ()
+#
+#  set (_SEQAN_VERSION_STRING "${_SEQAN_VERSION_MAJOR}.${_SEQAN_VERSION_MINOR}.${_SEQAN_VERSION_PATCH}")
+#  if (_SEQAN_VERSION_DEVELOPMENT)
+#    set (_SEQAN_VERSION_STRING "${_SEQAN_VERSION_STRING}_dev")
+#  endif ()
+#
+#  # Cache results.
+#  set (SEQAN_VERSION_MAJOR "${_SEQAN_VERSION_MAJOR}" CACHE INTERNAL "SeqAn major version.")
+#  set (SEQAN_VERSION_MINOR "${_SEQAN_VERSION_MINOR}" CACHE INTERNAL "SeqAn minor version.")
+#  set (SEQAN_VERSION_PATCH "${_SEQAN_VERSION_PATCH}" CACHE INTERNAL "SeqAn patch version.")
+#  set (SEQAN_VERSION_PRE_RELEASE "${_SEQAN_VERSION_PRE_RELEASE}" CACHE INTERNAL "Whether version is a pre-release version version.")
+#  set (SEQAN_VERSION_STRING "${_SEQAN_VERSION_STRING}" CACHE INTERNAL "SeqAn version string.")

   message (STATUS "  Determined version is ${SEQAN_VERSION_STRING}")
 endif (NOT DEFINED SEQAN_VERSION_STRING)
@@ -442,9 +442,9 @@
   message("  SEQAN_LIBRARIES            ${SEQAN_LIBRARIES}")
   message("  SEQAN_DEFINITIONS          ${SEQAN_DEFINITIONS}")
   message("  SEQAN_CXX_FLAGS            ${SEQAN_CXX_FLAGS}")
-  message("")
-  message("  SEQAN_VERSION_STRING       ${SEQAN_VERSION_STRING}")
-  message("  SEQAN_VERSION_MAJOR        ${SEQAN_VERSION_MAJOR}")
-  message("  SEQAN_VERSION_MINORG       ${SEQAN_VERSION_MINOR}")
-  message("  SEQAN_VERSION_PATCH        ${SEQAN_VERSION_PATCH}")
-endif ()
+#  message("")
+#  message("  SEQAN_VERSION_STRING       ${SEQAN_VERSION_STRING}")
+#  message("  SEQAN_VERSION_MAJOR        ${SEQAN_VERSION_MAJOR}")
+#  message("  SEQAN_VERSION_MINORG       ${SEQAN_VERSION_MINOR}")
+#  message("  SEQAN_VERSION_PATCH        ${SEQAN_VERSION_PATCH}")
+endif ()


cmake/modules/FindVIGRA.cmake: Find and export VIGRA library dir.

--- cmake/modules/FindVIGRA.cmake
+++ cmake/modules/FindVIGRA.cmake
@@ -21,6 +21,10 @@
 # configVersion.hxx only present, after build of Vigra
 FIND_PATH(VIGRA_INCLUDE_DIR vigra/configVersion.hxx PATHS ${VIGRA_ROOT}/include ENV CPLUS_INCLUDE_PATH)

+if (NOT "${VIGRA_ROOT}" STREQUAL "")
+    set(VIGRA_LIBRARY_DIR ${VIGRA_ROOT}/lib)
+endif()
+
 EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c
                             "import vigra.vigranumpycore; print vigra.vigranumpycore.__file__"
                             RESULT_VARIABLE VIGRA_VIGRANUMPYCORE_LIBRARY_NOT_FOUND
@@ -32,6 +36,7 @@

     MESSAGE(STATUS "Found VIGRA")
     MESSAGE(STATUS "  > includes:                 ${VIGRA_INCLUDE_DIR}")
+    MESSAGE(STATUS "  > libraries:                ${VIGRA_LIBRARY_DIR}")
     MESSAGE(STATUS "  > vigranumpy site-package:  ${VIGRANUMPY_SITEPACKAGE_DIR}")
     MESSAGE(STATUS "  > vigranumpycore library:   ${VIGRA_VIGRANUMPYCORE_LIBRARY}")
 ENDIF()
@@ -42,6 +47,6 @@
 # handle the QUIETLY and REQUIRED arguments and set VIGRA_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRA DEFAULT_MSG VIGRA_ROOT VIGRA_INCLUDE_DIR VIGRANUMPY_SITEPACKAGE_DIR VIGRA_VIGRANUMPYCORE_LIBRARY )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRA DEFAULT_MSG VIGRA_ROOT VIGRA_INCLUDE_DIR VIGRA_LIBRARY_DIR VIGRANUMPY_SITEPACKAGE_DIR VIGRA_VIGRANUMPYCORE_LIBRARY )

-MARK_AS_ADVANCED(VIGRA_ROOT VIGRA_INCLUDE_DIR VIGRANUMPY_SITEPACKAGE_DIR VIGRA_VIGRANUMPYCORE_LIBRARY)
+MARK_AS_ADVANCED(VIGRA_ROOT VIGRA_INCLUDE_DIR VIGRA_LIBRARY_DIR VIGRANUMPY_SITEPACKAGE_DIR VIGRA_VIGRANUMPYCORE_LIBRARY)


Fix Visual C++ Version when generating binary distribution on Windows

--- cmake/modules/RootCPack.cmake
+++ cmake/modules/RootCPack.cmake
@@ -49,7 +49,13 @@

 #---Binary package setup-----------------------------------------------------------------------------
 if(MSVC)
-  math(EXPR VS_VERSION "${VC_MAJOR} - 6")
+  if (MSVC_VERSION LESS 1900)
+    math(EXPR VS_VERSION "${VC_MAJOR} - 6")
+  elseif(MSVC_VERSION LESS 1910)
+    math(EXPR VS_VERSION "${VC_MAJOR} - 5")
+  elseif(MSVC_VERSION LESS 1919)
+    math(EXPR VS_VERSION "${VC_MAJOR} - 4")
+  endif()
   set(COMPILER_NAME_VERSION ".vc${VS_VERSION}")
 else()
   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")


Replace ENABLE_cxx logic with CMAKE_CXX_COMPILER_WORKS logic to keep meaning
of ENABLE_cxx "pure", i.e., enabling the C++ bindings and everything that
depends upon them, but not device drivers that happen to be written in C++.

svn path=/trunk/; revision=10199

--- cmake/modules/wxwidgets.cmake
+++ cmake/modules/wxwidgets.cmake
@@ -107,6 +107,13 @@
   option(ENABLE_wxwidgets "Enable wxwidgets bindings" ON)
 endif(DEFAULT_NO_BINDINGS)

+if(ENABLE_wxwidgets AND NOT CMAKE_CXX_COMPILER_WORKS)
+  message(STATUS "WARNING: no working C++ compiler so "
+    "setting ENABLE_wxwidgets to OFF."
+    )
+  set(ENABLE_wxwidgets OFF CACHE BOOL "Enable wxwidgets bindings" FORCE)
+endif(ENABLE_wxwidgets AND NOT CMAKE_CXX_COMPILER_WORKS)
+
 if(ENABLE_wxwidgets AND NOT PLD_wxwidgets)
   message(STATUS
     "WARNING: PLD_wxwidgets is OFF so "
@@ -115,13 +122,6 @@
   set(ENABLE_wxwidgets OFF CACHE BOOL "Enable wxwidgets bindings" FORCE)
 endif(ENABLE_wxwidgets AND NOT PLD_wxwidgets)

-if(ENABLE_wxwidgets AND NOT ENABLE_cxx)
-  message(STATUS
-    "WARNING: ENABLE_cxx is OFF so "
-    "setting ENABLE_wxwidgets to OFF."
-    )
-  set(ENABLE_wxwidgets OFF CACHE BOOL "Enable wxwidgets bindings" FORCE)
-endif(ENABLE_wxwidgets AND NOT ENABLE_cxx)
 if(ENABLE_wxwidgets)
   set(wxwidgets_true "")
 else(ENABLE_wxwidgets)


Removed /OPT:REF /OPT:ICF from win32 CXXFLAGS. These switches are unneeded and potentially problematic. See http://msdn.microsoft.com/en-us/library/bxwfs976.aspx

--- cmake_modules/LPSCommon.cmake
+++ cmake_modules/LPSCommon.cmake
@@ -214,7 +214,7 @@
        set(LPS_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /MACHINE:X64" CACHE STRING "Linker Flags for Executables")
     elseif(WIN64INTEL)
        set(LPS_CXX_FLAGS "/D_USRDLL ${MP} /GR /nologo /DWIN32 /D_WINDOWS /W1 /wd2651 /EHsc ${OPTIMIZATION} /Qprof-gen:srcpos /D_HDF5USEDLL_" CACHE STRING "C++ Compiler Flags")
-       set(LPS_SHARED_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /NXCOMPAT /MACHINE:X64" CACHE STRING "Linker Flags")
+       set(LPS_SHARED_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE  /NXCOMPAT /MACHINE:X64" CACHE STRING "Linker Flags")
     elseif(LINUX64INTEL)
         if(ENABLE_COVERAGE)
             if(INTELWARN)
@@ -318,9 +318,9 @@
                 STRING "Flags used by the C++ compiler for Release-contracts builds" )
         endif()

-        set(CMAKE_EXE_LINKER_FLAGS_RELEASE-CONTRACTS "${LPS_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD  /OPT:REF /OPT:ICF /NXCOMPAT"  CACHE
+        set(CMAKE_EXE_LINKER_FLAGS_RELEASE-CONTRACTS "${LPS_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD  /NXCOMPAT"  CACHE
             STRING "Flags used by the linker for executables for Release-contracts builds" )
-        set(CMAKE_SHARED_LINKER_FLAGS_RELEASE-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD /OPT:REF /OPT:ICF /NXCOMPAT " CACHE
+        set(CMAKE_SHARED_LINKER_FLAGS_RELEASE-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD  /NXCOMPAT " CACHE
             STRING "Flags used by the linker for shared libraries for Release-contracts builds" )
     else()
         set(CMAKE_CXX_FLAGS_RELEASE-CONTRACTS "${LPS_CXX_FLAGS} ${OPTIMIZATION}" CACHE
@@ -350,9 +350,9 @@
                 STRING "Flags used by the C++ compiler for Release-no-contracts builds" )
       endif()

-    set(CMAKE_EXE_LINKER_FLAGS_RELEASE-NO-CONTRACTS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD  /OPT:REF /OPT:ICF /NXCOMPAT" CACHE
+    set(CMAKE_EXE_LINKER_FLAGS_RELEASE-NO-CONTRACTS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD  /NXCOMPAT" CACHE
         STRING "Flags used by the linker for executables for Release-no-contracts builds" )
-    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE-NO-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD /OPT:REF /OPT:ICF /NXCOMPAT" CACHE
+    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE-NO-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD  /NXCOMPAT" CACHE
         STRING "Flags used by the linker for shared libraries for Release-no-contracts builds" )
     else()
         set(CMAKE_CXX_FLAGS_RELEASE-NO-CONTRACTS "${LPS_CXX_FLAGS} ${OPTIMIZATION} -DNDEBUG" CACHE
@@ -383,9 +383,9 @@
                 STRING "RelWithDebInfo-contracts compiler flags" )
         endif()

-        set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-CONTRACTS "${LPS_EXE_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD  /OPT:REF /OPT:ICF /NXCOMPAT"  CACHE
+        set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-CONTRACTS "${LPS_EXE_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD  /NXCOMPAT"  CACHE
             STRING "RelWithDebInfo-contracts linker flags - executables" )
-        set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD /OPT:REF /OPT:ICF /NXCOMPAT " CACHE
+        set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD  /NXCOMPAT " CACHE
             STRING "RelWithDebInfo-contracts linker flags - shared libs" )
     else()
         set(CMAKE_CXX_FLAGS_RELWITHDEBINFO-CONTRACTS "${LPS_CXX_FLAGS} ${OPTIMIZATION}" CACHE
@@ -415,9 +415,9 @@
                 STRING "RelWithDebInfo-no-contracts compiler flags" )
       endif()

-    set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-NO-CONTRACTS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD  /OPT:REF /OPT:ICF /NXCOMPAT" CACHE
+    set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-NO-CONTRACTS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD  /NXCOMPAT" CACHE
         STRING "RelWithDebInfo-no-contracts linker flags - executables" )
-    set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-NO-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD /OPT:REF /OPT:ICF /NXCOMPAT" CACHE
+    set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-NO-CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD  /NXCOMPAT" CACHE
         STRING "RelWithDebInfo-no-contracts linker flags - shared libs" )
     else()
         set(CMAKE_CXX_FLAGS_RELWITHDEBINFO-NO-CONTRACTS "${LPS_CXX_FLAGS} ${OPTIMIZATION} -DNDEBUG" CACHE


fix for craype config skipping SSE4.2 code generation

--- common/cmake/crayprgenv.cmake
+++ common/cmake/crayprgenv.cmake
@@ -15,7 +15,11 @@
 ## ======================================================================== ##

 SET(FLAGS_SSE2      "-target-cpu=xeon")
-SET(FLAGS_SSE42     "ERROR_ISA_NOT_SUPPORTED")
+IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+  SET(FLAGS_SSE42   "-target-cpu=xeon -msse4.2")
+ELSE()#Intel
+  SET(FLAGS_SSE42   "-target-cpu=xeon -xsse4.2 -fPIC")
+ENDIF()
 SET(FLAGS_AVX       "-target-cpu=sandybridge")
 SET(FLAGS_AVX2      "-target-cpu=haswell")
 SET(FLAGS_AVX512KNL "-target-cpu=mic-knl")


Bullet 2.79

Bullet 2.79

--- CMake/ExternalBullet.cmake
+++ CMake/ExternalBullet.cmake
@@ -23,8 +23,8 @@

     DOWNLOAD_DIR ${POLYCODE_DEPS_DOWNLOAD_DIR}

-    URL http://bullet.googlecode.com/files/bullet-2.78.zip
-    URL_MD5 99d4070864c9f73521481ba9cda25038
+    URL http://bullet.googlecode.com/files/bullet-2.79-rev2440.zip
+    URL_MD5 a58dbed79022e6687909ebb3a3553673

     INSTALL_DIR ${POLYCODE_DEPS_MODULES_PREFIX}
     CMAKE_ARGS ${bullet_CMAKE_ARGS}


ENH: use OTB install path for internal openjpeg library

--- CMake/ImportJPEG2000.cmake
+++ CMake/ImportJPEG2000.cmake
@@ -41,7 +41,7 @@

  SET(OPENJPEG_NAMESPACE "OTBOPENJPEG")
  SET(OPJ_MANGLE_PREFIX "otbopenjpeg")
-
+ SET(OPENJPEG_INSTALL_LIB_DIR ${OTB_INSTALL_LIB_DIR_CM24})

   ADD_DEFINITIONS(-DOTB_COMPILE_JPEG2000 -DUSE_OPJ_DEPRECATED)
   IF(NOT BUILD_SHARED_LIBS)


ENH: Make C++11 try_compile result related to CMAKE_CXX_FLAGS

If the CMAKE_CXX_FLAGS change then the C++11 try compile will be
re-done. This is done by computing the MD5 checksum of the flags, and
using that as part of the variable name in the cache.

Also changing variables to lower case, and removing extra CMAKE_ save
variable in function.

Change-Id: I61bb662e8bb1550f9db1960d872d064053ecc9d8

--- CMake/sitkCheckCXX11.cmake
+++ CMake/sitkCheckCXX11.cmake
@@ -16,27 +16,31 @@
 # Function to do wrap try compiles on the aggregate cxx test file1
 #
 function(sitkCXX11Test VARIABLE)
-  if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+  # use the hash of the depended cxx flags in the variable name to
+  # cache the results.
+  string(MD5 cmake_cxx_flags_hash "${CMAKE_CXX_FLAGS}")
+  set(cache_var "${VARIABLE}_${hash_cmake_cxx_flags_hash}")
+  if("${cache_var}" MATCHES "^${cache_var}$")
     message(STATUS "Performing Test ${VARIABLE}")
-    set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
-    set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D${VARIABLE}")
+    set(requred_definitions "${CMAKE_REQUIRED_DEFINITIONS} -D${VARIABLE}")
     try_compile(${VARIABLE}
       ${SimpleITK_BINARY_DIR}/CMakeTmp
       ${SimpleITK_SOURCE_DIR}/CMake/sitk_check_cxx11.cxx
       CMAKE_FLAGS
-      -DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_DEFINITIONS}
-      OUTPUT_VARIABLE OUTPUT)
-    set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})
+      -DCOMPILE_DEFINITIONS:STRING=${requred_definitions}
+      OUTPUT_VARIABLE output)
     if(${VARIABLE})
-      set(${VARIABLE} 1 CACHE INTERNAL "SimpleITK test ${FUNCTION}")
+      set(${cache_var} 1 CACHE INTERNAL "SimpleITK test ${FUNCTION}")
       message(STATUS "Performing Test ${VARIABLE} - Success")
     else()
       message(STATUS "Performing Test ${VARIABLE} - Failed")
-      set(${VARIABLE} 0 CACHE INTERNAL "SimpleITKTest ${FUNCTION}")
+      set(${cache_var} 0 CACHE INTERNAL "SimpleITKTest ${FUNCTION}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
                  "Performing Test ${VARIABLE} failed with the following output:\n"
                  "${OUTPUT}\n")
     endif()
+  else()
+    set("${VARIABLE}" "${cache_var}")
   endif()
 endfunction()


Update DCMQI to official v1.2.4

Update DCMQI to official v1.2.4

--- CMakeExternals/DCMQI.cmake
+++ CMakeExternals/DCMQI.cmake
@@ -27,7 +27,7 @@
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       GIT_REPOSITORY https://github.com/QIICR/dcmqi.git
-      GIT_TAG 83f498e9
+      GIT_TAG v1.2.4
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


cmake: added GSL_USES_CBLAS to overlinking with gslcblas

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -25,22 +25,31 @@
 pkg_check_modules(PC_GSL gsl)
 find_path(GSL_INCLUDE_DIR gsl/gsl_linalg.h HINTS ${PC_GSL_INCLUDE_DIRS})
 find_library(GSL_LIBRARY NAMES gsl HINTS ${PC_GSL_LIBRARY_DIRS} )
-find_library(GSLCBLAS_LIBRARY NAMES gslcblas cblas HINTS ${PC_GSL_LIBRARY_DIRS} )

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set GSL_FOUND to TRUE
 # if all listed variables are TRUE
-find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR GSLCBLAS_LIBRARY)
+find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR)
+
+option(GSL_USES_CBLAS "If GSL needs to be linked against cblas" OFF)
+if (GSL_USES_CBLAS)
+  find_library(GSLCBLAS_LIBRARY NAMES gslcblas cblas HINTS ${PC_GSL_LIBRARY_DIRS} )
+  find_package_handle_standard_args(GSL DEFAULT_MSG GSLCBLAS_LIBRARY)
+  if (GSL_FOUND)
+    include(CheckLibraryExists)
+    check_library_exists("${GSLCBLAS_LIBRARY};${MATH_LIBRARIES}" cblas_dsyrk "" FOUND_DSYRK)
+    if(NOT FOUND_DSYRK)
+      message(FATAL_ERROR "Could not find cblas_dsyrk in ${GSLCBLAS_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of libcblas in GSLCBLAS_LIBRARY by hand (i.e. -DGSLCBLAS_LIBRARY='/path/to/libcblas.so;/path/to/libm.so')! If your gsl was build against an different version of cblas, specify it in GSLCBLAS_LIBRARY")
+    endif(NOT FOUND_DSYRK)
+  endif(GSL_FOUND)
+else()
+  set(GSLCBLAS_LIBRARY)
+endif (GSL_USES_CBLAS)

 set(GSL_LIBRARIES "${GSL_LIBRARY};${GSLCBLAS_LIBRARY}")
 set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )

 if (GSL_FOUND)
-  include(CheckLibraryExists)
-  check_library_exists("${GSLCBLAS_LIBRARY};${MATH_LIBRARIES}" cblas_dsyrk "" FOUND_DSYRK)
-  if(NOT FOUND_DSYRK)
-    message(FATAL_ERROR "Could not find cblas_dsyrk in ${GSLCBLAS_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of libcblas in GSLCBLAS_LIBRARY by hand (i.e. -DGSLCBLAS_LIBRARY='/path/to/libcblas.so;/path/to/libm.so')! If your gsl was build against an different version of cblas, specify it in GSLCBLAS_LIBRARY")
-  endif(NOT FOUND_DSYRK)
   #adding MATH_LIBRARIES here to allow static libs, this does not harm us as we are anyway using it
   check_library_exists("${GSL_LIBRARIES};${MATH_LIBRARIES}" gsl_linalg_QR_decomp "" FOUND_QR_DECOMP)
   if(NOT FOUND_QR_DECOMP)


Increment version to 0.9.1

Increment version to 0.9.1

--- CMakeModules/Version.cmake
+++ CMakeModules/Version.cmake
@@ -9,7 +9,7 @@

 SET(FG_VERSION_MAJOR "0")
 SET(FG_VERSION_MINOR "9")
-SET(FG_VERSION_PATCH "0")
+SET(FG_VERSION_PATCH "1")

 SET(FG_VERSION "${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}")
 SET(FG_API_VERSION_CURRENT ${FG_VERSION_MAJOR}${FG_VERSION_MINOR})


iStop emitting corrupted cython code

iStop emitting corrupted cython code

--- lib/OpenCogAtomTypes.cmake
+++ lib/OpenCogAtomTypes.cmake
@@ -173,8 +173,9 @@
         # identifier as the Python Atom object.
         IF (NOT TYPE_NAME STREQUAL "Atom")
             IF (ISVALUE STREQUAL "VALUE")
-                FILE(APPEND "${PYTHON_FILE}" "def ${TYPE_NAME}(node_name, tv=None):\n")
-                FILE(APPEND "${PYTHON_FILE}" "    return atomspace.add_node(types.${TYPE_NAME}, node_name, tv)\n")
+                # XXX FIXME -- invent something for python
+                # FILE(APPEND "${PYTHON_FILE}" "def ${TYPE_NAME}(node_name, tv=None):\n")
+                # FILE(APPEND "${PYTHON_FILE}" "    return atomspace.add_node(types.${TYPE_NAME}, node_name, tv)\n")
             ENDIF (ISVALUE STREQUAL "VALUE")
             IF (ISNODE STREQUAL "NODE")
                 FILE(APPEND "${PYTHON_FILE}" "def ${TYPE_NAME}(node_name, tv=None):\n")


build BUGFIX remove non-existing header from lnc2 cmake module

--- FindLibNETCONF2.cmake
+++ FindLibNETCONF2.cmake
@@ -45,7 +45,6 @@
     NAMES
       nc_client.h
       nc_server.h
-      nc_transapi.h
     PATHS
       /usr/include
       /usr/local/include


remove the warning issue test=develop (#20718)

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -167,6 +167,8 @@
                 -Wno-error=cast-function-type # Warning in boost gcc 8.2
                 -Wno-error=parentheses # Warning in boost gcc 8.2
                 -Wno-error=catch-value # Warning in boost gcc 8.2
+                -Wno-error=nonnull-compare # Warning in boost gcc 8.2
+                -Wno-error=address # Warning in boost gcc 8.2
                 -Wno-ignored-qualifiers # Warning in boost gcc 8.2
                 )
     endif()


Fix building Halide when using Ninja as the CMake generator.

Previously the Ninja file was generated was invalid. Invoking ninja would give
an error message like this.

ninja: error: 'test/scratch_acquire_release/acquire_release.a', needed by 'bin/exec_test_acquire_release_aottest', missing and no known rule to make it

The issue was that target names for the generated header file and library were
sometimes incorrectly in the test directory instead of the scratch directory in
the ninja file rules.

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -75,7 +75,7 @@
   # Add a custom target to invoke the GENERATOR_TARGET and output the Halide
   # generated library
   if (WIN32)
-    add_custom_command(OUTPUT "${FILTER_LIB}" "${FILTER_HDR}"
+    add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
       DEPENDS "${args_GENERATOR_TARGET}"
       COMMAND "${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${generator_exec}" ${invoke_args}
       COMMAND "lib.exe" "/OUT:${FILTER_LIB}" "${SCRATCH_DIR}\\${args_GENERATED_FUNCTION}.o"
@@ -83,7 +83,7 @@
       )
   elseif(XCODE)
     if (NOT target_is_pnacl)
-      add_custom_command(OUTPUT "${FILTER_LIB}" "${FILTER_HDR}"
+      add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
         DEPENDS "${args_GENERATOR_TARGET}"

         # The generator executable will be placed in a configuration specific
@@ -98,7 +98,7 @@
         )
     else()
       # For pnacl targets, there is no libtool step
-      add_custom_command(OUTPUT "${FILTER_LIB}" "${FILTER_HDR}"
+      add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
         DEPENDS "${args_GENERATOR_TARGET}"
         COMMAND "${CMAKE_BINARY_DIR}/bin/$(CONFIGURATION)/${generator_exec}" ${invoke_args}
         WORKING_DIRECTORY "${SCRATCH_DIR}"
@@ -107,7 +107,8 @@

   else()
     if (NOT target_is_pnacl)
-      add_custom_command(OUTPUT "${FILTER_LIB}" "${FILTER_HDR}"
+      message(STATUS "The filter lib is ${FILTER_LIB}")
+      add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
         DEPENDS "${args_GENERATOR_TARGET}"
         COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}
         # Create an archive using ar (or similar)
@@ -116,7 +117,7 @@
         )
     else()
       # No archive step for pnacl targets
-      add_custom_command(OUTPUT "${FILTER_LIB}" "${FILTER_HDR}"
+      add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
         DEPENDS "${args_GENERATOR_TARGET}"
         COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}
         WORKING_DIRECTORY "${SCRATCH_DIR}"
@@ -129,7 +130,7 @@
   #  "exec_generator_"
   set(exec_generator_target "exec_generator_${args_GENERATOR_NAME}_${args_GENERATED_FUNCTION}")
   add_custom_target(${exec_generator_target}
-                    DEPENDS "${FILTER_LIB}" "${FILTER_HDR}"
+                    DEPENDS "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
                     )

   # Place the target in a special folder in IDEs


Changed gtest include directory to be reusable.

--- cmake/gtest.cmake
+++ cmake/gtest.cmake
@@ -1,5 +1,5 @@

 add_subdirectory("third_party/gtest-1.7.0" "gtest")
-include_directories("${gtest_SOURCE_DIR}/include")
+target_include_directories("gtest" PUBLIC "${gtest_SOURCE_DIR}/include")
 set_property(TARGET "gtest" PROPERTY FOLDER "gtest")
 set_property(TARGET "gtest_main" PROPERTY FOLDER "gtest")


Fix handling of ifdef/ifndef

Fix handling of ifdef/ifndef

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -125,7 +125,7 @@
     if (NOT "${line_match}" STREQUAL "")
       #message(STATUS "${CMAKE_MATCH_1} first: ${CMAKE_MATCH_2}")
       set (ElseSeen 0)
-      if (DEFINED ${CMAKE_MATCH_2})
+      if (${CMAKE_MATCH_2})
         if (${CMAKE_MATCH_1} STREQUAL "ifdef")
           #message (STATUS "condition is true")
           set (IfElse 1)


Build Google Benchmark in Release mode

Build Google Benchmark in Release mode

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -81,7 +81,7 @@
   if(NOT DEPENDENCIES_FORCE_DOWNLOAD)
     find_package(benchmark QUIET)
   endif()
-
+
   if(NOT benchmark_FOUND)
     message(STATUS "Google Benchmark not found. Downloading and building Google Benchmark.")
     # Download, build and install googlebenchmark library
@@ -90,7 +90,7 @@
              GIT_REPOSITORY https://github.com/google/benchmark.git
              GIT_TAG        master
              INSTALL_DIR    ${GOOGLEBENCHMARK_ROOT}
-             CMAKE_ARGS     -DBENCHMARK_ENABLE_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
+             CMAKE_ARGS     -DCMAKE_BUILD_TYPE=RELEASE -DBENCHMARK_ENABLE_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
              LOG_DOWNLOAD   TRUE
              LOG_CONFIGURE  TRUE
              LOG_BUILD      TRUE


BLAS option: Atlas->ATLAS, and added an else() message guard.

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -10,12 +10,12 @@

 # ---[ BLAS
 set(BLAS "Eigen" CACHE STRING "Selected BLAS library")
-set_property(CACHE BLAS PROPERTY STRINGS "Atlas;OpenBLAS;MKL")
+set_property(CACHE BLAS PROPERTY STRINGS "Eigen;ATLAS;OpenBLAS;MKL")

 if(BLAS STREQUAL "Eigen")
   # Eigen is header-only and we do not have any dependent libraries
   add_definitions(-DCAFFE2_USE_EIGEN_FOR_BLAS)
-elseif(BLAS STREQUAL "Atlas")
+elseif(BLAS STREQUAL "ATLAS")
   find_package(Atlas REQUIRED)
   include_directories(SYSTEM ${ATLAS_INCLUDE_DIRS})
   list(APPEND Caffe2_LINKER_LIBS ${ATLAS_LIBRARIES})
@@ -31,6 +31,8 @@
   list(APPEND Caffe2_LINKER_LIBS ${MKL_LIBRARIES})
   list(APPEND Caffe2_LINKER_LIBS cblas)
   add_definitions(-DCAFFE2_USE_MKL)
+else()
+  message(FATAL_ERROR "Unrecognized blas option:" ${BLAS})
 endif()

 # ---[ Google-glog


fix ei_add_property

fix ei_add_property

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -1,7 +1,7 @@

 macro(ei_add_property prop value)
   get_property(previous GLOBAL PROPERTY ${prop})
-  if (NOT ${previous} OR ${previous} STREQUAL "")
+  if ((NOT previous) OR (previous STREQUAL ""))
     set_property(GLOBAL PROPERTY ${prop} "${value}")
   else()
     set_property(GLOBAL PROPERTY ${prop} "${previous} ${value}")


Fix bug 542: fix detection of compiler version on systems without the head command.

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -322,13 +322,21 @@
     endif()
   else()
     # on all other system we rely on ${CMAKE_CXX_COMPILER}
-    # supporting a "--version" flag
-    execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
-                    COMMAND head -n 1
-                    OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+    # supporting a "--version" flag

-    ei_get_compilerver_from_cxx_version_string(${eigen_cxx_compiler_version_string} CNAME CVER)
+    # check whether the head command exists
+    find_program(HEAD_EXE head NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_CMAKE_SYSTEM_PATH)
+    if(HEAD_EXE)
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+                      COMMAND head -n 1
+                      OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+    else()
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+                      OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+      string(REGEX REPLACE "[\n\r].*"  ""  eigen_cxx_compiler_version_string  ${eigen_cxx_compiler_version_string})
+    endif()

+    ei_get_compilerver_from_cxx_version_string("${eigen_cxx_compiler_version_string}" CNAME CVER)
     set(${VAR} "${CNAME}-${CVER}")
   endif()
 endmacro(ei_get_compilerver)


Added the /bigobj flag in order to enable compilation with MSVC when EIGEN_SPLIT_LARGE_TESTS is not set.

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -27,6 +27,10 @@
   endif(EIGEN_NO_ASSERTION_CHECKING)

   ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_FUNC=${testname}")
+
+  if(MSVC AND NOT EIGEN_SPLIT_LARGE_TESTS)
+    ei_add_target_property(${targetname} COMPILE_FLAGS "/bigobj")
+  endif()

   # let the user pass flags.
   if(${ARGC} GREATER 2)
@@ -51,7 +55,7 @@
       # notice: no double quotes around ${libs_to_link} here. It may be a list.
       target_link_libraries(${targetname} ${libs_to_link})
     endif()
-  endif()
+  endif()

   if(WIN32)
     if(CYGWIN)


Fix FindPrimitiv.cmake.

Fix FindPrimitiv.cmake.

--- cmake/FindPrimitiv.cmake
+++ cmake/FindPrimitiv.cmake
@@ -5,6 +5,10 @@
 #   PRIMITIV_FOUND - Whether or not the system has the primitiv library.
 #   PRIMITIV_INCLUDE_DIR - primitiv include directory.
 #   PRIMITIV_LIBRARIES - primitiv library files.
+#
+#   PRIMITIV_C_FOUND - Whether or not the system has the primitiv C API.
+#   PRIMITIV_C_INCLUDE_DIR - primitiv C API include directory.
+#   PRIMITIV_C_LIBRARIES - primitiv C API library files.
 #
 # This script reads hints about search locations from the following
 # environment variables:
@@ -14,11 +18,16 @@
 #
 # Author: Yusuke Oda (odashi) <yus.takara@gmail.com>
 # Created: 2017/08/13
-# Updated: 2017/08/13
+# Updated: 2017/12/15
 #
-# This script is provided as a part of the primitiv library.
+# This script is provided as a part of the primitiv core library.
 # Redistributing and using this script is allowed according to
 # the Apache License Version 2.
+
+
+#
+# Finding primitiv core library
+#

 find_path(PRIMITIV_INCLUDE_DIR NAMES primitiv/primitiv.h
   HINTS
@@ -45,3 +54,35 @@
   message(STATUS "Primitiv is not installed.")
   set(PRIMITIV_FOUND OFF)
 endif()
+
+
+#
+# Finding primitiv C API
+#
+
+find_path(PRIMITIV_C_INCLUDE_DIR NAMES primitiv/c/api.h
+  HINTS
+  ENV PRIMITIV_ROOT
+  ENV PRIMITIV_ROOT_DIR
+  PATHS
+  ${CMAKE_INSTALL_PREFIX}/include
+)
+
+find_library(PRIMITIV_C_LIBRARIES NAMES primitiv_c
+  HINTS
+  ENV PRIMITIV_ROOT
+  ENV PRIMITIV_ROOT_DIR
+  PATHS
+  ${CMAKE_INSTALL_PREFIX}/lib
+)
+
+if (PRIMITIV_C_INCLUDE_DIR AND PRIMITIV_C_LIBRARIES)
+  message("-- Found Primitiv C API: " ${PRIMITIV_C_LIBRARIES})
+  #message("-- Primitiv C API include dir: " ${PRIMITIV_C_INCLUDE_DIR})
+  #message("-- Primitiv C API libraries: " ${PRIMITIV_C_LIBRARIES})
+  set(PRIMITIV_C_FOUND ON)
+else()
+  message(STATUS "Primitiv C API is not installed.")
+  set(PRIMITIV_C_FOUND OFF)
+endif()
+


Fixing regression coming from merge.

Fixing regression coming from merge.

--- cmake/FindUglifyJS.cmake
+++ cmake/FindUglifyJS.cmake
@@ -4,4 +4,4 @@
     find_program(UglifyJS_EXECUTABLE uglifyjs)
 endif()

-find_package_handle_standard_args(UglifyJS DEFAULT_MSG UGLIFYJS_EXECUTABLE)
+find_package_handle_standard_args(UglifyJS DEFAULT_MSG UglifyJS_EXECUTABLE)


build: Clean up the find-module for yaml-cpp

--- cmake/Findyaml-cpp.cmake
+++ cmake/Findyaml-cpp.cmake
@@ -20,35 +20,39 @@
 # Copyright (C) 2018 Scylladb, Ltd.
 #

-find_package (PkgConfig)
+find_package (PkgConfig REQUIRED)

-pkg_search_module (PC_yaml-cpp
-  REQUIRED
+pkg_search_module (yaml-cpp_PC
   QUIET
   yaml-cpp)

+find_library (yaml-cpp_LIBRARY
+  NAMES yaml-cpp
+  HINTS
+    ${yaml-cpp_PC_LIBDIR}
+    ${yaml-cpp_PC_LIBRARY_DIRS})
+
 find_path (yaml-cpp_INCLUDE_DIR
   NAMES yaml-cpp/yaml.h
-  PATHS ${PC_yaml-cpp_INCLUDE_DIRS})
+  PATH_SUFFIXES yaml-cpp
+  HINTS
+    ${yaml-cpp_PC_INCLUDEDIR}
+    ${yaml-cpp_PC_INCLUDE_DIRS})

-find_library (yaml-cpp_LIBRARY
-  NAMES yaml-cpp
-  PATHS ${PC_yaml-cpp_LIBRARY_DIRS})
-
-set (yaml-cpp_VERSION ${PC_yaml-cpp_VERSION})
+mark_as_advanced (
+  yaml-cpp_LIBRARY
+  yaml-cpp_INCLUDE_DIR)

 include (FindPackageHandleStandardArgs)

 find_package_handle_standard_args (yaml-cpp
-  FOUND_VAR yaml-cpp_FOUND
   REQUIRED_VARS
+    yaml-cpp_LIBRARY
     yaml-cpp_INCLUDE_DIR
-    yaml-cpp_LIBRARY
-  VERSION_VAR yaml-cpp_VERSION)
+  VERSION_VAR yaml-cpp_PC_VERSION)

-if (yaml-cpp_FOUND)
-  set (yaml-cpp_INCLUDE_DIRS ${yaml-cpp_INCLUDE_DIR})
-endif ()
+set (yaml-cpp_LIBRARIES ${yaml-cpp_LIBRARY})
+set (yaml-cpp_INCLUDE_DIRS ${yaml-cpp_INCLUDE_DIR})

 if (yaml-cpp_FOUND AND NOT (TARGET yaml-cpp::yaml-cpp))
   add_library (yaml-cpp::yaml-cpp UNKNOWN IMPORTED)
@@ -56,10 +60,5 @@
   set_target_properties (yaml-cpp::yaml-cpp
     PROPERTIES
       IMPORTED_LOCATION ${yaml-cpp_LIBRARY}
-      INTERFACE_COMPILE_OPTIONS "${PC_yaml-cpp_CFLAGS_OTHER}"
-      INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIR})
+      INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIRS})
 endif ()
-
-mark_as_advanced (
-  yaml-cpp_INCLUDE_DIR
-  yaml-cpp_LIBRARY)


cmake: dts: Remove duplicated "Remove duplicates"

"Remove duplicates" step was duplicated.

Signed-off-by: Erwan Gouriou <de4d967452b83bb0e37525652734e7d9163b6a4c@linaro.org>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -49,8 +49,6 @@
 list(REMOVE_DUPLICATES
   DTS_ROOT
   )
-
-list(REMOVE_DUPLICATES DTS_ROOT)

 set(dts_files
   ${DTS_SOURCE}


Update to latest AddSAMPPlugin.cmake from cmake-modules

--- cmake/AddSAMPPlugin.cmake
+++ cmake/AddSAMPPlugin.cmake
@@ -3,7 +3,7 @@

   set_target_properties(${name} PROPERTIES PREFIX "")

-  if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     set_property(TARGET ${name} APPEND_STRING PROPERTY COMPILE_FLAGS " -m32")
     set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS    " -m32")
   endif()
@@ -13,7 +13,7 @@
                  COMPILE_FLAGS " -Wno-attributes")
   endif()

-  if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+  if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     set_property(TARGET ${name} APPEND_STRING PROPERTY
                  COMPILE_FLAGS " -Wno-ignored-attributes")
   endif()
@@ -23,7 +23,7 @@
                  LINK_FLAGS " -Wl,--enable-stdcall-fixup")
   endif()

-  if(UNIX AND NOT WIN32)
+  if(UNIX AND NOT WIN32 AND NOT APPLE)
     set_property(TARGET ${name} APPEND PROPERTY COMPILE_DEFINITIONS "LINUX")
   endif()
 endfunction()


add missing client package copy step

add missing client package copy step

--- cmake/packages/nsis.cmake
+++ cmake/packages/nsis.cmake
@@ -1,9 +1,4 @@
 set(W_INSTALL_FILES                "${PROJECT_SOURCE_DIR}/Installation/Windows/")
-if (${USE_ENTERPRISE})
-  set(CPACK_PACKAGE_NAME             "ArangoDB3e")
-else()
-  set(CPACK_PACKAGE_NAME             "ArangoDB3")
-endif()

 set(CPACK_NSIS_DISPLAY_NAME,       ${ARANGODB_DISPLAY_NAME})
 set(CPACK_NSIS_HELP_LINK           ${ARANGODB_HELP_LINK})
@@ -101,6 +96,9 @@

 list(APPEND PACKAGES_LIST package-arongodb-client-nsis)

+add_custom_target(copy_client_nsis_package
+  COMMAND ${CMAKE_COMMAND} -E copy ${ARANGODB_CLIENT_PACKAGE_FILE_NAME}.exe ${PACKAGE_TARGET_DIR})
+
 add_custom_target(copy_nsis_packages
   COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_PACKAGE_FILE_NAME}.exe ${PACKAGE_TARGET_DIR})


ignore proctor and gpu_kinfo when configuring PCLConfig.cmake

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

--- cmake/pcl_pclconfig.cmake
+++ cmake/pcl_pclconfig.cmake
@@ -1,6 +1,6 @@

 set(PCL_SUBSYSTEMS_MODULES ${PCL_SUBSYSTEMS})
-list(REMOVE_ITEM PCL_SUBSYSTEMS_MODULES tools cuda_apps global_tests)
+list(REMOVE_ITEM PCL_SUBSYSTEMS_MODULES tools cuda_apps global_tests proctor gpu_kinfu)

 set(PCLCONFIG_AVAILABLE_COMPONENTS)
 set(PCLCONFIG_AVAILABLE_COMPONENTS_LIST)


pw_build/cmake: Add re-usable pw_add_library CMake function

Adds a re-usable, including by downstream projects, pw_add_library
CMake function which is used to implement function such as
pw_add_module_library.

Change-Id: I646a49edf0228000924a68d5396f499d4bcf87a9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/94020
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>
Commit-Queue: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -151,14 +151,25 @@
 endfunction(pw_auto_add_module_tests)

 # Sets the provided variable to the common library arguments.
-macro(_pw_library_args variable)
-  set("${variable}" SOURCES HEADERS PUBLIC_DEPS PRIVATE_DEPS ${ARGN})
+macro(_pw_library_multi_value_args variable)
+  set("${variable}" SOURCES HEADERS
+                    PUBLIC_DEPS PRIVATE_DEPS
+                    PUBLIC_INCLUDES PRIVATE_INCLUDES
+                    PUBLIC_DEFINES PRIVATE_DEFINES
+                    PUBLIC_COMPILE_OPTIONS PRIVATE_COMPILE_OPTIONS
+                    PUBLIC_LINK_OPTIONS PRIVATE_LINK_OPTIONS "${ARGN}")
 endmacro()

-# Creates a library in a module. The library has access to the public/ include
-# directory.
-#
-# Args:
+# pw_add_library: Creates a CMake library target.
+#
+# Required Args:
+#
+#   <name> - The name of the library target to be created.
+#   <type> - The library type which must be OBJECT, STATIC, SHARED, or MODULE.
+#            Note that INTERFACE is not supported and is implicitly used if no
+#            sources are provided.
+#
+# Optional Args:
 #
 #   SOURCES - source files for this library
 #   HEADERS - header files for this library
@@ -166,43 +177,29 @@
 #   PRIVATE_DEPS - private target_link_libraries arguments
 #   PUBLIC_INCLUDES - public target_include_directories argument
 #   PRIVATE_INCLUDES - public target_include_directories argument
-#   IMPLEMENTS_FACADES - which facades this library implements
 #   PUBLIC_DEFINES - public target_compile_definitions arguments
 #   PRIVATE_DEFINES - private target_compile_definitions arguments
 #   PUBLIC_COMPILE_OPTIONS - public target_compile_options arguments
 #   PRIVATE_COMPILE_OPTIONS - private target_compile_options arguments
 #   PUBLIC_LINK_OPTIONS - public target_link_options arguments
 #   PRIVATE_LINK_OPTIONS - private target_link_options arguments
-#
-function(pw_add_module_library NAME)
-  _pw_library_args(
-      list_args
-          PUBLIC_INCLUDES PRIVATE_INCLUDES
-          IMPLEMENTS_FACADES
-          PUBLIC_DEFINES PRIVATE_DEFINES
-          PUBLIC_COMPILE_OPTIONS PRIVATE_COMPILE_OPTIONS
-          PUBLIC_LINK_OPTIONS PRIVATE_LINK_OPTIONS
-  )
-  _pw_parse_argv_strict(pw_add_module_library 1 "" "" "${list_args}")
-
-  # Check that the library's name is prefixed by the module name.
-  get_filename_component(module "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
-
-  if(NOT "${NAME}" MATCHES "${module}(\\.[^\\.]+)?(\\.facade)?$")
-    message(FATAL_ERROR
-        "Module libraries must match the module name or be in the form "
-        "'MODULE_NAME.LIBRARY_NAME'. The library '${NAME}' does not match."
-    )
-  endif()
+function(pw_add_library NAME TYPE)
+  set(num_positional_args 2)
+  set(option_args)
+  set(one_value_args)
+  _pw_library_multi_value_args(multi_value_args)
+  _pw_parse_argv_strict(
+      pw_add_library "${num_positional_args}" "${option_args}"
+      "${one_value_args}" "${multi_value_args}")

   # Instead of forking all of the code below or injecting an empty source file,
   # conditionally select PUBLIC vs INTERFACE depending on whether there are
   # sources to compile.
   if(NOT "${arg_SOURCES}" STREQUAL "")
-    add_library("${NAME}" EXCLUDE_FROM_ALL)
+    add_library("${NAME}" "${TYPE}" EXCLUDE_FROM_ALL)
     set(public_or_interface PUBLIC)
   else("${arg_SOURCES}" STREQUAL "")
-    add_library("${NAME}" EXCLUDE_FROM_ALL INTERFACE)
+    add_library("${NAME}" INTERFACE EXCLUDE_FROM_ALL)
     set(public_or_interface INTERFACE)
   endif(NOT "${arg_SOURCES}" STREQUAL "")

@@ -223,82 +220,137 @@
   endforeach()

   if(NOT "${arg_PUBLIC_INCLUDES}" STREQUAL "")
-    target_include_directories("${NAME}"
-      ${public_or_interface}
-        ${arg_PUBLIC_INCLUDES}
-    )
-  else("${arg_PUBLIC_INCLUDES}" STREQUAL "")
-    # TODO(pwbug/601): Deprecate this legacy implicit PUBLIC_INCLUDES.
-    target_include_directories("${NAME}" ${public_or_interface} public)
+    target_include_directories(
+        "${NAME}" ${public_or_interface} ${arg_PUBLIC_INCLUDES})
   endif(NOT "${arg_PUBLIC_INCLUDES}" STREQUAL "")

   if(NOT "${arg_PRIVATE_INCLUDES}" STREQUAL "")
     target_include_directories("${NAME}" PRIVATE ${arg_PRIVATE_INCLUDES})
   endif(NOT "${arg_PRIVATE_INCLUDES}" STREQUAL "")

-  target_link_libraries("${NAME}"
-    ${public_or_interface}
+  target_link_libraries("${NAME}" ${public_or_interface} ${arg_PUBLIC_DEPS})
+
+  if(NOT "${arg_SOURCES}" STREQUAL "")
+    target_link_libraries("${NAME}" PRIVATE ${arg_PRIVATE_DEPS})
+  endif(NOT "${arg_SOURCES}" STREQUAL "")
+
+  if(NOT "${arg_PUBLIC_DEFINES}" STREQUAL "")
+    target_compile_definitions(
+        "${NAME}" ${public_or_interface} ${arg_PUBLIC_DEFINES})
+  endif(NOT "${arg_PUBLIC_DEFINES}" STREQUAL "")
+
+  if(NOT "${arg_PRIVATE_DEFINES}" STREQUAL "")
+    target_compile_definitions("${NAME}" PRIVATE ${arg_PRIVATE_DEFINES})
+  endif(NOT "${arg_PRIVATE_DEFINES}" STREQUAL "")
+
+  if(NOT "${arg_PUBLIC_COMPILE_OPTIONS}" STREQUAL "")
+    target_compile_options(
+        "${NAME}" ${public_or_interface} ${arg_PUBLIC_COMPILE_OPTIONS})
+  endif(NOT "${arg_PUBLIC_COMPILE_OPTIONS}" STREQUAL "")
+
+  if(NOT "${arg_PRIVATE_COMPILE_OPTIONS}" STREQUAL "")
+    target_compile_options("${NAME}" PRIVATE ${arg_PRIVATE_COMPILE_OPTIONS})
+  endif(NOT "${arg_PRIVATE_COMPILE_OPTIONS}" STREQUAL "")
+
+  if(NOT "${arg_PUBLIC_LINK_OPTIONS}" STREQUAL "")
+    target_link_options(
+        "${NAME}" ${public_or_interface} ${arg_PUBLIC_LINK_OPTIONS})
+  endif(NOT "${arg_PUBLIC_LINK_OPTIONS}" STREQUAL "")
+
+  if(NOT "${arg_PRIVATE_LINK_OPTIONS}" STREQUAL "")
+    target_link_options("${NAME}" PRIVATE ${arg_PRIVATE_LINK_OPTIONS})
+  endif(NOT "${arg_PRIVATE_LINK_OPTIONS}" STREQUAL "")
+endfunction(pw_add_library)
+
+# Creates a pw module library.
+#
+# Required Args:
+#
+#   <name> - The name of the library target to be created.
+#
+# Optional Args:
+#
+#   IMPLEMENTS_FACADES - which facades this module library implements
+#   SOURCES - source files for this library
+#   HEADERS - header files for this library
+#   PUBLIC_DEPS - public target_link_libraries arguments
+#   PRIVATE_DEPS - private target_link_libraries arguments
+#   PUBLIC_INCLUDES - public target_include_directories argument
+#   PRIVATE_INCLUDES - public target_include_directories argument
+#   PUBLIC_DEFINES - public target_compile_definitions arguments
+#   PRIVATE_DEFINES - private target_compile_definitions arguments
+#   PUBLIC_COMPILE_OPTIONS - public target_compile_options arguments
+#   PRIVATE_COMPILE_OPTIONS - private target_compile_options arguments
+#   PUBLIC_LINK_OPTIONS - public target_link_options arguments
+#   PRIVATE_LINK_OPTIONS - private target_link_options arguments
+#
+function(pw_add_module_library NAME)
+  _pw_library_multi_value_args(multi_value_args IMPLEMENTS_FACADES)
+  _pw_parse_argv_strict(pw_add_module_library 1 "" "" "${multi_value_args}")
+
+  # Check that the library's name is prefixed by the module name.
+  get_filename_component(module "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
+
+  if(NOT "${NAME}" MATCHES "${module}(\\.[^\\.]+)?(\\.facade)?$")
+    message(FATAL_ERROR
+        "Module libraries must match the module name or be in the form "
+        "'MODULE_NAME.LIBRARY_NAME'. The library '${NAME}' does not match."
+    )
+  endif()
+
+  pw_add_library(${NAME} STATIC
+    SOURCES
+      ${arg_SOURCES}
+    HEADERS
+      ${arg_HEADERS}
+    PUBLIC_DEPS
       pw_build
       ${arg_PUBLIC_DEPS}
-  )
-
+    PRIVATE_DEPS
+      pw_build.warnings
+      ${arg_PRIVATE_DEPS}
+    PUBLIC_INCLUDES
+      ${arg_PUBLIC_INCLUDES}
+    PRIVATE_INCLUDES
+      ${arg_PRIVATE_INCLUDES}
+    PUBLIC_DEFINES
+      ${arg_PUBLIC_DEFINES}
+    PRIVATE_DEFINES
+      ${arg_PRIVATE_DEFINES}
+    PUBLIC_COMPILE_OPTIONS
+      ${arg_PUBLIC_COMPILE_OPTIONS}
+    PRIVATE_COMPILE_OPTIONS
+      ${arg_PRIVATE_COMPILE_OPTIONS}
+    PUBLIC_LINK_OPTIONS
+      ${arg_PUBLIC_LINK_OPTIONS}
+    PRIVATE_LINK_OPTIONS
+      ${arg_PRIVATE_LINK_OPTIONS}
+  )
+
+  # Conditionally select PUBLIC vs INTERFACE depending on whether there are
+  # sources to compile.
   if(NOT "${arg_SOURCES}" STREQUAL "")
-    target_link_libraries("${NAME}"
-      PRIVATE
-        pw_build.warnings
-        ${arg_PRIVATE_DEPS}
-    )
+    set(public_or_interface PUBLIC)
+  else("${arg_SOURCES}" STREQUAL "")
+    set(public_or_interface INTERFACE)
   endif(NOT "${arg_SOURCES}" STREQUAL "")

+  # TODO(pwbug/601): Deprecate this legacy implicit PUBLIC_INCLUDES.
+  if("${arg_PUBLIC_INCLUDES}" STREQUAL "")
+    target_include_directories("${NAME}" ${public_or_interface} public)
+  endif("${arg_PUBLIC_INCLUDES}" STREQUAL "")
+
   if(NOT "${arg_IMPLEMENTS_FACADES}" STREQUAL "")
-    target_include_directories("${NAME}"
-      ${public_or_interface}
-        public_overrides
-    )
+    # TODO(pwbug/601): Deprecate this legacy implicit PUBLIC_INCLUDES.
     if("${arg_PUBLIC_INCLUDES}" STREQUAL "")
-      # TODO(pwbug/601): Deprecate this legacy implicit PUBLIC_INCLUDES.
-      target_include_directories("${NAME}"
-        ${public_or_interface}
-          public_overrides
-      )
+      target_include_directories(
+        "${NAME}" ${public_or_interface} public_overrides)
     endif("${arg_PUBLIC_INCLUDES}" STREQUAL "")
+
     set(facades ${arg_IMPLEMENTS_FACADES})
     list(TRANSFORM facades APPEND ".facade")
     target_link_libraries("${NAME}" ${public_or_interface} ${facades})
   endif(NOT "${arg_IMPLEMENTS_FACADES}" STREQUAL "")
-
-  if(NOT "${arg_PUBLIC_DEFINES}" STREQUAL "")
-    target_compile_definitions("${NAME}"
-      ${public_or_interface}
-        ${arg_PUBLIC_DEFINES}
-    )
-  endif(NOT "${arg_PUBLIC_DEFINES}" STREQUAL "")
-
-  if(NOT "${arg_PRIVATE_DEFINES}" STREQUAL "")
-    target_compile_definitions("${NAME}" PRIVATE ${arg_PRIVATE_DEFINES})
-  endif(NOT "${arg_PRIVATE_DEFINES}" STREQUAL "")
-
-  if(NOT "${arg_PUBLIC_COMPILE_OPTIONS}" STREQUAL "")
-    target_compile_options("${NAME}"
-      ${public_or_interface}
-        ${arg_PUBLIC_COMPILE_OPTIONS}
-    )
-  endif(NOT "${arg_PUBLIC_COMPILE_OPTIONS}" STREQUAL "")
-
-  if(NOT "${arg_PRIVATE_COMPILE_OPTIONS}" STREQUAL "")
-    target_compile_options("${NAME}" PRIVATE ${arg_PRIVATE_COMPILE_OPTIONS})
-  endif(NOT "${arg_PRIVATE_COMPILE_OPTIONS}" STREQUAL "")
-
-  if(NOT "${arg_PUBLIC_LINK_OPTIONS}" STREQUAL "")
-    target_link_options("${NAME}"
-      ${public_or_interface}
-        ${arg_PUBLIC_LINK_OPTIONS}
-    )
-  endif(NOT "${arg_PUBLIC_LINK_OPTIONS}" STREQUAL "")
-
-  if(NOT "${arg_PRIVATE_LINK_OPTIONS}" STREQUAL "")
-    target_link_options("${NAME}" PRIVATE ${arg_PRIVATE_LINK_OPTIONS})
-  endif(NOT "${arg_PRIVATE_LINK_OPTIONS}" STREQUAL "")
 endfunction(pw_add_module_library)

 # Declares a module as a facade.
@@ -314,7 +366,7 @@
 #  DEFAULT_BACKEND - which backend to use by default
 #
 function(pw_add_facade NAME)
-  _pw_library_args(list_args)
+  _pw_library_multi_value_args(list_args)
   _pw_parse_argv_strict(pw_add_facade 1 "" "DEFAULT_BACKEND" "${list_args}")

   # If no backend is set, a script that displays an error message is used


Delete cmake_install.cmake

Delete cmake_install.cmake

--- examples/myCodes/polygon-boundary/poly/cmake_install.cmake
+++ examples/myCodes/polygon-boundary/poly/cmake_install.cmake
@@ -1,39 +0,0 @@
-# Install script for directory: /Users/lisa/Desktop/dealii/examples/myCodes/polygon-boundary/poly
-
-# Set the install prefix
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  set(CMAKE_INSTALL_PREFIX "/usr/local")
-endif()
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  if(BUILD_TYPE)
-    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  else()
-    set(CMAKE_INSTALL_CONFIG_NAME "Debug")
-  endif()
-  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-endif()
-
-# Set the component getting installed.
-if(NOT CMAKE_INSTALL_COMPONENT)
-  if(COMPONENT)
-    message(STATUS "Install component: \"${COMPONENT}\"")
-    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  else()
-    set(CMAKE_INSTALL_COMPONENT)
-  endif()
-endif()
-
-if(CMAKE_INSTALL_COMPONENT)
-  set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-else()
-  set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-endif()
-
-string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
-       "${CMAKE_INSTALL_MANIFEST_FILES}")
-file(WRITE "/Users/lisa/Desktop/dealii/examples/myCodes/polygon-boundary/poly/${CMAKE_INSTALL_MANIFEST}"
-     "${CMAKE_INSTALL_MANIFEST_CONTENT}")


CMake: update dependencies

CMake: update dependencies

- freetype 2.6.5 -> 2.9
- SDL2 2.0.5 -> 2.0.8

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -139,14 +139,14 @@

     message(STATUS "Building freetype")
     file(DOWNLOAD
-        http://download.savannah.gnu.org/releases/freetype/freetype-2.6.5.tar.gz
-        ${OGRE_BINARY_DIR}/freetype-2.6.5.tar.gz)
-    execute_process(COMMAND ${CMAKE_COMMAND}
-        -E tar xf freetype-2.6.5.tar.gz WORKING_DIRECTORY ${OGRE_BINARY_DIR})
+        http://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.gz
+        ${OGRE_BINARY_DIR}/freetype-2.9.tar.gz)
+    execute_process(COMMAND ${CMAKE_COMMAND}
+        -E tar xf freetype-2.9.tar.gz WORKING_DIRECTORY ${OGRE_BINARY_DIR})
     # patch toolchain for iOS
     execute_process(COMMAND ${CMAKE_COMMAND} -E copy
         ${CMAKE_SOURCE_DIR}/CMake/toolchain/ios.toolchain.xcode.cmake
-        freetype-2.6.5/builds/cmake/iOS.cmake
+        freetype-2.9/builds/cmake/iOS.cmake
 		WORKING_DIRECTORY ${OGRE_BINARY_DIR})
     execute_process(COMMAND ${CMAKE_COMMAND}
         -DCMAKE_INSTALL_PREFIX=${OGREDEPS_PATH}
@@ -154,22 +154,22 @@
         -DBUILD_SHARED_LIBS=${OGREDEPS_SHARED}
         -DWITH_BZip2=OFF # tries to use it on iOS otherwise
         # workaround for broken iOS toolchain in freetype
-        -DPROJECT_SOURCE_DIR=${CMAKE_BINARY_DIR}/freetype-2.6.5
+        -DPROJECT_SOURCE_DIR=${CMAKE_BINARY_DIR}/freetype-2.9
         ${CROSS}
         -G ${CMAKE_GENERATOR}
         -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-        ${CMAKE_BINARY_DIR}/freetype-2.6.5
-        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/freetype-2.6.5/objs)
-    execute_process(COMMAND ${CMAKE_COMMAND}
-        --build ${CMAKE_BINARY_DIR}/freetype-2.6.5/objs ${BUILD_COMMAND_OPTS})
+        ${CMAKE_BINARY_DIR}/freetype-2.9
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/freetype-2.9/objs)
+    execute_process(COMMAND ${CMAKE_COMMAND}
+        --build ${CMAKE_BINARY_DIR}/freetype-2.9/objs ${BUILD_COMMAND_OPTS})

     if(MSVC) # other platforms dont need this
         message(STATUS "Building SDL2")
         file(DOWNLOAD
-            https://libsdl.org/release/SDL2-2.0.5.tar.gz
-            ${OGRE_BINARY_DIR}/SDL2-2.0.5.tar.gz)
+            https://libsdl.org/release/SDL2-2.0.8.tar.gz
+            ${OGRE_BINARY_DIR}/SDL2-2.0.8.tar.gz)
         execute_process(COMMAND ${CMAKE_COMMAND}
-            -E tar xf SDL2-2.0.5.tar.gz WORKING_DIRECTORY ${OGRE_BINARY_DIR})
+            -E tar xf SDL2-2.0.8.tar.gz WORKING_DIRECTORY ${OGRE_BINARY_DIR})
         execute_process(COMMAND ${CMAKE_COMMAND}
             -E make_directory ${OGRE_BINARY_DIR}/SDL2-build)
         execute_process(COMMAND ${CMAKE_COMMAND}
@@ -179,7 +179,7 @@
             -G ${CMAKE_GENERATOR}
             -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
             ${CROSS}
-            ${OGRE_BINARY_DIR}/SDL2-2.0.5
+            ${OGRE_BINARY_DIR}/SDL2-2.0.8
             WORKING_DIRECTORY ${OGRE_BINARY_DIR}/SDL2-build)
         execute_process(COMMAND ${CMAKE_COMMAND}
             --build ${OGRE_BINARY_DIR}/SDL2-build ${BUILD_COMMAND_OPTS})


ExternalData: Remove compatibility with CMake < 2.8.5

VTK already requires CMake >= 2.8.5 so our copy of the
ExternalData.cmake module does not need to be compatible with earlier
versions.

Change-Id: I7d549ae22c4f18edfee07f2412772d01ea4f61d3

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -135,8 +135,7 @@
 # Variables ExternalData_TIMEOUT_INACTIVITY and ExternalData_TIMEOUT_ABSOLUTE
 # set the download inactivity and absolute timeouts, in seconds.  The defaults
 # are 60 seconds and 300 seconds, respectively.  Set either timeout to 0
-# seconds to disable enforcement.  The inactivity timeout is enforced only
-# with CMake >= 2.8.5.
+# seconds to disable enforcement.

 #=============================================================================
 # Copyright 2010-2013 Kitware, Inc.
@@ -307,13 +306,7 @@
 endfunction()

 function(_ExternalData_random var)
-  if(NOT ${CMAKE_VERSION} VERSION_LESS 2.8.5)
-    string(RANDOM LENGTH 6 random)
-  elseif(EXISTS /dev/urandom)
-    file(READ /dev/urandom random LIMIT 4 HEX)
-  else()
-    message(FATAL_ERROR "CMake >= 2.8.5 required in this environment")
-  endif()
+  string(RANDOM LENGTH 6 random)
   set("${var}" "${random}" PARENT_SCOPE)
 endfunction()

@@ -647,14 +640,10 @@
   set(retry 3)
   while(retry)
     math(EXPR retry "${retry} - 1")
-    if("${CMAKE_VERSION}" VERSION_GREATER 2.8.4.20110602)
-      if(ExternalData_TIMEOUT_INACTIVITY)
-        set(inactivity_timeout INACTIVITY_TIMEOUT ${ExternalData_TIMEOUT_INACTIVITY})
-      elseif(NOT "${ExternalData_TIMEOUT_INACTIVITY}" EQUAL 0)
-        set(inactivity_timeout INACTIVITY_TIMEOUT 60)
-      else()
-        set(inactivity_timeout "")
-      endif()
+    if(ExternalData_TIMEOUT_INACTIVITY)
+      set(inactivity_timeout INACTIVITY_TIMEOUT ${ExternalData_TIMEOUT_INACTIVITY})
+    elseif(NOT "${ExternalData_TIMEOUT_INACTIVITY}" EQUAL 0)
+      set(inactivity_timeout INACTIVITY_TIMEOUT 60)
     else()
       set(inactivity_timeout "")
     endif()


superbuild Qt4 with MSVC and activate only required components

--- CMake/External_qt4.cmake
+++ CMake/External_qt4.cmake
@@ -17,12 +17,29 @@
   if(NOT DEFINED git_protocol)
     set(git_protocol "git")
   endif()
+
+  #activate only required components for Qt4
+  set(QT4_SB_CONFIG -no-phonon-backend -no-scripttools -no-multimedia -no-webkit -qt-sql-sqlite -plugin-sql-sqlite -no-nis -no-qt3support)

-  if(MSVC)
+  if(NOT USE_SYSTEM_ZLIB)
+    list(APPEND ${proj}_DEPENDENCIES ZLIB)
+  endif()

-      message(STATUS "  Qt4 SuperBuild is not available yet...")
-else(UNIX)
-
+  if(NOT USE_SYSTEM_TIFF)
+    list(APPEND ${proj}_DEPENDENCIES TIFF)
+  endif()
+
+  if(NOT USE_SYSTEM_PNG)
+    list(APPEND ${proj}_DEPENDENCIES PNG)
+  endif()
+
+  if(NOT USE_SYSTEM_SQLITE)
+    list(APPEND ${proj}_DEPENDENCIES SQLITE)
+  endif()
+
+ #use system libs always for Qt4 as we build them from source or have already in system
+  set(QT4_SB_CONFIG  ${QT4_SB_CONFIG} -system-zlib -system-libpng -system-libtiff -system-libjpeg -system-sqlite)
+
   ExternalProject_Add(${proj}
     PREFIX ${proj}
     URL "http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz"
@@ -34,20 +51,24 @@
     CONFIGURE_COMMAND
       ${QT4_SB_BUILD_DIR}/configure
         -prefix ${CMAKE_INSTALL_PREFIX}
-        -opensource
+        -opensource
         -confirm-license
+        -release
+        -shared
+        -nomake demos
+        -nomake examples
+        -nomake tools
+        ${QT4_SB_CONFIG}
     DEPENDS ${${proj}_DEPENDENCIES}
     )
-
+
   ExternalProject_Add_Step(${proj} copy_source
       COMMAND ${CMAKE_COMMAND} -E copy_directory
-        ${QT4_SB_SRC} ${QT4_SB_BUILD_DIR}
+      ${QT4_SB_SRC} ${QT4_SB_BUILD_DIR}
       DEPENDEES patch update
       DEPENDERS configure
-      )
-
-
+    )
+
   message(STATUS "  Using Qt4 SuperBuild version")
-endif()

 endif()


Revert "[HACK] : ugly patch for finding boost."

This reverts commit 89ca9e8f6afe8b4645286af83525d582a1d7173a.
The hack is no longer necessary, the boost recipe is fixed
in the last version of qitoolchain

--- cmake/qibuild/modules/boostutils.cmake
+++ cmake/qibuild/modules/boostutils.cmake
@@ -12,16 +12,12 @@

 function(boost_flib _suffix _libname)
   flib(BOOST_${_suffix} OPTIMIZED NAMES
-                          # HACK ! don't do without -mt !
-                          "boost_${_libname}"
                           "boost_${_libname}-mt"
                           "boost_${_libname}-xgcc40-mt-1_38"
                           "libboost_${_libname}-vc80-mt-1_38"
                           "libboost_${_libname}-vc90-mt-1_38"
                           )
   flib(BOOST_${_suffix} DEBUG NAMES
-                          # HACK ! don't do without -mt !
-                          "boost_${_libname}"
                           "boost_${_libname}-mt-d"
                           "boost_${_libname}-xgcc40-mt-1_38"
                           "libboost_${_libname}-vc80-mt-gd-1_38"


Added option KEEP_RPATHS to conan_cmake_run().

--- conan.cmake
+++ conan.cmake
@@ -82,7 +82,7 @@
         set(COMPILER_VERSION ${MAJOR}.${MINOR})
         if(${MAJOR} GREATER 4)
             set(COMPILER_VERSION ${MAJOR})
-        endif()
+        endif()
         set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${COMPILER_VERSION})
         if (USING_CXX)
           conan_cmake_detect_gnu_libcxx(_LIBCXX)
@@ -202,7 +202,7 @@

 macro(parse_arguments)
-  set(options BASIC_SETUP CMAKE_TARGETS UPDATE)
+  set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS)
   set(oneValueArgs CONANFILE DEBUG_PROFILE RELEASE_PROFILE PROFILE)
   set(multiValueArgs REQUIRES OPTIONS IMPORTS BUILD CONAN_COMMAND)
   cmake_parse_arguments(ARGUMENTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
@@ -345,9 +345,17 @@

     if(ARGUMENTS_BASIC_SETUP)
       if(ARGUMENTS_CMAKE_TARGETS)
-        conan_basic_setup(TARGETS)
+        if(ARGUMENTS_KEEP_RPATHS)
+            conan_basic_setup(TARGETS KEEP_RPATHS)
+        else()
+            conan_basic_setup(TARGETS)
+        endif()
       else()
-        conan_basic_setup()
+        if(ARGUMENTS_KEEP_RPATHS)
+            conan_basic_setup(KEEP_RPATHS)
+        else()
+            conan_basic_setup()
+        endif()
       endif()
     endif()
 endmacro()


Verify that version of toolset is supported

--- conan.cmake
+++ conan.cmake
@@ -2,20 +2,25 @@

 function(_get_msvc_ide_version result)
     set(${result} "" PARENT_SCOPE)
-    if (CMAKE_VS_PLATFORM_TOOLSET)
+    if(CMAKE_VS_PLATFORM_TOOLSET)
         string(REGEX MATCHALL "[0-9]+" output "${CMAKE_VS_PLATFORM_TOOLSET}")
         list(GET output 0 _toolset_version)
-        if ("${_toolset_version}" EQUAL "141")
-            set(_msvc_version "15")
+        if(_toolset_version LESS 142)
+            if ("${_toolset_version}" EQUAL "141")
+                set(_msvc_version "15")
+            else()
+                string(SUBSTRING ${_toolset_version} 0 2 _msvc_version)
+            endif()
+            set(${result} ${_msvc_version} PARENT_SCOPE)
+            return()
         else()
-            string(SUBSTRING ${_toolset_version} 0 2 _msvc_version)
-        endif()
-        set(${result} ${_msvc_version} PARENT_SCOPE)
-    else()
-        string(REGEX MATCHALL "[0-9]+" output "${CMAKE_GENERATOR}")
-        list(GET output 0 _msvc_version)
-        set(${result} ${_msvc_version} PARENT_SCOPE)
-    endif()
+            message(STATUS "Conan **WARNING** : Unknown MSVC toolset ${_toolset_version}")
+        endif()
+    endif()
+
+    string(REGEX MATCHALL "[0-9]+" output "${CMAKE_GENERATOR}")
+    list(GET output 0 _msvc_version)
+    set(${result} ${_msvc_version} PARENT_SCOPE)
 endfunction()

 function(conan_cmake_settings result)


Cleanup.

Cleanup.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -19,16 +19,17 @@
         if(NOT CC_FOUND)
             message( FATAL_ERROR "Compiler $ENV{CC} not found." )
         endif()
-        if($ENV{CC} STREQUAL "icc")
+        get_filename_component(CC $ENV{CC} NAME)
+        if(CC STREQUAL "icc")
             set(CC_NAME "icc")
             exec_program($ENV{CC} ARGS -dumpversion OUTPUT_VARIABLE CC_VERSION)
             exec_program($ENV{CC} ARGS -dumpmachine OUTPUT_VARIABLE CC_ARCH)
             string(STRIP "-pc-linux-gnu" CC_ARCH)
-        elseif($ENV{CC} STREQUAL "tcc")
+        elseif(CC STREQUAL "tcc")
             set(CC_NAME "tcc")
             exec_program($ENV{CC} ARGS -v OUTPUT_VARIABLE CC_VERSION)
             string(REGEX REPLACE ".*tcc version ([0-9]+\\.[0-9]+).*" "\\1" CC_VERSION ${CC_VERSION})
-        elseif($ENV{CC} STREQUAL "x86_64-w64-mingw32-gcc" OR $ENV{CC} STREQUAL "i686-w64-mingw32-gcc")
+        elseif(CC STREQUAL "x86_64-w64-mingw32-gcc" OR CC STREQUAL "i686-w64-mingw32-gcc" OR CC STREQUAL "x86_64-w64-mingw32.static-gcc" OR CC STREQUAL "i686-w64-mingw32.static-gcc")
             set(CC_NAME "mingw")
             exec_program($ENV{CC} ARGS -dumpversion OUTPUT_VARIABLE CC_VERSION)
             if((CC_VERSION VERSION_GREATER 5) OR (CC_VERSION VERSION_EQUAL 5))
@@ -37,10 +38,11 @@
                 string(SUBSTRING "${CC_VERSION}" 0 3 CC_VERSION)
             endif()
             exec_program($ENV{CC} ARGS -dumpmachine OUTPUT_VARIABLE CC_ARCH)
+            string(STRIP "-w64-mingw32.static" CC_ARCH)
             string(STRIP "-w64-mingw32" CC_ARCH)
             #Warmup wine or test timings are going to be wrong
             exec_program(wine ARGS version OUTPUT_VARIABLE WINE_VERSION)
-        elseif($ENV{CC} STREQUAL "emcc")
+        elseif(CC STREQUAL "emcc")
             set(CC_NAME "emscripten")
             set(CC_ARCH "asmjs")
             exec_program($ENV{CC} ARGS --version OUTPUT_VARIABLE CC_VERSION)
@@ -93,68 +95,49 @@
         set(CC_ARCH "x86")
     endif()
 endif()
+set(CI_BUILD_NAME "${CC_NAME}-${CC_VERSION}-${CC_ARCH}")

 # CI service
-# TODO set CTEST_CHANGE_ID for all services
 if(DEFINED ENV{APPVEYOR})
     set(CTEST_SITE "Appveyor CI")
     set(CTEST_SOURCE_DIRECTORY "$ENV{APPVEYOR_BUILD_FOLDER}")
-    if(DEFINED ENV{APPVEYOR_PULL_REQUEST_NUMBER})
-        set(CTEST_CHANGE_ID "$ENV{APPVEYOR_PULL_REQUEST_NUMBER}")
-    endif()
 elseif(DEFINED ENV{CIRCLECI})
     set(CTEST_SITE "Circle CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{PWD}")
 elseif(DEFINED ENV{DRONE})
     set(CTEST_SITE "Drone CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{DRONE_BUILD_DIR}")
 elseif(DEFINED ENV{GITLAB_CI})
     set(CTEST_SITE "GitLab CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{CI_PROJECT_DIR}")
 elseif(DEFINED ENV{MAGNUM})
     set(CTEST_SITE "Magnum CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{PWD}")
 elseif(DEFINED ENV{SCRUTINIZER})
     set(CTEST_SITE "Scrutinizer CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{PWD}")
 elseif(DEFINED ENV{SEMAPHORE})
     set(CTEST_SITE "Semaphore CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{SEMAPHORE_PROJECT_DIR}")
 elseif(DEFINED ENV{SHIPPABLE})
     set(CTEST_SITE "Shippable CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{SHIPPABLE_REPO_DIR}")
 elseif(DEFINED ENV{TRAVIS})
     set(CTEST_SITE "Travis CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}")
-    if($ENV{TRAVIS_PULL_REQUEST})
-        set(CTEST_CHANGE_ID "$ENV{TRAVIS_PULL_REQUEST}")
-    endif()
 elseif(DEFINED ENV{WERCKER_ROOT})
     set(CTEST_SITE "Wercker CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{WERCKER_ROOT}")
 elseif(DEFINED ENV{GIT_COMMIT} AND DEFINED ENV{BUILD_NUMBER} AND DEFINED ENV{WORKSPACE})
     set(CTEST_SITE "Jenkins CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{WORKSPACE}")
 elseif(DEFINED ENV{CI_NAME})
     if($ENV{CI_NAME} STREQUAL "codeship")
         set(CTEST_SITE "Codeship CI")
-        set(CTEST_SOURCE_DIRECTORY "$ENV{PWD}")
     endif()
 else()
     set(CTEST_SITE "Custom CI")
-    set(CTEST_SOURCE_DIRECTORY "$ENV{PWD}")
-endif()
-set(CI_BUILD_NAME "${CC_NAME}-${CC_VERSION}-${CC_ARCH}")
+endif()

 string(RANDOM CI_BUILD_UUID_RANDOM)
 string(UUID CI_BUILD_UUID NAMESPACE cd1ae0ac-17b9-4018-85da-921f0d3ae8d8 NAME ${CI_BUILD_UUID_RANDOM} TYPE SHA1)

 if(UNIX)
+    set(CTEST_SOURCE_DIRECTORY "$ENV{PWD}")
     set(CTEST_BINARY_DIRECTORY "$ENV{HOME}/build/${CI_BUILD_UUID}")
 else()
     set(CTEST_BINARY_DIRECTORY "$ENV{TMP}\\build\\${CI_BUILD_UUID}")
 endif()
-

 set(CTEST_UPDATE_VERSION_ONLY TRUE)
 set(CTEST_OUTPUT_ON_FAILURE TRUE)


Clang doesnt need the static-libtsan workaround on Ubuntu.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -322,6 +322,11 @@
     if(CC_VERSION VERSION_GREATER 5 OR CC_VERSION VERSION_EQUAL 5)
         if(CC_TSAN GREATER 0)
             set(CTEST_MEMORYCHECK_TYPE "ThreadSanitizer")
+            set(CI_UBUNTU 0)
+            execute_process(COMMAND cat /etc/os-release COMMAND grep -c Ubuntu OUTPUT_VARIABLE CI_UBUNTU )
+            if(CI_UBUNTU GREATER 0)
+                set(CC_TSAN_FLAGS "-static-libtsan")
+            endif()
         endif()
     endif()
 elseif(CC_NAME STREQUAL "clang")
@@ -332,13 +337,6 @@
     endif()
 endif()
 if(CTEST_MEMORYCHECK_TYPE STREQUAL "ThreadSanitizer")
-    if(UNIX)
-        set(CI_UBUNTU 0)
-        execute_process(COMMAND cat /etc/os-release COMMAND grep -c Ubuntu OUTPUT_VARIABLE CI_UBUNTU )
-        if(CI_UBUNTU GREATER 0)
-            set(CC_TSAN_FLAGS "-static-libtsan")
-        endif()
-    endif()
     set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "verbosity=1")
     set(CTEST_BUILD_NAME "${CI_BUILD_NAME}-tsan")
     ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})


print info about uploding files

print info about uploding files


cmake spelling issues in windows

cmake spelling issues in windows

--- cmake-modules/Findassimp.cmake
+++ cmake-modules/Findassimp.cmake
@@ -9,7 +9,7 @@
 	message(STATUS "CMAKE Finding assimp ${ASSIMP_ROOT_DIR}")

 	# Find path of each library
-	find_path(ASSIMP_INCLUDE_DIR
+	find_path(assimp_INCLUDE_DIRS
 		NAMES
 			assimp/anim.h
 		HINTS
@@ -34,12 +34,10 @@
 		find_library(ASSIMP_LIBRARY_RELEASE				assimp-${ASSIMP_MSVC_VERSION}-mt.lib 			PATHS ${ASSIMP_LIBRARY_DIR})
 		find_library(ASSIMP_LIBRARY_DEBUG				assimp-${ASSIMP_MSVC_VERSION}-mtd.lib			PATHS ${ASSIMP_LIBRARY_DIR})

-		set(ASSIMP_LIBRARY
+		set(assimp_LIBRARIES
 			optimized 	${ASSIMP_LIBRARY_RELEASE}
 			debug		${ASSIMP_LIBRARY_DEBUG}
 		)
-
-		set(ASSIMP_LIBRARIES "ASSIMP_LIBRARY_RELEASE" "ASSIMP_LIBRARY_DEBUG")

 		FUNCTION(ASSIMP_COPY_BINARIES TargetDirectory)
 			ADD_CUSTOM_TARGET(AssimpCopyBinaries


Add back some variable settings for capnproto.

--- cmake/External/capnproto.cmake
+++ cmake/External/capnproto.cmake
@@ -44,6 +44,13 @@
       LOG_INSTALL 1
       )

+    set(CAPNP_FOUND TRUE)
+    set(CAPNP_EXECUTABLE ${capnp_INSTALL}/bin/capnp)
+    set(CAPNPC_CXX_EXECUTABLE ${capnp_INSTALL}/bin/capnpc-c++)
+    set(CAPNP_INCLUDE_DIRS ${capnp_INSTALL}/include)
+    set(CAPNP_INCLUDE_DIRECTORY ${capnp_INSTALL}/include)
+    set(CAPNP_EXTERNAL TRUE)
+
     list(APPEND external_project_dependencies capnp)

   endif()


cmake: remove redundant gcc warning flags

These flags were already covered by -Wall or -Wextra.

--- cmake/HextEnableWarnings.cmake
+++ cmake/HextEnableWarnings.cmake
@@ -14,37 +14,25 @@
     "-Wall"
     "-Wcast-align"
     "-Wcast-qual"
-    "-Wchar-subscripts"
-    "-Wcomment"
     "-Wconversion"
     "-Wctor-dtor-privacy"
     "-Wdisabled-optimization"
     "-Weffc++"
     "-Wextra"
     "-Wfloat-equal"
-    "-Wformat-nonliteral"
-    "-Wformat-security"
-    "-Wformat-y2k"
     "-Wformat=2"
     "-Wimport"
-    "-Winit-self"
     "-Winvalid-pch"
     "-Wlogical-op"
     "-Wlong-long"
-    "-Wmissing-braces"
-    "-Wmissing-field-initializers"
     "-Wmissing-format-attribute"
     "-Wmissing-include-dirs"
     "-Wmissing-noreturn"
     "-Woverloaded-virtual"
     "-Wpacked"
-    "-Wparentheses"
     "-Wpointer-arith"
     "-Wredundant-decls"
-    "-Wreturn-type"
-    "-Wsequence-point"
     "-Wshadow"
-    "-Wsign-compare"
     "-Wsign-conversion"
     "-Wsign-promo"
     "-Wstack-protector"
@@ -52,19 +40,10 @@
     "-Wstrict-null-sentinel"
     "-Wstrict-overflow"
     "-Wswitch"
-    "-Wtrigraphs"
     "-Wundef"
-    "-Wuninitialized"
-    "-Wunknown-pragmas"
     "-Wunreachable-code"
     "-Wunused"
-    "-Wunused-function"
-    "-Wunused-label"
-    "-Wunused-parameter"
-    "-Wunused-value"
-    "-Wunused-variable"
     "-Wvariadic-macros"
-    "-Wvolatile-register-var"
     "-Wwrite-strings"
     "-pedantic"
     "-pedantic-errors"


Fix finding libcue

Fix finding libcue

--- cmake/Modules/FindLibCue.cmake
+++ cmake/Modules/FindLibCue.cmake
@@ -6,18 +6,18 @@
 #  LIBCUE_DEFINITIONS - Compiler switches required for using LibCue

 find_package(PkgConfig)
-pkg_check_modules(PC_LIBCUE QUIET libedit)
+pkg_check_modules(PC_LIBCUE QUIET libcue)
 set(LIBCUE_DEFINITIONS ${PC_LIBCUE_CFLAGS_OTHER})

-find_path(LIBCUE_INCLUDE_DIR libcue.h
+find_path(LIBCUE_INCLUDE_DIR libcue/libcue.h
           HINTS ${PC_LIBCUE_INCLUDEDIR} ${PC_LIBCUE_INCLUDE_DIRS}
-          PATH_SUFFIX libcue)
+          PATH_SUFFIXES libcue)

 find_library(LIBCUE_LIBRARY NAMES cue libcue
              HINTS ${PC_LIBCUE_LIBDIR} ${PC_LIBCUE_LIBRARY_DIRS})

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(LibCue  DEFAULT_MSG LIBCUE_LIBRARY LIBCUE_INCLUDE_DIR)
+find_package_handle_standard_args(LibCue DEFAULT_MSG LIBCUE_LIBRARY LIBCUE_INCLUDE_DIR)

 mark_as_advanced(LIBCUE_INCLUDE_DIR LIBCUE_LIBRARY)