[OGRE-133] GL3Plus RenderSystem is missing from FindOGRE.cmake

--HG--
branch : v1-9

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -28,7 +28,9 @@
 #  Plugin_BSPSceneManager, Plugin_CgProgramManager,
 #  Plugin_OctreeSceneManager, Plugin_OctreeZone,
 #  Plugin_ParticleFX, Plugin_PCZSceneManager,
-#  RenderSystem_GL, RenderSystem_Direct3D9,
+#  RenderSystem_GL, RenderSystem_GL3Plus,
+#  RenderSystem_GLES, RenderSystem_GLES2,
+#  RenderSystem_Direct3D9, RenderSystem_Direct3D11
 #  Paging, Terrain, Volume, Overlay
 #
 # For each of these components, the following variables are defined:
@@ -130,7 +132,7 @@
 set(OGRE_COMPONENTS Paging Terrain Volume Overlay
   Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager
   Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX
-  RenderSystem_Direct3D11 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GLES RenderSystem_GLES2)
+  RenderSystem_Direct3D11 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GL3Plus RenderSystem_GLES RenderSystem_GLES2)
 set(OGRE_RESET_VARS
   OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR
   OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG
@@ -472,6 +474,7 @@
 ogre_find_plugin(Plugin_OctreeSceneManager OgreOctreeSceneManager.h PlugIns/OctreeSceneManager/include)
 ogre_find_plugin(Plugin_ParticleFX OgreParticleFXPrerequisites.h PlugIns/ParticleFX/include)
 ogre_find_plugin(RenderSystem_GL OgreGLRenderSystem.h RenderSystems/GL/include)
+ogre_find_plugin(RenderSystem_GL3Plus OgreGL3PlusRenderSystem.h RenderSystems/GL3Plus/include)
 ogre_find_plugin(RenderSystem_GLES OgreGLESRenderSystem.h RenderSystems/GLES/include)
 ogre_find_plugin(RenderSystem_GLES2 OgreGLES2RenderSystem.h RenderSystems/GLES2/include)
 ogre_find_plugin(RenderSystem_Direct3D9 OgreD3D9RenderSystem.h RenderSystems/Direct3D9/include)
@@ -488,6 +491,9 @@
   if (NOT OPENGL_FOUND)
     set(OGRE_RenderSystem_GL_FOUND FALSE)
   endif ()
+  if (NOT OPENGL_FOUND)
+    set(OGRE_RenderSystem_GL3Plus_FOUND FALSE)
+  endif ()
   if (NOT OPENGLES_FOUND)
     set(OGRE_RenderSystem_GLES_FOUND FALSE)
   endif ()
@@ -506,6 +512,9 @@
     ${DirectX_D3D11_LIBRARIES}
   )
   set(OGRE_RenderSystem_GL_LIBRARIES ${OGRE_RenderSystem_GL_LIBRARIES}
+    ${OPENGL_LIBRARIES}
+  )
+  set(OGRE_RenderSystem_GL3Plus_LIBRARIES ${OGRE_RenderSystem_GL3Plus_LIBRARIES}
     ${OPENGL_LIBRARIES}
   )
   set(OGRE_RenderSystem_GLES_LIBRARIES ${OGRE_RenderSystem_GLES_LIBRARIES}


changed the revision tag for the testing-data

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -12,8 +12,8 @@
 set(MITK-Data_DEPENDS ${proj})

 if(BUILD_TESTING)
-  set(revision_tag b89a01b5)
-#                 ^^^^^^^^  these are just to check correct length of hash part
+  set(revision_tag acedec01)
+#                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}
     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/MITK-Data_${revision_tag}.tar.gz


Add a module dependency on EP_MITK

Add a module dependency on EP_MITK

--- CMake/mitkMacroCreateModule.cmake
+++ CMake/mitkMacroCreateModule.cmake
@@ -130,6 +130,9 @@

         ENDIF(NOT MODULE_QT_MODULE)

+        IF(NOT MODULE_HEADERS_ONLY AND TARGET EP_MITK)
+          ADD_DEPENDENCIES(${MODULE_PROVIDES} EP_MITK)
+        ENDIF()

         # install only if shared lib (for now)
         IF(NOT _STATIC OR MINGW)


change freetype build script to build shared libs

This also bumps up the freetype version to VER-2-7-1 in
build_freetype.cmake script.

--- CMakeModules/build_freetype.cmake
+++ CMakeModules/build_freetype.cmake
@@ -1,7 +1,15 @@
 INCLUDE(ExternalProject)

 SET(prefix ${PROJECT_BINARY_DIR}/third_party/ft)
-SET(freetype_location ${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}freetype${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+SET(LIB_POSTFIX "")
+IF (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+    SET(LIB_POSTFIX "d")
+ENDIF()
+
+SET(freetype_location
+    ${prefix}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}freetype${LIB_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
+
 IF(CMAKE_VERSION VERSION_LESS 3.2)
     IF(CMAKE_GENERATOR MATCHES "Ninja")
         MESSAGE(WARNING "Building freetype with Ninja has known issues with CMake older than 3.2")
@@ -20,8 +28,9 @@
 ExternalProject_Add(
     ft-ext
     GIT_REPOSITORY http://git.sv.nongnu.org/r/freetype/freetype2.git
-    GIT_TAG 14df6b1a63f5c5773bb498063205cb79aac21173
+    GIT_TAG VER-2-7-1
     PREFIX "${prefix}"
+    INSTALL_DIR "${prefix}"
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${CMAKE_COMMAND} -Wno-dev "-G${CMAKE_GENERATOR}" <SOURCE_DIR>
     -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
@@ -29,15 +38,17 @@
     -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
     -DCMAKE_C_FLAGS:STRING=${CFLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-    -DCMAKE_INSTALL_PREFIX:STRING=${prefix}
+    -DBUILD_SHARED_LIBS:BOOL=ON
+    -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
     ${byproducts}
     )

-ADD_LIBRARY(freetype IMPORTED STATIC)
-SET(freetype_location ${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}freetype${CMAKE_STATIC_LIBRARY_SUFFIX})
+ADD_LIBRARY(freetype IMPORTED SHARED)
+
+ExternalProject_Get_Property(ft-ext install_dir)
+
 SET_TARGET_PROPERTIES(freetype PROPERTIES IMPORTED_LOCATION ${freetype_location})
-ADD_DEPENDENCIES(freetype ft-ext)

-SET(FREETYPE_INCLUDE_DIRS ${prefix}/include/freetype2)
-SET(FREETYPE_LIBRARIES freetype)
-SET(FREETYPE_FOUND ON)
+SET(FREETYPE_INCLUDE_DIRS "${install_dir}/include/freetype2" CACHE INTERNAL "" FORCE)
+SET(FREETYPE_LIBRARIES ${freetype_location} CACHE INTERNAL "" FORCE)
+SET(FREETYPE_FOUND ON CACHE INTERNAL "" FORCE)


Disable DEBUG_TRACE in CivetWeb target.

Disable DEBUG_TRACE in CivetWeb target.

--- external/External.cmake
+++ external/External.cmake
@@ -647,7 +647,7 @@
             SOURCE_DIR "${civetweb_EXT_SOURCE_DIR}"
             CMAKE_ARGS "-DCMAKE_MACOSX_RPATH=${CMAKE_MACOSX_RPATH}"
                        "-DBUILD_SHARED_LIBS=OFF"
-                       "-DCMAKE_C_FLAGS=${EXT_C_FLAGS} -I${ressl_EXT_INCLUDE_DIR}"
+                       "-DCMAKE_C_FLAGS=${EXT_C_FLAGS} -I${ressl_EXT_INCLUDE_DIR} -D'DEBUG_TRACE(...)='"
                        "-DCMAKE_CXX_FLAGS=${EXT_CXX_FLAGS}"
                        "-DCMAKE_BUILD_TYPE=${EXT_BUILD_TYPE}"
                        "-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR}"


COMP: Update ITKSetStrandardCompilerFlags removing unneeded variables and options

Removes setting of unused variables:
 ITK_CXX_DISABLE_OPTIMIZATION_FLAG
 ITK_LIBRARY_BUILD_TYPE
 ITK_REQUIRED_C_FLAGS
 ITK_REQUIRED_CXX_FLAGS
 ITK_REQUIRED_LINK_FLAGS
 ITK_USE_64BITS_APPLE_TRUNCATION_WARNING

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -180,102 +180,8 @@
         set(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import")
       endif()
     else()
-      if(BUILD_SHARED_LIBS)
-        set(ITK_LIBRARY_BUILD_TYPE "SHARED")
-      else()
-        set(ITK_LIBRARY_BUILD_TYPE "STATIC")
-      endif()
       set(BUILD_SHARED_LIBS OFF)
     endif()
-  endif()
-  #-----------------------------------------------------------------------------
-  #ITK requires special compiler flags on some platforms.
-  if(CMAKE_COMPILER_IS_GNUCXX)
-   if(APPLE)
-     option(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING "Turn on warnings on 64bits to 32bits truncations." OFF)
-     mark_as_advanced(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING)
-
-     execute_process(COMMAND "${CMAKE_C_COMPILER}" --version
-       OUTPUT_VARIABLE _version ERROR_VARIABLE _version)
-
-     # -fopenmp breaks compiling the HDF5 library in shared library mode
-     # on the OS X platform -- at least with gcc 4.2 from Xcode.
-     set(compile_flag_lists CMAKE_C_FLAGS CMAKE_CXX_FLAGS
-       CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL
-       CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
-       CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL
-       CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO)
-     foreach(listname ${compile_flag_lists})
-       if("${${listname}}" MATCHES ".*-fopenmp.*")
-         string(REPLACE "-fopenmp" "" tmpFlags "${${listname}}")
-         set(${listname} "${tmpFlags}")
-         message("-fopenmp causes incorrect compliation of HDF, removing from ${listname}")
-       endif()
-     endforeach()
-
-   endif()
-
-   # gcc must have -msse2 option to enable sse2 support
-   if(VNL_CONFIG_ENABLE_SSE2 OR VNL_CONFIG_ENABLE_SSE2_ROUNDING)
-     set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -msse2")
-   endif()
-
-  endif()
-
-  #-----------------------------------------------------------------------------
-
-  # for the gnu compiler a -D_PTHREADS is needed on sun
-  # for the native compiler a -mt flag is needed on the sun
-  if(CMAKE_SYSTEM MATCHES "SunOS.*")
-    if(CMAKE_COMPILER_IS_GNUCXX)
-      set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -D_PTHREADS")
-      set(ITK_REQUIRED_LINK_FLAGS "${ITK_REQUIRED_LINK_FLAGS} -lrt")
-    else()
-      set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -mt")
-      set(ITK_REQUIRED_C_FLAGS "${ITK_REQUIRED_C_FLAGS} -mt")
-    endif()
-    # Add flags for the SUN compiler to provide all the methods for std::allocator.
-    #
-    CHECK_CXX_SOURCE_COMPILES("-features=no%anachronisms" SUN_COMPILER)
-    if(SUN_COMPILER)
-      CHECK_CXX_SOURCE_COMPILES("-library=stlport4" SUN_COMPILER_HAS_STL_PORT_4)
-      if(SUN_COMPILER_HAS_STL_PORT_4)
-        set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -library=stlport4")
-      endif()
-     endif()
-  endif()
-
-  # mingw thread support
-  if(MINGW)
-    set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -mthreads")
-    set(ITK_REQUIRED_C_FLAGS "${ITK_REQUIRED_C_FLAGS} -mthreads")
-    set(ITK_REQUIRED_LINK_FLAGS "${ITK_REQUIRED_LINK_FLAGS} -mthreads")
-  endif()
-
-
-  #-----------------------------------------------------------------------------
-  # The frename-registers option does not work due to a bug in the gnu compiler.
-  # It must be removed or data errors will be produced and incorrect results
-  # will be produced.  This is first documented in the gcc4 man page.
-  if(CMAKE_COMPILER_IS_GNUCXX)
-    set(ALL_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
-    separate_arguments(ALL_FLAGS)
-    foreach(COMP_OPTION ${ALL_FLAGS})
-      if("${COMP_OPTION}" STREQUAL "-frename-registers")
-        message(FATAL_ERROR "-frename-registers causes runtime bugs.  It must be removed from your compilation options.")
-      endif()
-    endforeach()
-  endif()
-
-  #-----------------------------------------------------------------------------
-  # Set the compiler-specific flag for disabling optimization.
-  if(MSVC)
-    set(ITK_CXX_DISABLE_OPTIMIZATION_FLAG "/Od")
-  elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Intel)$")
-    set(ITK_CXX_DISABLE_OPTIMIZATION_FLAG "-O0")
-  endif()
-  if(DEFINED ITK_CXX_DISABLE_OPTIMIZATION_FLAG)
-    CHECK_CXX_SOURCE_COMPILES(${ITK_CXX_DISABLE_OPTIMIZATION_FLAG} CXX_HAS_DISABLE_OPTIMIZATION_FLAG)
   endif()
 endmacro()#End the platform check function


Fix cross-compiling build due to incorrect CMake conditional check. Related to commit f9158a045e277691913e8a0e162475694a4b5377.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -668,7 +668,7 @@
         add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND scp $<TARGET_FILE:${TARGET_NAME}> ${URHO3D_SCP_TO_TARGET} || exit 0
             COMMENT "Scp-ing ${TARGET_NAME} executable to target system")
     endif ()
-    if (DEST_RUNTIME_DIR AND DEST_BUNDLE_DIR)
+    if (DEST_RUNTIME_DIR)
         # Need to check if the destination variable is defined first because this macro could be called by external project that does not wish to install anything
         install (TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${DEST_RUNTIME_DIR} BUNDLE DESTINATION ${DEST_BUNDLE_DIR})
     endif ()


Prevent confusion removing variable CTEST_CMAKE_COMMAND in driver script template.

* To summarize:
   - This variable was using in "old-style" ctest script.
   - Its value is only readonly.

* For reference consider reading: http://www.cmake.org/Bug/view.php?id=13080

--- CMake/ctkDashboardScript.TEMPLATE.cmake
+++ CMake/ctkDashboardScript.TEMPLATE.cmake
@@ -22,7 +22,6 @@
 set(QT_QMAKE_EXECUTABLE "$ENV{HOME}/Projects/qtsdk-2010.02/qt/bin/qmake")
 set(CTEST_SITE "sagarmatha.kitware") # for example: mymachine.kitware, mymachine.dkfz, ...
 set(CTEST_DASHBOARD_ROOT "$ENV{HOME}/Projects/")
-set(CTEST_CMAKE_COMMAND "$ENV{HOME}/Projects/cmake-trunk-build/bin/cmake")
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")

 #


BUG: Path names should use standard forwardslash notation

--- Ginger_Aylward_Org_TubeTK_Nightly.cmake
+++ Ginger_Aylward_Org_TubeTK_Nightly.cmake
@@ -27,29 +27,26 @@
 #   the TubeTK source directory.
 #
 set( SITE_NAME "Ginger.Aylward.Org" )
-set( SITE_PLATFORM "Windows7-VS2010_64" )
+set( SITE_PLATFORM "Windows7-VS2010-64" )
 set( SITE_BUILD_TYPE "Release" )
 set( SITE_CTEST_MODE "Nightly" ) # one of Experimental, Continuous, Nightly
 set( SITE_CMAKE_GENERATOR "Visual Studio 10" )

-set( TUBETK_SOURCE_DIR
-  "C:\\Users\\aylward\\src\\TubeTK" )
-set( TUBETK_BINARY_DIR
-  "C:\\Users\\aylward\\src\\TubeTK-${SITE_BUILD_TYPE}" )
+set( TUBETK_GIT_REPOSITORY "http://tubetk.org/TubeTK.git" )
+set( TUBETK_SOURCE_DIR "C:/Users/aylward/src/TubeTK" )
+set( TUBETK_BINARY_DIR "C:/Users/aylward/src/TubeTK-${SITE_BUILD_TYPE}" )

 set( SITE_MAKE_COMMAND "${CTEST_BUILD_COMMAND}" )
-set( SITE_CMAKE_COMMAND "C:\\Program Files\\CMake 2.8\\bin\\cmake" )
-set( SITE_QMAKE_COMMAND "C:\\Qt\\4.8.2\\bin\\qmake" )
-set( SITE_CTEST_COMMAND "C:\\Program Files\\CMake 2.8\\bin\\ctest" )
+set( SITE_CMAKE_COMMAND "C:/Program Files/CMake 2.8/bin/cmake" )
+set( SITE_QMAKE_COMMAND "C:/Qt/4.8.2/bin/qmake" )
+set( SITE_CTEST_COMMAND "C:/Program Files/CMake 2.8/bin/ctest" )

 set( SITE_MEMORYCHECK_COMMAND "" )
 set( SITE_COVERAGE_COMMAND "" )
 set( SITE_KWSTYLE_DIR "" )

-set( SITE_GIT_COMMAND
-  "C:\\Program Files (x86)\\Git\\bin\\git" )
-set( SITE_SVN_COMMAND
-  "C:\\Program Files\\TortoiseSVN\\bin\\svn" )
+set( SITE_GIT_COMMAND "C:/Program Files (x86)/Git/bin/git" )
+set( SITE_SVN_COMMAND "C:/Program Files/TortoiseSVN/bin/svn" )

 set( SITE_EXPERIMENTAL_BUILD ON )
 set( SITE_EXPERIMENTAL_TEST ON )
@@ -74,19 +71,39 @@
 set( SITE_NIGHTLY_PACKAGE ON )
 set( SITE_NIGHTLY_UPLOAD ON )
 set( SITE_NIGHTLY_STYLE OFF )
+##############################################################################

+##############################################################################
 ###########################################################################
-#
 # The following advanced variables should only be changed by experts
 #
-set( CTEST_SOURCE_DIRECTORY "${TUBETK_SOURCE_DIR}" )
-set( CTEST_BINARY_DIRECTORY "${TUBETK_BINARY_DIR}" )
-set( CTEST_COMMAND "${SITE_CTEST_COMMAND}" )
+set( TUBETK_SCRIPT_DIR "${TUBETK_SOURCE_DIR}/CMake/DashboardScripts" )

 set( SITE_BUILD_NAME "${SITE_PLATFORM}-${SITE_BUILD_TYPE}" )
-set( TUBETK_SCRIPT_DIR "${TUBETK_SOURCE_DIR}/CMake/DashboardScripts" )
+
 set( SITE_UPDATE_COMMAND "${SITE_GIT_COMMAND}" )
-set( GIT_EXECUTABLE "${SITE_GIT_COMMAND}" )
+
+set( CTEST_SITE "${SITE_NAME}" )
+
+set( CTEST_BUILD_CONFIGURATION "${SITE_BUILD_TYPE}" )
+set( CTEST_BUILD_COMMAND "${SITE_MAKE_COMMAND}" )
+
+set( CTEST_SOURCE_DIRECTORY "${TUBETK_SOURCE_DIR}" )
+set( CTEST_BINARY_DIRECTORY "${TUBETK_BINARY_DIR}/TubeTK-Build" )
+
+set( CTEST_CMAKE_GENERATOR "${SITE_CMAKE_GENERATOR}" )
+set( CTEST_TEST_TIMEOUT 1500 )
+
+set( CTEST_CMAKE_COMMAND "${SITE_CMAKE_COMMAND}" )
+set( CTEST_CTEST_COMMAND "${SITE_CTEST_COMMAND}" )
+set( CTEST_UPDATE_COMMAND "${SITE_UPDATE_COMMAND}" )
+set( CTEST_COVERAGE_COMMAND "${SITE_COVERAGE_COMMAND}" )
+set( CTEST_MEMORYCHECK_COMMAND "${SITE_MEMORYCHECK_COMMAND}" )
+set( CTEST_MEMORYCHECK_COMMAND_OPTIONS
+  "${SITE_MEMORYCHECK_COMMAND_OPTIONS}" )
+set( CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
+  "${SITE_MEMORYCHECK_SUPPRESSIONS_FILE}" )
+set( CTEST_COMMAND "${SITE_CTEST_COMMAND}" )

 set( SITE_EXECUTABLE_DIRS "${TUBETK_BINARY_DIR}/ModuleDescriptionParser-Build/${SITE_BUILD_TYPE};${TUBETK_BINARY_DIR}/GenerateCLP-Build/${SITE_BUILD_TYPE};${TUBETK_BINARY_DIR}/Insight-Build/bin/${SITE_BUILD_TYPE};${TUBETK_BINARY_DIR}/VTK-Build/bin/${SITE_BUILD_TYPE};${TUBETK_BINARY_DIR}/TubeTK-Build/bin/${SITE_BUILD_TYPE};${TUBETK_BINARY_DIR}/TubeTK-Build/lib/TubeTK/Plugins/${SITE_BUILD_TYPE}" )
 set( ENV{PATH} "${SITE_EXECUTABLE_DIRS};$ENV{PATH}" )
@@ -99,6 +116,19 @@
 set( SITE_MEMORYCHECK_COMMAND_OPTIONS "" )
 set( SITE_MEMORYCHECK_SUPPRESSIONS_FILE
   "${CTEST_SCRIPT_DIRECTORY}/valgrind_suppressions.txt" )
+
+set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SITE_C_FLAGS}" )
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SITE_CXX_FLAGS}" )
+set( CMAKE_EXE_LINKER_FLAGS
+  "${CMAKE_EXE_LINKER_FLAGS} ${SITE_EXE_LINKER_FLAGS}" )
+set( CMAKE_SHARED_LINKER_FLAGS
+  "${CMAKE_SHARED_LINKER_FLAGS} ${SITE_SHARED_LINKER_FLAGS}" )
+
+set( GITCOMMAND "${SITE_GIT_COMMAND}" )
+set( GIT_EXECUTABLE "${SITE_GIT_COMMAND}" )
+set( SVNCOMMAND "${SITE_SVN_COMMAND}" )
+set( CMAKE_GENERATOR ${SITE_CMAKE_GENERATOR} )
+set( QT_QMAKE_EXECUTABLE "${SITE_QMAKE_COMMAND}" )

 if( NOT EXISTS "${TUBETK_SOURCE_DIR}/CMakeLists.txt" )
   execute_process( COMMAND


Enhanced FindUrho3D.cmake module to find library with debug postfix on windows platform.

--- Source/CMake/Modules/FindUrho3D.cmake
+++ Source/CMake/Modules/FindUrho3D.cmake
@@ -20,8 +20,8 @@
 # THE SOFTWARE.
 #

-# Find Urho3D library and include directories in the build tree or installed location
-# For build tree detection to work, Urho3D library must be already been built
+# Find Urho3D library and include directories in the project root tree or installed location
+# For project root tree detection to work, Urho3D library must be already been built
 #
 #  URHO3D_FOUND
 #  URHO3D_INCLUDE_DIR
@@ -31,33 +31,37 @@

 set (URHO3D_FOUND 0)

+if (WIN32)
+    set (CMAKE_DEBUG_POSTFIX _d)
+endif ()
+
 set (URHO3D_HOME $ENV{URHO3D_HOME})
 if (URHO3D_HOME)
     file (TO_CMAKE_PATH ${URHO3D_HOME} URHO3D_HOME)

-    # Construct build tree paths from URHO3D_HOME environment variable
-    find_file (BUILD_TREE_PATH Urho3D.h.in ${URHO3D_HOME}/Source/Engine NO_DEFAULT_PATH)
-    if (BUILD_TREE_PATH)
-        string (REPLACE "/Urho3D.h.in" "" BUILD_TREE_PATH ${BUILD_TREE_PATH})
+    # Construct source tree paths from URHO3D_HOME environment variable
+    find_file (SOURCE_TREE_PATH Urho3D.h.in ${URHO3D_HOME}/Source/Engine NO_DEFAULT_PATH)
+    if (SOURCE_TREE_PATH)
+        get_filename_component (SOURCE_TREE_PATH ${SOURCE_TREE_PATH} PATH)
         set (URHO3D_INCLUDE_DIR
-            ${BUILD_TREE_PATH}
-            ${BUILD_TREE_PATH}/Audio
-            ${BUILD_TREE_PATH}/Container
-            ${BUILD_TREE_PATH}/Core
-            ${BUILD_TREE_PATH}/Engine
-            ${BUILD_TREE_PATH}/Graphics
-            ${BUILD_TREE_PATH}/Input
-            ${BUILD_TREE_PATH}/IO
-            ${BUILD_TREE_PATH}/Math
-            ${BUILD_TREE_PATH}/Navigation
-            ${BUILD_TREE_PATH}/Network
-            ${BUILD_TREE_PATH}/Physics
-            ${BUILD_TREE_PATH}/Resource
-            ${BUILD_TREE_PATH}/Scene
-            ${BUILD_TREE_PATH}/Script
-            ${BUILD_TREE_PATH}/UI
-            ${BUILD_TREE_PATH}/../Extras/LuaScript
-            ${BUILD_TREE_PATH}/../ThirdParty/SDL/include)
+            ${SOURCE_TREE_PATH}
+            ${SOURCE_TREE_PATH}/Audio
+            ${SOURCE_TREE_PATH}/Container
+            ${SOURCE_TREE_PATH}/Core
+            ${SOURCE_TREE_PATH}/Engine
+            ${SOURCE_TREE_PATH}/Graphics
+            ${SOURCE_TREE_PATH}/Input
+            ${SOURCE_TREE_PATH}/IO
+            ${SOURCE_TREE_PATH}/Math
+            ${SOURCE_TREE_PATH}/Navigation
+            ${SOURCE_TREE_PATH}/Network
+            ${SOURCE_TREE_PATH}/Physics
+            ${SOURCE_TREE_PATH}/Resource
+            ${SOURCE_TREE_PATH}/Scene
+            ${SOURCE_TREE_PATH}/Script
+            ${SOURCE_TREE_PATH}/UI
+            ${SOURCE_TREE_PATH}/../Extras/LuaScript
+            ${SOURCE_TREE_PATH}/../ThirdParty/SDL/include)

         if (RASPI AND CMAKE_CROSSCOMPILING)
             set (URHO3D_INCLUDE_DIR ${URHO3D_INCLUDE_DIR} ${URHO3D_HOME}/raspi-Build/Engine)
@@ -66,14 +70,14 @@
             set (URHO3D_INCLUDE_DIR ${URHO3D_INCLUDE_DIR} ${URHO3D_HOME}/Build/Engine)
             set (URHO3D_LIB_SEARCH_PATH ${URHO3D_HOME}/Lib)
         endif ()
-        find_library (URHO3D_LIBRARIES Urho3D ${URHO3D_LIB_SEARCH_PATH} NO_DEFAULT_PATH)
+        find_library (URHO3D_LIBRARIES Urho3D${CMAKE_DEBUG_POSTFIX} ${URHO3D_LIB_SEARCH_PATH} NO_DEFAULT_PATH)
     endif ()
 else ()
     set (URHO3D_INC_SEARCH_PATH /opt/include)
     find_path (URHO3D_INCLUDE_DIR Engine.h PATH_SUFFIXES Urho3D ${URHO3D_INC_SEARCH_PATH})

     set (URHO3D_LIB_SEARCH_PATH /opt/lib)
-    find_library (URHO3D_LIBRARIES Urho3D PATH_SUFFIXES Urho3D ${URHO3D_LIB_SEARCH_PATH})
+    find_library (URHO3D_LIBRARIES Urho3D${CMAKE_DEBUG_POSTFIX} PATH_SUFFIXES Urho3D ${URHO3D_LIB_SEARCH_PATH})
 endif ()

 if (URHO3D_INCLUDE_DIR AND URHO3D_LIBRARIES)


Changed configuration to use vpm_include_directories

--- configure.cmake
+++ configure.cmake
@@ -5,7 +5,7 @@
   boost
   crunch_base)

-include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
+vpm_include_directories(${CMAKE_CURRENT_LIST_DIR}/include)

 macro(crunch_add_benchmark _name)
   add_custom_target("run-${_name}"


Reactivated mitkToFNrrdImageWriterTest

Reactivated mitkToFNrrdImageWriterTest

--- Modules/ToFHardware/Testing/files.cmake
+++ Modules/ToFHardware/Testing/files.cmake
@@ -19,10 +19,10 @@
   mitkToFCameraPMDPlayerDeviceTest.cpp
   mitkToFImageCsvWriterTest.cpp
   mitkToFImageGrabberTest.cpp
-  mitkToFImageRecorderTest.cpp
-  #mitkToFImageRecorderFilterTest.cpp
+#  mitkToFImageRecorderTest.cpp
+  mitkToFImageRecorderFilterTest.cpp
   mitkToFImageWriterTest.cpp
-  #mitkToFNrrdImageWriterTest.cpp
+  mitkToFNrrdImageWriterTest.cpp
   mitkToFOpenCVImageGrabberTest.cpp
   mitkKinectControllerTest.cpp
   mitkKinectDeviceTest.cpp


ENH: Update elastix to revision 5159

ENH: Update elastix to revision 5159

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -2,7 +2,7 @@

 file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )
 set( ELASTIX_REPOSITORY https://svn.bigr.nl/elastix/trunkpublic/ )
-set( ELASTIX_REVISION 5158 )
+set( ELASTIX_REVISION 5159 )

 ExternalProject_Add( ${proj}
   SVN_REPOSITORY ${ELASTIX_REPOSITORY}


CUDA 6.5 does not support sm_10 anymore and sm_11-sm_13 are deprecated. Stop compiling them with CUDA 6.5

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -52,12 +52,14 @@
 #   This script will modify CUDA_NVCC_FLAGS if system default is not gcc-4.3
 include (nvcc-check)

-set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
-      -gencode arch=compute_10,code=sm_10
-      -gencode arch=compute_11,code=sm_11
-      -gencode arch=compute_12,code=sm_12
-      -gencode arch=compute_13,code=sm_13
-    )
+if("${CUDA_VERSION}" LESS 6.5)
+  set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
+        -gencode arch=compute_10,code=sm_10
+        -gencode arch=compute_11,code=sm_11
+        -gencode arch=compute_12,code=sm_12
+        -gencode arch=compute_13,code=sm_13
+      )
+endif ()

 if("${CUDA_VERSION}" LESS 5.0)
  set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}


Fixed CUDA warning

Fixed CUDA warning

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -35,9 +35,11 @@

 set (CUDA_FOUND ${CUDA_FOUND} CACHE BOOL "Did we find cuda?")

-IF(CUDA_FOUND AND ${CUDA_VERSION} LESS 3.2)
-  MESSAGE("CUDA version ${CUDA_VERSION} found, too old for RTK")
-  SET(CUDA_FOUND FALSE)
+IF(CUDA_FOUND)
+  IF(${CUDA_VERSION} LESS 3.2)
+    MESSAGE("CUDA version ${CUDA_VERSION} found, too old for RTK")
+    SET(CUDA_FOUND FALSE)
+  ENDIF()
 ENDIF()

 if (CUDA_FOUND)


Removing unused LibFindMacros cmake script

--- cmake/LibFindMacros.cmake
+++ cmake/LibFindMacros.cmake
@@ -1,99 +0,0 @@
-# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
-# used for the current package. For this to work, the first parameter must be the
-# prefix of the current package, then the prefix of the new package etc, which are
-# passed to find_package.
-macro (libfind_package PREFIX)
-  set (LIBFIND_PACKAGE_ARGS ${ARGN})
-  if (${PREFIX}_FIND_QUIETLY)
-    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
-  endif (${PREFIX}_FIND_QUIETLY)
-  if (${PREFIX}_FIND_REQUIRED)
-    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
-  endif (${PREFIX}_FIND_REQUIRED)
-  find_package(${LIBFIND_PACKAGE_ARGS})
-endmacro (libfind_package)
-
-# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
-# where they added pkg_check_modules. Consequently I need to support both in my scripts
-# to avoid those deprecated warnings. Here's a helper that does just that.
-# Works identically to pkg_check_modules, except that no checks are needed prior to use.
-macro (libfind_pkg_check_modules PREFIX PKGNAME)
-  if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    include(UsePkgConfig)
-    pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
-  else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    find_package(PkgConfig)
-    if (PKG_CONFIG_FOUND)
-      pkg_check_modules(${PREFIX} ${PKGNAME})
-    endif (PKG_CONFIG_FOUND)
-  endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-endmacro (libfind_pkg_check_modules)
-
-# Do the final processing once the paths have been detected.
-# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
-# all the variables, each of which contain one include directory.
-# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
-# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
-# Also handles errors in case library detection was required, etc.
-macro (libfind_process PREFIX)
-  # Skip processing if already processed during this run
-  if (NOT ${PREFIX}_FOUND)
-    # Start with the assumption that the library was found
-    set (${PREFIX}_FOUND TRUE)
-
-    # Process all includes and set _FOUND to false if any are missing
-    foreach (i ${${PREFIX}_PROCESS_INCLUDES})
-      if (${i})
-        set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
-        mark_as_advanced(${i})
-      else (${i})
-        set (${PREFIX}_FOUND FALSE)
-      endif (${i})
-    endforeach (i)
-
-    # Process all libraries and set _FOUND to false if any are missing
-    foreach (i ${${PREFIX}_PROCESS_LIBS})
-      if (${i})
-        set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
-        mark_as_advanced(${i})
-      else (${i})
-        set (${PREFIX}_FOUND FALSE)
-      endif (${i})
-    endforeach (i)
-
-    # Print message and/or exit on fatal error
-    if (${PREFIX}_FOUND)
-      if (NOT ${PREFIX}_FIND_QUIETLY)
-        message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
-      endif (NOT ${PREFIX}_FIND_QUIETLY)
-    else (${PREFIX}_FOUND)
-      if (${PREFIX}_FIND_REQUIRED)
-        foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
-          message("${i}=${${i}}")
-        endforeach (i)
-        message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
-      endif (${PREFIX}_FIND_REQUIRED)
-    endif (${PREFIX}_FOUND)
-  endif (NOT ${PREFIX}_FOUND)
-endmacro (libfind_process)
-
-macro(libfind_library PREFIX basename)
-  set(TMP "")
-  if(MSVC80)
-    set(TMP -vc80)
-  endif(MSVC80)
-  if(MSVC90)
-    set(TMP -vc90)
-  endif(MSVC90)
-  set(${PREFIX}_LIBNAMES ${basename}${TMP})
-  if(${ARGC} GREATER 2)
-    set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
-    string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
-    set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
-  endif(${ARGC} GREATER 2)
-  find_library(${PREFIX}_LIBRARY
-    NAMES ${${PREFIX}_LIBNAMES}
-    PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
-  )
-endmacro(libfind_library)
-


Link libiomp5

Link libiomp5

--- cmake/PlatformLinux.cmake
+++ cmake/PlatformLinux.cmake
@@ -84,7 +84,7 @@
         -Wno-padded
     )

-    set(LINUX_LINKER_FLAGS "-fopenmp=libomp")
+    set(LINUX_LINKER_FLAGS "-fopenmp=libiomp5")
 endif()


TundraInstall.cmake: For some reason the directory ARGX logic broke, maybe something with the new cmake that i installed. This ARGC logic should work with all versions of cmake.

--- cmake/TundraInstall.cmake
+++ cmake/TundraInstall.cmake
@@ -16,15 +16,19 @@
 #
 # Example: setup_install_directory (media) will copy <project_dir>/media to <prefix>/bin/media
 #
-function (setup_install_directory DATA_SRC_DIR_PATH)
+function (setup_install_directory)
     # Resolve destination dir
-    if (NOT ARGV1)
+    if (ARGC EQUAL 0)
+        message(FATAL_ERROR "setup_install_directory() called without parameters. At minumum give the folder you want to install.")
+    endif ()
+
+    if (ARGC EQUAL 1)
         set (DATA_DEST_DIR_PATH_FINAL "bin")
     else ()
         set (DATA_DEST_DIR_PATH_FINAL "bin/${ARGV1}")
     endif ()
     # Install directory
-    install (DIRECTORY ${DATA_SRC_DIR_PATH} DESTINATION ${DATA_DEST_DIR_PATH_FINAL})
+    install (DIRECTORY ${ARGV0} DESTINATION ${DATA_DEST_DIR_PATH_FINAL})
 endfunction ()

 # Macro for installing a file into the install prefix.
@@ -38,15 +42,15 @@
 #           NOTE: Must have" " around ${MY_INSTALL_FILES} for lists! seem to be needed if you
 #           are not using ARGN which we cant coz we have multiple params (right?)
 #
-function (setup_install_files DATA_SRC_FILES)
+function (setup_install_files)
     # Resolve destination dir
-    if (NOT ARGV1)
+    if (ARGC EQUAL 1)
         set (DATA_DEST_PATH_FINAL "bin")
     else ()
         set (DATA_DEST_PATH_FINAL "bin/${ARGV1}")
     endif ()
     # Install file
-    install (FILES ${DATA_SRC_FILES} DESTINATION ${DATA_DEST_PATH_FINAL})
+    install (FILES ${ARGV0} DESTINATION ${DATA_DEST_PATH_FINAL})
 endfunction ()

 # Macro for finding install files from a dir with a glob.


Bump patch version to 4

Bump patch version to 4

--- cmake/build-version.cmake
+++ cmake/build-version.cmake
@@ -19,7 +19,7 @@
   endif( )
   if( POLICY CMP0048 )
     cmake_policy( SET CMP0048 NEW )
-    project( ${PV_NAME} VERSION 0.5.3.0 LANGUAGES ${PV_LANGUAGES} )
+    project( ${PV_NAME} VERSION 0.5.4.0 LANGUAGES ${PV_LANGUAGES} )

   else( )
     project( ${PV_NAME} ${PV_LANGUAGES} )
@@ -33,7 +33,7 @@
     endif( )

     if( NOT DEFINED ${PV_NAME}_VERSION_PATCH )
-      set( ${PV_NAME}_VERSION_PATCH 3 )
+      set( ${PV_NAME}_VERSION_PATCH 4 )
     endif( )

     if( NOT DEFINED ${PV_NAME}_VERSION_TWEAK )


Fix cmake's version string handling (change proposed by Jonathan Perkin). Before this, a text suffix (like "-rc") after the numeric version was needed.

--- cmake/mysql_version.cmake
+++ cmake/mysql_version.cmake
@@ -42,6 +42,9 @@
         IF(NOT VERSION_STRING)
           FILE(STRINGS  configure.in  str REGEX "AC_INIT\\(")
           STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][a-zAZ0-9]+" VERSION_STRING "${str}")
+          IF(NOT VERSION_STRING)
+            STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION_STRING "${str}")
+          ENDIF()
         ENDIF()
       ENDIF()
     ENDIF()


CFitsIO to only look for missing components

--- modules/FindCFitsIO.cmake
+++ modules/FindCFitsIO.cmake
@@ -5,16 +5,20 @@
 # - CFitsIO_INCLUDE_DIR is the path to the include directory
 # - CFitsIO_VERSION_STRING is the version of the library

-find_library(
-  CFitsIO_LIBRARY cfitsio
-  DOC "Path to the cfitsio library"
-)
-find_path(
-  CFitsIO_INCLUDE_DIR fitsio.h
-  PATH_SUFFIXES include include/cfitsio
-  DOC "Path to the cfitsio include directory"
-)
-if(NOT "${CFitsIO_INCLUDE_DIR}" MATCHES "\\-NOTFOUND")
+if(NOT CFitsIO_LIBRARY)
+    find_library(
+      CFitsIO_LIBRARY cfitsio
+      DOC "Path to the cfitsio library"
+    )
+endif()
+if(NOT CFitsIO_INCLUDE_DIR)
+    find_path(
+      CFitsIO_INCLUDE_DIR fitsio.h
+      PATH_SUFFIXES include include/cfitsio
+      DOC "Path to the cfitsio include directory"
+    )
+endif()
+if(CFitsIO_INCLUDE_DIR)
   file(
     STRINGS ${CFitsIO_INCLUDE_DIR}/fitsio.h
     CFitsIO_VERSION_STRING


[cmake] fix parameter list for ChooseCudaCC

--- cmake/ChooseCudaCC.cmake
+++ cmake/ChooseCudaCC.cmake
@@ -3,14 +3,15 @@
 #    set(RESULT_NAME ${RESULT_NAME} CACHE STRING "CUDA CC versions to compile")
 # replacing your own variable for RESULT_NAME
 #
+# We assume that MINCC default to 20
 # We assume that MINCUDAVERSION defaults to 7.0
 #
 function(ChooseCudaCC RESULT_NAME MINCC MINCUDAVERSION)
-  if(NOT DEFINED ${MINCC})
-    message(FATAL_ERROR "CMake function ChooseCudaCC must be called with a minimal CC")
+  if(NOT DEFINED MINCC)
+    set(MINCC 20)
   endif()
-  if(NOT DEFINED ${MINCUDAVERSION})
-    set(MINCUDAVERSION 70)
+  if(NOT DEFINED MINCUDAVERSION)
+    set(MINCUDAVERSION 7.0)
   endif()

   find_package(CUDA ${MINCUDAVERSION} REQUIRED)
@@ -32,6 +33,7 @@
   else()
     message(FATAL_ERROR "Unknown how to build for ${CMAKE_SYSTEM_PROCESSOR}")
   endif()
+
   #
   # Default setting of the CUDA CC versions to compile.
   # Shortening the lists saves a lot of compile time.
@@ -63,9 +65,10 @@
   #
   # Add all requested CUDA CCs to the command line for offline compilation
   #
+  set(GENCODE_FLAGS "${CUDA_NVCC_FLAGS}")
   list(SORT CC_LIST)
   foreach(CC_VERSION ${CC_LIST})
-    set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_${CC_VERSION},code=sm_${CC_VERSION}")
+    set(GENCODE_FLAGS "${GENCODE_FLAGS};-gencode;arch=compute_${CC_VERSION},code=sm_${CC_VERSION}")
   endforeach()

   #
@@ -74,8 +77,13 @@
   list(LENGTH CC_LIST CC_LIST_LEN)
   MATH(EXPR CC_LIST_LEN "${CC_LIST_LEN}-1")
   list(GET CC_LIST ${CC_LIST_LEN} CC_LIST_LAST)
-  set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_${CC_LIST_LAST},code=compute_${CC_LIST_LAST}")
+  set(GENCODE_FLAGS "${GENCODE_FLAGS};-gencode;arch=compute_${CC_LIST_LAST},code=compute_${CC_LIST_LAST}")

+  #
+  # Two variables are exported to the parent scope. One is passed through the
+  # environment (CUDA_NVCC_FLAGS), the other is passed by name (RESULT_NAME)
+  #
+  set(CUDA_NVCC_FLAGS ${GENCODE_FLAGS} PARENT_SCOPE)
   set(${RESULT_NAME} ${CC_LIST} PARENT_SCOPE)
 endfunction()


add resolver that was there before

add resolver that was there before

--- cmake/ElektraCache.cmake
+++ cmake/ElektraCache.cmake
@@ -105,6 +105,7 @@
 	resolver_fm_xb_x
 	resolver_fm_xp_x
 	resolver_fm_xhp_x
+	resolver_fm_uhb_xb
 	)

 #


BUG: incorrect cmake variable used for prefix

--- cmake/LibKMLHelper.cmake
+++ cmake/LibKMLHelper.cmake
@@ -10,7 +10,6 @@
     VERSION   "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
     SOVERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
 endif()
-
 endmacro()

 macro(install_target _target)
@@ -27,7 +26,7 @@
  add_executable(test_${_target} ${_src})
  add_dependencies(test_${_target} ${_libs} ${_extra_libs})
  target_link_libraries(test_${_target} ${_libs} ${_extra_libs} ${GTEST_LIBRARY})
- add_test(${prefix}_${_target} ${_target})
+ add_test(${_prefix}_${_target} ${CMAKE_BINARY_DIR}/bin/test_${_target})
 endfunction()

 function(build_example _target _libs)


Properly set variables in FindEigen

Properly set variables in FindEigen

--- cmake/V4RFindEigen.cmake
+++ cmake/V4RFindEigen.cmake
@@ -1,11 +1,14 @@
-find_path(EIGEN_INCLUDE_PATH "Eigen/Core"
-          PATHS /usr/local /opt /usr $ENV{EIGEN_ROOT}/include ENV ProgramFiles ENV ProgramW6432
-          PATH_SUFFIXES include/eigen3 Eigen/include/eigen3
-          DOC "The path to Eigen3 headers"
-          CMAKE_FIND_ROOT_PATH_BOTH)
-
-if(EIGEN_INCLUDE_PATH)
-  v4r_include_directories(${EIGEN_INCLUDE_PATH})
-  v4r_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION)
-  set(HAVE_EIGEN TRUE)
+if(WITH_EIGEN)
+  v4r_clear_vars(EIGEN_INCLUDE_DIR EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION EIGEN_LIBRARIES EIGEN_INCLUDE_DIRS)
+  find_path(EIGEN_INCLUDE_PATH "Eigen/Core"
+            PATHS /usr/local /opt /usr $ENV{EIGEN_ROOT}/include ENV ProgramFiles ENV ProgramW6432
+            PATH_SUFFIXES include/eigen3 Eigen/include/eigen3
+            DOC "The path to Eigen3 headers"
+            CMAKE_FIND_ROOT_PATH_BOTH)
+  if(EIGEN_INCLUDE_PATH)
+    set(EIGEN_LIBRARIES "")
+    set(EIGEN_INCLUDE_DIRS "${EIGEN_INCLUDE_PATH}")
+    v4r_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION)
+    set(HAVE_EIGEN TRUE)
+  endif()
 endif()


git merge stable

git merge stable

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

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -9,6 +9,7 @@
 ##
 ##   ctest -S /path/to/ctest_script.cmake
 ##
+## It is recommended to make a copy of the file (especially using git).
 ## For extra information
 ##
 ##   ctest -S /path/to/ctest_script.cmake -V
@@ -16,7 +17,8 @@
 ## or even  -VV
 ##
 ## Set execution options in the Configuration part.
-## For multiple tests (eg. different compilers) copy this file and adjust options.
+## For multiple tests (eg. different compilers) make multiple copies
+## of this file and adjust options.
 ##
 ######################################################################

@@ -61,8 +63,8 @@
 set(CTEST_BINARY_DIRECTORY ${CTEST_SOURCE_DIRECTORY}/build_ctest)

 # Update type (eg. svn or git)
-set( UPDATE_TYPE svn)
-set( CTEST_UPDATE_COMMAND "svn") #"${CTEST_SOURCE_DIRECTORY}/cmake/svn_github.sh"
+set( UPDATE_TYPE git)
+set( CTEST_UPDATE_COMMAND "git") #"${CTEST_SOURCE_DIRECTORY}/cmake/svn_github.sh"

 # Timeouts
 set(CTEST_TEST_TIMEOUT 200 CACHE STRING
@@ -72,15 +74,15 @@

 # Build options
 set(gismo_build_options
-    #-DGISMO_BUILD_COVERAGE=ON
-    -DGISMO_PLAINDOX=ON # plain doxygen output for the trac Wiki
     -DGISMO_BUILD_LIB=ON
     -DGISMO_WITH_ONURBS=ON
-    -DGISMO_WITH_IPOPT=ON
-    -DIpOpt_DIR=/home/amantzaflaris/dashboards/IpOpt_inst
-    -DGISMO_WITH_PSOLID=ON
-    -DParasolid_DIR=/home/amantzaflaris/dropboxOUT/gforge/parasolid/26/1/153
-    #-DGISMO_BUILD_AXL=ON -DAxel_DIR=/home/amantzaflaris/build/axel
+    #-DGISMO_WITH_IPOPT=ON
+    #-DIpOpt_DIR=/path/to/ipopt
+    #-DGISMO_WITH_PSOLID=ON
+    #-DParasolid_DIR=/path/to/parasolid
+    #-DGISMO_BUILD_AXL=ON -DAxel_DIR=/path/to/axel
+    #-DGISMO_PLAINDOX=ON
+    #-DGISMO_BUILD_COVERAGE=ON
 )

 # Coverage analysis


update xpu.cmake to 20220731, test=kunlun (#44767)

--- cmake/external/xpu.cmake
+++ cmake/external/xpu.cmake
@@ -10,7 +10,7 @@
 if(NOT DEFINED XPU_BASE_URL)
   set(XPU_BASE_URL_WITHOUT_DATE
       "https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev")
-  set(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220728")
+  set(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220731")
 else()
   set(XPU_BASE_URL "${XPU_BASE_URL}")
 endif()
@@ -19,7 +19,7 @@
 if(NOT DEFINED XPU_XDNN_BASE_URL)
   set(XPU_XDNN_BASE_URL_WITHOUT_DATE
       "https://klx-sdk-release-public.su.bcebos.com/xdnn/dev")
-  set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220728")
+  set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220731")
 else()
   set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL}")
 endif()


build: pkgconfig not needed by gRPC anymore

Co-Authored-By: Leonardo Di Donato <2012e0ca99d70aa6c893822ff73002216e5dba72@gmail.com>
Signed-off-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>

--- cmake/modules/gRPC.cmake
+++ cmake/modules/gRPC.cmake
@@ -66,12 +66,6 @@
   endif()

 else()
-
-  find_package(PkgConfig)
-  if(NOT PKG_CONFIG_FOUND)
-    message(FATAL_ERROR "pkg-config binary not found")
-  endif()
-  message(STATUS "Found pkg-config executable: ${PKG_CONFIG_EXECUTABLE}")
   set(GRPC_SRC "${PROJECT_BINARY_DIR}/grpc-prefix/src/grpc")
   set(GRPC_INCLUDE "${GRPC_SRC}/include")
   set(GRPC_LIBS_ABSOLUTE "${GRPC_SRC}/libs/opt")


Only set SSE optimization when compiling an optimized build.

Needed for Debian and Gentoo packaging.

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

--- cmake/pcl_find_sse.cmake
+++ cmake/pcl_find_sse.cmake
@@ -128,6 +128,7 @@
         endif(HAVE_SSE2_EXTENSIONS)
     endif (NOT APPLE AND NOT MSVC)

-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SSE_FLAGS}")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SSE_FLAGS}")

 endmacro(PCL_CHECK_FOR_SSE)


dont use -march=native on Android

dont use -march=native on Android

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@4796 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_sse.cmake
+++ cmake/pcl_find_sse.cmake
@@ -6,7 +6,7 @@
     if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
         execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion"
                         OUTPUT_VARIABLE GCC_VERSION_STRING)
-        if(GCC_VERSION_STRING VERSION_GREATER 4.2 AND NOT APPLE)
+        if(GCC_VERSION_STRING VERSION_GREATER 4.2 AND NOT APPLE AND NOT ANDROID_NDK)
           SET(SSE_FLAGS "${SSE_FLAGS} -march=native")
           message(STATUS "Using CPU native flags for SSE optimization: ${SSE_FLAGS}")
         endif()


Detect 32bit environment on 64bit ARM hardware

for #2056, using same approach as #2058

--- cmake/system_check.cmake
+++ cmake/system_check.cmake
@@ -49,7 +49,11 @@
 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*)")
   set(ARM 1)
 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
-  set(ARM64 1)
+  if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+    set(ARM64 1)
+  else()
+    set(ARM 1)
+  endif()
 endif()

 if (X86_64)


fixed cmake variable matching

fixed cmake variable matching

--- src/version.cmake
+++ src/version.cmake
@@ -12,7 +12,7 @@
 	    set(VERSIONTAG "${COMMIT}")
 	else()
 		message(STATUS "The most recent tag was at ${TAGGEDCOMMIT}")
-		if(COMMIT MATCHES TAGGEDCOMMIT)
+		if(${COMMIT} MATCHES ${TAGGEDCOMMIT})
 			message(STATUS "You are building a tagged release")
 		    set(VERSIONTAG "release")
 		else()


Revert unintended commit

Revert unintended commit

--- build_settings.cmake
+++ build_settings.cmake
@@ -24,7 +24,7 @@
 set(CXX_SPECIFIC_WARN_OPTS "-Wsuggest-override -Wnon-virtual-dtor -Wformat-security")

 # C and C++ compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Og -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} -mtune=intel ${EXTRA_C_FLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} -mtune=intel ${EXTRA_C_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} ${CXX_SPECIFIC_WARN_OPTS} -std=c++1z -fvisibility-inlines-hidden -fdiagnostics-color=auto ${EXTRA_CXX_FLAGS}")

 # Linker flags


Revert accidental change.

Revert accidental change.

--- build_settings.cmake
+++ build_settings.cmake
@@ -20,7 +20,7 @@
 set(WARN_OPTS "-Wuninitialized -Werror -Wall -W -Wchar-subscripts -Wcomment -Wformat -Wparentheses -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings")

 # C and C++ compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Og ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel")

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -Wnon-virtual-dtor -fvisibility-inlines-hidden -fdiagnostics-color=auto")


Improved arch/platform detection. (2)

Improved arch/platform detection. (2)

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -104,21 +104,21 @@
     endif()
     string(FIND "${CC_PLATFORM}" "linux" CC_PLATFORM_LINUX)
     if(CC_PLATFORM_LINUX GREATER_EQUAL 0)
-        set(CC_ARCH "linux")
+        set(CC_PLATFORM "linux")
     endif()
     string(FIND "${CC_PLATFORM}" "darwin" CC_PLATFORM_DARWIN)
     if(CC_PLATFORM_DARWIN GREATER_EQUAL 0)
-        set(CC_ARCH "macos")
+        set(CC_PLATFORM "macos")
     endif()
     string(FIND "${CC_PLATFORM}" "Win64" CC_PLATFORM_WIN64)
     string(FIND "${CC_PLATFORM}" "Win32" CC_PLATFORM_WIN32)
     string(FIND "${CC_PLATFORM}" "mingw" CC_PLATFORM_MINGW)
     if(CC_PLATFORM_WIN64 GREATER_EQUAL 0 OR CC_PLATFORM_WIN32 GREATER_EQUAL 0 OR CC_PLATFORM_MINGW GREATER_EQUAL 0)
-        set(CC_ARCH "windows")
+        set(CC_PLATFORM "windows")
     endif()
     string(FIND "${CC_PLATFORM}" "android" CC_PLATFORM_ANDROID)
     if(CC_PLATFORM_ANDROID GREATER_EQUAL 0)
-        set(CC_ARCH "android")
+        set(CC_PLATFORM "android")
     endif()
 else()
     set(CC_NAME "msvc")


Update ITK tag to pull in MINC fixes and N4 optimiziation

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -151,7 +151,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
   # set(${proj}_REPOSITORY ${git_protocol}://github.com/stnava/ITK.git)
-  set(${proj}_GIT_TAG  81c14ce858a530699ee2fbf7fa48b884ad26b984 ) #20190914 - ITKv5 Enumerations with legacy OFF
+  set(${proj}_GIT_TAG  39f1ba9b9540a5daa38ddb87d2c091d4db1fb45d ) #20191004, MINC update and N4 optimization
   set(ITK_VERSION_ID ITK-5.1) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


Remove old unused AVR compiler way of building Arduino code.

--- cmake/CMakeAvr.cmake
+++ cmake/CMakeAvr.cmake
@@ -1,118 +0,0 @@
-# this one is important
-SET(VERBOSE 1)
-SET(CMAKE_SYSTEM_NAME Generic)
-SET(CMAKE_SYSTEM_VERSION 1)
-SET(CMAKE_SYSTEM_PROCSSOR avr)
-
-# specify the cross compiler
-SET(CMAKE_C_COMPILER   avr-gcc)
-SET(CMAKE_CXX_COMPILER avr-g++)
-SET(CMAKE_IMPORT_LIBRARY_SUFFIX so)
-SET(CMAKE_NO_QUOTED_OBJECTS 1)
-SET(CMAKE_C_CREATE_SHARED_LIBRARY "")
-SET(CMAKE_C_CREATE_MODULE_LIBRARY "")
-SET(CMAKE_C_LINK_EXECUTABLE "")
-SET(CMAKE_CXX_LINK_EXECUTABLE "")
-
-SET(CSTANDARD "-std=gnu99")
-SET(CDEBUG "-gstabs")
-SET(CWARN "-Wall -Wstrict-prototypes")
-SET(CTUNING "-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections")
-SET(COPT "-Os")
-SET(CXXOPT "-fno-exceptions")
-SET(CINCS "-I${CMAKE_SOURCE_DIR}/arduino")
-SET(CMCU "-mmcu=atmega328p")
-SET(CDEFS "-DF_CPU=16000000L -DSQ_ARDUINO")
-
-SET(CFLAGS "${CMCU} ${CDEBUG} ${CDEFS} ${CINCS} ${COPT} ${CWARN} ${CSTANDARD} ${CEXTRA} ${CTUNING}")
-#SET(CFLAGS "${CMCU} ${CDEFS} ${CINCS} ${COPT} ${CWARN} ${CSTANDARD} ${CEXTRA} ${CTUNING}")
-SET(CXXFLAGS "${CMCU} ${CDEFS} ${CINCS} ${COPT} ${CXXOPT} ${CTUNING}")
-
-ADD_DEFINITIONS(${CFLAGS})
-
-SET (CMAKE_C_FLAGS "")
-SET (CMAKE_C_FLAGS_DEBUG "${CFLAGS}")
-SET (CMAKE_C_FLAGS_MINSIZEREL "${CFLAGS}")
-SET (CMAKE_C_FLAGS_RELEASE "${CFLAGS}")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO "${CFLAGS}")
-
-SET (CMAKE_CXX_FLAGS "")
-SET (CMAKE_CXX_FLAGS_DEBUG "${CXXFLAGS}")
-SET (CMAKE_CXX_FLAGS_MINSIZEREL "${CXXFLAGS}")
-SET (CMAKE_CXX_FLAGS_RELEASE "${CXXFLAGS}")
-SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CXXFLAGS}")
-
-SET(CMAKE_C_FLAGS "${CFLAGS}")
-SET(CMAKE_CXX_FLAGS "${CXXFLAGS}")
-
-SET(C_FLAGS "${CFLAGS}")
-SET(CXX_FLAGS "${CXXFLAGS}")
-
-SET(SQ_MAX_STRING_LENGTH 256     CACHE STRING "")
-SET(SQ_MAX_OBJECT_LENGTH 100      CACHE STRING "")
-SET(SQ_MAX_PARAMETERS    5       CACHE STRING "")
-SET(SQ_LOGGING_ENABLED   OFF       CACHE BOOL "")
-SET(SQ_ARDUINO           ON      CACHE BOOL "")
-
-SET(EXTRA_SRCS ${CMAKE_SOURCE_DIR}/arduino/Print.cpp
-               ${CMAKE_SOURCE_DIR}/arduino/wiring.c
-               ${CMAKE_SOURCE_DIR}/arduino/new.cpp
-               ${CMAKE_SOURCE_DIR}/arduino/wiring_digital.c
-               ${CMAKE_SOURCE_DIR}/arduino/wiring_analog.c
-               ${CMAKE_SOURCE_DIR}/arduino/wiring_pulse.c
-               ${CMAKE_SOURCE_DIR}/arduino/wiring_shift.c
-               ${CMAKE_SOURCE_DIR}/arduino/WInterrupts.c
-               ${CMAKE_SOURCE_DIR}/arduino/WMath.cpp
-               ${CMAKE_SOURCE_DIR}/arduino/HardwareSerial.cpp
-               ${CMAKE_SOURCE_DIR}/arduino/Stream.cpp
-               ${CMAKE_SOURCE_DIR}/arduino/WString.cpp
-               ${CMAKE_SOURCE_DIR}/arduino/twi.c
-               ${CMAKE_SOURCE_DIR}/arduino/twowire/Wire.cpp)
-
-IF(SQ_ARDUINO_STREAM STREQUAL "arduino")
-  FILE(WRITE ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "#ifdef __cplusplus\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "extern \"C\" {\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "#endif\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "void arduino_serial_open(long _baudRate);\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "void arduino_serial_write ( const char * const _buff );\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "void arduino_serial_write_byte ( unsigned char _byte );\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "int arduino_serial_read (void);\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "int arduino_serial_available (void);\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "#ifdef __cplusplus\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "}\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.h "#endif\n")
-
-  FILE(WRITE ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "#include <avr/io.h>\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "#include <HardwareSerial.h>\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "extern \"C\" { \n" )
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "void arduino_serial_open(long _baudRate) { Serial.begin(_baudRate); }\n" )
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "void arduino_serial_write ( const char * const _buff ) { Serial.write ( _buff ); }\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "void arduino_serial_write_byte ( unsigned char _byte ) { Serial.write ( _byte ); }\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "int arduino_serial_read (void) { return Serial.read (); }\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "int arduino_serial_available (void) { return Serial.available (); }\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "void __cxa_pure_virtual(void) {} \n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp "}\n")
-
-  SET(EXTRA_SRCS ${EXTRA_SRCS}
-                  ${CMAKE_BINARY_DIR}/generated/arduino_serial.cpp)
-ENDIF(SQ_ARDUINO_STREAM STREQUAL "arduino")
-
-IF(WIN32)
-  FILE(WRITE ${CMAKE_BINARY_DIR}/upload_test_server.bat "SET PORT=%1\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/upload_test_server.bat "if x%1 == x ( SET PORT=COM8 )\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/upload_test_server.bat "avrdude -v -cstk500v1 -pm328p -b57600 -P\\\\.\\%PORT% -D -Uflash:w:test_server.hex:i\n")
-
-  FILE(WRITE ${CMAKE_BINARY_DIR}/upload_arduino_test.bat "SET PORT=%1\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/upload_arduino_test.bat "if x%1 == x ( SET PORT=COM8 )\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/upload_arduino_test.bat "avrdude -v -cstk500v1 -pm328p -b57600 -P\\\\.\\%PORT% -D -Uflash:w:arduino_test.hex:i\n")
-ELSE(WIN32)
-  FILE(WRITE ${CMAKE_BINARY_DIR}/generated/upload_test_server.sh "PORT=$1\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/upload_test_server.sh "if [ x$1 == x ]; then PORT=/dev/ttyUSB0; fi\n")
-  FILE(APPEND ${CMAKE_BINARY_DIR}/generated/upload_test_server.sh "avrdude -v -cstk500v1 -pm328p -b57600 -P$PORT -D -Uflash:w:test_server.hex:i\n")
-  FILE(COPY ${CMAKE_BINARY_DIR}/generated/upload_test_server.sh
-            DESTINATION ${CMAKE_BINARY_DIR}
-            FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
-  FILE(REMOVE ${CMAKE_BINARY_DIR}/generated/upload_test_server.sh)
-ENDIF(WIN32)


old switcharoo

old switcharoo

--- cmake/FindCOIN.cmake
+++ cmake/FindCOIN.cmake
@@ -151,7 +151,8 @@
     ENDIF(COIN_BZ2_LIBRARY)
     # Not required by cbc v2.5, but required by later versions in which case,
     # the lower line should be commented out and this line used
-    SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
+    #SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
+    SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_CLP_LIBRARY};${COIN_OSI_CLP_LIBRARIES}")
     #SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
     SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
 ENDIF(COIN_FOUND)


fix message

fix message

--- cmake/FindOgre.cmake
+++ cmake/FindOgre.cmake
@@ -214,7 +214,7 @@
             endif ()
         endif ()
         if (NOT OGRE_DEPS_FOUND)
-            pkg_message(OGRE "Could not find all required dependencies for the Ogre package.")
+            message(status "Could not find all required dependencies for the Ogre package.")
             set(OGRE_FOUND FALSE)
         endif ()
     endif()


Remove the unneeded xine cmake module

Remove the unneeded xine cmake module

--- cmake/FindXine.cmake
+++ cmake/FindXine.cmake
@@ -1,57 +0,0 @@
-# - Try to find the XINE  library
-# Once done this will define
-#
-#  XINE_FOUND - system has the XINE library
-#  XINE_VERSION - XINE version
-#  XINE_BUGFIX_VERSION - the XINE bugfix version
-#  XINE_INCLUDE_DIR - the XINE include directory
-#  XINE_LIBRARY - The libraries needed to use XINE
-#  XINE_XCB_FOUND - libxine can use XCB for video output
-
-# Copyright (c) 2008 Helio Chissini de Castro, <helio@kde.org>
-# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
-# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-if (XINE_INCLUDE_DIR AND XINE_LIBRARY)
-  # Already in cache, be silent
-  set(Xine_FIND_QUIETLY TRUE)
-endif (XINE_INCLUDE_DIR AND XINE_LIBRARY)
-
-IF (NOT WIN32)
-    FIND_PACKAGE(PkgConfig)
-	PKG_CHECK_MODULES(PKG_XINE libxine)
-ENDIF (NOT WIN32)
-
-FIND_PATH(XINE_INCLUDE_DIR NAMES xine.h
-    PATHS ${PKG_XINE_INCLUDE_DIRS} )
-
-FIND_LIBRARY(XINE_LIBRARY NAMES xine
- PATHS ${PKG_XINE_LIBRARY_DIRS} )
-
-if (XINE_INCLUDE_DIR AND XINE_LIBRARY)
-   macro_ensure_version(1.1.9 ${PKG_XINE_VERSION} XINE_VERSION_OK)
-   if (XINE_VERSION_OK)
-      set(XINE_FOUND TRUE)
-      string(REGEX REPLACE "[0-9].[0-9]." "" XINE_BUGFIX_VERSION ${PKG_XINE_VERSION})
-	  set(XINE_VERSION ${PKG_XINE_VERSION})
-   endif (XINE_VERSION_OK)
-endif (XINE_INCLUDE_DIR AND XINE_LIBRARY)
-
-
-if( XINE_FOUND )
-  INCLUDE(CheckCSourceCompiles)
-  SET(CMAKE_REQUIRED_INCLUDES ${XINE_INCLUDE_DIR})
-  SET(CMAKE_REQUIRED_LIBRARIES ${XINE_LIBRARY})
-  CHECK_C_SOURCE_COMPILES("#include <xine.h>\nint main()\n{\n  xine_open_video_driver(xine_new(), \"auto\", XINE_VISUAL_TYPE_XCB, NULL);\n  return 0;\n}\n" XINE_XCB_FOUND)
-endif(XINE_FOUND)
-
-if (XINE_FOUND)
-   if (NOT Xine_FIND_QUIETLY)
-      message(STATUS "Found XINE: ${XINE_LIBRARY}")
-   endif (NOT Xine_FIND_QUIETLY)
-endif (XINE_FOUND)
-
-MARK_AS_ADVANCED(XINE_INCLUDE_DIR XINE_LIBRARY)


cmake: Make non-vanilla CPU feat use -march=native

--- cmake/cpu_feat.cmake
+++ cmake/cpu_feat.cmake
@@ -1,2 +1,2 @@
-set(CAPABS "-mavx -maes -mfma -mfpmath=sse")
-message(STATUS "Using extended CPU features: AVX, AES, FMA. CAPABS = ${CAPABS}")
+set(CAPABS "-march=native -mfpmath=sse")
+message(STATUS "Using native CPU features. CAPABS = ${CAPABS}")


fixed wrong arguments in same cases

fixed wrong arguments in same cases

--- cmake/toplevel.cmake
+++ cmake/toplevel.cmake
@@ -19,7 +19,9 @@
   # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
   # or CMAKE_PREFIX_PATH from the environment
   if(NOT DEFINED CMAKE_PREFIX_PATH)
-    string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
+    if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
+      string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
+    endif()
   endif()

   # list of catkin workspaces


update test list file

update test list file

--- ctest/CTestTestfile.cmake
+++ ctest/CTestTestfile.cmake
@@ -1,4 +1,6 @@
-add_test(Test01 python ${CMAKE_CURRENT_SOURCE_DIR}/reg_tests/executeRegressionTestCase.py ${CMAKE_CURRENT_SOURCE_DIR}/build ${CMAKE_CURRENT_SOURCE_DIR}/reg_tests Test01 0.001)
-#add_test(Test02 python ${CMAKE_CURRENT_SOURCE_DIR}/reg_tests/executeRegressionTestCase.py ${CMAKE_CURRENT_SOURCE_DIR}/build ${CMAKE_CURRENT_SOURCE_DIR}/reg_tests Test02 0.001)
-#add_test(Test03 python ${CMAKE_CURRENT_SOURCE_DIR}/reg_tests/executeRegressionTestCase.py ${CMAKE_CURRENT_SOURCE_DIR}/build ${CMAKE_CURRENT_SOURCE_DIR}/reg_tests Test03 0.001)
-#add_test(Test04 python ${CMAKE_CURRENT_SOURCE_DIR}/reg_tests/executeRegressionTestCase.py ${CMAKE_CURRENT_SOURCE_DIR}/build ${CMAKE_CURRENT_SOURCE_DIR}/reg_tests Test04 0.001)
+
+add_test(Test01 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test01 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+#set_tests_properties(Test01 PROPERTIES ENVIRONMENT "CTEST_OUTPUT_ON_FAILURE=1" TIMEOUT 1000 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" LABELS "regression")
+#add_test(Test02 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test02 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+#add_test(Test03 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test03 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)
+#add_test(Test04 python ${CTEST_SOURCE_DIRECTORY}/reg_tests/executeRegressionTestCase.py Test04 ${CTEST_SOURCE_DIRECTORY}/install/bin/openfast ${CTEST_SOURCE_DIRECTORY} 0.001)


fix the destination dir for qt dependencies

related #261, #262, #263

--- cmake/DeployQt.cmake
+++ cmake/DeployQt.cmake
@@ -53,8 +53,7 @@
         COMMENT "Deploying Qt..."
     )

-    install(DIRECTORY \"$<TARGET_FILE_DIR:${target}}>/windeployqt\"
-        DESTINATION ${CMAKE_INSTALL_BINDIR})
+    install(DIRECTORY \"$<TARGET_FILE_DIR:${target}}>/windeployqt\" DESTINATION bin)

     # windeployqt doesn't work correctly with the system runtime libraries,
     # so we fall back to one of CMake's own modules for copying them over


Fix GLFW find script

Fix GLFW find script

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -70,10 +70,17 @@
     /src # for from-source builds

     DOC "The GLFW library")
-
-set(GLFW_LIBRARIES
-    optimized   ${GLFW_LIBRARY_RELEASE}
-    debug       ${GLFW_LIBRARY_DEBUG})
+
+set(GLFW_LIBRARIES "")
+if(GLFW_LIBRARY_RELEASE AND GLFW_LIBRARY_DEBUG)
+    set(GLFW_LIBRARIES
+        optimized   ${GLFW_LIBRARY_RELEASE}
+        debug       ${GLFW_LIBRARY_DEBUG})
+elseif(GLFW_LIBRARY_RELEASE)
+    set(GLFW_LIBRARIES ${GLFW_LIBRARY_RELEASE})
+elseif(GLFW_LIBRARY_DEBUG)
+    set(GLFW_LIBRARIES ${GLFW_LIBRARY_DEBUG})
+endif()

 if(WIN32)


build: search for libjami also

build: search for libjami also

Change-Id: I5a78e77d34ce19372e3785f93c997274e6a5c647

--- cmake/FindRing.cmake
+++ cmake/FindRing.cmake
@@ -25,6 +25,15 @@
    PATHS ${CMAKE_INSTALL_PREFIX}/bin
 )

+IF(${ring_BIN} MATCHES "")
+   FIND_LIBRARY(ring_BIN NAMES jami
+      PATHS ${RING_BUILD_DIR}/.libs
+      PATHS ${CMAKE_INSTALL_PREFIX}/lib
+      PATHS ${CMAKE_INSTALL_PREFIX}/libexec
+      PATHS ${CMAKE_INSTALL_PREFIX}/bin
+   )
+ENDIF()
+
 # Try a static version too
 IF(${ring_BIN} MATCHES "")
    SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.lib")
@@ -35,6 +44,14 @@
       PATHS ${CMAKE_INSTALL_PREFIX}/libexec
    )

+   IF(${ring_BIN} MATCHES "")
+      FIND_LIBRARY(ring_BIN NAMES jami
+         PATHS ${RING_BUILD_DIR}/.libs
+         PATHS ${CMAKE_INSTALL_PREFIX}/lib
+         PATHS ${CMAKE_INSTALL_PREFIX}/libexec
+      )
+   ENDIF()
+
 IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
    ADD_DEFINITIONS(-fPIC)
 ENDIF()


enable OpenMP by default when using gfortran

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -1,5 +1,5 @@
 set(CMAKE_BUILD_TYPE_INIT "Release")

 if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
-  set(CMAKE_Fortran_FLAGS_INIT "-Wall -Wextra -Wconversion -std=f2008 -pedantic")
+  set(CMAKE_Fortran_FLAGS_INIT "-fopenmp -Wall -Wextra -Wconversion -std=f2008 -pedantic")
 endif()


missing braces

missing braces

--- cmake/prebuild.cmake
+++ cmake/prebuild.cmake
@@ -198,10 +198,10 @@
 if ("${TCORE}" STREQUAL "CORTEXA57")
     set(SGEMM_UNROLL_M 16)
     set(SGEMM_UNROLL_N 4)
-else
+else ()
     set(SGEMM_UNROLL_M 8)
     set(SGEMM_UNROLL_N 8)
-endif
+endif ()
     set(DGEMM_UNROLL_M 8)
     set(DGEMM_UNROLL_N 4)
     set(CGEMM_UNROLL_M 8)


Added compile flags for mgmt contrib in cmake config

Conflicts:

	build/cmake/CondorConfigure.cmake

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -362,11 +362,7 @@
 	endif()
 endif(NOT HPUX)

-if (WINDOWS)
-    if (WANT_CONTRIB AND WITH_MANAGEMENT)
-        set ( CONDOR_QMF condor_qmflib;${QPID_FOUND} ) # global scoping dep
-    endif()
-else() # *nix
+if (NOT WINDOWS)
     option(HAVE_SSH_TO_JOB "Support for condor_ssh_to_job" ON)
 endif()

@@ -496,6 +492,14 @@
 	add_dependencies( externals ${CONDOR_EXTERNALS} )
 endif(CONDOR_EXTERNALS AND NOT WINDOWS)

+######### special case for contrib
+if (WINDOWS AND WANT_CONTRIB AND WITH_MANAGEMENT)
+    # global scoping external linkage var when options enable.
+    set (CONDOR_QMF condor_qmflib;${QPID_FOUND})
+    add_definitions( -DWANT_CONTRIB )
+    add_definitions( -DWITH_MANAGEMENT )
+endif()
+
 message(STATUS "********* External configuration complete (dropping config.h) *********")
 dprint("CONDOR_EXTERNALS=${CONDOR_EXTERNALS}")


boards: qemu_riscv64: enable icount mode

Enable icount mode for qemu_riscv64 platform, The icount shift value
is selectd based on cpu clock frequency of this platform. The virtual
cpu will execute one instruction every 2^shift ns of virtual time.

Signed-off-by: Wentong Wu <a92ffab6ab5ff780cf36418e13a69a97399df0f5@intel.com>

--- boards/riscv/qemu_riscv64/board.cmake
+++ boards/riscv/qemu_riscv64/board.cmake
@@ -10,4 +10,7 @@
   -machine sifive_e
   )

+if(CONFIG_QEMU_ICOUNT)
+  list(APPEND QEMU_EXTRA_FLAGS -icount shift=6,align=off,sleep=off -rtc clock=vm)
+endif()
 board_set_debugger_ifnset(qemu)


Increased timeout download in CMake + remove unnecessary parameter

--- macros.cmake
+++ macros.cmake
@@ -209,11 +209,10 @@
     message(STATUS "Prepare downloading...
        src='${url}'
        dst='${file}'
-       timeout='timeout 300sec'")
+       timeout='1200sec'")

     file(DOWNLOAD ${url} ${file}
-            TIMEOUT 300
-            ${hash_args}
+            TIMEOUT 1200
             STATUS status
             SHOW_PROGRESS
             LOG log)


[modules] Remove -Rmodule-build because it breaks roottest.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -136,7 +136,7 @@
                              CXX_SUPPORTS_MODULES)
   set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
   if(CXX_SUPPORTS_MODULES)
-    set(ROOT_CXXMODULES_COMMONFLAGS "-fmodules -fmodules-cache-path=${CMAKE_BINARY_DIR}/include/pcms/ -fno-autolink -fdiagnostics-show-note-include-stack -Rmodule-build")
+    set(ROOT_CXXMODULES_COMMONFLAGS "-fmodules -fmodules-cache-path=${CMAKE_BINARY_DIR}/include/pcms/ -fno-autolink -fdiagnostics-show-note-include-stack")
     if (APPLE)
       # FIXME: TGLIncludes and alike depend on glew.h doing special preprocessor
       # trickery to override the contents of system's OpenGL.


Nagios Monitoring 7.10.4-rc1 Release Candidate 1

Signed-off-by: Gavin Halliday <2edfa8aca9fb78974188e5b35be8b52d4e4967ae@lexisnexis.com>

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


ctest: keep the load below the number of processors

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- test.cmake
+++ test.cmake
@@ -253,7 +253,7 @@
 if(WIN32)
    set(MAKE_ARGS "-k")
 else()
-   set(MAKE_ARGS "-j${number_of_processors} -k")
+   set(MAKE_ARGS "-j${number_of_processors} -l${number_of_processors} -k")
 endif()

 if(WIN32)


PROTON-2087: Fix the logic for detecting python modules

--- tools/cmake/Modules/CheckPythonModule.cmake
+++ tools/cmake/Modules/CheckPythonModule.cmake
@@ -37,7 +37,7 @@
 #   macro, usually by using find_package(PythonInterp).

 macro (CHECK_PYTHON_MODULE MODULE VARIABLE)
-  if (NOT DEFINED "${VARIABLE}" AND DEFINED "PYTHON_EXECUTABLE")
+  if (NOT ${VARIABLE} AND PYTHON_EXECUTABLE)
     execute_process(
       COMMAND ${PYTHON_EXECUTABLE} -c "import sys, pkgutil; sys.exit(0 if pkgutil.find_loader('${MODULE}') else 1)"
       RESULT_VARIABLE RESULT)


[CMake] use components for Qt5

[CMake] use components for Qt5

--- cmake-module/qt.cmake
+++ cmake-module/qt.cmake
@@ -6,8 +6,8 @@
     INCLUDE(${QT_USE_FILE})
     SET(PACKAGE_EXTRA_MACROS "include(${QT_USE_FILE})\n${PACKAGE_EXTRA_MACROS}")
   ELSE()
+    ADD_PROJECT_DEPENDENCY(Qt5 REQUIRED COMPONENTS Xml Core Widgets Gui OpenGL Network Concurrent)
     FOREACH (component "Xml" "Core" "Widgets" "Gui" "OpenGL" "Network" "Concurrent")
-      ADD_PROJECT_DEPENDENCY ("Qt5${component}" REQUIRED)
       LIST(APPEND PROJECT_QT_LIBS Qt5::${component})
     ENDFOREACH ()
     SET(GEPETTO_VIEWER_QTVERSION "${Qt5Core_VERSION}")


Add lint-fix support

Add lint-fix support

--- cmake/ClangTidy.cmake
+++ cmake/ClangTidy.cmake
@@ -1,5 +1,21 @@
 if(NOT CLANG_TIDY_COMMAND)
-    set(CLANG_TIDY_COMMAND "clang-tidy-9" "clang-tidy-8" "clang-tidy-7" "clang-tidy-6.0" "clang-tidy" CACHE STRING "Possible names of clang-tidy")
+    set(CLANG_TIDY_COMMAND
+        "clang-tidy-9"
+        "clang-tidy-8"
+        "clang-tidy-7"
+        "clang-tidy-6.0"
+        "clang-tidy"
+        CACHE STRING "Possible names of clang-tidy")
+endif()
+
+if(NOT CLANG_APPLY_REPLACEMENTS_COMMAND)
+    set(CLANG_APPLY_REPLACEMENTS_COMMAND
+        "clang-apply-replacements-9"
+        "clang-apply-replacements-8"
+        "clang-apply-replacements-7"
+        "clang-apply-replacements-6.0"
+        "clang-apply-replacements"
+        CACHE STRING "Possible names of clang-apply-replacements")
 endif()

 find_program(CLANG_TIDY_PROGRAM NAMES ${CLANG_TIDY_COMMAND})
@@ -17,14 +33,14 @@
 find_package(Python3)

 if(NOT Python3_FOUND)
-	return()
+    return()
 endif()

 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/lint.bash.in" "${CMAKE_CURRENT_BINARY_DIR}/tools/unexec/lint.bash" @ONLY NEWLINE_STYLE LF)
 file(COPY "${CMAKE_CURRENT_BINARY_DIR}/tools/unexec/lint.bash"
-	 DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/tools"
-	 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
-	 GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+     DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/tools"
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
+     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/tools/unexec")

 message(STATUS "Linting enabled through ./tools/lint.bash")
@@ -33,6 +49,13 @@
 add_custom_target(lint-by-file "${CMAKE_CURRENT_BINARY_DIR}/tools/lint.bash" "--sort" "file" USES_TERMINAL)
 add_custom_target(lint-by-diagnostic "${CMAKE_CURRENT_BINARY_DIR}/tools/lint.bash" "--sort" "diagnostic"  USES_TERMINAL)

+find_program(CLANG_APPLY_REPLACEMENTS_PROGRAM NAMES ${CLANG_APPLY_REPLACEMENTS_COMMAND})
+if(CLANG_APPLY_REPLACEMENTS_PROGRAM)
+    message(STATUS "Found clang-apply-replacements at ${CLANG_APPLY_REPLACEMENTS_PROGRAM}")
+    add_custom_target(lint-fix "${CMAKE_CURRENT_BINARY_DIR}/tools/lint.bash" "--sort" "file" "--fix" "--clang-apply-replacements" "${CLANG_APPLY_REPLACEMENTS_PROGRAM}" USES_TERMINAL)
+else()
+    message(STATUS "clang-apply-replacements not found")
+endif()
 # function(lint TARGET)
 #     add_custom_target(${TARGET}-lint VERBATIM)


Change ulink to rm -f to avoid the error when file not exist

--- cmake/CopyUtils.cmake
+++ cmake/CopyUtils.cmake
@@ -21,7 +21,7 @@
   FILE(TO_NATIVE_PATH ${_source} COPY_FILE_INTERNAL_native_source)
   FILE(TO_NATIVE_PATH ${_dest} COPY_FILE_INTERNAL_native_dest)
   ADD_CUSTOM_COMMAND(OUTPUT ${_dest}
-    COMMAND unlink ${COPY_FILE_INTERNAL_native_dest}
+    COMMAND rm -f ${COPY_FILE_INTERNAL_native_dest}
     COMMAND cp -Pp
       ${COPY_FILE_INTERNAL_native_source} ${COPY_FILE_INTERNAL_native_dest}
     DEPENDS ${_depends})


Adapted findCEGUI to find Version.h for win32 builds not using install

--- cmake/FindCEGUI.cmake
+++ cmake/FindCEGUI.cmake
@@ -446,11 +446,22 @@
 set(CEGUI_INCOMPATIBLE FALSE)
 if (CEGUI_INCLUDE_DIR)
     # determine CEGUI version
-    if(CEGUI_CONFIG_INCLUDE_DIR_PREFIX)
-        file(READ ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h CEGUI_TEMP_VERSION_CONTENT)
+
+    # Determine version file path
+    set(VERSION_FILE_PATH "")
+
+    if(EXISTS "${CEGUI_CONFIG_INCLUDE_DIR}/CEGUIVersion.h")
+        set(VERSION_FILE_PATH "${CEGUI_CONFIG_INCLUDE_DIR}/CEGUIVersion.h")
+    elseif(EXISTS "${CEGUI_INCLUDE_DIR}/Version.h")
+        set(VERSION_FILE_PATH "${CEGUI_INCLUDE_DIR}/Version.h")
+    elseif(EXISTS "${CEGUI_CONFIG_INCLUDE_DIR}/CEGUI/Version.h")
+        set(VERSION_FILE_PATH "${CEGUI_CONFIG_INCLUDE_DIR}/CEGUI/Version.h")
     else()
-        file(READ ${CEGUI_INCLUDE_DIR}/Version.h CEGUI_TEMP_VERSION_CONTENT)
+        message(SEND_ERROR "Could not find CEGUI's Version.h file!")
     endif()
+
+    file(READ ${VERSION_FILE_PATH} CEGUI_TEMP_VERSION_CONTENT)
+

     if (NOT "${CEGUI_TEMP_VERSION_CONTENT}" STREQUAL "")
         get_preprocessor_entry(CEGUI_TEMP_VERSION_CONTENT CEGUI_VERSION_MAJOR CEGUI_VERSION_MAJOR)


MOD: Adding new ICONV Cmake Find file.

MOD: Adding new ICONV Cmake Find file.

--- cmake/FindIconv.cmake
+++ cmake/FindIconv.cmake
@@ -1,44 +1,92 @@
+# taken from:
+# http://code.google.com/p/tinygettext/source/browse/trunk/FindICONV.cmake?spec=svn183&r=183
+
+#
+#  Copyright (c) 2006, Peter Kmmel, <syntheticpp@gmx.net>
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  1. Redistributions of source code must retain the copyright
+#     notice, this list of conditions and the following disclaimer.
+#  2. Redistributions in binary form must reproduce the copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#  3. The name of the author may not be used to endorse or promote products
+#     derived from this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+#  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+#  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+#  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+#  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+#  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+#  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
 ################################################################################
-# Custom cmake module for CEGUI to see if iconv exists
+# Adapted for CEGUI
 ################################################################################
-include(FindPackageHandleStandardArgs)
-include(CheckCXXSourceCompiles)

-find_path(ICONV_H_PATH NAMES iconv.h)
-find_library(ICONV_LIB NAMES iconv)
-
+set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
+include(CheckFunctionExists)
 if (ICONV_H_PATH)
-    check_cxx_source_compiles("
-    #include <iconv.h>
-    int main() {
-        iconv(0, 0, 0, 0, 0);
-        return 0;
-    }"
-
-    ICONV_LIB_GLIBC)
-
-    if (NOT ICONV_LIB_GLIBC)
-        find_package_handle_standard_args(Iconv DEFAULT_MSG ICONV_LIB ICONV_H_PATH)
-    else()
-        set(ICONV_FOUND TRUE)
-        unset(ICONV_LIB)
-    endif()
-
-    # This compiles a test to determine whether iconv API takes ptr to const or
-    # non-const as the input buffer
-    set (CMAKE_REQUIRED_LIBRARIES ${ICONV_LIB})
-    check_cxx_source_compiles("
-    #include <iconv.h>
-    int main() {
-        const char* inbuf = 0;
-        iconv(0, &inbuf, 0, 0, 0);
-        return 0;
-    }"
-
-    CEGUI_ICONV_USES_CONST_INBUF)
+  # Already in cache, be silent
+  set(ICONV_FIND_QUIETLY TRUE)
 endif()

-mark_as_advanced(ICONV_H_PATH ICONV_LIB ICONV_LIB_GLIBC)
+find_path(ICONV_H_PATH iconv.h
+ /usr/include
+ /usr/local/include)
+
+set(POTENTIAL_ICONV_LIBS iconv libiconv libiconv2)
+
+find_library(ICONV_LIB NAMES ${POTENTIAL_ICONV_LIBS}
+	PATHS /usr/lib /usr/local/lib)
+
+if(WIN32)
+	set(ICONV_DLL_NAMES iconv.dll  libiconv.dll libiconv2.dll)
+	find_file(ICONV_DLL
+					NAMES ${ICONV_DLL_NAMES}
+					PATHS ENV PATH
+					NO_DEFAULT_PATH)
+	find_file(ICONV_DLL_HELP
+					NAMES ${ICONV_DLL_NAMES}
+					PATHS ENV PATH
+					${ICONV_H_PATH}/../bin)
+	if(ICONV_FIND_REQUIRED)
+		if(NOT ICONV_DLL AND NOT ICONV_DLL_HELP)
+			message(FATAL_ERROR "Could not find iconv.dll, please add correct your PATH environment variable")
+		endif()
+		if(NOT ICONV_DLL AND ICONV_DLL_HELP)
+			get_filename_component(ICONV_DLL_HELP ${ICONV_DLL_HELP} PATH)
+			message(STATUS)
+			message(STATUS "Could not find iconv.dll in standard search path, please add ")
+			message(STATUS "${ICONV_DLL_HELP}")
+			message(STATUS "to your PATH environment variable.")
+			message(STATUS)
+			message(FATAL_ERROR "exit cmake")
+		endif()
+	endif()
+	if(ICONV_H_PATH AND ICONV_LIB AND ICONV_DLL)
+   		set(ICONV_FOUND TRUE)
+	endif()
+else()
+	check_function_exists(iconv HAVE_ICONV_IN_LIBC)
+	if(ICONV_H_PATH AND HAVE_ICONV_IN_LIBC)
+   		set(ICONV_FOUND TRUE)
+		set(ICONV_LIB  CACHE TYPE STRING FORCE)
+	endif()
+	if(ICONV_H_PATH AND ICONV_LIB)
+   		set(ICONV_FOUND TRUE)
+	endif()
+endif()
+
+mark_as_advanced(ICONV_H_PATH ICONV_LIB)

 # set up output vars
 if (ICONV_FOUND)


Fix detection of Scala

Fix detection of Scala

--- cmake/FindScala.cmake
+++ cmake/FindScala.cmake
@@ -6,6 +6,8 @@
   /sw
   /usr
   /usr/share/java
+  /usr/share/scala
+  /usr/share/scala/lib
   )

 find_package(Java COMPONENTS Runtime)
@@ -25,29 +27,31 @@
   PATHS ${_SCALA_PATHS}
   )

-find_jar(Scala_JAR_EXECUTABLE "scala-library")
+find_jar(Scala_JAR_EXECUTABLE
+  NAMES "scala-library"
+  PATHS ${_SCALA_PATHS}
+  )

-if(Scala_SCALA_EXECUTABLE)
-    execute_process(COMMAND ${Scala_SCALA_EXECUTABLE} -version
-      RESULT_VARIABLE SCALA_SEARCH_SUCCESS
-      OUTPUT_VARIABLE SCALA_VERSION
-      ERROR_VARIABLE SCALA_VERSION
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-      ERROR_STRIP_TRAILING_WHITESPACE)
-    if( SCALA_SEARCH_SUCCESS )
-      message( FATAL_ERROR "Error executing scala -version" )
-    else()
-      string(TOLOWER ${SCALA_VERSION} SCALA_VERSION)
-      string( REGEX REPLACE ".*([0-9]+\\.[0-9]+\\.[0-9_.]+.*)" "\\1" SCALA_VERSION "${SCALA_VERSION}" )
-      string( REGEX REPLACE "([0-9]+\\.[0-9]+\\.[0-9_.]).*" "\\1" SCALA_VERSION ${SCALA_VERSION} )
-    endif()
+if( "${Scala_SCALA_EXECUTABLE}" MATCHES "Scala_SCALA_EXECUTABLE-NOTFOUND" )
+  message( FATAL_ERROR "Error executing scala -version" )
+else()
+  execute_process(COMMAND ${Scala_SCALA_EXECUTABLE} -version
+    RESULT_VARIABLE SCALA_SEARCH_SUCCESS
+    OUTPUT_VARIABLE SCALA_VERSION
+    ERROR_VARIABLE SCALA_VERSION
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    ERROR_STRIP_TRAILING_WHITESPACE
+    )
+    string(TOLOWER ${SCALA_VERSION} SCALA_VERSION)
+    string( REGEX REPLACE ".*([0-9]+\\.[0-9]+\\.[0-9_.]+.*)" "\\1" SCALA_VERSION "${SCALA_VERSION}" )
+    string( REGEX REPLACE "([0-9]+\\.[0-9]+\\.[0-9_.]).*" "\\1" SCALA_VERSION ${SCALA_VERSION} )
 endif()

 include(FindPackageHandleStandardArgs)
 if (CMAKE_VERSION LESS 2.8.3)
   find_package_handle_standard_args(SCALA DEFAULT_MSG Scala_SCALA_EXECUTABLE)
 else ()
-  find_package_handle_standard_args(SCALA
+  find_package_handle_standard_args(SCALA
       REQUIRED_VARS Scala_SCALA_EXECUTABLE Scala_SCALAC_EXECUTABLE Scala_JAR_EXECUTABLE
       VERSION_VAR SCALA_VERSION)
 endif ()


[MSan] Enable on PowerPC64.

[MSan] Enable on PowerPC64.

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

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@269522 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -183,7 +183,7 @@
     ${MIPS32} ${MIPS64} ${PPC64})
 set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
 set(ALL_LSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
-set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
+set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64})
 set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64}
     ${MIPS32} ${MIPS64})
 set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64})


Refactor setting toolchain in cmake.

Refactor setting toolchain in cmake.

--- cmake/toolchain.cmake
+++ cmake/toolchain.cmake
@@ -5,25 +5,31 @@
         set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
         set(CMAKE_ASM_COMPILER "arm-none-eabi-as")

-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfpu=fpv4-sp-d16 -fno-common -ffunction-sections -fdata-sections -static -lgcc")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdlib -fno-exceptions -fno-unwind-tables -fno-rtti")
-        #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc")                 # Do not include standard headers.
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-threadsafe-statics")   # Do not produce code to initialize statics in thread-safe way.
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}")
+        set(COMMON_FLAGS "-mcpu=cortex-a8 -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fno-common -ffunction-sections -fdata-sections -static -lgcc -Wall -Wextra -nostartfiles -nostdinc -nostdlib")
         set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
         set(CMAKE_EXECUTABLE_SUFFIX ".elf")

         # Set linker script.
-        set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-T ${COSMOS_BOARD_PATH}/${COSMOS_TARGET}.ld")
+        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T ${COSMOS_BOARD_PATH}/${COSMOS_TARGET}.ld")
         set(CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE} "-s")

-        # Set compilation flags.
-        set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++14 -Wall -Wextra")
-        set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} "-O0")
-        set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} "-O2 -Werror")
+        # Set C compilation flags.
+        set(CMAKE_C_FLAGS "${COMMON_FLAGS} -std=c11")
+        set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
+        set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -Werror")

+        # Set C++ compilation flags.
+        set(CMAKE_CXX_FLAGS "${COMMON_FLAGS} -std=c++14")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-unwind-tables")    # Disable C++ exceptions support, because it requires libc.
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")                             # Disable C++ run time information, because it requires libc.
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics")               # Do not produce code to initialize statics in thread-safe way.
+        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
+        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -Werror")
     endif()

+    string(REGEX REPLACE ";" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+    string(REGEX REPLACE ";" " " CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
+    string(REGEX REPLACE ";" " " CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
     string(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
     string(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
     string(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
@@ -31,8 +37,9 @@
     string(REGEX REPLACE ";" " " CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")

     message(STATUS "Setting toolchain to:")
-    message(STATUS "  C compiler     : ${CMAKE_C_COMPILER}")
-    message(STATUS "  C++ compiler   : ${CMAKE_CXX_COMPILER}")
-    message(STATUS "  assembler      : ${CMAKE_ASM_COMPILER}")
-    message(STATUS "  compiler flags : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+    message(STATUS "  C compiler         : ${CMAKE_C_COMPILER}")
+    message(STATUS "  C++ compiler       : ${CMAKE_CXX_COMPILER}")
+    message(STATUS "  assembler          : ${CMAKE_ASM_COMPILER}")
+    message(STATUS "  C compiler flags   : ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
+    message(STATUS "  C++ compiler flags : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
 endmacro()


TEST: update test args and workdir

TEST: update test args and workdir


Fix order of getting CMake variable for propagation to ITK

Add documentation to 64bits ids detection

Change-Id: Ib2e78bf6a91b3cda0f8646eed23a02764bdf6844

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -2,10 +2,8 @@
 #-----------------------------------------------------------------------------
 # Get and build itk

-get_cmake_property( _varNames VARIABLES )
-
+# Determine if we need to set to use 64BITS_IDS for windows64
 include(CheckTypeSize)
-
 check_type_size(size_t SITK_SIZEOF_SIZE_T)
 check_type_size(long SITK_SIZEOF_LONG)

@@ -21,6 +19,8 @@
   ${ITK_USE_64BITS_IDS_DEFAULT})
 mark_as_advanced(ITK_USE_64BITS_IDS)

+
+get_cmake_property( _varNames VARIABLES )

 foreach (_varName ${_varNames})
   if(_varName MATCHES "^ITK_" OR _varName MATCHES "FFTW")


Enable git-protocol control on VTK superbuild

--- SuperBuild/External_VTK.cmake
+++ SuperBuild/External_VTK.cmake
@@ -160,7 +160,7 @@
       ${VTK_MAC_ARGS}
     )
   ### --- End Project specific additions
-  set(${proj}_REPOSITORY https://github.com/Kitware/VTK.git)
+  set(${proj}_REPOSITORY ${git_protocol}://github.com/Kitware/VTK.git)
   set(${proj}_GIT_TAG acc5f269186e3571fb2a10af4448076ecac75e8e )
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}


[brief] Fixes atlas clang compiler variable name.

[detailed]

--- config/Compiler.cmake
+++ config/Compiler.cmake
@@ -40,7 +40,7 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")

     # Clang requires an additional library to be linked to use C++11.
-    if (ATLAS_COMPILER_APPLE_CLANG)
+    if (ATLAS_COMPILER_CLANG)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
     endif()
 endif()


use alignmend for boost ublas also on OSX

--- cmake/UbiTrackFindCoreLibraries.cmake
+++ cmake/UbiTrackFindCoreLibraries.cmake
@@ -37,10 +37,10 @@
 # always use supplied boost bindings
 set(BOOSTBINDINGS_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/modules/utcore/3rd/boost-bindings")
 add_subdirectory("${CMAKE_SOURCE_DIR}/modules/utcore/3rd/boost-bindings")
-IF(CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND (APPLE_CLANG_VERSION VERSION_GREATER 3.3)))
+IF(NOT WIN32)
   MESSAGE(STATUS "set boost::ublas alignment to 16")
   add_definitions("-DBOOST_UBLAS_BOUNDED_ARRAY_ALIGN=__attribute__ ((aligned (16)))")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND (APPLE_CLANG_VERSION VERSION_GREATER 3.3)))
+ENDIF(NOT WIN32)
 add_definitions(-DBOOST_SPIRIT_USE_OLD_NAMESPACE)
 set(HAVE_BOOSTBINDINGS 1)


Use -Wcast-qual in cmake builds, not only autoconfo ones.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -276,6 +276,7 @@
 elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
   if (LLVM_ENABLE_WARNINGS)
     append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    append("-Wcast-qual" CMAKE_CXX_FLAGS)

     # Turn off missing field initializer warnings for gcc to avoid noise from
     # false positives with empty {}. Turn them on otherwise (they're off by


build: fix syntax error in FreeBSD section of configure_sdk_unix

--- cmake/modules/SwiftConfigureSDK.cmake
+++ cmake/modules/SwiftConfigureSDK.cmake
@@ -374,7 +374,7 @@
           message(FATAL_ERROR "unsupported arch for FreeBSD: ${arch}")
         endif()

-        if(CMAKE_HOST_SYSTEM_NAME NOT STREQUAL FreeBSD)
+        if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL FreeBSD)
           message(WARNING "CMAKE_SYSTEM_VERSION will not match target")
         endif()


CMake: when looking for an internal SDK, check for the 'PrivateFrameworks' dir

Swift SVN r32333

--- cmake/modules/SwiftConfigureSDK.cmake
+++ cmake/modules/SwiftConfigureSDK.cmake
@@ -89,7 +89,7 @@
           COMMAND "xcrun" "--sdk" "${xcrun_name}.internal" "--show-sdk-path"
           OUTPUT_VARIABLE SWIFT_SDK_${prefix}_PATH
           OUTPUT_STRIP_TRAILING_WHITESPACE)
-      if(NOT EXISTS "${SWIFT_SDK_${prefix}_PATH}/System/Library/Frameworks/module.map")
+      if(NOT EXISTS "${SWIFT_SDK_${prefix}_PATH}/System/Library/PrivateFrameworks")
         message(FATAL_ERROR "Internal ${name} SDK not found at SWIFT_SDK_${prefix}_PATH.")
       endif()
     endif()


cmake/DaemonCBSE: find python again if currently cached python path is invalid

--- cmake/DaemonCBSE.cmake
+++ cmake/DaemonCBSE.cmake
@@ -26,7 +26,7 @@

 # Allow overriding the python path with a cached variable.
 set(DAEMON_CBSE_PYTHON_PATH "NOTFOUND" CACHE FILEPATH "Python executable for CBSE code generation")
-if (NOT DAEMON_CBSE_PYTHON_PATH)
+if (NOT DAEMON_CBSE_PYTHON_PATH OR NOT EXISTS DAEMON_CBSE_PYTHON_PATH)
     find_package(Python REQUIRED)
     set(DAEMON_CBSE_PYTHON_PATH "${Python_EXECUTABLE}" CACHE FILEPATH "Python executable for CBSE code generation" FORCE)
 endif()


Add target build_pdf to automatically generate the pdf

--- cmake/FindSphinx.cmake
+++ cmake/FindSphinx.cmake
@@ -120,9 +120,28 @@
   endif()

   if( ${SPHINX_LATEX_OUTPUT} )
+    find_package( LATEX )
+    if( NOT PDFLATEX_COMPILER )
+      message("pdflatex compiler was not found. Please pass to advanced mode and provide its full path")
+    else( NOT PDFLATEX_COMPILER )
+    endif()
+
     Sphinx_add_target( ${target_base_name}_latex latex ${conf} ${source} ${base_destination}/latex )

     add_dependencies( ${target_base_name}_latex ${_dependencies} )
+
+    file( GLOB _texfile
+      RELATIVE "${base_destination}/latex"
+      "${base_destination}/latex/*.tex"
+      )
+
+    add_custom_target( ${target_base_name}_pdf ALL
+      COMMAND ${PDFLATEX_COMPILER}
+        ${base_destination}/latex/${_texfile}
+        -output-directory ${base_destination}/latex
+      WORKING_DIRECTORY ${base_destination}/latex
+      DEPENDS ${target_base_name}_latex
+      )
   endif()

   if( ${SPHINX_MAN_OUTPUT} )


fix(qt): another attempt to suppress Qt 5.0 warnings with clang

--- cmake/consort/qt.cmake
+++ cmake/consort/qt.cmake
@@ -175,9 +175,9 @@
 			if(CONSORT_CLANG AND NOT APPLE)
 				# Clang seems to be generating warnings from Qt headers, even though
 				# -isystem is used
-				foreach(m Core ${_modules})
-					list(APPEND CONSORT_COMPILE_FLAGS "-isystem-prefix=Qt${m}/")
-				endforeach()
+				find_path(_qt_include_dir QtCore PATHS ${Qt5Core_INCLUDE_DIRS} NO_DEFAULT_PATH)
+				get_filename_component(_qt_include_dir "${_qt_include_dir}/.." ABSOLUTE)
+				list(APPEND CONSORT_COMPILE_FLAGS "-isystem-prefix=${_qt_include_dir}")
 			endif()

 			if( NOT QT_TRANSLATIONS_DIR)


switch libpng download source, the old one was incomplete adjust build command

--- cmake/get-libpng.cmake
+++ cmake/get-libpng.cmake
@@ -29,15 +29,16 @@
   DEPENDS             zlib
   PREFIX              ${DEPENDENCY_EXTRACT_DIR}
   DOWNLOAD_DIR        ${DEPENDENCY_DOWNLOAD_DIR}
-  URL                 ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/lpng1624.zip
-  URL_MD5             9572a426a87407f6cfa41f61cbe2e3b2
+  URL                 https://github.com/glennrp/libpng/archive/v1.6.24.zip
+  URL_MD5             8e8d519124c7c6a2b7ec72a23c453fbd
   INSTALL_DIR         ${DEPENDENCY_INSTALL_DIR}
   CONFIGURE_COMMAND   ${CMAKE_COMMAND} ${DEPENDENCY_EXTRACT_DIR}/src/libpng
          -G ${CMAKE_GENERATOR}
          -DZLIB_INCLUDE_DIR:PATH=${DEPENDENCY_INSTALL_DIR}/zlib/include
          -DZLIB_LIBRARY:FILEPATH=${DEPENDENCY_INSTALL_DIR}/zlib/lib/zlib.lib
          -DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
-  BUILD_COMMAND       msbuild libpng.sln /build Release /project png16
-  INSTALL_COMMAND     msbuild libpng.sln /build Release /project INSTALL
+  BUILD_COMMAND       ${CMAKE_COMMAND} --build ${DEPENDENCY_EXTRACT_DIR}/src/libpng-build --config Release --target INSTALL
+  #BUILD_COMMAND       msbuild libpng.sln /target:INSTALL /p:Platform=Win32 /p:Configuration=Release
+  #INSTALL_COMMAND     msbuild libpng.sln /build Release /project INSTALL
   #CMAKE_ARGS   ${LIBPNG_CMAKE_ARGS}
 )


Fixed parsing of gcc version

Fixed parsing of gcc version

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

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

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


Adding basic detection for the GNU quadmath library

--- cmake/tests/Math.cmake
+++ cmake/tests/Math.cmake
@@ -1,3 +1,8 @@
+
+# Default locations (currently, Linux-centric) for searching for math libs
+# ========================================================================
+set(MATH_PATHS "/usr/lib" "/usr/lib/openmpi/lib" "/usr/lib/gcc/x86_64-linux-gnu/4.8" "/lib/x86_64-linux-gnu" "/usr/lib/x86_64-linux-gnu")
+
 # Check for BLAS and LAPACK support
 # =================================
 if(EL_PURE)
@@ -27,11 +32,11 @@
 else()
   # Look for default BLAS and LAPACK
   if(REFERENCE_ROOT)
-    message(STATUS "Searching REFERENCE_ROOT=${REFERENCE_ROOT} for math libs")
+    message(STATUS "Searching REFERENCE_ROOT=${REFERENCE_ROOT} first for math libs")
   endif()
   set(REFERENCE_REQUIRED LAPACK BLAS)
-  find_library(BLAS_LIB NAMES blas PATHS ${REFERENCE_ROOT})
-  find_library(LAPACK_LIB NAMES lapack reflapack PATHS ${REFERENCE_ROOT})
+  find_library(BLAS_LIB NAMES blas HINTS ${REFERENCE_ROOT} PATHS ${MATH_PATHS})
+  find_library(LAPACK_LIB NAMES lapack reflapack HINTS ${REFERENCE_ROOT} PATHS ${MATH_PATHS})
   set(REFERENCE_FOUND TRUE)
   foreach(NAME ${REFERENCE_REQUIRED})
     if(${NAME}_LIB)
@@ -129,3 +134,26 @@
     message(STATUS "ScaLAPACK was NOT detected.")
   endif()
 endif()
+
+# Check for quad-precision support
+# ================================
+if(NOT EL_DISABLE_QUAD)
+  find_library(QUADMATH_LIB NAMES quadmath PATHS ${MATH_PATHS})
+  if(QUADMATH_LIB)
+    set(CMAKE_REQUIRED_LIBRARIES ${QUADMATH_LIB})
+    set(QUADMATH_CODE
+      "#include <iostream>
+       #include <quadmath.h>
+       int main( int argc, char* argv[] )
+       {
+           __float128 a = 2.0q;
+           __complex128 z;
+
+           char aStr[128];
+           quadmath_snprintf( aStr, sizeof(aStr), \"%Q\", a );
+           std::cout << aStr << std::endl;
+           return 0;
+       }")
+    check_cxx_source_compiles("${QUADMATH_CODE}" EL_HAVE_QUADMATH)
+  endif()
+endif()


Disable a broken Clang warning.

Disable a broken Clang warning.

See: http://permalink.gmane.org/gmane.comp.compilers.clang.scm/60466

--- cmake/SetFlags.cmake
+++ cmake/SetFlags.cmake
@@ -24,6 +24,7 @@
 		set(F_WARN "${F_WARN} -Wno-c++98-compat-pedantic")
 		set(F_WARN "${F_WARN} -Wno-global-constructors")
 		set(F_WARN "${F_WARN} -Wno-undefined-reinterpret-cast")
+		set(F_WARN "${F_WARN} -Wno-disabled-macro-expansion")

 		set(F_DBG "${F_WARN} -std=c++1y -g -O0 -fno-omit-frame-pointer")
 		set(F_DBG "${F_DBG} -fsanitize=address -fsanitize=undefined")


Fix clang version retrieval on Windows

Fix clang version retrieval on Windows

--- cmake/libclang.cmake
+++ cmake/libclang.cmake
@@ -1,14 +1,3 @@
-
-# Adapted from https://github.com/biicode/boost
-function(clangxx_version _ret)
-    clangxx_executable(clangxx)
-
-    execute_process( COMMAND ${clangxx} --version OUTPUT_VARIABLE version_string_full )
-    string (REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" version_string ${version_string_full})
-
-    set(${_ret} ${version_string} PARENT_SCOPE)
-endfunction()
-
 function(clangxx_executable _ret)
     if(CMAKE_CXX_COMPILER_ID  MATCHES "Clang")
         set(${_ret} "${CMAKE_CXX_COMPILER}" PARENT_SCOPE)
@@ -29,6 +18,47 @@
     endif()
 endfunction()

+# Adapted from https://github.com/biicode/boost
+function(clangxx_version _ret)
+    clangxx_executable(clangxx)
+
+    if(WIN32)
+        # All this stuff around execute_process() is to handle Windows paths with spaces
+        # such as "C:\Program Files (x86)\foo\"
+        # I love Windows
+        get_filename_component(dir "${clangxx}" DIRECTORY)
+        get_filename_component(name "${clangxx}" NAME)
+
+        execute_process(
+            COMMAND ${name} --version
+            OUTPUT_VARIABLE stdout
+            ERROR_VARIABLE stderr
+            RESULT_VARIABLE result_code
+            WORKING_DIRECTORY "${dir}"
+        )
+    else()
+        execute_process(
+            COMMAND ${clangxx} --version
+            OUTPUT_VARIABLE stdout
+            ERROR_VARIABLE stderr
+            RESULT_VARIABLE result_code
+            WORKING_DIRECTORY "${dir}"
+        )
+    endif()
+
+    string(REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" version_string "${stdout}")
+
+    if(SIPLASPLAS_VERBOSE_CONFIG)
+        message(STATUS "clang executable: ${clangxx}")
+        message(STATUS "clang version output: ${stdout}")
+        message(STATUS "clang version error: ${stderr}")
+        message(STATUS "clang version result code: ${result_code}")
+        message(STATUS "clang version parsed: ${version_string}")
+    endif()
+
+    set(${_ret} ${version_string} PARENT_SCOPE)
+endfunction()
+
 if(NOT SIPLASPLAS_LIBCLANG_VERSION)
     # Set libclang version to the installed clang version
     clangxx_version(SIPLASPLAS_LIBCLANG_VERSION)
@@ -107,7 +137,37 @@
     endif()
     set(SIPLASPLAS_LIBCLANG_INCLUDE_DIR "${llvm_root}/include")
     set(SIPLASPLAS_LIBCLANG_SYSTEM_INCLUDE_DIR "${llvm_root}/lib/clang/${SIPLASPLAS_LIBCLANG_VERSION}/include")
+else()
+    if(NOT SIPLASPLAS_LIBCLANG_LIBRARY)
+        if(WIN32)
+            clangxx_executable(clangxx)
+            get_filename_component(llvm_bin "${clangxx}" DIRECTORY)
+            message(STATUS "LLVM/bin/: ${llvm_bin}")
+            find_library(libclang_library
+                NAMES clang libclang.dll
+                HINTS "${llvm_bin}"
+            )
+        else()
+            find_library(libclang_library clang libclang)
+        endif()
+
+        if(NOT libclang_library AND EXISTS "${llvm_bin}/libclang.dll")
+            message(STATUS "${llvm_bin}/libclang.dll found by cmake FS IO")
+            set(libclang_library "${llvm_bin}/libclang.dll")
+        endif()
+
+        if(libclang_library)
+            set(SIPLASPLAS_LIBCLANG_LIBRARY "${libclang_library}")
+        else()
+            message(FATAL_ERROR "libclang library not found")
+        endif()
+    endif()
 endif()
+
+message(STATUS "libclang version: ${SIPLASPLAS_LIBCLANG_VERSION}")
+message(STATUS "libclang library: ${SIPLASPLAS_LIBCLANG_LIBRARY}")
+message(STATUS "libclang include dir: ${SIPLASPLAS_LIBCLANG_INCLUDE_DIR}")
+message(STATUS "libclang system include dir: ${SIPLASPLAS_LIBCLANG_SYSTEM_INCLUDE_DIR}")

 function(gxx_executable _ret)
     if(SIPLASPLAS_GXX)


On Solaris,  overwrite CMake's proposed thread library -lthread with -lpthread.  -lthread works fine in most cases, but at least with gcc 3.4.6 on x86, dlopen() crashes when libpthread is not used.  Note : the workaround existed prior and did not work  since CMAKE_THREADS_LIBS_INIT was already  in cache.  Now, use SET(.. CACHE FORCE)  to overwrite the cached value.

--- cmake/os/SunOS.cmake
+++ cmake/os/SunOS.cmake
@@ -30,7 +30,7 @@

 # CMake defined -lthread as thread flag. This crashes in dlopen
 # when trying to load plugins workaround with -lpthread
-SET(CMAKE_THREADS_LIBS_INIT -lpthread CACHE INTERNAL "")
+SET(CMAKE_THREADS_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE)

 # Solaris specific large page support
 CHECK_SYMBOL_EXISTS(MHA_MAPSIZE_VA sys/mman.h  HAVE_DECL_MHA_MAPSIZE_VA)


Fix providers with RMA Event and RMA Target RX

--- cmake/provider.cmake
+++ cmake/provider.cmake
@@ -67,7 +67,8 @@
         if(OFI.RMA.EVENT)
             set(OFI_CAPS "${OFI_CAPS} RMAEvent")
             add_definitions(-DOFI_RMA_EVENT)
-        elseif(OFI.RMA.TARGET.RX)
+        endif()
+        if(OFI.RMA.TARGET.RX)
             set(OFI_CAPS "${OFI_CAPS} RMATargetRx")
             add_definitions(-DOFI_RMA_TARGET_RX)
         endif()


wxwidgets use script enhancements

wxwidgets use script enhancements

* set wx::${lib} target properties INTERFACE_[INCLUDE_DIRECTORIES|COMPILE_DEFINITIONS] on unix
* issue https://github.com/smanders/externpro/issues/244

--- projects/use/usexp-wxwidgets-config.cmake
+++ projects/use/usexp-wxwidgets-config.cmake
@@ -146,6 +146,16 @@
           IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C;CXX"
           IMPORTED_LOCATION_RELEASE "${${lib}_RELEASE}"
           )
+        if(${PRJ}_INCLUDE_DIR)
+          set_target_properties(wx::${lib} PROPERTIES
+            INTERFACE_INCLUDE_DIRECTORIES "${${PRJ}_INCLUDE_DIR}"
+            )
+        endif()
+        if(${PRJ}_DEFINITIONS)
+          set_target_properties(wx::${lib} PROPERTIES
+            INTERFACE_COMPILE_DEFINITIONS "${${PRJ}_DEFINITIONS}"
+            )
+        endif()
         if(_wx_${lib}_deps OR _wx_${lib}_link OR _wx_${lib}_libs)
           unset(linkLibs)
           foreach(dep ${_wx_${lib}_deps})