fixing include and libs propagation for dependencies

--- WkDepends.cmake
+++ WkDepends.cmake
@@ -156,12 +156,16 @@
 		add_subdirectory(${dir_name} ${CMAKE_CURRENT_BINARY_DIR}/${dir_name})
 		list(LENGTH ${CMAKE_PROJECT_NAME}_SRCDEPENDS dpdlsize)
 		list ( GET ${CMAKE_PROJECT_NAME}_SRCDEPENDS dpdlsize-1 subprj_name )
-
+
+		#defining ${subprj_name}_DIR as build directory.
+		#We need it later to get location of libraries and other build results, to work in the same way as bin dependencies.
+		set ( ${subprj_name}_DIR ${CMAKE_CURRENT_BINARY_DIR}/${dir_name} )
+
 		if ( ${subprj_name}_INCLUDE_DIR )

 			#dependencies headers ( need to be included after project's own headers )
 			#Note : we use the include dir from source, not from the copy in binary dir.
-			file( TO_CMAKE_PATH ${dir_name}/${${subprj_name}_INCLUDE_DIR} subprj_include_path)
+			file( TO_CMAKE_PATH ${CMAKE_CURRENT_BINARY_DIR}/${dir_name}/${${subprj_name}_INCLUDE_DIR} subprj_include_path)
 			file( TO_CMAKE_PATH ${CMAKE_CURRENT_BINARY_DIR}/${dir_name}/CMakeFiles subprj_include_wk_path)

 			#To match a binary dependency variable names :
@@ -204,7 +208,10 @@
 		target_link_libraries(${PROJECT_NAME} ${${package_var_name}_LIBRARIES})
 		message ( STATUS "== Binary Dependency ${package_name} libs : ${${package_var_name}_LIBRARIES} OK !")

-		mark_as_advanced ( CLEAR ${package_var_name}_LIBRARIES )
+		#using fullpath libraries from here on
+
+
+		mark_as_advanced ( CLEAR ${package_var_name}_LIBRARIES )

 		IF ( WIN32 )
 			message ( STATUS "== Binary Dependency ${package_name} runlibs : ${${package_var_name}_RUN_LIBRARIES} OK !")
@@ -234,7 +241,8 @@

 		#If it s a custom Wk-dependency we need to use the Export from the dependency to be able to access built targets.
 		if ( ${package_name}_DIR )
-			file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Export.cmake "
+			#we need to add this to config and not export, as export will be erased by cmake during build configuration from cache.
+			file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "

 #Propagating imported targets
 if ( EXISTS \"${${package_name}_FDIR}/${package_name}Export.cmake\" )
@@ -303,7 +311,6 @@
 		ENDIF ( WIN32 )

 		# Once the project is built with it, the dependency becomes mandatory
-		# However we need to propagate the location of Custom Wk-dependencies, to make it easier for later
 		if ( ${subprj_name}_DIR )
 			get_filename_component( ${subprj_name}_FDIR ${${subprj_name}_DIR} ABSOLUTE )
 		endif ( ${subprj_name}_DIR )
@@ -316,7 +323,9 @@

 		#If it s a custom Wk-dependency we need to use the Export from the dependency to be able to access built targets.
 		if ( ${subprj_name}_DIR )
-			file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Export.cmake "
+			#we need to add this to config and not export, as export will be erased by cmake during build configuration from cache.
+			message(STATUS "Modifying ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Export.cmake about ${${subprj_name}_FDIR}/${subprj_name}Export.cmake" )
+			file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "

 #Propagating imported targets
 if ( EXISTS \"${${subprj_name}_FDIR}/${subprj_name}Export.cmake\" )


Set preference for link with pythonlib 2.7 instead others versions installed

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

--- cmake-modules/FindThirdPartyPython.cmake
+++ cmake-modules/FindThirdPartyPython.cmake
@@ -29,6 +29,8 @@
 ENDIF(WIN32)

 IF(UNIX)
+	# Prefert Python 2.7 supported by OV python-plugin
+	SET(Python_ADDITIONAL_VERSIONS 2.7)
 	INCLUDE("FindPythonLibs")
 	IF(PYTHONLIBS_FOUND)
 		MESSAGE(STATUS "  Found Python...")


CMake: Link static libstdc++ and gcc for exes

This way stuff will work without having to tote around a manual copy of
mingw's libraries

Change-Id: Ie80b742f2e10960acdddb8a2339dc64704dc43fc
Reviewed-on: http://review.couchbase.org/33332
Reviewed-by: Brett Lawson <c8c4369773d7d7226e031f0c4af62e3f38a08510@gmail.com>
Tested-by: Mark Nunberg <e7d42768707bf23038325b0b68d4b577e5f6064a@haskalah.org>

--- cmake/Modules/GetLibcouchbaseFlags.cmake
+++ cmake/Modules/GetLibcouchbaseFlags.cmake
@@ -81,6 +81,7 @@
     IF(WIN32)
         SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -gstabs")
         SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -gstabs")
+        SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
     ENDIF()
     SET(LCB_CORE_CFLAGS "${LCB_GNUC_C_WARNINGS}")
     SET(LCB_CORE_CXXFLAGS "${LCB_GNUC_CXX_WARNINGS}")


Adapt CMake script to make it compile under Ubuntu 13.04

--- numpy_eigen/cmake/add_python_export_library.cmake
+++ numpy_eigen/cmake/add_python_export_library.cmake
@@ -17,7 +17,7 @@

   rosbuild_add_boost_directories()
   # Find Python
-  FIND_PACKAGE(PythonLibs REQUIRED)
+  FIND_PACKAGE(PythonLibs 2.7.4 REQUIRED)
   INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})

   IF(APPLE)


Added checks to FindBuzz.cmake.

Added checks to FindBuzz.cmake.

--- src/utility/FindBuzz.cmake
+++ src/utility/FindBuzz.cmake
@@ -1,28 +1,74 @@
-set(_BUZZ_PATHS
+#
+# Stardard Buzz tool paths
+#
+set(_BUZZ_TOOL_PATHS
   /usr/bin
   /usr/local/bin
   /opt/bin
   /opt/local/bin)

+#
+# Standard Buzz library paths
+#
+set(_BUZZ_LIBRARY_PATHS
+  /usr/lib
+  /usr/local/lib
+  /opt/lib
+  /opt/local/lib)
+
+#
+# Standard Buzz include paths
+#
+set(_BUZZ_INCLUDE_PATHS
+  /usr/include
+  /usr/local/include
+  /opt/include
+  /opt/local/include)
+
+#
+# Look for bzzc
+#
 find_program(BUZZ_COMPILER
   NAMES bzzc
-  PATHS ${_BUZZ_PATHS}
+  PATHS ${_BUZZ_TOOL_PATHS}
   DOC "Location of the bzzc compiler")

+#
+# Look for bzzparse
+#
 find_program(BUZZ_PARSER
   NAMES bzzparse
-  PATHS ${_BUZZ_PATHS}
+  PATHS ${_BUZZ_TOOL_PATHS}
   DOC "Location of the bzzparse compiler")

+#
+# Look for bzzasm
+#
 find_program(BUZZ_ASSEMBLER
   NAMES bzzasm
-  PATHS ${_BUZZ_PATHS}
+  PATHS ${_BUZZ_TOOL_PATHS}
   DOC "Location of the bzzasm compiler")
+
+#
+# Look for Buzz library
+#
+find_library(BUZZ_LIBRARY
+  NAMES buzz
+  PATHS ${_BUZZ_LIBRARY_PATHS}
+  DOC "Location of the Buzz library")
+
+#
+# Look for Buzz include files
+#
+find_path(BUZZ_INCLUDE_DIR
+  NAMES buzz/buzzvm.h
+  PATHS ${_BUZZ_INCLUDE_PATHS}
+  DOC "Location of the Buzz include files")

 # Handle the QUIETLY and REQUIRED arguments and set BUZZ_FOUND to TRUE
 # if all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(BUZZ
-  REQUIRED_VARS BUZZ_COMPILER BUZZ_PARSER BUZZ_ASSEMBLER)
+  REQUIRED_VARS BUZZ_COMPILER BUZZ_PARSER BUZZ_ASSEMBLER BUZZ_LIBRARY BUZZ_INCLUDE_DIR)

-mark_as_advanced(BUZZ_COMPILER BUZZ_PARSER BUZZ_ASSEMBLER)
+mark_as_advanced(BUZZ_COMPILER BUZZ_PARSER BUZZ_ASSEMBLER BUZZ_LIBRARY BUZZ_INCLUDE_DIR)


COMP: Update TubeTK repository address

COMP: Update TubeTK repository address

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -44,7 +44,7 @@
     ${${proj}_EP_ARGS}
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
-    GIT_REPOSITORY "https://github.com/TubeTK/TubeTK.git"
+    GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
     GIT_TAG "8c53b6d06b4003bc5f31c6d2a8ca3598c7579da3"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}


Bump TubeTK for Mac and Unix fix

Bump TubeTK for Mac and Unix fix

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
-    GIT_TAG "43c540093d981a47ec61d3b97e0f1f7395a2009b"
+    GIT_TAG "74d09d6db679ae7706c019975c9d34a379075497"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


FIX (#3461):  deactivating mitkNavigationToolReaderAndWriterTest

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -26,12 +26,12 @@
    #mitkTrackingDeviceSourceTest.cpp
    #mitkNavigationDataPlayerTest.cpp  # deactivated, see bug 3073
    #mitkNavigationDataSourceTest.cpp   # deactivated because of  bug #2323
+   #mitkNavigationToolReaderAndWriterTest.cpp #deactivated, see bug #3461
    # -----------------------------------------------------------------------

    # ------------------ Navigation Tool Management Tests -------------------
    mitkNavigationToolStorageTest.cpp
    mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
    mitkNavigationToolTest.cpp
-   mitkNavigationToolReaderAndWriterTest.cpp
    # -----------------------------------------------------------------------
 )


Fixed function call for check_glog_compiles

Former-commit-id: 833422072cf910eab07693347d948e8d59d057df

--- cmake-modules/Fetch_glog.cmake
+++ cmake-modules/Fetch_glog.cmake
@@ -31,7 +31,7 @@
         find_library(GLOG_LIBRARIES     glog           )
         find_path   (GLOG_INCLUDE_DIR   glog/logging.h )
         if(GLOG_LIBRARIES AND GLOG_INCLUDE_DIR)
-            check_glog_compiles("${GLOG_LIBRARIES};unwind::full;gflags::gflags;pthread" "" "${GLOG_INCLUDE_DIR}")
+            check_glog_compiles("" "${GLOG_LIBRARIES};unwind::full;gflags::gflags;pthread" "${GLOG_INCLUDE_DIR}" "" "")
         endif()
         if (GLOG_COMPILES_lib_header)
             add_library(glog::glog ${LINK_TYPE} IMPORTED)


FIX: CMAKE_CXX_FLAGS was accidentally overwritten

--- cmake/DependenciesConfig.cmake
+++ cmake/DependenciesConfig.cmake
@@ -20,7 +20,7 @@
     find_package(OpenMP)
     if(${OPENMP_FOUND})
         message(STATUS "OpenMP found")
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} ${OpenMP_CXX_FLAGS}")
+        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OpenMP_CXX_FLAGS}")

         include_directories(${OpenMP_CXX_INCLUDE_DIRS})


- Add commit build information in engine build string

--- cmake/Modules/BuildFlags.cmake
+++ cmake/Modules/BuildFlags.cmake
@@ -19,6 +19,7 @@
     # These include system headers (which are constantly giving off warnings)
     #  as well as small warnings for padding and etc.
     # Microsoft makes the worst headers of them all.
+    # We also set a target Windows NT version for some reason
     add_definitions (
 	-W1
 	-D_WIN32_WINNT=0x0601
@@ -36,14 +37,22 @@
 # Because file timestamps are unreliable.
 string (TIMESTAMP CBUILDTIME "%y.%m.%d.%H%M")

-
 set ( COFFEE_VERSION_CODE "001" )

 #add_definitions( -DCOFFEE_APPLICATION_NAME="Generic Coffee" )
 add_definitions( -DCOFFEE_ORGANIZATION_NAME="Coffee Guy" )
 add_definitions( -DCOFFEE_VERSION_CODE=${COFFEE_VERSION_CODE} )

-set ( GIT_HASH "00000000" )
+# git hash is retrieved
+execute_process (
+    COMMAND git rev-parse HEAD
+    OUTPUT_VARIABLE GIT_HASH
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    )
+
+string ( SUBSTRING "${GIT_HASH}" "" 10 GIT_HASH )
+
+#set ( GIT_HASH "00000000" )

 set ( COFFEE_BUILD_STRING "${COFFEE_VERSION_CODE}.00.00.${CBUILDTIME}-${GIT_HASH}" )


BUILD FIX MINOR: Verbosity in FindEigen3.cmake

Former-commit-id: e75289d61b630434fd2266bfb0f73a5b538f3433

--- cmake/Modules/FindEigen3.cmake
+++ cmake/Modules/FindEigen3.cmake
@@ -56,8 +56,6 @@
   endif(NOT EIGEN3_VERSION_OK)
 endmacro(_eigen3_check_version)

-message("EIGEN_ROOT ${EIGEN_ROOT}")
-message("signature_of_eigen3_matrix_library ${signature_of_eigen3_matrix_library}")
 if (EIGEN3_INCLUDE_DIR)

   # in cache already


[cmake] fix warning for mpi4py

[cmake] fix warning for mpi4py

--- cmake/modules/Findmpi4py.cmake
+++ cmake/modules/Findmpi4py.cmake
@@ -17,10 +17,10 @@
 endif()

-find_package_handle_standard_args(MPI4PY DEFAULT_MSG MPI4PY_INCLUDE_DIR)
-mark_as_advanced(MPI4PY_FOUND MPI4PY_INCLUDE_DIR)
+find_package_handle_standard_args(mpi4py DEFAULT_MSG MPI4PY_INCLUDE_DIR)
+mark_as_advanced(mpi4py_FOUND MPI4PY_INCLUDE_DIR)

-if(MPI4PY_FOUND AND NOT TARGET mpi4py::mpi4py)
+if(mpi4py_FOUND AND NOT TARGET mpi4py::mpi4py)
   add_library(mpi4py::mpi4py INTERFACE IMPORTED)
   set_target_properties(mpi4py::mpi4py PROPERTIES
                                        INTERFACE_INCLUDE_DIRECTORIES "${MPI4PY_INCLUDE_DIR}")


[CMake] Add PYTHON_DEPS argument to ROOT_ADD_TEST/ROOT_ADD_PYUNITTTEST.

If a test requires a specific python packge, this can now (and should!)
be communicated using the argument PYTHON_DEPS when registering the test.
This will trigger the addition of a test fixture, which checks for this
package.
This fixture is a simple ctest that tries to import the requested
package. If the fixture passes, all dependent tests run. If the fixture
fails, the dependent test don't run, but are all marked as failed
because of the missing package.

This makes tests faster and failures easier to diagnose, because it becomes
obvious that those tests failed because of the missing package, and not
because there's another problem in the test.

Further, the tests that have python runtime dependencies will
automatically be labelled with "python_runtime_deps".

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -1404,12 +1404,14 @@
 #                        [BUILD target] [PROJECT project]
 #                        [PASSREGEX exp] [FAILREGEX epx]
 #                        [PASSRC code]
-#                        [LABELS label1 label2])
+#                        [LABELS label1 label2]
+#                        [PYTHON_DEPS numpy numba keras ...] # List of python packages required to run this test.
+#                                                              A fixture will be added the tries to import them before the test starts.)
 #
 function(ROOT_ADD_TEST test)
   CMAKE_PARSE_ARGUMENTS(ARG "DEBUG;WILLFAIL;CHECKOUT;CHECKERR;RUN_SERIAL"
                             "TIMEOUT;BUILD;INPUT;OUTPUT;ERROR;SOURCE_DIR;BINARY_DIR;WORKING_DIR;PROJECT;PASSRC"
-                             "COMMAND;COPY_TO_BUILDDIR;DIFFCMD;OUTCNV;OUTCNVCMD;PRECMD;POSTCMD;ENVIRONMENT;COMPILEMACROS;DEPENDS;PASSREGEX;OUTREF;ERRREF;FAILREGEX;LABELS"
+                            "COMMAND;COPY_TO_BUILDDIR;DIFFCMD;OUTCNV;OUTCNVCMD;PRECMD;POSTCMD;ENVIRONMENT;COMPILEMACROS;DEPENDS;PASSREGEX;OUTREF;ERRREF;FAILREGEX;LABELS;PYTHON_DEPS"
                             ${ARGN})

   #- Handle COMMAND argument
@@ -1606,6 +1608,19 @@

   if(ARG_LABELS)
     set_tests_properties(${test} PROPERTIES LABELS "${ARG_LABELS}")
+  endif()
+
+  if(ARG_PYTHON_DEPS)
+    foreach(python_dep ${ARG_PYTHON_DEPS})
+      if(NOT TEST test-import-${python_dep})
+        add_test(NAME test-import-${python_dep} COMMAND ${PYTHON_EXECUTABLE_Development_Main} -c "import ${python_dep}")
+        set_tests_properties(test-import-${python_dep} PROPERTIES FIXTURES_SETUP requires_${python_dep})
+      endif()
+      list(APPEND fixtures "requires_${python_dep}")
+    endforeach()
+    if(fixtures)
+      set_tests_properties(${test} PROPERTIES FIXTURES_REQUIRED "${fixtures}")
+    endif()
   endif()

   if(ARG_RUN_SERIAL)
@@ -1729,10 +1744,10 @@
 #                     [WILLFAIL]
 #                     [COPY_TO_BUILDDIR copy_file1 copy_file1 ...]
 #                     [ENVIRONMENT var1=val1 var2=val2 ...]
-#                     [DEPENDENCIES_FOUND dep_x_found dep_y_found ...])
+#                     [PYTHON_DEPS dep_x dep_y ...] # Communicate that this test requires python packages. A fixture checking for these will be run before the test.)
 #----------------------------------------------------------------------------
 function(ROOT_ADD_PYUNITTEST name file)
-  CMAKE_PARSE_ARGUMENTS(ARG "WILLFAIL" "" "COPY_TO_BUILDDIR;ENVIRONMENT;DEPENDENCIES_FOUND" ${ARGN})
+  CMAKE_PARSE_ARGUMENTS(ARG "WILLFAIL" "" "COPY_TO_BUILDDIR;ENVIRONMENT;PYTHON_DEPS" ${ARGN})
   if(MSVC)
     set(ROOT_ENV ROOTSYS=${ROOTSYS}
         PYTHONPATH=${ROOTSYS}/bin;$ENV{PYTHONPATH})
@@ -1757,23 +1772,18 @@
   if(ARG_WILLFAIL)
     set(will_fail WILLFAIL)
   endif()
-
-  set(dependencies ON)
-  if(DEFINED ARG_DEPENDENCIES_FOUND)
-      foreach(dep ${ARG_DEPENDENCIES_FOUND})
-      if(NOT ${dep})
-        set(dependencies FALSE)
-      endif()
-    endforeach()
-  endif()
-
-  if(dependencies)
-    ROOT_ADD_TEST(pyunittests-${good_name}
-                COMMAND ${PYTHON_EXECUTABLE_Development_Main} -B -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR}/${file_dir} -p ${file_name} -v
-                ENVIRONMENT ${ROOT_ENV} ${ARG_ENVIRONMENT}
-                ${copy_to_builddir}
-                ${will_fail})
-  endif()
+
+  if(ARG_PYTHON_DEPS)
+    list(APPEND labels python_runtime_deps)
+  endif()
+
+  ROOT_ADD_TEST(pyunittests-${good_name}
+              COMMAND ${PYTHON_EXECUTABLE_Development_Main} -B -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR}/${file_dir} -p ${file_name} -v
+              ENVIRONMENT ${ROOT_ENV} ${ARG_ENVIRONMENT}
+              LABELS ${labels}
+              ${copy_to_builddir}
+              ${will_fail}
+              PYTHON_DEPS ${ARG_PYTHON_DEPS})
 endfunction()

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


Removed the logging bit in data_target.cmake.


[CMake][Exp PyROOT] Remove QUIET from find_package Python2/3 and Numpy

Contrary to what was pointed out in 89c089, for what concerns
find_package(Python2), find_package(Python3), find_package(Python2
COMPONENTS Numpy) and find_package(Python3 COMPONENTS Numpy) the default
behavior is the one expected: if neither REQUIRED and QUIET are
specified, an output is printed and the build continues even if the
package is not found. For this reason it seems safe to remove the option
QUIET from here.
The behavior observed in 89c089 is still observed for what concerns
find_package(Python COMPONENTS Numpy), but this is erased in this PR.

--- cmake/modules/SearchRootCoreDeps.cmake
+++ cmake/modules/SearchRootCoreDeps.cmake
@@ -32,7 +32,7 @@
     set(Python${PYTHON_PREFER_VERSION}_EXECUTABLE "${PYTHON_EXECUTABLE}")
   endif()

-  find_package(Python3 COMPONENTS Interpreter Development NumPy QUIET)
+  find_package(Python3 COMPONENTS Interpreter Development NumPy)
   if(Python3_Development_FOUND)
     set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}" CACHE INTERNAL "" FORCE)
     set(PYTHON_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
@@ -44,7 +44,7 @@
     set(NUMPY_INCLUDE_DIRS "${Python3_NumPy_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
   endif()

-  find_package(Python2 COMPONENTS Interpreter Development NumPy QUIET)
+  find_package(Python2 COMPONENTS Interpreter Development NumPy)
   if(Python2_Development_FOUND)
     if(NOT Python3_Development_FOUND)
       # Only Python2 was found, set as main
@@ -85,7 +85,7 @@
     "Please specify only PYTHON_EXECUTABLE to CMake with an absolute path to ensure matching versions are found.")
   endif()

-  find_package(NumPy QUIET)
+  find_package(NumPy)

   set(PYTHON_VERSION_STRING "${PYTHON_VERSION_MAJOR}_${PYTHON_VERSION_MINOR}")


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 02)

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


[Build] The Python scripts now have the correct library and sample paths.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -820,8 +820,13 @@
   #  * on external libraries (Boost, MySQL, SOCI, StdAir), as calculated by
   #    the get_external_libs() macro above;
   #  * on the other module libraries, as provided as paramaters to this macro
-  target_link_libraries (${_lib_target}
-    ${PROJ_DEP_LIBS_FOR_LIB} ${_intermodule_dependencies})
+  #  * on the main/standard library of the module (when, of course, the
+  #    current library is not the main/standard library).
+  if (NOT "${_lib_short_name}" STREQUAL "${MODULE_NAME}")
+	set (_intramodule_dependencies ${MODULE_NAME}lib)
+  endif (NOT "${_lib_short_name}" STREQUAL "${MODULE_NAME}")
+  target_link_libraries (${_lib_target} ${PROJ_DEP_LIBS_FOR_LIB}
+	${_intermodule_dependencies} ${_intramodule_dependencies})

   # Register the library target in the project (for reporting purpose).
   # Note, the list() commands creates a new variable value in the current scope:
@@ -972,15 +977,23 @@
 # Add a Python script to be installed
 macro (module_python_add _script_file)
   #
-  set (_full_python_script_path ${CMAKE_CURRENT_SOURCE_DIR}/${_script_file})
-  if (EXISTS ${_full_python_script_path})
-    # Install the development helpers
-    install (PROGRAMS ${_script_file} DESTINATION bin COMPONENT devel)
-
-  else (EXISTS ${_full_python_script_path})
+  set (_full_script_src_path ${CMAKE_CURRENT_SOURCE_DIR}/${_script_file}.in)
+  set (_full_script_path ${CMAKE_CURRENT_BINARY_DIR}/${_script_file})
+  if (EXISTS ${_full_script_src_path})
+	#
+    configure_file (${_full_script_src_path} ${_full_script_path} @ONLY)
+
+    # Add the 'scripts_${MODULE_NAME}' target, depending on the
+    # converted (Python) scripts
+    add_custom_target (scripts_${MODULE_NAME} ALL DEPENDS ${_full_script_path})
+
+    # Install the (Python) script file
+    install (PROGRAMS ${_full_script_path} DESTINATION bin COMPONENT devel)
+
+  else (EXISTS ${_full_script_src_path})
     message (FATAL_ERROR
-      "The Python script to be installed, '${_script_file}', does not exist")
-  endif (EXISTS ${_full_python_script_path})
+      "The Python template script, '${_script_file}.in', does not exist")
+  endif (EXISTS ${_full_script_src_path})

   # Register the binary target in the project (for reporting purpose)
   get_filename_component (_script_alone ${_script_file} NAME)


Make doxygen output reproducible

Make doxygen output reproducible

Signed-off-by: Sebastian Ramacher <63df716952f6985d63bd730444128636613d6384@debian.org>

--- Doxyfile.cmake
+++ Doxyfile.cmake
@@ -18,3 +18,4 @@
 EXPAND_ONLY_PREDEF  = YES
 PREDEFINED          = LIBMB5_DEPRECATED(f)=
 REPEAT_BRIEF        = NO
+HTML_TIMESTAMP      = NO


FIX: APPLE like to have platform dependent libraries at the beggining.

--- FindFLTK.cmake
+++ FindFLTK.cmake
@@ -86,6 +86,10 @@

 IF(FLTK_FOUND)
   SET(FLTK_LIBRARIES ${FLTK_BASE_LIBRARY} ${FLTK_GL_LIBRARY}
-                     ${FLTK_FORMS_LIBRARY} ${FLTK_IMAGES_LIBRARY}
-                     ${FLTK_PLATFORM_DEPENDENT_LIBS})
+                       ${FLTK_FORMS_LIBRARY} ${FLTK_IMAGES_LIBRARY})
+  IF(APPLE)
+    SET(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES})
+  ELSE(APPLE)
+    SET(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${FLTK_PLATFORM_DEPENDENT_LIBS})
+  ENDIF(APPLE)
 ENDIF(FLTK_FOUND)


SVN_SILENT made messages (.desktop file)

--- plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
+++ plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
@@ -9,6 +9,7 @@
 Comment[et]=Morse ühendusehaldurit kasutavate kontode kohandatud konto seadistamise kasutajaliides
 Comment[fr]=Interface utilisateur personnalisée pour la configuration de comptes en utilisant le gestionnaire de connexions « Morse ».
 Comment[it]=Interfaccia utente personalizzata di configurazione account per account che usano il gestore di connessioni Morse.
+Comment[nb]=Brukerflate for å sette opp egendefinerte kontoer ved bruk av Morse tilkoblingsbehandler.
 Comment[nl]=Gebruikersinterface voor aangepaste accountconfiguratie voor accounts die de Morse verbindingenbeheerder gebruiken.
 Comment[pl]=Dostosowana nakładka graficzna do ustawiania kont dla kont wykorzystujących usługę połączeń Morse.
 Comment[pt]=Interface de utilizador de configuração de contas personalizadas com o gestor de ligações Morse.


Reverting 8d8f6acb4d33af76b1786ab5de1f9f406b8d3836

--- Shared/CMake/JamomaUtilFunctions.cmake
+++ Shared/CMake/JamomaUtilFunctions.cmake
@@ -10,8 +10,6 @@
     	if(APPLE)
         	set_property(TARGET ${PROJECT_NAME}
                      	PROPERTY INSTALL_RPATH "@loader_path/../../../../support;@loader_path")
-			set_property(TARGET ${PROJECT_NAME}
-						 PROPERTY BUILD_WITH_INSTALL_RPATH TRUE)
     	else()
         	set_property(TARGET ${PROJECT_NAME}
                      	PROPERTY INSTALL_RPATH "\$ORIGIN/../support;\$ORIGIN")
@@ -29,14 +27,12 @@
 	endif()

 	# Version
-	if(!BUILD_JAMOMAMAX)
-		set_property(TARGET ${LIBNAME}
-					 PROPERTY VERSION ${Jamoma_VERSION})
-		set_property(TARGET ${LIBNAME}
-					 PROPERTY SOVERSION ${Jamoma_SOVERSION})
-		set_property(TARGET ${LIBNAME} APPEND
-					 PROPERTY COMPATIBLE_INTERFACE_STRING Jamoma_MAJOR_VERSION)
-	endif()
+	set_property(TARGET ${LIBNAME}
+				 PROPERTY VERSION ${Jamoma_VERSION})
+	set_property(TARGET ${LIBNAME}
+				 PROPERTY SOVERSION ${Jamoma_SOVERSION})
+	set_property(TARGET ${LIBNAME} APPEND
+				 PROPERTY COMPATIBLE_INTERFACE_STRING Jamoma_MAJOR_VERSION)

 	# TODO replace with target_include_directories
 	if(APPLE)
@@ -44,45 +40,6 @@
 					 PROPERTY INTERFACE_INCLUDE_DIRECTORIES
 						$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/includes>
 						$<INSTALL_INTERFACE:include>)
-
-
-	if(APPLE)
-		if(BUILD_JAMOMAMAX)
-			if($ENV{TRAVIS})
-				message("no copy for travis")
-			else()
-				# TODO there appears to be some ambiguity when building because some things are build into debug/release even though CMAKE_BUILD_TYPE is the other here... [tap]
-
-				# ADD_CUSTOM_COMMAND(
-				#   TARGET ${LIBNAME}
-				#   POST_BUILD
-				#   COMMAND ${CMAKE_COMMAND} -E make_directory
-				#    ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support
-				# )
-				ADD_CUSTOM_COMMAND(
-				  TARGET ${LIBNAME}
-				  POST_BUILD
-				  COMMAND ${CMAKE_COMMAND} -E make_directory
-				   ${CMAKE_BINARY_DIR}/Debug/support
-				)
-				ADD_CUSTOM_COMMAND(
-				  TARGET ${LIBNAME}
-				  POST_BUILD
-				  COMMAND ${CMAKE_COMMAND} -E make_directory
-				   ${CMAKE_BINARY_DIR}/Release/support
-				)
-				ADD_CUSTOM_COMMAND(
-				  TARGET ${LIBNAME} #Jamoma::Foundation # for instance
-				  POST_BUILD
-				  COMMAND ${CMAKE_COMMAND} -E copy
-				      ${CMAKE_BINARY_DIR}/JamomaCore/${LIBNAME}/library/${CMAKE_BUILD_TYPE}/libJamoma${LIBNAME}.dylib #* # we have to be careful with .so / .dll
-				      ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support #/libJamomaFoundation.dylib
-				)
-			endif() # !$ENV{TRAVIS}
-		endif() # BUILD_JAMOMAMAX
-	endif() # APPLE
-
-
 	else()
 		set_property(TARGET ${LIBNAME} APPEND
 					 PROPERTY INTERFACE_INCLUDE_DIRECTORIES
@@ -142,7 +99,6 @@
 	endif()

   if(BUILD_JAMOMAMAX)
-
     install(TARGETS ${PROJECT_NAME}
         DESTINATION "${JAMOMAMAX_INSTALL_FOLDER}/Jamoma/support/${SUPPORT_FOLDER}"
         COMPONENT JamomaMax)
@@ -198,32 +154,6 @@
 			set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".ttdll")
 		endif()
 	endif()
-
-
-
-	if(APPLE)
-		if(BUILD_JAMOMAMAX)
-			if($ENV{TRAVIS})
-				message("no copy for travis")
-			else()
-				ADD_CUSTOM_COMMAND(
-				  TARGET ${PROJECT_NAME}
-				  POST_BUILD
-				  COMMAND ${CMAKE_COMMAND} -E make_directory
-				   ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support
-				)
-				ADD_CUSTOM_COMMAND(
-				  TARGET ${PROJECT_NAME} #Jamoma::Foundation # for instance
-				  POST_BUILD
-				  COMMAND ${CMAKE_COMMAND} -E copy
-				      ${CMAKE_BINARY_DIR}/JamomaCore/${JAMOMA_CURRENT_LIBRARY_NAME}/extensions/${PROJECT_NAME}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME}.ttdylib #* # we have to be careful with .so / .dll
-				      ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support #/libJamomaFoundation.dylib
-				)
-			endif() # !$ENV{TRAVIS}
-		endif() # BUILD_JAMOMAMAX
-	endif() # APPLE
-
-

 	### Tests ###
 	addTestTarget()


SuperBuild: use a sourceforge download mirror to avoid redirection

--- SuperBuild/CMake/External_opencv.cmake
+++ SuperBuild/CMake/External_opencv.cmake
@@ -14,7 +14,7 @@

 ExternalProject_Add(OPENCV
   PREFIX OPENCV
-  URL "http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.11/opencv-2.4.11.zip/download"
+  URL "http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.11/opencv-2.4.11.zip"
   URL_MD5 32f498451bff1817a60e1aabc2939575
   BINARY_DIR ${OPENCV_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


BUG: don't set opencv dir in Superbuild scripts as cmake should be able to find it and because share/OpenCV does not exist in opencv4

--- SuperBuild/CMake/External_opencv.cmake
+++ SuperBuild/CMake/External_opencv.cmake
@@ -125,5 +125,3 @@
   )

 SUPERBUILD_PATCH_SOURCE(OPENCV)
-
-set(_SB_OpenCV_DIR ${SB_INSTALL_PREFIX}/share/OpenCV)


Can't do std containers with const elements.

--- cmake/binary_to_char_array.cmake
+++ cmake/binary_to_char_array.cmake
@@ -32,7 +32,7 @@
     # Append " )"
     string(APPEND FORMATTED_HEX " }")

-    set(${_DATA_STATEMENT} "const std::vector<const unsigned char> ${VARIABLE_NAME} = ${FORMATTED_HEX};" PARENT_SCOPE)
+    set(${_DATA_STATEMENT} "const std::vector<unsigned char> ${VARIABLE_NAME} = ${FORMATTED_HEX};" PARENT_SCOPE)
     set(${_LEN_STATEMENT} "static const size_t ${VARIABLE_NAME}_LEN = ${HEX_LEN};" PARENT_SCOPE)
 endfunction()


Use QUIET in find_package uniess REQUIRED

Fix https://github.com/robotology/idyntree/issues/390

--- cmake/iDynTreeDependencies.cmake
+++ cmake/iDynTreeDependencies.cmake
@@ -9,9 +9,9 @@
   set(multiValueArgs COMPONENTS)
   cmake_parse_arguments(IHD "" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})
   if (IHD_COMPONENTS)
-    find_package(${package} ${IHD_MINIMUM_VERSION} COMPONENTS ${IHD_COMPONENTS})
+    find_package(${package} ${IHD_MINIMUM_VERSION} QUIET COMPONENTS ${IHD_COMPONENTS})
   else ()
-    find_package(${package} ${IHD_MINIMUM_VERSION})
+    find_package(${package} ${IHD_MINIMUM_VERSION} QUIET)
   endif ()
   string(TOUPPER ${package} PKG)
   option(IDYNTREE_USES_${PKG} "Build the part of iDynTree that depends on package ${package}" ${${package}_FOUND})


Retire the pbm device.

Retire the pbm device.

svn path=/trunk/; revision=10521

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -188,8 +188,10 @@
   "mem:mem:ON:M:OFF"
   "ntk:ntk:OFF:I:OFF"
   "null:null:ON:N:OFF"
-  # glibc detects double free
-  "pbm:pbm:OFF:F:OFF"
+  # The pbm device is primitive (e.g., Hershey fonts, software fills,
+  # no alpha transparency) and poorly maintained (the double free for
+  # example 2 has not been fixed).  Therefore retire this device.
+  # "pbm:pbm:OFF:F:OFF"
   "pdf:pdf:OFF:F:OFF"
   # (2007-09-01) As discussed on list, don't enable plmeta until we sort
   # out the known issues (e.g., strings, aspect ratio, and TrueType fonts).


Updated CMakeRC to themarpe fork

Updated CMakeRC to themarpe fork

--- cmake/CMakeRC.cmake
+++ cmake/CMakeRC.cmake
@@ -1,36 +1,54 @@
 # This block is executed when generating an intermediate resource file, not when
 # running in CMake configure mode
 if(_CMRC_GENERATE_MODE)
-    # Read in the digits
-    file(READ "${INPUT_FILE}" bytes HEX)
-    # Format each pair into a character literal. Heuristics seem to favor doing
-    # the conversion in groups of five for fastest conversion
-    string(REGEX REPLACE "(..)(..)(..)(..)(..)" "'\\\\x\\1','\\\\x\\2','\\\\x\\3','\\\\x\\4','\\\\x\\5'," chars "${bytes}")
-    # Since we did this in groups, we have some leftovers to clean up
-    string(LENGTH "${bytes}" n_bytes2)
-    math(EXPR n_bytes "${n_bytes2} / 2")
-    math(EXPR remainder "${n_bytes} % 5") # <-- '5' is the grouping count from above
-    set(cleanup_re "$")
-    set(cleanup_sub )
-    while(remainder)
-        set(cleanup_re "(..)${cleanup_re}")
-        set(cleanup_sub "'\\\\x\\${remainder}',${cleanup_sub}")
-        math(EXPR remainder "${remainder} - 1")
-    endwhile()
-    if(NOT cleanup_re STREQUAL "$")
-        string(REGEX REPLACE "${cleanup_re}" "${cleanup_sub}" chars "${chars}")
-    endif()
-    string(CONFIGURE [[
-        namespace { const char file_array[] = { @chars@ }; }
+    if (NOT INCBIN_ENABLED)
+        # Read in the digits
+        file(READ "${INPUT_FILE}" bytes HEX)
+        # Format each pair into a character literal. Heuristics seem to favor doing
+        # the conversion in groups of five for fastest conversion
+        string(REGEX REPLACE "(..)(..)(..)(..)(..)" "'\\\\x\\1','\\\\x\\2','\\\\x\\3','\\\\x\\4','\\\\x\\5'," chars "${bytes}")
+        # Since we did this in groups, we have some leftovers to clean up
+        string(LENGTH "${bytes}" n_bytes2)
+        math(EXPR n_bytes "${n_bytes2} / 2")
+        math(EXPR remainder "${n_bytes} % 5") # <-- '5' is the grouping count from above
+        set(cleanup_re "$")
+        set(cleanup_sub )
+        while(remainder)
+            set(cleanup_re "(..)${cleanup_re}")
+            set(cleanup_sub "'\\\\x\\${remainder}',${cleanup_sub}")
+            math(EXPR remainder "${remainder} - 1")
+        endwhile()
+        if(NOT cleanup_re STREQUAL "$")
+            string(REGEX REPLACE "${cleanup_re}" "${cleanup_sub}" chars "${chars}")
+        endif()
+
+        string(CONFIGURE [[
+        namespace { const char file_array[] = { @chars@ 0 }; }
         namespace cmrc { namespace @NAMESPACE@ { namespace res_chars {
         extern const char* const @SYMBOL@_begin = file_array;
         extern const char* const @SYMBOL@_end = file_array + @n_bytes@;
         }}}
-    ]] code)
+        ]] code)
+
+    else()
+
+        string(CONFIGURE [[
+            #include <incbin/incbin.h>
+            namespace cmrc { namespace @NAMESPACE@ { namespace res_chars {
+            INCBIN(@SYMBOL@, "@INPUT_FILE@");
+            extern const char* const @SYMBOL@_begin = (const char*) g@SYMBOL@Data;
+            extern const char* const @SYMBOL@_end = (const char*) (g@SYMBOL@Data + g@SYMBOL@Size);
+            }}}
+        ]] code)
+
+    endif()
+
     file(WRITE "${OUTPUT_FILE}" "${code}")
     # Exit from the script. Nothing else needs to be processed
     return()
 endif()
+
+

 set(_version 2.0.0)

@@ -386,16 +404,457 @@
 endif()
 file(GENERATE OUTPUT "${cmrc_hpp}" CONTENT "${hpp_content}" CONDITION ${_generate})

+
+
+get_filename_component(_inc_gen_dir "${CMAKE_BINARY_DIR}/_cmrc/gen/include" ABSOLUTE)
+# Lets generate incbin.h file
+file(MAKE_DIRECTORY "${_inc_gen_dir}/incbin")
+
+# https://github.com/graphitemaster/incbin
+# incbin project
+# commit: 8cefe46d5380bf5ae4b4d87832d811f6692aae44
+set(incbin_h_content [==[
+/**
+ * @file incbin.h
+ * @author Dale Weiler
+ * @brief Utility for including binary files
+ *
+ * Facilities for including binary files into the current translation unit and
+ * making use from them externally in other translation units.
+ */
+#ifndef INCBIN_HDR
+#define INCBIN_HDR
+#include <limits.h>
+#if   defined(__AVX512BW__) || \
+      defined(__AVX512CD__) || \
+      defined(__AVX512DQ__) || \
+      defined(__AVX512ER__) || \
+      defined(__AVX512PF__) || \
+      defined(__AVX512VL__) || \
+      defined(__AVX512F__)
+# define INCBIN_ALIGNMENT_INDEX 6
+#elif defined(__AVX__)      || \
+      defined(__AVX2__)
+# define INCBIN_ALIGNMENT_INDEX 5
+#elif defined(__SSE__)      || \
+      defined(__SSE2__)     || \
+      defined(__SSE3__)     || \
+      defined(__SSSE3__)    || \
+      defined(__SSE4_1__)   || \
+      defined(__SSE4_2__)   || \
+      defined(__neon__)
+# define INCBIN_ALIGNMENT_INDEX 4
+#elif ULONG_MAX != 0xffffffffu
+# define INCBIN_ALIGNMENT_INDEX 3
+# else
+# define INCBIN_ALIGNMENT_INDEX 2
+#endif
+
+/* Lookup table of (1 << n) where `n' is `INCBIN_ALIGNMENT_INDEX' */
+#define INCBIN_ALIGN_SHIFT_0 1
+#define INCBIN_ALIGN_SHIFT_1 2
+#define INCBIN_ALIGN_SHIFT_2 4
+#define INCBIN_ALIGN_SHIFT_3 8
+#define INCBIN_ALIGN_SHIFT_4 16
+#define INCBIN_ALIGN_SHIFT_5 32
+#define INCBIN_ALIGN_SHIFT_6 64
+
+/* Actual alignment value */
+#define INCBIN_ALIGNMENT \
+    INCBIN_CONCATENATE( \
+        INCBIN_CONCATENATE(INCBIN_ALIGN_SHIFT, _), \
+        INCBIN_ALIGNMENT_INDEX)
+
+/* Stringize */
+#define INCBIN_STR(X) \
+    #X
+#define INCBIN_STRINGIZE(X) \
+    INCBIN_STR(X)
+/* Concatenate */
+#define INCBIN_CAT(X, Y) \
+    X ## Y
+#define INCBIN_CONCATENATE(X, Y) \
+    INCBIN_CAT(X, Y)
+/* Deferred macro expansion */
+#define INCBIN_EVAL(X) \
+    X
+#define INCBIN_INVOKE(N, ...) \
+    INCBIN_EVAL(N(__VA_ARGS__))
+
+/* Green Hills uses a different directive for including binary data */
+#if defined(__ghs__)
+#  if (__ghs_asm == 2)
+#    define INCBIN_MACRO ".file"
+/* Or consider the ".myrawdata" entry in the ld file */
+#  else
+#    define INCBIN_MACRO "\tINCBIN"
+#  endif
+#else
+#  define INCBIN_MACRO ".incbin"
+#endif
+
+#ifndef _MSC_VER
+#  define INCBIN_ALIGN \
+    __attribute__((aligned(INCBIN_ALIGNMENT)))
+#else
+#  define INCBIN_ALIGN __declspec(align(INCBIN_ALIGNMENT))
+#endif
+
+#if defined(__arm__) || /* GNU C and RealView */ \
+    defined(__arm) || /* Diab */ \
+    defined(_ARM) /* ImageCraft */
+#  define INCBIN_ARM
+#endif
+
+#ifdef __GNUC__
+/* Utilize .balign where supported */
+#  define INCBIN_ALIGN_HOST ".balign " INCBIN_STRINGIZE(INCBIN_ALIGNMENT) "\n"
+#  define INCBIN_ALIGN_BYTE ".balign 1\n"
+#elif defined(INCBIN_ARM)
+/*
+ * On arm assemblers, the alignment value is calculated as (1 << n) where `n' is
+ * the shift count. This is the value passed to `.align'
+ */
+#  define INCBIN_ALIGN_HOST ".align " INCBIN_STRINGIZE(INCBIN_ALIGNMENT_INDEX) "\n"
+#  define INCBIN_ALIGN_BYTE ".align 0\n"
+#else
+/* We assume other inline assembler's treat `.align' as `.balign' */
+#  define INCBIN_ALIGN_HOST ".align " INCBIN_STRINGIZE(INCBIN_ALIGNMENT) "\n"
+#  define INCBIN_ALIGN_BYTE ".align 1\n"
+#endif
+
+/* INCBIN_CONST is used by incbin.c generated files */
+#if defined(__cplusplus)
+#  define INCBIN_EXTERNAL extern "C"
+#  define INCBIN_CONST    extern const
+#else
+#  define INCBIN_EXTERNAL extern
+#  define INCBIN_CONST    const
+#endif
+
+/**
+ * @brief Optionally override the linker section into which data is emitted.
+ *
+ * @warning If you use this facility, you'll have to deal with platform-specific linker output
+ * section naming on your own
+ *
+ * Overriding the default linker output section, e.g for esp8266/Arduino:
+ * @code
+ * #define INCBIN_OUTPUT_SECTION ".irom.text"
+ * #include "incbin.h"
+ * INCBIN(Foo, "foo.txt");
+ * // Data is emitted into program memory that never gets copied to RAM
+ * @endcode
+ */
+#if !defined(INCBIN_OUTPUT_SECTION)
+#  if defined(__APPLE__)
+#    define INCBIN_OUTPUT_SECTION         ".const_data"
+#  else
+#    define INCBIN_OUTPUT_SECTION         ".rodata"
+#  endif
+#endif
+
+#if defined(__APPLE__)
+/* The directives are different for Apple branded compilers */
+#  define INCBIN_SECTION         INCBIN_OUTPUT_SECTION "\n"
+#  define INCBIN_GLOBAL(NAME)    ".globl " INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME "\n"
+#  define INCBIN_INT             ".long "
+#  define INCBIN_MANGLE          "_"
+#  define INCBIN_BYTE            ".byte "
+#  define INCBIN_TYPE(...)
+#else
+#  define INCBIN_SECTION         ".section " INCBIN_OUTPUT_SECTION "\n"
+#  define INCBIN_GLOBAL(NAME)    ".global " INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME "\n"
+#  if defined(__ghs__)
+#    define INCBIN_INT           ".word "
+#  else
+#    define INCBIN_INT           ".int "
+#  endif
+#  if defined(__USER_LABEL_PREFIX__)
+#    define INCBIN_MANGLE        INCBIN_STRINGIZE(__USER_LABEL_PREFIX__)
+#  else
+#    define INCBIN_MANGLE        ""
+#  endif
+#  if defined(INCBIN_ARM)
+/* On arm assemblers, `@' is used as a line comment token */
+#    define INCBIN_TYPE(NAME)    ".type " INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME ", %object\n"
+#  elif defined(__MINGW32__) || defined(__MINGW64__)
+/* Mingw doesn't support this directive either */
+#    define INCBIN_TYPE(NAME)
+#  else
+/* It's safe to use `@' on other architectures */
+#    define INCBIN_TYPE(NAME)    ".type " INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME ", @object\n"
+#  endif
+#  define INCBIN_BYTE            ".byte "
+#endif
+
+/* List of style types used for symbol names */
+#define INCBIN_STYLE_CAMEL 0
+#define INCBIN_STYLE_SNAKE 1
+
+/**
+ * @brief Specify the prefix to use for symbol names.
+ *
+ * By default this is `g', producing symbols of the form:
+ * @code
+ * #include "incbin.h"
+ * INCBIN(Foo, "foo.txt");
+ *
+ * // Now you have the following symbols:
+ * // const unsigned char gFooData[];
+ * // const unsigned char *const gFooEnd;
+ * // const unsigned int gFooSize;
+ * @endcode
+ *
+ * If however you specify a prefix before including: e.g:
+ * @code
+ * #define INCBIN_PREFIX incbin
+ * #include "incbin.h"
+ * INCBIN(Foo, "foo.txt");
+ *
+ * // Now you have the following symbols instead:
+ * // const unsigned char incbinFooData[];
+ * // const unsigned char *const incbinFooEnd;
+ * // const unsigned int incbinFooSize;
+ * @endcode
+ */
+#if !defined(INCBIN_PREFIX)
+#  define INCBIN_PREFIX g
+#endif
+
+/**
+ * @brief Specify the style used for symbol names.
+ *
+ * Possible options are
+ * - INCBIN_STYLE_CAMEL "CamelCase"
+ * - INCBIN_STYLE_SNAKE "snake_case"
+ *
+ * Default option is *INCBIN_STYLE_CAMEL* producing symbols of the form:
+ * @code
+ * #include "incbin.h"
+ * INCBIN(Foo, "foo.txt");
+ *
+ * // Now you have the following symbols:
+ * // const unsigned char <prefix>FooData[];
+ * // const unsigned char *const <prefix>FooEnd;
+ * // const unsigned int <prefix>FooSize;
+ * @endcode
+ *
+ * If however you specify a style before including: e.g:
+ * @code
+ * #define INCBIN_STYLE INCBIN_STYLE_SNAKE
+ * #include "incbin.h"
+ * INCBIN(foo, "foo.txt");
+ *
+ * // Now you have the following symbols:
+ * // const unsigned char <prefix>foo_data[];
+ * // const unsigned char *const <prefix>foo_end;
+ * // const unsigned int <prefix>foo_size;
+ * @endcode
+ */
+#if !defined(INCBIN_STYLE)
+#  define INCBIN_STYLE INCBIN_STYLE_CAMEL
+#endif
+
+/* Style lookup tables */
+#define INCBIN_STYLE_0_DATA Data
+#define INCBIN_STYLE_0_END End
+#define INCBIN_STYLE_0_SIZE Size
+#define INCBIN_STYLE_1_DATA _data
+#define INCBIN_STYLE_1_END _end
+#define INCBIN_STYLE_1_SIZE _size
+
+/* Style lookup: returning identifier */
+#define INCBIN_STYLE_IDENT(TYPE) \
+    INCBIN_CONCATENATE( \
+        INCBIN_STYLE_, \
+        INCBIN_CONCATENATE( \
+            INCBIN_EVAL(INCBIN_STYLE), \
+            INCBIN_CONCATENATE(_, TYPE)))
+
+/* Style lookup: returning string literal */
+#define INCBIN_STYLE_STRING(TYPE) \
+    INCBIN_STRINGIZE( \
+        INCBIN_STYLE_IDENT(TYPE)) \
+
+/* Generate the global labels by indirectly invoking the macro with our style
+ * type and concatenating the name against them. */
+#define INCBIN_GLOBAL_LABELS(NAME, TYPE) \
+    INCBIN_INVOKE( \
+        INCBIN_GLOBAL, \
+        INCBIN_CONCATENATE( \
+            NAME, \
+            INCBIN_INVOKE( \
+                INCBIN_STYLE_IDENT, \
+                TYPE))) \
+    INCBIN_INVOKE( \
+        INCBIN_TYPE, \
+        INCBIN_CONCATENATE( \
+            NAME, \
+            INCBIN_INVOKE( \
+                INCBIN_STYLE_IDENT, \
+                TYPE)))
+
+/**
+ * @brief Externally reference binary data included in another translation unit.
+ *
+ * Produces three external symbols that reference the binary data included in
+ * another translation unit.
+ *
+ * The symbol names are a concatenation of `INCBIN_PREFIX' before *NAME*; with
+ * "Data", as well as "End" and "Size" after. An example is provided below.
+ *
+ * @param NAME The name given for the binary data
+ *
+ * @code
+ * INCBIN_EXTERN(Foo);
+ *
+ * // Now you have the following symbols:
+ * // extern const unsigned char <prefix>FooData[];
+ * // extern const unsigned char *const <prefix>FooEnd;
+ * // extern const unsigned int <prefix>FooSize;
+ * @endcode
+ */
+#define INCBIN_EXTERN(NAME) \
+    INCBIN_EXTERNAL const INCBIN_ALIGN unsigned char \
+        INCBIN_CONCATENATE( \
+            INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
+            INCBIN_STYLE_IDENT(DATA))[]; \
+    INCBIN_EXTERNAL const INCBIN_ALIGN unsigned char *const \
+    INCBIN_CONCATENATE( \
+        INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
+        INCBIN_STYLE_IDENT(END)); \
+    INCBIN_EXTERNAL const unsigned int \
+        INCBIN_CONCATENATE( \
+            INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
+            INCBIN_STYLE_IDENT(SIZE))
+
+/**
+ * @brief Include a binary file into the current translation unit.
+ *
+ * Includes a binary file into the current translation unit, producing three symbols
+ * for objects that encode the data and size respectively.
+ *
+ * The symbol names are a concatenation of `INCBIN_PREFIX' before *NAME*; with
+ * "Data", as well as "End" and "Size" after. An example is provided below.
+ *
+ * @param NAME The name to associate with this binary data (as an identifier.)
+ * @param FILENAME The file to include (as a string literal.)
+ *
+ * @code
+ * INCBIN(Icon, "icon.png");
+ *
+ * // Now you have the following symbols:
+ * // const unsigned char <prefix>IconData[];
+ * // const unsigned char *const <prefix>IconEnd;
+ * // const unsigned int <prefix>IconSize;
+ * @endcode
+ *
+ * @warning This must be used in global scope
+ * @warning The identifiers may be different if INCBIN_STYLE is not default
+ *
+ * To externally reference the data included by this in another translation unit
+ * please @see INCBIN_EXTERN.
+ */
+#ifdef _MSC_VER
+#define INCBIN(NAME, FILENAME) \
+    INCBIN_EXTERN(NAME)
+#else
+#define INCBIN(NAME, FILENAME) \
+    __asm__(INCBIN_SECTION \
+            INCBIN_GLOBAL_LABELS(NAME, DATA) \
+            INCBIN_ALIGN_HOST \
+            INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(DATA) ":\n" \
+            INCBIN_MACRO " \"" FILENAME "\"\n" \
+            INCBIN_GLOBAL_LABELS(NAME, END) \
+            INCBIN_ALIGN_BYTE \
+            INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(END) ":\n" \
+                INCBIN_BYTE "1\n" \
+            INCBIN_GLOBAL_LABELS(NAME, SIZE) \
+            INCBIN_ALIGN_HOST \
+            INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(SIZE) ":\n" \
+                INCBIN_INT INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(END) " - " \
+                           INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(DATA) "\n" \
+            INCBIN_ALIGN_HOST \
+            ".text\n" \
+    ); \
+    INCBIN_EXTERN(NAME)
+
+#endif
+#endif
+]==])
+
+set(cmrc_incbin_h "${_inc_gen_dir}/incbin/incbin.h" CACHE INTERNAL "")
+set(_generate 1)
+if(EXISTS "${cmrc_incbin_h}")
+    file(READ "${cmrc_incbin_h}" _current)
+    if(_current STREQUAL incbin_h_content)
+        set(_generate 0)
+    endif()
+endif()
+file(WRITE "${cmrc_incbin_h}" "${incbin_h_content}")
+
 add_library(cmrc-base INTERFACE)
+# Add interface include for users of library
 target_include_directories(cmrc-base
     INTERFACE
         $<INSTALL_INTERFACE:include>
         "$<BUILD_INTERFACE:${CMRC_INCLUDE_DIR}>"
 )
+
 # Signal a basic C++11 feature to require C++11.
 target_compile_features(cmrc-base INTERFACE cxx_nullptr)
 set_property(TARGET cmrc-base PROPERTY INTERFACE_CXX_EXTENSIONS OFF)
 add_library(cmrc::base ALIAS cmrc-base)
+
+# Tests if compatible mode shall be set
+
+# Let's generate the test for incbin.h
+get_filename_component(_tests_gen_dir "${CMAKE_BINARY_DIR}/_cmrc/tests" ABSOLUTE)
+file(MAKE_DIRECTORY "${_tests_gen_dir}/out")
+
+# Create a sample input file
+set(test_txt_content [==[
+Hello World!
+]==])
+file(WRITE "${_tests_gen_dir}/test.txt" "${test_txt_content}")
+string(CONFIGURE [==[
+#define INCBIN_PREFIX g_
+#define INCBIN_STYLE INCBIN_STYLE_SNAKE
+#include <incbin/incbin.h>
+namespace test{
+    INCBIN(test, "@_tests_gen_dir@/test.txt");
+}
+int main(){
+    int sum = 0;
+    for(unsigned int i = 0; i<test::g_test_size; i++){
+        sum += test::g_test_data[i];
+    }
+    return sum;
+}
+]==] test_cpp_content @ONLY)
+file(WRITE "${_tests_gen_dir}/test.cpp" "${test_cpp_content}")
+
+message(STATUS "CMRC | Check for working incbin assembly directive")
+
+# Now try to compile
+try_compile(HAVE_INCBIN_CAPABILITY "${_tests_gen_dir}" "${_tests_gen_dir}/test.cpp"
+    CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${_inc_gen_dir}"
+)
+
+# Remove tests
+file(REMOVE_RECURSE "${_tests_gen_dir}")
+
+message(STATUS "CMRC | Check for working incbin assembly directive - ${HAVE_INCBIN_CAPABILITY}")
+
+# HAVE_INCBIN_CAPABILITY
+if (HAVE_INCBIN_CAPABILITY)
+    message(STATUS "CMRC | Using Incbin library for faster performance")
+else()
+    message(STATUS "CMRC | Compatible mode - creating intermidiate character array files")
+endif()
+
+

 function(cmrc_add_resource_library name)
     set(args ALIAS NAMESPACE)
@@ -473,6 +932,10 @@
     # with a character array compiled in containing the contents of the
     # corresponding resource file.
     add_library(${name} STATIC ${libcpp})
+
+    # Add private include to incbin/incbin.h
+    target_include_directories(${name} PRIVATE "${_inc_gen_dir}")
+
     set_property(TARGET ${name} PROPERTY CMRC_LIBDIR "${libdir}")
     set_property(TARGET ${name} PROPERTY CMRC_NAMESPACE "${ARG_NAMESPACE}")
     target_link_libraries(${name} PUBLIC cmrc::base)
@@ -572,7 +1035,7 @@
             _cm_encode_fpath(parent_sym "${dirpath}")
         endif()
         # Generate the rule for the intermediate source file
-        _cmrc_generate_intermediate_cpp(${lib_ns} ${sym} "${abs_out}" "${abs_in}")
+        _cmrc_generate_intermediate_cpp(${lib_ns} ${sym} "${abs_out}" "${abs_in}" "${HAVE_INCBIN_CAPABILITY}")
         target_sources(${name} PRIVATE "${abs_out}")
         set_property(TARGET ${name} APPEND PROPERTY CMRC_EXTERN_DECLS
             "// Pointers to ${input}"
@@ -595,7 +1058,7 @@
     endforeach()
 endfunction()

-function(_cmrc_generate_intermediate_cpp lib_ns symbol outfile infile)
+function(_cmrc_generate_intermediate_cpp lib_ns symbol outfile infile incbin_enabled)
     add_custom_command(
         # This is the file we will generate
         OUTPUT "${outfile}"
@@ -608,6 +1071,7 @@
                 -DSYMBOL=${symbol}
                 "-DINPUT_FILE=${infile}"
                 "-DOUTPUT_FILE=${outfile}"
+                "-DINCBIN_ENABLED=${incbin_enabled}"
                 -P "${_CMRC_SCRIPT}"
         COMMENT "Generating intermediate file for ${infile}"
     )


Curl is also needed by Paddle

Curl is also needed by Paddle

For usage stats.

--- cmake/package.cmake
+++ cmake/package.cmake
@@ -10,7 +10,7 @@
 set(CPACK_DEBIAN_PACKAGE_MAINTAINER PaddlePaddle Dev <paddle-dev@baidu.com>)
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Paddle")
 set(CPACK_PACKAGE_DESCRIPTION "")
-set(CPACK_DEBIAN_PACKAGE_DEPENDS "libatlas3-base, libgflags2, libgoogle-glog0, libprotobuf8, libpython2.7, libstdc++6, python-numpy, python-pip, python-pip-whl, python-protobuf")
+set(CPACK_DEBIAN_PACKAGE_DEPENDS "libatlas3-base, libgflags2, libgoogle-glog0, libprotobuf8, libpython2.7, libstdc++6, python-numpy, python-pip, python-pip-whl, python-protobuf, curl")
 set(CPACK_DEBIAN_PACKAGE_SECTION Devel)
 set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJ_ROOT}/paddle/scripts/deb/postinst")
 #set(CPACK_GENERATOR "DEB")


Added basicimageprocessing and registration

--- Applications/mitkDiffusion/target_libraries.cmake
+++ Applications/mitkDiffusion/target_libraries.cmake
@@ -18,4 +18,6 @@
   org_mitk_gui_qt_imagenavigator
   org_mitk_gui_qt_moviemaker
   org_mitk_gui_qt_measurementtoolbox
+  org_mitk_gui_qt_basicimageprocessing
+  org_mitk_gui_qt_registration
 )


Now included cmiss_interactive_tool.h in api_source_files.cmake. Tracker item 2841, https://tracker.physiomeproject.org/show_bug.cgi?id=2841

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@8330 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/cmake/api_source_files.cmake
+++ source/cmake/api_source_files.cmake
@@ -40,6 +40,7 @@
 	source/api/cmiss_graphic.h
 	source/api/cmiss_graphics_window.h
 	source/api/cmiss_idle.h
+	source/api/cmiss_interactive_tool.h
 	source/api/cmiss_material.h
 	source/api/cmiss_node.h
 	source/api/cmiss_region.h


Properly set variables in FindEDT

Properly set variables in FindEDT

--- cmake/V4RFindEDT.cmake
+++ cmake/V4RFindEDT.cmake
@@ -3,11 +3,11 @@
     v4r_clear_vars(EDT_FOUND)
   endif()
   if(NOT EDT_FOUND)
-    v4r_clear_vars(EDT_LIBRARY EDT_LIBRARIES EDT_INCLUDE_DIR)
+    v4r_clear_vars(EDT_LIBRARY EDT_LIBRARIES EDT_INCLUDE_DIRS)
     set(EDT_LIBRARY edt)
     set(EDT_LIBRARIES ${EDT_LIBRARY})
     add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/EDT")
-    set(EDT_INCLUDE_DIR "${V4R_SOURCE_DIR}/3rdparty")
+    set(EDT_INCLUDE_DIRS "${V4R_SOURCE_DIR}/3rdparty")
     #set(EDT_DEFINITIONS "")
   endif()
   set(HAVE_EDT YES)


Clarified problem with Boost 1.62.0

Clarified problem with Boost 1.62.0

--- cmake/find/boost.cmake
+++ cmake/find/boost.cmake
@@ -11,15 +11,15 @@
 	SET(Boost_USE_STATIC_RUNTIME OFF)

 	SET(BOOST_Components_List "")
-        LIST(APPEND BOOST_Components_List "system")
-        LIST(APPEND BOOST_Components_List "filesystem")
+	LIST(APPEND BOOST_Components_List "system")
+	LIST(APPEND BOOST_Components_List "filesystem")
 	LIST(APPEND BOOST_Components_List "program_options")
 	LIST(APPEND BOOST_Components_List "date_time")

 	IF ( Boost_VERSION VERSION_LESS 106200 )
 		FIND_PACKAGE(Boost COMPONENTS ${BOOST_Components_List} REQUIRED)
 	ELSE()
-		FIND_PACKAGE(Boost REQUIRED)
+		MESSAGE(FATAL_ERROR "Boost version ${Boost_VERSION} is not yet supported by CMake. Try installing version 106200 (1.62.0).")
 	ENDIF()

 	IF(Boost_FOUND)


Fix deploy script

Fix deploy script

--- cmake/frc-deploy.cmake
+++ cmake/frc-deploy.cmake
@@ -20,11 +20,35 @@

 set(USERNAME lvuser)
 set(DEPLOY_DIR /home/lvuser)
+set(TMP_SSH_HOSTS tmp_ssh_hosts.txt)
+set(SSH_FLAGS -o StrictHostKeyChecking=no -o UserKnownHostsFile=${TMP_SSH_HOSTS})
+file(WRITE ${TMP_SSH_HOSTS} "")
+
+function(log MESSAGE)
+    message("==> ${MESSAGE}")
+endfunction()
+
+function(run_ssh MESSAGE EXE)
+    log("${MESSAGE}")
+    list(REMOVE_AT ARGV 0 1)
+    string(TOLOWER ${EXE} EXE)
+    if(${EXE} STREQUAL ssh)
+        set(EXE ${SSH_EXECUTABLE})
+    elseif(${EXE} STREQUAL scp)
+        set(EXE ${SCP_EXECUTABLE})
+    else()
+        message(FATAL_ERROR "invalid executable: ${EXE} (needs ssh/scp)")
+    endif()
+    execute_process(COMMAND ${EXE} ${SSH_FLAGS} ${ARGV} RESULT_VARIABLE STATUS)
+    if (NOT(${STATUS} EQUAL 0))
+        message(FATAL_ERROR "SSH failed")
+    endif()
+endfunction()

 set(TARGET)
 foreach(CUR_TARGET "roboRIO-${TEAM_NUMBER}-FRC.local" "172.22.11.2" "10.${TEAM_NUMBER_HIGH}.${TEAM_NUMBER_LOW}.2")
-    message("Trying ${CUR_TARGET}")
-    execute_process(COMMAND ${SSH_EXECUTABLE} ${USERNAME}@${CUR_TARGET} rm -f ${DEPLOY_DIR}/FRCUserProgram
+    log("Trying ${CUR_TARGET}")
+    execute_process(COMMAND ${SSH_EXECUTABLE} ${SSH_FLAGS} ${USERNAME}@${CUR_TARGET} true
         RESULT_VARIABLE SSH_RESULT
         TIMEOUT 5
     )
@@ -36,38 +60,30 @@
 if (NOT TARGET)
     message(FATAL_ERROR "Could not find target")
 endif()
-message("Connected to ${TARGET}")
+log("Connected to ${TARGET}")

-function(run_ssh_safe MESSAGE)
-    message("${MESSAGE}")
-    list(REMOVE_AT ARGV 0)
-    execute_process(COMMAND ${ARGV} RESULT_VARIABLE STATUS)
-    if (NOT(${STATUS} EQUAL 0))
-        message(FATAL_ERROR "SSH failed")
-    endif()
-endfunction()
-
-run_ssh_safe("Copying over robot code"
-    ${SCP_EXECUTABLE}
-        ${ROBOT_EXECUTABLE}
-        ${USERNAME}@${TARGET}:${DEPLOY_DIR}/FRCUserProgram
+run_ssh("Copying over robot code"
+    scp
+    ${ROBOT_EXECUTABLE}
+    ${USERNAME}@${TARGET}:${DEPLOY_DIR}/FRCUserProgram
 )
-run_ssh_safe("Stopping netconsole-host"
-    ${SSH_EXECUTABLE}
-        ${USERNAME}@${TARGET}
-        killall -q netconsole-host || :
+run_ssh("Stopping netconsole-host"
+    ssh
+    ${USERNAME}@${TARGET}
+    "killall -q netconsole-host || :"
 )
-run_ssh_safe("Copying over robot start script"
-    ${SCP_EXECUTABLE}
-        ${WPILIB_HOME}/ant/robotCommand
-        ${USERNAME}@${TARGET}:${DEPLOY_DIR}
+run_ssh("Copying over robot start script"
+    scp
+    ${WPILIB_HOME}/ant/robotCommand
+    ${USERNAME}@${TARGET}:${DEPLOY_DIR}
 )
-run_ssh_safe("Restarting robot"
-    ${SSH_EXECUTABLE}
-        ${USERNAME}@${TARGET}
-        . /etc/profile.d/natinst-path.sh;
-        chmod a+x ${DEPLOY_DIR}/FRCUserProgram;
-        /usr/local/frc/bin/frcKillRobot.sh -t -r;
-        sync
+run_ssh("Restarting robot"
+    ssh
+    ${USERNAME}@${TARGET}
+    ". /etc/profile.d/natinst-path.sh\\\\;"
+    "chmod a+x ${DEPLOY_DIR}/FRCUserProgram\\\\;"
+    "/usr/local/frc/bin/frcKillRobot.sh -t -r\\\\;"
+    sync
 )
-message("Done.")
+log("Done.")
+file(REMOVE ${TMP_SSH_HOSTS})


Instead of splitting the libs ourselves, let cmake do that. Just add all libraries with   set(gd_LINK_FLAGS ${GD_LIBRARIES}) - old code still commented. Works with win32 compilers and cygwin. Hopefully also linux.

svn path=/trunk/; revision=7137

--- cmake/modules/gd.cmake
+++ cmake/modules/gd.cmake
@@ -73,15 +73,15 @@
   endforeach(DIR ${GD_INCLUDE_DIR})

   # Generate library link commands
-  set(gd_LINK_FLAGS)
-  foreach(DIR ${GD_LIBRARY_DIR})
-    set(gd_LINK_FLAGS "${gd_LINK_FLAGS} -L${DIR}")
-  endforeach(DIR ${GD_LIBRARY_DIR})
-  foreach(LIB ${GD_LIBRARIES})
-    get_filename_component(LIBNAME ${LIB} NAME_WE)
-    string(REGEX REPLACE "^lib" "-l" LIBSHORT ${LIBNAME})
-    set(gd_LINK_FLAGS "${gd_LINK_FLAGS} ${LIBSHORT}")
-  endforeach(LIB ${GD_LIBRARIES})
+  set(gd_LINK_FLAGS ${GD_LIBRARIES})
+  #foreach(DIR ${GD_LIBRARY_DIR})
+  #  set(gd_LINK_FLAGS "${gd_LINK_FLAGS} -L${DIR}")
+  #endforeach(DIR ${GD_LIBRARY_DIR})
+  #foreach(LIB ${GD_LIBRARIES})
+  #  get_filename_component(LIBNAME ${LIB} NAME_WE)
+  #  string(REGEX REPLACE "^lib" "-l" LIBSHORT ${LIBNAME})
+  #  set(gd_LINK_FLAGS "${gd_LINK_FLAGS} ${LIBSHORT}")
+  #endforeach(LIB ${GD_LIBRARIES})
   set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${gd_LINK_FLAGS})
 endif(PLD_png OR PLD_jpeg OR PLD_gif)


cmake: Add diskbuilder function to service cmakefiles, fix some dependency issues

--- etc/service.cmake
+++ etc/service.cmake
@@ -202,21 +202,33 @@
 set_target_properties(libgcc PROPERTIES LINKER_LANGUAGE C)
 set_target_properties(libgcc PROPERTIES IMPORTED_LOCATION $ENV{INCLUDEOS_PREFIX}/includeos/lib/libgcc.a)

-# (optional) list of memdisks
-set(MDCOUNTER 0)
-foreach(DISK ${MEMDISK})
-  MATH(EXPR VAR "${MDCOUNTER}+1")
+# add memdisk
+function(add_memdisk DISK)
   get_filename_component(DISK_RELPATH "${DISK}"
                          REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
   add_custom_command(
     OUTPUT  memdisk.o
     COMMAND python $ENV{INCLUDEOS_PREFIX}/includeos/memdisk/memdisk.py --file $ENV{INCLUDEOS_PREFIX}/includeos/memdisk/memdisk.asm ${DISK_RELPATH}
     COMMAND nasm -f elf $ENV{INCLUDEOS_PREFIX}/includeos/memdisk/memdisk.asm -o memdisk.o
+    DEPENDS ${DISK_RELPATH}
   )
-  add_library(disk${MDCOUNTER} STATIC memdisk.o)
-  set_target_properties(disk${MDCOUNTER} PROPERTIES LINKER_LANGUAGE CXX)
-  target_link_libraries(service --whole-archive disk${MDCOUNTER} --no-whole-archive)
-endforeach()
+  add_library(memdisk STATIC memdisk.o)
+  set_target_properties(memdisk PROPERTIES LINKER_LANGUAGE CXX)
+  target_link_libraries(service --whole-archive memdisk --no-whole-archive)
+endfunction()
+
+# automatically built memdisks
+function(diskbuilder FOLD DISK)
+  get_filename_component(REL_DISK "${DISK}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
+  get_filename_component(REL_PATH "${FOLD}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
+  add_custom_command(
+      OUTPUT  ${REL_DISK}
+      COMMAND $ENV{INCLUDEOS_PREFIX}/includeos/bin/diskbuilder -o ${REL_DISK} ${REL_PATH}
+    )
+  add_custom_target(diskbuilder ALL DEPENDS ${REL_DISK})
+  add_dependencies(service diskbuilder)
+  add_memdisk(${REL_DISK})
+endfunction()

 if(TARFILE)
   get_filename_component(TAR_RELPATH "${TARFILE}"
@@ -277,17 +289,18 @@
   set(STRIP_LV /bin/true)
 endif()

-add_custom_command(
-  TARGET  service POST_BUILD
+add_custom_target(
+  pruned_elf_symbols ALL
   COMMAND $ENV{INCLUDEOS_PREFIX}/includeos/bin/elf_syms ${BINARY}
   COMMAND ${CMAKE_OBJCOPY} --update-section .elf_symbols=_elf_symbols.bin ${BINARY} ${BINARY}
   COMMAND ${STRIP_LV}
   COMMAND rm _elf_symbols.bin
+  DEPENDS service
 )

 # create .img files too automatically
-add_custom_command(
-  TARGET  service POST_BUILD
+add_custom_target(
+  prepend_bootloader ALL
   COMMAND $ENV{INCLUDEOS_PREFIX}/includeos/bin/vmbuild ${BINARY} $ENV{INCLUDEOS_PREFIX}/includeos/boot/bootloader
   DEPENDS service
 )


ENH: update git tag for TemporalGapfilling module

--- Modules/Remote/temporal-gapfilling.remote.cmake
+++ Modules/Remote/temporal-gapfilling.remote.cmake
@@ -27,5 +27,5 @@
 "
   GIT_REPOSITORY https://gitlab.orfeo-toolbox.org/jinglada/temporalgapfilling.git
   # Commit on develop branch which includes patches for Windows support
-  GIT_TAG 4fc4a71acf7b9b051cda5a3b950de2cdb9d26287
+  GIT_TAG 9d97764f0411de1a32dd5e0a90bdcdd8adfa049f
 )


Tentative PNG fix.

Tentative PNG fix.

--- VAD_ZLIB.cmake
+++ VAD_ZLIB.cmake
@@ -34,8 +34,12 @@
     endif()
     # NOTE: ZLIB_LIBRARY is not part of the public info exported by FindZLIB, but some packages use it nevertheless.
     set(ZLIB_LIBRARY "${ZLIB_LIBRARIES}" CACHE STRING "")
+    # Same for the include dir.
+    set(ZLIB_INCLUDE_DIR "${ZLIB_INCLUDE_DIRS}" CACHE STRING "")
     mark_as_advanced(FORCE ZLIB_INCLUDE_DIRS)
     mark_as_advanced(FORCE ZLIB_LIBRARIES)
+    mark_as_advanced(FORCE ZLIB_INCLUDE_DIR)
+    mark_as_advanced(FORCE ZLIB_LIBRARY)
     # Fetch the full version string from zlib.h, and populate the versioning variable provided by FindZLIB.
     file(READ ${VAD_EXTERNAL_ROOT}/ZLIB/zlib.h _zlib_h_contents)
     string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"


Update SS download link

Update SS download link

Closes #52

--- checkGetSuiteSparse.cmake
+++ checkGetSuiteSparse.cmake
@@ -40,7 +40,7 @@

 if(SUITESPARSE_DL_LAST)
 	# JL says: It seems the "current" symlink in the server is no longer available... we'll have to update this manually :-(
-	set(SUITESPARSE_URL "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.4.3.tar.gz")
+	set(SUITESPARSE_URL "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.6.tar.gz")
 	set(SUITESPARSE_ZIP "${CMAKE_SOURCE_DIR}/SuiteSparse.tar.gz")
 	if(SUITESPARSE_URL AND SUITESPARSE_ZIP)


Fix module for finding glew?

Fix module for finding glew?

--- cmake/FindGLEW.cmake
+++ cmake/FindGLEW.cmake
@@ -33,10 +33,8 @@

 set(GLEW_PATHS ${GLEW_ROOT} $ENV{GLEW_ROOT} )

-if(NOT DEFINED DEBUG_LIB_SUFFIX)
-	# TODO: Suffix must be -d. Workaround for now.
-	set(DEBUG_LIB_SUFFIX d)
-endif()
+# TODO: Suffix must be -d. Workaround for now.
+set(GLEW_DEBUG_LIB_SUFFIX d)

 find_path(GLEW_INCLUDE_DIR GL/glew.h
 	PATH_SUFFIXES include PATHS ${GLEW_PATHS}
@@ -44,14 +42,14 @@

 find_library(GLEW_LIBRARY NAMES libglew32
 	PATH_SUFFIXES lib
-	PATHS ${CPPFORMAT_PATHS}
+	PATHS ${GLEW_PATHS}
 )

-find_library(GLEW_LIBRARY_DEBUG NAMES cppformat${DEBUG_LIB_SUFFIX}
+find_library(GLEW_LIBRARY_DEBUG NAMES "libglew32${GLEW_DEBUG_LIB_SUFFIX}"
 	PATH_SUFFIXES lib
-	PATHS ${CPPFORMAT_PATHS}
+	PATHS ${GLEW_PATHS}
 )

 include(FindPackageHandleStandardArgs)

-find_package_handle_standard_args(CPPFORMAT REQUIRED_VARS CPPFORMAT_INCLUDE_DIR CPPFORMAT_LIBRARY CPPFORMAT_LIBRARY_DEBUG)+find_package_handle_standard_args(GLEW REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY GLEW_LIBRARY_DEBUG)


fix finding teem

fix finding teem

virvo #includes <teem/...>

--- cmake/FindTeem.cmake
+++ cmake/FindTeem.cmake
@@ -11,7 +11,7 @@

 find_path(TEEM_INCLUDE_DIR
   NAMES
-    nrrd.h
+    teem/nrrd.h
   HINTS
     ${hints}
   PATHS


build: make sure LLVM is exactly correct

 * check the version to be the correct major version
 * ensure that it has all the default targets enabled

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -15,14 +15,50 @@
         "c:/msys64/mingw64/bin"
         "C:/Libraries/llvm-7.0.0/bin")

+if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
+  message(FATAL_ERROR "unable to find llvm-config")
+endif()
+
 execute_process(
 	COMMAND ${LLVM_CONFIG_EXE} --version
 	OUTPUT_VARIABLE LLVM_CONFIG_VERSION
 	OUTPUT_STRIP_TRAILING_WHITESPACE)

-if(LLVM_CONFIG_VERSION VERSION_LESS 7)
-  message(FATAL_ERROR "expected LLVM version >=7 but found ${LLVM_CONFIG_VERSION}")
+if("${LLVM_CONFIG_VERSION}" VERSION_LESS 7)
+  message(FATAL_ERROR "expected LLVM 7.x but found ${LLVM_CONFIG_VERSION}")
 endif()
+if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 8)
+  message(FATAL_ERROR "expected LLVM 7.x but found ${LLVM_CONFIG_VERSION}")
+endif()
+if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 8)
+  message(FATAL_ERROR "expected LLVM 7.x but found ${LLVM_CONFIG_VERSION}")
+endif()
+
+execute_process(
+	COMMAND ${LLVM_CONFIG_EXE} --targets-built
+    OUTPUT_VARIABLE LLVM_TARGETS_BUILT_SPACES
+	OUTPUT_STRIP_TRAILING_WHITESPACE)
+string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}")
+function(NEED_TARGET TARGET_NAME)
+    list (FIND LLVM_TARGETS_BUILT "${TARGET_NAME}" _index)
+    if (${_index} EQUAL -1)
+        message(FATAL_ERROR "LLVM is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
+    endif()
+endfunction(NEED_TARGET)
+NEED_TARGET("AArch64")
+NEED_TARGET("AMDGPU")
+NEED_TARGET("ARM")
+NEED_TARGET("BPF")
+NEED_TARGET("Hexagon")
+NEED_TARGET("Lanai")
+NEED_TARGET("Mips")
+NEED_TARGET("MSP430")
+NEED_TARGET("NVPTX")
+NEED_TARGET("PowerPC")
+NEED_TARGET("Sparc")
+NEED_TARGET("SystemZ")
+NEED_TARGET("X86")
+NEED_TARGET("XCore")

 if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC)
   execute_process(


fix the list of llvm libraries

fix the list of llvm libraries

not sure what "HelloNew" was doing in there

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -219,6 +219,7 @@
   FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyCodeGen)
   FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDesc)
+  FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyUtils)
   FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMSystemZDisassembler)
   FIND_AND_ADD_LLVM_LIB(LLVMSystemZAsmParser)
@@ -294,11 +295,12 @@
   FIND_AND_ADD_LLVM_LIB(LLVMOrcJIT)
   FIND_AND_ADD_LLVM_LIB(LLVMMCJIT)
   FIND_AND_ADD_LLVM_LIB(LLVMJITLink)
-  FIND_AND_ADD_LLVM_LIB(LLVMOrcTargetProcess)
-  FIND_AND_ADD_LLVM_LIB(LLVMOrcShared)
   FIND_AND_ADD_LLVM_LIB(LLVMInterpreter)
   FIND_AND_ADD_LLVM_LIB(LLVMExecutionEngine)
   FIND_AND_ADD_LLVM_LIB(LLVMRuntimeDyld)
+  FIND_AND_ADD_LLVM_LIB(LLVMOrcTargetProcess)
+  FIND_AND_ADD_LLVM_LIB(LLVMOrcShared)
+  FIND_AND_ADD_LLVM_LIB(LLVMDWP)
   FIND_AND_ADD_LLVM_LIB(LLVMSymbolize)
   FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoPDB)
   FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoGSYM)
@@ -311,7 +313,6 @@
   FIND_AND_ADD_LLVM_LIB(LLVMCFGuard)
   FIND_AND_ADD_LLVM_LIB(LLVMCoroutines)
   FIND_AND_ADD_LLVM_LIB(LLVMObjCARCOpts)
-  FIND_AND_ADD_LLVM_LIB(LLVMHelloNew)
   FIND_AND_ADD_LLVM_LIB(LLVMipo)
   FIND_AND_ADD_LLVM_LIB(LLVMVectorize)
   FIND_AND_ADD_LLVM_LIB(LLVMLinker)
@@ -323,6 +324,7 @@
   FIND_AND_ADD_LLVM_LIB(LLVMGlobalISel)
   FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
   FIND_AND_ADD_LLVM_LIB(LLVMAsmPrinter)
+  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoMSF)
   FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARF)
   FIND_AND_ADD_LLVM_LIB(LLVMSelectionDAG)
   FIND_AND_ADD_LLVM_LIB(LLVMCodeGen)
@@ -344,7 +346,6 @@
   FIND_AND_ADD_LLVM_LIB(LLVMMCParser)
   FIND_AND_ADD_LLVM_LIB(LLVMMC)
   FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)
-  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoMSF)
   FIND_AND_ADD_LLVM_LIB(LLVMBitReader)
   FIND_AND_ADD_LLVM_LIB(LLVMCore)
   FIND_AND_ADD_LLVM_LIB(LLVMRemarks)


fix +XOP+FMA4 builds: cmake did not behave as I expected

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -373,9 +373,16 @@
             set(_ok TRUE)
             break()
          endif()
-         AddCompilerFlag(${_flag} CXX_RESULT _ok)
+         string(REPLACE " " ";" _flag_list "${_flag}")
+         foreach(_flag ${_flag_list})
+            message(STATUS "at ${_impl}, testing ${_flag}")
+            AddCompilerFlag(${_flag} CXX_RESULT _ok)
+            if(NOT _ok)
+               break()
+            endif()
+         endforeach()
          if(_ok)
-            set(_extra_flags ${_flag})
+            set(_extra_flags ${_flag_list})
             break()
          endif()
       endforeach()
@@ -477,15 +484,15 @@
       _vc_compile_one_implementation(${_objs} AVX      "-mavx"    "-xAVX"    "/arch:AVX")
       if(NOT Vc_FMA4_INTRINSICS_BROKEN)
          _vc_compile_one_implementation(${_objs} SSE+FMA4 "-mfma4"         ""    "")
-         _vc_compile_one_implementation(${_objs} AVX+FMA4 "-mavx;-mfma4"   ""    "")
+         _vc_compile_one_implementation(${_objs} AVX+FMA4 "-mavx -mfma4"   ""    "")
       endif()
       if(NOT Vc_XOP_INTRINSICS_BROKEN)
          _vc_compile_one_implementation(${_objs} SSE+XOP "-mxop"         ""    "")
-         _vc_compile_one_implementation(${_objs} AVX+XOP "-mavx;-mxop"   ""    "")
+         _vc_compile_one_implementation(${_objs} AVX+XOP "-mavx -mxop"   ""    "")
          if(NOT Vc_FMA4_INTRINSICS_BROKEN)
-            _vc_compile_one_implementation(${_objs} SSE+XOP+FMA4 "-mxop;-mfma4"        ""    "")
-            _vc_compile_one_implementation(${_objs} AVX+XOP+FMA4 "-mavx;-mxop;-mfma4"  ""    "")
-         endif()
-      endif()
-   endif()
-endmacro()
+            _vc_compile_one_implementation(${_objs} SSE+XOP+FMA4 "-mxop -mfma4"        ""    "")
+            _vc_compile_one_implementation(${_objs} AVX+XOP+FMA4 "-mavx -mxop -mfma4"  ""    "")
+         endif()
+      endif()
+   endif()
+endmacro()


adds -target 6 to lcmtypes.cmake

adds -target 6 to lcmtypes.cmake

git-svn-id: cf55bc44fb097054a32fc70455a459c940dbbffc@7159 c9849af7-e679-4ec6-a44e-fc146a885bd3

--- cmake/lcmtypes.cmake
+++ cmake/lcmtypes.cmake
@@ -383,14 +383,14 @@
     foreach(javafile ${_lcmtypes_java_files})
         string(REPLACE .java .class __tmp_class_fname ${javafile})
         #        add_custom_command(OUTPUT ${__tmp_class_fname} COMMAND
-        #            ${JAVA_COMPILE} -source 6 -cp ${_lcmtypes_java_dir}:${lcm_jar} ${javafile} VERBATIM DEPENDS ${javafile})
+        #            ${JAVA_COMPILE} -source 6 -target 6 -cp ${_lcmtypes_java_dir}:${lcm_jar} ${javafile} VERBATIM DEPENDS ${javafile})
         list(APPEND _lcmtypes_class_files ${__tmp_class_fname})
         unset(__tmp_class_fname)
     endforeach()

     # add a rule to build the .class files from from the .java files
     add_custom_command(OUTPUT ${_lcmtypes_class_files} COMMAND
-        ${JAVA_COMPILE} -source 6 -cp ${java_classpath} ${_lcmtypes_java_files}
+        ${JAVA_COMPILE} -source 6 -target 6 -cp ${java_classpath} ${_lcmtypes_java_files}
         DEPENDS ${_lcmtypes_java_files} VERBATIM)

     # add a rule to build a .jar file from the .class files


Respect a user's CMAKE_INSTALL_PREFIX (#294)

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

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

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


refix the librt check for mingw/win/apple (missed the problem building only on lucid).

--- cmake/tools/rt.cmake
+++ cmake/tools/rt.cmake
@@ -31,14 +31,12 @@
 # message("CMAKE_SYSTEM_LIBRARY_PATH: ${CMAKE_SYSTEM_LIBRARY_PATH}")
 # message("CMAKE_VERSION=${CMAKE_VERSION}")

-if(NOT APPLE)
+if(NOT (APPLE OR WIN32 OR MINGW))
   if (${CMAKE_VERSION} VERSION_LESS 2.8.4)
-    if(NOT (WIN32 OR MINGW))
-      # cmake later than 2.8.0 appears to have a better find_library
-      # that knows about the ABI of the compiler.  For lucid we just
-      # depend on the linker to find it for us.
-      set(RT_LIBRARY rt CACHE FILEPATH "Hacked find of rt for cmake < 2.8.4")
-    endif()
+    # cmake later than 2.8.0 appears to have a better find_library
+    # that knows about the ABI of the compiler.  For lucid we just
+    # depend on the linker to find it for us.
+    set(RT_LIBRARY rt CACHE FILEPATH "Hacked find of rt for cmake < 2.8.4")
   else()
     find_library(RT_LIBRARY rt)
     assert_file_exists(${RT_LIBRARY} "RT Library")


set GSTREAMER_VERSION

set GSTREAMER_VERSION

svn path=/trunk/kdesupport/phonon/; revision=879853

--- cmake/FindGStreamer.cmake
+++ cmake/FindGStreamer.cmake
@@ -5,6 +5,7 @@
 #  GSTREAMER_INCLUDE_DIR - the GStreamer include directory
 #  GSTREAMER_LIBRARIES - the libraries needed to use GStreamer
 #  GSTREAMER_DEFINITIONS - Compiler switches required for using GStreamer
+#  GSTREAMER_VERSION - the version of GStreamer

 # Copyright (c) 2008 Helio Chissini de Castro, <helio@kde.org>
 #  (c)2006, Tim Beaulen <tbscope@gmail.com>
@@ -25,6 +26,7 @@
    # in the FIND_PATH() and FIND_LIBRARY() calls
    # don't make this check required - otherwise you can't use macro_optional_find_package on this one
    PKG_CHECK_MODULES(PKG_GSTREAMER gstreamer-0.10)
+   SET(GSTREAMER_VERSION ${PKG_GSTREAMER_VERSION})
    SET(GSTREAMER_DEFINITIONS ${PKG_GSTREAMER_CFLAGS})
 ENDIF (NOT WIN32)


Change project naming for non-monolithic builds:

Game (static lib): ${name}-game
Exe: ${game}
DLL: ${game}-dll

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -431,19 +431,22 @@
 		add_executable(${name} WIN32 ${proj_sources} ${proj_headers})
 		target_compile_definitions(${name} PUBLIC HALLEY_EXECUTABLE)
 	else()
-		add_library(${name} STATIC ${proj_sources} ${proj_headers})
+		add_library(${name}-game STATIC ${proj_sources} ${proj_headers})
 		add_library(${name}-dll SHARED ${HALLEY_PATH}/src/entry/halley_dll_entry.cpp)

 		if (BUILD_MACOSX_BUNDLE)
-			add_executable(${name}-exe MACOSX_BUNDLE ${HALLEY_PATH}/src/entry/halley_exe_entry.cpp)
+			add_executable(${name} MACOSX_BUNDLE ${HALLEY_PATH}/src/entry/halley_exe_entry.cpp)
 		else()
-			add_executable(${name}-exe WIN32 ${HALLEY_PATH}/src/entry/halley_exe_entry.cpp)
-		endif()
-		set_target_properties(${name}-exe PROPERTIES OUTPUT_NAME ${name})
+			add_executable(${name} WIN32 ${HALLEY_PATH}/src/entry/halley_exe_entry.cpp)
+		endif()
+		#set_target_properties(${name}-exe PROPERTIES OUTPUT_NAME ${name})
+
+		add_dependencies(${name}-dll ${name}-game)
+		add_dependencies(${name} ${name}-game)

-		target_compile_definitions(${name} PUBLIC HALLEY_STATIC_LIBRARY)
+		target_compile_definitions(${name}-game PUBLIC HALLEY_STATIC_LIBRARY)
 		target_compile_definitions(${name}-dll PUBLIC HALLEY_SHARED_LIBRARY)
-		target_compile_definitions(${name}-exe PUBLIC HALLEY_EXECUTABLE)
+		target_compile_definitions(${name} PUBLIC HALLEY_EXECUTABLE)

 		# Setup default run paths for DLL
 		# Note that I'm using release halley-cmd for debug, as currently they have the same name
@@ -455,12 +458,16 @@
 		endif()

 		# Setup a gamebins target for external building
-		add_custom_target(${name}-gamebins DEPENDS ${name}-exe ${name}-dll)
+		add_custom_target(${name}-gamebins DEPENDS ${name} ${name}-dll)
 	endif()

 	if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
 		if (USE_PCH)
-			add_precompiled_header(${name} prec.h FORCEINCLUDE SOURCE_CXX prec.cpp)
+			if (HALLEY_MONOLITHIC)
+				add_precompiled_header(${name} prec.h FORCEINCLUDE SOURCE_CXX prec.cpp)
+			else()
+				add_precompiled_header(${name}-game prec.h FORCEINCLUDE SOURCE_CXX prec.cpp)
+			endif()
 		endif ()
 		set_target_properties(${name} PROPERTIES LINK_FLAGS_RELEASE "/PDBSTRIPPED:\"${targetDir}/${name}_stripped.pdb\"")
 	endif()
@@ -506,14 +513,14 @@
 	if (HALLEY_MONOLITHIC)
 		target_link_libraries(${name} ${LINK_LIBRARIES})
 	else ()
-		target_link_libraries(${name}-exe ${name} ${LINK_LIBRARIES})
-		target_link_libraries(${name}-dll ${name} ${LINK_LIBRARIES})
+		target_link_libraries(${name} ${name}-game ${LINK_LIBRARIES})
+		target_link_libraries(${name}-dll ${name}-game ${LINK_LIBRARIES})
 	endif()

 	if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "WindowsStore")
 		set_target_properties(${name} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
-		if (TARGET ${name}-exe)
-			set_target_properties(${name}-exe PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
+		if (TARGET ${name}-game)
+			set_target_properties(${name}-game PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
 		endif()
 		if (TARGET ${name}-dll)
 			set_target_properties(${name}-dll PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})


Use CMake 3.16's precompiled header support, on all platforms.

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -1,5 +1,4 @@
-include(PrecompiledHeader)
-
+cmake_minimum_required (VERSION 3.16)

 function(string_starts_with str prefix var)
   string(LENGTH "${str}" str_length)
@@ -461,14 +460,13 @@
 		add_custom_target(${name}-gamebins DEPENDS ${name} ${name}-dll)
 	endif()

+	if (HALLEY_MONOLITHIC)
+		target_precompile_headers(${name} PRIVATE prec.h)
+	else()
+		target_precompile_headers(${name}-game PRIVATE prec.h)
+	endif()
+
 	if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
-		if (USE_PCH)
-			if (HALLEY_MONOLITHIC)
-				add_precompiled_header(${name} prec.h FORCEINCLUDE SOURCE_CXX prec.cpp)
-			else()
-				add_precompiled_header(${name}-game prec.h FORCEINCLUDE SOURCE_CXX prec.cpp)
-			endif()
-		endif ()
 		set_target_properties(${name} PROPERTIES LINK_FLAGS_RELEASE "/PDBSTRIPPED:\"${targetDir}/${name}_stripped.pdb\"")
 	endif()


change c++11 to c++1y

change c++11 to c++1y

--- cmake/gcc-toolchain.cmake
+++ cmake/gcc-toolchain.cmake
@@ -1,7 +1,7 @@
 SET (CMAKE_C_COMPILER /usr/bin/gcc)
 SET (CMAKE_C_FLAGS          "-std=c99 -march=x86-64 -m64 -Winline")
 SET (CMAKE_CXX_COMPILER /usr/bin/g++)
-SET (CMAKE_CXX_FLAGS        "-std=c++11 -march=x86-64 -m64 -Winline -fno-omit-frame-pointer -fPIC -I/usr/local/include -Wall -Wextra -Woverloaded-virtual -Wno-unused-local-typedefs --param inline-unit-growth=150 --param max-inline-insns-single=500 --param large-function-growth=600")
+SET (CMAKE_CXX_FLAGS        "-std=c++1y -march=x86-64 -m64 -Winline -fno-omit-frame-pointer -fPIC -I/usr/local/include -Wall -Wextra -Woverloaded-virtual -Wno-unused-local-typedefs --param inline-unit-growth=150 --param max-inline-insns-single=500 --param large-function-growth=600")
 SET (CMAKE_INCLUDE_SYSTEM_FLAG_CXX "isystem")

 set (CMAKE_C_FLAGS          "${CMAKE_C_FLAGS}" CACHE STRING "c flags")


Fixing override of existing target properties

Change-Id: If77bb7b079f8eb46cd770661d08f2af545d91717

--- cmake/internal/doit.cmake
+++ cmake/internal/doit.cmake
@@ -82,7 +82,11 @@

 					LINK_DIRECTORIES(${GoogleTest_LIBRARY_DIRS} ${GoogleMock_LIBRARY_DIRS} ${external_package_link_directories})
 					ADD_EXECUTABLE(${CURRENT_MODULE_NAME}Test ${${CURRENT_MODULE_NAME}_TEST_FILES} ${${CURRENT_MODULE_NAME}_TEST_MAIN})
-					SET_TARGET_PROPERTIES(${CURRENT_MODULE_NAME}Test PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_MODULE_NAME}/include;${include_dirs};${test_path};${GoogleTest_INCLUDE_DIRS};${GoogleMock_INCLUDE_DIRS}")
+					GET_TARGET_PROPERTY(PREVIOUS_DIRS  ${CURRENT_MODULE_NAME}Test INCLUDE_DIRECTORIES)
+					IF ("${PREVIOUS_DIRS}" STREQUAL "PREVIOUS_DIRS-NOTFOUND")
+						SET(PREVIOUS_DIRS "")
+					ENDIF()
+					SET_TARGET_PROPERTIES(${CURRENT_MODULE_NAME}Test PROPERTIES INCLUDE_DIRECTORIES "${PREVIOUS_DIRS};${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_MODULE_NAME}/include;${include_dirs};${test_path};${GoogleTest_INCLUDE_DIRS};${GoogleMock_INCLUDE_DIRS}")
 					INTERNAL_ADD_FLAGS_TO_TEST_TARGET()

 					MESSAGE(VERBOSE  "${CURRENT_MODULE_NAME} contains unit tests, building ${CURRENT_MODULE_NAME}Test")
@@ -300,7 +304,11 @@

 MACRO(INTERNAL_SET_MODULE_TARGET_PROPERTIES)
-	SET_TARGET_PROPERTIES(${CURRENT_MODULE_NAME} PROPERTIES INCLUDE_DIRECTORIES "${include_dirs};${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_MODULE_NAME}/include")
+	GET_TARGET_PROPERTY(PREVIOUS_DIRS  ${CURRENT_MODULE_NAME} INCLUDE_DIRECTORIES)
+	IF ("${PREVIOUS_DIRS}" STREQUAL "PREVIOUS_DIRS-NOTFOUND")
+		SET(PREVIOUS_DIRS "")
+	ENDIF()
+	SET_TARGET_PROPERTIES(${CURRENT_MODULE_NAME} PROPERTIES INCLUDE_DIRECTORIES "${include_dirs};${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_MODULE_NAME}/include;${PREVIOUS_DIRS}")
 	SET_TARGET_PROPERTIES(${CURRENT_MODULE_NAME} PROPERTIES LINKER_LANGUAGE CXX)
 ENDMACRO(INTERNAL_SET_MODULE_TARGET_PROPERTIES)


Disabling gmm_test.py on Windows builds as it's flaky on GPU nightly builds.

--- tensorflow/contrib/cmake/tf_tests.cmake
+++ tensorflow/contrib/cmake/tf_tests.cmake
@@ -183,6 +183,8 @@
     # Loading resources in contrib doesn't seem to work on Windows
     "${tensorflow_source_dir}/tensorflow/contrib/tensor_forest/client/random_forest_test.py"
     "${tensorflow_source_dir}/tensorflow/contrib/tensor_forest/python/tensor_forest_test.py"
+    # Test is flaky on Windows GPU builds (b/38283730).
+    "${tensorflow_source_dir}/tensorflow/contrib/factorization/python/ops/gmm_test.py"
   )
   if (WIN32)
     set(tf_test_src_py_exclude


update protobuf

update protobuf

--- 3rd_party/protobuf/protobuf.cmake
+++ 3rd_party/protobuf/protobuf.cmake
@@ -21,8 +21,8 @@
         PREBUILD_COMMAND "./autogen.sh"
         WORKING_DIRECTORY "${3RD_PARTY_PROTOBUF_PKG_DIR}"
         PREFIX_DIRECTORY "${3RD_PARTY_PROTOBUF_ROOT_DIR}"
-        SRC_DIRECTORY_NAME "protobuf-3.2.0"
-        TAR_URL "https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz"
+        SRC_DIRECTORY_NAME "protobuf-3.3.0"
+        TAR_URL "https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz"
     )
     # try again, cached vars wiil cause find failed.
     if (NOT PROTOBUF_FOUND OR NOT PROTOBUF_PROTOC_EXECUTABLE OR NOT Protobuf_INCLUDE_DIRS OR NOT Protobuf_LIBRARY)


CMake: Transitioned Stout tests to use new third-party build scripts.

Review: https://reviews.apache.org/r/38753

--- 3rdparty/libprocess/3rdparty/stout/cmake/StoutTestsConfigure.cmake
+++ 3rdparty/libprocess/3rdparty/stout/cmake/StoutTestsConfigure.cmake
@@ -55,39 +55,28 @@
   )

 if (WIN32)
-  set(STOUT_TEST_DEPENDENCIES
-    ${STOUT_TEST_DEPENDENCIES}
-    ${CURL_TARGET}
-  )
-endif(WIN32)
+  set(STOUT_TEST_DEPENDENCIES ${STOUT_TEST_DEPENDENCIES} ${CURL_TARGET})
+endif (WIN32)

 # DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
 # headers for our third party libs (e.g., -I/path/to/glog on Linux)..
 ###############################################################################
 set(STOUT_TEST_INCLUDE_DIRS
   ${STOUT_TEST_INCLUDE_DIRS}
-  ${STOUT}/include
-  ${BOOST_ROOT}
-  ${PICOJSON_ROOT}
+  ${STOUT_INCLUDE_DIR}
+  ${BOOST_INCLUDE_DIR}
+  ${PICOJSON_INCLUDE_DIR}
   ${APR_INCLUDE_DIR}
   ${SVN_INCLUDE_DIR}
-  ${GMOCK_ROOT}/include
-  ${GTEST_SRC}/include
-  ${PROTOBUF_LIB}/include
+  ${GMOCK_INCLUDE_DIR}
+  ${GTEST_INCLUDE_DIR}
+  ${PROTOBUF_INCLUDE_DIR}
   src
+  ${GLOG_INCLUDE_DIR}
   )

 if (WIN32)
-  set(STOUT_TEST_INCLUDE_DIRS
-    ${STOUT_TEST_INCLUDE_DIRS}
-    ${GLOG_ROOT}/src/windows
-    ${CURL_ROOT}/include
-    )
-else (WIN32)
-  set(STOUT_TEST_INCLUDE_DIRS
-    ${STOUT_TEST_INCLUDE_DIRS}
-    ${GLOG_LIB}/include
-    )
+  set(STOUT_TEST_INCLUDE_DIRS ${STOUT_TEST_INCLUDE_DIRS} ${CURL_INCLUDE_DIR})
 endif (WIN32)

 # DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
@@ -98,29 +87,14 @@
   ${STOUT_TEST_LIB_DIRS}
   ${APR_LIBS}
   ${SVN_LIBS}
-  ${GMOCK_ROOT}-build/lib/.libs
+  ${GMOCK_LIB_DIR}
   ${GMOCK_ROOT}-build/gtest/lib/.libs
+  ${GLOG_LIB_DIR}
+  ${PROTOBUF_LIB_DIR}
   )

 if (WIN32)
-  # TODO(hausdorff): currently these dependencies have to be built out-of-band
-  # by opening Visual Studio, building the project, and then building Mesos. We
-  # should write batch scripts that will build these dependencies from the
-  # command line. (This is one reason why we're linking to the Debug/ folders,
-  # which is not a good idea for release builds anyway.)
-  set(STOUT_TEST_LIB_DIRS
-    ${STOUT_TEST_LIB_DIRS}
-    ${GLOG_ROOT}/Debug
-    ${GMOCK_ROOT}/msvc/2010/Debug
-    ${PROTOBUF_ROOT}/vsprojects/Debug
-    ${CURL_ROOT}/lib
-    )
-else (WIN32)
-  set(STOUT_TEST_LIB_DIRS
-    ${STOUT_TEST_LIB_DIRS}
-    ${GLOG_LIB}/lib
-    ${PROTOBUF_LIB}/lib
-    )
+  set(STOUT_TEST_LIB_DIRS ${STOUT_TEST_LIB_DIRS} ${CURL_LIB_DIR})
 endif (WIN32)

 # DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
@@ -129,28 +103,18 @@
 set(STOUT_TEST_LIBS
   ${STOUT_TEST_LIBS}
   ${CMAKE_THREAD_LIBS_INIT}
-  gmock
+  ${GMOCK_LFLAG}
   ${SVN_LIBS}
+  ${GLOG_LFLAG}
+  ${PROTOBUF_LFLAG}
   )

 if (WIN32)
-  # Necessary because the lib names for glog and protobuf are generated
-  # incorrectly on Windows. That is, on *nix, the glog binary should be (e.g.)
-  # libglog.so, and on Windows it should be glog.lib. But on Windows, it's
-  # actually libglog.lib. Hence, we have to special case it here because CMake
-  # assumes the library names are generated correctly.
-  set(STOUT_TEST_LIBS
-    ${STOUT_TEST_LIBS}
-    libglog
-    libprotobuf
-    libcurl_a
-    )
+  set(STOUT_TEST_LIBS ${STOUT_TEST_LIBS} ${CURL_LFLAG})
 else (WIN32)
   set(STOUT_TEST_LIBS
     ${STOUT_TEST_LIBS}
-    glog
-    gtest
-    protobuf
+    ${GTEST_LFLAG}
     dl
     apr-1
     )


Clang-Tidy: ignore exportdefinitions.h.

Clang-Tidy: ignore exportdefinitions.h.

Indeed, it doen't satisfy Clang-Tidy, but it's automatically generated by CMake, so not much we can do about it.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -162,7 +162,7 @@
       set(_CLANG_TIDY_WARNINGS_AS_ERRORS ";-warnings-as-errors=${_CLANG_TIDY_WARNINGS}")
     endif()
     set_target_properties(${_TARGET} PROPERTIES
-      CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${_CLANG_TIDY_WARNINGS};-header-filter=../src${_CLANG_TIDY_WARNINGS_AS_ERRORS}"
+      CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${_CLANG_TIDY_WARNINGS};-header-filter=../src/.*,-exportdefinitions.h${_CLANG_TIDY_WARNINGS_AS_ERRORS}"
     )
   endif()
 endfunction()


Fixup dotnet.cmake

Fixup dotnet.cmake

--- cmake/dotnet.cmake
+++ cmake/dotnet.cmake
@@ -88,9 +88,9 @@
   target_link_libraries(google-ortools-native PRIVATE dotnet_${SUBPROJECT})
 endforeach()

-file(COPY tools/doc/orLogo.png DESTINATION dotnet)
+file(COPY ${PROJECT_SOURCE_DIR}/tools/doc/orLogo.png DESTINATION dotnet)
 set(DOTNET_LOGO_DIR "${PROJECT_BINARY_DIR}/dotnet")
-configure_file(ortools/dotnet/Directory.Build.props.in dotnet/Directory.Build.props)
+configure_file(${PROJECT_SOURCE_DIR}/ortools/dotnet/Directory.Build.props.in dotnet/Directory.Build.props)

 # Generate Protobuf .Net sources
 set(PROTO_DOTNETS)
@@ -225,8 +225,8 @@
     ${DOTNET_PROJECT_DIR}/${DOTNET_PROJECT}.csproj
     dotnet_native_package
   BYPRODUCTS
-    dotnet/${DOTNET_PROJECT}/bin
-    dotnet/${DOTNET_PROJECT}/obj
+    ${DOTNET_PROJECT_DIR}/bin
+    ${DOTNET_PROJECT_DIR}/obj
   COMMENT "Generate .Net package ${DOTNET_PROJECT} (${DOTNET_PROJECT_DIR}/timestamp)"
   WORKING_DIRECTORY ${DOTNET_PROJECT_DIR}
 )


Fix for APPLE

Fix for APPLE

--- CMake/mathlink/FindMathLink.cmake
+++ CMake/mathlink/FindMathLink.cmake
@@ -39,7 +39,7 @@
   )
 ENDIF(APPLE)

-IF(UNIX)
+IF(UNIX AND NOT APPLE)
   IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
     FIND_LIBRARY( MathLink_ML_LIBRARY NAMES ML32i3
       PATHS ${MathLink_LIBRARY_DIRS}
@@ -57,7 +57,7 @@
     rt
     stdc++
   )
-ENDIF(UNIX)
+ENDIF(UNIX AND NOT APPLE)

 MACRO (MathLink_ADD_TM infile )
  GET_FILENAME_COMPONENT(outfile ${infile} NAME_WE)


Limit the png fix for Linux

Limit the png fix for Linux

temporarily...

--- deps/PNG/PNG.cmake
+++ deps/PNG/PNG.cmake
@@ -1,3 +1,8 @@
+set(_prefix_line "")
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    set(_prefix_line "-DPNG_PREFIX=prusaslicer_")
+endif()
+
 prusaslicer_add_cmake_project(PNG
     GIT_REPOSITORY https://github.com/glennrp/libpng.git
     GIT_TAG v1.6.35
@@ -5,7 +10,7 @@
     CMAKE_ARGS
         -DPNG_SHARED=OFF
         -DPNG_STATIC=ON
-        -DPNG_PREFIX=prusaslicer_
+        ${_prefix_line}
         -DPNG_TESTS=OFF
 )


Correct typo

Correct typo

--- CI/prepare_superbuild.cmake
+++ CI/prepare_superbuild.cmake
@@ -345,7 +345,7 @@

 # push
 # we should be able to do a simple : git push origin $BRANCH_NAME
-# execute_process(
+execute_process(
   COMMAND ${GIT} "push" "${REPOSITORY_GIT_URL}" "${BRANCH_NAME}"
   WORKING_DIRECTORY ${SB_ARTIFACT_GIT}
   RESULT_VARIABLE push_res


Don't mark QT_QMAKE_EXECUTABLE as advanced.

--- CMake/ctkMacroSetupQt.cmake
+++ CMake/ctkMacroSetupQt.cmake
@@ -24,9 +24,6 @@
   set(minimum_required_qt_version "4.6")

   find_package(Qt4)
-
-  # This option won't show up in the main CMake configure panel
-  mark_as_advanced(QT_QMAKE_EXECUTABLE)

   if(QT4_FOUND)


Honor VTK_INSTALL_NO_DEVELOPMENT for archive libraries

VTK module archive libraries are installed as part of the "Development"
component and so should be excluded by the VTK_INSTALL_NO_DEVELOPMENT
option.  Convert vtk_target_install() to a function so we can return()
early from it to skip static libraries.

Change-Id: Ib1be04898d4083b30b1b2a85765ecb77672c8d92

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -364,19 +364,32 @@
   set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${_name})
 endmacro()

-macro(vtk_target_install _name)
+function(vtk_target_install _name)
   if(NOT VTK_INSTALL_NO_LIBRARIES)
     if(APPLE AND VTK_JAVA_INSTALL)
        set_target_properties(${_name} PROPERTIES SUFFIX ".jnilib")
     endif(APPLE AND VTK_JAVA_INSTALL)
+    if(VTK_INSTALL_NO_DEVELOPMENT)
+      # Installation for deployment does not need static libraries.
+      get_property(_type TARGET ${_name} PROPERTY TYPE)
+      if(_type STREQUAL "STATIC_LIBRARY")
+        return()
+      endif()
+      set(_archive_destination "")
+    else()
+      # Installation for development needs static libraries.
+      set(_archive_destination
+        ARCHIVE DESTINATION ${VTK_INSTALL_ARCHIVE_DIR} COMPONENT Development
+        )
+    endif()
     install(TARGETS ${_name}
       EXPORT ${VTK_INSTALL_EXPORT_NAME}
       RUNTIME DESTINATION ${VTK_INSTALL_RUNTIME_DIR} COMPONENT RuntimeLibraries
       LIBRARY DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries
-      ARCHIVE DESTINATION ${VTK_INSTALL_ARCHIVE_DIR} COMPONENT Development
+      ${_archive_destination}
       )
   endif()
-endmacro()
+endfunction()

 macro(vtk_target _name)
   set(_install 1)


Fixed tarball and reactivated patch again

--- CMakeExternals/OpenCV.cmake
+++ CMakeExternals/OpenCV.cmake
@@ -61,14 +61,14 @@
     endif()

     set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/OpenCV-2.4.11.tar.gz)
-    set(opencv_url_md5 29d1b7d2b93aa48e813523ba4207d14a)
+    set(opencv_url_md5 54fe3dba49ea276ec0228f8819e653bc)

     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       URL ${opencv_url}
       URL_MD5 ${opencv_url_md5}
       # Related bug: http://bugs.mitk.org/show_bug.cgi?id=5912
-      # PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/OpenCV-2.4.8.2.patch
+      PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/OpenCV-2.4.8.2.patch
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
         ${ep_common_args}


Disable Python wrapping.

Disable Python wrapping.

--- CMakeExternals/VMTK.cmake
+++ CMakeExternals/VMTK.cmake
@@ -33,6 +33,7 @@
         ${additional_cmake_args}
         -DVTK_VMTK_BUILD_STREAMTRACER:BOOL=OFF
         -DVTK_VMTK_BUILD_TETGEN:BOOL=OFF
+        -DVTK_VMTK_WRAP_PYTHON:BOOL=OFF
       CMAKE_CACHE_ARGS
         ${ep_common_cache_args}
       CMAKE_CACHE_DEFAULT_ARGS


LARGE_EXCLUSION_LIST build option is no longer needed, removing

git-svn-id: 6ebf3f3f62b9d9e8e3b1c2012e0eb304cabfaf6e@3448 fa922fa7-2fde-0310-acd8-f43f465a7996

--- CMake_build_options.cmake
+++ CMake_build_options.cmake
@@ -26,16 +26,6 @@
 if (ENABLE_STATIC)
     add_definitions(-DENABLE_STATIC)
 endif(ENABLE_STATIC)
-
-#################################
-## Optional build with double size exclusion list
-## LARGE_EXCLUSION_LIST is an option to control whether HOOMD will have extra
-## exclusion lists to handle more complex molecules. Has some speed impact and
-## thus is not on by default.
-OPTION(LARGE_EXCLUSION_LIST "Increase the number of allowed exclusions from 4 to 16 per atom. Only needed for branched molecules with angles and dihedrals." OFF)
-if (LARGE_EXCLUSION_LIST)
-    add_definitions(-DLARGE_EXCLUSION_LIST)
-endif(LARGE_EXCLUSION_LIST)

 #################################
 ## Optional single/double precision build


Add definition _TARGET_64BIT_ in clrdefinitions.cmake

--- clrdefinitions.cmake
+++ clrdefinitions.cmake
@@ -14,6 +14,7 @@
     add_definitions(-DDBG_TARGET_AMD64_UNIX)
   endif()
   add_definitions(-D_TARGET_AMD64_=1)
+  add_definitions(-D_TARGET_64BIT_=1)
   add_definitions(-DDBG_TARGET_64BIT=1)
   add_definitions(-DDBG_TARGET_AMD64=1)
   add_definitions(-DDBG_TARGET_WIN64=1)
@@ -22,6 +23,7 @@
     add_definitions(-DDBG_TARGET_ARM64_UNIX)
   endif()
   add_definitions(-D_TARGET_ARM64_=1)
+  add_definitions(-D_TARGET_64BIT_=1)
   add_definitions(-DDBG_TARGET_64BIT=1)
   add_definitions(-DDBG_TARGET_ARM64=1)
   add_definitions(-DDBG_TARGET_WIN64=1)


fix glew-find-module for windows

fix glew-find-module for windows

git-svn-id: a0a066a1d7ce87c7a04dae20f169ad0cd8bda35d@1422 04231f92-3938-0410-9931-e931ac552b4f

--- cmake/FindGLEW.cmake
+++ cmake/FindGLEW.cmake
@@ -9,15 +9,10 @@

 IF (WIN32)
 	FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
-		$ENV{PROGRAMFILES}/GLEW/include
-		${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
 		DOC "The directory where GL/glew.h resides")
 	FIND_LIBRARY( GLEW_LIBRARY
 		NAMES glew GLEW glew32 glew32s
 		PATHS
-		$ENV{PROGRAMFILES}/GLEW/lib
-		${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
-		${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
 		DOC "The GLEW library")
 ELSE (WIN32)
 	FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
@@ -38,11 +33,5 @@
 		DOC "The GLEW library")
 ENDIF (WIN32)

-IF (GLEW_INCLUDE_DIR)
-	SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ELSE (GLEW_INCLUDE_DIR)
-	SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ENDIF (GLEW_INCLUDE_DIR)
-
-MARK_AS_ADVANCED( GLEW_FOUND )
-
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDE_DIR)


let ICC default to strict ANSI aliasing rules

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -306,7 +306,7 @@
          set(ALIAS_FLAGS "-no-ansi-alias")
          if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
             # default ICC to -no-ansi-alias because otherwise tests/utils_sse fails. So far I suspect a miscompilation...
-            set(ENABLE_STRICT_ALIASING false CACHE BOOL "Enables strict aliasing rules for more aggressive optimizations")
+            set(ENABLE_STRICT_ALIASING true CACHE BOOL "Enables strict aliasing rules for more aggressive optimizations")
             if(ENABLE_STRICT_ALIASING)
                set(ALIAS_FLAGS "-ansi-alias")
             endif(ENABLE_STRICT_ALIASING)


erthink: cleanup unused gcc-related warning options.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -172,19 +172,6 @@
   # GCC started to warn for unused result starting from 4.2, and
   # this is when it introduced -Wno-unused-result
   # GCC can also be built on top of llvm runtime (on mac).
-  check_compiler_flag("-Wno-unused-const-variable" CC_HAS_WNO_UNUSED_CONST_VARIABLE)
-  check_compiler_flag("-Wno-unused-result" CC_HAS_WNO_UNUSED_RESULT)
-  check_compiler_flag("-Wno-unused-value" CC_HAS_WNO_UNUSED_VALUE)
-  check_compiler_flag("-Wno-unused-function" CC_HAS_WNO_UNUSED_FUNCTION)
-  check_compiler_flag("-fno-strict-aliasing" CC_HAS_FNO_STRICT_ALIASING)
-  check_compiler_flag("-Wno-comment" CC_HAS_WNO_COMMENT)
-  check_compiler_flag("-Wno-parentheses" CC_HAS_WNO_PARENTHESES)
-  check_compiler_flag("-Wno-parentheses-equality" CC_HAS_WNO_PARENTHESES_EQUALITY)
-  check_compiler_flag("-Wno-undefined-inline" CC_HAS_WNO_UNDEFINED_INLINE)
-  check_compiler_flag("-Wno-dangling-else" CC_HAS_WNO_DANGLING_ELSE)
-  check_compiler_flag("-Wno-tautological-compare" CC_HAS_WNO_TAUTOLOGICAL_COMPARE)
-  check_compiler_flag("-Wno-misleading-indentation" CC_HAS_WNO_MISLEADING_INDENTATION)
-
   check_compiler_flag("-Wno-unknown-pragmas" CC_HAS_WNO_UNKNOWN_PRAGMAS)
   check_compiler_flag("-Wextra" CC_HAS_WEXTRA)
   check_compiler_flag("-Werror" CC_HAS_WERROR)
@@ -193,7 +180,6 @@
   check_compiler_flag("-funwind-tables" CC_HAS_FUNWIND_TABLES)
   check_compiler_flag("-fno-omit-frame-pointer" CC_HAS_FNO_OMIT_FRAME_POINTER)
   check_compiler_flag("-fno-common" CC_HAS_FNO_COMMON)
-  check_compiler_flag("-Wno-strict-aliasing" CC_HAS_WNO_STRICT_ALIASING)
   check_compiler_flag("-ggdb" CC_HAS_GGDB)
   check_compiler_flag("-fvisibility=hidden" CC_HAS_VISIBILITY)
   check_compiler_flag("-march=native" CC_HAS_ARCH_NATIVE)


CMake: silence *all* gcov output

CMake: silence *all* gcov output

--- cmake/gcc-gcov.cmake
+++ cmake/gcc-gcov.cmake
@@ -23,7 +23,7 @@

 add_custom_target(
   gcov
-  COMMAND "${FIND_PATH}" "${CMAKE_BINARY_DIR}" -type f -name '*.gcno' -exec "${GCOV_PATH}" ${GCOV_OPTS} {} + > /dev/null
+  COMMAND "${FIND_PATH}" "${CMAKE_BINARY_DIR}" -type f -name '*.gcno' -exec "${GCOV_PATH}" ${GCOV_OPTS} {} + &> /dev/null
   WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
   COMMENT "Running gcov tool on all the *.gcno files to produce *.gcov files"
   USES_TERMINAL


Don't use full path of libtool

Don't use full path of libtool

This is to be friendly to our OSX users where
the libtool path is very different.

Ref:
* https://github.com/Homebrew/homebrew-core/blob/master/Formula/mariadb.rb#L44..L46

--- cmake/libutils.cmake
+++ cmake/libutils.cmake
@@ -188,7 +188,7 @@
       # binaries properly)
       ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD
         COMMAND rm ${TARGET_LOCATION}
-        COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}
+        COMMAND libtool -static -o ${TARGET_LOCATION}
         ${STATIC_LIBS}
       )
     ELSE()


Add -Wno-incosistent-missing-override flag to pnacl (this is a new clang 3.6 C++11 warning)

--- cmake-toolchains/pnacl.toolchain.cmake
+++ cmake-toolchains/pnacl.toolchain.cmake
@@ -96,7 +96,7 @@
 set(CMAKE_SYSTEM_INCLUDE_PATH "${NACL_TOOLCHAIN_ROOT}/usr/include")

 # compiler flags
-set(CMAKE_CXX_FLAGS "${FIPS_NACL_EXCEPTION_FLAGS} -std=c++11 -pthread -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue -Wno-deprecated-writable-strings")
+set(CMAKE_CXX_FLAGS "${FIPS_NACL_EXCEPTION_FLAGS} -std=c++11 -pthread -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue -Wno-deprecated-writable-strings -Wno-inconsistent-missing-override")
 set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
 set(CMAKE_CXX_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DNACL_SDK_DEBUG -DFIPS_DEBUG=1")


remove unused file

remove unused file

--- cmake/external_projects/parmetis.cmake
+++ cmake/external_projects/parmetis.cmake
@@ -1,14 +0,0 @@
-set(METIS_DIR ${CMAKE_CURRENT_BINARY_DIR}/dependencies/src/parmetis/metis)
-set(PARMETIS_DIR ${CMAKE_CURRENT_BINARY_DIR}/dependencies/src/parametis)
-ExternalProject_Add(parmetis
-  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/dependencies
-  URL "http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz"
-  URL_MD5 f69c479586bf6bb7aff6a9bc0c739628
-  CMAKE_CACHE_ARGS -DMETIS_PATH:string=${METIS_DIR} -DGKLIB_PATH:string=${METIS_DIR}/GKlib
-  DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies
-  UPDATE_COMMAND "" # Disable update
-  BUILD_IN_SOURCE 1
-  )
-set_vars( NETGEN_CMAKE_ARGS METIS_DIR )
-
-list(APPEND NETGEN_DEPENDENCIES parmetis)