Add support for MKL_USE_STATIC_LIBS

Add support for MKL_USE_STATIC_LIBS

--- modules/FindMKL.cmake
+++ modules/FindMKL.cmake
@@ -213,7 +213,7 @@
   # TODO: Prepend new versions to this as they are released (they must remain
   # sorted in descending order).
   set(_MKL_PACKAGE_KNOWN_VERSIONS ${MKL_PACKAGE_ADDITIONAL_VERSIONS}
-      "2016.2.181". "2016.1.111" "2016.0.109" "2015.2.164")
+      "2016.2.181" "2016.1.111" "2016.0.109" "2015.2.164")
   foreach(v ${_MKL_PACKAGE_KNOWN_VERSIONS})
     if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
       list(APPEND _MKL_PATH_SUFFIXES "compilers_and_libraries_${v}/windows/mkl/include")
@@ -297,9 +297,17 @@
   set(MKL_LIBRARIES "")
   set(MKL_DEFINITIONS "")

+  # Handle static libraries
+  set(_MKL_LIB_PREFIX "")
+  set(_MKL_LIB_SUFFIX "")
+  if(MKL_USE_STATIC_LIBS)
+    set(_MKL_LIB_PREFIX "lib")
+    set(_MKL_LIB_SUFFIX ".a")
+  endif()
+
   # Find the core library
   find_library(MKL_CORE_LIB
-               "mkl_core"
+               "${_MKL_LIB_PREFIX}mkl_core${_MKL_LIB_SUFFIX}"
                HINTS ${_MKL_LIBRARY_SEARCH_DIRS})
   if("${MKL_CORE_LIB}" STREQUAL "MKL_CORE_LIB-NOTFOUND")
     set(MKL_FOUND 0)
@@ -328,7 +336,7 @@
       set(_MKL_INTERFACE_LIBRARY "mkl_intel_${_MKL_INTERFACE_LC}")
     endif()
     find_library(MKL_INTERFACE_LIB
-                 "${_MKL_INTERFACE_LIBRARY}"
+                 "${_MKL_LIB_PREFIX}${_MKL_INTERFACE_LIBRARY}${_MKL_LIB_SUFFIX}"
                  HINTS ${_MKL_LIBRARY_SEARCH_DIRS})
     if("${MKL_INTERFACE_LIB}" STREQUAL "MKL_INTERFACE_LIB-NOTFOUND")
       set(MKL_FOUND 0)
@@ -360,7 +368,7 @@
   endif()
   foreach(lib ${_MKL_THREADING_LIBS})
     find_library(_MKL_THREADING_${lib}
-                 "${lib}"
+                 "${_MKL_LIB_PREFIX}${lib}${_MKL_LIB_SUFFIX}"
                  HINTS ${_MKL_LIBRARY_SEARCH_DIRS})
     if("${_MKL_THREADING_${lib}}" STREQUAL "_MKL_THREADING_${lib}-NOTFOUND")
       set(MKL_FOUND 0)
@@ -389,7 +397,7 @@
     unset(_MKL_MPI_LC)

     find_library(MKL_BLACS_LIBRARY
-                 "${_MKL_BLACS_LIBNAME}"
+                 "${_MKL_LIB_PREFIX}${_MKL_BLACS_LIBNAME}${_MKL_LIB_SUFFIX}"
                  HINTS ${_MKL_LIBRARY_SEARCH_DIRS})
     if("${MKL_BLACS_LIBRARY}" STREQUAL "MKL_BLACS_LIBRARY-NOTFOUND")
       set(MKL_FOUND 0)
@@ -417,7 +425,7 @@
     list(FIND MKL_FIND_COMPONENTS CDFT _MKL_INDEXOF_CDFT)
     if (${_MKL_INDEXOF_CDFT} GREATER -1)
       find_library(MKL_CDFT_LIBRARY
-                   "mkl_cdft_core"
+                   "${_MKL_LIB_PREFIX}mkl_cdft_core${_MKL_LIB_SUFFIX}"
                    HINTS ${_MKL_LIBRARY_SEARCH_DIRS})
       if("${MKL_CDFT_LIBRARY}" STREQUAL "MKL_CDFT_LIBRARY-NOTFOUND")
         set(MKL_FOUND 0)
@@ -432,7 +440,7 @@
     list(FIND MKL_FIND_COMPONENTS ScaLAPACK _MKL_INDEXOF_SCALAPACK)
     if (${_MKL_INDEXOF_SCALAPACK} GREATER -1)
       find_library(MKL_ScaLAPACK_LIBRARY
-                   "mkl_scalapack_${_MKL_INTERFACE_LC}"
+                   "${_MKL_LIB_PREFIX}mkl_scalapack_${_MKL_INTERFACE_LC}${_MKL_LIB_SUFFIX}"
                    HINTS ${_MKL_LIBRARY_SEARCH_DIRS})
       if("${MKL_ScaLAPACK_LIBRARY}" STREQUAL "MKL_ScaLAPACK_LIBRARY-NOTFOUND")
         set(MKL_FOUND 0)
@@ -445,6 +453,9 @@
   endif()
   unset(_MKL_INTERFACE_LC)

+  unset(_MKL_LIB_PREFIX)
+  unset(_MKL_LIB_SUFFIX)
+
   # Construct MKL_LIBRARIES and MKL_DEFINITIONS
   list(REMOVE_DUPLICATES MKL_DEFINITIONS)
   list(REMOVE_DUPLICATES MKL_LIBRARIES)


Tests off by default take 2

Tests off by default take 2

--- lib/polarssl.cmake
+++ lib/polarssl.cmake
@@ -2,7 +2,7 @@
 if(NOT TARGET polarssl)
 	message("including polarssl")
 	if (SELF_TEST)
-		set(ENABLE_TESTING 0)
+		set(ENABLE_TESTING OFF CACHE BOOL)
 		add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl)
 	else()
 		add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl EXCLUDE_FROM_ALL)


build

build

--- modules/restbed.cmake
+++ modules/restbed.cmake
@@ -5,7 +5,14 @@
   add_library(restbed ${SOURCE_FILES})
   target_compile_definitions(restbed PRIVATE ASIO_STANDALONE ASIO_SEPARATE_COMPILATION BUILD_SSL)
   target_include_directories(restbed PRIVATE "restbed/source" PRIVATE "restbed/dependency/kashmir" PRIVATE "asio/asio/include" PRIVATE ${OPENSSL_INCLUDE_DIR})
-  #target_link_libraries(asio ${OPENSSL_LIBRARIES})
+  target_link_libraries(restbed ${OPENSSL_LIBRARIES})
+
+  # MinGW build should be manually linked with Winsock2 library
+  if(WIN32)
+    if(NOT MSVC)
+      target_link_libraries(restbed wsock32 ws2_32)
+    endif()
+  endif()

   # Module folder
   set_target_properties(restbed PROPERTIES FOLDER modules/restbed)


DFaure (and others) tell me this is in kdefakes.

svn path=/trunk/KDE/kdepim/; revision=615751

--- config.h.cmake
+++ config.h.cmake
@@ -209,101 +209,6 @@
 #define _FILE_OFFSET_BITS 64

-#if !defined(HAVE_GETDOMAINNAME_PROTO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include <sys/types.h>
-		int getdomainname (char *, size_t);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-#if !defined(HAVE_GETHOSTNAME_PROTO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-int gethostname (char *, unsigned int);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-#if !defined(HAVE_RES_INIT_PROTO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-int res_init(void);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-#if !defined(HAVE_SETENV_PROTO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-int setenv (const char *, const char *, int);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-#if !defined(HAVE_STRLCAT_PROTO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-unsigned long strlcat(char*, const char*, unsigned long);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-#if !defined(HAVE_STRLCPY_PROTO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-unsigned long strlcpy(char*, const char*, unsigned long);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-#if !defined(HAVE_UNSETENV_PROTO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-void unsetenv (const char *);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-#if !defined(HAVE_USLEEP_PROTO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-int usleep (unsigned int);
-#ifdef __cplusplus
-}
-#endif
-#endif
-

 /* Define for large files, on AIX-style hosts. */
 /* #undef _LARGE_FILES */


Make empty -doxycopy target warning visible when run.

--- DoxygenRule.cmake
+++ DoxygenRule.cmake
@@ -186,11 +186,17 @@
       COMMENT "Copying ${PROJECT_NAME} API documentation to ${GIT_DOCUMENTATION_DIR}"
       DEPENDS ${PROJECT_NAME}-doxygen VERBATIM)
   else()
+    # Having a command will force this target to run always when invoked. That
+    # makes the Makefile to print the comment. The text will be also visible
+    # in ninja.
     add_custom_target(${PROJECT_NAME}-doxycopy
+      COMMAND ${CMAKE_COMMAND} -E echo ""
       COMMENT "doxycopy target not available, missing ${_GIT_DOC_SRC_DIR}")
   endif()
 else()
   add_custom_target(${PROJECT_NAME}-doxycopy
+    # Same as above
+    COMMAND ${CMAKE_COMMAND} -E echo ""
     COMMENT "doxycopy target not available, missing GIT_DOCUMENTATION_REPO")
 endif()
 set_target_properties(${PROJECT_NAME}-doxycopy PROPERTIES


Improve find_simbody a little.

Improve find_simbody a little.

git-svn-id: 9e047e1e624cce0a2485e750063112e834f85522@6887 fc29be9c-2cb0-420d-b520-73dbd18add6e

--- FindSimbody.cmake
+++ FindSimbody.cmake
@@ -84,11 +84,6 @@
         set(Simbody_SEARCH_PATHS "${INSTDIR}")
     endif()

-    # Generic locations to search for Simbody files. First look to see
-    # if there is a Simbody already in the directory where we're going
-    # to install Molmodel.
-    list(APPEND Simbody_SEARCH_PATHS "${SimTK_INSTALL_PREFIX}")
-
     # UNIX includes Mac, Linux, and Cygwin
     if (UNIX)
         list(APPEND Simbody_SEARCH_PATHS /usr/local)
@@ -118,8 +113,22 @@
 # root directory. We're assuming the header is in
 #    Simbody_INCLUDE_DIR == ${Simbody_ROOT_DIR}/include
 # So stripping off the "/include" should give the root directory.
-find_path(Simbody_INCLUDE_DIR NAMES "SimTKsimbody.h" "Simbody.h"
-    PATHS ${Simbody_SEARCH_PATHS}
+
+foreach(pth IN LISTS Simbody_SEARCH_PATHS)
+  find_path(Simbody_INCLUDE_DIR
+    NAMES "SimTKsimbody.h" "Simbody.h"
+    PATHS "${pth}"
+    PATH_SUFFIXES "include" "SimTK/include" "simtk/include"
+                  "Simbody/include" "simbody/include"
+    NO_DEFAULT_PATH
+    DOC "Location of top-level installed Simbody header files"
+  )
+endforeach()
+
+# This will only be executed if the first loop fails. We're getting
+# desperate!
+find_path(Simbody_INCLUDE_DIR
+    NAMES "SimTKsimbody.h" "Simbody.h"
     PATH_SUFFIXES "include" "SimTK/include" "simtk/include"
                   "Simbody/include" "simbody/include"
     DOC "Location of top-level installed Simbody header files"


Updating external libpng download url in dependencies cmake script

* appears to have been moved to "history" folder
* this is not yet reflected on the main libpng site, their links to this mirror are broken as well
* the 1.5.11 release appears to be the new stable, but this has not been announced on the libpng site yet

--- CMake/ExternalPNG.cmake
+++ CMake/ExternalPNG.cmake
@@ -32,7 +32,7 @@
     PREFIX ${libpng_PREFIX}

     DOWNLOAD_DIR ${POLYCODE_DEPS_DOWNLOAD_DIR}
-    URL ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.10.tar.gz
+    URL ftp://ftp.simplesystems.org/pub/libpng/png/src/history/libpng15/libpng-1.5.10.tar.gz
     URL_MD5 9e5d864bce8f06751bbd99962ecf4aad

     INSTALL_DIR ${POLYCODE_DEPS_CORE_PREFIX}


CMake macro add_wast_executable dependency tracking bugfix

--- CMakeModules/wasm.cmake
+++ CMakeModules/wasm.cmake
@@ -138,7 +138,7 @@

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


FIX: Removed unused component QmitkSTLConverter

--- Qmitk/files.cmake
+++ Qmitk/files.cmake
@@ -28,7 +28,6 @@
   QmitkFunctionalityComponents/QmitkSingleTimeStepExporterComponent.cpp
   QmitkFunctionalityComponents/QmitkImageCropperComponent.cpp
   QmitkFunctionalityComponents/QmitkEmptyComponent.cpp
-  QmitkFunctionalityComponents/QmitkSTLConvertComponent.cpp
   QmitkHelpBrowser.cpp
   QmitkInteractionFunctionalityComponent.cpp
   QmitkLevelWindowWidgetContextMenu.cpp
@@ -88,7 +87,6 @@
   QmitkFunctionalityComponents/QmitkSingleTimeStepExporterComponentGUI.ui
   QmitkFunctionalityComponents/QmitkImageCropperComponentGUI.ui
   QmitkFunctionalityComponents/QmitkEmptyComponentGUI.ui
-  QmitkFunctionalityComponents/QmitkSTLConvertComponentGUI.ui
   QmitkLevelWindowPresetDefinition.ui
   QmitkLevelWindowRangeChange.ui
   QmitkLevelWindowWidget.ui
@@ -130,7 +128,6 @@
   QmitkFunctionalityComponents/QmitkSingleTimeStepExporterComponent.h
   QmitkFunctionalityComponents/QmitkImageCropperComponent.h
   QmitkFunctionalityComponents/QmitkEmptyComponent.h
-  QmitkFunctionalityComponents/QmitkSTLConvertComponent.h
   QmitkHelpBrowser.h
   QmitkInteractionFunctionalityComponent.h
   QmitkLevelWindowWidgetContextMenu.h


move SceneListView to mbi-qm because of dependency to DataStorage

--- Qmitk/files.cmake
+++ Qmitk/files.cmake
@@ -43,11 +43,6 @@
   QmitkPropertyObservers/QmitkStringPropertyEditor.cpp
   QmitkPropertyObservers/QmitkStringPropertyOnDemandEdit.cpp
   QmitkPropertyObservers/QmitkStringPropertyView.cpp
-  QmitkPropertyObservers/QmitkSceneListView.cpp
-  QmitkPropertyObservers/QmitkBoolPropertyObserver.cpp
-  QmitkPropertyObservers/QmitkSceneListViewGroupItem.cpp
-  QmitkPropertyObservers/QmitkSceneListViewItem.cpp
-  QmitkPropertyObservers/QmitkStringPropertyObserver.cpp
   QmitkRenderingManager.cpp
   QmitkRenderingManagerFactory.cpp
   QmitkRenderWindow.cpp


New version: 0.3.10

New version: 0.3.10

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "3")
-SET(HAWKEY_PATCH "9")
+SET(HAWKEY_PATCH "10")


New version: 0.4.2

New version: 0.4.2

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "1")
+SET(HAWKEY_PATCH "2")


fixing internal variable name for clarity. now doing PCH process only on source file, not on headers anymore.

--- WkBuild.cmake
+++ WkBuild.cmake
@@ -332,15 +332,6 @@
 	# to show we are using WkCMake to build ( can be #ifdef in header )
 	add_definitions( -D WK_BUILD )

-	#TODO : find a simpler way than this complex merge...
-	MERGE("${${PROJECT_NAME}_${target_name}_HEADERS}" "${${PROJECT_NAME}_${target_name}_SOURCES}" ${PROJECT_NAME}_${target_name}_SOURCES)
-	#MESSAGE ( STATUS "== ${target_name} Sources : ${${target_name}_SOURCES}" )
-
-	AddPlatformCheckSrc(${PROJECT_NAME}_${target_name}_SOURCES)
-
-	#Setting up AStyle target
-	WkTargetFormat(${target_name} ${${PROJECT_NAME}_${target_name}_SOURCES})
-
 	#Setting precompile header
 	if(${PROJECT_NAME}_PCH)
 		#hardcode precompiled header name
@@ -368,6 +359,15 @@
 		message ( STATUS "== Not using Precompiled header." )
 	endif()

+	#TODO : find a simpler way than this complex merge...
+	MERGE("${${PROJECT_NAME}_${target_name}_HEADERS}" "${${PROJECT_NAME}_${target_name}_SOURCES}" ${PROJECT_NAME}_${target_name}_ALL_SOURCES)
+	#MESSAGE ( STATUS "== ${target_name} Sources : ${${target_name}_ALL_SOURCES}" )
+
+	AddPlatformCheckSrc(${PROJECT_NAME}_${target_name}_ALL_SOURCES)
+
+	#Setting up AStyle target
+	WkTargetFormat(${target_name} ${${PROJECT_NAME}_${target_name}_ALL_SOURCES})
+
 	#internal headers ( non visible by outside project )
 	include_directories("${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_${target_name}_SRC_DIR}")

@@ -376,7 +376,7 @@
 	#	-source_dir/include for the unmodified ones,
 	include_directories("${PROJECT_BINARY_DIR}/CMakeFiles" "${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_INCLUDE_DIR}" )

-	add_library(${target_name} ${${PROJECT_NAME}_${target_name}_load_type} ${${PROJECT_NAME}_${target_name}_SOURCES})
+	add_library(${target_name} ${${PROJECT_NAME}_${target_name}_load_type} ${${PROJECT_NAME}_${target_name}_ALL_SOURCES})

 	#defining where to put what has been built
 	SET(${CMAKE_PROJECT_NAME}_LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${${CMAKE_PROJECT_NAME}_LIB_DIR} CACHE PATH "Ouput directory for ${PROJECT_NAME} libraries." )
@@ -481,13 +481,13 @@
 	add_definitions( -D WK_BUILD )

 	#TODO : find a simpler way than this complex merge...
-	MERGE("${${PROJECT_NAME}_${target_name}_HEADERS}" "${${PROJECT_NAME}_${target_name}_SOURCES}" ${PROJECT_NAME}_${target_name}_SOURCES)
+	MERGE("${${PROJECT_NAME}_${target_name}_HEADERS}" "${${PROJECT_NAME}_${target_name}_SOURCES}" ${PROJECT_NAME}_${target_name}_ALL_SOURCES)
 	#MESSAGE ( STATUS "== ${PROJECT_NAME} Sources : ${SOURCES}" )

-	AddPlatformCheckSrc(${PROJECT_NAME}_${target_name}_SOURCES)
+	AddPlatformCheckSrc(${PROJECT_NAME}_${target_name}_ALL_SOURCES)

 	#Setting up AStyle target
-	WkTargetFormat(${target_name} ${${PROJECT_NAME}_${target_name}_SOURCES})
+	WkTargetFormat(${target_name} ${${PROJECT_NAME}_${target_name}_ALL_SOURCES})

 	#internal headers ( non visible by outside project )
 	include_directories("${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_${target_name}_SRC_DIR}")
@@ -497,7 +497,7 @@
 	#	-source_dir/include for the unmodified ones,
 	include_directories("${PROJECT_BINARY_DIR}/CMakeFiles" "${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_INCLUDE_DIR}" )

-	add_executable(${target_name} ${${PROJECT_NAME}_${target_name}_SOURCES})
+	add_executable(${target_name} ${${PROJECT_NAME}_${target_name}_ALL_SOURCES})

 	SET(${CMAKE_PROJECT_NAME}_RUNTIME_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${${CMAKE_PROJECT_NAME}_BIN_DIR} CACHE PATH "Ouput directory for ${PROJECT_NAME} executables." )
 	mark_as_advanced(FORCE ${CMAKE_PROJECT_NAME}_RUNTIME_OUTPUT_PATH)


BUG: KWStyle_DIR is the proper var name

BUG: KWStyle_DIR is the proper var name

--- CMake/Superbuild/External_KWStyle.cmake
+++ CMake/Superbuild/External_KWStyle.cmake
@@ -32,17 +32,17 @@
 set( proj KWStyle )

 # Sanity checks.
-if( KWSTYLE_EXECUTABLE AND NOT EXISTS ${KWSTYLE_EXECUTABLE} )
+if( KWStyle_DIR AND NOT EXISTS ${KWSTYLE_Dir} )
   message( FATAL_ERROR
-    "KWSTYLE_EXECUTABLE is defined, but corresponds to a nonexistent file" )
-endif( KWSTYLE_EXECUTABLE AND NOT EXISTS ${KWSTYLE_EXECUTABLE} )
+    "KWStyle_DIR is defined, but corresponds to a nonexistent file" )
+endif( KWStyle_DIR AND NOT EXISTS ${KWStyle_DIR} )

 set( ${proj}_DEPENDENCIES "" )

 # Include dependent projects, if any.
 TubeTKMacroCheckExternalProjectDependency( ${proj} )

-if( NOT KWSTYLE_EXECUTABLE AND NOT ${USE_SYSTEM_KWSTYLE} )
+if( NOT KWStyle_DIR AND NOT ${USE_SYSTEM_KWSTYLE} )
   set( ${proj}_SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} )
   set( ${proj}_DIR ${CMAKE_BINARY_DIR}/${proj}-build )

@@ -71,12 +71,12 @@
     DEPENDS
       ${${proj}_DEPENDENCIES} )

-else( NOT KWSTYLE_EXECUTABLE AND NOT ${USE_SYSTEM_KWSTYLE} )
+  else( NOT KWStyle_DIR AND NOT ${USE_SYSTEM_KWSTYLE} )
   if( ${USE_SYSTEM_KWSTYLE} )
     find_package( ${proj} REQUIRED )
   endif( ${USE_SYSTEM_KWSTYLE} )

   TubeTKMacroEmptyExternalProject( ${proj} "${${proj}_DEPENDENCIES}" )
-endif( NOT KWSTYLE_EXECUTABLE AND NOT ${USE_SYSTEM_KWSTYLE} )
+endif( NOT KWStyle_DIR AND NOT ${USE_SYSTEM_KWSTYLE} )

-list( APPEND TubeTK_EXTERNAL_PROJECTS_ARGS -DKWSTYLE_DIR:FILEPATH=${KWSTYLE_DIR} )
+list( APPEND TubeTK_EXTERNAL_PROJECTS_ARGS -DKWStyle_DIR:FILEPATH=${KWSTYLE_DIR} )


SuperBuild: geotiff using SB_CMAKE_COMMAND with options

--- SuperBuild/CMake/External_geotiff.cmake
+++ SuperBuild/CMake/External_geotiff.cmake
@@ -61,9 +61,6 @@
       DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
       DEPENDS ${GEOTIFF_DEPENDENCIES}
       CMAKE_CACHE_ARGS
-      -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-      -DCMAKE_BUILD_TYPE:STRING=Release
-      -DBUILD_SHARED_LIBS:BOOL=ON
       -DBUILD_TESTING:BOOL=OFF
       -DPROJ4_OSGEO4W_HOME:PATH=${SB_INSTALL_PREFIX}
       ${GEOTIFF_SB_CONFIG}


REFAC: update geotiff version from 1.5.1 to 1.7.0

--- SuperBuild/CMake/External_geotiff.cmake
+++ SuperBuild/CMake/External_geotiff.cmake
@@ -37,8 +37,8 @@

 ExternalProject_Add(GEOTIFF
   PREFIX GEOTIFF
-  URL "https://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.5.1.tar.gz"
-  URL_MD5 6d0fa650c206791bc7d5e60ef625ea77
+  URL "https://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.7.0.tar.gz"
+  URL_MD5 e57b69098d70a008ddfc65b675cbfcf4
   SOURCE_DIR ${GEOTIFF_SB_SRC}
   BINARY_DIR ${GEOTIFF_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


fix path settting order for link and output

--- bin/dsn.cmake
+++ bin/dsn.cmake
@@ -12,7 +12,8 @@
 	endif()

 	include_directories(${DSN_EXTRA_INCLUDEDIR})
-	add_library(${PROJ_NAME} ${PROJ_TYPE} "${PROJ_SRC}")
+	add_library(${PROJ_NAME} ${PROJ_TYPE} ${PROJ_SRC})
+
 	if(DO_INSTALL)
 		install(TARGETS ${PROJ_NAME} DESTINATION lib)
 	endif()
@@ -31,7 +32,7 @@
 	set(INSTALL_BINPLACE_DIR "bin/${PROJ_NAME}")

 	include_directories(${DSN_EXTRA_INCLUDEDIR})
-	add_executable(${PROJ_NAME} "${PROJ_SRC}")
+	add_executable(${PROJ_NAME} ${PROJ_SRC})
 	target_link_libraries(${PROJ_NAME} LINK_PUBLIC ${INPUT_LIBS})

 	set(BINPLACE_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
@@ -138,6 +139,9 @@
 		"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
 		)
 	set(PROJ_SRC ${PROJ_SRC} ${DSN_EXTRA_SRC})
+    if (PROJ_SRC STREQUAL "")
+        message (FATAL "input sources cannot be empty")
+    endif()
 	ms_add_library("STATIC" ${PROJ_NAME} "${PROJ_SRC}" 1)
 endfunction(dsn_add_library)

@@ -158,6 +162,9 @@
 		)
 	set(PROJ_SRC ${PROJ_SRC} ${DSN_EXTRA_SRC})
 	set(INPUT_LIBS ${DSN_EXTRA_LIBS} ${DSN_LIBS})
+	if (PROJ_SRC STREQUAL "")
+        message (FATAL "input sources cannot be empty")
+    endif()
 	ms_add_executable(${PROJ_NAME} "${PROJ_SRC}" "${INPUT_LIBS}" "${BINPLACE_FILES}" 0)
 endfunction(dsn_add_executable PROJ_NAME BINPLACE_FILES)

@@ -341,8 +348,8 @@
 	dsn_setup_compiler_flags()
 	dsn_setup_packages()
 	dsn_setup_include_path()
+	dsn_set_output_path()
 	dsn_setup_link_path()
-	dsn_set_output_path()
 	dsn_setup_install()
 endfunction(dsn_common_setup)


Support for FreeRTOS on Windows as build platform

--- sdk/rtos.cmake
+++ sdk/rtos.cmake
@@ -1,4 +1,11 @@
-set(ESP8266_SDK_BASE $ENV{HOME}/git/ESP8266_RTOS_SDK CACHE PATH "Path to the ESP8266 SDK")
+if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
+    set(ESP8266_SDK_BASE $ENV{HOME}/git/ESP8266_RTOS_SDK CACHE PATH "Path to the ESP8266 SDK")
+elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+    set(ESP8266_SDK_BASE $ENV{USERPROFILE}/dev/projects/ESP8266_RTOS_SDK CACHE PATH "Path to the ESP8266 SDK")
+else()
+    message(FATAL_ERROR "Unsupported build platforom.")
+endif()
+
 if (ESP8266_FLASH_SIZE MATCHES "512K")
     set(ESP8266_LINKER_SCRIPT "eagle.app.v6.ld")
     set(FW_ADDR_1 0x00000 PARENT_SCOPE)


boards: add deprecations for various 'ns' TF-M boards

Various non-secure variants of boards with SoCs that have Trusted
Firmware M support were recently renamed without any deprecations
added for the old names. This unnecessarily breaks the build for out
of tree users.

Fix that by adding the following deprecations (deprecated name ->
replacement name):

  bl5340_dvk_cpuappns        -> bl5340_dvk_cpuapp_ns
  mps2_an521_nonsecure       -> mps2_an521_ns
  musca_b1_nonsecure         -> musca_b1_ns
  musca_s1_nonsecure         -> musca_s1_ns
  nrf5340dk_nrf5340_cpuappns -> nrf5340dk_nrf5340_cpuapp_ns
  nrf9160dk_nrf9160ns        -> nrf9160dk_nrf9160_ns

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

--- boards/deprecated.cmake
+++ boards/deprecated.cmake
@@ -7,3 +7,10 @@
 #
 # To add a board rename, add a line in following format:
 # set(<old_board_name>_DEPRECATED <new_board_name>)
+
+set(bl5340_dvk_cpuappns_DEPRECATED bl5340_dvk_cpuapp_ns)
+set(mps2_an521_nonsecure_DEPRECATED mps2_an521_ns)
+set(musca_b1_nonsecure_DEPRECATED musca_b1_ns)
+set(musca_s1_nonsecure_DEPRECATED musca_s1_ns)
+set(nrf5340dk_nrf5340_cpuappns_DEPRECATED nrf5340dk_nrf5340_cpuapp_ns)
+set(nrf9160dk_nrf9160ns_DEPRECATED nrf9160dk_nrf9160_ns)


setting some more explicit compiler/linker things to see if that's what'

--- firmware/mbed/arm_toolchain.cmake
+++ firmware/mbed/arm_toolchain.cmake
@@ -1,4 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
+
+set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "")
+set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "")

 set( CMAKE_SYSTEM_NAME       Generic     )
 set( CMAKE_SYSTEM_PROCESSOR  arm         )
@@ -34,7 +37,10 @@
 # set compiler things that were found above
 set( CMAKE_C_COMPILER       ${ARM_C_COMPILER}           )
 set( CMAKE_CXX_COMPILER     ${ARM_CXX_COMPILER}         )
+set( CMAKE_OBJCOPY          ${ARM_OBJCOPY}              )
+set( CMAKE_OBJDUMP          ${ARM_OBJDUMP}              )
 set( CMAKE_RANLIB           ${ARM_RANLIB}               )
+set( CMAKE_LINKER           ${ARM_LD}                   )
 set( CMAKE_AR               ${ARM_AR}                   )
 set( CMAKE_AS               ${ARM_AS}                   )
 set( ASM                    ${ARM_AS}                   )


cmake: add define for the POSIX side of eagle

--- cmake/configs/posix_eagle_default.cmake
+++ cmake/configs/posix_eagle_default.cmake
@@ -4,6 +4,12 @@
 include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)

 set(CONFIG_SHMEM "1")
+
+# This definition allows to differentiate if this just the usual POSIX build
+# or if it is for the Snapdragon.
+set(added_definitions
+	-D__PX4_POSIX_EAGLE
+	)

 set(config_module_list
 	drivers/device


Exclude from default module when used as a remote module

Change-Id: If4b9c4bf7a01b11d3afa74d9bbfea23b731157d3

--- itk-module.cmake
+++ itk-module.cmake
@@ -3,6 +3,7 @@
 itk_module(ITKExamples
   DEPENDS
     ITKCommon
+    EXCLUDE_FROM_DEFAULT
   DESCRIPTION
     "${DOCUMENTATION}"
   )


license check

license check

--- config/cmake/modules/FindCODIPACK.cmake
+++ config/cmake/modules/FindCODIPACK.cmake
@@ -1,13 +1,14 @@
-# Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at the
-# Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights reserved.
-# See file COPYRIGHT for details.
+# Copyright (c) 2010-2021, Lawrence Livermore National Security, LLC. Produced
+# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
+# LICENSE and NOTICE for details. LLNL-CODE-806117.
 #
 # This file is part of the MFEM library. For more information and source code
-# availability see http://mfem.org.
+# availability visit https://mfem.org.
 #
 # MFEM is free software; you can redistribute it and/or modify it under the
-# terms of the GNU Lesser General Public License (as published by the Free
-# Software Foundation) version 2.1 dated February 1999.
+# terms of the BSD-3 license. We welcome feedback and contributions, see file
+# CONTRIBUTING.md for details.
+

 # Sets the following variables:
 #   - CODIPACK_FOUND


FIX: On OS X, the .dylib extension for shared modules is pretty much ubiquitous, so why, oh why does cmake use .so for a lib declared as a MODULE?

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -216,6 +216,13 @@
             INSTALL_NAME_DIR ${CEGUI_APPLE_DYLIB_INSTALL_PATH}
             BUILD_WITH_INSTALL_RPATH TRUE
         )
+
+        # Force the somewhat standard .dylib extension for modules over the use of
+        # the .so extension
+        if (${_IS_MODULE})
+            set_target_properties(${_LIB_NAME} PROPERTIES SUFFIX ".dylib")
+        endif()
+
     else()
         set_target_properties(${_LIB_NAME} PROPERTIES
             INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CEGUI_LIB_INSTALL_DIR}"


Improve the JSONCPP finder, adding pre-cmake-3.0 support, etc.

--- cmake/FindJsonCpp.cmake
+++ cmake/FindJsonCpp.cmake
@@ -1,7 +1,9 @@
-# - Find jsoncpp - stopgap find module
-# This is a stopgap find module to find older jsoncpp versions and those sadly built
-# without JSONCPP_WITH_CMAKE_PACKAGE=ON. It also wraps the different versions of the module.
-#
+# - Find jsoncpp - Overarching find module
+# This is a over-arching find module to find older jsoncpp versions and those sadly built
+# without JSONCPP_WITH_CMAKE_PACKAGE=ON, as well as those built with the cmake config file.
+# It also wraps the different versions of the module.
+#
+# On CMake 3.0 and newer:
 #  JsonCpp::JsonCpp - Imported target (possibly an interface/alias) to use:
 #  if anything is populated, this is. If both shared and static are found, then
 #  this will be the static version on DLL platforms and shared on non-DLL platforms.
@@ -9,6 +11,14 @@
 #  shared library version.
 #  JsonCpp::JsonCppStatic - Imported target (possibly an interface/alias) for a
 #  static library version.
+#
+# On all CMake versions: (Note that on CMake 2.8.10 and earlier, you may need to use JSONCPP_INCLUDE_DIRS)
+#  JSONCPP_LIBRARY - wraps JsonCpp::JsonCpp or equiv.
+#  JSONCPP_LIBRARY_IS_SHARED - if we know for sure JSONCPP_LIBRARY is shared, this is true-ish. We try to "un-set" it if we don't know one way or another.
+#  JSONCPP_LIBRARY_SHARED - wraps JsonCpp::JsonCppShared or equiv.
+#  JSONCPP_LIBRARY_STATIC - wraps JsonCpp::JsonCppStatic or equiv.
+#  JSONCPP_INCLUDE_DIRS - Include directories - should (generally?) not needed if you require CMake 2.8.11+ since it handles target include directories.
+#
 #  JSONCPP_FOUND - True if JsonCpp was found.
 #
 # Original Author:
@@ -22,38 +32,102 @@
 # (See accompanying file LICENSE_1_0.txt or copy at
 # http://www.boost.org/LICENSE_1_0.txt)

-# We will always try to produce at least one imported target, and e haven't found an imported target.
-if(NOT TARGET JsonCpp::JsonCpp AND NOT TARGET jsoncpp_lib AND NOT TARGET jsoncpp_lib_static)
+set(__jsoncpp_have_namespaced_targets OFF)
+set(__jsoncpp_have_interface_support OFF)
+if(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0))
+	set(__jsoncpp_have_namespaced_targets ON)
+	set(__jsoncpp_have_interface_support ON)
+elseif(("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" EQUAL 2.8) AND "${CMAKE_PATCH_VERSION}" GREATER 10)
+	set(__jsoncpp_have_interface_support ON)
+endif()
+
+# sets __jsoncpp_have_jsoncpplib based on whether or not we have a real imported jsoncpp_lib target.
+macro(_jsoncpp_check_for_real_jsoncpplib)
+	set(__jsoncpp_have_jsoncpplib FALSE)
+	if(TARGET jsoncpp_lib)
+		get_property(__jsoncpp_lib_type TARGET jsoncpp_lib PROPERTY TYPE)
+		# We make interface libraries. If an actual config module made it, it would be an imported library.
+		if(NOT __jsoncpp_lib_type STREQUAL "INTERFACE_LIBRARY")
+			set(__jsoncpp_have_jsoncpplib TRUE)
+		endif()
+	endif()
+endmacro()
+
+# We will always try first to get a config file.
+if(NOT JSONCPP_IMPORTED_LIBRARY)
 	# See if we find a CMake config file.
 	find_package(jsoncpp QUIET NO_MODULE)
 	if(jsoncpp_FOUND)
 		# OK, so we found something.
-		add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
-		if(TARGET jsoncpp_lib AND TARGET jsoncpp_lib_static)
+		unset(JSONCPP_IMPORTED_LIBRARY_IS_SHARED)
+		_jsoncpp_check_for_real_jsoncpplib()
+		if(__jsoncpp_have_jsoncpplib AND TARGET jsoncpp_lib_static)
 			# A veritable cache of riches - we have both shared and static!
-			add_library(JsonCpp::JsonCppShared INTERFACE IMPORTED)
-			set_property(TARGET JsonCpp::JsonCppShared PROPERTY INTERFACE_LINK_LIBRARIES jsoncpp_lib)
-
-			add_library(JsonCpp::JsonCppStatic INTERFACE IMPORTED)
-			set_property(TARGET JsonCpp::JsonCppStatic PROPERTY INTERFACE_LINK_LIBRARIES jsoncpp_lib_static)
-
+			set(JSONCPP_IMPORTED_LIBRARY_SHARED jsoncpp_lib CACHE INTERNAL "" FORCE)
+			set(JSONCPP_IMPORTED_LIBRARY_STATIC jsoncpp_lib_static CACHE INTERNAL "" FORCE)
 			if(WIN32 OR CYGWIN OR MINGW)
 				# DLL platforms: static library should be default
-				set_property(TARGET JsonCpp::JsonCpp PROPERTY INTERFACE_LINK_LIBRARIES jsoncpp_lib_static)
+				set(JSONCPP_IMPORTED_LIBRARY ${JSONCPP_IMPORTED_LIBRARY_STATIC} CACHE INTERNAL "" FORCE)
+				set(JSONCPP_IMPORTED_LIBRARY_IS_SHARED FALSE CACHE INTERNAL "" FORCE)
 			else()
 				# Other platforms - might require PIC to be linked into shared libraries, so safest to prefer shared.
-				set_property(TARGET JsonCpp::JsonCpp PROPERTY INTERFACE_LINK_LIBRARIES jsoncpp_lib)
+				set(JSONCPP_IMPORTED_LIBRARY ${JSONCPP_IMPORTED_LIBRARY_SHARED} CACHE INTERNAL "" FORCE)
+				set(JSONCPP_IMPORTED_LIBRARY_IS_SHARED TRUE CACHE INTERNAL "" FORCE)
 			endif()
 		elseif(TARGET jsoncpp_lib_static)
 			# Well, only one variant, but we know for sure that it's static.
-			add_library(JsonCpp::JsonCppStatic INTERFACE IMPORTED)
-			set_property(TARGET JsonCpp::JsonCppStatic PROPERTY INTERFACE_LINK_LIBRARIES jsoncpp_lib_static)
-			set_property(TARGET JsonCpp::JsonCpp PROPERTY INTERFACE_LINK_LIBRARIES jsoncpp_lib_static)
+			set(JSONCPP_IMPORTED_LIBRARY_STATIC jsoncpp_lib_static CACHE INTERNAL "" FORCE)
+			set(JSONCPP_IMPORTED_LIBRARY ${JSONCPP_IMPORTED_LIBRARY_STATIC} CACHE INTERNAL "" FORCE)
+			set(JSONCPP_IMPORTED_LIBRARY_IS_SHARED FALSE CACHE INTERNAL "" FORCE)
 		else() #elseif(TARGET jsoncpp_lib)
 			# One variant, and we have no idea if this is just an old version or if
 			# this is shared based on the target name alone. Hmm.
 			# TODO figure out if this is shared or static?
-			set_property(TARGET JsonCpp::JsonCpp PROPERTY INTERFACE_LINK_LIBRARIES jsoncpp_lib)
+			set(JSONCPP_IMPORTED_LIBRARY jsoncpp_lib CACHE INTERNAL "" FORCE)
+		endif()
+
+		# Now, we need include directories. Can't just limit this to old CMakes, since
+		# new CMakes might be used to build projects designed to support older ones.
+		if(__jsoncpp_have_jsoncpplib)
+			get_property(__jsoncpp_interface_include_dirs TARGET jsoncpp_lib PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+			if(__jsoncpp_interface_include_dirs)
+				set(JSONCPP_IMPORTED_INCLUDE_DIRS "${__jsoncpp_interface_include_dirs}" CACHE INTERNAL "" FORCE)
+			endif()
+		endif()
+		if(TARGET jsoncpp_lib_static AND NOT JSONCPP_IMPORTED_INCLUDE_DIRS)
+			get_property(__jsoncpp_interface_include_dirs TARGET jsoncpp_lib_static PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+			if(__jsoncpp_interface_include_dirs)
+				set(JSONCPP_IMPORTED_INCLUDE_DIRS "${__jsoncpp_interface_include_dirs}" CACHE INTERNAL "" FORCE)
+			endif()
+		endif()
+		if(NOT JSONCPP_IMPORTED_INCLUDE_DIRS)
+			# OK, so we couldn't get it from the target... maybe we can figure it out from jsoncpp_DIR.
+
+			# take off the jsoncpp component
+			get_filename_component(__jsoncpp_import_root "${jsoncpp_DIR}/.." ABSOLUTE)
+			set(__jsoncpp_hints "${__jsoncpp_import_root}")
+			# take off the cmake component
+			get_filename_component(__jsoncpp_import_root "${__jsoncpp_import_root}/.." ABSOLUTE)
+			list(APPEND __jsoncpp_hints "${__jsoncpp_import_root}")
+			# take off the lib component
+			get_filename_component(__jsoncpp_import_root "${__jsoncpp_import_root}/.." ABSOLUTE)
+			list(APPEND __jsoncpp_hints "${__jsoncpp_import_root}")
+			# take off one more component in case of multiarch lib
+			get_filename_component(__jsoncpp_import_root "${__jsoncpp_import_root}/.." ABSOLUTE)
+			list(APPEND __jsoncpp_hints "${__jsoncpp_import_root}")
+
+			# Now, search.
+			find_path(JsonCpp_INCLUDE_DIR
+				NAMES
+				json/json.h
+				PATH_SUFFIXES include jsoncpp include/jsoncpp
+				HINTS ${__jsoncpp_hints})
+
+			if(JsonCpp_INCLUDE_DIR)
+				mark_as_advanced(JsonCpp_INCLUDE_DIR)
+				# Note - this does not set it in the cache, in case we find it better at some point in the future!
+				set(JSONCPP_IMPORTED_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR})
+			endif()
 		endif()

 		# As a convenience...
@@ -62,18 +136,55 @@
 			target_link_libraries(jsoncpp_lib INTERFACE jsoncpp_lib_static)
 		endif()

-		set(JSONCPP_LIBRARY JsonCpp::JsonCpp)
-
+		# OK, finish this up.
 		include(FindPackageHandleStandardArgs)
 		find_package_handle_standard_args(JsonCpp
 			DEFAULT_MSG
-			JSONCPP_LIBRARY)
-	endif()
-endif()
-
-# Still nothing after looking for the config file.
-if(NOT TARGET JsonCpp::JsonCpp)
-
+			JSONCPP_IMPORTED_LIBRARY
+			JSONCPP_IMPORTED_INCLUDE_DIRS)
+	endif()
+endif()
+
+# Create any missing namespaced targets from the config module.
+if(__jsoncpp_have_namespaced_targets)
+	if(JSONCPP_IMPORTED_LIBRARY AND NOT TARGET JsonCpp::JsonCpp)
+		add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
+		set_property(TARGET JsonCpp::JsonCpp PROPERTY INTERFACE_LINK_LIBRARIES ${JSONCPP_IMPORTED_LIBRARY})
+	endif()
+
+	if(JSONCPP_IMPORTED_LIBRARY_SHARED AND NOT TARGET JsonCpp::JsonCppShared)
+		add_library(JsonCpp::JsonCppShared INTERFACE IMPORTED)
+		set_property(TARGET JsonCpp::JsonCppShared PROPERTY INTERFACE_LINK_LIBRARIES ${JSONCPP_IMPORTED_LIBRARY_SHARED})
+	endif()
+
+	if(JSONCPP_IMPORTED_LIBRARY_STATIC AND NOT TARGET JsonCpp::JsonCppStatic)
+		add_library(JsonCpp::JsonCppStatic INTERFACE IMPORTED)
+		set_property(TARGET JsonCpp::JsonCppStatic PROPERTY INTERFACE_LINK_LIBRARIES ${JSONCPP_IMPORTED_LIBRARY_STATIC})
+	endif()
+endif()
+
+# Set any non-cache variables from cache variables set by a config module parsed above.
+if(JSONCPP_FOUND AND JSONCPP_IMPORTED_LIBRARY)
+	set(JSONCPP_LIBRARY ${JSONCPP_IMPORTED_LIBRARY})
+	set(JSONCPP_INCLUDE_DIRS ${JSONCPP_IMPORTED_INCLUDE_DIRS})
+	if(DEFINED JSONCPP_IMPORTED_LIBRARY_IS_SHARED)
+		set(JSONCPP_LIBRARY_IS_SHARED ${JSONCPP_IMPORTED_LIBRARY_IS_SHARED})
+	else()
+		unset(JSONCPP_LIBRARY_IS_SHARED)
+	endif()
+endif()
+
+if(JSONCPP_IMPORTED_LIBRARY_SHARED)
+	set(JSONCPP_LIBRARY_SHARED ${JSONCPP_IMPORTED_LIBRARY_SHARED})
+endif()
+
+if(JSONCPP_IMPORTED_LIBRARY_STATIC)
+	set(JSONCPP_LIBRARY_STATIC ${JSONCPP_IMPORTED_LIBRARY_STATIC})
+endif()
+
+
+# Still nothing after looking for the config file: must go "old-school"
+if(NOT JSONCPP_FOUND OR NOT JSONCPP_IMPORTED_LIBRARY)
 	# Invoke pkgconfig for hints
 	find_package(PkgConfig QUIET)
 	set(_JSONCPP_INCLUDE_HINTS)
@@ -173,11 +284,21 @@
 		#	INTERFACE_INCLUDE_DIRECTORIES "${JsonCpp_INCLUDE_DIR}"
 		#	IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")

-		add_library(jsoncpp_interface INTERFACE)
-		set_target_properties(jsoncpp_interface PROPERTIES
-			INTERFACE_LINK_LIBRARIES "${JsonCpp_LIBRARY}"
-			INTERFACE_INCLUDE_DIRECTORIES "${JsonCpp_INCLUDE_DIR}")
-		add_library(JsonCpp::JsonCpp ALIAS jsoncpp_interface)
+		set(JSONCPP_LIBRARY "${JsonCpp_LIBRARY}")
+		set(JSONCPP_INCLUDE_DIRS "${JsonCpp_INCLUDE_DIR}")
+		unset(JSONCPP_LIBRARY_IS_SHARED)
+
+		if(__jsoncpp_have_interface_support AND NOT TARGET jsoncpp_interface)
+			add_library(jsoncpp_interface INTERFACE)
+			set_target_properties(jsoncpp_interface PROPERTIES
+				INTERFACE_LINK_LIBRARIES "${JsonCpp_LIBRARY}"
+				INTERFACE_INCLUDE_DIRECTORIES "${JsonCpp_INCLUDE_DIR}")
+		endif()
+		if(__jsoncpp_have_namespaced_targets)
+			if(NOT TARGET JsonCpp::JsonCpp)
+				add_library(JsonCpp::JsonCpp ALIAS jsoncpp_interface)
+			endif()
+		endif()
 		mark_as_advanced(JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)
 	endif()
 endif()


Recent UMFPACK library requires to link to libSuiteSparse

--- cmake/FindUmfpack.cmake
+++ cmake/FindUmfpack.cmake
@@ -39,9 +39,12 @@
   find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
   if (COLAMD_LIBRARY)
     set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
-  #else (COLAMD_LIBRARY)
-  #  set(UMFPACK_LIBRARIES FALSE)
   endif (COLAMD_LIBRARY)
+
+  find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
+  if (SUITESPARSE_LIBRARY)
+    set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SUITESPARSE_LIBRARY})
+  endif (SUITESPARSE_LIBRARY)

 endif(UMFPACK_LIBRARIES)


Set CMP0051 to new.

Set CMP0051 to new.

To avoid error messages about CMP0051, this policy will be set to new.

--- cmake/Findcodecov.cmake
+++ cmake/Findcodecov.cmake
@@ -35,6 +35,14 @@
 	# gcc and clang fallback
 	"-O0 -g --coverage"
 )
+
+
+# To avoid error messages about CMP0051, this policy will be set to new. There
+# will be no problem, as TARGET_OBJECTS generator expressions will be filtered
+# with a regular expression from the sources.
+if (POLICY CMP0051)
+	cmake_policy(SET CMP0051 NEW)
+endif()

 # Add coverage support for target ${TNAME} and register target for coverage


Update: AUTO_OFF --> requirements not met

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -12,7 +12,7 @@
     PCL_GET_SUBSYS_HYPERSTATUS(subsys_status ${_name})
     if(NOT ("${subsys_status}" STREQUAL "AUTO_OFF"))
       option(${_opt_name} ${_desc} ${_default})
-      if(NOT ${_default} AND NOT ${_opt_name})
+      if((NOT ${_default} AND NOT ${_opt_name}) OR ("${_default}" STREQUAL "AUTO_OFF"))
         set(${_var} FALSE)
         if(${ARGC} GREATER 4)
           set(_reason ${ARGV4})
@@ -29,7 +29,7 @@
         set(${_var} TRUE)
         PCL_SET_SUBSYS_STATUS(${_name} TRUE)
         PCL_ENABLE_DEPENDIES(${_name})
-      endif(NOT ${_default} AND NOT ${_opt_name})
+      endif((NOT ${_default} AND NOT ${_opt_name}) OR ("${_default}" STREQUAL "AUTO_OFF"))
     endif(NOT ("${subsys_status}" STREQUAL "AUTO_OFF"))
     PCL_ADD_SUBSYSTEM(${_name} ${_desc})
 endmacro(PCL_SUBSYS_OPTION)