add xpTargetExtern cmake function

add xpTargetExtern cmake function

* given a target: calls target_include_directories, target_link_libraries, target_compile_definitions

see issue https://github.com/smanders/externpro/issues/182

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1125,20 +1125,22 @@
   endif()
 endfunction()

-function(ipAppendPkgVars pkg _libList _incDirs)
+function(ipAppendPkgVars pkg _lib _inc _def)
   string(TOUPPER ${pkg} PKG)
   if(${PKG}_FOUND)
     if(DEFINED ${PKG}_LIBRARIES)
-      list(APPEND liblist "${${PKG}_LIBRARIES}")
+      set(${_lib} ${${_lib}} "${${PKG}_LIBRARIES}" PARENT_SCOPE)
     endif()
     if(DEFINED ${PKG}_INCLUDE_DIR)
       foreach(idir ${${PKG}_INCLUDE_DIR})
-        list(APPEND incdirs "$<BUILD_INTERFACE:${idir}>")
+        list(APPEND pkginc "$<BUILD_INTERFACE:${idir}>")
       endforeach()
-    endif()
-  endif()
-  set(${_libList} ${liblist} PARENT_SCOPE)
-  set(${_incDirs} ${incdirs} PARENT_SCOPE)
+      set(${_inc} ${${_inc}} ${pkginc} PARENT_SCOPE)
+    endif()
+    if(DEFINED ${PKG}_DEFINITIONS)
+      set(${_def} ${${_def}} "${${PKG}_DEFINITIONS}" PARENT_SCOPE)
+    endif()
+  endif()
 endfunction()

 # get the external include directories and library list
@@ -1152,19 +1154,61 @@
     list(APPEND incdirs PUBLIC)
   endif()
   foreach(pkg ${GE_PUBLIC})
-    ipAppendPkgVars(${pkg} liblist incdirs)
+    ipAppendPkgVars(${pkg} liblist incdirs deflist)
   endforeach()
   if(DEFINED GE_PRIVATE)
     list(APPEND incdirs PRIVATE)
   endif()
   foreach(pkg ${GE_PRIVATE})
-    ipAppendPkgVars(${pkg} liblist incdirs)
+    ipAppendPkgVars(${pkg} liblist incdirs deflist)
   endforeach()
   if(DEFINED incdirs)
     list(REMOVE_DUPLICATES incdirs)
   endif()
   set(${_libList} ${liblist} PARENT_SCOPE)
   set(${_incDirs} ${incdirs} PARENT_SCOPE)
+endfunction()
+
+function(xpTargetExtern tgt)
+  set(multiValueArgs PUBLIC PRIVATE)
+  cmake_parse_arguments(TE "" "" "${multiValueArgs}" ${ARGN})
+  xpFindPkg(PKGS ${TE_PUBLIC} ${TE_PRIVATE})
+  foreach(pkg ${TE_PUBLIC})
+    ipAppendPkgVars(${pkg} publib pubinc pubdef)
+  endforeach()
+  foreach(pub publib pubinc pubdef)
+    if(${pub})
+      list(REMOVE_DUPLICATES ${pub})
+      set(_${pub} PUBLIC ${${pub}})
+    endif()
+  endforeach()
+  foreach(pkg ${TE_PRIVATE})
+    ipAppendPkgVars(${pkg} pvtlib pvtinc pvtdef)
+  endforeach()
+  foreach(pvt pvtlib pvtinc pvtdef)
+    if(${pvt})
+      list(REMOVE_DUPLICATES ${pvt})
+      set(_${pvt} PRIVATE ${${pvt}})
+    endif()
+  endforeach()
+  if(_publib OR _pvtlib)
+    if(XP_CMAKE_VERBOSE)
+      message(STATUS "${tgt} libs: ${_publib} ${_pvtlib}")
+    endif()
+    target_link_libraries(${tgt} ${_publib} ${_pvtlib})
+  endif()
+  if(_pubinc OR _pvtinc)
+    if(XP_CMAKE_VERBOSE)
+      message(STATUS "${tgt} incs: SYSTEM ${_pubinc} ${_pvtinc}")
+    endif()
+    target_include_directories(${tgt} SYSTEM ${_pubinc} ${_pvtinc})
+  endif()
+  if(_pubdef OR _pvtdef)
+    if(XP_CMAKE_VERBOSE)
+      message(STATUS "${tgt} defs: ${_pubdef} ${_pvtdef}")
+    endif()
+    target_compile_definitions(${tgt} ${_pubdef} ${_pvtdef})
+  endif()
 endfunction()

 function(xpLibdepTest libName)


iOS.cmake: Update from upstream source.

iOS.cmake: Update from upstream source.

--- iOS/iOS.cmake
+++ iOS/iOS.cmake
@@ -28,7 +28,6 @@
 #  A macro used to find executable programs on the host system, not within the iOS environment.
 #  Thanks to the android-cmake project for providing the command

-
 # Standard settings
 set (CMAKE_SYSTEM_NAME Darwin)
 set (CMAKE_SYSTEM_VERSION 1)
@@ -48,8 +47,9 @@

 # Force the compilers to gcc for iOS
 include (CMakeForceCompiler)
-CMAKE_FORCE_C_COMPILER (gcc gcc)
-CMAKE_FORCE_CXX_COMPILER (g++ g++)
+CMAKE_FORCE_C_COMPILER (/usr/bin/clang Apple)
+CMAKE_FORCE_CXX_COMPILER (/usr/bin/clang++ Apple)
+set(CMAKE_AR ar CACHE FILEPATH "" FORCE)

 # Skip the platform compiler checks for cross compiling
 set (CMAKE_CXX_COMPILER_WORKS TRUE)
@@ -70,7 +70,7 @@

 # Hidden visibilty is required for cxx on iOS
 set (CMAKE_C_FLAGS_INIT "")
-set (CMAKE_CXX_FLAGS_INIT "-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden")
+set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden -isysroot ${CMAKE_OSX_SYSROOT}")

 set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
 set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")


Update the file for compatibility.

Update the file for compatibility.


Minor bug fix to  build.cmake

Minor bug fix to  build.cmake

--- products/pgen/pgen_utils/.pgen_templates/build.cmake
+++ products/pgen/pgen_utils/.pgen_templates/build.cmake
@@ -1,10 +1,9 @@
-
 if(CMAKE_BUILD_TYPE MATCHES Debug)
-        set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/debug")
-        set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/debug")
-        set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/debug")
+        set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/${PROJECT_NAME}/debug")
+        set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/${PROJECT_NAME}/debug")
+        set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/${PROJECT_NAME}/debug")
 else()
-        set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/release")
-        set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/release")
-        set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/release")
+        set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/${PROJECT_NAME}/release")
+        set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/${PROJECT_NAME}/release")
+        set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/${PROJECT_NAME}/release")
 endif()


Remove old file config.h.cmake from libjingle tree

svn path=/trunk/KDE/kdenetwork/kopete/; revision=1355329

--- protocols/jabber/googletalk/libjingle/config.h.cmake
+++ protocols/jabber/googletalk/libjingle/config.h.cmake
@@ -1,85 +0,0 @@
-
-/* Chat archving */
-#define FEATURE_ENABLE_CHAT_ARCHIVING 1
-
-/* Enable SSL */
-#define FEATURE_ENABLE_SSL 1
-
-/* voice mail */
-#define FEATURE_ENABLE_VOICEMAIL 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Building on Linux */
-#cmakedefine LINUX 1
-
-/* Logging */
-#define LOGGING 1
-
-/* Building on OSX */
-#cmakedefine OSX 0
-
-/* Building on WIN32 */
-#cmakedefine WIN32 0
-
-/* Name of package */
-#define PACKAGE "libjingle"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "google-talk-open@googlegroups.com"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "libjingle"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libjingle 0.4.0"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "libjingle"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.4.0"
-
-/* If we're using configure, we're on POSIX */
-#cmakedefine POSIX 1
-
-/* Build as a production build */
-#define PRODUCTION 1
-
-/* Build as a production build */
-#define PRODUCTION_BUILD 1
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "0.4.0"
-


BUG: @ symbol was causing problems on some plateform

--- vtkGenerateVTKConfig.cmake
+++ vtkGenerateVTKConfig.cmake
@@ -25,7 +25,7 @@
 SET(VTK_MPI_CLIENT_POSTFLAGS_CONFIG ${VTK_MPI_CLIENT_POSTFLAGS})
 SET(VTK_MPI_SERVER_POSTFLAGS_CONFIG ${VTK_MPI_SERVER_POSTFLAGS})
 SET(PV_SSH_FLAGS_CONFIG ${PV_SSH_FLAGS})
-SET(PV_SETUP_SCRIPT_CONFIG ${PV_SETUP_SCRIPT@})
+SET(PV_SETUP_SCRIPT_CONFIG ${PV_SETUP_SCRIPT})

 #-----------------------------------------------------------------------------
 # Settings specific to the build tree.


Added the Open CASCADE TKCDF library required to build SMESH with OCCT7.x and 'quiet'ed search for OpenCascade Community Edition on OS X.

--- cMake/FindOpenCasCade.cmake
+++ cMake/FindOpenCasCade.cmake
@@ -12,9 +12,9 @@
   # Check for OSX needs to come first because UNIX evaluates to true on OSX
   if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     if(DEFINED MACPORTS_PREFIX)
-      find_package(OCE HINTS ${MACPORTS_PREFIX}/Library/Frameworks)
+      find_package(OCE QUIET HINTS ${MACPORTS_PREFIX}/Library/Frameworks)
     elseif(DEFINED HOMEBREW_PREFIX)
-      find_package(OCE HINTS ${HOMEBREW_PREFIX}/Cellar/oce/*)
+      find_package(OCE QUIET HINTS ${HOMEBREW_PREFIX}/Cellar/oce/*)
     endif()
   elseif(UNIX)
     set(OCE_DIR "/usr/local/share/cmake/")
@@ -112,6 +112,7 @@
     TKBin
     TKBool
     TKBO
+    TKCDF
     TKBRep
     TKTopAlgo
     TKGeomAlgo


config: Fix define for strsignal().

config: Fix define for strsignal().

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- config.h.cmake
+++ config.h.cmake
@@ -113,7 +113,7 @@
 #cmakedefine HAVE_VSNPRINTF 1

 /* Define to 1 if you have the `strsignal' function. */
-#cmakedefine HAVE_STRSIGNAL 0
+#cmakedefine HAVE_STRSIGNAL 1

 /**************************** OPTIONS ****************************/


[config.h] fix due to undefined HAVE_LPSOLVE

--- config.h.cmake
+++ config.h.cmake
@@ -24,8 +24,12 @@
 #define DUNE_GDT_VERSION_REVISION ${DUNE_GDT_VERSION_REVISION}

 // alberta and lpsolve both define a clashing get_max_level
-#if HAVE_LPSOLVE && HAVE_ALBERTA
+#ifdef HAVE_LPSOLVE
+#if HAVE_LPSOLVE
+#if HAVE_ALBERTA
 #undef HAVE_LPSOLVE
+#endif
+#endif
 #endif
 /* end dune-gdt */
 // NEVER delete/alter above comment, dune's cmake relies on it


transitively carry thrift dependencies forward

Summary: eden.thrift includes fb303_core.thrift, so any cmake target that depends on eden.thrift should pull in fb303_core.thrift's include directories and libraries. Implement that machinery in CppThriftLibrary.cmake.

Reviewed By: wez

Differential Revision: D16062657

fbshipit-source-id: d5d962960e767a138a9b634a12aebccf72d6ef43

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -37,7 +37,13 @@
     DIRECTORY
   )

-  list(APPEND GEN_ARGS "include_prefix=${output_dir}")
+  # Generate relative paths in #includes
+  file(RELATIVE_PATH include_prefix ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE})
+  get_filename_component(include_prefix ${include_prefix} DIRECTORY)
+
+  if (NOT "${include_prefix}" STREQUAL "")
+    list(APPEND GEN_ARGS "include_prefix=${include_prefix}")
+  endif()
   # CMake 3.12 is finally getting a list(JOIN) function, but until then
   # treating the list as a string and replacing the semicolons is good enough.
   string(REPLACE ";" "," GEN_ARG_STR "${GEN_ARGS}")
@@ -70,6 +76,24 @@
     )
   endforeach()

+  list(APPEND thrift_include_options -I ${CMAKE_SOURCE_DIR})
+  foreach(depends IN LISTS DEPENDS)
+    get_property(thrift_include_directory
+      TARGET ${depends}
+      PROPERTY THRIFT_INCLUDE_DIRECTORY)
+
+    if (thrift_include_directory STREQUAL "")
+      message(STATUS "No thrift dependency found for ${depends}")
+    else()
+      list(APPEND thrift_include_options -I
+        ${thrift_include_directory})
+    endif()
+  endforeach()
+
+  file(
+    GLOB_RECURSE THRIFT_TEMPLATE_FILES
+    FOLLOW_SYMLINKS ${FBTHRIFT_TEMPLATES_DIR}/*.mustache)
+
   # Emit the rule to run the thrift compiler
   add_custom_command(
     OUTPUT
@@ -82,7 +106,7 @@
       --strict
       --templates ${FBTHRIFT_TEMPLATES_DIR}
       --gen "mstch_cpp2:${GEN_ARG_STR}"
-      -I ${CMAKE_SOURCE_DIR}
+      ${thrift_include_options}
       -o ${output_dir}
       ${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}
     WORKING_DIRECTORY
@@ -97,16 +121,18 @@
   add_library(${LIB_NAME} STATIC
     ${generated_sources}
   )
-  set_property(
-    TARGET ${LIB_NAME}
-    PROPERTY PUBLIC_HEADER
-      ${generated_headers}
+
+  install(
+    FILES ${generated_headers}
+    DESTINATION $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/gen-cpp2
   )
+
   target_include_directories(
     ${LIB_NAME}
+    PRIVATE
+      ${CMAKE_SOURCE_DIR}
+      ${CMAKE_BINARY_DIR}
     PUBLIC
-      $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
-      $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
       ${FOLLY_INCLUDE_DIR}
       ${FBTHRIFT_INCLUDE_DIR}
   )
@@ -117,4 +143,15 @@
       FBThrift::thriftcpp2
       Folly::folly
   )
+
+  set_target_properties(
+    ${LIB_NAME}
+    PROPERTIES
+      EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
+      THRIFT_INCLUDE_DIRECTORY ${CMAKE_SOURCE_DIR}
+  )
+
+  get_property(thrift_include_directory
+    TARGET ${LIB_NAME}
+    PROPERTY THRIFT_INCLUDE_DIRECTORY)
 endfunction()


toolbox: add display_all_variables function, useful for debugging

--- lib/cmake/macros.cmake
+++ lib/cmake/macros.cmake
@@ -91,3 +91,13 @@
 		unset(__${OPT}_HELPSTRING CACHE)
 	endif()
 endmacro(disable_if)
+
+# display all set variables
+#
+# CALL: display_all_variables()
+macro(display_all_variables)
+	get_cmake_property(_variableNames VARIABLES)
+	foreach (_variableName ${_variableNames})
+		message(STATUS "${_variableName} = ${${_variableName}}")
+	endforeach()
+endmacro(display_all_variables)


Additional Libs (i.e. needed for BusOut)


Fix POSIX_SEMAPHORES_NOT_ENABLED and HAVE_BROKEN_SEM_GETVALUE test

The double quote were not escaped and the check state was poped to early
which was preventing the threading library from being associated
with the test.

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -647,14 +647,7 @@
 check_symbol_exists(pthread_init "${CFG_HEADERS}" HAVE_PTHREAD_INIT)
 check_symbol_exists(pthread_sigmask "${CFG_HEADERS}" HAVE_PTHREAD_SIGMASK)

-set(CFG_HEADERS ${CFG_HEADERS_SAVE})
-cmake_pop_check_state()
-
-# For multiprocessing module, check that sem_open
-# actually works.  For FreeBSD versions <= 7.2,
-# the kernel module that provides POSIX semaphores
-# isn't loaded by default, so an attempt to call
-# sem_open results in a 'Signal 12' error.
+# For multiprocessing module, check that sem_open actually works.
 set(check_src ${PROJECT_BINARY_DIR}/ac_cv_posix_semaphores_enabled.c)
 file(WRITE ${check_src} "#include <unistd.h>
 #include <fcntl.h>
@@ -663,13 +656,13 @@
 #include <sys/stat.h>

 int main(void) {
-  sem_t *a = sem_open("/autoconf", O_CREAT, S_IRUSR|S_IWUSR, 0);
+  sem_t *a = sem_open(\"/autoconf\", O_CREAT, S_IRUSR|S_IWUSR, 0);
   if (a == SEM_FAILED) {
-    perror("sem_open");
+    perror(\"sem_open\");
     return 1;
   }
   sem_close(a);
-  sem_unlink("/autoconf");
+  sem_unlink(\"/autoconf\");
   return 0;
 }
 ")
@@ -681,7 +674,7 @@
   )

 # Multiprocessing check for broken sem_getvalue
-set(check_src ${PROJECT_BINARY_DIR}/ac_cv_broken_sem_getvalue.c)
+set(check_src ${PROJECT_BINARY_DIR}/have_broken_sem_getvalue.c)
 file(WRITE ${check_src} "#include <unistd.h>
 #include <fcntl.h>
 #include <stdio.h>
@@ -689,17 +682,17 @@
 #include <sys/stat.h>

 int main(void){
-  sem_t *a = sem_open("/autocftw", O_CREAT, S_IRUSR|S_IWUSR, 0);
+  sem_t *a = sem_open(\"/autocftw\", O_CREAT, S_IRUSR|S_IWUSR, 0);
   int count;
   int res;
   if(a==SEM_FAILED){
-    perror("sem_open");
+    perror(\"sem_open\");
     return 1;

   }
   res = sem_getvalue(a, &count);
   sem_close(a);
-  sem_unlink("/autocftw");
+  sem_unlink(\"/autocftw\");
   return res==-1 ? 1 : 0;
 }
 ")
@@ -709,6 +702,9 @@
   ${check_src}
   INVERT
   )
+
+set(CFG_HEADERS ${CFG_HEADERS_SAVE})
+cmake_pop_check_state()

 if(CMAKE_SYSTEM MATCHES BlueGene)
   # Todo: Display message


[cmake] External: do not print warnings.

--- cmake/ExternalInclude.cmake
+++ cmake/ExternalInclude.cmake
@@ -1,3 +1,14 @@
+#set the compile defdinition for current directory (i.e. externals)
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+  add_compile_options(/w )
+else()
+  add_compile_options(-w)
+endif()
+
+#create a sepefic options for the external build
+get_directory_property(EXTERNAL_FLAGS COMPILE_OPTIONS)
+set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTERNAL_FLAGS}")
+
 set(RADIUM_EXTERNAL_CMAKE_OPTIONS
     -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
     -DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}
@@ -7,7 +18,7 @@
     -DCMAKE_INSTALL_MESSAGE=${RADIUM_EXTERNAL_CMAKE_INSTALL_MESSAGE}
     -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
     -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-    -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+    -DCMAKE_CXX_FLAGS=${EXTERNAL_CMAKE_CXX_FLAGS}
     -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
     -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
     -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}


loader: Further ImageMagick detection fix

Karl discovered an issue with the last change to FindImageMagick.cmake.

--- cmake/FindImageMagick.cmake
+++ cmake/FindImageMagick.cmake
@@ -155,7 +155,7 @@
     LIST(APPEND ImageMagick_INCLUDE_DIRS
       ${ImageMagick_${component}_INCLUDE_DIR}
       )
-    LIST(APPEND ImageMagick_${component}_INCLUDE_DIRS
+    LIST(APPEND ImageMagick_INCLUDE_DIRS
       ${ImageMagick_${component}_ARCH_INCLUDE_DIR}
       )
     LIST(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)


[cmake] correct default values in option docstrings

--- cmake/default_options.cmake
+++ cmake/default_options.cmake
@@ -15,23 +15,23 @@
 # Use cmake -DOPTION_NAME=some-value ... to modify default value.
 option(WITH_DOCUMENTATION "Build Documentation. Default = OFF" OFF)
 option(WITH_PYTHON_WRAPPER "Build python bindings using swig. Default = ON" ON)
-option(WITH_DOXYGEN_WARNINGS "Explore doxygen warnings." OFF)
+option(WITH_DOXYGEN_WARNINGS "Explore doxygen warnings. Default = OFF" OFF)
 option(WITH_DOXY2SWIG "Build swig docstrings from doxygen xml output. Default = OFF." OFF)
-option(WITH_SYSTEM_INFO "Verbose mode to get some system/arch details. Default = off." OFF)
+option(WITH_SYSTEM_INFO "Verbose mode to get some system/arch details. Default = OFF." OFF)
 option(WITH_TESTING "Enable 'make test' target" OFF)
 option(WITH_GIT "Consider sources are under GIT" OFF)
 option(WITH_SERIALIZATION "Compilation of serialization functions. Default = OFF" OFF)
 option(WITH_GENERATION "Generation of serialization functions with gccxml. Default = OFF" OFF)
-option(WITH_CXX "Enable CXX compiler for Numerics. Default=ON." ON)
+option(WITH_CXX "Enable CXX compiler for Numerics. Default = ON" ON)
 option(WITH_UNSTABLE "Enable this to include all 'unstable' sources. Default=OFF" OFF)
-option(BUILD_SHARED_LIBS "Building of shared libraries" ON)
-option(DEV_MODE "Compilation flags setup for developpers. Default: ON" OFF)
+option(BUILD_SHARED_LIBS "Building of shared libraries. Default = ON" ON)
+option(DEV_MODE "Compilation flags setup for developpers. Default = OFF" OFF)
 option(WITH_BULLET "compilation with Bullet Bindings. Default = OFF" OFF)
 option(WITH_OCC "compilation with OpenCascade Bindings. Default = OFF" OFF)
 option(WITH_MUMPS "Compilation with MUMPS solver. Default = OFF" OFF)
-option(WITH_FCLIB "link with fclib when this mode is enable. Default = off." OFF)
-option(WITH_FREECAD "Use FreeCAD" OFF)
-option(WITH_MECHANISMS "Generation of bindings for Saladyn Mechanisms toolbox" OFF)
+option(WITH_FCLIB "link with fclib when this mode is enable. Default = OFF" OFF)
+option(WITH_FREECAD "Use FreeCAD. Default = OFF" OFF)
+option(WITH_MECHANISMS "Generation of bindings for Saladyn Mechanisms toolbox. Default = OFF" OFF)
 option(WITH_XML "Enable xml files i/o. Default = ON" ON)

 # Set python install mode:


NFC. Updating an incomplete code comment

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -101,7 +101,9 @@
 macro(add_lldb_executable name)
   add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
   set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
-  # $ORIGIN is only
+  # ELF and Mach-O loaders have different ways of expressing that an rpath
+  # should be relative to the binary being loaded. Mach-O uses @loader_path, and
+  # ELF uses $ORIGIN.
   if(APPLE)
     set(rpath_prefix "@loader_path")
   else()


CMake: Stop using LLVM's custom parse_arguments. NFC

Summary:
Use CMake's cmake_parse_arguments() instead.
It's called in a slightly different way, but supports all our use cases.
It's in CMake 2.8.8, which is our minimum supported version.

CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc):
http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments

Reviewers: pcc, beanz, chapuni

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10531

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@240121 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1,4 +1,3 @@
-include(LLVMParseArguments)
 include(LLVMProcessSources)
 include(LLVM-Config)

@@ -847,7 +846,7 @@
 # A raw function to create a lit target. This is used to implement the testuite
 # management functions.
 function(add_lit_target target comment)
-  parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
+  cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
   set(LIT_ARGS "${ARG_ARGS} ${LLVM_LIT_ARGS}")
   separate_arguments(LIT_ARGS)
   if (NOT CMAKE_CFG_INTDIR STREQUAL ".")
@@ -862,9 +861,9 @@
   foreach(param ${ARG_PARAMS})
     list(APPEND LIT_COMMAND --param ${param})
   endforeach()
-  if (ARG_DEFAULT_ARGS)
+  if (ARG_UNPARSED_ARGUMENTS)
     add_custom_target(${target}
-      COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS}
+      COMMAND ${LIT_COMMAND} ${ARG_UNPARSED_ARGUMENTS}
       COMMENT "${comment}"
       ${cmake_3_2_USES_TERMINAL}
       )
@@ -883,12 +882,12 @@

 # A function to add a set of lit test suites to be driven through 'check-*' targets.
 function(add_lit_testsuite target comment)
-  parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
+  cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})

   # EXCLUDE_FROM_ALL excludes the test ${target} out of check-all.
   if(NOT EXCLUDE_FROM_ALL)
     # Register the testsuites, params and depends for the global check rule.
-    set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${ARG_DEFAULT_ARGS})
+    set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${ARG_UNPARSED_ARGUMENTS})
     set_property(GLOBAL APPEND PROPERTY LLVM_LIT_PARAMS ${ARG_PARAMS})
     set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS})
     set_property(GLOBAL APPEND PROPERTY LLVM_LIT_EXTRA_ARGS ${ARG_ARGS})
@@ -896,7 +895,7 @@

   # Produce a specific suffixed check rule.
   add_lit_target(${target} ${comment}
-    ${ARG_DEFAULT_ARGS}
+    ${ARG_UNPARSED_ARGUMENTS}
     PARAMS ${ARG_PARAMS}
     DEPENDS ${ARG_DEPENDS}
     ARGS ${ARG_ARGS}
@@ -905,7 +904,7 @@

 function(add_lit_testsuites project directory)
   if (NOT CMAKE_CONFIGURATION_TYPES)
-    parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
+    cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
     file(GLOB_RECURSE litCfg ${directory}/lit*.cfg)
     set(lit_suites)
     foreach(f ${litCfg})


Small correction so less files will be modified.

--- cmake/rtems/FindRTEMS.cmake
+++ cmake/rtems/FindRTEMS.cmake
@@ -45,6 +45,7 @@
 option(WITH_BACKTRACE      "Enable Backtrace feature"     No)
 option(WITH_LINUX_TRACE    "Enable Lttng support"         No)
 option(WITH_PTHREAD_TLS    "Use old Pthread TLS mode"     No)
+option(WITH_SYSTEM_MALLOC "Use system memory allocator"  Yes)

 # Plugins: what should be build ?, these options
 # will be processed later on the plugins/CMakeLists.txt file


More Fixes to FindJNI.cmake for the Ubuntu Installer

--- cmake_modules/FindJNI.cmake
+++ cmake_modules/FindJNI.cmake
@@ -102,11 +102,11 @@
   ${_JAVA_HOME}/lib
   ${_JAVA_HOME}
   /usr/lib/jvm/java-6-openjdk/jre/lib
+  /usr/lib/jvm/java-6-openjdk-i386/jre/lib
   /usr/lib/jvm/java-6-openjdk-amd64/jre/lib
-  /usr/lib/jvm/java-6-openjdk-i386/jre/lib
   /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
+  /usr/lib/jvm/java-6-openjdk-i386/jre/lib/{libarch}
   /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/{libarch}
-  /usr/lib/jvm/java-6-openjdk-i386/jre/lib/{libarch}
   /usr/lib
   /usr/local/lib
   /usr/lib/jvm/java/lib
@@ -142,9 +142,9 @@
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
   ${_JAVA_HOME}/include
-  /usr/lib/jvm/java-6-openjdk/jre/include
-  /usr/lib/jvm/java-6-openjdk-amd64/jre/include
-  /usr/lib/jvm/java-6-openjdk-i386/jre/include
+  /usr/lib/jvm/java-6-openjdk/include
+  /usr/lib/jvm/java-6-openjdk-amd64/include
+  /usr/lib/jvm/java-6-openjdk-i386/include
   /usr/include
   /usr/local/include
   /usr/lib/java/include


[Conf] CM074 available only on newer versions


BUG: Include ITKFactoryRegistration in ITK build

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -9,6 +9,7 @@
 include(${_ITKModuleMacros_DIR}/ITKModuleClangFormat.cmake)
 include(${_ITKModuleMacros_DIR}/CppcheckTargets.cmake)
 include(${_ITKModuleMacros_DIR}/ITKModuleCPPCheckTest.cmake)
+include(${_ITKModuleMacros_DIR}/ITKFactoryRegistration.cmake)

 # With Apple's (GGC <=4.2 and LLVM-GCC <=4.2) or (Clang < 3.2)
 # visibility of template  don't work. Set the option to off and hide it.


Added Gentoo install location for Cg to the FindCg.cmake script

--HG--
branch : v1-7

--- CMake/Packages/FindCg.cmake
+++ CMake/Packages/FindCg.cmake
@@ -26,7 +26,8 @@
 set(Cg_PREFIX_PATH ${Cg_HOME} ${ENV_Cg_HOME}
   ${OGRE_SOURCE}/Dependencies
   ${ENV_OGRE_SOURCE}/Dependencies
-  ${OGRE_HOME} ${ENV_OGRE_HOME})
+  ${OGRE_HOME} ${ENV_OGRE_HOME}
+  /opt/nvidia-cg-toolkit)
 create_search_paths(Cg)
 # redo search if prefix path changed
 clear_if_changed(Cg_PREFIX_PATH
@@ -49,4 +50,4 @@
 make_library_set(Cg_LIBRARY)

 findpkg_finish(Cg)
-add_parent_dir(Cg_INCLUDE_DIRS Cg_INCLUDE_DIR)+add_parent_dir(Cg_INCLUDE_DIRS Cg_INCLUDE_DIR)


adapted opencv.cmake file for v2.4.2

adapted opencv.cmake file for v2.4.2

--- CMakeExternals/OpenCV.cmake
+++ CMakeExternals/OpenCV.cmake
@@ -31,8 +31,8 @@
           )
     endif()

-    set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/OpenCV-2.3.0.tar.bz2)
-    set(opencv_url_md5 4e353dfb04b53bea37407f397aabf069)
+    set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/OpenCV-2.4.2.tar.bz2)
+    set(opencv_url_md5 d5d13c4a65dc96cdfaad54767e428215)

     ExternalProject_Add(${proj}
       SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
@@ -48,7 +48,7 @@
         -DBUILD_TESTS:BOOL=OFF
         -DBUILD_EXAMPLES:BOOL=OFF
         -DBUILD_DOXYGEN_DOCS:BOOL=OFF
-	-DWITH_CUDA:BOOL=OFF
+        -DWITH_CUDA:BOOL=OFF
         ${additional_cmake_args}
       DEPENDS ${proj_DEPENDENCIES}
     )


modules: updated FindCorrade.cmake.

modules: updated FindCorrade.cmake.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -158,7 +158,7 @@
 endif()

 # Configuration
-file(READ ${CORRADE_INCLUDE_DIR}/Corrade/corradeConfigure.h _corradeConfigure)
+file(READ ${CORRADE_INCLUDE_DIR}/Corrade/configure.h _corradeConfigure)

 # Compatibility?
 string(FIND "${_corradeConfigure}" "#define CORRADE_GCC47_COMPATIBILITY" _GCC47_COMPATIBILITY)


Porting to Paraview 3.98.1

Porting to Paraview 3.98.1

--- salome_adm/cmake_files/deprecated/install_python_from_idl.cmake
+++ salome_adm/cmake_files/deprecated/install_python_from_idl.cmake
@@ -23,4 +23,4 @@
 SET(FULLDIR ${CMAKE_INSTALL_PREFIX}/${DIR})
 FILE(MAKE_DIRECTORY ${FULLDIR})
 MESSAGE(STATUS "Compiling ${IDL_FILE} into ${FULLDIR}")
-EXECUTE_PROCESS(COMMAND ${OMNIORB_IDL_COMPILER} ${IDLPYFLAGS} -C${FULLDIR} ${IDL_FILE})
+EXECUTE_PROCESS(COMMAND ${OMNIORB_IDL_PYTHON} ${IDLPYFLAGS} -C${FULLDIR} ${IDL_FILE})


Added missing DESTINATION to file copy

Added missing DESTINATION to file copy

Signed-off-by: Caspar Goch <5009b2f1057faa18dd6e9f1cc5592a99d7ee0834@dkfz-heidelberg.de>

--- BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
+++ BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
@@ -118,7 +118,7 @@
   set(icon_full_path "${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon_name}")
   if(EXISTS "${icon_full_path}")
     set_target_properties(${_APP_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE "${icon_name}")
-    file(COPY ${icon_full_path} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_APP_NAME}.app/Contents/Resources/")
+    file(COPY ${icon_full_path} DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_APP_NAME}.app/Contents/Resources/")
     INSTALL (FILES ${icon_full_path} DESTINATION "${_APP_NAME}.app/Contents/Resources/")
   endif()
 endif()


STYLE: Use CLANG_FORMAT in CMake variable names

CLANG_FORMAT over CLANGFORMAT consistently across usage

--- CMake/ITKClangFormatSetup.cmake
+++ CMake/ITKClangFormatSetup.cmake
@@ -11,7 +11,7 @@
 option(ITK_USE_CLANG_FORMAT "Enable the use of clang-format enforce ITK coding style." ${BUILD_TESTING})
 mark_as_advanced(ITK_USE_CLANG_FORMAT)

-if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANGFORMAT_EXECUTABLE}" )
+if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANG_FORMAT_EXECUTABLE}" )
   # Download pre-built binaries (about 2M ) of clang-format extracted from
   # http://releases.llvm.org/download.html and cached on data.kitware.com
   #
@@ -32,30 +32,30 @@
   # CrayLinuxEnvironment - Cray supercomputers (Cray compiler)
   # MSYS                 - Windows (MSYS2 shell native GCC)
   if ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" )
-    set( CLANGFORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d274e88877dfcc902effc47/download" )
+    set( CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d274e88877dfcc902effc47/download" )
   elseif ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" )
-      set( CLANGFORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d2b8775877dfcc902fd8236/download" )
+      set( CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d2b8775877dfcc902fd8236/download" )
   elseif ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" )
-    set( CLANGFORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d2b8c87877dfcc902fda594/download" )
+    set( CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d2b8c87877dfcc902fda594/download" )
   else ()
-    message(FATAL_ERROR "UNKOWN SYSTEM: Set CLANGFORMAT_EXECUTABLE manually to the clang-format version 8.0 binary")
+    message(FATAL_ERROR "UNKOWN SYSTEM: Set CLANG_FORMAT_EXECUTABLE manually to the clang-format version 8.0 binary")
   endif()
   file(MAKE_DIRECTORY "${ITK_BINARY_DIR}/temp")
   if(WIN32)
     set(exe .exe)
   endif()
-  set(CLANGFORMAT_EXECUTABLE_NAME "clang-format-${CMAKE_SYSTEM_NAME}${exe}")
-  file(DOWNLOAD "${CLANGFORMAT_DOWNLOAD_URL}" "${ITK_BINARY_DIR}/temp/${CLANGFORMAT_EXECUTABLE_NAME}")
-  file(COPY "${ITK_BINARY_DIR}/temp/${CLANGFORMAT_EXECUTABLE_NAME}"
+  set(CLANG_FORMAT_EXECUTABLE_NAME "clang-format-${CMAKE_SYSTEM_NAME}${exe}")
+  file(DOWNLOAD "${CLANG_FORMAT_DOWNLOAD_URL}" "${ITK_BINARY_DIR}/temp/${CLANG_FORMAT_EXECUTABLE_NAME}")
+  file(COPY "${ITK_BINARY_DIR}/temp/${CLANG_FORMAT_EXECUTABLE_NAME}"
        DESTINATION "${ITK_BINARY_DIR}"
        FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
-  unset( CLANGFORMAT_DOWNLOAD_URL )
-  set( CLANGFORMAT_EXECUTABLE "${ITK_BINARY_DIR}/${CLANGFORMAT_EXECUTABLE_NAME}" CACHE FILEPATH "The binary for clang-format" FORCE)
+  unset( CLANG_FORMAT_DOWNLOAD_URL )
+  set( CLANG_FORMAT_EXECUTABLE "${ITK_BINARY_DIR}/${CLANG_FORMAT_EXECUTABLE_NAME}" CACHE FILEPATH "The binary for clang-format" FORCE)
 endif()
-if(CLANGFORMAT_EXECUTABLE)
-  mark_as_advanced(CLANGFORMAT_EXECUTABLE)
+if(CLANG_FORMAT_EXECUTABLE)
+  mark_as_advanced(CLANG_FORMAT_EXECUTABLE)
 endif()
-if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANGFORMAT_EXECUTABLE}")
-  message(FATAL_ERROR "Missing suitable clang-format executable, set CLANGFORMAT_EXECUTABLE variable to version 8.0")
-  unset(CLANGFORMAT_EXECUTABLE)
+if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANG_FORMAT_EXECUTABLE}")
+  message(FATAL_ERROR "Missing suitable clang-format executable, set CLANG_FORMAT_EXECUTABLE variable to version 8.0")
+  unset(CLANG_FORMAT_EXECUTABLE)
 endif()


CMake: Do not disable plugins for mobile/web platforms.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -173,7 +173,6 @@
     set (URHO3D_SSE OFF)
     set (URHO3D_TOOLS OFF)
     set (URHO3D_TASKS OFF)
-    set (URHO3D_PLUGINS OFF)
     if (WEB)
         set (URHO3D_NETWORK OFF)         # Not supported by kNet
         set (URHO3D_PROFILING OFF)       # No way to make use of profiler data because of lack of networking


Fix missing override

Fix missing override

--- cmake/cxxopts.cmake
+++ cmake/cxxopts.cmake
@@ -73,7 +73,11 @@
     if(MSVC)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2")
     elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wshadow -Weffc++ -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion")
+      if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+            set(COMPILER_SPECIFIC_FLAGS "-Wsuggest-override")
+        endif()
+
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wshadow -Weffc++ -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion ${COMPILER_SPECIFIC_FLAGS}")
     endif()

     set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)


doxygen.cmake: some fixes

doxygen.cmake: some fixes

Fix the previous commit, which was a patch applied as is from the sofa2
repository.

Former-commit-id: ee51bafb397589781df78a223068d02803465749

--- cmake/doxygen.cmake
+++ cmake/doxygen.cmake
@@ -52,7 +52,7 @@
     set(SOFA_DOC_TARGETS)
     foreach(project ${GLOBAL_DEPENDENCIES})
         if((${GLOBAL_PROJECT_PATH_${project}} MATCHES ".*/plugins/${project}") OR
-                (${GLOBAL_PROJECT_PATH_${project}} MATCHES ".*/modules/${project}"))
+                (${GLOBAL_PROJECT_PATH_${project}} MATCHES ".*/modules/sofa/component/${project}"))
             # Ignore SofaComponent* meta-modules
             if(NOT ${project} MATCHES "SofaComponent.*")
                 list(APPEND SOFA_DOCUMENTABLE_PROJECTS ${project})
@@ -165,21 +165,18 @@

     # Create the 'doc-SOFA' target for the documentation of framework/
     if(SOFA-MISC_DOXYGEN_COMPONENT_LIST)
+        add_custom_target("component_list"
+            COMMAND bin/generateComponentList > misc/component_list.h
+            DEPENDS generateComponentList)
         add_doc_target("SOFA" "${SOFA_FRAMEWORK_DIR}/sofa ${SOFA_BUILD_DIR}/misc/doc.h ${SOFA_BUILD_DIR}/misc/component_list.h" "")
-        add_dependencies("doc-SOFA" generateComponentList)
+        add_dependencies("doc-SOFA", "component_list")
     else()
         add_doc_target("SOFA" "${SOFA_FRAMEWORK_DIR}/sofa ${SOFA_BUILD_DIR}/misc/doc.h" "")
     endif()
     set_target_properties("doc-SOFA" PROPERTIES FOLDER "Documentation") # IDE Folder

     # Create the 'doc' target, to build every documentation
-    if(SOFA-MISC_DOXYGEN_COMPONENT_LIST)
-        add_custom_target("doc"
-            COMMAND bin/generateComponentList > misc/component_list.h
-            DEPENDS ${SOFA_DOC_TARGETS} "doc-SOFA")
-    else()
-        add_custom_target("doc" DEPENDS ${SOFA_DOC_TARGETS} "doc-SOFA")
-    endif()
+    add_custom_target("doc" DEPENDS ${SOFA_DOC_TARGETS} "doc-SOFA")
     set_target_properties("doc" PROPERTIES FOLDER "Documentation") # IDE Folder

     # Create a convenient shortcut to the main page


add ${CMAKE_THREAD_LIBS_INIT}

add ${CMAKE_THREAD_LIBS_INIT}

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -58,7 +58,7 @@
   cmake_parse_arguments(cc_binary "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   add_executable(${TARGET_NAME} ${cc_binary_SRCS})
   add_dependencies(${TARGET_NAME} ${cc_binary_DEPS} ${external_project_dependencies})
-  target_link_libraries(${TARGET_NAME} ${cc_binary_DEPS})
+  target_link_libraries(${TARGET_NAME} ${cc_binary_DEPS} ${CMAKE_THREAD_LIBS_INIT})
 endfunction(cc_binary)

 # The dependency to target tensor implies that if any of
@@ -75,7 +75,11 @@
   cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   add_executable(${TARGET_NAME} ${cc_test_SRCS})
   add_dependencies(${TARGET_NAME} ${cc_test_DEPS} ${external_project_dependencies})
-  target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} ${GTEST_MAIN_LIBRARIES} ${GTEST_LIBRARIES})
+  target_link_libraries(${TARGET_NAME}
+    ${cc_test_DEPS}
+    ${GTEST_MAIN_LIBRARIES}
+    ${GTEST_LIBRARIES}
+    ${CMAKE_THREAD_LIBS_INIT})
   add_test(${TARGET_NAME} ${TARGET_NAME})
 endfunction(cc_test)

@@ -107,7 +111,7 @@
   cmake_parse_arguments(nv_binary "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   cuda_add_executable(${TARGET_NAME} ${nv_binary_SRCS})
   add_dependencies(${TARGET_NAME} ${nv_binary_DEPS} ${external_project_dependencies})
-  target_link_libraries(${TARGET_NAME} ${nv_binary_DEPS})
+  target_link_libraries(${TARGET_NAME} ${nv_binary_DEPS} ${CMAKE_THREAD_LIBS_INIT})
 endfunction(nv_binary)

 # The dependency to target tensor implies that if any of
@@ -124,7 +128,11 @@
   cmake_parse_arguments(nv_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   cuda_add_executable(${TARGET_NAME} ${nv_test_SRCS})
   add_dependencies(${TARGET_NAME} ${nv_test_DEPS} ${external_project_dependencies})
-  target_link_libraries(${TARGET_NAME} ${nv_test_DEPS} ${GTEST_MAIN_LIBRARIES} ${GTEST_LIBRARIES})
+  target_link_libraries(${TARGET_NAME}
+    ${nv_test_DEPS}
+    ${GTEST_MAIN_LIBRARIES}
+    ${GTEST_LIBRARIES}
+    ${CMAKE_THREAD_LIBS_INIT})
   add_test(${TARGET_NAME} ${TARGET_NAME})
 endfunction(nv_test)


added debugging flags to unittest build

added debugging flags to unittest build

--- cmake-d/UseDUnittest.cmake
+++ cmake-d/UseDUnittest.cmake
@@ -15,6 +15,8 @@
         file(WRITE ${main_unittest} "// Generated by UseDUnittest.cmake\nint main() { return 0; }")
     endif()

+    string(REPLACE " " ";" FLAGS ${CMAKE_D_FLAGS_DEBUG_INIT})
+
     get_target_property(include_dirs ${_target} INCLUDE_DIRECTORIES)
     set(INCLUDES )
     foreach(include_dir ${include_dirs})
@@ -36,9 +38,8 @@
         list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
     endforeach()

-
     add_test(NAME build_${_testtarget}
-        COMMAND ${CMAKE_D_COMPILER} ${CMAKE_D_FLAGS} ${CMAKE_D_COMPILE_OPTIONS_PIC} ${INCLUDES} ${CMAKE_LIBRARY_PATH_FLAG}${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${LIBS} -of${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_testtarget} ${SOURCES} -unittest ${main_unittest})
+        COMMAND ${CMAKE_D_COMPILER} ${FLAGS} ${INCLUDES} ${CMAKE_LIBRARY_PATH_FLAG}${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${LIBS} -of${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_testtarget} ${SOURCES} -unittest ${main_unittest})

     add_test(NAME ${_testtarget}
         COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_testtarget})


Exclude some GCC flags for 4.8 version

Exclude some GCC flags for 4.8 version

--- cmake/AddGnuCompiler.cmake
+++ cmake/AddGnuCompiler.cmake
@@ -103,10 +103,8 @@
     -Wall
     -Wcast-qual
     -Wcomments
-    -Wconditionally-supported
     -Wconversion
     -Wctor-dtor-privacy
-    -Wdate-time
     -Wdisabled-optimization
     -Wdouble-promotion
     -Weffc++
@@ -123,7 +121,6 @@
     -Wmissing-include-dirs
     -Wnoexcept
     -Wold-style-cast
-    -Wopenmp-simd
     -Woverloaded-virtual
     -Wpacked
     -Wpedantic
@@ -166,5 +163,13 @@
     )
 endif()

+if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9)
+    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}
+        -Wconditionally-supported
+        -Wdate-time
+        -Wopenmp-simd
+    )
+endif()
+
 string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 string(REPLACE ";" " " CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")


Automatically enable Cyrus/SASL by default if found

--- cmake/DefineFeatures.cmake
+++ cmake/DefineFeatures.cmake
@@ -58,7 +58,7 @@
 cmake_dependent_option(_LARGE_FILES "Enable large file support" ON "FEATURE_LARGEFILE" OFF)
 mark_as_advanced(_LARGE_FILES)

-option(FEATURE_CYRUS "Enable Cyrus support" OFF)
+option(FEATURE_CYRUS "Enable Cyrus support" ON)
 if(FEATURE_CYRUS)
     find_package(Sasl2)
     if(SASL2_FOUND)


Spelling, USE_NUMERIC ==> FORCE_NUMERIC; and make it easier to switch
to FORCE_NUMERIC after the disable PYTHON WARNING message is issued by

set(NUMERIC_INCLUDE_PATH "NUMERIC_INCLUDE_PATH-NOTFOUND" ...

svn path=/trunk/; revision=11014

--- cmake/modules/python.cmake
+++ cmake/modules/python.cmake
@@ -28,13 +28,13 @@

 if(ENABLE_python AND NOT BUILD_SHARED_LIBS)
   message(STATUS "WARNING: "
-    "Python requires shared libraries. Disabling python bindings")
+    "Python requires shared libraries. Disabling Python bindings")
   set(ENABLE_python OFF CACHE BOOL "Enable Python bindings" FORCE)
 endif(ENABLE_python AND NOT BUILD_SHARED_LIBS)

 if(ENABLE_python AND NOT SWIG_FOUND)
   message(STATUS "WARNING: "
-    "swig not found. Disabling python bindings")
+    "swig not found. Disabling Python bindings")
   set(ENABLE_python OFF CACHE BOOL "Enable Python bindings" FORCE)
 endif(ENABLE_python AND NOT SWIG_FOUND)

@@ -43,31 +43,32 @@
   find_package(PythonInterp)
   if(NOT PYTHONINTERP_FOUND)
     message(STATUS "WARNING: "
-      "python interpreter not found. Disabling python bindings")
+      "Python interpreter not found. Disabling Python bindings")
     set(ENABLE_python OFF CACHE BOOL "Enable Python bindings" FORCE)
   endif(NOT PYTHONINTERP_FOUND)
 endif(ENABLE_python)

 if(ENABLE_python)
   # Check for Python libraries which defines
-  #  PYTHON_LIBRARIES     = path to the python library
+  #  PYTHON_LIBRARIES     = path to the Python library
   #  PYTHON_INCLUDE_PATH  = path to where Python.h is found
   find_package(PythonLibs)
   if(NOT PYTHON_LIBRARIES OR NOT PYTHON_INCLUDE_PATH)
     message(STATUS "WARNING: "
-      "python library and/or header not found. Disabling python bindings")
+      "Python library and/or header not found. Disabling Python bindings")
     set(ENABLE_python OFF CACHE BOOL "Enable Python bindings" FORCE)
   endif(NOT PYTHON_LIBRARIES OR NOT PYTHON_INCLUDE_PATH)
 endif(ENABLE_python)

 option(HAVE_NUMPY "Use numpy rather than deprecated Numeric" ON)
-option(USE_NUMERIC "Force use of deprecated Numeric" OFF)
-if(USE_NUMERIC)
+option(FORCE_NUMERIC "Force use of deprecated Numeric" OFF)
+if(FORCE_NUMERIC)
   set(HAVE_NUMPY OFF CACHE BOOL "Use numpy rather than deprecated Numeric" FORCE)
-endif(USE_NUMERIC)
+endif(FORCE_NUMERIC)

 if(ENABLE_python)
   # NUMERIC_INCLUDE_PATH = path to arrayobject.h for either Numeric or numpy.
+  #message(STATUS "DEBUG: NUMERIC_INCLUDE_PATH = ${NUMERIC_INCLUDE_PATH}")
   if(NOT NUMERIC_INCLUDE_PATH)
     if(HAVE_NUMPY)
       # First check for new version of numpy (replaces Numeric)
@@ -112,10 +113,10 @@
   if(NOT NUMERIC_INCLUDE_PATH)
     if(HAVE_NUMPY)
       message(STATUS "WARNING: "
-	"NumPy header not found. Disabling python bindings")
+	"NumPy header not found. Disabling Python bindings")
     else(HAVE_NUMPY)
       message(STATUS "WARNING: "
-	"Numeric header not found. Disabling python bindings")
+	"Numeric header not found. Disabling Python bindings")
     endif(HAVE_NUMPY)
     set(ENABLE_python OFF CACHE BOOL "Enable Python bindings" FORCE)
   endif(NOT NUMERIC_INCLUDE_PATH)
@@ -130,16 +131,24 @@
 endif(ENABLE_python AND HAVE_NUMPY)

 if(ENABLE_python AND NOT HAVE_NUMPY)
-  message(STATUS "WARNING: The Numeric extensions for python are deprecated. "
-                 "Support for Numeric will be dropped in a future plplot release. Please switch to numpy.")
-  if(NOT USE_NUMERIC)
-    message(STATUS "Disabling python. If you wish enable Numeric support set USE_NUMERIC.")
+  message(STATUS
+"WARNING: The Numeric extension for Python is deprecated.  Support for
+Numeric will be dropped in a future PLplot release. Please switch to numpy
+by installing that Python extension and/or specifying HAVE_NUMPY ON and
+FORCE_NUMERIC OFF.")
+  if(NOT FORCE_NUMERIC)
+    message(STATUS
+"WARNING: Disabling Python. If you really wish to enable the deprecated
+Numeric support set FORCE_NUMERIC ON.")
     set(ENABLE_python OFF CACHE BOOL "Enable Python bindings" FORCE)
-  endif(NOT USE_NUMERIC)
+    # Allow further modifications.
+    set(NUMERIC_INCLUDE_PATH "NUMERIC_INCLUDE_PATH-NOTFOUND"
+      CACHE FILEPATH "Path to Numeric or numpy header" FORCE)
+  endif(NOT FORCE_NUMERIC)
 endif(ENABLE_python AND NOT HAVE_NUMPY)

 if(ENABLE_python)
-  # N.B. This is a nice way to obtain all sorts of python information
+  # N.B. This is a nice way to obtain all sorts of Python information
   # using distutils.
   execute_process(
     COMMAND


exec_program ==> execute_process

exec_program ==> execute_process

svn path=/trunk/; revision=7678

--- cmake/modules/python.cmake
+++ cmake/modules/python.cmake
@@ -83,14 +83,10 @@
 if(ENABLE_python)
   # N.B. This is a nice way to obtain all sorts of python information
   # using distutils.
-  set(
-  PYTHON_ARG_STRING
-  "-c \"from distutils import sysconfig\;"
-  "print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_EXEC_PREFIX}')\""
-  )
-  exec_program(
-  ${PYTHON_EXECUTABLE}
-  ARGS ${PYTHON_ARG_STRING}
+  execute_process(
+  COMMAND
+  ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_EXEC_PREFIX}')"
   OUTPUT_VARIABLE PYTHON_INSTDIR
+  OUTPUT_STRIP_TRAILING_WHITESPACE
   )
 endif(ENABLE_python)


Fix default value for LLVM_INCLUDE_DOCS in out of tree build.

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

--- cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -77,6 +77,9 @@
   if (NOT DEFINED LLVM_INCLUDE_TESTS)
     set(LLVM_INCLUDE_TESTS ${LLVM_FOUND})
   endif()
+  if (NOT DEFINED LLVM_INCLUDE_DOCS)
+    set(LLVM_INCLUDE_DOCS ${LLVM_FOUND})
+  endif()
   if (NOT DEFINED LLVM_ENABLE_SPHINX)
     set(LLVM_ENABLE_SPHINX OFF)
   endif()


- Attempt at fixing Travis CI errors

- Attempt at fixing Travis CI errors

--- cmake/Toolchains/native-macintosh-generic.toolchain.cmake
+++ cmake/Toolchains/native-macintosh-generic.toolchain.cmake
@@ -1,11 +1,17 @@
 # Temporary workaround
-set ( CLANG_PATH "/usr/local/opt/llvm38" )

-set ( CMAKE_CXX_COMPILER ${CLANG_PATH}/bin/clang++-3.8 )
-set ( CMAKE_C_COMPILER ${CLANG_PATH}/bin/clang-3.8  )
+if(NOT "$ENV{CXX}" AND NOT "$ENV{CC}")
+    set ( CLANG_PATH "/usr/local/opt/llvm38" )
+    set ( CMAKE_C_COMPILER ${CLANG_PATH}/bin/clang-3.8  )
+    set ( CMAKE_CXX_COMPILER ${CLANG_PATH}/bin/clang++-3.8 )

-include_directories ( "${CLANG_PATH}/lib/llvm-3.8/include/c++/v1" )
-link_directories("${CLANG_PATH}/lib/llvm-3.8/lib")
+    include_directories ( "${CLANG_PATH}/lib/llvm-3.8/include/c++/v1" )
+    link_directories("${CLANG_PATH}/lib/llvm-3.8/lib")
+else()
+    set ( CMAKE_C_COMPILER "$ENV{CC}"  )
+    set ( CMAKE_CXX_COMPILER "$ENV{CXX}" )
+endif()
+
 # Forcing use of C++11 (or later) libc++
 set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11" CACHE STRING "" )
 # To prevent undefined symbol errors when creating OSX frameworks


modules: updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -129,7 +129,7 @@
 find_program(CORRADE_RC_EXECUTABLE corrade-rc)

 # Include dir
-find_path(CORRADE_INCLUDE_DIR
+find_path(_CORRADE_INCLUDE_DIR
     NAMES Corrade/PluginManager Corrade/Utility)

 # CMake module dir
@@ -149,7 +149,7 @@
     CORRADE_INTERCONNECT_LIBRARY
     CORRADE_PLUGINMANAGER_LIBRARY
     CORRADE_TESTSUITE_LIBRARY
-    CORRADE_INCLUDE_DIR
+    _CORRADE_INCLUDE_DIR
     CORRADE_RC_EXECUTABLE
     _CORRADE_MODULE_DIR)

@@ -216,11 +216,14 @@
     CORRADE_INTERCONNECT_LIBRARY
     CORRADE_PLUGINMANAGER_LIBRARY
     CORRADE_TESTSUITE_LIBRARY
+    _CORRADE_INCLUDE_DIR
     _CORRADE_MODULE_DIR)

 # Add Corrade dir to include path if this is deprecated build
 if(CORRADE_BUILD_DEPRECATED)
-    set(CORRADE_INCLUDE_DIR ${CORRADE_INCLUDE_DIR} ${CORRADE_INCLUDE_DIR}/Corrade)
+    set(CORRADE_INCLUDE_DIR ${_CORRADE_INCLUDE_DIR} ${CORRADE_INCLUDE_DIR}/Corrade)
+else()
+    set(CORRADE_INCLUDE_DIR ${_CORRADE_INCLUDE_DIR})
 endif()

 # Include our module dir, if we have any


CMake: Bugfix: Also compile and link the example steps when $ make (release|debug) is called

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@30678 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
+++ deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
@@ -85,11 +85,13 @@
     # Define custom targets to easily switch the build type:
     ADD_CUSTOM_TARGET(debug
       COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
+      COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target all
       COMMENT "Switch CMAKE_BUILD_TYPE to Debug"
       )

     ADD_CUSTOM_TARGET(release
       COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
+      COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target all
       COMMENT "Switch CMAKE_BUILD_TYPE to Release"
       )


modules: CMake goes crazy when I'm using frameworks as imported targets.

And the bug is closed as "wontfix". Dammit.

https://cmake.org/Bug/view.php?id=13765

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


installing libtbb also under MacOSX

installing libtbb also under MacOSX

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -95,6 +95,7 @@
   # install TBB with libc++ linkage for MacOSX
   IF (NOT ENABLE_INSTALLER)
     INSTALL(PROGRAMS ${TBB_ROOT}/lib/libc++/libtbb.dylib ${TBB_ROOT}/lib/libc++/libtbbmalloc.dylib DESTINATION bin COMPONENT tutorials)
-    INSTALL(PROGRAMS ${TBB_ROOT}/lib/libc++/libtbb.dylib ${TBB_ROOT}/lib/libc++/libtbbmalloc.dylib DESTINATION lib COMPONENT libraries)
   ENDIF()
+  INSTALL(PROGRAMS ${TBB_ROOT}/lib/libc++/libtbb.dylib ${TBB_ROOT}/lib/libc++/libtbbmalloc.dylib DESTINATION lib COMPONENT libraries)
+
 ENDIF()


Split off 7.8.56

Split off 7.8.56

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

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


Split off 7.6.30

Split off 7.6.30

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

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


FIRE-13896: Use correct library on 64-bit Linux.

--- indra/cmake/JsonCpp.cmake
+++ indra/cmake/JsonCpp.cmake
@@ -16,7 +16,11 @@
   elseif (DARWIN)
     set(JSONCPP_LIBRARIES libjson_darwin_libmt.a)
   elseif (LINUX)
-    set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
+    if (ND_BUILD64BIT_ARCH)
+      set(JSONCPP_LIBRARIES libjson_linux-gcc-4.4.7_libmt.a)
+    else (ND_BUILD64BIT_ARCH)
+      set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
+    endif (ND_BUILD64BIT_ARCH
   endif (WINDOWS)
   set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
 endif (STANDALONE)


SH-395 WIP fix linux opensource mesh teamcity build

cmake wasn't configured to use the right directories on the viewer for
debug libraries. Trying to update the config.

--- indra/cmake/Linking.cmake
+++ indra/cmake/Linking.cmake
@@ -9,12 +9,14 @@
     set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged executables")
   elseif (LINUX)
     if (VIEWER)
-      set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client)
+      set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
+      set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client)
+      set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_debug_client)
     else (VIEWER)
-      set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
+      set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
+      set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
+      set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_debug)
     endif (VIEWER)
-    set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS})
-    set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS})
     set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/lib CACHE FILEPATH "Location of staged .sos")
     set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin CACHE FILEPATH "Location of staged executables")
   elseif (DARWIN)


COMP: Add CMAKE_TOOLCHAIN_FILE to external project init cache

This commit adds support for cross-compilation with e.g. mxe.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -235,6 +235,7 @@
   CMAKE_SYSTEM_PROGRAM_PATH
   CMAKE_SYSTEM_IGNORE_PATH

+  CMAKE_TOOLCHAIN_FILE
   CMAKE_GENERATOR
   CMAKE_EXTRA_GENERATOR
   MEMORYCHECK_COMMAND_OPTIONS


Pass all variable beginning with SITK_ to the SimpleITK build.

Change-Id: I9f6408483e7d4317051a48d043ec77a26a13c3b3

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -300,9 +300,11 @@
 get_cmake_property( _varNames VARIABLES )

 foreach (_varName ${_varNames})
-  if(_varName MATCHES "^SimpleITK_" )
-    message( STATUS "Passing variable \"${_varName}=${${_varName}}\" to SimpleITK external project.")
-    list(APPEND SimpleITKITK_VARS ${_varName})
+  if(_varName MATCHES "^SimpleITK_" OR _varName MATCHES "^SITK_" )
+    if (NOT _varName MATCHES "^SITK_LANGUAGES_VARS")
+      message( STATUS "Passing variable \"${_varName}=${${_varName}}\" to SimpleITK external project.")
+      list(APPEND SimpleITKITK_VARS ${_varName})
+    endif()
   endif()
 endforeach()


Pass travis flag to scirun project

Pass travis flag to scirun project

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -269,6 +269,7 @@
     "-DBUILD_HEADLESS:BOOL=${BUILD_HEADLESS}"
     "-DSCIRUN_TEST_RESOURCE_DIR:PATH=${SCIRUN_TEST_RESOURCE_DIR}"
     "-DBUILD_WITH_PYTHON:BOOL=${BUILD_WITH_PYTHON}"
+    "-DTRAVIS_BUILD:BOOL=${TRAVIS_BUILD}"
     "-DUSER_PYTHON_VERSION:STRING=${USER_PYTHON_VERSION}"
     "-DUSER_PYTHON_VERSION_MAJOR:STRING=${USER_PYTHON_VERSION_MAJOR}"
     "-DUSER_PYTHON_VERSION_MINOR:STRING=${USER_PYTHON_VERSION_MINOR}"


CI: remove diapotb while it doesn't compile

--- CI/configure_options.cmake
+++ CI/configure_options.cmake
@@ -70,7 +70,7 @@
 set(cmake_configure_option
 "${cmake_configure_option}
 CMAKE_PREFIX_PATH=${XDK_PATH}")
-foreach(remote_module OTBTemporalGapFilling SertitObject DiapOTBModule)#otbGRM
+foreach(remote_module OTBTemporalGapFilling SertitObject)#otbGRM DiapOTBModule
   set(cmake_configure_option
 "${cmake_configure_option}
 Module_${remote_module}:BOOL=ON")


Upgrade to latest "snapshot" of DCMTK

Upgrade to latest "snapshot" of DCMTK

This version includes dcmrt and other fixes, but is
not a named snapshot from OFFIS, but merely a point
in time that works.

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -23,7 +23,7 @@
   if(CTK_SUPERBUILD)

     if(NOT DEFINED DCMTK_DIR)
-      set(revision_tag ae3b946f6e6231)
+      set(revision_tag ab844899a92f46e2d880c38c85ce098933533aef)
       if(${proj}_REVISION_TAG)
         set(revision_tag ${${proj}_REVISION_TAG})
       endif()


SuperBuild: libkml upgrade is not trivial, leave it for later

--- SuperBuild/CMake/External_libkml.cmake
+++ SuperBuild/CMake/External_libkml.cmake
@@ -28,21 +28,18 @@

   ExternalProject_Add(${proj}
     PREFIX ${proj}
-    URL "http://ftp.de.debian.org/debian/pool/main/libk/libkml/libkml_1.3.0~rc0.orig.tar.gz"
-    URL_MD5 b3be0ce2b3bf8725d5f8c6073822916f
+    URL "http://ftp.de.debian.org/debian/pool/main/libk/libkml/libkml_1.3.0~r863.orig.tar.gz"
+    URL_MD5 211ed5fdf2dd45aeb9c0abc8e1fe42be
     BINARY_DIR ${LIBKML_SB_BUILD_DIR}
     INSTALL_DIR ${SB_INSTALL_PREFIX}
       DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
     DEPENDS ${${proj}_DEPENDENCIES}
-    #PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory  ${CMAKE_SOURCE_DIR}/patches/${proj} ${LIBKML_SB_SRC}
+    PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory  ${CMAKE_SOURCE_DIR}/patches/${proj} ${LIBKML_SB_SRC}
     CMAKE_CACHE_ARGS
       -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
       -DCMAKE_BUILD_TYPE:STRING=Release
       -DBUILD_SHARED_LIBS:BOOL=ON
       -DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
-      -DWITH_JAVA:BOOL=OFF
-      -DWITH_PYTHON:BOOL=OFF
-      -DWITH_SWIG:BOOL=OFF
       ${LIBKML_SB_CONFIG}
     CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )


ENH: disabled default warning flags for C

The CMake script failed to detect supported C flags, and an excessive
number of warning are generaged. So these flags are not automatically
added for C.

--- CMake/CompilerFlagSettings.cmake
+++ CMake/CompilerFlagSettings.cmake
@@ -55,10 +55,10 @@
 -Wstrict-null-sentinel
 )

-set(cc_flags_to_test ${common_flags_to_test})
-
-test_cc_flags(C_RELEASE_DESIRED_FLAGS cc_flags_to_test)
-test_cc_flags(C_DEBUG_DESIRED_FLAGS cc_flags_to_test)
+# Detection does not appear to work correctly for C
+#set(cc_flags_to_test ${common_flags_to_test})
+#test_cc_flags(C_RELEASE_DESIRED_FLAGS cc_flags_to_test)
+#test_cc_flags(C_DEBUG_DESIRED_FLAGS cc_flags_to_test)

 set(cxx_flags_to_test ${common_flags_to_test} -Wno-invalid-offsetof )
 test_cxx_flags(CXX_RELEASE_DESIRED_FLAGS cxx_flags_to_test)


BUG: Fix PythonQt light wrapping so that header in subfolder can be wrapped.

If path of the form "foo/bar.h" were considered for wrapping, the
test "IF (TMP_FILEPATH)" was returning true whereas the filepath
wasn't absolute.

This commit simplify the code and also make the test more robust by using
"IS_ABSOLUTE".

--- CMake/ctkMacroWrapPythonQt.cmake
+++ CMake/ctkMacroWrapPythonQt.cmake
@@ -210,15 +210,12 @@
     # if we should wrap it
     IF (NOT skip_wrapping)

-      # the input file might be full path so handle that
-      get_filename_component(TMP_FILEPATH ${FILE} PATH)
-
       # compute the input filename
-      IF (TMP_FILEPATH)
-        set(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.h)
-      ELSE (TMP_FILEPATH)
-        set(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.h)
-      ENDIF (TMP_FILEPATH)
+      if(IS_ABSOLUTE FILE)
+        set(TMP_INPUT ${FILE})
+      else()
+        set(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
+      endif()

       list(APPEND SOURCES_TO_WRAP ${TMP_INPUT})


suppress missing-field-initializers warnings

--- ament_cmake_gmock/ament_cmake_gmock-extras.cmake
+++ ament_cmake_gmock/ament_cmake_gmock-extras.cmake
@@ -84,6 +84,14 @@
         # add CMakeLists.txt from gmock dir
         add_subdirectory("${GMOCK_FROM_SOURCE_BASE_DIR}" "${CMAKE_BINARY_DIR}/gmock")

+        if(NOT WIN32)
+          set(_gmock_compile_flags "-Wno-missing-field-initializers")
+          if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+            set(_gmock_compile_flags "${_gmock_compile_flags} -Wno-unused-const-variable")
+          endif()
+          set_target_properties(gmock gmock_main PROPERTIES COMPILE_FLAGS "${_gmock_compile_flags}")
+        endif()
+
         # mark gmock targets with EXCLUDE_FROM_ALL to only build
         # when tests are built which depend on them
         set_target_properties(gmock gmock_main PROPERTIES EXCLUDE_FROM_ALL 1)


Added check for COVFILE to disable OpenMP when building with Bullseye's wrappers

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -812,47 +812,53 @@
 endmacro(rosbuild_download_data)

 macro(rosbuild_add_openmp_flags target)
-# list of OpenMP flags to check
-  set(_rospack_check_openmp_flags
-    "-fopenmp" # gcc
-    "-openmp" # icc
-    "-mp" # SGI & PGI
-    "-xopenmp" # Sun
-    "-omp" # Tru64
-    "-qsmp=omp" # AIX
-    )
-
-# backup for a variable we will change
-  set(_rospack_openmp_flags_backup ${CMAKE_REQUIRED_FLAGS})
-
-# mark the fact we do not yet know the flag
-  set(_rospack_openmp_flag_found FALSE)
-  set(_rospack_openmp_flag_value)
-
-# find an OpenMP flag that works
-  foreach(_rospack_openmp_test_flag ${_rospack_check_openmp_flags})
-    if(NOT _rospack_openmp_flag_found)
-      set(CMAKE_REQUIRED_FLAGS ${_rospack_openmp_test_flag})
-      check_function_exists(omp_set_num_threads _rospack_openmp_function_found${_rospack_openmp_test_flag})
-
-      if(_rospack_openmp_function_found${_rospack_openmp_test_flag})
-	set(_rospack_openmp_flag_value ${_rospack_openmp_test_flag})
-	set(_rospack_openmp_flag_found TRUE)
-      endif(_rospack_openmp_function_found${_rospack_openmp_test_flag})
-    endif(NOT _rospack_openmp_flag_found)
-  endforeach(_rospack_openmp_test_flag ${_rospack_check_openmp_flags})
-
-# restore the CMake variable
-  set(CMAKE_REQUIRED_FLAGS ${_rospack_openmp_flags_backup})
-
-# add the flags or warn
-  if(_rospack_openmp_flag_found)
-    rosbuild_add_compile_flags(${target} ${_rospack_openmp_flag_value})
-    rosbuild_add_link_flags(${target} ${_rospack_openmp_flag_value})
-  else(_rospack_openmp_flag_found)
-    message("WARNING: OpenMP compile flag not found")
-  endif(_rospack_openmp_flag_found)
-
+  # Bullseye's wrappers appear to choke on OpenMP pragmas.  So if COVFILE
+  # is set (which indicates that we're doing a coverage build with
+  # Bullseye), we make this macro a no-op.
+  if("$ENV{COVFILE}" STREQUAL "")
+
+  # list of OpenMP flags to check
+    set(_rospack_check_openmp_flags
+      "-fopenmp" # gcc
+      "-openmp" # icc
+      "-mp" # SGI & PGI
+      "-xopenmp" # Sun
+      "-omp" # Tru64
+      "-qsmp=omp" # AIX
+      )
+
+  # backup for a variable we will change
+    set(_rospack_openmp_flags_backup ${CMAKE_REQUIRED_FLAGS})
+
+  # mark the fact we do not yet know the flag
+    set(_rospack_openmp_flag_found FALSE)
+    set(_rospack_openmp_flag_value)
+
+  # find an OpenMP flag that works
+    foreach(_rospack_openmp_test_flag ${_rospack_check_openmp_flags})
+      if(NOT _rospack_openmp_flag_found)
+        set(CMAKE_REQUIRED_FLAGS ${_rospack_openmp_test_flag})
+        check_function_exists(omp_set_num_threads _rospack_openmp_function_found${_rospack_openmp_test_flag})
+
+        if(_rospack_openmp_function_found${_rospack_openmp_test_flag})
+  	set(_rospack_openmp_flag_value ${_rospack_openmp_test_flag})
+  	set(_rospack_openmp_flag_found TRUE)
+        endif(_rospack_openmp_function_found${_rospack_openmp_test_flag})
+      endif(NOT _rospack_openmp_flag_found)
+    endforeach(_rospack_openmp_test_flag ${_rospack_check_openmp_flags})
+
+  # restore the CMake variable
+    set(CMAKE_REQUIRED_FLAGS ${_rospack_openmp_flags_backup})
+
+  # add the flags or warn
+    if(_rospack_openmp_flag_found)
+      rosbuild_add_compile_flags(${target} ${_rospack_openmp_flag_value})
+      rosbuild_add_link_flags(${target} ${_rospack_openmp_flag_value})
+    else(_rospack_openmp_flag_found)
+      message("WARNING: OpenMP compile flag not found")
+    endif(_rospack_openmp_flag_found)
+
+  endif("$ENV{COVFILE}" STREQUAL "")
 endmacro(rosbuild_add_openmp_flags)

 macro(rosbuild_make_distribution)


ENH: Update ITKv4 to fix TestDriver

ENH: Update ITKv4 to fix TestDriver

The test driver in ITKv4 was giving false positives when
the comparison files were missing or unreadable on the
file system.  This version of ITK will now properly fail
when the files are missing.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -73,7 +73,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git CACHE STRING "" FORCE)
-  set(${proj}_GIT_TAG f2ec79de1ae03478aaa9a33e1f220b20f746646b CACHE STRING "" FORCE) #2012-07-06
+  set(${proj}_GIT_TAG d84d414d32e9607b520b809c6594d342622cc696 CACHE STRING "" FORCE) #2012-07-10 -- Includes test driver fix for missing files.
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


COMP:SuperBuild issues

COMP:SuperBuild issues

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -73,7 +73,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git CACHE STRING "" FORCE)
-  set(${proj}_GIT_TAG deb7d6bebb2dd2edf716961741b492817551058c CACHE STRING "" FORCE)
+  set(${proj}_GIT_TAG v4.2rc01 CACHE STRING "" FORCE)
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


Fix typo

Fix typo

--- support/cmake/support_macros.cmake
+++ support/cmake/support_macros.cmake
@@ -232,7 +232,7 @@

         copy_files(OpenSpace
             "${OPENSPACE_EXT_DIR}/vld/bin/vld_x64.dll"
-            "${OPENSPACE_EXT_DIR/vld/bin/Microsoft.DTfW.DHL.manifest"
+            "${OPENSPACE_EXT_DIR}/vld/bin/Microsoft.DTfW.DHL.manifest"
         )
     endif ()
 endfunction ()


Bugfix. Check for the correct platform...

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@26496 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/contrib/cmake/setup_compiler_flags_gnu.cmake
+++ deal.II/contrib/cmake/setup_compiler_flags_gnu.cmake
@@ -81,7 +81,7 @@
 ENDIF()

-IF(CMAKE_SYSTEM_NAME MATCHES "Linux") # TODO: Check for correct name
+IF(CMAKE_SYSTEM_NAME MATCHES "CYGWIN") # TODO: Check for correct name
   #
   # TODO: Is this flag still necessary? Sound pretty invasive...
   #


FindGSL.cmake: better error message

FindGSL.cmake: better error message

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -41,7 +41,7 @@
 include(CheckLibraryExists)
 check_library_exists("${GSL_LIBRARY}" gsl_linalg_QR_decomp "" FOUND_QR_DECOMP)
 if(NOT FOUND_QR_DECOMP)
-  message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARY}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GSL_LIBRARY by hand and include 'libgslcblas' in there!")
+  message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARY}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GSL_LIBRARY by hand and include libgslcblas and libm in there (i.e. -DGSL_LIBRARY='/path/to/libgsl.so;/path/to/libgslcblas.so;/path/to/libm.so') !")
 endif(NOT FOUND_QR_DECOMP)

 include(FindPackageHandleStandardArgs)


fix phonon_export for methodtest under mingw

svn path=/trunk/KDE/kdelibs/phonon/; revision=672230

--- phonon_export.h.cmake
+++ phonon_export.h.cmake
@@ -25,27 +25,35 @@
 #cmakedefine __KDE_HAVE_GCC_VISIBILITY
 #endif

-#ifdef __KDE_HAVE_GCC_VISIBILITY
-
-# define PHONON_NO_EXPORT __attribute__ ((visibility("hidden")))
-# define PHONON_EXPORT __attribute__ ((visibility("default")))
-
-#elif defined(_WIN32) || defined(_WIN64)
-
+#ifdef PHONON_EXPORT
+  /* We are building a test case */
 # define PHONON_NO_EXPORT
-# if defined(MAKE_PHONON_LIB)
-   /* We are building this library */
-#  define PHONON_EXPORT __declspec(dllexport)
-# else
-   /* We are using this library */
-#  define PHONON_EXPORT __declspec(dllimport)
-# endif

 #else
+  /* We are not building a test case */

-# define PHONON_NO_EXPORT
-# define PHONON_EXPORT
+# ifdef __KDE_HAVE_GCC_VISIBILITY

+#  define PHONON_NO_EXPORT __attribute__ ((visibility("hidden")))
+#  define PHONON_EXPORT __attribute__ ((visibility("default")))
+
+# elif defined(_WIN32) || defined(_WIN64)
+
+#  define PHONON_NO_EXPORT
+#  if defined(MAKE_PHONON_LIB)
+    /* We are building this library */
+#   define PHONON_EXPORT __declspec(dllexport)
+#  else
+    /* We are using this library */
+#   define PHONON_EXPORT __declspec(dllimport)
+#  endif
+
+# else
+
+#  define PHONON_NO_EXPORT
+#  define PHONON_EXPORT
+
+# endif
 #endif

 #ifndef PHONON_EXPORT_DEPRECATED


prevent sort on undefined lists, which causes mysterious cmake badness

--- rmw_implementation/cmake/get_available_rmw_implementations.cmake
+++ rmw_implementation/cmake/get_available_rmw_implementations.cmake
@@ -20,6 +20,8 @@
 #
 function(get_available_rmw_implementations var)
   ament_index_get_resources(middleware_implementations "rmw_implementation")
-  list(SORT middleware_implementations)
+  if(DEFINED middleware_implementations)
+    list(SORT middleware_implementations)
+  endif()
   set(${var} ${middleware_implementations} PARENT_SCOPE)
 endfunction()


Several small fixes in Android CMake toolchain

* fix formatting
* honor Windows-style paths
* suppress warnings inside try_compile
* correct caching of toolchain variables

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -3,7 +3,7 @@
 #  Requires cmake 2.6.3 or newer (2.8.5 or newer is recommended).
 #  See home page: http://code.google.com/p/android-cmake/
 #
-#  The file is mantained by the OpenCV project. And also can be found at
+#  The file is mantained by the OpenCV project. The latest version can be get at
 #  http://code.opencv.org/projects/opencv/repository/revisions/master/changes/android/android.toolchain.cmake
 #
 #  Usage Linux:
@@ -29,7 +29,7 @@
 #   $ cmake.exe -G"MinGW Makefiles"
 #       -DCMAKE_TOOLCHAIN_FILE=path\to\the\android.toolchain.cmake
 #       -DCMAKE_MAKE_PROGRAM="%ANDROID_NDK%\prebuilt\windows\bin\make.exe" ..
-#   $ "%ANDROID_NDK%\prebuilt\windows\bin\make.exe"
+#   $ cmake.exe --build .
 #
 #
 #  Options (can be set as cmake parameters: -D<option_name>=<value>):
@@ -41,7 +41,7 @@
 #      (ignored if ANDROID_NDK is set).
 #      Can be set as environment variable. Can be set only at first cmake run.
 #
-#    ANDROID_ABI=armeabi-v7a -  specifies the target Application Binary
+#    ANDROID_ABI=armeabi-v7a - specifies the target Application Binary
 #      Interface (ABI). This option nearly matches to the APP_ABI variable
 #      used by ndk-build tool from Android NDK.
 #
@@ -58,27 +58,28 @@
 #        "x86" - matches to the NDK ABI with the same name.
 #            See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
 #        "mips" - matches to the NDK ABI with the same name
-#            (not testes on real devices)
+#            (It is not tested on real devices by the authos of this toolchain)
+#            See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
 #
 #    ANDROID_NATIVE_API_LEVEL=android-8 - level of Android API compile for.
-#      Option is read-only when standalone toolchain used.
-#
-#    ANDROID_FORCE_ARM_BUILD=OFF - set true to generate 32-bit ARM instructions
-#      instead of Thumb-1. Is not available for "x86" (inapplicable) and
-#      "armeabi-v6 with VFP" (forced) ABIs.
-#
-#    ANDROID_NO_UNDEFINED=ON - set true to show all undefined symbols as linker
+#      Option is read-only when standalone toolchain is used.
+#
+#    ANDROID_FORCE_ARM_BUILD=OFF - set ON to generate 32-bit ARM instructions
+#      instead of Thumb. Is not available for "x86" (inapplicable) and
+#      "armeabi-v6 with VFP" (is forced to be ON) ABIs.
+#
+#    ANDROID_NO_UNDEFINED=ON - set ON to show all undefined symbols as linker
 #      errors even if they are not used.
 #
-#    ANDROID_SO_UNDEFINED=OFF - set true to allow undefined symbols in shared
-#      libraries. Automatically turned on for NDK r5x and r6x due to GLESv2
+#    ANDROID_SO_UNDEFINED=OFF - set ON to allow undefined symbols in shared
+#      libraries. Automatically turned for NDK r5x and r6x due to GLESv2
 #      problems.
 #
 #    LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_SOURCE_DIR} - where to output binary
 #      files. See additional details below.
 #
-#    ANDROID_SET_OBSOLETE_VARIABLES=ON - it set, then toolchain defines some
-#      obsolete variables which were set by previous versions of this file for
+#    ANDROID_SET_OBSOLETE_VARIABLES=ON - if set, then toolchain defines some
+#      obsolete variables which were used by previous versions of this file for
 #      backward compatibility.
 #
 #
@@ -94,15 +95,15 @@
 #    Make sure to do the following in your scripts:
 #      SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}" )
 #      SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}" )
-#      The flags will be prepopulated with critical flags, so don't loose them.
-#      Also be aware that toolchain also sets configuration-specific compiler
-#      flags and linker flags.
+#    The flags will be prepopulated with critical flags, so don't loose them.
+#    Also be aware that toolchain also sets configuration-specific compiler
+#    flags and linker flags.
 #
 #    ANDROID and BUILD_ANDROID will be set to true, you may test any of these
 #    variables to make necessary Android-specific configuration changes.
 #
-#    Also ARMEABI or ARMEABI_V7A or X86 will be set true, mutually exclusive.
-#    NEON option will be set true if VFP is set to NEON.
+#    Also ARMEABI or ARMEABI_V7A or X86 or MIPS will be set true, mutually
+#    exclusive. NEON option will be set true if VFP is set to NEON.
 #
 #    LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where Android
 #    libraries will be installed.
@@ -185,7 +186,7 @@
 #     [+] added mips architecture support
 #   - modified August 2012
 #     [+] updated for NDK r8b
-#     [~] all intermediate files generated by toolchain are moved into CMakeFiles
+#     [~] all intermediate files generated by toolchain are moved to CMakeFiles
 #     [~] libstdc++ and libsupc are removed from explicit link libraries
 #     [+] added CCache support (via NDK_CCACHE environment or cmake variable)
 #     [+] added gold linker support for NDK r8b
@@ -199,7 +200,7 @@
  return()
 endif()

-get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
+get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
 if( _CMAKE_IN_TRY_COMPILE )
  include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL )
 endif()
@@ -279,15 +280,15 @@
     if( NOT "${__value}" STREQUAL "" )
      if( __test_path )
       if( EXISTS "${__value}" )
-       set( ${var_name} "${__value}" )
-       if( __obsolete )
+       file( TO_CMAKE_PATH "${__value}" ${var_name} )
+       if( __obsolete AND NOT _CMAKE_IN_TRY_COMPILE )
         message( WARNING "Using value of obsolete variable ${__var} as initial value for ${var_name}. Please note, that ${__var} can be completely removed in future versions of the toolchain." )
        endif()
        break()
       endif()
      else()
       set( ${var_name} "${__value}" )
-       if( __obsolete )
+       if( __obsolete AND NOT _CMAKE_IN_TRY_COMPILE )
         message( WARNING "Using value of obsolete variable ${__var} as initial value for ${var_name}. Please note, that ${__var} can be completely removed in future versions of the toolchain." )
        endif()
       break()
@@ -298,6 +299,8 @@
   unset( __value )
   unset( __values )
   unset( __obsolete )
+ elseif( __test_path )
+  file( TO_CMAKE_PATH "${${var_name}}" ${var_name} )
  endif()
  unset( __test_path )
 endmacro()
@@ -314,19 +317,23 @@
 endmacro()

 macro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )
- file( GLOB __gccExePath "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
- __LIST_FILTER( __gccExePath "bin/[.].*-gcc${TOOL_OS_SUFFIX}$" )
- list( LENGTH __gccExePath __gccExePathsCount )
- if( NOT __gccExePathsCount EQUAL 1 )
-  message( WARNING "Could not uniquely determine machine name for compiler from ${_root}." )
+ if( EXISTS "${_root}" )
+  file( GLOB __gccExePath "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
+  __LIST_FILTER( __gccExePath "bin/[.].*-gcc${TOOL_OS_SUFFIX}$" )
+  list( LENGTH __gccExePath __gccExePathsCount )
+  if( NOT __gccExePathsCount EQUAL 1  AND NOT _CMAKE_IN_TRY_COMPILE )
+   message( WARNING "Could not determine machine name for compiler from ${_root}" )
+   set( ${_var} "" )
+  else()
+   get_filename_component( __gccExeName "${__gccExePath}" NAME_WE )
+   string( REPLACE "-gcc" "" ${_var} "${__gccExeName}" )
+  endif()
+  unset( __gccExePath )
+  unset( __gccExePathsCount )
+  unset( __gccExeName )
+ else()
   set( ${_var} "" )
- else()
-  get_filename_component( __gccExeName "${__gccExePath}" NAME_WE )
-  string( REPLACE "-gcc" "" ${_var} "${__gccExeName}" )
- endif()
- unset( __gccExePath )
- unset( __gccExePathsCount )
- unset( __gccExeName )
+ endif()
 endmacro()

 macro( __COPY_IF_DIFFERENT _source _destination )
@@ -403,7 +410,6 @@
   endif( ANDROID_NDK )
  endif( NOT ANDROID_STANDALONE_TOOLCHAIN )
 endif( NOT ANDROID_NDK )
-
 # remember found paths
 if( ANDROID_NDK )
  get_filename_component( ANDROID_NDK "${ANDROID_NDK}" ABSOLUTE )
@@ -412,12 +418,13 @@
   string( LENGTH "${ANDROID_NDK}" __length )
   string( SUBSTRING "${CMAKE_AR}" 0 ${__length} __androidNdkPreviousPath )
   if( NOT __androidNdkPreviousPath STREQUAL ANDROID_NDK )
-   message( FATAL_ERROR "It is not possible to change path to the NDK on subsequent run." )
+   message( FATAL_ERROR "It is not possible to change the path to the NDK on subsequent CMake run. You must remove all files from your build folder first.
+   " )
   endif()
   unset( __androidNdkPreviousPath )
   unset( __length )
  endif()
- set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" )
+ set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" FORCE )
  set( BUILD_WITH_ANDROID_NDK True )
 elseif( ANDROID_STANDALONE_TOOLCHAIN )
  get_filename_component( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" ABSOLUTE )
@@ -431,7 +438,7 @@
   unset( __androidStandaloneToolchainPreviousPath )
   unset( __length )
  endif()
- set( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" CACHE INTERNAL "Path of the Android standalone toolchain" )
+ set( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" CACHE INTERNAL "Path of the Android standalone toolchain" FORCE )
  set( BUILD_WITH_STANDALONE_TOOLCHAIN True )
 else()
  list(GET ANDROID_NDK_SEARCH_PATHS 0 ANDROID_NDK_SEARCH_PATH)
@@ -585,7 +592,7 @@
  file( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")\n" )
 endif()

-set( ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} CACHE INTERNAL "ANDROID_ABI can be changed only to one of these ABIs. Changing to any other ABI requires to reset cmake cache." )
+set( ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} CACHE INTERNAL "ANDROID_ABI can be changed only to one of these ABIs. Changing to any other ABI requires to reset cmake cache." FORCE )
 if( CMAKE_VERSION VERSION_GREATER "2.8" )
  list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME} )
  set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} )
@@ -636,8 +643,8 @@
 list( GET __availableToolchains ${__toolchainIdx} ANDROID_TOOLCHAIN_NAME )
 list( GET __availableToolchainMachines ${__toolchainIdx} ANDROID_TOOLCHAIN_MACHINE_NAME )
 list( GET __availableToolchainCompilerVersions ${__toolchainIdx} ANDROID_COMPILER_VERSION )
-set( ANDROID_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" CACHE INTERNAL "Name of toolchain used" )
-set( ANDROID_COMPILER_VERSION "${ANDROID_COMPILER_VERSION}" CACHE INTERNAL "compiler version from selected toolchain" )
+set( ANDROID_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" CACHE INTERNAL "Name of toolchain used" FORCE )
+set( ANDROID_COMPILER_VERSION "${ANDROID_COMPILER_VERSION}" CACHE INTERNAL "compiler version from selected toolchain" FORCE )
 unset( __toolchainIdx )
 unset( __availableToolchains )
 unset( __availableToolchainMachines )
@@ -769,8 +776,10 @@
 # flags and definitions
 if(ANDROID_SYSROOT MATCHES "[ ;\"]")
  set( ANDROID_CXX_FLAGS "--sysroot=\"${ANDROID_SYSROOT}\"" )
- # quotes will break try_compile and compiler identification
- message(WARNING "Your Android system root has non-alphanumeric symbols. It can break compiler features detection and the whole build.")
+ if( NOT _CMAKE_IN_TRY_COMPILE )
+  # quotes will break try_compile and compiler identification
+  message(WARNING "Your Android system root has non-alphanumeric symbols. It can break compiler features detection and the whole build.")
+ endif()
 else()
  set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT}" )
 endif()
@@ -981,8 +990,8 @@
 link_directories( ${ANDROID_SYSTEM_LIB_DIRS} )

 # finish flags
-set( ANDROID_CXX_FLAGS    "${ANDROID_CXX_FLAGS}"    CACHE INTERNAL "Extra Android compiler flags")
-set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Extra Android linker flags")
+set( ANDROID_CXX_FLAGS    "${ANDROID_CXX_FLAGS}"    CACHE INTERNAL "Extra Android compiler flags" )
+set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Extra Android linker flags" )
 set( CMAKE_CXX_FLAGS           "${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" )
 set( CMAKE_C_FLAGS             "${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}" )
 if( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK MATCHES "-r8$" )
@@ -1129,16 +1138,17 @@
 #   NEON : TRUE if NEON unit is enabled
 #   VFPV3 : TRUE if VFP version 3 is enabled
 #   X86 : TRUE if configured for x86
+#   MIPS : TRUE if configured for mips
 #   BUILD_ANDROID : always TRUE
 #   BUILD_WITH_ANDROID_NDK : TRUE if NDK is used
 #   BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
 #   ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
-#   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a" or "x86" depending on ANDROID_ABI
+#   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86" or "mips" depending on ANDROID_ABI
 #   ANDROID_ARCH_NAME : "arm" or "x86" or "mips" depending on ANDROID_ABI
-#   TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
 #   ANDROID_SYSROOT : path to the compiler sysroot
 #   ANDROID_SYSTEM_INCLUDE_DIRS
 #   ANDROID_SYSTEM_LIB_DIRS
+#   TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
 # Obsolete:
 #   ARMEABI_NDK_NAME : superseded by ANDROID_NDK_ABI_NAME
 #


build: UNSET cache variables for FIND_IMAGEMAGICK_API

The way that the ImageMagick component search calls find_path
multiple times with the same variable but different names
does not expect old cache values in the variable.

--- cmake/FindImageMagick.cmake
+++ cmake/FindImageMagick.cmake
@@ -231,6 +231,8 @@
     )

     IF(component STREQUAL "Magick++")
+        # unset cached variable that assumes header parameter never changes
+        UNSET(ImageMagick_MagickWand_INCLUDE_DIR CACHE)

         # Try top folder first
         FIND_IMAGEMAGICK_API(Magick++ <NONE> Magick++.h
@@ -252,6 +254,8 @@
         ENDIF()

     ELSEIF(component STREQUAL "MagickWand")
+        # unset cached variable that assumes header parameter never changes
+        UNSET(ImageMagick_MagickWand_INCLUDE_DIR CACHE)

         # Try top folder first
         FIND_IMAGEMAGICK_API(MagickWand <NONE> MagickWand.h


cmake: add check for IPP IW license files

--- cmake/OpenCVFindIPPIW.cmake
+++ cmake/OpenCVFindIPPIW.cmake
@@ -29,6 +29,16 @@
     message(STATUS "${MESSAGE}")
   endif()
 endmacro()
+
+macro(ippiw_done)
+  foreach(__file ${IPP_IW_LICENSE_FILES})
+    if(EXISTS "${__file}")
+      ocv_install_3rdparty_licenses(ippiw "${__file}")
+    endif()
+  endforeach()
+  return()
+endmacro()
+
 file(TO_CMAKE_PATH "${IPPROOT}" IPPROOT)

 # This function detects Intel IPP Integration Wrappers version by analyzing .h file
@@ -81,7 +91,7 @@
           if(EXISTS "${FILE}")
             set(HAVE_IPP_IW_LL 1)
           endif()
-          return()
+          ippiw_done()
         else()
           ippiw_debugmsg("sources\tno")
         endif()
@@ -120,7 +130,7 @@
           if(EXISTS "${FILE}")
             set(HAVE_IPP_IW_LL 1)
           endif()
-          return()
+          ippiw_done()
         else()
           ippiw_debugmsg("binaries\tno")
         endif()
@@ -147,14 +157,12 @@
   ippiw_setup("${OpenCV_SOURCE_DIR}/3rdparty/ippiw" 1)

   set(IPPIW_ROOT "${IPPROOT}/../iw")
-  ocv_install_3rdparty_licenses(ippiw
-    "${IPPIW_ROOT}/../support.txt"
-    "${IPPIW_ROOT}/../third-party-programs.txt")
-  if(WIN32)
-    ocv_install_3rdparty_licenses(ippiw "${IPPIW_ROOT}/../EULA.rtf")
-  else()
-    ocv_install_3rdparty_licenses(ippiw "${IPPIW_ROOT}/../EULA.txt")
-  endif()
+  set(IPP_IW_LICENSE_FILES ${IPP_IW_LICENSE_FILES_EXTRA}
+      "${IPPIW_ROOT}/../support.txt"
+      "${IPPIW_ROOT}/../third-party-programs.txt"
+      "${IPPIW_ROOT}/../EULA.rtf"
+      "${IPPIW_ROOT}/../EULA.txt"
+  )

   # Package sources
   get_filename_component(__PATH "${IPPROOT}/../iw/" ABSOLUTE)
@@ -167,10 +175,11 @@
     include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/ippicv.cmake")
     download_ippicv(TEMP_ROOT)
     set(IPPIW_ROOT "${TEMP_ROOT}/iw/")
-    ocv_install_3rdparty_licenses(ippiw
-      "${IPPIW_ROOT}/../EULA.txt"
-      "${IPPIW_ROOT}/../support.txt"
-      "${IPPIW_ROOT}/../third-party-programs.txt")
+    set(IPP_IW_LICENSE_FILES ${IPP_IW_LICENSE_FILES_EXTRA}
+        "${IPPIW_ROOT}/../EULA.txt"
+        "${IPPIW_ROOT}/../support.txt"
+        "${IPPIW_ROOT}/../third-party-programs.txt"
+    )

     ippiw_setup("${IPPIW_ROOT}" 1)
   endif()


configs/default.cmake: inherit Clang version

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -26,7 +26,7 @@
 hunter_config(Boost VERSION 1.57.0)
 hunter_config(CLAPACK VERSION 3.2.1)
 hunter_config(Clang VERSION 3.5.0)
-hunter_config(ClangToolsExtra VERSION 3.5.0)
+hunter_config(ClangToolsExtra VERSION ${HUNTER_Clang_VERSION})
 hunter_config(Comet VERSION 4.0.1)
 hunter_config(CppNetlib VERSION 0.10.1-hunter-3)
 hunter_config(CppNetlibUri VERSION 1.0.4-hunter)
@@ -39,11 +39,11 @@
 hunter_config(Igloo VERSION 1.1.1-hunter)
 hunter_config(IntSizeof VERSION 1.0.0)
 hunter_config(JsonSpirit VERSION 0.0.4-hunter)
-hunter_config(LLVM VERSION 3.5.0)
-hunter_config(LLVMCompilerRT VERSION 3.5.0)
+hunter_config(LLVM VERSION ${HUNTER_Clang_VERSION})
+hunter_config(LLVMCompilerRT VERSION ${HUNTER_Clang_VERSION})
 hunter_config(Leathers VERSION 0.1.6)
-hunter_config(Libcxx VERSION 3.5.0)
-hunter_config(Libcxxabi VERSION 3.5.0)
+hunter_config(Libcxx VERSION ${HUNTER_Clang_VERSION})
+hunter_config(Libcxxabi VERSION ${HUNTER_Clang_VERSION})
 hunter_config(Libssh2 VERSION 1.4.4-patch-2)
 hunter_config(OpenCV VERSION 3.0.0-beta-p2)
 hunter_config(OpenSSL VERSION 1.0.2a)


qibuild/general.cmake: avoid warning with QI_VIRTUALENV_PATH

Change-Id: If082f1fb231c06a9233ffcf9aaeb83590d9e0067
Reviewed-on: http://gerrit.aldebaran.lan/66341
Tested-by: gerrit
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/general.cmake
+++ cmake/qibuild/general.cmake
@@ -137,3 +137,6 @@
 # Install a share/qi/path.conf so that libqi's sdkPrefix can be found
 file(WRITE "${CMAKE_BINARY_DIR}/path.conf" "# Installed by qibuild. Do not remove\n")
 qi_install_data(${CMAKE_BINARY_DIR}/path.conf SUBFOLDER "qi")
+
+# Avoid warning about unused variable:
+qi_persistent_set(QI_VIRTUALENV_PATH ${QI_VIRTUALENV_PATH})


proper path resolving fix for CPACK RPM bug

--- cmake/tarantool_cpack.cmake
+++ cmake/tarantool_cpack.cmake
@@ -11,6 +11,8 @@
     set (CPACK_RPM_PACKAGE_LICENSE "BSD")
     set (CPACK_RPM_PACKAGE_GROUP "MAIL.RU")
     set (CPACK_RPM_PACKAGE_DESCRIPTION "Tarantool in-memory DB storage")
+    set (CPACK_SET_DESTDIR "ON")
+    set (CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
 else()
     set (CPACK_GENERATOR "TGZ")
 endif()


cmake: also look for python3 since it is now supported

--- cmake/toolchain-pnacl.cmake
+++ cmake/toolchain-pnacl.cmake
@@ -51,12 +51,15 @@
 set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")

 if (NOT CMAKE_HOST_WIN32)
-    find_package(Python2)
-    if (NOT Python2_Interpreter_FOUND)
-        message(FATAL_ERROR "Please install python2 (and run in a python2 virtualenv if that's not enough).")
+    find_package(Python)
+
+    if (Python_Interpreter_FOUND)
+        set(PNACLPYTHON_PREFIX "env PNACLPYTHON=${Python_EXECUTABLE} ")
+        set(PNACLPYTHON_PREFIX2 env "PNACLPYTHON=${Python_EXECUTABLE} ")
+        message(STATUS "Using PNACL Python executable: ${Python_EXECUTABLE}")
+    else()
+        message(FATAL_ERROR "Please install python (and run in a python virtualenv if that's not enough).")
     endif()
-    set(PNACLPYTHON_PREFIX "env PNACLPYTHON=${Python2_EXECUTABLE} ")
-    set(PNACLPYTHON_PREFIX2 env "PNACLPYTHON=${Python2_EXECUTABLE} ")
 endif()

 # These commands can fail on windows if there is a space at the beginning


Adde msvc version info.

Adde msvc version info.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -94,6 +94,27 @@
     else()
         set(CC_ARCH "x86")
     endif()
+    exec_program($ENV{CC} ARGS --version OUTPUT_VARIABLE CC_VERSION)
+    string(REGEX REPLACE ".*Optimizing Compiler Version ([0-9]+\\.[0-9]+).*" "\\1" CC_VERSION ${CC_VERSION})
+    string(SUBSTRING "${CC_VERSION}" 0 2 CC_VERSION)
+    if(CC_VERSION STREQUAL "19")
+        string(SUBSTRING "${CC_VERSION}" 0 5 CC_VERSION)
+        if(CC_VERSION STREQUAL "19.10")
+            set(CC_VERSION "2017")
+        else()
+            set(CC_VERSION "2015")
+        endif()
+    elseif(CC_VERSION STREQUAL "18")
+        set(CC_VERSION "2013")
+    elseif(CC_VERSION STREQUAL "17")
+        set(CC_VERSION "2012")
+    elseif(CC_VERSION STREQUAL "16")
+        set(CC_VERSION "2010")
+    elseif(CC_VERSION STREQUAL "15")
+        set(CC_VERSION "2008")
+    elseif(CC_VERSION STREQUAL "14")
+        set(CC_VERSION "2005")
+    endif()
 endif()
 set(CI_BUILD_NAME "${CC_NAME}-${CC_VERSION}-${CC_ARCH}")


[build] Don't reset 'swiftlib_link_flags_all' unnecessarily

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -1437,7 +1437,6 @@

       # Add PrivateFrameworks, rdar://28466433
       set(swiftlib_c_compile_flags_all ${SWIFTLIB_C_COMPILE_FLAGS})
-      set(swiftlib_link_flags_all ${SWIFTLIB_LINK_FLAGS})

       # Add flags to prepend framework search paths for the parallel framework
       # hierarchy rooted at /System/iOSSupport/...


Fixed bugs in FindSystemdJournal and extended it to detect the new libsystemd library

--- cmake/Modules/FindSystemdJournal.cmake
+++ cmake/Modules/FindSystemdJournal.cmake
@@ -17,17 +17,20 @@

   if (PKG_CONFIG_FOUND)
     pkg_check_modules(_LIBSYSTEMD_JOURNAL_PC QUIET "libsystemd-journal")
-    pkg_check_modules(LIBSYSTEMD_ID128 QUIET "libsystemd-id128")
+    pkg_check_modules(_LIBSYSTEMD_ID128_PC QUIET "libsystemd-id128")
+    pkg_check_modules(_LIBSYSTEMD_PC QUIET "libsystemd")
   endif (PKG_CONFIG_FOUND)

   find_path (LIBSYSTEMD_JOURNAL_INCLUDE_DIR systemd/sd-journal.h
     ${_LIBSYSTEMD_JOURNAL_PC_INCLUDE_DIRS}
+    ${_LIBSYSTEMD_PC_INCLUDE_DIRS}
     /usr/include
     /usr/local/include
   )
-
+
   find_path (LIBSYSTEMD_ID128_INCLUDE_DIR systemd/sd-id128.h
     ${_LIBSYSTEMD_ID128_PC_INCLUDE_DIRS}
+    ${_LIBSYSTEMD_PC_INCLUDE_DIRS}
     /usr/include
     /usr/local/include
   )
@@ -35,9 +38,16 @@
   find_library (LIBSYSTEMD_JOURNAL_LIBRARIES NAMES systemd-journal systemd-id128
     PATHS
     ${_LIBSYSTEMD_JOURNAL_PC_LIBDIR}
+    ${_LIBSYSTEMD_ID128_PC_LIBDIR}
   )

-
+  # at least on newer versions of debian the libraries have been merged
+  if (NOT LIBSYSTEMD_JOURNAL_LIBRARIES)
+    find_library (LIBSYSTEMD_JOURNAL_LIBRARIES NAMES systemd
+      PATHS
+      ${_LIBSYSTEMD_PC_LIBDIR}
+    )
+  endif (NOT LIBSYSTEMD_JOURNAL_LIBRARIES)

   if (LIBSYSTEMD_JOURNAL_INCLUDE_DIR AND LIBSYSTEMD_ID128_INCLUDE_DIR AND LIBSYSTEMD_JOURNAL_LIBRARIES)


remove debug message

remove debug message

--- cmake/qibuild/modules/ogre-tools.cmake
+++ cmake/qibuild/modules/ogre-tools.cmake
@@ -47,8 +47,6 @@
     qi_error("Could not find library for render plugin: '${ARG_RENDER_PLUGIN}'")
   endif()

-  message(STATUS "_ogre_plugin: ${_ogre_plugin}")
-
   get_filename_component(_ogre_plugins_folder ${_ogre_plugin} PATH)

   set(_plugins_cfg "${QI_SDK_DIR}/${QI_SDK_BIN}/plugins.cfg")


build(WASI): Do not add extra wasm-opt step

Seems not longer required either because we updated wasi-sdk or
installed binaryen.

--- src/docker/itk-wasm/ITKWebAssemblyInterface.cmake
+++ src/docker/itk-wasm/ITKWebAssemblyInterface.cmake
@@ -43,7 +43,7 @@
     set_property(TARGET ${wasm_target} PROPERTY LINK_FLAGS_DEBUG " -fno-lto -s DISABLE_EXCEPTION_CATCHING=0 --bind ${_link_flags_debug}")
     set_property(TARGET ${umd_target} PROPERTY LINK_FLAGS_DEBUG " -fno-lto -s DISABLE_EXCEPTION_CATCHING=0 --bind ${_link_flags_debug}")
   else()
-    set_property(TARGET ${wasm_target} PROPERTY SUFFIX ".wasi.no-opt.wasm")
+    set_property(TARGET ${wasm_target} PROPERTY SUFFIX ".wasi.wasm")
     if (NOT TARGET wasi-exception-shim AND DEFINED CMAKE_CXX_COMPILE_OBJECT)
       add_library(wasi-exception-shim STATIC /ITKWebAssemblyInterface/src/exceptionShim.cxx)
     endif()
@@ -52,14 +52,6 @@
       _target_link_libraries(${target} PRIVATE $<$<LINK_LANGUAGE:CXX>:wasi-exception-shim>)
       get_property(_link_flags TARGET ${wasm_target} PROPERTY LINK_FLAGS)
       set_property(TARGET ${wasm_target} PROPERTY LINK_FLAGS "-Wl,--export-if-defined=main -Wl,--export-if-defined=itk_wasm_input_array_alloc -Wl,--export-if-defined=itk_wasm_input_json_alloc -Wl,--export-if-defined=itk_wasm_output_json_address -Wl,--export-if-defined=itk_wasm_output_json_size -Wl,--export-if-defined=itk_wasm_output_array_address -Wl,--export-if-defined=itk_wasm_output_array_size -Wl,--export-if-defined=itk_wasm_free_all ${_link_flags}")
-      if(NOT DEFINED ITK_WASM_WASM_OPT_FLAGS)
-        set(ITK_WASM_WASM_OPT_FLAGS "-O2")
-      endif()
-      add_custom_command(TARGET ${wasm_target} POST_BUILD
-        COMMAND /usr/bin/wasm-opt ${ITK_WASM_WASM_OPT_FLAGS}
-            "$<TARGET_FILE:${wasm_target}>"
-            -o "$<TARGET_FILE_BASE_NAME:${wasm_target}>.wasi.wasm"
-        VERBATIM)
       endif()
   endif()
 endfunction()


Split off candidate-5.0.6

Split off candidate-5.0.6

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

--- version.cmake
+++ version.cmake
@@ -4,9 +4,9 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 5 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 4 )
-set ( HPCC_MATURITY "release" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_POINT 5 )
+set ( HPCC_MATURITY "closedown" )
+set ( HPCC_SEQUENCE 0 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Graph Control 4.2.0-rc3 Release Candidate 3

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

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


Split off 7.6.2

Split off 7.6.2

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

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


Remove extra statement setting CMAKE_REQUIRED_INCLUDES

Instead simply include the expected header in the check_c_source_runs
code.

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -1031,10 +1031,9 @@
         int main() {f(NULL);} "
         HAVE_ATTRIBUTE_FORMAT_PARSETUPLE)

-set(CMAKE_REQUIRED_INCLUDES ${CFG_HEADERS})
 check_c_source_compiles("#include <unistd.h>\n int main() {getpgrp(0);}" GETPGRP_HAVE_ARG)

-check_c_source_runs("int main() {
+check_c_source_runs("#include <unistd.h>\n int main() {
         int val1 = nice(1);
         if (val1 != -1 && val1 == nice(2)) exit(0);
         exit(1);}" HAVE_BROKEN_NICE)


cmake fix for Clarius listen api on windows

--- cmake/ExternalClarius.cmake
+++ cmake/ExternalClarius.cmake
@@ -7,6 +7,18 @@
     set(URL "http://www.idi.ntnu.no/~smistad/clarius_listen_sdk_2018-11-16_20-44-46_isonosw.v5.0.0.linux.desktop_80_1cf035e5a38bb0ba4ddde2b35c54024b1d4230d1.zip")
 endif()

+if(WIN32)
+ExternalProject_Add(clarius
+        PREFIX ${FAST_EXTERNAL_BUILD_DIR}/clarius # The folder in which the package will downloaded to
+        URL ${URL}
+        UPDATE_COMMAND ""
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ""
+        INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${FAST_EXTERNAL_BUILD_DIR}/clarius/src/clarius/lib/listen.lib ${FAST_EXTERNAL_INSTALL_DIR}/lib/ COMMAND
+          ${CMAKE_COMMAND} -E copy ${FAST_EXTERNAL_BUILD_DIR}/clarius/src/clarius/lib/listen.dll ${FAST_EXTERNAL_INSTALL_DIR}/bin/ COMMAND
+          ${CMAKE_COMMAND} -E copy_directory ${FAST_EXTERNAL_BUILD_DIR}/clarius/src/clarius/include ${FAST_EXTERNAL_INSTALL_DIR}/include/
+)
+else()
 ExternalProject_Add(clarius
         PREFIX ${FAST_EXTERNAL_BUILD_DIR}/clarius # The folder in which the package will downloaded to
         URL ${URL}
@@ -16,4 +28,5 @@
         INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${FAST_EXTERNAL_BUILD_DIR}/clarius/src/clarius/lib ${FAST_EXTERNAL_INSTALL_DIR}/lib/ COMMAND
             ${CMAKE_COMMAND} -E copy_directory ${FAST_EXTERNAL_BUILD_DIR}/clarius/src/clarius/include ${FAST_EXTERNAL_INSTALL_DIR}/include/
 )
+endif()
 list(APPEND FAST_EXTERNAL_DEPENDENCIES clarius)