Hopefully last commit concerning CG detection under Windows x64

--- cmake/FindCg.cmake
+++ cmake/FindCg.cmake
@@ -1,139 +1,160 @@
-#
-# Try to find NVIDIA's Cg compiler, runtime libraries, and include path.
-# Once done this will define
-#
-# CG_FOUND =system has NVIDIA Cg and it can be used.
-# CG_INCLUDE_PATH = directory where cg.h resides
-# CG_LIBRARY = full path to libCg.so (Cg.DLL on win32)
-# CG_GL_LIBRARY = full path to libCgGL.so (CgGL.dll on win32)
-# CG_COMPILER = full path to cgc (cgc.exe on win32)
-#
-
-# On OSX default to using the framework version of Cg.
-
-IF (APPLE)
-  INCLUDE(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake)
-  SET(CG_FRAMEWORK_INCLUDES)
-  CMAKE_FIND_FRAMEWORKS(Cg)
-  IF (Cg_FRAMEWORKS)
-    FOREACH(dir ${Cg_FRAMEWORKS})
-      SET(CG_FRAMEWORK_INCLUDES ${CG_FRAMEWORK_INCLUDES}
-        ${dir}/Headers ${dir}/PrivateHeaders)
-    ENDFOREACH(dir)
-
-    # Find the include  dir
-    FIND_PATH(CG_INCLUDE_PATH cg.h
-      ${CG_FRAMEWORK_INCLUDES}
-      )
-
-    # Since we are using Cg framework, we must link to it.
-	# Note, we use weak linking, so that it works even when Cg is not available.
-    SET(CG_LIBRARY "-weak_framework Cg" CACHE STRING "Cg library")
-    SET(CG_GL_LIBRARY "-weak_framework Cg" CACHE STRING "Cg GL library")
-  ENDIF (Cg_FRAMEWORKS)
-  FIND_PROGRAM(CG_COMPILER cgc
-    /usr/bin
-    /usr/local/bin
-    DOC "The Cg compiler"
-    )
-ELSE (APPLE)
-  IF (WIN32)
-		IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
-			SET(CG_BIN_SEARCH_PATH "$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/bin.x64")
-		ELSE()
-			SET(CG_BIN_SEARCH_PATH "$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/bin")
-		ENDIF()
-    FIND_PROGRAM( CG_COMPILER cgc
-      $ENV{CG_BIN_PATH}
-			${CG_BIN_SEARCH_PATH}
-      $ENV{PROGRAMFILES}/Cg
-      ${PROJECT_SOURCE_DIR}/../Cg
-      DOC "The Cg Compiler"
-      )
-    IF (CG_COMPILER)
-      GET_FILENAME_COMPONENT(CG_COMPILER_DIR ${CG_COMPILER} PATH)
-      GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR ${CG_COMPILER_DIR} PATH)
-    ELSE (CG_COMPILER)
-      SET (CG_COMPILER_DIR .)
-      SET (CG_COMPILER_SUPER_DIR ..)
-    ENDIF (CG_COMPILER)
-    FIND_PATH( CG_INCLUDE_PATH Cg/cg.h
-      $ENV{CG_INC_PATH}
-      $ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/include
-      $ENV{PROGRAMFILES}/Cg
-      ${PROJECT_SOURCE_DIR}/../Cg
-      ${CG_COMPILER_SUPER_DIR}/include
-      ${CG_COMPILER_DIR}
-      DOC "The directory where Cg/cg.h resides"
-      )
-		IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
-			SET(CG_LIB_SEARCH_PATH "$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib.x64")
-		ELSE()
-			SET(CG_LIB_SEARCH_PATH "$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib")
-		ENDIF()
-    FIND_LIBRARY( CG_LIBRARY
-      NAMES Cg
-      PATHS
-			${CG_LIB_SEARCH_PATH}
-      $ENV{CG_LIB_PATH}
-      $ENV{PROGRAMFILES}/Cg
-      ${PROJECT_SOURCE_DIR}/../Cg
-      ${CG_COMPILER_SUPER_DIR}/lib
-      ${CG_COMPILER_DIR}
-      DOC "The Cg runtime library"
-      )
-    FIND_LIBRARY( CG_GL_LIBRARY
-      NAMES CgGL
-      PATHS
-			${CG_LIB_SEARCH_PATH}
-      $ENV{PROGRAMFILES}/Cg
-      ${PROJECT_SOURCE_DIR}/../Cg
-      ${CG_COMPILER_SUPER_DIR}/lib
-      ${CG_COMPILER_DIR}
-      DOC "The Cg runtime library"
-      )
-  ELSE (WIN32)
-    FIND_PROGRAM( CG_COMPILER cgc
-      /usr/bin
-      /usr/local/bin
-      DOC "The Cg Compiler"
-      )
-    GET_FILENAME_COMPONENT(CG_COMPILER_DIR "${CG_COMPILER}" PATH)
-    GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR "${CG_COMPILER_DIR}" PATH)
-    FIND_PATH( CG_INCLUDE_PATH Cg/cg.h
-      /usr/include
-      /usr/local/include
-      ${CG_COMPILER_SUPER_DIR}/include
-      DOC "The directory where Cg/cg.h resides"
-      )
-    FIND_LIBRARY( CG_LIBRARY Cg
-      PATHS
-      /usr/lib64
-      /usr/lib
-      /usr/local/lib64
-      /usr/local/lib
-      ${CG_COMPILER_SUPER_DIR}/lib64
-      ${CG_COMPILER_SUPER_DIR}/lib
-      DOC "The Cg runtime library"
-      )
-	SET(CG_LIBRARY ${CG_LIBRARY} -lpthread)
-    FIND_LIBRARY( CG_GL_LIBRARY CgGL
-      PATHS
-      /usr/lib64
-      /usr/lib
-      /usr/local/lib64
-      /usr/local/lib
-      ${CG_COMPILER_SUPER_DIR}/lib64
-      ${CG_COMPILER_SUPER_DIR}/lib
-      DOC "The Cg runtime library"
-      )
-  ENDIF (WIN32)
-ENDIF (APPLE)
-
-IF (CG_INCLUDE_PATH)
-  SET( CG_FOUND 1 CACHE STRING "Set to 1 if CG is found, 0 otherwise")
-ELSE (CG_INCLUDE_PATH)
-  SET( CG_FOUND 0 CACHE STRING "Set to 1 if CG is found, 0 otherwise")
-ENDIF (CG_INCLUDE_PATH)
-
-MARK_AS_ADVANCED( CG_FOUND )
+#
+# Try to find NVIDIA's Cg compiler, runtime libraries, and include path.
+# Once done this will define
+#
+# CG_FOUND =system has NVIDIA Cg and it can be used.
+# CG_INCLUDE_PATH = directory where cg.h resides
+# CG_LIBRARY = full path to libCg.so (Cg.DLL on win32)
+# CG_GL_LIBRARY = full path to libCgGL.so (CgGL.dll on win32)
+# CG_COMPILER = full path to cgc (cgc.exe on win32)
+#
+
+# On OSX default to using the framework version of Cg.
+
+IF (APPLE)
+  INCLUDE(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake)
+  SET(CG_FRAMEWORK_INCLUDES)
+  CMAKE_FIND_FRAMEWORKS(Cg)
+  IF (Cg_FRAMEWORKS)
+    FOREACH(dir ${Cg_FRAMEWORKS})
+      SET(CG_FRAMEWORK_INCLUDES ${CG_FRAMEWORK_INCLUDES}
+        ${dir}/Headers ${dir}/PrivateHeaders)
+    ENDFOREACH(dir)
+
+    # Find the include  dir
+    FIND_PATH(CG_INCLUDE_PATH cg.h
+      ${CG_FRAMEWORK_INCLUDES}
+      )
+
+    # Since we are using Cg framework, we must link to it.
+	# Note, we use weak linking, so that it works even when Cg is not available.
+    SET(CG_LIBRARY "-weak_framework Cg" CACHE STRING "Cg library")
+    SET(CG_GL_LIBRARY "-weak_framework Cg" CACHE STRING "Cg GL library")
+  ENDIF (Cg_FRAMEWORKS)
+  FIND_PROGRAM(CG_COMPILER cgc
+    /usr/bin
+    /usr/local/bin
+    DOC "The Cg compiler"
+    )
+ELSE (APPLE)
+  IF (WIN32)
+		IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
+						FIND_PROGRAM( CG_COMPILER cgc
+							$ENV{CG_BIN64_PATH}
+							$ENV{PROGRAMFILES}/Cg
+							${PROJECT_SOURCE_DIR}/../Cg
+							DOC "The Cg Compiler"
+							)
+		ELSE()
+						FIND_PROGRAM( CG_COMPILER cgc
+							$ENV{CG_BIN_PATH}
+							$ENV{PROGRAMFILES}/Cg
+							${PROJECT_SOURCE_DIR}/../Cg
+							DOC "The Cg Compiler"
+							)
+		ENDIF()
+    IF (CG_COMPILER)
+      GET_FILENAME_COMPONENT(CG_COMPILER_DIR ${CG_COMPILER} PATH)
+      GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR ${CG_COMPILER_DIR} PATH)
+    ELSE (CG_COMPILER)
+      SET (CG_COMPILER_DIR .)
+      SET (CG_COMPILER_SUPER_DIR ..)
+    ENDIF (CG_COMPILER)
+    FIND_PATH( CG_INCLUDE_PATH Cg/cg.h
+      $ENV{CG_INC_PATH}
+      $ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/include
+      $ENV{PROGRAMFILES}/Cg
+      ${PROJECT_SOURCE_DIR}/../Cg
+      ${CG_COMPILER_SUPER_DIR}/include
+      ${CG_COMPILER_DIR}
+      DOC "The directory where Cg/cg.h resides"
+      )
+		IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
+						FIND_LIBRARY( CG_LIBRARY
+							NAMES Cg
+							PATHS
+							$ENV{CG_LIB64_PATH}
+							$ENV{PROGRAMFILES}/Cg
+							${PROJECT_SOURCE_DIR}/../Cg
+							${CG_COMPILER_SUPER_DIR}/lib
+							${CG_COMPILER_DIR}
+							DOC "The Cg runtime library"
+							)
+						FIND_LIBRARY( CG_GL_LIBRARY
+							NAMES CgGL
+							PATHS
+							$ENV{CG_LIB64_PATH}
+							$ENV{PROGRAMFILES}/Cg
+							${PROJECT_SOURCE_DIR}/../Cg
+							${CG_COMPILER_SUPER_DIR}/lib
+							${CG_COMPILER_DIR}
+							DOC "The Cg runtime library"
+							)
+		ELSE()
+						FIND_LIBRARY( CG_LIBRARY
+							NAMES Cg
+							${CG_LIB_SEARCH_PATH}
+							PATHS
+							$ENV{CG_LIB_PATH}
+							$ENV{PROGRAMFILES}/Cg
+							${PROJECT_SOURCE_DIR}/../Cg
+							${CG_COMPILER_SUPER_DIR}/lib
+							${CG_COMPILER_DIR}
+							DOC "The Cg runtime library"
+							)
+						FIND_LIBRARY( CG_GL_LIBRARY
+							NAMES CgGL
+							${CG_LIB_SEARCH_PATH}
+							PATHS
+							$ENV{PROGRAMFILES}/Cg
+							${PROJECT_SOURCE_DIR}/../Cg
+							${CG_COMPILER_SUPER_DIR}/lib
+							${CG_COMPILER_DIR}
+							DOC "The Cg runtime library"
+							)
+		ENDIF()
+  ELSE (WIN32)
+    FIND_PROGRAM( CG_COMPILER cgc
+      /usr/bin
+      /usr/local/bin
+      DOC "The Cg Compiler"
+      )
+    GET_FILENAME_COMPONENT(CG_COMPILER_DIR "${CG_COMPILER}" PATH)
+    GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR "${CG_COMPILER_DIR}" PATH)
+    FIND_PATH( CG_INCLUDE_PATH Cg/cg.h
+      /usr/include
+      /usr/local/include
+      ${CG_COMPILER_SUPER_DIR}/include
+      DOC "The directory where Cg/cg.h resides"
+      )
+    FIND_LIBRARY( CG_LIBRARY Cg
+      PATHS
+      /usr/lib64
+      /usr/lib
+      /usr/local/lib64
+      /usr/local/lib
+      ${CG_COMPILER_SUPER_DIR}/lib64
+      ${CG_COMPILER_SUPER_DIR}/lib
+      DOC "The Cg runtime library"
+      )
+	SET(CG_LIBRARY ${CG_LIBRARY} -lpthread)
+    FIND_LIBRARY( CG_GL_LIBRARY CgGL
+      PATHS
+      /usr/lib64
+      /usr/lib
+      /usr/local/lib64
+      /usr/local/lib
+      ${CG_COMPILER_SUPER_DIR}/lib64
+      ${CG_COMPILER_SUPER_DIR}/lib
+      DOC "The Cg runtime library"
+      )
+  ENDIF (WIN32)
+ENDIF (APPLE)
+
+IF (CG_INCLUDE_PATH)
+  SET( CG_FOUND 1 CACHE STRING "Set to 1 if CG is found, 0 otherwise")
+ELSE (CG_INCLUDE_PATH)
+  SET( CG_FOUND 0 CACHE STRING "Set to 1 if CG is found, 0 otherwise")
+ENDIF (CG_INCLUDE_PATH)
+
+MARK_AS_ADVANCED( CG_FOUND )


Fixed a small Xcode building issue [ci skip].

Xcode considers -O4 and -O3 to be equivalent and therefore generates a
warning (and therefore an error in our case). Indeed, from Xcode 5.1,
-O4 doesn’t imply LTO anymore, hence our ‘fix’.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -126,7 +126,7 @@
             SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DNDEBUG /MD /O2 /Ob2")
         ELSE()
             IF(APPLE)
-                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O4")
+                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -flto")
             ELSE()
                 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
             ENDIF()


Cleaned up the INITIALISE_PROJECT CMake macro.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -6,36 +6,32 @@

     FIND_PACKAGE(Qt4 4.6.0 REQUIRED)

-    # Type of build
-    # Note: we do this here, so that all of our third-party libraries and
-    #       plugins can benefit from these settings
+    # Some settings which depend on whether we want a debug or release version
+    # of OpenCOR
+
+    SET(LINK_FLAGS_PROPERTIES)

     IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
-        SET(DEBUG_MODE ON)
-
         MESSAGE("Building a debug version...")
-    ELSE()
-        SET(DEBUG_MODE OFF)
-
+
+        # Default compiler settings
+
+        SET(CMAKE_CXX_FLAGS "-g -O0")
+    ELSE()
+SET(CMAKE_BUILD_TYPE "Release")
         MESSAGE("Building a release version...")
-    ENDIF()
-
-    # Default compiler and linker settings
-
-    IF(${DEBUG_MODE})
-        SET(CMAKE_CXX_FLAGS "-g -O0")
-    ELSE()
+
+        # Default compiler and linker settings
+
         SET(CMAKE_CXX_FLAGS "-O2 -ffast-math")
-    ENDIF()
-
-    SET(LINK_FLAGS_PROPERTIES)
-
-    IF(NOT APPLE AND NOT ${DEBUG_MODE})
-        SET(LINK_FLAGS_PROPERTIES "${LINK_FLAGS_PROPERTIES} -Wl,-s")
-        # Note #1: -Wl,-s strips all the symbols, thus reducing the final size
-        #          of OpenCOR of one its shared libraries
-        # Note #2: the above linking option has become obsolete on Mac OS X,
-        #          so...
+
+        IF(NOT APPLE)
+            SET(LINK_FLAGS_PROPERTIES "${LINK_FLAGS_PROPERTIES} -Wl,-s")
+            # Note #1: -Wl,-s strips all the symbols, thus reducing the final size
+            #          of OpenCOR of one its shared libraries
+            # Note #2: the above linking option has become obsolete on Mac OS X,
+            #          so...
+        ENDIF()
     ENDIF()

     # Default location for third-party libraries


use systemtap on linux if installed, for dtrace  functionality

--- cmake/dtrace.cmake
+++ cmake/dtrace.cmake
@@ -41,7 +41,7 @@
  ADD_CUSTOM_COMMAND(
    OUTPUT  ${header} ${header_no_dtrace}
    COMMAND ${DTRACE} -h -s ${provider} -o ${header}
-	 COMMAND perl ${CMAKE_SOURCE_DIR}/scripts/dheadgen.pl -f ${provider} > ${header_no_dtrace}
+   COMMAND perl ${CMAKE_SOURCE_DIR}/scripts/dheadgen.pl -f ${provider} > ${header_no_dtrace}
    DEPENDS ${provider}
  )
  ENDIF()
@@ -57,6 +57,13 @@
    ${CMAKE_BINARY_DIR}/include/probes_mysql_dtrace.h
    ${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h
   )
+  IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+   # Systemtap object
+   EXECUTE_PROCESS(
+     COMMAND ${DTRACE} -G -s ${CMAKE_SOURCE_DIR}/include/probes_mysql.d.base
+     -o ${CMAKE_BINARY_DIR}/probes_mysql.o
+   )
+  ENDIF()
   ADD_CUSTOM_TARGET(gen_dtrace_header
   DEPENDS
   ${CMAKE_BINARY_DIR}/include/probes_mysql.d
@@ -66,12 +73,16 @@
 ENDIF()

-MACRO (DTRACE_INSTRUMENT target)
+MACRO(DTRACE_INSTRUMENT target)
   IF(ENABLE_DTRACE)
     ADD_DEPENDENCIES(${target} gen_dtrace_header)

-     # On Solaris, invoke dtrace -G to generate object file and
-     # link it together with target.
+    IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+      TARGET_LINK_LIBRARIES(${target}  ${CMAKE_BINARY_DIR}/probes_mysql.o)
+    ENDIF()
+
+    # On Solaris, invoke dtrace -G to generate object file and
+    # link it together with target.
     IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
       SET(objdir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir)
       SET(outfile ${objdir}/${target}_dtrace.o)


SPLINT_COMMAND is now an advanced CMake cache variable.

--- cmake/splint.cmake
+++ cmake/splint.cmake
@@ -31,6 +31,7 @@

 set(SPLINT_COMMAND splint${CMAKE_EXECUTABLE_SUFFIX}
 	CACHE FILEPATH "the location of the splint executable.")
+mark_as_advanced(SPLINT_COMMAND)

 set(SPLINT_FLAGS -f ${CMAKE_CURRENT_SOURCE_DIR}/splintrc)


now storing command line in a variable to pass all filenames properly to the format custom target...

--- dist/WkBuild.cmake
+++ dist/WkBuild.cmake
@@ -31,6 +31,8 @@
 	message ( FATAL_ERROR " CMAKE MINIMUM BACKWARD COMPATIBILITY REQUIRED : 2.6 !" )
 endif( CMAKE_BACKWARDS_COMPATIBILITY LESS 2.6 )

+# using useful Macros
+include ( CMake/WkUtils.cmake )

 #To setup the compiler
 include ( CMake/WkCompilerSetup.cmake )
@@ -47,28 +49,6 @@
 CMAKE_POLICY(POP)
 endmacro(WKProject PROJECT_NAME)

-MACRO(MERGE ALIST BLIST OUTPUT)
-   SET(BTEMP ${BLIST})
-   FOREACH(A ${ALIST})
-       SET(SORTED)
-       SET(UNINSERTED 1)
-       FOREACH(B ${BTEMP})
-           IF(${UNINSERTED})
-               IF(${A} STRLESS ${B})
-                   SET(SORTED ${SORTED} ${A})
-                   SET(UNINSERTED 0)
-               ENDIF(${A} STRLESS ${B})
-           ENDIF(${UNINSERTED})
-           SET(SORTED ${SORTED} ${B})
-       ENDFOREACH(B ${BLIST})
-       IF(${UNINSERTED})
-           SET(SORTED ${SORTED} ${A})
-       ENDIF(${UNINSERTED})
-       SET(BTEMP ${SORTED})
-   ENDFOREACH(A ${ALIST})
-   SET(${OUTPUT} ${BTEMP})
-ENDMACRO(MERGE ALIST BLIST OUTPUT)
-
 #
 # Generate a config file for the project.
 #
@@ -88,7 +68,6 @@
 ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
 CMAKE_POLICY(PUSH)
 CMAKE_POLICY(VERSION 2.6)
-

 get_filename_component(SELF_DIR \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)
 #all required target should be defined there... no need to specify all targets in ${PROJECT_NAME}_LIBRARIES, they will be linked automatically
@@ -189,7 +168,12 @@
 		IF ( ${PROJECT_NAME}_CODE_FORMAT )
 			set(${PROJECT_NAME}_CODE_FORMAT_STYLE "ansi" CACHE STRING "Format Style for AStyle")
 		ENDIF ( ${PROJECT_NAME}_CODE_FORMAT )
-		ADD_CUSTOM_TARGET(format ALL ${ASTYLE_EXECUTABLE} "--style=${${PROJECT_NAME}_CODE_FORMAT_STYLE}" "${HEADERS}" "${SOURCES}" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM )
+		WkWhitespaceSplit( HEADERS HEADERS_PARAM )
+		WkWhitespaceSplit( SOURCES SOURCES_PARAM )
+		message ( "Sources :  ${HEADERS_PARAM} ${SOURCES_PARAM}" )
+		set ( cmdline " ${ASTYLE_EXECUTABLE} --style=${${PROJECT_NAME}_CODE_FORMAT_STYLE} ${HEADERS_PARAM} ${SOURCES_PARAM}" )
+		#message ( "CMD : ${cmdline} " )
+		ADD_CUSTOM_TARGET(format ALL sh -c ${cmdline} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM )
 	ENDIF ( ASTYLE_FOUND )

 	#Including configured headers (


CMake: do not copy .clang-format for the Core module in ValidateFormatting target (DiligentGraphics/DiligentEngine#199)

--- BuildUtils.cmake
+++ BuildUtils.cmake
@@ -384,10 +384,14 @@
         return()
     endif()

-    # Start by copying .clang-format file to the module's root folder
-    add_custom_target(${MODULE_NAME}-ValidateFormatting ALL
-        COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DILIGENT_CORE_SOURCE_DIR}/.clang-format" "${MODULE_ROOT_PATH}/.clang-format"
-    )
+    add_custom_target(${MODULE_NAME}-ValidateFormatting ALL)
+
+    if (NOT ("${DILIGENT_CORE_SOURCE_DIR}" STREQUAL "${MODULE_ROOT_PATH}"))
+        # Start by copying .clang-format file to the module's root folder
+        add_custom_command(TARGET ${MODULE_NAME}-ValidateFormatting
+            COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DILIGENT_CORE_SOURCE_DIR}/.clang-format" "${MODULE_ROOT_PATH}/.clang-format"
+        )
+    endif()

     if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
         set(RUN_VALIDATION_SCRIPT validate_format_win.bat)


Provide command line for clang-check

Provide command line for clang-check

--- CMake/init.cmake
+++ CMake/init.cmake
@@ -67,22 +67,22 @@
     add_compile_options( --coverage )
     link_libraries(      --coverage )
     add_definitions( -DNDEBUG )  # Disable assert to avoid code coverage bias
+endif()
+
+if( MARCH STREQUAL "native" )
+    if( CMAKE_COMPILER_IS_GNUCXX )
+        EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} -march=native -Q --help=target COMMAND awk "/-march=/{ printf $2}" OUTPUT_VARIABLE march_native )
+        message(STATUS "** MARCH is native and compiler is GNU => Detected processor '${march_native}' => -march=${march_native}")
+        add_compile_options( -march=${march_native} )
+    else()
+        message(STATUS "** MARCH is native and compiler is *not* GNU => -march=native")
+        add_compile_options( -march=native )
+    endif()
+elseif( MARCH )
+    message(STATUS "** MARCH is not native => -march=${MARCH}")
+    add_compile_options( -march=${MARCH} )
 else()
-    if( MARCH STREQUAL "native" )
-        if( CMAKE_COMPILER_IS_GNUCXX )
-            EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} -march=native -Q --help=target COMMAND awk "/-march=/{ printf $2}" OUTPUT_VARIABLE march_native )
-            message(STATUS "** MARCH is native and compiler is GNU => Detected processor '${march_native}' => -march=${march_native}")
-            add_compile_options( -march=${march_native} )
-        else()
-            message(STATUS "** MARCH is native and compiler is *not* GNU => -march=native")
-            add_compile_options( -march=native )
-        endif()
-    elseif( MARCH )
-        message(STATUS "** MARCH is not native => -march=${MARCH}")
-        add_compile_options( -march=${MARCH} )
-    else()
-        message(STATUS "** MARCH is empty => Disable flag -march")
-    endif()
+    message(STATUS "** MARCH is empty => Disable flag -march")
 endif()

 # Set -O0/-Og/-O1/-O2/-O3/-Ofast and -g2/-g3 depending on CMAKE_BUILD_TYPE
@@ -106,9 +106,8 @@
 #add_compile_options( -Wall -Wextra -Wswitch-enum -Wno-ignored-qualifiers) #-pedantic -Weffc++
 add_compile_options( -Wall -Wextra -Wno-ignored-qualifiers) #remove -Wswitch-enum else libPE does not compile

-# Temporarily (unitl Tredzone lib binary is ABIC++11 compliant) force old ABI format
+# Temporarily force old ABI format unitl all closed-libraries become ABIC++11 compliant
 add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
-

 ## Speed up build using pipes (rather than temporary files) for communication between the various GCC stages
 add_compile_options( -pipe )
@@ -145,5 +144,5 @@
 message(STATUS "** PLUGIN_OUTPUT_PATH    =${PLUGIN_OUTPUT_PATH}"   )

-# For clang-check
+# Use: awk -F: '/"file"/{print $2 }' build/compile_commands.json | xargs clang-check -fixit -p build
 set(CMAKE_EXPORT_COMPILE_COMMANDS "on")


PARQUET-940: Fix a bug that Arrow libraries may not be found

If we find Arrow by pkg-config and Arrow is installed into system
directory such as /usr, Arrow libraries can't be found. Because
pkg-config omits system directory from ARROW_LIBRARY_DIRS. In this case,
ARROW_LIBS is empty then Arrow libraries aren't found.

We should use ARROW_LIB_DIR (= $(pkg-config arrow --variable=libdir)
instead of ARROW_LIBRARY_DIRS. It always returns directory that has
Arrow libraries.

Author: Kouhei Sutou <kou@clear-code.com>

Closes #286 from kou/fix-arrow-lib-dir-detection and squashes the following commits:

2d54baf [Kouhei Sutou] Fix a bug that Arrow libraries may not be found

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -357,7 +357,6 @@
 pkg_check_modules(ARROW_IO arrow-io)
 if (ARROW_FOUND AND ARROW_IO_FOUND)
   set(ARROW_INCLUDE_DIR ${ARROW_INCLUDE_DIRS})
-  set(ARROW_LIBS ${ARROW_LIBRARY_DIRS})

   if (COMMAND pkg_get_variable)
     pkg_get_variable(ARROW_ABI_VERSION arrow abi_version)
@@ -380,11 +379,11 @@
   set(ARROW_LIB_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}arrow)
   set(ARROW_IO_LIB_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}arrow_io)

-  set(ARROW_SHARED_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}${ARROW_SHARED_LIB_SUFFIX})
-  set(ARROW_STATIC_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
-
-  set(ARROW_IO_SHARED_LIB ${ARROW_LIBS}/${ARROW_IO_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}${ARROW_IO_SHARED_LIB_SUFFIX})
-  set(ARROW_IO_STATIC_LIB ${ARROW_LIBS}/${ARROW_IO_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
+  set(ARROW_SHARED_LIB ${ARROW_LIBDIR}/${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}${ARROW_SHARED_LIB_SUFFIX})
+  set(ARROW_STATIC_LIB ${ARROW_LIBDIR}/${ARROW_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+  set(ARROW_IO_SHARED_LIB ${ARROW_LIBDIR}/${ARROW_IO_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}${ARROW_IO_SHARED_LIB_SUFFIX})
+  set(ARROW_IO_STATIC_LIB ${ARROW_LIBDIR}/${ARROW_IO_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
 else()
   find_package(Arrow)
 endif()


adding the QT_QMAKE_EXECUTABLE to the QwtExternal.cmake seems to work

--- Superbuild/QwtExternal.cmake
+++ Superbuild/QwtExternal.cmake
@@ -39,6 +39,7 @@
     -DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
+    -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
 )

 ExternalProject_Get_Property(Qwt_external BINARY_DIR)


ENH: Add http support

ENH: Add http support

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -3,10 +3,16 @@
 SET (NIGHTLY_START_TIME "23:00:00 EDT")

 # Dart server to submit results (used by client)
-SET (DROP_SITE "public.kitware.com")
-SET (DROP_LOCATION "/incoming")
-SET (DROP_SITE_USER "ftpuser")
-SET (DROP_SITE_PASSWORD "public")
+IF(DROP_METHOD MATCHES http)
+  SET (DROP_SITE "public.kitware.com")
+  SET (DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi")
+ELSE(DROP_METHOD MATCHES http)
+  SET (DROP_SITE "public.kitware.com")
+  SET (DROP_LOCATION "/incoming")
+  SET (DROP_SITE_USER "ftpuser")
+  SET (DROP_SITE_PASSWORD "public")
+ENDIF(DROP_METHOD MATCHES http)
+
 SET (TRIGGER_SITE
        "http://${DROP_SITE}/cgi-bin/Submit-vtk-TestingResults.pl")


check Mathematica_RUN_KERNEL_ON_CONFIGURE in _find_librarylink_package

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -1964,7 +1964,7 @@

 # internal macro to find LibaryLink package
 macro (_find_librarylink_package)
-	if (COMMAND Mathematica_FIND_PACKAGE)
+	if (Mathematica_RUN_KERNEL_ON_CONFIGURE AND COMMAND Mathematica_FIND_PACKAGE)
 		Mathematica_FIND_PACKAGE(Mathematica_LibraryLink_PACKAGE_FILE "LibraryLink`LibraryLink`")
 		# determine enclosing LibraryLink package directory
 		if (Mathematica_LibraryLink_PACKAGE_FILE)


COMP: remove wshadow from enabled-by-default list of warnings

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -136,7 +136,6 @@
     -Winvalid-pch
     -Wno-format-nonliteral
     -Wpointer-arith
-    -Wshadow
     -Wunused
     -Wwrite-strings
     -funit-at-a-time


Bump Cleaver version for packaging

Bump Cleaver version for packaging

--- CMake/Superbuild/External_Cleaver.cmake
+++ CMake/Superbuild/External_Cleaver.cmake
@@ -62,7 +62,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "git://public.kitware.com/Bender/Cleaver.git"
-    GIT_TAG "4d99b9ebdb202aa89b06f019d608a9a7250f3f6c"
+    GIT_TAG "fdd780995cf9b3b250572648f7faad37dea71e95"
     UPDATE_COMMAND ""
     INSTALL_COMMAND ""
     CMAKE_GENERATOR ${gen}


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -4,7 +4,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2008)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 08)
+SET(KWSYS_DATE_STAMP_MONTH 09)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


cmake: Disabled -Werror and -pedantic-errors if gmock or gtest integration is enabled.

--- cmake/Modules/CppUTestWarningFlags.cmake
+++ cmake/Modules/CppUTestWarningFlags.cmake
@@ -6,7 +6,6 @@
     include(CheckCXXCompilerFlag)

     set(WARNING_C_FLAGS
-        Werror
         Weverything
         Wall
         Wextra
@@ -14,11 +13,14 @@
         Wswitch-default
         Wswitch-enum
         Wconversion
-        pedantic-errors
         Wsign-conversion
         Woverloaded-virtual
         Wno-padded
         )
+
+    if (NOT GMOCK AND NOT REAL_GTEST)
+      list(APPEND WARNING_C_FLAGS Werror pedantic-errors)
+    endif (NOT GMOCK AND NOT REAL_GTEST)

     set(WARNING_C_ONLY_FLAGS
         Wstrict-prototypes


COMP: temporarily disabled opencv image grabber test

--- Modules/ToFHardware/Testing/files.cmake
+++ Modules/ToFHardware/Testing/files.cmake
@@ -9,7 +9,7 @@
   #mitkToFImageRecorderFilterTest.cpp
   mitkToFImageWriterTest.cpp
   mitkToFNrrdImageWriterTest.cpp
-  mitkToFOpenCVImageGrabberTest.cpp
+  #mitkToFOpenCVImageGrabberTest.cpp
 )

 set(MODULE_CUSTOM_TESTS


fixes in Examples.cmake;

fixes in Examples.cmake;

--- Examples/Examples.cmake
+++ Examples/Examples.cmake
@@ -12,7 +12,7 @@
 endif()
 set(MTF_PY_INSTALL_DIR ${MTF_PY_INSTALL_DIR_DEFAULT} CACHE PATH "Directory to install the Python interface module")
 set(Matlab_ROOT_DIR ${Matlab_ROOT_DIR_DEFAULT} CACHE PATH "MATLAB root directory")
-set(MTF_MEX_INSTALL_DIR ${Matlab_ROOT_DIR}/toolbox/local CACHE PATH "Directory to install the Matlab interface module")
+set(MTF_MEX_INSTALL_DIR "" CACHE PATH "Directory to install the Matlab interface module")

 # set(WARNING_FLAGS -Wfatal-errors -Wno-write-strings -Wno-unused-result)
 # set(MTF_COMPILETIME_FLAGS -std=c++11)
@@ -199,8 +199,13 @@
 if(WITH_MEX)
 	find_package(Matlab COMPONENTS MEX_COMPILER MX_LIBRARY)
 	if(Matlab_FOUND)
+		if ("${MTF_MEX_INSTALL_DIR}" STREQUAL "")
+			set(MTF_MEX_INSTALL_DIR ${Matlab_ROOT_DIR}/toolbox/local)
+		endif()
+		message(STATUS "Matlab_ROOT_DIR: ${Matlab_ROOT_DIR}")
 		message(STATUS "Matlab_MEX_LIBRARY: ${Matlab_MEX_LIBRARY}")
 		message(STATUS "Matlab_LIBRARIES: ${Matlab_LIBRARIES}")
+		message(STATUS "MTF_MEX_INSTALL_DIR: ${MTF_MEX_INSTALL_DIR}")
 		matlab_add_mex(
 			NAME mexMTF
 			SRC Examples/cpp/mexMTF.cc


cmake: fix getting parent dir

cmake: fix getting parent dir

--- cmake/DetectOpenCV.cmake
+++ cmake/DetectOpenCV.cmake
@@ -13,8 +13,16 @@
             message(SEND_ERROR "${OpenCV_DIR}. File does not exist.")
         endif(NOT EXISTS ${OpenCV_DIR})

-        message(STATUS "Prepending PKG_CONFIG_PATH with ${OpenCV_DIR}")
-        get_filename_component(OpenCV_DIR_PKG_CONFIG_PATH ${OpenCV_DIR} DIRECTORY)
+        # Get parent directory of .pc file
+        if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL "2.8"
+            AND ${CMAKE_PATCH_VERSION} LESS 12)
+
+            get_filename_component(OpenCV_DIR_PKG_CONFIG_PATH ${OpenCV_DIR} PATH)
+        else()
+            get_filename_component(OpenCV_DIR_PKG_CONFIG_PATH ${OpenCV_DIR} DIRECTORY)
+        endif()
+
+        message(STATUS "Prepending PKG_CONFIG_PATH with ${OpenCV_DIR_PKG_CONFIG_PATH}")
         set(ENV{PKG_CONFIG_PATH} "${OpenCV_DIR_PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}" )

         message(STATUS "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH}")


look for ft2build.h in /usr/include/freetype2

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@8152 662fdd30-d327-0410-a531-f549c87e1e9e

--- cmake/FindFREETYPE.cmake
+++ cmake/FindFREETYPE.cmake
@@ -14,6 +14,7 @@

 FIND_PATH(FREETYPE_INCLUDE_DIR ft2build.h
   /usr/local/include
+  /usr/include/freetype2
   /usr/include
    $ENV{MINGDIR}/include
 )
@@ -52,4 +53,4 @@
 MARK_AS_ADVANCED(
   FREETYPE_LIBRARY
   FREETYPE_INCLUDE_DIR
-  )+  )


Cmake: Removed obsolete IVW_PACKAGE_PROJECT

--- cmake/installutils.cmake
+++ cmake/installutils.cmake
@@ -32,14 +32,12 @@

 # See
 # https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1
-    if(IVW_PACKAGE_PROJECT)
-        # Only show this "advanced" setting when packaging
-        set(IVW_APP_INSTALL_NAME
-            "Inviwo" CACHE STRING "Application bundle name.
-             Override if you are packaging a custom application.
-             Installed libraries and modules
-             will be placed inside bundle <name>.app")
-    endif()
+	# Only show this "advanced" setting when packaging
+	set(IVW_APP_INSTALL_NAME
+		"Inviwo" CACHE STRING "Application bundle name.
+		 Override if you are packaging a custom application.
+		 Installed libraries and modules
+		 will be placed inside bundle <name>.app")
     set(IVW_RUNTIME_INSTALL_DIR ${IVW_APP_INSTALL_NAME}.app/Contents/MacOS)
     set(IVW_BUNDLE_INSTALL_DIR .)
     set(IVW_LIBRARY_INSTALL_DIR ${IVW_APP_INSTALL_NAME}.app/Contents/MacOS)


CMake: Fix CheckPrototypeExists (only works with CheckCSourceCompiles)

--- cmake/Modules/CheckPrototypeExists.cmake
+++ cmake/Modules/CheckPrototypeExists.cmake
@@ -10,7 +10,7 @@
 #  VARIABLE - variable to store the result
 #

-include (CheckCXXSourceCompiles)
+include (CheckCSourceCompiles)

 macro (check_prototype_exists _SYMBOL _HEADER _RESULT)
 	set (_INCLUDE_FILES)
@@ -33,5 +33,5 @@
   return 0;
 }
 ")
-	check_cxx_source_compiles("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
+	check_c_source_compiles("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 endmacro (check_prototype_exists _SYMBOL _HEADER _RESULT)


Also take pkg_INCLUDE_PATH into account

Also take pkg_INCLUDE_PATH into account

--- cmake/modules/VisionarayUsePackage.cmake
+++ cmake/modules/VisionarayUsePackage.cmake
@@ -17,7 +17,7 @@

     #
     # search for cmake variables in the following order:
-    #  name_INCLUDE_DIR, NAME_INCLUDE_DIR, name_INCLUDE_DIRS, NAME_INCLUDE_DIRS
+    #  name_INCLUDE_DIR, NAME_INCLUDE_DIR, name_INCLUDE_DIRS, NAME_INCLUDE_DIRS, NAME_INCLUDE_PATH
     if(NOT pkg_INCDIRS)
         if(${name}_INCLUDE_DIR)
             set(pkg_INCDIRS ${${name}_INCLUDE_DIR})
@@ -27,6 +27,10 @@
             set(pkg_INCDIRS ${${name}_INCLUDE_DIRS})
         elseif(${upper_name}_INCLUDE_DIRS)
             set(pkg_INCDIRS ${${upper_name}_INCLUDE_DIRS})
+        elseif(${name}_INCLUDE_PATH)
+            set(pkg_INCDIRS ${${name}_INCLUDE_PATH})
+        elseif(${upper_name}_INCLUDE_PATH)
+            set(pkg_INCDIRS ${${upper_name}_INCLUDE_PATH})
         endif()
     endif()


Update 'hunter_qt_add_module' to conform components optimization

--- cmake/modules/hunter_qt_add_module.cmake
+++ cmake/modules/hunter_qt_add_module.cmake
@@ -24,15 +24,19 @@
     return()
   endif()

-  set(dep_list "${x_COMPONENTS}")
+  set(dep_list "")

-  foreach(dep ${dep_list})
+  # "Base" components should be build first so adding dependencies of
+  # dependencies for the start.
+  foreach(dep ${x_COMPONENTS})
     list(APPEND dep_list ${component_${dep}_depends_on})
   endforeach()

+  # Now we can proceed with explicit dependencies
+  list(APPEND dep_list "${x_COMPONENTS}")
+
   list(REMOVE_ITEM dep_list "") # remove empty elements
   list(REMOVE_DUPLICATES dep_list)
-  list(SORT dep_list)

   set(component_${x_NAME}_depends_on "${dep_list}" PARENT_SCOPE)
 endfunction()


Excluded ANDROID OS from LINUX variable in cmake

--- cmake/Qt5QGCConfiguration.cmake
+++ cmake/Qt5QGCConfiguration.cmake
@@ -11,7 +11,7 @@
 	set(QT_MKSPEC $ENV{QT_MKSPEC})
 endif()

-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT ANDROID)
 	set(LINUX TRUE)
 endif()


Updated policyRules.cmake. Fixed scope of POLICY_SET variable

--- cmake/modules/policyRules.cmake
+++ cmake/modules/policyRules.cmake
@@ -9,6 +9,6 @@
         cmake_policy(SET CMP0074 NEW)
         message(STATUS "CMP0074 policy set to NEW")
     endif()
-    set(POLICY_SET ON)
+    set(POLICY_SET ON PARENT_SCOPE)
 endif()


Removing unintended debug output.

Removing unintended debug output.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -347,7 +347,6 @@
   GET_FILENAME_COMPONENT (_output_dir "${OUTPUT_FILE}" PATH)
   GET_FILENAME_COMPONENT (_output_filename "${OUTPUT_FILE}" NAME_WE)
   GET_FILENAME_COMPONENT (_output_ext "${OUTPUT_FILE}" EXT)
-  message (STATUS "${OUTPUT_FILE}...${_output_dir}...${_output_filename}...${_output_ext}")
   IF (NOT "${VERSION_ARG}" STREQUAL "")
     SET (_output_filename "${_output_filename}_${VERSION_ARG}${_output_ext}")
   ELSE (NOT "${VERSION_ARG}" STREQUAL "")


Added comments

Added comments

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -928,6 +928,10 @@
     STRING (REPLACE ".exe" ".bat" TARGET_LOCATION ${TARGET_LOCATION})
   ENDIF(WIN32)

+  #We cannot just use ARGN, as this will not work with arguments that contain ;, even if escaped
+  #A more recent version of CMake contains a $<SEMICOLON> special token, but this version of cmake
+  #is unsupported by some of our target platforms and it doesn't seem to work when used with variadic
+  #functions
   ADD_TEST ("${NAME}" "${TARGET_LOCATION}" ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5} ${ARGV6} ${ARGV7} ${ARGV8} ${ARGV9} ${ARGV10} ${ARGV11} ${ARGV12} ${ARGV13} ${ARGV14} ${ARGV15})
   SET_TESTS_PROPERTIES ("${NAME}" PROPERTIES TIMEOUT "${NORMAL_TIMEOUT_VALUE}")
   GET_PROPERTY (TEST_EXTRAPROPS GLOBAL PROPERTY "EXTRAPROPS-${NAME}")


DOC: Fix description typo.

DOC: Fix description typo.

--- itk-module.cmake
+++ itk-module.cmake
@@ -1,7 +1,7 @@
 set(DOCUMENTATION "This module implements cuberille implicit surface
 polygonization for ITK. This method operates by diving the surface into a
 number of small cubes called cuberilles. Each cuberille is centered at a
-pixel lying on th eiso-surface and then quadrilaterals are generated for each
+pixel lying on the iso-surface and then quadrilaterals are generated for each
 face. The original approach is improved by projecting the vertices of each
 cuberille onto the implicit surface, smoothing the typical block-like
 resultant mesh.


Fix multi build configurations with libcurl

--- CMake/external_libcurl.cmake
+++ CMake/external_libcurl.cmake
@@ -2,7 +2,7 @@
     include(ExternalProject)
     message(STATUS "Building libcurl enabled")

-    set(CURL_FLAGS -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_WIN32_LDAP=OFF -DHTTP_ONLY=ON -DCURL_ZLIB=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON -DCMAKE_USE_OPENSSL=OFF -DCMAKE_USE_LIBSSH2=OFF)
+    set(CURL_FLAGS -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_WIN32_LDAP=OFF -DHTTP_ONLY=ON -DCURL_ZLIB=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON -DCMAKE_USE_OPENSSL=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_TESTING=OFF )
     if (WIN32)
         set(CURL_FLAGS ${CURL_FLAGS} -DCURL_STATIC_CRT=ON )
     endif()
@@ -14,10 +14,16 @@
         GIT_TAG "53cdc2c963e33bc0cc1a51ad2df79396202e07f8" # curl-7_70_0
         SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/third-party/libcurl
         TEST_COMMAND ""
-        CMAKE_ARGS  -DCMAKE_CXX_STANDARD_LIBRARIES=${CMAKE_CXX_STANDARD_LIBRARIES}
+        CMAKE_ARGS  -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+                    -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+                    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+                    -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
+                    -DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
+                    -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
+                    -DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
+                    -DCMAKE_CXX_STANDARD_LIBRARIES=${CMAKE_CXX_STANDARD_LIBRARIES}
                     -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install
                     -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-                    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                     -DANDROID_ABI=${ANDROID_ABI}
                     -DANDROID_STL=${ANDROID_STL} ${CURL_FLAGS}
     )


COMP: force exclude vtkgl.h from hierarchy file

For some reason, Win32 builds could not find this file in the
CMAKE_CURRENT_BINARY_DIR.  Maybe because the BINARY_DIR was a
relative path, or maybe the dependencies were wrong and the file
wasn't built.  Oddly, vtkTypeInt32Array.h and friends are also
in CMAKE_CURRENT_BINARY_DIR (for Common) and they work fine.

--- CMake/vtkWrapHierarchy.cmake
+++ CMake/vtkWrapHierarchy.cmake
@@ -28,12 +28,14 @@

   # For each class
   FOREACH(FILE ${SOURCES})
+
     # should we wrap the file?
     GET_SOURCE_FILE_PROPERTY(TMP_WRAP_EXCLUDE ${FILE} WRAP_EXCLUDE)
     GET_SOURCE_FILE_PROPERTY(TMP_WRAP_SPECIAL ${FILE} WRAP_SPECIAL)

     # if we should wrap it
     IF (IGNORE_WRAP_EXCLUDE OR TMP_WRAP_SPECIAL OR NOT TMP_WRAP_EXCLUDE)
+
       # what is the filename without the extension
       GET_FILENAME_COMPONENT(TMP_FILENAME ${FILE} NAME_WE)

@@ -47,6 +49,8 @@
         SET(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.h)
       ENDIF (TMP_FILEPATH)

+      IF(NOT "${KIT}" STREQUAL "Rendering" OR
+         NOT "${TMP_FILENAME}" STREQUAL "vtkgl")
       IF(NOT "${KIT}" STREQUAL "Filtering" OR
          NOT "${TMP_FILENAME}" STREQUAL "vtkInformation")

@@ -59,6 +63,8 @@

       ENDIF(NOT "${KIT}" STREQUAL "Filtering" OR
             NOT "${TMP_FILENAME}" STREQUAL "vtkInformation")
+      ENDIF(NOT "${KIT}" STREQUAL "Rendering" OR
+            NOT "${TMP_FILENAME}" STREQUAL "vtkgl")
     ENDIF (IGNORE_WRAP_EXCLUDE OR TMP_WRAP_SPECIAL OR NOT TMP_WRAP_EXCLUDE)
   ENDFOREACH(FILE)


Laurens Voerman, "my cmake (2.8.10.2 generating for Visual Studio 11 Win64) doesn't like include(${CMAKE_MODULE_PATH}/FindPackageHandleStandardArgs.cmake) in CMakeModules/FindLua52.cmake changing to a more common     include(FindPackageHandleStandardArgs) solves my problem."

--- CMakeModules/FindLua52.cmake
+++ CMakeModules/FindLua52.cmake
@@ -71,7 +71,7 @@
 endif()

-include(${CMAKE_MODULE_PATH}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)

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


- Fix to iOS toolchain

- Fix to iOS toolchain

--- cmake/Toolchains/all-ios.toolchain.cmake
+++ cmake/Toolchains/all-ios.toolchain.cmake
@@ -47,9 +47,9 @@

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

 # Skip the platform compiler checks for cross compiling
 set (CMAKE_CXX_COMPILER_WORKS TRUE)


Correct SIRF-Contribs install location

Correct SIRF-Contribs install location

actually same location, just using a variable copied and pasted from CCPi stuff

--- SuperBuild/External_SIRF-Contribs.cmake
+++ SuperBuild/External_SIRF-Contribs.cmake
@@ -49,7 +49,7 @@
       DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR}
       STAMP_DIR ${${proj}_STAMP_DIR}
       TMP_DIR ${${proj}_TMP_DIR}
-      INSTALL_DIR ${libcilreg_Install_Dir}
+      INSTALL_DIR ${SUPERBUILD_INSTALL_DIR}

       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""


Align EXTERNAL_PROJECT_BUILD_TYPE with CMAKE_BUILD_TYPE

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -45,9 +45,8 @@

 include(ExternalProject)

-set(EXTERNAL_PROJECT_BUILD_TYPE "Release" CACHE STRING "Default build type for support libraries")
-set_property(CACHE EXTERNAL_PROJECT_BUILD_TYPE PROPERTY
-STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+set(EXTERNAL_PROJECT_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE INTERNAL "Default build type for support libraries")
+message(STATUS "EXTERNAL_PROJECT_BUILD_TYPE: ${EXTERNAL_PROJECT_BUILD_TYPE}")

 # Make sure that some CMake variables are passed to all dependencies
 mark_as_superbuild(
@@ -90,7 +89,7 @@
 else()
   set(build_Gadgetron_default ON)
 endif()
-
+
 option(BUILD_GADGETRON "Build Gadgetron" ${build_Gadgetron_default})

 set(${PRIMARY_PROJECT_NAME}_DEPENDENCIES
@@ -124,7 +123,7 @@

 ## configure the environment files env_ccppetmr.sh/csh
 ## We create a whole bash/csh block script which does set the appropriate
-## environment variables for Python and Matlab.
+## environment variables for Python and Matlab.
 ## in the env_ccppetmr scripts we perform a substitution of the whole block
 ## during the configure_file() command call below.

@@ -140,7 +139,7 @@
 setenv SIRF_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}")

   set (ENV_PYTHON_BASH "\
-PYTHONPATH=${CCPPETMR_INSTALL}/python:$PYTHONPATH \n\
+PYTHONPATH=${CCPPETMR_INSTALL}/python:$PYTHONPATH \n\
 export PYTHONPATH \n\
 SIRF_PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} \n\
 export SIRF_PYTHON_EXECUTABLE")
@@ -173,4 +172,3 @@
 add_test(NAME SIRF_TESTS
          COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
          WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SIRF-prefix/src/SIRF-build/)
-


update tarball version

update tarball version

--- SCOREC_StandAlone.cmake
+++ SCOREC_StandAlone.cmake
@@ -86,5 +86,5 @@

 #binary distribution package
 set(CPACK_GENERATOR "TGZ")
-set(CPACK_PACKAGE_VERSION "1.0.2")
+set(CPACK_PACKAGE_VERSION "1.1.0")
 include(CPack)


Fixed find cpprest for cmake script

Fixed find cpprest for cmake script

--- lib/Findcpprest.cmake
+++ lib/Findcpprest.cmake
@@ -8,7 +8,7 @@
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

-FIND_LIBRARY(cpprest_LIBRARY NAMES libcpprest PATHS
+FIND_LIBRARY(cpprest_LIBRARY NAMES cpprest PATHS
     /usr/lib
     /usr/local/lib
 )


Tentative linux packaging as .deb. Not working yet.

--- Superbuild/Projects/unix/veloview.bundle.cmake
+++ Superbuild/Projects/unix/veloview.bundle.cmake
@@ -1,6 +1,10 @@
+#SET(CPACK_GENERATOR "DEB")
+#SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "David Oroshnik <doroshnik@velodyne.com>") #required
+#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libqt4-core (>= 4.8.4), libqt4-core (>= 4.8.4), python (>= 2.7)")
+#SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+
 include(veloview.bundle.common)
 include(CPack)
-

 # install all ParaView's shared libraries.
 install(DIRECTORY "${install_location}/lib/paraview-${PARAVIEW_VERSION}"


No comment.

No comment.

--- msvc/Custom-vs.cmake
+++ msvc/Custom-vs.cmake
@@ -12,7 +12,7 @@

 set(CMAKE_VERBOSE_MAKEFILE ON)
 # set(Eigen3_DIR "D:\\msys64\\home\\restore\\vcpkg\\packages\\eigen3_x64-windows\\share\\eigen3")
-find_package (Eigen3 3.3 REQUIRED NO_MODULE)
+# find_package (Eigen3 3.3 REQUIRED NO_MODULE)

 # Csound build options for MSVC
 set(BUILD_BUCHLA_OPCODES ON)


Add NO_INSTALL option.

Add NO_INSTALL option.

	* build-aux/cmake/modules/Gostai.cmake (gostai_add_executable): Here.

--- build-aux/cmake/modules/Gostai.cmake
+++ build-aux/cmake/modules/Gostai.cmake
@@ -26,7 +26,7 @@
   parse_arguments(
     ${name}
     "SOURCES;MOCS;UIS;CPPFLAGS;INCLUDE_DIRS;LIBRARIES;RESOURCES;TRANSLATIONS"
-    "NO_CONSOLE;INSTALL_NO_DEPS"
+    "NO_CONSOLE;INSTALL_NO_DEPS;NO_INSTALL"
     ${ARGN})

   # =================== #
@@ -175,21 +175,25 @@
   # Install files #
   # ============= #

-  install(TARGETS ${name} DESTINATION ${BINARIES_DIR})
-  install_qt_plugins(${PLUGINS_DIR})
-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qt.conf.install
-    DESTINATION ${BINARIES_DIR}
-    RENAME qt.conf)
-  install(FILES ${${name}_QM_SOURCES} DESTINATION ${TRANSLATIONS_DIR})
+  if(NOT ${name}_NO_INSTALL)
+    install(TARGETS ${name} DESTINATION ${BINARIES_DIR})
+    install_qt_plugins(${PLUGINS_DIR})
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qt.conf.install
+      DESTINATION ${BINARIES_DIR}
+      RENAME qt.conf)
+    install(FILES ${${name}_QM_SOURCES} DESTINATION ${TRANSLATIONS_DIR})
+  endif(NOT ${name}_NO_INSTALL)

   # ========================== #
   # Deploy dependent libraries #
   # ========================== #

-  if(NOT ${name}_INSTALL_NO_DEPS)
-    gen_lib_loader(${name})
-    dldep_install(${name})
-  endif(NOT ${name}_INSTALL_NO_DEPS)
+  if(NOT ${name}_NO_INSTALL)
+    if(NOT ${name}_INSTALL_NO_DEPS)
+      gen_lib_loader(${name})
+      dldep_install(${name})
+    endif(NOT ${name}_INSTALL_NO_DEPS)
+  endif(NOT ${name}_NO_INSTALL)

   # ================== #
   # Add custom targets #


Update the vtkDICOM remote module to v0.7.7.

--- Remote/vtkDICOM.remote.cmake
+++ Remote/vtkDICOM.remote.cmake
@@ -5,6 +5,6 @@
 vtk_fetch_module(vtkDICOM
   "Dicom classes and utilities"
   GIT_REPOSITORY https://github.com/dgobbi/vtk-dicom
-  # vtk-dicom tag v0.7.6 (Mar 23, 2016)
-  GIT_TAG 67b8b50a1a68e520a307565ee2a39e2e350422c6
+  # vtk-dicom tag v0.7.7 (Apr 21, 2016)
+  GIT_TAG 1b2085814fc7f246ddb3f27e487233fe1f02dcb0
   )


point to our cross C++ compiler

point to our cross C++ compiler

--- cmake/HermitCore-Toolchain-x86.cmake
+++ cmake/HermitCore-Toolchain-x86.cmake
@@ -8,8 +8,9 @@

 set(CMAKE_SYSTEM_NAME Generic)

-# point CMake to our toolchain, it will auto detect C++ compiler
+# point CMake to our toolchain
 set(CMAKE_C_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_ARCH}-gcc)
+set(CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_ARCH}-g++)
 set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_ARCH}-gfortran)
 set(CMAKE_Go_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_ARCH}-gccgo)


[cmake] Added modules to default cmake config to make build work.

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -133,7 +133,7 @@
 set(mlp_defvalue OFF)
 set(monalisa_defvalue OFF)
 set(mysql_defvalue OFF)
-set(net_defvalue OFF)
+set(net_defvalue ON)
 set(odbc_defvalue OFF)
 set(oracle_defvalue OFF)
 set(peac_defvalue OFF)
@@ -158,8 +158,8 @@
 set(srp_defvalue OFF)
 set(ssl_defvalue OFF)
 set(tmva_defvalue OFF)
-set(tree_defvalue OFF)
-set(treeplayer_defvalue OFF)
+set(tree_defvalue ON)
+set(treeplayer_defvalue ON)
 set(treeviewer_defvalue OFF)
 set(vmc_defvalue OFF)
 set(xml_defvalue OFF)


[VDT] VDT is OFF by default on Win32, where it is not supported

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -171,7 +171,11 @@
 ROOT_BUILD_OPTION(tmva-gpu ON "Build TMVA with GPU support for deep learning. Requries CUDA")
 ROOT_BUILD_OPTION(unuran OFF "UNURAN - package for generating non-uniform random numbers")
 ROOT_BUILD_OPTION(vc OFF "Vc adds a few new types for portable and intuitive SIMD programming")
-ROOT_BUILD_OPTION(vdt ON "VDT adds a set of fast and vectorisable mathematical functions")
+if(WIN32)
+  ROOT_BUILD_OPTION(vdt OFF "VDT adds a set of fast and vectorisable mathematical functions")
+else()
+  ROOT_BUILD_OPTION(vdt ON "VDT adds a set of fast and vectorisable mathematical functions")
+endif()
 ROOT_BUILD_OPTION(veccore OFF "VecCore SIMD abstraction library")
 ROOT_BUILD_OPTION(vecgeom OFF "VecGeom is a vectorized geometry library enhancing the performance of geometry navigation.")
 ROOT_BUILD_OPTION(winrtdebug OFF "Link against the Windows debug runtime library")


Fix yaml-cpp SHA1 (#73)

Fix yaml-cpp SHA1 (#73)

--- cmake/projects/yaml-cpp/hunter.cmake
+++ cmake/projects/yaml-cpp/hunter.cmake
@@ -58,7 +58,7 @@
   URL
   "https://github.com/hunter-packages/yaml-cpp/archive/v0.6.2-0f9a586-p1.zip"
   SHA1
-  956C2B5FBF5AA0EB8EF5EF890C0328B3AA357A13
+  956c2b5fbf5aa0eb8ef5ef890c0328b3aa357a13
   )

 hunter_cmake_args(


clang-tidy: default=do not use

clang-tidy: default=do not use

--- cmakemodules/script_clang_tidy.cmake
+++ cmakemodules/script_clang_tidy.cmake
@@ -10,7 +10,7 @@
   endif()
 else()
   message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
-  option(USE_CLANG_TIDY "Use clang-tidy analyzer" ON)
+  option(USE_CLANG_TIDY "Use clang-tidy analyzer" OFF)
   if (USE_CLANG_TIDY)
     #  cppcoreguidelines checks: not all for now...
     #  cppcoreguidelines-no-malloc


more search folders for sdl main

more search folders for sdl main

--- cmake-modules/FindSDL2.cmake
+++ cmake-modules/FindSDL2.cmake
@@ -103,7 +103,7 @@
 			NAMES SDL2main
 			HINTS
 			$ENV{SDL2DIR}
-			PATH_SUFFIXES lib64 lib
+			PATH_SUFFIXES lib64 lib Release Debug
 			PATHS ${SDL2_SEARCH_PATHS}
 		)


cmake: remove documentation for NVTX_ROOT_DIR in favor of NVTX_ROOT (#17405)

https://cmake.org/cmake/help/latest/policy/CMP0074.html

--- cmake/Modules/FindNVTX.cmake
+++ cmake/Modules/FindNVTX.cmake
@@ -14,8 +14,6 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-set(NVTX_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA NVTX")

 find_path(NVTX_INCLUDE_DIRS
   NAMES nvToolsExt.h


add 5.2 and 6.1 compute capability support

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -67,9 +67,9 @@
   elseif(CUDA_GENERATION STREQUAL "Kepler")
     set(__cuda_arch_bin "3.0 3.5 3.7")
   elseif(CUDA_GENERATION STREQUAL "Maxwell")
-    set(__cuda_arch_bin "5.0")
+    set(__cuda_arch_bin "5.0 5.2")
   elseif(CUDA_GENERATION STREQUAL "Pascal")
-    set(__cuda_arch_bin "6.0")
+    set(__cuda_arch_bin "6.0 6.1")
   elseif(CUDA_GENERATION STREQUAL "Auto")
     execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
                      WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
@@ -92,9 +92,9 @@
       set(__cuda_arch_ptx "")
     else()
       if(${CUDA_VERSION} VERSION_LESS "8.0")
-        set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0")
+        set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2")
       else()
-        set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 6.0")
+        set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2 6.0 6.1")
       endif()
       set(__cuda_arch_ptx "")
     endif()


Fixed PCH warning during ARM crosscompilation

--- cmake/OpenCVPCHSupport.cmake
+++ cmake/OpenCVPCHSupport.cmake
@@ -169,9 +169,9 @@
         # if you have different versions of the headers for different build types
         # you may set _pch_dowarn
         IF (_dowarn)
-            SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include \"${CMAKE_CURRENT_BINARY_DIR}/${_header_name}\" -Winvalid-pch " )
+            SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -Winvalid-pch " )
         ELSE (_dowarn)
-            SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include \"${CMAKE_CURRENT_BINARY_DIR}/${_header_name}\" " )
+            SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} " )
         ENDIF (_dowarn)

     ELSE(CMAKE_COMPILER_IS_GNUCXX)


try fix gcc < 4.9 build

try fix gcc < 4.9 build

--- cmake/PlatformLinuxGCC.cmake
+++ cmake/PlatformLinuxGCC.cmake
@@ -51,7 +51,6 @@

       -Wno-float-equal
       -Wno-pragmas
-      -Wno-float-conversion

     # -Werror=return-type -> missing returns in functions and methods are handled as errors which stops the compilation
     # -Wshadow      # -> e.g. when a parameter is named like a member, too many warnings, disabled for now
@@ -62,7 +61,7 @@
 if (CMAKE_COMPILER_IS_GNUCXX)
     if (NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "4.9"))
         set(LINUX_COMPILE_FLAGS ${LINUX_COMPILE_FLAGS}
-            -Wno-error=float-conversion
+            -Wno-float-conversion
         )
     endif ()
 endif ()


made output directories project specific

--- cmake/catkin_workspace.cmake
+++ cmake/catkin_workspace.cmake
@@ -45,11 +45,14 @@
       list(GET CATKIN_ORDERED_PROJECTS ${index} name)
       list(GET CATKIN_ORDERED_PROJECT_PATHS ${index} path)
       message(STATUS "+++ add_subdirectory(${path})")
-      # set project specific output directory and create it if necessary
+      # set project specific output directory for binaries and create it if necessary
       set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${catkin_BUILD_PREFIX}/lib/${name})
       if(NOT IS_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
         file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
       endif()
+      set(CATKIN_CURRENT_RUNTIME_DESTINATION lib/${name})
+      # set project specific output directory for architecture independent files
+      set(CATKIN_CURRENT_SHARE_DIRECTORY share/${name})

       set(CATKIN_CURRENT_STACK "" CACHE INTERNAL "" FORCE)
       stamp(${path}/stack.xml)


build: inline constant values for `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -675,10 +675,7 @@
 #     target
 #     [SHARED]
 #     [STATIC]
-#     [SDK sdk]
-#     [ARCHITECTURE architecture]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
-#     INSTALL_IN_COMPONENT comp
 #     source1 [source2 source3 ...])
 #
 # target
@@ -690,17 +687,8 @@
 # STATIC
 #   Build a static library.
 #
-# SDK sdk
-#   SDK to build for.
-#
-# ARCHITECTURE
-#   Architecture to build for.
-#
 # LLVM_LINK_COMPONENTS
 #   LLVM components this library depends on.
-#
-# INSTALL_IN_COMPONENT comp
-#   The Swift installation component that this library belongs to.
 #
 # source1 ...
 #   Sources to add into this library
@@ -708,10 +696,7 @@
   set(SWIFTLIB_SINGLE_options
         SHARED
         STATIC)
-  set(SWIFTLIB_SINGLE_single_parameter_options
-        ARCHITECTURE
-        INSTALL_IN_COMPONENT
-        SDK)
+  set(SWIFTLIB_SINGLE_single_parameter_options)
   set(SWIFTLIB_SINGLE_multiple_parameter_options
         GYB_SOURCES
         LLVM_LINK_COMPONENTS)
@@ -726,23 +711,18 @@

   translate_flags(SWIFTLIB_SINGLE "${SWIFTLIB_SINGLE_options}")

-  # Check arguments.
-  precondition(SWIFTLIB_SINGLE_SDK MESSAGE "Should specify an SDK")
-  precondition(SWIFTLIB_SINGLE_ARCHITECTURE MESSAGE "Should specify an architecture")
-  precondition(SWIFTLIB_SINGLE_INSTALL_IN_COMPONENT MESSAGE "INSTALL_IN_COMPONENT is required")
-
   if(NOT SWIFTLIB_SINGLE_SHARED AND NOT SWIFTLIB_SINGLE_STATIC)
     message(FATAL_ERROR "Either SHARED or STATIC must be specified")
   endif()

   # Determine the subdirectory where this library will be installed.
   set(SWIFTLIB_SINGLE_SUBDIR
-      "${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}/${SWIFTLIB_SINGLE_ARCHITECTURE}")
+    "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH}")

   # Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
   set(embed_bitcode_arg)
   if(SWIFT_EMBED_BITCODE_SECTION)
-    if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "IOS" OR "${SWIFTLIB_SINGLE_SDK}" STREQUAL "TVOS" OR "${SWIFTLIB_SINGLE_SDK}" STREQUAL "WATCHOS")
+    if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "IOS" OR "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "TVOS" OR "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WATCHOS")
       list(APPEND SWIFTLIB_SINGLE_C_COMPILE_FLAGS "-fembed-bitcode")
       set(embed_bitcode_arg EMBED_BITCODE)
     endif()
@@ -777,24 +757,24 @@
     handle_gyb_sources(
         gyb_dependency_targets
         SWIFTLIB_SINGLE_GYB_SOURCES
-        "${SWIFTLIB_SINGLE_ARCHITECTURE}")
+        "${SWIFT_HOST_VARIANT_ARCH}")
     set(SWIFTLIB_SINGLE_SOURCES ${SWIFTLIB_SINGLE_SOURCES}
       ${SWIFTLIB_SINGLE_GYB_SOURCES})
   endif()

   add_library("${target}" ${libkind}
               ${SWIFTLIB_SINGLE_SOURCES})
-  _set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFTLIB_SINGLE_SDK}")
-
-  if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")
-    swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} SWIFTLIB_INCLUDE)
+  _set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFT_HOST_VARIANT_SDK}")
+
+  if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
+    swift_windows_include_for_arch(${SWIFT_HOST_VARIANT_ARCH} SWIFTLIB_INCLUDE)
     target_include_directories("${target}" SYSTEM PRIVATE ${SWIFTLIB_INCLUDE})
     set_target_properties(${target}
                           PROPERTIES
                             CXX_STANDARD 14)
   endif()

-  if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+  if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
     if("${libkind}" STREQUAL "SHARED")
       # Each dll has an associated .lib (import library); since we may be
       # building on a non-DLL platform (not windows), create an imported target
@@ -816,19 +796,19 @@
       BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
       LIBRARY_DIR ${SWIFT_LIBRARY_OUTPUT_INTDIR})

-  if(SWIFTLIB_SINGLE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
+  if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
     set_target_properties("${target}"
       PROPERTIES
       INSTALL_NAME_DIR "@rpath")
-  elseif("${SWIFTLIB_SINGLE_SDK}" STREQUAL "LINUX")
+  elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
     set_target_properties("${target}"
       PROPERTIES
       INSTALL_RPATH "$ORIGIN:/usr/lib/swift/linux")
-  elseif("${SWIFTLIB_SINGLE_SDK}" STREQUAL "CYGWIN")
+  elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "CYGWIN")
     set_target_properties("${target}"
       PROPERTIES
       INSTALL_RPATH "$ORIGIN:/usr/lib/swift/cygwin")
-  elseif("${SWIFTLIB_SINGLE_SDK}" STREQUAL "ANDROID")
+  elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "ANDROID")
     # Only set the install RPATH if cross-compiling the host tools, in which
     # case both the NDK and Sysroot paths must be set.
     if(NOT "${SWIFT_ANDROID_NDK_PATH}" STREQUAL "" AND
@@ -857,11 +837,11 @@
   set(c_compile_flags ${SWIFTLIB_SINGLE_C_COMPILE_FLAGS})
   set(link_flags)

-  set(library_search_subdir "${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
+  set(library_search_subdir "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
   set(library_search_directories
       "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}"
       "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR}"
-      "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
+      "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")

   # In certain cases when building, the environment variable SDKROOT is set to override
   # where the sdk root is located in the system. If that environment variable has been
@@ -872,8 +852,8 @@
   endif()

   _add_variant_c_compile_flags(
-    SDK "${SWIFTLIB_SINGLE_SDK}"
-    ARCH "${SWIFTLIB_SINGLE_ARCHITECTURE}"
+  SDK "${SWIFT_HOST_VARIANT_SDK}"
+    ARCH "${SWIFT_HOST_VARIANT_ARCH}"
     BUILD_TYPE ${CMAKE_BUILD_TYPE}
     ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS}
     ANALYZE_CODE_COVERAGE ${SWIFT_ANALYZE_CODE_COVERAGE}
@@ -881,29 +861,29 @@
     RESULT_VAR_NAME c_compile_flags
     )

-  if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS)
+  if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS)
     if(libkind STREQUAL SHARED)
       list(APPEND c_compile_flags -D_WINDLL)
     endif()
   endif()
   _add_variant_link_flags(
-    SDK "${SWIFTLIB_SINGLE_SDK}"
-    ARCH "${SWIFTLIB_SINGLE_ARCHITECTURE}"
+    SDK "${SWIFT_HOST_VARIANT_SDK}"
+    ARCH "${SWIFT_HOST_VARIANT_ARCH}"
     BUILD_TYPE ${CMAKE_BUILD_TYPE}
     ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS}
     ANALYZE_CODE_COVERAGE ${SWIFT_ANALYZE_CODE_COVERAGE}
     ENABLE_LTO ${SWIFT_TOOLS_ENABLE_LTO}
-    LTO_OBJECT_NAME "${target}-${SWIFTLIB_SINGLE_SDK}-${SWIFTLIB_SINGLE_ARCHITECTURE}"
+    LTO_OBJECT_NAME "${target}-${SWIFT_HOST_VARIANT_SDK}-${SWIFT_HOST_VARIANT_ARCH}"
     RESULT_VAR_NAME link_flags
     LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories
       )

   # Set compilation and link flags.
-  if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS)
-    swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE}
-      ${SWIFTLIB_SINGLE_ARCHITECTURE}_INCLUDE)
+  if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS)
+    swift_windows_include_for_arch(${SWIFT_HOST_VARIANT_ARCH}
+      ${SWIFT_HOST_VARIANT_ARCH}_INCLUDE)
     target_include_directories(${target} SYSTEM PRIVATE
-      ${${SWIFTLIB_SINGLE_ARCHITECTURE}_INCLUDE})
+      ${${SWIFT_HOST_VARIANT_ARCH}_INCLUDE})

     if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL MSVC)
       swift_windows_get_sdk_vfs_overlay(SWIFTLIB_SINGLE_VFS_OVERLAY)
@@ -923,7 +903,7 @@
     ${c_compile_flags})
   target_link_options(${target} PRIVATE
     ${link_flags})
-  if(${SWIFTLIB_SINGLE_SDK} IN_LIST SWIFT_APPLE_PLATFORMS)
+  if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_APPLE_PLATFORMS)
     target_link_options(${target} PRIVATE
       "LINKER:-compatibility_version,1")
     if(SWIFT_COMPILER_VERSION)
@@ -932,7 +912,7 @@
     endif()
     # Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
     if(SWIFT_EMBED_BITCODE_SECTION)
-      if(${SWIFTLIB_SINGLE_SDK} MATCHES "(I|TV|WATCH)OS")
+      if(${SWIFT_HOST_VARIANT_SDK} MATCHES "(I|TV|WATCH)OS")
         # The two branches of this if statement accomplish the same end result
         # We are simply accounting for the fact that on CMake < 3.16
         # using a generator expression to
@@ -1014,10 +994,7 @@
     ${ASHL_SHARED_keyword}
     ${ASHL_STATIC_keyword}
     ${ASHL_SOURCES}
-    SDK ${SWIFT_HOST_VARIANT_SDK}
-    ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
     LLVM_LINK_COMPONENTS ${ASHL_LLVM_LINK_COMPONENTS}
-    INSTALL_IN_COMPONENT "dev"
     )

   add_dependencies(dev ${name})


[cmake] Remove debug message.

[cmake] Remove debug message.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -88,8 +88,6 @@
       "-arch" "${CFLAGS_ARCH}"
       "-F" "${SWIFT_SDK_${CFLAGS_SDK}_PATH}/../../../Developer/Library/Frameworks"
       "-m${SWIFT_SDK_${CFLAGS_SDK}_VERSION_MIN_NAME}-version-min=${DEPLOYMENT_VERSION}")
-
-    message("SDK=${CFLAGS_SDK} + ARCH=${CFLAGS_ARCH} + DEPLOYMENT_VERSION=${DEPLOYMENT_VERSION} + INPUT_DEPLOYMENT_VERS_IOS=${CFLAGS_DEPLOYMENT_VERSION_IOS}")

     if(analyze_code_coverage)
       list(APPEND result "-fprofile-instr-generate"


CMake Xcode builds: symlink tblgen targets out to bin/.

Xcode always puts executable targets in the directory
bin/<Config>. When building separate LLVM and Clang projects for
Xcode, this prevents the CMake-configured project for Clang from
finding llvm-tblgen. Add a symlink so that tblgen executables are
always available in bin/ (regardless of the configuration LLVM is
built with).

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -85,6 +85,16 @@
   add_llvm_utility(${target} ${ARGN})
   set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS})

+  # For Xcode builds, symlink bin/<target> to bin/<Config>/<target> so that
+  # a separately-configured Clang project can still find llvm-tblgen.
+  if (XCODE)
+    add_custom_target(${target}-top ALL
+      ${CMAKE_COMMAND} -E create_symlink
+        ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}
+        ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}${CMAKE_EXECUTABLE_SUFFIX}
+      DEPENDS ${target})
+  endif ()
+
   set(${project}_TABLEGEN "${target}" CACHE
       STRING "Native TableGen executable. Saves building one when cross-compiling.")


cmake: cleanup

cmake: cleanup

Former-commit-id: a2cfb608195927ac431702b57ba2ccc86ddad75a

--- cmake/Modules/CMakeSofaBuildFlags.cmake
+++ cmake/Modules/CMakeSofaBuildFlags.cmake
@@ -1,7 +1,6 @@
 ## Set some default build flags when compiling a SOFA library.
 ## unless cmake is called with CMAKE_BUILD_TYPE=Debug, release build is forced
 if(NOT CMAKE_BUILD_TYPE)
-    #message(STATUS "No build type selected, default to Release")
     set(CMAKE_BUILD_TYPE "Release")
 endif()

@@ -27,18 +26,17 @@
         if("${GCXX_VERSION}" VERSION_EQUAL 4.6)
             set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-partial-inlining")
         endif()
-        set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
-        set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
+        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
+        set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
     endif()
 elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
 elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel")
 endif()

-set(compilerDefines ${GLOBAL_COMPILER_DEFINES})
+set(compilerDefines)

-# windows specific
 if(WIN32)
-    add_definitions( "-DUNICODE")
+    add_definitions("-DUNICODE")
     add_definitions("-wd4250 -wd4251 -wd4275 -wd4675 -wd4996 /bigobj")
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
 endif()
@@ -48,7 +46,7 @@
 endif()

 # NDEBUG preprocessor macro
-if (WIN32 OR APPLE)
+if(WIN32 OR APPLE)
     # NDEBUG and _DEBUG are automatically set in the default c/cxx flags of the right configurations
 elseif(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
     list(APPEND compilerDefines "NDEBUG")
@@ -60,11 +58,11 @@
 endif()

 # SOFA_DEBUG preprocessor macro
-if (WIN32 OR APPLE)
+if(WIN32 OR APPLE)
     # Reminder: multi-configuration generators like Visual Studio and XCode do not use CMAKE_BUILD_TYPE,
     # as they generate all configurations in the project, not just one at a time!
-    set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSOFA_DEBUG")
-    set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSOFA_DEBUG")
+    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSOFA_DEBUG")
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSOFA_DEBUG")
 elseif(CMAKE_BUILD_TYPE MATCHES "Debug")
     list(APPEND compilerDefines "SOFA_DEBUG")
 endif()
@@ -73,21 +71,21 @@
 if(SOFA-MISC_OPENMP)
     list(APPEND compilerDefines "USING_OMP_PRAGMAS")
     find_package(OpenMP QUIET)
-    if (OPENMP_FOUND)
-        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
-        set (CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} ${OpenMP_C_FLAGS}")
-        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-        set (CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} ${OpenMP_CXX_FLAGS}")
+    if(OPENMP_FOUND)
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+        set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} ${OpenMP_C_FLAGS}")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+        set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} ${OpenMP_CXX_FLAGS}")
     endif()
 endif()

 # SSE Flags on Win32
 if(SOFA-MISC_VECTORIZE)
     if(MSVC)
-	set(ARCH_FLAGS "/arch:SSE2 /fp:fast")
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAGS}")
-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_FLAGS}")
-    endif(MSVC)
+	    set(ARCH_FLAGS "/arch:SSE2 /fp:fast")
+	    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAGS}")
+	    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_FLAGS}")
+    endif()
 endif()


generate catkin environment not only when catkin is in workspace

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

   # buildspace
   set(SETUP_DIR ${catkin_BUILD_PREFIX})
-#  if(NOT MSVC)
+  if(NOT MSVC)
     # non-windows
     # generate env
     configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in
@@ -19,7 +19,7 @@
         ${catkin_BUILD_PREFIX}/setup.${shell})
     endforeach()

-#  else()
+  else()
     # windows
     # generate env
     configure_file(${catkin_EXTRAS_DIR}/templates/env.bat.in
@@ -29,53 +29,51 @@
       ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.buildspace.context.py
       ${catkin_EXTRAS_DIR}/em/setup.bat.em
       ${catkin_BUILD_PREFIX}/setup.bat)
-#  endif()
+  endif()

-  # only install when catkin is in workspace
-  if(catkin_SOURCE_DIR)
-    set(SETUP_DIR ${CMAKE_INSTALL_PREFIX})
-#    if(NOT MSVC)
-      # non-windows
-      # generate and install env
-      configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in
-        ${CMAKE_CURRENT_BINARY_DIR}/installspace/env.sh)
-      install(PROGRAMS
-        ${CMAKE_CURRENT_BINARY_DIR}/installspace/env.sh
+  # installspace
+  set(SETUP_DIR ${CMAKE_INSTALL_PREFIX})
+  if(NOT MSVC)
+    # non-windows
+    # generate and install env
+    configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in
+      ${CMAKE_CURRENT_BINARY_DIR}/installspace/env.sh)
+    install(PROGRAMS
+      ${CMAKE_CURRENT_BINARY_DIR}/installspace/env.sh
+      DESTINATION ${CMAKE_INSTALL_PREFIX})
+    # generate and install setup for various shells
+    set(CURRENT_WORKSPACE ${CMAKE_INSTALL_PREFIX})
+    em_expand(${catkin_EXTRAS_DIR}/templates/setup.context.py.in
+      ${CMAKE_CURRENT_BINARY_DIR}/setup.installspace.context.py
+      ${catkin_EXTRAS_DIR}/em/setup.sh.em
+      ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.sh)
+    install(FILES
+      ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.sh
+      DESTINATION ${CMAKE_INSTALL_PREFIX})
+    foreach(shell bash zsh)
+      configure_file(${catkin_EXTRAS_DIR}/templates/setup.${shell}.in
+        ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.${shell})
+      install(FILES
+        ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.${shell}
         DESTINATION ${CMAKE_INSTALL_PREFIX})
-      # generate and install setup
-      set(CURRENT_WORKSPACE ${CMAKE_INSTALL_PREFIX})
-      em_expand(${catkin_EXTRAS_DIR}/templates/setup.context.py.in
-        ${CMAKE_CURRENT_BINARY_DIR}/setup.installspace.context.py
-        ${catkin_EXTRAS_DIR}/em/setup.sh.em
-        ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.sh)
-      install(FILES
-        ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.sh
-        DESTINATION ${CMAKE_INSTALL_PREFIX})
-      foreach(shell bash zsh)
-        configure_file(${catkin_EXTRAS_DIR}/templates/setup.${shell}.in
-          ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.${shell})
-        install(FILES
-          ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.${shell}
-          DESTINATION ${CMAKE_INSTALL_PREFIX})
-      endforeach()
+    endforeach()

-#    else()
-      # windows
-      # generate and install env
-      configure_file(${catkin_EXTRAS_DIR}/templates/env.bat.in
-        ${CMAKE_CURRENT_BINARY_DIR}/installspace/env.bat)
-      install(PROGRAMS
-        ${CMAKE_CURRENT_BINARY_DIR}/installspace/env.bat
-        DESTINATION ${CMAKE_INSTALL_PREFIX})
-      # generate and install setup
-      em_expand(${catkin_EXTRAS_DIR}/templates/setup.context.py.in
-        ${CMAKE_CURRENT_BINARY_DIR}/setup.installspace.context.py
-        ${catkin_EXTRAS_DIR}/em/setup.bat.em
-        ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.bat)
-      install(FILES
-        ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.bat
-        DESTINATION ${CMAKE_INSTALL_PREFIX})
-#    endif()
+  else()
+    # windows
+    # generate and install env
+    configure_file(${catkin_EXTRAS_DIR}/templates/env.bat.in
+      ${CMAKE_CURRENT_BINARY_DIR}/installspace/env.bat)
+    install(PROGRAMS
+      ${CMAKE_CURRENT_BINARY_DIR}/installspace/env.bat
+      DESTINATION ${CMAKE_INSTALL_PREFIX})
+    # generate and install setup
+    em_expand(${catkin_EXTRAS_DIR}/templates/setup.context.py.in
+      ${CMAKE_CURRENT_BINARY_DIR}/setup.installspace.context.py
+      ${catkin_EXTRAS_DIR}/em/setup.bat.em
+      ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.bat)
+    install(FILES
+      ${CMAKE_CURRENT_BINARY_DIR}/installspace/setup.bat
+      DESTINATION ${CMAKE_INSTALL_PREFIX})
   endif()

   # XXX what is .rosinstall needed for?


[FIX] Scilab include directories are not found under linux/Ubuntu

git-svn-id: ed06c97986a68fa016311908f99ed1538fbb9b5d@254 93be6e1e-6fcc-11de-baec-69240fdc299a

--- CMake/FindScilab.cmake
+++ CMake/FindScilab.cmake
@@ -1,13 +1,5 @@
 # - Try to find a version of Scilab and headers/library required by the
 #   used compiler.
-#
-# For Windows, this module detects a Matlab's version between Matlab 7.0
-# (R14) and Matlab 7.9 (r2009b).
-# The MacOS X part of this module detect if a Matlab version exist based on the
-# name of the applications in /Applications.
-# The Linux part of this module doesn't detect the Matlab version. To use it,
-# it is necessary to set the SCILAB_ROOT with the path of the Matlab
-# installation.
 #
 # This module defines:
 #  SCILAB_ROOT: Scilab installation path
@@ -32,54 +24,63 @@
   # LIBMEX, LIBMX names
   SET(LIBMEX "libmex.dll")
   SET(LIBMX "libmx.dll")
+  SET(LIBSCILAB "LibScilab")
 ELSEIF(APPLE)
   FILE(GLOB SCILAB_PATHS "/Applications/Scilab*")
   SET(LIBMEX "libmex.dylib")
   SET(LIBMX "libmx.dylib")
+  SET(LIBSCILAB "scilab")
 ELSE(WIN32)
   SET(SCILAB_PATHS
     "/usr/share/scilab"
     "/usr/local/share/scilab"
     "/opt/local/share/scilab")
-  SET(SCILAB_MODULE_PATH
+  SET(SCILAB_MODULE_PATHS
     "/usr/include/scilab"
     "/usr/local/include/scilab"
     "/opt/local/include/scilab")
-  SET(SCILAB_LIBRARIES_PATH
+  SET(SCILAB_LIBRARIES_PATHS
     "/usr/lib/scilab"
     "/usr/local/lib/scilab"
     "/opt/local/lib/scilab")
+  SET(SCILAB_MODULES_MEXLIB_PATHS
+    "/usr/include/scilab/mexlib"
+    "/usr/local/include/scilab/mexlib"
+    "/opt/local/include/scilab/mexlib")
+  SET(SCILAB_MODULES_CORE_PATHS
+    "/usr/include/scilab/core"
+    "/usr/local/include/scilab/core"
+    "/opt/local/include/scilab/core")
   SET(LIBMEX "libmex.so")
   SET(LIBMX "libmx.so")
+  SET(LIBSCILAB "scilab")
 ENDIF(WIN32)

 FIND_PATH(SCILAB_ROOT "etc/scilab.start" ${SCILAB_PATHS})

 IF(WIN32 OR APPLE)
   FIND_PATH(SCILAB_ROOT "etc/scilab.start" ${SCILAB_PATHS})
-  SET(SCILAB_MODULE_PATH "${SCILAB_ROOT}/modules")
-  SET(SCILAB_LIBRARIES_PATH "${SCILAB_ROOT}/bin")
+  SET(SCILAB_MODULE_PATHS "${SCILAB_ROOT}/modules")
+  SET(SCILAB_LIBRARIES_PATHS "${SCILAB_ROOT}/bin")
+  SET(SCILAB_MODULES_MEXLIB_PATHS "${SCILAB_MODULE_PATHS}/mexlib/includes")
+  SET(SCILAB_MODULES_CORE_PATHS "${SCILAB_MODULE_PATHS}/core/includes")
 ENDIF(WIN32 OR APPLE)

 FIND_LIBRARY(SCILAB_IMPL_LIBRARY
-    "LibScilab"
-    ${SCILAB_LIBRARIES_PATH} NO_DEFAULT_PATH
-    )
+    ${LIBSCILAB}
+    ${SCILAB_LIBRARIES_PATHS} NO_DEFAULT_PATH)
 FIND_FILE(SCILAB_MEX_LIBRARY
     ${LIBMEX}
-    ${SCILAB_LIBRARIES_PATH} NO_DEFAULT_PATH
-    )
+    ${SCILAB_LIBRARIES_PATHS} NO_DEFAULT_PATH)
 FIND_FILE(SCILAB_MX_LIBRARY
     ${LIBMX}
-    ${SCILAB_LIBRARIES_PATH} NO_DEFAULT_PATH
-    )
+    ${SCILAB_LIBRARIES_PATHS} NO_DEFAULT_PATH)
 FIND_PATH(SCILAB_MEX_INCLUDE_DIR
     "mex.h"
-    "${SCILAB_MODULE_PATH}/mexlib/includes" NO_DEFAULT_PATH
-    )
+    ${SCILAB_MODULES_MEXLIB_PATHS} NO_DEFAULT_PATH)
 FIND_PATH(SCILAB_CORE_INCLUDE_DIR
     "core_math.h"
-    "${SCILAB_MODULE_PATH}/core/includes" NO_DEFAULT_PATH
+    ${SCILAB_MODULES_CORE_PATHS} NO_DEFAULT_PATH
     )

 SET(SCILAB_LIBRARIES
@@ -100,4 +101,4 @@
   SCILAB_LIBRARIES
   SCILAB_MEX_INCLUDE_DIR
   SCILAB_CORE_INCLUDE_DIR
-)+)


Don't truncate output for CTest.

Don't truncate output for CTest.

--- examples/plugin/selfcontained_test.cmake
+++ examples/plugin/selfcontained_test.cmake
@@ -13,6 +13,9 @@
     endif()
 endmacro()

+# Avoid truncating output.
+message(STATUS "CTEST_FULL_OUTPUT")
+
 message(STATUS "Clearing build...")
 execute_process(COMMAND "${CMAKE_COMMAND}" -E remove_directory "${DIR}")
 execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${DIR}")


last version almost working, trying to managed both binary and source dependencies...

--- dist/WkBuild.cmake
+++ dist/WkBuild.cmake
@@ -119,6 +119,11 @@
 	#Generating config file
 	file( WRITE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "### Config file for ${PROJECT_NAME} auto generated by WkCmake ###

+IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
+   MESSAGE(FATAL_ERROR "CMake >= 2.6.0 required")
+ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
+CMAKE_POLICY(PUSH)
+CMAKE_POLICY(VERSION 2.6)
 ### First section : Main target ###

 get_filename_component(SELF_DIR \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)
@@ -130,7 +135,9 @@

 	file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "
 #however we still want to have ${PROJECT_NAME}_LIBRARIES available
-set(${PROJECT_NAME}_LIBRARY ${PROJECT_NAME})
+#getting full path for the library,
+get_target_property(${PROJECT_NAME}_IMPORTED_IMPLIB ${PROJECT_NAME} IMPORTED_IMPLIB)
+set(${PROJECT_NAME}_LIBRARY \${${PROJECT_NAME}_IMPORTED_IMPLIB})
 set(${PROJECT_NAME}_LIBRARIES \${${PROJECT_NAME}_LIBRARY})
 	" )

@@ -152,9 +159,8 @@
 	")

 	foreach( looparg ${${PROJECT_NAME}_source_depends} )
-		# TODO better : linked ot the include copy in the binary dir...
 		file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "
-get_filename_component(${looparg}_INCLUDE_DIR \"\${SELF_DIR}/ext/${looparg}/include\" ABSOLUTE)
+get_filename_component(${looparg}_INCLUDE_DIR \"\${PROJECT_BINARY_DIR}/ext/${looparg}_build/include\" ABSOLUTE)
 set(${PROJECT_NAME}_INCLUDE_DIRS \${${PROJECT_NAME}_INCLUDE_DIRS} \${${looparg}_INCLUDE_DIR})
 		")

@@ -171,13 +177,17 @@

 	foreach( looparg ${${PROJECT_NAME}_source_depends} )
-		#get_target_property(${looparg}_IMPLIB ${looparg}_IMPLIB)
 		file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "
-set(${looparg}_LIBRARY ${looparg} ) #\${${looparg}_IMPLIB})
-set(${looparg}_LIBRARIES \${${looparg}_LIBRARIES} ${looparg} ) #\${${looparg}_LIBRARY})
+		#This is fine because we know the dependency target, and it will be exported along with the main target
+set(${looparg}_LIBRARY ${looparg})
+set(${looparg}_LIBRARIES \${${looparg}_LIBRARIES} \${${looparg}_LIBRARY})
 		")

 	endforeach( looparg ${${PROJECT_NAME}_source_depends} )
+
+	file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "
+CMAKE_POLICY(POP)
+	")

 endmacro ( WkGenConfig )

@@ -287,11 +297,18 @@
 	MERGE("${HEADERS}" "${SOURCES}" SOURCES)
 	#MESSAGE ( STATUS "Sources : ${SOURCES}" )

+	#
+	# Handling my own build config
+	#
+
 	if(${project_type} STREQUAL "LIBRARY")
 		add_library(${PROJECT_NAME} ${${PROJECT_NAME}_load_type} ${SOURCES})
+		set( ${PROJECT_NAME}_LIBRARIES ${PROJECT_NAME} CACHE INTERNAL " libraries needed for ${target_name} " )
 		if ( ${PROJECT_NAME}_load_type )
 		if(${${PROJECT_NAME}_load_type} STREQUAL "SHARED")
 			set_target_properties(${PROJECT_NAME} PROPERTIES DEFINE_SYMBOL "WK_SHAREDLIB_BUILD")
+			get_target_property(${PROJECT_NAME}_LOCATION ${PROJECT_NAME} LOCATION)
+			set( ${PROJECT_NAME}_RUN_LIBRARIES ${${PROJECT_NAME}_LOCATION} CACHE INTERNAL " libraries needed to run ${target_name} " )
 		endif(${${PROJECT_NAME}_load_type} STREQUAL "SHARED")
 		endif (${PROJECT_NAME}_load_type)
 	elseif (${project_type} STREQUAL "EXECUTABLE")
@@ -313,6 +330,9 @@
 		WkRunLibraries( ${PROJECT_NAME} ${${package_name}_RUN_LIBRARIES} )
 		message ( STATUS " ${PROJECT_NAME} Now running with ${${looparg}_RUN_LIBRARIES} ")
 	endforeach ( looparg ${${PROJECT_NAME}_source_depends} )
+
+
+

 	#
 	# Defining where to put what has been built


ARROW-563: Support non-standard gcc version strings

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #343 from xhochy/ARROW-563 and squashes the following commits:

64d1c93 [Uwe L. Korn] ARROW-563: Support non-standard gcc version strings

--- cpp/cmake_modules/CompilerInfo.cmake
+++ cpp/cmake_modules/CompilerInfo.cmake
@@ -21,6 +21,7 @@
                 ERROR_VARIABLE COMPILER_VERSION_FULL)
 message(INFO " ${COMPILER_VERSION_FULL}")
 message(INFO " ${CMAKE_CXX_COMPILER_ID}")
+string(TOLOWER "${COMPILER_VERSION_FULL}" COMPILER_VERSION_FULL_LOWER)

 if(MSVC)
   set(COMPILER_FAMILY "msvc")
@@ -53,10 +54,10 @@
   set(COMPILER_VERSION "3.8.0svn")

 # gcc
-elseif("${COMPILER_VERSION_FULL}" MATCHES ".*gcc version.*")
+elseif("${COMPILER_VERSION_FULL_LOWER}" MATCHES ".*gcc[ -]version.*")
   set(COMPILER_FAMILY "gcc")
-  string(REGEX REPLACE ".*gcc version ([0-9\\.]+).*" "\\1"
-    COMPILER_VERSION "${COMPILER_VERSION_FULL}")
+  string(REGEX REPLACE ".*gcc[ -]version ([0-9\\.]+).*" "\\1"
+      COMPILER_VERSION "${COMPILER_VERSION_FULL_LOWER}")
 else()
   message(FATAL_ERROR "Unknown compiler. Version info:\n${COMPILER_VERSION_FULL}")
 endif()


Fix for ROOT-6628

Fix for ROOT-6628

--- etc/cmake/FindROOT.cmake
+++ etc/cmake/FindROOT.cmake
@@ -69,13 +69,11 @@
   #---Get the list of header files-------------------------
   set(headerfiles)
   foreach(fp ${ARG_UNPARSED_ARGUMENTS})
-    file(GLOB files ${fp})
-    if(files)
+    if(${fp} MATCHES "[*?]") # Is this header a globbing expression?
+      file(GLOB files ${fp})
       foreach(f ${files})
-        if(NOT f MATCHES LinkDef)
-          find_file(headerFile ${f} PATHS ${incdirs})
-          set(headerfiles ${headerfiles} ${headerFile})
-          unset(headerFile CACHE)
+        if(NOT f MATCHES LinkDef) # skip LinkDefs from globbing result
+          set(headerfiles ${headerfiles} ${f})
         endif()
       endforeach()
     else()


qi_create_module -> qi_create_service.

qi_create_module -> qi_create_service.

Change-Id: Id11bbdb13f06e1e53c35412f437bc2769c0bb7d4
Reviewed-on: http://gerrit.aldebaran.lan:8080/13170
Reviewed-by: cgestes <ddb78fe00abb42f91254c16a0860e38eb0781789@aldebaran-robotics.com>
Reviewed-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>
Tested-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>

--- codegen/src/idl-config.cmake
+++ codegen/src/idl-config.cmake
@@ -1,7 +1,7 @@

-qi_global_set(qi_create_module_file ${CMAKE_CURRENT_LIST_FILE})
-
-#! Create a naoqi module
+qi_global_set(qi_create_service_file ${CMAKE_CURRENT_LIST_FILE})
+
+#! Create a naoqi service and companion files
 # \group:CLASSES list of class names to be exposed to naoqi as objects
 # \group:SERVICES list of class names to be exposed to naoqi as services
 # \group:INCLUDE files to #include in generated files
@@ -10,16 +10,15 @@
 # \param:IDL the IDL file to use as input
 # \param:PROXY generate specialized proxy header and install them
 # \param:SPLIT_BIND generate binding code in a separate file per class
-function(qi_create_module name)
-  message("qi_create_module: ${ARGN}")
+function(qi_create_service name)
   cmake_parse_arguments(ARG
     "NOBINDLL;NO_INSTALL;NO_FPIC;SHARED;STATIC;INTERNAL;PROXY;SPLIT_BIND"
     "SUBFOLDER;IDL"
     "SRC;DOXYSRC;SUBMODULE;DEPENDS;CLASSES;SERVICES;INCLUDE;INCLUDE_SERVICE" ${ARGN})
   message("parsing args: ${ARG_CLASSES}")
   #First, locate idl.py
-  qi_global_get(qi_create_module_file_local qi_create_module_file)
-  get_filename_component(cdir "${qi_create_module_file_local}" PATH)
+  qi_global_get(qi_create_service_file_local qi_create_service_file)
+  get_filename_component(cdir "${qi_create_service_file_local}" PATH)
   find_program(_python_executable
     NAMES python2 python python.exe
     NO_CMAKE_FIND_ROOT_PATH)


idl-config: remove qi_create_service.

idl-config: remove qi_create_service.

Tries to do too many things at the same time.

Change-Id: I05f3f69aff04566a4d364d4f2fbc1bcde3dd4124
Reviewed-on: http://gerrit.aldebaran.lan:8080/17316
Reviewed-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>
Tested-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>

--- codegen/src/idl-config.cmake
+++ codegen/src/idl-config.cmake
@@ -139,189 +139,3 @@
   qi_persistent_set(${files} "${names}")
 endfunction()

-#! Create a naoqi service and companion files
-# \group:CLASSES list of class names to be exposed to naoqi as objects
-# \group:SERVICES list of class names to be exposed to naoqi as services
-# \group:INCLUDE files to #include in generated files
-# \group:INCLUDE_SERVICE files to #include in generated files
-# \group:DOXYSRC sources to pass to doxygen, but not to compile
-# \param:IDL the IDL file to use as input
-# \param:PROXY generate specialized proxy header and install them
-# \param:SPLIT_BIND generate binding code in a separate file per class
-function(qi_create_service name)
-  cmake_parse_arguments(ARG
-    "NOBINDLL;NO_INSTALL;NO_FPIC;SHARED;STATIC;INTERNAL;PROXY;SPLIT_BIND"
-    "SUBFOLDER;IDL"
-    "SRC;DOXYSRC;SUBMODULE;DEPENDS;CLASSES;SERVICES;INCLUDE;INCLUDE_SERVICE" ${ARGN})
-  message("parsing args: ${ARG_CLASSES}")
-  #First, locate idl.py
-  _qi_find_idl(IDLPY)
-  #ARGN are sources too
-  set(ARG_SRC ${ARG_UNPARSED_ARGUMENTS} ${ARG_SRC})
-  #Reformat arguments to be able to bounce them
-  if (ARG_NO_INSTALL)
-    set(ARGOPT_NO_INSTALL NO_INSTALL)
-  endif()
-  if (ARG_NO_FPIC)
-    set(ARGOPT_NO_FPIC NO_FPIC)
-  endif()
-  if (ARG_SHARED)
-    set(ARGOPT_SHARED SHARED)
-  endif()
-  if (ARG_STATIC)
-    set(ARGOPT_STATIC STATIC)
-  endif()
-  if (ARG_INTERNAL)
-    set(ARGOPT_INTERNAL INTERNAL)
-  endif()
-  if ("${ARG_HEADERS}" STREQUAL "")
-    set(ARG_HEADERS ${ARG_SRC})
-  endif()
-  if ("${ARG_IDL}" STREQUAL "")
-    # no IDL specified, generate it from sources and classes
-    # or do nothing, will be generated at each call
-    set(IDL ${ARG_SRC} ${ARG_DOXYSRC})
-  else()
-    set(IDL ${ARG_IDL})
-  endif()
-  set(classes '')
-  foreach(c ${ARG_SERVICES})
-    set(classes "${classes},${c}")
-  endforeach()
-  foreach(c ${ARG_CLASSES})
-    set(classes "${classes},${c}")
-  endforeach()
-  if (classes)
-    set(kclasses "-k ${classes}")
-  endif()
-  if (classes)
-    set(classes "-c ${classes}")
-  endif()
-  message("input classes: ${ARG_SERVICES} ${ARG_CLASSES}")
-  message("classes: '${classes}'")
-
-  # Generate comma separated includes for the various cases
-  #  user includes
-  foreach(inc ${ARG_INCLUDE})
-    set(includes "${includes},${inc}")
-  endforeach()
-  #  user includes plus generated interface
-  set(includesiface "${includes},${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp")
-  #  service includes
-  foreach(inc ${ARG_INCLUDE_SERVICE})
-    set(service_includes "${service_includes},${inc}")
-  endforeach()
-  if (NOT service_includes)
-    set(service_includes "${includes}")
-  endif()
-  set(service_includes "${service_includes},${CMAKE_CURRENT_BINARY_DIR}/${name}_interface.hpp")
-
-
-  # Generate proxy if asked to
-  if (ARG_PROXY)
-    qi_generate_src(
-      ${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp
-      SRC ${ARG_SRC} ${ARG_DOXYSRC} ${IDL}
-      COMMAND ${_python_executable} ${IDLPY}
-        ${IDL}
-        "${classes}"
-        -m proxyFuture --interface
-        ${kclasses}
-        -I ${includes}
-        -o ${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp
-    )
-    list(APPEND ARG_SRC ${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp)
-    set(service_includes "${service_includes},${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp")
-    set(includes "${includes},${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp")
-  endif()
-  # Generate binder
-  # Build command argument from classes and modules
-  # Put classes before services, most likely there is a dependency
-  # in this order
-
-  set(bindname ${name}_bind.cpp)
-  set(bindtarget ${bindname})
-  if (ARG_SPLIT_BIND)
-    foreach(c ${ARG_SERVICES})
-       string(TOLOWER ${c} cl)
-       qi_generate_src(
-       ${CMAKE_CURRENT_BINARY_DIR}/${cl}_bind.cpp
-       SRC ${ARG_SRC} ${ARG_DOXYSRC} ${IDL}
-       COMMAND ${_python_executable} ${IDLPY}
-         ${IDL}
-         ${kclasses}
-         -m cxxservicebouncerregister --interface
-         -c ${c}:cxxservicebouncerregister
-         -o ${CMAKE_CURRENT_BINARY_DIR}/${cl}_bind.cpp
-         -I "${service_includes}"
-      )
-    endforeach(c)
-    foreach(c ${ARG_CLASSES})
-      message("Generating bind for ${c}")
-      string(TOLOWER ${c} cl)
-      qi_generate_src(
-      ${CMAKE_CURRENT_BINARY_DIR}/${cl}_bind.cpp
-      SRC ${ARG_SRC} ${ARG_DOXYSRC} ${IDL}
-      COMMAND ${_python_executable} ${IDLPY}
-        ${IDL}
-        ${kclasses}
-        -m cxxservicebouncerregister --interface
-        -c ${c}:cxxservicebouncer
-        -o ${CMAKE_CURRENT_BINARY_DIR}/${cl}_bind.cpp
-        -I "${service_includes}"
-      )
-    endforeach(c)
-  else()
-    message("Generating merged bind")
-    set (carg '')
-    foreach(class ${ARG_CLASSES})
-      set(carg "${carg},${class}:cxxservicebouncer")
-    endforeach()
-    foreach(module ${ARG_SERVICES})
-      set(carg "${carg},${module}:cxxservicebouncerregister")
-    endforeach(module)
-    if (carg)
-      set(carg "-c ${carg}")
-    endif()
-    message("carg: '${carg}'")
-    qi_generate_src(
-       ${CMAKE_CURRENT_BINARY_DIR}/${name}_bind.cpp
-       SRC ${ARG_SRC} ${ARG_DOXYSRC} ${IDL}
-       COMMAND ${_python_executable} ${IDLPY}
-         ${IDL}
-         ${kclasses}
-         -m cxxservicebouncerregister --interface
-         "${carg}"
-         -o ${CMAKE_CURRENT_BINARY_DIR}/${name}_bind.cpp
-         -I "${service_includes}"
-    )
-    set(ARG_SRC ${CMAKE_CURRENT_BINARY_DIR}/${name}_bind.cpp ${ARG_SRC})
-  endif()
-  # Generate interface
-  qi_generate_src(
-     ${CMAKE_CURRENT_BINARY_DIR}/${name}_interface.hpp
-     SRC ${ARG_SRC} ${ARG_DOXYSRC} ${IDL}
-     COMMAND ${_python_executable} ${IDLPY}
-       ${IDL}
-       ${classes}
-       ${kclasses}
-       -m interface --interface
-       -o ${CMAKE_CURRENT_BINARY_DIR}/${name}_interface.hpp
-       -I "${includes}"
-  )
-  # Add interface (or it wont be generated) to sources
-  set(ARG_SRC ${CMAKE_CURRENT_BINARY_DIR}/${name}_interface.hpp ${ARG_SRC})
-  #invoke qi_create_lib
-  qi_create_lib(${name}
-    "${ARGVAL_SUBFOLDER}"
-    "${ARGOPT_NO_BINDLL}"
-    "${ARGOPT_NO_INSTALL}"
-    "${ARGOPT_NO_FPIC}"
-    "${ARGOPT_SHARED}"
-    "${ARGOPT_STATIC}"
-    "${ARGOPT_INTERNAL}"
-    SRC ${ARG_SRC}
-    SUBMODULE ${ARG_SUBMODULE}
-    DEPENDS ${ARG_DEPENDS}
-  )
-endfunction()


ORC-227: Fix ExternalProject_Add parameter order for older cmakes.

Fixes #155

Signed-off-by: Owen O'Malley <54ea18af6a9d2f71f251392755b45ef039a9facd@apache.org>

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -52,11 +52,11 @@

 ExternalProject_Add (zlib_ep
   URL ${ZLIB_SRC_URL}
-  BUILD_BYPRODUCTS "${ZLIB_STATIC_LIB}"
   LOG_DOWNLOAD 1
   LOG_CONFIGURE 1
   LOG_BUILD 1
   LOG_INSTALL 1
+  BUILD_BYPRODUCTS "${ZLIB_STATIC_LIB}"
   CMAKE_ARGS ${ZLIB_CMAKE_ARGS})

 include_directories (SYSTEM ${ZLIB_INCLUDE_DIRS})


Tell user when build type defaults to debug.

--- cmake/ConfigSafeGuards.cmake
+++ cmake/ConfigSafeGuards.cmake
@@ -1,11 +1,11 @@
-
 # guard against in-source builds
 if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
     message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
 endif()

 # guard against bad build-type strings
-if(NOT CMAKE_BUILD_TYPE)
+if (NOT CMAKE_BUILD_TYPE)
+    message(STATUS "No build type selected, default to Debug")
     set(CMAKE_BUILD_TYPE "Debug")
 endif()


Remove -Wshadow - no thanks

Remove -Wshadow - no thanks

--- cmake/DefineBuildFlags.cmake
+++ cmake/DefineBuildFlags.cmake
@@ -62,7 +62,7 @@
     # strerror_r, fdopen and strcasecmp etc. (their declarations in system headers are between ifdef)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U__STRICT_ANSI__")
 elseif(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wno-unused-parameter -Woverloaded-virtual -Wshadow")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wno-unused-parameter -Woverloaded-virtual")
     if(CMAKE_BUILD_TYPE STREQUAL "Debug")
         # These enable some debug options in g++'s STL, e.g. invalid use of iterators
         # But they cause crashes on cygwin while loading modules


included boolean if root version newer than v.6.08 in FindROOT

--- cmake/Modules/FindROOT.cmake
+++ cmake/Modules/FindROOT.cmake
@@ -21,6 +21,8 @@
 SET(ROOT_DEFINITIONS "")

 SET(ROOT_INSTALLED_VERSION_TOO_OLD FALSE)
+
+SET(ROOT_INSTALLED_VERSION_TOO_NEW FALSE)

 SET(ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND)

@@ -52,11 +54,20 @@
   IF (NOT ROOT_MIN_VERSION)
     SET(ROOT_MIN_VERSION "5.00/00")
   ENDIF (NOT ROOT_MIN_VERSION)
+
+  # from 6.08/00 on now backward compatibility for TMVA anymore
+  IF (NOT ROOT_MAX_VERSION)
+    SET(ROOT_MAX_VERSION "6.07/00")
+  ENDIF (NOT ROOT_MAX_VERSION)

   # now parse the parts of the user given version string into variables
   STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" req_root_major_vers "${ROOT_MIN_VERSION}")
   STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" req_root_minor_vers "${ROOT_MIN_VERSION}")
   STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" req_root_patch_vers "${ROOT_MIN_VERSION}")
+
+  STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" max_root_major_vers "${ROOT_MAX_VERSION}")
+  STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" max_root_minor_vers "${ROOT_MAX_VERSION}")
+  STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" max_root_patch_vers "${ROOT_MAX_VERSION}")

   # and now the version string given by qmake
   STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}")
@@ -69,6 +80,7 @@

   # compute an overall version number which can be compared at once
   MATH(EXPR req_vers "${req_root_major_vers}*10000 + ${req_root_minor_vers}*100 + ${req_root_patch_vers}")
+  MATH(EXPR max_vers "${max_root_major_vers}*10000 + ${max_root_minor_vers}*100 + ${max_root_patch_vers}")
   MATH(EXPR found_vers "${found_root_major_vers}*10000 + ${found_root_minor_vers}*100 + ${found_root_patch_vers}")

   IF (found_vers LESS req_vers)
@@ -77,6 +89,11 @@
   ELSE (found_vers LESS req_vers)
     SET(ROOT_FOUND TRUE)
   ENDIF (found_vers LESS req_vers)
+
+  IF (max_vers LESS found_vers)
+    MESSAGE("Current ROOT version \"${ROOTVERSION}\" is newer than 6.07/00, TMVA works differently now")
+    SET(ROOT_INSTALLED_VERSION_TOO_NEW TRUE)
+  ENDIF (max_vers LESS found_vers)

 ENDIF (ROOT_CONFIG_EXECUTABLE)