minor fix in cmake.config generation - do not force client libs to include numpy include dirs

--- cmake/ConfigGen.cmake
+++ cmake/ConfigGen.cmake
@@ -10,6 +10,17 @@
   # remove at most one ${PROJECT_BINARY_DIR} include added for caffe_config.h
   list(FIND current_includes ${PROJECT_BINARY_DIR} __index)
   list(REMOVE_AT current_includes ${__index})
+
+  # removing numpy includes (since not required for client libs)
+  set(__toremove "")
+  foreach(__i ${current_includes})
+    if(${__i} MATCHES "python")
+      list(APPEND __toremove ${__i})
+    endif()
+  endforeach()
+  if(__toremove)
+    list(REMOVE_ITEM current_includes ${__toremove})
+  endif()

   caffe_list_unique(current_includes)
   set(${includes_variable} ${current_includes} PARENT_SCOPE)


Remove the useless get_filename_component() - the result isn't used anywhere and it just doesn't work either.

--- cmake/FindGLIB2.cmake
+++ cmake/FindGLIB2.cmake
@@ -25,8 +25,6 @@
              NAMES glib-2.0
              PATHS ${PKG_GLIB_LIBRARY_DIRS} )

-get_filename_component(glib2LibDir ${PKG_GLIB_LIBRARIES} PATH)
-
 find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
           PATH_SUFFIXES glib-2.0/include
           PATHS ${PKG_GLIB_INCLUDE_DIRS} ${PKG_GLIB_LIBRARIES} ${CMAKE_SYSTEM_LIBRARY_PATH})


[cmake] copy the latest axl_cmake.cmake dropper

--- cmake/axl_cmake.cmake
+++ cmake/axl_cmake.cmake
@@ -107,7 +107,7 @@
 		if (NOT _PATHS_CMAKE)
 			include (${AXL_CMAKE_ORIGIN_DIR}/dependencies.cmake)
 			string (REPLACE ";" " " _PATH_LIST "${AXL_PATH_LIST}")
-			message (FATAL_ERROR "please create paths.cmake and fill it with definitions for: ${_PATH_LIST}")
+			message (FATAL_ERROR "AXL_CMAKE_DIR not found, create paths.cmake and fill it with definitions for: ${_PATH_LIST}")
 		endif ()

 		include (${_PATHS_CMAKE})


ARC: gcc-m-cpu: check for exact HS CPU time instead of whole family

As of today we check against CPU_ARCHS config option which may be
related to different HS CPUs (i.e. ARCv2 HS, ARCv3 HS, etc...).
Let's check against exact HS CPU type (CPU_HS3X) as we do EM
processors.

Signed-off-by: Eugeniy Paltsev <ec089b543c2604b626d7ce60c03e4d074ed102c7@synopsys.com>
Signed-off-by: Evgeniy Paltsev <7de4ab8b01334d64e4e84734c688a8a936513edc@gmail.com>

--- cmake/gcc-m-cpu.cmake
+++ cmake/gcc-m-cpu.cmake
@@ -54,7 +54,7 @@
     set(GCC_M_CPU em4_dmips)
   elseif(CONFIG_CPU_EM4_FPUDA)
     set(GCC_M_CPU em4_fpuda)
-  elseif(CONFIG_CPU_ARCHS)
+  elseif(CONFIG_CPU_HS3X)
     set(GCC_M_CPU hs)
   elseif(CONFIG_CPU_EM4)
     set(GCC_M_CPU arcem)


less build output.

less build output.

--- cmake/installer.cmake
+++ cmake/installer.cmake
@@ -19,7 +19,8 @@

 add_custom_target(
   installer
-  COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_CURRENT_BINARY_DIR} --config Release --target install
-  COMMAND "${ISCC}" "${CMAKE_INSTALL_PREFIX}/LuaVM.iss" /O. /FLuaVM-vs${VC_NAME}-${PACKAGE_ARCH_NAME}
+  COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_CURRENT_BINARY_DIR} --config Release
+  COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_CURRENT_BINARY_DIR} --config Release --target install > NUL
+  COMMAND "${ISCC}" /Q /O. /FLuaVM-vs${VC_NAME}-${PACKAGE_ARCH_NAME} "${CMAKE_INSTALL_PREFIX}/LuaVM.iss"
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 )


fix typo in path in CMakeLists.txt

fix typo in path in CMakeLists.txt

--- software/ddapp/cmake/dd-testing.cmake
+++ software/ddapp/cmake/dd-testing.cmake
@@ -4,5 +4,5 @@

 include(CTest)

-configure_file(${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in
+configure_file(${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake.in
                ${CMAKE_BINARY_DIR}/CTestCustom.cmake COPYONLY)


find clucene on win32

find clucene on win32

svn path=/trunk/kdesupport/strigi/; revision=719228

--- cmake/FindCLucene.cmake
+++ cmake/FindCLucene.cmake
@@ -10,6 +10,7 @@
 #

 INCLUDE(CheckSymbolExists)
+INCLUDE(FindLibraryWithDebug)

 IF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake)
   INCLUDE(${PROJECT_CMAKE}/CLuceneConfig.cmake)
@@ -30,9 +31,9 @@
     /usr/include
     /sw/include
     NO_DEFAULT_PATH
-  )
-
-  FIND_LIBRARY(CLUCENE_LIBRARY clucene
+  )
+  FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY
+      WIN32_DEBUG_POSTFIX d
       NAMES clucene-core
       PATHS ${TRIAL_LIBRARY_PATHS})
   IF (CLUCENE_LIBRARY)
@@ -46,28 +47,26 @@
     MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}")
   ENDIF (CLUCENE_INCLUDE_DIR)

-  IF(NOT MSVC)
-    FIND_PATH(CLUCENE_LIBRARY_DIR
-        NAMES CLucene/clucene-config.h PATHS ${TRIAL_LIBRARY_PATHS})
-    IF (CLUCENE_LIBRARY_DIR)
-      MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
-      FILE(READ ${CLUCENE_LIBRARY_DIR}/CLucene/clucene-config.h CLCONTENT)
-      STRING(REGEX MATCH "_CL_VERSION +\".*\"" CLMATCH ${CLCONTENT})
-      IF (CLMATCH)
-        STRING(REGEX REPLACE "_CL_VERSION +\"(.*)\"" "\\1" CLUCENE_VERSION ${CLMATCH})
-	IF (CLUCENE_VERSION STRLESS "0.9.16")
-	  MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum 0.9.16")
-	ENDIF (CLUCENE_VERSION STRLESS "0.9.16")
-	IF (CLUCENE_VERSION STREQUAL "0.9.17")
-	  MESSAGE(FATAL_ERROR "CLucene version 0.9.17 is not supported.")
-	ENDIF (CLUCENE_VERSION STREQUAL "0.9.17")
-      ENDIF (CLMATCH)
-    ENDIF (CLUCENE_LIBRARY_DIR)
-  ELSE(NOT MSVC)
-    #msvc doesnt use a config file
-    SET(CLUCENE_LIBRARY_DIR ${CLUCENE_INCLUDE_DIR})
-  ENDIF(NOT MSVC)
+  IF(WIN32)
+    SET(TRIAL_LIBRARY_PATHS ${CLUCENE_INCLUDE_DIR})
+  ENDIF(WIN32)

+  FIND_PATH(CLUCENE_LIBRARY_DIR
+      NAMES CLucene/clucene-config.h PATHS ${TRIAL_LIBRARY_PATHS})
+  IF (CLUCENE_LIBRARY_DIR)
+    MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
+    FILE(READ ${CLUCENE_LIBRARY_DIR}/CLucene/clucene-config.h CLCONTENT)
+    STRING(REGEX MATCH "_CL_VERSION +\".*\"" CLMATCH ${CLCONTENT})
+    IF (CLMATCH)
+      STRING(REGEX REPLACE "_CL_VERSION +\"(.*)\"" "\\1" CLUCENE_VERSION ${CLMATCH})
+	  IF (CLUCENE_VERSION STRLESS "0.9.16")
+	    MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum 0.9.16")
+	  ENDIF (CLUCENE_VERSION STRLESS "0.9.16")
+	  IF (CLUCENE_VERSION STREQUAL "0.9.17")
+	    MESSAGE(FATAL_ERROR "CLucene version 0.9.17 is not supported.")
+	  ENDIF (CLUCENE_VERSION STREQUAL "0.9.17")
+    ENDIF (CLMATCH)
+  ENDIF (CLUCENE_LIBRARY_DIR)

 IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR)
   SET(CLucene_FOUND 1)


Search in /usr/pkg (used by pkgsrc package system).

svn path=/trunk/kdesupport/strigi/; revision=869841

--- cmake/FindCLucene.cmake
+++ cmake/FindCLucene.cmake
@@ -27,6 +27,7 @@
   /opt/local/lib${LIB_SUFFIX}
   /usr/lib${LIB_SUFFIX}
   /sw/lib${LIB_SUFFIX}
+  /usr/pkg/lib${LIB_SUFFIX}
   )
 SET(TRIAL_INCLUDE_PATHS
   $ENV{CLUCENE_HOME}/include
@@ -34,6 +35,7 @@
   /usr/local/include
   /usr/include
   /sw/include
+  /usr/pkg/include
   )
 FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY
   WIN32_DEBUG_POSTFIX d


MAINT: fix link errors.

MAINT: fix link errors.

--- cmake/FindDO_Sara.cmake
+++ cmake/FindDO_Sara.cmake
@@ -202,12 +202,12 @@
             find_library(${IMAGE_IO_LIB}_RELEASE_LIBRARY
               NAMES ${IMAGE_IO_LIB}
               PATHS "C:/Program Files/DO-Sara/lib")
-            if (DO_USE_STATIC_LIBS)
+            if (NOT DO_USE_STATIC_LIBS AND NOT ${IMAGE_IO_LIB}_DEBUG_LIBRARY)
+              set(${IMAGE_IO_LIB}_LIBRARY ${${IMAGE_IO_LIB}_RELEASE_LIBRARY})
+            else ()
               set(${IMAGE_IO_LIB}_LIBRARY
                 debug ${${IMAGE_IO_LIB}_DEBUG_LIBRARY}
                 optimized ${${IMAGE_IO_LIB}_RELEASE_LIBRARY})
-            elseif (NOT ${IMAGE_IO_LIB}_DEBUG_LIBRARY)
-              set(${IMAGE_IO_LIB}_LIBRARY ${${IMAGE_IO_LIB}_RELEASE_LIBRARY})
             endif ()
           else ()
             find_package(JPEG REQUIRED)


typo fix.

typo fix.

--- cmake/gcc_stm32f0.cmake
+++ cmake/gcc_stm32f0.cmake
@@ -6,7 +6,7 @@
 SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -mabi=aapcs" CACHE INTERNAL "module linker flags")
 SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -mabi=aapcs" CACHE INTERNAL "shared linker flags")

-SET(STM32_CHIP_TYPES 030x6 30x8 031x6 038xx 042x6 048x6 051x8 058xx 070x6 070xB 071xB 072xB 078xx 091xC 098xx 030xC CACHE INTERNAL "stm32f0 chip types")
+SET(STM32_CHIP_TYPES 030x6 030x8 031x6 038xx 042x6 048x6 051x8 058xx 070x6 070xB 071xB 072xB 078xx 091xC 098xx 030xC CACHE INTERNAL "stm32f0 chip types")
 SET(STM32_CODES "030.[46]" "030.8" "031.[46]" "038.6" "042.[46]" "048.6" "051.[468]" "058.8" "070.6" "070.B" "071.[8B]" "072.[8B]" "078.B" "091.[BC]" "098.C" "030.C")

 MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE)


Yet another hack for bus builds (#166)

Yet another hack for bus builds (#166)

--- cmake/layers/base.cmake
+++ cmake/layers/base.cmake
@@ -17,6 +17,8 @@
 bde_create_virtual_function(component_initialize bde_component_initialize)
 bde_create_virtual_function(component_find_sources bde_component_find_sources)
 bde_create_virtual_function(component_find_tests bde_component_find_tests)
+#Hack to fix bus builds. the above virtual function must be used in the code.
+bde_create_virtual_function(component_find_test bde_component_find_tests)
 bde_create_virtual_function(process_component base_process_component)

 # package


Add macro to generate subsystem centric documentation

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@3559 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -539,26 +539,65 @@
     endforeach(subdir)
 endmacro()

-macro(PCL_DISABLE_DEPENDIES subsys)
-    string(TOUPPER "pcl_${subsys}_dependies" PCL_SUBSYS_DEPENDIES)
+########################################################################################
+# Macro to disable subsystem dependies
+# _subsys IN subsystem name
+macro(PCL_DISABLE_DEPENDIES _subsys)
+    string(TOUPPER "pcl_${_subsys}_dependies" PCL_SUBSYS_DEPENDIES)
     if(NOT ("${${PCL_SUBSYS_DEPENDIES}}" STREQUAL ""))
         foreach(dep ${${PCL_SUBSYS_DEPENDIES}})
-            PCL_SET_SUBSYS_HYPERSTATUS(${subsys} ${dep} AUTO_OFF "Automatically disabled.")
+            PCL_SET_SUBSYS_HYPERSTATUS(${_subsys} ${dep} AUTO_OFF "Automatically disabled.")
             set(BUILD_${dep} OFF CACHE BOOL "Automatically disabled ${dep}" FORCE)
         endforeach(dep)
     endif(NOT ("${${PCL_SUBSYS_DEPENDIES}}" STREQUAL ""))
 endmacro(PCL_DISABLE_DEPENDIES subsys)

-macro(PCL_ENABLE_DEPENDIES subsys)
-    string(TOUPPER "pcl_${subsys}_dependies" PCL_SUBSYS_DEPENDIES)
+########################################################################################
+# Macro to enable subsystem dependies
+# _subsys IN subsystem name
+macro(PCL_ENABLE_DEPENDIES _subsys)
+    string(TOUPPER "pcl_${_subsys}_dependies" PCL_SUBSYS_DEPENDIES)
     if(NOT ("${${PCL_SUBSYS_DEPENDIES}}" STREQUAL ""))
         foreach(dep ${${PCL_SUBSYS_DEPENDIES}})
-            PCL_GET_SUBSYS_HYPERSTATUS(dependee_status ${subsys} ${dep})
+            PCL_GET_SUBSYS_HYPERSTATUS(dependee_status ${_subsys} ${dep})
             if("${dependee_status}" STREQUAL "AUTO_OFF")
-                PCL_SET_SUBSYS_HYPERSTATUS(${subsys} ${dep} AUTO_ON)
+                PCL_SET_SUBSYS_HYPERSTATUS(${_subsys} ${dep} AUTO_ON)
                 GET_IN_MAP(desc PCL_SUBSYS_DESC ${dep})
                 set(BUILD_${dep} ON CACHE BOOL "${desc}" FORCE)
             endif("${dependee_status}" STREQUAL "AUTO_OFF")
         endforeach(dep)
     endif(NOT ("${${PCL_SUBSYS_DEPENDIES}}" STREQUAL ""))
 endmacro(PCL_ENABLE_DEPENDIES subsys)
+
+########################################################################################
+# Macro to build subsystem centric documentation
+# _subsys IN the name of the subsystem to generate documentation for
+macro (PCL_ADD_DOC _subsys)
+  string(TOUPPER "${_subsys}" SUBSYS)
+  set(doc_subsys "doc_${_subsys}")
+  GET_IN_MAP(dependencies PCL_SUBSYS_DEPS ${_subsys})
+  if(DOXYGEN_FOUND)
+    if(HTML_HELP_COMPILER)
+      set(DOCUMENTATION_HTML_HELP YES)
+    else(HTML_HELP_COMPILER)
+      set(DOCUMENTATION_HTML_HELP NO)
+    endif(HTML_HELP_COMPILER)
+    if(NOT "${dependencies}" STREQUAL "")
+      set(STRIPPED_HEADERS "${PCL_SOURCE_DIR}/${dependencies}/include")
+      string(REPLACE ";" "/include \\\n\t\t\t\t\t\t\t\t\t\t\t\t ${PCL_SOURCE_DIR}/"
+             STRIPPED_HEADERS "${STRIPPED_HEADERS}")
+    endif(NOT "${dependencies}" STREQUAL "")
+    set(DOC_SOURCE_DIR "\"${CMAKE_CURRENT_SOURCE_DIR}\"\\")
+    foreach(dep ${dependencies})
+      set(DOC_SOURCE_DIR
+          "${DOC_SOURCE_DIR}\n\t\t\t\t\t\t\t\t\t\t\t\t \"${PCL_SOURCE_DIR}/${dep}\"\\")
+    endforeach(dep)
+    file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html")
+    set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/doxyfile")
+    configure_file("${PCL_SOURCE_DIR}/doc/doxygen/doxyfile.in" ${doxyfile})
+    add_custom_target(${doc_subsys} ${DOXYGEN_EXECUTABLE} ${doxyfile})
+    # if(USE_PROJECT_FOLDERS)
+    #   set_target_properties(${doc_subsys} PROPERTIES FOLDER "Documentation")
+    # endif(USE_PROJECT_FOLDERS)
+  endif(DOXYGEN_FOUND)
+endmacro(PCL_ADD_DOC)


fixed linking because of /DELAYLOAD flags: added 'delayimp.lib' to link libraries

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

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -103,6 +103,10 @@
     add_library(${_name} ${PCL_LIB_TYPE} ${ARGN})
     # must link explicitly against boost.
     target_link_libraries(${_name} ${Boost_LIBRARIES})
+
+	if(MSVC90 OR MSVC10)
+	  target_link_libraries(${_name} delayimp.lib)  # because delay load is enabled for openmp.dll
+	endif()
     #
     # Only link if needed
     if(WIN32 AND MSVC)


Modified config for windows support

Modified config for windows support

--- src/cmake/ResourcePackerConfig.cmake
+++ src/cmake/ResourcePackerConfig.cmake
@@ -3,10 +3,17 @@

 include(${SELF_DIR}/ResourcePackerTargets.cmake)

+if(WIN32)
+set(ResourcePacker_INCLUDE_DIR ${SELF_DIR}/../../../include)
+set(ResourcePacker_INCLUDE_DIRS ${SELF_DIR}/../../../include)
+set(ResourcePacker_LIBRARY ${SELF_DIR}/../../../bin/libResourcePacker.dll)
+set(ResourcePacker_LIBRARIES ${SELF_DIR}/../../../bin/libResourcePacker.dll)
+else()
 set(ResourcePacker_INCLUDE_DIR ${SELF_DIR}/../../../include)
 set(ResourcePacker_INCLUDE_DIRS ${SELF_DIR}/../../../include)
 set(ResourcePacker_LIBRARY ${SELF_DIR}/../../../lib/libResourcePacker.so)
 set(ResourcePacker_LIBRARIES ${SELF_DIR}/../../../lib/libResourcePacker.so)
+endif()

 get_filename_component(ResourcePacker_INCLUDE_DIR ${ResourcePacker_INCLUDE_DIR} ABSOLUTE)
 get_filename_component(ResourcePacker_INCLUDE_DIRS ${ResourcePacker_INCLUDE_DIRS} ABSOLUTE)


Add a new include search path for OpenJPEG 1.5.

--- src/cmake/modules/FindOpenJpeg.cmake
+++ src/cmake/modules/FindOpenJpeg.cmake
@@ -60,6 +60,7 @@
      /usr/local/include/openjpeg
      /usr/local/include
      /usr/include/openjpeg
+     /usr/include/openjpeg-1.5
      /usr/include
      /opt/local/include)


cmake macros

cmake macros

--- share/RFLMacros.cmake
+++ share/RFLMacros.cmake
@@ -1,24 +1,61 @@
+macro (add_module_rfl mid version)
+  set (output_files
+    ${CMAKE_CURRENT_BINARY_DIR}/${mid}_rfl.h
+    ${CMAKE_CURRENT_BINARY_DIR}/${mid}_rfl.cc
+    #${CMAKE_CURRENT_BINARY_DIR}/${mid}.ini
+    )
+  set (annotated_sources)
+  foreach (src ${${mid}_RFL_SOURCES})
+    list (APPEND annotated_sources ${CMAKE_CURRENT_SOURCE_DIR}/${src})
+  endforeach ()
+
+  set (imports)
+  foreach (dep ${${mid}_DEPS})
+    list (APPEND imports "-l${dep}")
+  endforeach ()
+
+  add_custom_command (
+    DEPENDS ${annotated_sources} ${RFL_GENERATOR}
+    COMMAND ${LIBRFL_RFLSCAN_EXE} -p ${CMAKE_BINARY_DIR}/compile_commands.json
+      -basedir ${CMAKE_SOURCE_DIR}
+      -output ${mid}
+      -pkg-name ${mid} -pkg-version=${version}
+      ${imports}
+      -G $<TARGET_FILE:${RFL_GENERATOR}>
+      ${annotated_sources}
+    OUTPUT ${output_files}
+    )
+  set (${mid}_rfl_SOURCES ${output_files})
+  set (${mid}_rfl_TARGET_TYPE STATIC)
+  set (${mid}_rfl_DEPS ${${mid}_DEPS})
+
+  add_module(${mid}_rfl)
+
+  list (APPEND ${mid}_DEPS ${mid}_rfl)
+  list (APPEND ${mid}_SOURCES ${${mid}_RFL_SOURCES})
+
+  add_module(${mid})
+
+endmacro ()
+
 macro (add_rfl_sources mid version)
   set (${mid}_rfl_SOURCES
-    ${mid}_rfl.h
-    ${mid}_rfl.cc
-    ${mid}.ini
+    ${CMAKE_CURRENT_BINARY_DIR}/${mid}_rfl.h
+    ${CMAKE_CURRENT_BINARY_DIR}/${mid}_rfl.cc
+    ${CMAKE_CURRENT_BINARY_DIR}/${mid}.ini
     )
-  set (${mid}_rfl_INCLUDE_DIRS ${${mid}_INCLUDE_DIRS} ${CMAKE_CURRENT_BUILD_DIR})
-  set (${mid}_rfl_TARGET_TYPE SHARED)
   set (${mid}_rfl_DEPS ${mid} ${${mid}_DEPS})
   set (${mid}_rfl_RFL_IMPORTS)
-  foreach (dep ${ARGN})
-    list (APPEND ${mid}_rfl_RFL_IMPORTS "-i${dep}")
-  endforeach ()
   foreach (dep ${${mid}_DEPS})
     list (APPEND ${mid}_rfl_RFL_IMPORTS "-l${dep}")
   endforeach ()
   set (annotated_sources)
-  foreach (src ${${mid}_SOURCES})
+  foreach (src ${ARGN})
     list (APPEND annotated_sources ${CMAKE_CURRENT_SOURCE_DIR}/${src})
   endforeach ()
-  add_custom_command (OUTPUT ${${mid}_rfl_SOURCES}
+  add_custom_command (
+    DEPENDS ${annotated_sources} ${RFL_GENERATOR}
+    OUTPUT ${${mid}_rfl_SOURCES}
     COMMAND ${LIBRFL_RFLSCAN_EXE} -p ${CMAKE_BINARY_DIR}/compile_commands.json
       -basedir ${CMAKE_SOURCE_DIR}
       -output ${mid}
@@ -26,9 +63,9 @@
       ${${mid}_rfl_RFL_IMPORTS}
       -G $<TARGET_FILE:${RFL_GENERATOR}>
       ${annotated_sources}
-    DEPENDS ${${mid}_SOURCES} ${RFL_GENERATOR}
     )
-  list (APPEND ${mid}_SOURCES ${${mid}_rfl_SOURCES})
+  set_source_files_properties (${${mid}_rfl_SOURCES} PROPERTIES GENERATED TRUE )
+  list (APPEND ${mid}_SOURCES ${${mid}_rfl_SOURCES} ${ARGN})
 endmacro ()

 macro (add_rfl_module mid version)
@@ -59,6 +96,7 @@
       -pkg-name ${mid} -pkg-version=${version}
       ${${mid}_rfl_RFL_IMPORTS}
       -G $<TARGET_FILE:${RFL_GENERATOR}>
+      -plugin
       ${annotated_sources}
     DEPENDS ${${mid}_SOURCES} ${${mid}_rfl_DEPS} ${RFL_GENERATOR}
     )
@@ -68,8 +106,16 @@
   add_custom_command(TARGET ${mid}_rfl POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${mid}.ini
     ${CMAKE_BINARY_DIR}/$<CONFIGURATION>/bin/plugins)
+
+  if (OS_LINUX)
+    set (rpath_value "$ORIGIN")
+  elseif (OS_MAC)
+    set (rpath_value "$ORIGIN")
+    #set (rpath_value "@executable_path")
+  endif ()
+
   set_target_properties(${mid}_rfl PROPERTIES
-    INSTALL_RPATH "$ORIGIN/../../lib:$ORIGIN"
+    INSTALL_RPATH "${rpath_value}/../../lib:${rpath_value}"
     BUILD_WITH_INSTALL_RPATH ON
     )
 endmacro ()


Removed quoting

Removed quoting

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -174,7 +174,7 @@
     # Write initial cache.
     file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
 CTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
-CTEST_PROJECT_ADDITIONAL_TARGETS:INTERNAL=\"${CTEST_PROJECT_ADDITIONAL_TARGETS}\"
+CTEST_PROJECT_ADDITIONAL_TARGETS:INTERNAL=${CTEST_PROJECT_ADDITIONAL_TARGETS}
 BUILD_TESTING:BOOL=TRUE
 MITK_CTEST_SCRIPT_MODE:BOOL=TRUE
 CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}


ENH: deactivate freetype support for ossim

--- SuperBuild/CMake/External_ossim.cmake
+++ SuperBuild/CMake/External_ossim.cmake
@@ -102,6 +102,7 @@
         -DCMAKE_BUILD_TYPE:STRING=Release
         -DCMAKE_CXX_FLAGS:STRING=${OSSIM_CXX_FLAGS}
         -DBUILD_OSSIM_MPI_SUPPORT:BOOL=OFF
+        -DBUILD_OSSIM_FREETYPE_SUPPORT:BOOL=OFF
         -DBUILD_OSSIM_APPS:BOOL=OFF
         -DBUILD_OSSIM_FRAMEWORKS:BOOL=OFF
         -DINSTALL_ARCHIVE_DIR:STRING=lib


Update ProjectBuildOption.cmake

Update ProjectBuildOption.cmake

--- project/cmake/ProjectBuildOption.cmake
+++ project/cmake/ProjectBuildOption.cmake
@@ -60,6 +60,21 @@

   string(STRIP "${PROJECT_VCS_COMMIT}" PROJECT_VCS_COMMIT)
   string(STRIP "${PROJECT_VCS_BRANCH}" PROJECT_VCS_BRANCH)
+
+  # URL Alias
+  if(PROJECT_GIT_REMOTE_ORIGIN_USE_SSH AND NOT PROJECT_GIT_CLONE_REMOTE_ORIGIN_DISABLE_SSH)
+    execute_process(
+      COMMAND ${GIT_EXECUTABLE} config --local --unset-all "url.https://github.com/.insteadOf"
+      COMMAND ${GIT_EXECUTABLE} config --local --unset-all "url.git@git.github.com:.insteadOf"
+      COMMAND ${GIT_EXECUTABLE} config --add --local "url.git@git.github.com:.insteadOf" "https://github.com/"
+      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+  else()
+    execute_process(
+      COMMAND ${GIT_EXECUTABLE} config --local --unset-all "url.https://github.com/.insteadOf"
+      COMMAND ${GIT_EXECUTABLE} config --local --unset-all "url.git@git.github.com:.insteadOf"
+      COMMAND ${GIT_EXECUTABLE} config --add --local "url.https://github.com/.insteadOf" "git@git.github.com:"
+      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+  endif()
 endif()

 if(NOT PROJECT_VCS_COMMIT_SHA)


Added MAGNUM_*_INCLUDE_DIRS for all modules too.

Some modules need it (Sdl2Context), some not.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -37,6 +37,7 @@
 #
 #  MAGNUM_*_FOUND   - Whether the component was found
 #  MAGNUM_*_LIBRARIES - Component library and dependent libraries
+#  MAGNUM_*_INCLUDE_DIRS - Include dirs of module dependencies
 #
 # Additionally these variables are defined for internal usage:
 #
@@ -108,6 +109,7 @@
             find_package(SDL2)
             if(SDL2_FOUND)
                 set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARY})
+                set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()
@@ -155,6 +157,7 @@
     # Decide if the library was found
     if(MAGNUM_${_COMPONENT}_LIBRARY AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR)
         set(MAGNUM_${_COMPONENT}_LIBRARIES ${MAGNUM_${_COMPONENT}_LIBRARY} ${_MAGNUM_${_COMPONENT}_LIBRARIES})
+        set(MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${_MAGNUM_${_COMPONENT}_INCLUDE_DIRS})
         set(Magnum_${component}_FOUND TRUE)
     else()
         set(Magnum_${component}_FOUND FALSE)


FindMagnum.cmake: fixed finding of Text library.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -246,7 +246,7 @@

     # Text library
     if(${component} STREQUAL Text)
-        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Font.h)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES AbstractFont.h)
     endif()

     # TextureTools library


added path for local Qt install. added MIO_INCLUDE_DIR def.

--- qt/imageListViewer/PkgConfigPath.cmake
+++ qt/imageListViewer/PkgConfigPath.cmake
@@ -1,9 +1,19 @@
 set(SYSTEM_DETECTED ON)
 if(UNIX AND NOT APPLE)
   set(CODE_PREFIX_ "/home/$ENV{USER}")
+  set(Qt5_DIR_LINUX "/home/$ENV{USER}/Qt/5.9.1/gcc_64/lib/cmake/Qt5")
+  if(EXISTS ${Qt5_DIR_LINUX})
+    set(Qt5_DIR ${Qt5_DIR_LINUX})
+    message(STATUS "Qt5_DIR: ${Qt5_DIR}")
+  endif()
 elseif(APPLE)
   set(CODE_PREFIX_ "/Users/$ENV{USER}")
-  set(Qt5_DIR "/Users/$ENV{USER}/Qt/5.7/clang_64/lib/cmake/Qt5")
+  set(Qt5_DIR_APPLE "/Users/$ENV{USER}/Qt/5.9.1/clang_64/lib/cmake/Qt5")
+  if(EXISTS ${Qt5_DIR_APPLE})
+    set(Qt5_DIR ${Qt5_DIR_APPLE})
+    message(STATUS "Qt5_DIR: ${Qt5_DIR}")
+  endif()
+
 else()
   set(SYSTEM_DETECTED OFF)
 endif()
@@ -13,6 +23,7 @@

   ## mio
   set(MIO_INCLUDE_DIR "${CODE_PREFIX_}/code/src")
+  add_definitions(-DMIO_INCLUDE_DIR="${MIO_INCLUDE_DIR}")

   ## OpenCV
   set(OpenCV_DIR "${CODE_PREFIX_}/code/install/opencv/dev/rel/share/OpenCV")


add missing opencv libs

add missing opencv libs

--- cmake/DetectOpenCV.cmake
+++ cmake/DetectOpenCV.cmake
@@ -42,11 +42,12 @@
         #message(STATUS "Prepending linker flags with ${OpenCV_LDFLAGS}")
         #set(CMAKE_EXE_LINKER_FLAGS "${OpenCV_LDFLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
         #set(CMAKE_MODULE_LINKER_FLAGS "${OpenCV_LDFLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
-        foreach(LDFLAGS_ITEM ${OpenCV_LDFLAGS})
-            if(LDFLAGS_ITEM MATCHES ".so$")

-                message(STATUS "is .so ${LDFLAGS_ITEM}")
-            endif(LDFLAGS_ITEM MATCHES ".so$")
+        # loop over opencv ldflags and add libs missing in OpenCV_LIBS
+        foreach(__LDFLAGS_ITEM ${OpenCV_LDFLAGS})
+            if(__LDFLAGS_ITEM MATCHES "(.so$)|(.a$)" AND NOT __LDFLAGS_ITEM MATCHES "^-l")
+                list(APPEND OpenCV_LIBS ${__LDFLAGS_ITEM})
+            endif()
         endforeach()

         list(APPEND OpenCV_LIBS ${OpenCV_LIBRARIES})


use runtest.sh script iif /bin/bash does exist

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -2,6 +2,9 @@
 option(EIGEN_DEBUG_ASSERTS "Enable advanced debuging of assertions" OFF)

 include(CheckCXXSourceCompiles)
+
+# check whether /bin/bash exists
+find_file(EIGEN_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH)

 macro(ei_add_property prop value)
   get_property(previous GLOBAL PROPERTY ${prop})
@@ -61,15 +64,11 @@
     endif()
   endif()

-  if(WIN32)
-    if(CYGWIN)
-      add_test(${testname_with_suffix} "${Eigen_SOURCE_DIR}/test/runtest.sh" "${testname_with_suffix}")
-    else(CYGWIN)
-      add_test(${testname_with_suffix} "${targetname}")
-    endif(CYGWIN)
-  else(WIN32)
+  if(EIGEN_BIN_BASH_EXISTS)
     add_test(${testname_with_suffix} "${Eigen_SOURCE_DIR}/test/runtest.sh" "${testname_with_suffix}")
-  endif(WIN32)
+  else()
+    add_test(${testname_with_suffix} "${targetname}")
+  endif()

 endmacro(ei_add_test_internal)


add augeas in ALL plugins

add augeas in ALL plugins

--- cmake/ElektraCache.cmake
+++ cmake/ElektraCache.cmake
@@ -70,7 +70,7 @@
 # plugins with dependencies
 #
 set (PLUGINS_LIST_DEP
-	yajl dbus tcl xmltool
+	yajl dbus tcl xmltool augeas
 	)

 #


travis integration

travis integration

--- cmake/EnableGtests.cmake
+++ cmake/EnableGtests.cmake
@@ -9,7 +9,7 @@
 # Find gtest or otherwise fetch it into the build_dir/gtest
 # Adapted from alpscore
 function(UseGtest)
-    set (gtest_root ${GTEST_ROOT})
+    set (gtest_root ${ARGN})
     if (DEFINED gtest_root)
         message(STATUS "gtest source specified at ${gtest_root}")
         find_path(gtest_root NAMES "include/gtest/gtest.h" HINTS ${gtest_root})
@@ -25,8 +25,8 @@
             set (gtest_root ${gtest_root1})
         else()
             message(STATUS "Trying to fetch gtest via subversion")
-            find_package(Subversion)
-            execute_process(COMMAND "${Subversion_SVN_EXECUTABLE}" "checkout" "https://github.com/google/googletest/tags/release-1.7.0" "gtest" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+            find_package(Git)
+            execute_process(COMMAND "${GIT_EXECUTABLE}" "clone" "--branch" "release-1.7.0" "https://github.com/google/googletest.git" "gtest" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
             set (gtest_root "${CMAKE_BINARY_DIR}/gtest")
         endif()
         unset (gtest_root1)
@@ -45,9 +45,35 @@
     set (GTEST_LIBRARY gtest_main PARENT_SCOPE)
 endfunction()

+# custom function to add gtest with xml output
+# arg0 - test (assume the source is ${test}.cpp
+function(add_gtest test)
+    if (TestXMLOutput)
+        set (test_xml_output --gtest_output=xml:${test}.xml)
+    endif(TestXMLOutput)
+
+    if(${ARGC} EQUAL 2)
+        set(source "${ARGV1}/${test}.cpp")
+    else(${ARGC} EQUAL 2)
+        set(source "${test}.cpp")
+    endif(${ARGC} EQUAL 2)
+
+    add_executable(${test} ${source})
+    target_link_libraries(${test} ${LINK_ALL} ${LINK_TEST})
+    add_test(NAME ${test} COMMAND ${test} ${test_xml_output})
+endfunction(add_gtest)
+
+# add test in release mode with gtest
+function(add_gtest_release test)
+    if (CMAKE_BUILD_TYPE STREQUAL Release)
+        add_gtest(${test})
+    endif()
+endfunction(add_gtest_release)
+
+
 # enable testing with gtest - fetch it if needed
 if (NOT tests_are_already_enabled AND Testing )
-    find_package(GTest QUIET)
+    find_package(GTest)

     if (NOT GTEST_FOUND)
         #include(UseGtest) # fetch gtest


make cmake report install prefix

make cmake report install prefix

--- cmake_admin/report.cmake
+++ cmake_admin/report.cmake
@@ -2,6 +2,7 @@
          "Summary:" )

 message( "Build type:            " ${CMAKE_BUILD_TYPE} )
+message( "Install Prefix:        " ${CMAKE_INSTALL_PREFIX} )

 if ( LIBSNDFILE_SUPPORT )
   if ( LIBSNDFILE_HASVORBIS )


fix library path

fix library path

--- recipes/xmsinterp/condabuildinfo.cmake
+++ recipes/xmsinterp/condabuildinfo.cmake
@@ -1,12 +1,14 @@
 set(EXT_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/xmscore")
 set(EXT_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/xmsgrid")
+
 if(WIN32)
     set(EXT_LIB_DIRS "${LIBRARY_LIB}")
 else()
     set(EXT_LIB_DIRS "${CMAKE_INSTALL_PREFIX}/lib")
 endif()
+
 set(EXT_LIBS xmscorelib)
-set(EXT_LIBS xmsgridlib)
+list(APPEND EXT_LIBS xmsgridlib)

 set(Boost_USE_STATIC_LIBS TRUE)
 find_package(Boost REQUIRED log_setup log system filesystem serialization timer thread)


COMP: OSX set deployment target when building fftw

Similar to 58df91b, make sure to set SDKROOT and DEPLOYMENT_TARGET when
building an external project via its ./configure script on OS X.
Otherwise the compiler will not know which version of OS X to build for.

Change-Id: I6a4c1a5853cc25534f2b623f85b1379b16990c38

--- CMake/itkExternal_FFTW.cmake
+++ CMake/itkExternal_FFTW.cmake
@@ -28,6 +28,28 @@
 #--  LIBS        libraries to pass to the linker, e.g. -l<library>
 #--  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
 #--              you have headers in a nonstandard directory <include dir>
+
+set(_additional_configure_env)
+set(_additional_external_project_args)
+if (APPLE)
+  list(APPEND _additional_configure_env
+        "SDKROOT=${CMAKE_OSX_SYSROOT}"
+        "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
+  )
+  list(APPEND _additional_external_project_args
+        BUILD_COMMAND
+          env
+            "SDKROOT=${CMAKE_OSX_SYSROOT}"
+            "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
+          make
+        INSTALL_COMMAND
+          env
+            "SDKROOT=${CMAKE_OSX_SYSROOT}"
+            "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
+          make
+            install
+  )
+endif()

 ## Perhaps in the future a set of TryCompiles could be used here.
 set(FFTW_OPTIMIZATION_CONFIGURATION "" CACHE INTERNAL "architecture flags: --enable-sse --enable-sse2 --enable-altivec --enable-mips-ps --enable-cell")
@@ -72,6 +94,7 @@
             "LIBS=$ENV{LIBS}"
             "CPP=$ENV{CPP}"
             "CPPFLAGS=$ENV{CPPFLAGS}"
+            ${_additional_configure_env}
           ${ITK_BINARY_DIR}/fftwf/src/fftwf/configure
             ${FFTW_SHARED_FLAG}
             ${FFTW_OPTIMIZATION_CONFIGURATION}
@@ -79,6 +102,7 @@
             --disable-fortran
             --enable-float
             --prefix=${ITK_BINARY_DIR}/fftw
+        ${_additional_external_project_args}
         )
     endif()

@@ -97,6 +121,7 @@
            "LIBS=$ENV{LIBS}"
            "CPP=$ENV{CPP}"
            "CPPFLAGS=$ENV{CPPFLAGS}"
+            ${_additional_configure_env}
           ${ITK_BINARY_DIR}/fftwd/src/fftwd/configure
             ${FFTW_SHARED_FLAG}
             ${FFTW_OPTIMIZATION_CONFIGURATION}
@@ -104,6 +129,7 @@
             --disable-fortran
             --disable-float
             --prefix=${ITK_BINARY_DIR}/fftw
+        ${_additional_external_project_args}
         )
     endif()
     set(FFTW_INCLUDE_PATH ${ITK_BINARY_DIR}/fftw/include)


Allow overriding the baseline directory in tests

Change-Id: I3171a120a8c5c9ce501c612c58890d7fd98d62be

--- CMake/vtkTestingMacros.cmake
+++ CMake/vtkTestingMacros.cmake
@@ -100,6 +100,11 @@
     set(data_dir "${${vtk-module}_DATA_DIR}")
   endif()

+  set(baseline_dir ${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline)
+  if(VTK_BASELINE_DIR)
+    set(baseline_dir ${VTK_BASELINE_DIR})
+  endif()
+
   foreach(name IN LISTS names)
     _vtk_test_set_options("${mpi_options}" "local_" ${_${name}_options})

@@ -109,7 +114,7 @@
     if(local_TESTING_DATA)
       set(_D -D ${data_dir})
       set(_T -T ${VTK_BINARY_DIR}/Testing/Temporary)
-      set(_V -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/${name}.png,:}")
+      set(_V -V "DATA{${baseline_dir}/${name}.png,:}")
     endif()

     set(numprocs ${default_numprocs})
@@ -173,12 +178,15 @@
   _vtk_test_parse_args("${cxx_options}" "cxx" ${ARGN})
   _vtk_test_set_options("${cxx_options}" "" ${options})

-  if(vtk-module)
+  if(VTK_BASELINE_DIR)
     set(prefix ${vtk-module})
-    set(base_dir ${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline)
+    set(baseline_dir ${VTK_BASELINE_DIR})
+  elseif(vtk-module)
+    set(prefix ${vtk-module})
+    set(baseline_dir ${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline)
   elseif(vtk-example)
     set(prefix ${vtk-example})
-    set(base_dir ${CMAKE_CURRENT_SOURCE_DIR}/Baseline)
+    set(baseline_dir ${CMAKE_CURRENT_SOURCE_DIR}/Baseline)
   else()
     message(FATAL_ERROR "Neither vtk-module nor vtk-example is set!")
   endif()
@@ -203,7 +211,7 @@

     set(_V "")
     if(NOT local_NO_VALID)
-      set(_V -V "DATA{${base_dir}/${name}.png,:}")
+      set(_V -V "DATA{${baseline_dir}/${name}.png,:}")
     endif()

     ExternalData_add_test(VTKData
@@ -300,6 +308,11 @@
     set(data_dir "${${vtk-module}_DATA_DIR}")
   endif()

+  set(baseline_dir ${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline)
+  if(VTK_BASELINE_DIR)
+    set(baseline_dir ${VTK_BASELINE_DIR})
+  endif()
+
   foreach(name IN LISTS names)
     _vtk_test_set_options("${python_options}" "local_" ${_${name}_options})

@@ -314,10 +327,10 @@
     set(_A "")
     if(NOT local_NO_VALID)
       if(local_NO_RT)
-        set(_B -B "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/,REGEX:${name}(_[0-9]+)?.png}")
+        set(_B -B "DATA{${baseline_dir}/,REGEX:${name}(_[0-9]+)?.png}")
       else()
         set(rtImageTest ${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/rtImageTest.py)
-        set(_V -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/${name}.png,:}")
+        set(_V -V "DATA{${baseline_dir}/${name}.png,:}")
         set(_A -A ${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py)
       endif()
     endif()
@@ -375,6 +388,11 @@
     set(data_dir "${${vtk-module}_DATA_DIR}")
   endif()

+  set(baseline_dir ${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline)
+  if(VTK_BASELINE_DIR)
+    set(baseline_dir ${VTK_BASELINE_DIR})
+  endif()
+
   foreach(name IN LISTS names)
     _vtk_test_set_options("${tcl_options}" "local_" ${_${name}_options})

@@ -392,7 +410,7 @@
     if(NOT local_NO_RT)
       set(rtImageTest ${vtkTestingRendering_SOURCE_DIR}/rtImageTest.tcl)
       if(NOT local_NO_VALID)
-        set(_V -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/${name}.png,:}")
+        set(_V -V "DATA{${baseline_dir}/${name}.png,:}")
       endif()
       if(NOT local_NO_OUTPUT)
         set(_T -T ${VTK_TEST_OUTPUT_DIR})


cmake: Add options for BUILD_SHARED_LIBS

--- DefineOptions.cmake
+++ DefineOptions.cmake
@@ -1,11 +1,5 @@
-option(WITH_STATIC_LIB "Build with a static library" OFF)
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
 option(WITH_CMOCKERY_SUPPORT "Install a cmockery header" OFF)
 option(WITH_EXAMPLES "Build examples" ON)
 option(UNIT_TESTING "Build with unit testing" OFF)
 option(PICKY_DEVELOPER "Build with picky developer flags" OFF)
-
-if (WITH_STATIC_LIB)
-    set(BUILD_SHARED_LIBS OFF)
-else (WITH_STATIC_LIB)
-    set(BUILD_SHARED_LIBS ON)
-endif (WITH_STATIC_LIB)


COMP: Add the right gtest lib directory building UTs

--- CMake/GTest.cmake
+++ CMake/GTest.cmake
@@ -30,7 +30,7 @@
 message(${GTEST_INCLUDE_DIRS})
 enable_testing()
 function(cxx_gtest name sources sourcesDirectory)
-  message(${sources})
+  link_directories("${CMAKE_BINARY_DIR}/gtest-build/googlemock/gtest/Debug")
   add_executable(${name} ${sources})
   add_dependencies(${name} gtest_ext)


[CMAKE] Increase the unit test verbosity to test_suite

Summary:
Default is error, this bumps to test_suite:
https://www.boost.org/doc/libs/1_64_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/log_level.html

Test Plan:
  ninja check
Cause a failure in a unit test and check the output is more verbose.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5882

--- cmake/modules/TestSuite.cmake
+++ cmake/modules/TestSuite.cmake
@@ -98,7 +98,7 @@
 		add_test_runner(
 			${SUITE}
 			${_test_name}
-			${NAME} -t "${_test_name}"
+			${NAME} -t "${_test_name}" -l test_suite
 		)
 		set_property(
 			TARGET ${SUITE_TARGET}


Tentative fix submoduleOpenMesh.cmake for windows

--- cmake/submoduleOpenMesh.cmake
+++ cmake/submoduleOpenMesh.cmake
@@ -1,28 +1,4 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
-# here is defined the way we want to import assimp
-ExternalProject_Add(
-        openmesh
-        # where the source will live
-        SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdPartyLibraries/OpenMesh"
-
-        # override default behaviours
-        UPDATE_COMMAND ""
-
-        # set the installatin to installed/openmesh
-        INSTALL_DIR "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}"
-        CMAKE_ARGS
-            -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-            -DBUILD_APPS=OFF
-            -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-            -DOPENMESH_BUILD_SHARED=TRUE
-            -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-            -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-            -DCMAKE_BUILD_TYPE=${RADIUM_SUBMODULES_BUILD_TYPE}
-)
-
-add_custom_target(openmesh_lib
-    DEPENDS openmesh
-    )

 # ----------------------------------------------------------------------------------------------------------------------
 set( OPENMESH_INCLUDE_DIR ${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/include )
@@ -31,7 +7,7 @@
 elseif ( UNIX )
     set( OPENMESH_LIBRARIES "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshCore.so")
 elseif (MINGW)
-    set( OPENMESH_DLL "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshCore.dll")
+    set( OPENMESH_DLL "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/libOpenMeshCore.dll")
     set( OPENMESH_LIBRARIES "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshCore.dll.a")
 elseif( MSVC )
     # in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix
@@ -55,11 +31,44 @@

 endif()

+
+
+# here is defined the way we want to import assimp
+ExternalProject_Add(
+        openmesh
+        # where the source will live
+        SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdPartyLibraries/OpenMesh"
+
+        # override default behaviours
+        UPDATE_COMMAND ""
+
+        GIT_SUBMODULES 3rdPartyLibraries/OpenMesh
+
+        # set the installatin to installed/openmesh
+        INSTALL_DIR "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}"
+        BUILD_BYPRODUCTS "${OPENMESH_LIBRARIES} ${OPENMESH_DLL}"
+        CMAKE_GENERATOR ${CMAKE_GENERATOR}
+        CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
+        CMAKE_ARGS
+            -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
+            -DBUILD_APPS=OFF
+            -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+            -DOPENMESH_BUILD_SHARED=TRUE
+            -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+            -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+            -DCMAKE_BUILD_TYPE=${RADIUM_SUBMODULES_BUILD_TYPE}
+        EXCLUDE_FROM_ALL TRUE
+)
+
+add_custom_target(openmesh_lib
+    DEPENDS openmesh
+    )
+
 if( MSVC OR MINGW )

-	add_custom_target( openmesh_install_compiled_dll
-                COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OPENMESH_DLL} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
-		COMMENT "copy openmesh dll to bin dir" VERBATIM
+        add_custom_target( openmesh_install_compiled_dll
+            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OPENMESH_DLL} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+                COMMENT "copy openmesh dlls to bin dir" VERBATIM
 		DEPENDS openmesh
 	)
 	add_dependencies(openmesh_lib openmesh_install_compiled_dll)


BUG: Do not look for QWT in the system paths when dti_tract_stat is build as a Slicer extension since QWT is build as part of the package

--- FiberViewerLight.cmake
+++ FiberViewerLight.cmake
@@ -48,10 +48,14 @@

 # Qwt libraries
 if( NOT QWT_LIBRARY )
+  if( EXTENSION_SUPERBUILD_BINARY_DIR )
+    set(NO_ENV_PATH "NO_DEFAULT_PATH")
+  endif()
   SET(QWT_NAMES ${QWT_NAMES} qwt libqwt)
   FIND_LIBRARY(QWT_LIBRARY
     NAMES ${QWT_NAMES}
     PATHS ${QWT_LIBRARY_PATH} /usr/local/qwt/lib /usr/local/lib /usr/lib
+    ${NO_ENV_PATH}
   )
 endif()
 if(NOT QWT_LIBRARY)


FIX: Exclude vtkRenderingVolumeOpenGLNew from vtkOpenGL kit

This fixes the issue that when the vtkOpenGL kit is turned ON,
the vtkRenderingVolumeOpenGLNew module should not be built.

Change-Id: Icca73fa738567a0fd37e0e498d82d4b99d08b253

--- Rendering/VolumeOpenGLNew/module.cmake
+++ Rendering/VolumeOpenGLNew/module.cmake
@@ -19,7 +19,5 @@
     vtkRenderingOpenGL
     vtkTestingCore
     vtkTestingRendering
-  KIT
-    vtkOpenGL
   EXCLUDE_FROM_ALL
 )


Update tryrun.cmake for arm-softfp (#5323)

--- cross/arm-softfp/tryrun.cmake
+++ cross/arm-softfp/tryrun.cmake
@@ -114,3 +114,18 @@
      0
      CACHE STRING "Result from TRY_RUN" FORCE)

+SET( HAVE_PROCFS_CTL_EXITCODE
+     1
+     CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_PROCFS_MAPS_EXITCODE
+     1
+     CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_PROCFS_STAT_EXITCODE
+     1
+     CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_PROCFS_STATUS_EXITCODE
+     1
+     CACHE STRING "Result from TRY_RUN" FORCE)


Remove trailing withspace

Remove trailing withspace


bugfix add C++11 support for paraview in the Superbuild

Some C++11 has been introduce in our custom paraview branch.
This fix is a quick and dirty fix as we will move to the new superbuild soon

--- Superbuild/Projects/paraview.cmake
+++ Superbuild/Projects/paraview.cmake
@@ -2,6 +2,7 @@
   DEPENDS qt python pythonqt

   CMAKE_ARGS
+    -DCMAKE_CXX_STANDARD=11
     -DBUILD_SHARED_LIBS:BOOL=ON
     -DBUILD_TESTING:BOOL=OFF
     -DPARAVIEW_BUILD_QT_GUI:BOOL=ON


bump SIRF_TAG

bump SIRF_TAG

[travis skip]

--- version_config.cmake
+++ version_config.cmake
@@ -190,7 +190,7 @@
   set(DEFAULT_CCPi-Regularisation-Toolkit_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG c8f808acf5324b4ed56360362f369a1dd693f33d)
+  set(DEFAULT_SIRF_TAG 17f7fa91704b0b5309d1e2562489aaf7932875e8)
 #  set(DEFAULT_SIRF_TAG v3.0.0)

   ## STIR


ENH: update OTB superbuild following modularization

--- CMake/External_OTB.cmake
+++ CMake/External_OTB.cmake
@@ -163,19 +163,10 @@
       -DBUILD_SHARED_LIBS:BOOL=${SB_BUILD_SHARED_LIBS}
       -DBUILD_TESTING:BOOL=${BUILD_TESTING}
       -DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-      -DBUILD_APPLICATIONS:BOOL=ON
       -DCMAKE_PREFIX_PATH:STRING=${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
       -DOTB_DATA_ROOT:STRING=${OTB_DATA_ROOT}
-      -DOTB_USE_EXTERNAL_OSSIM:BOOL=ON
-      -DOTB_USE_EXTERNAL_BOOST:BOOL=ON
-      -DOTB_USE_EXTERNAL_ITK:BOOL=ON
-      -DOTB_USE_EXTERNAL_MUPARSER:BOOL=ON
-      -DOTB_USE_EXTERNAL_MUPARSERX:BOOL=ON
-      -DOTB_USE_EXTERNAL_TINYXML:BOOL=ON
-      -DOTB_USE_EXTERNAL_EXPAT:BOOL=ON
-      -DOTB_USE_EXTERNAL_LIBKML:BOOL=ON
+      -DOTB_USE_LIBKML:BOOL=ON
       -DOTB_USE_OPENCV:BOOL=ON
-      -DOTB_USE_JPEG2000:BOOL=OFF
       ${OTB_SB_WRAP_QT_CONFIG}
       ${OTB_SB_ITK_CONFIG}
       ${OTB_SB_LIBKML_CONFIG}


Changed some CTK issues and changed CTK version to my github ctk version

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   IF(NOT DEFINED CTK_DIR)

-    SET(revision_tag 34a638b)
+    SET(revision_tag 5ce6a4ed)
     IF(${proj}_REVISION_TAG)
       SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()
@@ -33,7 +33,7 @@
     ENDFOREACH()

     ExternalProject_Add(${proj}
-      GIT_REPOSITORY http://github.com/commontk/CTK.git
+      GIT_REPOSITORY http://github.com/Miluba154/CTK.git
       GIT_TAG ${revision_tag}
       SOURCE_DIR ${proj}-src
       BINARY_DIR ${proj}-build


Do not set VTK_USE_QVTK_QTOPENGL to ON (this is the VTK default).

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -40,7 +40,7 @@
     list(APPEND additional_cmake_args
         -DDESIRED_QT_VERSION:STRING=4
         -DVTK_USE_GUISUPPORT:BOOL=ON
-        -DVTK_USE_QVTK_QTOPENGL:BOOL=ON
+        -DVTK_USE_QVTK_QTOPENGL:BOOL=OFF
         -DVTK_USE_QT:BOOL=ON
         -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
      )


Remove an obsolete comment.

Remove an obsolete comment.

svn path=/trunk/kdesupport/akonadi/; revision=1173706

--- akonadi-prefix.h.cmake
+++ akonadi-prefix.h.cmake
@@ -3,5 +3,4 @@
 #define AKONADIPREFIX "${CMAKE_INSTALL_PREFIX}"
 #define AKONADIDATA   "${SHARE_INSTALL_PREFIX}"
 #define AKONADICONFIG "${CONFIG_INSTALL_DIR}"
-// the below is hardcoded to what FindKDE4Internal.cmake sets it to, since we have no way of finding that
 #define AKONADIBUNDLEPATH "${AKONADI_BUNDLE_PATH}"


fix bug: fix android build

fix bug: fix android build

--- cmake/Utils.cmake
+++ cmake/Utils.cmake
@@ -108,7 +108,7 @@
       message(WARNING "MSVC version is ${MSVC_VERSION}, /WHOLEARCHIVE flag cannot be set")
       set(${output_var} ${lib} PARENT_SCOPE)
     endif ()
-  elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+  elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND NOT ANDROID)
     set(${output_var} -Wl,-force_load ${lib} PARENT_SCOPE)
   else ()
     set(${output_var} -Wl,--whole-archive ${lib} -Wl,--no-whole-archive PARENT_SCOPE)


fix(cmake): Font not found message

fix(cmake): Font not found message

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -198,8 +198,8 @@
     set(output_variable "${output_variable}" PARENT_SCOPE)
     message(STATUS "Found font: ${output_variable}")
   else()
-    message_colored(WARNING "Font not found: ${fontname}" "33;1")
-  endif()
-endfunction()
-
-# }}}
+    message_colored(STATUS "Font not found: ${fontname}" "33;1")
+  endif()
+endfunction()
+
+# }}}


cmake: Skip CMP0045 on CMake >= 3.0.1

cmake: Skip CMP0045 on CMake >= 3.0.1

The policy CMP0045 is set to old because of a CMake issue.
It was fixed in CMake 3.0.0, we don't need the CMP0045 setting.
Also, on newer CMake, this line is triggering a warning about CMP0045
will be removed in the future.

See #275

--- cmake/CMakeExpandImportedTargets.cmake
+++ cmake/CMakeExpandImportedTargets.cmake
@@ -52,9 +52,11 @@
       endif()
    endif()

-   # XXX ignore warning 'get_target_property() called with non-existent target'
-   if(POLICY CMP0045)
-     cmake_policy(SET CMP0045 OLD)
+   if(CMAKE_VERSION VERSION_LESS 3.0.1)
+      # XXX ignore warning 'get_target_property() called with non-existent target'
+      if(POLICY CMP0045)
+         cmake_policy(SET CMP0045 OLD)
+      endif()
    endif()

    # handle imported library targets


[CMake][PyROOT] Cache PyROOT variables needed by root-config --config

If we don't cache the PyROOT library, include dir and version
variables, they will not be found by CMake in the loop over
CACHE_VARIABLES which sets ROOT_CONFIGARGS in the main CMakeLists.txt,
and therefore root-config --config will not show them.

--- cmake/modules/SearchRootCoreDeps.cmake
+++ cmake/modules/SearchRootCoreDeps.cmake
@@ -83,13 +83,13 @@
     find_package(Python${PYTHON_PREFER_VERSION} COMPONENTS Interpreter Development NumPy)
     if(Python${PYTHON_PREFER_VERSION}_Interpreter_FOUND)
       set(PYTHON_EXECUTABLE "${Python${PYTHON_PREFER_VERSION}_EXECUTABLE}")
-      set(PYTHON_VERSION_STRING "${Python${PYTHON_PREFER_VERSION}_VERSION}")
-      set(PYTHON_VERSION_MAJOR "${Python${PYTHON_PREFER_VERSION}_VERSION_MAJOR}")
-      set(PYTHON_VERSION_MINOR "${Python${PYTHON_PREFER_VERSION}_VERSION_MINOR}")
+      set(PYTHON_VERSION_STRING "${Python${PYTHON_PREFER_VERSION}_VERSION}" CACHE INTERNAL "" FORCE)
+      set(PYTHON_VERSION_MAJOR "${Python${PYTHON_PREFER_VERSION}_VERSION_MAJOR}" CACHE INTERNAL "" FORCE)
+      set(PYTHON_VERSION_MINOR "${Python${PYTHON_PREFER_VERSION}_VERSION_MINOR}" CACHE INTERNAL "" FORCE)
       if(Python${PYTHON_PREFER_VERSION}_Development_FOUND)
-        set(PYTHON_INCLUDE_DIRS "${Python${PYTHON_PREFER_VERSION}_INCLUDE_DIRS}")
-        set(PYTHON_LIBRARIES "${Python${PYTHON_PREFER_VERSION}_LIBRARIES}")
-        set(PYTHON_LIBRARY_DIR "${Python${PYTHON_PREFER_VERSION}_LIBRARY_DIRS}")
+        set(PYTHON_INCLUDE_DIRS "${Python${PYTHON_PREFER_VERSION}_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
+        set(PYTHON_LIBRARIES "${Python${PYTHON_PREFER_VERSION}_LIBRARIES}" CACHE INTERNAL "" FORCE)
+        set(PYTHON_LIBRARY_DIR "${Python${PYTHON_PREFER_VERSION}_LIBRARY_DIRS}" CACHE INTERNAL "" FORCE)
         # Set PyROOT variables
         set(Python${PYTHON_PREFER_VERSION}_Interpreter_Development_FOUND ON) # This means we have both Interpreter and Development, hence we can build PyROOT with this Python
         set(PYTHON_EXECUTABLE_Development_Main "${Python${PYTHON_PREFER_VERSION}_EXECUTABLE}")
@@ -102,7 +102,7 @@
       endif()
       if(Python${PYTHON_PREFER_VERSION}_NumPy_FOUND)
         set(NUMPY_FOUND ${Python${PYTHON_PREFER_VERSION}_NumPy_FOUND})
-        set(NUMPY_INCLUDE_DIRS "${Python${PYTHON_PREFER_VERSION}_NumPy_INCLUDE_DIRS}")
+        set(NUMPY_INCLUDE_DIRS "${Python${PYTHON_PREFER_VERSION}_NumPy_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
       endif()
     endif()
     if(DEFINED Python${PYTHON_PREFER_VERSION}_VERSION AND "${Python${PYTHON_PREFER_VERSION}_VERSION}" VERSION_LESS "2.7")
@@ -120,13 +120,13 @@
     find_package(Python3 COMPONENTS Interpreter Development NumPy)
     if(Python3_Interpreter_FOUND)
       set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
-      set(PYTHON_VERSION_STRING "${Python3_VERSION}")
-      set(PYTHON_VERSION_MAJOR "${Python3_VERSION_MAJOR}")
-      set(PYTHON_VERSION_MINOR "${Python3_VERSION_MINOR}")
+      set(PYTHON_VERSION_STRING "${Python3_VERSION}" CACHE INTERNAL "" FORCE)
+      set(PYTHON_VERSION_MAJOR "${Python3_VERSION_MAJOR}" CACHE INTERNAL "" FORCE)
+      set(PYTHON_VERSION_MINOR "${Python3_VERSION_MINOR}" CACHE INTERNAL "" FORCE )
       if(Python3_Development_FOUND)
-        set(PYTHON_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}")
-        set(PYTHON_LIBRARIES "${Python3_LIBRARIES}")
-        set(PYTHON_LIBRARY_DIR "${Python3_LIBRARY_DIRS}")
+        set(PYTHON_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
+        set(PYTHON_LIBRARIES "${Python3_LIBRARIES}" CACHE INTERNAL "" FORCE)
+        set(PYTHON_LIBRARY_DIR "${Python3_LIBRARY_DIRS}" CACHE INTERNAL "" FORCE)
         # Set PyROOT variables
         set(Python3_Interpreter_Development_FOUND ON) # This means we have both Interpreter and Development, hence we can build PyROOT with Python3
         set(PYTHON_EXECUTABLE_Development_Main "${Python3_EXECUTABLE}")
@@ -139,7 +139,7 @@
       endif()
       if(Python3_NumPy_FOUND)
         set(NUMPY_FOUND ${Python3_NumPy_FOUND})
-        set(NUMPY_INCLUDE_DIRS "${Python3_NumPy_INCLUDE_DIRS}")
+        set(NUMPY_INCLUDE_DIRS "${Python3_NumPy_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
       endif()
     endif()

@@ -152,13 +152,13 @@
         # Only Python2 was found, set as main
         if(Python2_Interpreter_FOUND)
           set(PYTHON_EXECUTABLE "${Python2_EXECUTABLE}")
-          set(PYTHON_VERSION_STRING "${Python2_VERSION}")
-          set(PYTHON_VERSION_MAJOR "${Python2_VERSION_MAJOR}")
-          set(PYTHON_VERSION_MINOR "${Python2_VERSION_MINOR}")
+          set(PYTHON_VERSION_STRING "${Python2_VERSION}" CACHE INTERNAL "" FORCE)
+          set(PYTHON_VERSION_MAJOR "${Python2_VERSION_MAJOR}" CACHE INTERNAL "" FORCE)
+          set(PYTHON_VERSION_MINOR "${Python2_VERSION_MINOR}" CACHE INTERNAL "" FORCE)
           if(Python2_Development_FOUND)
-            set(PYTHON_INCLUDE_DIRS "${Python2_INCLUDE_DIRS}")
-            set(PYTHON_LIBRARIES "${Python2_LIBRARIES}")
-            set(PYTHON_LIBRARY_DIR "${Python2_LIBRARY_DIRS}")
+            set(PYTHON_INCLUDE_DIRS "${Python2_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
+            set(PYTHON_LIBRARIES "${Python2_LIBRARIES}" CACHE INTERNAL "" FORCE)
+            set(PYTHON_LIBRARY_DIR "${Python2_LIBRARY_DIRS}" CACHE INTERNAL "" FORCE)
             # Set PyROOT variables
             set(Python2_Interpreter_Development_FOUND ON) # This means we have both Interpreter and Development, hence we can build PyROOT with Python2
             set(PYTHON_EXECUTABLE_Development_Main "${Python2_EXECUTABLE}")
@@ -171,7 +171,7 @@
           endif()
           if(Python2_NumPy_FOUND)
             set(NUMPY_FOUND ${Python2_NumPy_FOUND})
-            set(NUMPY_INCLUDE_DIRS "${Python2_NumPy_INCLUDE_DIRS}")
+            set(NUMPY_INCLUDE_DIRS "${Python2_NumPy_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
           endif()
         endif()
       else()
@@ -193,9 +193,9 @@
               set(OTHER_NUMPY_INCLUDE_DIRS "${Python2_NumPy_INCLUDE_DIRS}")
             endif()
           else()
-            set(PYTHON_INCLUDE_DIRS "${Python2_INCLUDE_DIRS}")
-            set(PYTHON_LIBRARIES "${Python2_LIBRARIES}")
-            set(PYTHON_LIBRARY_DIR "${Python2_LIBRARY_DIRS}")
+            set(PYTHON_INCLUDE_DIRS "${Python2_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
+            set(PYTHON_LIBRARIES "${Python2_LIBRARIES}" CACHE INTERNAL "" FORCE)
+            set(PYTHON_LIBRARY_DIR "${Python2_LIBRARY_DIRS}" CACHE INTERNAL "" FORCE)
             # Set PyROOT variables
             set(PYTHON_EXECUTABLE_Development_Main "${Python2_EXECUTABLE}")
             set(PYTHON_VERSION_STRING_Development_Main "${Python2_VERSION}")
@@ -206,7 +206,7 @@
             set(PYTHON_LIBRARIES_Development_Main "${Python2_LIBRARIES}")
             if(Python2_NumPy_FOUND)
               set(NUMPY_FOUND ${Python2_NumPy_FOUND})
-              set(NUMPY_INCLUDE_DIRS "${Python2_NumPy_INCLUDE_DIRS}")
+              set(NUMPY_INCLUDE_DIRS "${Python2_NumPy_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
             endif()
           endif()
         endif()


indra/cmake/APR.cmake: Fix windows simulator build so it still dymanically links with iconv.

--- indra/cmake/APR.cmake
+++ indra/cmake/APR.cmake
@@ -24,8 +24,8 @@
       optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib
       )
     set(APRICONV_LIBRARIES
-      debug ${ARCH_PREBUILT_DIRS_DEBUG}/apriconv-1.lib
-      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apriconv-1.lib
+      debug ${ARCH_PREBUILT_DIRS_DEBUG}/iconv.dll
+      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/iconv.dll
       )
   elseif (DARWIN)
     set(APR_LIBRARIES


Add Python style tests to plugin tests

Add Python style tests to plugin tests

--- worker/plugin.cmake
+++ worker/plugin.cmake
@@ -2,6 +2,8 @@

 add_python_style_test(
     python_static_analysis_worker "${PROJECT_SOURCE_DIR}/plugins/worker/server")
+add_python_style_test(
+    python_static_analysis_worker_tests "${PROJECT_SOURCE_DIR}/plugins/worker/plugin_tests")

 add_eslint_test(
     worker "${PROJECT_SOURCE_DIR}/plugins/worker/web_client/js")


[Dev] Boost.Python2 rather than Boost.Python3

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -518,7 +518,7 @@

 # ~~~~~~~~~~ ICU ~~~~~~~~~
 macro (get_icu)
-  cmake_policy(SET CMP0074 NEW)
+  #cmake_policy(SET CMP0074 NEW)
   unset (_required_version)
   if (${ARGC} GREATER 0)
     set (_required_version ${ARGV0})
@@ -606,7 +606,7 @@
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
     date_time random iostreams serialization filesystem system
-	locale python37 regex)
+	locale python regex)
   set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
   set (BOOST_REQUIRED_COMPONENTS_FOR_TST unit_test_framework)
   set (BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS_FOR_LIB}


Set-up Sphinx theme depending on its version

--- salome_adm/cmake_files/FindSphinx.cmake
+++ salome_adm/cmake_files/FindSphinx.cmake
@@ -38,7 +38,18 @@
 ELSE()
   SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
 ENDIF()
+
 # Handle the standard arguments of the find_package() command:
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE)

+IF(SPHINX_EXECUTABLE)
+  EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} "--version" OUTPUT_VARIABLE SPHINX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+  STRING(REGEX REPLACE ".* ([0-9.]+)$" "\\1" SPHINX_VERSION "${SPHINX_VERSION}" )
+  MESSAGE(STATUS "Sphinx version is ${SPHINX_VERSION}")
+  IF(SPHINX_VERSION VERSION_LESS "1.3")
+    SET(SPHINX_THEME "basic")
+  ELSE()
+    SET(SPHINX_THEME "classic")
+  ENDIF()
+ENDIF(SPHINX_EXECUTABLE)


Fix double inclusions guard.

Fix double inclusions guard.

	* build-aux/cmake/modules/Init.cmake: Here.

--- build-aux/cmake/modules/Init.cmake
+++ build-aux/cmake/modules/Init.cmake
@@ -13,7 +13,7 @@
 # Set common variables used in all Gostai project using cmake.

 if(NOT DEFINED INIT_CMAKE)
-set(INIT_CMAKE)
+set(INIT_CMAKE TRUE)

 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
 enable_testing()


build: accept include dir paths passed in command line

Accept extra parameters to the include path passed in cmake
via -DCMAKE_INCLUDE_PATH=/foo/bar

--- CMake/includes.cmake
+++ CMake/includes.cmake
@@ -12,3 +12,8 @@
 include_directories(
   ${PROJECT_SOURCE_DIR}/src
   )
+
+# accept include dirs passed in command line
+foreach(dir ${CMAKE_INCLUDE_PATH})
+  include_directories(${dir})
+endforeach()


Rectified FindARToolKit5.cmake

Rectified FindARToolKit5.cmake

--- cmake/Modules/FindARToolKit5.cmake
+++ cmake/Modules/FindARToolKit5.cmake
@@ -47,7 +47,7 @@
 		if (ARTOOLKIT5_DIR)
 		FIND_PATH(ARTOOLKIT5_INCLUDE_DIR
 			AR/ar.h
-			PATHS $ENV{ARTOOLKIT5_ROOT}/include
+			PATHS ${ARTOOLKIT5_DIR}/include
 			/usr/include)
 			FIND_LIBRARY(ARTOOLKIT5_LIBRARIES
 				NAME


[CMake] Cleanup CMake version checking

[CMake] Cleanup CMake version checking

CMAKE_VERSION is always greater than 3.0 now. No reason not to remove the extra compatibility code.

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

--- cmake/Modules/SanitizerUtils.cmake
+++ cmake/Modules/SanitizerUtils.cmake
@@ -38,22 +38,8 @@
       DEPENDS ${stamp}
       SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA})

-    if(NOT CMAKE_VERSION VERSION_LESS 3.0)
-      install(FILES $<TARGET_FILE:${target_name}>.syms
-              DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
-    else()
-      # Per-config install location.
-      if(CMAKE_CONFIGURATION_TYPES)
-        foreach(c ${CMAKE_CONFIGURATION_TYPES})
-          get_target_property(libfile ${target_name} LOCATION_${c})
-          install(FILES ${libfile}.syms CONFIGURATIONS ${c}
+    install(FILES $<TARGET_FILE:${target_name}>.syms
             DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
-        endforeach()
-      else()
-        get_target_property(libfile ${target_name} LOCATION_${CMAKE_BUILD_TYPE})
-        install(FILES ${libfile}.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
-      endif()
-    endif()
     if(ARG_PARENT_TARGET)
       add_dependencies(${ARG_PARENT_TARGET} ${target_name}-symbols)
     endif()


Search for llvm-config in LLDB_PATH_TO_LLVM_BUILD first

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -17,7 +17,7 @@
     set(FIND_PATHS "${LLDB_PATH_TO_LLVM_BUILD}/bin")
   endif()
   find_program(LLVM_CONFIG "llvm-config"
-    PATHS ${FIND_PATHS})
+    HINTS ${FIND_PATHS})

   if(LLVM_CONFIG)
     message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")


Enable Y3 download renaming

Enable Y3 download renaming

--- bootstrap/get.cmake
+++ bootstrap/get.cmake
@@ -61,8 +61,12 @@
 endfunction()

 function(y3_download _url)
-  cmake_parse_arguments(_arg "" "SHA1" "" ${ARGN})
-  string(REGEX REPLACE "^.*/([^/]+)$" "\\1" _name ${_url})
+  cmake_parse_arguments(_arg "" "NAME;SHA1" "" ${ARGN})
+  if(_arg_NAME)
+    set(_name ${_arg_NAME})
+  else()
+    string(REGEX REPLACE "^.*/([^/]+)$" "\\1" _name ${_url})
+  endif()
   message(STATUS "[Y3] Downloading ${_name}")
   set(_path ${CACHE_DIR}/${_name})
   if(EXISTS ${_path})
@@ -154,8 +158,10 @@
 if("catch2" IN_LIST _y3_packages)
   set(_version "2.3.0")
   set(_package "Catch2-${_version}")
-  y3_download("https://github.com/catchorg/Catch2/archive/v${_version}.tar.gz" SHA1 "e913061207ca04dcd3d29e49a226f8caa26304fa")
-  y3_extract("v${_version}.tar.gz" DIR ${_package})
+  y3_download("https://github.com/catchorg/Catch2/archive/v${_version}.tar.gz"
+    NAME "${_package}.tar.gz"
+    SHA1 "e913061207ca04dcd3d29e49a226f8caa26304fa")
+  y3_extract("${_package}.tar.gz" DIR ${_package})
   y3_cmake(${_package}
     CONFIG ${CONFIG}
     OPTIONS -DCATCH_BUILD_TESTING=OFF -DCATCH_INSTALL_DOCS=OFF -DCATCH_INSTALL_HELPERS=OFF -DPKGCONFIG_INSTALL_DIR=${CMAKE_BINARY_DIR}/.trash)
@@ -164,8 +170,10 @@
 if("glslang" IN_LIST _y3_packages)
   set(_version "7.8.2853")
   set(_package "glslang-${_version}")
-  y3_download("https://github.com/KhronosGroup/glslang/archive/${_version}.tar.gz" SHA1 "9b6d3734abb351e8218e31c4b08c08805f2c22fc")
-  y3_extract("${_version}.tar.gz" DIR ${_package})
+  y3_download("https://github.com/KhronosGroup/glslang/archive/${_version}.tar.gz"
+    NAME "${_package}.tar.gz"
+    SHA1 "9b6d3734abb351e8218e31c4b08c08805f2c22fc")
+  y3_extract("${_package}.tar.gz" DIR ${_package})
   y3_cmake(${_package}
     CONFIG ${CONFIGS}
     OPTIONS -DENABLE_AMD_EXTENSIONS=OFF -DENABLE_GLSLANG_BINARIES=OFF -DENABLE_HLSL=OFF -DENABLE_NV_EXTENSIONS=OFF -DENABLE_SPVREMAPPER=OFF -DENABLE_OPT=OFF)
@@ -191,8 +199,10 @@
 if("nasm" IN_LIST _y3_packages)
   set(_version "2.13.03")
   set(_package "nasm-${_version}")
-  y3_download("https://www.nasm.us/pub/nasm/releasebuilds/${_version}/win64/${_package}-win64.zip" SHA1 "149a814fa53980976a7fc081231f59cfbcd02543")
-  y3_extract("${_package}-win64.zip" DIR ${_package})
+  y3_download("https://www.nasm.us/pub/nasm/releasebuilds/${_version}/win64/${_package}-win64.zip"
+    NAME "${_package}.zip"
+    SHA1 "149a814fa53980976a7fc081231f59cfbcd02543")
+  y3_extract("${_package}.zip" DIR ${_package})
   set(NASM_EXECUTABLE ${BUILD_DIR}/${_package}/nasm.exe)
 endif()

@@ -228,7 +238,8 @@
 if("zlib" IN_LIST _y3_packages)
   set(_version "1.2.11")
   set(_package "zlib-${_version}")
-  y3_download("https://zlib.net/${_package}.tar.xz" SHA1 "e1cb0d5c92da8e9a8c2635dfa249c341dfd00322")
+  y3_download("https://zlib.net/${_package}.tar.xz"
+    SHA1 "e1cb0d5c92da8e9a8c2635dfa249c341dfd00322")
   y3_extract("${_package}.tar.xz" DIR ${_package})
   y3_cmake(${_package}
     TARGET "zlibstatic"
@@ -246,7 +257,8 @@
 if("jpeg" IN_LIST _y3_packages)
   set(_version "1.5.3")
   set(_package "libjpeg-turbo-${_version}")
-  y3_download("https://downloads.sourceforge.net/project/libjpeg-turbo/${_version}/${_package}.tar.gz" SHA1 "87ebf4cab2bb27fcb8e7ccb18ec4eb680e1f2c2d")
+  y3_download("https://downloads.sourceforge.net/project/libjpeg-turbo/${_version}/${_package}.tar.gz"
+    SHA1 "87ebf4cab2bb27fcb8e7ccb18ec4eb680e1f2c2d")
   y3_extract("${_package}.tar.gz" DIR ${_package})
   y3_cmake(${_package}
     TARGET "jpeg-static"
@@ -266,7 +278,8 @@
 if("png" IN_LIST _y3_packages)
   set(_version "1.6.35")
   set(_package "libpng-${_version}")
-  y3_download("https://downloads.sourceforge.net/project/libpng/libpng16/${_version}/${_package}.tar.xz" SHA1 "0df1561aa1da610e892239348970d574b14deed0")
+  y3_download("https://downloads.sourceforge.net/project/libpng/libpng16/${_version}/${_package}.tar.xz"
+    SHA1 "0df1561aa1da610e892239348970d574b14deed0")
   y3_extract("${_package}.tar.xz" DIR ${_package})
   y3_git_apply(${_package} ${CMAKE_CURRENT_LIST_DIR}/patches/libpng.patch)
   y3_cmake(${_package}


support of Netgen with split libraries and handle Debug & Release libraries on Windows

--- cMake/FindNETGEN.cmake
+++ cMake/FindNETGEN.cmake
@@ -34,6 +34,29 @@

     IF(NOT NETGENDATA)
         SET(NETGENDATA ${NGLIB_PREFIX}/include/netgen)
+    ENDIF(NOT NETGENDATA)
+
+ELSEIF(WIN32)
+    FIND_PATH(NGLIB_INCLUDE_DIR NAMES nglib.h PATHS ${NETGEN_INCLUDEDIR})
+    SET(NETGEN_LIBS nglib mesh occ interface)
+    SET(NGLIB_LIBRARIES "")
+    FOREACH(it ${NETGEN_LIBS})
+        FIND_LIBRARY(NGLIB ${it} PATHS ${NETGEN_LIBDIR})
+        FIND_LIBRARY(NGLIBD ${it}d PATHS ${NETGEN_LIBDIR})
+        IF(NGLIBD AND NGLIB)
+            SET(NG_LIB optimized ${NGLIB}
+                       debug ${NGLIBD})
+            SET(NGLIB_LIBRARIES ${NGLIB_LIBRARIES} ${NG_LIB})
+            UNSET(NGLIB CACHE)
+            UNSET(NGLIBD CACHE)
+        ELSEIF(NGLIB)
+            SET(NGLIB_LIBRARIES ${NGLIB_LIBRARIES} ${NGLIB})
+            UNSET(NGLIB CACHE)
+        ENDIF()
+    ENDFOREACH()
+
+    IF(NOT NETGENDATA)
+        SET(NETGENDATA netgen)
     ENDIF(NOT NETGENDATA)

 ELSE(DEFINED MACPORTS_PREFIX OR DEFINED HOMEBREW_PREFIX)


Bug fix for CheckIncludeFile

Bug fix for CheckIncludeFile

Change-Id: I89da8ce8f784bd48300c1c2d10f0059346b71044

--- cmake/FindGflags.cmake
+++ cmake/FindGflags.cmake
@@ -1,6 +1,6 @@
 # Ceres Solver - A fast non-linear least squares minimizer
-# Copyright 2013 Google Inc. All rights reserved.
-# http://code.google.com/p/ceres-solver/
+# Copyright 2015 Google Inc. All rights reserved.
+# http://ceres-solver.org/
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
@@ -65,6 +65,14 @@
 # GFLAGS_LIBRARY: gflags library, not including the libraries of any
 #                 dependencies.

+# Reset CALLERS_CMAKE_FIND_LIBRARY_PREFIXES to its value when
+# FindGflags was invoked.
+MACRO(GFLAGS_RESET_FIND_LIBRARY_PREFIX)
+  IF (MSVC)
+    SET(CMAKE_FIND_LIBRARY_PREFIXES "${CALLERS_CMAKE_FIND_LIBRARY_PREFIXES}")
+  ENDIF (MSVC)
+ENDMACRO(GFLAGS_RESET_FIND_LIBRARY_PREFIX)
+
 # Called if we failed to find gflags or any of it's required dependencies,
 # unsets all public (designed to be used externally) variables and reports
 # error message at priority depending upon [REQUIRED/QUIET/<NONE>] argument.
@@ -72,11 +80,19 @@
   UNSET(GFLAGS_FOUND)
   UNSET(GFLAGS_INCLUDE_DIRS)
   UNSET(GFLAGS_LIBRARIES)
-  UNSET(GFLAGS_NAMESPACE)
+  # Do not use unset, as we want to keep GFLAGS_NAMESPACE in the cache,
+  # but simply clear its value.
+  SET(GFLAGS_NAMESPACE "" CACHE STRING
+    "gflags namespace (google or gflags)" FORCE)
+
   # Make results of search visible in the CMake GUI if gflags has not
   # been found so that user does not have to toggle to advanced view.
   MARK_AS_ADVANCED(CLEAR GFLAGS_INCLUDE_DIR
-                         GFLAGS_LIBRARY)
+                         GFLAGS_LIBRARY
+                         GFLAGS_NAMESPACE)
+
+  GFLAGS_RESET_FIND_LIBRARY_PREFIX()
+
   # Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by FindPackage()
   # use the camelcase library name, not uppercase.
   IF (Gflags_FIND_QUIETLY)
@@ -90,6 +106,99 @@
   ENDIF ()
 ENDMACRO(GFLAGS_REPORT_NOT_FOUND)

+# A cut down version of CMake's check_cxx_source_compiles() macro, which
+# supports specification of the CMAKE_BUILD_TYPE with which the test should
+# be compiled (but not REGEX matching of the output).  This is important
+# on Windows, for at least the NMake generator, which otherwise chooses
+# Debug, when the gflags library will typically be compiled in Release, and
+# MSVC will then fail to build, thus making all check_cxx_source_compiles()
+# tests fail.
+#
+# As per the CMake check_cxx_source_compiles() macro, we assume the following
+# variables can be set before this is invoked:
+#
+#    CMAKE_REQUIRED_FLAGS - String of compile command line flags.
+#    CMAKE_REQUIRED_DEFINITIONS - List of macros to define (-DFOO=bar).
+#    CMAKE_REQUIRED_INCLUDES - List of include directories.
+#    CMAKE_REQUIRED_LIBRARIES - List of libraries to link.
+#
+# This macro is a derivative of the CMake check_cxx_source_compiles() macro
+# distributed under the BSD License, Copyright 2005-2009 Kitware, Inc.
+MACRO(CHECK_CXX_SOURCE_COMPILES_WITH_BUILD_TYPE
+    SOURCE BUILD_TYPE VAR)
+  # Do not rerun test if output variable has an assigned value, ie is not
+  # an empty string.
+  IF ("${VAR}" MATCHES "^${VAR}$")
+    # Verify that the BUILD_TYPE is sane.
+    IF (NOT "${BUILD_TYPE}" STREQUAL "Release" AND
+        NOT "${BUILD_TYPE}" STREQUAL "Debug" AND
+        NOT "${BUILD_TYPE}" STREQUAL "RelWithDebInfo" AND
+        NOT "${BUILD_TYPE}" STREQUAL "MinSizeRel" AND
+        NOT "${BUILD_TYPE}" STREQUAL "")
+      MESSAGE(FATAL_ERROR "Invalid BUILD_TYPE: ${BUILD_TYPE}, is not a "
+        "valid CMAKE_BUILD_TYPE option.")
+    ENDIF()
+
+    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+      "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+
+    SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
+    IF (CMAKE_REQUIRED_LIBRARIES)
+      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
+        LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+    ENDIF()
+
+    SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
+    IF (CMAKE_REQUIRED_INCLUDES)
+      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
+        "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+    ENDIF()
+
+    FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
+      "${SOURCE}\n")
+
+    MESSAGE(STATUS "Performing Test ${VAR}")
+    # Pass the CMAKE_BUILD_TYPE to the CMake test project created to execute
+    # the test (main difference over CMake's check_cxx_source_compiles() macro).
+    TRY_COMPILE(${VAR}
+      ${CMAKE_BINARY_DIR}
+      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
+      COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+      ${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}
+      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+      "-DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE}"
+      "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
+      OUTPUT_VARIABLE OUTPUT)
+
+    IF (${VAR})
+      MESSAGE(STATUS "Performing Test ${VAR} - Success")
+      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+        "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
+        "${OUTPUT}\n"
+        "Source file was:\n${SOURCE}\n")
+    ELSE()
+      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
+      SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+        "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
+        "${OUTPUT}\n"
+        "Source file was:\n${SOURCE}\n")
+    ENDIF()
+  ENDIF()
+ENDMACRO()
+
+# Handle possible presence of lib prefix for libraries on MSVC, see
+# also GFLAGS_RESET_FIND_LIBRARY_PREFIX().
+IF (MSVC)
+  # Preserve the caller's original values for CMAKE_FIND_LIBRARY_PREFIXES
+  # s/t we can set it back before returning.
+  SET(CALLERS_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+  # The empty string in this list is important, it represents the case when
+  # the libraries have no prefix (shared libraries / DLLs).
+  SET(CMAKE_FIND_LIBRARY_PREFIXES "lib" "" "${CMAKE_FIND_LIBRARY_PREFIXES}")
+ENDIF (MSVC)
+
 # Search user-installed locations first, so that we prefer user installs
 # to system installs where both exist.
 #
@@ -135,60 +244,152 @@
 # detect threads, we assume that gflags requires it.
 FIND_PACKAGE(Threads QUIET)
 SET(GFLAGS_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
-# On Windows, the Shlwapi library is used by gflags if available.
-IF (MSVC)
+# On Windows (including MinGW), the Shlwapi library is used by gflags if
+# available.
+IF (WIN32)
+  INCLUDE(CheckIncludeFileCXX)
   CHECK_INCLUDE_FILE_CXX("shlwapi.h" HAVE_SHLWAPI)
   IF (HAVE_SHLWAPI)
     LIST(APPEND GFLAGS_LINK_LIBRARIES shlwapi.lib)
   ENDIF(HAVE_SHLWAPI)
-ENDIF (MSVC)
+ENDIF (WIN32)
+
 # Mark internally as found, then verify. GFLAGS_REPORT_NOT_FOUND() unsets
 # if called.
 SET(GFLAGS_FOUND TRUE)

 # Identify what namespace gflags was built with.
-IF (GFLAGS_INCLUDE_DIR)
-  # First try the (older) google namespace.
-  INCLUDE(CheckCXXSourceCompiles)
-  # Setup include path & link library for gflags for CHECK_CXX_SOURCE_COMPILES
-  SET(CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR})
-  SET(CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARY} ${GFLAGS_LINK_LIBRARIES})
-  CHECK_CXX_SOURCE_COMPILES(
-    "#include <gflags/gflags.h>
+IF (GFLAGS_INCLUDE_DIR AND NOT GFLAGS_NAMESPACE)
+  # To handle Windows peculiarities / CMake bugs on MSVC we try two approaches
+  # to detect the gflags namespace:
+  #
+  # 1) Try to use a custom version of check_cxx_source_compiles():
+  #    check_cxx_source_compiles_with_build_type(),
+  #    to compile a trivial program with the two choices for the gflags
+  #    namespace.
+  #
+  #    This works on all OSs except Windows.  On Windows, if using NMake
+  #    generator the previous method also works, if using Visual Studio, it does
+  #    not, because our explicit instruction regarding the CMAKE_BUILD_TYPE is
+  #    ignored by msbuild.  This breaks detection because MSVC requires that the
+  #    build type of the test project used by check_cxx_source_compiles() match
+  #    that of gflags.  However, msbuild forces the test project to use Debug,
+  #    but gflags will be built in Release.
+  #
+  # 2) [In the event 1) fails] Use regex on the gflags.h header file to try to
+  #    determine the gflags namespace.  Whilst this is less robust than 1),
+  #    it does avoid any interaction with msbuild.
+
+  # On Windows, it is required that the build type of the test app match that
+  # of gflags, as CMAKE_BUILD_TYPE may not be defined when this is called, we
+  # try each in turn.
+  LIST(APPEND TEST_BUILD_TYPES Release Debug)
+  FOREACH(BUILD_TYPE ${TEST_BUILD_TYPES})
+    STRING(TOUPPER "${BUILD_TYPE}" BUILD_TYPE_UPPERCASE)
+    # Setup include path & link library for gflags for CHECK_CXX_SOURCE_COMPILES.
+    SET(CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR})
+    SET(CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARY} ${GFLAGS_LINK_LIBRARIES})
+    # First try the (older) google namespace.  Note that the output variable
+    # MUST be unique to the build type as otherwise the test is not repeated as
+    # it is assumed to have already been performed.
+    CHECK_CXX_SOURCE_COMPILES_WITH_BUILD_TYPE(
+      "#include <gflags/gflags.h>
      int main(int argc, char * argv[]) {
        google::ParseCommandLineFlags(&argc, &argv, true);
        return 0;
      }"
-     GFLAGS_IN_GOOGLE_NAMESPACE)
-  IF (GFLAGS_IN_GOOGLE_NAMESPACE)
-    SET(GFLAGS_NAMESPACE google)
-  ELSE (GFLAGS_IN_GOOGLE_NAMESPACE)
-    # Try (newer) gflags namespace instead.
-    #
-    # Setup include path & link library for gflags for CHECK_CXX_SOURCE_COMPILES
-    SET(CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR})
-    SET(CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARY} ${GFLAGS_LINK_LIBRARIES})
-    CHECK_CXX_SOURCE_COMPILES(
-      "#include <gflags/gflags.h>
+     ${BUILD_TYPE}
+     GFLAGS_IN_GOOGLE_NAMESPACE_${BUILD_TYPE_UPPERCASE})
+   IF (GFLAGS_IN_GOOGLE_NAMESPACE_${BUILD_TYPE_UPPERCASE})
+     SET(GFLAGS_NAMESPACE google)
+     BREAK()
+   ELSE (GFLAGS_IN_GOOGLE_NAMESPACE_${BUILD_TYPE_UPPERCASE})
+     # Try (newer) gflags namespace instead.  Note that the output variable
+     # MUST be unique to the build type as otherwise the test is not repeated as
+     # it is assumed to have already been performed.
+     SET(CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR})
+     SET(CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARY} ${GFLAGS_LINK_LIBRARIES})
+     CHECK_CXX_SOURCE_COMPILES_WITH_BUILD_TYPE(
+       "#include <gflags/gflags.h>
        int main(int argc, char * argv[]) {
          gflags::ParseCommandLineFlags(&argc, &argv, true);
          return 0;
        }"
-       GFLAGS_IN_GFLAGS_NAMESPACE)
-    IF (GFLAGS_IN_GFLAGS_NAMESPACE)
-      SET(GFLAGS_NAMESPACE gflags)
-    ENDIF (GFLAGS_IN_GFLAGS_NAMESPACE)
-  ENDIF (GFLAGS_IN_GOOGLE_NAMESPACE)
-
-  IF (NOT GFLAGS_NAMESPACE)
-    GFLAGS_REPORT_NOT_FOUND(
-      "Failed to determine gflags namespace, it is not google or gflags.")
-  ENDIF (NOT GFLAGS_NAMESPACE)
-ENDIF (GFLAGS_INCLUDE_DIR)
+       ${BUILD_TYPE}
+       GFLAGS_IN_GFLAGS_NAMESPACE_${BUILD_TYPE_UPPERCASE})
+     IF (GFLAGS_IN_GFLAGS_NAMESPACE_${BUILD_TYPE_UPPERCASE})
+       SET(GFLAGS_NAMESPACE gflags)
+       BREAK()
+     ENDIF (GFLAGS_IN_GFLAGS_NAMESPACE_${BUILD_TYPE_UPPERCASE})
+   ENDIF (GFLAGS_IN_GOOGLE_NAMESPACE_${BUILD_TYPE_UPPERCASE})
+ ENDFOREACH()
+
+ IF (NOT GFLAGS_NAMESPACE)
+   # Failed to determine gflags namespace using
+   # check_cxx_source_compiles_with_build_type() method, try and obtain it
+   # using regex on the gflags header instead.
+   MESSAGE(STATUS "Failed to find gflags namespace using using "
+     "check_cxx_source_compiles(), trying namespace regex instead, "
+     "this is expected on Windows.")
+   # Scan gflags.h to identify what namespace gflags was built with.
+   SET(GFLAGS_HEADER_FILE ${GFLAGS_INCLUDE_DIR}/gflags/gflags.h)
+   IF (NOT EXISTS ${GFLAGS_HEADER_FILE})
+     GFLAGS_REPORT_NOT_FOUND(
+       "Could not find file: ${GFLAGS_HEADER_FILE} "
+       "containing namespace information in gflags install located at: "
+       "${GFLAGS_INCLUDE_DIR}.")
+   ELSE (NOT EXISTS ${GFLAGS_HEADER_FILE})
+     FILE(READ ${GFLAGS_HEADER_FILE} GFLAGS_HEADER_FILE_CONTENTS)
+
+     STRING(REGEX MATCH "namespace [A-Za-z]+"
+       GFLAGS_NAMESPACE "${GFLAGS_HEADER_FILE_CONTENTS}")
+     STRING(REGEX REPLACE "namespace ([A-Za-z]+)" "\\1"
+       GFLAGS_NAMESPACE "${GFLAGS_NAMESPACE}")
+
+     IF (NOT GFLAGS_NAMESPACE)
+      GFLAGS_REPORT_NOT_FOUND(
+        "Failed to extract gflags namespace from header file: "
+        "${GFLAGS_HEADER_FILE}.")
+     ENDIF (NOT GFLAGS_NAMESPACE)
+
+     # Verify that the namespace is either google or gflags.  Strictly
+     # speaking the users can specify something else when building gflags,
+     # but doing so would cause so many compatibility issues, that they should
+     # not have done, so any mismatch is almost certainly a regex failure.
+     IF (NOT GFLAGS_NAMESPACE STREQUAL "google" AND
+         NOT GFLAGS_NAMESPACE STREQUAL "gflags")
+       GFLAGS_REPORT_NOT_FOUND(
+         "Failed to extract valid gflags namespace from header file: "
+         "${GFLAGS_HEADER_FILE}, result: ${GFLAGS_NAMESPACE} is not "
+         "google or gflags.")
+     ENDIF()
+   ENDIF (NOT EXISTS ${GFLAGS_HEADER_FILE})
+ ENDIF (NOT GFLAGS_NAMESPACE)
+
+ IF (NOT GFLAGS_NAMESPACE)
+   GFLAGS_REPORT_NOT_FOUND(
+     "Failed to determine gflags namespace either by "
+     "check_cxx_source_compiles(), or namespace regex.")
+ ENDIF (NOT GFLAGS_NAMESPACE)
+ENDIF (GFLAGS_INCLUDE_DIR AND NOT GFLAGS_NAMESPACE)
+
+# Make the GFLAGS_NAMESPACE a cache variable s/t the user can view it, and could
+# overwrite it in the CMake GUI.
+SET(GFLAGS_NAMESPACE "${GFLAGS_NAMESPACE}" CACHE STRING
+  "gflags namespace (google or gflags)" FORCE)

 # gflags does not seem to provide any record of the version in its
 # source tree, thus cannot extract version.

+# Catch case when caller has set GFLAGS_NAMESPACE in the cache / GUI
+# with an invalid value.
+IF (GFLAGS_NAMESPACE AND
+    NOT GFLAGS_NAMESPACE STREQUAL "google" AND
+    NOT GFLAGS_NAMESPACE STREQUAL "gflags")
+  GFLAGS_REPORT_NOT_FOUND(
+    "Caller defined GFLAGS_NAMESPACE:"
+    " ${GFLAGS_NAMESPACE} is not valid, not google or gflags.")
+ENDIF ()
 # Catch case when caller has set GFLAGS_INCLUDE_DIR in the cache / GUI and
 # thus FIND_[PATH/LIBRARY] are not called, but specified locations are
 # invalid, otherwise we would report the library as found.
@@ -217,6 +418,8 @@
   SET(GFLAGS_LIBRARIES ${GFLAGS_LIBRARY} ${GFLAGS_LINK_LIBRARIES})
 ENDIF (GFLAGS_FOUND)

+GFLAGS_RESET_FIND_LIBRARY_PREFIX()
+
 # Handle REQUIRED / QUIET optional arguments.
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gflags DEFAULT_MSG


[cmake] Matlab: use mexext for arch detection

--- cmake/FindMATLAB.cmake
+++ cmake/FindMATLAB.cmake
@@ -53,17 +53,19 @@
       OR ("${MATLAB_ROOT}" STREQUAL "/registry"))
   ENDFOREACH(MATVER)

-  # Directory name depending on whether the Windows architecture is 32
-  # bit or 64 bit
-  set(CMAKE_SIZEOF_VOID_P 8) # Note: For some weird reason this variable is undefined in my system...
-  IF(CMAKE_SIZEOF_VOID_P MATCHES "4")
-    SET(WINDIR "win32")
-  ELSEIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
-    SET(WINDIR "win64")
-  ELSE(CMAKE_SIZEOF_VOID_P MATCHES "4")
-    MESSAGE(FATAL_ERROR
-      "CMAKE_SIZEOF_VOID_P (${CMAKE_SIZEOF_VOID_P}) doesn't indicate a valid platform")
-  ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "4")
+  EXECUTE_PROCESS(COMMAND "${MATLAB_ROOT}/bin/mexext.bat"
+                  OUTPUT_VARIABLE MATLAB_MEXEXT
+                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+  IF(NOT MATLAB_MEXEXT)
+     MESSAGE(FATAL_ERROR "mexext.bat not found. Meh!")
+  ENDIF()
+
+  IF(MATLAB_MEXEXT STREQUAL "mexw32")
+      SET(WINDIR "win32")
+  ELSE()
+      SET(WINDIR "win64")
+  ENDIF()

   # Folder where the MEX libraries are, depending of the Windows compiler
   IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
@@ -111,12 +113,6 @@
     "${MATLAB_ROOT}/extern/include"
     )

-   EXECUTE_PROCESS(
-       COMMAND "${MATLAB_ROOT}/bin/mexext.bat"
-       OUTPUT_VARIABLE MATLAB_MEXEXT
-       OUTPUT_STRIP_TRAILING_WHITESPACE
-       )
-
 ELSE(WIN32)

   IF((NOT DEFINED MATLAB_ROOT)


Modify error message

Modify error message

--- cmake/FindWebRTC.cmake
+++ cmake/FindWebRTC.cmake
@@ -376,5 +376,5 @@

 if(NOT WEBRTC_FOUND)
   message(FATAL_ERROR "WebRTC file was not found.\n"
-      "Please check 'WEBRTC_ROOT_DIR' and 'WEBRTC_LIBRARY_DIR'.\n")
-endif()
+      "Please check 'WEBRTC_ROOT_DIR'.\n")
+endif()


r10128/sofa : FIX: cmake: Debug build flags incorrectly set on multi-configuration generators (Visual Studio, XCode).

Former-commit-id: eca1518a7c9c832fc071327ab0940ef86f01b82c

--- cmake/buildFlags.cmake
+++ cmake/buildFlags.cmake
@@ -47,7 +47,9 @@
 endif()

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

@@ -57,7 +59,12 @@
 endif()

 # SOFA_DEBUG preprocessor macro
-if(CMAKE_BUILD_TYPE MATCHES "Debug")
+if (WIN32 OR APPLE)
+	# Reminder: multi-configuration generators like Visual Studio and XCode do not use CMAKE_BUILD_TYPE,
+	# as they generate all configurations in the project, not just one at a time!
+	set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSOFA_DEBUG")
+	set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSOFA_DEBUG")
+elseif(CMAKE_BUILD_TYPE MATCHES "Debug")
     list(APPEND compilerDefines "SOFA_DEBUG")
 endif()


fix(qt): Qt sometimes adds include directories that don't exist

--- cmake/consort/qt.cmake
+++ cmake/consort/qt.cmake
@@ -162,6 +162,17 @@
 			set( CMAKE_AUTORCC 1 )

 			message(STATUS "Qt version: ${Qt5Core_VERSION_STRING} (${QT_ROOT})")
+
+			if( Qt5Core_VERSION_STRING VERSION_LESS "5.1" )
+				# Qt before 5.1 can generate errors
+				foreach(m ${_qt_modules})
+					foreach(d ${Qt5${m}_INCLUDE_DIRS})
+						if(NOT IS_DIRECTORY "${d}")
+							list(REMOVE_ITEM Qt5${m}_INCLUDE_DIRS "${d}")
+						endif()
+					endforeach()
+				endforeach()
+			endif()

 			if( NOT QT_TRANSLATIONS_DIR)
 				get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)


[cmake] remove cplex to decrease the madness a bit

--- cmake/gams_setup.cmake
+++ cmake/gams_setup.cmake
@@ -27,13 +27,13 @@
   COMPILE_WITH(PathVI)
   IF(PathVI_FOUND)
     SET(HAVE_GAMS_PATHVI TRUE)
-    compile_with(Cplex)
+    #    compile_with(Cplex)
   ELSE(PathVI_FOUND)
     SET(HAVE_GAMS_PATHVI FALSE)
   ENDIF(PathVI_FOUND)

   # GAMS distributes Cplex ...
-  IF(NOT Cplex_LIBRARY_DIRECTORY)
-    SET(Cplex_LIBRARY_DIRECTORY ${GAMS_DIR})
-   ENDIF()
+  #  IF(NOT Cplex_LIBRARY_DIRECTORY)
+  #    SET(Cplex_LIBRARY_DIRECTORY ${GAMS_DIR})
+  #   ENDIF()
  ENDIF(GAMS_FOUND)


set BUILD_SHARED_LIBS FALSE and PNG_SHARED off

--- cmake/get-libpng.cmake
+++ cmake/get-libpng.cmake
@@ -16,8 +16,8 @@
       -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
       -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
       -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-      -DBUILD_SHARED_LIBS=TRUE
-      -DPNG_SHARED=on
+      -DBUILD_SHARED_LIBS=FALSE
+      -DPNG_SHARED=off
       -DPNG_STATIC=on
       -DPNG_TESTS=off
       -DZLIB_LIBRARY:FILEPATH=${DEPENDENCY_INSTALL_DIR}/zlib/lib/zlib.lib


r9297/sofa : cmake: fix shadow build for SofaGuiQt

Former-commit-id: b5f85dcdf263118693e9d45ef56b645b96142951

--- cmake/pre-config.cmake
+++ cmake/pre-config.cmake
@@ -96,4 +96,7 @@

 	find_package(Qt3 COMPONENTS qtopengl REQUIRED)
 endif()
-set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE} CACHE INTERNAL "QMake executable path")+set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE} CACHE INTERNAL "QMake executable path")
+
+# out of source build support
+set(CMAKE_INCLUDE_CURRENT_DIR 1)


Do not add_library() gmock and gtest if targets already exist (#927)

* Do not add_library() gmock and gmock_main() if already existing

Fixes build problems with Google Cartographer (https://github.com/googlecartographer/cartographer_ros/issues/776), which provides its own `FindGMock.cmake`.

* Also check if gtest exists before calling add_library()

--- cmake/test/gtest.cmake
+++ cmake/test/gtest.cmake
@@ -366,10 +366,14 @@
     endif()
   else()
     message(STATUS "Found gtest: gtests will be built")
-    add_library(gtest SHARED IMPORTED)
-    set_target_properties(gtest PROPERTIES IMPORTED_LOCATION "${GTEST_LIBRARIES}")
-    add_library(gtest_main SHARED IMPORTED)
-    set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION "${GTEST_MAIN_LIBRARIES}")
+    if(NOT TARGET gtest)
+      add_library(gtest SHARED IMPORTED)
+      set_target_properties(gtest PROPERTIES IMPORTED_LOCATION "${GTEST_LIBRARIES}")
+    endif()
+    if(NOT TARGET gtest_main)
+      add_library(gtest_main SHARED IMPORTED)
+      set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION "${GTEST_MAIN_LIBRARIES}")
+    endif()
     set(GTEST_FOUND ${GTEST_FOUND} CACHE INTERNAL "")
     set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} CACHE INTERNAL "")
     set(GTEST_LIBRARIES ${GTEST_LIBRARIES} CACHE INTERNAL "")
@@ -378,10 +382,14 @@
   endif()
 else()
   message(STATUS "Found gmock: gmock and gtests will be built")
-  add_library(gmock UNKNOWN IMPORTED)
-  set_target_properties(gmock PROPERTIES IMPORTED_LOCATION "${GMOCK_LIBRARIES}")
-  add_library(gmock_main UNKNOWN IMPORTED)
-  set_target_properties(gmock_main PROPERTIES IMPORTED_LOCATION "${GMOCK_MAIN_LIBRARIES}")
+  if(NOT TARGET gmock)
+    add_library(gmock UNKNOWN IMPORTED)
+    set_target_properties(gmock PROPERTIES IMPORTED_LOCATION "${GMOCK_LIBRARIES}")
+  endif()
+  if(NOT TARGET gmock_main)
+    add_library(gmock_main UNKNOWN IMPORTED)
+    set_target_properties(gmock_main PROPERTIES IMPORTED_LOCATION "${GMOCK_MAIN_LIBRARIES}")
+  endif()
   set(GMOCK_FOUND ${GMOCK_FOUND} CACHE INTERNAL "")
   set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS} CACHE INTERNAL "")
   set(GMOCK_LIBRARIES ${GMOCK_LIBRARIES} CACHE INTERNAL "")


Revert one openal -> openal-soft replacement - reviewed by Moss

--- indra/cmake/OPENAL.cmake
+++ indra/cmake/OPENAL.cmake
@@ -12,7 +12,7 @@
   if (STANDALONE)
     include(FindPkgConfig)
     include(FindOpenAL)
-    pkg_check_modules(OPENAL_LIB REQUIRED openal-soft)
+    pkg_check_modules(OPENAL_LIB REQUIRED openal)
     pkg_check_modules(FREEALUT_LIB REQUIRED freealut)
   else (STANDALONE)
     use_prebuilt_binary(openal-soft)


Additional FBX library name for Linux builds

--- cmake/FindFBX.cmake
+++ cmake/FindFBX.cmake
@@ -19,7 +19,7 @@
 )

 FIND_LIBRARY(FBX_LIBRARY_DEBUG
-  NAMES libfbxsdkd
+  NAMES libfbxsdkd fbxsdkd
   PATH_SUFFIXES lib64 lib
   PATHS
   ${CMAKE_SOURCE_DIR}/../Intrinsic_Dependencies/dependencies/fbx
@@ -34,7 +34,7 @@
 )

 FIND_LIBRARY(FBX_LIBRARY_RELEASE
-  NAMES libfbxsdk
+  NAMES libfbxsdk fbxsdk
   PATH_SUFFIXES lib64 lib
   PATHS
   ${CMAKE_SOURCE_DIR}/../Intrinsic_Dependencies/dependencies/fbx


Fix FindLZO.cmake Detecting liblzo on darwin was not working and the linking flags were not exported properly

--- cmake/FindLZO.cmake
+++ cmake/FindLZO.cmake
@@ -6,9 +6,9 @@

 find_path(LZO_INCLUDE_DIR NAMES lzo/lzoconf.h)

-find_library(LZO_LIB NAMES liblzo2.so)
+find_library(LZO_LIBS NAMES lzo2)

-if (LZO_LIB)
+if (LZO_LIBS)
   if (LZO_INCLUDE_DIR)
     set(LZO_FOUND TRUE)
   else ()
@@ -20,7 +20,7 @@

 if (LZO_FOUND)
   if (NOT LZO_FIND_QUIETLY)
-    message(STATUS "Lzo Library ${LZO_LIB}")
+    message(STATUS "Lzo Library ${LZO_LIBS}")
     message(STATUS "Lzo Include Found in ${LZO_INCLUDE_DIR}")
   endif ()
 else ()


remove outdated tbb flag tests

remove outdated tbb flag tests

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -187,9 +187,8 @@
 ELSE(TBB_LINK_LIBRARIES AND TBB_INCLUDE_DIR)
     SET(TBB_BASIC_FOUND FALSE)
 ENDIF(TBB_LINK_LIBRARIES AND TBB_INCLUDE_DIR)
+
 IF(TBB_BASIC_FOUND)
-    INCLUDE(CheckCXXSourceRuns)
-    SET(SAFE_CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS})
     SET(SAFE_CMAKE_REQUIRED_INCLUDES  ${CMAKE_REQUIRED_INCLUDES})
     SET(SAFE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
     SET(CMAKE_REQUIRED_INCLUDES ${SAFE_CMAKE_REQUIRED_INCLUDES}
@@ -201,36 +200,13 @@
         SET(CMAKE_REQUIRED_LIBRARIES ${SAFE_CMAKE_REQUIRED_LIBRARIES}
             ${TBB_LINK_LIBRARIES})
     ENDIF(TBB_LINK_LIBRARIES_DEBUG)
-    CHECK_CXX_SOURCE_RUNS("${TBB_TEST_SOURCE}" TBB_TEST_SOURCE_RUNS)
-    FOREACH(EXCEPTION_FLAG 1 0)
-        FOREACH(CPP0X_FLAG 1 0)
-            IF(NOT TBB_TEST_SOURCE_RUNS)
-                MESSAGE(STATUS
-                    "Try TBB with -DTBB_USE_CAPTURED_EXCEPTION=${EXCEPTION_FLAG} -DTBB_IMPLEMENT_CPP0X=${CPP0X_FLAG}")
-                UNSET(TBB_TEST_SOURCE_RUNS CACHE)
-                SET(CMAKE_REQUIRED_DEFINITIONS
-                    ${SAFE_CMAKE_REQUIRED_DEFINITIONS}
-                    -DTBB_USE_CAPTURED_EXCEPTION=${EXCEPTION_FLAG}
-                    -DTBB_IMPLEMENT_CPP0X=${CPP0X_FLAG})
-                CHECK_CXX_SOURCE_RUNS("${TBB_TEST_SOURCE}"
-                    TBB_TEST_SOURCE_RUNS)
-                IF(TBB_TEST_SOURCE_RUNS)
-                    SET(TBB_DEFINITIONS
-                        -DTBB_USE_CAPTURED_EXCEPTION=${EXCEPTION_FLAG}
-                        -DTBB_IMPLEMENT_CPP0X=${CPP0X_FLAG}
-                        CACHE STRING "TBB compile time definitions")
-                ENDIF(TBB_TEST_SOURCE_RUNS)
-            ENDIF(NOT TBB_TEST_SOURCE_RUNS)
-        ENDFOREACH(CPP0X_FLAG 0 1)
-    ENDFOREACH(EXCEPTION_FLAG 0 1)
-    IF(TBB_TEST_SOURCE_RUNS)
+    INCLUDE(CheckCXXSourceRuns)
+    CHECK_CXX_SOURCE_RUNS("${TBB_TEST_SOURCE}" TBB_FOUND)
+    IF(TBB_FOUND)
         MESSAGE(STATUS "Found TBB")
-        SET(TBB_FOUND TRUE CACHE BOOL "Found TBB")
-    ELSE(TBB_TEST_SOURCE_RUNS)
+    ELSE(TBB_FOUND)
         MESSAGE(STATUS "NOT Found TBB")
-        SET(TBB_FOUND FALSE CACHE BOOL "NOT Found TBB")
-    ENDIF(TBB_TEST_SOURCE_RUNS)
-    SET(CMAKE_REQUIRED_DEFINITIONS ${SAFE_CMAKE_REQUIRED_DEFINITIONS})
+    ENDIF(TBB_FOUND)
     SET(CMAKE_REQUIRED_INCLUDES ${SAFE_CMAKE_REQUIRED_INCLUDES})
     SET(CMAKE_REQUIRED_LIBRARIES ${SAFE_CMAKE_REQUIRED_LIBRARIES})
 ELSE(TBB_BASIC_FOUND)


minor cmake sumamry log fix

minor cmake sumamry log fix

--- cmake/Summary.cmake
+++ cmake/Summary.cmake
@@ -107,8 +107,9 @@
   caffe_status("  C++ compiler      :   ${CMAKE_CXX_COMPILER}")
   caffe_status("  Release CXX flags :   ${__flags_rel}")
   caffe_status("  Debug CXX flags   :   ${__flags_deb}")
+  caffe_status("  Build type        :   ${CMAKE_BUILD_TYPE}")
+  caffe_status("")
   caffe_status("  BUILD_SHARED_LIBS :   ${BUILD_SHARED_LIBS}")
-  caffe_status("  Build type        :   ${CMAKE_BUILD_TYPE}")
   caffe_status("  BUILD_python      :   ${BUILD_python}")
   caffe_status("  BUILD_matlab      :   ${BUILD_matlab}")
   caffe_status("  BUILD_docs        :   ${BUILD_docs}")
@@ -116,8 +117,9 @@
   caffe_status("")
   caffe_status("Dependencies:")
   caffe_status("  BLAS              : " APPLE THEN "Yes (vecLib)" ELSE "Yes (${BLAS})")
+  caffe_status("  Boost             :   Yes (ver. ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION})")
   caffe_status("  glog              :   Yes")
-  caffe_status("  gflags            :   Yes")
+  caffe_status("  gflags            :   Yes")
   caffe_status("  protobuf          : " PROTOBUF_FOUND THEN "Yes (ver. ${PROTOBUF_VERSION})" ELSE "No" )
   caffe_status("  lmdb              : " LMDB_FOUND THEN "Yes (ver. ${LMDB_VERSION})" ELSE "No")
   caffe_status("  Snappy            : " SNAPPY_FOUND THEN "Yes (ver. ${Snappy_VERSION})" ELSE "No" )


Fix for CMake CMP0064 warning

Fix for CMake CMP0064 warning

CMake 3.4 gives a warning when ${test_type} is equal to "TEST".
This is because TEST is now a operator in if() statements.  The
fix matches the version of this file that will be part of CMake 3.4.1.

Change-Id: I7cac7affa3c1a2fe451b3e00f85f8c63b7e4c64b

--- CMake/FindGTest.cmake
+++ CMake/FindGTest.cmake
@@ -124,11 +124,11 @@
           string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})

           # Parameterized tests have a different signature for the filter
-          if(${test_type} STREQUAL "TEST_P")
+          if("x${test_type}" STREQUAL "xTEST_P")
             string(REGEX REPLACE ${gtest_case_name_regex}  "*/\\1.\\2/*" test_name ${hit})
-          elseif(${test_type} STREQUAL "TEST_F" OR ${test_type} STREQUAL "TEST")
+          elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST")
             string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit})
-          elseif(${test_type} STREQUAL "TYPED_TEST")
+          elseif("x${test_type}" STREQUAL "xTYPED_TEST")
             string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" test_name ${hit})
           else()
             message(WARNING "Could not parse GTest ${hit} for adding to CTest.")


Reorder CMake checks for sprintf() variants. VS2015 has snprintf(), however sprintf_s() is still recommended.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -211,20 +211,20 @@
   #include <cstdio>
   int main() {
     char buf[20];
-    snprintf(buf, 20, \"%d\", 1);
-    return 0;
-  }
-" HAVE_SNPRINTF)
-
-if(NOT HAVE_SNPRINTF)
+    sprintf_s(buf, \"%d\", 1);
+    return 0;
+  }
+" HAVE_SPRINTF_S)
+
+if(NOT HAVE_SPRINTF_S)
   check_cxx_source_compiles("
     #include <cstdio>
     int main() {
       char buf[20];
-      sprintf_s(buf, \"%d\", 1);
+      snprintf(buf, 20, \"%d\", 1);
       return 0;
     }
-  " HAVE_SPRINTF_S)
+  " HAVE_SNPRINTF)
 endif()

 # Check for libz using the cmake supplied FindZLIB.cmake


Remove debugging message I accidently left behind in
1a21e311828b4d489888336f81c290c9597db65b [formerly 831b276f3c3ac50c7f25aad7213fbb13a5473b46]

Former-commit-id: e9850e715a64998fac59967ff3bc18bc3b03e75e

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -107,7 +107,6 @@

   else()
     if (NOT target_is_pnacl)
-      message(STATUS "The filter lib is ${FILTER_LIB}")
       add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
         DEPENDS "${args_GENERATOR_TARGET}"
         COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}


build: Fix Visual Studio warnings.

build: Fix Visual Studio warnings.

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -63,6 +63,9 @@
 endif (UNIX AND NOT WIN32)

 if (MSVC)
-    # Suppress warning about "deprecated" functions
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nologo -D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x501")
+    # Use secure functions by defaualt and suppress warnings about
+    #"deprecated" functions
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1")
 endif (MSVC)


Add missing libraries

Add missing libraries

--- cmake/Qt5Widgets_HunterPlugin_5_5.cmake
+++ cmake/Qt5Widgets_HunterPlugin_5_5.cmake
@@ -140,10 +140,16 @@
   # defined: 'IceProcessMessages'
   # Disable for build with xcb from Hunter
   # _qt_cmake_extra_helpers_add_interface(Qt5::Widgets "ICE")
+  _qt_cmake_extra_helpers_add_interface(
+      Qt5::Widgets "${_qt_install_prefix}/lib/libICE.a"
+  )

   # defined: `SmcCloseConnection'
   # Disable for build with xcb from Hunter
   # _qt_cmake_extra_helpers_add_interface(Qt5::Widgets "SM")
+  _qt_cmake_extra_helpers_add_interface(
+      Qt5::Widgets "${_qt_install_prefix}/lib/libSM.a"
+  )

   # Disable for build with xcb from Hunter
   # _qt_cmake_extra_helpers_add_interface(Qt5::Widgets "X11")


Remove unused CMAKE_XXD_PROGRAM

Remove unused CMAKE_XXD_PROGRAM

Change-Id: I27c0ddab14985e33aab4a1ac865d316037d12a19
GitOrigin-RevId: 6b5f85d2c19152fd2c64c1095678fb0c9d096358

--- cmake/toolchain-arm-none-eabi-gcc.cmake
+++ cmake/toolchain-arm-none-eabi-gcc.cmake
@@ -76,8 +76,6 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

-find_program(CMAKE_XXD_PROGRAM xxd REQUIRED)
-
 set(COMMON_C_FLAGS
     "-Wall"
     "-Wno-psabi"


Don't use checksums in `MunkeiCoverage`

Don't use checksums in `MunkeiCoverage`

--- MunkeiCoverage.cmake
+++ MunkeiCoverage.cmake
@@ -52,7 +52,6 @@
       COMMAND           ${lcov}
                           --base-directory ${CMAKE_SOURCE_DIR}
                           --capture
-                          --checksum
                           --directory ${CMAKE_BINARY_DIR}
                           --no-external
                           --output-file ${tracefile}


test: Fix xml output matching on i386-pc-windows-msvc targets

Class methods have an extra attributes="__thiscall__" xml attribute
on this architecture that does not appear in our test expectation
files.  We already have an explicit test that this function type
attribute is generated, so simply filter it out from test output
before matching.

--- test/run.cmake
+++ test/run.cmake
@@ -34,6 +34,8 @@
   set(maybe_xml xml)
   if(EXISTS "${xml}")
     file(READ "${xml}" actual_xml)
+    # Filter out arch-specific attributes.
+    string(REGEX REPLACE "(<(Constructor|Destructor|Method|OperatorMethod|Converter)[^/>]*) attributes=\"__thiscall__\"(/?>)" "\\1\\3" actual_xml "${actual_xml}")
   else()
     set(actual_xml "(missing)")
   endif()


Do not try to compile libunwind on macOS

--- project/cmake/ProjectBuildOption.cmake
+++ project/cmake/ProjectBuildOption.cmake
@@ -97,7 +97,7 @@
 endif()

 if(LOG_WRAPPER_ENABLE_STACKTRACE)
-  if(NOT ANDROID AND NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+  if(NOT ANDROID AND NOT CMAKE_HOST_APPLE)
     # include("${ATFRAMEWORK_CMAKE_TOOLSET_DIR}/ports/jemalloc/jemalloc.cmake")
     if(LIBUNWIND_ENABLED)
       include("${ATFRAMEWORK_CMAKE_TOOLSET_DIR}/ports/libunwind/libunwind.cmake")


Should export scripts in exec/scripts and not exec/<host>/<mode>/scripts

--- make/TSPCMakeTools.cmake
+++ make/TSPCMakeTools.cmake
@@ -1,4 +1,4 @@
-SET(XSCRIPT_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/exec/${CMAKE_SYSTEM_NAME}/${CMAKE_BUILD_TYPE}/scripts)
+SET(XSCRIPT_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/exec/scripts)
 MAKE_DIRECTORY(${XSCRIPT_OUTPUT_PATH})
 # define TSP_XSCRIPT MACRO
 MACRO(TSP_XSCRIPT)