remove optional include of CMAKE_BINARY_DIR version.cmake

issue https://github.com/smanders/externpro/issues/16

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1391,8 +1391,6 @@

 # cmake-generates Version.hpp, resource.rc, resource.h in CMAKE_CURRENT_BINARY_DIR
 function(xpGenerateResources iconPath generatedFiles)
-  include(${CMAKE_BINARY_DIR}/version.cmake OPTIONAL)
-  # in case there wasn't a version.cmake in CMAKE_BINARY_DIR
   include(${xpThisDir}/version.cmake)
   string(TIMESTAMP PACKAGE_CURRENT_YEAR %Y)
   # Creates PACKAGE_VERSION_NUM and PACKAGE_STR


Enforce the C++11 standard as minimal requirement.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -489,6 +489,11 @@

 # Platform and compiler specific options
 set (CMAKE_CXX_STANDARD 11)
+set (CMAKE_CXX_STANDARD_REQUIRED ON)
+set (CMAKE_CXX_EXTENSIONS OFF)
+if (EMSCRIPTEN)     # It appears CMake does not detect C++standard for EMCC correctly, so do it the old way still
+    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+endif ()
 if (APPLE)
     if (IOS)
         # iOS-specific setup


hard-code boost search path in configure_boost

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1298 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ModuleSetup.cmake
+++ CMakeModules/ModuleSetup.cmake
@@ -149,6 +149,12 @@
         NAMES Boost boost
         COMPONENTS date_time filesystem system thread program_options unit_test_framework
         PREFIXES ${ENV_NAALI_DEP_PATH})
+
+    if (MSVC)
+        set (BOOST_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} ${ENV_NAALI_DEP_PATH}/include)
+        set (BOOST_LIBRARY_DIRS ${BOOST_LIBRARY_DIRS} ${ENV_NAALI_DEP_PATH}/lib)
+    endif ()
+
 endmacro (configure_boost)

 macro (configure_poco)


Missed an instance of DISABLE -> ENABLE changes

--HG--
branch : v1-7
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-7%401805

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -17,8 +17,8 @@
   set(OGRE_SET_BUILD_PLATFORM_IPHONE 1)
   set(OGRE_STATIC 1)
   set(OGRE_STATIC_LIB 1)
-  set(OGRE_CONFIG_DISABLE_VIEWPORT_ORIENTATIONMODE FALSE)
-  set(OGRE_CONFIG_DISABLE_PVRTC FALSE)
+  set(OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATIONMODE TRUE)
+  set(OGRE_CONFIG_ENABLE_PVRTC TRUE)
 endif()

 # should we build static libs?


mention prebuilt binaries in case of boost

--- CMake/External_boost.cmake
+++ CMake/External_boost.cmake
@@ -29,6 +29,9 @@
         ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
         ${BOOST_SB_SRC}
     )
+
+    message(STATUS "  Using Boost SuperBuild version")
+
   else(MSVC)
     #TODO: find hash for archives properly
     set(BOOST_HEADERS_URL_HASH 1605dc6085cb2dc778ef5ab6c0e59083)
@@ -36,20 +39,17 @@
     set(BOOST_REGEX_URL_HASH a3bfc2dc9a3ebe3c050518ecb29d6f8b)
     set(BOOST_UTF_URL_HASH 75971963a74c76d32e01974a8e48be11)

-
-   if(MSVC10)
-    set(BOOST_HEADERS_URL_HASH 1605dc6085cb2dc778ef5ab6c0e59083)
-    set(BOOST_GRAPH_URL_HASH c246516ca84a3c79ae8a0b22fceb0344)
-    set(BOOST_REGEX_URL_HASH a3bfc2dc9a3ebe3c050518ecb29d6f8b)
-    set(BOOST_UTF_URL_HASH 75971963a74c76d32e01974a8e48be11)
-   else(MSVC80)
+    if(MSVC10)
+        set(BOOST_HEADERS_URL_HASH 1605dc6085cb2dc778ef5ab6c0e59083)
+        set(BOOST_GRAPH_URL_HASH c246516ca84a3c79ae8a0b22fceb0344)
+        set(BOOST_REGEX_URL_HASH a3bfc2dc9a3ebe3c050518ecb29d6f8b)
+        set(BOOST_UTF_URL_HASH 75971963a74c76d32e01974a8e48be11)
+    else(MSVC80)

-   else(CMAKE_COMPILER_2005)
+    else(CMAKE_COMPILER_2005)

-   endif()
+    endif()

-
-
     set(BOOST_HEADERS_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/boost_1_50_headers.zip/download")
     set(BOOST_GRAPH_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/libboost_graph-vc100-mt-1_50.zip/download")
     set(BOOST_UTF_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/boost_unit_test_framework-vc100-mt-1_50.zip/download")
@@ -79,18 +79,18 @@
     list(APPEND BOOSTLIBS ${proj}_${BOOSTLIB})
     endforeach()

-        ExternalProject_Add(${proj}
-        PREFIX ${proj}
-        DOWNLOAD_COMMAND ""
-        SOURCE_DIR ${BOOST_SB_SRC}
-        DEPENDS ${BOOSTLIBS}
-        CONFIGURE_COMMAND ""
-        BUILD_COMMAND ""
-        INSTALL_COMMAND ""
-     )
+    ExternalProject_Add(${proj}
+      PREFIX ${proj}
+      DOWNLOAD_COMMAND ""
+      SOURCE_DIR ${BOOST_SB_SRC}
+      DEPENDS ${BOOSTLIBS}
+      CONFIGURE_COMMAND ""
+      BUILD_COMMAND ""
+      INSTALL_COMMAND ""
+    )

-  endif()
-
-  message(STATUS "  Using Boost SuperBuild version")
+    message(STATUS "  Using Boost SuperBuild version (prebuilt binaries)")
+
+  endif() #end else MSVC

 endif()


ENH: add an optional INSTALL parameter to the macro so that they can install files instead of copy them. Using INSTALL_FILES on TCL_SUPPORT_FILES just won't work because INSTALL_FILES does not recreate the subdirs

--- CMake/vtkTclTkMacros.cmake
+++ CMake/vtkTclTkMacros.cmake
@@ -102,15 +102,20 @@

 # ----------------------------------------------------------------------------
 # VTK_COPY_TCL_TK_SUPPORT_FILES
-# Copy Tcl/Tk support files to a different location.
+# Copy (or install) Tcl/Tk support files to a specific location.
 # See VTK_GET_TCL_SUPPORT_FILES for more info about support files.
-# Given the paths to the Tcl and Tk support lib dirs, this macro will copy
-# the appropriate support files to destination dirs, recreating the subdirs.
+# Given the paths to the Tcl and Tk support lib dirs, this macro will
+# copy (or install) the appropriate support files to destination dirs,
+# recreating the subdirs.
+# This macro takes an optional last parameter, if set to INSTALL the
+# files will be scheduled for installation (using CMake's INSTALL_FILES)
+# instead of copied.
 #
 # in: tcl_support_lib_dir:  path to the Tcl support lib dir
 #     tcl_support_lib_dest: destination dir for the Tcl support lib files
 #     tk_support_lib_dir:   path to the Tk support lib dir
 #     tk_support_lib_dest:  destination dir for the Tk support lib files
+#     INSTALL:              optional parameter (install files instead of copy)
 #
 # ex: VTK_COPY_TCL_TK_SUPPORT_FILES (
 #       "c:/tcl/lib/tcl8.4" "d:/vtk-bin/TclTk/lib/tcl8.4"
@@ -132,7 +137,12 @@
   FOREACH (file ${TCL_SUPPORT_FILES})
     IF (EXISTS ${file})
       STRING (REGEX REPLACE "${tcl_support_lib_dir}/" "" filebase ${file})
-      CONFIGURE_FILE (${file} "${tcl_support_lib_dest}/${filebase}" COPYONLY)
+      IF ("${ARGV4}" STREQUAL "INSTALL")
+        GET_FILENAME_COMPONENT(dir ${filebase} PATH)
+        INSTALL_FILES ("${tcl_support_lib_dest}/${dir}" FILES ${file})
+      ELSE ("${ARGV4}" STREQUAL "INSTALL")
+        CONFIGURE_FILE (${file} "${tcl_support_lib_dest}/${filebase}" COPYONLY)
+      ENDIF ("${ARGV4}" STREQUAL "INSTALL")
     ENDIF (EXISTS ${file})
   ENDFOREACH (file)

@@ -140,7 +150,12 @@
   FOREACH (file ${TK_SUPPORT_FILES})
     IF (EXISTS ${file})
       STRING (REGEX REPLACE "${tk_support_lib_dir}/" "" filebase ${file})
-      CONFIGURE_FILE (${file} "${tk_support_lib_dest}/${filebase}" COPYONLY)
+      IF ("${ARGV4}" STREQUAL "INSTALL")
+        GET_FILENAME_COMPONENT(dir ${filebase} PATH)
+        INSTALL_FILES ("${tk_support_lib_dest}/${dir}" FILES ${file})
+      ELSE ("${ARGV4}" STREQUAL "INSTALL")
+        CONFIGURE_FILE (${file} "${tk_support_lib_dest}/${filebase}" COPYONLY)
+      ENDIF ("${ARGV4}" STREQUAL "INSTALL")
     ENDIF (EXISTS ${file})
   ENDFOREACH (file)

@@ -148,14 +163,18 @@

 # ----------------------------------------------------------------------------
 # VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR
-# Front-end to VTK_COPY_TCL_TK_SUPPORT_FILES, this macro will copy the
-# appropriate Tcl/Tk support files to a project directory.
+# Front-end to VTK_COPY_TCL_TK_SUPPORT_FILES, this macro will
+# copy (or install) the appropriate Tcl/Tk support files to a directory.
 # The Tcl/Tk version is retrieved automatically and used to create
 # the subdirectories (see example below)
+# This macro takes an optional last parameter, if set to INSTALL the
+# files will be scheduled for installation (using CMake's INSTALL_FILES)
+# instead of copied.
 #
 # in: tcl_support_lib_dir: path to the Tcl support lib dir
 #     tk_support_lib_dir:  path to the Tk support lib dir
-#     project_dir:         project dir
+#     target_dir:          target directory
+#     INSTALL:             optional parameter (install files instead of copy)
 #
 # ex: VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR (
 #        "c:/tcl/lib/tcl8.4" "c:/tcl/lib/tk8.4" "d:/vtk-bin/lib")
@@ -167,16 +186,16 @@
 #       d:/vtk-bin/lib/tcl8.4
 #       d:/vtk-bin/lib/tk8.4

-MACRO (VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR tcl_support_lib_dir tk_support_lib_dir project_dir)
-
+MACRO (VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR tcl_support_lib_dir tk_support_lib_dir target_dir)
   VTK_GET_TCL_TK_VERSION ("TCL_TK_MAJOR_VERSION" "TCL_TK_MINOR_VERSION")
   IF (TCL_TK_MAJOR_VERSION AND TCL_TK_MINOR_VERSION)
     SET (TCL_TK_VERSION "${TCL_TK_MAJOR_VERSION}.${TCL_TK_MINOR_VERSION}")
     VTK_COPY_TCL_TK_SUPPORT_FILES (
       "${tcl_support_lib_dir}"
-      "${project_dir}/tcl${TCL_TK_VERSION}"
+      "${target_dir}/tcl${TCL_TK_VERSION}"
       "${tk_support_lib_dir}"
-      "${project_dir}/tk${TCL_TK_VERSION}"
+      "${target_dir}/tk${TCL_TK_VERSION}"
+      "${ARGV3}"
       )
   ENDIF (TCL_TK_MAJOR_VERSION AND TCL_TK_MINOR_VERSION)


git-svn-id: https://svn.icg.tugraz.at/svn/vmgpu/trunk/vmlibraries/imageutilities@10721 358b74ad-2626-0410-af80-f4c3c349ae55

--- imageutilities/cmake/FindCUDASDK.cmake
+++ imageutilities/cmake/FindCUDASDK.cmake
@@ -88,7 +88,10 @@
   "$ENV{HOME}/NVIDIA_GPU_Computing_SDK"
   "/Developer/CUDA"
   "/opt/cuda/sdk"
+  "$ENV{CUDA_SDK_ROOT_DIR}"
   )
+
+

 # Find include file from the CUDA_SDK_SEARCH_PATH


correct logic around building sirf and registration

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -235,7 +235,7 @@
 option(BUILD_SIRF_Contribs "Build SIRF-Contribs" ON)

 option(BUILD_SIRF_Registration "Build SIRFS's registration functionality" ${BUILD_NIFTYREG})
-if (BUILD_SIRF_Registration AND NOT BUILD_NIFTYREG)
+if (BUILD_SIRF AND BUILD_SIRF_Registration AND NOT BUILD_NIFTYREG)
   message(WARNING "Building SIRF registration is enabled, but BUILD_NIFTYREG=OFF. Reverting to BUILD_NIFTYREG=ON")
   set(BUILD_NIFTYREG ON CACHE BOOL "Build NIFTYREG" FORCE)
 endif()
@@ -299,7 +299,7 @@
   list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES CCPi-Regularisation-Toolkit CCPi-Framework CCPi-FrameworkPlugins)
 endif()

-if (BUILD_SIRF_Registration)
+if (BUILD_SIRF_Registration AND BUILD_SIRF)
   list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES NIFTYREG)
 endif()


ENH: In superbuild.cmake, CTK-build step can be excluded if SUPERBUILD_EXCLUDE_CTKBUILD_TARGET is set to ON.

The variable should be set to ON in case a ctest driver script is
using subproject and want to configure/build/test each one of them
separately. In that specific case, we want to make sure the configure and
build error are not reported when the project is configure/build from the top
level.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -323,17 +323,19 @@
 #-----------------------------------------------------------------------------
 # CTK
 #
-SET(proj CTK-build)
-ExternalProject_Add(${proj}
-  DOWNLOAD_COMMAND ""
-  CMAKE_GENERATOR ${gen}
-  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
-  BINARY_DIR CTK-build
-  #BUILD_COMMAND ""
-  INSTALL_COMMAND ""
-  DEPENDS
-    "CTK-Configure"
-  )
+#MESSAGE(STATUS SUPERBUILD_EXCLUDE_CTKBUILD_TARGET:${SUPERBUILD_EXCLUDE_CTKBUILD_TARGET})
+IF(NOT DEFINED SUPERBUILD_EXCLUDE_CTKBUILD_TARGET OR NOT SUPERBUILD_EXCLUDE_CTKBUILD_TARGET)
+  SET(proj CTK-build)
+  ExternalProject_Add(${proj}
+    DOWNLOAD_COMMAND ""
+    CMAKE_GENERATOR ${gen}
+    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+    BINARY_DIR CTK-build
+    INSTALL_COMMAND ""
+    DEPENDS
+      "CTK-Configure"
+    )
+ENDIF()

 #-----------------------------------------------------------------------------
 # Custom target allowing to drive the build of CTK project itself


Superbuild - Explicitly set BUILD_COMMAND associated with CTK-Build step.

Setting CONFIGURE_COMMAND to an empty command is not enough to skip configuration step,
the BUILD_COMMAND should also be specified explicitly otherwise it will in-conditionally
default to 'make' on all platform.

See _ep_get_configure_command_id and _ep_get_build_command in ExternalProject.cmake

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -258,12 +258,15 @@
 #MESSAGE(STATUS SUPERBUILD_EXCLUDE_CTKBUILD_TARGET:${SUPERBUILD_EXCLUDE_CTKBUILD_TARGET})
 IF(NOT DEFINED SUPERBUILD_EXCLUDE_CTKBUILD_TARGET OR NOT SUPERBUILD_EXCLUDE_CTKBUILD_TARGET)
   SET(proj CTK-build)
-  # Note: Let's add a dummy configure step so that BUILD_COMMAND is properly setup.
+  # Note: Setting CONFIGURE_COMMAND to an empty command is not enough to skip configuration step,
+  #       the BUILD_COMMAND should also be specified explicitly otherwise it will in-conditionally
+  #       default to 'make' on all platform.
   #       See _ep_get_configure_command_id and _ep_get_build_command in ExternalProject.cmake
   ExternalProject_Add(${proj}
     DOWNLOAD_COMMAND ""
-    CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo_append
+    CONFIGURE_COMMAND ""
     CMAKE_GENERATOR ${gen}
+    BUILD_COMMAND ${CMAKE_COMMAND} --build ${CTK_BINARY_DIR}/CTK-build --config ${CMAKE_CFG_INTDIR}
     SOURCE_DIR ${CTK_SOURCE_DIR}
     BINARY_DIR CTK-build
     INSTALL_COMMAND ""


Use CMAKE_C(XX)_COMPILER variable in external projects.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -20,7 +20,6 @@
 if(MITK_USE_QT)
   find_package(Qt4 REQUIRED)
   set(vtk_QT_ARGS
-      ${ep_common_args}
       -DDESIRED_QT_VERSION:STRING=4
       -DVTK_USE_GUISUPPORT:BOOL=ON
       -DVTK_USE_QVTK_QTOPENGL:BOOL=ON
@@ -70,7 +69,9 @@
   -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
   -DBUILD_SHARED_LIBS:BOOL=ON
   -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-  "-DCMAKE_C_FLAGS:STRING=${ep_common_CXX_FLAGS}"
+  -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
+  -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
+  "-DCMAKE_C_FLAGS:STRING=${ep_common_C_FLAGS}"
   "-DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS}"
 )

@@ -166,16 +167,11 @@
   DOWNLOAD_COMMAND ""
   CMAKE_GENERATOR ${gen}
   CMAKE_ARGS
+    ${ep_common_args}
     ${mitk_superbuild_boolean_args}
     -DMITK_USE_SUPERBUILD:BOOL=OFF
     -DCTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
     -DMITK_SUPERBUILD_BINARY_DIR:PATH=${MITK_BINARY_DIR}
-    -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
-    -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-    "-DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS} ${MITK_CXX_FLAGS}"
-    "-DCMAKE_C_FLAGS:STRING=${ep_common_C_FLAGS} ${MITK_C_FLAGS}"
-    -DMITK_CXX_FLAGS:STRING=${MITK_CXX_FLAGS}
-    -DMITK_C_FLAGS:STRING=${MITK_C_FLAGS}
     -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
     -DMITK_KWSTYLE_EXECUTABLE:FILEPATH=${MITK_KWSTYLE_EXECUTABLE}
     -DCTK_DIR:PATH=${CTK_DIR}


Create a default gadgetron config

Create a default gadgetron config

Create a default gadgetron.xml if not present.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -93,6 +93,11 @@
 configure_file(env_ccppetmr.sh.in ${CCPPETMR_INSTALL}/bin/env_ccppetmr.sh)
 configure_file(env_ccppetmr.csh.in ${CCPPETMR_INSTALL}/bin/env_ccppetmr.csh)

+# create a default gadgetron config file if it doens't exist yet
+if(NOT EXISTS "${CCPPETMR_INSTALL}/share/gadgetron/config/gadgetron.xml")
+    configure_file(${CCPPETMR_INSTALL}/share/gadgetron/config/gadgetron.xml.example ${CCPPETMR_INSTALL}/share/gadgetron/config/gadgetron.xml)
+endif()
+

 # add tests


SVN_SILENT made messages (.desktop file)

--- ds9/ds9.desktop.cmake
+++ ds9/ds9.desktop.cmake
@@ -34,6 +34,7 @@
 Name[pt_BR]=DirectShow9
 Name[ro]=DirectShow9
 Name[ru]=DirectShow9
+Name[sk]=DirectShow9
 Name[sl]=DirectShow9
 Name[sr]=Дајректшоу‑9
 Name[sr@ijekavian]=Дајректшоу‑9
@@ -72,6 +73,7 @@
 Comment[pt_BR]=Infraestrutura do DirectShow9 para o Phonon
 Comment[ro]=Suportul DirectShow9 pentru Phonon
 Comment[ru]=Механизм DirectShow9 для Phonon
+Comment[sk]=Backend Phonon DirectShow9
 Comment[sl]=Zaledje DirectShow9 za Phonon
 Comment[sr]=Дајректшоу‑9 као позадина Фонона
 Comment[sr@ijekavian]=Дајректшоу‑9 као позадина Фонона


Fix to freeimage module

Fix to freeimage module

--- allocore/modules/freeimage_module.cmake
+++ allocore/modules/freeimage_module.cmake
@@ -26,7 +26,7 @@
     foreach(header ${FREEIMAGE_HEADERS})
         list(APPEND FREEIMAGE_DUMMY_HEADER_INFO "${header}::::Freeimage")
     endforeach()
-    list(APPEND ALLOCORE_DUMMY_HEADERS ${FREEIMAGE_HEADERS})
+    list(APPEND ALLOCORE_DUMMY_HEADERS ${FREEIMAGE_DUMMY_HEADERS})

 endif(GLUT_LIBRARY AND OPENGL_LIBRARY)

@@ -35,6 +35,6 @@
     foreach(header ${FREEIMAGE_HEADERS})
         list(APPEND FREEIMAGE_DUMMY_HEADER_INFO "${header}::::Freeimage")
     endforeach()
-    list(APPEND ALLOCORE_DUMMY_HEADERS ${FREEIMAGE_HEADERS})
+    list(APPEND ALLOCORE_DUMMY_HEADERS ${FREEIMAGE_DUMMY_HEADERS})
 endif(FREEIMAGE_LIBRARY)


ENH: use archive, contains a fixed version of Atomic (pb on OSX)

--- CMake/External_OpenThreads.cmake
+++ CMake/External_OpenThreads.cmake
@@ -20,8 +20,10 @@

   ExternalProject_Add(${proj}
     PREFIX ${proj}
-    SVN_REPOSITORY "http://svn.openscenegraph.org/osg/OpenThreads/tags/OpenThreads-2.3.0/"
-    SVN_REVISION -r 14667
+    #SVN_REPOSITORY "http://svn.openscenegraph.org/osg/OpenThreads/tags/OpenThreads-2.3.0/"
+    #SVN_REVISION -r 14667
+    URL "http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip"
+    URL_MD5 4980f8692712a24d4c99f363f80c6814
     SOURCE_DIR ${OPENTHREADS_SB_SRC}
     BINARY_DIR ${OPENTHREADS_SB_BUILD_DIR}
     INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
@@ -38,4 +40,4 @@

   message(STATUS "  Using OpenThreads SuperBuild version")

-endif()+endif()


REFAC: OTBApplicationEngine should be already in the DEPENDS

--- CMake/OTBApplicationMacros.cmake
+++ CMake/OTBApplicationMacros.cmake
@@ -26,7 +26,7 @@
    # Build the library as a MODULE (shared lib even if OTB is built statically)
    include_directories(${APPLICATION_INCLUDE_DIRS})
    add_library(${APPLICATION_TARGET_NAME} MODULE ${APPLICATION_SOURCES})
-   target_link_libraries(${APPLICATION_TARGET_NAME} OTBApplicationEngine ${APPLICATION_LINK_LIBRARIES})
+   target_link_libraries(${APPLICATION_TARGET_NAME} ${APPLICATION_LINK_LIBRARIES})
    if(otb-module)
      otb_module_target_label(${APPLICATION_TARGET_NAME})
    endif()


refactor thorpp cmake macro

refactor thorpp cmake macro

--- CMake/Packages/UsingThorPP.cmake
+++ CMake/Packages/UsingThorPP.cmake
@@ -86,6 +86,7 @@
             MESSAGE(FATAL_ERROR "file must exist!")
         ENDIF()

+        FILE(MAKE_DIRECTORY ${__output_path})
         SET(__input_stem "${__output_path}/${__input_name}") # do everything in output path
         STRING(REGEX REPLACE ${__input_ext} "${__output_ext}" gen_source_1 ${__input_stem})

@@ -188,6 +189,7 @@
             MESSAGE(FATAL_ERROR "file must exist!")
         ENDIF()

+        FILE(MAKE_DIRECTORY ${__output_path})
         SET(__input_stem "${__output_path}/${__input_name}") # do everything in output path
         STRING(REGEX REPLACE ${__input_ext} "_intermediate.cpp" gen_source_1 ${__input_stem})
         STRING(REGEX REPLACE ${__input_ext} "${__output_ext}" gen_source_2 ${__input_stem})


Prefer downloaded boost compute over system version. Set min version

--- CMakeModules/boost_package.cmake
+++ CMakeModules/boost_package.cmake
@@ -5,7 +5,7 @@
 # The complete license agreement can be obtained at:
 # http://arrayfire.com/licenses/BSD-3-Clause

-find_package(Boost)
+find_package(Boost 1.66 REQUIRED)

 set(Boost_MIN_VER 107000)
 set(Boost_MIN_VER_STR "1.70")
@@ -45,8 +45,8 @@
   add_dependencies(Boost::boost boost_compute)

   set_target_properties(Boost::boost PROPERTIES
-    INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIR};${source_dir}/include"
-    INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIR};${source_dir}/include"
+    INTERFACE_INCLUDE_DIRECTORIES "${source_dir}/include;${Boost_INCLUDE_DIR}"
+    INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${source_dir}/include;${Boost_INCLUDE_DIR}"
     )
 else()
   if(NOT TARGET Boost::boost)


fix: Map package name to Find<Pkg>/<Pkg>Config result variable name prefix [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -528,10 +528,11 @@
         if (NOT "^${_DEPENDS_${PKG}_DIR}$" STREQUAL "^${DEPENDS_${PKG}_DIR}$")
           set (${PKG}_FOUND FALSE) # need to start a new search
           get_cmake_property (_BFP_VARS VARIABLES)
-          basis_sanitize_for_regex (PKG_RE   "${PKG}")
-          basis_sanitize_for_regex (PKG_U_RE "${PKG_U}")
+          basis_sanitize_for_regex (PKG_RE     "${PKG}")
+          basis_sanitize_for_regex (PKG_U_RE   "${PKG_U}")
+          basis_sanitize_for_regex (_BFP_NS_RE "${_BFP_NS}")
           foreach (_BFP_VAR IN LISTS _BFP_VARS)
-            if (_BFP_VAR MATCHES "^(${PKG_RE}|${PKG_U_RE})[_-]")
+            if (_BFP_VAR MATCHES "^_?(${_BFP_NS_RE}|${PKG_RE}|${PKG_U_RE})[_-]")
               basis_is_cached (_BFP_CACHED ${_BFP_VAR})
               if (_BFP_CACHED)
                 set_property (CACHE ${_BFP_VAR} PROPERTY VALUE "${_BFP_VAR}-NOTFOUND")
@@ -542,6 +543,8 @@
             endif ()
           endforeach ()
           unset (PKG_RE)
+          unset (PKG_U_RE)
+          unset (_BFP_NS_RE)
         endif ()
       endif ()
       # ----------------------------------------------------------------------
@@ -591,8 +594,8 @@
         mark_as_advanced (FORCE DEPENDS_${PKG}_DIR)
       else ()
         # status message with information what we are looking for
-        if (PKG MATCHES "^(MFC|wxWidgets)$")
-          set (_BFP_STATUS) # Find<Pkg> module prints status already
+        if (_BFP_ARGN_QUIET)
+          set (_BFP_STATUS)
         else ()
           set (_BFP_STATUS "Looking for ${PKG}")
           if (_BFP_VERSIONS)
@@ -614,13 +617,10 @@
         endif ()
         # make copy of previous <Pkg>_VERSION_STRING if already set which is used
         # as "last resort" when variable not set by the following find_package
-        set (_BFP_VERSION_STRING "${${PKG}_VERSION_STRING}")
-        unset (${PKG}_VERSION_STRING)
+        set (_BFP_VERSION_STRING "${${_BFP_NS}_VERSION_STRING}")
+        unset (${_BFP_NS}_VERSION_STRING)
         # set internal <Pkg>_DIR used by find_package to locate <Pkg>Config
         set (${PKG}_DIR "${DEPENDS_${PKG}_DIR}" CACHE INTERNAL "Directory containing ${PKG}Config.cmake file." FORCE)
-        # set <PKG>_ROOT used by some Find<Pkg> modules
-        # Attention: FindBoost does not allow Boost_ROOT to be set, only BOOST_ROOT!
-        set (${PKG_U}_ROOT "${DEPENDS_${PKG}_DIR}")
         # call find_package if not all components found yet
         set (_BFP_FOUND "${${PKG}_FOUND}") # used to decide what the intersection of
                                            # multiple find invocations for the same
@@ -628,23 +628,24 @@
                                            # for the setting of <PKG>_FOUND
         if (NOT _BFP_NO_FIND_PACKAGE)
           # reset <PKG>_FOUND
-          set (${PKG}_FOUND FALSE)
+          set (${PKG}_FOUND   FALSE)
+          set (${PKG_U}_FOUND FALSE)
           # make copy of find_* search path variables
           foreach (_BFP_VAR IN ITEMS CMAKE_PREFIX_PATH CMAKE_PROGRAM_PATH)
             set (_BFP_${_BFP_VAR} "${${_BFP_VAR}}")
           endforeach ()
-          # insert <PKG>_DIR into find_* search path variables
-          if (IS_DIRECTORY "${${PKG}_DIR}")
+          # insert DEPENDS_<PKG>_DIR into find_* search paths
+          if (IS_DIRECTORY "${DEPENDS_${PKG}_DIR}")
             # add directory to CMAKE_PROGRAM_PATH when the name
             # of the last subdirectory is "bin", "Bin", "sbin",
             # or "texbin" (i.e., MacTeX's "/Library/TeX/texbin" path)
-            if (${PKG}_DIR MATCHES "/([bB]in|sbin|texbin)/+$")
-              list (INSERT CMAKE_PROGRAM_PATH 0 "${${PKG}_DIR}")
+            if (DEPENDS_${PKG}_DIR MATCHES "/([bB]in|sbin|texbin)/+$")
+              list (INSERT CMAKE_PROGRAM_PATH 0 "${DEPENDS_${PKG}_DIR}")
             # add directory to CMAKE_PREFIX_PATH otherwise as users
             # tend to specify the installation prefix instead of the
             # actual directory containing the package configuration file
             else ()
-              list (INSERT CMAKE_PREFIX_PATH 0 "${${PKG}_DIR}")
+              list (INSERT CMAKE_PREFIX_PATH 0 "${DEPENDS_${PKG}_DIR}")
             endif ()
           endif ()
           # now look for the package using find_package
@@ -665,9 +666,6 @@
             foreach (_BFP_VERSION ${_BFP_VERSIONS})
               find_package (${PKG} ${_BFP_VERSION} ${_BFP_FIND_PACKAGE_ARGS} QUIET)
               if (${PKG}_FOUND)
-                if (NOT _BFP_ARGN_QUIET)
-                  find_package (${PKG} ${_BFP_VERSION} ${_BFP_FIND_PACKAGE_ARGS})
-                endif ()
                 break ()
               endif ()
             endforeach ()
@@ -678,7 +676,7 @@
             if (_BFP_ARGN_NO_MODULE OR _BFP_ARGN_CONFIG)
               list (APPEND _BFP_FIND_PACKAGE_ARGS CONFIG)
             endif ()
-            find_package (${PKG} ${_BFP_VERSIONS} ${_BFP_FIND_PACKAGE_ARGS})
+            find_package (${PKG} ${_BFP_VERSIONS} ${_BFP_FIND_PACKAGE_ARGS} QUIET)
           endif ()
           unset (_BFP_FIND_PACKAGE_ARGS)
           # restore find_* search path variables
@@ -699,35 +697,31 @@
           endif ()
         endif () # NOT _BFP_NO_FIND_PACKAGE
         # set common <Pkg>_VERSION_STRING variable if possible and not set
-        if (NOT DEFINED ${PKG}_VERSION_STRING)
-          if ("^${PKG}$" STREQUAL "^PythonInterp$") # FindPythonInterp
-            set (${PKG}_VERSION_STRING ${PYTHON_VERSION_STRING})
-          elseif ("^${PKG}$" STREQUAL "^JythonInterp$") # FindJythonInterp
-            set (${PKG}_VERSION_STRING ${JYTHON_VERSION_STRING})
-          elseif (DEFINED ${PKG}_VERSION_MAJOR)
-            set (${PKG}_VERSION_STRING ${${PKG}_VERSION_MAJOR})
-            if (DEFINED ${PKG}_VERSION_MINOR)
-              set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_VERSION_MINOR})
-              if (DEFINED ${PKG}_VERSION_PATCH)
-                set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_VERSION_PATCH})
-              elseif (DEFINED ${PKG}_SUBMINOR_VERSION) # e.g., FindBoost
-                set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_SUBMINOR_VERSION})
+        if (NOT DEFINED ${_BFP_NS}_VERSION_STRING)
+          if (DEFINED ${_BFP_NS}_VERSION_MAJOR)
+            set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_VERSION_MAJOR})
+            if (DEFINED ${_BFP_NS}_VERSION_MINOR)
+              set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_VERSION_STRING}.${${_BFP_NS}_VERSION_MINOR})
+              if (DEFINED ${_BFP_NS}_VERSION_PATCH)
+                set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_VERSION_STRING}.${${_BFP_NS}_VERSION_PATCH})
+              elseif (DEFINED ${_BFP_NS}_SUBMINOR_VERSION) # e.g., FindBoost
+                set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_VERSION_STRING}.${${_BFP_NS}_SUBMINOR_VERSION})
               endif ()
             endif ()
-          elseif (DEFINED ${PKG}_MAJOR_VERSION)
-            set (${PKG}_VERSION_STRING ${${PKG}_MAJOR_VERSION})
-            if (DEFINED ${PKG}_MINOR_VERSION)
-              set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_MINOR_VERSION})
+          elseif (DEFINED ${_BFP_NS}_MAJOR_VERSION)
+            set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_MAJOR_VERSION})
+            if (DEFINED ${_BFP_NS}_MINOR_VERSION)
+              set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_VERSION_STRING}.${${_BFP_NS}_MINOR_VERSION})
               if (DEFINED ${PKG}_PATCH_VERSION)
-                set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_PATCH_VERSION})
-              elseif (DEFINED ${PKG}_SUBMINOR_VERSION) # e.g., FindBoost
-                set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_SUBMINOR_VERSION})
+                set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_VERSION_STRING}.${${_BFP_NS}_PATCH_VERSION})
+              elseif (DEFINED ${_BFP_NS}_SUBMINOR_VERSION) # e.g., FindBoost
+                set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_VERSION_STRING}.${${_BFP_NS}_SUBMINOR_VERSION})
               endif ()
             endif ()
-          elseif (DEFINED ${PKG}_VERSION)
-            set (${PKG}_VERSION_STRING ${${PKG}_VERSION})
+          elseif (DEFINED ${_BFP_NS}_VERSION)
+            set (${_BFP_NS}_VERSION_STRING ${${_BFP_NS}_VERSION})
           else ()
-            set (${PKG}_VERSION_STRING "${_BFP_VERSION_STRING}")
+            set (${_BFP_NS}_VERSION_STRING "${_BFP_VERSION_STRING}")
           endif ()
         endif ()
         unset (_BFP_VERSION_STRING)
@@ -736,34 +730,24 @@
           if (${PKG}_DIR AND IS_ABSOLUTE "${${PKG}_DIR}" AND
               (EXISTS "${${PKG}_DIR}/${PKG}Config.cmake" OR
                EXISTS "${${PKG}_DIR}/${PKG_L}-config.cmake"))
-            list (GET ${PKG}_DIR 0 _BFP_PREFIX)
-            _basis_config_to_prefix_dir(${PKG} "${_BFP_PREFIX}" _BFP_PREFIX)
+            _basis_config_to_prefix_dir(${PKG} "${${PKG}_DIR}" _BFP_PREFIX)
             basis_update_value (DEPENDS_${PKG}_DIR "${_BFP_PREFIX}")
           elseif (NOT DEPENDS_${PKG}_DIR)
-            if (${PKG}_INCLUDE_DIR)
-              list (GET ${PKG}_INCLUDE_DIR 0 _BFP_PREFIX)
+            if (${_BFP_NS}_INCLUDE_DIR)
+              list (GET ${_BFP_NS}_INCLUDE_DIR 0 _BFP_PREFIX)
               string (REGEX REPLACE "^(.*)/[iI]ncludes?(/.*)?$" "\\1" _BFP_PREFIX "${_BFP_PREFIX}")
-            elseif (${PKG}_LIBRARY_DIR)
-              list (GET ${PKG}_LIBRARY_DIR 0 _BFP_PREFIX)
+            elseif (${_BFP_NS}_LIBRARY_DIR)
+              list (GET ${_BFP_NS}_LIBRARY_DIR 0 _BFP_PREFIX)
               string (REGEX REPLACE "^(.*)/[lL]ib(s|exec|64)?(/.*)?$" "\\1" _BFP_PREFIX "${_BFP_PREFIX}")
             else ()
               set (_BFP_VARS
-                ${PKG}_EXECUTABLE   # e.g., FindBash
-                ${PKG}_COMPILER     # e.g., FindLATEX
-                ${PKG}_CONVERTER    # e.g., FindLATEX
+                ${_BFP_NS}_EXECUTABLE # e.g., FindBASH
+                ${_BFP_NS}_COMPILER   # e.g., FindLATEX
+                ${_BFP_NS}_CONVERTER  # e.g., FindLATEX
               )
-              list (REMOVE_DUPLICATES _BFP_VARS)
               foreach (_BFP_VAR IN LISTS _BFP_VARS)
                 if (${_BFP_VAR})
-                  if (${_BFP_VAR} MATCHES "^(.*)/[bB]in(/+.*)?$")
-                    if (CMAKE_MATCH_1)
-                      set (_BFP_PREFIX "${CMAKE_MATCH_1}")
-                    else ()
-                      set (_BFP_PREFIX "/")
-                    endif ()
-                  else ()
-                    get_filename_component (_BFP_PREFIX "${${_BFP_VAR}}" PATH)
-                  endif ()
+                  get_filename_component (_BFP_PREFIX "${${_BFP_VAR}}" PATH)
                   break ()
                 endif ()
               endforeach ()
@@ -793,9 +777,9 @@
           if (${PKG}_FOUND)
             set (_BFP_STATUS "${_BFP_STATUS} - found")
             if ("^${PKG}$" STREQUAL "^Boost$")
-              set (_BFP_STATUS "${_BFP_STATUS} v${${PKG}_MAJOR_VERSION}.${${PKG}_MINOR_VERSION}.${${PKG}_SUBMINOR_VERSION}")
-            elseif (DEFINED ${PKG}_VERSION_STRING AND NOT ${PKG}_VERSION_STRING MATCHES "^(0(\\.0)?(\\.0)?)?$")
-              set (_BFP_STATUS "${_BFP_STATUS} v${${PKG}_VERSION_STRING}")
+              set (_BFP_STATUS "${_BFP_STATUS} v${${_BFP_NS}_MAJOR_VERSION}.${${_BFP_NS}_MINOR_VERSION}.${${_BFP_NS}_SUBMINOR_VERSION}")
+            elseif (DEFINED ${_BFP_NS}_VERSION_STRING AND NOT ${_BFP_NS}_VERSION_STRING MATCHES "^(0(\\.0)?(\\.0)?)?$")
+              set (_BFP_STATUS "${_BFP_STATUS} v${${_BFP_NS}_VERSION_STRING}")
             endif ()
             if (BASIS_VERBOSE AND DEPENDS_${PKG}_DIR)
               set (_BFP_STATUS "${_BFP_STATUS} at ${DEPENDS_${PKG}_DIR}")
@@ -871,6 +855,7 @@
   foreach (_BFP_VAR IN LISTS _BFP_OPTIONS _BFP_MULTI_ARGS)
     unset (_BFP_ARGN_${_BFP_VAR})
   endforeach ()
+  unset (_BFP_COMPONENTS)
   unset (_BFP_ARGN_UNPARSED_ARGUMENTS)
   unset (_BFP_OPTIONS)
   unset (_BFP_MULTI_ARGS)
@@ -891,6 +876,7 @@
   unset (_BFP_FIND_COMPONENTS)
   unset (_BFP_FIND_OPTIONAL_COMPONENTS)
   unset (_BFP_NO_FIND_PACKAGE)
+  unset (_BFP_NS)
   unset (PKG)
   unset (PKG_L)
   unset (PKG_U)


COMP: Update ITK version to fix windows compilation errors (extra itk namespaces)

--- CMake/FindExternalTools.cmake
+++ CMake/FindExternalTools.cmake
@@ -181,7 +181,7 @@
     endif(SlicerExecutionModel_FOUND)

   else(ITK_FOUND)
-    message(WARNING "ITK not found. ITKv4.3.0 will be downloaded and recompiled.")
+    message(WARNING "ITK not found. ITKv4.4.0 will be downloaded and recompiled.")
     set(RecompileITK ON) # Automatically recompile SlicerExecutionModel
   endif(ITK_FOUND)
 endif() # COMPILE_EXTERNAL_dtiprocessTK OR COMPILE_EXTERNAL_BRAINS OR COMPILE_EXTERNAL_ANTS OR COMPILE_EXTERNAL_ResampleDTI
@@ -192,7 +192,7 @@
   # Download and compile ITKv4
   ExternalProject_Add(I4 # BRAINSStandAlone/SuperBuild/External_ITKv4.cmake # !! All args needed as they are # Name shorten from ITKv4 because Windows ITKv4 path limited to 50 chars
     GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git"
-    GIT_TAG 555049f830d1c09f8d4d95904f429290467d39ab #2012-12-16 ITKv4.3.0
+    GIT_TAG 3c03e162c7e287b81115e2175898482998b50a34 # master 01-31-13 4.4.0 : fixed extra itk namespaces # 555049f830d1c09f8d4d95904f429290467d39ab #2012-12-16 ITKv4.3.0
     SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/I4 # Path shorten from ITKv4 because Windows SOURCE_DIR path limited to 50 chars
     BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/I4-b # Path shorten from ITKv4 because Windows SOURCE_DIR path limited to 50 chars
     CMAKE_GENERATOR ${gen}
@@ -214,7 +214,7 @@
 #      -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_CURRENT_BINARY_DIR}/ITKv4-build/lib # Needed for BRAINSTools to compile
 #      -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_CURRENT_BINARY_DIR}/ITKv4-build/bin # Needed for BRAINSTools to compile
     )
-  set(ITK_DIR ${CMAKE_CURRENT_BINARY_DIR}/I4-i/lib/cmake/ITK-4.3) # Use the downloaded ITK for all tools # Path shorten from ITKv4 because Windows SOURCE_DIR path limited to 50 chars
+  set(ITK_DIR ${CMAKE_CURRENT_BINARY_DIR}/I4-i/lib/cmake/ITK-4.4) # Use the downloaded ITK for all tools # Path shorten from ITKv4 because Windows SOURCE_DIR path limited to 50 chars
   set(ITK_DEPEND I4)
   set(RecompileSEM ON) # If recompile ITK, recompile SlicerExecutionModel
   set(RecompileBatchMake ON) # If recompile ITK, recompile BatchMake
@@ -324,7 +324,7 @@
   SVN_REPOSITORY "http://www.nitrc.org/svn/dtiprocess/branches/Slicer4Extension" # /dtiprocess"
   SVN_USERNAME slicerbot
   SVN_PASSWORD slicer
-  SVN_REVISION -r 144 # 01/30/2013 version modified by Adrien for windows compilation # 137 # 01/16/2013 # 113 # 12/20/2012 updated for ITKv4.3.0
+  SVN_REVISION -r 144 # 01/30/2013 version modified by Adrien for windows compilation # 137 # 01/16/2013 # 113 # 12/20/2012 updated for ITKv4.4.0
   )
 set( CMAKE_ExtraARGS
   -DBUILD_TESTING:BOOL=OFF


COMP: Update PythonQt to fix windows build error

This commit fixes a regression introduced
in 0752686c (ENH: Add ctkAbstractPythonManager::redirectStdOutCallbackEnabled property)

List of PythonQt changes:

* for patched-8 branch

$ git shortlog 946253d..fae2301
Jean-Christophe Fillion-Robin (1):
      Fix windows build error renaming stdout ivar

* for patched-5 branch:

$ git shortlog 5d46804..90c08fb --no-merges
Jean-Christophe Fillion-Robin (1):
      Fix windows build error renaming stdout ivar

--- CMakeExternals/PythonQt.cmake
+++ CMakeExternals/PythonQt.cmake
@@ -78,9 +78,9 @@
   endif()

   if (CTK_QT_VERSION VERSION_GREATER "4")
-    set(revision_tag 946253d4584a4cc5238335d9a4bedeaed1a55d27) # patched-8
+    set(revision_tag fae2301264529b4c8c85ee6e285f9605176471f0) # patched-8
   else()
-    set(revision_tag 5d46804e39c72c224cee8e258c30fc618171f57d) # patched-5
+    set(revision_tag 90c08fb0d523622d2de9e7a91f4ef116a66a8801) # patched-5
   endif()

   if(${proj}_REVISION_TAG)


Fix for MacPorts.

Fix for MacPorts.

--- CMakeModules/FindFFMPEG.cmake
+++ CMakeModules/FindFFMPEG.cmake
@@ -26,33 +26,28 @@
 FIND_LIBRARY(
   AVCODEC_LIBRARY
   NAMES avcodec
-  PATH /usr/lib /usr/local/lib
+  PATH /usr/lib /usr/local/lib /opt/local/lib
 )
 FIND_LIBRARY(
   AVFORMAT_LIBRARY
   NAMES avformat
-  PATH /usr/lib /usr/local/lib
+  PATH /usr/lib /usr/local/lib /opt/local/lib
 )
 FIND_LIBRARY(
   AVUTIL_LIBRARY
   NAMES avutil
-  PATH /usr/lib /usr/local/lib
+  PATH /usr/lib /usr/local/lib /opt/local/lib
 )
 FIND_LIBRARY(
   SWSCALE_LIBRARY
   NAMES swscale
-  PATH /usr/lib /usr/local/lib
-)
-FIND_LIBRARY(
-  AVUTIL_LIBRARY
-  NAMES avutil
-  PATH /usr/lib /usr/local/lib
+  PATH /usr/lib /usr/local/lib /opt/local/lib
 )

 INCLUDE(CheckIncludeFiles)
 CHECK_INCLUDE_FILES("${AVUTIL_INCLUDE_DIR}/libavutil/pixdesc.h" AVUTIL_HAVE_PIXDESC)

-IF(AVCODEC_INCLUDE_DIR AND AVFORMAT_INCLUDE_DIR AND AVUTIL_INCLUDE_DIR AND SWSCALE_INCLUDE_DIR AND AVCODEC_LIBRARY AND AVFORMAT_LIBRARY AND AVUTIL_LIBRARY AND SWSCALE_LIBRARY AND AVUTIL_LIBRARY AND AVUTIL_HAVE_PIXDESC)
+IF(AVCODEC_INCLUDE_DIR AND AVFORMAT_INCLUDE_DIR AND AVUTIL_INCLUDE_DIR AND SWSCALE_INCLUDE_DIR AND AVCODEC_LIBRARY AND AVFORMAT_LIBRARY AND AVUTIL_LIBRARY AND SWSCALE_LIBRARY AND AVUTIL_HAVE_PIXDESC)
    SET(FFMPEG_FOUND TRUE)
    SET(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY})
    SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR})


fix FindLibOVR

fix FindLibOVR

--- CMakeModules/FindLibOVR.cmake
+++ CMakeModules/FindLibOVR.cmake
@@ -1,13 +1,7 @@
 include(FindPackageHandleStandardArgs)

-find_library(LibOVR_LIBRARIES ovr)
-set(LibOVR_LIBRARIES ${LibOVR_LIBOVRA})
-
-find_path(LibOVR_INCLUDE OVR.h)
-set(LibOVR_INCLUDE_DIRS ${LibOVR_INCLUDE})
-
-find_path(LibOVR_SRC OVR_CAPI.h)
-set(LibOVR_INCLUDE_DIRS ${LibOVR_INCLUDE_DIRS} ${LibOVR_SRC})
+find_library(LibOVR_LIBRARIES libovr.a)
+find_path(LibOVR_INCLUDE_DIRS OVR.h OVR_CAPI.h)

 if(LibOVR_SOURCE)
 	find_package_handle_standard_args(LibOVR DEFAULT_MSG


Added missing CUDA architecture compilation options.

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -26,7 +26,7 @@
 macro(APPEND_FLAGS FLAG_VAR)
     foreach (flag ${ARGN})
         set(${FLAG_VAR} "${${FLAG_VAR}} ${flag}")
-    endforeach()
+    endforeach()
 endmacro()

 # Set general compiler flags.
@@ -46,33 +46,33 @@
         # Treat external code as system headers.
         # This avoids a number of warning supression flags.
         append_flags(CMAKE_C_FLAGS -isystem ${CUDA_INCLUDE_DIRS})
-        append_flags(CMAKE_CXX_FLAGS
+        append_flags(CMAKE_CXX_FLAGS
             -isystem ${CUDA_INCLUDE_DIRS}
             -isystem ${GTEST_INCLUDE_DIR}
             -isystem ${GTEST_INCLUDE_DIR}/internal
             -isystem ${CASACORE_INCLUDE_DIR}/casacore
         )
-        append_flags(CMAKE_C_FLAGS
-            -fvisibility=hidden
+        append_flags(CMAKE_C_FLAGS
+            -fvisibility=hidden
             -fdiagnostics-show-option)

         # Note: long-long is required for cfitsio
-        append_flags(CMAKE_C_FLAGS_DEBUG
+        append_flags(CMAKE_C_FLAGS_DEBUG
             -Wextra -pedantic -Wcast-qual -Wcast-align
             -Wmissing-prototypes -Wno-long-long
             -Wno-variadic-macros -Wno-unused-function
          )
          # Additional test flags
-#        append_flags(CMAKE_C_FLAGS_DEBUG
+#        append_flags(CMAKE_C_FLAGS_DEBUG
 #            -Wbad-function-cast -Wstack-protector -Wpacked
-#            -Wredundant-decls -Wshadow -Wwrite-strings
+#            -Wredundant-decls -Wshadow -Wwrite-strings
 #            -Waggregate-return -Wstrict-prototypes
 #            -Wstrict-aliasing -Wdeclaration-after-statement
 #        )
         append_flags(CMAKE_C_FLAGS_RELWITHDEBINFO -Wno-unused-function)
         append_flags(CMAKE_CXX_FLAGS
             -fvisibility=hidden -fvisibility-inlines-hidden
-            -fdiagnostics-show-option
+            -fdiagnostics-show-option
         )
         append_flags(CMAKE_CXX_FLAGS_DEBUG
             -Wextra -pedantic -Wcast-qual -Wcast-align -Wno-long-long
@@ -167,16 +167,21 @@

     message("===============================================================================")
     if (NOT DEFINED CUDA_ARCH OR CUDA_ARCH MATCHES ALL|[Aa]ll)
-        message("-- INFO: Building CUDA device code for Fermi, Kepler and Maxwell architectures")
+        message("-- INFO: Building CUDA device code for Fermi, Kepler,")
+        message("-- INFO: Maxwell and Pascal architectures")
         message("-- INFO: The target CUDA architecture can be specified by using the option:")
         message("-- INFO:   -DCUDA_ARCH=<arch>")
         message("-- INFO: where <arch> is one of:")
-        message("-- INFO:   1.3, 2.0, 2.1, 3.0, 3.5, 5.0 or ALL.")
+        message("-- INFO:   1.3, 2.0, 2.1, 3.0, 3.5, 3.7, 5.0, 5.2, 6.0, 6.1 or ALL.")
         list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
         list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_21)
         list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
         list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_37,code=sm_37)
         list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_50,code=sm_50)
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_52,code=sm_52)
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_60,code=sm_60)
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_61,code=sm_61)
     elseif (CUDA_ARCH MATCHES 1.3)
         message("-- INFO: Building CUDA device code for architecture 1.3")
         list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_13,code=sm_13)
@@ -192,9 +197,24 @@
     elseif (CUDA_ARCH MATCHES 3.5)
         message("-- INFO: Building CUDA device code for architecture 3.5")
         list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
+    elseif (CUDA_ARCH MATCHES 3.7)
+        message("-- INFO: Building CUDA device code for architecture 3.7")
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_37,code=sm_37)
     elseif (CUDA_ARCH MATCHES 5.0)
         message("-- INFO: Building CUDA device code for architecture 5.0")
         list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_50,code=sm_50)
+    elseif (CUDA_ARCH MATCHES 5.2)
+        message("-- INFO: Building CUDA device code for architecture 5.2")
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_52,code=sm_52)
+    elseif (CUDA_ARCH MATCHES 6.0)
+        message("-- INFO: Building CUDA device code for architecture 6.0")
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_60,code=sm_60)
+    elseif (CUDA_ARCH MATCHES 6.1)
+        message("-- INFO: Building CUDA device code for architecture 6.1")
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_61,code=sm_61)
+    elseif (CUDA_ARCH MATCHES 6.2)
+        message("-- INFO: Building CUDA device code for architecture 6.2")
+        list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_62,code=sm_62)
     else()
         message(FATAL_ERROR "-- CUDA_ARCH ${CUDA_ARCH} not recognised!")
     endif()


Set CMAKE_INSTALL_RPATH for systems that require it.

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -112,15 +112,21 @@
     endif()
 endif ()

-# RPATH settings for macOS
-# See https://cmake.org/Wiki/CMake_RPATH_handling
+# RPATH settings.
+# See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
 # ------------------------------------------------------------------------------
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 if (APPLE)
     set(CMAKE_INSTALL_NAME_DIR "@rpath")
     list(APPEND CMAKE_INSTALL_RPATH
         "@loader_path/../${OSKAR_LIB_INSTALL_DIR}/")
-endif (APPLE)
+elseif (NOT WIN32)
+    list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+            "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
+    if ("${isSystemDir}" STREQUAL "-1")
+       list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+    endif()
+endif()

 # Set CUDA releated compiler flags.
 # --compiler-options or -Xcompiler: specify options directly to the compiler


Remove ExternalProject dependency. It is not necessary.

--- CPM.cmake
+++ CPM.cmake
@@ -270,7 +270,6 @@
 endif()

 # Include dependencies
-include(ExternalProject)
 find_package(Git)
 if(NOT GIT_FOUND)
   message(FATAL_ERROR "CPM requires Git.")


Display output and errors from CMake when running in "server mode"

conan_cmake_install does not report output or errors
if executed by CMake in "server" mode (e.g. on behalf of another IDE
like Visual Studio or QtCreator).

Instead, the user recieves the following generic error:

CMake Error at C:/<path to cmake-conan>/conan.cmake:331 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  C:/<path to cmake-conan>/conan.cmake:409 (conan_cmake_install)
  CMakeLists.txt:90 (conan_cmake_run)

So, capture the output from both standard output and standard error
and report it back to the user.

Worth noting, when calling CMake from a command line that owns stdout
and stderr, the output will will be collected and reported all at once,
i.e. it will no longer be streamed, which is a minor change in behavior.

However, this means conan_cmake_install behaves the same regardless
of which mode ("server" or "non-server") CMake runs in.

--- conan.cmake
+++ conan.cmake
@@ -329,8 +329,12 @@

     execute_process(COMMAND ${conan_command} ${conan_args}
                      RESULT_VARIABLE return_code
+                     OUTPUT_VARIABLE conan_output
+                     ERROR_VARIABLE conan_output
                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

+    message(STATUS "${conan_output}")
+
     if(NOT "${return_code}" STREQUAL "0")
       message(FATAL_ERROR "Conan install failed='${return_code}'")
     endif()


Use of liboctD instead of MPQ.

Use of liboctD instead of MPQ.

--- cmake/FindApron.cmake
+++ cmake/FindApron.cmake
@@ -1,27 +1,35 @@
 #Find Apron library
-set (APRON_ROOT "" CACHE PATH "Root of Apron install.")
+if (NOT APRON_FOUND)

-find_package (Gmp QUIET)
-find_package (Mpfr QUIET)
+   set (APRON_ROOT "" CACHE PATH "Root of Apron install.")

-find_path(APRON_INCLUDE_DIR NAMES ap_abstract0.h PATHS ${APRON_ROOT}/include)
+   find_package (Gmp QUIET)
+   find_package (Mpfr QUIET)

-find_library(Apron_Polka_Lib NAMES polkaMPQ PATHS ${APRON_ROOT}/lib)
-find_library(Apron_Oct_Lib NAMES octMPQ PATHS ${APRON_ROOT}/lib)
-find_library(Apron_Opt_Oct_Lib NAMES optoct PATHS ${APRON_ROOT}/lib)
-find_library(Apron_Apron_Lib NAMES apron PATHS ${APRON_ROOT}/lib)
-find_library(Apron_Box_Lib NAMES boxMPQ PATHS ${APRON_ROOT}/lib)
-find_library(Apron_Itv_Lib NAMES itvMPQ PATHS ${APRON_ROOT}/lib)
+   find_path(APRON_INCLUDE_DIR NAMES ap_abstract0.h PATHS ${APRON_ROOT}/include)

-set(APRON_LIBRARY ${Apron_Polka_Lib} ${Apron_Oct_Lib} ${Apron_Opt_Oct_Lib}
-  ${Apron_Apron_Lib} ${Apron_Box_Lib} ${Apron_Itv_Lib} )
+   find_library(Apron_Polka_Lib NAMES polkaMPQ PATHS ${APRON_ROOT}/lib)
+   ## octD is faster than octMPQ
+   find_library(Apron_Oct_Lib NAMES octD PATHS ${APRON_ROOT}/lib)
+   # find_library(Apron_Oct_Lib NAMES octMPQ PATHS ${APRON_ROOT}/lib)
+   find_library(Apron_Opt_Oct_Lib NAMES optoct PATHS ${APRON_ROOT}/lib)
+   find_library(Apron_Opt_Oct_utils_Lib NAMES linkedlistapi PATHS ${APRON_ROOT}/lib)
+   find_library(Apron_Apron_Lib NAMES apron PATHS ${APRON_ROOT}/lib)
+   find_library(Apron_Box_Lib NAMES boxMPQ PATHS ${APRON_ROOT}/lib)
+   find_library(Apron_Itv_Lib NAMES itvMPQ PATHS ${APRON_ROOT}/lib)
+
+   set(APRON_LIBRARY ${Apron_Polka_Lib} ${Apron_Oct_Lib}
+     ${Apron_Opt_Oct_Lib} ${Apron_Opt_Oct_utils_Lib}
+     ${Apron_Apron_Lib} ${Apron_Box_Lib} ${Apron_Itv_Lib} )
+
+   include (FindPackageHandleStandardArgs)
+   find_package_handle_standard_args (Apron
+     REQUIRED_VARS APRON_INCLUDE_DIR APRON_LIBRARY GMP_FOUND MPFR_FOUND)
+
+   set (APRON_INCLUDE_DIR ${APRON_INCLUDE_DIR} ${MPFR_INC_DIR})
+   set (APRON_LIBRARY ${APRON_LIBRARY} ${MPFR_LIB})
+
+   mark_as_advanced(APRON_LIBRARY APRON_INCLUDE_DIR
+     Apron_Apron_Lib Apron_Box_Lib Apron_Itv_Lib Apron_Oct_Lib Apron_Polka_Lib )

-include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Apron
-  REQUIRED_VARS APRON_INCLUDE_DIR APRON_LIBRARY GMP_FOUND MPFR_FOUND)
-
-set (APRON_INCLUDE_DIR ${APRON_INCLUDE_DIR} ${MPFR_INC_DIR})
-set (APRON_LIBRARY ${APRON_LIBRARY} ${MPFR_LIB})
-
-mark_as_advanced(APRON_LIBRARY APRON_INCLUDE_DIR
-  Apron_Apron_Lib Apron_Box_Lib Apron_Itv_Lib Apron_Oct_Lib Apron_Polka_Lib )+endif ()


cmake: Add c files to get_all_cpp_files functions

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -23,7 +23,7 @@
 # helper function to find all c/cpp files
 # has to be called from project root  to find all files
 function(get_all_cpp_files file_list IGNORE_PREFIX_LIST)
-  file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.h)
+  file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.c *.h)
   foreach (SOURCE_FILE ${ALL_SOURCE_FILES})
     set(PREFIX_FOUND -1)
     foreach(PREFIX ${IGNORE_PREFIX_LIST})


Fix typo in python cmake

Fix typo in python cmake

--- python.cmake
+++ python.cmake
@@ -57,7 +57,7 @@
 set (PYTHON_INCLUDE_PATH ${PYTHON_PREFIX}/include/python2.7)
 set (PYTHON_LIBRARY_FILE ${PYTHON_PREFIX}/lib/libpython2.7.${BUILDEM_PLATFORM_DYLIB_EXTENSION})
 set (PYTHON_EXE ${PYTHON_PREFIX}/bin/python)
-set (BUILDEM_PYTHONPATH  ${PYTHON_PREFIX}/lib/python2.7:${PYTHON_PREFIX}/lib/python2.7/site-packages:${PYTHON_PREFIX}/lib))
+set (BUILDEM_PYTHONPATH  ${PYTHON_PREFIX}/lib/python2.7:${PYTHON_PREFIX}/lib/python2.7/site-packages:${PYTHON_PREFIX}/lib)

 set_target_properties(${python_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)


CMake: Dependencies - switch to stable zzip release

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -128,19 +128,19 @@

     message(STATUS "Building ZZIPlib")
     file(DOWNLOAD
-        https://github.com/gdraheim/zziplib/archive/develop.zip
-        ${PROJECT_BINARY_DIR}/zziplib-develop.tar.gz)
+        https://github.com/gdraheim/zziplib/archive/v0.13.71.tar.gz
+        ${PROJECT_BINARY_DIR}/zziplib-0.13.71.tar.gz)
     execute_process(COMMAND ${CMAKE_COMMAND}
-        -E tar xf zziplib-develop.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
+        -E tar xf zziplib-0.13.71.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
     execute_process(COMMAND ${BUILD_COMMAND_COMMON}
         -DZLIB_ROOT=${OGREDEPS_PATH}
         -DZZIPMMAPPED=OFF -DZZIPCOMPAT=OFF -DZZIPLIBTOOL=OFF -DZZIPFSEEKO=OFF -DZZIPWRAP=OFF -DZZIPSDL=OFF -DZZIPBINS=OFF -DZZIPTEST=OFF -DZZIPDOCS=OFF -DBASH=sh
         -DBUILD_STATIC_LIBS=TRUE
         -DBUILD_SHARED_LIBS=${OGREDEPS_SHARED}
-        ${PROJECT_BINARY_DIR}/zziplib-develop
-        WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/zziplib-develop)
+        ${PROJECT_BINARY_DIR}/zziplib-0.13.71
+        WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/zziplib-0.13.71)
     execute_process(COMMAND ${CMAKE_COMMAND}
-        --build ${PROJECT_BINARY_DIR}/zziplib-develop ${BUILD_COMMAND_OPTS})
+        --build ${PROJECT_BINARY_DIR}/zziplib-0.13.71 ${BUILD_COMMAND_OPTS})

     message(STATUS "Building pugixml")
     file(DOWNLOAD


BUG: fixing mantis bug 861

BUG: fixing mantis bug 861

--- CMake/ImportMapnik.cmake
+++ CMake/ImportMapnik.cmake
@@ -65,21 +65,25 @@
         endif()

-        # Validating the config
-        try_compile(OTB_MAPNIK_SUPPORTS_API20
-          ${CMAKE_CURRENT_BINARY_DIR}/CMake
-          ${CMAKE_CURRENT_SOURCE_DIR}/CMake/otbTestCompileMapnik2.cxx
-          CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${MAPNIK_INCLUDE_DIR};${ICUUC_INCLUDE_DIR};${LTDL_INCLUDE_DIR};${FREETYPE2_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${MAPNIK_LIBRARY};${ICUUC_LIBRARY}"
-          OUTPUT_VARIABLE OUTPUT)
-        if(OTB_MAPNIK_SUPPORTS_API20)
-          message(STATUS "  Testing if Mapnik2     -- yes")
-        else()
-          message(STATUS "  Testing if Mapnik2     -- no")
-          #message(STATUS "Does not support mapnik2 interface: ${OUTPUT}")
-          message(STATUS "  Assuming mapnik 0.7")
+        file(READ "${MAPNIK_INCLUDE_DIR}/mapnik/version.hpp" _mapnik_version_hpp_CONTENTS)
+        STRING(REGEX REPLACE ".*#define MAPNIK_MAJOR_VERSION ([0-9]+).*" "\\1" MAPNIK_MAJOR_VERSION  ${_mapnik_version_hpp_CONTENTS})
+        STRING(REGEX REPLACE ".*#define MAPNIK_MINOR_VERSION ([0-9]+).*" "\\1" MAPNIK_MINOR_VERSION  ${_mapnik_version_hpp_CONTENTS})
+        STRING(REGEX REPLACE ".*#define MAPNIK_PATCH_VERSION ([0-9]+).*" "\\1" MAPNIK_PATCH_VERSION  ${_mapnik_version_hpp_CONTENTS})
+        SET(MAPNIK_VERSION ${MAPNIK_MAJOR_VERSION}.${MAPNIK_MINOR_VERSION}.${MAPNIK_PATCH_VERSION})
+        if(${MAPNIK_MAJOR_VERSION} LESS "2")
+          message(STATUS "Does not support mapnik2 interface:  ${MAPNIK_VERSION}")
+          add_definitions(-DOTB_MAPNIK_COMPATIBILITY_API07)
           # This should be dropped when we don't want to support this any more
           # Estimated date: 02/2013.
-          add_definitions(-DOTB_MAPNIK_COMPATIBILITY_API07)
+        else()
+          find_path(AGG2_INCLUDE_DIR agg_pixfmt_rgba.h PATHS /usr/include/)
+          mark_as_advanced(AGG2_INCLUDE_DIR)
+          if(NOT AGG2_INCLUDE_DIR)
+            message(FATAL_ERROR
+              "Cannot find AGG2 library, needed by MAPNIK. Please set AGG2_INCLUDE_DIR or set OTB_USE_MAPNIK OFF.")
+          endif()
+          include_directories(${AGG2_INCLUDE_DIR})
+          SET(OTB_MAPNIK_SUPPORTS_API20 TRUE)
         endif()

         # Add compiler option
@@ -88,6 +92,7 @@
         include_directories(${MAPNIK_INCLUDE_DIR} ${ICUUC_INCLUDE_DIR} ${LTDL_INCLUDE_DIR} ${FREETYPE2_INCLUDE_DIR})

         message(STATUS "  Enabling Mapnik support")
+        message(STATUS "  Mapnik version: ${MAPNIK_VERSION}")
         message(STATUS "  Mapnik includes : ${MAPNIK_INCLUDE_DIR}")
         message(STATUS "  Mapnik library  : ${MAPNIK_LIBRARY}")
         message(STATUS "  ICU includes : ${ICUUC_INCLUDE_DIR}")


PKG: mxe use all lower case for system dll exceptions

--- CMake/MinGWPackage.cmake
+++ CMake/MinGWPackage.cmake
@@ -34,7 +34,7 @@
     install(FILES ${Monteverdi_BINARY_DIR}/i18n/${APP_TS_FILENAME}.qm
       DESTINATION ${PACKAGE_PREFIX_DIR}/${Monteverdi_INSTALL_DATA_DIR}/i18n)
   endforeach()
-
+
   #dependency resolution based on copydlldeps.sh from mxe by Timothy Gu
   if(PACKAGE_NEEDS_OTB_APPS)
     file(GLOB otbapps_list ${OTB_MODULES_DIR}/../../../otb/applications/otbapp_*dll) # /lib/otb
@@ -59,42 +59,36 @@

 set(SYSTEM_DLLS
   msvc.*dll
-  USER32.dll
-  GDI32.dll
-  SHELL32.DLL
-  KERNEL32.dll
-  ADVAPI32.dll
-  CRYPT32.dll
-  WS2_32.dll
+  user32.dll
+  gdi32.dll
+  shell32.dll
+  kernel32.dll
+  advapi32.dll
+  crypt32.dll
+  ws2_32.dll
   wldap32.dll
   ole32.dll
-  OPENGL32.DLL
-  GLU32.DLL
-  COMDLG32.DLL
-  IMM32.DLL
-  OLEAUT32.dll
-  COMCTL32.DLL
-  WINMM.DLL
-
-  SHELL32.dll
-  WLDAP32.dll
-  OPENGL32.dll
-  GLU32.dll
+  opengl32.dll
+  glu32.dll
   comdlg32.dll
-  IMM32.dll
-  WINMM.dll
-  Secur32.dll
-  LIBEAY32.dll
-  SHFOLDER.DLL
-  SSLEAY32.dll
-  WSOCK32.DLL
-  WINSPOOL.DRV)
+  imm32.dll
+  oleaut32.dll
+  comctl32.dll
+  winmm.dll
+  secur32.dll
+  libeay32.dll
+  shfolder.dll
+  ssleay32.dll
+  wsock32.dll
+  winspool.drv)

 ## http://www.cmake.org/Wiki/CMakeMacroListOperations
 macro(is_system_dll matched value)
   set(${matched})
+  string(TOLOWER ${value} value_)
   foreach (pattern ${SYSTEM_DLLS})
-    if(${value} MATCHES ${pattern})
+    string(TOLOWER ${pattern} pattern_)
+    if(${value_} MATCHES ${pattern_})
       set(${matched} TRUE)
     endif()
   endforeach()


cmake: fix manual version with git

cmake: fix manual version with git

--- CMakeModules/gitid.cmake
+++ CMakeModules/gitid.cmake
@@ -18,7 +18,7 @@
   endif()
   message("Current git revision is ${MANUAL_GIT_ID}")
   set(MANUAL_GIT_ID "gitid: ${MANUAL_GIT_ID}")
-  set(MANUAL_GIT_ID "(MANUAL_GIT_ID)")
+  set(MANUAL_GIT_ID "(${MANUAL_GIT_ID})")
 else()
   set (MANUAL_GIT_ID)
 endif()


Change GLEW_FOUND to a boolean instead of a string

--- src/unit_PARALLEL/cmake/FindGLEW.cmake
+++ src/unit_PARALLEL/cmake/FindGLEW.cmake
@@ -38,10 +38,10 @@
 		DOC "The GLEW library")
 ENDIF (WIN32)

-IF (GLEW_INCLUDE_DIR)
-	SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ELSE (GLEW_INCLUDE_DIR)
-	SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ENDIF (GLEW_INCLUDE_DIR)
+SET(GLEW_FOUND 0)
+IF(GLEW_LIBRARY AND GLEW_INCLUDE_DIR)
+  SET(GLEW_FOUND 1)
+  message(STATUS "GLEW found!")
+ENDIF()

 MARK_AS_ADVANCED( GLEW_FOUND )


build: Cleanup DefineCompilerFlags.

build: Cleanup DefineCompilerFlags.

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -4,57 +4,65 @@
 include(MacroCheckCCompilerFlagSSP)

 if (UNIX AND NOT WIN32)
-  if (${CMAKE_C_COMPILER_ID} MATCHES GNU)
-    # add -Wconversion ?
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute")
+    #
+    # Define GNUCC compiler flags
+    #
+    if (${CMAKE_C_COMPILER_ID} MATCHES GNU)
+        # add -Wconversion ?
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute")

-    # with -fPIC
-    check_c_compiler_flag("-fPIC" WITH_FPIC)
-    if (WITH_FPIC)
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
-    endif (WITH_FPIC)
+        # with -fPIC
+        check_c_compiler_flag("-fPIC" WITH_FPIC)
+        if (WITH_FPIC)
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+        endif (WITH_FPIC)

-    check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
-    if (WITH_STACK_PROTECTOR)
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
-    endif (WITH_STACK_PROTECTOR)
+        check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
+        if (WITH_STACK_PROTECTOR)
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
+        endif (WITH_STACK_PROTECTOR)

-    check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
-    if (WITH_FORTIFY_SOURCE)
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
-    endif (WITH_FORTIFY_SOURCE)
+        check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
+        if (WITH_FORTIFY_SOURCE)
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
+        endif (WITH_FORTIFY_SOURCE)
+    endif (${CMAKE_C_COMPILER_ID} MATCHES GNU)

-  endif (${CMAKE_C_COMPILER_ID} MATCHES GNU)
-
-  if (CMAKE_SIZEOF_VOID_P MATCHES "8")
-   # with large file support
-   execute_process(
-     COMMAND
-       getconf LFS64_CFLAGS
-     OUTPUT_VARIABLE
-       _lfs_CFLAGS
-     ERROR_QUIET
-     OUTPUT_STRIP_TRAILING_WHITESPACE
-   )
- else (CMAKE_SIZEOF_VOID_P MATCHES "8")
-   # with large file support
-   execute_process(
-     COMMAND
-       getconf LFS_CFLAGS
-     OUTPUT_VARIABLE
-       _lfs_CFLAGS
-     ERROR_QUIET
-     OUTPUT_STRIP_TRAILING_WHITESPACE
-   )
- endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
- if (_lfs_CFLAGS)
-   string(REGEX REPLACE "[\r\n]" " " "${_lfs_CFLAGS}" "${${_lfs_CFLAGS}}")
-   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_lfs_CFLAGS}")
- endif (_lfs_CFLAGS)
+    #
+    # Check for large filesystem support
+    #
+    if (CMAKE_SIZEOF_VOID_P MATCHES "8")
+        # with large file support
+        execute_process(
+            COMMAND
+                getconf LFS64_CFLAGS
+            OUTPUT_VARIABLE
+                _lfs_CFLAGS
+            ERROR_QUIET
+            OUTPUT_STRIP_TRAILING_WHITESPACE
+        )
+    else (CMAKE_SIZEOF_VOID_P MATCHES "8")
+        # with large file support
+        execute_process(
+            COMMAND
+                getconf LFS_CFLAGS
+            OUTPUT_VARIABLE
+                _lfs_CFLAGS
+            ERROR_QUIET
+            OUTPUT_STRIP_TRAILING_WHITESPACE
+        )
+    endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
+    if (_lfs_CFLAGS)
+        string(REGEX REPLACE "[\r\n]" " " "${_lfs_CFLAGS}" "${${_lfs_CFLAGS}}")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_lfs_CFLAGS}")
+    endif (_lfs_CFLAGS)

 endif (UNIX AND NOT WIN32)

-# suppress warning about "deprecated" functions
 if (MSVC)
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
+    # Suppress warning about "deprecated" functions
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
 endif (MSVC)


stdlib: Don't explicitly pass requirement machine flags that are on by default

--- stdlib/cmake/modules/SwiftSource.cmake
+++ stdlib/cmake/modules/SwiftSource.cmake
@@ -465,12 +465,6 @@
     endif()
   endif()

-  # The standard library and overlays are built with the Requirement Machine enabled.
-  if(SWIFTFILE_IS_STDLIB)
-    list(APPEND swift_flags "-Xfrontend" "-requirement-machine-protocol-signatures=verify")
-    list(APPEND swift_flags "-Xfrontend" "-requirement-machine-abstract-signatures=verify")
-  endif()
-
   # The standard library and overlays are built resiliently when SWIFT_STDLIB_STABLE_ABI=On.
   if(SWIFTFILE_IS_STDLIB AND SWIFT_STDLIB_STABLE_ABI)
     list(APPEND swift_flags "-enable-library-evolution")


Implement support (with some known constraints) for add_executable with
the Ada language.

svn path=/trunk/; revision=7389

--- cmake/modules/CMakeAdaInformation.cmake
+++ cmake/modules/CMakeAdaInformation.cmake
@@ -142,18 +142,41 @@
     "<CMAKE_Ada_COMPILER> <FLAGS> -o <OBJECT> -c <SOURCE>")
 ENDIF(NOT CMAKE_Ada_COMPILE_OBJECT)

-# The only way to link an executable is with gnatmake (or the equivalent
-# gnatbind and gnatlink commands).  But those commands need
-# <SOURCE> which is not available.  Under these
-# circumstances, no linking can be done.  Thus,
-# add_executable only compiles but does no linking, so the user must follow
-# it with the appropriate gnatmake command to get the binding and linking
-# done correctly.
-#IF(NOT CMAKE_Ada_LINK_EXECUTABLE)
+# Assumption:
+# The programme gnatmake is assumed available since gnatgcc has already
+# been proved to be available.
+# Constraints:
+# gnatmake is required to do the binding and linking of Ada executables,
+# and it requires a source file name which is constructed from
+# <TARGET>.adb.  The source file arguments of add_executable are
+# all compiled by the above rule (which must remain that form since it
+# is also used to compile objects for Ada libraries), but the results are
+# ignored since they are put in a different directory while gnatmake assumes
+# objects are located in the _current_ directory.  Thus, put in a minimal
+# source file (with correct .adb suffix to identify the Ada language)
+# to reduce this useless compilation to a minimum.  Usually, the main Ada
+# routine qualifies since it is normally small.  Thus, the normal usage is
+# add_executable(foo foo.adb), but  add_executable(foo path/minimal.adb) would
+# work as well so long as both path/minimal.adb existed and foo.adb existed.
+# Also, note there is no way to specify
+# ${CMAKE_CURRENT_SOURCE_DIR}/<TARGET>.adb as the code for gnatmake to compile
+# because in this context ${CMAKE_CURRENT_SOURCE_DIR} is set to the top
+# of the source tree and not the expected sub-directory of the source tree.
+# Thus, LINK_FLAGS -aI${CMAKE_CURRENT_SOURCE_DIR} must be set using
+# set_target_properties in order to specify the directory where <TARGET>.adb
+# exists. Note, LINK_FLAGS can also be used to set other gnatmake flags
+# such as -aL.
+
+# In sum, you have to be careful of your target name, the nominal source file
+# name has to be compilable, but otherwise it is ignored, and you must specify
+# the required -aI and other gnatmake options using LINK_FLAGS specified
+# with set_target_properties.  However, so long as you pay attention to these
+# constraints, add_executable should work for the Ada language.
+
+IF(NOT CMAKE_Ada_LINK_EXECUTABLE)
   SET(CMAKE_Ada_LINK_EXECUTABLE
-    "")
-#    "<CMAKE_Ada_COMPILER> <FLAGS> <CMAKE_Ada_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
-#ENDIF(NOT CMAKE_Ada_LINK_EXECUTABLE)
+    "gnatmake <FLAGS> <CMAKE_Ada_LINK_FLAGS> <LINK_FLAGS> <TARGET>.adb -largs <LINK_LIBRARIES>")
+ENDIF(NOT CMAKE_Ada_LINK_EXECUTABLE)

 IF(CMAKE_Ada_STANDARD_LIBRARIES_INIT)
   SET(CMAKE_Ada_STANDARD_LIBRARIES "${CMAKE_Ada_STANDARD_LIBRARIES_INIT}"


Do not link against QtConcurrent

Do not link against QtConcurrent

--- cmake/modules/FindQt5Transitional.cmake
+++ cmake/modules/FindQt5Transitional.cmake
@@ -45,10 +45,15 @@
                                  ${Qt5PrintSupport_LIBRARIES}
                                  ${Qt5Svg_LIBRARIES} )
       endif()
-      if ("${_component}" STREQUAL "Core")
-        find_package(Qt5Concurrent REQUIRED)
-        list(APPEND QT_LIBRARIES ${Qt5Concurrent_LIBRARIES} )
-      endif()
+#      Core module was separated to Core and Concurrent in Qt5.
+#      But QCA doesn't use any classes from QtConcurrent.
+#      So QtConcurrent mustn't be used in QCA.
+#      Uncomment this if Concurrent support will be added.
+
+#      if ("${_component}" STREQUAL "Core")
+#        find_package(Qt5Concurrent REQUIRED)
+#        list(APPEND QT_LIBRARIES ${Qt5Concurrent_LIBRARIES} )
+#      endif()
     endforeach()
   endif()


Refining MSVC warning set to the minimum required and documenting.

--- build_tools/cmake/iree_copts.cmake
+++ build_tools/cmake/iree_copts.cmake
@@ -230,18 +230,30 @@
     # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-2-and-4-c4200
     "/wd4200"

-    # Misc tweaks to better match clang/gcc behavior:
-    "/wd4065"  # switch statement contains 'default' but no 'case' labels
+    # "signed/unsigned mismatch in comparison"
+    # This is along the lines of a generic implicit conversion warning but tends
+    # to crop up in code that implicitly treats unsigned size_t values as if
+    # they were signed values instead of properly using ssize_t. In certain
+    # cases where the comparison being performed may be guarding access to
+    # memory this can cause unexpected behavior ("-1ull < 512ull, great let's
+    # dereference buffer[-1ull]!).
+    # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4018
+    #
+    # TODO(benvanik): remove this (or make it per-file to iree/compiler, as LLVM
+    # tends to not care about these kind of things and it crops up there a lot).
+    "/wd4018"
+
+    # Misc tweaks to better match reasonable clang/gcc behavior:
+    "/wd4005"  # allow: macro redefinition
+    "/wd4065"  # allow: switch statement contains 'default' but no 'case' labels
+    "/wd4141"  # allow: inline used more than once
+    "/wd4624"  # allow: destructor was implicitly defined as deleted
+
+    # TODO(benvanik): confirm these are all still required and document:
     "/wd4146"  # operator applied to unsigned type, result still unsigned
-
-    "/wd4141"  # duplicate inline attributes
-    "/wd4005"  # macro redefinition
-    "/wd4267"
-    "/wd4141"
-    "/wd4244"
-    "/wd4146"
-    "/wd4018"
-    "/wd4065"
+    "/wd4244"  # possible loss of data
+    "/wd4267"  # initializing: possible loss of data
+    "/wd5105"  # allow: macro expansion producing 'defined' has undefined behavior
 )

 if(NOT ANDROID)


* check: add checking uuid library if efi option enabled;

--- check.cmake
+++ check.cmake
@@ -122,4 +122,6 @@
 option(EFI_ENABLE "Disable optional EFI support" ON)
 if (${EFI_ENABLE})
 	set(ENABLE_EFI 1)
+	# check uuid library
+	pkg_check_modules(UUID REQUIRED uuid>=2.25.0)
 endif()


Some work on the functionality in YACMA to setup compiler flags.

--- cmake/yacma/YACMACompilerLinkerSettings.cmake
+++ cmake/yacma/YACMACompilerLinkerSettings.cmake
@@ -9,11 +9,17 @@
     set(CMAKE_MACOSX_RPATH 1)
 endif()

+# Helper function to print out the autodetected flags.
+function(YACMA_REPORT_FLAGS)
+    message(STATUS "YACMA autodetected C++ flags: ${YACMA_CXX_FLAGS}")
+    message(STATUS "YACMA autodetected C++ debug flags: ${YACMA_CXX_FLAGS_DEBUG}")
+endfunction()
+
 # We don't want to execute all this every time CMake is run, as it is time expensive. We will set cache variables
 # on the first run and skip following CMake runs.
 if(YACMACompilerLinkerSettingsRun)
-    message(STATUS "YACMA C++ flags: ${YACMA_CXX_FLAGS}")
-    message(STATUS "YACMA C++ debug flags: ${YACMA_CXX_FLAGS_DEBUG}")
+    # Report the flags before exiting.
+    YACMA_REPORT_FLAGS()
     return()
 endif()

@@ -24,6 +30,7 @@
 # Clang detection:
 # http://stackoverflow.com/questions/10046114/in-cmake-how-can-i-test-if-the-compiler-is-clang
 # http://www.cmake.org/cmake/help/v2.8.10/cmake.html#variable:CMAKE_LANG_COMPILER_ID
+# NOTE: we use MATCHES here because on OSX sometimes the compiler calls itself "AppleClang".
 if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
     set(YACMA_COMPILER_IS_CLANGXX 1)
 endif()
@@ -43,16 +50,20 @@
 set(_YACMA_CXX_FLAGS "")
 set(_YACMA_CXX_FLAGS_DEBUG "")

-# Enable conditionally a CXX flags, is supported by the compiler.
+# Enable conditionally a CXX flags, if supported by the compiler.
 # This is for flags intended to be enabled in all configurations.
-macro(YACMA_CHECK_ENABLE_CXX_FLAG flag)
-    message(STATUS "Checking the availability of the compiler flag '${flag}'")
+# NOTE: we use macros and go through temporary private variables
+# because it's apparently impossible to append to an internal
+# CACHEd list.
+macro(_YACMA_CHECK_ENABLE_CXX_FLAG flag)
+    set(CMAKE_REQUIRED_QUIET TRUE)
     check_cxx_compiler_flag("${flag}" YACMA_CHECK_CXX_FLAG)
+    unset(CMAKE_REQUIRED_QUIET)
     if(YACMA_CHECK_CXX_FLAG)
-        message(STATUS "Enabling the '${flag}' compiler flag.")
+        message(STATUS "'${flag}': flag is supported by the compiler, enabling.")
         list(APPEND _YACMA_CXX_FLAGS "${flag}")
     else()
-        message(STATUS "Disabling the '${flag}' compiler flag.")
+        message(STATUS "'${flag}': flag is not supported by the compiler.")
     endif()
     # NOTE: check_cxx_compiler stores variables in the cache.
     unset(YACMA_CHECK_CXX_FLAG CACHE)
@@ -60,14 +71,15 @@

 # Enable conditionally a debug CXX flags, is supported by the compiler.
 # This is for flags intended to be enabled in debug mode.
-macro(YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG flag)
-    message(STATUS "Checking the availability of the debug compiler flag '${flag}'")
+macro(_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG flag)
+    set(CMAKE_REQUIRED_QUIET TRUE)
     check_cxx_compiler_flag("${flag}" YACMA_CHECK_DEBUG_CXX_FLAG)
+    unset(CMAKE_REQUIRED_QUIET)
     if(YACMA_CHECK_DEBUG_CXX_FLAG)
-        message(STATUS "Enabling the '${flag}' debug compiler flag.")
+        message(STATUS "'${flag}': debug flag is supported by the compiler, enabling.")
         list(APPEND _YACMA_CXX_FLAGS_DEBUG "${flag}")
     else()
-        message(STATUS "Disabling the '${flag}' debug compiler flag.")
+        message(STATUS "'${flag}': debug flag is not supported by the compiler.")
     endif()
     unset(YACMA_CHECK_DEBUG_CXX_FLAG CACHE)
 endmacro()
@@ -77,54 +89,54 @@

 # Configuration bits specific for GCC.
 if(YACMA_COMPILER_IS_GNUCXX)
-    YACMA_CHECK_ENABLE_CXX_FLAG(-fdiagnostics-color=auto)
+    _YACMA_CHECK_ENABLE_CXX_FLAG(-fdiagnostics-color=auto)
 endif()

 # Configuration bits specific for clang.
 if(YACMA_COMPILER_IS_CLANGXX)
     # For now it seems like -Wshadow from clang behaves better than GCC's, just enable it here
     # for the time being.
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wshadow)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wshadow)
     # Clang is better at this flag than GCC.
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Werror)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Werror)
 endif()

 # Common configuration for GCC, clang and Intel.
 if (YACMA_COMPILER_IS_CLANGXX OR YACMA_COMPILER_IS_INTELXX OR YACMA_COMPILER_IS_GNUCXX)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wall)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnoexcept)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wlogical-op)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wconversion)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wdeprecated)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wall)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnoexcept)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wlogical-op)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wconversion)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wdeprecated)
     # This limit is supposed to be at least 1024 in C++11, but for some reason
     # clang sets this to 256, and gcc to 900.
-    YACMA_CHECK_ENABLE_CXX_FLAG(-ftemplate-depth=1024)
+    _YACMA_CHECK_ENABLE_CXX_FLAG(-ftemplate-depth=1024)
     # NOTE: this can be useful, but at the moment it triggers lots of warnings in type traits.
     # Keep it in mind for the next time we touch type traits.
-    # YACMA_CHECK_ENABLE_CXX_FLAG(-Wold-style-cast)
+    # _YACMA_CHECK_ENABLE_CXX_FLAG(-Wold-style-cast)
     # NOTE: disable this for now, as it results in a lot of clutter from Boost.
-    # YACMA_CHECK_ENABLE_CXX_FLAG(-Wzero-as-null-pointer-constant)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-pedantic-errors)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wdisabled-optimization)
-    YACMA_CHECK_ENABLE_CXX_FLAG(-fvisibility-inlines-hidden)
-    YACMA_CHECK_ENABLE_CXX_FLAG(-fvisibility=hidden)
+    # _YACMA_CHECK_ENABLE_CXX_FLAG(-Wzero-as-null-pointer-constant)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-pedantic-errors)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wdisabled-optimization)
+    _YACMA_CHECK_ENABLE_CXX_FLAG(-fvisibility-inlines-hidden)
+    _YACMA_CHECK_ENABLE_CXX_FLAG(-fvisibility=hidden)
     # This is useful when the compiler decides the template backtrace is too verbose.
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-ftemplate-backtrace-limit=0)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-fstack-protector-all)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-ftemplate-backtrace-limit=0)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-fstack-protector-all)
     # These became available in GCC from version 5.
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wodr)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsuggest-final-types)
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsuggest-final-methods)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wodr)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsuggest-final-types)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsuggest-final-methods)
 endif()

 # MSVC setup.
 if(YACMA_COMPILER_IS_MSVC)
     # Enable higher warning level than usual.
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4)
     # Treat warnings as errors.
-    YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX)
+    _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX)
 endif()

 # Set the cache variables.
@@ -133,8 +145,7 @@
 set(YACMACompilerLinkerSettingsRun YES CACHE INTERNAL "")

 # Final report.
-message(STATUS "YACMA C++ flags: ${YACMA_CXX_FLAGS}")
-message(STATUS "YACMA C++ debug flags: ${YACMA_CXX_FLAGS_DEBUG}")
+YACMA_REPORT_FLAGS()

 # Mark as included.
 set(YACMACompilerLinkerSettingsIncluded YES)


Fixing gflags static link

Fixing gflags static link

Former-commit-id: 6299435d040348e6d3ebce3c1864e351cfd144e9

--- cmake-modules/Fetch_Ceres.cmake
+++ cmake-modules/Fetch_Ceres.cmake
@@ -56,7 +56,8 @@
             CMAKE_ARGS
             -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
             -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-            -DBUILD_TESTING:BOOL=OFF
+            -DBUILD_TESTING:BOOL=ON
+            -DBUILD_EXAMPLES:BOOL=ON
             -DCMAKE_CXX_FLAGS:STRING=${FLAGS}
             -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
             -DCMAKE_FIND_LIBRARY_SUFFIXES:STRING=${CUSTOM_SUFFIX}
@@ -69,11 +70,11 @@
             -DEIGEN_INCLUDE_DIR_HINTS:PATH=${EIGEN3_INCLUDE_DIR}
             -DEIGEN_PREFER_EXPORTED_EIGEN_CMAKE_CONFIGURATION:BOOL=FALSE
             -DGFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION:BOOL=FALSE
-            -DGFLAGS_INCLUDE_DIR_HINTS:PATH=${GFLAGS_INCLUDE_DIR}
-            -DGFLAGS_LIBRARY_DIR_HINTS:PATH=${GFLAGS_LIBRARY_DIR}
+            -DGFLAGS_INCLUDE_DIR:PATH=${GFLAGS_INCLUDE_DIR}
+            -DGFLAGS_LIBRARY:PATH=${GFLAGS_LIBRARIES}
             -DGLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION:BOOL=FALSE
-            -DGLOG_INCLUDE_DIR_HINTS:PATH=${GLOG_INCLUDE_DIR}
-            -DGLOG_LIBRARY_DIR_HINTS:PATH=${GLOG_LIBRARY_DIR}
+            -DGLOG_INCLUDE_DIR:PATH=${GLOG_INCLUDE_DIR}
+            -DGLOG_LIBRARY:PATH=${GLOG_LIBRARIES}
             -DLAPACK:BOOL=OFF
             -DEIGENSPARSE:BOOL=ON
             -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>


Correct the new find_library commands.

Correct the new find_library commands.

Thanks to SpecLad.

--- cmake/OpenCVFindLibsVideo.cmake
+++ cmake/OpenCVFindLibsVideo.cmake
@@ -229,18 +229,10 @@
     if(FFMPEG_INCLUDE_DIR)
       set(HAVE_GENTOO_FFMPEG TRUE)
       set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
-      find_library(FFMPEG_CODEC_LIB
-                   NAMES "libavcodec.a" "libavcodec.dylib"
-                   PATHS "${FFMPEG_LIB_DIR}")
-      find_library(FFMPEG_FORMAT_LIB
-                   NAMES "libavformat.a" "libavformat.dylib"
-                   PATHS "${FFMPEG_LIB_DIR}")
-      find_library(FFMPEG_UTIL_LIB
-                   NAMES "libavutil.a" "libavutil.dylib"
-                   PATHS "${FFMPEG_LIB_DIR}")
-      find_library(FFMPEG_SWSCALE_LIB
-                   NAMES "libswscale.a" "libswscale.dylib"
-                   PATHS "${FFMPEG_LIB_DIR}")
+      find_library(FFMPEG_CODEC_LIB "avcodec" HINTS "${FFMPEG_LIB_DIR}")
+      find_library(FFMPEG_FORMAT_LIB "avformat" HINTS "${FFMPEG_LIB_DIR}")
+      find_library(FFMPEG_UTIL_LIB "avutil" HINTS "${FFMPEG_LIB_DIR}")
+      find_library(FFMPEG_SWSCALE_LIB "swscale" HINTS "${FFMPEG_LIB_DIR}")
       if(FFMPEG_CODEC_LIB AND FFMPEG_FORMAT_LIB AND
          FFMPEG_UTIL_LIB AND FFMPEG_SWSCALE_LIB)
         set(HAVE_FFMPEG 1)


Lock H18.0 to ABI=6, otherwise use ABI=7

Signed-off-by: Dan Bailey <39b6ae1dd30d9ab3cd77a2d084b277520f14c203@ilm.com>

--- cmake/OpenVDBHoudiniSetup.cmake
+++ cmake/OpenVDBHoudiniSetup.cmake
@@ -328,8 +328,10 @@
   set(OPENVDB_HOUDINI_ABI 4)
 elseif(Houdini_VERSION VERSION_LESS 18)
   set(OPENVDB_HOUDINI_ABI 5)
+elseif(Houdini_VERSION VERSION_LESS 18.5)
+  set(OPENVDB_HOUDINI_ABI 6)
 else()
-  set(OPENVDB_HOUDINI_ABI 6)
+  set(OPENVDB_HOUDINI_ABI 7)
 endif()

 # ------------------------------------------------------------------------


set the default socket addr for C/C

set the default socket addr for C/C

--- cmake/mariadb_connector_c.cmake
+++ cmake/mariadb_connector_c.cmake
@@ -48,6 +48,7 @@
 ENDIF()

 SET(PLUGIN_INSTALL_DIR ${INSTALL_PLUGINDIR})
+SET(MARIADB_UNIX_ADDR ${MYSQL_UNIX_ADDR})

 MESSAGE("== Configuring MariaDB Connector/C")
 ADD_SUBDIRECTORY(libmariadb)


Disable CXX extensions

Disable CXX extensions

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -23,6 +23,7 @@
     LINKER_LANGUAGE           "CXX"
     POSITION_INDEPENDENT_CODE ON
     CXX_VISIBILITY_PRESET     "hidden"
+    CXX_EXTENSIONS            Off
 )


Add back in include

Add back in include

--- cmake/External_gtest.cmake
+++ cmake/External_gtest.cmake
@@ -62,3 +62,6 @@
     IMPORTED_LINK_INTERFACE_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}"
     ${GTEST_IMPORTED_LOCATION}
 )
+
+# I couldn't make it work with INTERFACE_INCLUDE_DIRECTORIES
+include_directories("${source_dir}/include")


Finally fixed archive linking order.

Finally fixed archive linking order.

--- cmake/FindLibTooling.cmake
+++ cmake/FindLibTooling.cmake
@@ -10,12 +10,30 @@

 # Set the libraries that need to be found:
 set(LIBTOOLING_REQUIRED_LIBRARIES
-    "clangTooling" "clangFrontend" "clangSerialization" "clangDriver"
-    "clangRewriteFrontend" "clangRewriteCore" "clangParse" "clangSema"
-    "clangAnalysis" "clangAST" "clangASTMatchers" "clangEdit" "clangLex"
+    "clangTooling"
+    "clangFrontend"
+    "clangSerialization"
+    "clangDriver"
+    "clangRewriteFrontend"
+    "clangRewriteCore"
+    "clangParse"
+    "clangSema"
+    "clangAnalysis"
+    "clangAST"
+    "clangASTMatchers"
+    "clangEdit"
+    "clangLex"
     "clangBasic"
-    "LLVMCore" "LLVMOption" "LLVMMC" "LLVMObject" "LLVMBitReader"
-    "LLVMSupport" "LLVMAsmParser" "LLVMMCParser" "LLVMTransformUtils")
+    "LLVMBitReader"
+    "LLVMAsmParser"
+    "LLVMMCParser"
+    "LLVMTransformUtils"
+    "LLVMOption"
+    "LLVMMC"
+    "LLVMObject"
+    "LLVMCore"
+    "LLVMSupport"
+)

 # First, find LLVM by way of the `llvm-config` executable
 if(NOT LLVM_CONFIG_EXECUTABLE)


Define FMT_DEPRECATED for CUDA, as NVCC doesn't like deprecated attributes (#1039)

--- src/cmake/cuda_macros.cmake
+++ src/cmake/cuda_macros.cmake
@@ -18,6 +18,7 @@
             "-I${OPENIMAGEIO_INCLUDE_DIR}"
             "-I${ILMBASE_INCLUDE_DIR}"
             "-I${Boost_INCLUDE_DIRS}"
+            "-DFMT_DEPRECATED=\"\""
             ${LLVM_COMPILE_FLAGS}
             -DOSL_USE_FAST_MATH=1
             -m64 -arch ${CUDA_TARGET_ARCH} -ptx


Belated update of the find module for this library - accounting for the suffix `.h` -> `.hpp` transition (see issue #62).

--- cmake/Modules/FindCUDAAPIWrappers.cmake
+++ cmake/Modules/FindCUDAAPIWrappers.cmake
@@ -17,7 +17,7 @@

 find_path(
 	CUDA_API_WRAPPERS_INCLUDE_DIR
-	cuda/api_wrappers.h
+	cuda/api_wrappers.hpp
 	HINTS
 		${CUDA_INCLUDE_DIRS}
 		${CMAKE_CURRENT_SOURCE_DIR}/cuda-api-wrappers


Update to latest libprimesieve

Update to latest libprimesieve

--- lib/primesieve/cmake/multiarch_popcnt_bmi.cmake
+++ lib/primesieve/cmake/multiarch_popcnt_bmi.cmake
@@ -12,7 +12,7 @@
     #if defined(__POPCNT__) && defined(__BMI__)
         Error: multiarch_popcnt_bmi not needed!
     #endif
-    #if defined(__GNUC__)
+    #if defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)
         #if __GNUC__ <= 5
             Error: The linker does not support function multiversioning
                    for shared libraries.


Fix handling of AMD OpenCL include/lib dirs

Also correctly handle 64 vs. 32bit builds, although I should probably
switch to 64bit builds actually.

--- cmake/FindOpenCL.cmake
+++ cmake/FindOpenCL.cmake
@@ -34,13 +34,11 @@

 	    # The AMD SDK currently installs both x86 and x86_64 libraries
 	    # This is only a hack to find out architecture
-	    IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
-	    	SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64")
-			SET(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64")
-	    ELSE (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
-	    	SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86")
-	   		SET(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86")
-	    ENDIF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
+		IF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
+			SET(OPENCL_LIB_DIR "$ENV{AMDAPPSDKROOT}/lib/x86_64")
+	    ELSE (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
+			SET(OPENCL_LIB_DIR "$ENV{AMDAPPSDKROOT}/lib/x86")
+	    ENDIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" AND CMAKE_SIZEOF_VOID_P EQUAL 8)

 	    # find out if the user asked for a 64-bit build, and use the corresponding
 	    # 64 or 32 bit NVIDIA library paths to the search:


Fix detection of RTfact debug library with CMake.

--- cmake/FindRTfact.cmake
+++ cmake/FindRTfact.cmake
@@ -29,8 +29,8 @@

 	## And a possible debug version
 	FIND_LIBRARY(RTFACT_DEBUG_LIBRARY
-		NAMES RTfactRemoted
-		PATHS ${RTFACT_POSSIBLE_ROOT_DIRS}
+		NAMES RTfactRemoted RTfactRemote
+		PATHS ${RTFACT_POSSIBLE_ROOT_DIRS} ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/Debug
 		PATH_SUFFIXES lib
 		DOC "RTfact library, debug")


fix(qt): another attempt to fix Qt warnings from Clang

--- cmake/consort/qt.cmake
+++ cmake/consort/qt.cmake
@@ -176,7 +176,7 @@
 				# Clang seems to be generating warnings from Qt headers, even though
 				# -isystem is used
 				foreach(m Core ${_modules})
-					list(APPEND CONSORT_COMPILE_FLAGS -isystem-prefix "Qt${m}/")
+					list(APPEND CONSORT_COMPILE_FLAGS "-isystem-prefix=Qt${m}/")
 				endforeach()
 			endif()


update FindDependency to search properly for multiple libraries in differnet directories

--- cmake/modules/FindDependency.cmake
+++ cmake/modules/FindDependency.cmake
@@ -19,19 +19,24 @@
 ##############################################################################
 # search paths
 ##############################################################################
-SET(${DEP}_INCLUDE_SEARCH_DIRS
-  ${GLOBAL_EXT_DIR}/inc/${DEP}
+list(APPEND ${DEP}_INCLUDE_SEARCH_DIRS
   ${${DEP}_INCLUDE_DIRS}
   ${${DEP}_INCLUDE_SEARCH_DIR}
+  ${GLOBAL_EXT_DIR}/inc/${DEP}
   "/usr/include"
   "/usr/share/include"
   "/usr/include/x86_64-linux-gnu/"
 )

-SET(${DEP}_LIBRARY_SEARCH_DIRS
-  ${GLOBAL_EXT_DIR}/lib
+# search before global paths
+list(APPEND ${DEP}_LIBRARY_SEARCH_HINTS
   ${${DEP}_LIBRARY_DIRS}
   ${${DEP}_LIBRARY_SEARCH_DIR}
+  ${GLOBAL_EXT_DIR}/lib
+  ${GLOBAL_EXT_DIR}/${DEP}/lib
+)
+# search after global paths
+list(APPEND ${DEP}_LIBRARY_SEARCH_PATHS
   "/usr/lib/"
   "/usr/lib/x86_64-linux-gnu/"
 )
@@ -39,120 +44,105 @@
 # macros
 ##############################################################################
 # feedback to provide user-defined paths to search for ${DEP}
-MACRO (request_dep_search_directories)
+MACRO(request_include_search_dirs)
+  # if hints were provided, display
+  if (DEFINED ${DEP}_INCLUDE_SEARCH_DIR)
+    set(${DEP}_INCLUDE_SEARCH_DIR ${${DEP}_INCLUDE_SEARCH_DIR} CACHE PATH "path to ${DEP} headers.")
+    # if not, request them
+  else()
+    set(${DEP}_INCLUDE_SEARCH_DIR "Please provide ${DEP} include path." CACHE PATH "path to ${DEP} headers.")
+  endif()
+ENDMACRO()

-  IF ( NOT ${DEP}_INCLUDE_DIRS )
-    SET(${DEP}_INCLUDE_SEARCH_DIR "Please provide ${DEP} include path." CACHE PATH "path to ${DEP} headers.")
-    MESSAGE(FATAL_ERROR "find_${DEP}.cmake: unable to find ${DEP} headers.")
-  ELSE ( NOT ${DEP}_INCLUDE_DIRS )
-    UNSET(${DEP}_INCLUDE_SEARCH_DIR CACHE)
-  ENDIF ( NOT ${DEP}_INCLUDE_DIRS )
-
-  IF ( NOT ${DEP}_LIBRARY_DIRS )
-    SET(${DEP}_LIBRARY_SEARCH_DIR "Please provide ${DEP} library path." CACHE PATH "path to ${DEP} libraries.")
-    MESSAGE(FATAL_ERROR "find_${DEP}.cmake: unable to find ${DEP} libraries.")
-  ELSE ( NOT ${DEP}_LIBRARY_DIRS )
-    UNSET(${DEP}_LIBRARY_SEARCH_DIR CACHE)
-  ENDIF ( NOT ${DEP}_LIBRARY_DIRS )
-
-ENDMACRO (request_dep_search_directories)
-
-# get library extension depending on platform
-MACRO(add_lib_extension FILENAME FULL_FILENAME)
-  IF(UNIX)
-    SET(${FULL_FILENAME} "${FILENAME}.so")
-  ELSEIF(WIN32)
-    SET(${FULL_FILENAME} "${FILENAME}.lib")
-  ENDIF(UNIX)
-ENDMACRO(add_lib_extension)
+MACRO(request_lib_search_dirs)
+  # if hints were provided, display
+  if (DEFINED ${DEP}_LIBRARY_SEARCH_DIR)
+    set(${DEP}_LIBRARY_SEARCH_DIR ${${DEP}_LIBRARY_SEARCH_DIR} CACHE PATH "path to ${DEP} libraries.")
+    # if not, request them
+  else()
+    set(${DEP}_LIBRARY_SEARCH_DIR "Please provide ${DEP} library path." CACHE PATH "path to ${DEP} libraries.")
+  endif()
+ENDMACRO()
 ##############################################################################
 # search
 ##############################################################################
 message(STATUS "Looking for ${DEP}")
 # search for include directory
-IF (NOT ${DEP}_INCLUDE_DIRS)
+if (NOT ${DEP}_INCLUDE_DIRS)

-  SET(_${DEP}_FOUND_INC_DIRS "")
-  FOREACH(_SEARCH_DIR ${${DEP}_INCLUDE_SEARCH_DIRS})
-    FIND_PATH(_CUR_SEARCH
+  set(_${DEP}_FOUND_INC_DIRS "")
+  foreach(_SEARCH_DIR ${${DEP}_INCLUDE_SEARCH_DIRS})
+    find_path(_CUR_SEARCH
       NAMES ${DEP_HEADER}
         PATHS ${_SEARCH_DIR}
         NO_DEFAULT_PATH)
     # stop search once dir is found
-    IF (_CUR_SEARCH)
-      LIST(APPEND _${DEP}_FOUND_INC_DIRS ${_CUR_SEARCH})
-      BREAK()
-    ENDIF(_CUR_SEARCH)
-  ENDFOREACH(_SEARCH_DIR ${${DEP}_INCLUDE_SEARCH_DIRS})
+    if (_CUR_SEARCH)
+      list(APPEND _${DEP}_FOUND_INC_DIRS ${_CUR_SEARCH})
+      break()
+    endif(_CUR_SEARCH)
+  endforeach(_SEARCH_DIR ${${DEP}_INCLUDE_SEARCH_DIRS})
   # reset search status for next search
-  SET(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")
+  set(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")

-  IF (NOT _${DEP}_FOUND_INC_DIRS)
-    request_dep_search_directories()
-  ENDIF (NOT _${DEP}_FOUND_INC_DIRS)
+  if (NOT _${DEP}_FOUND_INC_DIRS)
+    request_include_search_dirs()
+    message(FATAL_ERROR "Unable to find ${DEP} headers.")
+  endif (NOT _${DEP}_FOUND_INC_DIRS)

-  FOREACH(_INC_DIR ${_${DEP}_FOUND_INC_DIRS})
-    SET(${DEP}_INCLUDE_DIRS ${${DEP}_INCLUDE_DIRS} ${_INC_DIR} CACHE PATH "${DEP} include directory.")
-  ENDFOREACH(_INC_DIR ${_${DEP}_FOUND_INC_DIRS})
+  foreach(_INC_DIR ${_${DEP}_FOUND_INC_DIRS})
+    set(${DEP}_INCLUDE_DIRS ${${DEP}_INCLUDE_DIRS} ${_INC_DIR} CACHE PATH "${DEP} include directory.")
+  endforeach(_INC_DIR ${_${DEP}_FOUND_INC_DIRS})

-ENDIF (NOT ${DEP}_INCLUDE_DIRS)
+endif (NOT ${DEP}_INCLUDE_DIRS)

-
-# search for library dirs
-add_lib_extension(${DEP_LIB} ${DEP}_LIB_FILENAME)
-IF ( NOT ${DEP}_LIBRARY_DIRS )
-
-  SET(_${DEP}_FOUND_LIB_DIR "")
-  SET(_${DEP}_POSTFIX "")
-  # check all given possible library dirs
-  FOREACH(_SEARCH_DIR ${${DEP}_LIBRARY_SEARCH_DIRS})
-    FIND_PATH(_CUR_SEARCH
-      NAMES ${${DEP}_LIB_FILENAME}
-        PATHS ${_SEARCH_DIR}
+# search for libraries
+if (NOT ${DEP}_LIBS_FOUND)
+  # create list of libs from lib and optional arguments
+  set(${DEP}_LIB_LIST ${DEP_LIB})
+  list(APPEND ${DEP}_LIB_LIST ${ARGN})
+  # accumulate library list
+  foreach(_SEARCH_LIB ${${DEP}_LIB_LIST})
+    # search only for lib if it hasnt already been found
+    list(FIND ${DEP}_FOUND_LIBS ${_SEARCH_LIB} _INDEX)
+    if(${_INDEX} LESS 0)
+      find_library(_CUR_SEARCH
+        NAMES ${_SEARCH_LIB}
+        HINTS ${${DEP}_LIBRARY_SEARCH_HINTS}
+        PATHS ${${DEP}_LIBRARY_SEARCH_PATHS}
         PATH_SUFFIXES release debug
-        NO_DEFAULT_PATH)
-    # stop search once dir is found
-    IF (_CUR_SEARCH)
-      LIST(APPEND _${DEP}_FOUND_LIB_DIR ${_SEARCH_DIR})
-      BREAK()
-    ENDIF(_CUR_SEARCH)
-  ENDFOREACH(_SEARCH_DIR ${${DEP}_LIBRARY_SEARCH_DIRS})
-  # reset search status for next search
-  SET(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")
-
-  # react to search result
-  IF (NOT _${DEP}_FOUND_LIB_DIR)
-    request_dep_search_directories()
-  ELSE (NOT _${DEP}_FOUND_LIB_DIR)
-    SET(${DEP}_LIBRARY_DIRS ${_${DEP}_FOUND_LIB_DIR} CACHE INTERNAL PATH "The ${DEP} library directory")
-  ENDIF (NOT _${DEP}_FOUND_LIB_DIR)
-
-  # begin list of libraries with search library
-  LIST(APPEND _${DEP}_LIBRARIES "${_${DEP}_FOUND_LIB_DIR}/${${DEP}_LIB_FILENAME}")
-  # Cannot use ARGN directly with list() command.
-  SET(extra_macro_args ${ARGN})
-  # accumulate library list
-  FOREACH(EXTRA_LIB ${extra_macro_args})
-    add_lib_extension(${EXTRA_LIB} EXTRA_LIB_FULL)
-    LIST(APPEND _${DEP}_LIBRARIES "${_${DEP}_FOUND_LIB_DIR}/${EXTRA_LIB_FULL}")
-  ENDFOREACH(EXTRA_LIB ${extra_macro_args})
-  # set library cache variable
-  IF (_${DEP}_FOUND_LIB_DIR)
-    SET(${DEP}_LIBRARIES ${_${DEP}_LIBRARIES} CACHE FILEPATH "The ${DEP} library filename.")
-  ENDIF (_${DEP}_FOUND_LIB_DIR)
-
-ENDIF ( NOT ${DEP}_LIBRARY_DIRS )
+      )
+      # react to search result
+      if(_CUR_SEARCH)
+          # add library and path to output lists
+          set(${DEP}_LIBRARIES ${${DEP}_LIBRARIES} ${_CUR_SEARCH} CACHE FILEPATH "The ${DEP} library filenames." FORCE)
+          get_filename_component(_${DEP}_LIB_PATH ${_CUR_SEARCH} DIRECTORY)
+          set(${DEP}_LIBRARY_DIRS ${${DEP}_LIBRARY_DIRS} ${_${DEP}_LIB_PATH} CACHE PATH "The ${DEP} library directories." FORCE)
+          # mark library as found
+          set(${DEP}_FOUND_LIBS ${${DEP}_FOUND_LIBS} ${_SEARCH_LIB} CACHE INTERNAL "internal use")
+        # reset search status for next search
+        set(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")
+      else()
+        set(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")
+        request_lib_search_dirs()
+        # stops processing and exits loop
+        message(FATAL_ERROR "Unable to find ${DEP} library '${_SEARCH_LIB}'")
+      endif()
+    endif()
+  endforeach()
+  # if statement is reached, all libraries were found
+  set(${DEP}_LIBS_FOUND TRUE CACHE INTERNAL "internal use")
+endif()

 ##############################################################################
 # verify
 ##############################################################################
-IF ( NOT ${DEP}_INCLUDE_DIRS OR NOT ${DEP}_LIBRARY_DIRS )
-  request_dep_search_directories()
+if(${DEP}_INCLUDE_DIRS AND ${DEP}_LIBS_FOUND)
+  unset(${DEP}_INCLUDE_SEARCH_DIR CACHE)
+  unset(${DEP}_LIBRARY_SEARCH_DIR CACHE)
+  message(STATUS "Looking for ${DEP} - found")
+else()
   message(STATUS "Looking for ${DEP} - not found")
-ELSE ( NOT ${DEP}_INCLUDE_DIRS OR NOT ${DEP}_LIBRARY_DIRS )
-  UNSET(${DEP}_INCLUDE_SEARCH_DIR CACHE)
-  UNSET(${DEP}_LIBRARY_SEARCH_DIR CACHE)
-  message(STATUS "Looking for ${DEP} - found")
-ENDIF ( NOT ${DEP}_INCLUDE_DIRS OR NOT ${DEP}_LIBRARY_DIRS )
+endif()

 ENDMACRO(find_dependency)


python path macro tweak.

python path macro tweak.

--- cmake/ectoMacros.cmake
+++ cmake/ectoMacros.cmake
@@ -89,17 +89,26 @@
 # ==============================================================================

 # ============== Python Path ===================================================
+
+#ecto_python_env_gen( [path1 [ path2 [ path3 [...] ] ] ])
+#this will generate a python_path.sh script in the ${PROJECT_BINARY_DIR}
+#where any argument supplied is consired to be a python module directory
+#and will be preprended to the python path.  Also, the path where ecto's python
+#binding are located will appear after any user supplied lists.
+#typically this call will look like:
+# ecto_python_env_gen(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+#
 macro( ecto_python_env_gen )
     set(ecto_PYTHONPATH_ ${ecto_PYTHONPATH} )
     set(ecto_user_PYTHONPATH )
+    #put user path first
+    list(APPEND ecto_user_PYTHONPATH  ${ARGN})
     list(APPEND ecto_user_PYTHONPATH  ${ecto_PYTHONPATH})
-    list(APPEND ecto_user_PYTHONPATH  ${ARGN})
     #transform the cmake list to a sh path list
     string(REPLACE ";" ":"
         ecto_user_PYTHONPATH
         "${ecto_user_PYTHONPATH}"
     )
-
     configure_file(${ECTO_CONFIG_PATH}/python_path.sh.user.in
       ${PROJECT_BINARY_DIR}/python_path.sh
       )


LLDB standalone build: check if Clang was built independently from LLVM

This is fix for bug 23704: LLDB standalone build always include
ClangConfig.cmake even if Clang was built with LLVM (ClangConfig.cmake
doesn't exist).

Patch by: Eugene Zelenko

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@241575 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -61,7 +61,9 @@
   endif()
   # Import CMake library targets from LLVM and Clang.
   include("${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
-  include("${LLDB_PATH_TO_CLANG_BUILD}/share/clang/cmake/ClangConfig.cmake")
+  if (EXISTS "${LLDB_PATH_TO_CLANG_BUILD}/share/clang/cmake/ClangConfig.cmake")
+      include("${LLDB_PATH_TO_CLANG_BUILD}/share/clang/cmake/ClangConfig.cmake")
+  endif()

   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")


cmake: toolchain: Don't add -Werror=implicit-int to CXX builds

We do compiler flag compatibility tests to be able to support many
different toolchains and flags in a scalable way. But the test is not
perfect and in these situations we we will need to hardcode whether a
flag is compatible or not.

To support this we have zephyr_compiler_check first check if the flag
is covered by a hardcoded test before testing it.

Currently the only hardcoded compatibilty is that -Werror=implicit-int
is not supported for CXX.

This fixes #21229

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -746,6 +746,14 @@
 # caching comes in addition to the caching that CMake does in the
 # build folder's CMakeCache.txt)
 function(zephyr_check_compiler_flag lang option check)
+  # Check if the option is covered by any hardcoded check before doing
+  # an automated test.
+  zephyr_check_compiler_flag_hardcoded(${lang} "${option}" check exists)
+  if(exists)
+    set(check ${check} PARENT_SCOPE)
+    return()
+  endif()
+
   # Locate the cache directory
   set_ifndef(
     ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE_DIR
@@ -841,6 +849,19 @@
       )
   endif()
 endfunction()
+
+function(zephyr_check_compiler_flag_hardcoded lang option check exists)
+  # -Werror=implicit-int is not supported for CXX and we are not able
+  # to automatically test for it because it produces a warning
+  # instead of an error during the test.
+  if((${lang} STREQUAL CXX) AND ("${option}" STREQUAL -Werror=implicit-int))
+    set(check 0 PARENT_SCOPE)
+    set(exists 1 PARENT_SCOPE)
+  else()
+    # There does not exist a hardcoded check for this option.
+    set(exists 0 PARENT_SCOPE)
+  endif()
+endfunction(zephyr_check_compiler_flag_hardcoded)

 # zephyr_linker_sources(<location> <files>)
 #