add error message when dynamic reconfigure is called in wrong order

--- cmake/catkin_python_setup.cmake
+++ cmake/catkin_python_setup.cmake
@@ -20,10 +20,13 @@
     message(FATAL_ERROR "catkin_python_setup() called with unused arguments: ${ARGN}")
   endif()

-  # mark that catkin_python_setup() was called in order to disable installation of generated __init__.py files in generate_messages()
+  # mark that catkin_python_setup() was called in order to disable installation of generated __init__.py files in generate_messages() and generate_dynamic_reconfigure_options()
   set(${PROJECT_NAME}_CATKIN_PYTHON_SETUP TRUE PARENT_SCOPE)
   if(${PROJECT_NAME}_GENERATE_MESSAGES)
     message(FATAL_ERROR "generate_messages() must be called after catkin_python_setup() in project '${PROJECT_NAME}'")
+  endif()
+  if(${PROJECT_NAME}_GENERATE_DYNAMIC_RECONFIGURE)
+    message(FATAL_ERROR "generate_dynamic_reconfigure_options() must be called after catkin_python_setup() in project '${PROJECT_NAME}'")
   endif()

   if(NOT EXISTS ${${PROJECT_NAME}_SOURCE_DIR}/setup.py)


CMAKE: help CheckAtomic find check_library_exists

lldb fails to build standalone on x86

-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Failed
CMake Error at CheckAtomic.cmake:66 (check_library_exists):
  Unknown CMake command "check_library_exists".
Call Stack (most recent call first):
  LLDBStandalone.cmake:90 (include)
CMakeLists.txt:3 (include)

Reviewed By: rnk

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

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

--- cmake/modules/CheckAtomic.cmake
+++ cmake/modules/CheckAtomic.cmake
@@ -1,6 +1,7 @@
 # atomic builtins are required for threading support.

 INCLUDE(CheckCXXSourceCompiles)
+INCLUDE(CheckLibraryExists)

 # Sometimes linking against libatomic is required for atomic ops, if
 # the platform doesn't support lock-free atomics.


Quote paths used in FindPySideTools.cmake

--- cMake/FindPySideTools.cmake
+++ cMake/FindPySideTools.cmake
@@ -41,9 +41,9 @@
         # pyside-uic generates in comments at beginning, which is why
         # we follow the tool command with in-place sed.
         ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-          COMMAND ${PYSIDEUIC4BINARY} "${infile}" -o "${outfile}"
+          COMMAND "${PYSIDEUIC4BINARY}" "${infile}" -o "${outfile}"
           COMMAND sed -i "/^# /d" "${outfile}"
-          MAIN_DEPENDENCY ${infile}
+          MAIN_DEPENDENCY "${infile}"
         )
     endif(WIN32)
     list(APPEND ${outfiles} ${outfile})
@@ -72,10 +72,10 @@
         # Especially on Open Build Service we don't want changing date like
         # pyside-rcc generates in comments at beginning, which is why
         # we follow the tool command with in-place sed.
-        ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-          COMMAND ${PYSIDERCC4BINARY} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
+        ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
+          COMMAND "${PYSIDERCC4BINARY}" "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
           COMMAND sed -i "/^# /d" "${outfile}"
-          MAIN_DEPENDENCY ${infile}
+          MAIN_DEPENDENCY "${infile}"
         )
     endif(WIN32)
     list(APPEND ${outfiles} ${outfile})


updated sl-compiler.cmake

updated sl-compiler.cmake

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

-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+if( CMAKE_CXX_COMPILER_ID MATCHES "GNU|AppleClang|Clang" )

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

   if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang")
     foreach(flag_var CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
@@ -20,4 +19,5 @@
     set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -stdlib=libc++")
     set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -stdlib=libc++")
   endif()
+
 endif()


Simplify if statement when auto detect houdini ABI

CMake will implicitly check for the -NOTFOUND suffix and return false.

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

--- cmake/OpenVDBHoudiniSetup.cmake
+++ cmake/OpenVDBHoudiniSetup.cmake
@@ -339,7 +339,7 @@
   find_file(_houdini_openvdb_version_file "openvdb/version.h"
     PATHS ${HOUDINI_INCLUDE_DIR}
     NO_DEFAULT_PATH)
-  if(NOT ${_houdini_openvdb_version_file} EQUAL "_houdini_openvdb_version_file-NOTFOUND")
+  if(NOT ${_houdini_openvdb_version_file})
     file(STRINGS ${_houdini_openvdb_version_file} _houdini_openvdb_version)
     foreach(line ${_houdini_openvdb_version})
       if(line MATCHES "^#define OPENVDB_ABI_VERSION_NUMBER ([0-9]+)$")


Disable warning 4592 'identifier': symbol will be dynamically initialized (implementation limitation)

--- cmake/PlatformWindowsMSVC.cmake
+++ cmake/PlatformWindowsMSVC.cmake
@@ -38,6 +38,8 @@
     # /wd4127       # -> conditional expression is constant
       /wd4251       # -> 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
       /wd4267       # -> 'var' : conversion from 'size_t' to 'type', possible loss of data
+      /wd4592       # -> 'identifier': symbol will be dynamically initialized (implementation limitation)
+

     # /W3           # -> warning level 3


[CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds

This is just a minor update to the Apple packaging configuration.

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

--- cmake/caches/Apple-stage2.cmake
+++ cmake/caches/Apple-stage2.cmake
@@ -3,6 +3,7 @@

 set(LLVM_TARGETS_TO_BUILD X86 ARM AArch64 CACHE STRING "")
 set(PACKAGE_VENDOR Apple CACHE STRING "")
+set(CLANG_VENDOR_UTI com.apple.clang CACHE STRING "")
 set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
 set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
 set(LLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD OFF CACHE BOOL "")


Small fix for OpenVDB find script

Small fix for OpenVDB find script

--- cmake/modules/FindOpenVDB.cmake
+++ cmake/modules/FindOpenVDB.cmake
@@ -158,7 +158,7 @@

 # Additionally try and use pkconfig to find OpenVDB

-find_package(PkgConfig ${_quiet} ${_required})
+find_package(PkgConfig ${_quiet} )
 pkg_check_modules(PC_OpenVDB QUIET OpenVDB)

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


Use "cegui_find_package_handle_standard_args" to find OIS so that debug libraries are taken into account.

--HG--
branch : mingw

--- cmake/FindOIS.cmake
+++ cmake/FindOIS.cmake
@@ -33,8 +33,7 @@

 mark_as_advanced(OIS_H_PATH OIS_LIB OIS_LIB_DBG)

-find_package_handle_standard_args(OIS DEFAULT_MSG OIS_LIB OIS_H_PATH)
-
+cegui_find_package_handle_standard_args(OIS OIS_LIB OIS_H_PATH)

 # set up output vars
 if (OIS_FOUND)


removed obsolete statuses

removed obsolete statuses

--- cmake/Summary.cmake
+++ cmake/Summary.cmake
@@ -116,11 +116,8 @@
 #  caffe_status("  CPU_ONLY          :   ${CPU_ONLY}") # serves CUDA
 #  caffe_status("")
   caffe_status("Dependencies:")
-  caffe_status("  Qt5               :   Yes ${QT5_VERSION}")
-  caffe_status("  glog              :   Yes ${GLOG_VERSION}")
-  caffe_status("  gflags            :   Yes ${GFLAGS_VERSION}")
-  caffe_status("  gtest             :   Yes ${GTEST_VERSION}")
-  caffe_status("  Flex              :   ${FLEX_EXECUTABLE}")
+  caffe_status("  Qt5               :" Qt5_FOUND THEN " (${Qt5_VERSION})" ELSE "No")
+  caffe_status("  GoogleTest        :" GTEST_FOUND THEN "${GTEST_LIBRARIES} (${GTEST_VERSION})" ELSE "No")
   if(BUILD_docs)
     caffe_status("Documentation:")
     caffe_status("  Doxygen           :" DOXYGEN_FOUND THEN "${DOXYGEN_EXECUTABLE} (${DOXYGEN_VERSION})" ELSE "No")


Make ARCH variable a CACHE variable

Make ARCH variable a CACHE variable

--- cmake/c_check.cmake
+++ cmake/c_check.cmake
@@ -61,7 +61,8 @@
 # CMAKE_HOST_SYSTEM_PROCESSOR - The name of the CPU CMake is running on.
 #
 # TODO: CMAKE_SYSTEM_PROCESSOR doesn't seem to be correct - instead get it from the compiler a la c_check
-set(ARCH ${CMAKE_SYSTEM_PROCESSOR})
+set(ARCH ${CMAKE_SYSTEM_PROCESSOR} CACHE STRING "Target Architecture")
+
 if (${ARCH} STREQUAL "AMD64")
   set(ARCH "x86_64")
 endif ()


doxygen.cmake: create a doc target for every plugin

This commit changes the cmake script to generate a documentation target
for every plugin in plugins/, instead of only the enabled ones.

Also, minor adjustments.

Former-commit-id: 09a447b80c1bc0da145c4e262c39d1dff4defa6b

--- cmake/doxygen.cmake
+++ cmake/doxygen.cmake
@@ -1,18 +1,28 @@

-# In this file, we create targets to generate doxygen documentation on
-# a per-project basis.
-
-# The idea is to have one documentation for each part of the framework
-# (core, helper...), each module, each plugin. etc.
-# Then, you can:
-# - use the 'doc-Foo' target to build the documentation for Foo
-#   (e.g doc-SofaCore, doc-SofaEngine, or doc-SofaPython)
-# - use the 'doc' target to build all the documentations, as well as a
-#   main documentation page that links to the others. (doc/SOFA/index.html)
+# In this file, if the option SOFA-MISC_DOXYGEN in enabled, we create
+# targets to generate doxygen documentation for each module and
+# plugin, namely:
+#
+# - the 'doc-Foo' target generates the doxygen for the Foo module or
+#   plugin (e.g, doc-SofaEngine, or doc-SofaPython).  Also, doc-Foo
+#   depends on doc-Bar if Foo depends on the Bar module/plugin.
+#
+# - the 'doc-SOFA' target generates the documentation for framework/,
+#   and inserts in its main page a list of links to the others
+#   documentations.
+#
+# - the 'doc' target depends on all the doc-* targets.

-# How it's done:
+# Furthermore, if the SOFA-MISC_DOXYGEN_COMPONENT_LIST option is
+# enabled, building 'doc' will compile Sofa and generate an extra page
+# in the main documentation that list all the components available in
+# modules and links to their documentation page, so that one can
+# easily find the doxygen of a component.

+
+# Details:
+#
 # Doxygen has mechanisms that allow to link documentations together.
 # Here is the outline: when generating the documentation for projectA,
 # you can export the list of documented entities in a tag file. Then,
@@ -20,11 +30,13 @@
 # projectA, you can feed this tag file to doxygen. As a result,
 # symbols from projectA present in your documentation are linked to
 # their documentation in projectA.
+#
 # (see http://www.stack.nl/~dimitri/doxygen/manual/external.html)
-
+#
 # Here, we use this 'tag file' mechanism of doxygen and the dependency
 # tree of the projects to generate the documentation of the different
 # projects in a correct order, and link them together.
+

 if (SOFA-MISC_DOXYGEN)
     find_package(Doxygen REQUIRED)
@@ -39,9 +51,10 @@
     set(SOFA_DOCUMENTABLE_PROJECTS)
     set(SOFA_DOC_TARGETS)
     foreach(project ${GLOBAL_DEPENDENCIES})
-        if(TARGET ${project})
-            if((${GLOBAL_PROJECT_PATH_${project}} MATCHES ".*/plugins/.*") OR
-                    (${GLOBAL_PROJECT_PATH_${project}} MATCHES ".*/modules/.*"))
+        if((${GLOBAL_PROJECT_PATH_${project}} MATCHES ".*/plugins/${project}") OR
+                (${GLOBAL_PROJECT_PATH_${project}} MATCHES ".*/modules/${project}"))
+            # Ignore SofaComponent* meta-modules
+            if(NOT ${project} MATCHES "SofaComponent.*")
                 list(APPEND SOFA_DOCUMENTABLE_PROJECTS ${project})
                 list(APPEND SOFA_DOC_TARGETS doc-${project})
             endif()
@@ -94,6 +107,7 @@
         add_doc_target("${project}" "${input}" "${documentable_dependencies};SOFA")
     endforeach()

+
     # Use configure_file() to generate the source for the main page of
     # the documentation, which lists all the other documentations.

@@ -132,15 +146,16 @@

     set(LINK_TO_COMPONENT_LIST_PAGE "")
     if(SOFA-MISC_DOXYGEN_COMPONENT_LIST)
-        set(LINK_TO_COMPONENT_LIST_PAGE "If you are looking for the documentation of a specific component, check out this page, which lists all the components available in modules.")
+        set(LINK_TO_COMPONENT_LIST_PAGE "If you are looking for the documentation of a specific component, check out the Component List (modules only).")
     endif()
     configure_file("${SOFA_FRAMEWORK_DIR}/doc.h" "${SOFA_BUILD_DIR}/misc/doc.h")
+

     if(SOFA-MISC_DOXYGEN_COMPONENT_LIST)
         add_subdirectory(cmake/doxygen)
     endif()

-    # Create the target for the main page
+    # Create the 'doc-SOFA' target for the documentation of framework/
     if(SOFA-MISC_DOXYGEN_COMPONENT_LIST)
         add_doc_target("SOFA" "${SOFA_FRAMEWORK_DIR}/sofa ${SOFA_BUILD_DIR}/misc/doc.h ${SOFA_BUILD_DIR}/misc/component_list.h" "")
         add_dependencies("doc-SOFA" generateComponentList)


Use the correct version file for TBB since 2021.1

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -185,7 +185,8 @@

   if(TBB_INCLUDE_DIRS)
     if(EXISTS "${TBB_INCLUDE_DIRS}/tbb/version.h")
-        file(READ "${TBB_INCLUDE_DIRS}/tbb/version.h" _tbb_version_file)
+        # since version 2021.1
+        file(READ "${TBB_INCLUDE_DIRS}/oneapi/tbb/version.h" _tbb_version_file)
     else()
         file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file)
     endif()


Bumped version to 0.1.4

Bumped version to 0.1.4

--- cmake/Version.cmake
+++ cmake/Version.cmake
@@ -13,7 +13,7 @@
 # The PATCH version can be incremented whenever it is necessary.  The patch version should be
 # incremented whenever there is a "release" in any form, but can also be incremented periodically
 # for testing purposes.
-set(CGUL_VERSION_PATCH 3)
+set(CGUL_VERSION_PATCH 4)

 # Combined version
 set(CGUL_VERSION ${CGUL_VERSION_MAJOR}.${CGUL_VERSION_MINOR}.${CGUL_VERSION_PATCH})


fix find_package cache pollution

fix find_package cache pollution

--- cmake/OpenCVDetectVTK.cmake
+++ cmake/OpenCVDetectVTK.cmake
@@ -1,34 +1,34 @@
-# VTK 9.0
 if(NOT VTK_FOUND)
-  find_package(VTK 9 QUIET NAMES vtk COMPONENTS
-    FiltersExtraction
-    FiltersSources
-    FiltersTexture
-    IOExport
-    IOGeometry
-    IOPLY
-    InteractionStyle
-    RenderingCore
-    RenderingLOD
-    RenderingOpenGL2
-    NO_MODULE)
-endif()
-
-# VTK 6.x components
-if(NOT VTK_FOUND)
-  find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
-  IF(VTK_FOUND)
-    IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
-      find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE)
-    ELSE(VTK_RENDERING_BACKEND)
-      find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
-    ENDIF(VTK_RENDERING_BACKEND)
-  ENDIF(VTK_FOUND)
-endif()
-
-# VTK 5.x components
-if(NOT VTK_FOUND)
-  find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
+  find_package(VTK QUIET NAMES vtk VTK)
+  if(VTK_FOUND)
+    if(VTK_VERSION VERSION_EQUAL "9") # VTK 9.0
+      find_package(VTK 9 QUIET NAMES vtk COMPONENTS
+              FiltersExtraction
+              FiltersSources
+              FiltersTexture
+              IOExport
+              IOGeometry
+              IOPLY
+              InteractionStyle
+              RenderingCore
+              RenderingLOD
+              RenderingOpenGL2
+              NO_MODULE)
+    elseif(VTK_VERSION VERSION_GREATER "5") # VTK 6.x components
+      find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
+      IF(VTK_FOUND)
+        IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
+          find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE)
+        ELSE(VTK_RENDERING_BACKEND)
+          find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
+        ENDIF(VTK_RENDERING_BACKEND)
+      ENDIF(VTK_FOUND)
+    elseif(VTK_VERSION VERSION_EQUAL "5") # VTK 5.x components
+      find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
+    else()
+      set(VTK_FOUND FALSE)
+    endif()
+  endif()
 endif()

 if(NOT VTK_FOUND)


Added dependency from numpy to debian package with python bindings.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -69,10 +69,10 @@
 set(CPACK_COMPONENT_docs_DEPENDS libs)
 set(CPACK_COMPONENT_java_DEPENDS libs)
 set(CPACK_COMPONENT_python_DEPENDS libs)
-set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
+set(CPACK_DEB_python_PACKAGE_DEPENDS "python-numpy (>=${PYTHON_NUMPY_VERSION}), python${PYTHON_VERSION_MAJOR_MINOR}")
 set(CPACK_COMPONENT_tests_DEPENDS libs)
 if (HAVE_opencv_python)
-  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
+  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python-numpy (>=${PYTHON_NUMPY_VERSION}), python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
 endif()

 if(HAVE_CUDA)


cmake: move the BOARD variable watch below deprecated board handling

Fixes: #33138

Board alias and deprecated board handling is setting the BOARD variable
after zephyr_boilerplate_watch(BOARD) has been executed.

This results in the board changed warning.

This commit moves the zephyr_boilerplate_watch(BOARD) code below the
board alias and deprecation handling.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -224,8 +224,6 @@
   string(SUBSTRING ${BOARD} 0 ${REVISION_SEPARATOR_INDEX} BOARD)
 endif()

-zephyr_boilerplate_watch(BOARD)
-
 set(BOARD_MESSAGE "Board: ${BOARD}")

 if(DEFINED ENV{ZEPHYR_BOARD_ALIASES})
@@ -242,6 +240,8 @@
   set(BOARD ${${BOARD}_DEPRECATED})
   message(WARNING "Deprecated BOARD=${BOARD_DEPRECATED} name specified, board automatically changed to: ${BOARD}.")
 endif()
+
+zephyr_boilerplate_watch(BOARD)

 foreach(root ${BOARD_ROOT})
   # Check that the board root looks reasonable.


cmake: set CMP0116 policy to old, Ninja DEPFILE behaviour

Fixes: #36185

CMake >=3.20 now supports relative paths in Ninja depfiles.

As Zephyr still supports the use of CMake 3.13, and the current use of
DEPFILE in linker/ld/target.cmake is already absolute path, then the
safest choice is to use old behavior.
This can be changed when Zephyr increases minimum required CMake to be
3.20 or newer.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -35,6 +35,13 @@
 # to the new behaviour.
 # CMP0079: "target_link_libraries() allows use with targets in other directories"
 cmake_policy(SET CMP0079 OLD)
+
+# Use the old CMake behaviour until we are updating the CMake 3.20 as minimum
+# required. This ensure that CMake >=3.20 will be consistent with older CMakes.
+# CMP0116: Ninja generators transform DEPFILE s from add_custom_command().
+if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.20)
+  cmake_policy(SET CMP0116 OLD)
+endif()

 define_property(GLOBAL PROPERTY ZEPHYR_LIBS
     BRIEF_DOCS "Global list of all Zephyr CMake libs that should be linked in"


CMake: Use LLVM_COMMON_DEPENDS on add_llvm_executable.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -30,6 +30,9 @@
   if( llvm_system_libs )
     target_link_libraries(${name} ${llvm_system_libs})
   endif()
+  if( LLVM_COMMON_DEPENDS )
+    add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
+  endif( LLVM_COMMON_DEPENDS )
 endmacro(add_llvm_executable name)


[cmake] Fix capitalization in find_path argument.

--- cmake/modules/FindICU.cmake
+++ cmake/modules/FindICU.cmake
@@ -25,7 +25,7 @@
   find_path(ICU_INCLUDE_DIR
             NAMES "unicode/utypes.h"
             HINTS ${icu_roots}
-            PATh_SUFFIXES ${icu_include_suffixes}
+            PATH_SUFFIXES ${icu_include_suffixes}
             DOC "ICU include directory")
   set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)


Set CMAKE_C_COMPILE_OBJECT (wasn't being set sometimes?)

--- cmake/toolchain-pnacl.cmake
+++ cmake/toolchain-pnacl.cmake
@@ -42,16 +42,18 @@
 set(CMAKE_RANLIB          "${PLATFORM_PREFIX}/${PLATFORM_TRIPLET}-ranlib${PNACL_BIN_EXT}")
 set(CMAKE_FIND_ROOT_PATH  "${PLATFORM_PREFIX}/../le32-nacl")

-SET(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
-SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
-SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-SET(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1)
-SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1)
 set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "@")
 set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")
 set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> rc <TARGET> <LINK_FLAGS> <OBJECTS>")
 set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> rc <TARGET> <LINK_FLAGS> <OBJECTS>")
+set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
+set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")

 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)


Statically link libstdc++ for Linux (#355)

Summary:
Fixes Issue #352 for Linux.
Currently not sure about `CMAKE_EXE_LINKER_FLAGS` for lld (macOS) so this fix only applies to Linux.

Before:
```bash
vagrant@ubuntu-xenial:~/redex/build-cmake$ ldd redex-all
	linux-vdso.so.1 =>  (0x00007ffe17ef0000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f28866c2000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f28864be000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f288613c000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2885e33000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2885c1d000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2885853000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f28868df000)
```

After the fix:
```bash
vagrant@ubuntu-xenial:~/redex/build-cmake$ ldd redex-all
	linux-vdso.so.1 =>  (0x00007fffb2bce000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1836e42000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1836c3e000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1836935000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f183656b000)
```
Pull Request resolved: https://github.com/facebook/redex/pull/355

Reviewed By: int3

Differential Revision: D10478081

Pulled By: minjang

fbshipit-source-id: b2372e5e07a301edc6a8d1cd9bc5cc2cb9ec0919

--- cmake_modules/Commons.cmake
+++ cmake_modules/Commons.cmake
@@ -16,6 +16,10 @@
         set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
         set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT")
     else ()
+        if (UNIX AND NOT APPLE AND ENABLE_STATIC)
+            set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
+        endif ()
+
         set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -Wall")
         set(COMMON_CXX_FLAGS_NODBG, "-O3")
         set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COMMON_CXX_FLAGS_NODBG}")


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/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   26)
+SET(KWSYS_DATE_STAMP_DAY   27)


Added 'dl' library on linux

Added 'dl' library on linux

--- config/config.cmake
+++ config/config.cmake
@@ -39,7 +39,6 @@
   SET(OSTYPE $ENV{OSTYPE})
   SET(BUILD_OS OFOPSYS_LINUX)
   SET(WORDSIZE "WORDSIZE32")
-
   IF (OSTYPE STREQUAL "linux")
     SET(BUILD_OS OFOPSYS_LINUX)
   ENDIF(OSTYPE STREQUAL "linux")
@@ -55,6 +54,7 @@

   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic -fPIC")

+  SET(LIBS ${LIBS} "dl")
 ENDIF(WIN32)

 # Change this to "SHARED" to create shared libraries


[changed] cleanup

[changed] cleanup

--- cmake/BOTG.cmake
+++ cmake/BOTG.cmake
@@ -153,10 +153,12 @@
 #-------------------------------------------------------------------------------
 # PUBLIC
 # Define a library (including headers) to build.
-# botgLibrary( Testing123
-#    SOURCE
+# botgLibrary( <name>
+#    SOURCES
 #        ..
 #    HEADERS
+#        ..
+#    LINK_TO
 #        ..
 # )
 #
@@ -215,7 +217,7 @@
 # PUBLIC
 # Add flags to the linker.
 #
-MACRO( botgAddLinkerFlags compiler system) #list of flags comes at end
+MACRO( botgAddLinkerFlags compiler system ) #list of flags comes at end
     #Use CXX to check the validity of flags
     botgCompilerAndSystemMatches( CXX "${compiler}" "${system}" found )
     IF( found )
@@ -233,8 +235,6 @@
                 ELSE()
                     MESSAGE(STATUS "[BootsOnTheGround] could not add invalid linker flag='${flag}'!")
                 ENDIF()
-            ELSE()
-                MESSAGE(STATUS "[BootsOnTheGround] linker flag='${flag}' has already been added.")
             ENDIF()
         ENDFOREACH()
     ENDIF()
@@ -270,12 +270,7 @@
         ASSERT_DEFINED( VERSION )
         SET(version "${VERSION}")
     ENDIF()
-    SET(final "")
-    IF( "${${REPOSITORY_NAME}_ENABLE_DEVELOPMENT_MODE}" )
-        SET(final "-dev")
-    ENDIF()
-    GLOBAL_SET( ${PACKAGE_NAME}_VERSION "${version}${final}")
-    MESSAGE( STATUS "[BootsOnTheGround] configuring package=${PACKAGE_NAME} version=${${PACKAGE_NAME}_VERSION}")
+    GLOBAL_SET( ${PACKAGE_NAME}_VERSION "${version}")
 ENDMACRO()
 #-------------------------------------------------------------------------------
 # PUBLIC
@@ -324,7 +319,9 @@

     # Turn on tests by default.
     GLOBAL_SET( ${PROJECT_NAME}_ENABLE_TESTS ON CACHE BOOL "Enable all tests by default.")
-    GLOBAL_SET( ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE ON)
+
+    # Turn secondary tested code on by default.
+    GLOBAL_SET( ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE ON CACHE BOOL "Enable secondary tested code by default.")

     # Set repository names if not set.
     GLOBAL_SET( REPOSITORY_NAME ${PROJECT_NAME} )
@@ -402,7 +399,7 @@
             #############################
             TRIBITS_PACKAGE_POSTPROCESS()
             #############################
-            MESSAGE( STATUS "[BootsOnTheGround] finished configuring package=${PACKAGE_NAME} version=${BOTG_${PACKAGE_NAME}_VERSION}!")
+            MESSAGE( STATUS "[BootsOnTheGround] finished configuring package=${PACKAGE_NAME} version=${${PACKAGE_NAME}_VERSION}!")

         ENDIF()

@@ -417,7 +414,7 @@
         #############################
         TRIBITS_PACKAGE_POSTPROCESS()
         #############################
-        MESSAGE( STATUS "[BootsOnTheGround] finished configuring superpackage=${PACKAGE_NAME} version=${BOTG_${PACKAGE_NAME}_VERSION}!")
+        MESSAGE( STATUS "[BootsOnTheGround] finished configuring superpackage=${PACKAGE_NAME} version=${${PACKAGE_NAME}_VERSION}!")

         GLOBAL_SET(BOTG_INSIDE_SUPERPACKAGE_CMAKELISTS "")


Removed cmake namespace stuff.

Removed cmake namespace stuff.

namespace won't work anyway because there would also be collisions
with header search paths, etc... so all we'll do is look for
import/export name collisions and warn about them

--- cmake/fips.cmake
+++ cmake/fips.cmake
@@ -12,8 +12,6 @@
 include("${FIPS_ROOT_DIR}/cmake/fips_osx.cmake")
 include("${FIPS_ROOT_DIR}/cmake/fips_pnacl.cmake")
 #include("${FIPS_ROOT_DIR}/cmake/fips_generators.cmake")
-
-set(FIPS_NAMESPACE)

 #-------------------------------------------------------------------------------
 #   define top-level options for the whole project
@@ -139,22 +137,6 @@
 endmacro()

 #-------------------------------------------------------------------------------
-#   fips_namespace(ns)
-#   Set the current fips namespace (for imported targets)
-#
-macro(fips_namespace ns)
-    set(FIPS_NAMESPACE "${ns}_")
-endmacro()
-
-#-------------------------------------------------------------------------------
-#   fips_reset_namespace()
-#   Reset the fips namespace to an empty string.
-#
-macro(fips_namespace)
-    set(FIPS_NAMESPACE)
-endmacro()
-
-#-------------------------------------------------------------------------------
 #   fips_ide_group(group)
 #   Define the IDE group name for the following targets.
 #
@@ -175,7 +157,7 @@
 #   Begin defining an fips module.
 #
 macro(fips_begin_module name)
-    set(name ${FIPS_NAMESPACE}${name})
+    set(name ${name})
     if (FIPS_CMAKE_VERBOSE)
         message("Module: name=" ${name})
     endif()
@@ -216,7 +198,7 @@
 #   Begin defining a static link library
 #
 macro(fips_begin_lib name)
-    set(name ${FIPS_NAMESPACE}${name})
+    set(name ${name})
     if (FIPS_CMAKE_VERBOSE)
         message("Library: name=" ${name})
     endif()


fix error when WITH_TESTING=OFF

fix error when WITH_TESTING=OFF

--- cmake/util.cmake
+++ cmake/util.cmake
@@ -107,7 +107,6 @@
         paddle_parameter
         paddle_proto
         paddle_cuda
-        paddle_test_main
         ${METRIC_LIBS}
         ${PROTOBUF_LIBRARY}
         ${LIBGLOG_LIBRARY}
@@ -156,7 +155,7 @@
 function(link_paddle_test TARGET_NAME)
     link_paddle_exe(${TARGET_NAME})
     target_link_libraries(${TARGET_NAME} ${GTEST_MAIN_LIBRARIES}
-        ${GTEST_LIBRARIES})
+        ${GTEST_LIBRARIES} paddle_test_main)
 endfunction()

 # add_unittest_without_exec


Added debugging output to CMake module

Added debugging output to CMake module

--- source/raptor/FindRAPTOR.cmake
+++ source/raptor/FindRAPTOR.cmake
@@ -75,10 +75,9 @@
     find_library(RAPTOR_LIBRARY NAMES raptor2 libraptor2)
     endif ()
     message("Found Raptor at ${RAPTOR_LIBRARY}")
-
-    message("Found Raptor at ${RAPTOR_LIBRARY}")
-    message("$ENV{HOME}")
-    file(GLOB_RECURSE include_files LIST_DIRECTORIES true $ENV{HOME}/.linuxbrew/include/*)
+    message("home: $ENV{HOME}")
+    message("user: $ENV{USER}"
+    file(GLOB_RECURSE include_files LIST_DIRECTORIES true home/$ENV{USER}/.linuxbrew/include/*)
     message("${include_files}")

     if (NOT WIN32)


CMake: fix syntax error from previous commit.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -126,7 +126,7 @@
                 execute_process (COMMAND cmd /C mklink ${SLASH_D} ${BACKWARD_ABS_DESTINATION} ${BACKWARD_ABS_SOURCE} OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE RESULT_CODE)
             endif ()
         endif ()
-        if ("${RESULT_CODE}" NOT STREQUAL "0")
+        if (NOT "${RESULT_CODE}" STREQUAL "0")
             if (SLASH_D)
                 set (COMMAND COMMAND ${CMAKE_COMMAND} -E copy_directory ${ABS_SOURCE} ${ABS_DESTINATION})
             else ()


CMake: Use CMake facilities to detect MSBuild when possible. Fixes #207.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -267,11 +267,15 @@
 endfunction()

 if (URHO3D_CSHARP)
-	if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
-		# Workaround for some cases where csc has issues when invoked by CMake.
-		set (TERM_WORKAROUND env TERM=xterm)
-	endif ()
-	find_program(MSBUILD msbuild PATHS /Library/Frameworks/Mono.framework/Versions/Current/bin ${MONO_PATH}/bin)
+    if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
+        # Workaround for some cases where csc has issues when invoked by CMake.
+        set (TERM_WORKAROUND env TERM=xterm)
+    endif ()
+    if (CMAKE_VS_MSBUILD_COMMAND)
+        set (MSBUILD ${CMAKE_VS_MSBUILD_COMMAND} CACHE STRING "")
+    else ()
+        find_program(MSBUILD msbuild PATHS /Library/Frameworks/Mono.framework/Versions/Current/bin ${MONO_PATH}/bin)
+    endif ()
 endif ()

 function (add_msbuild_target)
@@ -330,7 +334,7 @@
     add_msbuild_target(TARGET NugetRestore EXCLUDE_FROM_ALL ARGS ${VS_SOLUTIONS} /t:restore /m)

     execute_process(COMMAND ${TERM_WORKAROUND} ${MSBUILD} ${VS_SOLUTIONS} /t:restore /m /nologo
-		/p:CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}/ /consoleloggerparameters:ErrorsOnly
+        /p:CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}/ /consoleloggerparameters:ErrorsOnly
     )

     # Strong name signatures


Added pthread library for linux systems.

--- CMakeExternals/PatchACVD.cmake
+++ CMakeExternals/PatchACVD.cmake
@@ -29,3 +29,9 @@
 string(REPLACE "ss" "ss VTK_EXPORT" contents ${contents})
 set(CONTENTS ${contents})
 configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+set(path "DiscreteRemeshing/CMakeLists.txt")
+file(STRINGS ${path} contents NEWLINE_CONSUME)
+string(REPLACE "TARGET_LINK_LIBRARIES(v" "IF(UNIX AND NOT APPLE)\n  LIST(APPEND LIB_ADDED pthread)\nENDIF(UNIX AND NOT APPLE)\n\nTARGET_LINK_LIBRARIES(v" contents ${contents})
+set(CONTENTS ${contents})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)


FindGROMACS.cmake: fix typo

FindGROMACS.cmake: fix typo

--- CMakeModules/FindGROMACS.cmake
+++ CMakeModules/FindGROMACS.cmake
@@ -47,7 +47,7 @@
   include(CheckLibraryExists)
   check_library_exists("${GROMACS_LIBRARY}" GromacsVersion "" FOUND_GROMACS_VERSION)
   if(NOT FOUND_GROMACS_VERSION)
-    message(FATAL_ERROR "Could not find GromacsVersion in ${GROMACS_LIBRARY}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GROMACS_LIBRARY by hand which sets the gromacs lib and it's depencies (i.e. -DGROMACS_LIBRARY='/path/to/libgmx.so;/path/to/libblas.so;/path/to/libm.so')!")
+    message(FATAL_ERROR "Could not find GromacsVersion in ${GROMACS_LIBRARY}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GROMACS_LIBRARY by hand which sets the gromacs lib and it's dependencies (i.e. -DGROMACS_LIBRARY='/path/to/libgmx.so;/path/to/libblas.so;/path/to/libm.so')!")
   endif(NOT FOUND_GROMACS_VERSION)
   check_library_exists("${GROMACS_LIBRARY}" init_mtop "" FOUND_GROMACS_INIT_MTOP)
   if(NOT FOUND_GROMACS_INIT_MTOP)


Force staging tests to run serially

Force staging tests to run serially

--- testing/adios2/engine/staging-common/TestSupp.cmake
+++ testing/adios2/engine/staging-common/TestSupp.cmake
@@ -251,7 +251,10 @@
        set (timeout "30")
     endif()

-    set_tests_properties(${testname} PROPERTIES TIMEOUT ${timeout} ${${basename}_PROPERTIES} )
+    set_tests_properties(${testname} PROPERTIES
+        TIMEOUT ${timeout} ${${basename}_PROPERTIES}
+        RUN_SERIAL TRUE
+    )
 endfunction()

 function(from_hex HEX DEC)


choose default middleware implementation from available ones

--- rclcpp/rclcpp-extras.cmake
+++ rclcpp/rclcpp-extras.cmake
@@ -1,22 +1,26 @@
 # copied from rclcpp/rclcpp-extras.cmake

+ament_index_get_resources(_middleware_implementations "ros_middleware_implementation")
+if("${_middleware_implementations}" STREQUAL "")
+  message(FATAL_ERROR "Could not find any ROS middleware implementation.")
+endif()
+
+set(_middleware_implementation "")
 # option()
-set(_middleware_implementation "")
 if(NOT "${ROS_MIDDLEWARE_IMPLEMENTATION}" STREQUAL "")
   set(_middleware_implementation "${ROS_MIDDLEWARE_IMPLEMENTATION}")
 elseif(NOT "$ENV{ROS_MIDDLEWARE_IMPLEMENTATION}" STREQUAL "")
   set(_middleware_implementation "$ENV{ROS_MIDDLEWARE_IMPLEMENTATION}")
 else()
-  # detemine "default" implementation based on the available ones
-  set(_middleware_implementation "ros_middleware_connext_cpp")
-  if("${_middleware_implementation}" STREQUAL "")
-    message(FATAL_ERROR "No middleware implementation available.")
-  endif()
+  # TODO detemine "default" implementation based on the available ones
+  list(GET _middleware_implementations 1 _middleware_implementation)
 endif()

-message("rclcpp_DEFINITIONS ${rclcpp_DEFINITIONS}")
-message("rclcpp_INCLUDE_DIRS ${rclcpp_INCLUDE_DIRS}")
-message("rclcpp_LIBRARIES ${rclcpp_LIBRARIES}")
+list(FIND _middleware_implementations "${_middleware_implementation}" _index)
+if(_index EQUAL -1)
+  string(REPLACE ";" ", " _middleware_implementations_string "${_middleware_implementations}")
+  message(FATAL_ERROR "Could not find ROS middleware implementation '${_middleware_implementation}'. Choose one of the following: ${_middleware_implementations_string}")
+endif()

 message(STATUS "Using middleware implementation: ${_middleware_implementation}")
 find_package("${_middleware_implementation}" REQUIRED)
@@ -30,7 +34,3 @@
 list(APPEND rclcpp_DEFINITIONS ${${ROS_MIDDLEWARE_IMPLEMENTATION}_DEFINITIONS})
 list(APPEND rclcpp_INCLUDE_DIRS ${${ROS_MIDDLEWARE_IMPLEMENTATION}_INCLUDE_DIRS})
 list(APPEND rclcpp_LIBRARIES ${${ROS_MIDDLEWARE_IMPLEMENTATION}_LIBRARIES})
-
-message("rclcpp_DEFINITIONS ${rclcpp_DEFINITIONS}")
-message("rclcpp_INCLUDE_DIRS ${rclcpp_INCLUDE_DIRS}")
-message("rclcpp_LIBRARIES ${rclcpp_LIBRARIES}")


CMake now searchs and links sfml-audio

CMake now searchs and links sfml-audio

--- cmake/SFML.cmake
+++ cmake/SFML.cmake
@@ -49,14 +49,33 @@
     PATHS ${DCPU_VM_SEARCH_PATHS}
 )

+message(STATUS "Looking for sfml-audio library")
+find_library(SFML_AUDIO_LIBRARY
+    NAMES sfml-audio
+    HINTS
+    NO_DEFAULT_PATH
+    NO_CMAKE_ENVIRONMENT_PATH
+    NO_CMAKE_SYSTEM_PATH
+    NO_SYSTEM_ENVIRONMENT_PATH
+    NO_CMAKE_PATH
+    CMAKE_FIND_FRAMEWORK NEVER
+    PATH_SUFFIXES lib lib64
+    PATHS ${DCPU_VM_SEARCH_PATHS}
+)
+
 if (SFML_SYSTEM_LIBRARY)
     if (SFML_WINDOW_LIBRARY)
         if (SFML_GRAPHICS_LIBRARY)
-            set (SFML_LIBRARIES
-                "${SFML_SYSTEM_LIBRARY}"
-                "${SFML_WINDOW_LIBRARY}"
-                "${SFML_GRAPHICS_LIBRARY}"
-                )
+            if (SFML_AUDIO_LIBRARY)
+                set (SFML_LIBRARIES
+                    "${SFML_SYSTEM_LIBRARY}"
+                    "${SFML_WINDOW_LIBRARY}"
+                    "${SFML_GRAPHICS_LIBRARY}"
+                    "${SFML_AUDIO_LIBRARY}"
+                    )
+            else (SFML_AUDIO_LIBRARY)
+                message(FATAL_ERROR "sfml-audio library not found")
+            endif (SFML_AUDIO_LIBRARY)
         else (SFML_GRAPHICS_LIBRARY)
             message(FATAL_ERROR "sfml-graphics library not found")
         endif (SFML_GRAPHICS_LIBRARY)


Optimization, ensure that linker in suil application uses static library

--- cmake/Suil.cmake
+++ cmake/Suil.cmake
@@ -169,23 +169,23 @@
     if (SUIL_APP_DEPENDS)
         message(STATUS "adding dependencies to ${name}: ${SUIL_APP_DEPENDS}")
         add_dependencies(${name} ${SUIL_APP_DEPENDS})
-        set(${name}_LIBRARIES ${SUIL_PROJECT_LIBRARIES} ${SUIL_APP_LIBRARIES})
-    else()
-        set(${name}_LIBRARIES ${SUIL_PROJECT_STATIC_LIBRARIES} ${SUIL_APP_LIBRARIES})
-    endif()
-
-    # add dependecy libraries
-    target_link_libraries(${name} ${${name}_LIBRARIES})
-    message(STATUS "target '${name}' libraries: ${${name}_LIBRARIES}")
+    endif()

     if (SUIL_APP_TEST)
         list(APPEND SUIL_APP_DEFINES "-DSUIL_TESTING")
+        set(${name}_LIBRARIES ${SUIL_PROJECT_LIBRARIES} ${SUIL_APP_LIBRARIES})
+    else()
+        set(${name}_LIBRARIES ${SUIL_PROJECT_STATIC_LIBRARIES} ${SUIL_APP_LIBRARIES})
     endif()
     # add custom definitions if provided
     if (SUIL_APP_DEFINES)
         message(STATUS "target '${name}' extra defines: ${SUIL_APP_DEFINES}")
         target_compile_definitions(${name} PUBLIC ${SUIL_APP_DEFINES})
     endif()
+    # add dependecy libraries
+    target_link_libraries(${name} ${${name}_LIBRARIES})
+    message(STATUS "target '${name}' libraries: ${${name}_LIBRARIES}")
+

     # add target include directories
     set(${name}_INCLUDES src includes)


WIP: Adjusted CTest.cmake according to more likely SuperElastix settings

--- CTest.cmake
+++ CTest.cmake
@@ -1,28 +1,51 @@
-set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/workspace/tmp/dashboards/libssh/source")
-set(CTEST_BINARY_DIRECTORY "$ENV{HOME}/workspace/tmp/dashboards/libssh/build")
+#=========================================================================
+#
+#  Copyright Leiden University Medical Center, Erasmus University Medical
+#  Center and contributors
+#
+#  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.txt
+#
+#  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.
+#
+#=========================================================================

-set(CTEST_SITE "host.libssh.org")
-set(CTEST_BUILD_NAME "linux-gcc-default")
+set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/src")
+set(CTEST_BINARY_DIRECTORY "$ENV{HOME}/build")
+
+set(CTEST_SITE "lkeb-selx01")
+
+find_program(CTEST_GIT_COMMAND NAMES git)
+
+execute_process (
+    COMMAND ${CTEST_GIT_COMMAND} rev-parse --short HEAD
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+    OUTPUT_VARIABLE SELX_GIT_COMMIT_SHA
+)
+execute_process (
+    COMMAND ${CTEST_GIT_COMMAND} name-rev --name-only HEAD
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+    OUTPUT_VARIABLE SELX_GIT_BRANCH_NAME
+)
+
+set(CTEST_BUILD_NAME "${SELX_GIT_BRANCH_NAME};commit=SHA\:${SELX_GIT_COMMIT_SHA}")

 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
-set(CTEST_BUILD_CONFIGURATION "Profiling")
-set(CTEST_BUILD_OPTIONS "-DWITH_SSH1=ON -WITH_SFTP=ON -DWITH_SERVER=ON -DWITH_ZLIB=ON -DWITH_PCAP=ON -DWITH_GCRYPT=OFF")
-
-set(WITH_MEMCHECK TRUE)
-set(WITH_COVERAGE TRUE)
-
-#######################################################################
+set(CTEST_BUILD_CONFIGURATION Release)
+set(CTEST_BUILD_OPTIONS "-j4")

 ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})

-find_program(CTEST_GIT_COMMAND NAMES git)
-find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
-find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
-
-set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE ${CTEST_SOURCE_DIRECTORY}/tests/valgrind.supp)

 if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
-  set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} clone git://git.libssh.org/projects/libssh/libssh.git ${CTEST_SOURCE_DIRECTORY}")
+  set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} clone https://github.com/SuperElastix/SuperElastix.git ${CTEST_SOURCE_DIRECTORY}")
 endif()

 set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
@@ -37,10 +60,4 @@
 ctest_configure()
 ctest_build()
 ctest_test()
-if (WITH_COVERAGE AND CTEST_COVERAGE_COMMAND)
-  ctest_coverage()
-endif (WITH_COVERAGE AND CTEST_COVERAGE_COMMAND)
-if (WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
-  ctest_memcheck()
-endif (WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
 ctest_submit()


Add Wl block to avoid parallel dependencies in the unit tests

--- cmake/FindMKL.cmake
+++ cmake/FindMKL.cmake
@@ -89,7 +89,10 @@
              NO_DEFAULT_PATH)

 set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIR})
-set(MKL_LIBRARIES ${MKL_INTERFACE_LIBRARY} ${MKL_SEQUENTIAL_LAYER_LIBRARY} ${MKL_CORE_LIBRARY})
+# Added -Wl block to avoid circular dependencies.
+# https://stackoverflow.com/questions/5651869/what-are-the-start-group-and-end-group-command-line-options
+# https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
+set(MKL_LIBRARIES -Wl,--start-group ${MKL_INTERFACE_LIBRARY} ${MKL_SEQUENTIAL_LAYER_LIBRARY} ${MKL_CORE_LIBRARY} -Wl,--end-group)

 # message("1 ${MKL_INCLUDE_DIR}")
 # message("2 ${MKL_INTERFACE_LIBRARY}")


Prefer Qt5

Prefer Qt5

--- cmake/FindQwt.cmake
+++ cmake/FindQwt.cmake
@@ -80,7 +80,9 @@

 find_library ( QWT_LIBRARY
-  NAMES qwt qwt-qt3 qwt-qt4 qwt-qt5
+  # KDJ
+  # NAMES qwt qwt-qt3 qwt-qt4 qwt-qt5
+  NAMES qwt-qt5 qwt
   HINTS ${QT_LIBRARY_DIR}
 )


add paddle_protobuf_generate_cpp() Func which could dynamic set RUNTIME_LITE mode for paddle

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -389,13 +389,60 @@
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 endfunction(go_test)

+# Modification of standard 'protobuf_generate_cpp()' with protobuf-lite support
+# Usage:
+#   paddle_protobuf_generate_cpp(<proto_srcs> <proto_hdrs> <proto_files>)
+
+function(paddle_protobuf_generate_cpp SRCS HDRS)
+  if(NOT ARGN)
+    message(SEND_ERROR "Error: paddle_protobuf_generate_cpp() called without any proto files")
+    return()
+  endif()
+
+  set(${SRCS})
+  set(${HDRS})
+
+  if (MOBILE_INFERENCE)
+      set(EXTRA_FLAG "lite:")
+  else()
+      set(EXTRA_FLAG "")
+  endif()
+
+  foreach(FIL ${ARGN})
+    get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+    get_filename_component(FIL_WE ${FIL} NAME_WE)
+
+    set(_protobuf_protoc_src "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
+    set(_protobuf_protoc_hdr "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
+    list(APPEND ${SRCS} "${_protobuf_protoc_src}")
+    list(APPEND ${HDRS} "${_protobuf_protoc_hdr}")
+
+    add_custom_command(
+      OUTPUT "${_protobuf_protoc_src}"
+             "${_protobuf_protoc_hdr}"
+
+      COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}"
+      COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
+      -I${CMAKE_CURRENT_SOURCE_DIR}
+      --cpp_out "${EXTRA_FLAG}${CMAKE_CURRENT_BINARY_DIR}" ${ABS_FIL}
+      DEPENDS ${ABS_FIL} protoc
+      COMMENT "Running C++ protocol buffer compiler on ${FIL}"
+      VERBATIM )
+  endforeach()
+
+  set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
+  set(${SRCS} ${${SRCS}} PARENT_SCOPE)
+  set(${HDRS} ${${HDRS}} PARENT_SCOPE)
+endfunction()
+
+
 function(proto_library TARGET_NAME)
   set(oneValueArgs "")
   set(multiValueArgs SRCS DEPS)
   cmake_parse_arguments(proto_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   set(proto_srcs)
   set(proto_hdrs)
-  protobuf_generate_cpp(proto_srcs proto_hdrs ${proto_library_SRCS})
+  paddle_protobuf_generate_cpp(proto_srcs proto_hdrs ${proto_library_SRCS})
   cc_library(${TARGET_NAME} SRCS ${proto_srcs} DEPS ${proto_library_DEPS} protobuf)
 endfunction()


cmake: adjust headers for recent changes in Chunk I/O

Signed-off-by: Eduardo Silva <81f705dc2ce1a61a2621e0e4b442a9474e1d0c70@calyptia.com>

--- cmake/headers.cmake
+++ cmake/headers.cmake
@@ -8,7 +8,11 @@
   ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_CO}
   ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_RBTREE}
   ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MSGPACK}/include
+
+  # Chunk I/O generate headers also in the binary path
   ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_CHUNKIO}/include
+  ${CMAKE_CURRENT_BINARY_DIR}/lib/chunkio/include
+
   ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_LUAJIT}/src
   ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MONKEY}/include
   ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MONKEY}/include/monkey


fix version.cmake, test=develop (#20606)

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -59,7 +59,8 @@
   endif()
 endwhile()

-string(REPLACE "." ";" PADDLE_VER_LIST ${PADDLE_VERSION})
+string(REPLACE "-" "." PADDLE_VER_LIST ${PADDLE_VERSION})
+string(REPLACE "." ";" PADDLE_VER_LIST ${PADDLE_VER_LIST})
 list(GET PADDLE_VER_LIST 0 PADDLE_MAJOR_VER)
 list(GET PADDLE_VER_LIST 1 PADDLE_MINOR_VER)
 list(GET PADDLE_VER_LIST 2 PADDLE_PATCH_VER)


skip MIC offload test - not supported right now anyway

--- cmake/FindMIC.cmake
+++ cmake/FindMIC.cmake
@@ -56,39 +56,43 @@
 # First check whether offload works

 if(NOT DEFINED c_compiler_can_offload OR NOT DEFINED cxx_compiler_can_offload)
-   include(CheckCSourceCompiles)
-   include(CheckCXXSourceCompiles)
-
-   #find_library(MIC_HOST_IMF_LIBRARY   imf   HINTS ENV LIBRARY_PATH)
-   #find_library(MIC_HOST_SVML_LIBRARY  svml  HINTS ENV LIBRARY_PATH)
-   #find_library(MIC_HOST_INTLC_LIBRARY intlc HINTS ENV LIBRARY_PATH)
-
-   #set(MIC_HOST_LIBS ${MIC_HOST_IMF_LIBRARY} ${MIC_HOST_SVML_LIBRARY} ${MIC_HOST_INTLC_LIBRARY})
-
-   set(_mic_offload_test_source "
-#ifdef __MIC__
-#include <immintrin.h>
-#endif
-__attribute__((target(mic))) void test()
-{
-#ifdef __MIC__
- __m512 v = _mm512_setzero_ps();
- (void)v;
-#endif
-}
-
-int main()
-{
-#pragma offload target(mic)
- test();
- return 0;
-}
-")
-
-   set(CMAKE_REQUIRED_FLAGS "-offload-build")
-   check_c_source_compiles("${_mic_offload_test_source}" c_compiler_can_offload)
-   check_cxx_source_compiles("${_mic_offload_test_source}" cxx_compiler_can_offload)
-   set(CMAKE_REQUIRED_FLAGS)
+   set(c_compiler_can_offload FALSE)
+   set(cxx_compiler_can_offload FALSE)
+
+   # For now offload is not supported so skip it
+#   include(CheckCSourceCompiles)
+#   include(CheckCXXSourceCompiles)
+#
+#   #find_library(MIC_HOST_IMF_LIBRARY   imf   HINTS ENV LIBRARY_PATH)
+#   #find_library(MIC_HOST_SVML_LIBRARY  svml  HINTS ENV LIBRARY_PATH)
+#   #find_library(MIC_HOST_INTLC_LIBRARY intlc HINTS ENV LIBRARY_PATH)
+#
+#   #set(MIC_HOST_LIBS ${MIC_HOST_IMF_LIBRARY} ${MIC_HOST_SVML_LIBRARY} ${MIC_HOST_INTLC_LIBRARY})
+#
+#   set(_mic_offload_test_source "
+##ifdef __MIC__
+##include <immintrin.h>
+##endif
+#__attribute__((target(mic))) void test()
+#{
+##ifdef __MIC__
+# __m512 v = _mm512_setzero_ps();
+# (void)v;
+##endif
+#}
+#
+#int main()
+#{
+##pragma offload target(mic)
+# test();
+# return 0;
+#}
+#")
+#
+#   set(CMAKE_REQUIRED_FLAGS "-offload-build")
+#   check_c_source_compiles("${_mic_offload_test_source}" c_compiler_can_offload)
+#   check_cxx_source_compiles("${_mic_offload_test_source}" cxx_compiler_can_offload)
+#   set(CMAKE_REQUIRED_FLAGS)
 endif()

 if(c_compiler_can_offload AND cxx_compiler_can_offload)


Use 64-bit for xlC

Use 64-bit for xlC

--- Common.cmake
+++ Common.cmake
@@ -77,9 +77,10 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
   endif()
 elseif(CMAKE_COMPILER_IS_XLCXX)
-  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -qnosmp")
-  set(CMAKE_CC_FLAGS_DEBUG "${CMAKE_CC_FLAGS_DEBUG} -qnosmp")
-  set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -qsmp")
+  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -qnosmp -q64")
+  set(CMAKE_CC_FLAGS_DEBUG "${CMAKE_CC_FLAGS_DEBUG} -qnosmp -q64")
+  set(CMAKE_SHARED_LINKER_FLAGS_DEBUG
+	 "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -qsmp -q64")
 endif()

 if(MSVC)


Fix warning

Fix warning

--- Common.cmake
+++ Common.cmake
@@ -113,6 +113,12 @@
     /wd4244 # conversion from X to Y, possible loss of data
     /wd4800 # forcing value to bool 'true' or 'false' (performance warning)
     )
+
+  # By default, do not warn when built on machines using only VS Express
+  # http://cmake.org/gitweb?p=cmake.git;a=commit;h=fa4a3b04d0904a2e93242c0c3dd02a357d337f77
+  if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+      SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+  endif()

   # http://www.ogre3d.org/forums/viewtopic.php?f=2&t=60015&start=0
   if(RELEASE_VERSION)


cmake: Remove obsolete code

cmake: Remove obsolete code

Starting with CMake 3.5, cmake_parse_arguments() became a naive command.


Fix Win32 build concerning unknown pragmas

--- Common.cmake
+++ Common.cmake
@@ -100,6 +100,7 @@
   add_definitions(
     /D_CRT_SECURE_NO_WARNINGS
     /D_SCL_SECURE_NO_WARNINGS
+    /wd4068 # disable unknown pragma warnings
     /wd4244 # conversion from X to Y, possible loss of data
     /wd4800 # forcing value to bool 'true' or 'false' (performance warning)
     )


modules: updated FindMagnumExtras.cmake.

--- modules/FindMagnumExtras.cmake
+++ modules/FindMagnumExtras.cmake
@@ -14,6 +14,7 @@
 #
 #  Ui                       - Ui library
 #  ui-gallery               - magnum-ui-gallery executable
+#  player                   - magnum-player executable
 #
 # Example usage with specifying additional components is:
 #
@@ -94,7 +95,7 @@
 # Component distinction (listing them explicitly to avoid mistakes with finding
 # components from other repositories)
 set(_MAGNUMEXTRAS_LIBRARY_COMPONENT_LIST Ui)
-set(_MAGNUMEXTRAS_EXECUTABLE_COMPONENT_LIST ui-gallery)
+set(_MAGNUMEXTRAS_EXECUTABLE_COMPONENT_LIST player ui-gallery)

 # Inter-component dependencies
 set(_MAGNUMEXTRAS_ui-gallery_DEPENDENCIES Ui)


additional work on nightly.cmake script to get automatic merging of dev->master

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -273,10 +273,10 @@

 # Main code !
 ctest_start(${CTEST_TEST_TYPE})
-ctest_update()
-ctest_configure()
-ctest_build()
-ctest_test()
+#ctest_update()
+#ctest_configure()
+#ctest_build()
+#ctest_test()

 SET(CONFIGURE_OPTIONS
   "-DCMAKE_C_COMPILER:FILEPATH=mpicc"
@@ -292,14 +292,14 @@

 SET(BUILD_TYPES "Release;Debug")

-#setup_repo()
-
-#foreach(BRANCH IN LISTS BRANCHES)
-#  foreach(BUILD IN LISTS BUILD_TYPES)
-#    check_tracking_branch("${BRANCH}"
-#      "${CONFIGURE_OPTIONS} -DCMAKE_BUILD_TYPE=${BUILD}"
-#      CHECK_ERR)
-#  endforeach()
-#endforeach()
+setup_repo()
+
+foreach(BRANCH IN LISTS BRANCHES)
+  foreach(BUILD IN LISTS BUILD_TYPES)
+    check_tracking_branch("${BRANCH}"
+      "${CONFIGURE_OPTIONS} -DCMAKE_BUILD_TYPE=${BUILD}"
+      CHECK_ERR)
+  endforeach()
+endforeach()

 try_merge(master develop "${CONFIGURE_OPTIONS}" ${ALLOWED_WARNINGS})


TRA: ensure absolute paths for translations input files

--- CMake/i18n_qt4.cmake
+++ CMake/i18n_qt4.cmake
@@ -7,8 +7,14 @@
 #
 # Set locale human-readable translation files.
 macro( add_to_qt4_i18n_sources SOURCE_FILES )
-  set( Monteverdi2_I18N_SOURCE_FILES
-    ${Monteverdi2_I18N_SOURCE_FILES} ${ARGV}
-    CACHE INTERNAL "" FORCE
-    )
+
+  foreach(SOURCE_FILE ${ARGV})
+    get_filename_component( ABS_SOURCE_FILE ${SOURCE_FILE} ABSOLUTE )
+    message("ABS_SOURCE_FILE ${ABS_SOURCE_FILE}")
+    set( Monteverdi2_I18N_SOURCE_FILES
+      ${Monteverdi2_I18N_SOURCE_FILES} ${ABS_SOURCE_FILE}
+      CACHE INTERNAL "" FORCE
+      )
+  endforeach()
+
 endmacro()


Use lowercase for internal variables

Use lowercase for internal variables

--- src/vistk/pipeline/thread_naming.cmake
+++ src/vistk/pipeline/thread_naming.cmake
@@ -6,17 +6,17 @@
 if (CMAKE_USE_PTHREADS_INIT)
   cmake_push_check_state()
   set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
-  check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
-  check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP)
+  check_function_exists(pthread_setname_np have_pthread_setname_np)
+  check_function_exists(pthread_set_name_np have_pthread_set_name_np)
   cmake_pop_check_state()

-  if (HAVE_PTHREAD_SETNAME_NP OR HAVE_PTHREAD_SET_NAME_NP)
+  if (have_pthread_setname_np OR have_pthread_set_name_np)
     set(thread_naming_defines
       ${thread_naming_defines}
       HAVE_PTHREAD_NAMING)
   endif ()

-  if (HAVE_PTHREAD_SETNAME_NP)
+  if (have_pthread_setname_np)
     set(thread_naming_defines
       ${thread_naming_defines}
       HAVE_PTHREAD_SETNAME_NP)
@@ -41,20 +41,20 @@
   return EXIT_SUCCESS;
 }
 ")
-    try_compile(PTHREAD_SETNAME_NP_TAKES_ID
+    try_compile(pthread_setname_np_takes_id
       "${cmakefiles_dir}/pthread_setname_np_takes_id"
       "${pthread_setname_np_takes_id_path}"
       CMAKE_FLAGS
         "-DLINK_LIBRARIES=${CMAKE_THREAD_LIBS_INIT}")

-    if (PTHREAD_SETNAME_NP_TAKES_ID)
+    if (pthread_setname_np_takes_id)
       set(thread_naming_defines
         ${thread_naming_defines}
         PTHREAD_SETNAME_NP_TAKES_ID)
     endif ()
   endif ()

-  if (HAVE_PTHREAD_SET_NAME_NP)
+  if (have_pthread_set_name_np)
     set(thread_naming_defines
       ${thread_naming_defines}
       HAVE_PTHREAD_SET_NAME_NP)
@@ -62,10 +62,10 @@
 endif ()

 cmake_push_check_state()
-check_function_exists(setproctitle HAVE_SETPROCTITLE)
+check_function_exists(setproctitle have_setproctitle)
 cmake_pop_check_state()

-if (HAVE_SETPROCTITLE)
+if (have_setproctitle)
   set(thread_naming_defines
     ${thread_naming_defines}
     HAVE_SETPROCTITLE)


Removed -pthread build flag

Removed -pthread build flag

--- config/config.cmake
+++ config/config.cmake
@@ -58,7 +58,7 @@
     SET(LIBS ${LIBS} "dl pthread")
   ELSE(CLANG)
     SET(LIBS ${LIBS} "dl")
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   ENDIF(CLANG)
 ENDIF(WIN32)


Sync with kdelibs cmake module

Sync with kdelibs cmake module

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

--- cmake/FindQt4.cmake
+++ cmake/FindQt4.cmake
@@ -73,6 +73,7 @@
 #  QT_QTSQL_FOUND         True if QtSql was found.
 #  QT_QTXML_FOUND         True if QtXml was found.
 #  QT_QTSVG_FOUND         True if QtSvg was found.
+#  QT_QTSCRIPT_FOUND      True if QtScript was found.
 #  QT_QTTEST_FOUND        True if QtTest was found.
 #  QT_QTUITOOLS_FOUND     True if QtUiTools was found.
 #
@@ -100,6 +101,7 @@
 #  QT_QTSQL_INCLUDE_DIR        Path to "include/QtSql"
 #  QT_QTXML_INCLUDE_DIR        Path to "include/QtXml"
 #  QT_QTSVG_INCLUDE_DIR        Path to "include/QtSvg"
+#  QT_QTSCRIPT_INCLUDE_DIR     Path to "include/QtScript"
 #  QT_QTTEST_INCLUDE_DIR       Path to "include/QtTest"
 #
 #  QT_LIBRARY_DIR              Path to "lib" of Qt4
@@ -136,6 +138,8 @@
 # The QtXml library:          QT_QTXML_LIBRARY
 #
 # The QtSvg library:          QT_QTSVG_LIBRARY
+#
+# The QtScript library:       QT_QTSCRIPT_LIBRARY
 #
 # The QtTest library:         QT_QTTEST_LIBRARY
 #
@@ -429,6 +433,14 @@
     NO_DEFAULT_PATH
     )

+  # Set QT_QTSVG_INCLUDE_DIR
+  FIND_PATH(QT_QTSCRIPT_INCLUDE_DIR QtScript
+    PATHS
+    ${QT_INCLUDE_DIR}/QtScript
+    ${QT_LIBRARY_DIR}/QtScript.framework/Headers
+    NO_DEFAULT_PATH
+    )
+
   # Set QT_QTTEST_INCLUDE_DIR
   FIND_PATH(QT_QTTEST_INCLUDE_DIR QtTest
     PATHS
@@ -549,6 +561,7 @@
     SET(QT_QTSQL_LIBRARY      "-framework QtSql"      CACHE STRING "The QtSql library.")
     SET(QT_QTXML_LIBRARY      "-framework QtXml"      CACHE STRING "The QtXml library.")
     SET(QT_QTSVG_LIBRARY      "-framework QtSvg"      CACHE STRING "The QtSvg library.")
+    SET(QT_QTSCRIPT_LIBRARY   "-framework QtScript"   CACHE STRING "The QtScript library.")
     SET(QT_QTDBUS_LIBRARY     "-framework QtDBus"     CACHE STRING "The QtDBus library.")
     SET(QT_QTTEST_LIBRARY     "-framework QtTest"     CACHE STRING "The QtTest library.")

@@ -558,44 +571,47 @@
   ELSE (QT_USE_FRAMEWORKS)

     # Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore."  as part of the filename
-    FIND_LIBRARY(QT_QTCORE_LIBRARY NAMES QtCore QtCore4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )
+    FIND_LIBRARY(QT_QTCORE_LIBRARY NAMES QtCore QtCore4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )

     # Set QT_QT3SUPPORT_LIBRARY
-    FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTGUI_LIBRARY
-    FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTMOTIF_LIBRARY
     IF(Q_WS_X11)
-      FIND_LIBRARY(QT_QTMOTIF_LIBRARY NAMES QtMotif PATHS ${QT_LIBRARY_DIR}       NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTMOTIF_LIBRARY NAMES QtMotif              PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
     ENDIF(Q_WS_X11)

     # Set QT_QTNETWORK_LIBRARY
-    FIND_LIBRARY(QT_QTNETWORK_LIBRARY NAMES QtNetwork QtNetwork4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTNETWORK_LIBRARY NAMES QtNetwork QtNetwork4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTNSPLUGIN_LIBRARY
-    FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY NAMES QtNsPlugin PATHS ${QT_LIBRARY_DIR}       NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY NAMES QtNsPlugin          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTOPENGL_LIBRARY
-    FIND_LIBRARY(QT_QTOPENGL_LIBRARY NAMES QtOpenGL QtOpenGL4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTOPENGL_LIBRARY NAMES QtOpenGL QtOpenGL4    PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTSQL_LIBRARY
-    FIND_LIBRARY(QT_QTSQL_LIBRARY NAMES QtSql QtSql4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTSQL_LIBRARY NAMES QtSql QtSql4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTXML_LIBRARY
-    FIND_LIBRARY(QT_QTXML_LIBRARY NAMES QtXml QtXml4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTXML_LIBRARY NAMES QtXml QtXml4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTSVG_LIBRARY
-    FIND_LIBRARY(QT_QTSVG_LIBRARY NAMES QtSvg QtSvg4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTSVG_LIBRARY NAMES QtSvg QtSvg4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+    # Set QT_QTSCRIPT_LIBRARY
+    FIND_LIBRARY(QT_QTSCRIPT_LIBRARY NAMES QtScript QtScript4    PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTUITOOLS_LIBRARY
-    FIND_LIBRARY(QT_QTUITOOLS_LIBRARY NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTUITOOLS_LIBRARY NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTTEST_LIBRARY
-    FIND_LIBRARY(QT_QTTEST_LIBRARY NAMES QtTest QtTest4 PATHS ${QT_LIBRARY_DIR}                      NO_DEFAULT_PATH)
-
-    FIND_LIBRARY(QT_QTDBUS_LIBRARY NAMES QtDBus QtDBus4 PATHS ${QT_LIBRARY_DIR}                      NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTTEST_LIBRARY NAMES QtTest QtTest4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+    FIND_LIBRARY(QT_QTDBUS_LIBRARY NAMES QtDBus QtDBus4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     IF(MSVC)
       FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG      NAMES QtCored4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
@@ -606,6 +622,7 @@
       FIND_LIBRARY(QT_QTSQL_LIBRARY_DEBUG       NAMES QtSqld4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTXML_LIBRARY_DEBUG       NAMES QtXmld4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTSVG_LIBRARY_DEBUG       NAMES QtSvgd4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_DEBUG    NAMES QtScriptd4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_DEBUG   NAMES QtUiToolsd QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTTEST_LIBRARY_DEBUG      NAMES QtTestd4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTDBUS_LIBRARY_DEBUG      NAMES QtDBusd4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
@@ -693,6 +710,7 @@
   _QT4_ADJUST_LIB_VARS(QTSQL)
   _QT4_ADJUST_LIB_VARS(QTXML)
   _QT4_ADJUST_LIB_VARS(QTSVG)
+  _QT4_ADJUST_LIB_VARS(QTSCRIPT)
   _QT4_ADJUST_LIB_VARS(QTUITOOLS)
   _QT4_ADJUST_LIB_VARS(QTTEST)
   _QT4_ADJUST_LIB_VARS(QTDBUS)
@@ -705,7 +723,10 @@
   IF(WIN32)
     _QT4_ADJUST_LIB_VARS(QTMAIN)
   ENDIF(WIN32)
-
+
+  IF(QT_QTSCRIPT_LIBRARY AND QT_QTUITOOLS_LIBRARY)
+    SET(QT_QTUITOOLS_LIBRARY ${QT_QTUITOOLS_LIBRARY} ${QT_QTSCRIPT_LIBRARY} )
+  ENDIF(QT_QTSCRIPT_LIBRARY AND QT_QTUITOOLS_LIBRARY)

   #######################################
   #
@@ -850,10 +871,11 @@
       SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
       #  parse file for dependencies
       FILE(READ "${infile}" _RC_FILE_CONTENTS)
-      STRING(REGEX MATCHALL "<file>[^<]*" _RC_FILES "${_RC_FILE_CONTENTS}")
+      STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
+
       SET(_RC_DEPENDS)
       FOREACH(_RC_FILE ${_RC_FILES})
-        STRING(REGEX REPLACE "^<file>" "" _RC_FILE "${_RC_FILE}")
+        STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
         SET(_RC_DEPENDS ${_RC_DEPENDS} "${rc_path}/${_RC_FILE}")
       ENDFOREACH(_RC_FILE)
       ADD_CUSTOM_COMMAND(OUTPUT ${outfile}


Issue #18: Always use Eigen from source dir.

--- CMake/ExternalProjects/Eigen.cmake
+++ CMake/ExternalProjects/Eigen.cmake
@@ -42,6 +42,7 @@
     #CONFIGURE_COMMAND ""
     UPDATE_COMMAND ""
     BUILD_COMMAND ""
+    INSTALL_COMMAND ""
     CMAKE_GENERATOR ${gen}
     CMAKE_ARGS
       ${EP_COMMON_ARGS}
@@ -54,18 +55,8 @@
     DEPENDS ${proj_DEPENDENCIES}
   )

-  if(BUILD_PCL)
-    # We want to use the 'unsupported' folder, which is never installed.
-    # Then we must be consistently passing the same folder to PCL, and the project level build.
-    set(Eigen_DIR ${proj_SOURCE})
-    set(Eigen_INCLUDE_DIR ${proj_SOURCE})
-  else()
-    set(Eigen_DIR ${proj_INSTALL})
-    set(Eigen_INCLUDE_DIR ${Eigen_DIR}/include/eigen3)
-    set(MYPROJECT_PREFIX_PATH ${proj_INSTALL}^^${MYPROJECT_PREFIX_PATH})
-  endif()
-
-  mitkFunctionInstallExternalCMakeProject(${proj})
+  set(Eigen_DIR ${proj_SOURCE})
+  set(Eigen_INCLUDE_DIR ${proj_SOURCE})

   message("SuperBuild loading Eigen from ${Eigen_DIR} with Eigen_INCLUDE_DIR=${Eigen_INCLUDE_DIR}.")


Patch ITK to fix LandmarkBasedTransformInitializer

This fix is already included in ITK v4 and required
by XDLFL

--- CMakeExternals/PatchITK-3.20.cmake
+++ CMakeExternals/PatchITK-3.20.cmake
@@ -1,7 +1,8 @@
 # Called by ITK.cmake (ExternalProject_Add) as a patch for ITK to work witk GDCM 2.0.18
-# Updates library dependencies

-# read whole file
+# First patch
+# updates library dependencies
+# read whole file CMakeLists.txt
 file(STRINGS CMakeLists.txt sourceCode NEWLINE_CONSUME)

 # substitute dependency to gdcmMSFF by dependencies for more libraries
@@ -11,3 +12,14 @@
 set(CONTENTS ${sourceCode})
 configure_file(${TEMPLATE_FILE} CMakeLists.txt @ONLY)

+# second patch
+# read whole file
+file(STRINGS Code/Common/itkLandmarkBasedTransformInitializer.h sourceCode2 NEWLINE_CONSUME)
+
+# substitute dependency to gdcmMSFF by dependencies for more libraries
+string(REGEX REPLACE "typedef typename ParametersType::ValueType +ParameterValueType;" "typedef typename TransformType::ScalarType                      ParameterValueType;" sourceCode2 ${sourceCode2})
+
+# set variable CONTENTS, which is substituted in TEMPLATE_FILE
+set(CONTENTS ${sourceCode2})
+configure_file(${TEMPLATE_FILE} Code/Common/itkLandmarkBasedTransformInitializer.h @ONLY)
+


Added lib64 to search path for OpenThreads

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@6354 16af8721-9629-0410-8352-f15c8da7e697

--- CMakeModules/FindOpenThreads.cmake
+++ CMakeModules/FindOpenThreads.cmake
@@ -46,7 +46,9 @@
 	$ENV{OSG_DIR}/lib
 	~/Library/Frameworks
 	/Library/Frameworks
+	/usr/local/lib64
 	/usr/local/lib
+	/usr/lib64
 	/usr/lib
 	/sw/lib
 	/opt/local/lib
@@ -58,6 +60,6 @@
 SET(OPENTHREADS_FOUND "NO")
 IF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)
 	SET(OPENTHREADS_FOUND "YES")
+        MESSAGE("---Found OpenThreads: "${OPENTHREADS_LIBRARY})
 ENDIF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)

-


Fixing install script

Fixing install script

--- CMakeModules/install/windows.cmake
+++ CMakeModules/install/windows.cmake
@@ -55,21 +55,21 @@
 	CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel
 )
 # SDK: Hydrax headers
-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/Hydrax/src
+install(DIRECTORY ${CMAKE_BINARY_DIR}/Dependencies/src/Hydrax
 	DESTINATION ${PREFIX}/sdk/dependencies/include
 	CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel
 	PATTERN "*.cpp" EXCLUDE
 	PATTERN "CMakeLists.txt" EXCLUDE
 )
 # SDK: SkyX headers
-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/SkyX
+install(DIRECTORY ${CMAKE_BINARY_DIR}/Dependencies/src/SkyX
 	DESTINATION ${PREFIX}/sdk/dependencies/include
 	CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel
 	PATTERN "*.cpp" EXCLUDE
 	PATTERN "CMakeLists.txt" EXCLUDE
 )
 # SDK: PagedGeometry headers
-FILE(GLOB pg_headers "${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/PagedGeometry/include/*.h")
+FILE(GLOB pg_headers "${CMAKE_BINARY_DIR}/Dependencies/src/Pagedgeometry/include/*.h")
 install(FILES ${pg_headers}
 	DESTINATION ${PREFIX}/sdk/dependencies/include/OFS
 	CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel
@@ -91,7 +91,7 @@
 	PATTERN "CMakeLists.txt" EXCLUDE
 )
 # SDK: Caelum headers
-FILE(GLOB caelum_headers "${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/Caelum-0.5.0/main/include/*.h")
+FILE(GLOB caelum_headers "${CMAKE_BINARY_DIR}/Dependencies/src/Caelum/include/*.h")
 install(FILES ${caelum_headers}
 	DESTINATION ${PREFIX}/sdk/dependencies/include/Caelum-0.5.0
 	CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel


qt4.cmake: Added a comment about why we must use framework builds on mac.

--- qt4.cmake
+++ qt4.cmake
@@ -44,7 +44,15 @@
         --prefix=${BUILDEM_DIR}
         -opensource
         -arch x86_64
-        -optimized-qmake
+        -optimized-qmake
+        #-no-framework # Intentionally omitted.
+                       # On Mac, Qt is built as a "framework" by default.  It would be nice if we could build it as a non-framework,
+                       # since other cross-platform packages (e.g. qimage2ndarray) usually assume a non-framework directory tree.
+                       # Unfortunately, we must build as a framework.
+                       # Normally when OSX finds two versions of the same .dylib on the system, it loads only one of them and ignores the other.
+                       # However, OSX doesn't seem to recognize that two dylibs with the SAME NAME shouldn't be loaded simultaneously if one of them is part of a framework and the other isn't.
+                       # This means that if the user already has a QT framework installation on his system somewhere, then installing a non-framework build on his system will lead to weirdness.
+                       # If we just build QT as a framework, then OSX knows not to load both sets of dylibs.
         -nomake examples
         -nomake demos
         -nomake docs


SunRPC is being removed from glibc, so use tirpc when installed

--- deps/sigar.cmake
+++ deps/sigar.cmake
@@ -29,8 +29,8 @@
     MESSAGE("Windows Arch Unknown")
   ENDIF()

-  ## make sure we only use the smallest set of
-  ## headers on win32. Otherwise we get clashes
+  ## make sure we only use the smallest set of
+  ## headers on win32. Otherwise we get clashes
   ## between winsock2.h and winsock.h
   ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
   ADD_DEFINITIONS(-DWIN32)
@@ -74,6 +74,12 @@
   SET(SIGAR_SRC ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/src/os/linux/linux_sigar.c)

   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/src/os/linux/)
+
+  IF(EXISTS /usr/include/tirpc)
+    INCLUDE_DIRECTORIES(/usr/include/tirpc)
+
+    SET(EXTRA_LIBS ${EXTRA_LIBS} -ltirpc)
+  ENDIF(EXISTS /usr/include/tirpc)
 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")

 ## macosx, freebsd
@@ -140,22 +146,22 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/src/sigar_ptql.c
   ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/src/sigar_signal.c
   ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/src/sigar_util.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-cpu.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-disk.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-fs.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-load.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-mem.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-netif.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-proc.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-swap.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-sysinfo.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-test.lua
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-who.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-cpu.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-disk.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-fs.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-load.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-mem.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-netif.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-proc.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-swap.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-sysinfo.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-test.lua
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar-who.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/deps/lua-sigar/deps/sigar/bindings/lua/sigar.c
 )

 ADD_LIBRARY(sigar STATIC ${SIGAR_SRC})

 IF(SIGAR_LINK_FLAGS)
   SET_TARGET_PROPERTIES(sigar PROPERTIES LINK_FLAGS "${SIGAR_LINK_FLAGS}")
-ENDIF(SIGAR_LINK_FLAGS)
+ENDIF(SIGAR_LINK_FLAGS)


Make sub project tag overridable

Make sub project tag overridable

--- SubProject.cmake
+++ SubProject.cmake
@@ -81,6 +81,10 @@
 macro(git_subproject name url tag)
   if(NOT BUILDYARD AND NOT DISABLE_SUBPROJECTS)
     string(TOUPPER ${name} NAME)
+    set(TAG ${tag})
+    if(SUBPROJECT_TAG)
+      set(TAG ${SUBPROJECT_TAG})
+    endif()
     if(NOT ${NAME}_FOUND)
       get_property(__included GLOBAL PROPERTY ${name}_IS_SUBPROJECT)
       if(NOT EXISTS ${CMAKE_SOURCE_DIR}/${name})
@@ -89,7 +93,7 @@
         find_package(${name} QUIET CONFIG HINTS ${CMAKE_BINARY_DIR}/${NAME})
       endif()
       if(NOT ${NAME}_FOUND)
-        git_external(${CMAKE_SOURCE_DIR}/${name} ${url} ${tag})
+        git_external(${CMAKE_SOURCE_DIR}/${name} ${url} ${TAG})
         add_subproject(${name})
         find_package(${name} REQUIRED CONFIG) # find subproject "package"
         include_directories(${${NAME}_INCLUDE_DIRS})


Only set -stdlib if OSX_DEPLOYMENT_TARGET is defined...

--- standard/StandardProject.cmake
+++ standard/StandardProject.cmake
@@ -100,7 +100,7 @@

   #CMAKE_OSX_DEPLOYMENT_TARGET < 10.9 implies -stdlib=libstdc++, which doesn't have
   #complete c++11 support. override with libc++
-  if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.9)
+  if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.9)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" PARENT_SCOPE)
   endif()


CMake on OS X - symlink the frameworks into each .app to make them pseudo-local (real apps would copy)

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%40682

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -130,9 +130,25 @@
     set_property(TARGET ${SAMPLENAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
   endif ()

-  # On OS X, create .app bundle
   if (APPLE)
+    # On OS X, create .app bundle
     set_property(TARGET ${SAMPLENAME} PROPERTY MACOSX_BUNDLE TRUE)
+    # also, symlink frameworks so .app is standalone
+    # NOTE: $(CONFIGURATION) is not resolvable at CMake run time, it's only
+    # valid at build time (hence parenthesis rather than braces)
+    set (OGRE_SAMPLE_CONTENTS_PATH
+      ${CMAKE_BINARY_DIR}/bin/$(CONFIGURATION)/${SAMPLENAME}.app/Contents)
+    add_custom_command(TARGET ${SAMPLENAME} POST_BUILD
+      COMMAND mkdir ARGS -p ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks
+      COMMAND ln ARGS -s -f ${CMAKE_BINARY_DIR}/lib/$(CONFIGURATION)/Ogre.framework
+        ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
+      COMMAND ln ARGS -s -f ${CMAKE_SOURCE_DIR}/Dependencies/Cg.framework
+        ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
+      COMMAND ln ARGS -s -f ${CMAKE_SOURCE_DIR}/Dependencies/CEGUI.framework
+        ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
+    )
+
+
   endif ()

   if (OGRE_INSTALL_SAMPLES)


Fix install of tools PDBs in debug mode

Fix install of tools PDBs in debug mode

--HG--
branch : v1-7

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -363,7 +363,7 @@
     ogre_install_target(${TOOLNAME} "" FALSE)
     if (OGRE_INSTALL_PDB)
       # install debug pdb files
-      install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${TOOLNAME}.pdb
+      install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${TOOLNAME}_d.pdb
         DESTINATION bin${OGRE_DEBUG_PATH}
         CONFIGURATIONS Debug
         )


build: adapt spidermonkey threading test to avoid compiler optimisations

--- CMakeModules/FindSpidermonkey.cmake
+++ CMakeModules/FindSpidermonkey.cmake
@@ -78,9 +78,11 @@
         SET(CMAKE_REQUIRED_DEFINITIONS ${SPIDERMONKEY_DEFINITIONS})
         SET(CMAKE_REQUIRED_LIBRARIES ${SPIDERMONKEY_LIBRARY})
         CHECK_CXX_SOURCE_RUNS(
-            "extern \"C\" void js_GetCurrentThread();
+            "#include <stdio.h>
+             extern \"C\" void js_GetCurrentThread();
              int main() {
-                 return ((void*)js_GetCurrentThread) != 0 ? 0 : 1;
+                 printf(\"%p\", (void*)js_GetCurrentThread);
+                 return (void*)js_GetCurrentThread ? 0 : 1;
              }"
             SPIDERMONKEY_THREADSAFE)


double down

double down

--- cmake/FindCOIN.cmake
+++ cmake/FindCOIN.cmake
@@ -151,8 +151,9 @@
     ENDIF(COIN_BZ2_LIBRARY)
     # Not required by cbc v2.5, but required by later versions in which case,
     # the lower line should be commented out and this line used
-    #SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
-    SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES};${COIN_OSI_CBC_LIBRARY}")
+    SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
+    #SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES};${COIN_OSI_CBC_LIBRARY}")
+    SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARIES};${COIN_CBC_LIBRARIES}")
     #SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
     SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
 ENDIF(COIN_FOUND)


Update GLFW find script

Update GLFW find script

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -1,8 +1,9 @@

 # GLFW_FOUND
 # GLFW_INCLUDE_DIR
-# GLFW_LIBRARY
-
+# GLFW_LIBRARY_RELEASE
+# GLFW_LIBRARY_DEBUG
+# GLFW_LIBRARIES
 # GLFW_BINARY (win32 only)

 include(FindPackageHandleStandardArgs)
@@ -27,6 +28,9 @@

 find_library(GLFW_LIBRARY_RELEASE NAMES glfw3 glfw glfw3dll glfwdll

+    HINTS
+    ${GLFW_INCLUDE_DIR}/..
+
     PATHS
     $ENV{GLFW_DIR}
     /lib/x64
@@ -50,6 +54,9 @@
     DOC "The GLFW library")

 find_library(GLFW_LIBRARY_DEBUG NAMES glfw3d glfwd glfw3ddll glfwddll
+
+    HINTS
+    ${GLFW_INCLUDE_DIR}/..

     PATHS
     $ENV{GLFW_DIR}
@@ -107,6 +114,7 @@
 if(APPLE)
     set(GLFW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
     set(GLFW_iokit_LIBRARY "-framework IOKit" CACHE STRING "IOKit framework for OSX")
+    set(GLFW_corevideo_LIBRARY "-framework CoreVideo" CACHE STRING "CoreVideo framework for OSX")
 endif()

 # GLFW is required to link statically for now (no deploy specified)


fix message

fix message

--HG--
branch : v0-8

--- cmake/FindOgre.cmake
+++ cmake/FindOgre.cmake
@@ -214,7 +214,7 @@
             endif ()
         endif ()
         if (NOT OGRE_DEPS_FOUND)
-            pkg_message(OGRE "Could not find all required dependencies for the Ogre package.")
+            message(status "Could not find all required dependencies for the Ogre package.")
             set(OGRE_FOUND FALSE)
         endif ()
     endif()


Fix Skia flag for Windows (SK_BUILD_FOR_WIN)

--- cmake/FindSkia.cmake
+++ cmake/FindSkia.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2019-2021  Igara Studio S.A.
+# Copyright (C) 2019-2022  Igara Studio S.A.
 #
 # This file is released under the terms of the MIT license.
 # Read LICENSE.txt for more information.
@@ -65,7 +65,7 @@

 if(WIN32)
   target_compile_definitions(skia INTERFACE
-    SK_BUILD_FOR_WIN32
+    SK_BUILD_FOR_WIN
     _CRT_SECURE_NO_WARNINGS)
 elseif(APPLE)
   target_compile_definitions(skia INTERFACE


fix message call

fix message call

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -51,7 +51,7 @@
          message(STATUS "GCC Version from --version: ${VC_GCC_VERSION}")
       endif()
    else()
-      message(ERROR "Unsupported Compiler for use with Vc.\nPlease fill out the missing parts in the CMake scripts and submit a patch to http://code.compeng.uni-frankfurt.de/projects/vc")
+      message(FATAL_ERROR "Unsupported Compiler for use with Vc.\nPlease fill out the missing parts in the CMake scripts and submit a patch to http://code.compeng.uni-frankfurt.de/projects/vc")
    endif()
 endmacro()


Add defines for asan/tsan builds. (#212)

--- cmake/bde_ufid.cmake
+++ cmake/bde_ufid.cmake
@@ -355,6 +355,13 @@
             $<${bde_ufid_is_safe2}:
                 BDE_BUILD_TARGET_SAFE_2
                 BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
+            >
+
+            $<${bde_ufid_is_asan}:
+                BDE_BUILD_TARGET_ASAN
+            >
+            $<${bde_ufid_is_tsan}:
+                BDE_BUILD_TARGET_TSAN
             >

             $<${bde_ufid_is_aopt}:
@@ -588,6 +595,13 @@
                 _STLP_EXTRA_OPERATORS_FOR_DEBUG=1
             >

+            $<${bde_ufid_is_asan}:
+                BDE_BUILD_TARGET_ASAN
+            >
+            $<${bde_ufid_is_tsan}:
+                BDE_BUILD_TARGET_TSAN
+            >
+
             $<${bde_ufid_is_aopt}:
                 BSLS_ASSERT_LEVEL_ASSERT_OPT
             >


fptu: '-Wno-invalid-offsetof' only for GCC < 5.x

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -462,11 +462,10 @@
     add_compile_flags("C;CXX" "-Wextra")
   endif()

-  if(CMAKE_COMPILER_IS_GNUCXX)
+  if(CMAKE_COMPILER_IS_GNUCXX
+      AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
     # G++ bug. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31488
-    add_compile_flags("CXX"
-      "-Wno-invalid-offsetof"
-      )
+    add_compile_flags("CXX" "-Wno-invalid-offsetof")
   endif()

   add_definitions("-D__STDC_FORMAT_MACROS=1")


ENH: updating dashboard name

ENH: updating dashboard name

to reflect updated Ubuntu and new gcc version

--- Testing/Dashboard/pxDashboard_LKEB_linux64_gcc.cmake
+++ Testing/Dashboard/pxDashboard_LKEB_linux64_gcc.cmake
@@ -11,14 +11,14 @@
 # and defaults to Nightly.
 # NOTE that Model should directly follow the comma: no space allowed!
 #
-# Setup: Linux 64bit, Ubuntu 2.6.32-25-server
-# gcc 4.4.3
-# Debug mode, ITK 4.0.0, code coverage by gcov
+# Setup: Linux 64bit, Ubuntu 3.2.0-34-generic
+# gcc 4.6.3
+# Debug mode, ITK 4.x (git), code coverage by gcov
 # PC: LKEB (MS), goliath

 # Client maintainer: m.staring@lumc.nl
 set( CTEST_SITE "LKEB.goliath" )
-set( CTEST_BUILD_NAME "Linux-64bit-gcc4.4.3" )
+set( CTEST_BUILD_NAME "Linux-64bit-gcc4.6.3" )
 set( CTEST_BUILD_FLAGS "-j6" ) # parallel build for makefiles
 set( CTEST_TEST_ARGS PARALLEL_LEVEL 6 ) # parallel testing
 set( CTEST_BUILD_CONFIGURATION Debug )


Mac: lua scripts added to bundle

Mac: lua scripts added to bundle

--- Mac/projectDef.cmake
+++ Mac/projectDef.cmake
@@ -17,8 +17,14 @@

 file( GLOB LIBVLC_LIB ${VLC_PATH}/lib/[^.]*.dylib )
 file( GLOB LIBVLC_PLUGINS ${VLC_PATH}/plugins/[^.]*.dylib )
+file( GLOB LIBVLC_LUA_EXTENSIONS ${VLC_PATH}/share/lua/extensions/[^.]*.luac )
+file( GLOB LIBVLC_LUA_MODULES ${VLC_PATH}/share/lua/modules/[^.]*.luac )
+file( GLOB LIBVLC_LUA_PLAYLIST ${VLC_PATH}/share/lua/playlist/[^.]*.luac )

-set( LIBVLC ${LIBVLC_LIB} ${LIBVLC_PLUGINS} )
+set( LIBVLC
+     ${LIBVLC_LIB} ${LIBVLC_PLUGINS}
+     ${LIBVLC_LUA_EXTENSIONS} ${LIBVLC_LUA_MODULES} ${LIBVLC_LUA_PLAYLIST}
+)

 set_source_files_properties(
     ${LIBVLC_LIB}
@@ -30,6 +36,24 @@
     ${LIBVLC_PLUGINS}
     PROPERTIES
     MACOSX_PACKAGE_LOCATION MacOS/plugins
+)
+
+set_source_files_properties(
+    ${LIBVLC_LUA_EXTENSIONS}
+    PROPERTIES
+    MACOSX_PACKAGE_LOCATION MacOS/share/lua/extensions/
+)
+
+set_source_files_properties(
+    ${LIBVLC_LUA_MODULES}
+    PROPERTIES
+    MACOSX_PACKAGE_LOCATION MacOS/share/lua/modules/
+)
+
+set_source_files_properties(
+    ${LIBVLC_LUA_PLAYLIST}
+    PROPERTIES
+    MACOSX_PACKAGE_LOCATION MacOS/share/lua/playlist/
 )

 include_directories( ${VLC_PATH}/include )


Correct restoration of IOS variable while using find_host_package macro

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -915,8 +915,8 @@
   set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
   set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
+  set(_TOOLCHAIN_IOS ${IOS})
   set(IOS FALSE)
-  set(_TOOLCHAIN_IOS ${IOS})
   find_package(${ARGN})
   set(IOS ${_TOOLCHAIN_IOS})
   set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)


Another stab.

Another stab.

--- cmake/FindDbgHelp.cmake
+++ cmake/FindDbgHelp.cmake
@@ -1,8 +1,39 @@
-# Create an imported target for the DbgHelp library in MSVC.
-# NOTE: the library is supposed to be always available in Windows:
-# https://stackoverflow.com/questions/1619754/is-dbghelp-dll-built-in-to-windows-can-i-rely-on-it-being-there
-# So we don't bother about locating the include path or the library, just link
-# it directly.
+# This is similar to FindQuadmath.cmake, only we don't care about the include dir.

-add_library(DbgHelp::DbgHelp UNKNOWN IMPORTED)
-set_target_properties(DbgHelp::DbgHelp PROPERTIES INTERFACE_LINK_LIBRARIES "dbghelp.lib")
+include(FindPackageHandleStandardArgs)
+
+if(DbgHelp_LIBRARY)
+	# Already in cache, be silent
+	set(DbgHelp_FIND_QUIETLY TRUE)
+endif()
+
+find_library(DbgHelp_LIBRARY NAMES "dbghelp")
+
+if(NOT DbgHelp_LIBRARY)
+    set(DbgHelp_USE_DIRECTLY TRUE)
+    set(DbgHelp_LIBRARY "dbghelp.lib" CACHE FILEPATH "" FORCE)
+endif()
+
+if(DbgHelp_USE_DIRECTLY)
+    message(STATUS "dbghelp.lib will be included and linked directly.")
+endif()
+
+find_package_handle_standard_args(DbgHelp DEFAULT_MSG DbgHelp_LIBRARY)
+
+mark_as_advanced(DbgHelp_LIBRARY)
+
+if(DbgHelp_FOUND AND NOT TARGET DbgHelp::DbgHelp)
+    message(STATUS "Creating the 'DbgHelp::DbgHelp' imported target.")
+    if(DbgHelp_USE_DIRECTLY)
+        # If we are using it directly, we must define an interface library,
+        # as we do not have the full path to the shared library.
+        add_library(DbgHelp::DbgHelp INTERFACE IMPORTED)
+        set_target_properties(DbgHelp::DbgHelp PROPERTIES INTERFACE_LINK_LIBRARIES "${DbgHelp_LIBRARY}")
+    else()
+        # Otherwise, we proceed as usual.
+        add_library(DbgHelp::DbgHelp UNKNOWN IMPORTED)
+        set_target_properties(DbgHelp::DbgHelp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${DbgHelp_INCLUDE_DIR}"
+            IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+            IMPORTED_LOCATION "${DbgHelp_LIBRARY}")
+    endif()
+endif()


Update PythonWheel.cmake

Update PythonWheel.cmake

--- cmake/PythonWheel.cmake
+++ cmake/PythonWheel.cmake
@@ -1,8 +1,4 @@
 message(STATUS "Creating setup.py for python ${PYTHON_VERSION} wheel...")

 configure_file(${FAST_SOURCE_DIR}/source/FAST/Python/setup.py.in ${FAST_BINARY_DIR}/python/setup.py @ONLY IMMEDIATE)
-if(APPLE)
-execute_process(COMMAND MACOSX_DEPLOYMENT_TARGET=10.13 ${PYTHON_EXECUTABLE} setup.py bdist_wheel --py-limited-api cp36 WORKING_DIRECTORY "${FAST_BINARY_DIR}/python/")
-else()
 execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py bdist_wheel --py-limited-api cp36 WORKING_DIRECTORY "${FAST_BINARY_DIR}/python/")
-endif()


Fixed dependency error in tbag_modules__apply_ext_luajit_install_conf() cmake macro.

--- cmake/TbagModules.cmake
+++ cmake/TbagModules.cmake
@@ -716,7 +716,7 @@
     add_custom_command (
             OUTPUT ${__output}
             COMMAND ${CMAKE_COMMAND} -E copy "${luajit_EXT_CONF_HEADER}" "${__output}"
-            DEPENDS "${luajit_EXT_CONF_HEADER}")
+            DEPENDS luajit)
     add_custom_target (${__target} ALL DEPENDS ${__output})
     list (APPEND TBAG_PROJECT_DEPENDENCIES ${__target})
 endmacro ()


added explicit link to libm

added explicit link to libm

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@7387 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -102,7 +102,7 @@
 macro(PCL_ADD_LIBRARY _name _component)
     add_library(${_name} ${PCL_LIB_TYPE} ${ARGN})
     # must link explicitly against boost.
-    target_link_libraries(${_name} ${Boost_LIBRARIES})
+    target_link_libraries(${_name} m ${Boost_LIBRARIES})

 	if(MSVC90 OR MSVC10)
 	  target_link_libraries(${_name} delayimp.lib)  # because delay load is enabled for openmp.dll
@@ -184,7 +184,7 @@
     add_executable(${_name} ${ARGN})
     # must link explicitly against boost.
     if(UNIX AND NOT ANDROID)
-      target_link_libraries(${_name} ${Boost_LIBRARIES} pthread ${CLANG_LIBRARIES})
+      target_link_libraries(${_name} ${Boost_LIBRARIES} pthread m ${CLANG_LIBRARIES})
     else()
       target_link_libraries(${_name} ${Boost_LIBRARIES})
     endif()


Fix ROOT missing FileEntry error

Fix ROOT missing FileEntry error

ROOT could not find the biodynamo header files.
Added include paths for linux and macos

Error on start-up:
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for biology_module/grow_divide.h
   requested to autoload type bdm::GrowDivide

--- cmake/BioDynaMo.cmake
+++ cmake/BioDynaMo.cmake
@@ -70,6 +70,10 @@
   foreach( d ${incdirs})
     set(includedirs ${includedirs} -I${d})
   endforeach()
+  # header install path on linux
+  set(includedirs ${includedirs} -I/snap/biodynamo/current/biodynamo/include)
+  # header install path on osx
+  set(includedirs ${includedirs} -I/usr/local/include/biodynamo)
   #---Get preprocessor definitions--------------------------
   get_directory_property(defs COMPILE_DEFINITIONS)
   foreach( d ${defs})


[cmake] decoupled eigen and superlu checks

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -215,11 +215,12 @@
 if(SUPERLU_FOUND)
   include_directories(${SUPERLU_INCLUDES})
   link_directories(${SUPERLU_LIBRARY_DIRS})
-  pkg_check_modules(Eigen3, eigen3)
-  if(EIGEN3_FOUND)
-    include_directories(${EIGEN3_INCLUDE_DIR})
-  endif(EIGEN3_FOUND)
 endif(SUPERLU_FOUND)
+
+pkg_check_modules(Eigen3, eigen3)
+if(EIGEN3_FOUND)
+  include_directories(${EIGEN3_INCLUDE_DIR})
+endif(EIGEN3_FOUND)

 if(ENABLE_MPI)
 	find_package(MPI REQUIRED)


Remove debugging message

Remove debugging message

--- cmake/FindCEGUI.cmake
+++ cmake/FindCEGUI.cmake
@@ -493,7 +493,6 @@
 # its parent rather than directly the subdirectory. Otherwise we'll get compiler errors.
 if ("${CEGUI_VERSION}" VERSION_GREATER "0.8.0")
     add_parent_dir(CEGUI_INCLUDE_DIRS_TEMP CEGUI_INCLUDE_DIR)
-    message(${CEGUI_INCLUDE_DIRS_TEMP})
     set(${CEGUI_INCLUDE_DIRS} ${CEGUI_INCLUDE_DIRS_TEMP})
 endif()
 set(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS})


Removed config.h dependency

Removed config.h dependency

--- cmake/FindDWARF.cmake
+++ cmake/FindDWARF.cmake
@@ -105,6 +105,5 @@

 mark_as_advanced(DWARF_INCLUDE_DIR LIBDW_INCLUDE_DIR DWARF_LIBRARY ELF_LIBRARY EBL_LIBRARY)
 include_directories(${DWARF_INCLUDE_DIR} ${LIBDW_INCLUDE_DIR})
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)

-message(STATUS "Checking availability of DWARF and ELF development libraries - done")+message(STATUS "Checking availability of DWARF and ELF development libraries - done")


Adapt build system to support both ffmpeg and libav

--- cmake/FindLibAV.cmake
+++ cmake/FindLibAV.cmake
@@ -23,6 +23,7 @@
 #
 # Copyright (c) 2013 Sergiu Dotenco
 # Changed 2015 by Jan Schlüter: https://bitbucket.org/sergiu/libav-cmake/issue/2
+# Changed 2016 by Jan Schlüter: support both ffmpeg and libav
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -117,36 +118,46 @@

 # Determine library's version

-FIND_PROGRAM (LIBAV_AVCONV_EXECUTABLE NAMES avconv
-  HINTS ${LIBAV_ROOT_DIR}
-  PATH_SUFFIXES bin
-  DOC "avconv executable")
-
-IF (LIBAV_AVCONV_EXECUTABLE)
-  EXECUTE_PROCESS (COMMAND ${LIBAV_AVCONV_EXECUTABLE} -version
-    OUTPUT_VARIABLE _LIBAV_AVCONV_OUTPUT ERROR_QUIET)
-
-  STRING (REGEX REPLACE
-    ".*avconv(\\s+version)?[ \t]+v?([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*" "\\2"
-    LIBAV_VERSION "${_LIBAV_AVCONV_OUTPUT}")
-  STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\1"
-    LIBAV_VERSION_MAJOR "${LIBAV_VERSION}")
-  STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\2"
-    LIBAV_VERSION_MINOR "${LIBAV_VERSION}")
-
-  IF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
-    STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\3"
-      LIBAV_VERSION_PATCH "${LIBAV_VERSION}")
-    SET (LIBAV_VERSION_COMPONENTS 3)
-  ELSEIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
-    SET (LIBAV_VERSION_COMPONENTS 2)
-  ELSEIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)$")
-    # mostly developer/alpha/beta versions
-    SET (LIBAV_VERSION_COMPONENTS 2)
-    SET (LIBAV_VERSION_MINOR 0)
-    SET (LIBAV_VERSION "${LIBAV_VERSION}.0")
-  ENDIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
-ENDIF (LIBAV_AVCONV_EXECUTABLE)
+FOREACH(_CMD_NAME ffmpeg avconv)
+  FIND_PROGRAM (LIBAV_EXECUTABLE NAMES ${_CMD_NAME}
+    HINTS ${LIBAV_ROOT_DIR}
+    PATH_SUFFIXES bin
+    DOC "ffmpeg or avconv executable")
+
+  IF (LIBAV_EXECUTABLE)
+    EXECUTE_PROCESS (COMMAND ${LIBAV_EXECUTABLE} -version
+      OUTPUT_VARIABLE _LIBAV_EXECUTABLE_OUTPUT ERROR_QUIET)
+
+    STRING (REGEX REPLACE
+      ".*${_CMD_NAME}([ \t]+version)?[ \t]+v?([0-9.]*).*" "\\2"
+      LIBAV_VERSION "${_LIBAV_EXECUTABLE_OUTPUT}")
+
+    IF (LIBAV_VERSION)
+      STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\1"
+        LIBAV_VERSION_MAJOR "${LIBAV_VERSION}")
+      STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\2"
+        LIBAV_VERSION_MINOR "${LIBAV_VERSION}")
+
+      IF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
+        STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\3"
+          LIBAV_VERSION_PATCH "${LIBAV_VERSION}")
+        SET (LIBAV_VERSION_COMPONENTS 3)
+      ELSEIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)$")
+        SET (LIBAV_VERSION_COMPONENTS 2)
+      ELSEIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)$")
+        # mostly developer/alpha/beta versions
+        SET (LIBAV_VERSION_COMPONENTS 2)
+        SET (LIBAV_VERSION_MINOR 0)
+        SET (LIBAV_VERSION "${LIBAV_VERSION}.0")
+      ENDIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
+    ELSE (LIBAV_VERSION)
+      # clear variable if empty, can trap version check otherwise
+      UNSET (LIBAV_VERSION)
+    ENDIF (LIBAV_VERSION)
+
+    BREAK()
+  ENDIF (LIBAV_EXECUTABLE)
+ENDFOREACH(_CMD_NAME)

 IF (WIN32)
   FIND_PROGRAM (LIB_EXECUTABLE NAMES lib


Remove FindNumPy.cmake as it is not longer needed from CMake version 3.13.

--- cmake/FindNumPy.cmake
+++ cmake/FindNumPy.cmake
@@ -1,68 +0,0 @@
-# Find the Python NumPy package
-# PYTHON_NUMPY_INCLUDE_DIR
-# NUMPY_FOUND
-# will be set by this script
-
-cmake_minimum_required(VERSION 2.6)
-
-if(NOT PYTHON_EXECUTABLE)
-  if(NumPy_FIND_QUIETLY)
-    find_package(PythonInterp QUIET)
-  else()
-    find_package(PythonInterp)
-    set(_numpy_out 1)
-  endif()
-endif()
-
-if (PYTHON_EXECUTABLE)
-  # write a python script that finds the numpy path
-  file(WRITE ${PROJECT_BINARY_DIR}/FindNumpyPath.py
-      "try: import numpy; print(numpy.get_include())\nexcept:pass\n")
-
-  # execute the find script
-  exec_program("${PYTHON_EXECUTABLE}" ${PROJECT_BINARY_DIR}
-    ARGS "FindNumpyPath.py"
-    OUTPUT_VARIABLE NUMPY_PATH)
-    unset (NUMPY_LIBRARIES)
-
-  execute_process(COMMAND "${PYTHON_EXECUTABLE}"
-    "${CMAKE_CURRENT_LIST_DIR}/sitepackagelocations.py"
-    RESULT_VARIABLE _PYTHON_SUCCESS
-    OUTPUT_VARIABLE _PYTHON_SITE_PACKAGES
-    ERROR_VARIABLE _PYTHON_ERROR_VALUE
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-  set(_NUMPY_LIB_PATHS)
-  if (_PYTHON_SUCCESS STREQUAL "0")
-    string(REPLACE "\n" ";" _PYTHON_SITE_PACKAGES ${_PYTHON_SITE_PACKAGES})
-    foreach(d ${_PYTHON_SITE_PACKAGES})
-      list(APPEND _NUMPY_LIB_PATHS "${d}/numpy/core")
-    endforeach()
-
-    get_filename_component(NUMPY_ROOT_PATH ${NUMPY_PATH} DIRECTORY)
-    list(APPEND _NUMPY_LIB_PATHS ${NUMPY_ROOT_PATH})
-
-    find_library (NUMPY_NPYMATH_LIBRARY npymath
-      HINTS ${_NUMPY_LIB_PATHS}
-      PATH_SUFFIXES lib)
-  endif()
-elseif(_numpy_out)
-  message(STATUS "Python executable not found.")
-endif(PYTHON_EXECUTABLE)
-
-find_path(PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h
-  HINTS "${NUMPY_PATH}" "${PYTHON_INCLUDE_PATH}")
-
-if(PYTHON_NUMPY_INCLUDE_DIR)
-  set(PYTHON_NUMPY_FOUND 1 CACHE INTERNAL "Python numpy found")
-endif(PYTHON_NUMPY_INCLUDE_DIR)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(NumPy DEFAULT_MSG NUMPY_NPYMATH_LIBRARY PYTHON_NUMPY_INCLUDE_DIR)
-
-if(NUMPY_FOUND)
-  set(NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_INCLUDE_DIR})
-  set(NUMPY_LIBRARIES ${NUMPY_NPYMATH_LIBRARY})
-endif()
-
-mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIR NUMPY_NPYMATH_LIBRARY)


UseCython.cmake: Compile with --gdb flag automatically.

Pass --gdb to cython when CMAKE_BUILD_TYPE is Debug or RelWithDebInfo.

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -184,14 +184,15 @@
   # Set additional flags.
   if( CYTHON_ANNOTATE )
     set( annotate_arg "--annotate" )
-  else()
-    set( annotate_arg "" )
   endif()

   if( CYTHON_NO_DOCSTRINGS )
     set( no_docstrings_arg "--no-docstrings" )
-  else()
-    set( no_docstrings_arg "" )
+  endif()
+
+  if( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR
+        "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo" )
+      set( cython_debug_arg "--gdb" )
   endif()

   # Include directory arguments.
@@ -213,7 +214,7 @@
   add_custom_command( OUTPUT ${_generated_file}
     COMMAND ${CYTHON_EXECUTABLE}
     ARGS ${cxx_arg} ${include_directory_arg}
-    ${annotate_arg} ${no_docstrings_arg} ${CYTHON_FLAGS}
+    ${annotate_arg} ${no_docstrings_arg} ${cython_debug_arg} ${CYTHON_FLAGS}
     --output-file  ${_generated_file} ${pyx_locations}
     DEPENDS ${pyx_locations} ${pxd_dependencies}
     IMPLICIT_DEPENDS ${pyx_lang} ${c_header_dependencies}