Install QtWebEngine on macOS

Install QtWebEngine on macOS

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -47,20 +47,27 @@

   # Install Qt WebEngine

-  set(_install_DESTINATION "")
+  if(APPLE)
+    set(_install_DESTINATION "../Frameworks/QtWebEngineCore.framework")

-  if(NOT APPLE)
+    get_filename_component(_real_path "${_qmake_path}/../lib/QtWebEngineCore.framework/Helpers" REALPATH)
+    MITK_INSTALL(DIRECTORY ${_real_path})
+
+    get_filename_component(_real_path "${_qmake_path}/../lib/QtWebEngineCore.framework/Resources" REALPATH)
+    MITK_INSTALL(DIRECTORY ${_real_path})
+  else()
+    set(_install_DESTINATION "")
+
     if(WIN32)
       MITK_INSTALL(FILES "${_qmake_path}/QtWebEngineProcess.exe")
     elseif(UNIX)
       MITK_INSTALL(FILES "${_qmake_path}/../libexec/QtWebEngineProcess")
     endif()

-    set(_install_DESTINATION "resources")
-    MITK_INSTALL(DIRECTORY "${_qmake_path}/../resources/")
+    MITK_INSTALL(DIRECTORY "${_qmake_path}/../resources")

-    set(_install_DESTINATION "translations/qtwebengine_locales")
-    MITK_INSTALL(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales/")
+    set(_install_DESTINATION "translations")
+    MITK_INSTALL(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales")
   endif()
 endif()


FindFFTW3.cmake: remove non-standard function check

--- CMakeModules/FindFFTW3.cmake
+++ CMakeModules/FindFFTW3.cmake
@@ -34,15 +34,6 @@

 find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR )

-if (FFTW3_FOUND)
-  include(CheckLibraryExists)
-  #adding MATH_LIBRARIES here to allow static libs, this does not harm us as we are anyway using it
-  check_library_exists("${FFTW3_LIBRARY};${MATH_LIBRARIES}" fftw_plan_r2r_1d "" FOUND_FFTW_PLAN)
-  if(NOT FOUND_FFTW_PLAN)
-    message(FATAL_ERROR "Could not find fftw_plan_r2r_1d in ${FFTW3_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of fftw3 in FFTW3_LIBRARY by hand (i.e. -DFFTW3_LIBRARY='/path/to/libfftw3.so;/path/to/libm.so') !")
-  endif(NOT FOUND_FFTW_PLAN)
-endif (FFTW3_FOUND)
-
 # Copy the results to the output variables and target.
 if(FFTW3_FOUND)
   set(FFTW3_LIBRARIES ${FFTW3_LIBRARY} )


Fix invalid comparison operator in .pc files

--- librtosc-cpp.pc.cmake
+++ librtosc-cpp.pc.cmake
@@ -9,6 +9,6 @@
 Name: rtosc_cpp
 Description: rtosc_cpp - a realtime safe open sound control serialization and dispatch system for C++
 Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
-Requires: librtosc == @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
+Requires: librtosc = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
 Libs: -L${libdir} -lrtosc -lrtosc-cpp
 Cflags: -I${includedir}


doc: Reset version of master branch to “0.0.0” [CMake]

--- BasisProject.cmake
+++ BasisProject.cmake
@@ -52,7 +52,7 @@
   # --------------------------------------------------------------------------
   # meta-data
   NAME         "MIRTK"
-  VERSION      "2.0.0" # Version of core (+ external) modules
+  VERSION      "0.0.0" # Version of core (+ external) modules
   SOVERSION    "0"     # API yet unstable
   AUTHORS      "Andreas Schuh"
   DESCRIPTION  "Medical Image Registration ToolKit"


By default, all archive/lib builds go to BPD/lib and all executables go to BPD/bin.  This shouldn't affect called cmake scripts since the variable setting is scoped

--- BuildSupport.cmake
+++ BuildSupport.cmake
@@ -26,7 +26,7 @@
     file (MAKE_DIRECTORY ${BUILDEM_BIN_DIR})
 endif ()

-set (BUILDEM_TEST_DIR    ${BUILDEM_DIR}/tests)
+set (BUILDEM_TEST_DIR    ${BUILDEM_DIR}/bin/tests)
 if (NOT EXISTS ${BUILDEM_TEST_DIR})
     file (MAKE_DIRECTORY ${BUILDEM_TEST_DIR})
 endif ()
@@ -64,6 +64,11 @@
 set (BUILDEM_ENV_STRING   env PATH=${BUILDEM_BIN_PATH} ${BUILDEM_LD_LIBRARY_VAR}=${BUILDEM_LIB_PATH} ${BUILDEM_PLATFORM_SPECIFIC_ENV})
 set (BUILDEM_LDFLAGS      "-Wl,-rpath,${BUILDEM_LIB_DIR} -L${BUILDEM_LIB_DIR}")

+# All library builds should go to BPD/lib
+set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY  ${BUILDEM_LIB_DIR})
+set (CMAKE_LIBRARY_OUTPUT_DIRECTORY  ${BUILDEM_LIB_DIR})
+set (CMAKE_RUNTIME_OUTPUT_DIRECTORY  ${BUILDEM_BIN_DIR})
+
 # Set standard include directories.
 include_directories (BEFORE ${BUILDEM_INCLUDE_DIR})


Create flatc_generate_target3() cmake function.

--- cmake/TbagFindPackage/FindFlatc.cmake
+++ cmake/TbagFindPackage/FindFlatc.cmake
@@ -141,3 +141,15 @@
     add_custom_target (${__target} SOURCES ${__fbs_result})
 endfunction ()

+function (flatc_generate_target3 __target __type __fbs)
+    flatc_generate_target2 (${__target} ${Flatc_COMPILER} ${__type} ${__fbs})
+endfunction ()
+
+function (flatc_generate_target3_cpp __target __fbs)
+    flatc_generate_target2 (${__target} ${Flatc_COMPILER} cpp ${__fbs})
+endfunction ()
+
+function (flatc_generate_target3_js __target __fbs)
+    flatc_generate_target2 (${__target} ${Flatc_COMPILER} js ${__fbs})
+endfunction ()
+


[cmake] Add -fms-compatibility-version=19 when clang-cl gives errors about char16_t

What we are really trying to do here is to figure out if we are using
the 2015 STL. Unfortunately, so far as I know the MSVC STL does not
define a version macro that we can check directly. Instead I wrote a
check to see if char16_t works.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -347,6 +347,17 @@
   # "Enforce type conversion rules".
   append("/Zc:rvalueCast" CMAKE_CXX_FLAGS)

+  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    # In VS 2015, char16_t became a builtin type. Clang still defaults to VS
+    # 2013 compatibility, where it cannot be a builtin type. If we're using an
+    # STL newer than 2015, this compilation will fail. Rasing the MSVC
+    # compatibility version of the compiler will provide char16/32.
+    check_cxx_source_compiles("#include <cstdint>\nchar16_t v1;\n" STL_PROVIDES_CHAR16_T)
+    if (NOT STL_PROVIDES_CHAR16_T)
+      append("-fms-compatibility-version=19" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    endif()
+  endif()
+
   if (NOT LLVM_ENABLE_TIMESTAMPS AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     # clang-cl and cl by default produce non-deterministic binaries because
     # link.exe /incremental requires a timestamp in the .obj file.  clang-cl


Add back C++ standard to root-config --features

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -564,7 +564,7 @@

 #---root-config----------------------------------------------------------------------------------------------
 ROOT_GET_OPTIONS(features ENABLED)
-string(REPLACE "c++11" "cxx11" features ${features}) # change the name of the c++11 feature needed for root-config.in
+set(features "cxx${CMAKE_CXX_STANDARD} ${features}")
 set(configfeatures ${features})
 set(configargs ${ROOT_CONFIGARGS})
 set(configoptions ${ROOT_CONFIGARGS})


moved to generator expressions for cmake debug flags

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -23,9 +23,9 @@
 endif ()

 ## add TOKU_PTHREAD_DEBUG for debug builds
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1)
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD TOKU_PTHREAD_DEBUG=1)
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD _FORTIFY_SOURCE=2)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
+  $<$<OR:$<CONFIG:DEBUG>,$<CONFIG:DRD>>:TOKU_PTHREAD_DEBUG=1>
+  $<$<CONFIG:DRD>:_FORTIFY_SOURCE=2>)

 ## coverage
 option(USE_GCOV "Use gcov for test coverage." OFF)


print absolute path of unparsed line log

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -1499,7 +1499,7 @@
 			if (WIN32)
 				file (TO_NATIVE_PATH "${_unparsedLinesFile}" _unparsedLinesLogPath)
 			else()
-				file (RELATIVE_PATH _unparsedLinesLogPath "${CMAKE_BINARY_DIR}" "${_unparsedLinesFile}")
+				set (_unparsedLinesLogPath "${_unparsedLinesFile}")
 			endif()
 			message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesLogPath}")
 		endif()


set predefined values for OSPRAY_ISPC_ADDRESSING, validate it if incorrect

--- components/ospcommon/cmake/ispc.cmake
+++ components/ospcommon/cmake/ispc.cmake
@@ -67,8 +67,14 @@
   MARK_AS_ADVANCED(ISPC_EXECUTABLE)
 ENDIF()

-SET(OSPRAY_ISPC_ADDRESSING 32 CACHE INT "32vs64 bit addressing in ispc")
+SET(OSPRAY_ISPC_ADDRESSING 32 CACHE INT "32 vs 64 bit addressing in ispc")
+SET_PROPERTY(CACHE OSPRAY_ISPC_ADDRESSING PROPERTY STRINGS 32 64)
 MARK_AS_ADVANCED(OSPRAY_ISPC_ADDRESSING)
+
+IF (NOT (OSPRAY_ISPC_ADDRESSING STREQUAL "32" OR
+         OSPRAY_ISPC_ADDRESSING STREQUAL "64"))
+  MESSAGE(FATAL_ERROR "OSPRAY_ISPC_ADDRESSSING must be set to either '32' or '64'!")
+ENDIF()

 GET_FILENAME_COMPONENT(ISPC_DIR ${ISPC_EXECUTABLE} PATH)


updating mbed cmake file for the BurstSPI library build

--- firmware/mbed/arm_mbed.cmake
+++ firmware/mbed/arm_mbed.cmake
@@ -213,13 +213,14 @@
 # set variables to each of the accessory library cmake project files
 set(RPC_MBED_LIB      ${CMAKE_CURRENT_LIST_DIR}/mbed-rpc.cmake)
 set(MCP23017_MBED_LIB ${CMAKE_CURRENT_LIST_DIR}/mcp23017.cmake)
+set(BURSTSPI_MBED_LIB ${CMAKE_CURRENT_LIST_DIR}/burst-spi.cmake)
 set(SWSPI_MBED_LIB    ${CMAKE_CURRENT_LIST_DIR}/software-spi.cmake)
 set(SWI2C_MBED_LIB    ${CMAKE_CURRENT_LIST_DIR}/software-i2c.cmake)
 set(MODSER_MBED_LIB   ${CMAKE_CURRENT_LIST_DIR}/modserial.cmake)
 set(MODDMA_MBED_LIB   ${CMAKE_CURRENT_LIST_DIR}/moddma.cmake)

 # create a list of which accessory libraries we want to download and add to the common2015 library
-set(MBED_ASSEC_LIBS ${RPC_MBED_LIB} ${MODSER_MBED_LIB} ${MODDMA_MBED_LIB})
+set(MBED_ASSEC_LIBS ${RPC_MBED_LIB} ${MODSER_MBED_LIB} ${MODDMA_MBED_LIB} ${BURSTSPI_MBED_LIB})

 # uncomment the below line to add the MCP23017 library or other
 # ones when adding their cmake file to the mbed directory


Output only the first few lines of numdiff output if a test fails. Then output
the first 50 lines of regular diff since it's so much more readable.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@32815 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_add_test.cmake
+++ deal.II/cmake/macros/macro_add_test.cmake
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2013 by the deal.II authors
+## Copyright (C) 2013, 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -205,7 +205,12 @@
         COMMAND rm -f ${_test_directory}/failing_diff
         COMMAND touch ${_test_directory}/diff
         COMMAND
-          ${${_test_diff_variable}} # see comment in line 72
+	  # run diff or numdiff (if available) to determine
+	  # whether files are the same. if they are not, output
+          # the first few lines of the output of numdiff, followed
+          # by the results of regular diff since the latter is just
+          # more readable
+          ${${_test_diff_variable}} # see comment above about redirection
             ${_comparison_file}
             ${_test_directory}/output
             > ${_test_directory}/diff
@@ -216,8 +221,10 @@
               && echo "${_test_full}: DIFF failed. ------ Source: ${_comparison_file}"
               && echo "${_test_full}: DIFF failed. ------ Result: ${_test_directory}/output"
               && echo "${_test_full}: DIFF failed. ------ Diff:   ${_test_directory}/failing_diff"
-              && echo "${_test_full}: DIFF failed. ------ Diffs as follows:"
-              && cat ${_test_directory}/failing_diff
+              && echo "${_test_full}: DIFF failed. ------ First 8 lines of numdiff/diff output:"
+              && cat ${_test_directory}/failing_diff | head -n 8
+              && echo "${_test_full}: DIFF failed. ------ First 50 lines diff output:"
+              && ${DIFF_EXECUTABLE} -c ${_comparison_file} ${_test_directory}/output | head -n 50
               && exit 1)
         WORKING_DIRECTORY
           ${_test_directory}


convert paths to native paths under Windows

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -889,6 +889,9 @@
 	if (NOT _compilerArg1)
 		set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
 	endif()
+	if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+		file (TO_NATIVE_PATH "${_compilerExe}" _compilerExe)
+	endif()
 	string (STRIP "${_compilerArg1}" _compilerArg1)
 	if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
 		# compiler launcher is only supported for Makefile and Ninja
@@ -1246,7 +1249,15 @@
 		set (${_includesVar} "" PARENT_SCOPE)
 		return()
 	endif()
-	list (APPEND _cmd ${_existingSourceFiles})
+	# add source files to be scanned
+	if (WIN32 AND "${_option_COMPILER_ID}" MATCHES "MSVC|Intel")
+		foreach (_sourceFile ${_existingSourceFiles})
+			file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative)
+			list (APPEND _cmd "${_sourceFileNative}")
+		endforeach()
+	else()
+		list (APPEND _cmd ${_existingSourceFiles})
+	endif()
 	if (COTIRE_VERBOSE)
 		message (STATUS "execute_process: ${_cmd}")
 	endif()


generate per project parent_prefix_path files

--- ament_cmake_core/cmake/environment/ament_cmake_environment_package_hook.cmake
+++ ament_cmake_core/cmake/environment/ament_cmake_environment_package_hook.cmake
@@ -30,17 +30,7 @@
 endfunction()

 function(ament_cmake_environment_generate_parent_prefix_path_marker)
-  if(NOT "$ENV{AMENT_PREFIX_PATH} " STREQUAL " ")
-    set(marker_file
-      "${CMAKE_CURRENT_BINARY_DIR}/ament_cmake_environment/parent_prefix_path")
-    file(WRITE "${marker_file}" "$ENV{AMENT_PREFIX_PATH}")
-    file(MD5 "${marker_file}" md5)
-    install(
-      FILES "${marker_file}"
-      DESTINATION "share/ament_parent_prefix_path"
-      RENAME "${md5}"
-    )
-  endif()
+  ament_index_register_resource("parent_prefix_path" CONTENT "$ENV{AMENT_PREFIX_PATH}")
 endfunction()

 if(AMENT_CMAKE_ENVIRONMENT_PARENT_PREFIX_PATH_GENERATION)


ENH:  Revert back to previous git tag.

ENH:  Revert back to previous git tag.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -161,7 +161,7 @@

   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG fe002fcf5c5a47ebd3b52a80d5ec1bff7c9bdc8e) ##
+  set(${proj}_GIT_TAG fc03bcc92b11326b87c232c14eb234fc1f791f9f) ##
   set(ITK_VERSION_ID ITK-4.9) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


ENH:  Adding point set registration capabilities.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -150,7 +150,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
   set(${proj}_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git")
-  set(${proj}_GIT_TAG 6e55ef004c197d0e0850c9a65fe553c4156d3bcf)
+  set(${proj}_GIT_TAG a664dadfbc39d190449c6ecb9d0ffe93901a24d3)
   set(ITK_VERSION_ID ITK-4.7)

   ExternalProject_Add(${proj}


Better Cmake messages.

Better Cmake messages.

--- cmake/Compiler.cmake
+++ cmake/Compiler.cmake
@@ -2,7 +2,7 @@

 function(add_compile_options_if_supported)
     foreach(flag ${ARGN})
-        set(option_var option_supported${flag})
+        set(option_var option_supported_${flag})
         CHECK_CXX_COMPILER_FLAG(${flag} ${option_var})

         if( ${option_var} )


fix CUTI_USES_MSVC_UNIT_BACKEND declaration

--- cmake/FindCUTI.cmake
+++ cmake/FindCUTI.cmake
@@ -110,6 +110,7 @@
       find_package(VisualStudio REQUIRED)
       add_library(${target} SHARED ${ARGN} ${CUTI_INCLUDE} ${CUTI_PLUGIN_SRC})
       target_include_directories(${target} PRIVATE ${MSVC_UNIT_TEST_DIR}/include)
+      target_compile_definitions(${target} PUBLIC -DCUTI_USES_MSVC_UNIT_BACKEND)
     elseif(APPLE)
       #integrate tests to XCode
       find_package(XCTest REQUIRED)
@@ -130,7 +131,6 @@
 	target_link_libraries(${target} PRIVATE optimized ${CUTI_LIBRARIES_RELEASE} ${testee})

   if(MSVC)
-    target_compile_definitions(${target} PUBLIC -DCUTI_USES_MSVC_UNIT_BACKEND)
     target_compile_options(${target} PRIVATE "/Zi")
     if (MSVC_VERSION GREATER 1800)
       set_target_properties(${target} PROPERTIES LINK_FLAGS "/DEBUG:FASTLINK")


fptu: speedup cmake-stage for Windows (skip checking for GCC-related options).

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -98,46 +98,50 @@
     "Please consider upgrade to gcc 4.5+ or clang 3.2+.")
 endif()

-#
-# GCC started to warn for unused result starting from 4.2, and
-# this is when it introduced -Wno-unused-result
-# GCC can also be built on top of llvm runtime (on mac).
-#
-check_c_compiler_flag("-Wno-unused-const-variable" CC_HAS_WNO_UNUSED_CONST_VARIABLE)
-check_c_compiler_flag("-Wno-unused-result" CC_HAS_WNO_UNUSED_RESULT)
-check_c_compiler_flag("-Wno-unused-value" CC_HAS_WNO_UNUSED_VALUE)
-check_c_compiler_flag("-Wno-unused-function" CC_HAS_WNO_UNUSED_FUNCTION)
-check_c_compiler_flag("-fno-strict-aliasing" CC_HAS_FNO_STRICT_ALIASING)
-check_c_compiler_flag("-Wno-comment" CC_HAS_WNO_COMMENT)
-check_c_compiler_flag("-Wno-parentheses" CC_HAS_WNO_PARENTHESES)
-check_c_compiler_flag("-Wno-parentheses-equality" CC_HAS_WNO_PARENTHESES_EQUALITY)
-check_c_compiler_flag("-Wno-undefined-inline" CC_HAS_WNO_UNDEFINED_INLINE)
-check_c_compiler_flag("-Wno-dangling-else" CC_HAS_WNO_DANGLING_ELSE)
-check_c_compiler_flag("-Wno-tautological-compare" CC_HAS_WNO_TAUTOLOGICAL_COMPARE)
-check_c_compiler_flag("-Wno-misleading-indentation" CC_HAS_WNO_MISLEADING_INDENTATION)
-
-check_c_compiler_flag("-Wno-unknown-pragmas" CC_HAS_WNO_UNKNOWN_PRAGMAS)
-check_c_compiler_flag("-Wall" CC_HAS_WALL)
-check_c_compiler_flag("-Wextra" CC_HAS_WEXTRA)
-check_c_compiler_flag("-Werror" CC_HAS_WERROR)
-check_c_compiler_flag("-fexceptions" CC_HAS_FEXCEPTIONS)
-check_c_compiler_flag("-funwind-tables" CC_HAS_FUNWIND_TABLES)
-check_c_compiler_flag("-fno-omit-frame-pointer" CC_HAS_FNO_OMIT_FRAME_POINTER)
-check_c_compiler_flag("-fno-stack-protector" CC_HAS_FNO_STACK_PROTECTOR)
-check_c_compiler_flag("-fno-common" CC_HAS_FNO_COMMON)
-check_c_compiler_flag("-Wno-strict-aliasing" CC_HAS_WNO_STRICT_ALIASING)
-check_c_compiler_flag("-ggdb" CC_HAS_GGDB)
-check_c_compiler_flag("-fvisibility=hidden" CC_HAS_VISIBILITY)
-check_c_compiler_flag("-march=native" CC_HAS_ARCH_NATIVE)
-
-#
-# Check for an omp support
-set(CMAKE_REQUIRED_FLAGS "-fopenmp -Werror")
-check_cxx_source_compiles("int main(void) {
-  #pragma omp parallel
-  return 0;
-  }" HAVE_OPENMP)
-set(CMAKE_REQUIRED_FLAGS "")
+if(MSVC)
+  check_c_compiler_flag("/WX" CC_HAS_WERROR)
+else()
+  #
+  # GCC started to warn for unused result starting from 4.2, and
+  # this is when it introduced -Wno-unused-result
+  # GCC can also be built on top of llvm runtime (on mac).
+  #
+  check_c_compiler_flag("-Wno-unused-const-variable" CC_HAS_WNO_UNUSED_CONST_VARIABLE)
+  check_c_compiler_flag("-Wno-unused-result" CC_HAS_WNO_UNUSED_RESULT)
+  check_c_compiler_flag("-Wno-unused-value" CC_HAS_WNO_UNUSED_VALUE)
+  check_c_compiler_flag("-Wno-unused-function" CC_HAS_WNO_UNUSED_FUNCTION)
+  check_c_compiler_flag("-fno-strict-aliasing" CC_HAS_FNO_STRICT_ALIASING)
+  check_c_compiler_flag("-Wno-comment" CC_HAS_WNO_COMMENT)
+  check_c_compiler_flag("-Wno-parentheses" CC_HAS_WNO_PARENTHESES)
+  check_c_compiler_flag("-Wno-parentheses-equality" CC_HAS_WNO_PARENTHESES_EQUALITY)
+  check_c_compiler_flag("-Wno-undefined-inline" CC_HAS_WNO_UNDEFINED_INLINE)
+  check_c_compiler_flag("-Wno-dangling-else" CC_HAS_WNO_DANGLING_ELSE)
+  check_c_compiler_flag("-Wno-tautological-compare" CC_HAS_WNO_TAUTOLOGICAL_COMPARE)
+  check_c_compiler_flag("-Wno-misleading-indentation" CC_HAS_WNO_MISLEADING_INDENTATION)
+
+  check_c_compiler_flag("-Wno-unknown-pragmas" CC_HAS_WNO_UNKNOWN_PRAGMAS)
+  check_c_compiler_flag("-Wextra" CC_HAS_WEXTRA)
+  check_c_compiler_flag("-Werror" CC_HAS_WERROR)
+  check_c_compiler_flag("-fexceptions" CC_HAS_FEXCEPTIONS)
+  check_c_compiler_flag("-funwind-tables" CC_HAS_FUNWIND_TABLES)
+  check_c_compiler_flag("-fno-omit-frame-pointer" CC_HAS_FNO_OMIT_FRAME_POINTER)
+  check_c_compiler_flag("-fno-stack-protector" CC_HAS_FNO_STACK_PROTECTOR)
+  check_c_compiler_flag("-fno-common" CC_HAS_FNO_COMMON)
+  check_c_compiler_flag("-Wno-strict-aliasing" CC_HAS_WNO_STRICT_ALIASING)
+  check_c_compiler_flag("-ggdb" CC_HAS_GGDB)
+  check_c_compiler_flag("-fvisibility=hidden" CC_HAS_VISIBILITY)
+  check_c_compiler_flag("-march=native" CC_HAS_ARCH_NATIVE)
+  check_c_compiler_flag("-Wall" CC_HAS_WALL)
+
+  #
+  # Check for an omp support
+  set(CMAKE_REQUIRED_FLAGS "-fopenmp -Werror")
+  check_cxx_source_compiles("int main(void) {
+    #pragma omp parallel
+    return 0;
+    }" HAVE_OPENMP)
+  set(CMAKE_REQUIRED_FLAGS "")
+endif()

 #
 # Check for LTO support by GCC


Travis fix

Travis fix

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -1,6 +1,6 @@

 if(UNIX)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fPIC")
 #  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
 else()
   add_definitions(-D_WIN32_WINNT=0x601)


fix visual studio case to correctly use dynamic link with cppunit

--- cmake/findCUTI.cmake
+++ cmake/findCUTI.cmake
@@ -41,7 +41,7 @@
 	find_package(CppUnit REQUIRED)
 	add_definitions(-DCUTI_USES_CPPUNIT_BACKEND)
 	add_definitions(-DCPPUNIT_DLL)
-  IF(USE_CUTI_INTEGRATION)
+  IF(USE_CUTI_INTEGRATION OR WIN32)
 	  set(CUTI_LIBRARIES_DEBUG ${CPPUNIT_LIBRARIES_DEBUG})
 	  set(CUTI_LIBRARIES_RELEASE ${CPPUNIT_LIBRARIES_RELEASE})
   ELSE()


Add cgemm and zgemm unroll factors for core2

--- cmake/prebuild.cmake
+++ cmake/prebuild.cmake
@@ -124,6 +124,10 @@
       set(SGEMM_UNROLL_N 4)
       set(DGEMM_UNROLL_M 4)
       set(DGEMM_UNROLL_N 4)
+      set(CGEMM_DEFAULT_UNROLL_M 4)
+      set(CGEMM_DEFAULT_UNROLL_N 2)
+      set(ZGEMM_DEFAULT_UNROLL_M 2)
+      set(ZGEMM_DEFAULT_UNROLL_N 2)
   elseif ("${TCORE}" STREQUAL "ARMV7")
     file(APPEND ${TARGET_CONF_TEMP}
       "#define L1_DATA_SIZE\t65536\n"


explicitly call project() in toplevel CMakeLists.txt (#1106)

--- cmake/toplevel.cmake
+++ cmake/toplevel.cmake
@@ -2,6 +2,8 @@
 # catkin/cmake/toplevel.cmake

 cmake_minimum_required(VERSION 3.0.2)
+
+project(Project)

 set(CATKIN_TOPLEVEL TRUE)


Fix cmake settings for CentOS 8 with llvm 12

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -34,7 +34,7 @@
   if (VESPA_OS_DISTRO_NAME STREQUAL "CentOS Stream")
     set(DEFAULT_VESPA_LLVM_VERSION "12" PARENT_SCOPE)
   else()
-    set(DEFAULT_VESPA_LLVM_VERSION "11" PARENT_SCOPE)
+    set(DEFAULT_VESPA_LLVM_VERSION "12" PARENT_SCOPE)
   endif()
 endfunction()


ENH:  Review.

ENH:  Review.

--- Modules/Remote/AdaptiveDenoising.remote.cmake
+++ Modules/Remote/AdaptiveDenoising.remote.cmake
@@ -1,6 +1,6 @@
 #-- # Grading Level Criteria Report
-#-- EVALUATION DATE:
-#-- EVALUATORS:
+#-- EVALUATION DATE: 09/28/2020
+#-- EVALUATORS: Nick Tustison
 #--
 #-- ## Compliance level 5 star (AKA ITK main modules, or remote modules that could become core modules)
 #--   - [ ] Widespread community dependance
@@ -11,29 +11,29 @@
 #--
 #-- ## Compliance Level 4 star (Very high-quality code, perhaps small community dependance)
 #--   - [ ] Meets all ITK code style standards
-#--   - [ ] No external requirements beyond those needed by ITK proper
+#--   - [ X ] No external requirements beyond those needed by ITK proper
 #--   - [ ] Builds and passes tests on all supported platforms within 1 month of each core tagged release
 #--            - [ ] Windows Shared Library Build with Visual Studio
 #--            - [ ] Mac with clang compiller
 #--            - [ ] Linux with gcc compiler
-#--   - [ ] Active developer community dedicated to maintaining code-base
+#--   - [ X ] Active developer community dedicated to maintaining code-base
 #--   - [ ] 75% code coverage demonstrated for testing suite
-#--   - [ ] Continuous integration testing performed
+#--   - [ X ] Continuous integration testing performed
 #--   - [ ] All requirements of Levels 3,2,1
 #--
 #-- ## Compliance Level 3 star (Quality beta code)
-#--   - [ ] API | executable interface is considered mostly stable and feature complete
-#--   - [ ] 10% C0-code coverage demonstrated for testing suite
-#--   - [ ] Some tests exist and pass on at least some platform
-#--   - [ ] All requirements of Levels 2,1
+#--   - [ X ] API | executable interface is considered mostly stable and feature complete
+#--   - [ X ] 10% C0-code coverage demonstrated for testing suite
+#--   - [ X ] Some tests exist and pass on at least some platform
+#--   - [ X ] All requirements of Levels 2,1
 #--
 #-- ## Compliance Level 2 star (Alpha code feature API development or niche community/exectution environment dependance )
-#--   - [ ] Compiles for at least 1 niche set of execution envirionments, and perhaps others
+#--   - [ X ] Compiles for at least 1 niche set of execution envirionments, and perhaps others
 #--         (may depend on specific external tools like a java environment, or specific external libraries to work )
-#--   - [ ] All requirements of Levels 1
+#--   - [ X ] All requirements of Levels 1
 #--
 #-- ## Compliance Level 1 star (Pre-alpha features under development and code of unkown quality)
-#--   - [ ] Code complies on at least 1 platform
+#--   - [ X ] Code complies on at least 1 platform
 #--
 #-- ## Compliance Level 0 star ( Code/Feature of known poor-quality or deprecated status )
 #--   - [ ] Code reviewed and explicitly identified as not recommended for use
@@ -54,7 +54,7 @@
   Insight Journal.
   http://insight-journal.org/browse/publication/979.
   "
-  MODULE_COMPLIANCE_LEVEL
+  MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/ntustison/ITKAdaptiveDenoising.git
   GIT_TAG ef309a1f050a2f7b1102f5024cf4997cd284266b
 )


COMP: Make initial HDF5 discovery of 1.8.16 quiet.

Avoid the warning:

CMake Warning at Modules/ThirdParty/HDF5/itk-module-init.cmake:7 (find_package):
  Could not find a package configuration file provided by "HDF5" with any of
  the following names:

    HDF5Config.cmake
    hdf5-config.cmake

  Add the installation prefix of "HDF5" to CMAKE_PREFIX_PATH or set
  "HDF5_DIR" to a directory containing one of the above files.  If "HDF5"
  provides a separate development package or SDK, be sure it has been
  installed.

when HDF5 1.8.15 or lower is installed.

Change-Id: Ie7a5dac8da8d3e85c62cc01c8d5a8ed5f18f5d93

--- Modules/ThirdParty/HDF5/itk-module-init.cmake
+++ Modules/ThirdParty/HDF5/itk-module-init.cmake
@@ -2,9 +2,9 @@
 mark_as_advanced(ITK_USE_SYSTEM_HDF5)
 if(ITK_USE_SYSTEM_HDF5)
   if(BUILD_SHARED_LIBS)
-    find_package(HDF5 NO_MODULE COMPONENTS CXX C shared)
+    find_package(HDF5 QUIET NO_MODULE COMPONENTS CXX C shared)
   else()
-    find_package(HDF5 NO_MODULE COMPONENTS CXX C static)
+    find_package(HDF5 QUIET NO_MODULE COMPONENTS CXX C static)
   endif()

   if(NOT HDF5_FOUND)


queue: remove deleted files from source list

--- sal/list.cmake
+++ sal/list.cmake
@@ -10,9 +10,7 @@
   sal/__bits/fmtval.hpp
   sal/queue.hpp
   sal/__bits/queue_intrusive.hpp
-  sal/__bits/queue_mpmc.hpp
   sal/__bits/queue_mpsc.hpp
-  sal/__bits/queue_spmc.hpp
   sal/__bits/queue_spsc.hpp
   sal/spinlock.hpp
   sal/thread.hpp


LUABRIDGE_INCLUDE_DIR should be marked as advanced

* hide this cmake variable in the advanced settings of ccmake/cmake-gui
* see issue https://github.com/smanders/externpro/issues/142

--- projects/use/usexp-lua-config.cmake
+++ projects/use/usexp-lua-config.cmake
@@ -23,4 +23,4 @@
 list(APPEND ${PRJ}_INCLUDE_DIR ${${PRJB}_INCLUDE_DIR})
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(${prj} REQUIRED_VARS ${reqVars})
-mark_as_advanced(${reqVars})
+mark_as_advanced(${reqVars} ${PRJB}_INCLUDE_DIR)


version: use + to separate latest tag and the latest tag distance

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

--- cmake/hg.cmake
+++ cmake/hg.cmake
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2017 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+# Copyright (c) 2017-2019 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -42,7 +42,7 @@

 # TODO: if there are uncommitted changes, append -dirty
 gethgrev(VERSION
-	"{ifeq(latesttagdistance,0,\"{latesttag}\",\"{latesttag}-{latesttagdistance}-{node|short}\")}"
+	"{ifeq(latesttagdistance,0,\"{latesttag}\",\"{latesttag}+{latesttagdistance}-{node|short}\")}"
 	"${JEFFPC_VERSION}")

 if(${HG_COMMIT_STR} STREQUAL "0000000000000000000000000000000000000000")


conan: os.cmake update

conan: os.cmake update

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -296,7 +296,7 @@
   #  DEPEN
   #TODO if not debug strip
   if (CMAKE_BUILD_TYPE MATCHES DEBUG)
-    set(STRIP_LV "echo debug")
+    set(STRIP_LV )
   else()
     set(STRIP_LV strip --strip-all ${CMAKE_BINARY_DIR}/${TARGET})
   endif()
@@ -325,34 +325,42 @@
   target_link_libraries(${TARGET}${ELF_POSTFIX} ${ARGN})
 endfunction()

+function (os_add_library_from_path TARGET LIBRARY PATH)
+  set(FILE_NAME "${PATH}/lib${LIBRARY}.a")
+
+  if(NOT EXISTS ${FILE_NAME})
+    message(FATAL_ERROR "Library lib${LIBRARY}.a not found at ${PATH}")
+    return()
+  endif()
+
+  add_library(${LIBRARY} STATIC IMPORTED)
+  set_target_properties(${LIBRARY} PROPERTIES LINKER_LANGUAGE CXX)
+  set_target_properties(${LIBRARY} PROPERTIES IMPORTED_LOCATION ${FILE_NAME})
+  os_link_libraries(${TARGET}  --whole-archive ${LIBRARY} --no-whole-archive)
+endfunction()
+
 function (os_add_drivers TARGET)
-
   foreach(DRIVER ${ARGN})
-    add_library(${DRIVER} STATIC IMPORTED)
-    set_target_properties(${DRIVER} PROPERTIES LINKER_LANGUAGE CXX)
-    set(FILE_NAME "${INCLUDEOS_PREFIX}/${ARCH}/drivers/lib${DRIVER}.a")
-    if (EXISTS ${FILE_NAME})
-      set_target_properties(${DRIVER} PROPERTIES IMPORTED_LOCATION ${INCLUDEOS_PREFIX}/${ARCH}/drivers/lib${DRIVER}.a)
-    else()
-      message(FATAL_ERROR "Driver ${DRIVER} does not found expected ${FILE_NAME}")
-    endif()
-    os_link_libraries(${TARGET} ${DRIVER})
-    os_link_libraries(${TARGET}  --whole-archive ${DRIVER} --no-whole-archive)
+    os_add_library_from_path(${TARGET} ${DRIVER} "${INCLUDEOS_PREFIX}/${ARCH}/drivers")
   endforeach()
 endfunction()

+function(os_add_plugins TARGET)
+  foreach(PLUGIN ${ARGN})
+    os_add_library_from_path(${TARGET} ${PLUGIN} "${INCLUDEOS_PREFIX}/${ARCH}/plugins")
+  endforeach()
+endfunction()

 function (os_add_stdout TARGET DRIVER)
-  add_library(${DRIVER} STATIC IMPORTED)
-  set_target_properties(${DRIVER} PROPERTIES LINKER_LANGUAGE CXX)
-  set_target_properties(${DRIVER} PROPERTIES IMPORTED_LOCATION ${INCLUDEOS_PREFIX}/${ARCH}/drivers/stdout/lib${DRIVER}.a)
-  os_link_libraries(${TARGET}  --whole-archive ${DRIVER} --no-whole-archive)
+   os_add_library_from_path(${TARGET} ${DRIVER} "${INCLUDEOS_PREFIX}/${ARCH}/drivers/stdout")
 endfunction()

 function(os_add_os_library TARGET)
-   message(FATAL_ERROR "Function not implemented yet")
+   message(FATAL_ERROR "Function not implemented yet.. pull from conan or install to lib ?")
   #target_link_libraries(${TARGET}${ELF_POSTFIX} ${ARGN})
 endfunction()
+
+

 #TODO investigate could be wrapped in generic embed object ?
 #If the user sets the config.json in the CMAKE then at least he knows its inluded :)
@@ -382,6 +390,7 @@

+
 function(os_install)
   set(options OPTIONAL)
   set(oneValueArgs DESTINATION)


version 0.0.3.0 and vlc 2.0.6

version 0.0.3.0 and vlc 2.0.6

--- PluginConfig.cmake
+++ PluginConfig.cmake
@@ -8,12 +8,12 @@
 set(PLUGIN_NAME "FBVLC")
 set(PLUGIN_PREFIX "FBVLC")
 set(COMPANY_NAME "RSATom")
-set(PLUGIN_VERSION "0.0.2.0")
+set(PLUGIN_VERSION "0.0.3.0")

 #if you want embed vlc into FBVLC distribution:
 # 1) place vlc into FBVLC\Win\WiX\vlc-${VLC_VERSION}
 # 2) uncomment following line
-set(VLC_VERSION "2.0.5")
+set(VLC_VERSION "2.0.6")
 # 3) run prepXXXX.cmd from FireBreath

 #unfortunately current implementation does not work :(


SVN_SILENT made messages (.desktop file)

--- xine/xine.desktop.cmake
+++ xine/xine.desktop.cmake
@@ -64,6 +64,7 @@

 Comment=Phonon Xine backend
 Comment[bg]=Phonon през Xine
+Comment[bs]=Xine kao pozadina za Phonon
 Comment[ca]=Dorsal del Xine pel Phonon
 Comment[ca@valencia]=Dorsal del Xine pel Phonon
 Comment[cs]=Phonon Xine backend


CMake: In case of C++14 support, check whether std::max/min support constexpr

--- cmake/checks/check_01_cxx_features.cmake
+++ cmake/checks/check_01_cxx_features.cmake
@@ -49,6 +49,7 @@
   SET(DEAL_II_WITH_CXX17 OFF CACHE STRING "" FORCE)
 ENDIF()

+#
 # Check the user supplied DEAL_II_CXX_VERSION_FLAG
 #

@@ -184,6 +185,22 @@
       DEAL_II_HAVE_CXX14_MAKE_UNIQUE)

     #
+    # This test checks constexpr std::max/min support. Unfortunately,
+    # gcc-4.9 does claim to support C++14 but fails to provide a constexpr
+    # compatible std::max/min. Disable C++14 support in this case.
+    #
+    CHECK_CXX_SOURCE_COMPILES(
+      "
+      #include <algorithm>
+      int main()
+      {
+          constexpr int max = std::max(0,1);
+      }
+      "
+      DEAL_II_HAVE_CXX14_CONSTEXPR_STDMAXMIN)
+
+
+    #
     # Clang-3.5* or older, bail out with a spurious error message in case
     # of an undeduced auto return type.
     #
@@ -207,7 +224,8 @@
   ENDIF()

   IF( DEAL_II_HAVE_CXX14_MAKE_UNIQUE AND
-      DEAL_II_HAVE_CXX14_CLANGAUTODEBUG_BUG_OK )
+      DEAL_II_HAVE_CXX14_CLANGAUTODEBUG_BUG_OK AND
+      DEAL_II_HAVE_CXX14_CONSTEXPR_STDMAXMIN)
     SET(DEAL_II_HAVE_CXX14 TRUE)
   ELSE()
     IF(NOT _user_provided_cxx_version_flag)


refs #5889 fix O_DIRECT detection

refs #5889 fix O_DIRECT detection

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@52239 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuFeatureDetection.cmake
+++ cmake_modules/TokuFeatureDetection.cmake
@@ -54,6 +54,9 @@
 ## check whether we have CLOCK_REALTIME
 check_symbol_exists(CLOCK_REALTIME "time.h" HAVE_CLOCK_REALTIME)
 ## check how to do direct I/O
+if (NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+  set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+endif ()
 check_symbol_exists(O_DIRECT "fcntl.h" HAVE_O_DIRECT)
 check_symbol_exists(F_NOCACHE "fcntl.h" HAVE_F_NOCACHE)


Fix CPPUNIT detection when its library directory contains -l (like -L/usr/lib/x86_64-linux-gnu in Ubuntu 13.10)

--- salome_adm/cmake_files/FindCppUnit.cmake
+++ salome_adm/cmake_files/FindCppUnit.cmake
@@ -60,20 +60,28 @@
     MESSAGE(FATAL_ERROR "Error in CPPUNIT detection ! cppunit-config executable not found !")
   ENDIF(NOT CPPUNIT_CONFIG_BIN)
   EXECUTE_PROCESS(COMMAND ${CPPUNIT_CONFIG_BIN} --libs OUTPUT_VARIABLE CPPUNIT_LDFLAGS)
-  STRING( REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" CPPUNIT_TMP4 "${CPPUNIT_LDFLAGS}" )
-  IF(CPPUNIT_TMP4)
-    STRING( REGEX REPLACE "^-L" "" CPPUNIT_LIBRARY_DIRS ${CPPUNIT_TMP4})
-    LIST(APPEND CMAKE_LIBRARY_PATH ${CPPUNIT_LIBRARY_DIRS})
-  ENDIF(CPPUNIT_TMP4)
-  STRING( REGEX MATCHALL "-l([^\", \n]+)" CPPUNIT_TMP5 "${CPPUNIT_LDFLAGS}" )
-  FOREACH(LIB ${CPPUNIT_TMP5})
-    STRING(REGEX REPLACE "^-l" "" LIB2 ${LIB})
-    FIND_LIBRARY(CPPUNIT_SUBLIB_${LIB2} ${LIB2})
-    IF(NOT CPPUNIT_SUBLIB_${LIB2})
-      MESSAGE(FATAL_ERROR "Error in CPPUNIT detection ! Fail to locate the needed library ${LIB2} !")
-    ENDIF(NOT CPPUNIT_SUBLIB_${LIB2})
-    LIST(APPEND CPPUNIT_LIBRARIES ${CPPUNIT_SUBLIB_${LIB2}})
-  ENDFOREACH(LIB ${CPPUNIT_TMP5})
+  STRING(STRIP ${CPPUNIT_LDFLAGS} CPPUNIT_LDFLAGS)
+  STRING(REPLACE " " ";" LDFLAGS_LIST ${CPPUNIT_LDFLAGS})
+  FOREACH(LDFLAG ${LDFLAGS_LIST})
+    STRING(REGEX MATCH "^-L.*" LIBDIR "${LDFLAG}")
+    STRING(REGEX MATCH "^-l.*" LIB "${LDFLAG}")
+    IF(LIBDIR)
+      STRING(REGEX REPLACE "^-L" "" LIBDIR ${LIBDIR})
+      LIST(APPEND CMAKE_LIBRARY_PATH ${LIBDIR})
+    ELSEIF(LIB)
+      STRING(REGEX REPLACE "^-l" "" LIB ${LIB})
+      LIST(APPEND LIBS ${LIB})
+    ELSE()
+      MESSAGE(FATAL_ERROR "Unrecognized token \"${LDFLAG}\" in the output of cppunit-config --libs")
+    ENDIF()
+  ENDFOREACH(LDFLAG ${LDFLAGS_LIST})
+  FOREACH(LIB ${LIBS})
+    FIND_LIBRARY(CPPUNIT_SUBLIB_${LIB} ${LIB})
+    IF(NOT CPPUNIT_SUBLIB_${LIB})
+      MESSAGE(FATAL_ERROR "Error in CPPUNIT detection! Fail to locate the needed library ${LIB}!")
+    ENDIF(NOT CPPUNIT_SUBLIB_${LIB})
+    LIST(APPEND CPPUNIT_LIBRARIES ${CPPUNIT_SUBLIB_${LIB}})
+  ENDFOREACH(LIB ${LIBS})
 #  MESSAGE("**** ${CPPUNIT_LIBRARIES}")
 ENDIF(WIN32)


[numerics] remove ortiz w/ LATIN{,_W}

[numerics] remove ortiz w/ LATIN{,_W}

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -81,7 +81,10 @@
   SET(test-LCP_CPG-lcp_CPS_4bis_PROPERTIES WILL_FAIL TRUE)

   # problem with Cholesky here
-  SET_LCP_TEST_AS_FAILED("exp_murty;exp_murty2;ortiz" "LATIN;LATIN_W")
+  SET_LCP_TEST_AS_FAILED("exp_murty;exp_murty2" "LATIN;LATIN_W")
+  RM_TEST2(SICONOS_LCP_LATIN "lcp_ortiz.dat")
+  RM_TEST2(SICONOS_LCP_LATIN_W "lcp_ortiz.dat")
+
   # QP reformulation does not always work when the matrix is not symmetric
   # Use NSQP
   SET_LCP_TEST_AS_FAILED("exp_murty;exp_murty2;ortiz;enum_fails;CPS_2;CPS_3;CPS_4;CPS_4bis" "QP")


added cylemon dependency

added cylemon dependency

--- ilastik.cmake
+++ ilastik.cmake
@@ -29,6 +29,7 @@
 include (lazyflow)
 include (yapsy)
 include (pgmlink)
+include (cylemon)

 external_git_repo (ilastik
     HEAD
@@ -42,6 +43,7 @@
         DEPENDS             ${vigra_NAME} ${h5py_NAME} ${psutil_NAME}
                             ${blist_NAME} ${greenlet_NAME} ${volumina_NAME}
 			    ${lazyflow_NAME} ${yapsy_NAME} ${pgmlink_NAME}
+                            ${cylemon_NAME}
         PREFIX              ${BUILDEM_DIR}
         GIT_REPOSITORY      ${ilastik_URL}
         UPDATE_COMMAND      ""


CMake: Improve error message for invalid user provided CXX and LD flags

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@32314 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_compiler_flags.cmake
+++ deal.II/cmake/setup_compiler_flags.cmake
@@ -66,12 +66,14 @@
 # Check the user provided CXX flags:
 #

-IF(NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_FLAGS_SAVED}")
+IF( NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_FLAGS_SAVED}"
+    OR NOT "${DEAL_II_LINKER_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_LINKER_FLAGS_SAVED}")
   MESSAGE(STATUS "")
   # Rerun this test if cxx flags changed:
   UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
 ENDIF()
 SET(CACHED_DEAL_II_CXX_FLAGS_SAVED "${DEAL_II_CXX_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)
+SET(CACHED_DEAL_II_LINKER_FLAGS_SAVED "${DEAL_II_LINKER_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)

 # Initialize all CMAKE_REQUIRED_* variables a this point:
 RESET_CMAKE_REQUIRED()
@@ -82,11 +84,12 @@

 IF(NOT DEAL_II_HAVE_USABLE_CXX_FLAGS)
   UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
-  MESSAGE(FATAL_ERROR "\n"
-    "Configuration error: Cannot compile with the user supplied CXX flags:\n"
-    "${DEAL_II_CXX_FLAGS_SAVED}\n"
-    "Please check the CMake variable DEAL_II_CXX_FLAGS and the\n"
-    "environment variable CXXFLAGS\n\n"
+  MESSAGE(FATAL_ERROR "
+Configuration error: Cannot compile with the user supplied flags:
+CXX flags: ${DEAL_II_CXX_FLAGS_SAVED}
+LD flags: ${DEAL_II_LINKER_FLAGS_SAVED}
+Please check the CMake variables DEAL_II_CXX_FLAGS, DEAL_II_LINKER_FLAGS
+and the environment variables CXXFLAGS, LDFLAGS.\n\n"
     )
 ENDIF()


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -365,7 +365,7 @@

 endmacro()

-function(cmaki2_executable)
+function(cmaki_executable)
 	cmaki_parse_parameters(${ARGV})
 	set(_EXECUTABLE_NAME ${_MAIN_NAME})
 	source_group( "Source Files" FILES ${_SOURCES} )
@@ -409,7 +409,7 @@

 endfunction()

-function(cmaki2_library)
+function(cmaki_library)
 	cmaki_parse_parameters(${ARGV})
 	set(_LIBRARY_NAME ${_MAIN_NAME})
 	source_group( "Source Files" FILES ${_SOURCES} )
@@ -447,7 +447,7 @@
 	endforeach()
 endfunction()

-function(cmaki2_static_library)
+function(cmaki_static_library)
 	cmaki_parse_parameters(${ARGV})
 	set(_LIBRARY_NAME ${_MAIN_NAME})
 	source_group( "Source Files" FILES ${_SOURCES} )
@@ -486,7 +486,7 @@
 	endforeach()
 endfunction()

-function(cmaki2_test)
+function(cmaki_test)
 	cmaki_parse_parameters(${ARGV})
 	set(_TEST_NAME ${_MAIN_NAME})
 	set(_TEST_SUFFIX "_unittest")
@@ -575,15 +575,15 @@

 endfunction()

-macro(cmaki2_gtest)
+macro(cmaki_google_test)
 	cmaki_find_package(google-gmock)
-	cmaki2_test(${ARGV})
+	cmaki_test(${ARGV})
 endmacro()

 macro(cmaki_python_library)
 	cmaki_find_package(python)
 	cmaki_find_package(boost-python)
-	cmaki2_library(${ARGV} PTHREADS)
+	cmaki_library(${ARGV} PTHREADS)
 	cmaki_parse_parameters(${ARGV})
 	set_target_properties(${_MAIN_NAME} PROPERTIES PREFIX "")
 	foreach(BUILD_TYPE ${CMAKE_BUILD_TYPE})
@@ -596,7 +596,7 @@
 macro(cmaki_boost_python_test)
 	cmaki_find_package(python)
 	cmaki_find_package(boost-python)
-	cmaki2_gtest(${ARGV} PTHREADS)
+	cmaki_google_test(${ARGV} PTHREADS)
 	cmaki_parse_parameters(${ARGV})
 	set_tests_properties(${_MAIN_NAME}_test PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE}")
 endmacro()


Windows container may use lower case paths

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -242,7 +242,10 @@
 macro (_get_program_names _outProgramNames)
 	set (${_outProgramNames} "")
 	# Mathematica products in order of preference
-	set (_MathematicaApps "Mathematica" "Wolfram Desktop" "Wolfram Engine" "gridMathematica Server")
+	set (_MathematicaApps
+		"mathematica" "Mathematica"
+		"Wolfram Desktop" "Wolfram Engine"
+		"gridMathematica Server")
 	# Mathematica product versions in order of preference
 	set (_MathematicaVersions
 		"12.3" "12.2" "12.1" "12.0"
@@ -461,6 +464,14 @@
 				list (APPEND ${_outSearchPaths} "${_unixPath}/Wolfram Research" )
 			endif()
 		endforeach()
+		# add default installation path
+		if (IS_DIRECTORY "C:/Program Files/Wolfram Research")
+			list (APPEND ${_outSearchPaths} "C:/Program Files/Wolfram Research" )
+		endif()
+		# Windows container paths may be lowercase
+		if (IS_DIRECTORY "C:/Program Files/wolfram research")
+			list (APPEND ${_outSearchPaths} "C:/Program Files/wolfram research" )
+		endif()
 	elseif (CMAKE_HOST_APPLE)
 		# add standard Mathematica Mac OS X installation paths
 		list (APPEND ${_outSearchPaths} "~/Applications;/Applications")


fix broken launch services database search under Catalina

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -367,7 +367,7 @@
 		foreach (_bundleID IN ITEMS ${ARGN})
 			execute_process(
 				COMMAND "${Mathematica_LSRegister_EXECUTABLE}" "-dump"
-				COMMAND "grep" "--before-context=20" "--after-context=20" " ${_bundleID} "
+				COMMAND "grep" "--before-context=20" "--after-context=20" "${_bundleID}"
 				COMMAND "grep" "--only-matching" "/.*\\.app"
 				TIMEOUT 10 OUTPUT_VARIABLE _queryResult ERROR_QUIET)
 			string (REPLACE ";" "\\;" _queryResult "${_queryResult}")


Allow embedding of Dependencies source build into the Ogre source tree

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -199,6 +199,19 @@
   endif (OGRE_BUILD_PLATFORM_IPHONE)
 endif(APPLE)

+
+# now see if we have a buildable Dependencies package in
+# the source tree. If so, include that, and it will take care of
+# setting everything up, including overriding any of the above
+# findings.
+set(OGREDEPS_RUNTIME_OUTPUT ${OGRE_RUNTIME_OUTPUT})
+if (EXISTS "${OGRE_SOURCE_DIR}/Dependencies/CMakeLists.txt")
+  add_subdirectory(Dependencies)
+elseif (EXISTS "${OGRE_SOURCE_DIR}/ogredeps/CMakeLists.txt")
+  add_subdirectory(ogredeps)
+endif ()
+
+
 # Display results, terminate if anything required is missing
 MACRO_DISPLAY_FEATURE_LOG()


CMake: Dependencies - update SDL2 to 2.0.14

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -182,15 +182,15 @@
     if(MSVC OR MINGW) # other platforms dont need this
         message(STATUS "Building SDL2")
         file(DOWNLOAD
-            https://libsdl.org/release/SDL2-2.0.10.tar.gz
-            ${PROJECT_BINARY_DIR}/SDL2-2.0.10.tar.gz)
+            https://libsdl.org/release/SDL2-2.0.14.tar.gz
+            ${PROJECT_BINARY_DIR}/SDL2-2.0.14.tar.gz)
         execute_process(COMMAND ${CMAKE_COMMAND}
-            -E tar xf SDL2-2.0.10.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
+            -E tar xf SDL2-2.0.14.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
         execute_process(COMMAND ${CMAKE_COMMAND}
             -E make_directory ${PROJECT_BINARY_DIR}/SDL2-build)
         execute_process(COMMAND ${BUILD_COMMAND_COMMON}
             -DSDL_STATIC=FALSE
-            ${PROJECT_BINARY_DIR}/SDL2-2.0.10
+            ${PROJECT_BINARY_DIR}/SDL2-2.0.14
             WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/SDL2-build)
         execute_process(COMMAND ${CMAKE_COMMAND}
             --build ${PROJECT_BINARY_DIR}/SDL2-build ${BUILD_COMMAND_OPTS})


Update CTK

Update CTK

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

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag "78341aba")
+    set(revision_tag "7210c5bc")

     set(ctk_optional_cache_args )
     if(MITK_USE_Python3)


CTK hash update

CTK hash update

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

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 9331130f)
+    set(revision_tag 9331130f+65420ed0+e57224a2)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()
@@ -72,7 +72,7 @@
       BINARY_DIR ${proj}-build
       PREFIX ${proj}-cmake
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 c6f66556103c8d0dcae4e7db5eb0f77e
+      URL_MD5 0ee6baf7333b3bb53480453311f4a3ee
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Fixed Gtkmm.cmake

Fixed Gtkmm.cmake

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

--- CMakeModules/Gtkmm.cmake
+++ CMakeModules/Gtkmm.cmake
@@ -9,8 +9,8 @@

 macro (INCLUDE_GTKMM)
     if (MSVC)
-        include_directories
-            ($ENV{GTKMM_BASEPATH}/include/gtk-2.0/gdk
+        include_directories (
+		    $ENV{GTKMM_BASEPATH}/include/gtk-2.0/gdk
             $ENV{GTKMM_BASEPATH}/include/atk-1.0
             $ENV{GTKMM_BASEPATH}/lib/gtk-2.0/include
             $ENV{GTKMM_BASEPATH}/include/gdkmm-2.4


Remove inttypes stuff from config.h.cmake

--- config.h.cmake
+++ config.h.cmake
@@ -1,13 +1,4 @@
 #ifndef OPENSLIDE_CONFIG_H
 #define OPENSLIDE_CONFIG_H

-/* defined if "inttypes.h" is availabel */
-#cmakedefine HAVE_INTTYPES_H
-
-/* 16 bit format */
-#cmakedefine PRIu16 @PRIu16@
-
-/* 64 bit format */
-#cmakedefine PRId64 @PRId64@
-
 #endif


Added a macro fior installing executable

--- build/macros.cmake
+++ build/macros.cmake
@@ -106,6 +106,15 @@
 		list(GET VERSION_PARTS 2 ${_prefix}_PATCH)
 	else()
 		message(FATAL_ERROR "Invalid version: ${${_ver}}")
+	endif()
+endmacro()
+
+macro(install_exe _targ)
+	if(NOT SKIP_INSTALL_ALL)
+		install(
+			TARGETS ${_targ}
+			RUNTIME DESTINATION "${ORK_INSTALL_BIN_DIR}" COMPONENT Runtime
+		)
 	endif()
 endmacro()


Fix time for start nightly build with (Central European Summer Time)

git-svn-id: 8b72b58fb31a931b6e9a2bd3bb08bc6614045fb1@3468 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- test/CTestConfig.cmake
+++ test/CTestConfig.cmake
@@ -1,7 +1,7 @@
 #ctest_submit(                                             RETURN_VALUE res)

 SET(CTEST_PROJECT_NAME "OpenViBe")
-SET(CTEST_NIGHTLY_START_TIME "20:00:00 EST")
+SET(CTEST_NIGHTLY_START_TIME "20:00:00 CEST")
 SET(CTEST_DROP_METHOD "http")
 SET(CTEST_DROP_SITE "cdash.inria.fr")
 SET(CTEST_DROP_LOCATION "/CDash/submit.php?project=OpenViBe")


[CMake][Fuchsia] Re-enable iOS runtimes for Fuchsia standard

Turned out this is used by Flutter which uses Fuchsia Clang toolchain.

Differential Revision: https://reviews.llvm.org/D57432

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@352586 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -35,7 +35,6 @@
   list(APPEND BUILTIN_TARGETS "default")
   list(APPEND RUNTIME_TARGETS "default")

-  set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
   set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
   set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
 endif()


CELIX-163: Added fixed Manifest-Version to Manifest

git-svn-id: 2595ac559ac7dd568b108f33b264eba7ab70070c@1632122 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/cmake_celix/Packaging.cmake
+++ cmake/cmake_celix/Packaging.cmake
@@ -153,6 +153,9 @@
     IF(BUNDLE_NAME)
         SET_HEADERS("Bundle-Name: ${BUNDLE_NAME}")
     ENDIF()
+
+    SET_HEADERS("Manifest-Version: 1.0")
+
 ENDMACRO()


Added comment to FindOpenJPEG2.cmake

Added comment to FindOpenJPEG2.cmake

--- cmake/modules/FindOpenJPEG2.cmake
+++ cmake/modules/FindOpenJPEG2.cmake
@@ -14,6 +14,8 @@
 ####################################################################################################

 # UseOPENJPEG.cmake ?
+
+# cf. FindPkgConfig: a pkg-config module for CMake

 # find_path(OPENJPEG2_INCLUDE_DIR openjpeg.h)
 exec_program("pkg-config"


Revert "Remove dead code."

Revert "Remove dead code."

This reverts commit 3a24679f1e70dc757382033e5678c12fee0ff5fd.

This triggered a discussion and people believe it is heavily used and
potentially breaking builds.

There are no current plans for using this for modules.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -232,10 +232,6 @@
       endif()
     endforeach()
   endif(ARG_OPTIONS)
-
-  if (ARG_DEPENDENCIES)
-    message(FATAL_ERROR "Unimplemented switch!")
-  endif(ARG_DEPENDENCIES)

   #---roottest compability---------------------------------
   if(CMAKE_ROOTTEST_DICT)
@@ -354,6 +350,13 @@
     set(rootmapargs )
   else()
     set(rootmapargs -rml ${library_name} -rmf ${rootmap_name})
+  endif()
+
+  #---Get the library and module dependencies-----------------
+  if(ARG_DEPENDENCIES)
+    foreach(dep ${ARG_DEPENDENCIES})
+      set(newargs ${newargs} -m  ${libprefix}${dep}_rdict.pcm)
+    endforeach()
   endif()

   #---what rootcling command to use--------------------------


generateManual: do not regenerate if man page is up to date

ROOT-9925 #close

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -1478,16 +1478,22 @@
 endfunction()

 #----------------------------------------------------------------------------
-# Generate man page through argparse method
-# The first argument pythonInput is the path of the python argparse file for this command
-# The second argument output is the of path/name of the output file
-#----------------------------------------------------------------------------
-function(generateManual name pythonInput output)
-     add_custom_target(${name} ALL
-          DEPENDS ${pythonInput} ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
-          COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
-                                          ${pythonInput}
-                                          ${output}
-     )
-     install(FILES ${output} DESTINATION ${CMAKE_INSTALL_MANDIR})
-endfunction()
+# Generate and install manual page with build/misc/argparse2help.py script
+# The 1st argument is the name of the manual page
+# The 2nd argument is the path to the python argparse input file
+# The 3rd argument is the path to the output manual page
+#----------------------------------------------------------------------------
+function(generateManual name input output)
+  add_custom_target(${name} ALL DEPENDS ${output})
+
+  add_custom_command(OUTPUT ${output}
+    MAIN_DEPENDENCY
+      ${input}
+    DEPENDS
+      ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
+    COMMAND
+      ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py ${input} ${output}
+  )
+
+  install(FILES ${output} DESTINATION ${CMAKE_INSTALL_MANDIR})
+endfunction()


The mystery that is Cg detection on Windows continues

--- cmake/FindCg.cmake
+++ cmake/FindCg.cmake
@@ -74,8 +74,8 @@
     FIND_LIBRARY( CG_LIBRARY
       NAMES Cg
       PATHS
+			${CG_LIB_SEARCH_PATH}
       $ENV{CG_LIB_PATH}
-			${CG_LIB_SEARCH_PATH}
       $ENV{PROGRAMFILES}/Cg
       ${PROJECT_SOURCE_DIR}/../Cg
       ${CG_COMPILER_SUPER_DIR}/lib


Now use @rpath rather than @executable_path on OS X (closes #434).

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -268,9 +268,13 @@
         SET(DISTRIB_BINARY_DIR ${DISTRIB_DIR})
     ENDIF()

-    # Set the RPATH information on Linux
-
-    IF(NOT WIN32 AND NOT APPLE)
+    # Set the RPATH information on Linux and OS X
+
+    IF(APPLE)
+        SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+
+        SET(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks;@executable_path/../PlugIns/${PROJECT_NAME}")
+    ELSEIF(NOT WIN32)
         SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
     ENDIF()
 ENDMACRO()
@@ -541,21 +545,6 @@

         OS_X_CLEAN_UP_FILE_WITH_QT_LIBRARIES(${PROJECT_NAME} ${DEST_PLUGINS_DIR} ${PLUGIN_FILENAME} ${QT_LIBRARIES})

-        # Make sure that the plugin refers to our embedded version of the other
-        # plugins on which it depends
-
-        FOREACH(PLUGIN ${PLUGINS})
-            # We don't know where the plugin is located, so we try our different
-            # plugin build directories
-
-            FOREACH(PLUGIN_BUILD_DIR ${PLUGIN_BUILD_DIRS})
-                ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
-                                   COMMAND install_name_tool -change @rpath/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN}${CMAKE_SHARED_LIBRARY_SUFFIX}
-                                                                     @executable_path/../PlugIns/${CMAKE_PROJECT_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN}${CMAKE_SHARED_LIBRARY_SUFFIX}
-                                                                     ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})
-            ENDFOREACH()
-        ENDFOREACH()
-
         # Make sure that the plugin refers to our embedded version of the
         # binary plugins on which it depends

@@ -564,7 +553,7 @@

             ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
                                COMMAND install_name_tool -change ${PLUGIN_BINARY}
-                                                                 @executable_path/../PlugIns/${CMAKE_PROJECT_NAME}/${PLUGIN_BINARY}
+                                                                 @rpath/${PLUGIN_BINARY}
                                                                  ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})
         ENDFOREACH()

@@ -574,7 +563,7 @@
         FOREACH(EXTERNAL_BINARY ${EXTERNAL_BINARIES})
             ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
                                COMMAND install_name_tool -change ${EXTERNAL_BINARY}
-                                                                 @executable_path/../Frameworks/${EXTERNAL_BINARY}
+                                                                 @rpath/${EXTERNAL_BINARY}
                                                                  ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})
         ENDFOREACH()
     ENDIF()
@@ -682,23 +671,6 @@

                     OS_X_CLEAN_UP_FILE_WITH_QT_LIBRARIES(${TEST_NAME} ${DEST_TESTS_DIR} ${TEST_FILENAME} ${QT_LIBRARIES})

-                    # Make sure that the plugin's tests refer to our embedded version of the other
-                    # plugins on which they depend
-
-                    LIST(APPEND PLUGINS ${PLUGIN_NAME})
-
-                    FOREACH(PLUGIN ${PLUGINS})
-                        # We don't know where the plugin is located, so we try our different
-                        # plugin build directories
-
-                        FOREACH(PLUGIN_BUILD_DIR ${PLUGIN_BUILD_DIRS})
-                            ADD_CUSTOM_COMMAND(TARGET ${TEST_NAME} POST_BUILD
-                                               COMMAND install_name_tool -change @rpath/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN}${CMAKE_SHARED_LIBRARY_SUFFIX}
-                                                                                @executable_path/../PlugIns/${CMAKE_PROJECT_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN}${CMAKE_SHARED_LIBRARY_SUFFIX}
-                                                                                ${DEST_TESTS_DIR}/${TEST_FILENAME})
-                        ENDFOREACH()
-                    ENDFOREACH()
-
                     # Make sure that the plugin's tests refer to our embedded version of the
                     # binary plugins on which they depend

@@ -707,7 +679,7 @@

                         ADD_CUSTOM_COMMAND(TARGET ${TEST_NAME} POST_BUILD
                                            COMMAND install_name_tool -change ${PLUGIN_BINARY}
-                                                                             @executable_path/../PlugIns/${CMAKE_PROJECT_NAME}/${PLUGIN_BINARY}
+                                                                             @rpath/${PLUGIN_BINARY}
                                                                              ${DEST_TESTS_DIR}/${TEST_FILENAME})
                     ENDFOREACH()

@@ -717,7 +689,7 @@
                     FOREACH(EXTERNAL_BINARY ${EXTERNAL_BINARIES})
                         ADD_CUSTOM_COMMAND(TARGET ${TEST_NAME} POST_BUILD
                                            COMMAND install_name_tool -change ${EXTERNAL_BINARY}
-                                                                             @executable_path/../Frameworks/${EXTERNAL_BINARY}
+                                                                             @rpath/${EXTERNAL_BINARY}
                                                                              ${DEST_TESTS_DIR}/${TEST_FILENAME})
                     ENDFOREACH()
                 ENDIF()
@@ -965,7 +937,7 @@

         ADD_CUSTOM_COMMAND(TARGET ${PROJECT_TARGET} POST_BUILD
                            COMMAND install_name_tool -change ${QT_LIBRARY_DIR}/${DEPENDENCY_FILENAME}
-                                                             @executable_path/../Frameworks/${DEPENDENCY_FILENAME}
+                                                             @rpath/${DEPENDENCY_FILENAME}
                                                              ${FULL_FILENAME})
     ENDFOREACH()
 ENDMACRO()
@@ -1043,7 +1015,7 @@

         ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
                            COMMAND install_name_tool -change ${DEPENDENCY_FILENAME}
-                                                             @executable_path/../Frameworks/${DEPENDENCY_FILENAME}
+                                                             @rpath/${DEPENDENCY_FILENAME}
                                                              ${LIBRARY_FILEPATH})
     ENDFOREACH()
 ENDMACRO()


[CLI] [CMake] Pass variable 'CMAKE_PREFIX_PATH' to submodules.

--- cmake/virgil.cmake
+++ cmake/virgil.cmake
@@ -107,6 +107,12 @@
             -DVIRGIL_SDK_KEYS:BOOL=ON
         )

+        if (CMAKE_PREFIX_PATH)
+            list (APPEND CMAKE_ARGS
+                -DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
+            )
+        endif (CMAKE_PREFIX_PATH)
+
         if (CMAKE_TOOLCHAIN_FILE)
             list (APPEND CMAKE_ARGS
                 -DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}


Symlink the node and bower dependencies into place within the source.

--- build/cmake/core-admin-ui.cmake
+++ build/cmake/core-admin-ui.cmake
@@ -55,3 +55,31 @@
   COMMAND cd ${CORE_BUILD_DIR}/tmp/admin-ui-build && env PATH=${DEV_INSTALL_PREFIX}/bin:$ENV{PATH} ./node_modules/.bin/ember build --environment=production --output-path=./dist-prod
   COMMAND touch ${STAMP_DIR}/core-admin-ui-build
 )
+
+# Normally we perform the yarn & bower installs out-of-source (so the build
+# takes place entirely out of source), but if testing/development is enabled
+# for this build, then also create a local symlink within the source. This then
+# allows for easier interactions with the application.
+if(ENABLE_TEST_DEPENDENCIES)
+  add_custom_command(
+    OUTPUT ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/node_modules
+    DEPENDS
+      ${STAMP_DIR}/core-admin-ui-yarn-install
+      ${CORE_BUILD_DIR}/tmp/admin-ui-build/node_modules
+    COMMAND rm -rf ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/node_modules
+    COMMAND ln -snf ${CORE_BUILD_DIR}/tmp/admin-ui-build/node_modules ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/node_modules
+    COMMAND touch -h ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/node_modules
+  )
+  add_custom_target(core-admin-ui-local-yarn ALL DEPENDS ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/node_modules)
+
+  add_custom_command(
+    OUTPUT ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/bower_components
+    DEPENDS
+      ${STAMP_DIR}/core-admin-ui-bower-install
+      ${CORE_BUILD_DIR}/tmp/admin-ui-build/bower_components
+    COMMAND rm -rf ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/bower_components
+    COMMAND ln -snf ${CORE_BUILD_DIR}/tmp/admin-ui-build/bower_components ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/bower_components
+    COMMAND touch -h ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/bower_components
+  )
+  add_custom_target(core-admin-ui-local-bower ALL DEPENDS ${CMAKE_SOURCE_DIR}/src/api-umbrella/admin-ui/bower_components)
+endif()


Fix elasticsearch upgrades.

Fix elasticsearch upgrades.

The elasticsearch archives appear to have files with identical
timestamps, even though the content differs. So switch to checksum-based
syncing so upgrades happen properly when dealing with a cached build
directory.

--- build/cmake/elasticsearch.cmake
+++ build/cmake/elasticsearch.cmake
@@ -7,7 +7,7 @@
   URL_HASH SHA1=${ELASTICSEARCH_HASH}
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ""
-  INSTALL_COMMAND rsync -a -v --delete-after <SOURCE_DIR>/ ${STAGE_EMBEDDED_DIR}/elasticsearch/
+  INSTALL_COMMAND rsync -a -v --checksum --delete-after <SOURCE_DIR>/ ${STAGE_EMBEDDED_DIR}/elasticsearch/
     COMMAND mkdir -p ${STAGE_EMBEDDED_DIR}/elasticsearch/plugins
     COMMAND cd ${STAGE_EMBEDDED_DIR}/bin && ln -snf ../elasticsearch/bin/plugin ./plugin
     COMMAND cd ${STAGE_EMBEDDED_DIR}/bin && ln -snf ../elasticsearch/bin/elasticsearch ./elasticsearch


disable -fsanitize=address

disable -fsanitize=address

--- cmake/CFlags.cmake
+++ cmake/CFlags.cmake
@@ -4,8 +4,9 @@
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lprotobuf -lz -lpthread")

 set(CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_CXX_FLAGS_DEBUG}")
-set(CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize=address ${CMAKE_CXX_FLAGS_DEBUG}")
-set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+set(CMAKE_CXX_FLAGS_DEBUG "-g ${CMAKE_CXX_FLAGS_DEBUG}")
+#set(CMAKE_CXX_FLAGS_DEBUG "-fsanitize=address ${CMAKE_CXX_FLAGS_DEBUG}")
+#set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")

 # OSX FLAGS
 if(APPLE)


Update to latest Plugin.cmake from cmake-modules

--- cmake/Plugin.cmake
+++ cmake/Plugin.cmake
@@ -9,11 +9,13 @@
   endif()

   if(CMAKE_COMPILER_IS_GNUCXX)
-    target_compile_options(${name} PRIVATE -Wno-attributes)
+    set_property(TARGET ${name} APPEND_STRING PROPERTY
+                 COMPILE_FLAGS " -Wno-attributes")
   endif()

   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-    target_compile_options(${name} PRIVATE -Wno-ignored-attributes)
+    set_property(TARGET ${name} APPEND_STRING PROPERTY
+                 COMPILE_FLAGS " -Wno-ignored-attributes")
   endif()

   if(WIN32 AND CMAKE_COMPILER_IS_GNUCC)


Post-fix for Bug#58158 on Solaris

Post-fix for Bug#58158 on Solaris

Problem : The build might fail with
make[2]: *** No rule to make target `../sql/z',
needed by `sql/mysqld_dtrace_all.o'.  Stop.
if one of plugins would depends on system libz
library

Fix: Filter out non-static dependent libraries
when dtracing static libs

--- cmake/dtrace.cmake
+++ cmake/dtrace.cmake
@@ -153,13 +153,23 @@
 # to mysqld.
 MACRO (DTRACE_INSTRUMENT_STATIC_LIBS target libs)
 IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND ENABLE_DTRACE)
+  # Filter out non-static libraries in the list, if any
+  SET(static_libs)
   FOREACH(lib ${libs})
+    GET_TARGET_PROPERTY(libtype ${lib} TYPE)
+    IF(libtype MATCHES STATIC_LIBRARY)
+      SET(static_libs ${static_lics} ${lib})
+    ENDIF()
+  ENDFOREACH()
+
+  FOREACH(lib ${static_libs})
     SET(dirs ${dirs} ${TARGET_OBJECT_DIRECTORY_${lib}})
   ENDFOREACH()
+
   SET (obj ${CMAKE_CURRENT_BINARY_DIR}/${target}_dtrace_all.o)
   ADD_CUSTOM_COMMAND(
   OUTPUT ${obj}
-  DEPENDS ${libs}
+  DEPENDS ${static_libs}
   COMMAND ${CMAKE_COMMAND}
    -DDTRACE=${DTRACE}
    -DOUTFILE=${obj}


install lib/ output to CMAKE_INSTALL_LIBDIR

--- cmake/macros.cmake
+++ cmake/macros.cmake
@@ -223,7 +223,7 @@
 macro(SET_INSTALL_DIRS)
   string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
   if (NOT DEFINED PDAL_LIB_INSTALL_DIR)
-    set(PDAL_LIB_INSTALL_DIR lib)
+      set(PDAL_LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
   endif ()
     set(PDAL_INCLUDE_INSTALL_ROOT "include/")
     set(PDAL_INCLUDE_INSTALL_DIR


thrift.cmake: - Explicitly provide python prefix. - Disable support for bindings other than ones supported by BuildEM: C++, go, python

--- thrift.cmake
+++ thrift.cmake
@@ -36,8 +36,14 @@
     PATCH_COMMAND       ""
     CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ./configure
         --prefix=${BUILDEM_DIR}
-        --with-boost=${BUILDEM_DIR}
-        PY_PREFIX=${BUILDEM_DIR}
+        --with-boost=${BUILDEM_DIR}
+        --with-openssl=${BUILDEM_DIR}
+        --with-haskell=no
+        --with-java=no
+        --with-php=no
+        --with-perl=no
+        --with-ruby=no
+        PY_PREFIX=${PYTHON_PREFIX}
         LDFLAGS=${BUILDEM_LDFLAGS}
         CPPFLAGS=-I${BUILDEM_DIR}/include
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} make
@@ -46,7 +52,7 @@
 )

 set (thrift_STATIC_LIBRARIES ${BUILDEM_LIB_DIR}/libthrift.a)
-set (thrift_LIBRARIES ${BUILDEM_LIB_DIR}/libthrift.so)
+set (thrift_LIBRARIES ${BUILDEM_LIB_DIR}/libthrift.${BUILDEM_PLATFORM_DYLIB_EXTENSION})

 set_target_properties(${thrift_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)


updated sl-compiler.cmake

updated sl-compiler.cmake

--- cmake-modules/sl-compiler.cmake
+++ cmake-modules/sl-compiler.cmake
@@ -5,8 +5,8 @@
         ##      ##
 ##########      ############################################################# shaduzlabs.com #######

-set (CMAKE_C_FLAGS "$CMAKE_C_FLAGS -fPIC")
-set (CMAKE_CXX_FLAGS "$CMAKE_CXX_FLAGS -fPIC")
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

 if( CMAKE_CXX_COMPILER_ID MATCHES "GNU|AppleClang|Clang" )
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=256 -std=c++11")


Do not set stack memory limit on OSX.

Do not set stack memory limit on OSX.

--- cmake/EthCompilerSettings.cmake
+++ cmake/EthCompilerSettings.cmake
@@ -55,11 +55,6 @@
 	message(WARNING "Your compiler is not tested, if you run into any issues, we'd welcome any patches.")
 endif ()

-# Set stack memory limits
-if (APPLE)
-	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-stack_size,1000000")
-endif()
-
 if (PROFILING AND (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")))
 	set(CMAKE_CXX_FLAGS "-g ${CMAKE_CXX_FLAGS}")
 	set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}")


Use OPENVDB_VERSION_FROM_HEADER function for auto detect houdini ABI

Instead of manually doing a regex search to fetch the ABI.

Signed-off-by: Fredrik Salomonsson <94092975b04047b37821994781a0b9ea8d41c3ff@d2.com>

--- cmake/OpenVDBHoudiniSetup.cmake
+++ cmake/OpenVDBHoudiniSetup.cmake
@@ -77,6 +77,8 @@

 cmake_minimum_required(VERSION 3.15)

+# Include utility functions for version information
+include(${CMAKE_CURRENT_LIST_DIR}/OpenVDBUtils.cmake)

 set(_FIND_HOUDINI_ADDITIONAL_OPTIONS "")
 if(DISABLE_CMAKE_SEARCH_PATHS)
@@ -340,14 +342,8 @@
     PATHS ${HOUDINI_INCLUDE_DIR}
     NO_DEFAULT_PATH)
   if(NOT ${_houdini_openvdb_version_file})
-    file(STRINGS ${_houdini_openvdb_version_file} _houdini_openvdb_version)
-    foreach(line ${_houdini_openvdb_version})
-      if(line MATCHES "^#define OPENVDB_ABI_VERSION_NUMBER ([0-9]+)$")
-        set(OPENVDB_HOUDINI_ABI ${CMAKE_MATCH_1})
-        break()
-      endif()
-    endforeach()
-    unset(_houdini_openvdb_version)
+    OPENVDB_VERSION_FROM_HEADER("${_houdini_openvdb_version_file}"
+      ABI OPENVDB_HOUDINI_ABI)
   endif()
   unset(_houdini_openvdb_version_file)
   if(NOT OPENVDB_HOUDINI_ABI)


Updated Arduino CMake documentation discrepencies and typos

--- cmake/modules/FindArduino.cmake
+++ cmake/modules/FindArduino.cmake
@@ -163,7 +163,7 @@
     endif()

     message(STATUS "Generating ${TARGET_NAME}")
-
+
     set(ALL_LIBS)
     set(ALL_SRCS ${INPUT_SRCS} ${INPUT_HDRS})

@@ -175,7 +175,7 @@
     endif()

     list(APPEND ALL_LIBS ${CORE_LIB} ${INPUT_LIBS})
-
+
     add_library(${TARGET_NAME} ${ALL_SRCS})
     target_link_libraries(${TARGET_NAME} ${ALL_LIBS})
 endfunction()
@@ -276,13 +276,13 @@
     endif()
 endmacro()

-# setup_arduino_core(VAR_NAME BOARD_ID TARGET_NAME)
+# setup_arduino_core(VAR_NAME BOARD_ID)
 #
 #        VAR_NAME    - Variable name that will hold the generated library name
 #        BOARD_ID    - Arduino board id
 #
-# Creates the Arduino Core library for the specified target,
-# each target gets it's own version of the library
+# Creates the Arduino Core library for the specified board,
+# each board gets it's own version of the library.
 #
 function(setup_arduino_core VAR_NAME BOARD_ID)
     set(CORE_LIB_NAME ${BOARD_ID}_CORE)
@@ -306,15 +306,15 @@
 #  are ${ARDUINO_SDK_PATH}/libraries and ${CMAKE_CURRENT_SOURCE_DIR}.
 #
 #  A Arduino library is a folder that has the same name as the include header.
-#  For example, if we have a include "#include <LibraryName.h>" the the following
-#  directory structure is considered as a Arduino library:
+#  For example, if we have a include "#include <LibraryName.h>" then the following
+#  directory structure is considered a Arduino library:
 #
 #     LibraryName/
 #          |- LibraryName.h
 #          `- LibraryName.c
 #
 #  If such a directory is found then all sources within that directory are considred
-#  a Arduino library.
+#  to be part of that Arduino library.
 #
 function(find_arduino_libraries VAR_NAME SRCS)
     set(ARDUINO_LIBS )
@@ -425,14 +425,13 @@
                         VERBATIM)
 endfunction()

-# setup_arduino_upload(BOARD_ID TARGET_NAME TARGET_PATH PORT)
+# setup_arduino_upload(BOARD_ID TARGET_NAME PORT)
 #
 #        BOARD_ID    - Arduino board id
 #        TARGET_NAME - Target name
-#        TARGET_PATH - Target path
 #        PORT        - Serial port for upload
 #
-# Create an upload target for the Arduino target (${TARGET_NAME}-uplpad).
+# Create an upload target (${TARGET_NAME}-upload) for the specified Arduino target.
 #
 function(setup_arduino_upload BOARD_ID TARGET_NAME PORT)
     add_custom_target(${TARGET_NAME}-upload


ported changes from kdelibs

ported changes from kdelibs

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

--- cmake/modules/FindSoprano.cmake
+++ cmake/modules/FindSoprano.cmake
@@ -39,7 +39,7 @@
 #else(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES)
   include(FindLibraryWithDebug)

-  # have packageconfig set variables to find Soprano:
+  # have packageconfig set variables to find Soprano:
   # package config dirs are used as secondary search paths after install_dir
   find_package(PkgConfig)
   if (PKG_CONFIG_FOUND)
@@ -49,7 +49,7 @@
   find_path(SOPRANO_INCLUDE_DIR
     NAMES
     soprano/soprano.h
-    PATHS
+    HINTS
     ${INCLUDE_INSTALL_DIR}
     ${Soprano_PKGCONF_INCLUDE_DIRS}
     )
@@ -58,7 +58,7 @@
     WIN32_DEBUG_POSTFIX d
     NAMES
     sopranoindex
-    PATHS
+    HINTS
     ${LIB_INSTALL_DIR}
     ${Soprano_PKGCONF_LIBRARY_DIRS}
     )
@@ -67,7 +67,7 @@
     WIN32_DEBUG_POSTFIX d
     NAMES
     sopranoclient
-    PATHS
+    HINTS
     ${LIB_INSTALL_DIR}
     ${Soprano_PKGCONF_LIBRARY_DIRS}
     )
@@ -75,7 +75,7 @@
   find_library_with_debug(SOPRANO_LIBRARIES
     WIN32_DEBUG_POSTFIX d
     NAMES soprano
-    PATHS
+    HINTS
     ${LIB_INSTALL_DIR}
     ${Soprano_PKGCONF_LIBRARY_DIRS}
   )
@@ -84,7 +84,7 @@
     WIN32_DEBUG_POSTFIX d
     NAMES
     sopranoserver
-    PATHS
+    HINTS
     ${LIB_INSTALL_DIR}
     ${Soprano_PKGCONF_LIBRARY_DIRS}
     )
@@ -129,14 +129,18 @@
       endif(SOPRANO_VERSION STRLESS "${SOPRANO_MIN_VERSION}")
     endif(SOPRANO_VERSION_MATCH)
   endif(Soprano_FOUND)
-
+
+
   #look for parser plugins
   if(Soprano_FOUND)
     find_path(SOPRANO_PLUGIN_DIR
       NAMES
       soprano/plugins
       PATHS
-      ${SHARE_INSTALL_PREFIX} /usr/share /usr/local/share
+      ${SOPRANO_INCLUDE_DIR}/../share
+      ${SHARE_INSTALL_PREFIX}
+      /usr/share
+      /usr/local/share
       NO_DEFAULT_PATH
       NO_SYSTEM_ENVIRONMENT_PATH
       )
@@ -181,7 +185,7 @@

   if(Soprano_FOUND)
     if(NOT Soprano_FIND_QUIETLY)
-      message(STATUS "Found Soprano: ${SOPRANO_LIBRARIES}")
+      message(STATUS "Found Soprano version ${SOPRANO_VERSION}: ${SOPRANO_LIBRARIES}")
       message(STATUS "Found Soprano includes: ${SOPRANO_INCLUDE_DIR}")
       message(STATUS "Found Soprano Index: ${SOPRANO_INDEX_LIBRARIES}")
       message(STATUS "Found Soprano Client: ${SOPRANO_CLIENT_LIBRARIES}")


CMake: Add /MT version of yaml-cpp to find_package module.

--- cmake/modules/FindYamlCpp.cmake
+++ cmake/modules/FindYamlCpp.cmake
@@ -42,7 +42,7 @@

 # find the release yaml-cpp library
 find_library(YAMLCPP_LIBRARY_RELEASE
-  NAMES ${YAMLCPP_STATIC} yaml-cpp libyaml-cppmd.lib
+  NAMES ${YAMLCPP_STATIC} yaml-cpp libyaml-cppmd.lib libyaml-cppmt.lib
   PATH_SUFFIXES lib64 lib Release RelWithDebInfo
   PATHS
     ${PROJECT_SOURCE_DIR}/dependencies/yaml-cpp-0.5.1/
@@ -58,7 +58,7 @@

 # find the debug yaml-cpp library
 find_library(YAMLCPP_LIBRARY_DEBUG
-  NAMES ${YAMLCPP_STATIC_DEBUG} yaml-cpp-dbg libyaml-cppmdd.lib
+  NAMES ${YAMLCPP_STATIC_DEBUG} yaml-cpp-dbg libyaml-cppmdd.lib libyaml-cppmtd.lib
   PATH_SUFFIXES lib64 lib Debug
   PATHS
     ${PROJECT_SOURCE_DIR}/dependencies/yaml-cpp-0.5.1/


Update hardening flags

Update hardening flags

--- cmake/CompilerSettings.cmake
+++ cmake/CompilerSettings.cmake
@@ -10,13 +10,6 @@
     set(warn_flags "-Wall -Wextra -Wpedantic -Wcast-qual -Wformat=2 -Wlogical-op -Wmissing-include-dirs -Wswitch-default -Wno-maybe-uninitialized")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pthread ${warn_flags}")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread ${warn_flags} -Woverloaded-virtual")
-
-    # Hardening
-    set(hardening_flags "-fstack-protector -pie -fPIE -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now")
-    set(CMAKE_C_FLAGS_RELEASE          "${CMAKE_C_FLAGS_RELEASE}          ${hardening_flags}")
-    set(CMAKE_C_FLAGS_RELWITHDEBINFO   "${CMAKE_C_FLAGS_RELWITHDEBINFO}   ${hardening_flags}")
-    set(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE}        ${hardening_flags}")
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${hardening_flags}")

 # Workaround for CMake < 3.1: Variables such as 'MSVC' are expanded in 'if'
 # statements even if they are quoted. We can't enable the policy CMP0054 because
@@ -32,4 +25,20 @@
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.9")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9")
     endif()
+
+# non-Apple unices
+elseif(UNIX)
+    # Hardening
+    set(hardening_cflags  "-fstack-protector -fPIC -D_FORTIFY_SOURCE=2")
+    set(hardening_ldflags "-Wl,-z,relro,-z,now")
+
+    set(CMAKE_C_FLAGS_RELEASE          "${CMAKE_C_FLAGS_RELEASE}          ${hardening_cflags}")
+    set(CMAKE_C_FLAGS_RELWITHDEBINFO   "${CMAKE_C_FLAGS_RELWITHDEBINFO}   ${hardening_cflags}")
+    set(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE}        ${hardening_cflags}")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${hardening_cflags}")
+
+    set(CMAKE_EXE_LINKER_FLAGS_RELEASE           "${CMAKE_EXE_LINKER_FLAGS_RELEASE}           -pie ${hardening_ldflags}")
+    set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO    "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}    -pie ${hardening_ldflags}")
+    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE        "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}        -pic ${hardening_ldflags}")
+    set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} -pic ${hardening_ldflags}")
 endif()


cmake: replace with -Wpedantic

cmake: replace with -Wpedantic

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -148,7 +148,7 @@
 # Common flags can be used by both C and C++ and by all supported compilers (gcc, mingw, icc, clang)
 #
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wno-long-long") # allow long long in C++ code
-set (COMMON_FLAGS "${COMMON_FLAGS} -pedantic -Wno-variadic-macros")
+set (COMMON_FLAGS "${COMMON_FLAGS} -Wpedantic -Wno-variadic-macros")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wall -Wextra")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wno-overlength-strings")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wsign-compare -Wfloat-equal")


python: Handle REQUIRED arguments for FindPythonModule

--- cmake/FindPythonModule.cmake
+++ cmake/FindPythonModule.cmake
@@ -121,12 +121,19 @@
   endif()

   include(FindPackageHandleStandardArgs)
-  set(FPHSA_NAME_MISMATCHED TRUE)
+  set(CMAKE_FIND_PACKAGE_NAME PythonModule_${module_NAME})
+  foreach(VAR IN ITEMS REQUIRED QUIETLY VERSION COMPONENTS)
+    if(DEFINED PythonModule_FIND_${VAR})
+      set(PythonModule_${module_NAME}_FIND_${VAR} "${PythonModule_FIND_${VAR}}")
+    else()
+      unset(PythonModule_${module_NAME}_FIND_${VAR})
+    endif()
+  endforeach()
+
   find_package_handle_standard_args(PythonModule_${module_NAME}
     FOUND_VAR PythonModule_${module_NAME}_FOUND
     REQUIRED_VARS ${required_vars}
   )
-  unset(FPHSA_NAME_MISMATCHED)
 endif()

 if(PythonModule_${module_NAME}_FOUND AND


Add dependency of precompiled header for each non-excluded source file

--- cmake/PrecompileHeader.cmake
+++ cmake/PrecompileHeader.cmake
@@ -86,8 +86,6 @@
         get_filename_component(prefix_file ${arg_PREFIX_FILE} REALPATH)

         file(TO_NATIVE_PATH ${host_file} host_file_native)
-        file(TO_NATIVE_PATH ${gch_file} gch_file_native)
-        file(TO_NATIVE_PATH ${prefix_file} prefix_file_native)

         # We dont need a host file in case of GCC/Clang but if the prefix file
         # contains #pragma once then we avoid getting a warning of having this in 'main file'
@@ -135,6 +133,9 @@
             set_property(SOURCE ${source_file}
                 APPEND_STRING PROPERTY COMPILE_OPTIONS "-include;${host_file_native};-Winvalid-pch"
             )
+            set_property(SOURCE ${source_file}
+                APPEND PROPERTY OBJECT_DEPENDS ${prefix_file}
+            )
         endforeach()
         add_dependencies(${_target} ${_target}.pch-symlink)
     endif()


CELIX-127: Added escapes to test result parsing target.

git-svn-id: b0a1bd8fd09963d3661abf01547333b64b62a32b@1607051 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/cmake_celix/Test.cmake
+++ cmake/cmake_celix/Test.cmake
@@ -40,8 +40,8 @@

 	add_custom_target(${__testTarget}
 		${EXEC} ${EXEC}
-		COMMAND if [ -e ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Results.xml ]\; then xsltproc --path ${CUNIT_SHARE_DIR} ${CUNIT_SHARE_DIR}/CUnit-Run.xsl ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Results.xml > ${EXEC}-Results.html \; fi
-		COMMAND if [ -e ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Listing.xml ]\; then xsltproc --path ${CUNIT_SHARE_DIR} ${CUNIT_SHARE_DIR}/CUnit-List.xsl ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Listing.xml > ${EXEC}-Listing.html \; fi
+		COMMAND if \[ -e ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Results.xml \]\; then xsltproc --path ${CUNIT_SHARE_DIR} ${CUNIT_SHARE_DIR}/CUnit-Run.xsl ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Results.xml > ${EXEC}-Results.html \; fi
+		COMMAND if \[ -e ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Listing.xml \]\; then xsltproc --path ${CUNIT_SHARE_DIR} ${CUNIT_SHARE_DIR}/CUnit-List.xsl ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Listing.xml > ${EXEC}-Listing.html \; fi
 		WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/test_results
 	)
 	ADD_DEPENDENCIES(test_cunit ${__testTarget})


Refs #4770. Adding .bat to GRADLE_EXE on windows. (#507)

--- cmake/dev/java_support.cmake
+++ cmake/dev/java_support.cmake
@@ -16,6 +16,10 @@
     find_package(Java 1.6 COMPONENTS Runtime REQUIRED)
     if(WIN32)
         find_program(GRADLE_EXE NAMES gradle gradle.exe gradle.bat)
+        get_filename_component(GRADLE_EXE_EXTENSION ${GRADLE_EXE} EXT)
+        if(NOT GRADLE_EXE_EXTENSION)
+            set(GRADLE_EXE ${GRADLE_EXE}.bat)
+        endif()
     else()
         find_program(GRADLE_EXE gradle)
     endif()


Cmake changes for -llog and -latomic

Cmake changes for -llog and -latomic

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -359,9 +359,10 @@
     endif()
   elseif("${LFLAGS_SDK}" STREQUAL "ANDROID")
     list(APPEND result
-        "-ldl"
+        "-ldl" "-llog" "-latomic"
         "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so")
     list(APPEND library_search_directories
+        "${SWIFT_ANDROID_NDK_PATH}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/lib/armv7-a"
         "${SWIFT_ANDROID_PREBUILT_PATH}/lib/gcc/arm-linux-androideabi/${SWIFT_ANDROID_NDK_GCC_VERSION}.x")
   else()
     # If lto is enabled, we need to add the object path flag so that the LTO code


[cmake/AddSwift] When `support` is passed for LLVM_LINK_COMPONENTS also implicitly include `demangle`

Using `support` llvm component ends up adding `-Xlinker /path/to/lib/libLLVMDemangle.a`
to `LINK_FLAGS` but `libLLVMDemangle.a` is not added as an input to the linking ninja statement.
As a workaround, in order to setup precise inputs for the ninja link statement, include `demangle` component
whenever `support` is mentioned.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -485,6 +485,13 @@
     message(FATAL_ERROR "One of SHARED/STATIC/OBJECT must be specified")
   endif()

+  # Using `support` llvm component ends up adding `-Xlinker /path/to/lib/libLLVMDemangle.a`
+  # to `LINK_FLAGS` but `libLLVMDemangle.a` is not added as an input to the linking ninja statement.
+  # As a workaround, include `demangle` component whenever `support` is mentioned.
+  if("support" IN_LIST ASHL_LLVM_LINK_COMPONENTS)
+    list(APPEND ASHL_LLVM_LINK_COMPONENTS "demangle")
+  endif()
+
   if(XCODE)
     get_filename_component(base_dir ${CMAKE_CURRENT_SOURCE_DIR} NAME)

@@ -794,6 +801,12 @@
   precondition(ASHT_SWIFT_COMPONENT
                MESSAGE "Swift Component is required to add a host tool")

+  # Using `support` llvm component ends up adding `-Xlinker /path/to/lib/libLLVMDemangle.a`
+  # to `LINK_FLAGS` but `libLLVMDemangle.a` is not added as an input to the linking ninja statement.
+  # As a workaround, include `demangle` component whenever `support` is mentioned.
+  if("support" IN_LIST ASHT_LLVM_LINK_COMPONENTS)
+    list(APPEND ASHT_LLVM_LINK_COMPONENTS "demangle")
+  endif()

   add_executable(${executable} ${ASHT_UNPARSED_ARGUMENTS})
   _add_host_variant_c_compile_flags(${executable})


Use Find_program  instead of Execute_process to detect date-config

--- cmake/modules/FindDATE.cmake
+++ cmake/modules/FindDATE.cmake
@@ -8,9 +8,7 @@

 # Check if DATE is installed and in the path

-Execute_process(
-  COMMAND which date-config
-  OUTPUT_VARIABLE DATE_PROGRAM)
+Find_program( DATE_PROGRAM date-config )

 If(DATE_PROGRAM)
   Set(DATE_FOUND YES)


Teach CMake to only touch tablegen-generated files if anything
actually changed.

Patch by Frits van Bommel!

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -13,10 +13,19 @@
       ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS})
   endif()
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
+    # Generate tablegen output in a temporary file.
     COMMAND ${LLVM_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
     -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
     ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
-    -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
+    -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
+    # Only update the real output file if there are any differences.
+    # This prevents recompilation of all the files depending on it if there
+    # aren't any.
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different
+        ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
+        ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
+    # Either way, we no longer need the temporary file.
+    COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     DEPENDS tblgen ${local_tds} ${global_tds}
     COMMENT "Building ${ofn}..."
     )


CMake: Generate dependency list that can be added to a target that depends on generated headers. Header list can also be used as dependency tracking by putting them to target's source list.

--- cmake/scripts/wire2cpp.cmake
+++ cmake/scripts/wire2cpp.cmake
@@ -31,12 +31,32 @@
     set_property(DIRECTORY APPEND PROPERTY WIRE_INCLUDE_DIRECTORIES ${wire_includes})
 endfunction()

+## wire2cpp macro
+# Generates commands for generating C++ header and source files from wire
+# idl files.
+# INCLUDE_ROOT All includes with files from the same directory will be
+#              prepended with this path
+# HEADER_DIR   Directory to place header files
+# SOURCE_DIR   Directory to place source files
+# SOURCES      List of generated source files
+# HEADERS      List of generated header files
+# DEPENDENCIES List of generated dependency targets
+# OPTIONS      Additional options to pass to wire2cpp generator program
 function(wire2cpp)
-    set(argnames INCLUDE_ROOT HEADER_DIR SOURCE_DIR SOURCES HEADERS OPTIONS)
+    set(argnames
+        INCLUDE_ROOT
+        HEADER_DIR
+        SOURCE_DIR
+        SOURCES
+        HEADERS
+        DEPENDENCIES
+        OPTIONS)
     parse_argn("" argnames ${ARGN})
     set(out_cpps ${${SOURCES}})
     set(out_hpps ${${HEADERS}})
+    set(deps)
     set(wire2cpp_options ${WIRE_INCLUDE_DIRECTORIES})
+
     if(HEADER_DIR)
         list(APPEND wire2cpp_options --header-output-dir=${HEADER_DIR})
     endif()
@@ -74,7 +94,19 @@
             DEPENDS ${base_dir}/${wire_file} wire2cpp
             COMMENT "Generate C++ sources from ${wire_file}"
         )
+        if (DEPENDENCIES)
+            get_filename_component(target_name ${wire_file} NAME)
+            set(target_name ".${target_name}")
+            add_custom_target(
+                ${target_name}
+                COMMAND ${CMAKE_COMMAND} -E touch ${target_name}
+                DEPENDS ${cpp_file} ${hpp_file})
+            list(APPEND deps ${target_name})
+        endif()
     endforeach()
+    if (DEPENDENCIES)
+        set(${DEPENDENCIES} ${deps} PARENT_SCOPE)
+    endif()
     if (SOURCES)
         set(${SOURCES} ${out_cpps} PARENT_SCOPE)
     endif()


update of FindPHP5.cmake

update of FindPHP5.cmake

--- cmake_modules/FindPHP5.cmake
+++ cmake_modules/FindPHP5.cmake
@@ -23,7 +23,6 @@
   /usr/lib
   )

-SET(PHP5_LIBRARY /usr/lib/php5)
 #FIND_PATH(PHP5_FOUND_INCLUDE_PATH main/php.h
 #  ${PHP5_POSSIBLE_INCLUDE_PATHS})
 #
@@ -38,7 +37,6 @@
 FIND_PROGRAM(PHP5_EXECUTABLE
   NAMES php5 php
   PATHS
-  /usr/bin
   /usr/local/bin
   )

@@ -49,8 +47,10 @@

 IF(APPLE)
 # this is a hack for now
-  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
-   "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
+#  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+#   "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
+  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+   "-Wl,-flat_namespace")
   FOREACH(symbol
     __efree
     __emalloc
@@ -72,52 +72,93 @@
     _zend_rsrc_list_get_rsrc_type
     _zend_wrong_param_count
     _zval_used_for_init
+    _zend_register_list_destructors_ex
+    _zend_hash_exists
+ __zend_hash_init_ex
+ _php_info_print_table_header
+ _zend_hash_destroy
+ __ecalloc
+ _zend_parse_parameters
+ _php_sprintf
+ _php_info_print_table_start
+ _zend_hash_apply_with_arguments
+ __estrndup
+ _zend_fetch_class
+ _zend_register_internal_class
+ _zend_objects_get_address
+ _zend_get_std_object_handlers
+ _zend_read_property
+ _zend_register_ini_entries
+ __erealloc
+ _zend_hash_internal_pointer_reset_ex
+ _convert_to_null
+ __convert_to_string
+ _php_info_print_table_end
+ _executor_globals
+ __safe_emalloc
+ _zend_str_tolower_copy
+ __zval_copy_ctor_func
+ _zend_hash_get_current_key_ex
+ _zend_hash_num_elements
+ _display_ini_entries
+ _zend_ini_string
+ _zval_update_constant
+ _zend_do_inheritance
+ __zval_ptr_dtor
+ _zend_opcode_handlers
+ _zval_add_ref
+ _zend_hash_get_current_data_ex
+ _zend_get_class_entry
+ _zend_hash_move_forward_ex
+ _zend_hash_get_current_key_type_ex
+ _call_user_function
+_zend_object_store_get_object_by_handle
+_add_next_index_string
+__array_init
+__zend_hash_init
+__zval_ptr_dtor_wrapper
     )
-    SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+    SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
       "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
   ENDFOREACH(symbol)
 ENDIF(APPLE)

 FIND_PROGRAM(PHP5_CONFIG_EXECUTABLE
-  NAMES php5-config php-config5 php-config
-  PATHS
-  /usr/bin
-  /usr/local/bin
+  NAMES php5-config php-config
   )

-EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --version
-   OUTPUT_VARIABLE PHP5_VERSION)
+IF(PHP5_CONFIG_EXECUTABLE)
+  EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --version
+    OUTPUT_VARIABLE PHP5_VERSION)

-EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --extension-dir
-   OUTPUT_VARIABLE PHP5_EXTENSION_DIR)
-STRING(REPLACE "'n" "" PHP5_EXTENSION_DIR "${PHP5_EXTENSION_DIR}")
+  EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --extension-dir
+    OUTPUT_VARIABLE PHP5_EXTENSION_DIR)
+  STRING(REPLACE "\n" "" PHP5_EXTENSION_DIR "${PHP5_EXTENSION_DIR}")

-EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --includes
-   OUTPUT_VARIABLE PHP5_INCLUDES)
+  EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --includes
+    OUTPUT_VARIABLE PHP5_INCLUDES)
+  STRING(REPLACE "-I" ";" PHP5_INCLUDES "${PHP5_INCLUDES}")
+  STRING(REPLACE " " "" PHP5_INCLUDES "${PHP5_INCLUDES}")
+  STRING(REPLACE "\n" "" PHP5_INCLUDES "${PHP5_INCLUDES}")
+  LIST(GET PHP5_INCLUDES 0 PHP5_INCLUDE_DIR)

+  set(PHP5_MAIN_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/main)
+  set(PHP5_TSRM_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/TSRM)
+  set(PHP5_ZEND_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/Zend)
+  set(PHP5_REGEX_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/regex)
+  set(PHP5_EXT_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext)
+  set(PHP5_DATE_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext/date/lib)
+  set(PHP5_STANDARD_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext/standard)

-STRING(REPLACE "-I" ";" PHP5_INCLUDES "${PHP5_INCLUDES}")
-STRING(REPLACE " " "" PHP5_INCLUDES "${PHP5_INCLUDES}")
-STRING(REPLACE "\n" "" PHP5_INCLUDES "${PHP5_INCLUDES}")
-LIST(GET PHP5_INCLUDES 0 PHP5_INCLUDE_DIR)
+  MESSAGE(STATUS ${PHP5_MAIN_INCLUDE_DIR})

-set(PHP5_MAIN_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/main)
-set(PHP5_TSRM_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/TSRM)
-set(PHP5_ZEND_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/Zend)
-set(PHP5_REGEX_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/regex)
-set(PHP5_EXT_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext)
-set(PHP5_DATE_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext/date/lib)
-set(PHP5_STANDARD_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext/standard)
+  IF(PHP5_VERSION LESS 5)
+    MESSAGE(FATAL_ERROR "PHP version is not 5 or later")
+  ENDIF(PHP5_VERSION LESS 5)

-MESSAGE(STATUS ${PHP5_MAIN_INCLUDE_DIR})
-
-IF(PHP5_VERSION LESS 5)
-    MESSAGE(FATAL_ERROR "PHP version is not 5 or later")
-ENDIF(PHP5_VERSION LESS 5)
-
-IF(PHP5_EXECUTABLE AND PHP5_INCLUDES)
+  IF(PHP5_EXECUTABLE AND PHP5_INCLUDES)
     set(PHP5_FOUND "yes")
     MESSAGE(STATUS "Found PHP5-Version ${PHP5_VERSION}")
-ENDIF(PHP5_EXECUTABLE AND PHP5_INCLUDES)
-
+  ENDIF(PHP5_EXECUTABLE AND PHP5_INCLUDES)
+ENDIF(PHP5_CONFIG_EXECUTABLE)