BUG: Use module's libraries for linking header test.

The libraries a module needs were not being linked to the header
test. This was causing link errors when trying to use the openmpi
library in a external module.

Change-Id: I80c23e15000a3e0d4b5e14500d8ac5d4dc575a93

--- CMake/ITKModuleHeaderTest.cmake
+++ CMake/ITKModuleHeaderTest.cmake
@@ -85,7 +85,7 @@
         ${_test_num}
         )
       add_executable( ${_test_name} ${_header_test_src} )
-      target_link_libraries( ${_test_name} ITKCommon )
+      target_link_libraries( ${_test_name} ${${_name}_LIBRARIES} )
       add_dependencies(${_test_name} ${${_name}_LIBRARIES})
       add_dependencies(${_name}-all ${_test_name})
       math( EXPR _test_num "${_test_num} + 1" )


better approach for including boost

better approach for including boost

--HG--
branch : nostaticzlib

--- CMake/Utils/AndroidMacros.cmake
+++ CMake/Utils/AndroidMacros.cmake
@@ -16,6 +16,16 @@
     SET(SAMPLE_LDLIBS "${SAMPLE_LDLIBS}\n    LOCAL_STATIC_LIBRARIES\t+= ")
 endmacro(add_static_libs)

+macro(add_static_libs_from_paths)
+    foreach(LIB ${ARGN})
+        get_filename_component(LIB_NAME ${LIB} NAME_WE)
+        string(SUBSTRING ${LIB_NAME} 3 -1 LIB_NAME) # strip lib prefix
+
+        set(HEADERS "${HEADERS}# ${LIB_NAME}\n\tinclude $(CLEAR_VARS)\n\tLOCAL_MODULE    := ${LIB_NAME}\n\tLOCAL_SRC_FILES := ${LIB}\n\tinclude $(PREBUILT_STATIC_LIBRARY)\n\n")
+        set(SAMPLE_LDLIBS "${SAMPLE_LDLIBS} ${LIB_NAME}")
+    endforeach()
+    set(SAMPLE_LDLIBS "${SAMPLE_LDLIBS}\n    LOCAL_STATIC_LIBRARIES\t+= ")
+endmacro(add_static_libs)

 macro(create_android_proj ANDROID_PROJECT_TARGET)
     ##################################################################
@@ -53,16 +63,8 @@
     endif()

     if(OGRE_USE_BOOST)
-       set(OGRE_BOOST_INCLUDES ${Boost_INCLUDE_DIRS})
-       set(OGRE_BOOST_LIBS)
-
-       foreach(LIB ${Boost_LIBRARIES})
-           get_filename_component(LIB_NAME ${LIB} NAME_WE)
-           string(SUBSTRING ${LIB_NAME} 3 -1 LIB_NAME)
-           set(OGRE_BOOST_LIBS ${OGRE_BOOST_LIBS} ${LIB_NAME})
-       endforeach()
-
-	   add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_NDK_ABI_NAME@" ${OGRE_BOOST_LIBS})
+       set(OGRE_BOOST_INCLUDES ${Boost_INCLUDE_DIRS})
+	   add_static_libs_from_paths(${Boost_LIBRARIES})
     endif()

     add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_NDK_ABI_NAME@" "OIS" "freetype" "zzip")


Do not pass unneeded language arguments on the command line

Only pass language CMake variable to the SimpleITK sub-superbuild
project when the language is enabled.

Conflicts:
	CMake/sitkLanguageOptions.cmake

Change-Id: I8c46f920d5ae3423912e5b78d4263a6907b09654

--- CMake/sitkLanguageOptions.cmake
+++ CMake/sitkLanguageOptions.cmake
@@ -47,22 +47,27 @@
 else()
   set( WRAP_PYTHON_DEFAULT OFF )
 endif()
-list( APPEND SITK_LANGUAGES_VARS
-  PYTHON_DEBUG_LIBRARY
-  PYTHON_EXECUTABLE
-  PYTHON_LIBRARY
-  PYTHON_INCLUDE_DIR
-#  PYTHON_INCLUDE_PATH ( deprecated )
-   )
+
+option( WRAP_PYTHON "Wrap Python" ${WRAP_PYTHON_DEFAULT} )
+
+if ( WRAP_PYTHON )
+  list( APPEND SITK_LANGUAGES_VARS
+    PYTHON_DEBUG_LIBRARY
+    PYTHON_EXECUTABLE
+    PYTHON_LIBRARY
+    PYTHON_INCLUDE_DIR
+    #  PYTHON_INCLUDE_PATH ( deprecated )
+    )
 # Debian "jessie" has this additional variable required to match
 # python versions.
-if(PYTHON_INCLUDE_DIR2)
-  list( APPEND SITK_LANGUAGES_VARS
-    PYTHON_INCLUDE_DIR2
-    )
-endif()
-option( WRAP_PYTHON "Wrap Python" ${WRAP_PYTHON_DEFAULT} )
+  if(PYTHON_INCLUDE_DIR2)
+    list( APPEND SITK_LANGUAGES_VARS
+      PYTHON_INCLUDE_DIR2
+      )
+  endif()
+endif ()
 check_PIC_flag ( Python )
+

 if (DEFINED  WRAP_JAVA AND WRAP_JAVA)
   set(_QUIET "REQUIRED")
@@ -77,29 +82,32 @@
 else ( ${JAVA_FOUND} AND ${JNI_FOUND} )
   set( WRAP_JAVA_DEFAULT OFF )
 endif ( ${JAVA_FOUND} AND ${JNI_FOUND} )
-list( APPEND SITK_LANGUAGES_VARS
-  Java_JAVA_EXECUTABLE
-  Java_JAVAC_EXECUTABLE
-  Java_JAR_EXECUTABLE
-  Java_VERSION_STRING
-  Java_VERSION_MAJOR
-  Java_VERSION_MINOR
-  Java_VERSION_PATCH
-  Java_VERSION_TWEAK
-  Java_VERSION
-  Java_INCLUDE_DIRS
-  Java_LIBRARIES
-  JNI_INCLUDE_DIRS
-  JNI_LIBRARIES
-  JAVA_AWT_LIBRARY
-  JAVA_JVM_LIBRARY
-  JAVA_INCLUDE_PATH
-  JAVA_INCLUDE_PATH2
-  JAVA_AWT_INCLUDE_PATH
-
-  )
+
 option ( WRAP_JAVA "Wrap Java" ${WRAP_JAVA_DEFAULT} )
 check_PIC_flag ( Java )
+
+if ( WRAP_JAVA )
+  list( APPEND SITK_LANGUAGES_VARS
+    Java_JAVA_EXECUTABLE
+    Java_JAVAC_EXECUTABLE
+    Java_JAR_EXECUTABLE
+    Java_VERSION_STRING
+    Java_VERSION_MAJOR
+    Java_VERSION_MINOR
+    Java_VERSION_PATCH
+    Java_VERSION_TWEAK
+    Java_VERSION
+    Java_INCLUDE_DIRS
+    Java_LIBRARIES
+    JNI_INCLUDE_DIRS
+    JNI_LIBRARIES
+    JAVA_AWT_LIBRARY
+    JAVA_JVM_LIBRARY
+    JAVA_INCLUDE_PATH
+    JAVA_INCLUDE_PATH2
+    JAVA_AWT_INCLUDE_PATH
+    )
+endif()

 if (DEFINED  WRAP_TCL AND WRAP_TCL)
@@ -114,14 +122,20 @@
 else ( ${TCL_FOUND} )
   set ( WRAP_TCL_DEFAULT OFF )
 endif ( ${TCL_FOUND} )
-list( APPEND SITK_LANGUAGES_VARS
-  TCL_LIBRARY
-  TCL_INCLUDE_PATH
-  TCL_TCLSH
-  TK_LIBRARY
-  TK_INCLUDE_PATH
-  TK_WISH )
+
 option ( WRAP_TCL "Wrap Tcl" ${WRAP_TCL_DEFAULT} )
+
+if ( WRAP_TCL )
+  list( APPEND SITK_LANGUAGES_VARS
+    TCL_LIBRARY
+    TCL_INCLUDE_PATH
+    TCL_TCLSH
+    TK_LIBRARY
+    TK_INCLUDE_PATH
+    TK_WISH
+    )
+endif()
+

 find_package ( Ruby QUIET )
 if ( ${RUBY_FOUND} )
@@ -129,16 +143,20 @@
 else ( ${RUBY_FOUND} )
   set ( WRAP_RUBY_DEFAULT OFF )
 endif ( ${RUBY_FOUND} )
-check_PIC_flag ( Ruby )
-list( APPEND SITK_LANGUAGES_VARS
-  RUBY_EXECUTABLE
-  RUBY_INCLUDE_DIRS
-  RUBY_LIBRARY
-  RUBY_VERSION
-  RUBY_FOUND
-  RUBY_INCLUDE_PATH )
+
 option ( WRAP_RUBY "Wrap Ruby" ${WRAP_RUBY_DEFAULT} )
 check_PIC_flag ( Ruby )
+
+if ( WRAP_RUBY )
+  list( APPEND SITK_LANGUAGES_VARS
+    RUBY_EXECUTABLE
+    RUBY_INCLUDE_DIRS
+    RUBY_LIBRARY
+    RUBY_VERSION
+    RUBY_FOUND
+    RUBY_INCLUDE_PATH
+    )
+endif()

 if (DEFINED  WRAP_CSHARP AND WRAP_CSHARP)
@@ -153,12 +171,17 @@
 else ()
   set ( WRAP_CSHARP_DEFAULT OFF )
 endif ()
-list( APPEND SITK_LANGUAGES_VARS
-  CSHARP_COMPILER
-  CSHARP_INTERPRETER
-  CSHARP_PLATFORM
-)
+
 option ( WRAP_CSHARP "Wrap C#" ${WRAP_CSHARP_DEFAULT} )
+
+if ( WRAP_CSHARP )
+  list( APPEND SITK_LANGUAGES_VARS
+    CSHARP_COMPILER
+    CSHARP_INTERPRETER
+    CSHARP_PLATFORM
+    )
+endif()
+

 if (DEFINED  WRAP_R AND WRAP_R)
   set(_QUIET "REQUIRED")
@@ -173,14 +196,17 @@
   set ( WRAP_R_DEFAULT OFF )
 endif( )

-
-list( APPEND SITK_LANGUAGES_VARS
- R_INCLUDE_DIR
- R_LIBRARIES
- R_LIBRARY_BASE
- R_COMMAND
- RSCRIPT_EXECUTABLE )
 option ( WRAP_R "Wrap R" ${WRAP_R_DEFAULT} )
+
+if ( WRAP_R )
+  list( APPEND SITK_LANGUAGES_VARS
+    R_INCLUDE_DIR
+    R_LIBRARIES
+    R_LIBRARY_BASE
+    R_COMMAND
+    RSCRIPT_EXECUTABLE )
+endif()
+

 if( WIN32 )
   mark_as_advanced( WRAP_R )


Modified to use FreeType distribution included in Omegalib

--- CMakeModules/FindFreetype.cmake
+++ CMakeModules/FindFreetype.cmake
@@ -11,15 +11,6 @@
 # correspond to the ./configure --prefix=$FREETYPE_DIR
 # used in building FREETYPE.
 # Created by Eric Wing.
-
-# prefer FindFreetype from cmake distribution
-if(EXISTS ${CMAKE_ROOT}/Modules/FindFreetype.cmake)
-  include(${CMAKE_ROOT}/Modules/FindFreetype.cmake)
-
-  if(FREETYPE_FOUND)
-    return()
-  endif()
-endif()

 # Ugh, FreeType seems to use some #include trickery which
 # makes this harder than it should be. It looks like they
@@ -36,7 +27,7 @@

 FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
   PATHS
-  $ENV{FREETYPE_DIR}
+  ${FREETYPE_DIR}
   NO_DEFAULT_PATH
   PATH_SUFFIXES include
 )


Don't print version multiple times

Don't print version multiple times

--- CPPCheck.cmake
+++ CPPCheck.cmake
@@ -15,6 +15,12 @@
      --max-configs=1)

 function (_validate_cppcheck CONTINUE)
+
+    if (DEFINED CPPCHECK_VERSION)
+
+        set (${CONTINUE} TRUE PARENT_SCOPE)
+
+    endif (DEFINED CPPCHECK_VERSION)

     if (NOT CPPCHECK_EXECUTABLE)


ENH: updated itk version used for SuperBuild

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -15,7 +15,7 @@
 set(proj ITK)  ## Use ITK convention of calling it ITK
 set(ITK_REPOSITORY git://itk.org/ITK.git)
 set(ITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.0)
-set(ITK_TAG_COMMAND GIT_TAG  d49dc15f93c68469866a )
+set(ITK_TAG_COMMAND GIT_TAG  b57ab3d7969915f0fe0431c7c13e5e6520559468 )
 set(WrapITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.0/WrapITK)
 message(STATUS "ITK_WRAPPING=${ITK_WRAPPING}")


Bug fix: libcurl was not linked to openssl on iOS

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -2334,7 +2334,7 @@
       tar --strip-components 1 -xvf
           ${LIBCURL_PREFIX}/download/curl-7.33.0.tar.bz2
   CONFIGURE_COMMAND ${CONFIGURE_COMMAND})
-if (NOT APPLE)
+if (NOT APPLE OR IS_IOS)
   add_dependencies(${LIBCURL_TARGET} ${OPENSSL_TARGET})
 endif ()
 add_dependencies(${LIBCURL_TARGET} ${ZLIB_TARGET})


Added install step for ImageMagick

Added install step for ImageMagick

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -1634,7 +1634,14 @@
       cd <SOURCE_DIR> &&
       tar --strip-components 1 -xvf
           ${IMAGEMAGICK_PREFIX}/download/ImageMagick-6.8.9-0.tar.bz2
-  CONFIGURE_COMMAND ${IMAGEMAGICK_CONFIGURE_COMMAND})
+  CONFIGURE_COMMAND ${IMAGEMAGICK_CONFIGURE_COMMAND}
+  INSTALL_COMMAND
+      make install &&
+      cd <INSTALL_DIR>/lib &&
+      echo "\
+      for f in *${LIBRARY_SUFFIX}$<SEMICOLON> do\
+        echo $f| sed 's/\\(\\(^.*\\)-.*\\.\\(.*$\\)\\)/ln -sf \\1 \\2.\\3/'|sh$<SEMICOLON>\
+      done" | sh)
 add_dependencies(${IMAGEMAGICK_TARGET} ${FREETYPE_TARGET})

 ################################################################################


ENH: just activate core and ml in opencv

--- CMake/External_OpenCV.cmake
+++ CMake/External_OpenCV.cmake
@@ -38,7 +38,29 @@
       -DBUILD_TESTS:BOOL=OFF
       -DBUILD_TIFF:BOOL=OFF
       -DBUILD_ZLIB:BOOL=OFF
+      -DBUILD_opencv_apps:BOOL=OFF
+      -DBUILD_opencv_calib3d:BOOL=OFF
+      -DBUILD_opencv_contrib:BOOL=OFF
+      -DBUILD_opencv_core:BOOL=ON
+      -DBUILD_opencv_features2d:BOOL=OFF
       -DBUILD_opencv_flann:BOOL=OFF
+      -DBUILD_opencv_gpu:BOOL=OFF
+      -DBUILD_opencv_highgui:BOOL=OFF
+      -DBUILD_opencv_imgproc:BOOL=OFF
+      -DBUILD_opencv_java:BOOL=OFF
+      -DBUILD_opencv_legacy:BOOL=OFF
+      -DBUILD_opencv_ml:BOOL=ON
+      -DBUILD_opencv_nonfree:BOOL=OFF
+      -DBUILD_opencv_objdetect:BOOL=OFF
+      -DBUILD_opencv_ocl:BOOL=OFF
+      -DBUILD_opencv_photo:BOOL=OFF
+      -DBUILD_opencv_python:BOOL=OFF
+      -DBUILD_opencv_stitching:BOOL=OFF
+      -DBUILD_opencv_superres:BOOL=OFF
+      -DBUILD_opencv_ts:BOOL=OFF
+      -DBUILD_opencv_video:BOOL=OFF
+      -DBUILD_opencv_videostab:BOOL=OFF
+      -DBUILD_opencv_world:BOOL=OFF
     DEPENDS ${${proj}_DEPENDENCIES}
     )


--- CMakeExternals/OpenCV.cmake
+++ CMakeExternals/OpenCV.cmake
@@ -21,6 +21,15 @@
            -DBUILD_NEW_PYTHON_SUPPORT:BOOL=ON
           )
     endif()
+
+    # 12-05-02, muellerm, added QT usage by OpenCV if QT is used in MITK
+    if(MITK_USE_QT)
+      list(APPEND additional_cmake_args
+           -DWITH_QT:BOOL=ON
+           -DWITH_QT_OPENGL:BOOL=ON
+           -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+          )
+    endif()

     set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/OpenCV-2.3.0.tar.bz2)
     set(opencv_url_md5 4e353dfb04b53bea37407f397aabf069)


build MAINTENANCE replace tabulators by spaces

--- CMakeModules/ABICheck.cmake
+++ CMakeModules/ABICheck.cmake
@@ -2,40 +2,40 @@

 # generate API/ABI report
 macro(LIBYANG_ABICHECK)
-	find_program(ABI_DUMPER abi-dumper)
-	find_package_handle_standard_args(abi-dumper DEFAULT_MSG ABI_DUMPER)
-	if(ABI_DUMPER)
-	    set(PUBLIC_HEADERS ${headers})
-	    string(PREPEND PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/")
-	    string(REPLACE ";" "\n${CMAKE_SOURCE_DIR}/" PUBLIC_HEADERS "${PUBLIC_HEADERS}")
-	    file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/public_headers CONTENT "${PUBLIC_HEADERS}")
-	    add_custom_target(abi-dump
-	            COMMAND ${ABI_DUMPER} ./libyang${CMAKE_SHARED_LIBRARY_SUFFIX} -o libyang.${LIBYANG_SOVERSION_FULL}.dump
-	            -lver ${LIBYANG_SOVERSION_FULL} -public-headers ${CMAKE_BINARY_DIR}/public_headers
-	            DEPENDS yang
-	            BYPRODUCTS ${CMAKE_BINARY_DIR}/libyang.${LIBYANG_SOVERSION_FULL}.dump
-	            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-	            COMMENT Dumping ABI information for abi-check.)
-	endif()
-
-	# check correctness of the SO version according to the API/ABI changes
-	find_program(ABI_CHECKER abi-compliance-checker)
-	find_package_handle_standard_args(abi-compliance-checker DEFAULT_MSG ABI_CHECKER)
-	if(ABI_DUMPER AND ABI_CHECKER)
-		set(ABIBASE_HASH "" CACHE STRING "GIT hash for the commit to compare current ABI to. If not set, base SO version commit is found.")
-		if (NOT ABIBASE_HASH)
-		    # check that we have some ABI base version already and get its hash in GIT
-		    set(ABIBASE_VERSION "${LIBYANG_MAJOR_VERSION}.0.0")
-		    execute_process(COMMAND bash "-c" "git log --pretty=oneline --grep=\"SOVERSION .* ${ABIBASE_VERSION}\$\" | cut -d' ' -f1"
-		            OUTPUT_VARIABLE ABIBASE_HASH)
-		else()
-			string(SUBSTRING ${ABIBASE_HASH} 0 8 ABIBASE_HASH_SHORT)
-			set(ABIBASE_VERSION "git-${ABIBASE_HASH_SHORT}")
-		endif()
-	    if(ABIBASE_HASH)
-	        # we have the ABI base version, so generate script for abi-check target
-	        string(REPLACE "\n" "" ABIBASE_HASH ${ABIBASE_HASH})
-	        file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/abibase.sh CONTENT "#!/bin/sh
+    find_program(ABI_DUMPER abi-dumper)
+    find_package_handle_standard_args(abi-dumper DEFAULT_MSG ABI_DUMPER)
+    if(ABI_DUMPER)
+        set(PUBLIC_HEADERS ${headers})
+        string(PREPEND PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/")
+        string(REPLACE ";" "\n${CMAKE_SOURCE_DIR}/" PUBLIC_HEADERS "${PUBLIC_HEADERS}")
+        file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/public_headers CONTENT "${PUBLIC_HEADERS}")
+        add_custom_target(abi-dump
+                COMMAND ${ABI_DUMPER} ./libyang${CMAKE_SHARED_LIBRARY_SUFFIX} -o libyang.${LIBYANG_SOVERSION_FULL}.dump
+                -lver ${LIBYANG_SOVERSION_FULL} -public-headers ${CMAKE_BINARY_DIR}/public_headers
+                DEPENDS yang
+                BYPRODUCTS ${CMAKE_BINARY_DIR}/libyang.${LIBYANG_SOVERSION_FULL}.dump
+                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+                COMMENT Dumping ABI information for abi-check.)
+    endif()
+
+    # check correctness of the SO version according to the API/ABI changes
+    find_program(ABI_CHECKER abi-compliance-checker)
+    find_package_handle_standard_args(abi-compliance-checker DEFAULT_MSG ABI_CHECKER)
+    if(ABI_DUMPER AND ABI_CHECKER)
+        set(ABIBASE_HASH "" CACHE STRING "GIT hash for the commit to compare current ABI to. If not set, base SO version commit is found.")
+        if (NOT ABIBASE_HASH)
+            # check that we have some ABI base version already and get its hash in GIT
+            set(ABIBASE_VERSION "${LIBYANG_MAJOR_VERSION}.0.0")
+            execute_process(COMMAND bash "-c" "git log --pretty=oneline --grep=\"SOVERSION .* ${ABIBASE_VERSION}\$\" | cut -d' ' -f1"
+                    OUTPUT_VARIABLE ABIBASE_HASH)
+        else()
+            string(SUBSTRING ${ABIBASE_HASH} 0 8 ABIBASE_HASH_SHORT)
+            set(ABIBASE_VERSION "git-${ABIBASE_HASH_SHORT}")
+    endif()
+        if(ABIBASE_HASH)
+            # we have the ABI base version, so generate script for abi-check target
+            string(REPLACE "\n" "" ABIBASE_HASH ${ABIBASE_HASH})
+            file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/abibase.sh CONTENT "#!/bin/sh
 if [ ! -d abibase ]; then mkdir abibase; fi
 cd abibase
 if [ ! -f build/libyang.*.dump ]; then
@@ -52,18 +52,18 @@
     make abi-dump
 fi
 ")
-	        # abi-check target itself using abi-compliance-checker
-	        add_custom_target(abi-check
-	                COMMAND bash ./abibase.sh
-	                COMMAND ${ABI_CHECKER} -l libyang${CMAKE_SHARED_LIBRARY_SUFFIX} -old abibase/build/libyang.*.dump
-	                -new ./libyang.${LIBYANG_SOVERSION_FULL}.dump -s
-	                DEPENDS yang abi-dump
-	                BYPRODUCTS ${CMAKE_BINARY_DIR}/compat_reports/libyang${CMAKE_SHARED_LIBRARY_SUFFIX}/*_to_${LIBYANG_SOVERSION_FULL}/compat_report.html
-	                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-	                COMMENT Checking ABI compatibility with the ${ABIBASE_VERSION} version.)
-	    else()
-	        add_custom_target(abi-check
-	                COMMENT Nothing to check - missing base SOVERSION commit for ${ABIBASE_VERSION} version.)
-	    endif()
-	endif()
+            # abi-check target itself using abi-compliance-checker
+            add_custom_target(abi-check
+                    COMMAND bash ./abibase.sh
+                    COMMAND ${ABI_CHECKER} -l libyang${CMAKE_SHARED_LIBRARY_SUFFIX} -old abibase/build/libyang.*.dump
+                    -new ./libyang.${LIBYANG_SOVERSION_FULL}.dump -s
+                    DEPENDS yang abi-dump
+                    BYPRODUCTS ${CMAKE_BINARY_DIR}/compat_reports/libyang${CMAKE_SHARED_LIBRARY_SUFFIX}/*_to_${LIBYANG_SOVERSION_FULL}/compat_report.html
+                    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+                    COMMENT Checking ABI compatibility with the ${ABIBASE_VERSION} version.)
+        else()
+            add_custom_target(abi-check
+                    COMMENT Nothing to check - missing base SOVERSION commit for ${ABIBASE_VERSION} version.)
+        endif()
+    endif()
 endmacro()


UseLATEX.cmake: update to v2.7.0

UseLATEX.cmake: update to v2.7.0

--- CMakeModules/UseLATEX.cmake
+++ CMakeModules/UseLATEX.cmake
@@ -1,6 +1,6 @@
 # File: UseLATEX.cmake
 # CMAKE commands to actually use the LaTeX compiler
-# Version: 2.4.3
+# Version: 2.7.0
 # Author: Kenneth Moreland <kmorel@sandia.gov>
 #
 # Copyright 2004, 2015 Sandia Corporation.
@@ -42,17 +42,18 @@
 # add_latex_document(<tex_file>
 #                    [BIBFILES <bib_files>]
 #                    [INPUTS <input_tex_files>]
-#                    [IMAGE_DIRS] <image_directories>
-#                    [IMAGES] <image_files>
-#                    [CONFIGURE] <tex_files>
-#                    [DEPENDS] <tex_files>
-#                    [MULTIBIB_NEWCITES] <suffix_list>
+#                    [IMAGE_DIRS <image_directories>]
+#                    [IMAGES <image_files>]
+#                    [CONFIGURE <tex_files>]
+#                    [DEPENDS <tex_files>]
+#                    [MULTIBIB_NEWCITES <suffix_list>]
 #                    [USE_BIBLATEX]
 #                    [USE_INDEX]
 #                    [INDEX_NAMES <index_names>]
 #                    [USE_GLOSSARY] [USE_NOMENCL]
 #                    [FORCE_PDF] [FORCE_DVI] [FORCE_HTML]
-#                    [TARGET_NAME] <name>
+#                    [TARGET_NAME <name>]
+#                    [INCLUDE_DIRECTORIES <directories>]
 #                    [EXCLUDE_FROM_ALL]
 #                    [EXCLUDE_FROM_DEFAULTS])
 #       Adds targets that compile <tex_file>.  The latex output is placed
@@ -113,7 +114,48 @@
 #       support the extra auxiliary files created with the \newcite command
 #       in the multibib package.
 #
+#       INCLUDE_DIRECTORIES provides a list of directories in which LaTeX
+#       should look for input files. It accepts both files relative to the
+#       binary directory and absolute paths.
+#
 # History:
+#
+# 2.7.0 Add INCLUDE_DIRECTORIES parameters. (Thanks to Eric Dönges.)
+#
+# 2.6.1 Fix issue with detecting long undefined reference warnings that
+#       LaTeX "helpfully" split across lines (and which fowled up our
+#       regex).
+#
+# 2.6.0 Skip image conversion targets that are not used when a force option
+#       is given. This helps prevent errors for missing conversion programs
+#       that are not needed. (Thanks to Martin Wetzel.)
+#
+# 2.5.0 Parse biber output for warnings.
+#
+#       For regular bibtex, you get warnings about undefined references
+#       when you run latex. However, when using biber, biber itself prints
+#       out the said warning and latex sees nothing. Thus, when using biber
+#       the regular output is now suppressed and the log file is scanned
+#       for potential issues.
+#
+# 2.4.9 Use biblatex.cfg file if it exists and the USE_BIBLATEX option is ON.
+#
+# 2.4.8 Fix synctex issue with absolute paths not being converted.
+#
+# 2.4.7 Fix some issues with spaces in the path of the working directory where
+#       LaTeX is executed.
+#
+# 2.4.6 Fix parse issue with older versions of CMake.
+#
+# 2.4.5 Fix issues with files and paths containing spaces.
+#
+# 2.4.4 Improve error reporting message when LaTeX fails.
+#
+#       When LaTeX fails, delete the output file, which is invalid.
+#
+#       Add warnings for "missing characters." These usually mean that a
+#       non-ASCII character is in the document and will not be printed
+#       correctly.
 #
 # 2.4.3 Check for warnings from the natbib package. When using natbib,
 #       warnings for missing bibliography references look different. So
@@ -412,10 +454,6 @@
 # Functions that perform processing during a LaTeX build.
 #############################################################################
 function(latex_execute_latex)
-  if(NOT LATEX_TARGET)
-    message(SEND_ERROR "Need to define LATEX_TARGET")
-  endif()
-
   if(NOT LATEX_WORKING_DIRECTORY)
     message(SEND_ERROR "Need to define LATEX_WORKING_DIRECTORY")
   endif()
@@ -424,20 +462,54 @@
     message(SEND_ERROR "Need to define LATEX_FULL_COMMAND")
   endif()

+  if(NOT LATEX_OUTPUT_FILE)
+    message(SEND_ERROR "Need to define LATEX_OUTPUT_FILE")
+  endif()
+
+  if(NOT LATEX_LOG_FILE)
+    message(SEND_ERROR "Need to define LATEX_LOG_FILE")
+  endif()
+
   set(full_command_original "${LATEX_FULL_COMMAND}")
-  separate_arguments(LATEX_FULL_COMMAND)
+
+  # Chose the native method for parsing command arguments. Newer versions of
+  # CMake allow you to just use NATIVE_COMMAND.
+  if (CMAKE_VERSION VERSION_GREATER 3.8)
+    set(separate_arguments_mode NATIVE_COMMAND)
+  else()
+    if (WIN32)
+      set(separate_arguments_mode WINDOWS_COMMAND)
+    else()
+      set(separate_arguments_mode UNIX_COMMAND)
+    endif()
+  endif()
+
+  # Preps variables for use in execute_process.
+  # Even though we expect LATEX_WORKING_DIRECTORY to have a single "argument,"
+  # we also want to make sure that we strip out any escape characters that can
+  # foul up the WORKING_DIRECTORY argument.
+  separate_arguments(LATEX_FULL_COMMAND UNIX_COMMAND "${LATEX_FULL_COMMAND}")
+  separate_arguments(LATEX_WORKING_DIRECTORY_SEP UNIX_COMMAND "${LATEX_WORKING_DIRECTORY}")
+
   execute_process(
     COMMAND ${LATEX_FULL_COMMAND}
-    WORKING_DIRECTORY ${LATEX_WORKING_DIRECTORY}
+    WORKING_DIRECTORY "${LATEX_WORKING_DIRECTORY_SEP}"
     RESULT_VARIABLE execute_result
+    OUTPUT_VARIABLE ignore
+    ERROR_VARIABLE ignore
     )

   if(NOT ${execute_result} EQUAL 0)
-    message("LaTeX command failed")
+    # LaTeX tends to write a file when a failure happens. Delete that file so
+    # that LaTeX will run again.
+    file(REMOVE "${LATEX_WORKING_DIRECTORY}/${LATEX_OUTPUT_FILE}")
+
+    message("\n\nLaTeX command failed")
     message("${full_command_original}")
     message("Log output:")
-    file(READ ${LATEX_WORKING_DIRECTORY}/${LATEX_TARGET}.log log_output)
-    message(FATAL_ERROR "${log_output}")
+    file(READ "${LATEX_WORKING_DIRECTORY}/${LATEX_LOG_FILE}" log_output)
+    message("${log_output}")
+    message(FATAL_ERROR "Executed LaTeX, but LaTeX returned an error.")
   endif()
 endfunction(latex_execute_latex)

@@ -636,6 +708,8 @@
   if(NOT LATEX_BINARY_DIRECTORY)
     message(SEND_ERROR "Need to define LATEX_BINARY_DIRECTORY")
   endif()
+  message("${LATEX_BINARY_DIRECTORY}")
+  message("${LATEX_SOURCE_DIRECTORY}")

   set(synctex_file ${LATEX_BINARY_DIRECTORY}/${LATEX_TARGET}.synctex)
   set(synctex_file_gz ${synctex_file}.gz)
@@ -653,13 +727,24 @@
     message("Reading synctex file.")
     file(READ ${synctex_file} synctex_data)

-    message("Replacing relative with absolute paths.")
-    string(REGEX REPLACE
-      "(Input:[0-9]+:)([^/\n][^\n]*)"
-      "\\1${LATEX_SOURCE_DIRECTORY}/\\2"
-      synctex_data
-      "${synctex_data}"
-      )
+    message("Replacing output paths with input paths.")
+    foreach(extension tex cls bst clo sty ist fd)
+      # Relative paths
+      string(REGEX REPLACE
+        "(Input:[0-9]+:)([^/\n][^\n]\\.${extension}*)"
+        "\\1${LATEX_SOURCE_DIRECTORY}/\\2"
+        synctex_data
+        "${synctex_data}"
+        )
+
+      # Absolute paths
+      string(REGEX REPLACE
+        "(Input:[0-9]+:)${LATEX_BINARY_DIRECTORY}([^\n]*\\.${extension})"
+        "\\1${LATEX_SOURCE_DIRECTORY}\\2"
+        synctex_data
+        "${synctex_data}"
+        )
+    endforeach(extension)

     message("Writing synctex file.")
     file(WRITE ${synctex_file} "${synctex_data}")
@@ -678,6 +763,39 @@
 endfunction(latex_correct_synctex)

 function(latex_check_important_warnings)
+  # Check for biber warnings/errors if that was run
+  set(bib_log_file ${LATEX_TARGET}.blg)
+  if(EXISTS ${bib_log_file})
+    file(READ ${bib_log_file} bib_log)
+    if(bib_log MATCHES "INFO - This is Biber")
+      message("\nChecking ${bib_log_file} for Biber warnings/errors.")
+
+      string(REGEX MATCHALL
+        "[A-Z]+ - [^\n]*"
+        biber_messages
+        "${bib_log}")
+
+      set(found_error)
+      foreach(message ${biber_messages})
+        if(NOT message MATCHES  "^INFO - ")
+          set(found_error TRUE)
+          message("${message}")
+        endif()
+      endforeach(message)
+
+      if(found_error)
+        latex_get_filename_component(log_file_path ${bib_log_file} ABSOLUTE)
+        message("\nConsult ${log_file_path} for more information on Biber output.")
+      else()
+        message("No known important Biber output found.")
+      endif(found_error)
+    else() # Biber output not in log file
+      message("Skipping biber checks (biber not used)")
+    endif()
+  else() # No bib log file
+    message("Skipping bibliography checks (not run)")
+  endif()
+
   set(log_file ${LATEX_TARGET}.log)

   message("\nChecking ${log_file} for important warnings.")
@@ -692,33 +810,61 @@

   set(found_error)

-  # Check for undefined references
-  file(STRINGS ${log_file} reference_warnings REGEX "Reference.*undefined")
-  if(reference_warnings)
+  file(READ ${log_file} log)
+
+  # Check for declared LaTeX warnings
+  string(REGEX MATCHALL
+    "\nLaTeX Warning:[^\n]*"
+    latex_warnings
+    "${log}")
+  if(latex_warnings)
     set(found_error TRUE)
-    message("\nFound missing reference warnings.")
-    foreach(warning ${reference_warnings})
-      message("${warning}")
+    message("\nFound declared LaTeX warnings.")
+    foreach(warning ${latex_warnings})
+      string(STRIP "${warning}" warning_no_newline)
+      message("${warning_no_newline}")
     endforeach(warning)
   endif()

   # Check for natbib warnings
-  file(STRINGS ${log_file} natbib_warnings REGEX "^Package natbib Warning:")
+  string(REGEX MATCHALL
+    "\nPackage natbib Warning:[^\n]*"
+    natbib_warnings
+    "${log}")
   if(natbib_warnings)
     set(found_error TRUE)
     message("\nFound natbib package warnings.")
     foreach(warning ${natbib_warnings})
-      message("${warning}")
+      string(STRIP "${warning}" warning_no_newline)
+      message("${warning_no_newline}")
     endforeach(warning)
   endif()

   # Check for overfull
-  file(STRINGS ${log_file} overfull_warnings REGEX "^Overfull")
+  string(REGEX MATCHALL
+    "\nOverfull[^\n]*"
+    overfull_warnings
+    "${log}")
   if(overfull_warnings)
     set(found_error TRUE)
     message("\nFound overfull warnings. These are indicative of layout errors.")
     foreach(warning ${overfull_warnings})
-      message("${warning}")
+      string(STRIP "${warning}" warning_no_newline)
+      message("${warning_no_newline}")
+    endforeach(warning)
+  endif()
+
+  # Check for invalid characters
+  string(REGEX MATCHALL
+    "\nMissing character:[^\n]*"
+    invalid_character_warnings
+    "${log}")
+  if(invalid_character_warnings)
+    set(found_error TRUE)
+    message("\nFound invalid character warnings. These characters are likely not printed correctly.")
+    foreach(warning ${invalid_character_warnings})
+      string(STRIP "${warning}" warning_no_newline)
+      message("${warning_no_newline}")
     endforeach(warning)
   endif()

@@ -1093,10 +1239,15 @@

   # Check input filename for potential problems with LaTeX.
   latex_get_filename_component(name "${input_file}" NAME_WE)
-  if(name MATCHES ".*\\..*")
-    string(REPLACE "." "-" suggested_name "${name}")
-    set(suggested_name "${suggested_name}${extension}")
-    message(WARNING "Some LaTeX distributions have problems with image file names with multiple extensions.  Consider changing ${name}${extension} to something like ${suggested_name}.")
+  set(suggested_name "${name}")
+  if(suggested_name MATCHES ".*\\..*")
+    string(REPLACE "." "-" suggested_name "${suggested_name}")
+  endif()
+  if(suggested_name MATCHES ".* .*")
+    string(REPLACE " " "-" suggested_name "${suggested_name}")
+  endif()
+  if(NOT suggested_name STREQUAL name)
+    message(WARNING "Some LaTeX distributions have problems with image file names with multiple extensions or spaces. Consider changing ${name}${extension} to something like ${suggested_name}${extension}.")
   endif()

   string(REGEX REPLACE "\\.[^.]*\$" ${output_extension} output_file
@@ -1167,19 +1318,23 @@
       make_directory("${path}")

       # Do conversions for dvi.
-      latex_convert_image(output_files "${file}" .eps "${convert_flags}"
-        "${LATEX_DVI_IMAGE_EXTENSIONS}" "${ARGN}")
-      list(APPEND dvi_outputs ${output_files})
+      if(NOT LATEX_FORCE_PDF)
+          latex_convert_image(output_files "${file}" .eps "${convert_flags}"
+            "${LATEX_DVI_IMAGE_EXTENSIONS}" "${ARGN}")
+          list(APPEND dvi_outputs ${output_files})
+      endif ()

       # Do conversions for pdf.
-      if(is_raster)
-        latex_convert_image(output_files "${file}" .png "${convert_flags}"
-          "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
-        list(APPEND pdf_outputs ${output_files})
-      else()
-        latex_convert_image(output_files "${file}" .pdf "${convert_flags}"
-          "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
-        list(APPEND pdf_outputs ${output_files})
+      if(NOT LATEX_FORCE_DVI AND NOT LATEX_FORCE_HTML)
+        if(is_raster)
+          latex_convert_image(output_files "${file}" .png "${convert_flags}"
+            "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
+          list(APPEND pdf_outputs ${output_files})
+        else()
+          latex_convert_image(output_files "${file}" .pdf "${convert_flags}"
+            "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
+          list(APPEND pdf_outputs ${output_files})
+        endif()
       endif()
     else()
       message(WARNING "Could not find file ${CMAKE_CURRENT_SOURCE_DIR}/${file}.  Are you sure you gave relative paths to IMAGES?")
@@ -1277,6 +1432,7 @@
     CONFIGURE
     DEPENDS
     INDEX_NAMES
+    INCLUDE_DIRECTORIES
     )
   cmake_parse_arguments(
     LATEX "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -1317,6 +1473,8 @@
 endfunction(parse_add_latex_arguments)

 function(add_latex_targets_internal)
+  latex_get_output_path(output_dir)
+
   if(LATEX_USE_SYNCTEX)
     set(synctex_flags ${LATEX_SYNCTEX_ARGS})
   else()
@@ -1333,9 +1491,10 @@
     set(latex_build_command
       ${CMAKE_COMMAND}
         -D LATEX_BUILD_COMMAND=execute_latex
-        -D LATEX_TARGET=${LATEX_TARGET}
         -D LATEX_WORKING_DIRECTORY="${output_dir}"
         -D LATEX_FULL_COMMAND="${latex_build_command}"
+        -D LATEX_OUTPUT_FILE="${LATEX_TARGET}.dvi"
+        -D LATEX_LOG_FILE="${LATEX_TARGET}.log"
         -P "${LATEX_USE_LATEX_LOCATION}"
       )
   endif()
@@ -1348,15 +1507,43 @@
     set(pdflatex_build_command
       ${CMAKE_COMMAND}
         -D LATEX_BUILD_COMMAND=execute_latex
-        -D LATEX_TARGET=${LATEX_TARGET}
         -D LATEX_WORKING_DIRECTORY="${output_dir}"
         -D LATEX_FULL_COMMAND="${pdflatex_build_command}"
+        -D LATEX_OUTPUT_FILE="${LATEX_TARGET}.pdf"
+        -D LATEX_LOG_FILE="${LATEX_TARGET}.log"
         -P "${LATEX_USE_LATEX_LOCATION}"
       )
   endif()

+  if(LATEX_INCLUDE_DIRECTORIES)
+    # The include directories needs to start with the build directory so
+    # that the copied files can be found. It also needs to end with an
+    # empty directory so that the standard system directories are included
+    # after any specified.
+    set(LATEX_INCLUDE_DIRECTORIES . ${LATEX_INCLUDE_DIRECTORIES} "")
+
+    # CMake separates items in a list with a semicolon. Lists of
+    # directories on most systems are separated by colons, so we can do a
+    # simple text replace. On Windows, directories are separated by
+    # semicolons, but we replace them with the $<SEMICOLON> generator
+    # expression to make sure CMake treats it as a single string.
+    if(CMAKE_HOST_WIN32)
+      string(REPLACE ";" "$<SEMICOLON>" TEXINPUTS "${LATEX_INCLUDE_DIRECTORIES}")
+    else()
+      string(REPLACE ";" ":" TEXINPUTS "${LATEX_INCLUDE_DIRECTORIES}")
+    endif()
+
+    # Set the TEXINPUTS environment variable
+    set(latex_build_command
+      ${CMAKE_COMMAND} -E env TEXINPUTS=${TEXINPUTS} ${latex_build_command})
+    set(pdflatex_build_command
+      ${CMAKE_COMMAND} -E env TEXINPUTS=${TEXINPUTS} ${pdflatex_build_command})
+  endif()
+
   if(NOT LATEX_TARGET_NAME)
-    set(LATEX_TARGET_NAME ${LATEX_TARGET})
+    # Use the main filename (minus the .tex) as the target name. Remove any
+    # spaces since CMake cannot have spaces in its target names.
+    string(REPLACE " " "_" LATEX_TARGET_NAME ${LATEX_TARGET})
   endif()

   # Some LaTeX commands may need to be modified (or may not work) if the main
@@ -1500,17 +1687,30 @@
   endif()

   if(LATEX_BIBFILES)
+    set(suppress_bib_output)
     if(LATEX_USE_BIBLATEX)
       if(NOT BIBER_COMPILER)
         message(SEND_ERROR "I need the biber command.")
       endif()
       set(bib_compiler ${BIBER_COMPILER})
       set(bib_compiler_flags ${BIBER_COMPILER_ARGS})
+
+      if(NOT BIBER_COMPILER_ARGS MATCHES ".*-q.*")
+        # Only suppress bib output if the quiet option is not specified.
+        set(suppress_bib_output TRUE)
+      endif()
+
+      if(LATEX_USE_BIBLATEX_CONFIG)
+        list(APPEND auxiliary_clean_files ${output_dir}/biblatex.cfg)
+        list(APPEND make_dvi_depends ${output_dir}/biblatex.cfg)
+        list(APPEND make_pdf_depends ${output_dir}/biblatex.cfg)
+      endif()
     else()
       set(bib_compiler ${BIBTEX_COMPILER})
       set(bib_compiler_flags ${BIBTEX_COMPILER_ARGS})
     endif()
     if(LATEX_MULTIBIB_NEWCITES)
+      # Suppressed bib output currently not supported for multibib
       foreach (multibib_auxfile ${LATEX_MULTIBIB_NEWCITES})
         latex_get_filename_component(multibib_target ${multibib_auxfile} NAME_WE)
         set(make_dvi_command ${make_dvi_command}
@@ -1523,12 +1723,25 @@
           ${output_dir}/${multibib_target}.aux)
       endforeach (multibib_auxfile ${LATEX_MULTIBIB_NEWCITES})
     else()
+      set(full_bib_command
+        ${bib_compiler} ${bib_compiler_flags} ${LATEX_TARGET})
+      if(suppress_bib_output)
+        set(full_bib_command
+          ${CMAKE_COMMAND}
+          -D LATEX_BUILD_COMMAND=execute_latex
+          -D LATEX_WORKING_DIRECTORY="${output_dir}"
+          -D LATEX_FULL_COMMAND="${full_bib_command}"
+          -D LATEX_OUTPUT_FILE="${LATEX_TARGET}.bbl"
+          -D LATEX_LOG_FILE="${LATEX_TARGET}.blg"
+          -P "${LATEX_USE_LATEX_LOCATION}"
+          )
+      endif()
       set(make_dvi_command ${make_dvi_command}
         COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
-        ${bib_compiler} ${bib_compiler_flags} ${LATEX_TARGET})
+        ${full_bib_command})
       set(make_pdf_command ${make_pdf_command}
         COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
-        ${bib_compiler} ${bib_compiler_flags} ${LATEX_TARGET})
+        ${full_bib_command})
     endif()

     foreach (bibfile ${LATEX_BIBFILES})
@@ -1798,6 +2011,11 @@
       latex_copy_input_file(${bib_file})
     endforeach (bib_file)

+    if (LATEX_USE_BIBLATEX AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/biblatex.cfg)
+      latex_copy_input_file(biblatex.cfg)
+      set(LATEX_USE_BIBLATEX_CONFIG TRUE)
+    endif()
+
     foreach (input ${LATEX_INPUTS})
       latex_copy_input_file(${input})
     endforeach(input)


Remove debug message

Remove debug message

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -413,9 +413,6 @@
                              LIBRARIES ${INTERFACE_LIBS})
     _lib_found_in_libraries (${LIBRARY} FOUND_IN_LINK
                              LIBRARIES ${LINK_LIBS})
-
-    message (STATUS "All target libraries for ${TARGET_NAME}")
-    _print_all_target_libraries (${TARGET_NAME})

     if (FOUND_IN_INTERFACE OR FOUND_IN_LINK)


lox: Compile with -fno-builtin

lox: Compile with -fno-builtin

--- build/cmake/liblox.cmake
+++ build/cmake/liblox.cmake
@@ -8,4 +8,6 @@
 )

 add_library(lox STATIC ${LIBLOX_SRC})
+target_compile_options(lox PRIVATE "-fno-builtin")
+
 add_library(lox-kernel STATIC ${LIBLOX_SRC})


Fix output name of embedded library, honor OUTPUT_NAME in MERGE_LIBRARIES macro

--- cmake/libutils.cmake
+++ cmake/libutils.cmake
@@ -220,7 +220,7 @@
   SET(LIBS ${ARG_DEFAULT_ARGS})
   LIST(REMOVE_AT LIBS 0)
   IF(ARG_STATIC)
-    IF (NOT "${ARG_OUTPUT_NAME}")
+    IF (NOT ARG_OUTPUT_NAME)
       SET(ARG_OUTPUT_NAME ${TARGET})
     ENDIF()
     MERGE_STATIC_LIBS(${TARGET} ${ARG_OUTPUT_NAME} "${LIBS}")


CMake: Fix a strange CMake bug

CMake: Fix a strange CMake bug

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

--- deal.II/cmake/configure/configure_boost.cmake
+++ deal.II/cmake/configure/configure_boost.cmake
@@ -38,7 +38,11 @@

 MACRO(FEATURE_BOOST_FIND_EXTERNAL var)

-  SET_IF_EMPTY(BOOST_DIR "$ENV{BOOST_DIR}")
+  IF(NOT DEFINED BOOST_DIR)
+    SET(BOOST_DIR "$ENV{BOOST_DIR}")
+  ELSE()
+    SET_IF_EMPTY(BOOST_DIR "$ENV{BOOST_DIR}")
+  ENDIF()
   IF(NOT "${BOOST_DIR}" STREQUAL "")
     SET(BOOST_ROOT "${BOOST_DIR}")
   ENDIF()


Do not add -lpthread on Android builds (#1229)

* Do not add -lpthread on Android builds

* Do not add -lpthread on Android cmake builds

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -77,7 +77,7 @@
   set(NO_EXPRECISION 1)
 endif ()

-if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Interix")
+if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Interix" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android")
   if (SMP)
     set(EXTRALIB "${EXTRALIB} -lpthread")
   endif ()


Update Kylin dependency.

Update Kylin dependency.

--- build/cmake/versions.cmake
+++ build/cmake/versions.cmake
@@ -12,8 +12,8 @@
 set(GLIDE_HASH 9e7dd635e9008294f46a7558853ef5ea)
 set(GOLANG_VERSION 1.6.3)
 set(GOLANG_HASH cdde5e08530c0579255d6153b08fdb3b8e47caabbe717bc7bcd7561275a87aeb)
-set(KYLIN_VERSION 1.5.2.1)
-set(KYLIN_HASH 81032007daff8fdab8f19d39fe2ca3a3)
+set(KYLIN_VERSION 1.5.3)
+set(KYLIN_HASH 517874b77685a9aae25719bed208edaa)
 set(LIBCIDR_VERSION 1.2.3)
 set(LIBCIDR_HASH c5efcc7ae114fdaa5583f58dacecd9de)
 set(LIBESTR_VERSION 0.1.10)


Testsuite: Allow for comparison operators in feature and compiler matches

--- cmake/macros/macro_deal_ii_pickup_tests.cmake
+++ cmake/macros/macro_deal_ii_pickup_tests.cmake
@@ -152,22 +152,59 @@
     #

     STRING(REGEX MATCHALL
-      "compiler=[^=]*=(on|off|yes|no|true|false)" _matches ${_test}
-      )
+      "compiler=([a-z]|[A-Z])*(>=|<=|=|>|<)(on|off|yes|no|true|false|[0-9]+(\\.[0-9]+)*)" _matches ${_test}
+      )
+
     FOREACH(_match ${_matches})
+      #
+      # Extract compiler name, comparison operator, (a possible) boolean and
+      # (a possible) version number from the feature constraint:
+      #
       STRING(REGEX REPLACE
-        "^compiler=([^=]*)=(on|off|yes|no|true|false)$" "\\1"
+        "^compiler=(([a-z]|[A-Z])*)(=|>=|<=|<).*$" "\\1"
         _compiler ${_match}
         )
+      STRING(REGEX REPLACE "^compiler=(([a-z]|[A-Z])*)(>=|<=|=|>|<).*$" "\\3"  _operator ${_match})
       STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
-
-      IF( ( "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}"
-              MATCHES "^${_compiler}"
-            AND NOT ${_boolean} )
-          OR ( NOT "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}"
-                   MATCHES "^${_compiler}"
-               AND ${_boolean} ) )
-        SET(_define_test FALSE)
+      STRING(REGEX MATCH "([0-9]+(\\.[0-9]+)*)$" _version ${_match})
+
+      #
+      # First process simple yes/no feature constraints:
+      #
+      IF(NOT "${_boolean}" STREQUAL "")
+        IF(NOT "${_operator}" STREQUAL "=")
+          MESSAGE(FATAL_ERROR "
+Invalid syntax in constraint \"${_match}\" in file
+\"${_comparison}\":
+Comparison operator \"=\" expected for boolean match.\n"
+            )
+        ENDIF()
+
+        # This is why I hate CMake :-/
+        IF( ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "${_compiler}" AND NOT ${_boolean} ) OR
+            ( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "${_compiler}" AND ${_boolean} ) )
+          SET(_define_test FALSE)
+        ENDIF()
+      ENDIF()
+
+      #
+      # Process version constraints:
+      #
+      IF(NOT "${_version}" STREQUAL "")
+
+        IF( ( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "${_compiler}" ) OR
+            ( "${_operator}" STREQUAL "=" AND
+              NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_EQUAL "${_version}" ) OR
+            ( "${_operator}" STREQUAL ">" AND
+              NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "${_version}" ) OR
+            ( "${_operator}" STREQUAL "<" AND
+              NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "${_version}" ) OR
+            ( "${_operator}" STREQUAL ">=" AND
+              "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "${_version}" ) OR
+            ( "${_operator}" STREQUAL "<=" AND
+                    "${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "${_version}" ) )
+          SET(_define_test FALSE)
+        ENDIF()
       ENDIF()
     ENDFOREACH()

@@ -182,14 +219,25 @@
     #

     STRING(REGEX MATCHALL
-      "with_([0-9]|[a-z]|_)*=(on|off|yes|no|true|false|[0-9]+(\\.[0-9]+)*)"
+      "with_([0-9]|[a-z]|_)*(=|>=|<=|>|<)(on|off|yes|no|true|false|[0-9]+(\\.[0-9]+)*)"
       _matches ${_test}
       )

     FOREACH(_match ${_matches})
-      STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)=.*" "\\1" _feature ${_match})
+      #
+      # Extract feature name, comparison operator, (a possible) boolean and
+      # (a possible) version number from the feature constraint:
+      #
+      STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(>=|<=|=|>|<).*" "\\1" _feature ${_match})
       STRING(TOUPPER ${_feature} _feature)
-
+      STRING(REGEX MATCH "(>=|<=|=|>|<)" _operator ${_match})
+      STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(>=|<=|=|>|<).*$" "\\3" _operator ${_match})
+      STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
+      STRING(REGEX MATCH "([0-9]+(\\.[0-9]+)*)$" _version ${_match})
+
+      #
+      # Valid feature?
+      #
       IF(NOT DEFINED DEAL_II_WITH_${_feature})
         MESSAGE(FATAL_ERROR "
 Invalid feature constraint \"${_match}\" in file
@@ -201,8 +249,16 @@
       #
       # First process simple yes/no feature constraints:
       #
-      STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
       IF(NOT "${_boolean}" STREQUAL "")
+        IF(NOT "${_operator}" STREQUAL "=")
+          MESSAGE(FATAL_ERROR "
+Invalid syntax in constraint \"${_match}\" in file
+\"${_comparison}\":
+Comparison operator \"=\" expected for boolean match.\n"
+            )
+        ENDIF()
+
+        # This is why I hate CMake :-/
         IF( (DEAL_II_WITH_${_feature} AND NOT ${_boolean}) OR
             (NOT DEAL_II_WITH_${_feature} AND ${_boolean}) )
           SET(_define_test FALSE)
@@ -212,18 +268,26 @@
       #
       # Process version constraints:
       #
-      STRING(REGEX MATCH "([0-9]+(\\.[0-9]+)*)$" _version ${_match})
       IF(NOT "${_version}" STREQUAL "")
-
         IF(NOT ${DEAL_II_WITH_${_feature}})
           SET(_define_test FALSE)
-        ENDIF()
-
-        IF("${DEAL_II_${_feature}_VERSION}" VERSION_LESS "${_version}")
-          SET(_define_test FALSE)
-        ENDIF()
-      ENDIF()
-
+        ELSEIF( "${_operator}" STREQUAL "=" AND
+                NOT "${DEAL_II_${_feature}_VERSION}" VERSION_EQUAL "${_version}" )
+          SET(_define_test FALSE)
+        ELSEIF( "${_operator}" STREQUAL ">" AND
+                NOT "${DEAL_II_${_feature}_VERSION}" VERSION_GREATER "${_version}" )
+          SET(_define_test FALSE)
+        ELSEIF( "${_operator}" STREQUAL "<" AND
+                NOT "${DEAL_II_${_feature}_VERSION}" VERSION_LESS "${_version}" )
+          SET(_define_test FALSE)
+        ELSEIF( "${_operator}" STREQUAL ">=" AND
+                "${DEAL_II_${_feature}_VERSION}" VERSION_LESS "${_version}" )
+          SET(_define_test FALSE)
+        ELSEIF( "${_operator}" STREQUAL "<=" AND
+                "${DEAL_II_${_feature}_VERSION}" VERSION_GREATER "${_version}" )
+          SET(_define_test FALSE)
+        ENDIF()
+      ENDIF()
     ENDFOREACH()

     IF(_define_test)


process_start_linux() fix: Run forked process on WORKING_DIRECTORY

--- cmake/process/linux/process_start_Linux.cmake
+++ cmake/process/linux/process_start_Linux.cmake
@@ -14,6 +14,8 @@
   map_tryget(${process_start_info} command_arguments)
   ans(command_arguments)

+  map_tryget(${process_start_info} working_directory)
+  ans(working_directory)

   command_line_args_combine(${command_arguments})
   ans(command_arguments_string)
@@ -30,14 +32,14 @@
   file_make_temporary("")
   ans(pid_out)

-  process_chanage_state(${process_handle} starting)
+  process_handle_change_state(${process_handle} starting)
   # create a temporary shell script
   # which starts bash with the specified command
   # output of the command is stored in stdout file
   # error of the command is stored in stderr file
   # return_code is stored in return_code file
   # and the created process id is stored in pid_out
-  shell_tmp_script("( bash -c \"${command_string} > ${stdout} 2> ${stderr}\" ; echo $? > ${return_code}) & echo $! > ${pid_out}")
+  shell_tmp_script("( bash -c \"(cd ${working_directory}; ${command_string} > ${stdout} 2> ${stderr})\" ; echo $? > ${return_code}) & echo $! > ${pid_out}")
   ans(script)
   ## execute the script in bash with nohup
   ## which causes the script to run detached from process
@@ -57,7 +59,7 @@

   map_set(${process_handle} pid "${pid}")

-  process_chanage_state(${process_handle} running)
+  process_handle_change_state(${process_handle} running)

   ## set output of process


Fixed bugs in Android cmake toolchain; added experimantal assembler support to the toolchain

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -164,9 +164,19 @@
 #     [+] updated for NDK r7b
 #     [~] fixed cmake try_compile() command
 #     [~] Fix for missing install_name_tool on OS X
+#   - modified March 2012 Andrey Kamaev andrey.kamaev@itseez.com
+#     [~] fixed incorrect C compiler flags
+#     [~] fixed CMAKE_SYSTEM_PROCESSOR change on ANDROID_ABI change
+#     [+] improved toolchain loading speed
+#     [+] added assembler language support (.S)
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
+
+if( DEFINED CMAKE_CROSSCOMPILING )
+ #subsequent toolchain loading is not really needed
+ return()
+endif()

 if( PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
  include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL )
@@ -524,6 +534,12 @@
  message( SEND_ERROR "Unknown ANDROID_ABI=\"${ANDROID_ABI}\" is specified." )
 endif()

+if( CMAKE_BINARY_DIR AND EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" )
+ #really dirty hack
+ #it is not possible to change CMAKE_SYSTEM_PROCESSOR after the first run...
+ file( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")\n" )
+endif()
+
 set( ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME}} CACHE INTERNAL "ANDROID_ABI can be changed only to one of these ABIs. Changing to any other ABI requires to reset cmake cache." )
 if( CMAKE_VERSION VERSION_GREATER "2.8" )
  list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME} )
@@ -626,14 +642,19 @@
 # specify the cross compiler
 set( CMAKE_C_COMPILER   "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}"     CACHE PATH "gcc" )
 set( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}"     CACHE PATH "g++" )
+set( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}"     CACHE PATH "Assembler" )
+if( CMAKE_VERSION VERSION_LESS 2.8.5 )
+ set( CMAKE_ASM_COMPILER_ARG1 "-c" )
+endif()
+#there may be a way to make cmake deduce these TODO deduce the rest of the tools
 set( CMAKE_STRIP        "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}"   CACHE PATH "strip" )
-#there may be a way to make cmake deduce these TODO deduce the rest of the tools
 set( CMAKE_AR           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}"      CACHE PATH "archive" )
 set( CMAKE_LINKER       "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ld${TOOL_OS_SUFFIX}"      CACHE PATH "linker" )
 set( CMAKE_NM           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-nm${TOOL_OS_SUFFIX}"      CACHE PATH "nm" )
 set( CMAKE_OBJCOPY      "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}" CACHE PATH "objcopy" )
 set( CMAKE_OBJDUMP      "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objdump${TOOL_OS_SUFFIX}" CACHE PATH "objdump" )
 set( CMAKE_RANLIB       "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ranlib${TOOL_OS_SUFFIX}"  CACHE PATH "ranlib" )
+set( _CMAKE_TOOLCHAIN_PREFIX "${ANDROID_TOOLCHAIN_MACHINE_NAME}-" )
 if( APPLE )
  find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool )
  if( NOT CMAKE_INSTALL_NAME_TOOL )
@@ -695,10 +716,21 @@
 # Force set compilers because standard identification works badly for us
 include( CMakeForceCompiler )
 CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU )
+set( CMAKE_C_PLATFORM_ID Linux )
+set( CMAKE_C_SIZEOF_DATA_PTR 4 )
+set( CMAKE_C_HAS_ISYSROOT 1 )
+set( CMAKE_C_COMPILER_ABI ELF )
 CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU )
-set( CMAKE_SIZEOF_VOID_P 4 )
-set( CMAKE_C_SIZEOF_DATA_PTR 4 )
+set( CMAKE_CXX_PLATFORM_ID Linux )
 set( CMAKE_CXX_SIZEOF_DATA_PTR 4 )
+set( CMAKE_CXX_HAS_ISYSROOT 1 )
+set( CMAKE_CXX_COMPILER_ABI ELF )
+#force ASM compiler (required for CMake < 2.8.5)
+set( CMAKE_ASM_COMPILER_ID_RUN TRUE )
+set( CMAKE_ASM_COMPILER_ID GNU )
+set( CMAKE_ASM_COMPILER_WORKS TRUE )
+set( CMAKE_ASM_COMPILER_FORCED TRUE )
+set( CMAKE_COMPILER_IS_GNUASM 1)

 # NDK flags
 if( ARMEABI OR ARMEABI_V7A )
@@ -854,11 +886,11 @@

 #cache flags
 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags" )
-set( CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c flags" )
+set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags" )
 set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "c++ Release flags" )
-set( CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "c Release flags" )
+set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "c Release flags" )
 set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "c++ Debug flags" )
-set( CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "c Debug flags" )
+set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING "c Debug flags" )
 set( CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" )
 set( CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" )
 set( CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -Wl,-z,nocopyreloc ${LINKER_FLAGS}" CACHE STRING "linker flags" )
@@ -962,6 +994,7 @@
  set( ARM_TARGET "${ANDROID_ABI}" )
  set( ARMEABI_NDK_NAME "${ANDROID_NDK_ABI_NAME}" )
 endif()
+

 # Variables controlling behavior or set by cmake toolchain:
 #   ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86"


Make it clear when coverage is enabled.

Make it clear when coverage is enabled.

Now a helpful message will be displayed if you try
to generate coverage without a coverage build.

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -81,11 +81,6 @@
     CMAKE_EXE_LINKER_FLAGS_COVERAGE
     CMAKE_SHARED_LINKER_FLAGS_COVERAGE )

-IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage"))
-  MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" )
-ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
-
-
 # Param _targetname     The name of new the custom make target
 # Param _testrunner     The name of the target which runs the tests.
 #						MUST return ZERO always, even on errors.
@@ -132,36 +127,22 @@

 ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE

-# Param _targetname     The name of new the custom make target
-# Param _testrunner     The name of the target which runs the tests
-# Param _outputname     cobertura output is generated as _outputname.xml
-# Optional fourth parameter is passed as arguments to _testrunner
-#   Pass them in list form, e.g.: "-j;2" for -j 2
-FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname)

-	IF(NOT PYTHON_EXECUTABLE)
-		MESSAGE(FATAL_ERROR "Python not found! Aborting...")
-	ENDIF() # NOT PYTHON_EXECUTABLE
+string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
+if (cmake_build_type_tolower STREQUAL "coverage")
+    # If unwanted files are included in the coverage reports, you can
+    # adjust the exclude patterns on line 114.
+    SETUP_TARGET_FOR_COVERAGE(
+                            coverage            # Name for custom target.
+                            ${TEST_MAIN}        # Name of the test driver executable that runs the tests.
+                                                # NOTE! This should always have a ZERO as exit code
+                                                # otherwise the coverage generation will not complete.
+                            coverage_out        # Name of output directory.
+                            )
+else()
+    add_custom_target(coverage
+        COMMAND echo "${Red}Code coverage only available in coverage builds."
+        COMMAND echo "${Green}Make a new build directory and rerun cmake with -DCMAKE_BUILD_TYPE=Coverage to enable this target.${ColorReset}"
+    )
+endif()

-	IF(NOT GCOVR_PATH)
-		MESSAGE(FATAL_ERROR "gcovr not found! Aborting...")
-	ENDIF() # NOT GCOVR_PATH
-
-	ADD_CUSTOM_TARGET(${_targetname}
-
-		# Run tests
-		${_testrunner} ${ARGV3}
-
-		# Running gcovr
-		COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -e '${CMAKE_SOURCE_DIR}/build/'  -o ${_outputname}.xml
-		WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-		COMMENT "Running gcovr to produce Cobertura code coverage report."
-	)
-
-	# Show info where to find the report
-	ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
-		COMMAND ;
-		COMMENT "Cobertura code coverage report saved in ${_outputname}.xml."
-	)
-
-ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE_COBERTURA


use LIB_SUFFIX for TARGET_TOOL_EXEC_FOLDER

if *only* former is given
when TARGET_TOOL_EXEC_FOLDER is directly set, the behaviour is as before
closes #33

--- cmake/ElektraCache.cmake
+++ cmake/ElektraCache.cmake
@@ -300,7 +300,7 @@
     )

 set (TARGET_TOOL_EXEC_FOLDER
-		"lib/elektra/tool_exec"
+		"lib${LIB_SUFFIX}/elektra/tool_exec"
 		CACHE STRING
 		"This folder (below prefix) will be used to install additional kdb-tools"
     )


Set headers and sources basing on HAL_PREFIX

Initial setting of variables HAL_HEADERS and HAL_SRCS was earlier made
inside IF...ELSE clause what was redundant. Now it is done once using
the variable called HAL_PREFIX.

--- cmake/FindSTM32HAL.cmake
+++ cmake/FindSTM32HAL.cmake
@@ -13,13 +13,6 @@

     SET(HAL_PREFIX stm32f0xx_)

-    SET(HAL_HEADERS
-        stm32f0xx_hal.h
-        stm32f0xx_hal_def.h
-    )
-    SET(HAL_SRCS
-        stm32f0xx_hal.c
-    )
 ELSEIF(STM32_FAMILY STREQUAL "F1")
     SET(HAL_COMPONENTS adc can cec cortex crc dac dma eth flash gpio hcd i2c
                        i2s irda iwdg nand nor pccard pcd pwr rcc rtc sd smartcard
@@ -35,13 +28,6 @@

     SET(HAL_PREFIX stm32f1xx_)

-    SET(HAL_HEADERS
-        stm32f1xx_hal.h
-        stm32f1xx_hal_def.h
-    )
-    SET(HAL_SRCS
-        stm32f1xx_hal.c
-    )
 ELSEIF(STM32_FAMILY STREQUAL "F2")
     SET(HAL_COMPONENTS adc can cortex crc cryp dac dcmi dma eth flash
                        gpio hash hcd i2c i2s irda iwdg nand nor pccard
@@ -58,14 +44,6 @@

     SET(HAL_PREFIX stm32f2xx_)

-    SET(HAL_HEADERS
-        stm32f2xx_hal.h
-        stm32f2xx_hal_def.h
-    )
-
-    SET(HAL_SRCS
-        stm32f2xx_hal.c
-    )
 ELSEIF(STM32_FAMILY STREQUAL "F3")
     SET(HAL_COMPONENTS adc can cec comp cortex crc dac dma flash gpio i2c i2s
                        irda nand nor opamp pccard pcd pwr rcc rtc sdadc
@@ -78,14 +56,6 @@

     SET(HAL_PREFIX stm32f3xx_)

-    SET(HAL_HEADERS
-        stm32f3xx_hal.h
-        stm32f3xx_hal_def.h
-    )
-
-    SET(HAL_SRCS
-        stm32f3xx_hal.c
-    )
 ELSEIF(STM32_FAMILY STREQUAL "F4")
     SET(HAL_COMPONENTS adc can cec cortex crc cryp dac dcmi dma dma2d eth flash
                        flash_ramfunc fmpi2c gpio hash hcd i2c i2s irda iwdg ltdc
@@ -104,14 +74,6 @@

     SET(HAL_PREFIX stm32f4xx_)

-    SET(HAL_HEADERS
-        stm32f4xx_hal.h
-        stm32f4xx_hal_def.h
-    )
-
-    SET(HAL_SRCS
-        stm32f4xx_hal.c
-    )
 ELSEIF(STM32_FAMILY STREQUAL "F7")
     SET(HAL_COMPONENTS adc can cec cortex crc cryp dac dcmi dma dma2d eth flash
                        gpio hash hcd i2c i2s irda iwdg lptim ltdc nand nor pcd
@@ -129,14 +91,6 @@

     SET(HAL_PREFIX stm32f7xx_)

-    SET(HAL_HEADERS
-        stm32f7xx_hal.h
-        stm32f7xx_hal_def.h
-    )
-
-    SET(HAL_SRCS
-        stm32f7xx_hal.c
-    )
 ELSEIF(STM32_FAMILY STREQUAL "L0")
     SET(HAL_COMPONENTS adc comp cortex crc crs cryp dac dma exti firewall flash gpio i2c
                        i2s irda iwdg lcd lptim lpuart pcd pwr rcc rng rtc smartcard
@@ -152,16 +106,9 @@

     SET(HAL_PREFIX stm32l0xx_)

-    SET(HAL_HEADERS
-        stm32l0xx_hal.h
-        stm32l0xx_hal_def.h
-    )
-    SET(HAL_SRCS
-        stm32l0xx_hal.c
-    )
 ELSEIF(STM32_FAMILY STREQUAL "L4")
     SET(HAL_COMPONENTS adc can comp cortex crc cryp dac dcmi dfsdm dma dma2d dsi
-                       firewall flash flash_ramfunc gfxmmu gpio hash hcd i2c irda iwdg
+                       firewall flash flash_ramfunc gfxmmu gpio hash hcd i2c irda iwdg
                        lcd lptim ltdc nand nor opamp ospi pcd pwr qspi rcc rng rtc sai
                        sd smartcard smbus spi sram swpmi tim tsc uart usart wwdg)

@@ -178,16 +125,16 @@

     SET(HAL_PREFIX stm32l4xx_)

-    SET(HAL_HEADERS
-        stm32l4xx_hal.h
-        stm32l4xx_hal_def.h
-    )
-
-    SET(HAL_SRCS
-        stm32l4xx_hal.c
-    )
 ENDIF()

+SET(HAL_HEADERS
+	${HAL_PREFIX}hal.h
+	${HAL_PREFIX}hal_def.h
+)
+
+SET(HAL_SRCS
+	${HAL_PREFIX}hal.c
+)
 IF(NOT STM32HAL_FIND_COMPONENTS)
     SET(STM32HAL_FIND_COMPONENTS ${HAL_COMPONENTS})
     MESSAGE(STATUS "No STM32HAL components selected, using all: ${STM32HAL_FIND_COMPONENTS}")


Update ITK version to fix build support for MINC transforms

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

   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG 5538e605e730f054d40fee78c258fbaf959fbc92) ## include bug fix for float transforms!
+  set(${proj}_GIT_TAG 3b7d4fde0d71e0bb01c3a5f5c64f0ff09a6962f8) ## include bug fix for float transforms!
   set(ITK_VERSION_ID ITK-4.9) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


ENH: Update ITKv4 2012-07-23

ENH: Update ITKv4 2012-07-23

This includes several patches:
1) Register Transforms
2) Bug fix LaplacianRecursiveGaussian
3) Performance improvemet for GetInput/GetOuput out of loops
4) Remove references to StartRegistration

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -72,8 +72,8 @@
       -DUSE_WRAP_ITK:BOOL=OFF ## HACK:  QUICK CHANGE
     )
   ### --- End Project specific additions
-  set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git CACHE STRING "" FORCE)
-  set(${proj}_GIT_TAG b35534e39a94d4b9edd44e871e97dd6400211615 CACHE STRING "" FORCE) #2012-07-19 -- Includes test driver fix for missing files.
+  set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
+  set(${proj}_GIT_TAG 949f14eb4d34d3a9e58427e67b5a7ccd5ea77d0f) #2012-07-23 -- Includes LaplacianRecursiveGaussian bug fix.
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


Bugfix: Let DEAL_II_INSOURCE_SETUP_TARGET add all include directories

--- cmake/macros/macro_deal_ii_insource_setup_target.cmake
+++ cmake/macros/macro_deal_ii_insource_setup_target.cmake
@@ -37,7 +37,8 @@
     INCLUDE_DIRECTORIES
       "${CMAKE_BINARY_DIR}/include"
       "${CMAKE_SOURCE_DIR}/include"
-      "${CMAKE_SOURCE_DIR}/include/deal.II/"
+      ${DEAL_II_BUNDLED_INCLUDE_DIRS}
+      ${DEAL_II_INCLUDE_DIRS}
     )

 GET_PROPERTY(_type TARGET ${_target} PROPERTY TYPE)


gen-cov: fix coverage generation

gen-cov: fix coverage generation

--- cmake/g++.cmake
+++ cmake/g++.cmake
@@ -28,7 +28,8 @@
   endif()
   set(LCOV_ARGS
     --quiet
-    --directory ${PROJECT_SOURCE_DIR}
+    --base-directory ${PROJECT_SOURCE_DIR}
+    --directory ${CMAKE_BINARY_DIR}
     --rc lcov_branch_coverage=1
   )


added comments for future dev

added comments for future dev

--- dist/WkDepends.cmake
+++ dist/WkDepends.cmake
@@ -140,8 +140,12 @@
 			# then we need to add the run libraries of the dependency to the current project myrun libraries
 			#set( ${PROJECT_NAME}_RUN_LIBRARIES "${${PROJECT_NAME}_RUN_LIBRARIES}" "${${package_var_name}_RUN_LIBRARIES}" CACHE FILEPATH "blabla")
 			#message( "Project run lib WkDepends : ${${PROJECT_NAME}_RUN_LIBRARIES} " )
-
-
+
+			#TODO : here is the default case. We can assume if the variable RUN_LIBRARIES does not exist that
+			# either there is no dll needed OR
+			# the dll needed is delivered with the .lib file ( usual with windows dev environments, same as with SDL_* libs )
+			# that could be implemented
+
 		ENDIF ( WIN32 )

 		# Once the project is built with it, the dependency becomes mandatory


Add definition for the 64 bits platforms.

--- salome_adm/cmake_files/SalomeSetupPlatform.cmake
+++ salome_adm/cmake_files/SalomeSetupPlatform.cmake
@@ -95,7 +95,7 @@
   SET(PLATFORM_LIBS Ws2_32.lib)
   LIST(APPEND PLATFORM_LIBS Userenv.lib)      # At least for GEOM suit

-  IF(MACHINE_IS_64)
+  IF(MACHINE_IS_64)
     ADD_DEFINITIONS(-D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0)
     ADD_DEFINITIONS(-D_HAS_ITERATOR_DEBUGGING=0) # To avoid runtime error during checking iterators
     SET(SIZE_OF_LONG "4")                        # set sizeof(long) to 4 byte
@@ -103,6 +103,9 @@
 ELSE()
   ## Linux specific:
   SET(PLATFORM_LIBS dl)    # Dynamic loading (dlopen, dlsym)
+  IF(MACHINE_IS_64)
+    ADD_DEFINITIONS(-DPCLINUX64)
+  ENDIF(MACHINE_IS_64)
 ENDIF()

 ## define _DEBUG_ macro


COMP: Just issue a warning when OpenCV is not found, not a CMake error.

--- CMake/MITK_OpenCV_Config.cmake
+++ CMake/MITK_OpenCV_Config.cmake
@@ -12,6 +12,6 @@
 LIST(APPEND ALL_LIBRARIES ${OpenCV_LIBS})
 link_directories(${OpenCV_LIB_DIR})
 ELSE(OPENCV_DIR)
-MESSAGE(SEND_ERROR "OpenCVConfig.cmake not found. Please set OPENCV_DIR manually to guide search.")
+MESSAGE(STATUS "Warning: OpenCVConfig.cmake not found. Please set OPENCV_DIR manually to guide search.")
 #SET(OPENCV_DIR CACHE PATH "Set the directory containing OpenCVConfig.cmake")
 ENDIF(OPENCV_DIR)


To the COLLADA_INCLUDE_DIR search paths added the directories:

    /usr/local/include/collada-dom2.4
    /usr/local/include/collada-dom2.2
    /opt/local/include/collada-dom2.4
    /opt/local/include/collada-dom2.2
    /usr/include/collada-dom2.4
    /usr/include/collada-dom2.2

To enable recent versions of the DOM to be found in their new install locations.

--- CMakeModules/FindCOLLADA.cmake
+++ CMakeModules/FindCOLLADA.cmake
@@ -53,10 +53,16 @@
     /usr/local/include
     /usr/local/include/colladadom
     /usr/local/include/collada-dom
+    /usr/local/include/collada-dom2.4
+    /usr/local/include/collada-dom2.2
     /opt/local/include/collada-dom
+    /opt/local/include/collada-dom2.4
+    /opt/local/include/collada-dom2.2
     /usr/include/
     /usr/include/colladadom
     /usr/include/collada-dom
+    /usr/include/collada-dom2.4
+    /usr/include/collada-dom2.2
     /sw/include # Fink
     /opt/local/include # DarwinPorts
     /opt/csw/include # Blastwave


Nagios Monitoring 5.0.6-1 Gold

Nagios Monitoring 5.0.6-1 Gold

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -4,6 +4,6 @@
 set ( HPCC_NM_MAJOR 5 )
 set ( HPCC_NM_MINOR 0 )
 set ( HPCC_NM_POINT 6 )
-set ( HPCC_NM_MATURITY "rc" )
+set ( HPCC_NM_MATURITY "release" )
 set ( HPCC_NM_SEQUENCE 1 )
 ###


Split off 8.2.68

Split off 8.2.68

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 2 )
-set ( HPCC_POINT 67 )
+set ( HPCC_POINT 69 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Graph Control 4.2.4-rc2 Release Candidate 2

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -6,7 +6,7 @@
 set ( HPCC_MINOR 2 )
 set ( HPCC_POINT 4 )
 set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_SEQUENCE 2 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Split off 7.8.48

Split off 7.8.48

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 8 )
-set ( HPCC_POINT 47 )
+set ( HPCC_POINT 49 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Suppress unused MACRO

Suppress unused MACRO

--- make/TSPCMakeTools.cmake
+++ make/TSPCMakeTools.cmake
@@ -71,36 +71,6 @@
   ENDIF (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
 ENDMACRO(TSP_LIBRARY_INSTALL)

-MACRO(TSP_XSHAREDLIB)
-  FOREACH(SHARED_LIB ${ARGV})
-    GET_FILENAME_COMPONENT(FN ${SHARED_LIB} NAME)
-
-    SET(XSEARCH_PATH ${LIBRARY_OUTPUT_PATH})
-	SET(XCOPY_PATH ${EXECUTABLE_OUTPUT_PATH})
-
-	IF (WIN32)
-
-		SET(XSEARCH_PATH ${XSEARCH_PATH}/${CMAKE_BUILD_TYPE})
-		SET(XCOPY_PATH ${XCOPY_PATH}/${CMAKE_BUILD_TYPE})
-
-	ENDIF (WIN32)
-
-	FIND_LIBRARY(X_LIBRARY
-		NAMES ${FN}
-		PATHS ${XSEARCH_PATH}
-		DOC "The X Library")
-
-	IF (X_LIBRARY)
-
-		CONFIGURE_FILE(${XSEARCH_PATH}/${SHARED_LIB} ${XCOPY_PATH}/${FN} COPYONLY)
-
-	ENDIF (X_LIBRARY)
-
-  ENDFOREACH(SHARED_LIB)
-ENDMACRO(TSP_XSHAREDLIB)
-
-
-
 MARK_AS_ADVANCED(
   XSCRIPT_OUTPUT_PATH
   XINCLUDE_OUTPUT_PATH


getdeps: add an install_fb_python_executable() function to the CMake utilities

Summary:
Add a `install_fb_python_executable()` function to `FBPythonBinary.cmake` for
helping to install python executables generated with
`add_fb_python_executable()`.  This primarily helps by automatically looking
up the correct output file to install from the generated targets.

Reviewed By: wez

Differential Revision: D18774539

fbshipit-source-id: 4b397580d72ac448f21d1db6d2cdd653cf3635df

--- build/fbcode_builder/CMake/FBPythonBinary.cmake
+++ build/fbcode_builder/CMake/FBPythonBinary.cmake
@@ -548,6 +548,30 @@
 endfunction()

 #
+# Install an FB-style packaged python binary.
+#
+# - DESTINATION <export-name>:
+#   Associate the installed target files with the given export-name.
+#
+function(install_fb_python_executable TARGET)
+  # Parse the arguments
+  set(one_value_args DESTINATION)
+  set(multi_value_args)
+  fb_cmake_parse_args(
+    ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
+  )
+
+  if(NOT DEFINED ARG_DESTINATION)
+    set(ARG_DESTINATION bin)
+  endif()
+
+  install(
+    PROGRAMS "$<TARGET_PROPERTY:${TARGET}.GEN_PY_EXE,EXECUTABLE>"
+    DESTINATION "${ARG_DESTINATION}"
+  )
+endfunction()
+
+#
 # Install a python library.
 #
 # - EXPORT <export-name>:


ENH: Removed unneeded message commands

ENH: Removed unneeded message commands

--- Wrapping/UseSWIGLocal.cmake
+++ Wrapping/UseSWIGLocal.cmake
@@ -245,12 +245,10 @@
     ENDIF(WIN32 AND NOT CYGWIN)
   ENDIF ("${swig_lowercase_language}" STREQUAL "python")
   IF ("${swig_lowercase_language}" STREQUAL "ruby")
-    message ( "ruby module" )
     SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
     IF(APPLE)
       SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".bundle")
       SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES COMPILE_FLAGS "-bundle")
-      message ( "Apple! ruby module: ${SWIG_MODULE_${name}_REAL_NAME}" )
     ENDIF(APPLE)
   ENDIF ("${swig_lowercase_language}" STREQUAL "ruby")
 ENDMACRO(SWIG_ADD_MODULE)


Fix/cmake build grpc (#7028)

Fix/cmake build grpc (#7028)

* BuildFlatbuffers.cmake: add verbose on build

* BuildFlatbuffers.cmake: properly add *.fb.* files with --grpc argument

When "--grpc" argument is provided as an extra flag, resulting grpc files
should be added as part of the interface library.
This prevent adding .fb.cc files manually to the build.

V2: fix dependency on grpc files

--- CMake/BuildFlatBuffers.cmake
+++ CMake/BuildFlatBuffers.cmake
@@ -230,16 +230,30 @@
   foreach(schema ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS})
     get_filename_component(filename ${schema} NAME_WE)
     set(generated_include "${generated_include_dir}/${filename}_generated.h")
+
+    # Generate files for grpc if needed
+    set(generated_source_file)
+    if("${FLATBUFFERS_GENERATE_HEADERS_FLAGS}" MATCHES "--grpc")
+      # Check if schema file contain a rpc_service definition
+      file(STRINGS ${schema} has_grpc REGEX "rpc_service")
+      if(has_grpc)
+        list(APPEND generated_include "${generated_include_dir}/${filename}.grpc.fb.h")
+        set(generated_source_file "${generated_include_dir}/${filename}.grpc.fb.cc")
+      endif()
+    endif()
+
     add_custom_command(
-      OUTPUT ${generated_include}
+      OUTPUT ${generated_include} ${generated_source_file}
       COMMAND ${FLATC} ${FLATC_ARGS}
       -o ${generated_include_dir}
       ${include_params}
       -c ${schema}
       ${FLATBUFFERS_GENERATE_HEADERS_FLAGS}
       DEPENDS ${FLATC_TARGET} ${schema}
-      WORKING_DIRECTORY "${working_dir}")
+      WORKING_DIRECTORY "${working_dir}"
+      COMMENT "Building ${schema} flatbuffers...")
     list(APPEND all_generated_header_files ${generated_include})
+    list(APPEND all_generated_source_files ${generated_source_file})

     # Geneate the binary flatbuffers schemas if instructed to.
     if (NOT ${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR} STREQUAL "")
@@ -264,6 +278,7 @@
     INTERFACE
       ${all_generated_header_files}
       ${all_generated_binary_files}
+      ${all_generated_source_files}
       ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS})
   add_dependencies(
     ${FLATBUFFERS_GENERATE_HEADERS_TARGET}
@@ -278,6 +293,10 @@
     TREE "${generated_target_dir}"
     PREFIX "Flatbuffers/Generated/Headers Files"
     FILES ${all_generated_header_files})
+  source_group(
+    TREE "${generated_target_dir}"
+    PREFIX "Flatbuffers/Generated/Source Files"
+    FILES ${all_generated_source_files})
   source_group(
     TREE ${working_dir}
     PREFIX "Flatbuffers/Schemas"
@@ -371,7 +390,8 @@
       -b ${FLATBUFFERS_GENERATE_BINARY_FILES_SCHEMA} ${json_file}
       ${FLATBUFFERS_GENERATE_BINARY_FILES_FLAGS}
       DEPENDS ${FLATC_TARGET} ${json_file}
-      WORKING_DIRECTORY "${working_dir}")
+      WORKING_DIRECTORY "${working_dir}"
+      COMMENT "Building ${json_file} binary flatbuffers...")
       list(APPEND all_generated_binary_files ${generated_binary_file})
   endforeach()


build: look for function iconv_open() instead of iconv() to make cmake messages less confusing

--- CMakeModules/FindIconv.cmake
+++ CMakeModules/FindIconv.cmake
@@ -34,7 +34,7 @@

 if(NOT ICONV_INCLUDE_DIR STREQUAL "ICONV_INCLUDE_DIR-NOTFOUND")
     set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
-    check_function_exists(iconv ICONV_IN_GLIBC)
+    check_function_exists(iconv_open ICONV_IN_GLIBC)
 endif()

 if(NOT ICONV_IN_GLIBC)


add /usr/local/include to include dir that is default include dir for the 3rd party software for FreeBSD.

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -31,6 +31,10 @@
 #

 set(DEFAULT_INCLUDE_DIRECTORIES)
+
+if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+    include_directories("/usr/local/include")
+endif ()

 #


next try ...

next try ...

--- cmake/FindOpenALSoft.cmake
+++ cmake/FindOpenALSoft.cmake
@@ -5,31 +5,31 @@
 #  OPENALSOFT_INCLUDE_DIR    - The OpenAL-Soft include directories
 #  OPENALSOFT_LIBRARY        - The OpenAL-Soft libraries

-find_path(OPENALSOFT_INCLUDE_DIR
-  NAMES al.h
-  PATHS
-    /sw # Fink
-    /opt/local # DarwinPorts
-    /opt/csw # Blastwave
-    /opt
-    # Linux Include PATH
-    /usr/include/AL/
-    # Windows SDK Include PATH
-    /include/OpenALSoft
-)
+IF(NOT APPLE)
+  find_path(OPENALSOFT_INCLUDE_DIR al.h
+    PATHS
+      /sw # Fink
+      /opt/local # DarwinPorts
+      /opt/csw # Blastwave
+      /opt
+      # Linux Include PATH
+      /usr/include/AL/
+      # Windows SDK Include PATH
+      /include/OpenALSoft
+  )

-find_library(OPENALSOFT_LIBRARY
-  NAMES libopenal openal libOpenAL32 OpenAL32 OpenAL32.dll soft_oal.dll
-  PATHS
-    ${OPENALSOFT_INCLUDE_DIR}/../lib
-    /usr/local/opt/openal-soft/lib
-    /lib
-    /usr/lib
-)
+  find_library(OPENALSOFT_LIBRARY
+    NAMES libopenal openal libOpenAL32 OpenAL32 OpenAL32.dll soft_oal.dll
+    PATHS
+      ${OPENALSOFT_INCLUDE_DIR}/../lib
+      /usr/local/opt/openal-soft/lib
+      /lib
+      /usr/lib
+  )
+ENDIF(NOT APPLE)

 IF (APPLE)
-  find_path(OPENALSOFT_INCLUDE_DIR
-  NAMES al.h
+  find_path(OPENALSOFT_INCLUDE_DIR al.h
   PATHS
     /usr/local/opt/openal-soft/include/
   )
@@ -43,6 +43,6 @@

 include(FindPackageHandleStandardArgs)

-find_package_handle_standard_args(OPENALSOFT DEFAULT_MSG OPENALSOFT_LIBRARY OPENALSOFT_INCLUDE_DIR)
+find_package_handle_standard_args(OPENALSOFT REQUIRED_VARS OPENALSOFT_LIBRARY OPENALSOFT_INCLUDE_DIR)

 mark_as_advanced(OPENALSOFT_INCLUDE_DIR OPENALSOFT_LIBRARY)


Build system: tweak WARNING message when hdf5.h is not found

--- cmake/modules/octave.cmake
+++ cmake/modules/octave.cmake
@@ -182,7 +182,7 @@
 	)
       else(OCTAVE_INCLUDE_PATH_EXTERNAL)
 	message(STATUS "WARNING: "
-	  "Required external octave header, hdf5.h, not found. Disabling octave bindings")
+	  "Required external octave header, hdf5.h, that is typically part of the libhdf5-dev package, has not found. Disabling octave bindings")
 	set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
       endif(OCTAVE_INCLUDE_PATH_EXTERNAL)
     else(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)


Update find Boost version

Update find Boost version

Update find Boost version.
Add Boost 1.64.0 that supported Visual Studio 2017.


cmake: replace hard-coded RPATH with rel-path in qi_create_bin/lib

If a developer specifies a SUBFOLDER in qi_create_bin or qi_create_lib,
then the RPATH for Linux that was hard-coded ("$ORIGIN/../lib") becomes
incorrect.

Instead, this patch transforms it into
"$ORIGIN/<relative path to sdk/lib>" that takes into account the
SUBFOLDER.

Change-Id: I4513918aeba4f5f908d85ba6dc15d6786d147d7e

--- cmake/qibuild/target.cmake
+++ cmake/qibuild/target.cmake
@@ -117,17 +117,17 @@
       RUNTIME_OUTPUT_DIRECTORY                "${_runtime_out}"
   )

+  file(RELATIVE_PATH _dotdot "${_runtime_out}" "${QI_SDK_DIR}/${QI_SDK_LIB}")
   if(UNIX AND NOT APPLE)
     if(NOT ARG_NO_RPATH)
       # Use a relative rpath at installation
       set_target_properties("${name}"
         PROPERTIES
-          INSTALL_RPATH "\$ORIGIN/../lib"
+          INSTALL_RPATH "\$ORIGIN/${_dotdot}"
       )
     endif()
   endif()
   if(APPLE AND NOT ARG_NO_RPATH)
-     file(RELATIVE_PATH _dotdot "${_runtime_out}" "${QI_SDK_DIR}/${QI_SDK_LIB}")
      set_target_properties("${name}"
        PROPERTIES
          INSTALL_RPATH "@executable_path/${_dotdot};@executable_path/${_dotdot}/..")
@@ -329,18 +329,19 @@
         INSTALL_NAME_DIR ${QI_INSTALL_NAME_DIR}
     )
   endif()
+
+ file(RELATIVE_PATH _dotdot "${_lib_out}" "${QI_SDK_DIR}/${QI_SDK_LIB}")
   if(UNIX AND NOT APPLE)
     if(NOT ARG_NO_RPATH)
       # Use a relative rpath at installation
       set_target_properties("${name}"
         PROPERTIES
-          INSTALL_RPATH "\$ORIGIN/../lib"
+          INSTALL_RPATH "\$ORIGIN/${_dotdot}"
       )
     endif()
   endif()
   if(APPLE AND NOT ARG_NO_RPATH AND NOT _type STREQUAL "STATIC")
      set(_rpath "@loader_path")
-     file(RELATIVE_PATH _dotdot "${_lib_out}" "${QI_SDK_DIR}/${QI_SDK_LIB}")
      if(NOT "${_dotdot}" STREQUAL "")
          set(_rpath "${_rpath};@loader_path/${_dotdot}")
      endif()


feat(Core/Cmake): add support MariaDb 10.7 and 10.8 (#10322)

--- src/cmake/macros/FindMySQL.cmake
+++ src/cmake/macros/FindMySQL.cmake
@@ -40,7 +40,7 @@
 # Find MariaDB for Windows
 if (WIN32)
   # Set know versions MariaDB
-  set(_MARIADB_KNOWN_VERSIONS "MariaDB 10.6" "MariaDB 10.5")
+  set(_MARIADB_KNOWN_VERSIONS "MariaDB 10.8" "MariaDB 10.7" "MariaDB 10.6" "MariaDB 10.5")

   # Set default options
   set(MARIADB_FOUND_LIB 0)


Adding locations for boost discovery

Adding locations for boost discovery

--- appveyor.cmake
+++ appveyor.cmake
@@ -1,5 +1,5 @@
 set(BUILD_DIR C:/projects/morebin CACHE PATH "")
-set(BOOST_ROOT C:/Libraries/boost_1_60_0/ CACHE_PATH "")
-set(BOOST_DIR C:/Libraries/boost_1_60_0/ CACHE_PATH "")
-set(BOOST_INCLUDE_DIR C:/Libraries/boost_1_60_0/ CACHE_PATH "")
-set(BOOST_LIBRARY_DIR C:/Libraries/boost_1_60_0/lib64-msvc-14.0/ CACHE_PATH "")
+set(Boost_ROOT C:/Libraries/boost_1_60_0/ CACHE_PATH "")
+set(Boost_DIR C:/Libraries/boost_1_60_0/ CACHE_PATH "")
+set(Boost_INCLUDE_DIR C:/Libraries/boost_1_60_0/ CACHE_PATH "")
+set(Boost_LIBRARY_DIR C:/Libraries/boost_1_60_0/lib64-msvc-14.0/ CACHE_PATH "")


Fix lib names for embree-config

Fix lib names for embree-config

On Linux and Mac OS X the lib names to be linked against should contain
the API version (SOVERSION).

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -94,11 +94,15 @@
   INSTALL(PROGRAMS "${PROJECT_BINARY_DIR}/uninstall.command" DESTINATION ${CMAKE_INSTALL_BINDIR}/.. COMPONENT lib)
 ENDIF()

+# why does this have to be so complicated...
 IF (WIN32)
-  SET(EMBREE_LIBRARY_NAME embree.lib)
-ELSE()
-  SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${CMAKE_SHARED_LIBRARY_SUFFIX})
-ENDIF()
+  SET(EMBREE_LIBRARY_NAME ${CMAKE_IMPORT_LIBRARY_PREFIX}embree${CMAKE_IMPORT_LIBRARY_SUFFIX})
+ELSEIF (APPLE)
+  SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree.${EMBREE_CONFIG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
+ELSE()
+  SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${CMAKE_SHARED_LIBRARY_SUFFIX}.${EMBREE_CONFIG_VERSION})
+ENDIF()
+
 IF (WIN32 OR EMBREE_ZIP_MODE)
   # for local "installs" and on Windows we want the cmake config files placed
   # in the install root, such that users can point the CMake variable


minor fix for static build

minor fix for static build

--- tutorial/cmake/FindNANOGUIH.cmake
+++ tutorial/cmake/FindNANOGUIH.cmake
@@ -38,9 +38,9 @@
 if(NANOGUI_FOUND)
   message(STATUS "Found NANOGUI: ${NANOGUI_INCLUDE_DIR} -- HEADERS ONLY")
 else(NANOGUI_FOUND)
-  if (NOT NANOGUI_FIND_QUIETLY)
+  if (NOT NANOGUIH_FIND_QUIETLY)
     message(FATAL_ERROR "could NOT find NANOGUI")
-  endif (NOT NANOGUI_FIND_QUIETLY)
+  endif (NOT NANOGUIH_FIND_QUIETLY)
 endif(NANOGUI_FOUND)

 endif(NOT NANOGUI_FOUND)


CMake: Bugfix: Throw a verbose error message instead of silently ignoring an argument

--- cmake/macros/macro_deal_ii_setup_target.cmake
+++ cmake/macros/macro_deal_ii_setup_target.cmake
@@ -38,9 +38,8 @@
 #   "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_<build type>}"
 #
 # If no "DEBUG" or "RELEASE" keyword is specified after the target, the
-# current CMAKE_BUILD_TYPE determines which compiler and linker flags as
-# well as compile definitions to use and against which deal.II library it
-# should be linked against.
+# current CMAKE_BUILD_TYPE is used instead: Every build type that (case
+# insensitively) matches "debug" is considered a debug build.
 #
 # If the requested build type is not available (e.g. DEBUG request but
 # deal.II was compiled with release mode only), the other available will be
@@ -80,6 +79,11 @@
   #
   IF("${ARGN}" MATCHES "^(DEBUG|RELEASE)$")
     SET(_build "${ARGN}")
+  ELSEIF(NOT "${ARGN}" STREQUAL "")
+    MESSAGE(FATAL_ERROR
+      "\nDEAL_II_SETUP_TARGET called with invalid second argument.
+      Valid arguments are (empty), DEBUG, or RELEASE\n\n"
+      )
   ENDIF()

   #


Hunter spdlog points to official release

--- hunter_recipes/projects/GBenchmark/hunter.cmake
+++ hunter_recipes/projects/GBenchmark/hunter.cmake
@@ -31,9 +31,9 @@
     VERSION
     "1.1.0"
     URL
-    "https://github.com/mdavezac/benchmark/archive/v1.1.0.tar.gz"
+    "https://github.com/google/benchmark/archive/v1.1.0.tar.gz"
     SHA1
-    772372564531dc0023037367a122391326bd1dc0
+    8c539bbe2a212618fa87b6c38fba087100b6e4ae
 )

 hunter_cmake_args(GBenchmark CMAKE_ARGS BENCHMARK_ENABLE_TESTING=OFF)


Prefer the more specific 'sqlite3' library name

We are not compatible with pre v3 sqlite

--- cmake-modules/FindSQLite3.cmake
+++ cmake-modules/FindSQLite3.cmake
@@ -19,7 +19,7 @@
 FIND_PATH(SQLITE3_INCLUDE_DIR NAMES sqlite3.h)

 # Look for the library.
-FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite sqlite3)
+FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite)

 # Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE if all listed variables are TRUE.
 INCLUDE(FindPackageHandleStandardArgs)


Add back the version variables removed in ab40630f.

--- cmake/OpenCVFindLibsVideo.cmake
+++ cmake/OpenCVFindLibsVideo.cmake
@@ -232,6 +232,10 @@
         find_library(FFMPEG_SWSCALE_LIB "swscale" HINTS "${FFMPEG_LIB_DIR}")
         if(FFMPEG_CODEC_LIB AND FFMPEG_FORMAT_LIB AND
            FFMPEG_UTIL_LIB AND FFMPEG_SWSCALE_LIB)
+          set(ALIASOF_libavcodec_VERSION "Unknown")
+          set(ALIASOF_libavformat_VERSION "Unknown")
+          set(ALIASOF_libavutil_VERSION "Unknown")
+          set(ALIASOF_libswscale_VERSION "Unknown")
           set(HAVE_FFMPEG 1)
         endif()
       endif(FFMPEG_INCLUDE_DIR)


Check if libgadu is compiled with GG_CONFIG_HAVE_PTHREAD, otherwise it will crash Kopete.

BUG: 193957

svn path=/trunk/KDE/kdenetwork/kopete/; revision=982946

--- cmake/modules/FindLibgadu.cmake
+++ cmake/modules/FindLibgadu.cmake
@@ -16,12 +16,7 @@

 include (FindLibraryWithDebug)

-if (LIBGADU_INCLUDE_DIR AND LIBGADU_LIBRARIES)
-
-    # in cache already
-    set (LIBGADU_FOUND TRUE)
-
-else (LIBGADU_INCLUDE_DIR AND LIBGADU_LIBRARIES)
+if (NOT LIBGADU_INCLUDE_DIR OR NOT LIBGADU_LIBRARIES)

     if (NOT WIN32)

@@ -69,4 +64,29 @@

     mark_as_advanced (LIBGADU_INCLUDE_DIR LIBGADU_LIBRARIES)

-endif (LIBGADU_INCLUDE_DIR AND LIBGADU_LIBRARIES)
+endif (NOT LIBGADU_INCLUDE_DIR OR NOT LIBGADU_LIBRARIES)
+
+if (LIBGADU_INCLUDE_DIR AND LIBGADU_LIBRARIES)
+
+    if (NOT WIN32)
+
+        execute_process ( COMMAND grep "#define GG_CONFIG_HAVE_PTHREAD" ${LIBGADU_INCLUDE_DIR}/libgadu.h RESULT_VARIABLE LIBGADU_PTHREADS )
+
+        if (${LIBGADU_PTHREADS} GREATER 0)
+
+            MESSAGE(STATUS "libgadu must be compiled with pthreads support")
+            set (LIBGADU_FOUND FALSE)
+
+        else (${LIBGADU_PTHREADS} GREATER 0)
+
+            set (LIBGADU_FOUND TRUE)
+
+        endif (${LIBGADU_PTHREADS} GREATER 0)
+
+    else (NOT WIN32)
+
+        set (LIBGADU_FOUND TRUE)
+
+    endif (NOT WIN32)
+
+endif (LIBGADU_INCLUDE_DIR AND LIBGADU_LIBRARIES)


updating cmake

updating cmake

--- cmake/select_compute_arch.cmake
+++ cmake/select_compute_arch.cmake
@@ -63,6 +63,7 @@
       "}\n")

     execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${cufile}"
+                    "-ccbin" ${CMAKE_CXX_COMPILER}
                     WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                     RESULT_VARIABLE nvcc_res OUTPUT_VARIABLE nvcc_out
                     ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -116,13 +117,13 @@
       set(add_ptx TRUE)
       set(arch_name ${CMAKE_MATCH_1})
     endif()
-    if(arch_name MATCHES "([0-9]\\.[0-9])$")
+    if(arch_name MATCHES "(^[0-9]\\.[0-9](\\([0-9]\\.[0-9]\\))?)$")
       set(arch_bin ${CMAKE_MATCH_1})
       set(arch_ptx ${arch_bin})
     else()
       # Look for it in our list of known architectures
       if(${arch_name} STREQUAL "Fermi")
-        set(arch_bin 2.0 "2.1(2.0)")
+        set(arch_bin "2.0 2.1(2.0)")
       elseif(${arch_name} STREQUAL "Kepler+Tegra")
         set(arch_bin 3.2)
       elseif(${arch_name} STREQUAL "Kepler+Tesla")
@@ -173,11 +174,11 @@
   # Tell NVCC to add binaries for the specified GPUs
   foreach(arch ${cuda_arch_bin})
     if(arch MATCHES "([0-9]+)\\(([0-9]+)\\)")
-      # User explicitly specified PTX for the concrete BIN
+      # User explicitly specified ARCH for the concrete CODE
       list(APPEND nvcc_flags -gencode arch=compute_${CMAKE_MATCH_2},code=sm_${CMAKE_MATCH_1})
       list(APPEND nvcc_archs_readable sm_${CMAKE_MATCH_1})
     else()
-      # User didn't explicitly specify PTX for the concrete BIN, we assume PTX=BIN
+      # User didn't explicitly specify ARCH for the concrete CODE, we assume ARCH=CODE
       list(APPEND nvcc_flags -gencode arch=compute_${arch},code=sm_${arch})
       list(APPEND nvcc_archs_readable sm_${arch})
     endif()


YamlCpp: disable build tests to avoid error

as we were getting error with gtest, disabling tests for YamlCpp
workarounds the problem.

--- external/YamlCppLib.cmake
+++ external/YamlCppLib.cmake
@@ -60,6 +60,7 @@
     CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
         -DBUILD_SHARED_LIBS=OFF
         -DYAML_CPP_BUILD_TOOLS=OFF
+	-DYAML_CPP_BUILD_TESTS=OFF # causes build errors with gtest (as of YamlCpp 0.6.2)
         -DYAML_CPP_BUILD_CONTRIB=OFF
         -DCMAKE_C_FLAGS=${c_flags}
         -DCMAKE_CXX_FLAGS=${cxx_flags}


ENH: show patch command with full args list if failed

--- SuperBuild/CMake/patch.cmake
+++ SuperBuild/CMake/patch.cmake
@@ -54,7 +54,8 @@
   endif()

   if(PATCHING_FAILED)
-    message(FATAL_ERROR "${PATCH_PROGRAM} returned non-zero exit status \n ${patch_ov} \n")
+    message(FATAL_ERROR
+      "${PATCH_PROGRAM} ${PATCH_ARGS} -p1 -i ${dot_diff_file} failed\n error: ${patch_ov} \n")
   else()
     message("${patch_ov}")
   endif()


Allows (but does not require) the user to define the coin_root_dir either on the command line or in an environment variable. This was a slight streamlining improvement noticed while debugging the cae build, and avoids the need for adding any coin include directories to your path.

--- src/CMake/FindCOIN.cmake
+++ src/CMake/FindCOIN.cmake
@@ -1,8 +1,16 @@
 # modeled after FindCOIN.cmake in the lemon project
+
+IF(NOT DEFINED COIN_ROOT_DIR)
+    SET(COIN_ROOT_DIR "$ENV{COIN_ROOT_DIR}")
+ENDIF(NOT DEFINED COIN_ROOT_DIR)
+
+MESSAGE(STATUS "COIN_ROOT_DIR hint is : ${COIN_ROOT_DIR}")

 # if installed in a non-standard location,
 # the include directory must be added to the PATH variable
 FIND_PATH(COIN_INCLUDE_DIR coin/CbcModel.hpp
+  HINTS "${COIN_INCLUDE_DIR}"
+  HINTS "${COIN_ROOT_DIR}/include"
   HINTS /usr/
   HINTS /usr/include/
   HINTS /usr/local/
@@ -19,61 +27,71 @@

 FIND_LIBRARY(COIN_CBC_LIBRARY
   NAMES Cbc libCbc
-  HINTS ${COIN_INCLUDE_DIR}/../../lib/
+  HINTS "${COIN_INCLUDE_DIR}/../../lib/"
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN CBC: ${COIN_CBC_LIBRARY}")

 FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
   NAMES CbcSolver libCbcSolver
   HINTS ${COIN_INCLUDE_DIR}/../../lib/
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN CBC solver: ${COIN_CBC_SOLVER_LIBRARY}")

 FIND_LIBRARY(COIN_CGL_LIBRARY
   NAMES Cgl libCgl
   HINTS ${COIN_INCLUDE_DIR}/../../lib/
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN CGL: ${COIN_CGL_LIBRARY}")

 FIND_LIBRARY(COIN_CLP_LIBRARY
   NAMES Clp libClp
   HINTS ${COIN_INCLUDE_DIR}/../../lib/
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN CLP: ${COIN_CLP_LIBRARY}")

 FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
   NAMES CoinUtils libCoinUtils
   HINTS ${COIN_INCLUDE_DIR}/../../lib/
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN UTILS: ${COIN_COIN_UTILS_LIBRARY}")

 FIND_LIBRARY(COIN_OSI_LIBRARY
   NAMES Osi libOsi
   HINTS ${COIN_INCLUDE_DIR}/../../lib/
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN OSI: ${COIN_OSI_LIBRARY}")

 FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
   NAMES OsiCbc libOsiCbc
   HINTS ${COIN_INCLUDE_DIR}/../../lib/
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN OSI CBC: ${COIN_OSI_CBC_LIBRARY}")

 FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
   NAMES OsiClp libOsiClp
   HINTS ${COIN_INCLUDE_DIR}/../../lib/
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN OSI CLP: ${COIN_OSI_CLP_LIBRARY}")

 FIND_LIBRARY(COIN_ZLIB_LIBRARY
   NAMES z libz
   HINTS ${COIN_ROOT_DIR}/lib
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 #MESSAGE("\tCOIN ZLIP: ${COIN_ZLIB_LIBRARY}")

 FIND_LIBRARY(COIN_BZ2_LIBRARY
- NAMES bz2 libz2
- HINTS ${COIN_ROOT_DIR}/lib
+  NAMES bz2 libz2
+  HINTS ${COIN_ROOT_DIR}/lib
+  HINTS "${COIN_ROOT_DIR}/lib"
 )
 # #MESSAGE("\tCOIN BZ2: ${COIN_BZ2_LIBRARY}")

@@ -110,4 +128,4 @@
   MESSAGE("\tFound COIN Include Dirs: ${COIN_INCLUDE_DIRS}")
 ELSE(COIN_INCLUDE_DIRS)
   MESSAGE("\tCOIN Include Dirs NOT FOUND")
-ENDIF(COIN_INCLUDE_DIRS)+ENDIF(COIN_INCLUDE_DIRS)


include zlib, bzip2 if using boost iostreams

--- projects/use/usexp-boost-config.cmake
+++ projects/use/usexp-boost-config.cmake
@@ -46,6 +46,11 @@
   # NOTE: determined boost library dependency order by building boost on linux
   # with link=shared and runtime-link=shared and using ldd
 endif()
+list(FIND Boost_LIBS iostreams idx)
+if(NOT ${idx} EQUAL -1)
+  xpGetExtern(dontcare zlibBinary PRIVATE zlib)
+  xpGetExtern(dontcare bzip2Binary PRIVATE bzip2)
+endif()
 unset(Boost_INCLUDE_DIR CACHE)
 unset(Boost_LIBRARY_DIR CACHE)
 foreach(lib ${Boost_LIBS})
@@ -56,6 +61,7 @@
 string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1.\\2" BOOST_VER2 ${BOOST_VER})
 set(Boost_ADDITIONAL_VERSIONS ${BOOST_VER} ${BOOST_VER2})
 if(UNIX)
+  set(syslibs $<TARGET_FILE:${zlibBinary}> $<TARGET_FILE:${bzip2Binary}>)
   include(CheckLibraryExists)
   function(checkLibraryConcat lib symbol liblist)
     string(TOUPPER ${lib} LIB)
@@ -97,6 +103,12 @@
   endif()
   link_directories(${XP_ROOTDIR}/lib)
   set(reqVars ${PRJ}_INCLUDE_DIR)
+  if(DEFINED zlibBinary)
+    add_definitions(-DBOOST_ZLIB_BINARY=$<TARGET_FILE:${zlibBinary}>)
+  endif()
+  if(DEFINED bzip2Binary)
+    add_definitions(-DBOOST_BZIP2_BINARY=$<TARGET_FILE:${bzip2Binary}>)
+  endif()
 endif()
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(${prj} REQUIRED_VARS ${reqVars})


兼容自定义安装位置的check

兼容自定义安装位置的check

--- cmake/FindCheck.cmake
+++ cmake/FindCheck.cmake
@@ -4,6 +4,7 @@
 #  CHECK_FOUND - system has check
 #  CHECK_INCLUDE_DIRS - the check include directory
 #  CHECK_LIBRARIES - check library
+#  CHECK_LIBRARY_DIRS - the check library directory
 #
 #  Copyright (c) 2007 Daniel Gollub <gollub@b1-systems.de>
 #  Copyright (c) 2007-2009 Bjoern Ricks  <bjoern.ricks@gmail.com>
@@ -28,6 +29,6 @@
 ENDIF ( CHECK_MIN_VERSION )

 # Hide advanced variables from CMake GUIs
-MARK_AS_ADVANCED( CHECK_INCLUDE_DIRS CHECK_LIBRARIES )
+MARK_AS_ADVANCED( CHECK_INCLUDE_DIRS CHECK_LIBRARIES CHECK_LIBRARY_DIRS)


git-svn-id: https://ricamsvn.ricam.oeaw.ac.at/gismo/stable@4157 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsLibrary.cmake
+++ cmake/gsLibrary.cmake
@@ -19,7 +19,8 @@
 if(GISMO_BUILD_LIB)

 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
- set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES} "${PROJECT_SOURCE_DIR}/src/misc/gsLibInit.cpp")
+ set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
+     "${gismo_SOURCE_DIR}/src/misc/gsLibInit.cpp")
 endif()

 #add_library(${PROJECT_NAME} ${LIB_TYPE}


Enable D bindings and examples by default.  The D examples are still not
complete, but a large fraction of them are, and the bindings and
existing examples build without issues.

Previously, we were rather reluctant to enable a new language by default,
but now that a missing D compiler only causes a warning, I believe the
criteria for enabling a language by default do not have to be quite so
severe as before.

svn path=/trunk/; revision=10157

--- cmake/modules/d.cmake
+++ cmake/modules/d.cmake
@@ -25,7 +25,7 @@
 if(DEFAULT_NO_BINDINGS)
   option(ENABLE_d "Enable D bindings" OFF)
 else(DEFAULT_NO_BINDINGS)
-  option(ENABLE_d "Enable D bindings" OFF)
+  option(ENABLE_d "Enable D bindings" ON)
 endif(DEFAULT_NO_BINDINGS)

 if(ENABLE_d AND NOT PLPLOT_D_COMPILER_WORKS)


[SUPERBUILD] attempt to write sensible message when finding HDF5

--- SuperBuild/External_HDF5.cmake
+++ SuperBuild/External_HDF5.cmake
@@ -50,7 +50,7 @@
  else()
     if(${USE_SYSTEM_${externalProjName}})
       find_package(${proj} ${${externalProjName}_REQUIRED_VERSION} REQUIRED)
-      message("USING the system ${externalProjName}, set ${externalProjName}_DIR=${${externalProjName}_DIR}")
+      message(STATUS "USING the system ${externalProjName}, found HDF5_C_LIBRARY_hdf5=${HDF5_C_LIBRARY_hdf5}")
   endif()
 endif()


Updating swig-2.0.11-1.tar.gz download file and hash.

The prior file had the root of the tar ball include "swig-2.0.11-1"
which was not expected in the superbuild.

Change-Id: I6fe7bbec01b6190ec52732db7c36f80fd34608c7

--- SuperBuild/External_Swig.cmake
+++ SuperBuild/External_Swig.cmake
@@ -13,7 +13,7 @@
 if(NOT SWIG_DIR)

   set(SWIG_TARGET_VERSION 2.0.11-1)
-  set(SWIG_DOWNLOAD_SOURCE_HASH "baa47646134350d5e0dbb9aa7346b94e")
+  set(SWIG_DOWNLOAD_SOURCE_HASH "23f4f4b26bf5d8466c6d9008ef0081af")
   set(SWIG_DOWNLOAD_WIN_HASH "084d171dd2155782c0c9de0fd289c7e3" )


cmake: Try to compensate for new ffmpeg directory structure by setting HAVE_LIBSWSCALE_TREE if swscale.his found.

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -454,7 +454,7 @@
   vlc_check_include_files (ffmpeg/avcodec.h)
   vlc_check_include_files (ffmpeg/avutil.h)
   vlc_check_include_files (ffmpeg/swscale.h)
-  vlc_check_include_files (swscale.h)
+  check_include_files (swscale.h HAVE_LIBSWSCALE_TREE)

   check_include_files ("stdint.h;postproc/postprocess.h" HAVE_POSTPROC_POSTPROCESS_H)
   vlc_enable_modules(ffmpeg)


FindVOTCA_TOOLS.cmake: fixed a typo

FindVOTCA_TOOLS.cmake: fixed a typo

--- CMakeModules/FindVOTCA_TOOLS.cmake
+++ CMakeModules/FindVOTCA_TOOLS.cmake
@@ -30,6 +30,9 @@
 if (VOTCA_TOOLS_HAS_SQLITE3)
   #due to include <sqlite3.h> in database.h
   find_package(SQLITE3 REQUIRED)
+  set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR};${SQLITE3_INCLUDE_DIR}" )
+else(VOTCA_TOOLS_HAS_SQLITE3)
+  set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR}" )
 endif (VOTCA_TOOLS_HAS_SQLITE3)

@@ -48,7 +51,6 @@
 endif("${VOTCA_TOOLS_LIBRARY}" MATCHES "libvotca_tools[^;]*\\.a")

 set(VOTCA_TOOLS_LIBRARIES "${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}" )
-set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR}" )

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set VOTCA_TOOLS_FOUND to TRUE


Add -lm and disable EXPRECISION support on *BSD

fixes #2075

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -4,6 +4,11 @@
 ##              Detects the OS and sets appropriate variables.

 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+  set(EXTRALIB "${EXTRALIB} -lm")
+  set(NO_EXPRECISION 1)
+endif ()
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|OpenBSD|NetBSD|DragonFly")
   set(EXTRALIB "${EXTRALIB} -lm")
   set(NO_EXPRECISION 1)
 endif ()


Trying to make Ubuntu find v8.

Trying to make Ubuntu find v8.

Unfortunately the v8 version installed by nodejs is not compatible with
v8 8.5.x

--- cmake/v8.cmake
+++ cmake/v8.cmake
@@ -14,11 +14,37 @@

 find_package(PkgConfig)
 if(PKG_CONFIG_FOUND)
-    pkg_check_modules(V8 REQUIRED IMPORTED_TARGET GLOBAL v8 v8_libplatform)
-    set(V8_TARGET PkgConfig::V8)
+    pkg_check_modules(V8 QUIET IMPORTED_TARGET GLOBAL v8 v8_libplatform)
+    if(V8_FOUND)
+        set(V8_TARGET PkgConfig::V8)
+    else()
+        find_path(V8_INCLUDE_DIR NAMES "v8.h" PATH_SUFFIXES "nodejs/deps/v8/include" REQUIRED)
+
+        if(V8_INCLUDE_DIR AND EXISTS "${V8_INCLUDE_DIR}/v8-version.h")
+            file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MAJOR_VERSION REGEX "^#define V8_MAJOR_VERSION [0-9]+.*$")
+            string(REGEX REPLACE "^#define V8_MAJOR_VERSION ([0-9]+).*$" "\\1" V8_MAJOR_VERSION "${V8_MAJOR_VERSION}")
+            file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MINOR_VERSION REGEX "^#define V8_MINOR_VERSION [0-9]+.*$")
+            string(REGEX REPLACE "^#define V8_MINOR_VERSION ([0-9]+).*$" "\\1" V8_MINOR_VERSION  "${V8_MINOR_VERSION}")
+            file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_BUILD_NUMBER REGEX "^#define V8_BUILD_NUMBER [0-9]+.*$")
+            string(REGEX REPLACE "^#define V8_BUILD_NUMBER ([0-9]+).*$" "\\1" V8_BUILD_NUMBER "${V8_BUILD_NUMBER}")
+            file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_PATCH_LEVEL REGEX "^#define V8_PATCH_LEVEL [0-9]+.*$")
+            string(REGEX REPLACE "^#define V8_PATCH_LEVEL ([0-9]+).*$" "\\1" V8_PATCH_LEVEL "${V8_PATCH_LEVEL}")
+            set(V8_VERSION_STRING "${V8_MAJOR_VERSION}.${V8_MINOR_VERSION}.${V8_BUILD_NUMBER}.${V8_PATCH_LEVEL}")
+            message(STATUS "V8 Version ${V8_VERSION_STRING}")
+        endif()
+
+        find_library(v8 V8_LIBRARY)
+        find_library(v8_libbase V8LIBBASE_LIBRARY)
+        find_library(v8_libplatform V8LIBPLATFORM_LIBRARY)
+        add_library(V8::V8 SHARED IMPORTED)
+        set_target_properties(V8::V8 PROPERTIES
+          INTERFACE_INCLUDE_DIRECTORIES "${V8_INCLUDE_DIR}"
+          IMPORTED_LOCATION "${V8_LIBRARY}"
+          IMPORTED_LINK_INTERFACE_LIBRARIES
+          "${V8LIBBASE_LIBRARY};${V8LIBPLATFORM_LIBRARY}")
+        set(V8_TARGET V8::V8)
+    endif()
 else()
     find_package(V8 REQUIRED)
     set(V8_TARGET V8::V8 V8::V8LIBBASE V8::V8LIBPLATFORM)
 endif()
-
-