Changed version generation svn->git for copyScript

[ ] May break build
[ ] Breaks existing applications
[x] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation

--- copyScript.cmake
+++ copyScript.cmake
@@ -87,7 +87,7 @@
         "xcopy /s /y \"${WIN_SOURCE_DIR}\\libs\\server\\\"*.h \"${COPY_TARGET}\\include\\eq\\server\"\n"
         "xcopy /s /y \"${WIN_SOURCE_DIR}\\libs\\server\\equalizers\\\"*.h \"${COPY_TARGET}\\include\\eq\\server\\equalizers\"\n"

-        "\"%ProgramFiles%\\TortoiseSVN\\bin\\SubWCRev.exe\" \"${WIN_SOURCE_DIR}\" > \"${COPY_TARGET}\\include\\eq\\Version.txt\"\n"
+        "\"%ProgramFiles(x86)%\\Git\\bin\\git.exe\" --no-pager log --max-count=1 \"${WIN_SOURCE_DIR}\" > \"${COPY_TARGET}\\include\\eq\\Version.txt\"\n"
         "pause\n"
     )
 endif(WIN32)


fixed macro deal2lkit_setup_target

fixed macro deal2lkit_setup_target

--- cmake/macros/macro_deal2lkit_setup_target.cmake
+++ cmake/macros/macro_deal2lkit_setup_target.cmake
@@ -132,6 +132,6 @@
       )
   ENDIF()

-  DEAL_II_SETUP_TARGET(${_target})
+  DEAL_II_SETUP_TARGET(${_target} ${ARGN})

 ENDMACRO()


qt4.cmake: Updated Qt download url.

qt4.cmake: Updated Qt download url.

--- qt4.cmake
+++ qt4.cmake
@@ -15,7 +15,7 @@
     4.8.3
     qt-everywhere-opensource-src-4.8.3.tar.gz
     a663b6c875f8d7caa8ac9c30e4a4ec3b
-    http://download.qt.nokia.com/qt/source)
+    http://download.qt-project.org/official_releases/qt/4.8/4.8.3)

 message ("Installing ${qt4_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")


Nagios Monitoring 5.4.2-rc2 Release Candidate 2

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

--- version.cmake
+++ version.cmake
@@ -4,7 +4,7 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 5 )
 set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "release" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_POINT 2 )
+set ( HPCC_MATURITY "rc" )
+set ( HPCC_SEQUENCE 2 )
 ###


Split off 8.6.48

Split off 8.6.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 8 )
 set ( HPCC_MINOR 6 )
-set ( HPCC_POINT 47 )
+set ( HPCC_POINT 49 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off candidate-4.2.4 branch

Split off candidate-4.2.4 branch

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

--- version.cmake
+++ version.cmake
@@ -4,9 +4,9 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 4 )
 set ( HPCC_MINOR 2 )
-set ( HPCC_POINT 3 )
-set ( HPCC_MATURITY "closedown" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_POINT 4 )
+set ( HPCC_MATURITY "rc" )
+set ( HPCC_SEQUENCE 0 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


precompiled_libs: include openjpeg for msvc for proper linking with oiio.

--- src/cmake/precompiled_libs.cmake
+++ src/cmake/precompiled_libs.cmake
@@ -47,6 +47,9 @@
 # Dependencies for OpenImageIO.
 set(PNG_LIBRARIES "${_lib_DIR}/png/lib/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}")
 set(JPEG_LIBRARIES "${_lib_DIR}/jpeg/lib/libjpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
+if (MSVC)
+	set(JPEG_LIBRARIES ${JPEG_LIBRARIES};${_lib_DIR}/openjpeg/lib/openjpeg.lib)
+endif()
 # TODO(sergey): Move naming to a consistent state.
 set(TIFF_LIBRARY "${_lib_DIR}/tiff/lib/libtiff${CMAKE_STATIC_LIBRARY_SUFFIX}")


hook config file for rosinstallish customization

--- toplevel.cmake
+++ toplevel.cmake
@@ -4,6 +4,8 @@
 cmake_minimum_required(VERSION 2.8)
 cmake_policy(SET CMP0003 NEW)
 cmake_policy(SET CMP0011 NEW)
+
+include(${CMAKE_SOURCE_DIR}/workspace-config.cmake OPTIONAL)

 set(CATKIN YES)
 list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/cmake)


Updated test_driver.cmake to new gtest source repo

--- test/test_driver.cmake
+++ test/test_driver.cmake
@@ -40,11 +40,9 @@
 # Download and install GoogleTest
 ExternalProject_Add(
     gtest
-	GIT_REPOSITORY https://github.com/google/googletest
-    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest
-    # Disable install and update step
+    GIT_REPOSITORY https://github.com/google/googletest
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
     UPDATE_COMMAND ""
-    INSTALL_COMMAND ""
 )

 # Create a libgtest target to be used as a dependency by test programs
@@ -54,15 +52,16 @@
 add_dependencies(libgtest_main gtest)

 # Set gtest properties
-ExternalProject_Get_Property(gtest source_dir binary_dir)
+ExternalProject_Get_Property(gtest source_dir install_dir)
+file(MAKE_DIRECTORY "${install_dir}/include")
 set_target_properties(libgtest PROPERTIES
-    "IMPORTED_LOCATION" "${binary_dir}/libgtest.a"
+    "IMPORTED_LOCATION" "${install_dir}/lib/libgtest.a"
     "IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
-    #"INTERFACE_INCLUDE_DIRECTORIES" "${source_dir}/include"
+    "INTERFACE_INCLUDE_DIRECTORIES" "${install_dir}/include"
 )
 set_target_properties(libgtest_main PROPERTIES
-    "IMPORTED_LOCATION" "${binary_dir}/libgtest_main.a"
+    "IMPORTED_LOCATION" "${install_dir}/lib/libgtest_main.a"
     "IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
-    #"INTERFACE_INCLUDE_DIRECTORIES" "${source_dir}/include"
+    "INTERFACE_INCLUDE_DIRECTORIES" "${install_dir}/include"
 )
-include_directories("${source_dir}/include")
+#include_directories("${source_dir}/include")


targets/host/cmake: Use logging_main in CMake for tests

Migrates the host target to use the pw_unit_test.logging_main
just like GN for unit tests.

Change-Id: Ief41020a0eb41cdcc4a8e8a32ce3dde37dddcff9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117351
Commit-Queue: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Reviewed-by: Armando Montanez <97ef6fdb231c129ac8827d9f0c4106bfbf57f74f@google.com>

--- targets/host/pw_add_host_executable.cmake
+++ targets/host/pw_add_host_executable.cmake
@@ -35,7 +35,7 @@
   add_executable(${NAME} EXCLUDE_FROM_ALL)
   pw_target_link_targets(${NAME}
     PRIVATE
-      pw_unit_test.simple_printing_main
+      pw_unit_test.logging_main
       ${TEST_DEP}
   )
 endfunction(pw_add_host_executable)


Added MIPS targets to the TNUN_ABIs list.

--- toolchains/android.toolchain.cmake
+++ toolchains/android.toolchain.cmake
@@ -130,6 +130,8 @@
   arm-linux-androideabi
   x86_64
   x86
+  mips64el-linux-android
+  mipsel-linux-android
 )


FIX: Resolve issues with build on OS X where resources and libs would not get put into the debug app bundles with the _d suffix (but would overwite the release versions), and /all/ versions of the libs could be copied into release versions of the app bundles (without the _d suffix).  Resolves: http://www.cegui.org.uk/mantis/view.php?id=513

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -261,7 +261,7 @@
     endif()

     if (${_INSTALL_HEADERS} AND UNIX AND NOT APPLE AND NOT WIN32)
-        string (REPLACE "cegui/src" "" _REL_HEADER_DIR ${_REL_SRC_DIR})
+        string (REPLACE "cegui/src/" "" _REL_HEADER_DIR ${_REL_SRC_DIR})
         install(FILES ${${_HEADER_FILES_VAR}} DESTINATION "${CEGUI_INCLUDE_INSTALL_DIR}/${CMAKE_PROJECT_NAME}/${_REL_HEADER_DIR}")
     endif()
 endmacro()
@@ -297,29 +297,41 @@
         set (_ACTIONMSG "copies of")
     endif()

-    file (REMOVE_RECURSE
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources
-    )
-    file (MAKE_DIRECTORY
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources
-    )
+    # depending on the generator used, we need to examine different things to discover the build type
+    if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
+        set(_CEGUI_BUILD_CONFIG ${CMAKE_BUILD_TYPE})
+    else()
+        set(_CEGUI_BUILD_CONFIG "$(CONFIGURATION)")
+    endif()
+
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; rm -rf \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks\"
+        COMMENT "Removing old Frameworks in ${_TARGET_NAME}.app")
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; rm -rf \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources\"
+        COMMENT "Removing old Resources in ${_TARGET_NAME}.app")
+
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; mkdir -p \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks\"
+        COMMENT "Creating Frameworks directory ${_TARGET_NAME}.app")
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; mkdir -p \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources\"
+        COMMENT "Creating Resources directory ${_TARGET_NAME}.app")

     if (NOT ${_STATIC})
         if (NOT CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES)
             add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-                COMMAND ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/dynamic/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks/
+                COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; ce_libglob=\"*${CEGUI_BUILD_SUFFIX}.dylib\"\; else ce_ext=\"\"\; shopt -s extglob\; ce_libglob=\"!\(*${CEGUI_BUILD_SUFFIX}\).dylib\"\; fi\; ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/dynamic/$$ce_libglob \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks/\"
                 COMMENT "Creating ${_ACTIONMSG} dependency libraries in ${_TARGET_NAME}.app")
         endif()

         add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-            COMMAND ${_ACTIONCMD} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks/
+            COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; ce_libglob=\"*${CEGUI_BUILD_SUFFIX}.dylib\"\; else ce_ext=\"\"\; shopt -s extglob\; ce_libglob=\"!\(*${CEGUI_BUILD_SUFFIX}\).dylib\"\; fi\; ${_ACTIONCMD} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$$ce_libglob \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks/\"
             COMMENT "Creating ${_ACTIONMSG} built cegui libraries in ${_TARGET_NAME}.app")
     endif()

     add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-        COMMAND ${_ACTIONCMD} ${CMAKE_SOURCE_DIR}/datafiles ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources/
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; ${_ACTIONCMD} ${CMAKE_SOURCE_DIR}/datafiles \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources/\"
         COMMENT "Creating ${_ACTIONMSG} sample datafiles ${_TARGET_NAME}.app")
 endmacro()


removed logging of clangformat files

removed logging of clangformat files

--- cmake/ClangFormat.cmake
+++ cmake/ClangFormat.cmake
@@ -38,7 +38,6 @@
   endif()

   if(NOT ("${CLANGFORMAT_EXECUTABLE}" STREQUAL "NotFound"))
-    message(INFO ": ClangFormat ${clangformat_files}")
     add_custom_target(clangformat
         COMMAND
         ${CLANGFORMAT_EXECUTABLE}


Cmake Python magic requires more magic

Cmake Python magic requires more magic

--- cmake/PythonMagic.cmake
+++ cmake/PythonMagic.cmake
@@ -7,7 +7,7 @@
 find_package(PythonLibs 2) # using PYTHON_INCLUDE_PATH instead of PYTHON_INCLUDE_DIR
 if( NOT PYTHON_EXECUTABLE )
   # look specifically for 2.7
-  find_program(PYTHON_EXECUTABLE NAMES python2.7 python27 python PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath])
+  find_program(PYTHON_EXECUTABLE NAMES python2.7 python27 python python.exe PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath])
 endif()

 if( PYTHON_EXECUTABLE )
@@ -21,12 +21,12 @@
     COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)"
     OUTPUT_VARIABLE _python_distpackage OUTPUT_STRIP_TRAILING_WHITESPACE
     RESULT_VARIABLE _python_failed1)
-  execute_process(
-    COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; from os.path import relpath; print relpath(get_python_lib(1,prefix='${CMAKE_INSTALL_PREFIX}'),'${CMAKE_INSTALL_PREFIX}')"
-    OUTPUT_VARIABLE OPENRAVE_PYTHON_INSTALL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
-    RESULT_VARIABLE _python_failed2)
+#  execute_process(
+#    COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; from os.path import relpath; print relpath(get_python_lib(1,prefix='${CMAKE_INSTALL_PREFIX}'),'${CMAKE_INSTALL_PREFIX}')"
+#    OUTPUT_VARIABLE OPENRAVE_PYTHON_INSTALL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
+#    RESULT_VARIABLE _python_failed2)

-  if( ${_python_failed0} EQUAL 0 AND ${_python_failed1} EQUAL 0 AND ${_python_failed2} EQUAL 0 )
+  if( ${_python_failed0} EQUAL 0 AND ${_python_failed1} EQUAL 0 ) #AND ${_python_failed2} EQUAL 0 )
     if( NOT IS_DIRECTORY "${_python_distpackage}/numpy/core/include" )
       if( NOT IS_DIRECTORY "${_python_sitepackage}/numpy/core/include" )
 	FIND_PACKAGE(Numpy REQUIRED)


Rename temporary file to avoid conflict.

--- cmake/Windeployqt.cmake
+++ cmake/Windeployqt.cmake
@@ -51,7 +51,7 @@

     # install(CODE ...) doesn't support generator expressions, but
     # file(GENERATE ...) does - store the path in a file
-    file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}"
+    file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}_path"
         CONTENT "$<TARGET_FILE:${target}>"
     )

@@ -59,7 +59,7 @@
     # runtime files to the appropriate directory for installation
     install(CODE
         "
-        file(READ \"${CMAKE_CURRENT_BINARY_DIR}/${target}\" _file)
+        file(READ \"${CMAKE_CURRENT_BINARY_DIR}/${target}_path\" _file)
         execute_process(
             COMMAND \"${CMAKE_COMMAND}\" -E
                 env PATH=\"${_qt_bin_dir}\" \"${WINDEPLOYQT_EXECUTABLE}\"


[cmake] windows: adds NOMINMAX as preproc def

--- cmake/XzeroCommon.cmake
+++ cmake/XzeroCommon.cmake
@@ -3,6 +3,7 @@
 # Ubuntu LTS release is supporting
 if(MSVC)
 # TODO ... fill in whatever is required for compiling under Visual Studio
+  add_definitions(-DNOMINMAX)
 else()

 if(APPLE)
@@ -10,9 +11,6 @@
 else()
   set(CMAKE_CXX_FLAGS "-std=c++1z")
 endif()
-
-# be more sensible on compiler warnings
-add_definitions(-Wall -Wno-variadic-macros)

 # we need the following definitions in order to get some special
 # OS-level features like posix_fadvise() or readahead().


checkinstall tweak.  Adding description-pak.

--- cmake/ectoInstall.cmake
+++ cmake/ectoInstall.cmake
@@ -46,16 +46,16 @@
   COMPONENT main
   )

-#checkinstall --exclude=/home -y --nodoc --pkgname ecto-amoeba <<EOF
-#Ecto, a hybrid c++/python framework for dataflow pipeline development.
-#EOF
-
+#used for checkinstall package description.
+file(WRITE ${CMAKE_BINARY_DIR}/description-pak
+    "Ecto, a hybrid c++/python framework for dataflow pipeline development.\n"
+)

 add_custom_target(checkinstall
   COMMENT "Install using checkinstall." VERBATIM
   )

 add_custom_command(TARGET checkinstall
-  COMMAND sh -c "sudo checkinstall --exclude=/home -y --nodoc --pkgname ecto-${ECTO_CODE_NAME} <<EOF Ecto, a hybrid c++/python framework for dataflow pipeline development. EOF"
+  COMMAND sh -c "sudo checkinstall --exclude=/home -y --nodoc --pkgname ecto-${ECTO_CODE_NAME}"
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
   )


updates to .gitlab-ci.yml

updates to .gitlab-ci.yml

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -63,7 +63,7 @@
 SET(ISPC_VERSION ${CMAKE_MATCH_1})

 IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
-  MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")
+  MESSAGE(FATAL_ERROR "ISPC ${ISPC_VERSION} is too old. You need at least ISPC ${ISPC_VERSION_REQUIRED}.")
 ENDIF()

 GET_FILENAME_COMPONENT(ISPC_DIR ${EMBREE_ISPC_EXECUTABLE} PATH)


Add glbinding-aux in lib needed by radium with FindRadium

--- cmake/FindRadium.cmake
+++ cmake/FindRadium.cmake
@@ -90,6 +90,14 @@
       )
   endif (NOT GLBINDING_LIBRARIES)

+  if (NOT GLBINDINGAUX_LIBRARIES)
+      find_library(GLBINDINGAUX_LIBRARIES
+              NAMES glbinding-aux glbinding-auxd
+              PATHS "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib"
+              )
+      list(APPEND GLBINDING_LIBRARIES ${GLBINDINGAUX_LIBRARIES})
+  endif (NOT GLBINDINGAUX_LIBRARIES)
+
   if(NOT GLBINDING_INCLUDE_DIR)
     set(GLBINDING_INCLUDE_DIR "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/include" )
   endif(NOT GLBINDING_INCLUDE_DIR)


Update HunterGate

Update HunterGate

--- cmake/HunterGate.cmake
+++ cmake/HunterGate.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2013-2015, Ruslan Baratov
+# Copyright (c) 2013-2017, Ruslan Baratov
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -42,10 +42,16 @@
 #     * https://github.com/hunter-packages/gate/
 #     * https://github.com/ruslo/hunter

-cmake_minimum_required(VERSION 3.0) # Minimum for Hunter
+option(HUNTER_ENABLED "Enable Hunter package manager support" ON)
+if(HUNTER_ENABLED)
+  if(CMAKE_VERSION VERSION_LESS "3.0")
+    message(FATAL_ERROR "At least CMake version 3.0 required for hunter dependency management."
+      " Update CMake or set HUNTER_ENABLED to OFF.")
+  endif()
+endif()
+
 include(CMakeParseArguments) # cmake_parse_arguments

-option(HUNTER_ENABLED "Enable Hunter package manager support" ON)
 option(HUNTER_STATUS_PRINT "Print working status" ON)
 option(HUNTER_STATUS_DEBUG "Print a lot info" OFF)

@@ -88,7 +94,8 @@

 function(hunter_gate_fatal_error)
   cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}")
-  if(NOT hunter_WIKI)
+  string(COMPARE EQUAL "${hunter_WIKI}" "" have_no_wiki)
+  if(have_no_wiki)
     hunter_gate_internal_error("Expected wiki")
   endif()
   message("")
@@ -137,7 +144,8 @@
 # Set HUNTER_GATE_ROOT cmake variable to suitable value.
 function(hunter_gate_detect_root)
   # Check CMake variable
-  if(HUNTER_ROOT)
+  string(COMPARE NOTEQUAL "${HUNTER_ROOT}" "" not_empty)
+  if(not_empty)
     set(HUNTER_GATE_ROOT "${HUNTER_ROOT}" PARENT_SCOPE)
     hunter_gate_status_debug("HUNTER_ROOT detected by cmake variable")
     return()
@@ -201,10 +209,20 @@
 endmacro()

 function(hunter_gate_download dir)
-  if(NOT HUNTER_RUN_INSTALL)
+  string(
+      COMPARE
+      NOTEQUAL
+      "$ENV{HUNTER_DISABLE_AUTOINSTALL}"
+      ""
+      disable_autoinstall
+  )
+  if(disable_autoinstall AND NOT HUNTER_RUN_INSTALL)
     hunter_gate_fatal_error(
-        "Hunter not found in '${HUNTER_GATE_ROOT}'"
+        "Hunter not found in '${dir}'"
         "Set HUNTER_RUN_INSTALL=ON to auto-install it from '${HUNTER_GATE_URL}'"
+        "Settings:"
+        "  HUNTER_ROOT: ${HUNTER_GATE_ROOT}"
+        "  HUNTER_SHA1: ${HUNTER_GATE_SHA1}"
         WIKI "error.run.install"
     )
   endif()
@@ -275,8 +293,34 @@
   endif()

   hunter_gate_status_debug("Run generate")
+
+  # Need to add toolchain file too.
+  # Otherwise on Visual Studio + MDD this will fail with error:
+  # "Could not find an appropriate version of the Windows 10 SDK installed on this machine"
+  if(EXISTS "${CMAKE_TOOLCHAIN_FILE}")
+    get_filename_component(absolute_CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE)
+    set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${absolute_CMAKE_TOOLCHAIN_FILE}")
+  else()
+    # 'toolchain_arg' can't be empty
+    set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=")
+  endif()
+
+  string(COMPARE EQUAL "${CMAKE_MAKE_PROGRAM}" "" no_make)
+  if(no_make)
+    set(make_arg "")
+  else()
+    # Test case: remove Ninja from PATH but set it via CMAKE_MAKE_PROGRAM
+    set(make_arg "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}")
+  endif()
+
   execute_process(
-      COMMAND "${CMAKE_COMMAND}" "-H${dir}" "-B${build_dir}"
+      COMMAND
+      "${CMAKE_COMMAND}"
+      "-H${dir}"
+      "-B${build_dir}"
+      "-G${CMAKE_GENERATOR}"
+      "${toolchain_arg}"
+      ${make_arg}
       WORKING_DIRECTORY "${dir}"
       RESULT_VARIABLE download_result
       ${logging_params}
@@ -328,6 +372,17 @@
     # Empty function to avoid error "unknown function"
     function(hunter_add_package)
     endfunction()
+
+    set(
+        _hunter_gate_disabled_mode_dir
+        "${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/disabled-mode"
+    )
+    if(EXISTS "${_hunter_gate_disabled_mode_dir}")
+      hunter_gate_status_debug(
+          "Adding \"disabled-mode\" modules: ${_hunter_gate_disabled_mode_dir}"
+      )
+      list(APPEND CMAKE_PREFIX_PATH "${_hunter_gate_disabled_mode_dir}")
+    endif()
   elseif(_hunter_gate_done)
     hunter_gate_status_debug("Secondary HunterGate (use old settings)")
     hunter_gate_self(
@@ -340,9 +395,11 @@
   else()
     set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_LIST_DIR}")

-    if(PROJECT_NAME)
+    string(COMPARE NOTEQUAL "${PROJECT_NAME}" "" _have_project_name)
+    if(_have_project_name)
       hunter_gate_fatal_error(
-          "Please set HunterGate *before* 'project' command"
+          "Please set HunterGate *before* 'project' command. "
+          "Detected project: ${PROJECT_NAME}"
           WIKI "error.huntergate.before.project"
       )
     endif()
@@ -350,35 +407,48 @@
     cmake_parse_arguments(
         HUNTER_GATE "LOCAL" "URL;SHA1;GLOBAL;FILEPATH" "" ${ARGV}
     )
-    if(NOT HUNTER_GATE_SHA1)
-      hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory")
-    endif()
-    if(NOT HUNTER_GATE_URL)
-      hunter_gate_user_error("URL suboption of HunterGate is mandatory")
-    endif()
-    if(HUNTER_GATE_UNPARSED_ARGUMENTS)
+
+    string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" _empty_sha1)
+    string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" _empty_url)
+    string(
+        COMPARE
+        NOTEQUAL
+        "${HUNTER_GATE_UNPARSED_ARGUMENTS}"
+        ""
+        _have_unparsed
+    )
+    string(COMPARE NOTEQUAL "${HUNTER_GATE_GLOBAL}" "" _have_global)
+    string(COMPARE NOTEQUAL "${HUNTER_GATE_FILEPATH}" "" _have_filepath)
+
+    if(_have_unparsed)
       hunter_gate_user_error(
           "HunterGate unparsed arguments: ${HUNTER_GATE_UNPARSED_ARGUMENTS}"
       )
     endif()
-    if(HUNTER_GATE_GLOBAL)
+    if(_empty_sha1)
+      hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory")
+    endif()
+    if(_empty_url)
+      hunter_gate_user_error("URL suboption of HunterGate is mandatory")
+    endif()
+    if(_have_global)
       if(HUNTER_GATE_LOCAL)
         hunter_gate_user_error("Unexpected LOCAL (already has GLOBAL)")
       endif()
-      if(HUNTER_GATE_FILEPATH)
+      if(_have_filepath)
         hunter_gate_user_error("Unexpected FILEPATH (already has GLOBAL)")
       endif()
     endif()
     if(HUNTER_GATE_LOCAL)
-      if(HUNTER_GATE_GLOBAL)
+      if(_have_global)
         hunter_gate_user_error("Unexpected GLOBAL (already has LOCAL)")
       endif()
-      if(HUNTER_GATE_FILEPATH)
+      if(_have_filepath)
         hunter_gate_user_error("Unexpected FILEPATH (already has LOCAL)")
       endif()
     endif()
-    if(HUNTER_GATE_FILEPATH)
-      if(HUNTER_GATE_GLOBAL)
+    if(_have_filepath)
+      if(_have_global)
         hunter_gate_user_error("Unexpected GLOBAL (already has FILEPATH)")
       endif()
       if(HUNTER_GATE_LOCAL)
@@ -393,12 +463,16 @@
         HUNTER_GATE_ROOT "${HUNTER_GATE_ROOT}" ABSOLUTE
     )
     hunter_gate_status_debug("HUNTER_ROOT: ${HUNTER_GATE_ROOT}")
-    string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces)
-    if(NOT _contain_spaces EQUAL -1)
-      hunter_gate_fatal_error(
-          "HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces"
-          WIKI "error.spaces.in.hunter.root"
-      )
+    if(NOT HUNTER_ALLOW_SPACES_IN_PATH)
+      string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces)
+      if(NOT _contain_spaces EQUAL -1)
+        hunter_gate_fatal_error(
+            "HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces."
+            "Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error"
+            "(Use at your own risk!)"
+            WIKI "error.spaces.in.hunter.root"
+        )
+      endif()
     endif()

     string(
@@ -417,17 +491,17 @@
         "${HUNTER_GATE_ROOT}"
         "${HUNTER_GATE_VERSION}"
         "${HUNTER_GATE_SHA1}"
-        hunter_self_
-    )
-
-    set(_master_location "${hunter_self_}/cmake/Hunter")
+        _hunter_self
+    )
+
+    set(_master_location "${_hunter_self}/cmake/Hunter")
     if(EXISTS "${HUNTER_GATE_ROOT}/cmake/Hunter")
       # Hunter downloaded manually (e.g. by 'git clone')
       set(_unused "xxxxxxxxxx")
       set(HUNTER_GATE_SHA1 "${_unused}")
       set(HUNTER_GATE_VERSION "${_unused}")
     else()
-      get_filename_component(_archive_id_location "${hunter_self_}/.." ABSOLUTE)
+      get_filename_component(_archive_id_location "${_hunter_self}/.." ABSOLUTE)
       set(_done_location "${_archive_id_location}/DONE")
       set(_sha1_location "${_archive_id_location}/SHA1")


cmake: Added assert that will show usage

There is a catch-22 in that you need to run CMake to get a build
system that can show you usage, but you need to know the usage to be
able to get a build system.

This assert could be used to improve the usability somewhat. When
invalid usage is detected it can be used to print the usage.

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

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -811,3 +811,21 @@
     message(FATAL_ERROR "No such file or directory: ${var}: '${${var}}'")
   endif()
 endmacro()
+
+# Usage:
+#   assert_with_usage(BOARD_DIR "No board named '${BOARD}' found")
+#
+# will print an error message, show usage, and then end executioon
+# with a FATAL_ERROR if the test fails.
+macro(assert_with_usage test comment)
+  if(NOT ${test})
+    message(${comment})
+    message("see usage:")
+    execute_process(
+      COMMAND
+      ${CMAKE_COMMAND} -P $ENV{ZEPHYR_BASE}/cmake/usage/usage.cmake
+      )
+    message(FATAL_ERROR "Invalid usage")
+  endif()
+endmacro()
+


Do rpath handling for qt devices.

Do rpath handling for qt devices.

svn path=/trunk/; revision=9738

--- cmake/modules/qt.cmake
+++ cmake/modules/qt.cmake
@@ -33,16 +33,17 @@
 # 			    device.
 # qt_LINK_FLAGS	  	  - list of full path names of libraries and
 # 			    linker flags for dynamic wxwidgets device driver.
+# qt_RPATH	       	  - RPATH directory list for qt device driver.
 # DRIVERS_LINK_FLAGS  	  - list of device LINK_FLAGS for case
 # 			    when ENABLE_DYNDRIVERS OFF.

 find_package(Qt4)
 if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt)
   if(QT4_FOUND)
-		if(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2)
-			set(QT_USE_QTSVG 1)
-		endif(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2)
-		include(${QT_USE_FILE})
+    if(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2)
+      set(QT_USE_QTSVG 1)
+    endif(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2)
+    include(${QT_USE_FILE})
     set(qt_COMPILE_FLAGS)
     foreach(DIR ${QT_INCLUDES})
       set(qt_COMPILE_FLAGS "${qt_COMPILE_FLAGS} -I${DIR}")
@@ -50,6 +51,8 @@

     set(qt_LINK_FLAGS ${QT_LIBRARIES})
     #message("qt_LINK_FLAGS = ${qt_LINK_FLAGS}")
+    set(qt_RPATH ${QT_LIBRARY_DIR})
+    #message("qt_LIBRARY_DIR = ${qt_LIBRARY_DIR}")
     set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${qt_LINK_FLAGS})
   else(QT4_FOUND)
     set(PLD_bmpqt OFF CACHE BOOL "Enable Qt Windows bmp device" FORCE)


add a mroe flexible way to specify the gtest sources

--- cmake/test/gtest.cmake
+++ cmake/test/gtest.cmake
@@ -61,9 +61,13 @@

 find_package(GTest QUIET)
 if(NOT GTEST_FOUND)
-  if(EXISTS "/usr/src/gtest")
+  find_file(_CATKIN_GTEST_SRC "gtest.cc" PATHS "/usr/src/gtest/src" "${CMAKE_SOURCE_DIR}/gtest/src" NO_DEFAULT_PATH NO_CMAKE_PATH)
+
+  if(_CATKIN_GTEST_SRC)
+    GET_FILENAME_COMPONENT(_CATKIN_GTEST_DIR ${_CATKIN_GTEST_SRC} PATH)
+    set(_CATKIN_GTEST_DIR "${_CATKIN_GTEST_DIR}/../" CACHE INTERNAL "")
     # add source dir directly (this only works on Ubuntu for now)
-    add_subdirectory("/usr/src/gtest" ${CMAKE_BINARY_DIR}/gtest)
+    add_subdirectory(${_CATKIN_GTEST_DIR} "../gtest")
     # set the same variables as find_package()
     set(GTEST_FOUND TRUE CACHE INTERNAL "")
     find_path(GTEST_INCLUDE_DIRS gtest/gtest.h)
@@ -72,13 +76,11 @@
     set(GTEST_MAIN_LIBRARIES "gtest_main" CACHE INTERNAL "")
     set(GTEST_BOTH_LIBRARIES "${GTEST_LIBRARIES};${GTEST_MAIN_LIBRARIES}" CACHE INTERNAL "")
     set(GTEST_LIBRARY_DIRS ${CMAKE_BINARY_DIR}/gtest CACHE INTERNAL "")
-    if(GTEST_FOUND)
-      message(STATUS "Found gtest sources under '/usr/src/gtest': gtests will be built")
-    endif()
+    message(STATUS "Found gtest sources under '/usr/src/gtest': gtests will be built")
     set(_CATKIN_GTEST_SRC_FOUND TRUE CACHE INTERNAL "")
   endif()
   if(NOT GTEST_FOUND)
-    message(WARNING "gtest not found, C++ tests can not be built")
+    message(WARNING "gtest not found, C++ tests can not be built. You can run \"svn checkout http://googletest.googlecode.com/svn/tags/release-1.6.0 gtest\" in the root of your workspace")
   endif()
 else()
   message(STATUS "Found gtest: gtests will be built")


package.json.cmake: fix broken main property

This is a partial revert of previous commit

Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- src/javascript/package.json.cmake
+++ src/javascript/package.json.cmake
@@ -3,7 +3,7 @@
   "description": "IO library that helps you use I2c, SPI, gpio, uart, pwm, analog inputs (aio) and more on a number of platforms such as the Intel galileo, the Intel edison and others",
   "keywords":["gpio", "edison","galileo","io", "mraajs", "spi", "i2c", "minnow", "intel"],
   "homepage": "http://github.com/intel-iot-devkit/mraa",
-  "main" : "build/Release/mraa.node",
+  "main" : "./mraa.node",
   "engines": {
     "node": ">= 1.0.x"
   },


TYPO: installable_item_in_bin -> installable_item_in_lib

--- SuperBuild/Packaging/PackageHelper.cmake
+++ SuperBuild/Packaging/PackageHelper.cmake
@@ -96,7 +96,7 @@

   #install lib files into lib as install(FILES ..
   foreach(installable_item_in_lib ${lib_install_list})
-    install(FILES "${installable_item_in_bin}" DESTINATION ${PKG_STAGE_DIR}/lib)
+    install(FILES "${installable_item_in_lib}" DESTINATION ${PKG_STAGE_DIR}/lib)
   endforeach()

   ############# install package configure script ################


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/KWSys/vtksys/kwsysDateStamp.cmake
+++ Utilities/KWSys/vtksys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   09)
+SET(KWSYS_DATE_STAMP_DAY   10)


Updated comments.

Updated comments.

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

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -257,8 +257,7 @@
 macro (configure_dbus_glib)
     sagase_configure_package (DBUS_GLIB
         NAMES dbus-glib dbus
-        COMPONENTS dbus-glib # dbus-glib added to help sagese to find include folder with dbus-glib.h file
-        # TODO: Add real components
+        COMPONENTS dbus-glib
         PREFIXES ${ENV_NAALI_DEP_PATH}/dbus-glib)
     sagase_configure_report (DBUS_GLIB)
 endmacro (configure_dbus_glib)


small cleanup in cmake

small cleanup in cmake

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

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -13,18 +13,16 @@
     endif ()

     if (APPLE)
-        sagase_configure_package (BOOST
-    	    NAMES Boost boost
-            COMPONENTS boost_date_time boost_filesystem boost_system boost_thread boost_program_options boost_unit_test_framework
-
-            PREFIXES ${ENV_NAALI_DEP_PATH})
+            set (BOOST_COMPONENTS boost_date_time boost_filesystem boost_system boost_thread boost_program_options boost_unit_test_framework)
     else ()
-        sagase_configure_package (BOOST
-    	    NAMES Boost boost
-            COMPONENTS date_time filesystem system thread program_options unit_test_framework
-            PREFIXES ${ENV_NAALI_DEP_PATH})
+            set (BOOST_COMPONENTS date_time filesystem system thread program_options unit_test_framework)
     endif ()

+    sagase_configure_package (BOOST
+        NAMES Boost boost
+        COMPONENTS ${BOOST_COMPONENTS}
+        PREFIXES ${ENV_NAALI_DEP_PATH})
+
     if (APPLE)
         set (BOOST_LIBRARY_DIRS ${ENV_NAALI_DEP_PATH}/lib)
         set (BOOST_INCLUDE_DIRS ${ENV_NAALI_DEP_PATH}/include)


simple build fix for linux systems with glib1 installed -- thanks to kazzy

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

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -261,7 +261,7 @@

 macro (configure_glib)
     sagase_configure_package (GLIB
-        NAMES glib Glib
+        NAMES glib-2.0 glib Glib
         COMPONENTS glib-2.0 gobject-2.0 glib # glib added to help sagese to find include folder with glib.h file
         PREFIXES ${ENV_NAALI_DEP_PATH})
     sagase_configure_report (GLIB)


build fix for linking vorbis on linux

build fix for linking vorbis on linux

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

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -340,7 +340,7 @@

 macro (configure_vorbis)
     sagase_configure_package(VORBIS
-        NAMES vorbis libvorbis
+        NAMES vorbisfile vorbis libvorbis
         COMPONENTS vorbis libvorbis libvorbisfile
         PREFIXES ${ENV_NAALI_DEP_PATH}/libvorbis)


Allow parent project to specify sdkconfig

--- lib/smooth/idf_utils.cmake
+++ lib/smooth/idf_utils.cmake
@@ -40,9 +40,16 @@

         idf_build_component(smooth_idf_component)

+        # When a project specifies a specific sdkconfig, use it
+        if("${project_specific_sdkconfig}" EQUAL "")
+            set(smooth_sdkconfig ${CMAKE_CURRENT_LIST_DIR}/sdkconfig)
+        else()
+            set(smooth_sdkconfig ${project_specific_sdkconfig})
+        endif()
+
         idf_build_process(esp32
                 COMPONENTS ${smooth_req_comps} smooth_idf_component
-                SDKCONFIG ${CMAKE_CURRENT_LIST_DIR}/sdkconfig
+                SDKCONFIG ${smooth_sdkconfig}
                 BUILD_DIR ${CMAKE_BINARY_DIR})

         smooth_link_to_idf(${target})


Update our CPackRPM.cmake to not omit symlinks from RPMs. #2412

We're using a modified version of CPackRPM.cmake taken from cmake 2.8.0.
That version omits all symlinks from the RPMs it creates. Cmake 2.8.3
fixes this. Now, our modified CPackRPM.cmake is based on cmake 2.8.3.

--- build/cmake/modules/CPackRPM.cmake
+++ build/cmake/modules/CPackRPM.cmake
@@ -1,36 +1,19 @@
- ###############################################################
- #
- # Copyright 2011 Red Hat, Inc.
- #
- # Licensed under the Apache License, Version 2.0 (the "License"); you
- # may not use this file except in compliance with the License.  You may
- # obtain a copy of the License at
- #
- #    http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- #
- ###############################################################
-
-# Based on CMake 2.8.0
+# Based on CMake 2.8.3, modified for use building Condor
+#
 # - The builtin (binary) CPack RPM generator (Unix only)
 # CPackRPM may be used to create RPM package using CPack.
 # CPackRPM is a CPack generator thus it uses the CPACK_XXX variables
 # used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
 #
 # However CPackRPM has specific features which are controlled by
-# the specifics CPACK_RPM_XXX variables.You'll find a detailed usage on
-# the wiki:
+# the specifics CPACK_RPM_XXX variables. You'll find a detailed usage on
+# the wiki:
 #  http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
 # However as a handy reminder here comes the list of specific variables:
 #
-#  CPACK_RPM_PACKAGE_SUMMARY
-#     Mandatory : YES
-#     Default   : CPACK_PACKAGE_DESCRIPTION
+#  CPACK_RPM_PACKAGE_SUMMARY
+#     Mandatory : YES
+#     Default   : CPACK_PACKAGE_DESCRIPTION_SUMMARY
 #     The RPM package summary
 #  CPACK_RPM_PACKAGE_NAME
 #     Mandatory : YES
@@ -43,14 +26,14 @@
 #  CPACK_RPM_PACKAGE_ARCHITECTURE
 #     Mandatory : NO
 #     Default   : -
-#     The RPM package architecture. This may be set to "noarch" if you
+#     The RPM package architecture. This may be set to "noarch" if you
 #     know you are building a noarch package.
 #  CPACK_RPM_PACKAGE_RELEASE
 #     Mandatory : YES
 #     Default   : 1
-#     The RPM package release. This is the numbering of the RPM package
-#     itself, i.e. the version of the packaging and not the version of the
-#     content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
+#     The RPM package release. This is the numbering of the RPM package
+#     itself, i.e. the version of the packaging and not the version of the
+#     content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
 #     value if the previous packaging was buggy and/or you want to put here
 #     a fancy Linux distro specific numbering.
 #  CPACK_RPM_PACKAGE_LICENSE
@@ -61,38 +44,115 @@
 #     Mandatory : YES
 #     Default   : "unknown"
 #     The RPM package group.
-#  CPACK_RPM_PACKAGE_VENDOR
-#     Mandatory : YES
-#     Default   : CPACK_PACKAGE_VENDOR if set or"unknown"
-#     The RPM package group.
+#  CPACK_RPM_PACKAGE_VENDOR
+#     Mandatory : YES
+#     Default   : CPACK_PACKAGE_VENDOR if set or "unknown"
+#     The RPM package vendor.
+#  CPACK_RPM_PACKAGE_URL
+#     Mandatory : NO
+#     Default   : -
+#     The projects URL.
 #  CPACK_RPM_PACKAGE_DESCRIPTION
 #     Mandatory : YES
 #     Default   : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available"
+#  CPACK_RPM_COMPRESSION_TYPE
+#     Mandatory : NO
+#     Default   : -
+#     May be used to override RPM compression type to be used
+#     to build the RPM. For example some Linux distribution now default
+#     to lzma or xz compression whereas older cannot use such RPM.
+#     Using this one can enforce compression type to be used.
+#     Possible value are: lzma, xz, bzip2 and gzip.
 #  CPACK_RPM_PACKAGE_REQUIRES
 #     Mandatory : NO
 #     Default   : -
-#     May be used to set RPM dependencies.
+#     May be used to set RPM dependencies (requires).
+#     Note that you must enclose the complete requires string between quotes,
+#     for example:
+#     set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
+#  CPACK_RPM_PACKAGE_SUGGESTS
+#     Mandatory : NO
+#     Default   : -
+#     May be used to set weak RPM dependencies (suggests).
+#     Note that you must enclose the complete requires string between quotes.
+#  CPACK_RPM_PACKAGE_PROVIDES
+#     Mandatory : NO
+#     Default   : -
+#     May be used to set RPM dependencies (provides).
+#  CPACK_RPM_PACKAGE_OBSOLETES
+#     Mandatory : NO
+#     Default   : -
+#     May be used to set RPM packages that are obsoleted by this one.
+#  CPACK_RPM_PACKAGE_RELOCATABLE
+#     Mandatory : NO
+#     Default   : CPACK_PACKAGE_RELOCATABLE
+#     If this variable is set to TRUE or ON CPackRPM will try
+#     to build a relocatable RPM package. A relocatable RPM may
+#     be installed using rpm --prefix or --relocate in order to
+#     install it at an alternate place see rpm(8).
+#     Note that currently this may fail if CPACK_SET_DESTDIR is set to ON.
+#     If CPACK_SET_DESTDIR is set then you will get a warning message
+#     but if there is file installed with absolute path you'll get
+#     unexpected behavior.
 #  CPACK_RPM_SPEC_INSTALL_POST
 #     Mandatory : NO
 #     Default   : -
-#     May be used to set an RPM post-install command inside the spec file.
-#     For example setting it to "/bin/true" may be used to prevent
+#     May be used to set an RPM post-install command inside the spec file.
+#     For example setting it to "/bin/true" may be used to prevent
 #     rpmbuild to strip binaries.
 #  CPACK_RPM_SPEC_MORE_DEFINE
 #     Mandatory : NO
 #     Default   : -
 #     May be used to add any %define lines to the generated spec file.
+#  CPACK_RPM_PACKAGE_DEBUG
+#     Mandatory : NO
+#     Default   : -
+#     May be set when invoking cpack in order to trace debug information
+#     during CPack RPM run. For example you may launch CPack like this
+#     cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
 #  CPACK_RPM_SPEC_IGNORE_FILES
 #     Mandatory : NO
 #     Default   : -
 #     Can be used to specify a list of files to ignore when CPackRPM is
 #     generating a file list to file %file section (@CPACK_RPM_INSTALL_FILES@)
-#  CPACK_RPM_PACKAGE_DEBUG
-#     Mandatory : NO
-#     Default   : -
-#     May be set when invoking cpack in order to trace debug informations
-#     during CPack RPM run. For example you may launch CPack like this
-#     cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
+#  CPACK_RPM_USER_BINARY_SPECFILE
+#     Mandatory : NO
+#     Default   : -
+#     May be set by the user in order to specify a USER binary spec file
+#     to be used by CPackRPM instead of generating the file.
+#     The specified file will be processed by CONFIGURE_FILE( @ONLY).
+#  CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
+#     Mandatory : NO
+#     Default   : -
+#     If set CPack will generate a template for USER specified binary
+#     spec file and stop with an error. For example launch CPack like this
+#     cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
+#     The user may then use this file in order to hand-craft is own
+#     binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE.
+#  CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
+#  CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
+#     Mandatory : NO
+#     Default   : -
+#     May be used to embbed a pre (un)installation script in the spec file.
+#     The refered script file(s) will be read and directly
+#     put after the %pre or %preun section
+#     One may verify which scriptlet has been included with
+#      rpm -qp --scripts  package.rpm
+#  CPACK_RPM_POST_INSTALL_SCRIPT_FILE
+#  CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
+#     Mandatory : NO
+#     Default   : -
+#     May be used to embbed a post (un)installation script in the spec file.
+#     The refered script file(s) will be read and directly
+#     put after the %post or %postun section
+#     One may verify which scriptlet has been included with
+#      rpm -qp --scripts  package.rpm
+#  CPACK_RPM_CHANGELOG_FILE
+#     Mandatory : NO
+#     Default   : -
+#     May be used to embbed a changelog in the spec file.
+#     The refered file will be read and directly  put after the %changelog
+#     section.

 #=============================================================================
 # Copyright 2007-2009 Kitware, Inc.
@@ -104,12 +164,12 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # See the License for more information.
 #=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)

 # Author: Eric Noulard with the help of Alexander Neundorf.

-MESSAGE("Using patched version of CPackRPM.cmake-2.8.0 located in build/cmake")
+MESSAGE("Using patched version of CPackRPM.cmake-2.8.3 located in build/cmake")
 # This patched version add support for CPACK_RPM_SPEC_IGNORE_FILES.
 # This allows us to specify config file manually in SPEC file.
 # In the future version of CPackRPM, we should be able to specify config file via
@@ -124,23 +184,23 @@
 ENDIF(NOT UNIX)

 # rpmbuild is the basic command for building RPM package
-# it may be a simple (symbolic) link to rpmb command.
+# it may be a simple (symbolic) link to rpm command.
 FIND_PROGRAM(RPMBUILD_EXECUTABLE rpmbuild)

-# Check version of the rpmbuild tool this would be easier to
+# Check version of the rpmbuild tool this would be easier to
 # track bugs with users and CPackRPM debug mode.
-# We may use RPM version in order to check for available version dependent features
+# We may use RPM version in order to check for available version dependent features
 IF(RPMBUILD_EXECUTABLE)
   execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --version
                   OUTPUT_VARIABLE _TMP_VERSION
                   ERROR_QUIET
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REGEX REPLACE "^.*\ " ""
+  string(REGEX REPLACE "^.*\ " ""
          RPMBUILD_EXECUTABLE_VERSION
-         ${_TMP_VERSION})
+         ${_TMP_VERSION})
   IF(CPACK_RPM_PACKAGE_DEBUG)
     MESSAGE("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
 ENDIF(RPMBUILD_EXECUTABLE)

 IF(NOT RPMBUILD_EXECUTABLE)
@@ -148,14 +208,14 @@
 ENDIF(NOT RPMBUILD_EXECUTABLE)

 # We may use RPM version in the future in order
-# to shut down warning about space in buildtree
+# to shut down warning about space in buildtree
 # some recent RPM version should support space in different places.
 # not checked [yet].
 IF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
   MESSAGE(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
 ENDIF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")

-# If rpmbuild is found
+# If rpmbuild is found
 # we try to discover alien since we may be on non RPM distro like Debian.
 # In this case we may try to to use more advanced features
 # like generating RPM directly from DEB using alien.
@@ -165,7 +225,7 @@
   MESSAGE(STATUS "alien found, we may be on a Debian based distro.")
 ENDIF(ALIEN_EXECUTABLE)

-#
+#
 # Use user-defined RPM specific variables value
 # or generate reasonable default value from
 # CPACK_xxx generic values.
@@ -180,10 +240,10 @@
   IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
     STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
   ELSE(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-    SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+    SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
   ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
 ENDIF(NOT CPACK_RPM_PACKAGE_SUMMARY)
-
+
 # CPACK_RPM_PACKAGE_NAME (mandatory)
 IF(NOT CPACK_RPM_PACKAGE_NAME)
   STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
@@ -196,6 +256,11 @@
   ENDIF(NOT CPACK_PACKAGE_VERSION)
   SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
 ENDIF(NOT CPACK_RPM_PACKAGE_VERSION)
+# Replace '-' in version with '_'
+# '-' character is  an Illegal RPM version character
+# it is illegal because it is used to separate
+# RPM "Version" from RPM "Release"
+STRING(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})

 # CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
 IF(CPACK_RPM_PACKAGE_ARCHITECTURE)
@@ -243,7 +308,7 @@

 # CPACK_RPM_PACKAGE_DESCRIPTION
 # The variable content may be either
-#   - explicitely given by tthe user or
+#   - explicitly given by the user or
 #   - filled with the content of CPACK_PACKAGE_DESCRIPTION_FILE
 #     if it is defined
 #   - set to a default value
@@ -256,15 +321,57 @@
         ENDIF (CPACK_PACKAGE_DESCRIPTION_FILE)
 ENDIF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)

-# CPACK_RPM_PACKAGE_REQUIRES
-# Placeholder used to specify binary RPM dependencies (if any)
-# see http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
-IF(CPACK_RPM_PACKAGE_REQUIRES)
-  IF(CPACK_RPM_PACKAGE_DEBUG)
-    MESSAGE("CPackRPM:Debug: User defined Requires:\n ${CPACK_RPM_PACKAGE_REQUIRES}")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-  SET(TMP_RPM_REQUIRES "Requires: ${CPACK_RPM_PACKAGE_REQUIRES}")
-ENDIF(CPACK_RPM_PACKAGE_REQUIRES)
+# CPACK_RPM_COMPRESSION_TYPE
+#
+IF (CPACK_RPM_COMPRESSION_TYPE)
+   IF(CPACK_RPM_PACKAGE_DEBUG)
+     MESSAGE("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
+   ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+   IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+     SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
+   ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+   IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+     SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
+   ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+   IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+     SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
+   ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+   IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
+     SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
+   ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
+ELSE(CPACK_RPM_COMPRESSION_TYPE)
+   SET(CPACK_RPM_COMPRESSION_TYPE_TMP "")
+ENDIF(CPACK_RPM_COMPRESSION_TYPE)
+
+if(CPACK_PACKAGE_RELOCATABLE)
+    set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
+endif(CPACK_PACKAGE_RELOCATABLE)
+if(CPACK_RPM_PACKAGE_RELOCATABLE)
+  if(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: Trying to build a relocatable package")
+  endif(CPACK_RPM_PACKAGE_DEBUG)
+  if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
+    message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.")
+  else(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
+    set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX})
+  endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
+endif(CPACK_RPM_PACKAGE_RELOCATABLE)
+
+# check if additional fields for RPM spec header are given
+FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX)
+  IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+    STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
+    MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
+    STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
+    STRING(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
+    STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
+    SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
+    IF(CPACK_RPM_PACKAGE_DEBUG)
+      MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}")
+    ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+    SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}")
+  ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+ENDFOREACH(_RPM_SPEC_HEADER)

 # CPACK_RPM_SPEC_INSTALL_POST
 # May be used to define a RPM post intallation script
@@ -277,6 +384,61 @@
   SET(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
 ENDIF(CPACK_RPM_SPEC_INSTALL_POST)

+# CPACK_RPM_POST_INSTALL_SCRIPT_FILE
+# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
+# May be used to embbed a post (un)installation script in the spec file.
+# The refered script file(s) will be read and directly
+# put after the %post or %postun section
+if(CPACK_RPM_POST_INSTALL_SCRIPT_FILE)
+  if(EXISTS ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
+    file(READ ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE} CPACK_RPM_SPEC_POSTINSTALL)
+  else(EXISTS ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
+    message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_SCRIPT_FILE}> does not exists - ignoring")
+  endif(EXISTS ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
+endif(CPACK_RPM_POST_INSTALL_SCRIPT_FILE)
+
+if(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE)
+  if(EXISTS ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
+    file(READ ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE} CPACK_RPM_SPEC_POSTUNINSTALL)
+  else(EXISTS ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
+    message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE}> does not exists - ignoring")
+  endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
+endif(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE)
+
+# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
+# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
+# May be used to embed a pre (un)installation script in the spec file.
+# The refered script file(s) will be read and directly
+# put after the %pre or %preun section
+if(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE)
+  if(EXISTS ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
+    file(READ ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE} CPACK_RPM_SPEC_PREINSTALL)
+  else(EXISTS ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
+    message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE}> does not exists - ignoring")
+  endif(EXISTS ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
+endif(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE)
+
+if(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE)
+  if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
+    file(READ ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE} CPACK_RPM_SPEC_PREUNINSTALL)
+  else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
+    message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE}> does not exists - ignoring")
+  endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
+endif(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE)
+
+# CPACK_RPM_CHANGELOG_FILE
+# May be used to embed a changelog in the spec file.
+# The refered file will be read and directly put after the %changelog section
+if(CPACK_RPM_CHANGELOG_FILE)
+  if(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+    file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG)
+  else(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+    message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring")
+  endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+else(CPACK_RPM_CHANGELOG_FILE)
+  set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n  Generated by CPack RPM (no Changelog file were provided)")
+endif(CPACK_RPM_CHANGELOG_FILE)
+
 # CPACK_RPM_SPEC_MORE_DEFINE
 # This is a generated spec rpm file spaceholder
 IF(CPACK_RPM_SPEC_MORE_DEFINE)
@@ -284,10 +446,6 @@
     MESSAGE("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
   ENDIF(CPACK_RPM_PACKAGE_DEBUG)
 ENDIF(CPACK_RPM_SPEC_MORE_DEFINE)
-
-# CPACK_RPM_USER_BINARY_SPECFILE
-# FIXME when this is set then CPack should us the
-# user provided file.

 # Now we may create the RPM build tree structure
 SET(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
@@ -309,102 +467,170 @@
 SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")

 # Use files tree to construct files command (spec file)
-EXECUTE_PROCESS(COMMAND find -type f
-               COMMAND sed {s/\\.//}
+# We should not forget to include symlinks (thus -o -type l)
+# We must remove the './' due to the local search and escape the
+# file name by enclosing it between double quotes (thus the sed)
+# Then we must authorize any man pages extension (adding * at the end)
+# because rpmbuild may automatically compress those files
+EXECUTE_PROCESS(COMMAND find -type f -o -type l
+               COMMAND sed {s:.*/man.*/.*:&*:}
+               COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
                WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
                OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)

 # Remove user-specified files
-FOREACH ( _REMOVE_FILE  ${CPACK_RPM_SPEC_IGNORE_FILES} )
-   STRING (REGEX REPLACE "${_REMOVE_FILE}\n" "" CPACK_RPM_INSTALL_FILES ${CPACK_RPM_INSTALL_FILES})
+FOREACH ( _REMOVE_FILE  ${CPACK_RPM_SPEC_IGNORE_FILES} )
+  STRING (REGEX REPLACE "${_REMOVE_FILE}\n" "" CPACK_RPM_INSTALL_FILES ${CPACK_RPM_INSTALL_FILES})
 ENDFOREACH()

+if (CPACK_ABSOLUTE_DESTINATION_FILES)
+  IF(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES}")
+  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+  # Remove trailing space
+  string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
+  # Transform endline separated - string into CMake List
+  string(REPLACE "\n" ";" CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES_LIST}")
+  # Remove unecessary quotes
+  string(REPLACE "\"" "" CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES_LIST}")
+  # Remove ABSOLUTE install file from INSTALL FILE LIST
+  list(REMOVE_ITEM CPACK_RPM_INSTALL_FILES_LIST ${CPACK_ABSOLUTE_DESTINATION_FILES})
+  # Rebuild INSTALL_FILES
+  set(CPACK_RPM_INSTALL_FILES "")
+  foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
+    set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
+  endforeach(F)
+  # Build ABSOLUTE_INSTALL_FILES
+  set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
+  foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES)
+    set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
+  endforeach(F)
+  IF(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
+    message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
+  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+endif(CPACK_ABSOLUTE_DESTINATION_FILES)
+
+# The name of the final spec file to be used by rpmbuild
 SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec")
+
+# Print out some debug information if we were asked for that
+IF(CPACK_RPM_PACKAGE_DEBUG)
+   MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY          = ${CPACK_TOPLEVEL_DIRECTORY}")
+   MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_TAG                = ${CPACK_TOPLEVEL_TAG}")
+   MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY         = ${CPACK_TEMPORARY_DIRECTORY}")
+   MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME            = ${CPACK_OUTPUT_FILE_NAME}")
+   MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH            = ${CPACK_OUTPUT_FILE_PATH}")
+   MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME           = ${CPACK_PACKAGE_FILE_NAME}")
+   MESSAGE("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE         = ${CPACK_RPM_BINARY_SPECFILE}")
+   MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+   MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
+ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+
+# USER generated spec file handling.
+# We should generate a spec file template:
+#  - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
+#  - or the user did not provide one : NOT CPACK_RPM_USER_BINARY_SPECFILE
+#
+IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
+   FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
+      "# -*- rpm-spec -*-
+BuildRoot:      \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@
+Summary:        \@CPACK_RPM_PACKAGE_SUMMARY\@
+Name:           \@CPACK_RPM_PACKAGE_NAME\@
+Version:        \@CPACK_RPM_PACKAGE_VERSION\@
+Release:        \@CPACK_RPM_PACKAGE_RELEASE\@
+License:        \@CPACK_RPM_PACKAGE_LICENSE\@
+Group:          \@CPACK_RPM_PACKAGE_GROUP\@
+Vendor:         \@CPACK_RPM_PACKAGE_VENDOR\@
+\@TMP_RPM_URL\@
+\@TMP_RPM_REQUIRES\@
+\@TMP_RPM_PROVIDES\@
+\@TMP_RPM_OBSOLETES\@
+\@TMP_RPM_BUILDARCH\@
+\@TMP_RPM_PREFIX\@
+
+%define _rpmdir \@CPACK_RPM_DIRECTORY\@
+%define _rpmfilename \@CPACK_RPM_FILE_NAME\@
+%define _unpackaged_files_terminate_build 0
+%define _topdir \@CPACK_RPM_DIRECTORY\@
+\@TMP_RPM_SPEC_INSTALL_POST\@
+\@CPACK_RPM_SPEC_MORE_DEFINE\@
+\@CPACK_RPM_COMPRESSION_TYPE_TMP\@
+
+%description
+\@CPACK_RPM_PACKAGE_DESCRIPTION\@
+
+# This is a shortcutted spec file generated by CMake RPM generator
+# we skip _install step because CPack does that for us.
+# We do only save CPack installed tree in _prepr
+# and then restore it in build.
+%prep
+mv $RPM_BUILD_ROOT \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\"
+
+#p build
+
+%install
+if [ -e $RPM_BUILD_ROOT ];
+then
+  mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/*\" $RPM_BUILD_ROOT
+else
+  mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
+fi
+
+%clean
+
+%post
+\@CPACK_RPM_SPEC_POSTINSTALL\@
+
+%postun
+\@CPACK_RPM_SPEC_POSTUNINSTALL\@
+
+%pre
+\@CPACK_RPM_SPEC_PREINSTALL\@
+
+%preun
+\@CPACK_RPM_SPEC_PREUNINSTALL\@
+
+%files
+%defattr(-,root,root,-)
+${CPACK_RPM_INSTALL_FILES}
+${CPACK_RPM_ABSOLUTE_INSTALL_FILES}
+
+%changelog
+\@CPACK_RPM_SPEC_CHANGELOG\@
+")
+  # Stop here if we were asked to only generate a template USER spec file
+  # The generated file may then be used as a template by user who wants
+  # to customize their own spec file.
+  IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
+     MESSAGE(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
+  ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
+ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
+
+# After that we may either use a user provided spec file
+# or generate one using appropriate variables value.
 IF(CPACK_RPM_USER_BINARY_SPECFILE)
   # User may have specified SPECFILE just use it
-  MESSAGE("CPackRPM: Will use user specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
-  # Note that user provided file is processed for @var replacement
+  MESSAGE("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
+  # The user provided file is processed for @var replacement
   CONFIGURE_FILE(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
 ELSE(CPACK_RPM_USER_BINARY_SPECFILE)
-  # No User specified spec file generate a valid one using var values
-  IF(CPACK_RPM_PACKAGE_DEBUG)
-    MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY          = ${CPACK_TOPLEVEL_DIRECTORY}")
-    MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_TAG                = ${CPACK_TOPLEVEL_TAG}")
-    MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY         = ${CPACK_TEMPORARY_DIRECTORY}")
-    MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME            = ${CPACK_OUTPUT_FILE_NAME}")
-    MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH            = ${CPACK_OUTPUT_FILE_PATH}")
-    MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME           = ${CPACK_PACKAGE_FILE_NAME}")
-    MESSAGE("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE         = ${CPACK_RPM_BINARY_SPECFILE}")
-    MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-    MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-  FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}
-    "# -*- rpm-spec -*-
-Buildroot:      ${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}
-Summary:        ${CPACK_RPM_PACKAGE_SUMMARY}
-Name:           ${CPACK_RPM_PACKAGE_NAME}
-Version:        ${CPACK_RPM_PACKAGE_VERSION}
-Release:        ${CPACK_RPM_PACKAGE_RELEASE}
-License:        ${CPACK_RPM_PACKAGE_LICENSE}
-Group:          ${CPACK_RPM_PACKAGE_GROUP}
-Vendor:         ${CPACK_RPM_PACKAGE_VENDOR}
-${TMP_RPM_REQUIRES}
-${TMP_RPM_BUILDARCH}
-
-#p define prefix ${CMAKE_INSTALL_PREFIX}
-%define _rpmdir ${CPACK_RPM_DIRECTORY}
-%define _rpmfilename ${CPACK_RPM_FILE_NAME}
-%define _unpackaged_files_terminate_build 0
-%define _topdir ${CPACK_RPM_DIRECTORY}
-${TMP_RPM_SPEC_INSTALL_POST}
-${CPACK_RPM_SPEC_MORE_DEFINE}
-
-%description
-${CPACK_RPM_PACKAGE_DESCRIPTION}
-
-# This is a shortcutted spec file
-# generated by CMake RPM generator
-# we skip the _prepn _build and _install
-# steps because CPack does that for us
-# WE MUST NOT DO ANYTHING in those steps because they
-# may fail for non-privileged user
-#p prep
-
-#p build
-
-#p install
-
-%clean
-
-%files
-%defattr(-,root,root,-)
-#p dir %{prefix}
-#p {prefix}/*
-${CPACK_RPM_INSTALL_FILES}
-
-%changelog
-* Sat Oct 03 2009 Kami <cmoidavid@gmail.com>
-  Update to handle more precisely the files section
-* Mon Oct 03 2008 Erk <eric.noulard@gmail.com>
-  Update generator to handle optional dependencies using Requires
-  Update DEBUG output typos.
-* Mon Aug 25 2008 Erk <eric.noulard@gmail.com>
-  Update generator to handle optional post-install
-* Tue Aug 16 2007 Erk <eric.noulard@gmail.com>
-  Generated by CPack RPM Generator and associated macros
-")
+  # No User specified spec file, will use the generated spec file
+  MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
+  # Note the just created file is processed for @var replacement
+  CONFIGURE_FILE(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
 ENDIF(CPACK_RPM_USER_BINARY_SPECFILE)
-

 IF(RPMBUILD_EXECUTABLE)
   # Now call rpmbuild using the SPECFILE
   EXECUTE_PROCESS(
-    COMMAND "${RPMBUILD_EXECUTABLE}" -bb
-            --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
+    COMMAND "${RPMBUILD_EXECUTABLE}" -bb
+            --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
             "${CPACK_RPM_BINARY_SPECFILE}"
     WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
     ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err"
-    OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
+    OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
   IF(CPACK_RPM_PACKAGE_DEBUG)
     MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
     MESSAGE("CPackRPM:Debug:    - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err")


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   03)
+SET(KWSYS_DATE_STAMP_DAY   04)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   18)
+SET(KWSYS_DATE_STAMP_DAY   19)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   27)
+SET(KWSYS_DATE_STAMP_DAY   28)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   01)
+SET(KWSYS_DATE_STAMP_DAY   02)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   15)
+SET(KWSYS_DATE_STAMP_DAY   16)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   27)
+SET(KWSYS_DATE_STAMP_DAY   28)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   23)
+SET(KWSYS_DATE_STAMP_DAY   24)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   09)
+SET(KWSYS_DATE_STAMP_DAY   10)


BUG: Fix incorrect variable reference

BUG: Fix incorrect variable reference

SVN-Revision: 3060

--- Application/CMakeScript/MIDAS.cmake
+++ Application/CMakeScript/MIDAS.cmake
@@ -85,7 +85,7 @@
   file(WRITE "${MIDAS_DATA_DIR}/FetchScripts/${testName}_fetchData.cmake"
   "message(STATUS \"Data is here: ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg}\")
 if(NOT EXISTS \"${MIDAS_DATA_DIR}/${checksum}\")
-  file(DOWNLOAD ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${MIDAS_HASH_ALGORITHM} \"${MIDAS_DATA_DIR}/${checksum}\" ${MIDAS_DOWNLOAD_TIMEOUT_STR} STATUS status)
+  file(DOWNLOAD ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg} \"${MIDAS_DATA_DIR}/${checksum}\" ${MIDAS_DOWNLOAD_TIMEOUT_STR} STATUS status)
   list(GET status 0 exitCode)
   list(GET status 1 errMsg)
   if(NOT exitCode EQUAL 0)


update meshkit cmake file for linux

update meshkit cmake file for linux

--- superbuild/Projects/unix/meshkit.cmake
+++ superbuild/Projects/unix/meshkit.cmake
@@ -9,7 +9,6 @@

 if(BUILD_WITH_CUBIT)

-message("Cubit meshkit")
 find_package(Autotools REQUIRED)
 add_external_project(meshkit
     BUILD_COMMAND "make -j5 install"
@@ -28,6 +27,14 @@
       -DAUTORECONF_EXECUTABLE:path=${AUTORECONF_EXECUTABLE}
       -DAUTOUPDATE_EXECUTABLE:path=${AUTOUPDATE_EXECUTABLE}
       -DCUBIT_PATH:PATH=${CUBIT_PATH})
+
+  if(BUILD_WITH_CUBIT)
+    message("BUILD WITH CUBIT")
+    set(CUBIT_PATH CACHE PATH "Location of the CUBIT Libraries")
+    if(NOT IS_DIRECTORY ${CUBIT_PATH})
+        message(SEND_ERROR "CUBIT_PATH needs to be set to a valid path")
+    endif()
+  endif()

 else()

@@ -56,18 +63,10 @@
     DEPENDEES update
     DEPENDERS configure
   )
-
-  option ( BUILD_WITH_CUBIT       "Build CGM with CUBIT"                 OFF )
-  if(BUILD_WITH_CUBIT)
-    set(CUBIT_PATH CACHE PATH "Location of the CUBIT Libraries")
-    if(NOT IS_DIRECTORY ${CUBIT_PATH})
-        message(SEND_ERROR "CUBIT_PATH needs to be set to a valid path")
-    endif()
-  endif()
 endif()

 endif()

-if(ENABLE_meshkit )
+if(ENABLE_meshkit)
   option ( BUILD_WITH_CUBIT       "Build CGM with CUBIT"                 OFF )
 endif()


Fix path bug on windows direct call to ctest

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@3571 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/test/CTestTestfile.cmake
+++ trunk/test/CTestTestfile.cmake
@@ -19,11 +19,23 @@
 # ${TEST_LOCAL} is repleased by "FALSE" only by automatic test call, else {TEST_LOCAL} is not defined
 SET(LOCAL ${TEST_LOCAL})
 IF(NOT (LOCAL MATCHES "FALSE"))
-	set(OV_ROOT_DIR              "$ENV{PWD}/..")
+	IF(WIN32)
+		# triky way to get absolute path for ../. directory in windows with cygwin
+		# todo: try to find a cmake way to get this for simple call to ctest in OV_ROOT_DIR\test directory in the aim to run all test
+		exec_program("cygpath" ARGS "-a -w ../." OUTPUT_VARIABLE "OV_ROOT_DIR")
+	ELSE(WIN32)
+		set(OV_ROOT_DIR              "$ENV{PWD}/..")
+	ENDIF(WIN32)
+
 	set(CTEST_SOURCE_DIRECTORY		"${OV_ROOT_DIR}")
 	set(ENV{OV_BINARY_PATH} "${OV_ROOT_DIR}/dist")
 	message("running local test here= $ENV{OV_BINARY_PATH}")
 ENDIF(NOT (LOCAL MATCHES "FALSE"))
+
+get_cmake_property(_variableNames VARIABLES)
+foreach (_variableName ${_variableNames})
+    message(STATUS "${_variableName}=${${_variableName}}")
+endforeach()

 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-plugins/acquisition/trunc/test")
@@ -82,6 +94,3 @@
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/scripts/software/tmp/vrpn/java_vrpn/test")

-
-
-


[CMake] Keep modules disabled by default

--- cmake/caches/Apple-lldb-base.cmake
+++ cmake/caches/Apple-lldb-base.cmake
@@ -4,7 +4,7 @@
 set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "")
 set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
 set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
-set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
+set(LLVM_ENABLE_MODULES OFF CACHE BOOL "")

 # Release builds set these explicitly:
 #set(LLDB_VERSION_MAJOR 9999 CACHE STRING "")


[CMake] Fix two details from r351863

[CMake] Fix two details from r351863

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

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -6,10 +6,10 @@
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)

   set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH "Path to LLVM build tree")
-  set(LLDB_PATH_TO_CLANG_BUILD "" CACHE PATH "Path to Clang build tree")
+  set(LLDB_PATH_TO_CLANG_BUILD "${LLDB_PATH_TO_LLVM_BUILD}" CACHE PATH "Path to Clang build tree")

-  file(TO_CMAKE_PATH LLDB_PATH_TO_LLVM_BUILD "${LLDB_PATH_TO_LLVM_BUILD}")
-  file(TO_CMAKE_PATH LLDB_PATH_TO_CLANG_BUILD "${LLDB_PATH_TO_CLANG_BUILD}")
+  file(TO_CMAKE_PATH "${LLDB_PATH_TO_LLVM_BUILD}" LLDB_PATH_TO_LLVM_BUILD)
+  file(TO_CMAKE_PATH "${LLDB_PATH_TO_CLANG_BUILD}" LLDB_PATH_TO_CLANG_BUILD)

   find_package(LLVM REQUIRED CONFIG
     HINTS "${LLDB_PATH_TO_LLVM_BUILD}" NO_CMAKE_FIND_ROOT_PATH)


Specify C++11 for casacore headers.

Specify C++11 for casacore headers.

Add CUDA 7.x architectures to list of defaults.

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -21,10 +21,20 @@
     endif()
 endif()

+if (CASACORE_FOUND)
+    # C++11 is now required for casacore headers.
+    include(CheckCXXCompilerFlag)
+    CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11)
+    CHECK_CXX_COMPILER_FLAG(-std=c++0x COMPILER_SUPPORTS_CXX0X)
+    if (COMPILER_SUPPORTS_CXX11)
+        append_flags(CMAKE_CXX_FLAGS -std=c++11)
+    elseif (COMPILER_SUPPORTS_CXX0X)
+        append_flags(CMAKE_CXX_FLAGS -std=c++0x)
+    endif()
+endif()
+
 if (NOT WIN32)
     if ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang.*")
-        # Tell Clang to use C++11, required for casacore headers.
-        append_flags(CMAKE_CXX_FLAGS -std=c++11)
         if (FORCE_LIBSTDC++)
             # Tell Clang to use libstdc++ rather than libc++
             # This is required if any of the OSKAR dependencies are built
@@ -174,7 +184,7 @@
     foreach (ARCH ${CUDA_ARCH})
         if (ARCH MATCHES ALL|[Aa]ll)
             message("-- INFO: Building CUDA device code for Kepler,")
-            message("-- INFO: Maxwell and Pascal architectures")
+            message("-- INFO: Maxwell, Pascal, Volta and Turing architectures")
             list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
             list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_32,code=sm_32)
             list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
@@ -184,6 +194,9 @@
             list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_60,code=sm_60)
             list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_61,code=sm_61)
             list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_62,code=sm_62)
+            list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_70,code=sm_70)
+            list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_72,code=sm_72)
+            list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_75,code=sm_75)
         elseif (ARCH MATCHES 1.3)
             message("-- INFO: Building CUDA device code for architecture 1.3")
             list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_13,code=sm_13)


commented enumeration of warnings problems with Eigen

--- cmake/platforms/Darwin-clang.cmake
+++ cmake/platforms/Darwin-clang.cmake
@@ -21,14 +21,18 @@
     -Wno-documentation
     # Ignore unknown documentation command (There are nrecognized but valid doxygen commands !)
     -Wno-documentation-unknown-command
-    # Too many of sign conversion problems. Ignore them for the moment.
-    #-Wno-sign-
     # Ignore warnings about C++98 compatibility
     -Wno-c++98-compat
     # Ignore warnings about c++98 compat pedantic mode
     -Wno-c++98-compat-pedantic
     # Ignore warnings about C++11 extensions (cgogn is promoting c++11 )
     -Wno-c++11-extensions
+
+    # # Too many of sign conversion problems (Eigen!!!). Ignore them for the moment.
+    # -Wno-sign-conversion
+    # #
+    # -Wno-deprecated
+    # -Wno-old-style-cast
 )

 # Compile with full warnings by default


[t:4814] fix project root name

[t:4814] fix project root name

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

--- cmake_modules/TokuSetupCTest.cmake
+++ cmake_modules/TokuSetupCTest.cmake
@@ -104,7 +104,7 @@
   file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/valgrind.suppressions" "${bash_suppressions}")

   ## setup a function to write tests that will run with helgrind
-  set(CMAKE_HELGRIND_COMMAND_STRING "valgrind --quiet --tool=helgrind --error-exitcode=1 --suppressions=${TOKUDB_SOURCE_DIR}/src/tests/helgrind.suppressions --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,test,*/tokudb_dump* --trace-children-skip-by-arg=--only_create,--test,--no-shutdown")
+  set(CMAKE_HELGRIND_COMMAND_STRING "valgrind --quiet --tool=helgrind --error-exitcode=1 --suppressions=${TokuDB_SOURCE_DIR}/src/tests/helgrind.suppressions --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,test,*/tokudb_dump* --trace-children-skip-by-arg=--only_create,--test,--no-shutdown")
   function(add_helgrind_test name)
     if (CMAKE_SYSTEM_NAME MATCHES Darwin OR
         ((CMAKE_C_COMPILER_ID MATCHES Intel) AND
@@ -126,7 +126,7 @@
   endfunction(add_helgrind_test)

   ## setup a function to write tests that will run with drd
-  set(CMAKE_DRD_COMMAND_STRING "valgrind --quiet --tool=drd --error-exitcode=1 --suppressions=${TOKUDB_SOURCE_DIR}/src/tests/drd.suppressions --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,test,*/tokudb_dump* --trace-children-skip-by-arg=--only_create,--test,--no-shutdown")
+  set(CMAKE_DRD_COMMAND_STRING "valgrind --quiet --tool=drd --error-exitcode=1 --suppressions=${TokuDB_SOURCE_DIR}/src/tests/drd.suppressions --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,test,*/tokudb_dump* --trace-children-skip-by-arg=--only_create,--test,--no-shutdown")
   function(add_drd_test name)
     if (CMAKE_SYSTEM_NAME MATCHES Darwin OR
         ((CMAKE_C_COMPILER_ID MATCHES Intel) AND


build

build

--- modules/HdrHistogram.cmake
+++ modules/HdrHistogram.cmake
@@ -8,7 +8,7 @@
     # C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data
     set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} /wd4057 /wd4146 /wd4244")
   else()
-    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} -Wno-format -Wno-implicit-function-declaration -Wno-incompatible-pointer-types")
+    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} -Wno-char-subscripts -Wno-format -Wno-implicit-function-declaration -Wno-incompatible-pointer-types")
   endif()
   add_library(HdrHistogram ${SOURCE_FILES})
   target_include_directories(HdrHistogram PUBLIC "HdrHistogram/src")


Update functional tests for metalink

Update functional tests for metalink

--- test/functional/ctest_functional.cmake
+++ test/functional/ctest_functional.cmake
@@ -14,9 +14,9 @@
 set(http_lcgdm_file "${http_lcgdm_base}/davix-tests/testread0011")
 set(http_dynaFed_file "${http_dynaFed_base}/davix-tests/testread0011")

-set(metalink_url "http://download.documentfoundation.org/libreoffice/stable/4.1.6/deb/x86_64/LibreOffice_4.1.6_Linux_x86-64_deb.tar.gz")
-set(metalink3_url "http://download.documentfoundation.org/libreoffice/stable/4.1.6/deb/x86_64/LibreOffice_4.1.6_Linux_x86-64_deb.tar.gz.metalink")
-set(metalink_url_direct "http://download.documentfoundation.org/libreoffice/stable/4.1.6/deb/x86_64/LibreOffice_4.1.6_Linux_x86-64_deb.tar.gz.meta4")
+set(metalink_url "http://download.documentfoundation.org/libreoffice/stable/4.3.0/deb/x86_64/LibreOffice_4.3.0_Linux_x86-64_deb.tar.gz")
+set(metalink3_url "http://download.documentfoundation.org/libreoffice/stable/4.3.0/deb/x86_64/LibreOffice_4.3.0_Linux_x86-64_deb_helppack_en-US.tar.gz.metalink")
+set(metalink_url_direct "http://download.documentfoundation.org/libreoffice/stable/4.3.0/deb/x86_64/LibreOffice_4.3.0_Linux_x86-64_deb_langpack_fr.tar.gz.meta4")

 test_dav_endpoint_ronly( ${http_desy_base} "proxy")
 test_valid_write_read_generic("${http_desy_base}" "proxy")


ENH: fix KWStyle errors for SubdivisionQuadEdgeMesh

Change-Id: I5ecc38d12ba434b428b074d8ca190072d176eab6

--- Modules/Remote/SubdivisionQuadEdgeMeshFilter.remote.cmake
+++ Modules/Remote/SubdivisionQuadEdgeMeshFilter.remote.cmake
@@ -7,5 +7,5 @@
   http://www.insight-journal.org/browse/publication/831
   http://hdl.handle.net/10380/3307"
   GIT_REPOSITORY http://github.com/InsightSoftwareConsortium/itkSubdivisionQuadEdgeMeshFilter
-  GIT_TAG 9bf7a6a20903c3dc8326c2769e3fcd92fa8c1b39
+  GIT_TAG de694991d2c16bc72030f4a0d4cd3a6bf229e1c7
   )


pick up version from configure.in

pick up version from configure.in

--- VERSION.cmake
+++ VERSION.cmake
@@ -43,7 +43,10 @@
 # 6) If any interfaces have been removed since the last public release, then
 #    set COMPATMINOR to MINOR. (binary incompatible change)
 #
+EXECUTE_PROCESS(COMMAND grep VERSION_MAJOR= ${CMAKE_SOURCE_DIR}/configure.in COMMAND cut -d = -f 2 COMMAND tr -d \n OUTPUT_VARIABLE VERSION_MAJOR)
+EXECUTE_PROCESS(COMMAND grep VERSION_MINOR= ${CMAKE_SOURCE_DIR}/configure.in COMMAND cut -d = -f 2 COMMAND tr -d \n OUTPUT_VARIABLE VERSION_MINOR)
+EXECUTE_PROCESS(COMMAND grep VERSION_RELEASE= ${CMAKE_SOURCE_DIR}/configure.in COMMAND cut -d = -f 2 COMMAND tr -d \n OUTPUT_VARIABLE VERSION_RELEASE)

-SET(OPENWSMAN_MAJOR "2")
-SET(OPENWSMAN_MINOR "0")
-SET(OPENWSMAN_PATCH "0b1")
+SET(OPENWSMAN_MAJOR ${VERSION_MAJOR})
+SET(OPENWSMAN_MINOR ${VERSION_MINOR})
+SET(OPENWSMAN_PATCH ${VERSION_RELEASE})