SuperBuild: qt4 check variable exists before calling TO_NATIVE_PATH

--- SuperBuild/CMake/External_qt4.cmake
+++ SuperBuild/CMake/External_qt4.cmake
@@ -43,10 +43,15 @@
   set(FT_INCLUDE ${_SB_FREETYPE_INCLUDE_DIRS})
 endif()

-file(TO_NATIVE_PATH ${FT_INCLUDE} FT_INCLUDE_NATIVE)
-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)
+if(FT_INCLUDE)
+  file(TO_NATIVE_PATH ${FT_INCLUDE} FT_INCLUDE_NATIVE)
+endif()
+
+if(SB_INSTALL_PREFIX)
+  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)
+endif()

 if(WIN32)
   set(QT4_BIN_EXT ".exe")


COMP: wrong lib name

COMP: wrong lib name

--- Superbuild/CMake/External_qt4.cmake
+++ Superbuild/CMake/External_qt4.cmake
@@ -6,7 +6,7 @@
 message(STATUS "Setup Qt4 ...")

 if(USE_SYSTEM_QT4)
-  find_package ( QT4 )
+  find_package ( Qt4 )
   add_custom_target(${proj})
   message(STATUS "  Using Qt4 system version")
 else()


libfnord -> libstx

libfnord -> libstx

--- src/stx/protobuf/FindProtobuf.cmake
+++ src/stx/protobuf/FindProtobuf.cmake
@@ -80,7 +80,7 @@
       OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.cc"
              "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.h"
       COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE}
-      ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} --proto_path ${PROTOBUF_INCLUDE_DIR} --proto_path ${FNORD_SOURCE_DIR}/fnord ${PROTOC_ARGS} ${ABS_FIL}
+      ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} --proto_path ${PROTOBUF_INCLUDE_DIR} --proto_path ${FNORD_SOURCE_DIR}/stx ${PROTOC_ARGS} ${ABS_FIL}
       DEPENDS ${ABS_FIL}
       COMMENT "Running C++ protocol buffer compiler on ${FIL}"
       VERBATIM )


Extend macros acg_append_files_recursive acg_append_files to not include files starting with a dot

git-svn-id: e0b5bbb11d0e9fdbbfcabba14dc32ad5d6b235bd@329 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCommon.cmake
+++ cmake/ACGCommon.cmake
@@ -193,20 +193,35 @@
 endmacro ()

 # append all files with extension "ext" in the "dirs" directories to "ret"
+# excludes all files starting with a '.' (dot)
 macro (acg_append_files ret ext)
   foreach (_dir ${ARGN})
     file (GLOB _files "${_dir}/${ext}")
+    foreach (_file ${_files})
+      get_filename_component (_filename ${_file} NAME)
+      if (_filename MATCHES "^[.]")
+	list (REMOVE_ITEM _files ${_file})
+      endif ()
+    endforeach ()
     list (APPEND ${ret} ${_files})
   endforeach ()
 endmacro ()

 # append all files with extension "ext" in the "dirs" directories and its subdirectories to "ret"
+# excludes all files starting with a '.' (dot)
 macro (acg_append_files_recursive ret ext)
   foreach (_dir ${ARGN})
     file (GLOB_RECURSE _files "${_dir}/${ext}")
+    foreach (_file ${_files})
+      get_filename_component (_filename ${_file} NAME)
+      if (_filename MATCHES "^[.]")
+	list (REMOVE_ITEM _files ${_file})
+      endif ()
+    endforeach ()
     list (APPEND ${ret} ${_files})
   endforeach ()
 endmacro ()
+

 # drop all "*T.cc" files from list
 macro (acg_drop_templates list)


Minor fix to finding blosc on unix when both release and debug variants are available

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/FindBlosc.cmake
+++ cmake/FindBlosc.cmake
@@ -328,7 +328,7 @@
 if(BLOSC_USE_STATIC_LIBS)
   set(BLOSC_LIB_TYPE STATIC)
 elseif(UNIX)
-  get_filename_component(_BLOSC_EXT ${Blosc_LIBRARY} EXT)
+  get_filename_component(_BLOSC_EXT ${Blosc_LIBRARY_RELEASE} EXT)
   if(_BLOSC_EXT STREQUAL ".a")
     set(BLOSC_LIB_TYPE STATIC)
   elseif(_BLOSC_EXT STREQUAL ".so" OR


Bootstrap only static Zlib

Bootstrap only static Zlib

--- cmake/bootstrap.cmake
+++ cmake/bootstrap.cmake
@@ -247,8 +247,28 @@
   y_download("https://zlib.net/${_package}.tar.xz" SHA1 "e1cb0d5c92da8e9a8c2635dfa249c341dfd00322")
   y_extract("${_package}.tar.xz" DIR ${_package})
   y_cmake(${_package}
+    TARGET "zlibstatic"
     CONFIG ${CONFIGS}
     OPTIONS -DSKIP_INSTALL_FILES=ON)
+  file(INSTALL
+    ${BUILD_DIR}/${_package}/zconf.h
+    ${BUILD_DIR}/${_package}/zlib.h
+    DESTINATION ${PREFIX_DIR}/include)
+  if(WIN32)
+    if(WITH_RELEASE)
+      file(INSTALL
+        ${BUILD_DIR}/${_package}/RelWithDebInfo/zlibstatic.lib
+        ${BUILD_DIR}/${_package}/zlibstatic.dir/RelWithDebInfo/zlibstatic.pdb
+        DESTINATION ${PREFIX_DIR}/lib)
+    endif()
+    if(WITH_DEBUG)
+      file(RENAME ${BUILD_DIR}/${_package}/zlibstatic.dir/Debug/zlibstatic.pdb ${BUILD_DIR}/${_package}/zlibstatic.dir/Debug/zlibstaticd.pdb)
+      file(INSTALL
+        ${BUILD_DIR}/${_package}/Debug/zlibstaticd.lib
+        ${BUILD_DIR}/${_package}/zlibstatic.dir/Debug/zlibstaticd.pdb
+        DESTINATION ${PREFIX_DIR}/lib)
+    endif()
+  endif()
 endif()

 if("libjpeg" IN_LIST _y_packages)
@@ -289,9 +309,19 @@
   set(_package "libpng-${_version}")
   y_download("https://downloads.sourceforge.net/project/libpng/libpng16/${_version}/${_package}.tar.xz" SHA1 "0df1561aa1da610e892239348970d574b14deed0")
   y_extract("${_package}.tar.xz" DIR ${_package})
-  y_cmake(${_package}
-    CONFIG ${CONFIGS}
-    OPTIONS -DPNG_SHARED=OFF -DPNG_TESTS=OFF -DSKIP_INSTALL_EXECUTABLES=ON -DSKIP_INSTALL_EXPORT=ON -DSKIP_INSTALL_FILES=ON -DSKIP_INSTALL_PROGRAMS=ON)
+  y_replace(${BUILD_DIR}/${_package}/CMakeLists.txt
+    "  find_package(ZLIB REQUIRED)"
+    "  #find_package(ZLIB REQUIRED)")
+  y_cmake(${_package}
+    CONFIG ${CONFIGS}
+    OPTIONS
+      -DPNG_SHARED=OFF
+      -DPNG_TESTS=OFF
+      -DSKIP_INSTALL_EXECUTABLES=ON
+      -DSKIP_INSTALL_EXPORT=ON
+      -DSKIP_INSTALL_FILES=ON
+      -DSKIP_INSTALL_PROGRAMS=ON
+      -DZLIB_INCLUDE_DIR=${PREFIX_DIR}/include)
 endif()

 if("libvorbis" IN_LIST _y_packages)


libc++: Perform configuration checks with -nodefaultlibs

We're compiling libc++ with -nodefaultlibs, so we should also pass this option
during the configuration checks to ensure those checks are consistent with the
actual build.

The primary motivation here is to ease cross-compilation against a non-standard
set of C++ libraries. Previously, the configuration checks would attempt to link
against the standard C++ libraries, which would cause link failures when
cross-compiling, even though the actual library link would go through correctly
(because of the use of -nodefaultlibs and explicitly specifying any needed
libraries). This is more correct even ignoring the motivation, however.

Patch by Shoaib Meenai!

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@279584 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -1,5 +1,26 @@
 include(CheckLibraryExists)
 include(CheckCXXCompilerFlag)
+
+check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
+check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
+
+# libc++ is built with -nodefaultlibs, so we want all our checks to also
+# use this option, otherwise we may end up with an inconsistency between
+# the flags we think we require during configuration (if the checks are
+# performed without -nodefaultlibs) and the flags that are actually
+# required during compilation (which has the -nodefaultlibs). libc is
+# required for the link to go through.
+check_cxx_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+  list(APPEND CMAKE_REQUIRED_LIBRARIES -nodefaultlibs)
+  if (LIBCXX_HAS_C_LIB)
+    list(APPEND CMAKE_REQUIRED_LIBRARIES c)
+  endif ()
+  if (LIBCXX_HAS_GCC_S_LIB)
+    list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
+  endif ()
+endif ()
+
 include(CheckLibcxxAtomic)

 # Check compiler flags
@@ -14,7 +35,5 @@

 # Check libraries
 check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
-check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
 check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
 check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
-check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)


Fixed boost standard library linking settings.

Former-commit-id: 5c753cfd7880573c92fa084c0cb3a004867376c6

--- cmake/externals.cmake
+++ cmake/externals.cmake
@@ -1,216 +1,219 @@
-cmake_policy(SET CMP0015 OLD)
-
-# lib dir
-link_directories("${SOFA_LIB_DIR}")
-link_directories("${SOFA_LIB_OS_DIR}")
-if (NOT SOFA-EXTERNAL_LIBRARY_DIR STREQUAL "")
-    link_directories("${SOFA-EXTERNAL_LIBRARY_DIR}")
-endif()
-
-# include dirs
-if(WIN32)
-    list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_INC_DIR}")
-endif()
-if(NOT SOFA-EXTERNAL_INCLUDE_DIR STREQUAL "")
-    list(APPEND GLOBAL_INCLUDE_DIRECTORIES ${SOFA-EXTERNAL_INCLUDE_DIR})
-endif()
-list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_FRAMEWORK_DIR}")
-list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_MODULES_DIR}")
-list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_APPLICATIONS_DIR}")
-list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_APPLICATIONS_PLUGINS_DIR}")
-list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_EXTLIBS_DIR}")
-list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_BUILD_DIR}/misc/include") # Generated files
-
-
-## Boost
-if(SOFA-EXTERNAL_BOOST)
-    if(NOT SOFA-EXTERNAL_BOOST_PATH STREQUAL "")
-        set(BOOST_ROOT ${SOFA-EXTERNAL_BOOST_PATH})
-    endif()
-	if(WIN32)
-		if(BOOST_ROOT)
-			file(GLOB ALL_BOOST_SUBDIRS "${BOOST_ROOT}/*")
-			if(NOT ALL_BOOST_SUBDIRS STREQUAL "")
-
-				if(CMAKE_CL_64)
-					set(BOOST_ARCH "64")
-				else()
-					set(BOOST_ARCH "32")
-				endif()
-
-				## try to find the proper lib dir according to the current architecture (32 / 64 bit)
-				foreach(BOOST_SUBDIR ${ALL_BOOST_SUBDIRS})
-					if(IS_DIRECTORY ${BOOST_SUBDIR})
-						if(BOOST_SUBDIR MATCHES ".*lib.*")
-							if(BOOST_SUBDIR MATCHES ".*${BOOST_ARCH}.*")
-								list(APPEND BOOST_LIBRARYDIR "${BOOST_SUBDIR}")
-							endif()
-						endif()
-					endif()
-				endforeach()
-
-				## if no lib dir has been found according to the current architecture, we assume the user built only the needed one and did not set an architecture prefix
-				if(NOT BOOST_LIBRARYDIR)
-					foreach(BOOST_SUBDIR ${ALL_BOOST_SUBDIRS})
-						if(IS_DIRECTORY ${BOOST_SUBDIR})
-							if(BOOST_SUBDIR MATCHES ".*lib.*")
-								list(APPEND BOOST_LIBRARYDIR "${BOOST_SUBDIR}")
-							endif()
-						endif()
-					endforeach()
-				endif()
-
-				endif()
-		endif()
-	endif()
-
-	if(SOFA-MISC_STATIC_LINK_BOOST)
-		set(Boost_USE_STATIC_LIBS ON)
-		set(Boost_USE_STATIC_RUNTIME ON)
-	else()
-		set(Boost_USE_STATIC_LIBS OFF)
-		set(Boost_USE_STATIC_RUNTIME OFF)
-	endif()
-
-	if(WIN32)
-		  # Setting some more suffixes for the library
-		set(Boost_LIB_PREFIX "lib") #if you compile BOOST yourself then the lib is appended to the name
-	endif()
-
-    set(Boost_USE_MULTITHREADED ON)
-    find_package("Boost" REQUIRED COMPONENTS thread graph system)
-    set(Boost_LIB_DIAGNOSTIC_DEFINITIONS ${Boost_LIB_DIAGNOSTIC_DEFINITIONS} CACHE INTERNAL "Boost lib diagnostic definitions" FORCE)
-    set(GLOBAL_COMPILER_DEFINES ${GLOBAL_COMPILER_DEFINES} BOOST_ALL_NO_LIB CACHE INTERNAL "Global Compiler Defines" FORCE)
-    list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
-#    message( "Boost - lib path: " ${Boost_LIBRARY_DIRS} " - include path: " ${Boost_INCLUDE_DIRS} )
-else()
-    list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA-EXTERNAL_BOOST_PATH}")
-endif()
-
-# packages and libraries
-
-## opengl / glew / glut
-if (NOT SOFA-MISC_NO_OPENGL)
-    find_package(OPENGL REQUIRED)
-    unset(GLUT_LIBRARIES CACHE) # force remove glut path to be able to switch glut/freeglut
-    if(WIN32)
-        list(FIND OPENGL_LIBRARIES "glu32" GLU32_INDEX)
-        if(GLU32_INDEX EQUAL -1)
-            list(APPEND OPENGL_LIBRARIES "glu32")
-        endif()
-        if(SOFA-EXTERNAL_FREEGLUT)
-            set(GLUT_LIBRARIES "freeglut")
-        else()
-            set(GLUT_LIBRARIES "glut32")
-        endif()
-        if(SOFA-EXTERNAL_GLEW)
-            set(GLEW_LIBRARIES "glew32")
-        else()
-            set(GLEW_LIBRARIES "")
-        endif()
-    else()
-        if(NOT PS3)
-            if (SOFA-EXTERNAL_FREEGLUT)
-                find_package(GLUT REQUIRED)
-            else()
-                if(APPLE)
-                    find_library(GLUT_LIBRARIES "GLUT")
-                else()
-                    find_library(GLUT_LIBRARIES "glut")
-                endif()
-            endif()
-        endif()
-        ## GLU
-        if(UNIX)
-            if(NOT APPLE)
-                list(FIND GLUT_LIBRARIES GLU GLU_INDEX)
-                if(GLU_INDEX EQUAL -1)
-                    list(APPEND GLUT_LIBRARIES GLU)
-                endif()
-                list(FIND GLUT_LIBRARIES X11 X11_INDEX)
-                if(X11_INDEX EQUAL -1)
-                    list(APPEND GLUT_LIBRARIES X11)
-                endif()
-            endif()
-            list(FIND GLUT_LIBRARIES dl DL_INDEX)
-            if(DL_INDEX EQUAL -1)
-                list(APPEND GLUT_LIBRARIES dl)
-            endif()
-        endif()
-        sofa_remove_duplicates(GLUT_LIBRARIES)
-        if(SOFA-EXTERNAL_GLEW AND NOT PS3)
-            find_package(GLEW REQUIRED)
-        else()
-            set(GLEW_LIBRARIES "")
-        endif()
-    endif()
-else()
-    set(OPENGL_LIBRARIES "")
-    set(GLUT_LIBRARIES "")
-    set(GLEW_LIBRARIES "")
-endif()
-
-## libpng
-if (SOFA-EXTERNAL_PNG)
-    if(WIN32)
-        set(PNG_LIBRARIES "libpng")
-    else()
-        if(SOFA-EXTERNAL_PNG_SPECIFIC_VERSION)
-            set(PNG_LIBRARIES "${SOFA-EXTERNAL_PNG_VERSION}")
-        else()
-            #find_library(PNG_LIBRARIES "png")
-            find_package(PNG REQUIRED)
-            list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIR}")
-        endif()
-    endif()
-    if(PS3)
-        set(PNG_LIBRARIES "${SOFA_LIB_OS_DIR}/libpng.a")
-        set(PNG_INCLUDE_DIR ${SOFA_INC_DIR})
-    endif(PS3)
-else()
-    set(PNG_LIBRARIES "")
-endif()
-
-set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} CACHE INTERNAL "OpenGL Library")
-set(GLEW_LIBRARIES ${GLEW_LIBRARIES} CACHE INTERNAL "GLEW Library")
-set(GLUT_LIBRARIES ${GLUT_LIBRARIES} CACHE INTERNAL "GLUT Library")
-set(PNG_LIBRARIES ${PNG_LIBRARIES} CACHE INTERNAL "PNG Library")
-
-RegisterProjects(${OPENGL_LIBRARIES})
-RegisterProjects(${GLEW_LIBRARIES} OPTION SOFA-EXTERNAL_GLEW COMPILE_DEFINITIONS SOFA_HAVE_GLEW)
-if(SOFA-EXTERNAL_FREEGLUT)
-    RegisterProjects(${GLUT_LIBRARIES} COMPILE_DEFINITIONS SOFA_HAVE_FREEGLUT)
-else()
-    RegisterProjects(${GLUT_LIBRARIES})
-endif()
-RegisterProjects(${PNG_LIBRARIES} OPTION SOFA-EXTERNAL_PNG COMPILE_DEFINITIONS SOFA_HAVE_PNG)
-
-
-## Zlib (SOFA-EXTERNAL_ZLIB)
-# Note: zlib has to be registered AFTER libpng, because zlib is part of PNG_LIBRARIES; this way,
-# GLOBAL_PROJECT_OPTION_COMPILERDEFINITIONS_zlib is set to SOFA_HAS_ZLIB (and not SOFA_HAVE_PNG)
-# (This is quite a ugly workaround, I agree)
-if(WIN32 OR XBOX OR PS3)
-    if(PS3)
-        set(ZLIB_LIBRARIES "${SOFA_LIB_OS_DIR}/zlib.a")
-        set(ZLIB_INCLUDE_DIR ${SOFA_INC_DIR})
-    else()
-        set(ZLIB_LIBRARIES "zlib")
-    endif(PS3)
-else()
-    find_library(ZLIB_LIBRARIES "z")
-endif()
-set(ZLIB_LIBRARIES ${ZLIB_LIBRARIES} CACHE INTERNAL "ZLib Library")
-if (SOFA-EXTERNAL_ZLIB)
-    set(ZLIB_LIBRARIES_OPTIONAL ${ZLIB_LIBRARIES} CACHE INTERNAL "ZLib Library")
-else()
-    set(ZLIB_LIBRARIES_OPTIONAL "" CACHE INTERNAL "ZLib Library (optional)")
-endif()
-RegisterProjects(${ZLIB_LIBRARIES} OPTION SOFA-EXTERNAL_ZLIB COMPILE_DEFINITIONS SOFA_HAVE_ZLIB)
-
-
-
-# enable unit tests
-if(SOFA-MISC_TESTS)
-    enable_testing()
-endif()
+cmake_policy(SET CMP0015 OLD)
+
+# lib dir
+link_directories("${SOFA_LIB_DIR}")
+link_directories("${SOFA_LIB_OS_DIR}")
+if (NOT SOFA-EXTERNAL_LIBRARY_DIR STREQUAL "")
+    link_directories("${SOFA-EXTERNAL_LIBRARY_DIR}")
+endif()
+
+# include dirs
+if(WIN32)
+    list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_INC_DIR}")
+endif()
+if(NOT SOFA-EXTERNAL_INCLUDE_DIR STREQUAL "")
+    list(APPEND GLOBAL_INCLUDE_DIRECTORIES ${SOFA-EXTERNAL_INCLUDE_DIR})
+endif()
+list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_FRAMEWORK_DIR}")
+list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_MODULES_DIR}")
+list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_APPLICATIONS_DIR}")
+list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_APPLICATIONS_PLUGINS_DIR}")
+list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_EXTLIBS_DIR}")
+list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_BUILD_DIR}/misc/include") # Generated files
+
+
+## Boost
+if(SOFA-EXTERNAL_BOOST)
+    if(NOT SOFA-EXTERNAL_BOOST_PATH STREQUAL "")
+        set(BOOST_ROOT ${SOFA-EXTERNAL_BOOST_PATH})
+    endif()
+	if(WIN32)
+		if(BOOST_ROOT)
+			file(GLOB ALL_BOOST_SUBDIRS "${BOOST_ROOT}/*")
+			if(NOT ALL_BOOST_SUBDIRS STREQUAL "")
+
+				if(CMAKE_CL_64)
+					set(BOOST_ARCH "64")
+				else()
+					set(BOOST_ARCH "32")
+				endif()
+
+				## try to find the proper lib dir according to the current architecture (32 / 64 bit)
+				foreach(BOOST_SUBDIR ${ALL_BOOST_SUBDIRS})
+					if(IS_DIRECTORY ${BOOST_SUBDIR})
+						if(BOOST_SUBDIR MATCHES ".*lib.*")
+							if(BOOST_SUBDIR MATCHES ".*${BOOST_ARCH}.*")
+								list(APPEND BOOST_LIBRARYDIR "${BOOST_SUBDIR}")
+							endif()
+						endif()
+					endif()
+				endforeach()
+
+				## if no lib dir has been found according to the current architecture, we assume the user built only the needed one and did not set an architecture prefix
+				if(NOT BOOST_LIBRARYDIR)
+					foreach(BOOST_SUBDIR ${ALL_BOOST_SUBDIRS})
+						if(IS_DIRECTORY ${BOOST_SUBDIR})
+							if(BOOST_SUBDIR MATCHES ".*lib.*")
+								list(APPEND BOOST_LIBRARYDIR "${BOOST_SUBDIR}")
+							endif()
+						endif()
+					endforeach()
+				endif()
+
+				endif()
+		endif()
+	endif()
+
+	if(SOFA-MISC_STATIC_LINK_BOOST)
+		set(Boost_USE_STATIC_LIBS ON)
+	else()
+		set(Boost_USE_STATIC_LIBS OFF)
+	endif()
+
+	# this setting should match the standard library usage of Sofa libraries, not the value of SOFA-MISC_STATIC_LINK_BOOST
+	# ie. on Win32 it should be OFF if we link with msvcrt (/MD) or ON if we link with libcmt (/MT).
+	# Sofa links with msvcrt for now (which is the recommended default on Windows).
+	set(Boost_USE_STATIC_RUNTIME OFF)
+
+	if(WIN32)
+		  # Setting some more suffixes for the library
+		set(Boost_LIB_PREFIX "lib") #if you compile BOOST yourself then the lib is appended to the name
+	endif()
+
+    set(Boost_USE_MULTITHREADED ON)
+    find_package("Boost" REQUIRED COMPONENTS thread graph system)
+    set(Boost_LIB_DIAGNOSTIC_DEFINITIONS ${Boost_LIB_DIAGNOSTIC_DEFINITIONS} CACHE INTERNAL "Boost lib diagnostic definitions" FORCE)
+    set(GLOBAL_COMPILER_DEFINES ${GLOBAL_COMPILER_DEFINES} BOOST_ALL_NO_LIB CACHE INTERNAL "Global Compiler Defines" FORCE)
+    list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
+#    message( "Boost - lib path: " ${Boost_LIBRARY_DIRS} " - include path: " ${Boost_INCLUDE_DIRS} )
+else()
+    list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA-EXTERNAL_BOOST_PATH}")
+endif()
+
+# packages and libraries
+
+## opengl / glew / glut
+if (NOT SOFA-MISC_NO_OPENGL)
+    find_package(OPENGL REQUIRED)
+    unset(GLUT_LIBRARIES CACHE) # force remove glut path to be able to switch glut/freeglut
+    if(WIN32)
+        list(FIND OPENGL_LIBRARIES "glu32" GLU32_INDEX)
+        if(GLU32_INDEX EQUAL -1)
+            list(APPEND OPENGL_LIBRARIES "glu32")
+        endif()
+        if(SOFA-EXTERNAL_FREEGLUT)
+            set(GLUT_LIBRARIES "freeglut")
+        else()
+            set(GLUT_LIBRARIES "glut32")
+        endif()
+        if(SOFA-EXTERNAL_GLEW)
+            set(GLEW_LIBRARIES "glew32")
+        else()
+            set(GLEW_LIBRARIES "")
+        endif()
+    else()
+        if(NOT PS3)
+            if (SOFA-EXTERNAL_FREEGLUT)
+                find_package(GLUT REQUIRED)
+            else()
+                if(APPLE)
+                    find_library(GLUT_LIBRARIES "GLUT")
+                else()
+                    find_library(GLUT_LIBRARIES "glut")
+                endif()
+            endif()
+        endif()
+        ## GLU
+        if(UNIX)
+            if(NOT APPLE)
+                list(FIND GLUT_LIBRARIES GLU GLU_INDEX)
+                if(GLU_INDEX EQUAL -1)
+                    list(APPEND GLUT_LIBRARIES GLU)
+                endif()
+                list(FIND GLUT_LIBRARIES X11 X11_INDEX)
+                if(X11_INDEX EQUAL -1)
+                    list(APPEND GLUT_LIBRARIES X11)
+                endif()
+            endif()
+            list(FIND GLUT_LIBRARIES dl DL_INDEX)
+            if(DL_INDEX EQUAL -1)
+                list(APPEND GLUT_LIBRARIES dl)
+            endif()
+        endif()
+        sofa_remove_duplicates(GLUT_LIBRARIES)
+        if(SOFA-EXTERNAL_GLEW AND NOT PS3)
+            find_package(GLEW REQUIRED)
+        else()
+            set(GLEW_LIBRARIES "")
+        endif()
+    endif()
+else()
+    set(OPENGL_LIBRARIES "")
+    set(GLUT_LIBRARIES "")
+    set(GLEW_LIBRARIES "")
+endif()
+
+## libpng
+if (SOFA-EXTERNAL_PNG)
+    if(WIN32)
+        set(PNG_LIBRARIES "libpng")
+    else()
+        if(SOFA-EXTERNAL_PNG_SPECIFIC_VERSION)
+            set(PNG_LIBRARIES "${SOFA-EXTERNAL_PNG_VERSION}")
+        else()
+            #find_library(PNG_LIBRARIES "png")
+            find_package(PNG REQUIRED)
+            list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIR}")
+        endif()
+    endif()
+    if(PS3)
+        set(PNG_LIBRARIES "${SOFA_LIB_OS_DIR}/libpng.a")
+        set(PNG_INCLUDE_DIR ${SOFA_INC_DIR})
+    endif(PS3)
+else()
+    set(PNG_LIBRARIES "")
+endif()
+
+set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} CACHE INTERNAL "OpenGL Library")
+set(GLEW_LIBRARIES ${GLEW_LIBRARIES} CACHE INTERNAL "GLEW Library")
+set(GLUT_LIBRARIES ${GLUT_LIBRARIES} CACHE INTERNAL "GLUT Library")
+set(PNG_LIBRARIES ${PNG_LIBRARIES} CACHE INTERNAL "PNG Library")
+
+RegisterProjects(${OPENGL_LIBRARIES})
+RegisterProjects(${GLEW_LIBRARIES} OPTION SOFA-EXTERNAL_GLEW COMPILE_DEFINITIONS SOFA_HAVE_GLEW)
+if(SOFA-EXTERNAL_FREEGLUT)
+    RegisterProjects(${GLUT_LIBRARIES} COMPILE_DEFINITIONS SOFA_HAVE_FREEGLUT)
+else()
+    RegisterProjects(${GLUT_LIBRARIES})
+endif()
+RegisterProjects(${PNG_LIBRARIES} OPTION SOFA-EXTERNAL_PNG COMPILE_DEFINITIONS SOFA_HAVE_PNG)
+
+
+## Zlib (SOFA-EXTERNAL_ZLIB)
+# Note: zlib has to be registered AFTER libpng, because zlib is part of PNG_LIBRARIES; this way,
+# GLOBAL_PROJECT_OPTION_COMPILERDEFINITIONS_zlib is set to SOFA_HAS_ZLIB (and not SOFA_HAVE_PNG)
+# (This is quite a ugly workaround, I agree)
+if(WIN32 OR XBOX OR PS3)
+    if(PS3)
+        set(ZLIB_LIBRARIES "${SOFA_LIB_OS_DIR}/zlib.a")
+        set(ZLIB_INCLUDE_DIR ${SOFA_INC_DIR})
+    else()
+        set(ZLIB_LIBRARIES "zlib")
+    endif(PS3)
+else()
+    find_library(ZLIB_LIBRARIES "z")
+endif()
+set(ZLIB_LIBRARIES ${ZLIB_LIBRARIES} CACHE INTERNAL "ZLib Library")
+if (SOFA-EXTERNAL_ZLIB)
+    set(ZLIB_LIBRARIES_OPTIONAL ${ZLIB_LIBRARIES} CACHE INTERNAL "ZLib Library")
+else()
+    set(ZLIB_LIBRARIES_OPTIONAL "" CACHE INTERNAL "ZLib Library (optional)")
+endif()
+RegisterProjects(${ZLIB_LIBRARIES} OPTION SOFA-EXTERNAL_ZLIB COMPILE_DEFINITIONS SOFA_HAVE_ZLIB)
+
+
+
+# enable unit tests
+if(SOFA-MISC_TESTS)
+    enable_testing()
+endif()


fix install folder

fix install folder

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

--- cmake/gsInstall.cmake
+++ cmake/gsInstall.cmake
@@ -115,9 +115,9 @@
 #        PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

 # For gsConfig.h
-install(DIRECTORY ${GISMO_DATA_DIR} DESTINATION gismodata)
+install(DIRECTORY ${GISMO_DATA_DIR} DESTINATION share/gismodata)
 # todo: search environment variable as well
-set(GISMO_DATA_DIR ${CMAKE_INSTALL_PREFIX}/gismodata/)
+set(GISMO_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/gismodata/)
 configure_file ("${PROJECT_SOURCE_DIR}/src/gsCore/gsConfig.h.in"
                 "${PROJECT_BINARY_DIR}/gsCore/gsConfig_install.h" )
 install(FILES ${PROJECT_BINARY_DIR}/gsCore/gsConfig_install.h


fix version

fix version

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

--- cmake/gsVersion.cmake
+++ cmake/gsVersion.cmake
@@ -26,16 +26,16 @@
 set(${PROJECT_NAME}_MAJOR_VERSION "0")
 set(${PROJECT_NAME}_MINOR_VERSION "8")
 set(${PROJECT_NAME}_PATCH_VERSION "1")
-set(${PROJECT_NAME}_VERSION_TYPE  "alpha")
+#set(${PROJECT_NAME}_VERSION_TYPE  "alpha")

 # Constuct version info
 if( "${${PROJECT_NAME}_PATCH_VERSION}" STREQUAL "0")
     set(${PROJECT_NAME}_VERSION
-        "${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}${${PROJECT_NAME}_VERSION_TYPE}"
+        "${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}$" #{${PROJECT_NAME}_VERSION_TYPE}
         CACHE INTERNAL "${PROJECT_NAME} version number")
 else()
     set(${PROJECT_NAME}_VERSION
-        "${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION}${${PROJECT_NAME}_VERSION_TYPE}"
+        "${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION}" #{${PROJECT_NAME}_VERSION_TYPE}
         CACHE INTERNAL "${PROJECT_NAME} version number")
 endif()


Fix to link to the dynamic python library. Improves cross-distribution support in the binaries.

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

--- CMake/hoomd/HOOMDPythonSetup.cmake
+++ CMake/hoomd/HOOMDPythonSetup.cmake
@@ -32,11 +32,8 @@
 run_python("from distutils import sysconfig\; print sysconfig.get_python_version()" _python_version)
 string(REPLACE "." "" _python_version_no_dots ${_python_version})

-if (ENABLE_STATIC)
-    get_filename_component(_python_lib_first ${_python_static_lib_name} NAME)
-else (ENABLE_STATIC)
-    get_filename_component(_python_lib_first ${_python_dynamic_lib_name} NAME)
-endif (ENABLE_STATIC)
+# always link the dynamic python library
+get_filename_component(_python_lib_first ${_python_dynamic_lib_name} NAME)

 # add a blank suffix to the beginning to find the Python framework
 set(_old_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})


Undo small change to FindOpenCascade.cmake

Re-add FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXCAF TKXCAF) to the cmake file.

--- CMakeModules/FindOpenCascade.cmake
+++ CMakeModules/FindOpenCascade.cmake
@@ -90,6 +90,7 @@
 FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKTopAlgo TKTopAlgo)
 FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKV3d TKV3d)
 FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKVRML TKVRML)
+FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXCAF TKXCAF)
 FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXDEIGES TKXDEIGES)
 FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXDESTEP TKXDESTEP)
 FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXMesh TKXMesh)


From Eric Wing, adding message w.r.t debug OpenThreads library for when its not available.

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@6442 16af8721-9629-0410-8352-f15c8da7e697

--- CMakeModules/FindOpenThreads.cmake
+++ CMakeModules/FindOpenThreads.cmake
@@ -80,8 +80,9 @@
   SET(OPENTHREADS_FOUND "YES")
   # MESSAGE("-- Found OpenThreads: "${OPENTHREADS_LIBRARY})
   IF(NOT OPENTHREADS_LIBRARY_DEBUG)
-	  # MESSAGE("-- Warning Debug OpenThreads not found, using: ${OPENTHREADS_LIBRARY}")
-  	SET(OPENTHREADS_LIBRARY_DEBUG "${OPENTHREADS_LIBRARY}")
+	  #MESSAGE("-- Warning Debug OpenThreads not found, using: ${OPENTHREADS_LIBRARY}")
+	  #SET(OPENTHREADS_LIBRARY_DEBUG "${OPENTHREADS_LIBRARY}")
+	  SET(OPENTHREADS_LIBRARY_DEBUG "${OPENTHREADS_LIBRARY}" CACHE FILEPATH "Debug version of OpenThreads Library (use regular version if not available)" FORCE)
   ENDIF(NOT OPENTHREADS_LIBRARY_DEBUG)
 ENDIF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)


Patch #1430 Fixed GL render system build for TBB

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -60,6 +60,10 @@
 	if (OGRE_CONFIG_THREAD_PROVIDER STREQUAL "tbb")
 		set(OGRE_THREAD_PROVIDER 3)
 		include_directories(${TBB_INCLUDE_DIRS})
+		if (WIN32)
+			add_definitions(-D_WIN32_WINNT=0x0501)
+		endif ()
+
 		set(OGRE_THREAD_LIBRARIES ${TBB_LIBRARIES})
 	endif ()
 endif()


j'en ai marre

j'en ai marre

--- CMake/Modules/common.cmake
+++ CMake/Modules/common.cmake
@@ -25,4 +25,6 @@
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DASH_MBIT}")
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DASH_MBIT}")
 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${DASH_MBIT}")
+set (CCMAKE_EXE_LINKER_FLAGS "${CCMAKE_EXE_LINKER_FLAGS} ${DASH_MBIT}")
+set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${DASH_MBIT}")


Update DCMQI to v1.2.3

Update DCMQI to v1.2.3

Summary: Update DCMQI to v1.2.3 to fix a DICOM SEG loading issue

Test Plan: CI

Reviewers: O1 MITK Reviewer Group I, kislinsk

Reviewed By: O1 MITK Reviewer Group I, kislinsk

Differential Revision: https://phabricator.mitk.org/D456

--- 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 99192b76
+      GIT_TAG v1.2.3
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Small fix to non debug path

Small fix to non debug path

--- CMakeModules/FindPNG.cmake
+++ CMakeModules/FindPNG.cmake
@@ -10,7 +10,7 @@
 		set(PNG_FIND_QUIETLY TRUE)
 	endif(PNG_INCLUDE_DIR AND PNG_LIBRARY AND PNG_LIBRARY_DEBUG)
 else(PNG_FIND_DEBUG)
-	if(PNG_INCLUDE_DIR AND QUIKGRID_LIBRARY)
+	if(PNG_INCLUDE_DIR AND PNG_LIBRARY)
 		set(PNG_FIND_QUIETLY TRUE)
 	endif(PNG_INCLUDE_DIR AND PNG_LIBRARY)
 endif(PNG_FIND_DEBUG)


[cmake|doxygen] using code from eos-noon branch and expose doxygen conf file always

--- CMakeModules/doxygen.cmake
+++ CMakeModules/doxygen.cmake
@@ -1,9 +1,10 @@
+configure_file("eos.doxygen.in" "${CMAKE_BINARY_DIR}/eos.doxygen")
+
 include(FindDoxygen)
-configure_file("eos.doxygen.in" "${CMAKE_BINARY_DIR}/eos.doxygen")
+
 if(NOT DOXYGEN_FOUND)
   message(STATUS "Doxygen not found.  Contract documentation will not be generated.")
 else()
-  message(STATUS "Doxygen found.  Contract documentation will be generated.")
   set(DOXY_EOS_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" CACHE INTERNAL "Version string used in PROJECT_NUMBER.")
   # CMake strips trailing path separators off of variables it knows are paths,
   # so the trailing '/' Doxygen expects is embedded in the doxyfile.
@@ -14,17 +15,15 @@
   else(DOXYGEN_DOT_FOUND)
     set(DOXY_HAVE_DOT "NO" CACHE STRING "Doxygen to use dot for diagrams.")
   endif(DOXYGEN_DOT_FOUND)
-  configure_file("eos.doxygen.in" "${CMAKE_BINARY_DIR}/eos.doxygen")
   if(BUILD_DOXYGEN)
-     # !! Core developers who don't want to see the doxygen output on every build
-     # !! should remove the 'ALL' option from both commands below.
-     # Doxygen has issues making destination directories more than one level deep, so do it for it.
-     add_custom_target(make_doc_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${DOXY_DOC_DEST_DIR}")
-     add_custom_target(contract_documentation ALL
-         COMMAND "${DOXYGEN_EXECUTABLE}" "${CMAKE_BINARY_DIR}/eos.doxygen"
-         DEPENDS make_doc_dir
-         WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
-         COMMENT "Building doxygen documentation into ${DOXY_DOC_DEST_DIR}..."
-         VERBATIM)
+    message(STATUS "Doxygen found.  Contract documentation will be generated.")
+    # Doxygen has issues making destination directories more than one level deep, so do it for it.
+    add_custom_target(make_doc_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${DOXY_DOC_DEST_DIR}")
+    add_custom_target(contract_documentation ALL
+      COMMAND "${DOXYGEN_EXECUTABLE}" "${CMAKE_BINARY_DIR}/eos.doxygen"
+      DEPENDS make_doc_dir
+      WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+      COMMENT "Building doxygen documentation into ${DOXY_DOC_DEST_DIR}..."
+      VERBATIM)
   endif(BUILD_DOXYGEN)
 endif()


BUG: Update TubeTK to include version that addressed missing VTK files

--- Modules/Remote/TubeTK.remote.cmake
+++ Modules/Remote/TubeTK.remote.cmake
@@ -49,5 +49,5 @@
 "
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTubeTK.git
-  GIT_TAG "b0c153f4c2eb0033f218e9706a345a46c05e30ba"
+  GIT_TAG "c5df267f34bd8f8bb4e933c4f3a3c92b53e7a3f5"
   )


Packaging: Added required CPack field for unix debian packaging

--- apps/inviwo/packaging/packaging.cmake
+++ apps/inviwo/packaging/packaging.cmake
@@ -32,6 +32,7 @@
 include (InstallRequiredSystemLibraries)

 set(CPACK_PACKAGE_NAME                "Inviwo")
+set(CPACK_PACKAGE_CONTACT             "Inviwo Foundation <info@inviwo.org>")
 set(CPACK_PACKAGE_VENDOR              "Inviwo Foundation")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Interactive Visualization Workshop")
 set(CPACK_PACKAGE_VERSION_MAJOR       "${IVW_MAJOR_VERSION}")
@@ -116,6 +117,7 @@
 else()
     if(IVW_PACKAGE_INSTALLER)
         set(CPACK_GENERATOR "DEB")
+        set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.inviwo.org")
     else()
         set(CPACK_GENERATOR "TGZ")
     endif()


added case to java version regex

added case to java version regex

git-svn-id: 33ed6c3feaacb64944efc691d1ae8e09b17f2bf9@1582437 13f79535-47bb-0310-9956-ffa450edef68

--- tools/cmake/Modules/FindJava.cmake
+++ tools/cmake/Modules/FindJava.cmake
@@ -107,7 +107,7 @@
       # 2. OpenJDK 1.6
       # 3. GCJ 1.5
       # 4. Kaffe 1.4.2
-      if(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
+      if(var MATCHES "(java|openjdk) version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
         # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
         string( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
                 "\\1" Java_VERSION_STRING "${var}" )


Add special case for finding the in-tree ABI library.

When libcxx is built in-tree with libcxxabi it links against libcxxabi using
the name of the cmake target and not the actual library name. The cmake target
will not work with `find_library()`, so it needs special case handling.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@220121 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/HandleLibCXXABI.cmake
+++ cmake/Modules/HandleLibCXXABI.cmake
@@ -27,13 +27,20 @@
   # each run of find_library.
   set(LIBCXX_CXX_ABI_LIBRARIES "")
   foreach(alib ${abilibs})
-    unset(_Res CACHE)
-    find_library(_Res ${alib})
-    if (${_Res} STREQUAL "_Res-NOTFOUND")
-      message(FATAL_ERROR "Failed to find ABI library: ${alib}")
+    # cxxabi is a cmake target and not a library.
+    # Handle this special case explicitly.
+    # Otherwise use find_library to locate the correct binary.
+    if (alib STREQUAL "cxxabi")
+      list(APPEND LIBCXX_CXX_ABI_LIBRARIES cxxabi)
     else()
-      message(STATUS "Adding ABI library: ${_Res}")
-      list(APPEND LIBCXX_CXX_ABI_LIBRARIES ${_Res})
+      unset(_Res CACHE)
+      find_library(_Res ${alib})
+      if (${_Res} STREQUAL "_Res-NOTFOUND")
+        message(FATAL_ERROR "Failed to find ABI library: ${alib}")
+      else()
+        message(STATUS "Adding ABI library: ${_Res}")
+        list(APPEND LIBCXX_CXX_ABI_LIBRARIES ${_Res})
+      endif()
     endif()
   endforeach()


no debug output please

no debug output please

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -156,7 +156,6 @@
       list(APPEND _disable_vector_unit_list "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "sse4a")
    endif(USE_SSE2)
    foreach(_flag ${_march_flag_list})
-      message(STATUS "${_flag}")
       AddCompilerFlag("-march=${_flag}" _good)
       if(_good)
          break()


arch: arm: Remove -march compiler flag

arch: arm: Remove -march compiler flag

The ARM GCC `-march` compiler flag is completely redundant when the
`-mcpu` flag is specified, since the `-mcpu` selects the target ARM
architecture as well as CPU-specific optimisations.

In fact, it is disadvantageous to specify both `-march` and `-mcpu`
flags because the `-march` flag overrides and disables any CPU-specific
optimisations enabled by the `-mcpu` flag.

Signed-off-by: Stephanos Ioannidis <dc76e9f0c0006e8f919e0c515c66dbba3982f785@stephanos.io>

--- cmake/compiler/gcc/target_arm.cmake
+++ cmake/compiler/gcc/target_arm.cmake
@@ -14,22 +14,8 @@
     list(APPEND TOOLCHAIN_LD_FLAGS  -mthumb)
   endif()

-  set(ARCH_FOR_cortex-m0        armv6s-m        )
-  set(ARCH_FOR_cortex-m0plus    armv6s-m        )
-  set(ARCH_FOR_cortex-m3        armv7-m         )
-  set(ARCH_FOR_cortex-m4        armv7e-m        )
-  set(ARCH_FOR_cortex-m23       armv8-m.base    )
-  set(ARCH_FOR_cortex-m33       armv8-m.main+dsp)
-  set(ARCH_FOR_cortex-m33+nodsp armv8-m.main    )
-  set(ARCH_FOR_cortex-r4        armv7-r         )
-  set(ARCH_FOR_cortex-r5        armv7-r+idiv    )
-
-  if(ARCH_FOR_${GCC_M_CPU})
-      set(ARCH_FLAG -march=${ARCH_FOR_${GCC_M_CPU}})
-  endif()
-
-  list(APPEND TOOLCHAIN_C_FLAGS -mabi=aapcs ${ARCH_FLAG})
-  list(APPEND TOOLCHAIN_LD_FLAGS -mabi=aapcs ${ARCH_FLAG})
+  list(APPEND TOOLCHAIN_C_FLAGS -mabi=aapcs)
+  list(APPEND TOOLCHAIN_LD_FLAGS -mabi=aapcs)

   # Defines a mapping from GCC_M_CPU to FPU


Fix build

Fix build

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -43,9 +43,9 @@
       do_install
   )
   if(do_install)
+    set(${h_root_name} "${HUNTER_BASE}/Install/${h_tag}")
+  else()
     set(${h_root_name} "${HUNTER_BASE}/Source/${h_name}")
-  else()
-    set(${h_root_name} "${HUNTER_BASE}/Install/${h_tag}")
   endif()
   set(${h_root_name} "${${h_root_name}}" PARENT_SCOPE)
   set(ENV{${h_root_name}} "${${h_root_name}}")


on windows: don't link all plugins with mysqld, only do it for storage engines.

--- storage/mysql_storage_engine.cmake
+++ storage/mysql_storage_engine.cmake
@@ -42,7 +42,7 @@
     ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN)
     ADD_VERSION_INFO(${${engine}_LIB} SHARED ${engine}_SOURCES)
     ADD_LIBRARY(${${engine}_LIB} MODULE ${${engine}_SOURCES})
-    TARGET_LINK_LIBRARIES (${${engine}_LIB}  mysqlservices mysqld)
+    TARGET_LINK_LIBRARIES (${${engine}_LIB}  mysqlservices)
     IF(${engine}_LIBS)
       TARGET_LINK_LIBRARIES(${${engine}_LIB} ${${engine}_LIBS})
     ENDIF(${engine}_LIBS)
@@ -61,6 +61,8 @@
                       ${CMAKE_SOURCE_DIR}/extra/yassl/include)
   IF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
     ADD_DEFINITIONS(-DWITH_${engine}_STORAGE_ENGINE -DMYSQL_SERVER)
+  ELSEIF(${ENGINE_BUILD_TYPE} STREQUAL "DYNAMIC")
+    TARGET_LINK_LIBRARIES (${${engine}_LIB} mysqld)
   ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
 ENDIF(NOT SOURCE_SUBLIBS)
 ENDMACRO(MYSQL_STORAGE_ENGINE)


Disable more unused Paraview things

Disable more unused Paraview things

--- Superbuild/Projects/paraview.cmake
+++ Superbuild/Projects/paraview.cmake
@@ -6,6 +6,12 @@
     -DBUILD_TESTING:BOOL=OFF
     -DPARAVIEW_BUILD_QT_GUI:BOOL=ON
     -DPARAVIEW_ENABLE_PYTHON:BOOL=ON
+    -DPARAVIEW_ENABLE_CATALYST:BOOL=OFF
+    -DPARAVIEW_ENABLE_VTK_MODULES_AS_NEEDED:BOOL=FALSE
+    -DPARAVIEW_ENABLE_WEB:BOOL=FALSE
+    -DPARAVIEW_ENABLE_MATPLOTLIB:BOOL=FALSE
+    -DPARAVIEW_ENABLE_SPYPLOT_MARKER:BOOL=FALSE
+    -DPARAVIEW_BUILD_PLUGIN_Catalyst:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_AdiosReader:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_AnalyzeNIfTIIO:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_ArrowGlyph:BOOL=FALSE
@@ -25,6 +31,7 @@
     -DPARAVIEW_BUILD_PLUGIN_QuadView:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_SLACTools:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_SciberQuestToolKit:BOOL=FALSE
+    -DPARAVIEW_BUILD_PLUGIN_StreamingParticles:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_SierraPlotTools:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_SurfaceLIC:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_UncertaintyRendering:BOOL=FALSE


Fix Win32 build

Fix Win32 build

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[x] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation

--- PurpleAddLibrary.cmake
+++ PurpleAddLibrary.cmake
@@ -86,8 +86,9 @@
       COMPILE_DEFINITIONS "${THIS_DEFINITIONS}"
       SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
       LINK_LIBRARIES "${THIS_LINK_LIBRARIES}"
-      FOLDER "Transitional"
+      FOLDER "Libraries" PROJECT_LABEL "${NAME}"
       )
+
     if(NOT THIS_EXCLUDE_FROM_ALL)
       purple_install_pdb(${THIS_TARGET} DESTINATION bin COMPONENT ${SHORT_NAME}dev)
     endif(NOT THIS_EXCLUDE_FROM_ALL)


Skip the flatbuffers test cases in cmake.

--- tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
+++ tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
@@ -32,6 +32,7 @@
   OverridableFetchContent_Populate(flatbuffers)
 endif()

+option(FLATBUFFERS_BUILD_TESTS OFF)
 # Required for Windows, since it has macros called min & max which
 # clashes with std::min
 add_definitions(-DNOMINMAX=1)


Fix error of ITK headers.

Fix error of ITK headers.

--- add_dependencies.cmake
+++ add_dependencies.cmake
@@ -32,6 +32,7 @@

 FIND_PACKAGE (ITK REQUIRED)
 include(${ITK_USE_FILE})
+add_definitions("-DVCL_CAN_STATIC_CONST_INIT_FLOAT=0")

 set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror -g -fPIC")


Crossport r1000668 by lueck from trunk to the enterprise4 branch:

fixed typo not found by Yuri

svn path=/branches/kdepim/enterprise4/kdepim/; revision=1001156

--- kmail/kmail.kcfg.cmake
+++ kmail/kmail.kcfg.cmake
@@ -652,7 +652,7 @@
     <group name="OutOfOffice">
         <entry name="AllowOutOfOfficeSettings" type="Bool">
             <default>true</default>
-            Allow out-of-office settings to to be changeable by the user.
+            Allow out-of-office settings to be changeable by the user.
         </entry>
         <entry name="AllowOutOfOfficeUploadButNoSettings" type="Bool">
             <default>false</default>


build_tools:cmake:riscv: Fix the system library path (#5175)

Set the system library path to the RISC-V toolchain so the linker can
find the right libraries while building the RISC-V target.

--- build_tools/cmake/riscv.toolchain.cmake
+++ build_tools/cmake/riscv.toolchain.cmake
@@ -36,6 +36,7 @@
 set(CMAKE_AR "${RISCV_TOOLCHAIN_ROOT}/bin/llvm-ar")
 set(CMAKE_RANLIB "${RISCV_TOOLCHAIN_ROOT}/bin/llvm-ranlib")
 set(CMAKE_STRIP "${RISCV_TOOLCHAIN_ROOT}/bin/llvm-strip")
+set(CMAKE_SYSTEM_LIBRARY_PATH "${RISCV_TOOLCHAIN_ROOT}/sysroot/usr/lib")

 set(RISCV_COMPILER_FLAGS)
 set(RISCV_COMPILER_FLAGS_CXX)


More adjustments, we do need QT_GUI...

More adjustments, we do need QT_GUI...

We don't actually need the GUI, but the libraries that are enabled by
the flag are required. QT_SUPPORT is not enough in our case at least.

Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -21,7 +21,7 @@
   DEPENDS_OPTIONAL tbb png

   CMAKE_ARGS
-    -DPARAVIEW_BUILD_QT_GUI:BOOL=OFF
+    -DPARAVIEW_BUILD_QT_GUI:BOOL=ON
     -DPARAVIEW_ENABLE_QT_SUPPORT:BOOL=ON
     -DPARAVIEW_BUILD_SHARED_LIBS:BOOL=ON
     -DPARAVIEW_BUILD_TESTING:BOOL=OFF


Fix missing include directive

Fix missing include directive

--- standard/toolchain-android32.cmake
+++ standard/toolchain-android32.cmake
@@ -1,2 +1,3 @@
 set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
 set(CMAKE_ANDROID_ARM_MODE ON)
+include(${CMAKE_CURRENT_LIST_DIR}/toolchain-android.cmake)


Update gate file

Update gate file

--- HunterGate.cmake
+++ HunterGate.cmake
@@ -14,8 +14,8 @@

 cmake_minimum_required(VERSION 2.8.10)

-set(HUNTER_MINIMUM_VERSION "0.2.9")
-set(HUNTER_MINIMUM_VERSION_HASH a47509e078a71ab7abbc66fc20faf37b439c2440)
+set(HUNTER_MINIMUM_VERSION "0.3.1")
+set(HUNTER_MINIMUM_VERSION_HASH da6ec33da5b96e6e74a0e097b3a37f72614049f7)

 # Set HUNTER_ROOT cmake variable to suitable value.
 # Info about variable can be found in HUNTER_ROOT_INFO.


CMake: support sourcing environment on windows

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -24,19 +24,21 @@
 include(ucm)

 # Source environment
-if (CMAKE_CROSSCOMPILING)
+if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
+    execute_process(COMMAND cmd /c set OUTPUT_VARIABLE ENVIRONMENT)
+else ()
     execute_process(COMMAND env OUTPUT_VARIABLE ENVIRONMENT)
-    string(REGEX REPLACE "=[^\n]*\n?" ";" ENVIRONMENT "${ENVIRONMENT}")
-    set(IMPORT_URHO3D_VARIABLES_FROM_ENV BUILD_SHARED_LIBS)
-    foreach(key ${ENVIRONMENT})
-        list (FIND IMPORT_URHO3D_VARIABLES_FROM_ENV ${key} _index)
-        if ("${key}" MATCHES "^(URHO3D_|CMAKE_).+" OR ${_index} GREATER -1)
-            if (NOT DEFINED ${key})
-                set (${key} $ENV{${key}} CACHE STRING "" FORCE)
-            endif ()
+endif ()
+string(REGEX REPLACE "=[^\n]*\n?" ";" ENVIRONMENT "${ENVIRONMENT}")
+set(IMPORT_URHO3D_VARIABLES_FROM_ENV BUILD_SHARED_LIBS)
+foreach(key ${ENVIRONMENT})
+    list (FIND IMPORT_URHO3D_VARIABLES_FROM_ENV ${key} _index)
+    if ("${key}" MATCHES "^(URHO3D_|CMAKE_).+" OR ${_index} GREATER -1)
+        if (NOT DEFINED ${key})
+            set (${key} $ENV{${key}} CACHE STRING "" FORCE)
         endif ()
-    endforeach()
-endif ()
+    endif ()
+endforeach()

 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DURHO3D_DEBUG")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DURHO3D_DEBUG")


Validate apps first, since they might trigger plug-in build options.

--- CMake/ctkMacroSetupPlugins.cmake
+++ CMake/ctkMacroSetupPlugins.cmake
@@ -163,7 +163,7 @@
                                  "${plugin_dirswithoption};${previous_plugin_dirswithoption};${MY_APPS}"
                                  WITH_EXTERNALS)
   ctkMacroValidateBuildOptions("${CMAKE_CURRENT_BINARY_DIR}" "${CTK_DGRAPH_EXECUTABLE}"
-                               "${plugin_dirswithoption};${previous_plugin_dirswithoption};${MY_APPS}")
+                               "${MY_APPS};${plugin_dirswithoption};${previous_plugin_dirswithoption}")

   # Record the current set of plug-ins and their option names
   SET_PROPERTY(GLOBAL APPEND PROPERTY ctkMacroSetupExternalPlugins_dirswithoption ${plugin_dirswithoption})


tweak cmake message

tweak cmake message

--- CMakeModules/FindlibSquish.cmake
+++ CMakeModules/FindlibSquish.cmake
@@ -10,5 +10,5 @@

 IF (LIBSQUISH_LIBRARY AND LIBSQUISH_INCLUDE_DIR)
    SET(LIBSQUISH_FOUND TRUE)
-   MESSAGE(STATUS Found libSquish: ${LIBSQUISH_LIBRARY})
+   MESSAGE(STATUS "Found libSquish: ${LIBSQUISH_LIBRARY}")
 ENDIF (LIBSQUISH_LIBRARY AND LIBSQUISH_INCLUDE_DIR)


Ensure FORTIFY_SOURCE, and optimization, is not used for Debug-builds

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -60,10 +60,13 @@
       add_definitions(${_lfs_CFLAGS})
     endif (CMAKE_SIZEOF_VOID_P MATCHES "8")

-    check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
-    if (WITH_FORTIFY_SOURCE)
-      add_definitions(-D_FORTIFY_SOURCE=2 -O)
-    endif (WITH_FORTIFY_SOURCE)
+    if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+      MESSAGE(NOT ${CMAKE_BUILD_TYPE})
+      check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
+      if (WITH_FORTIFY_SOURCE)
+        add_definitions(-D_FORTIFY_SOURCE=2 -O)
+      endif (WITH_FORTIFY_SOURCE)
+    endif ()
   endif (CMAKE_COMPILER_IS_GNUCC OR COMPILER_IS_CLANG)
 endif (UNIX)


support for python3.8

support for python3.8

--- PyPort/system-python.cmake
+++ PyPort/system-python.cmake
@@ -16,7 +16,7 @@
 		file(GLOB_RECURSE PYTHON_H ${PYTHON_HOME}/*Python.h)
 	endif()
 	message("Globbed '${PYTHON_H}'")
-	string(REGEX MATCH "([^;]*)[/]+include[/]+(python3.([0-9])+)m" PYTHON_VER "${PYTHON_H}")
+	string(REGEX MATCH "([^;]*)[/]+include[/]+(python3.([0-9])+)m?" PYTHON_VER "${PYTHON_H}")
 	if(PYTHON_VER)
 		set(PYTHON_HOME_DISCOVERED ${CMAKE_MATCH_1})
 		set(PYTHON_VER ${CMAKE_MATCH_2})
@@ -31,7 +31,7 @@
 	endif()

 	find_path(PYTHON_INCLUDE_DIRS Python.h
-		PATHS ${PYTHON_HOME}/include/${PYTHON_VER}m ${PYTHON_HOME}/include
+		PATHS ${PYTHON_HOME}/include/${PYTHON_VER}m ${PYTHON_HOME}/include/${PYTHON_VER} ${PYTHON_HOME}/include
 		NO_DEFAULT_PATH
 		CMAKE_FIND_ROOT_PATH_BOTH)

@@ -63,10 +63,13 @@
 		set(PYTHON_DEBUG_POSTFIX "_d")
 	endif()

+	message( ${CMAKE_LIBRARY_ARCHITECTURE})
 	#import the python lib
 	find_library(PYTHON_LIBRARY_RELEASE
 		NAMES ${PYTHON_VER}m
+			${PYTHON_VER}
 			lib${PYTHON_VER}m
+			lib${PYTHON_VER}
 			libpython${PYTHON_NUM}
 			python${PYTHON_NUM}
 		PATHS ${PYTHON_HOME}/lib ${PYTHON_HOME}/libs ${PYTHON_HOME}/local/lib ${PYTHON_HOME}/lib64 ${PYTHON_HOME}/local/lib64
@@ -79,7 +82,9 @@
 	#import the debug python lib
 	find_library(PYTHON_LIBRARY_DEBUG
 		NAMES ${PYTHON_VER}m${PYTHON_DEBUG_POSTFIX}
+			${PYTHON_VER}${PYTHON_DEBUG_POSTFIX}
 			lib${PYTHON_VER}m${PYTHON_DEBUG_POSTFIX}
+			lib${PYTHON_VER}${PYTHON_DEBUG_POSTFIX}
 			libpython${PYTHON_NUM}${PYTHON_DEBUG_POSTFIX}
 			python${PYTHON_NUM}${PYTHON_DEBUG_POSTFIX}
 		PATHS ${PYTHON_HOME}/lib ${PYTHON_HOME}/libs ${PYTHON_HOME}/local/lib ${PYTHON_HOME}/lib64 ${PYTHON_HOME}/local/lib64


Readd eigen and assimp for UNIX.

Readd eigen and assimp for UNIX.

--- add_dependencies.cmake
+++ add_dependencies.cmake
@@ -91,9 +91,9 @@
 list(APPEND LIBRARIES ${OPENGL_LIBRARIES})

 if(UNIX)
-  #find_package(PkgConfig)
-  #pkg_check_modules(EIGEN3 REQUIRED eigen3)
-  #include_directories(${EIGEN3_INCLUDE_DIRS})
+  find_package(PkgConfig)
+  pkg_check_modules(EIGEN3 REQUIRED eigen3)
+  include_directories(${EIGEN3_INCLUDE_DIRS})
 else()
    set(EIGEN3_INCLUDE_DIR "$ENV{EIGEN_INCLUDE_DIR}" )
   if(NOT EIGEN3_INCLUDE_DIR)
@@ -108,9 +108,9 @@
 list(APPEND LIBRARIES ${OPENGL_LIBRARIES})

 if(UNIX)
-  #pkg_check_modules(ASSIMP REQUIRED assimp)
-  #include_directories(${ASSIMP_INCLUDE_DIRS})
-  #list(APPEND LIBRARIES ${ASSIMP_LIBRARIES})
+  pkg_check_modules(ASSIMP REQUIRED assimp)
+  include_directories(${ASSIMP_INCLUDE_DIRS})
+  list(APPEND LIBRARIES ${ASSIMP_LIBRARIES})
 else()
   set(ASSIMP_DIR $ENV{ASSIMP_ROOT})
   #message(STATUS "ASSIMP_DIR: ${ASSIMP_DIR}")


do not install sample plugins when they will be linked in statically

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -331,7 +331,7 @@
     set_target_properties(${SAMPLENAME} PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION})
   endif()

-  if (OGRE_INSTALL_SAMPLES)
+  if (OGRE_INSTALL_SAMPLES AND NOT OGRE_STATIC)
 	ogre_install_target(${SAMPLENAME} ${OGRE_SAMPLE_PATH} FALSE)
   endif()


modules: updated FindSDL2.cmake.

modules: updated FindSDL2.cmake.

Fixes building on OSX.

--- modules/FindSDL2.cmake
+++ modules/FindSDL2.cmake
@@ -94,7 +94,14 @@
 if(NOT TARGET SDL2::SDL2)
     if(SDL2_LIBRARY_NEEDED)
         add_library(SDL2::SDL2 UNKNOWN IMPORTED)
-        set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY})
+
+        # Work around BUGGY framework support on OSX
+        # https://cmake.org/Bug/view.php?id=13765
+        if(CORRADE_TARGET_APPLE AND ${SDL2_LIBRARY} MATCHES "\\.framework$")
+            set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}/SDL2)
+        else()
+            set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY})
+        endif()

         # Link frameworks on iOS
         if(CORRADE_TARGET_IOS)


typo in comment

typo in comment


ENH: on Windows, use internal FLTK by default

--- CMake/ImportFLTK.cmake
+++ CMake/ImportFLTK.cmake
@@ -35,10 +35,13 @@
         # FLTK Library
         #-------------------------------

-        # Use an external version of FLTK by default
-        # FLTK is now packaged on most systems
-        # Internal FLTK version is 1.1 and there is some issue Monteverdi
-        OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." ON)
+        # Use an external version of FLTK by default except on windows (FLTK is not packaged in OSGeo4W)
+        SET(DEFAULT_OTB_USE_EXTERNAL_FLTK ON)
+        IF(WIN32)
+          SET(DEFAULT_OTB_USE_EXTERNAL_FLTK OFF)
+        ENDIF()
+
+        OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." ${DEFAULT_OTB_USE_EXTERNAL_FLTK})
         MARK_AS_ADVANCED(OTB_USE_EXTERNAL_FLTK)

         IF(OTB_USE_EXTERNAL_FLTK)


BUG: Wrong CMake variable name for enabled module

--- CMake/elxModules.cmake
+++ CMake/elxModules.cmake
@@ -16,7 +16,7 @@
   _elxmodule_check_name( ${MODULE_NAME} )

   if( NOT ${MODULE_NAME}_ENABLED )
-    set( USE_${MODULE_NAME} ON )
+    set( ${MODULE_NAME}_ENABLED ON )

     include( ${${MODULE_NAME}_FILE} )


Enabling FOLLY_HAVE_LIBUNWIND if libunwind is available (#1501)

Summary:
Previously theFOLLY_HAVE_LIBUNWIND macro would evaluate to false even if LibUnwind was available.

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

Reviewed By: yfeldblum

Differential Revision: D25583562

Pulled By: Orvid

fbshipit-source-id: 7dac5afa1f0f24747f4accf2e08b804ab12e416f

--- CMake/folly-deps.cmake
+++ CMake/folly-deps.cmake
@@ -156,6 +156,9 @@
 find_package(LibUnwind)
 list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})
 list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS})
+if (LIBUNWIND_FOUND)
+  set(FOLLY_HAVE_LIBUNWIND ON)
+endif()

 cmake_push_check_state()
 set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE)


Fix regex in FindMaya.cmake that breaks with recent versions of Maya

--- cmake/FindMaya.cmake
+++ cmake/FindMaya.cmake
@@ -218,7 +218,7 @@
 if(MAYA_INCLUDE_DIRS AND EXISTS "${MAYA_INCLUDE_DIR}/maya/MTypes.h")

     # Tease the MAYA_API_VERSION numbers from the lib headers
-    file(STRINGS ${MAYA_INCLUDE_DIR}/maya/MTypes.h TMP REGEX "^#define MAYA_API_VERSION.*$")
+    file(STRINGS ${MAYA_INCLUDE_DIR}/maya/MTypes.h TMP REGEX "#define MAYA_API_VERSION.*$")
     string(REGEX MATCHALL "[0-9]+" MAYA_API_VERSION ${TMP})
 endif()


erthink-cmake: fix/refine LTO by CLANG on OSX.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -360,7 +360,7 @@
     endif()

     if(NOT CMAKE_CLANG_LD AND clang_bindirs)
-      find_program(CMAKE_CLANG_LD NAMES lld-link ld.lld ld${CMAKE_TARGET_BITNESS}.lld lld llvm-link llvm-ld PATHS ${clang_bindirs} NO_DEFAULT_PATH)
+      find_program(CMAKE_CLANG_LD NAMES lld-link ld.lld "ld${CMAKE_TARGET_BITNESS}.lld" lld llvm-link llvm-ld PATHS ${clang_bindirs} NO_DEFAULT_PATH)
     endif()
     if(NOT CMAKE_CLANG_AR AND clang_bindirs)
       find_program(CMAKE_CLANG_AR NAMES llvm-ar ar PATHS ${clang_bindirs} NO_DEFAULT_PATH)
@@ -409,7 +409,8 @@
       AND ((CLANG_LTO_PLUGIN AND CMAKE_LD_GOLD)
         OR (CMAKE_CLANG_LD
           AND NOT (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux"
-            AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))))
+            AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
+        OR APPLE))
     set(CLANG_LTO_AVAILABLE TRUE)
     message(STATUS "Link-Time Optimization by CLANG/LLVM is available")
   elseif(CMAKE_TOOLCHAIN_FILE AND NOT CMAKE_${CMAKE_PRIMARY_LANG}_COMPILER_VERSION VERSION_LESS 7.0)


link with --as-needed on Linux only

link with --as-needed on Linux only

The flag may not be supported by linkers on other platforms.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -12,4 +12,6 @@
   set(CMAKE_C_FLAGS_INIT "-std=c99")
 endif()

-set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--as-needed")
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+  set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--as-needed")
+endif()


migrate cmake functions from webpro to externpro

* wpPatch integrated into xpPatch with NPM_INSTALL option
* wpBuildNpmModule renamed to xpBuildNpmModule and slightly modified (NPM_FLAGS)
* moves the supporting cmake functions mentioned in issue https://github.com/smanders/externpro/issues/115

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -156,8 +156,10 @@
 endfunction()

 function(xpPatch)
+  set(options NPM_INSTALL)
   set(oneValueArgs NAME PARENT SUBDIR PATCH PATCH_STRIP DLURL DLMD5 DLNAME)
-  cmake_parse_arguments(P "" "${oneValueArgs}" "" ${ARGN})
+  set(multiValueArgs NPM_FLAGS)
+  cmake_parse_arguments(P "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   string(TOLOWER ${P_NAME} prj)
   if(DEFINED P_PARENT)
     set(tgt ${P_PARENT}_${prj})
@@ -172,7 +174,16 @@
   if(NOT DEFINED P_DLURL AND NOT DEFINED P_PATCH)
     return()
   endif()
-  if(DEFINED P_PATCH)
+  if(P_NPM_INSTALL)
+    # npm installs into the download directory (DWNLD_DIR)
+    # use for libraries that can be pulled directly through npm without
+    # the need for a patch
+    if(NOT DEFINED NODE_EXE OR NOT DEFINED NODE_NPM)
+      message(FATAL_ERROR "${P_NAME} with NPM_INSTALL doesn't have NODE_EXE or NODE_NPM defined")
+    endif()
+    list(APPEND P_NPM_FLAGS --no-bin-links --only=prod --legacy-bundling)
+    set(patchCmd ${NODE_EXE} ${NODE_NPM} install ${P_NPM_FLAGS})
+  elseif(DEFINED P_PATCH)
     if(COMMAND patch_patch)
       if(NOT TARGET patch)
         patch_patch()
@@ -219,6 +230,14 @@
     UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
     BINARY_DIR ${NULL_DIR} INSTALL_DIR ${NULL_DIR}
     )
+  if(UNIX AND P_NPM_INSTALL) # ensure permissions are proper on unix
+    ExternalProject_Get_Property(${tgt} SOURCE_DIR)
+    ExternalProject_Add_Step(${tgt} ${tgt}_permissions
+      COMMAND chmod -R u+rwX,go+rX,go-w ${SOURCE_DIR} # 755 for directories 644 for files
+      DEPENDEES download # change permissions after files are downloaded
+      DEPENDERS patch # change permissions before npm install
+      )
+  endif()
   set_property(TARGET ${tgt} PROPERTY FOLDER ${src_folder})
 endfunction()

@@ -445,6 +464,34 @@
   endif()
 endfunction()

+# npm installs downloaded repo to the download directory
+# use for libraries that are manually downloaded from the git repo and possibly
+# patched that still require an npm install (usually needed if there are
+# node_module dependencies)
+function(xpBuildNpmModule)
+  set(oneValueArgs NAME)
+  set(multiValueArgs NPM_FLAGS)
+  cmake_parse_arguments(P "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+  string(TOLOWER ${P_NAME} prj)
+  string(TOUPPER ${P_NAME} PRJ)
+  if(TARGET ${prj}_bld)
+    return()
+  endif()
+  if(XP_DEFAULT OR XP_PRO_${PRJ})
+    list(APPEND P_NPM_FLAGS --no-bin-links --only=prod --legacy-bundling)
+    ExternalProject_Get_Property(${prj} SOURCE_DIR)
+    ExternalProject_Add(${prj}_bld DEPENDS ${prj}
+      DOWNLOAD_COMMAND "" DOWNLOAD_DIR ${NULL_DIR}
+      SOURCE_DIR ${SOURCE_DIR}
+      PATCH_COMMAND ${NODE_EXE} ${NODE_NPM} install ${P_NPM_FLAGS}
+      UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
+      BINARY_DIR ${NULL_DIR}
+      INSTALL_DIR ${NULL_DIR}
+      )
+    set_property(TARGET ${prj}_bld PROPERTY FOLDER ${bld_folder})
+  endif()
+endfunction()
+
 function(xpMarkdownLink var _ret)
   list(LENGTH var len)
   if(NOT ${len} EQUAL 3)


msvc: Support Microsoft Build Tools 2017

--- cmake/modules/hunter_setup_msvc.cmake
+++ cmake/modules/hunter_setup_msvc.cmake
@@ -115,6 +115,9 @@
     hunter_status_debug(
         "CMAKE_VS_DEVENV_COMMAND: '${CMAKE_VS_DEVENV_COMMAND}'"
     )
+    hunter_status_debug(
+        "CMAKE_VS_MSBUILD_COMMAND: '${CMAKE_VS_MSBUILD_COMMAND}'"
+    )

     string(COMPARE EQUAL "${_hunter_vcvarsall_path}" "" _is_empty)
     if(_is_empty)
@@ -122,25 +125,35 @@
         # ignore error, see 'tests/hunter_setup_msvc/CMakeLists.txt'
       else()
         hunter_status_debug(
-            "Environment variable '${_hunter_vcvarsall_env}' is empty, analyzing CMAKE_VS_DEVENV_COMMAND"
+            "Environment variable '${_hunter_vcvarsall_env}' is empty,"
+            "  analyzing CMAKE_VS_DEVENV_COMMAND and CMAKE_VS_MSBUILD_COMMAND"
         )
-        string(COMPARE EQUAL "${CMAKE_VS_DEVENV_COMMAND}" "" is_empty)
-        if(is_empty)
+        string(COMPARE EQUAL "${CMAKE_VS_DEVENV_COMMAND}" "" is_devenv_empty)
+        string(COMPARE EQUAL "${CMAKE_VS_MSBUILD_COMMAND}" "" is_msbuild_empty)
+        if(NOT is_devenv_empty AND IS_ABSOLUTE "${CMAKE_VS_DEVENV_COMMAND}")
+          get_filename_component(_hunter_vcvarsall_path
+              "${CMAKE_VS_DEVENV_COMMAND}" DIRECTORY
+          )
+          set(_hunter_vcvarsall_path
+              "${_hunter_vcvarsall_path}/../../VC/Auxiliary/Build"
+          )
+        elseif(is_msbuild_empty AND IS_ABSOLUTE "${CMAKE_VS_MSBUILD_COMMAND}")
+          get_filename_component(_hunter_vcvarsall_path
+              "${CMAKE_VS_MSBUILD_COMMAND}" DIRECTORY
+          )
+          set(_hunter_vcvarsall_path
+              "${_hunter_vcvarsall_path}/../../../VC/Auxiliary/Build"
+          )
+        else()
           hunter_fatal_error(
-              "Incorrect CMAKE_VS_DEVENV_COMMAND: is empty"
+              "Incorrect MSVC setup:"
+              "  At least one of the following should be an absolute path"
+              "  CMAKE_VS_DEVENV_COMMAND:(${CMAKE_VS_DEVENV_COMMAND})"
+              "  CMAKE_VS_MSBUILD_COMMAND:(${CMAKE_VS_MSBUILD_COMMAND})"
               WIKI
               error.vs.devenv
           )
         endif()
-        if(NOT IS_ABSOLUTE "${CMAKE_VS_DEVENV_COMMAND}")
-          hunter_fatal_error(
-              "Incorrect CMAKE_VS_DEVENV_COMMAND: not absolute (${CMAKE_VS_DEVENV_COMMAND})"
-              WIKI
-              error.vs.devenv
-          )
-        endif()
-        get_filename_component(_hunter_vcvarsall_path "${CMAKE_VS_DEVENV_COMMAND}" DIRECTORY)
-        set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/../../VC/Auxiliary/Build")
       endif()
     else()
       set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/../../VC")


Try to avoid a cmake warning.

Try to avoid a cmake warning.

--- CompilerFeatures.cmake
+++ CompilerFeatures.cmake
@@ -13,6 +13,8 @@
     set(CMAKE_REQUIRED_FLAGS "-std=c++11")
 elseif(COMPILER_SUPPORTS_CXX0X)
     set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
+elseif(MSVC)
+    set(CMAKE_REQUIRED_FLAGS)
 endif()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


Fix symlinking of standard universe test executables. #1676

--- build/cmake/CondorStdExeTest.cmake
+++ build/cmake/CondorStdExeTest.cmake
@@ -42,7 +42,7 @@
 		command_target( cc_${_CNDR_TARGET} ${CONDOR_COMPILE} "-condor_lib;${STDU_LIB_LOC};-condor_ld_dir;${STDU_LIB_LOC};${_COMPILER};-o;${CMAKE_CURRENT_SOURCE_DIR}/${_CNDR_TARGET}.cndr.exe;${objs_${_CNDR_TARGET}};${_LINK_FLAGS}" "${CMAKE_CURRENT_SOURCE_DIR}/${_CNDR_TARGET}.cndr.exe" )
 		add_dependencies( cc_${_CNDR_TARGET} arx_${_CNDR_TARGET})

-		command_target( ca_${_CNDR_TARGET} ${CONDOR_ARCH_LINK} "${CMAKE_CURRENT_SOURCE_DIR}/${_CNDR_TARGET}.cndr.exe" "${_CNDR_TARGET}.cndr.exe.LINUX.INTEL")
+		command_target( ca_${_CNDR_TARGET} ${CONDOR_ARCH_LINK} "${_CNDR_TARGET}.cndr.exe" "${CMAKE_CURRENT_SOURCE_DIR}/${_CNDR_TARGET}.cndr.exe.LINUX.INTEL")
 		add_dependencies( ca_${_CNDR_TARGET} cc_${_CNDR_TARGET})

 		append_var(CONDOR_TESTS ca_${_CNDR_TARGET})


MFC: Add more extra libraries for the static library case

When using _WIN32_WINNT >= 0x0501, the static MFC libraries also
require Uxtheme and windowscodecs. Add them to the variable
VTK_MFC_EXTRA_LIBS to avoid linking errors in programs that
link to VTK_LIBRARIES when built with the MFC module enabled
and static settings for the MFC libs.

Change-Id: I5067a0410f01547067873986c9aa00b162cecbcb

--- GUISupport/MFC/VTKMFCSettings.cmake
+++ GUISupport/MFC/VTKMFCSettings.cmake
@@ -74,6 +74,7 @@
   SET(VTK_MFC_EXTRA_LIBS ${VTK_MFC_EXTRA_LIBS}
     debug nafxcwd optimized nafxcw
     debug LIBCMTD optimized LIBCMT
+    Uxtheme windowscodecs
     )
 ENDIF(VTK_MFC_STATIC)


Issue #21: Fix OpenCV to use CUDA, tested on Mac only.

--- CMake/ExternalProjects/OpenCV.cmake
+++ CMake/ExternalProjects/OpenCV.cmake
@@ -42,16 +42,20 @@
     )
   endif()

+  set(_cuda_options)
+  if(MYPROJECT_USE_CUDA)
+    set(_cuda_options
+      -DCUDA_TOOLKIT_ROOT_DIR:PATH=${CUDA_TOOLKIT_ROOT_DIR}
+      -DCUDA_ARCH_BIN:STRING=${MYPROJECT_CUDA_ARCH_BIN}
+      -DCUDA_NVCC_FLAGS:STRING=${MYPROJECT_CXX11_FLAG}
+      -DCUDA_PROPAGATE_HOST_FLAGS:BOOL=OFF
+    )
+  endif()
+
   if(CTEST_USE_LAUNCHERS)
     list(APPEND additional_cmake_args
       "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake"
     )
-  endif()
-
-  set(_cuda_flag "-DWITH_CUDA:BOOL=${MYPROJECT_USE_CUDA}")
-  if(APPLE)
-    # I've not had much luck with CUDA on Mac. Might only work with gcc compilers.
-    set(_cuda_flag "-DWITH_CUDA:BOOL=OFF")
   endif()

   ExternalProject_Add(${proj}
@@ -85,9 +89,8 @@
       -DWITH_EIGEN:BOOL=OFF
       -DWITH_FFMPEG:BOOL=${OPENCV_WITH_FFMPEG}
       -DWITH_OPENMP:BOOL=${MYPROJECT_USE_OPENMP}
-      ${_cuda_flag}
-      -DCUDA_TOOLKIT_ROOT_DIR:PATH=${CUDA_TOOLKIT_ROOT_DIR}
-      -DCUDA_ARCH_BIN:STRING=${MYPROJECT_CUDA_ARCH_BIN}
+      -DWITH_CUDA:BOOL=${MYPROJECT_USE_CUDA}
+      ${_cuda_options}
       -DADDITIONAL_C_FLAGS:STRING=${OPENCV_ADDITIONAL_C_FLAGS}
       -DADDITIONAL_CXX_FLAGS:STRING=${OPENCV_ADDITIONAL_CXX_FLAGS}
       ${additional_cmake_args}


support running tests when building inside the source tree on windows

--- Code/cmake/Modules/RDKitUtils.cmake
+++ Code/cmake/Modules/RDKitUtils.cmake
@@ -88,7 +88,7 @@
     set_target_properties(${RDKPY_NAME} PROPERTIES PREFIX "")
 if(WIN32)
     set_target_properties(${RDKPY_NAME} PROPERTIES SUFFIX ".pyd"
-                          RUNTIME_OUTPUT_DIRECTORY
+                          LIBRARY_OUTPUT_DIRECTORY
                           ${RDK_PYTHON_OUTPUT_DIRECTORY}/${RDKPY_DEST})
 else(WIN32)
     set_target_properties(${RDKPY_NAME} PROPERTIES


ENH: Needed to add DICOM Support for ITKv4 build.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -91,6 +91,7 @@
 #------------------------------------------------------------------------------

 set(ITK_EXTERNAL_NAME ITKv${ITK_VERSION_MAJOR})
+set(${PROJECT_NAME}_BUILD_DICOM_SUPPORT ON)

 set(${LOCAL_PROJECT_NAME}_DEPENDENCIES DCMTK ${ITK_EXTERNAL_NAME} SlicerExecutionModel VTK BRAINSTools)


update external sha1 for openni-camera-lcm

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -404,9 +404,10 @@

   ExternalProject_Add(openni2-camera-lcm
     GIT_REPOSITORY https://github.com/openhumanoids/openni2-camera-lcm
-    GIT_TAG master
-    CMAKE_CACHE_ARGS
-      ${default_cmake_args}
+    GIT_TAG 6b1fe91
+    CMAKE_CACHE_ARGS
+      ${default_cmake_args}
+      -DINSTALL_BOT_SPY:BOOL=OFF
     DEPENDS
       ${lcm_depends}
     )


Fixing travis find openblas

Fixing travis find openblas

Former-commit-id: c216907c0c7b0ed4506fc295b87dd8243fe45602

--- cmake-modules/Fetch_OpenBLAS.cmake
+++ cmake-modules/Fetch_OpenBLAS.cmake
@@ -148,12 +148,11 @@
 endif()

-
-target_link_libraries(blas INTERFACE ${BLAS_LIBRARIES} ${PTHREAD_LIBRARY})
-target_include_directories(blas INTERFACE ${BLAS_INCLUDE_DIRS})
 if(TARGET lapacke)
     target_link_libraries(blas INTERFACE lapacke)
 endif()
+target_link_libraries(blas INTERFACE ${BLAS_LIBRARIES} ${PTHREAD_LIBRARY})
+target_include_directories(blas INTERFACE ${BLAS_INCLUDE_DIRS})

 target_link_libraries(lapack INTERFACE blas)


Added environment variable PKMNSIM_DATABASE_DIR

* NSIS creates and deletes environment variable
* get_database_path() uses this successfully, but only on Linux

--- cmake/Modules/PKMNsimPackage.cmake
+++ cmake/Modules/PKMNsimPackage.cmake
@@ -30,4 +30,19 @@
 SET(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README.txt)
 SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt)

+########################################################################
+# Setup CPack NSIS
+########################################################################
+SET(CPACK_NSIS_MODIFY_PATH ON)
+
+SET(HLKM_ENV "\\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\"")
+
+SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
+    WriteRegStr HKLM ${HLKM_ENV} \\\"PKMNSIM_DATABASE_DIR\\\" \\\"$INSTDIR\\\\share\\\\pkmnsim\\\"
+")
+
+SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
+    DeleteRegValue HKLM ${HLKM_ENV} \\\"PKMNSIM_DATABASE_DIR\\\"
+")
+
 INCLUDE(CPack)


added a missing " in Windows-MSVC.cmake

added a missing " in Windows-MSVC.cmake

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

--- cmake/platforms/Windows-MSVC.cmake
+++ cmake/platforms/Windows-MSVC.cmake
@@ -4,4 +4,4 @@
 # C4127 - conditional expression is constant
 # C4714 - marked as __forceinline but not inlined
 # C4505 - unreferenced local function has been removed (impossible to deactive selectively)
-add_flags(${CMAKE_CXX_FLAGS} /EHsc /wd4127 /wd4505 /wd4714")
+add_flags(${CMAKE_CXX_FLAGS} "/EHsc /wd4127 /wd4505 /wd4714")


remove -u option from cp, fixes #66

remove -u option from cp, fixes #66

--- cmake_modules/TokuThirdParty.cmake
+++ cmake_modules/TokuThirdParty.cmake
@@ -65,7 +65,7 @@
 ExternalProject_Add(build_lzma
     PREFIX xz
     DOWNLOAD_COMMAND
-        cp -au "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
+        cp -a "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
     CONFIGURE_COMMAND
         "<SOURCE_DIR>/configure" ${xz_configure_opts}
         "--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"


ENH: Adding the new file itkNumericTraitsFixedArrayPixel.h.

--- Wrapping/WrapITK/Modules/Base/wrap_itkNumericTraits.cmake
+++ Wrapping/WrapITK/Modules/Base/wrap_itkNumericTraits.cmake
@@ -5,6 +5,7 @@
 WRAP_INCLUDE("itkNumericTraitsTensorPixel.h")
 WRAP_INCLUDE("itkNumericTraitsVariableLengthVectorPixel.h")
 WRAP_INCLUDE("itkNumericTraitsVectorPixel.h")
+WRAP_INCLUDE("itkNumericTraitsFixedArrayPixel.h")

 WRAP_CLASS(vcl_numeric_limits FORCE_INSTANTIATE)


Remove USE_D3D9_SUBSURFACE_BLIT as it is buggy.

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -156,7 +156,7 @@
         sagase_configure_report (OGRE)
     else()
         # DX blitting define for naali
-        add_definitions(-DUSE_D3D9_SUBSURFACE_BLIT)
+#        add_definitions(-DUSE_D3D9_SUBSURFACE_BLIT)
         include_directories($ENV{OGRE_HOME})
         # Ogre built from sources
         include_directories($ENV{OGRE_HOME}/include)


Add warning: padded

Add warning: padded

--- cmake/utility/sugar_generate_warning_flag_by_name.cmake
+++ cmake/utility/sugar_generate_warning_flag_by_name.cmake
@@ -215,6 +215,17 @@
     return()
   endif()

+  ### padded
+  string(COMPARE EQUAL "padded" "${warning_name}" hit)
+  if(hit)
+    if(is_clang OR is_gcc)
+      list(APPEND result "padded")
+    endif()
+
+    set(${warning_flags} "${result}" PARENT_SCOPE)
+    return()
+  endif()
+
   ### pedantic
   string(COMPARE EQUAL "pedantic" "${warning_name}" hit)
   if(hit)


split make args into separate variable

split make args into separate variable

--- test.cmake
+++ test.cmake
@@ -8,21 +8,21 @@
 include(CTestCustom.cmake)
 include(CTestConfig.cmake)
 set(CTEST_USE_LAUNCHERS 1) # much improved error/warning message logging
+set(MAKE_ARGS "-j$ENV{number_of_processors} -i")

 if(WIN32)
    find_program(JOM jom)
    if(JOM)
       set(CTEST_CMAKE_GENERATOR "NMake Makefiles JOM")
-      set(CMAKE_MAKE_PROGRAM "jom -j$ENV{number_of_processors} -i")
+      set(CMAKE_MAKE_PROGRAM "jom")
    else()
       set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
-      set(CMAKE_MAKE_PROGRAM "nmake -I")
+      set(CMAKE_MAKE_PROGRAM "nmake")
+      set(MAKE_ARGS "-I")
    endif()
 else()
    set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
-   if(NOT CMAKE_MAKE_PROGRAM)
-      set(CMAKE_MAKE_PROGRAM "make -j$ENV{number_of_processors} -i")
-   endif()
+   set(CMAKE_MAKE_PROGRAM "make")
 endif()

 macro(go)
@@ -45,7 +45,7 @@
             set_property(GLOBAL PROPERTY SubProject ${subproject})
             set_property(GLOBAL PROPERTY Label ${subproject})
             set(CTEST_BUILD_TARGET "${subproject}")
-            set(CTEST_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM} ${CTEST_BUILD_TARGET}")
+            set(CTEST_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM} ${MAKE_ARGS} ${CTEST_BUILD_TARGET}")
             ctest_build(
                BUILD "${CTEST_BINARY_DIRECTORY}"
                APPEND


cmake: remove todo target, use vim function instead

--- lib/cmake/targets.cmake
+++ lib/cmake/targets.cmake
@@ -1,2 +1 @@
 add_custom_target(run ./run WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-add_custom_target(todo which ack && ack --type=cpp TODO || grep -Hrn TODO *)


修正不规范的c++标准设置

修正不规范的c++标准设置

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -1,95 +1,98 @@
-# 默认配置选项
+# 默认配置选项
 #####################################################################

-if (NOT DEFINED ALL_FLAGS_IN_ONE_COMMON)
+if (CMAKE_CONFIGURATION_TYPES)
+	message(STATUS "Available Build Type: ${CMAKE_CONFIGURATION_TYPES}")
+else()
+	message(STATUS "Available Build Type: Unknown")
+endif()

-    option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
+if(NOT CMAKE_BUILD_TYPE)
+	set(CMAKE_BUILD_TYPE "Debug")
+	#set(CMAKE_BUILD_TYPE "RelWithDebInfo")
+endif()

-    if (CMAKE_CONFIGURATION_TYPES)
-        message(STATUS "Available Build Type: ${CMAKE_CONFIGURATION_TYPES}")
-    else()
-        message(STATUS "Available Build Type: Unknown")
+# 设置公共编译选项
+set(ALL_FLAGS_IN_ONE_COMMON "")
+set(C_FLAGS_IN_ONE_COMMON "")
+set(CXX_FLAGS_IN_ONE_COMMON "")
+
+# 编译器选项 (仅做了GCC、VC和Clang兼容)
+if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+    add_definitions(-Wall -Werror)
+
+    # gcc 4.9 编译输出颜色支持
+    if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.9.0" )
+            add_definitions(-fdiagnostics-color=auto)
+    endif()
+    # 检测GCC版本大于等于4.8时，默认-Wno-unused-local-typedefs (普片用于type_traits，故而关闭该警告)
+    if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.8.0" )
+            add_definitions(-Wno-unused-local-typedefs)
+            message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} Found, -Wno-unused-local-typedefs added.")
+    endif()
+
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "5.0.0" )
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 14)
+        message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++14.")
+    elseif ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.7.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.7.0" )
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 11)
+        message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++11.")
+    elseif( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.4.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.4.0" )
+        set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=c++0x")
+        message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c++0x.")
     endif()

-    if(NOT CMAKE_BUILD_TYPE)
-        set(CMAKE_BUILD_TYPE "Debug")
-        #set(CMAKE_BUILD_TYPE "RelWithDebInfo")
+elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    add_definitions(-Wall -Werror -fPIC)
+    # 苹果系统会误判，不过问题不大，反正也是用最高的标准
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.4" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "3.4" )
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 14)
+        message(STATUS "Clang Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++14.")
+    elseif ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.3" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "3.3" )
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 11)
+        message(STATUS "Clang Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++11.")
     endif()
+endif()

-    # 设置公共编译选项
-    set(ALL_FLAGS_IN_ONE_COMMON "")
-    set(C_FLAGS_IN_ONE_COMMON "")
-    set(CXX_FLAGS_IN_ONE_COMMON "")
+# 配置公共编译选项
+if ( NOT MSVC )
+        set(ALL_FLAGS_IN_ONE_DEBUG "-ggdb -O0 ${ALL_FLAGS_IN_ONE_COMMON}")
+        set(ALL_FLAGS_IN_ONE_RELEASE "${ALL_FLAGS_IN_ONE_COMMON}")
+        set(ALL_FLAGS_IN_ONE_RELWITHDEBINFO "-ggdb ${ALL_FLAGS_IN_ONE_COMMON}")
+        set(ALL_FLAGS_IN_ONE_MINSIZEREL "${ALL_FLAGS_IN_ONE_COMMON}")
+else()
+        set(ALL_FLAGS_IN_ONE_DEBUG "/Od /MDd ${ALL_FLAGS_IN_ONE_COMMON}")
+        set(ALL_FLAGS_IN_ONE_RELEASE "/O2 /MD ${ALL_FLAGS_IN_ONE_COMMON} /D NDEBUG")
+        set(ALL_FLAGS_IN_ONE_RELWITHDEBINFO "/O2 /MDd ${ALL_FLAGS_IN_ONE_COMMON}")
+        set(ALL_FLAGS_IN_ONE_MINSIZEREL "/Ox /MD ${ALL_FLAGS_IN_ONE_COMMON} /D NDEBUG")

-    # 编译器选项 (仅做了GCC、VC和Clang兼容)
-    if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
-            if(UNIX AND NOT CYGWIN)
-                add_definitions(-fPIC)
-            endif()
-
-            add_definitions(-Wall -Werror -D_POSIX_MT_ -D_FILE_OFFSET_BITS=64)
+        #add_definitions(/D SEED_WITH_BOOST_HPP /D SEED_ENABLE_BOOST_FOREACH /D SEED_ENABLE_BOOST_STATIC_ASSERT)
+endif()

-        # gcc 4.9 编译输出颜色支持
-            if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.9.0" )
-                    add_definitions(-fdiagnostics-color=auto)
-            endif()
-            # 检测GCC版本大于等于4.8时，默认-Wno-unused-local-typedefs (普片用于type_traits，故而关闭该警告)
-            if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.8.0" )
-                    add_definitions(-Wno-unused-local-typedefs)
-                    message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} Found, -Wno-unused-local-typedefs added.")
-            endif()
-            if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.7.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.7.0" )
-                    set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=gnu++11 -Wno-literal-suffix")
-                    set(C_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=gnu11")
-                    message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=gnu11/gnu++11.")
-            elseif( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.4.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.4.0" )
-                    set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=gnu++0x")
-                    message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=gnu++0x.")
-            endif()
+# 设置实际的编译选项
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${ALL_FLAGS_IN_ONE_DEBUG} ${CXX_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ALL_FLAGS_IN_ONE_RELEASE} ${CXX_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${ALL_FLAGS_IN_ONE_RELWITHDEBINFO} ${CXX_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${ALL_FLAGS_IN_ONE_MINSIZEREL} ${CXX_FLAGS_IN_ONE_COMMON}")

-    elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
-            if(UNIX AND NOT CYGWIN)
-                add_definitions(-fPIC)
-            endif()
-            add_definitions(-Wall -Werror -D_POSIX_MT_ -D_FILE_OFFSET_BITS=64)
-            set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=c++11")
-            message(STATUS "CLang Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c++11.")
-    endif()
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${ALL_FLAGS_IN_ONE_DEBUG} ${C_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ALL_FLAGS_IN_ONE_RELEASE} ${C_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${ALL_FLAGS_IN_ONE_RELWITHDEBINFO} ${C_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${ALL_FLAGS_IN_ONE_MINSIZEREL} ${C_FLAGS_IN_ONE_COMMON}")

-    # 配置公共编译选项
-    if ( NOT MSVC )
-            set(ALL_FLAGS_IN_ONE_DEBUG "-ggdb -O0 ${ALL_FLAGS_IN_ONE_COMMON}")
-            set(ALL_FLAGS_IN_ONE_RELEASE "${ALL_FLAGS_IN_ONE_COMMON}")
-            set(ALL_FLAGS_IN_ONE_RELWITHDEBINFO "-ggdb ${ALL_FLAGS_IN_ONE_COMMON}")
-            set(ALL_FLAGS_IN_ONE_MINSIZEREL "${ALL_FLAGS_IN_ONE_COMMON}")
-    else()
-            set(ALL_FLAGS_IN_ONE_DEBUG "/Od /MDd ${ALL_FLAGS_IN_ONE_COMMON}")
-            set(ALL_FLAGS_IN_ONE_RELEASE "/O2 /MD ${ALL_FLAGS_IN_ONE_COMMON} /D NDEBUG")
-            set(ALL_FLAGS_IN_ONE_RELWITHDEBINFO "/O2 /MDd ${ALL_FLAGS_IN_ONE_COMMON}")
-            set(ALL_FLAGS_IN_ONE_MINSIZEREL "/Ox /MD ${ALL_FLAGS_IN_ONE_COMMON} /D NDEBUG")
-    endif()
+# 库文件的附加参数 -fPIC, 多线程附加参数 -pthread -D_POSIX_MT_

-    # 设置实际的编译选项
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${ALL_FLAGS_IN_ONE_DEBUG} ${CXX_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ALL_FLAGS_IN_ONE_RELEASE} ${CXX_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${ALL_FLAGS_IN_ONE_RELWITHDEBINFO} ${CXX_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${ALL_FLAGS_IN_ONE_MINSIZEREL} ${CXX_FLAGS_IN_ONE_COMMON}")
-
-    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${ALL_FLAGS_IN_ONE_DEBUG} ${C_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ALL_FLAGS_IN_ONE_RELEASE} ${C_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${ALL_FLAGS_IN_ONE_RELWITHDEBINFO} ${C_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${ALL_FLAGS_IN_ONE_MINSIZEREL} ${C_FLAGS_IN_ONE_COMMON}")
-
-    # 库文件的附加参数 -fPIC, 多线程附加参数 -pthread -D_POSIX_MT_
-
-    # 功能函数
-    macro(add_compiler_define)
-        foreach(def ${ARGV})
-            if ( NOT MSVC )
-                add_definitions(-D${def})
-            else()
-                add_definitions("/D ${def}")
-            endif()
-        endforeach()
-    endmacro(add_compiler_define)
-endif()
+# 功能函数
+macro(add_compiler_define)
+	foreach(def ${ARGV})
+    	if ( NOT MSVC )
+            add_definitions(-D${def})
+        else()
+            add_definitions("/D ${def}")
+        endif()
+	endforeach()
+endmacro(add_compiler_define)


COMP: fix wrong executable name

COMP: fix wrong executable name

--- CMake/mitkTestPluginGenerator.cmake
+++ CMake/mitkTestPluginGenerator.cmake
@@ -10,7 +10,7 @@
   endif()

   add_test(NAME mitkPluginGeneratorCreateTest
-           COMMAND PluginGenerator --project-name "${proj}" --project-app-name "TestApp"
+           COMMAND MITKPluginGenerator --project-name "${proj}" --project-app-name "TestApp"
                            -ps org.test.plugin -pn "Test Plugin" -vn "Test View"
                            -o ${test_project_out_dir} -y
           )


Use -Xcompiler for nvcc only.

Use -Xcompiler for nvcc only.

--- tests/Makefile.cmake
+++ tests/Makefile.cmake
@@ -17,8 +17,8 @@
                   -Xptxas -v @NVCC_COMP@ #-keep
 OFLAGS          = -O3

-CC_CC           = @CMAKE_CXX_COMPILER@ -std=c++11 -Xcompiler -Wall -Xcompiler -Wunused
-CU_CC           = @NVCC@ $(NVCC_FLAGS) -Wall -Wunused
+CC_CC           = @CMAKE_CXX_COMPILER@ -std=c++11 -Wall -Wunused
+CU_CC           = @NVCC@ $(NVCC_FLAGS) -Xcompiler -Wall -Xcompiler -Wunused
 CC_LINK         = -lm -ldl -lstdc++ @TIME_LINK@
 CU_LINK         = $(CC_LINK) @CUDA_LINK@
 # OpenCL specific configuration


[lldb] [cmake] Use install directories for LLVM_* variables

Restore the previous behavior of using install directories for
LLVM_MAIN_INCLUDE_DIR, LLVM_LIBRARY_DIR and LLVM_BINARY_DIR.  The update
from llvm-config to CMake has changed the values of those values to use
LLVM_BUILD_* which is plain wrong and breaks stand-alone builds.
Instead, use the CMake counterparts of the values returned
by llvm-config.

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

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@353925 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -23,9 +23,9 @@
   set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake modules")

   set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
-  set(LLVM_MAIN_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
-  set(LLVM_LIBRARY_DIR ${LLVM_BUILD_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
-  set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR} CACHE PATH "Path to LLVM build tree")
+  set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
+  set(LLVM_LIBRARY_DIR ${LLVM_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
+  set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR} CACHE PATH "Path to LLVM build tree")
   set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")

   if(CMAKE_CROSSCOMPILING)


PS-7622: Suppress implicit-fallthrough and unused-but-set-variable warn from liblzma

https://jira.percona.com/browse/PS-7622

--- cmake_modules/TokuThirdParty.cmake
+++ cmake_modules/TokuThirdParty.cmake
@@ -7,7 +7,10 @@
   list(APPEND xz_configure_opts --disable-assembler)
 endif ()

-list(APPEND xz_configure_opts "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
+list(APPEND xz_configure_opts
+  "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}"
+  "CFLAGS=-Wno-implicit-fallthrough -Wno-unused-but-set-variable")
+
 if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL drd)
   list(APPEND xz_configure_opts --enable-debug)
 endif ()


Do not install PCRE2 globally

Do not install PCRE2 globally

--- cmake/BuildPCRE2.cmake
+++ cmake/BuildPCRE2.cmake
@@ -14,11 +14,16 @@
   LIST (APPEND _PCRE2_CMAKE_ARGS "${_PCRE2_CMAKE_OPTIONS} -DPCRE_STATIC_RUNTIME=1")
 ENDIF ()

+#
+# We force the install command with DESTDIR= in any case, so that it always remains local
+# even if user says "make install DESTDIR=/somewhere/else
+#
 EXTERNALPROJECT_ADD(pcre2
   URL "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23-patched.tar.gz"
   UPDATE_COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23/CMakeLists_fixed.txt" "${CMAKE_CURRENT_BINARY_DIR}/pcre2/src/pcre2/CMakeLists.txt"
   PREFIX "${CMAKE_CURRENT_BINARY_DIR}/pcre2"
   CMAKE_ARGS ${_PCRE2_CMAKE_ARGS}
+  INSTALL_COMMAND "${CMAKE_MAKE_PROGRAM}" install "DESTDIR="
   )
 SET (PCRE2_INCLUDE_DIR "${3RDPARTY_OUTPUT_PATH}/include")
 IF (WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))


fixed endif

fixed endif

--- cmake/FindCyclus.cmake
+++ cmake/FindCyclus.cmake
@@ -25,7 +25,7 @@
         ELSE(CYCLUS_BIN)
             SET(CYCLUS_ROOT_DIR "$ENV{HOME}/.local")
         ENDIF(CYCLUS_BIN)
-    ENDIF(DEFINED CYCLUS_ROOT_DIR)
+    ENDIF(NOT DEFINED CYCLUS_ROOT_DIR)
 ENDIF(DEFINED ENV{CYCLUS_ROOT_DIR})

 # Let the user know if we're using a hint


Allow tk and tkwin device drivers to build if there are embedded blanks
in the source or build tree directory prefixes.

svn path=/trunk/; revision=10732

--- cmake/modules/tk.cmake
+++ cmake/modules/tk.cmake
@@ -59,7 +59,7 @@

 if(PLD_tk)
   set(tk_COMPILE_FLAGS
-  "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I${CMAKE_SOURCE_DIR}/bindings/tcl -I${CMAKE_BINARY_DIR}/bindings/tcl -I${CMAKE_SOURCE_DIR}/bindings/tk"
+  "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I\"${CMAKE_SOURCE_DIR}\"/bindings/tcl -I\"${CMAKE_BINARY_DIR}\"/bindings/tcl -I\"${CMAKE_SOURCE_DIR}\"/bindings/tk"
   )
   set(tk_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_LIBRARY} ${TK_LIBRARY})
   set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${TCL_LIBRARY} ${TK_LIBRARY})
@@ -105,7 +105,7 @@

 if(PLD_tkwin)
   set(tkwin_COMPILE_FLAGS
-  "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I${CMAKE_SOURCE_DIR}/bindings/tcl -I${CMAKE_BINARY_DIR}/bindings/tcl -I${CMAKE_SOURCE_DIR}/bindings/tk-x-plat -I${CMAKE_SOURCE_DIR}/bindings/tk"
+  "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I\"${CMAKE_SOURCE_DIR}\"/bindings/tcl -I\"${CMAKE_BINARY_DIR}\"/bindings/tcl -I\"${CMAKE_SOURCE_DIR}\"/bindings/tk-x-plat -I\"${CMAKE_SOURCE_DIR}\"/bindings/tk"
   )
   set(tkwin_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_LIBRARY} ${TK_LIBRARY})
   set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${TCL_LIBRARY} ${TK_LIBRARY})


Fixed parsing of gcc version

Fixed parsing of gcc version

--- cmake/nvcc-check.cmake
+++ cmake/nvcc-check.cmake
@@ -26,8 +26,8 @@
     EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)

     # Get major and minor revs
-    STRING(REGEX REPLACE "([0-9]+).[0-9]+" "\\1" GCCVER_MAJOR "${GCCVER}")
-    STRING(REGEX REPLACE "[0-9]+.([0-9]+)" "\\1" GCCVER_MINOR "${GCCVER}")
+    STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" GCCVER_MAJOR "${GCCVER}")
+    STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" GCCVER_MINOR "${GCCVER}")

     # Check that adequate
     IF("${GCCVER_MAJOR}" MATCHES "${GCC_MAJOR}" AND "${GCCVER_MINOR}" MATCHES "${GCC_MINOR}")


unit tests exe name

unit tests exe name

--- cmake/unit-tests.cmake
+++ cmake/unit-tests.cmake
@@ -15,7 +15,7 @@

 include_directories(${CRYPTOPP_INCLUDE_DIR} ${JSONCPP_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include)

-add_executable(unit-tests ${TEST_SOURCES})
-add_dependencies(unit-tests ethkey)
+add_executable(ethkey-tests ${TEST_SOURCES})
+add_dependencies(ethkey-tests ethkey)

-target_link_libraries(unit-tests ethkey ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_RANDOM_LIBRARY} ${CRYPTOPP_LIBRARY} ${GMP_LIBRARY} -lscrypt ${JSONCPP_LIBRARY})
+target_link_libraries(ethkey-tests ethkey ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_RANDOM_LIBRARY} ${CRYPTOPP_LIBRARY} ${GMP_LIBRARY} -lscrypt ${JSONCPP_LIBRARY})


COMP: remove local patch for Shark

COMP: remove local patch for Shark

--- SuperBuild/CMake/External_shark.cmake
+++ SuperBuild/CMake/External_shark.cmake
@@ -33,7 +33,6 @@
       -DENABLE_HDF5:BOOL=OFF
       CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )
-  SUPERBUILD_PATCH_SOURCE(SHARK "patch-for-at-rpath")
   set(_SB_SHARK_DIR ${SB_INSTALL_PREFIX}/share/SHARK)
 endif()
 endif()


Add sorting to linting

Add sorting to linting

--- cmake/ClangTidy.cmake
+++ cmake/ClangTidy.cmake
@@ -23,7 +23,9 @@

 message(STATUS "Linting enabled through ./tools/lint.bash")

-add_custom_target(lint "${CMAKE_CURRENT_BINARY_DIR}/tools/lint.bash" USES_TERMINAL)
+add_custom_target(lint "${CMAKE_CURRENT_BINARY_DIR}/tools/lint.bash" "--sort" "file" USES_TERMINAL)
+add_custom_target(lint-by-file "${CMAKE_CURRENT_BINARY_DIR}/tools/lint.bash" "--sort" "file" USES_TERMINAL)
+add_custom_target(lint-by-diagnostic "${CMAKE_CURRENT_BINARY_DIR}/tools/lint.bash" "--sort" "diagnostic"  USES_TERMINAL)

 # function(lint TARGET)
 #     add_custom_target(${TARGET}-lint VERBATIM)


Windows compatibility fixes in UsePython.cmake

--- cmake/UsePython.cmake
+++ cmake/UsePython.cmake
@@ -15,6 +15,8 @@
 		if("${in}" IS_NEWER_THAN "${out_abs}")
 			file(TO_NATIVE_PATH "${in}" in)
 			file(TO_NATIVE_PATH "${out}" out)
+			string(REPLACE "\\" "\\\\" in "${in}")
+			string(REPLACE "\\" "\\\\" out "${out}")
 			string(REPLACE "\"" "\\\"" in "${in}")
 			string(REPLACE "\"" "\\\"" out "${out}")
 			file(APPEND "${pyc_DIR_OUT}/.py_compile.tmp" "\"${in}\",\"${out}\"\n")
@@ -64,7 +66,13 @@
 		PROPERTIES SYMBOLIC ON)
 endmacro(_py_compile_dir)

-find_package(Python3 3.6 REQUIRED)
+if(WIN32)
+	find_package(PythonInterp 3.6 REQUIRED)
+	set(Python3_EXECUTABLE "${PYTHON_EXECUTABLE}")
+	set(Python3_Interpreter_FOUND ON)
+else()
+	find_package(Python3 3.6 REQUIRED)
+endif()

 function(py_compile)
 	cmake_parse_arguments(pyc