CTest command line arguments

CTest command line arguments

Added the ability to specify command line arguments to be passed from
CTest to unit tests

Signed-off-by: JaredWright <b526e344fa5a3e46c729bd368dac4237f81981fb@gmail.com>

--- scripts/cmake/macros.cmake
+++ scripts/cmake/macros.cmake
@@ -1262,9 +1262,11 @@
 #     is not in the same directory, allowing you to pass a source file with
 #     a directory. Nomrally FILENAME should still match the filename being
 #     used.
+# @param CMD_LINE_ARGS Command line arguements to be passed to the test
+#     executable by ctest
 #
 function(do_test FILENAME)
-    set(multiVal DEFINES DEPENDS SOURCES)
+    set(multiVal DEFINES DEPENDS SOURCES CMD_LINE_ARGS)
     cmake_parse_arguments(ARG "" "" "${multiVal}" ${ARGN})

     set(DEPENDS "")
@@ -1281,7 +1283,7 @@
     add_executable(test_${NAME} ${ARG_SOURCES})
     target_link_libraries(test_${NAME} ${DEPENDS} test_catch)
     target_compile_definitions(test_${NAME} PRIVATE ${ARG_DEFINES})
-    add_test(test_${NAME} test_${NAME})
+    add_test(test_${NAME} test_${NAME} ${ARG_CMD_LINE_ARGS})
     if(CYGWIN OR WIN32)
         target_link_libraries(test_${NAME} setupapi)
     endif()


fix check and print for build results

fix check and print for build results

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -109,9 +109,9 @@
       NUMBER_ERRORS NUM_BUILD_ERRORS
       NUMBER_WARNINGS NUM_BUILD_WARNINGS
       RETURN_VALUE BUILD_RET)
-  if(CONFIG_RET OR NUM_BUILD_WARNINGS OR NUM_BUILD_ERRORS)
+  if(NUM_BUILD_WARNINGS OR NUM_BUILD_ERRORS OR BUILD_RET)
     message(WARNING "
-${BRANCH_NAME} config failed!
+${BRANCH_NAME} build failed!
   ${NUM_BUILD_WARNINGS} warnings
   ${NUM_BUILD_ERRORS} errors
   code ${BUILD_RET}")


Enable PUMI on nightly testing

Enable PUMI on nightly testing

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -112,6 +112,7 @@
   "-DCMAKE_C_FLAGS=${flags}"
   "-DCMAKE_CXX_FLAGS=${flags} -std=c++11"
   "-DCMAKE_EXE_LINKER_FLAGS=-ldl ${flags} -pthread"
+  "-DENABLE_PUMI=ON"
   "-DSCOREC_PREFIX=/usr/local/pumi/core/"
   "-DIS_TESTING=ON"
   "-DMESHES=/users/diamog/meshes"


Add test for i386 target to ensure -march=i586 is set to enable use of atomic cpu instructions

--- src/cmake/platform.cmake
+++ src/cmake/platform.cmake
@@ -32,6 +32,10 @@
     elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
         set (platform "FreeBSD")
         set (CXXFLAGS "${CXXFLAGS} -DFREEBSD")
+        if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
+            # minimum arch of i586 is needed for atomic cpu instructions
+            set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i586")
+        endif()
     else ()
         string (TOLOWER ${CMAKE_SYSTEM_NAME} platform)
     endif ()


CMake: Silent the signed/unsigned comparison warnings

They happen quite a lot and they're all harmless and we already
have those warnings disabled in Blender anyway.

--- src/cmake/configure_build.cmake
+++ src/cmake/configure_build.cmake
@@ -9,7 +9,7 @@
 # Per-compiler configuration.

 if(CMAKE_COMPILER_IS_GNUCXX)
-	set(CMAKE_CXX_FLAGS "-Wall")
+	set(CMAKE_CXX_FLAGS "-Wall -Wno-sign-compare")
 endif(CMAKE_COMPILER_IS_GNUCXX)

 if(APPLE)


COMP: CTK now references GIT_EXECUTABLE instead of Git_EXECUTABLE

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -295,6 +295,7 @@
         -DCTK_LIB_PluginFramework:BOOL=OFF
         -DCTK_PLUGIN_org.commontk.eventbus:BOOL=OFF
         -Dgit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
+        -DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
         -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
         -DVTK_DIR:PATH=${VTK_DIR}
       INSTALL_COMMAND ""


BUG: Modify SuperBuild.cmake to use USE_SYSTEM_ITK

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -12,7 +12,7 @@
   set(build_type "${CMAKE_BUILD_TYPE}")
 endif()

-if(TubeTK_SUPERBUILD_ITK)
+if(NOT USE_SYSTEM_ITK)

 set(proj ITK)

@@ -33,7 +33,7 @@

 #SET( ITK_DIR ${prefix}/lib/InsightToolkit )

-endif(TubeTK_SUPERBUILD_ITK)
+endif(NOT USE_SYSTEM_ITK)

 set(proj tclap)

@@ -50,7 +50,7 @@

 set(proj ModuleDescriptionParser)

-if(TubeTK_SUPERBUILD_ITK)
+if(NOT USE_SYSTEM_ITK)
   ExternalProject_Add(${proj}
     SVN_REPOSITORY
       "http://svn.slicer.org/Slicer3/trunk/Libs/ModuleDescriptionParser"
@@ -65,7 +65,7 @@
     DEPENDS
       "ITK"
   )
-else(TubeTK_SUPERBUILD_ITK)
+else(NOT USE_SYSTEM_ITK)
   ExternalProject_Add(${proj}
     SVN_REPOSITORY
       "http://svn.slicer.org/Slicer3/trunk/Libs/ModuleDescriptionParser"
@@ -78,7 +78,7 @@
       -DBUILD_TESTING:BOOL=${testing}
       -DITK_DIR:PATH=${ITK_DIR}
   )
-endif(TubeTK_SUPERBUILD_ITK)
+endif(NOT USE_SYSTEM_ITK)

 set(proj GenerateCLP)


Don't build STIR with OPENMP on APPLE yet

Correcting the previous commit as UNIS is TRUE on OSX as well.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -113,7 +113,13 @@
 #option(USE_SYSTEM_Gadgetron "Build using an external version of Gadgetron" OFF)
 option(USE_SYSTEM_SIRF "Build using an external version of SIRF" OFF)
 option(USE_SYSTEM_GTest "Build using an external version of GTest" OFF)
-option(BUILD_STIR_WITH_OPENMP "Build STIR with OpenMP acceleration" ${UNIX})
+
+if (APPLE)
+  set (build_STIR_OPENMP_default OFF)
+else()
+  set (build_STIR_OPENMP_default ON)
+endif()
+option(BUILD_STIR_WITH_OPENMP "Build STIR with OpenMP acceleration" ${build_STIR_OPENMP_default})

 if (WIN32)
   set(build_Gadgetron_default OFF)


Remove status message

Remove status message

Former-commit-id: c9794853e58e22432a56debb5f2ea168196bbd0f

--- cmake-modules/FindOpenMP.cmake
+++ cmake-modules/FindOpenMP.cmake
@@ -162,7 +162,6 @@
         else()
             set(OMP_DUMMY_TARGET openmp::dummy_${lib})
         endif()
-        message(STATUS "Testing target ${OMP_DUMMY_TARGET}")
         define_omp_target(${OMP_DUMMY_TARGET} ${lib})
         check_omp_compiles(${OMP_DUMMY_TARGET})
         if(OMP_COMPILES)


[cmake] Remove the LLDB versions of the exception-controlling variables

Summary:
One can still use the LLVM variables to control this: LLVM_ENABLE_EH, LLVM_ENABLE_RTTI. It's not
clear to me why one would want to control these at lldb level and it's generally not even a good
idea to compile parts of the same binary with different values of these flags.

Reviewers: zturner, tfiala

Subscribers: lldb-commits

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

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

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -338,28 +338,6 @@
   list(APPEND system_libs ${CMAKE_DL_LIBS})
 endif()

-if(LLDB_REQUIRES_EH)
-  set(LLDB_REQUIRES_RTTI ON)
-else()
-  if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
-    set(LLDB_COMPILE_FLAGS "${LLDB_COMPILE_FLAGS} -fno-exceptions")
-  elseif(MSVC)
-    add_definitions( -D_HAS_EXCEPTIONS=0 )
-    set(LLDB_COMPILE_FLAGS "${LLDB_COMPILE_FLAGS} /EHs-c-")
-  endif()
-endif()
-
-# Disable RTTI by default
-if(NOT LLDB_REQUIRES_RTTI)
-  if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
-    set(LLDB_COMPILE_FLAGS "${LLDB_COMPILE_FLAGS} -fno-rtti")
-  elseif(MSVC)
-    set(LLDB_COMPILE_FLAGS "${LLDB_COMPILE_FLAGS} /GR-")
-  endif()
-endif()
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLDB_COMPILE_FLAGS}")
-
 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
     # Check for syscall used by lldb-server on linux.
     # If these are not found, it will fall back to ptrace (slow) for memory reads.


Update md5sum for Windows pyfftw python 3.7

This is for pyfftw 0.10.4 on Windows.

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- versions.cmake
+++ versions.cmake
@@ -68,7 +68,7 @@
 if (WIN32)
   add_revision(pyfftw
     URL "https://www.tomviz.org/files/pyfftw-0.10.4-win64.zip"
-    URL_MD5 "c9c60d3f28df1c9d545152734350f9ba")
+    URL_MD5 "1104e1f912df7d9e390dfec10d89afa3")
 else()
   add_revision(pyfftw
     URL "https://www.tomviz.org/files/pyFFTW-0.10.4.tar.gz"


Update paraview to pull in function rename

--- versions.cmake
+++ versions.cmake
@@ -64,7 +64,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "3099c34209bf9528a5899c94d1f0dfd8363038ed")
+  set(_paraview_revision "33d87dede6aafdd3a4a28bd52288e91e0da88b1d")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


BUG: 6932. CTEST_PROJECT_NAME is only used by CMake's CTEST_BUILD command, which       combines it with other variables to create the full command-line that will       build the project (say: C:\devel\languages\c\msnet2003\Common7\IDE\devenv.com       Insight.sln /build Release /project ALL_BUILD). As one can see from that       example, the *wrong* solution file was picked, Insight.sln instead of ITK.sln.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,4 +1,4 @@
-SET(CTEST_PROJECT_NAME "Insight")
+SET(CTEST_PROJECT_NAME "ITK")
 SET(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")

 IF(NOT DEFINED CTEST_DROP_METHOD)


Changed aligment/typesize tests to be done with lli to prevent need to call Visual Studio linker separately to build exe.

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -262,7 +262,7 @@
 endmacro()

 # clang try-compile-run macro, run via lli, the llvm interpreter
-macro(custom_try_run_lli SOURCE1 SOURCE2 OUTPUT_VAR)
+macro(custom_try_run_lli SOURCE1 SOURCE2 OUTPUT_VAR RES_VAR)
 # this uses "lli" - the interpreter, so we can run any -target
 # TODO variable for target !!
   set(OUTF "${CMAKE_BINARY_DIR}/try_run.bc")
@@ -271,10 +271,12 @@
   endif()
   custom_try_compile_c_cxx("${CLANG}" "c" "${SOURCE1}" "${SOURCE2}" RESV "-o" "${OUTF}" "-x" "c" "-emit-llvm" "-c" ${ARGN})
   set(${OUTPUT_VAR} "")
+  set(${RES_VAR} "")
   if(RESV OR (NOT EXISTS "${OUTF}"))
     message(STATUS " ########## Compilation failed")
   else()
     execute_process(COMMAND "${LLVM_LLI}" "${OUTF}" RESULT_VARIABLE RESV OUTPUT_VARIABLE ${OUTPUT_VAR} ERROR_VARIABLE EV)
+    set(${RES_VAR} ${RESV})
     file(REMOVE "${OUTF}")
     if(${RESV})
       message(STATUS " ########## The command ${OUTF}")
@@ -341,7 +343,7 @@
   setup_cache_var_name(SIZEOF "${TYPE}-${TRIPLE}-${CLANG}")

   if(NOT DEFINED ${CACHE_VAR_NAME})
-    custom_try_run_exe("" "return sizeof(${TYPE});" SIZEOF_STDOUT ${RES_VAR} "${CLANG_TARGET_OPTION}${TRIPLE}")
+    custom_try_run_lli("" "return sizeof(${TYPE});" SIZEOF_STDOUT ${RES_VAR} "${CLANG_TARGET_OPTION}${TRIPLE}")
     if(NOT ${RES_VAR})
       message(SEND_ERROR "Could not determine sizeof(${TYPE})")
     endif()
@@ -355,7 +357,7 @@

   if(NOT DEFINED ${CACHE_VAR_NAME})

-    custom_try_run_exe("
+    custom_try_run_lli("
 #ifndef offsetof
 #define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
 #endif


Fix detection of enabled assertions in LLVM

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -321,11 +321,12 @@

 if(CLANGXX)

+  message(STATUS "Checking if clang++ works (required by vecmathlib)")
+
   setup_cache_var_name(CLANGXX_WORKS "${LLVM_HOST_TARGET}-${CLANGXX}-${LLVM_CLANGXX_VERSION}")

   if(NOT DEFINED ${CACHE_VAR_NAME})
     set(CLANGXX_WORKS 1)
-    message(STATUS "Checking if clang++ works (required by vecmathlib)")
     custom_try_compile_clangxx("namespace std { class type_info; } \n  #include <iostream>" "std::cout << \"Hello clang++ world!\" << std::endl;" COMPILE_RESULT)
     if(COMPILE_RESULT)
       set(CLANGXX_WORKS 0)
@@ -352,12 +353,13 @@
 if(NOT LLVM_CXXFLAGS MATCHES "-DNDEBUG")

   message(STATUS "Checking if LLVM is built with assertions")
-
-  custom_try_compile_clangxx("#include <llvm/Support/Debug.h>" "llvm::DebugFlag=true;" COMPILE_RESULT "-UNDEBUG")
-  if(NOT COMPILE_RESULT)
+  separate_arguments(_FLAGS UNIX_COMMAND "${LLVM_CXXFLAGS}")
+  custom_try_compile_clangxx("#include <llvm/Support/Debug.h>" "llvm::DebugFlag=true;" COMPILE_RESULT ${_FLAGS} "-UNDEBUG")
+  if(COMPILE_RESULT)
     message(STATUS "no assertions... adding -DNDEBUG")
     set(LLVM_CXXFLAGS "${LLVM_CXXFLAGS} -DNDEBUG")
   endif()
+  unset(_FLAGS)

 endif()


cmake(java): Fix maven usage

cmake(java): Fix maven usage

--- cmake/java.cmake
+++ cmake/java.cmake
@@ -52,6 +52,14 @@
 find_package(Java 1.8 REQUIRED COMPONENTS Development)
 find_package(JNI REQUIRED)

+# Find maven
+find_program(MAVEN_EXECUTABLE mvn)
+if(NOT MAVEN_EXECUTABLE)
+  message(FATAL_ERROR "Check for maven Program: not found")
+else()
+  message(STATUS "Found Maven: ${MAVEN_EXECUTABLE}")
+endif()
+
 # CMake will remove all '-D' prefix (i.e. -DUSE_FOO become USE_FOO)
 #get_target_property(FLAGS ortools::ortools COMPILE_DEFINITIONS)
 set(FLAGS -DUSE_BOP -DUSE_GLOP -DABSL_MUST_USE_RESULT)
@@ -104,11 +112,9 @@
   DEPENDS
     ortools::ortools
     Java${PROJECT_NAME}_proto
+    jniortools
     java/pom.xml
-  COMMAND ${CMAKE_COMMAND} -E remove_directory com
-  COMMAND ${Java_JAVAC_EXECUTABLE} pom.xml
-  BYPRODUCTS
-    java
+  COMMAND ${MAVEN_EXECUTABLE} package
   WORKING_DIRECTORY java
   )


Squashed 'CMake/Basis/' changes from 030ecb9..93d4837

93d4837 #506 fix: Show error message when BASIS_TEST_LIBRARY or BASIS_TEST_MAIN_LIBRARY not set

git-subtree-dir: CMake/Basis
git-subtree-split: 93d48378068217bacd45ae56c5e877b09f78ffd8

--- BasisTest.cmake
+++ BasisTest.cmake
@@ -534,9 +534,26 @@
       endif ()
       if (LANGUAGE MATCHES "CXX")
         if (NOT ARGN_NO_DEFAULT_MAIN)
-          list (APPEND ARGN_LINK_DEPENDS "${BASIS_TEST_MAIN_LIBRARY}")
+          if (BASIS_TEST_MAIN_LIBRARY)
+            list (APPEND ARGN_LINK_DEPENDS "${BASIS_TEST_MAIN_LIBRARY}")
+          else ()
+            message (FATAL_ERROR "Test ${TEST_NAME} added as UNITTEST without NO_DEFAULT_MAIN option,"
+                                 " but BASIS_TEST_MAIN_LIBRARY not set. This library is part of the"
+                                 " CMake BASIS installation. When you are using the CMake BASIS Modules"
+                                 " without CMake BASIS installation, add GTest to TEST_DEPENDS and"
+                                 " set BASIS_TEST_MAIN_LIBRARY to the value of GTEST_MAIN_LIBRARY"
+                                 " before using the basis_add_test command.")
+          endif ()
         endif ()
-        list (APPEND ARGN_LINK_DEPENDS "${BASIS_TEST_LIBRARY}")
+        if (BASIS_TEST_LIBRARY)
+          list (APPEND ARGN_LINK_DEPENDS "${BASIS_TEST_LIBRARY}")
+        else ()
+         message (FATAL_ERROR "Test ${TEST_NAME} added as UNITTEST, but BASIS_TEST_LIBRARY not set."
+                              " This library is part of the CMake BASIS installation. When you are"
+                              " using the CMake BASIS Modules without CMake BASIS installation,"
+                              " add GTest to TEST_DEPENDS and set BASIS_TEST_LIBRARY to the value"
+                              " of GTEST_LIBRARY before using the basis_add_test command.")
+        endif ()
       endif ()
     endif ()


Sometimes the length of NUMPY_VALUES is longer than 2.  Closes #104

--- FindNumPy.cmake
+++ FindNumPy.cmake
@@ -69,8 +69,9 @@
 # Convert the process output into a list
 string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES_OUTPUT})
 string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES})
-list(GET _NUMPY_VALUES 0 NUMPY_VERSION)
-list(GET _NUMPY_VALUES 1 NUMPY_INCLUDE_DIRS)
+# Just in case there is unexpected output from the Python command.
+list(GET _NUMPY_VALUES -2 NUMPY_VERSION)
+list(GET _NUMPY_VALUES -1 NUMPY_INCLUDE_DIRS)

 string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" _VER_CHECK "${NUMPY_VERSION}")
 if("${_VER_CHECK}" STREQUAL "")


Fix bug in CMake script that finds CAF

Fix bug in CMake script that finds CAF

--- cmake/FindCAF.cmake
+++ cmake/FindCAF.cmake
@@ -76,7 +76,8 @@
                      /sw/lib
                      ${CMAKE_INSTALL_PREFIX}/lib)
       mark_as_advanced(CAF_LIBRARY_${UPPERCOMP})
-      if ("${CAF_LIBRARY_${UPPERCOMP}}" STREQUAL "CAF_LIBRARY-NOTFOUND")
+      if ("${CAF_LIBRARY_${UPPERCOMP}}"
+          STREQUAL "CAF_LIBRARY_${UPPERCOMP}-NOTFOUND")
         set(CAF_${comp}_FOUND false)
       else ()
         set(CAF_LIBRARIES ${CAF_LIBRARIES} ${CAF_LIBRARY_${UPPERCOMP}})


updating packaging rules for rpms.

updating packaging rules for rpms.


add limit_of_tmp_allocation for CI (#15513)

test=develop

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -388,6 +388,7 @@
     endif()
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cpu_deterministic=true)
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_init_allocated_mem=true)
+    set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_limit_of_tmp_allocation=4294967296) # 4G
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cudnn_deterministic=true)
     # No unit test should exceed 10 minutes.
     set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 600)
@@ -460,6 +461,7 @@
     endif()
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cpu_deterministic=true)
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_init_allocated_mem=true)
+    set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_limit_of_tmp_allocation=4294967296) # 4G
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cudnn_deterministic=true)
   endif()
 endfunction(nv_test)
@@ -708,9 +710,10 @@
     set(oneValueArgs "")
     set(multiValueArgs SRCS DEPS ARGS ENVS)
     cmake_parse_arguments(py_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
     add_test(NAME ${TARGET_NAME}
              COMMAND ${CMAKE_COMMAND} -E env FLAGS_init_allocated_mem=true FLAGS_cudnn_deterministic=true
-             FLAGS_cpu_deterministic=true
+             FLAGS_cpu_deterministic=true FLAGS_limit_of_tmp_allocation=4294967296  # 4G
              PYTHONPATH=${PADDLE_BINARY_DIR}/python ${py_test_ENVS}
              ${PYTHON_EXECUTABLE} -u ${py_test_SRCS} ${py_test_ARGS}
              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})


fix python full coverage decrease issue (#31429)

* fix python full coverage decrease issue

* fix

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -797,7 +797,8 @@
     if(WITH_COVERAGE AND NOT (WITH_INCREMENTAL_COVERAGE AND "$ENV{PADDLE_GIT_DIFF_PY_FILE}" STREQUAL ""))
       add_test(NAME ${TARGET_NAME}
               COMMAND ${CMAKE_COMMAND} -E env FLAGS_init_allocated_mem=true FLAGS_cudnn_deterministic=true
-              FLAGS_cpu_deterministic=true ${py_test_ENVS}
+              FLAGS_cpu_deterministic=true
+              PYTHONPATH=${PADDLE_BINARY_DIR}/python ${py_test_ENVS}
               COVERAGE_FILE=${PADDLE_BINARY_DIR}/python-coverage.data
               ${PYTHON_EXECUTABLE} -m coverage run --branch -p ${py_test_SRCS} ${py_test_ARGS}
               WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})


kconfig: Change the format of KERNELVERSION

Change the format of KERNELVERSION as it exists in Kconfig to match
it's format elsewhere. Specifically, change from a string format
"1.10.3" to a numerical format.

This format change is a backwards-incompatible change. Any out-of-tree
Kconfig sources that were accessing KERNELVERSION with
$(KERNELVERSION) will need to be ported.

This change is to fix a bug. KERNELVERSION should have always been in
a numerical format. It should have been in a numerical format because;

KERNELVERSION is in a numerical format as a CMake variable and as a C
macro.

The purpose of having KERNELVERSION available in Kconfig is to have
configuration depend on the version, but this is only possible if it
exists in a numerical format[0].

[0] A string comparison of two semver strings does not always result
in a correct version comparison.

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

--- cmake/kconfig.cmake
+++ cmake/kconfig.cmake
@@ -21,7 +21,7 @@
 endif()

 set(ENV{srctree}            ${ZEPHYR_BASE})
-set(ENV{KERNELVERSION}      ${PROJECT_VERSION})
+set(ENV{KERNELVERSION}      ${KERNELVERSION})
 set(ENV{KCONFIG_CONFIG}     ${DOTCONFIG})

 # Set environment variables so that Kconfig can prune Kconfig source
@@ -34,7 +34,7 @@
   menuconfig
   ${CMAKE_COMMAND} -E env
   srctree=${ZEPHYR_BASE}
-  KERNELVERSION=${PROJECT_VERSION}
+  KERNELVERSION=${KERNELVERSION}
   KCONFIG_CONFIG=${DOTCONFIG}
   ARCH=$ENV{ARCH}
   BOARD_DIR=$ENV{BOARD_DIR}


CMake: fixing c++11 flag when compiling with ccache and g++

Former-commit-id: aff57fb6a77e954ed94c8acc2ff66334f7e166f5

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -201,8 +201,10 @@
 #        add_definitions(-std=c++11) # is also adding the flag to the C compiler...

         if(CMAKE_COMPILER_IS_GNUCXX)
-            execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
-            if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+
+            EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+
+            if(GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
                 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
             elseif(GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
                 message(WARNING "c++0x activated. g++ compiler with a version >= 4.7 is needed to fully support c++11.")


CMake: Tone down MSVC warning level because its crazy.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -62,6 +62,7 @@
 if (MSVC)
     set (DEST_BIN_DIR_CONFIG ${DEST_BIN_DIR_CONFIG}/$<CONFIG>)
     set (DEST_LIBRARY_DIR_CONFIG ${DEST_LIBRARY_DIR}/$<CONFIG>)
+    ucm_add_flags(/W1)
 endif ()
 if (WIN32)
     set (WINVER 0x0601)


Reorganize GUI installer components hierarchy

--- CMakeModules/CPackConfig.cmake
+++ CMakeModules/CPackConfig.cmake
@@ -130,29 +130,56 @@
 cpack_add_install_type(Extra DISPLAY_NAME "Extra")
 cpack_add_install_type(Runtime DISPLAY_NAME "Runtime")

+cpack_add_component_group(backends
+  DISPLAY_NAME "ArrayFire"
+  DESCRIPTION "ArrayFire Backend Libraries"
+  EXPANDED)
+cpack_add_component_group(cpu_backend
+  DISPLAY_NAME "CPU Backend"
+  DESCRIPTION "Libraries and dependencies of CPU Backend"
+  PARENT_GROUP backends)
+cpack_add_component_group(cuda_backend
+  DISPLAY_NAME "CUDA Backend"
+  DESCRIPTION "Libraries and dependencies of CUDA Backend"
+  PARENT_GROUP backends)
+cpack_add_component_group(opencl_backend
+  DISPLAY_NAME "OpenCL Backend"
+  DESCRIPTION "Libraries and dependencies of OpenCL Backend"
+  PARENT_GROUP backends)
+
 set(PACKAGE_MKL_DEPS OFF)

 if ((USE_CPU_MKL OR USE_OPENCL_MKL) AND TARGET MKL::MKL)
   set(PACKAGE_MKL_DEPS ON)
-  cpack_add_component(mkl_dependencies HIDDEN
+  cpack_add_component(mkl_dependencies
+    DISPLAY_NAME "Intel MKL"
+	DESCRIPTION "Intel Math Kernel Libraries for FFTW, BLAS and LAPACK routines"
+	GROUP backends
     INSTALL_TYPES Development Runtime)
 endif ()

 cpack_add_component(common_backend_dependencies
-  HIDDEN
-  INSTALL_TYPES Development Runtime)
-
-cpack_add_component(opencl_dependencies HIDDEN
+  DISPLAY_NAME "Dependencies"
+  DESCRIPTION "Libraries that are commonly required by all ArrayFire backends"
+  GROUP backends
+  INSTALL_TYPES Development Runtime)
+
+cpack_add_component(opencl_dependencies
+  DISPLAY_NAME "OpenCL Dependencies"
+  DESCRIPTION "Libraries required by OpenCL Backend"
+  GROUP opencl_backend
   INSTALL_TYPES Development Runtime)

 cpack_add_component(cuda_dependencies
   DISPLAY_NAME "CUDA Dependencies"
   DESCRIPTION "CUDA Runtime and libraries required for the CUDA backend."
+  GROUP cuda_backend
   INSTALL_TYPES Development Runtime)

 cpack_add_component(cuda
   DISPLAY_NAME "CUDA Backend"
   DESCRIPTION "This Backend allows you to take advantage of the CUDA enabled GPUs to run ArrayFire code. Please make sure you have CUDA toolkit installed or install CUDA dependencies component."
+  GROUP cuda_backend
   DEPENDS common_backend_dependencies cuda_dependencies
   INSTALL_TYPES Development Runtime)

@@ -171,22 +198,26 @@
 cpack_add_component(cpu
   DISPLAY_NAME "CPU Backend"
   DESCRIPTION "This Backend allows you to run ArrayFire code on native CPUs."
+  GROUP cpu_backend
   DEPENDS ${cpu_deps_comps}
   INSTALL_TYPES Development Runtime)

 cpack_add_component(opencl
   DISPLAY_NAME "OpenCL Backend"
   DESCRIPTION "This Backend allows you to take advantage of OpenCL capable GPUs to run ArrayFire code. Currently ArrayFire does not support OpenCL for the Intel CPU on OSX."
+  GROUP opencl_backend
   DEPENDS ${ocl_deps_comps}
   INSTALL_TYPES Development Runtime)

 cpack_add_component(unified
   DISPLAY_NAME "Unified Backend"
   DESCRIPTION "This Backend allows you to choose the platform(cpu, cuda, opencl) at runtime. This option requires at least one of the three backends to be installed to work properly."
+  GROUP backends
   INSTALL_TYPES Development Runtime)
 cpack_add_component(headers
   DISPLAY_NAME "C/C++ Headers"
   DESCRIPTION "Headers for the ArrayFire Libraries."
+  GROUP backends
   INSTALL_TYPES Development)
 cpack_add_component(cmake
   DISPLAY_NAME "CMake Support"
@@ -239,6 +270,10 @@
 get_native_path(bsd3_lic_path "${CMAKE_SOURCE_DIR}/LICENSES/BSD 3-Clause.txt")
 get_native_path(issl_lic_path "${CMAKE_SOURCE_DIR}/LICENSES/ISSL License.txt")

+cpack_ifw_configure_component_group(backends)
+cpack_ifw_configure_component_group(cpu_backend)
+cpack_ifw_configure_component_group(cuda_backend)
+cpack_ifw_configure_component_group(opencl_backend)
 if (PACKAGE_MKL_DEPS)
   cpack_ifw_configure_component(mkl_dependencies)
 endif ()


added vc14 (Visual Studio 2015) and boost 1.58 support in FindCOLLADA.cmake

--- CMakeModules/FindCOLLADA.cmake
+++ CMakeModules/FindCOLLADA.cmake
@@ -28,6 +28,8 @@
     SET(COLLADA_BUILDNAME "mac")
 ELSEIF(MINGW)
     SET(COLLADA_BUILDNAME "mingw")
+ELSEIF(MSVC14)
+    SET(COLLADA_BUILDNAME "vc14")
 ELSEIF(MSVC12)
     SET(COLLADA_BUILDNAME "vc12")
 ELSEIF(MSVC11)
@@ -250,7 +252,7 @@
     )

     FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
-        NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_55
+        NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_55 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_58
         PATHS
         ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
         ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -258,7 +260,7 @@
     )

     FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
-        NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_55
+        NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_55  libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_58
         PATHS
         ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
         ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -266,7 +268,7 @@
     )

     FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
-        NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BUILDNAME}0-mt libboost_system-${COLLADA_BUILDNAME}0-mt-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-1_55
+        NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BUILDNAME}0-mt libboost_system-${COLLADA_BUILDNAME}0-mt-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-1_55  libboost_system-${COLLADA_BUILDNAME}0-mt-1_58
         PATHS
         ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
         ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -274,7 +276,7 @@
     )

     FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
-        NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BUILDNAME}0-mt-gd libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_55
+        NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BUILDNAME}0-mt-gd libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_55  libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_58
         PATHS
         ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
         ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw


turned off clFFT examples in external project build

--- CMakeModules/build_clFFT.cmake
+++ CMakeModules/build_clFFT.cmake
@@ -26,6 +26,7 @@
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
     -DBUILD_SHARED_LIBS:BOOL=OFF
+    -DBUILD_EXAMPLES:BOOL=OFF
     -DBUILD_CLIENT:BOOL=OFF
     -DBUILD_TEST:BOOL=OFF
     -DSUFFIX_LIB:STRING=


Corrected regex

Corrected regex

--- cmake/FindHAL.cmake
+++ cmake/FindHAL.cmake
@@ -249,7 +249,7 @@
     find_file(PACKAGE_FILE NAMES package.xml PATHS ${STM32_CUBE_${FAMILY}_PATH})
     if(PACKAGE_FILE)
         file(READ ${PACKAGE_FILE} PACKAGE_FILE_CONTENT)
-        string(REGEX MATCH "PackDescription Release=\"FW.${FAMILY}.([0-9.])+\"( Patch=\"FW.${FAMILY}.([0-9.]+)\")?" VERSION_INFO ${PACKAGE_FILE_CONTENT})
+        string(REGEX MATCH "PackDescription Release=\"FW.${FAMILY}.([0-9.]+)\"( Patch=\"FW.${FAMILY}.([0-9.]+)\")?" VERSION_INFO ${PACKAGE_FILE_CONTENT})
         if(CMAKE_MATCH_3) # This is the "Patch" revision
             set(HAL_${COMP}_VERSION ${CMAKE_MATCH_3})
             set(HAL_VERSION ${CMAKE_MATCH_3})
@@ -383,4 +383,3 @@
     FOUND_VAR HAL_FOUND
     HANDLE_COMPONENTS
 )
-


FinICU fixes [ci skip]

FinICU fixes [ci skip]

--- cmake/FindICU.cmake
+++ cmake/FindICU.cmake
@@ -133,7 +133,8 @@
     PATHS ${ICU_ROOT_DIR}
     PATH_SUFFIXES ${_ICU_POSSIBLE_INCLUDE_SUFFIXES}
     DOC "ICU include directory"
-    NO_DEFAULT_PATH)
+    # NO_DEFAULT_PATH
+    )
 ELSE (ICU_ROOT_DIR)
   # Use default path search
   FIND_PATH (ICU_INCLUDE_DIR
@@ -155,7 +156,8 @@
     NAMES icuinfo
     PATHS ${ICU_ROOT_DIR}
     PATH_SUFFIXES ${_ICU_POSSIBLE_BIN_SUFFIXES}
-    NO_DEFAULT_PATH)
+    # NO_DEFAULT_PATH
+    )
 ELSE (ICU_ROOT_DIR)
   FIND_PROGRAM (ICU_BINARY_DIR
     NAMES icuinfo
@@ -189,36 +191,46 @@

 IF (NOT DEFINED ICU_CONFIG_EXECUTABLE)
   FIND_PROGRAM (ICU_CONFIG_EXECUTABLE icu-config PATH ${ICU_ROOT_DIR})
-
-  IF (ICU_CONFIG_EXECUTABLE)
-
-    EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE
-      _ICU_C_FLAGS)
-    EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE
-      _ICU_CXX_FLAGS)
-    EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cppflags OUTPUT_VARIABLE
-      _ICU_CPP_FLAGS)
-    EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --ldflags OUTPUT_VARIABLE
-      _ICU_LINK_FLAGS)
-    EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --ldflags-layout OUTPUT_VARIABLE
-      _ICU_LINK_LAYOUT_FLAGS)
-    EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --ldflags-icuio OUTPUT_VARIABLE
-      _ICU_LINK_IO_FLAGS)
-    EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cflags-dynamic
-      OUTPUT_VARIABLE _ICU_C_FLAGS_SHARED)
-    EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cxxflags-dynamic
-      OUTPUT_VARIABLE _ICU_CXX_FLAGS_SHARED)
-
-    IF (APPLE)
-      # Both are set to -dynamic which results in compilation errors: set to
-      # empty
-      SET (_ICU_C_FLAGS_SHARED "")
-      SET (_ICU_CXX_FLAGS_SHARED "")
-    ENDIF (APPLE)
-  ENDIF (ICU_CONFIG_EXECUTABLE)
-ENDIF (NOT DEFINED ICU_CONFIG_EXECUTABLE)
+ENDIF ()
+
+IF (ICU_CONFIG_EXECUTABLE)
+
+  EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE _ICU_C_FLAGS)
+  STRING(REGEX REPLACE "[\r\n]$" "" _ICU_C_FLAGS "${_ICU_C_FLAGS}")
+
+  EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE _ICU_CXX_FLAGS)
+  STRING(REGEX REPLACE "[\r\n]$" "" _ICU_CXX_FLAGS "${_ICU_CXX_FLAGS}")
+
+  EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cppflags OUTPUT_VARIABLE _ICU_CPP_FLAGS)
+  STRING(REGEX REPLACE "[\r\n]$" "" _ICU_CPP_FLAGS "${_ICU_CPP_FLAGS}")
+
+  EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --ldflags OUTPUT_VARIABLE _ICU_LINK_FLAGS)
+  STRING(REGEX REPLACE "[\r\n]$" "" _ICU_LINK_FLAGS "${_ICU_LINK_FLAGS}")
+
+  EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --ldflags-layout OUTPUT_VARIABLE _ICU_LINK_LAYOUT_FLAGS)
+  STRING(REGEX REPLACE "[\r\n]$" "" _ICU_LINK_LAYOUT_FLAGS "${_ICU_LINK_LAYOUT_FLAGS}")
+
+  EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --ldflags-icuio OUTPUT_VARIABLE _ICU_LINK_IO_FLAGS)
+  STRING(REGEX REPLACE "[\r\n]$" "" _ICU_LINK_IO_FLAGS "${_ICU_LINK_IO_FLAGS}")
+
+  EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cflags-dynamic OUTPUT_VARIABLE _ICU_C_FLAGS_SHARED)
+  STRING(REGEX REPLACE "[\r\n]$" "" _ICU_C_FLAGS_SHARED "${_ICU_C_FLAGS_SHARED}")
+
+  EXEC_PROGRAM (${ICU_CONFIG_EXECUTABLE} ARGS --cxxflags-dynamic OUTPUT_VARIABLE _ICU_CXX_FLAGS_SHARED)
+  STRING(REGEX REPLACE "[\r\n]$" "" _ICU_CXX_FLAGS_SHARED "${_ICU_CXX_FLAGS_SHARED}")
+
+  IF (APPLE)
+    # Both are set to -dynamic which results in compilation errors: set to
+    # empty
+    SET (_ICU_C_FLAGS_SHARED "")
+    SET (_ICU_CXX_FLAGS_SHARED "")
+  ENDIF (APPLE)
+ENDIF (ICU_CONFIG_EXECUTABLE)

 IF (ICU_INCLUDE_DIR)
+
+  MESSAGE(STATUS "... ICU_INCLUDE_DIR is ${ICU_INCLUDE_DIR}")
+
   # ICU 4 version numbers header
   SET (_ICU_VERSION_HEADER ${ICU_INCLUDE_DIR}/unicode/uvernum.h)

@@ -314,8 +326,10 @@
     IF (ICU_ROOT_DIR)
       FIND_LIBRARY (${_ICU_LIBRARY_BASE}_DEBUG
 	NAMES ${_ICU_COMPONENT_POSSIBLE_DEBUG_NAMES}
-	PATHS ${ICU_ROOT_DIR} PATH_SUFFIXES ${_ICU_POSSIBLE_LIB_SUFFIXES}
-	NO_DEFAULT_PATH)
+	PATHS ${ICU_ROOT_DIR}
+	PATH_SUFFIXES ${_ICU_POSSIBLE_LIB_SUFFIXES}
+	# NO_DEFAULT_PATH
+	)
     ELSE (ICU_ROOT_DIR)
       FIND_LIBRARY (${_ICU_LIBRARY_BASE}_DEBUG
 	NAMES ${_ICU_COMPONENT_POSSIBLE_DEBUG_NAMES}
@@ -327,7 +341,8 @@
       FIND_LIBRARY (${_ICU_LIBRARY_BASE}_RELEASE
 	NAMES ${_ICU_COMPONENT_POSSIBLE_RELEASE_NAMES}
 	PATHS ${ICU_ROOT_DIR} PATH_SUFFIXES ${_ICU_POSSIBLE_LIB_SUFFIXES}
-	NO_DEFAULT_PATH)
+	# NO_DEFAULT_PATH
+	)
     ELSE (ICU_ROOT_DIR)
       FIND_LIBRARY (${_ICU_LIBRARY_BASE}_RELEASE
 	NAMES ${_ICU_COMPONENT_POSSIBLE_RELEASE_NAMES}


unbreak

unbreak

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

--- cmake/FindQt4.cmake
+++ cmake/FindQt4.cmake
@@ -1128,9 +1128,6 @@
     # on OS X X11 may not be required
     IF (Q_WS_X11)
       FIND_PACKAGE(X11 REQUIRED)
-      IF(NOT X11_ICE_FOUND)
-        MESSAGE(FATAL_ERROR "X11 ICE library not found")
-      ENDIF(NOT X11_ICE_FOUND)
     ENDIF (Q_WS_X11)
     FIND_PACKAGE(Threads)
     SET(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})


Disable Jenkins leak checking for OpenSSL module

--- cmake/jenkins.cmake
+++ cmake/jenkins.cmake
@@ -12,3 +12,7 @@
   set(CMAKE_C_COMPILER "clang" CACHE STRING "C compiler option")
   set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "C++ compiler option")
 endif()
+# disable SSL when doing leak checking due to a known issue with the module
+if (${LABEL_EXPR} MATCHES "LeakSanitizer")
+  set(CAF_NO_OPENSSL yes CACHE BOOL "Configure OpenSSL module")
+endif()


Fix running the sync tests when building the Release configuration.

--- CMake/RealmCore.cmake
+++ CMake/RealmCore.cmake
@@ -361,7 +361,7 @@

     # Sync server library is built as part of the sync library build
     set(sync_server_library_debug ${sync_library_directory}/librealm-server${platform}-dbg.a)
-    set(sync_server_library_release ${sync_library_directory}/librealm$-server${platform}.a)
+    set(sync_server_library_release ${sync_library_directory}/librealm-server${platform}.a)
     set(sync_server_libraries ${sync_server_library_debug} ${sync_server_library_release})

     ExternalProject_Add_Step(realm-sync-lib ensure-server-libraries


additional debugging output

additional debugging output

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2396,6 +2396,9 @@
 				"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
 				"${_prefixFile}" "${_pchFile}" "${_hostFile}" _flags)
 			set_property (SOURCE ${_hostFile} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+			if (COTIRE_DEBUG)
+				message (STATUS "set_property: SOURCE ${_hostFile} APPEND_STRING COMPILE_FLAGS ${_flags}")
+			endif()
 			set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_OUTPUTS "${_pchFile}")
 			# make object file generated from host file depend on prefix header
 			set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
@@ -2447,6 +2450,9 @@
 				"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
 				"${_prefixFile}" "${_pchFile}" _flags)
 			set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+			if (COTIRE_DEBUG)
+				message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+			endif()
 			# make object files generated from source files depend on precompiled header
 			set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_pchFile}")
 		endif()
@@ -2460,6 +2466,9 @@
 				"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
 				"${_prefixFile}" "${_pchFile}" _flags)
 			set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+			if (COTIRE_DEBUG)
+				message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+			endif()
 			# mark sources as cotired to prevent them from being used in another cotired target
 			set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
 		endif()
@@ -2477,6 +2486,9 @@
 		"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
 		"${_prefixFile}" "${_pchFile}" _flags)
 	set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+	if (COTIRE_DEBUG)
+		message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+	endif()
 	# mark sources as cotired to prevent them from being used in another cotired target
 	set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
 	# make object files generated from source files depend on prefix header
@@ -2593,6 +2605,9 @@
 						"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
 						"${_prefixFile}" "${_pchFile}" _options)
 					set_property(TARGET ${_target} APPEND PROPERTY ${_options})
+					if (COTIRE_DEBUG)
+						message (STATUS "set_property: TARGET ${_target} APPEND PROPERTY ${_options}")
+					endif()
 				endif()
 			endif()
 		endif()


Use cppcheck_add_target_sources_to_unused_function_check.

This has the handy side effect of adding the target itself as a
dependency to the unused function check, which is useful since
some generators don't appear to support running the rules to
generate files which are out of the directory immediate directory
tree.

--- PolysquareCommon.cmake
+++ PolysquareCommon.cmake
@@ -259,10 +259,6 @@

         if (NOT CHECKS_NO_UNUSED_CHECK)

-            get_property (TARGET_SOURCES
-                          TARGET ${TARGET}
-                          PROPERTY SOURCES)
-
             # CHECK_GENERATED is on by default unless explicitly disabled.
             set (CHECK_GENERATED CHECK_GENERATED)
             if (CHECKS_NO_UNUSED_GENERATED_CHECK)
@@ -279,12 +275,18 @@
             endif (CHECKS_UNUSED_CHECK_GROUP)

             set (INCDIRS ${CHECKS_INTERNAL_INCLUDE_DIRS})
-            cppcheck_add_to_unused_function_check (${CHECK_NAME}
-                                                   SOURCES
-                                                   ${TARGET_SOURCES}
-                                                   INCLUDES
-                                                   ${INCDIRS}
-                                                   ${CHECK_GENERATED})
+            set (SOURCES ${TARGET_SOURCES})
+            set (CHECKGEN ${CHECK_GENERATED})
+
+            # Using this function will have the side-effect of requiring that
+            # TARGET is built before CHECK_NAME.
+            cppcheck_add_target_sources_to_unused_function_check (${TARGET}
+                                                                  ${CHECK_NAME}
+                                                                  SOURCES
+                                                                  ${SOURCES}
+                                                                  INCLUDES
+                                                                  ${INCDIRS}
+                                                                  ${CHECKGEN})

         endif (NOT CHECKS_NO_UNUSED_CHECK)


Removed port in data.kitware.com template

--- tests/TestData.cmake
+++ tests/TestData.cmake
@@ -14,7 +14,7 @@
 # set the default mirror
 set(ExternalData_URL_TEMPLATES
   "https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"
-  "https://data.kitware.com:443/api/v1/file/hashsum/%(algo)/%(hash)/download"
+  "https://data.kitware.com/api/v1/file/hashsum/%(algo)/%(hash)/download"
 )

 # Expose the absolute path to the data file source tree because


Libraries pthread and m are only needed on linux.

--- copasi/common.cmake
+++ copasi/common.cmake
@@ -46,7 +46,7 @@
 if (EXTRA_LIBS)
   SET(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${EXTRA_LIBS})
 else ()
-  if (${BLA_VENDOR} STREQUAL "Intel (MKL)")
+  if (UNIX AND ${BLA_VENDOR} STREQUAL "Intel (MKL)")
     SET(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} -lpthread -lm)
   endif()
 endif(EXTRA_LIBS)


remove kinect config - it is now in the mitk-mbi repository

--- CMake/PackageDepends/MITK_Kinect_Config.cmake
+++ CMake/PackageDepends/MITK_Kinect_Config.cmake
@@ -1,20 +0,0 @@
-#Begin Microsoft Kinect hardware
-OPTION(MITK_USE_MSKINECT "Enable support for MS Kinect" OFF)
-# only if PMD Camcube is enabled
-IF(MITK_USE_MSKINECT)
-  FIND_LIBRARY(MITK_MSKINECT_LIB CLNUIDevice DOC "Kinect access library.")
-  GET_FILENAME_COMPONENT(MITK_KINECT_SDK_DIR ${MITK_MSKINECT_LIB} PATH)
-  SET(MITK_KINECT_SDK_DIR ${MITK_KINECT_SDK_DIR}/..)
-  FIND_PATH(MITK_KINECT_INCLUDE_DIR CLNUIDevice.h ${MITK_KINECT_SDK_DIR}/Include DOC  "Include directory of Kinect-SDK.")
-
-  SET(INCLUDE_DIRS_INTERNAL ${INCLUDE_DIRS_INTERNAL} ${MITK_KINECT_INCLUDE_DIR})
-  SET(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${MITK_MSKINECT_LIB})
-  LIST(APPEND ALL_INCLUDE_DIRECTORIES ${MITK_KINECT_INCLUDE_DIR})
-  LIST(APPEND ALL_LIBRARIES ${MITK_MSKINECT_LIB})
-
-  IF(WIN32)
-  MITK_INSTALL(FILES ${MITK_KINECT_SDK_DIR}/Lib/CLNUIDevice.dll CONFIGURATIONS Release)
-  ENDIf(WIN32)
-ENDIF(MITK_USE_MSKINECT)
-#End Microsoft Kinect Hardware
-


COMP: Bump versions of CTK and VTK to match Slicer

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -30,7 +30,7 @@

 # Common Toolkit snapshot 2013-09-16 17:59:15
 set( CTK_URL ${github_protocol}://github.com/commontk/CTK.git )
-set( CTK_HASH_OR_TAG dcf7db15f2b43507395316dd680dba5999f886b4 )
+set( CTK_HASH_OR_TAG 00be8fae583173f338893659b9d8296ce9d5765b )

 # TubeTK Image Viewer snapshot 2013-08-21 06:23:25
 set( ImageViewer_URL
@@ -69,4 +69,4 @@

 # Visualization Toolkit (3D Slicer fork) snapshot 2013-08-20 06:54:45
 set( VTK_URL ${github_protocol}://github.com/Slicer/VTK.git )
-set( VTK_HASH_OR_TAG 6da2c7235b8de9d8663a62f3246198d6865ecfae )
+set( VTK_HASH_OR_TAG f387593148a8bc49cf46c1e27537674d5b779f49 )


BUG: Update ImageViewer to revert an ineffective fix to a cmake warning

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -34,7 +34,7 @@

 # TubeTK Image Viewer snapshot 2015-01-09
 set( ImageViewer_URL ${github_protocol}://github.com/KitwareMedical/ImageViewer.git )
-set( ImageViewer_HASH_OR_TAG c61ca8dac393ff58019fdeef561c5aac95406dee )
+set( ImageViewer_HASH_OR_TAG a87022f1e76953f7205a85cf0d4501a52ac63037 )

 # Insight Segmentation and Registration Toolkit
 set( ITK_URL ${github_protocol}://github.com/Slicer/ITK.git )


Set executable suffix in CMake

Set executable suffix in CMake

--- tools/cmake/app.cmake
+++ tools/cmake/app.cmake
@@ -19,3 +19,7 @@
 include(${MBED_PATH}/tools/cmake/profile.cmake)

 enable_language(C CXX ASM)
+
+# set executable suffix (has to be done after enabling languages)
+# Note: This is nice to have, but is also required because STM32Cube will only work on files with a .elf extension
+set(CMAKE_EXECUTABLE_SUFFIX .elf)


SVN_SILENT made messages (.desktop file)

--- vlc/vlc.desktop.cmake
+++ vlc/vlc.desktop.cmake
@@ -11,6 +11,7 @@

 Name=VLC
 Name[ca]=VLC
+Name[ca@valencia]=VLC
 Name[cs]=VLC
 Name[da]=VLC
 Name[es]=VLC
@@ -25,6 +26,7 @@

 Comment=Phonon VLC backend
 Comment[ca]=Dorsal del VLC pel Phonon
+Comment[ca@valencia]=Dorsal del VLC pel Phonon
 Comment[cs]=Podpůrná vrstva VLC
 Comment[da]=Phonon VLC-motor
 Comment[es]=Motor VLC para Phonon


Travis CI: trying to address an issue with Homebrew building Qt 5.5 with no rpath.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -1041,8 +1041,12 @@
         #       real path instead. So, we need to use both...

         GET_FILENAME_COMPONENT(REAL_QT_LIBRARY_DIR ${QT_LIBRARY_DIR} REALPATH)
+MESSAGE("---------[${PROJECT_TARGET}]---------")

         FOREACH(QT_LIBRARY ${OS_X_QT_LIBRARIES})
+MESSAGE("===> ${QT_LIBRARY}")
+MESSAGE("     ${QT_LIBRARY_DIR}/${QT_LIBRARY_FILENAME} ---> @rpath/${QT_LIBRARY_FILENAME}")
+MESSAGE("     ${REAL_QT_LIBRARY_DIR}/${QT_LIBRARY_FILENAME} ---> @rpath/${QT_LIBRARY_FILENAME}")
             SET(QT_LIBRARY_FILENAME ${QT_LIBRARY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_LIBRARY})

             ADD_CUSTOM_COMMAND(TARGET ${PROJECT_TARGET} POST_BUILD


Fix luajit flags with out of source compilation

--- cmake/luajit.cmake
+++ cmake/luajit.cmake
@@ -182,7 +182,7 @@
         add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/third_party/luajit/src/libluajit.a
             WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/third_party/luajit
             COMMAND cp -r ${PROJECT_SOURCE_DIR}/third_party/luajit/* .
-            COMMAND $(MAKE) clean
+            COMMAND $(MAKE) ${luajit_buildoptions} clean
             COMMAND $(MAKE) -C src ${luajit_buildoptions} libluajit.a
             DEPENDS ${PROJECT_BINARY_DIR}/CMakeCache.txt ${PROJECT_BINARY_DIR}/third_party/luajit
         )


removed GCC-6 from toolchains list

removed GCC-6 from toolchains list

--- src/cmake/toolchains/gcc6.cmake
+++ src/cmake/toolchains/gcc6.cmake
@@ -1,10 +0,0 @@
-SET(CMAKE_SYSTEM_NAME Linux)
-
-set(CMAKE_C_COMPILER   gcc-6)
-set(CMAKE_CXX_COMPILER g++-6)
-
-set(CMAKE_AR      "ar"      CACHE FILEPATH "ar")
-set(CMAKE_LINKER  "ld"      CACHE FILEPATH "ld")
-set(CMAKE_NM      "nm"      CACHE FILEPATH "nm")
-set(CMAKE_OBJDUMP "objdump" CACHE FILEPATH "objdump")
-set(CMAKE_RANLIB  "ranlib"  CACHE FILEPATH "ranlib")


cmake: write temporary files in CMakeFiles/

--- bootstrap/cmake/package-deb.cmake
+++ bootstrap/cmake/package-deb.cmake
@@ -18,9 +18,10 @@
 	set(PACKAGE_ARCH "${opts_ARCH}")
 	set(PACKAGE_SECTION "${opts_SECTION}")
 	set(PACKAGE_DEBS "")
-	configure_file("../distrib/deb-control-debian.template" "${__pkg_deb_tmp}/deb-control-${opts_COMPONENT}")
+	set(output_file "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${__pkg_deb_tmp}/deb-control-${opts_COMPONENT}")
+	configure_file("../distrib/deb-control-debian.template" "${output_file}")
 	install(
-		FILES "${__pkg_deb_tmp}/deb-control-${opts_COMPONENT}"
+		FILES "${output_file}"
 		DESTINATION "DEBIAN"
 		RENAME "control"
 		PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ


COMP: clarify GDAL status message during configuration

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -121,10 +121,10 @@
   CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
   OUTPUT_VARIABLE OUTPUT)
   IF(GDAL_HAS_TIFF)
-    MESSAGE(STATUS "  Testing if GDAL has tiff    -- yes")
+    MESSAGE(STATUS "  Testing if GDAL exposes tiff library symbols      -- yes")
     SET(TIFF_LIBRARY ${GDAL_LIBRARY})
   ELSE(GDAL_HAS_TIFF)
-    MESSAGE(STATUS "  Testing if GDAL has tiff    -- no")
+    MESSAGE(STATUS "  Testing if GDAL exposes tiff library symbols      -- no")
     FIND_LIBRARY(TIFF_LIBRARY NAMES tiff libtiff_i PATHS  ${OSGEO4W_LIB})
     MARK_AS_ADVANCED(TIFF_LIBRARY)
     IF (NOT TIFF_LIBRARY)
@@ -140,10 +140,10 @@
   CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GEOTIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
   OUTPUT_VARIABLE OUTPUT)
   IF(GDAL_HAS_GEOTIFF)
-    MESSAGE(STATUS "  Testing if GDAL has geotiff -- yes")
+    MESSAGE(STATUS "  Testing if GDAL exposes geotiff library symbols   -- yes")
     SET(GEOTIFF_LIBRARY ${GDAL_LIBRARY})
   ELSE(GDAL_HAS_GEOTIFF)
-    MESSAGE(STATUS "  Testing if GDAL has geotiff -- no")
+    MESSAGE(STATUS "  Testing if GDAL exposes geotiff library symbols   -- no")
     FIND_LIBRARY(GEOTIFF_LIBRARY NAMES geotiff geotiff_i PATHS ${OSGEO4W_LIB})
     MARK_AS_ADVANCED(GEOTIFF_LIBRARY)
     IF (NOT GEOTIFF_LIBRARY)
@@ -159,10 +159,10 @@
   CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${JPEG_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
   OUTPUT_VARIABLE OUTPUT)
   IF(GDAL_HAS_JPEG)
-    MESSAGE(STATUS "  Testing if GDAL has jpeg    -- yes")
+    MESSAGE(STATUS "  Testing if GDAL exposes jpeg library symbols      -- yes")
     SET(JPEG_LIBRARY ${GDAL_LIBRARY})
   ELSE(GDAL_HAS_JPEG)
-    MESSAGE(STATUS "  Testing if GDAL has jpeg    -- no")
+    MESSAGE(STATUS "  Testing if GDAL exposes jpeg library symbols      -- no")
     FIND_LIBRARY(JPEG_LIBRARY NAMES jpeg jpeg_i PATHS ${OSGEO4W_LIB})
     MARK_AS_ADVANCED(JPEG_LIBRARY)
     IF (NOT JPEG_LIBRARY)
@@ -178,10 +178,10 @@
   CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${OGR_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
   OUTPUT_VARIABLE OUTPUT)
   IF(GDAL_HAS_OGR)
-    MESSAGE(STATUS "  Testing if GDAL has OGR     -- yes")
+    MESSAGE(STATUS "  Testing if GDAL has OGR                           -- yes")
     SET(OGR_LIBRARY ${GDAL_LIBRARY})
   ELSE(GDAL_HAS_OGR)
-    MESSAGE(STATUS "  Testing if GDAL has OGR     -- no")
+    MESSAGE(STATUS "  Testing if GDAL has OGR                           -- no")
     MESSAGE(FATAL_ERROR "OGR MESSAGE: ${OUTPUT}")
     FIND_LIBRARY(OGR_LIBRARY ogr PATHS)
     MARK_AS_ADVANCED(OGR_LIBRARY)


fix: set CMAKE_ASM_COMPILER to -gcc because -as does not understand C defines

--- CMake/GNU-ARM-Toolchain.cmake
+++ CMake/GNU-ARM-Toolchain.cmake
@@ -6,7 +6,7 @@
 # which compilers to use for C and C++
 set(CMAKE_C_COMPILER arm-none-eabi-gcc)
 set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
-set(CMAKE_ASM_COMPILER arm-none-eabi-as)
+set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
 set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
 set(CMAKE_OBJDUMP arm-none-eabi-objdump)


Link updated test data

Link updated test data

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag 6af89bce)
+  set(revision_tag 65aaf5ca)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


COMP: Merge branch 'bug-18735-DeleteDisplayGeometry-Clean'

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

 if(BUILD_TESTING)
-  set(revision_tag c9ac0917) # first 8 characters of hash-tag
+  set(revision_tag 89ea8fb6) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


ENH: Update elastix (fixes #240)

ENH: Update elastix (fixes #240)

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -2,7 +2,7 @@
 file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )

 set( ELASTIX_GIT_REPOSITORY ${git_protocol}://github.com/SuperElastix/elastix )
-set( ELASTIX_GIT_TAG 1f504cf08cc73bc1c11ce2b29fcb3b8c14383cb6 )
+set( ELASTIX_GIT_TAG 143cdc99290a5013271c95d991725e0d49a69a51 )

 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}


disabling --fast-math addition on clang

disabling --fast-math addition on clang

--- cmake/CompilerOptimizations.cmake
+++ cmake/CompilerOptimizations.cmake
@@ -9,6 +9,11 @@
 endif()

+
+
+
+if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+
 check_c_compiler_flag(-ffast-math HAS_FAST_MATH)
 check_cxx_compiler_flag(-ffast-math HAS_CXX_FAST_MATH)
 if (HAS_FAST_MATH AND NOT MINGW)
@@ -17,9 +22,6 @@
 if (HAS_CXX_FAST_MATH AND NOT MINGW)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
 endif()
-
-
-if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

 check_c_compiler_flag(-mfpmath=sse HAS_FPMATH_SSE)
 check_cxx_compiler_flag(-mfpmath=sse HAS_CXX_FPMATH_SSE)


Remove warning flag unknown to GCC 7 from CXXFLAGS

Compiler message from GCC 7.1.0:

warning: unknown warning option '-Wno-noexcept-type';
did you mean '-Wno-encode-type'? [-Wunknown-warning-option]

The compiler does know about -Wnoexcept-type, however.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -147,7 +147,7 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion")
 elseif(CMAKE_COMPILER_IS_GNUCXX)
   if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-fallthrough -Wno-noexcept-type")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-fallthrough")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-fallthrough")
   endif()
 endif()


From Pere: CMAKE_CXX_COMPILER_ID is an internal variable and is not defined for Windows. Fixes Savannah #94209

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@44083 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -13,7 +13,7 @@

 #----Test if clang setup works----------------------------------------------------------------------
-if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   exec_program(${CMAKE_C_COMPILER} ARGS "-v" OUTPUT_VARIABLE _clang_version_info)
   string(REGEX REPLACE "^.*[ ]([0-9]+)\\.[0-9].*$" "\\1" CLANG_MAJOR "${_clang_version_info}")
   string(REGEX REPLACE "^.*[ ][0-9]+\\.([0-9]).*$" "\\1" CLANG_MINOR "${_clang_version_info}")


CMake: Add project_option_with_list()

CMake: Add project_option_with_list()

--- cmake/modules/ProjectOption.cmake
+++ cmake/modules/ProjectOption.cmake
@@ -8,3 +8,19 @@
         option(${OPTION_PREFIX}_${OPTION_NAME} "${OPTION_TEXT}" ${OPTION_VALUE})
     endif()
 endfunction()
+
+function(project_option_with_list OPTION_NAME OPTION_TEXT OPTION_VALUE OPTION_LIST_PLACEHOLDER)
+    string(TOUPPER "${PROJECT_NAME}" OPTION_PREFIX)
+    if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
+        set(OPTION_FULL_NAME "${OPTION_NAME}")
+    else()
+        set(OPTION_FULL_NAME "${OPTION_PREFIX}_${OPTION_NAME}")
+    endif()
+
+    set(${OPTION_FULL_NAME} "${OPTION_VALUE}" CACHE STRING "${OPTION_TEXT}")
+    set_property(CACHE "${OPTION_FULL_NAME}" PROPERTY STRINGS ${ARGN})
+
+    if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
+        set(${OPTION_PREFIX}_${OPTION_NAME} ${${OPTION_NAME}} PARENT_SCOPE)
+    endif()
+endfunction()


Added find_python_module(module) to detect the existence of Python modules

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -911,3 +911,28 @@
   endif()
 endfunction()

+#----------------------------------------------------------------------------
+# find_python_module(module [REQUIRED])
+#----------------------------------------------------------------------------
+function(find_python_module module)
+  string(TOUPPER ${module} module_upper)
+  if(NOT PY_${module_upper})
+    if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
+      set(${module}_FIND_REQUIRED TRUE)
+    endif()
+    # A module's location is usually a directory, but for binary modules
+    # it's a .so file.
+    execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
+      "import re, ${module}; print re.compile('/__init__.py.*').sub('',${module}.__file__)"
+      RESULT_VARIABLE _${module}_status
+      OUTPUT_VARIABLE _${module}_location
+      ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+    if(NOT _${module}_status)
+      set(PY_${module_upper} ${_${module}_location} CACHE STRING  "Location of Python module ${module}")
+    endif()
+  endif()
+  find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper})
+  set(PY_${module_upper}_FOUND ${PY_${module_upper}_FOUND} PARENT_SCOPE)
+endfunction()
+
+


Fix from Pere attempting to fix the mathtext issue with cmake on windows.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@46989 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -267,7 +267,7 @@
     message("Target ${library} already exists. Renaming target name to ${library}_new")
     set(library ${library}_new)
   endif()
-  if(WIN32 AND NOT ARG_DLLEXPORT)
+  if(WIN32 AND ARG_TYPE STREQUAL SHARED AND NOT ARG_DLLEXPORT)
     #---create a list of all the object files-----------------------------
     if(CMAKE_GENERATOR MATCHES "Visual Studio")
       foreach(src1 ${lib_srcs})


Use more meaningful name. Saves time debugging.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -246,28 +246,28 @@
   endif()
   #---Get the list of header files-------------------------
   set(headerfiles)
-  set(fullheaderfiles)
+  set(_list_of_header_dependencies)
   foreach(fp ${ARG_UNPARSED_ARGUMENTS})
     if(${fp} MATCHES "[*?]") # Is this header a globbing expression?
       file(GLOB files inc/${fp} ${fp})
       foreach(f ${files})
         if(NOT f MATCHES LinkDef) # skip LinkDefs from globbing result
           list(APPEND headerfiles ${f})
-          list(APPEND fullheaderfiles ${f})
+          list(APPEND _list_of_header_dependencies ${f})
         endif()
       endforeach()
     elseif(CMAKE_PROJECT_NAME STREQUAL ROOT AND
            EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${fp}) # only for ROOT project
       list(APPEND headerfiles ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
-      list(APPEND fullheaderfiles ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
+      list(APPEND _list_of_header_dependencies ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
     elseif(IS_ABSOLUTE ${fp})
       list(APPEND headerfiles ${fp})
-      list(APPEND fullheaderfiles ${fp})
+      list(APPEND _list_of_header_dependencies ${fp})
     else()
       find_file(headerFile ${fp} HINTS ${localinclude} ${incdirs})
       list(APPEND headerfiles ${fp})
       if(headerFile)
-        list(APPEND fullheaderfiles ${headerFile})
+        list(APPEND _list_of_header_dependencies ${headerFile})
       endif()
       unset(headerFile CACHE)
     endif()


libuv: Remove API 21+ requirement for Android

--- cmake/projects/libuv/hunter.cmake
+++ cmake/projects/libuv/hunter.cmake
@@ -52,10 +52,5 @@

 hunter_pick_scheme(DEFAULT url_sha1_cmake)

-if(ANDROID AND (CMAKE_SYSTEM_VERSION VERSION_LESS 21))
-  # https://stackoverflow.com/a/32638557/2288008
-  hunter_report_broken_package("API 21+ required for 'pthread_atfork'")
-endif()
-
 hunter_cacheable(libuv)
 hunter_download(PACKAGE_NAME libuv)


ENH: Improved process for remote module fetching

Added an environment variable so that developers can try new revisions
without editing the remote module description file.

For example, the HEAD of the remote module can be tested by executing
these git commands in the remote module checkout:

git pull

export RemoteGitTag=`git rev-parse HEAD`

--- Remote/WikiExamples.remote.cmake
+++ Remote/WikiExamples.remote.cmake
@@ -1,11 +1,20 @@
 #
 # VTK WikiExamples
 #
+
+# If the environement var RemoteGitTag exists, use it
+if (NOT DEFINED ENV{RemoteGitTag})
+  # February 17, 2016
+  # Qt5 fixes
+  set(GIT_TAG 184ef64f241c53356a8a6c3852dfb2ec18691d49)
+else()
+  set(GIT_TAG $ENV{RemoteGitTag})
+endif()

 vtk_fetch_module(WikiExamples
   "A collection of examples that illustrate how to use VTK."
   GIT_REPOSITORY https://github.com/lorensen/VTKWikiExamples.git
   # February 14, 2016
   # New baselines
-  GIT_TAG e41208c9abe2cba0703a49638ca0da03e7f0ee7f
+  GIT_TAG ${GIT_TAG}
   )


remove patch command from uriparser

remove patch command from uriparser

--- cmake/External_uriparser.cmake
+++ cmake/External_uriparser.cmake
@@ -4,8 +4,11 @@
    URL_MD5 c5cf6b3941d887deb7defc2a86c40f1d
    BINARY_DIR ${CMAKE_BINARY_DIR}/URIPARSER/build
    DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-   PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/URIPARSER/CMakeLists.txt ${CMAKE_BINARY_DIR}/URIPARSER/src/URIPARSER/
-   CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/URIPARSER/src/URIPARSER/configure --disable-test --disable-doc --prefix=${INSTALL_DIR}/URIPARSER)
+   CONFIGURE_COMMAND
+   ${CMAKE_BINARY_DIR}/URIPARSER/src/URIPARSER/configure
+   --disable-test
+   --disable-doc
+   --prefix=${INSTALL_DIR}/URIPARSER)

  include_project_vars(URIPARSER "liburiparser.so")


cmake: HextEnableWarnings: set -Wstrict-overflow to default warning level to avoid false positives

--- cmake/HextEnableWarnings.cmake
+++ cmake/HextEnableWarnings.cmake
@@ -21,7 +21,7 @@
     "-Woverloaded-virtual" "-Wpacked" "-Wparentheses" "-Wpointer-arith"
     "-Wredundant-decls" "-Wreturn-type" "-Wsequence-point" "-Wshadow"
     "-Wsign-compare" "-Wsign-promo" "-Wstack-protector" "-Wstrict-aliasing=2"
-    "-Wstrict-null-sentinel" "-Wstrict-overflow=5" "-Wswitch"
+    "-Wstrict-null-sentinel" "-Wstrict-overflow" "-Wswitch"
     "-Wtrigraphs" "-Wundef" "-Wuninitialized" "-Wunknown-pragmas"
     "-Wunreachable-code" "-Wunused" "-Wunsafe-loop-optimizations"
     "-Wunused-function" "-Wunused-label" "-Wunused-parameter" "-Wunused-value"


cmake: fix python detection

cmake: fix python detection

--- cmake/OpenCVDetectPython.cmake
+++ cmake/OpenCVDetectPython.cmake
@@ -26,7 +26,7 @@
          libs_found libs_version_string libraries library debug_libraries
          debug_library include_path include_dir include_dir2 packages_path
          numpy_include_dirs numpy_version)
-
+if(NOT ${found})
   ocv_check_environment_variables(${executable})
   if(${executable})
     set(PYTHON_EXECUTABLE "${${executable}}")
@@ -197,23 +197,24 @@
   endif()

   # Export return values
-  set(${found} "${_found}" PARENT_SCOPE)
+  set(${found} "${_found}" CACHE INTERNAL "")
   set(${executable} "${_executable}" CACHE FILEPATH "Path to Python interpretor")
-  set(${version_string} "${_version_string}" PARENT_SCOPE)
-  set(${version_major} "${_version_major}" PARENT_SCOPE)
-  set(${version_minor} "${_version_minor}" PARENT_SCOPE)
-  set(${libs_found} "${_libs_found}" PARENT_SCOPE)
-  set(${libs_version_string} "${_libs_version_string}" PARENT_SCOPE)
-  set(${libraries} "${_libraries}" PARENT_SCOPE)
+  set(${version_string} "${_version_string}" CACHE INTERNAL "")
+  set(${version_major} "${_version_major}" CACHE INTERNAL "")
+  set(${version_minor} "${_version_minor}" CACHE INTERNAL "")
+  set(${libs_found} "${_libs_found}" CACHE INTERNAL "")
+  set(${libs_version_string} "${_libs_version_string}" CACHE INTERNAL "")
+  set(${libraries} "${_libraries}" CACHE INTERNAL "Python libraries")
   set(${library} "${_library}" CACHE FILEPATH "Path to Python library")
-  set(${debug_libraries} "${_debug_libraries}" PARENT_SCOPE)
+  set(${debug_libraries} "${_debug_libraries}" CACHE INTERNAL "")
   set(${debug_library} "${_debug_library}" CACHE FILEPATH "Path to Python debug")
-  set(${include_path} "${_include_path}" PARENT_SCOPE)
+  set(${include_path} "${_include_path}" CACHE INTERNAL "")
   set(${include_dir} "${_include_dir}" CACHE PATH "Python include dir")
   set(${include_dir2} "${_include_dir2}" CACHE PATH "Python include dir 2")
   set(${packages_path} "${_packages_path}" CACHE PATH "Where to install the python packages.")
   set(${numpy_include_dirs} ${_numpy_include_dirs} CACHE PATH "Path to numpy headers")
-  set(${numpy_version} "${_numpy_version}" PARENT_SCOPE)
+  set(${numpy_version} "${_numpy_version}" CACHE INTERNAL "")
+endif()
 endfunction(find_python)

 find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR


ApplyPatches: Fix finding of patch.exe if installed in user folder

Reported-by: Andras Lasso <bf5e972943f0e90adb0d9bfa939dcc72ce410bec@queensu.ca>

--- cmake/PythonApplyPatches.cmake
+++ cmake/PythonApplyPatches.cmake
@@ -8,6 +8,10 @@
         "$ENV{ProgramFiles${_x86}}/GnuWin32/bin"
         "$ENV{ProgramFiles}/Git/bin"
         "$ENV{ProgramFiles${_x86}}/Git/bin"
+        "$ENV{LOCALAPPDATA}/Programs/Git/bin"
+        "$ENV{LOCALAPPDATA}/Programs/Git/usr/bin"
+        "$ENV{APPDATA}/Programs/Git/bin"
+        "$ENV{APPDATA}/Programs/Git/usr/bin"
   )
 if(NOT PATCH_EXECUTABLE)
   message(FATAL_ERROR "Could NOT find patch (missing: PATCH_EXECUTABLE)")


Updated python module correcting setting of libs

--- cmake/TestForPythonEmbed.cmake
+++ cmake/TestForPythonEmbed.cmake
@@ -4,7 +4,7 @@
 #  PYTHON_EMBEDABLE - True if embedable

 find_package(PythonLibs)
-# Some systems require these libs to be explicitly be added for the test
+# Some systems require these libs to be added explicitly
 find_library(DL dl)
 find_library(MATH m)
 find_library(PTHREAD pthread)
@@ -13,10 +13,9 @@
 if(PYTHONLIBS_FOUND)
 	MESSAGE(STATUS "Checking if Python is Embedable")
 	SET(CMAKE_REQUIRED_INCLUDES ${PYTHON_INCLUDE_PATH})
-	# If on Slackware, uncomment the next line to fix a missing library issue
-	# As of 11/22/2009 this is needed for Slackware 13
-	# SET(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} -ldl -lm -lpthread -lutil)
-	SET(CMAKE_REQUIRED_LIBRARIES ${PYTHON_LIBRARIES} ${DL} ${MATH} ${PTHREAD} ${UTIL})
+	# ensure the libs are included with python
+	SET(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} ${DL} ${MATH} ${PTHREAD} ${UTIL})
+	SET(CMAKE_REQUIRED_LIBRARIES ${PYTHON_LIBRARIES})
 	CHECK_C_SOURCE_COMPILES(
 "#include <Python.h>
 int main(int argc, char *argv[]) {


Updated FindMatlab.cmake.

Updated FindMatlab.cmake.

--- cmake/modules/FindMatlab.cmake
+++ cmake/modules/FindMatlab.cmake
@@ -77,40 +77,18 @@
             NO_DEFAULT_PATH)
     endforeach ()

-    # HACK: find_library doesnt seem to be able to find versioned libraries... :(
-    if (NOT APPLE)
-        find_library(MATLAB_QT_QTCORE_LIBRARY libQtCore.so.4
+    # HACK: find_library doesn't seem to be able to find versioned libraries... :(
+    set(MATLAB_QT_LIBS QtCore QtXml QtGui)
+    foreach (lib ${LIB_NAMES})
+        string(TOUPPER ${lib} _LIB)
+        find_file(MATLAB_QT_${_LIB}_LIBRARY ${lib}
+            NAMES lib${lib}.so lib${lib}.so.4 lib${lib}.dylib lib${lib}.dylib.4
             HINTS ${MATLAB_ROOT_HINTS}
             PATHS ${MATLAB_ROOT_PATHS}
             PATH_SUFFIXES ${MATLAB_LIB_SUFFIXES}
             NO_DEFAULT_PATH)
-        find_library(MATLAB_QT_QTGUI_LIBRARY libQtGui.so.4
-            HINTS ${MATLAB_ROOT_HINTS}
-            PATHS ${MATLAB_ROOT_PATHS}
-            PATH_SUFFIXES ${MATLAB_LIB_SUFFIXES}
-            NO_DEFAULT_PATH)
-        find_library(MATLAB_QT_QTXML_LIBRARY libQtXml.so.4
-            HINTS ${MATLAB_ROOT_HINTS}
-            PATHS ${MATLAB_ROOT_PATHS}
-            PATH_SUFFIXES ${MATLAB_LIB_SUFFIXES}
-            NO_DEFAULT_PATH)
-    else ()
-        find_library(MATLAB_QT_QTCORE_LIBRARY QtCore
-            HINTS ${MATLAB_ROOT_HINTS}
-            PATHS ${MATLAB_ROOT_PATHS}
-            PATH_SUFFIXES ${MATLAB_LIB_SUFFIXES}
-            NO_DEFAULT_PATH)
-        find_library(MATLAB_QT_QTGUI_LIBRARY QtGui
-            HINTS ${MATLAB_ROOT_HINTS}
-            PATHS ${MATLAB_ROOT_PATHS}
-            PATH_SUFFIXES ${MATLAB_LIB_SUFFIXES}
-            NO_DEFAULT_PATH)
-        find_library(MATLAB_QT_QTXML_LIBRARY QtXml
-            HINTS ${MATLAB_ROOT_HINTS}
-            PATHS ${MATLAB_ROOT_PATHS}
-            PATH_SUFFIXES ${MATLAB_LIB_SUFFIXES}
-            NO_DEFAULT_PATH)
-    endif()
+    endforeach ()
+
     find_path(MATLAB_INCLUDE_DIR "mex.h"
         HINTS ${MATLAB_ROOT_HINTS}
         PATHS ${MATLAB_ROOT_PATHS}
@@ -136,10 +114,7 @@
 endif(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES AND MATLAB_BINARY_DIR)

 if (MATLAB_FOUND)
-    message(STATUS "Found MATLAB")
-    message(STATUS "  * INCLUDE_DIR: ${MATLAB_INCLUDE_DIR}")
-    message(STATUS "  * LIBRARIES: ${MATLAB_LIBRARIES}")
-    message(STATUS "  * BINARY_DIR: ${MATLAB_BINARY_DIR}")
+    message(STATUS "MATLAB_LIBRARIES: ${MATLAB_LIBRARIES}")
 endif ()

 mark_as_advanced(


PARQUET-939: Accept Thrift_HOME CMake variable like FindSnappy does as Snappy_HOME

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

Closes #285 from kou/accept-thrift-home-cmake-variable and squashes the following commits:

4d317e4 [Kouhei Sutou] Accept Thrift_HOME CMake variable like FindSnappy does as Snappy_HOME

--- cmake_modules/FindThrift.cmake
+++ cmake_modules/FindThrift.cmake
@@ -13,6 +13,14 @@
 # limitations under the License.

 # - Find Thrift (a cross platform RPC lib/tool)
+#
+# Variables used by this module, they can change the default behaviour and need
+# to be set before calling find_package:
+#
+#  Thrift_HOME - When set, this path is inspected instead of standard library
+#                locations as the root of the Thrift installation.
+#                The environment variable THRIFT_HOME overrides this variable.
+#
 # This module defines
 #  THRIFT_VERSION, version string of ant if found
 #  THRIFT_INCLUDE_DIR, where to find THRIFT headers
@@ -21,35 +29,48 @@
 #  THRIFT_FOUND, If false, do not try to use ant

 # prefer the thrift version supplied in THRIFT_HOME
+if( NOT "$ENV{THRIFT_HOME}" STREQUAL "")
+    file( TO_CMAKE_PATH "$ENV{THRIFT_HOME}" _native_path )
+    list( APPEND _thrift_roots ${_native_path} )
+elseif ( Thrift_HOME )
+    list( APPEND _thrift_roots ${Thrift_HOME} )
+endif()
+
 message(STATUS "THRIFT_HOME: $ENV{THRIFT_HOME}")
 find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h HINTS
-  $ENV{THRIFT_HOME}/include/
+  ${_thrift_roots}
+  NO_DEFAULT_PATH
+  PATH_SUFFIXES "include"
+)
+
+find_path(THRIFT_CONTRIB_DIR share/fb303/if/fb303.thrift HINTS
+  ${_thrift_roots}
   NO_DEFAULT_PATH
 )

-find_path(THRIFT_CONTRIB_DIR share/fb303/if/fb303.thrift HINTS
-  $ENV{THRIFT_HOME}
+find_library(THRIFT_STATIC_LIB
+  ${CMAKE_STATIC_LIBRARY_PREFIX}thrift${CMAKE_STATIC_LIBRARY_SUFFIX}
+  HINTS ${_thrift_roots}
   NO_DEFAULT_PATH
+  PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib"
 )

-set(THRIFT_LIB_PATHS
-  $ENV{THRIFT_HOME}/lib
-  NO_DEFAULT_PATH)
+find_library(THRIFT_LIB NAMES
+  ${CMAKE_SHARED_LIBRARY_PREFIX}thrift${CMAKE_SHARED_LIBRARY_SUFFIX}
+  HINTS ${_thrift_roots}
+  NO_DEFAULT_PATH
+  PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib"
+)

-find_path(THRIFT_STATIC_LIB_PATH libthrift.a PATHS ${THRIFT_LIB_PATHS})
-
-# prefer the thrift version supplied in THRIFT_HOME
-find_library(THRIFT_LIB NAMES thrift HINTS ${THRIFT_LIB_PATHS})
-
-find_program(THRIFT_COMPILER thrift
-  $ENV{THRIFT_HOME}/bin
+find_program(THRIFT_COMPILER thrift HINTS
+  ${_thrift_roots}
   NO_DEFAULT_PATH
+  PATH_SUFFIXES "bin"
 )

 if (THRIFT_LIB)
   set(THRIFT_FOUND TRUE)
   set(THRIFT_LIBS ${THRIFT_LIB})
-  set(THRIFT_STATIC_LIB ${THRIFT_STATIC_LIB_PATH}/libthrift.a)
   exec_program(${THRIFT_COMPILER}
     ARGS -version OUTPUT_VARIABLE THRIFT_VERSION RETURN_VALUE THRIFT_RETURN)
 else ()


ENH: Checking KWStyle version

ENH: Checking KWStyle version

--- Utilities/KWStyle/KWStyle.cmake
+++ Utilities/KWStyle/KWStyle.cmake
@@ -1,9 +1,13 @@
 OPTION(ITK_USE_KWSTYLE "Enable the use of KWStyle for checking coding style." OFF)
+IF(ITK_USE_KWSTYLE)

-IF( ITK_USE_KWSTYLE )
+# Set the required KWStyle version
+SET(KWSTYLE_REQ_MAJOR 1)
+SET(KWSTYLE_REQ_MINOR 0)
+SET(KWSTYLE_REQ_PATCH 1)

-OPTION(KWSTYLE_USE_VIM_FORMAT "Set KWStyle to generate errors with a VIM-compatible format." OFF)
-OPTION(KWSTYLE_USE_MSVC_FORMAT "Set KWStyle to generate errors with a VisualStudio-compatible format." OFF)
+#OPTION(KWSTYLE_USE_VIM_FORMAT "Set KWStyle to generate errors with a VIM-compatible format." OFF)
+#OPTION(KWSTYLE_USE_MSVC_FORMAT "Set KWStyle to generate errors with a VisualStudio-compatible format." OFF)

 FIND_PROGRAM(KWSTYLE_EXECUTABLE
 NAMES KWStyle
@@ -11,6 +15,40 @@
 /usr/local/bin
 )

+IF(KWSTYLE_EXECUTABLE)
+
+  EXECUTE_PROCESS(
+  COMMAND ${KWSTYLE_EXECUTABLE} -version
+  OUTPUT_VARIABLE KWSTYLE_VERSION_TEXT
+  )
+
+string(STRIP ${KWSTYLE_VERSION_TEXT} KWSTYLE_VERSION_TEXT)
+
+IF(${KWSTYLE_VERSION_TEXT} STREQUAL "Version: Not defined")
+  MESSAGE("This project requires a newer version of KWStyle. Please upgrade the KWStyle executable.")
+ELSE(${KWSTYLE_VERSION_TEXT} STREQUAL "Version: Not defined")
+
+  string(LENGTH ${KWSTYLE_VERSION_TEXT} KWSTYLE_VERSION_LENGTH)
+  math(EXPR KWSTYLE_VERSION_FINAL_LENGTH "${KWSTYLE_VERSION_LENGTH}-9")
+  string(SUBSTRING ${KWSTYLE_VERSION_TEXT} 9 ${KWSTYLE_VERSION_FINAL_LENGTH} KWSTYLE_VERSION)
+
+  # now parse the parts of the user given version string into variables
+  STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" KWSTYLE_MAJOR_VERSION "${KWSTYLE_VERSION}")
+  STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" KWSTYLE_MINOR_VERSION "${KWSTYLE_VERSION}")
+  STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" KWSTYLE_PATCH_VERSION "${KWSTYLE_VERSION}")
+
+  MATH(EXPR KWSTYLE_REQ_VERSION "${KWSTYLE_REQ_MAJOR}*10000 + ${KWSTYLE_REQ_MINOR}*100 + ${KWSTYLE_REQ_PATCH}")
+  MATH(EXPR KWSTYLE_LONG_VERSION "${KWSTYLE_MAJOR_VERSION}*10000 + ${KWSTYLE_MINOR_VERSION}*100 + ${KWSTYLE_PATCH_VERSION}")
+
+  # Set the minimum require version for batchmake
+  IF(KWSTYLE_LONG_VERSION LESS KWSTYLE_REQ_VERSION)
+    MESSAGE(FATAL_ERROR "This project requires a newer version of KWStyle. Please upgrade the KWStyle executable.")
+  ELSE(KWSTYLE_LONG_VERSION LESS KWSTYLE_REQ_VERSION)
+    SET(KWSTYLE_FOUND 1)
+  ENDIF(KWSTYLE_LONG_VERSION LESS KWSTYLE_REQ_VERSION)
+ENDIF(${KWSTYLE_VERSION_TEXT} STREQUAL "Version: Not defined")
+
+IF(KWSTYLE_FOUND)
 #
 #  Define file names
 #
@@ -47,6 +85,15 @@
 #
 SET(KWSTYLE_EDITOR_FORMAT " ")
 SET(KWSTYLE_EDITOR_FORMAT "")
+
+IF(${CMAKE_CXX_COMPILER} MATCHES "cl.exe$")
+  SET(KWSTYLE_USE_MSVC_FORMAT 1)
+ENDIF(${CMAKE_CXX_COMPILER} MATCHES "cl.exe$")
+
+IF(${CMAKE_C_COMPILER} MATCHES "g[cx][cx]$")
+  SET(KWSTYLE_USE_VIM_FORMAT 1)
+ENDIF(${CMAKE_C_COMPILER} MATCHES "g[cx][cx]$")
+
 IF(KWSTYLE_USE_VIM_FORMAT)
   SET(KWSTYLE_EDITOR_FORMAT -vim)
 ENDIF(KWSTYLE_USE_VIM_FORMAT)
@@ -73,7 +120,7 @@
   )

 ADD_CUSTOM_COMMAND(
-  OUTPUT ${ITK_BINARY_DIR}/KWStyleCodeReport.txt
+  OUTPUT  ${ITK_BINARY_DIR}/KWStyleCodeReport.txt
   COMMAND ${KWSTYLE_EXECUTABLE}
   ARGS    ${KWSTYLE_ARGUMENTS_CODE}
   COMMENT "Coding Style Checker"
@@ -85,4 +132,6 @@
 ADD_TEST(KWStyleReviewTest ${KWSTYLE_EXECUTABLE} ${KWSTYLE_ARGUMENTS_REVIEW})
 ADD_TEST(KWStyleCodeTest   ${KWSTYLE_EXECUTABLE} ${KWSTYLE_ARGUMENTS_CODE})

-ENDIF( ITK_USE_KWSTYLE )
+ENDIF(KWSTYLE_FOUND)
+ENDIF(KWSTYLE_EXECUTABLE)
+ENDIF(ITK_USE_KWSTYLE)


Add a copyright

Add a copyright

svn path=/trunk/KDE/kdepim/; revision=1000548

--- akonadi/akonadi-version.h.cmake
+++ akonadi/akonadi-version.h.cmake
@@ -1,3 +1,22 @@
+/*
+    This file is part of kdepim.
+    Copyright (C) 2009 Christophe Giboudeaux  <cgiboudeaux@gmail.com>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
 #ifndef AKONADI_VERSION_H
 #define AKONADI_VERSION_H


freetype2 dependency for fontconfig

freetype2 dependency for fontconfig

--- fontconfig.cmake
+++ fontconfig.cmake
@@ -11,6 +11,7 @@
   include (BuildSupport)

   include (libxml2)
+  include (freetype2)

   external_source(
     fontconfig
@@ -24,7 +25,7 @@
   message("Installing ${fontconfig_NAME} into FlyEM build area ${BUILDEM_DIR} ...")
   ExternalProject_Add(
     ${fontconfig_NAME}
-    DEPENDS             ${libxml2_NAME}
+    DEPENDS             ${libxml2_NAME} ${freetype2_NAME}
     PREFIX              ${BUILDEM_DIR}
     URL                 ${fontconfig_URL}
     URL_MD5             ${fontconfig_MD5}


Add dummy target for SWIG when we are using prebuilt Windows binary.

--- external/Swig.cmake
+++ external/Swig.cmake
@@ -28,6 +28,7 @@
 if (NOT SWIG_FOUND)
   # Build SWIG from source.
   if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+    add_custom_target(Swig)
     set(SWIG_EXECUTABLE
         ${PROJECT_SOURCE_DIR}/${PLATFORM}${BITNESS}/bin/swig.exe)
   else()


Enable navigation sidebar

Enable navigation sidebar

--- doc/Doxyfile.cmake
+++ doc/Doxyfile.cmake
@@ -138,8 +138,8 @@
 TOC_EXPAND = NO
 DISABLE_INDEX = NO
 ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 350
 FORMULA_FONTSIZE = 10
 #---------------------------------------------------------------------------
 # configuration options related to the LaTeX output


Use separate set of warning options for clang.

--- build_settings.cmake
+++ build_settings.cmake
@@ -21,7 +21,11 @@

 # Warnings that are specific to C++ compilation
 # Note: this is not a union of C_WARN_OPTS, since CMAKE_CXX_FLAGS already includes CMAKE_C_FLAGS, which in turn includes C_WARN_OPTS transitively
-set(CXX_SPECIFIC_WARN_OPTS "-Wsuggest-override -Wnon-virtual-dtor -Wformat-security")
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+  set(CXX_SPECIFIC_WARN_OPTS "-Wnon-virtual-dtor -Wformat-security")
+else()
+  set(CXX_SPECIFIC_WARN_OPTS "-Wsuggest-override -Wnon-virtual-dtor -Wformat-security")
+endif()

 # C and C++ compiler flags
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} -mtune=intel ${EXTRA_C_FLAGS}")


Revert accidental debug build.

Revert accidental debug build.

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

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

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


Better CMAKE

Better CMAKE

--- boards/avr.cmake
+++ boards/avr.cmake
@@ -38,24 +38,21 @@

     add_custom_target (
         flash
-        sudo ${AVRDUDE} -p ${MCU} -v -c ${PROGRAMMER} -P ${PORT} -U flash:w:"${CMAKE_PROJECT_NAME}.hex"
+        sudo ${AVRDUDE} -p ${MCU} -v -c ${PROGRAMMER} -P ${PORT} -B5 -U flash:w:"${CMAKE_PROJECT_NAME}.hex"
         DEPENDS hex
         COMMENT "Flashing ${CMAKE_PROJECT_NAME}.hex"
         )

     add_custom_target (
         get_fuses
-        sudo ${AVRDUDE} -p ${MCU} -c ${PROGRAMMER} -P ${PORT} -n
-            -U lfuse:r:-:b
-            -U hfuse:r:-:b
+        sudo ${AVRDUDE} -p ${MCU} -c ${PROGRAMMER} -P ${PORT} -n -U lfuse:r:-:b -U hfuse:r:-:b
             COMMENT "Get fuses from ${MCU}"
         )

     if( DEFINED L_FUSE )
         add_custom_target (
             set_fuses
-            sudo ${AVRDUDE} -p ${MCU} -c ${PROGRAMMER} -P ${PORT}
-                -U lfuse:w:${L_FUSE}:m
+            sudo ${AVRDUDE} -p ${MCU} -c ${PROGRAMMER} -P ${PORT} -U lfuse:w:${L_FUSE}:m
                 COMMENT "Setup:\n Low Fuse: ${L_FUSE}"
             )
     endif( DEFINED L_FUSE )


[Build] Fixed the CMake build on the trunk branch.

--- project_config_embeddable.cmake
+++ project_config_embeddable.cmake
@@ -669,19 +669,21 @@
 #  * The short name of the library to be built.
 #    Note that the library (CMake) target is derived directly from the library
 #    short name: a 'lib' suffix is just appended to the short name.
+#  * The directory where to find the header files.
 #  * The header files to be published/installed along with the library.
 #  * The source files to build the library.
 #    Note that the source files contain at least the header files. Hence,
 #    even when there are no .cpp source files, the .hpp files will appear.
 #
-# Note that the source files should be given as a single parameter,
+# Note that the header and source files should be given as single parameters,
 # i.e., enclosed by double quotes (").
 #
 # The additional parameters, if given, correspond to the names of the
 # modules this current module depends upon. Dependencies on the
 # external libraries (e.g., Boost, SOCI, StdAir) are automatically
 # appended, thanks to the get_external_libs() macro.
-macro (module_library_add_specific _lib_short_name _lib_headers _lib_sources)
+macro (module_library_add_specific
+	_lib_short_name _lib_dir _lib_headers _lib_sources)
   # Derive the library (CMake) target from its name
   set (_lib_target ${_lib_short_name}lib)

@@ -693,7 +695,7 @@
   set (_intermodule_dependencies "")
   foreach (_arg_module ${ARGV})

-    if (NOT "${_lib_short_name};${_lib_headers};${_lib_sources}"
+    if (NOT "${_lib_dir};${_lib_short_name};${_lib_headers};${_lib_sources}"
 	MATCHES "${_arg_module}")
       list (APPEND _intermodule_dependencies ${_arg_module}lib)
     endif ()
@@ -731,22 +733,16 @@
   # DEBUG
   #message ("DEBUG -- [${_lib_target}] _lib_headers = ${_lib_headers}")

-  # Register the library target in the project (for reporting purpose)
-  set (PROJ_ALL_LIB_TARGETS
-	${PROJ_ALL_LIB_TARGETS} ${MODULE_LIB_TARGET} PARENT_SCOPE)
-
   ##
   # Library name (and soname)
   if (WIN32)
     set_target_properties (${_lib_target} PROPERTIES
       OUTPUT_NAME ${_lib_short_name}
-      VERSION ${GENERIC_LIB_VERSION}
-      PUBLIC_HEADER "${_lib_headers}")
+      VERSION ${GENERIC_LIB_VERSION})
   else (WIN32)
     set_target_properties (${_lib_target} PROPERTIES
       OUTPUT_NAME ${_lib_short_name}
-      VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
-      PUBLIC_HEADER "${_lib_headers}")
+      VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
   endif (WIN32)

   # If everything else is not enough for CMake to derive the language to


build: do not set haskell targets when haskell is not build

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -215,6 +215,64 @@
 									     "${GHC_GMP_PATH}"
 									     "${CMAKE_INSTALL_RPATH}"
 									     "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/elektra/haskell")
+
+									set (PLUGIN_ARGS "")
+									if (ARG_TEST_README)
+										list (APPEND PLUGIN_ARGS "TEST_README")
+										list (APPEND PLUGIN_ARGS "TEST_ENVIRONMENT")
+										list (
+											APPEND
+												PLUGIN_ARGS
+												"SANDBOX_PACKAGEDB=${CMAKE_BINARY_DIR}/.cabal-sandbox/${GHC_TARGET_PLATFORM}-ghc-${GHC_VERSION}-packages.conf.d/"
+											)
+										if (ARG_TEST_ENVIRONMENT)
+											list (APPEND PLUGIN_ARGS "${ARG_TEST_ENVIRONMENT}")
+										endif (ARG_TEST_ENVIRONMENT)
+
+										if (ARG_TEST_REQUIRED_PLUGINS)
+											list (APPEND PLUGIN_ARGS "TEST_REQUIRED_PLUGINS")
+											list (APPEND PLUGIN_ARGS "${ARG_TEST_REQUIRED_PLUGINS}")
+										endif (ARG_TEST_REQUIRED_PLUGINS)
+									endif (ARG_TEST_README)
+
+									# compile our c wrapper which takes care of invoking the haskell runtime
+									# the actual haskell plugin gets linked in dynamically as a library
+									add_plugin (${target}
+											SOURCES ${CMAKE_CURRENT_BINARY_DIR}/haskell.h
+												${CMAKE_CURRENT_BINARY_DIR}/haskell.c
+											INCLUDE_DIRECTORIES ${GHC_INCLUDE_DIRS}
+											LINK_LIBRARIES ${GHC_LIBS}
+											LINK_ELEKTRA elektra-pluginprocess
+												 "${PLUGIN_ARGS}"
+											DEPENDS ${target}
+												c2hs_haskell)
+
+									if (DEPENDENCY_PHASE AND TARGET elektra-${target})
+										set_target_properties (
+											elektra-${target}
+											PROPERTIES INSTALL_RPATH
+												   "${HASKELL_RPATH}"
+												   SANDBOX_PACKAGEDB
+												   "${CMAKE_BINARY_DIR}/.cabal-sandbox/${GHC_TARGET_PLATFORM}-ghc-${GHC_VERSION}-packages.conf.d/")
+									endif (DEPENDENCY_PHASE AND TARGET elektra-${target})
+
+									set (PLUGINTEST_ARGS "")
+									if (ARG_INSTALL_TEST_DATA)
+										list (APPEND PLUGINTEST_ARGS "INSTALL_TEST_DATA")
+									endif (ARG_INSTALL_TEST_DATA)
+
+									if (ADDTESTING_PHASE AND TARGET elektra-${target})
+										add_plugintest (${target} MEMLEAK "${PLUGINTEST_ARGS}")
+										get_target_property (HASKELL_RPATH elektra-${target} INSTALL_RPATH)
+										get_target_property (SANDBOX_PACKAGEDB elektra-${target} SANDBOX_PACKAGEDB)
+
+										# this is required so that it finds the type checker plugin and all the libraries
+										set_target_properties (testmod_${target} PROPERTIES INSTALL_RPATH "${HASKELL_RPATH}")
+										set_property (TEST testmod_${target}
+												  PROPERTY ENVIRONMENT
+													   "SANDBOX_PACKAGEDB=${SANDBOX_PACKAGEDB};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")
+									endif (ADDTESTING_PHASE AND TARGET elektra-${target})
+
 								else (GHC_PRIM_LIB)
 									remove_plugin (${target} "GHC_PRIM_LIB not found")
 								endif (GHC_PRIM_LIB)
@@ -238,64 +296,6 @@
 			remove_plugin (${target} "${PLUGINPROCESS_NOTFOUND_INFO}, but required for haskell plugins")
 		endif (PLUGINPROCESS_FOUND)
 	endif (DEPENDENCY_PHASE)
-
-	set (PLUGIN_ARGS "")
-	if (ARG_TEST_README)
-		list (APPEND PLUGIN_ARGS "TEST_README")
-		list (APPEND PLUGIN_ARGS "TEST_ENVIRONMENT")
-		list (
-			APPEND
-				PLUGIN_ARGS
-				"SANDBOX_PACKAGEDB=${CMAKE_BINARY_DIR}/.cabal-sandbox/${GHC_TARGET_PLATFORM}-ghc-${GHC_VERSION}-packages.conf.d/"
-			)
-		if (ARG_TEST_ENVIRONMENT)
-			list (APPEND PLUGIN_ARGS "${ARG_TEST_ENVIRONMENT}")
-		endif (ARG_TEST_ENVIRONMENT)
-
-		if (ARG_TEST_REQUIRED_PLUGINS)
-			list (APPEND PLUGIN_ARGS "TEST_REQUIRED_PLUGINS")
-			list (APPEND PLUGIN_ARGS "${ARG_TEST_REQUIRED_PLUGINS}")
-		endif (ARG_TEST_REQUIRED_PLUGINS)
-
-	endif (ARG_TEST_README)
-
-	# compile our c wrapper which takes care of invoking the haskell runtime
-	# the actual haskell plugin gets linked in dynamically as a library
-	add_plugin (${target}
-		    SOURCES ${CMAKE_CURRENT_BINARY_DIR}/haskell.h
-			    ${CMAKE_CURRENT_BINARY_DIR}/haskell.c
-		    INCLUDE_DIRECTORIES ${GHC_INCLUDE_DIRS}
-		    LINK_LIBRARIES ${GHC_LIBS}
-		    LINK_ELEKTRA elektra-pluginprocess
-				 "${PLUGIN_ARGS}"
-		    DEPENDS ${target}
-			    c2hs_haskell)
-
-	if (DEPENDENCY_PHASE AND TARGET elektra-${target})
-		set_target_properties (
-			elektra-${target}
-			PROPERTIES INSTALL_RPATH
-				   "${HASKELL_RPATH}"
-				   SANDBOX_PACKAGEDB
-				   "${CMAKE_BINARY_DIR}/.cabal-sandbox/${GHC_TARGET_PLATFORM}-ghc-${GHC_VERSION}-packages.conf.d/")
-	endif (DEPENDENCY_PHASE AND TARGET elektra-${target})
-
-	set (PLUGINTEST_ARGS "")
-	if (ARG_INSTALL_TEST_DATA)
-		list (APPEND PLUGINTEST_ARGS "INSTALL_TEST_DATA")
-	endif (ARG_INSTALL_TEST_DATA)
-
-	if (ADDTESTING_PHASE AND TARGET elektra-${target})
-		add_plugintest (${target} MEMLEAK "${PLUGINTEST_ARGS}")
-		get_target_property (HASKELL_RPATH elektra-${target} INSTALL_RPATH)
-		get_target_property (SANDBOX_PACKAGEDB elektra-${target} SANDBOX_PACKAGEDB)
-
-		# this is required so that it finds the type checker plugin and all the libraries
-		set_target_properties (testmod_${target} PROPERTIES INSTALL_RPATH "${HASKELL_RPATH}")
-		set_property (TEST testmod_${target}
-			      PROPERTY ENVIRONMENT
-				       "SANDBOX_PACKAGEDB=${SANDBOX_PACKAGEDB};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")
-	endif (ADDTESTING_PHASE AND TARGET elektra-${target})

 	mark_as_advanced (GHC_FFI_LIB GHC_RTS_LIB GHC_BASE_LIB GHC_GMP_LIB GHC_PRIM_LIB)
 endmacro (add_haskell_plugin)


Set TPL_ENABLE_BoostOrg in RepositoryDependenciesSetup.cmake

--- cmake/RepositoryDependenciesSetup.cmake
+++ cmake/RepositoryDependenciesSetup.cmake
@@ -1 +1,3 @@
 SET_DEFAULT(DataTransferKit_REPOSITORY_MASTER_EMAIL_ADDRESS coupler-infrastructure@casl-dev.ornl.gov)
+
+SET(TPL_ENABLE_BoostOrg "${TPL_ENABLE_Boost}")


Exclude module from being turned on by default

--- itk-module.cmake
+++ itk-module.cmake
@@ -3,6 +3,12 @@
 # re-used it for documentation here
 get_filename_component( MY_CURENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
 file( READ "${MY_CURENT_DIR}/README" DOCUMENTATION )
+
+# ITK version 4.5 changed it from EXCLUDE_FROM_ALL to EXCLUDE_FROM_DEFAULT
+set( _EXCLUDE "EXCLUDE_FROM_ALL" )
+if (NOT "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_MINOR_PATCH}" VERSION_LESS "4.5")
+  set( _EXCLUDE "EXCLUDE_FROM_DEFAULT" )
+endif()

 # itk_module() defines the module dependencies in ITKOBBLabelMap
 # ITKOBBLabelMap depends on ITKCommon
@@ -19,4 +25,5 @@
     ITKMetaIO
   DESCRIPTION
     "${DOCUMENTATION}"
+  ${_EXCLUDE}
 )


support Xcode versions < 10.1

support Xcode versions < 10.1

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -141,12 +141,20 @@
 if (IOS_PLATFORM STREQUAL "OS")
   set(XCODE_IOS_PLATFORM iphoneos)
   if(NOT IOS_ARCH)
-    set(IOS_ARCH armv7 armv7s arm64 arm64e)
+    if (XCODE_VERSION VERSION_GREATER 10.0)
+      set(IOS_ARCH armv7 armv7s arm64 arm64e)
+    else()
+      set(IOS_ARCH armv7 armv7s arm64)
+    endif()
   endif()
  elseif (IOS_PLATFORM STREQUAL "OS64")
   set(XCODE_IOS_PLATFORM iphoneos)
   if(NOT IOS_ARCH)
-    set(IOS_ARCH arm64 arm64e)
+    if (XCODE_VERSION VERSION_GREATER 10.0)
+      set(IOS_ARCH arm64 arm64e)
+    else()
+      set(IOS_ARCH arm64)
+    endif()
   endif()
 elseif (IOS_PLATFORM STREQUAL "SIMULATOR")
   set(XCODE_IOS_PLATFORM iphonesimulator)


Remove never used FEATURE_NORM_IDNA_ONLY

--- clrdefinitions.cmake
+++ clrdefinitions.cmake
@@ -147,7 +147,6 @@
   add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
 endif(FEATURE_MERGE_JIT_AND_ENGINE)
 add_definitions(-DFEATURE_MULTICOREJIT)
-add_definitions(-DFEATURE_NORM_IDNA_ONLY)
 if(CLR_CMAKE_PLATFORM_UNIX)
   add_definitions(-DFEATURE_PAL)
   add_definitions(-DFEATURE_PAL_SXS)


Update according to remill.

Update according to remill.

--- cmake/settings.cmake
+++ cmake/settings.cmake
@@ -14,10 +14,12 @@
   endif()

   # overwrite the default install prefix
-  if(DEFINED WIN32)
-    set(CMAKE_INSTALL_PREFIX "C:/")
-  else()
-    set(CMAKE_INSTALL_PREFIX "/usr/local")
+  if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+    if(DEFINED WIN32)
+      set(CMAKE_INSTALL_PREFIX "C:/")
+    else()
+      set(CMAKE_INSTALL_PREFIX "/usr/local")
+    endif()
   endif()

   message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")


ffmpeg configure mods, continued

ffmpeg configure mods, continued

* disable libxcb
* this should alleviate link errors seen
* issue https://github.com/smanders/externpro/issues/17#issuecomment-353403156

--- projects/ffmpeg.cmake
+++ projects/ffmpeg.cmake
@@ -69,7 +69,7 @@
     build_openh264(openh264Tgts)
     set(XP_CONFIGURE_BASE ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${STAGE_DIR}/share/cmake
       <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> #--enable-shared --disable-static
-      --enable-libopenh264 --disable-bzlib --disable-iconv --disable-zlib
+      --enable-libopenh264 --disable-bzlib --disable-iconv --disable-libxcb --disable-zlib
       )
     set(XP_CONFIGURE_Debug ${XP_CONFIGURE_BASE} --enable-debug=1)
     set(XP_CONFIGURE_Release ${XP_CONFIGURE_BASE} --disable-debug)


Remove any -W flags that llvm-config feeds our compiler.

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -188,6 +188,12 @@
 #LLVM_CXX_FLAGS=$($LLVM_CONFIG --cxxflags | sed -e 's/ -pedantic / /g')
 string(REPLACE " -pedantic" "" LLVM_CXXFLAGS "${LLVM_CXXFLAGS}")

+#llvm-config clutters CXXFLAGS with a lot of -W<whatever> flags.
+#(They are not needed - we want to use -Wall anyways)
+#This is a problem if LLVM was built with a different compiler than we use here,
+#and our compiler chokes on unrecognized command-line options.
+string(REGEX REPLACE "-W[^ ]*" "" LLVM_CXXFLAGS "${LLVM_CXXFLAGS}")
+
 # Llvm-config does not include clang libs
 set(CLANG_LIBNAMES clangFrontendTool clangFrontend clangDriver clangSerialization
     clangCodeGen clangParse clangSema clangRewrite clangRewriteFrontend


remove unused macro defs

remove unused macro defs


cmake edits

cmake edits

--- cmake/Misc.cmake
+++ cmake/Misc.cmake
@@ -24,9 +24,9 @@
 endif()

 # ---[ Install options
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-  set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/install" CACHE PATH "Default install path" FORCE)
-endif()
+#if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+#  set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/install" CACHE PATH "Default install path" FORCE)
+#endif()

 # ---[ RPATH settings
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOLEAN "Use link paths for shared library rpath")


Expose new fips cmake variables:

Expose new fips cmake variables:

- FIPS_BUILD_DIR: points to the global build directory (fips-build)
- FIPS_PROJECT_BUILD_DIR: points to the current project's and
  config's build dir (e.g. fips-build/oryol/osx-xcode-debug)
- these two are similar to FIPS_DEPLOY_DIR, and
  FIPS_PROJECT_BUILD_DIR, they are useful in cmake files
  to generated temporary files (in the build dir), or to place
  files that should become part of deployment

--- cmake/fips.cmake
+++ cmake/fips.cmake
@@ -9,6 +9,7 @@

 get_filename_component(FIPS_PROJECT_DIR "." ABSOLUTE)
 get_filename_component(FIPS_DEPLOY_DIR "../fips-deploy" ABSOLUTE)
+get_filename_component(FIPS_BUILD_DIR "../fips-build" ABSOLUTE)

 include(CMakeParseArguments)

@@ -80,6 +81,7 @@
     else()
         message(FATAL_ERROR "Must specify absolute FIPS_PROJECT_DIR before calling fips_setup()!")
     endif()
+    message("FIPS_BUILD_DIR: ${FIPS_BUILD_DIR}")
     if (FIPS_DEPLOY_DIR)
         message("FIPS_DEPLOY_DIR: ${FIPS_DEPLOY_DIR}")
     else()
@@ -136,6 +138,8 @@
         fips_choose_config()
     endif()
     message("FIPS_CONFIG: ${FIPS_CONFIG}")
+    get_filename_component(FIPS_PROJECT_BUILD_DIR "${FIPS_BUILD_DIR}/${CMAKE_PROJECT_NAME}/${FIPS_CONFIG}" ABSOLUTE)
+    message("FIPS_PROJECT_BUILD_DIR: ${FIPS_PROJECT_BUILD_DIR}")
     get_filename_component(FIPS_PROJECT_DEPLOY_DIR "${FIPS_DEPLOY_DIR}/${CMAKE_PROJECT_NAME}/${FIPS_CONFIG}" ABSOLUTE)
     message("FIPS_PROJECT_DEPLOY_DIR: ${FIPS_PROJECT_DEPLOY_DIR}")


Fixed a cmake warning about unquoted ifs

--- cmake/fips.cmake
+++ cmake/fips.cmake
@@ -106,10 +106,10 @@

     # detect compiler
     message("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
-    if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+    if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
         set(FIPS_CLANG 1)
         message("Detected C++ Compiler: Clang (FIPS_CLANG)")
-    elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+    elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
         set(FIPS_GCC 1)
         message("Detected C++ Compiler: GCC (FIPS_GCC)")
     elseif (MSVC)


Do a git clone instead of zip donloading the gl3w repo

--- cmake/gl3w.cmake
+++ cmake/gl3w.cmake
@@ -34,10 +34,10 @@

 ExternalProject_Add(
   gl3w_dl
-  URL "https://github.com/skaslev/gl3w/archive/master.zip"
-  URL_HASH SHA1=4d7485a2e47d6f0a34b2f30dd6a849ea55da41b2
-  DOWNLOAD_NO_PROGRESS 1
   PREFIX ${CMAKE_BINARY_DIR}/gl3w
+  GIT_REPOSITORY https://github.com/skaslev/gl3w
+  TIMEOUT 10
+  UPDATE_COMMAND ${GIT_EXECUTABLE} pull
   PATCH_COMMAND ${PYTHON_EXECUTABLE} <SOURCE_DIR>/gl3w_gen.py
   CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
   # disable install


Fix typo

Fix typo

--- cmake/glut.cmake
+++ cmake/glut.cmake
@@ -21,9 +21,9 @@
 ELSEIF (WIN32)
 # FindGLUT.cmake is broken for Windows in CMake until 3.0: does not support PATH
   IF (GLUT_ROOT_PATH)
-    MESSAGE(WARNING "Warning: GLUT_ROOT_PATH is depreciated.")
-    SET(DEPRECIATED_WIN32_INCLUDE ${GLUT_ROOT_PATH}/include)
-    SET(DEPRECIATED_WIN32_RELEASE ${GLUT_ROOT_PATH}/Release)
+    MESSAGE(WARNING "Warning: GLUT_ROOT_PATH is deprecated.")
+    SET(DEPRECATED_WIN32_INCLUDE ${GLUT_ROOT_PATH}/include)
+    SET(DEPRECATED_WIN32_RELEASE ${GLUT_ROOT_PATH}/Release)
   ENDIF()
   FIND_PATH(GLUT_INCLUDE_DIR
     NAMES GL/glut.h
@@ -31,7 +31,7 @@
     ${PROJECT_SOURCE_DIR}/../freeglut/include
     ${PROJECT_SOURCE_DIR}/../freeglut-MSVC-3.0.0-2.mp/include ${PROJECT_SOURCE_DIR}/../freeglut-MSVC-3.0.0-2.mp/freeglut/include
     ${PROJECT_SOURCE_DIR}/../freeglut-MSVC-2.8.1-1.mp/include ${PROJECT_SOURCE_DIR}/../freeglut-MSVC-2.8.1-1.mp/freeglut/include
-    ${DEPRECIATED_WIN32_INCLUDE}
+    ${DEPRECATED_WIN32_INCLUDE}
   )
   # detect and select x64
   IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -39,7 +39,7 @@
   ENDIF()
   FIND_LIBRARY(GLUT_glut_LIBRARY
     NAMES freeglut glut glut32
-    HINTS ${GLUT_INCLUDE_DIR}/../lib/${ARCH} ${FREEGLUT_ROOT_PATH}/lib/${ARCH} ${DEPRECIATED_WIN32_RELEASE}
+    HINTS ${GLUT_INCLUDE_DIR}/../lib/${ARCH} ${FREEGLUT_ROOT_PATH}/lib/${ARCH} ${DEPRECATED_WIN32_RELEASE}
   )
   SET(GLUT_LIBRARIES ${GLUT_glut_LIBRARY})
   MARK_AS_ADVANCED(