fbcode_builder: use build interface generator expression for thrift include directories

Summary:
Fix an error about source directories being included in the include
path in add_thrift_cpp2_library. I don't know why this was failing for
fb303 and not for other projects, but adding a generation expression
appears to fix the issue.

Reviewed By: strager

Differential Revision: D15725024

fbshipit-source-id: 6c02fed6c6703733cf9e0b130c0f90b70e3ea300

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -105,8 +105,8 @@
   target_include_directories(
     ${LIB_NAME}
     PUBLIC
-      ${CMAKE_SOURCE_DIR}
-      ${CMAKE_BINARY_DIR}
+      $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
+      $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
       ${FOLLY_INCLUDE_DIR}
       ${FBTHRIFT_INCLUDE_DIR}
   )


Replaced deprecated FindVTK for CMake 3.1.0 and later.

--- cmake/ThirdPartyVTK.cmake
+++ cmake/ThirdPartyVTK.cmake
@@ -33,7 +33,7 @@
         SET(VTK_USE_FILE ${VTK_DIR}/UseVTK.cmake)
         INCLUDE (${VTK_DIR}/VTKConfig.cmake)
     ELSE()
-        INCLUDE (FindVTK)
+        FIND_PACKAGE(VTK)
         IF (VTK_FOUND)
             MESSAGE(STATUS "Found VTK: ${VTK_USE_FILE}")
         ELSE (VTK_FOUND)


add include shaders in application resources

--- cmake/articated_app.cmake
+++ cmake/articated_app.cmake
@@ -33,9 +33,15 @@
 ################################################################################
 # App hello
 ################################################################################
-qt5_add_resources(articated_app_rcc ${articated_app_qml_qrc})
-qt5_add_resources(3D_models_rcc ${CMAKE_SOURCE_DIR}/resources/3D_models/3D_models.qrc)
-qt5_add_resources(3D_models_rcc ${CMAKE_SOURCE_DIR}/resources/debug_samples/debug_samples.qrc)
+qt5_add_resources(articated_app_rcc ${articated_app_qml_qrc}
+    ${CMAKE_SOURCE_DIR}/resources/3D_models/3D_models.qrc
+    ${CMAKE_SOURCE_DIR}/resources/debug_samples/debug_samples.qrc
+    ${CMAKE_SOURCE_DIR}/resources/GL_shaders/GL_shaders.qrc)
+#TODO: delete the following commented lines if functional without
+#qt5_add_resources(3D_models_rcc ${CMAKE_SOURCE_DIR}/resources/3D_models/3D_models.qrc)
+#qt5_add_resources(3D_models_rcc ${CMAKE_SOURCE_DIR}/resources/debug_samples/debug_samples.qrc)
+#qt5_add_resources(3D_models_rcc ${CMAKE_SOURCE_DIR}/resources/GL_shaders/GL_shaders.qrc)
+

 set( articated_app_SOURCES   ${SRC_DIR}/main.cpp ${SRC_DIR}/window.cpp)
 set( articated_app_HEADERS   ${INCLUDE_DIR}/window.hpp )


add the rest of the prefix path

add the rest of the prefix path

--- cmake/get-libvorbis.cmake
+++ cmake/get-libvorbis.cmake
@@ -15,7 +15,7 @@
       -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
       -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
       # find libogg
-      -DCMAKE_PREFIX_PATH=${DEPENDENCY_INSTALL_DIR}
+      -DCMAKE_PREFIX_PATH=${DEPENDENCY_INSTALL_DIR} ${CMAKE_PREFIX_PATH}
 )

 ExternalProject_Add(


Copyright.

Copyright.

svn path=/trunk/; revision=10476

--- cmake/modules/ocaml.cmake
+++ cmake/modules/ocaml.cmake
@@ -2,6 +2,7 @@
 #
 # Copyright (C) 2008 Andrew Ross
 # Copyright (C) 2009 Hezekiah M. Carty
+# Copyright (C) 2009 Alan W. Irwin
 #
 # This file is part of PLplot.
 #


Try to add support for MYSQL_U_SCORE_VERSION and MYSQL_COPYRIGHT_YEAR.

--- cmake/mysql_version.cmake
+++ cmake/mysql_version.cmake
@@ -55,6 +55,7 @@
   ENDIF()

   SET(VERSION ${VERSION_STRING})
+  STRING(REPLACE "-" "_" MYSQL_U_SCORE_VERSION "${VERSION_STRING}")

   # Remove trailing (non-numeric) part of the version string
   STRING(REGEX REPLACE "[^\\.0-9].*" "" VERSION_STRING ${VERSION_STRING})
@@ -115,6 +116,16 @@
 SET(PRODUCTNAME "MySQL Server")
 SET(COMPANYNAME ${CPACK_PACKAGE_VENDOR})

+# Windows 'date' command has unpredictable output, so cannot rely on it to
+# set MYSQL_COPYRIGHT_YEAR - if someone finds a portable way to do so then
+# it might be useful
+#IF (WIN32)
+#  EXECUTE_PROCESS(COMMAND "date" "/T" OUTPUT_VARIABLE TMP_DATE)
+#  STRING(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" MYSQL_COPYRIGHT_YEAR ${TMP_DATE})
+IF(UNIX)
+  EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE MYSQL_COPYRIGHT_YEAR)
+ENDIF()
+
 # Add version information to the exe and dll files
 # Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
 # for more info.


Removing test code.

Removing test code.

--- cmake/configs/qurt_eagle_release.cmake
+++ cmake/configs/qurt_eagle_release.cmake
@@ -70,7 +70,6 @@
 	modules/uORB
 	modules/commander
 	modules/controllib
-

 	#
 	# Libraries


[Build] Added support for RMOL and AirInv in the CMake framework.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -120,7 +120,11 @@
   if (NOT EXISTS ${DOC_INSTALL_FILE})
     unset (DOC_INSTALL_FILE)
   endif (NOT EXISTS ${DOC_INSTALL_FILE})
-  set (BASICDOC_FILES AUTHORS NEWS README ${DOC_INSTALL_FILE})
+  set (DOC_NEWS_FILE NEWS)
+  if (NOT EXISTS ${DOC_NEWS_FILE})
+    unset (DOC_NEWS_FILE)
+  endif (NOT EXISTS ${DOC_NEWS_FILE})
+  set (BASICDOC_FILES AUTHORS ${DOC_NEWS_FILE} README ${DOC_INSTALL_FILE})
   set (BASICDOC_PATH "share/doc/${PACKAGE}-${PACKAGE_VERSION}")

 endmacro (set_project_options)
@@ -291,9 +295,49 @@
       get_stdair (${_arg_version})
     endif (${_arg_lower} STREQUAL "stdair")

+    if (${_arg_lower} STREQUAL "sevmgr")
+      get_sevmgr (${_arg_version})
+    endif (${_arg_lower} STREQUAL "sevmgr")
+
+    if (${_arg_lower} STREQUAL "trademgen")
+      get_trademgen (${_arg_version})
+    endif (${_arg_lower} STREQUAL "trademgen")
+
+    if (${_arg_lower} STREQUAL "travelccm")
+      get_travelccm (${_arg_version})
+    endif (${_arg_lower} STREQUAL "travelccm")
+
+    if (${_arg_lower} STREQUAL "airsched")
+      get_airsched (${_arg_version})
+    endif (${_arg_lower} STREQUAL "airsched")
+
     if (${_arg_lower} STREQUAL "airrac")
       get_airrac (${_arg_version})
     endif (${_arg_lower} STREQUAL "airrac")
+
+    if (${_arg_lower} STREQUAL "rmol")
+      get_rmol (${_arg_version})
+    endif (${_arg_lower} STREQUAL "rmol")
+
+    if (${_arg_lower} STREQUAL "airinv")
+      get_airinv (${_arg_version})
+    endif (${_arg_lower} STREQUAL "airinv")
+
+    if (${_arg_lower} STREQUAL "avlcal")
+      get_avlcal (${_arg_version})
+    endif (${_arg_lower} STREQUAL "avlcal")
+
+    if (${_arg_lower} STREQUAL "simfqt")
+      get_simfqt (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simfqt")
+
+    if (${_arg_lower} STREQUAL "simlfs")
+      get_simlfs (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simlfs")
+
+    if (${_arg_lower} STREQUAL "simcrs")
+      get_simcrs (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simcrs")

     if (${_arg_lower} STREQUAL "doxygen")
       get_doxygen (${_arg_version})
@@ -577,6 +621,70 @@
   endif (AirRAC_FOUND)

 endmacro (get_airrac)
+
+# ~~~~~~~~~~ RMOL ~~~~~~~~~
+macro (get_rmol)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires RMOL-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires RMOL without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (RMOL ${_required_version} REQUIRED
+	HINTS ${WITH_RMOL_PREFIX})
+  if (RMOL_FOUND)
+    #
+    message (STATUS "Found RMOL version: ${RMOL_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${RMOL_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${RMOL_LIBRARIES})
+
+  else (RMOL_FOUND)
+    set (ERROR_MSG "The RMOL library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_RMOL_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<RMOL install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (RMOL_FOUND)
+
+endmacro (get_rmol)
+
+# ~~~~~~~~~~ Airinv ~~~~~~~~~
+macro (get_airinv)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires Airinv-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires Airinv without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (Airinv ${_required_version} REQUIRED
+	HINTS ${WITH_AIRINV_PREFIX})
+  if (Airinv_FOUND)
+    #
+    message (STATUS "Found Airinv version: ${AIRINV_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${AIRINV_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${AIRINV_LIBRARIES})
+
+  else (Airinv_FOUND)
+    set (ERROR_MSG "The Airinv library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_AIRINV_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<Airinv install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (Airinv_FOUND)
+
+endmacro (get_airinv)

 ##############################################
@@ -1572,6 +1680,34 @@
     message (STATUS "  - AIRRAC_INCLUDE_DIRS ........ : ${AIRRAC_INCLUDE_DIRS}")
   endif (AirRAC_FOUND)
 endmacro (display_airrac)
+
+# RMOL
+macro (display_rmol)
+  if (RMOL_FOUND)
+    message (STATUS)
+    message (STATUS "* RMOL:")
+    message (STATUS "  - RMOL_VERSION ............... : ${RMOL_VERSION}")
+    message (STATUS "  - RMOL_BINARY_DIRS ........... : ${RMOL_BINARY_DIRS}")
+    message (STATUS "  - RMOL_EXECUTABLES ........... : ${RMOL_EXECUTABLES}")
+    message (STATUS "  - RMOL_LIBRARY_DIRS .......... : ${RMOL_LIBRARY_DIRS}")
+    message (STATUS "  - RMOL_LIBRARIES ............. : ${RMOL_LIBRARIES}")
+    message (STATUS "  - RMOL_INCLUDE_DIRS .......... : ${RMOL_INCLUDE_DIRS}")
+  endif (RMOL_FOUND)
+endmacro (display_rmol)
+
+# Airinv
+macro (display_airinv)
+  if (Airinv_FOUND)
+    message (STATUS)
+    message (STATUS "* Airinv:")
+    message (STATUS "  - AIRINV_VERSION ............. : ${AIRINV_VERSION}")
+    message (STATUS "  - AIRINV_BINARY_DIRS ......... : ${AIRINV_BINARY_DIRS}")
+    message (STATUS "  - AIRINV_EXECUTABLES ......... : ${AIRINV_EXECUTABLES}")
+    message (STATUS "  - AIRINV_LIBRARY_DIRS ........ : ${AIRINV_LIBRARY_DIRS}")
+    message (STATUS "  - AIRINV_LIBRARIES ........... : ${AIRINV_LIBRARIES}")
+    message (STATUS "  - AIRINV_INCLUDE_DIRS ........ : ${AIRINV_INCLUDE_DIRS}")
+  endif (Airinv_FOUND)
+endmacro (display_airinv)

 ##
 macro (display_status_all_modules)
@@ -1658,6 +1794,8 @@
   display_soci ()
   display_stdair ()
   display_airrac ()
+  display_rmol ()
+  display_airinv ()
   #
   message (STATUS)
   message (STATUS "Change a value with: cmake -D<Variable>=<Value>" )


Use a compatible version of nyc for coverage reporting

--- tests/JavascriptTests.cmake
+++ tests/JavascriptTests.cmake
@@ -12,7 +12,7 @@
   add_test(
     NAME js_coverage_combine_report
     WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
-    COMMAND npx nyc report
+    COMMAND npx nyc@11.9 report
   )
   set_property(TEST js_coverage_reset PROPERTY LABELS girder_browser girder_integration)
   set_property(TEST js_coverage_combine_report PROPERTY LABELS girder_coverage)


save diff output

save diff output

--- utilities/cmake/setup_test_case.macro.cmake
+++ utilities/cmake/setup_test_case.macro.cmake
@@ -55,7 +55,9 @@
     )
   # Compare output
   ADD_CUSTOM_TARGET(diff_${_test_name}
-    COMMAND ${_exec_diff} ${_para_diff} ${_test_directory}/${_output_file}  ${_test_directory}/${_comparison_file}
+    COMMAND ${_exec_diff} ${_para_diff} ${_test_directory}/${_output_file}  ${_test_directory}/${_comparison_file} > output.diff
+    WORKING_DIRECTORY
+      ${_test_directory}
     DEPENDS
       ${_test_directory}/${_output_file}
       ${_test_directory}/${_comparison_file}


simplified build

simplified build

--- sources/build.cmake
+++ sources/build.cmake
@@ -1,7 +1,2 @@
-set(ARCHIVE_NAME watchdog)
-message("${ARCHIVE_NAME}@${CMAKE_CURRENT_LIST_DIR} using: ${CMAKE_CURRENT_LIST_FILE}")
-
-file(GLOB ARCHIVE_HEADERS ${CMAKE_CURRENT_LIST_DIR}/*.h)
-file(GLOB ARCHIVE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/*.c)
-add_library(${ARCHIVE_NAME} ${ARCHIVE_HEADERS} ${ARCHIVE_SOURCES})
-target_link_libraries(${ARCHIVE_NAME} PRIVATE panic process)
+add_library(watchdog ${CMAKE_CURRENT_LIST_DIR}/watchdog.h ${CMAKE_CURRENT_LIST_DIR}/watchdog.c)
+target_link_libraries(watchdog PRIVATE panic process)


Fix tests : missing renaming (SICONOS_FRICTION_3D_ONECONTACT_NSN_AC --> SICONOS_FRICTION_3D_ONECONTACT_NSN). This time, that should be ok ...

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -318,12 +318,12 @@

   NEW_FC_3D_TEST(Confeti-ex13-4contact-Fc3D-SBM.dat
     SICONOS_FRICTION_3D_NSGS  1e-12 10000
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC 1e-18 10
+    SICONOS_FRICTION_3D_ONECONTACT_NSN 1e-18 10
     INTERNAL_IPARAM 1 0)

   NEW_FC_3D_TEST(Confeti-ex13-4contact-Fc3D-SBM.dat
     SICONOS_FRICTION_3D_NSGS  1e-12 10000
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC 1e-18 10
+    SICONOS_FRICTION_3D_ONECONTACT_NSN 1e-18 10
     INTERNAL_IPARAM 1 1)

   NEW_FC_3D_TEST(Confeti-ex13-4contact-Fc3D-SBM.dat
@@ -336,11 +336,11 @@

   NEW_FC_3D_TEST(problem-checkTwoRods1-condensed.dat
     SICONOS_FRICTION_3D_NSGS  1e-05 10000
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC 0.0 0
+    SICONOS_FRICTION_3D_ONECONTACT_NSN 0.0 0
     INTERNAL_IPARAM 1 1)
   NEW_FC_3D_TEST(Example1_Fc3D.dat
     SICONOS_FRICTION_3D_NSGS  1e-5 ${NSGS_NB_IT}
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC 1e-18 10)
+    SICONOS_FRICTION_3D_ONECONTACT_NSN 1e-18 10)
   NEW_FC_3D_TEST(Rover1039.dat
     SICONOS_FRICTION_3D_NSGS ${NSGS_TOL} ${NSGS_NB_IT}
     SICONOS_FRICTION_3D_ONECONTACT_QUARTIC 1e-6 10)
@@ -389,7 +389,7 @@
     WILL_FAIL)
   NEW_FC_3D_TEST(Confeti-ex03-Fc3D-SBM.dat
     SICONOS_FRICTION_3D_NSGS 1e-12 1000
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC 1e-16  10)
+    SICONOS_FRICTION_3D_ONECONTACT_NSN 1e-16  10)

   NEW_FC_3D_TEST(Confeti-ex03-Fc3D-SBM.dat
     SICONOS_FRICTION_3D_NSGS 1e-12 10000
@@ -405,7 +405,7 @@

   NEW_FC_3D_TEST(Confeti-ex13-Fc3D-SBM.dat
     SICONOS_FRICTION_3D_NSGS 1e-5 1000
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC 1e-16 10)
+    SICONOS_FRICTION_3D_ONECONTACT_NSN 1e-16 10)

   NEW_FC_3D_TEST(Confeti-ex13-Fc3D-SBM.dat
     SICONOS_FRICTION_3D_NSGS 1e-12 10000
@@ -527,7 +527,7 @@
   NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 100000
     SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 1e-16 1000)
   NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 100000
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC 1e-16 100)
+    SICONOS_FRICTION_3D_ONECONTACT_NSN 1e-16 100)

   # ---- PROX ---

@@ -692,8 +692,8 @@
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP4.dat)
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP5.dat)

-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP4.dat)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP5.dat)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN GMP4.dat)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN GMP5.dat)

   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration GMP4.dat)
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration GMP5.dat)
@@ -727,9 +727,9 @@
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP5.dat 0 0 0 0 0 2)
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP6.dat 0 0 0 0 0 2)

-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP4.dat 0 0 0 0 0 2)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP5.dat 0 0 0 0 0 2)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP6.dat 0 0 0 0 0 2)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN GMP4.dat 0 0 0 0 0 2)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN GMP5.dat 0 0 0 0 0 2)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN GMP6.dat 0 0 0 0 0 2)

   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration GMP4.dat 0 0 0 0 0 2)
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration GMP5.dat 0 0 0 0 0 2)


add exception and rtti check

add exception and rtti check

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -282,26 +282,36 @@
     endif()
     set(CMAKE_REQUIRED_FLAGS ${COMPILER_OPTIONS_BAKCUP_CMAKE_REQUIRED_FLAGS})
     unset(COMPILER_OPTIONS_BAKCUP_CMAKE_REQUIRED_FLAGS)
-    check_cxx_source_compiles("
-    #include <exception>
-    void handle_eptr(std::exception_ptr eptr) {
-        try {
-            if (eptr) {
-                std::rethrow_exception(eptr);
+    # Check if exception enabled
+    check_cxx_source_compiles("int main () { try { throw 123; } catch (...) {} return 0; }" COMPILER_OPTIONS_TEST_EXCEPTION)
+    if (COMPILER_OPTIONS_TEST_EXCEPTION)
+        check_cxx_source_compiles("
+        #include <exception>
+        void handle_eptr(std::exception_ptr eptr) {
+            try {
+                if (eptr) {
+                    std::rethrow_exception(eptr);
+                }
+            } catch(...) {}
+        }
+
+        int main() {
+            std::exception_ptr eptr;
+            try {
+                throw 1;
+            } catch(...) {
+                eptr = std::current_exception(); // capture
             }
-        } catch(...) {}
-    }
-
-    int main() {
-        std::exception_ptr eptr;
-        try {
-            throw 1;
-        } catch(...) {
-            eptr = std::current_exception(); // capture
-        }
-        handle_eptr(eptr);
-    }
-    " COMPILER_OPTIONS_TEST_STD_EXCEPTION_PTR)
+            handle_eptr(eptr);
+        }
+        " COMPILER_OPTIONS_TEST_STD_EXCEPTION_PTR)
+    else ()
+        unset(COMPILER_OPTIONS_TEST_STD_EXCEPTION_PTR CACHE)
+    endif ()
+    # Check if rtti enabled
+    check_cxx_source_compiles("#include <typeinfo>
+    #include <cstdio>
+    int main () { puts(typeid(int).name()); return 0; }" COMPILER_OPTIONS_TEST_RTTI)

     # list => string
     string(REPLACE ";" " " CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")


Install ITK into .../Contents/Python

Install ITK into .../Contents/Python

--- projects/apple/tomviz.bundle.cmake
+++ projects/apple/tomviz.bundle.cmake
@@ -38,9 +38,9 @@
           COMMAND ${CMAKE_CURRENT_LIST_DIR}/fixup_itk.py
                   \"${install_location}/lib/itk\")
         message(\"Installing ITK\")
-        file(INSTALL DESTINATION \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Libraries\"
+        file(INSTALL DESTINATION \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Python/\"
              USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
-             \"${install_location}/lib/itk/\")
+             \"${install_location}/lib/itk/python3.6/site-packages/\")
     endif()

     # at this point, the installed bundle should have the libraries that need to


Add CONFIGURATION_FILE argument

Add CONFIGURATION_FILE argument

--- cmake/DevBaseLinkcheckerMacro.cmake
+++ cmake/DevBaseLinkcheckerMacro.cmake
@@ -1,7 +1,7 @@
 # Check links in html files.
 function(check_for_broken_links)
     set(OPTIONS "")
-    set(ONE_VALUE_ARGUMENTS TARGET)
+    set(ONE_VALUE_ARGUMENTS TARGET CONFIGURATION_FILE)
     set(MULTI_VALUE_ARGUMENTS IGNORE_URLS SOURCES)  # Html source files.

     cmake_parse_arguments(CHECK_LINKS "${OPTIONS}"
@@ -19,6 +19,11 @@
     foreach(url_regex ${CHECK_LINKS_IGNORE_URLS})
         list(APPEND ignore_urls_option "--ignore-url=${url_regex}")
     endforeach()
+
+    if(CHECK_LINKS_CONFIGURATION_FILE)
+        set(configuration_file_option
+            "--config=${CHECK_LINKS_CONFIGURATION_FILE}")
+    endif()

     foreach(source_filename ${sources})
         get_filename_component(source_directory ${source_filename} DIRECTORY)
@@ -44,6 +49,8 @@
                 # We are only interested in the links in the current file,
                 # not in the links in linked files.
                 --recursion-level=1
+                --no-status
+                ${configuration_file_option}
                 ${ignore_urls_option}
                 ${source_pathname}
             VERBATIM


TranslateDesktopTs: Adds UPDATE_OPTIONS options

qtX_add_translation() allows the user to pass OPTIONS to lupdate, but we
didn't provide a way, for the user of lxqt_translate_ts(), to set them.

--- cmake/modules/LXQtTranslateTs.cmake
+++ cmake/modules/LXQtTranslateTs.cmake
@@ -29,6 +29,7 @@
 #                           [USE_QT5 [Yes | No]]
 #                           [UPDATE_TRANSLATIONS [Yes | No]]
 #                           SOURCES <sources>
+#                           [UPDATE_OPTIONS] update_options
 #                           [TEMPLATE] translation_template
 #                           [TRANSLATION_DIR] translation_directory
 #                           [INSTALL_DIR] install_directory
@@ -43,6 +44,9 @@
 #       UPDATE_TRANSLATIONS Optional flag. Setting it to Yes, extracts and
 #                           compiles the translations. Setting it No, only
 #                           compiles them.
+#
+#       UPDATE_OPTIONS Optional options to lupdate when UPDATE_TRANSLATIONS
+#                       is True.
 #
 #       TEMPLATE Optional translations files base name. Defaults to
 #                ${PROJECT_NAME}. An .ts extensions is added.
@@ -65,11 +69,15 @@

 function(lxqt_translate_ts qmFiles)
     set(oneValueArgs USE_QT5 UPDATE_TRANSLATIONS TEMPLATE TRANSLATION_DIR INSTALL_DIR COMPONENT)
-    set(multiValueArgs SOURCES)
+    set(multiValueArgs SOURCES UPDATE_OPTIONS)
     cmake_parse_arguments(TR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

     if (NOT DEFINED TR_UPDATE_TRANSLATIONS)
         set(TR_UPDATE_TRANSLATIONS "No")
+    endif()
+
+    if (NOT DEFINED TR_UPDATE_OPTIONS)
+        set(TR_UPDATE_OPTIONS "")
     endif()

     if (NOT DEFINED TR_USE_QT5)
@@ -93,11 +101,12 @@
             qt5_patched_create_translation(QMS
                 ${TR_SOURCES}
                 ${templateFile}
-                OPTIONS -locations absolute
+                OPTIONS ${TR_UPDATE_OPTIONS}
             )
             qt5_patched_create_translation(QM
                 ${TR_SOURCES}
                 ${tsFiles}
+                OPTIONS ${TR_UPDATE_OPTIONS}
             )
         else()
             qt5_patched_add_translation(QM ${tsFiles})
@@ -108,11 +117,12 @@
             qt4_create_translation(QMS
                 ${TR_SOURCES}
                 ${templateFile}
-                OPTIONS -locations absolute
+                OPTIONS ${TR_UPDATE_OPTIONS}
             )
             qt4_create_translation(QM
                 ${TR_SOURCES}
                 ${tsFiles}
+                OPTIONS ${TR_UPDATE_OPTIONS}
             )
         else()
             qt4_add_translation(QM ${tsFiles})


[CMake] Don't install FileCheck by default

Not everybody can or does use the "build-script" and the build-script
can easily opt into this if it wants.

--- cmake/modules/SwiftComponents.cmake
+++ cmake/modules/SwiftComponents.cmake
@@ -75,6 +75,8 @@
 # These clang header options conflict with 'clang-builtin-headers'.
 list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "clang-resource-dir-symlink")
 list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "clang-builtin-headers-in-clang-resource-dir")
+# This conflicts with LLVM itself when doing unified builds.
+list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "toolchain-dev-tools")
 # The sourcekit install variants are currently mutually exclusive.
 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
   list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "sourcekit-inproc")


Fix regression introduced by previous commit

Note: the test still does not pass because
some variables are marked as 'advanced' and
some are not.

Don't care right now ?

Change-Id: I9129cf0530c2069b469e4a9706533a04a49e48b6
Reviewed-on: http://gerrit.aldebaran.lan:8080/637
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/internal/uselib.cmake
+++ cmake/qibuild/internal/uselib.cmake
@@ -151,7 +151,7 @@
     endif()

     if ((DEFINED "${_U_PKG}_TARGET") AND (TARGET "${${_U_PKG}_TARGET}"))
-      qi_append_global(${_U_name}_TARGET_DEPENDS ${${_U_PKG}_TARGET})
+      qi_append_uniq_global(${_U_name}_TARGET_DEPENDS ${${_U_PKG}_TARGET})
       add_dependencies(${name} ${${_U_PKG}_TARGET})
     endif()


Quick fix to prevent new XML module functions from breaking runtime-generation.

--- cmake_modules/GenZorbaRuntime.cmake
+++ cmake_modules/GenZorbaRuntime.cmake
@@ -40,7 +40,7 @@
   EXECUTE_PROCESS (
     COMMAND
       ${ZORBA_EXE}
-      -q "import module namespace file = 'http://expath.org/ns/file'; file:exists( 'a non existant file' )"
+      -q "import module namespace file = 'http://expath.org/ns/file'; import module namespace x = 'http://www.zorba-xquery.com/modules/xml'; file:exists( 'a non existant file' )"
     RESULT_VARIABLE ZORBA_WORKS_RES
     OUTPUT_VARIABLE ZORBA_WORKS_OUTPUT
   )


better find

better find

--- tutorial/cmake/FindTRIANGLE.cmake
+++ tutorial/cmake/FindTRIANGLE.cmake
@@ -9,7 +9,7 @@
    add_definitions(-DNO_TIMER)
 ENDIF (WIN32)

-FIND_PATH(TRIANGLE_INCLUDE_DIR triangle.h
+FIND_PATH(TRIANGLE_INCLUDE_DIR triangle.c
    /usr/include
    /usr/local/include
    ${PROJECT_SOURCE_DIR}/../libigl/external/triangle/


fpta-cmake: fix add_compile_flags macro.

--- cmake.fpta/utils.cmake
+++ cmake.fpta/utils.cmake
@@ -2,9 +2,9 @@
   foreach(_lang ${langs})
     string(REPLACE ";" " " _flags "${ARGN}")
     set("${_lang}_FLAGS" "${${_lang}_FLAGS} ${_flags}")
-    unset(${_lang})
-    unset(${_flags})
   endforeach()
+  unset(_lang)
+  unset(_flags)
 endmacro(add_compile_flags)

 macro(set_source_files_compile_flags)


fixed indentation

fixed indentation

--- cmake/FindCyclus.cmake
+++ cmake/FindCyclus.cmake
@@ -20,8 +20,8 @@
         FIND_PROGRAM(CYCLUS_BIN cyclus)
         IF(CYCLUS_BIN)
             EXECUTE_PROCESS(COMMAND cyclus --install-path
-            OUTPUT_VARIABLE CYCLUS_ROOT_DIR
-            OUTPUT_STRIP_TRAILING_WHITESPACE)
+                OUTPUT_VARIABLE CYCLUS_ROOT_DIR
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
         ELSE(CYCLUS_BIN)
             SET(CYCLUS_ROOT_DIR "$ENV{HOME}/.local")
         ENDIF(CYCLUS_BIN)


improved FindOpenCV.cmake

improved FindOpenCV.cmake

--- cmake/FindOpenCV.cmake
+++ cmake/FindOpenCV.cmake
@@ -110,9 +110,13 @@
   IF (OPENCV_USE_GPU_LIBS)
     LIST (APPEND _OPENCV_LIB_HINTS
       ${OPENCV_ROOT_DIR}/${_OPENCV_BUILD_DIR}/${_OPENCV_ARCHITECTURE}/${_OPENCV_LIB_DIR})
+    LIST (APPEND _OPENCV_LIB_HINTS
+      ${OPENCV_ROOT_DIR}/${_OPENCV_ARCHITECTURE}/${_OPENCV_LIB_DIR})
   ELSE (OPENCV_USE_GPU_LIBS)
     LIST (APPEND _OPENCV_LIB_HINTS
       ${OPENCV_ROOT_DIR}/${_OPENCV_BUILD_DIR}/${_OPENCV_ARCHITECTURE}/${_OPENCV_COMPILER}/${_OPENCV_LIB_DIR})
+    LIST (APPEND _OPENCV_LIB_HINTS
+      ${OPENCV_ROOT_DIR}/${_OPENCV_ARCHITECTURE}/${_OPENCV_COMPILER}/${_OPENCV_LIB_DIR})
   ENDIF (OPENCV_USE_GPU_LIBS)
 ENDIF (DEFINED _OPENCV_COMPILER)

@@ -196,7 +200,7 @@
   IF (NOT OpenCV_FIND_COMPONENTS)
     IF (OPENCV_VERSION VERSION_GREATER 2.1)
       SET (OpenCV_FIND_COMPONENTS calib3d contrib core features2d flann highgui
-        imgproc legacy ml objdetect video)
+        imgproc legacy ml objdetect video gpu)
     ELSE (OPENCV_VERSION VERSION_GREATER 2.1)
       SET (OpenCV_FIND_COMPONENTS cxcore cv ml highgui cvaux)
     ENDIF (OPENCV_VERSION VERSION_GREATER 2.1)


Create tbag_config__generate_export_api_c_header() cmake function.

--- cmake/TbagConfig.cmake
+++ cmake/TbagConfig.cmake
@@ -367,6 +367,71 @@
         "\n"
         "\n#endif /* __INCLUDE_${MAIN_NAME_UPPER}__${MAIN_NAME_UPPER}_CONFIG_H__ */"
         "\n")
+endfunction ()
+
+#/// Write Export API C header file.
+#///
+#/// @param __name        [in] Project name.
+#/// @param __prefix      [in] Prefix of APIs.
+#/// @param __output_path [in] Output header file path.
+#/// @param __more_body   [in] More c header code.
+function (tbag_config__generate_export_api_c_header __name __prefix __output_path __more_body)
+    set (__prefix_export_api "${__prefix}_EXPORT_API")
+    set (__prefix_api        "${__prefix}_API")
+
+    file (WRITE ${__output_path} ""
+            "\n#ifndef __INCLUDE_${__name}__${__prefix}_EXPORT_API_H__"
+            "\n#define __INCLUDE_${__name}__${__prefix}_EXPORT_API_H__"
+            "\n"
+            "\n#if defined(__GNUC__)"
+            "\n#define __${__prefix}_GNUC_FULLVERSION \\"
+            "\n    ( (__GNUC__            * 10000) \\"
+            "\n    + (__GNUC_MINOR__      *   100) \\"
+            "\n    + (__GNUC_PATCHLEVEL__ *     1) )"
+            "\n#else"
+            "\n#define __${__prefix}_GNUC_FULLVERSION 0"
+            "\n#endif"
+            "\n"
+            "\n#if defined(WIN32) || defined(_WIN32) || \\"
+            "\n    defined(WIN64) || defined(_WIN64) || \\"
+            "\n    defined(WINCE) || defined(_WINCE) || \\"
+            "\n    defined(__TOS_WIN__) || \\"
+            "\n    defined(__WIN32__) || defined(__TOS_WIN__) || \\"
+            "\n    defined(__WINDOWS__)"
+            "\n#define __${__prefix}_PLATFORM_WINDOWS"
+            "\n#endif"
+            "\n"
+            "\n#if defined(${__prefix_export_api})"
+            "\n# if defined(__${__prefix}_PLATFORM_WINDOWS)"
+            "\n#  define ${__prefix_api} __declspec(dllexport)"
+            "\n# elif __${__prefix}_GNUC_FULLVERSION >= 40000"
+            "\n#  define ${__prefix_api} __attribute__((visibility(\"default\")))"
+            "\n# else"
+            "\n#  define ${__prefix_api}"
+            "\n# endif"
+            "\n#else // defined(${__prefix_export_api})"
+            "\n# if defined(__${__prefix}_PLATFORM_WINDOWS)"
+            "\n#  define ${__prefix_api} __declspec(dllimport)"
+            "\n# else"
+            "\n#  define ${__prefix_api}"
+            "\n# endif"
+            "\n#endif // defined(${__prefix_export_api})"
+            "\n"
+            "\n#if defined(__cplusplus)"
+            "\nextern \"C\" {"
+            "\n#endif"
+            "\n"
+            "\n${__more_body}"
+            "\n"
+            "\n#if defined(__cplusplus)"
+            "\n} /* extern \"C\" */"
+            "\n#endif"
+            "\n"
+            "\n#endif /* __INCLUDE_${__name}__${__prefix}_EXPORT_API_H__ */"
+            "\n")
+
+    message (STATUS "[${__name}/${__prefix}] Export API macro: ${__prefix_export_api}")
+    message (STATUS "[${__name}/${__prefix}] API macro: ${__prefix_api}")
 endfunction ()

 macro (tbag_config__default_generate_c_header)


r9968/sofa : cmake: fixed build with gcc<4.6 when gcc4.6 is present on the system

Former-commit-id: 8c7ebf1b7386f2546cb3a8aa2f1f3b8946af9e16

--- cmake/buildFlags.cmake
+++ cmake/buildFlags.cmake
@@ -12,7 +12,16 @@
 elseif(CMAKE_BUILD_TYPE MATCHES "Release")
 	#message(STATUS "Building Release")
 	if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
-		execute_process(COMMAND g++ -dumpversion OUTPUT_VARIABLE GCXX_VERSION)
+                if(CMAKE_CXX_COMPILER_ARG1)
+                    # in the case of CXX="ccache g++"
+                    string(STRIP ${CMAKE_CXX_COMPILER_ARG1} CMAKE_CXX_COMPILER_ARG1_stripped)
+                    #message(STATUS "using CMAKE_CXX_COMPILER_ARG1=${CMAKE_CXX_COMPILER_ARG1_stripped} to detect g++ version...")
+                    execute_process(COMMAND ${CMAKE_CXX_COMPILER_ARG1_stripped} -dumpversion OUTPUT_VARIABLE GCXX_VERSION)
+                else()
+                    #message(STATUS "using CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} to detect g++ version...")
+                    execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCXX_VERSION)
+                endif()
+                #message(STATUS GCXX_VERSION=${GCXX_VERSION})
 		set(CXX_OPTIMIZATION_FLAGS "-O2")
 		#set(CXX_ARCH_FLAGS "-march='native'")
 		set(CXX_STACKPROTECTOR_FLAGS "-fstack-protector --param=ssp-buffer-size=4")


improve the macros to set a variable for Python OUTPUT in buildspace

--- cmake/ectoMacros.cmake
+++ cmake/ectoMacros.cmake
@@ -98,17 +98,25 @@
   target_link_libraries(${NAME}_ectomodule
     ${ARGN}
   )
-  if (ecto_module_PYTHON_INSTALL)
-    set_target_properties(${NAME}_ectomodule PROPERTIES
-                          LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${ecto_module_PYTHON_INSTALL}
-    )
-  endif()
+  set_target_properties(${NAME}_ectomodule PROPERTIES
+                        LIBRARY_OUTPUT_DIRECTORY ${ecto_module_PYTHON_OUTPUT}
+  )
 endmacro()

 # ==============================================================================
 #this is where usermodules may be installed to
-macro( set_ecto_install_package_name package_name)
-  set(ecto_module_PYTHON_INSTALL ${PYTHON_PACKAGES_PATH}/${package_name})
+# one folder or none has to be given
+macro(set_ecto_install_package_name)
+  if (${ARGC})
+    # there is only one argument given
+    foreach(package_name ${ARGN})
+      set(ecto_module_PYTHON_INSTALL ${PYTHON_PACKAGES_PATH}/${package_name})
+      set(ecto_module_PYTHON_OUTPUT ${CMAKE_BINARY_DIR}/gen/py/${package_name})
+    endforeach()
+  else()
+    set(ecto_module_PYTHON_INSTALL ${PYTHON_PACKAGES_PATH}/)
+    set(ecto_module_PYTHON_OUTPUT ${CMAKE_BINARY_DIR}/gen/py/)
+  endif()
 endmacro()

 # ==============================================================================


Build system: Only calculate and print out TKLIB_COMPILE_FLAGS when actually needed

This change is primarily motivated by removing confusing and unneeded
Tk output information when ENABLE_tk=OFF.

--- cmake/modules/tk.cmake
+++ cmake/modules/tk.cmake
@@ -1,6 +1,6 @@
 # cmake/modules/tk.cmake
 #
-# Copyright (C) 2006  Alan W. Irwin
+# Copyright (C) 2006-2015 Alan W. Irwin
 #
 # This file is part of PLplot.
 #
@@ -61,9 +61,11 @@
   set(PLD_tkwin OFF CACHE BOOL "Enable Tk device" FORCE)
 endif(NOT X11_FOUND AND (PLD_tk OR PLD_tkwin))

-# Transform TK_INCLUDE_PATH (which is a list) to blank-delimited flag form.
-string(REGEX REPLACE ";" "\" -I\"" TKLIB_COMPILE_FLAGS "-I\"${TK_INCLUDE_PATH}\"")
-message(STATUS "TKLIB_COMPILE_FLAGS = ${TKLIB_COMPILE_FLAGS}")
+if(PLD_tk OR PLD_ntk OR PLD_tkwin)
+  # Transform TK_INCLUDE_PATH (which is a list) to blank-delimited flag form.
+  string(REGEX REPLACE ";" "\" -I\"" TKLIB_COMPILE_FLAGS "-I\"${TK_INCLUDE_PATH}\"")
+  message(STATUS "TKLIB_COMPILE_FLAGS = ${TKLIB_COMPILE_FLAGS}")
+endif(PLD_tk OR PLD_ntk OR PLD_tkwin)

 if(PLD_tk)
   set(tk_COMPILE_FLAGS


[cmake] fix fPIC for libtre build on linux

--- cmake/tre-config.cmake
+++ cmake/tre-config.cmake
@@ -12,6 +12,7 @@
     GIT_REPOSITORY ${TRE_GIT_REPOSITORY}
     CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+               -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE
     )
 endif()
 ExternalProject_Get_Property(tre INSTALL_DIR)
@@ -37,4 +38,4 @@
 function(target_add_tre tgt)
   target_include_directories(${tgt} PRIVATE ${TRE_INCLUDE_DIRS})
   target_link_libraries(${tgt} ${TRE_LIBRARIES})
-endfunction()+endfunction()


cmake: Touch miniconda file after downloading.

Fix the following issue;
```
Prerequisite '/usr/bin/wget' is newer than target 'env/Miniconda3-4.5.12-Linux-x86_64.sh'.
```

Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro>

--- common/cmake/env.cmake
+++ common/cmake/env.cmake
@@ -63,6 +63,7 @@
       OUTPUT ${ENV_DIR}/${MINICONDA_FILE}
       COMMAND ${CMAKE_COMMAND} -E make_directory ${ENV_DIR}
       COMMAND ${WGET} ${MINICONDA_URL} -O ${ENV_DIR}/${MINICONDA_FILE}
+      COMMAND ${CMAKE_COMMAND} -E touch ${ENV_DIR}/${MINICONDA_FILE}
       DEPENDS ${WGET})
     set(CONDA_DIR ${ENV_DIR}/conda)
     set_target_properties(env PROPERTIES CONDA_DIR ${CONDA_DIR})


removed support for using gcc with clang linker

--- common/cmake/gcc.cmake
+++ common/cmake/gcc.cmake
@@ -36,7 +36,4 @@

 IF (APPLE)
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7")
-  IF (TARGET_AVX OR TARGET_AVX2)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-q") # use clang assembler if user needs AVX
-  ENDIF()
 ENDIF (APPLE)


BUG: Add VTK_VERSION for older VTK versions

For older VTK's, VTK_VERSION is not defined. It needs to be setup manually.

See ITK-3304

Change-Id: I5efec656190e7417c7a2cbfa1b27b8b545261ca0

--- Modules/Bridge/VtkGlue/itk-module-init.cmake
+++ Modules/Bridge/VtkGlue/itk-module-init.cmake
@@ -1,8 +1,19 @@
 #
 # Find the packages required by this module
 #
+
+# Needed VTK version
+set(VERSION_MIN "5.9.20110419")
+
+# Look for VTK
 find_package(VTK REQUIRED)
-set(VERSION_MIN "5.9.20110419")
+
+# Older versions of VTK (VTK 5.5 for example) do not have VTK_VERSION, in this
+# case it needs to be defined manually
+if(NOT VTK_VERSION)
+set(VTK_VERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
+endif()
+
 if (${VTK_VERSION} VERSION_LESS ${VERSION_MIN})
   message(ERROR " VtkGlue requires VTK version ${VERSION_MIN} or newer but the current version is ${VTK_VERSION}")
 endif()


ENH: missing ITK compilation flags

ENH: missing ITK compilation flags

--- Modules/ThirdParty/ITK/otb-module-init.cmake
+++ Modules/ThirdParty/ITK/otb-module-init.cmake
@@ -2,4 +2,10 @@
 # TODO : ensure all necessary modules are enabled with COMPONENTS

 # set ( ITK_NO_IO_FACTORY_REGISTER_MANAGER TRUE )
-# include (${ITK_USE_FILE})+# include (${ITK_USE_FILE})
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ITK_REQUIRED_C_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ITK_REQUIRED_CXX_FLAGS}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
+set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")


nomsg

nomsg

--- SoftwareGuide/Examples/MeanImageFilter.cmake
+++ SoftwareGuide/Examples/MeanImageFilter.cmake
@@ -1,6 +0,0 @@
-# Cmake macro to invoke: /ORFEO/thomas/ORFEO-TOOLBOX/OTB/bin/MeanImageFilter  /ORFEO/thomas/ORFEO-TOOLBOX/OTB/Examples/Data/Circle.png /home/ORFEO/thomas/ORFEO-TOOLBOX/OTB-Documents/SoftwareGuide/Art/Generated/CircleMeanOutput.png 10 10
-RUN_EXAMPLE( "MeanImageFilter" "CircleMeanOutput.png" "/ORFEO/thomas/ORFEO-TOOLBOX/OTB/Examples/StartExamples/MeanImageFilter.cxx"  /ORFEO/thomas/ORFEO-TOOLBOX/OTB/Examples/Data/Circle.png /home/ORFEO/thomas/ORFEO-TOOLBOX/OTB-Documents/SoftwareGuide/Art/Generated/CircleMeanOutput.png 10 10 )
-CONVERT_INPUT_IMG( "Circle.png" "Circle.eps" "/ORFEO/thomas/ORFEO-TOOLBOX/OTB/Examples/Data" )
-ADD_DEP_TEX_ON_EPS_FIGS( "/home/ORFEO/thomas/ORFEO-TOOLBOX/OTB-Documents/SoftwareGuide/Examples/MeanImageFilter.tex" "Circle.eps" )
-CONVERT_IMG( "CircleMeanOutput.png" "CircleMeanOutput.eps" "/home/ORFEO/thomas/ORFEO-TOOLBOX/OTB-Documents/SoftwareGuide/Art/Generated" )
-ADD_DEP_TEX_ON_EPS_FIGS( "/home/ORFEO/thomas/ORFEO-TOOLBOX/OTB-Documents/SoftwareGuide/Examples/MeanImageFilter.tex" "CircleMeanOutput.eps" )


i#4024: Do not build tests in cronbuilds (#4025)

Disables building of tests in cronbuilds, which then turns on
SHOW_RESULTS in the sample clients.  The prior cronbuilds had
SHOW_RESULTS off, resulting in no output, which is not very useful.

Fixes #4024

--- suite/runsuite.cmake
+++ suite/runsuite.cmake
@@ -1,5 +1,5 @@
 # **********************************************************
-# Copyright (c) 2010-2019 Google, Inc.    All rights reserved.
+# Copyright (c) 2010-2020 Google, Inc.    All rights reserved.
 # Copyright (c) 2009-2010 VMware, Inc.    All rights reserved.
 # **********************************************************

@@ -68,6 +68,8 @@
   endif ()
 endforeach (arg)

+set(build_tests "BUILD_TESTS:BOOL=ON")
+
 if (arg_travis)
   # XXX i#1801, i#1962: under clang we have several failing tests.  Until those are
   # fixed, our Travis clang suite only builds and does not run tests.
@@ -84,6 +86,10 @@
     # XXX: I'd rather set this in the .yml files but I don't see a way to set
     # one env var based on another's value there.
     set(run_tests OFF)
+    # In fact we do not want to build the tests at all since they are not part
+    # of the cronbuild package.  Plus, having BUILD_TESTS set causes SHOW_RESULTS
+    # to be off, ruining the samples for interactive use.
+    set(build_tests "")
     message("Detected a cron package build: disabling running of tests")
   endif()
 endif()
@@ -94,7 +100,7 @@
   # have CDash ignore them and avoid going red and sending emails.
   # We rely on our CI for a history of _FLAKY results.
   set(base_cache "${base_cache}
-    BUILD_TESTS:BOOL=ON
+    ${build_tests}
     TEST_LONG:BOOL=ON
     SKIP_FLAKY_TESTS:BOOL=ON")
 else (TEST_LONG)
@@ -275,7 +281,7 @@
   testbuild_ex("debug-internal-32" OFF "
     DEBUG:BOOL=ON
     INTERNAL:BOOL=ON
-    BUILD_TESTS:BOOL=ON
+    ${build_tests}
     ${install_path_cache}
     " OFF ON "${install_build_args}")
   if (last_build_dir MATCHES "-32")
@@ -286,7 +292,7 @@
   testbuild_ex("debug-internal-64" ON "
     DEBUG:BOOL=ON
     INTERNAL:BOOL=ON
-    BUILD_TESTS:BOOL=ON
+    ${build_tests}
     ${install_path_cache}
     ${32bit_path}
     " OFF ON "${install_build_args}")
@@ -316,7 +322,7 @@
   testbuild_ex("release-external-64" ON "
     DEBUG:BOOL=OFF
     INTERNAL:BOOL=OFF
-    BUILD_TESTS:BOOL=ON
+    ${build_tests}
     ${install_path_cache}
     ${32bit_path}
     " OFF ${arg_package} "${install_build_args}")
@@ -415,7 +421,7 @@
   testbuild_ex("arm-debug-internal-32" OFF "
     DEBUG:BOOL=ON
     INTERNAL:BOOL=ON
-    BUILD_TESTS:BOOL=ON
+    ${build_tests}
     CMAKE_TOOLCHAIN_FILE:PATH=${CTEST_SOURCE_DIRECTORY}/make/toolchain-arm32.cmake
     " OFF ${arg_package} "")
   testbuild_ex("arm-release-external-32" OFF "
@@ -426,7 +432,7 @@
   testbuild_ex("arm-debug-internal-64" ON "
     DEBUG:BOOL=ON
     INTERNAL:BOOL=ON
-    BUILD_TESTS:BOOL=ON
+    ${build_tests}
     CMAKE_TOOLCHAIN_FILE:PATH=${CTEST_SOURCE_DIRECTORY}/make/toolchain-arm64.cmake
     " OFF ${arg_package} "")
   testbuild_ex("arm-release-external-64" ON "
@@ -482,7 +488,7 @@
     DEBUG:BOOL=ON
     INTERNAL:BOOL=ON
     CMAKE_TOOLCHAIN_FILE:PATH=${CTEST_SOURCE_DIRECTORY}/make/toolchain-android.cmake
-    BUILD_TESTS:BOOL=ON
+    ${build_tests}
     ${android_extra_dbg}
     " OFF ${arg_package} "")
   testbuild_ex("android-release-external-32" OFF "


* replaced not applicable license with a new one. * cleanup

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -1,177 +1,132 @@
-# Copyright (c) 2012 - 2015, Lars Bilke
+# Copyright (c) 2015, Philipp Harms
 # All rights reserved.
 #
-# Redistribution and use in source and binary forms, with or without modification,
-# are permitted provided that the following conditions are met:
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
 #
-# 1. Redistributions of source code must retain the above copyright notice, this
-#    list of conditions and the following disclaimer.
+# * Redistributions of source code must retain the above copyright notice, this
+#  list of conditions and the following disclaimer.
 #
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
 #
-# 3. Neither the name of the copyright holder nor the names of its contributors
-#    may be used to endorse or promote products derived from this software without
-#    specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-# 2012-01-31, Lars Bilke
-# - Enable Code Coverage
-#
-# 2013-09-17, Joakim Söderberg
-# - Added support for Clang.
-# - Some additional usage instructions.
-#
-# USAGE:
-
-# 0. (Mac only) If you use Xcode 5.1 make sure to patch geninfo as described here:
-#      http://stackoverflow.com/a/22404544/80480
-#
-# 1. Copy this file into your cmake modules path.
-#
-# 2. Add the following line to your CMakeLists.txt:
-#      INCLUDE(CodeCoverage)
-#
-# 3. Set compiler flags to turn off optimization and enable coverage:
-#    SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
-#	 SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
-#
-# 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target
-#    which runs your test executable and produces a lcov code coverage report:
-#    Example:
-#	 SETUP_TARGET_FOR_COVERAGE(
-#				my_coverage_target  # Name for custom target.
-#				test_driver         # Name of the test driver executable that runs the tests.
-#									# NOTE! This should always have a ZERO as exit code
-#									# otherwise the coverage generation will not complete.
-#				coverage            # Name of output directory.
-#				)
-#
-# 4. Build a Debug build:
-#	 cmake -DCMAKE_BUILD_TYPE=Debug ..
-#	 make
-#	 make my_coverage_target
-#
-#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 function(_codecov_failure_message msg)
-	message(FATAL_ERROR "${msg}")
+  message(FATAL_ERROR "${msg}")
 endfunction()

 function(_codecov_gnu_setup)
-	find_program(CodeCov_GNU_LCOV lcov)
-	find_program(CodeCov_GNU_GENHTML genhtml)
+  find_program(CodeCov_GNU_LCOV lcov)
+  find_program(CodeCov_GNU_GENHTML genhtml)

-	set(_missing_programs)
-	if(NOT CodeCov_GNU_LCOV)
-		list(APPEND _missing_programs "lcov")
-	endif()
+  set(_missing_programs)
+  if(NOT CodeCov_GNU_LCOV)
+    list(APPEND _missing_programs "lcov")
+  endif()

-	if(NOT CodeCov_GNU_GENHTML)
-		list(APPEND _missing_programs "genhtml")
-	endif()
+  if(NOT CodeCov_GNU_GENHTML)
+    list(APPEND _missing_programs "genhtml")
+  endif()

-	if(_missing_programs)
-		string(REPLACE ";" ", " _missing_programs ${_missing_programs})
-		string(CONCAT _message "Could not find ${_missing_programs}")
+  if(_missing_programs)
+    string(REPLACE ";" ", " _missing_programs ${_missing_programs})
+    string(CONCAT _message "Could not find ${_missing_programs}")

-		_codecov_failure_message(${_message})
-	endif()
+    _codecov_failure_message(${_message})
+  endif()

-	mark_as_advanced(CodeCov_GNU_LCOV CodeCov_GNU_GENHTML)
+  mark_as_advanced(CodeCov_GNU_LCOV CodeCov_GNU_GENHTML)

-	add_custom_target(codecov_prerun
-	  ${CodeCov_GNU_LCOV} --directory . --zerocounters
-	  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-	COMMENT "Cleaning up coverage statistics")
+  add_custom_target(codecov_prerun
+    ${CodeCov_GNU_LCOV} --directory . --zerocounters
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMENT "Cleaning up coverage statistics")

-	add_custom_target(codecov_postrun
-		${CodeCov_GNU_LCOV} --directory . --capture --output-file coverage.info
-		COMMAND ${CodeCov_GNU_LCOV} --remove coverage.info '/usr/*' --output-file coverage.info.cleaned
-		COMMAND ${CodeCov_GNU_GENHTML} -o coverage coverage.info.cleaned
-	  COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned
+  add_custom_target(codecov_postrun
+    ${CodeCov_GNU_LCOV} --directory . --capture --output-file coverage.info
+    COMMAND ${CodeCov_GNU_LCOV} --remove coverage.info '/usr/*' --output-file coverage.info.cleaned
+    COMMAND ${CodeCov_GNU_GENHTML} -o coverage coverage.info.cleaned
+    COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned

-		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-	  COMMENT "Generating coverage report")
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating coverage report")

-	add_custom_target(coverage DEPENDS codecov_postrun)
+  add_custom_target(coverage DEPENDS codecov_postrun)
 endfunction()

 function(enable_coverage lang)
   if(CodeCov_${lang}_IS_INITIALIZED)
-		return()
-	endif()
+    return()
+  endif()

   if(NOT CMAKE_${lang}_COMPILER_LOADED)
-		enable_language(${lang})
-	endif()
+    enable_language(${lang})
+  endif()

   if(CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
-		if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS "4.1.0")
-			set(CodeCov_${lang}_FLAGS_INTERNAL "-g" "-O0" "-fprofile-arcs" "-ftest-coverage")
-			set(CodeCov_${lang}_LINK_FLAGS_INTERNAL "-fprofile-arcs -ftest-coverage")
-		else()
-		  set(CodeCov_${lang}_FLAGS_INTERNAL "-g" "-O0" "--coverage")
-		  set(CodeCov_${lang}_LINK_FLAGS_INTERNAL "--coverage")
-		endif()
-	elseif(CMAKE_${lang}_COMPILER_ID STREQUAL "Clang")
-		include(Check${lang}CompilerFlag)
-		if(${lang} STREQUAL "C")
-		  check_c_compiler_flag("-fprofile-instr-generate" PROFILE_INSTR_GENERATE_DETECTED)
-		  check_c_compiler_flag("-fcoverage-mapping" COVERAGE_MAPPING_DETECTED)
-		elseif(${lang} STREQUAL "CXX")
-			check_cxx_compiler_flag("-fprofile-instr-generate" PROFILE_INSTR_GENERATE_DETECTED)
-			check_cxx_compiler_flag("-fcoverage-mapping" COVERAGE_MAPPING_DETECTED)
-		elseif(${lang} STREQUAL "Fortran")
-			check_fortran_compiler_flag("-fprofile-instr-generate" PROFILE_INSTR_GENERATE_DETECTED)
-			check_fortran_compiler_flag("-fcoverage-mapping" COVERAGE_MAPPING_DETECTED)
-		else()
-			unset(PROFILE_INSTR_GENERATE_DETECTED)
-			unset(COVERAGE_MAPPING_DETECTED)
-		endif()
+    if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS "4.1.0")
+      set(CodeCov_${lang}_FLAGS_INTERNAL "-g" "-O0" "-fprofile-arcs" "-ftest-coverage")
+      set(CodeCov_${lang}_LINK_FLAGS_INTERNAL "-fprofile-arcs -ftest-coverage")
+    else()
+      set(CodeCov_${lang}_FLAGS_INTERNAL "-g" "-O0" "--coverage")
+      set(CodeCov_${lang}_LINK_FLAGS_INTERNAL "--coverage")
+    endif()
+  elseif(CMAKE_${lang}_COMPILER_ID STREQUAL "Clang")
+    include(Check${lang}CompilerFlag)
+    if(${lang} STREQUAL "C")
+      check_c_compiler_flag("-fprofile-instr-generate" PROFILE_INSTR_GENERATE_DETECTED)
+      check_c_compiler_flag("-fcoverage-mapping" COVERAGE_MAPPING_DETECTED)
+    elseif(${lang} STREQUAL "CXX")
+      check_cxx_compiler_flag("-fprofile-instr-generate" PROFILE_INSTR_GENERATE_DETECTED)
+      check_cxx_compiler_flag("-fcoverage-mapping" COVERAGE_MAPPING_DETECTED)
+    elseif(${lang} STREQUAL "Fortran")
+      check_fortran_compiler_flag("-fprofile-instr-generate" PROFILE_INSTR_GENERATE_DETECTED)
+      check_fortran_compiler_flag("-fcoverage-mapping" COVERAGE_MAPPING_DETECTED)
+    else()
+      unset(PROFILE_INSTR_GENERATE_DETECTED)
+      unset(COVERAGE_MAPPING_DETECTED)
+    endif()

-		if(PROFILE_INSTR_GENERATE_DETECTED AND COVERAGE_MAPPING_DETECTED)
-			set(CodeCov_${lang}_FLAGS_INTERNAL
-				"-g" "-O0" "-fprofile-instr-generate" "-fcoverage-mapping")
-			set(CodeCov_${lang}_LINK_FLAGS_INTERNAL
-				"-fprofile-instr-generate" "-fcoverage-mapping")
-		else()
-				unset(CodeCov_${lang}_FLAGS_INTERNAL)
-				unset(CodeCov_${lang}_LINK_FLAGS_INTERNAL)
-		endif()
-	else()
-		unset(CodeCov_${lang}_FLAGS_INTERNAL)
-		unset(CodeCov_${lang}_LINK_FLAGS_INTERNAL)
-	endif()
+    if(PROFILE_INSTR_GENERATE_DETECTED AND COVERAGE_MAPPING_DETECTED)
+      set(CodeCov_${lang}_FLAGS_INTERNAL
+        "-g" "-O0" "-fprofile-instr-generate" "-fcoverage-mapping")
+      set(CodeCov_${lang}_LINK_FLAGS_INTERNAL
+        "-fprofile-instr-generate" "-fcoverage-mapping")
+    else()
+        unset(CodeCov_${lang}_FLAGS_INTERNAL)
+        unset(CodeCov_${lang}_LINK_FLAGS_INTERNAL)
+    endif()
+  else()
+    unset(CodeCov_${lang}_FLAGS_INTERNAL)
+    unset(CodeCov_${lang}_LINK_FLAGS_INTERNAL)
+  endif()

-	set(CodeCov_${lang}_FLAGS "${CodeCov_C_FLAGS_INTERNAL}" CACHE STRING
-	  	"C compiler flags for code coverage.")
-	set(CodeCov_${lang}_LINK_FLAGS "${CodeCov_C_LINK_FLAGS_INTERNAL}" CACHE STRING
-	  	"These flags will be used when a target with coverage is linked.")
-	mark_as_advanced(CodeCov_${lang}_FLAGS CodeCov_${lang}_LINK_FLAGS)
+  set(CodeCov_${lang}_FLAGS "${CodeCov_C_FLAGS_INTERNAL}" CACHE STRING
+      "C compiler flags for code coverage.")
+  set(CodeCov_${lang}_LINK_FLAGS "${CodeCov_C_LINK_FLAGS_INTERNAL}" CACHE STRING
+      "These flags will be used when a target with coverage is linked.")
+  mark_as_advanced(CodeCov_${lang}_FLAGS CodeCov_${lang}_LINK_FLAGS)

-	if(CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
-		_codecov_gnu_setup()
-	else()
-		message(FATAL_ERROR "code coverage is not implemented for CMAKE_${lang}_COMPILER_ID")
-	endif()
+  if(CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
+    _codecov_gnu_setup()
+  else()
+    message(FATAL_ERROR "code coverage is not implemented for CMAKE_${lang}_COMPILER_ID")
+  endif()

-	if(CodeCov_${lang}_FLAGS AND CodeCov_${lang}_LINK_FLAGS)
-		set(CodeCov_${lang}_IS_INITIALIZED TRUE PARENT_SCOPE)
-	endif()
+  if(CodeCov_${lang}_FLAGS AND CodeCov_${lang}_LINK_FLAGS)
+    set(CodeCov_${lang}_IS_INITIALIZED TRUE PARENT_SCOPE)
+  endif()
 endfunction()

 function(add_coverage_target target lang)
@@ -203,5 +158,5 @@
   add_custom_target(${name} COMMAND ${failsafe_command})

   add_dependencies(${name} codecov_prerun)
-	add_dependencies(codecov_postrun ${name})
+  add_dependencies(codecov_postrun ${name})
 endfunction()


getdeps: export a property that contains the path to the output executable

Summary:
Export a property that indicates the path to the test executable.  This is
useful for callers that want to install the binary or run it from other CMake
rules.

Reviewed By: simpkins

Differential Revision: D17647146

fbshipit-source-id: b32e2694e44a07d7c234e53a7a5c8443cb144487

--- build/fbcode_builder/CMake/FBPythonBinary.cmake
+++ build/fbcode_builder/CMake/FBPythonBinary.cmake
@@ -156,6 +156,12 @@
   # Add an "ALL" target that depends on force ${EXE_NAME},
   # so that ${EXE_NAME} will be included in the default list of build targets.
   add_custom_target("${EXE_NAME}.GEN_PY_EXE" ALL DEPENDS "${output_file}")
+
+  # Allow resolving the executable path for the target that we generate
+  # via a generator expression like:
+  # "WATCHMAN_WAIT_PATH=$<TARGET_PROPERTY:watchman-wait.GEN_PY_EXE,EXECUTABLE>"
+  set_property(TARGET "${EXE_NAME}.GEN_PY_EXE"
+      PROPERTY EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/${output_file}")
 endfunction()

 #


Add check of fcntl.h

Add check of fcntl.h

--- cmake/MyPackageCheckCommonIncludeFiles.cmake
+++ cmake/MyPackageCheckCommonIncludeFiles.cmake
@@ -12,4 +12,5 @@
   CHECK_INCLUDE_FILE ("unistd.h"     HAVE_UNISTD_H)
   CHECK_INCLUDE_FILE ("io.h"         HAVE_IO_H)
   CHECK_INCLUDE_FILE ("time.h"       HAVE_TIME_H)
+  CHECK_INCLUDE_FILE ("fcntl.h"      HAVE_FCNTL_H)
 ENDMACRO()


fix: Use execute_process to replace cache.cmake and ScriptConfig.cmake if different [BASIS]

--- CMake/Basis/TargetTools.cmake
+++ CMake/Basis/TargetTools.cmake
@@ -1407,7 +1407,7 @@
   add_custom_target (${TARGET_UID} ALL SOURCES ${SOURCES})
   # dump CMake variables for configuration of script
   set (BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TARGET_UID}")
-  basis_dump_variables ("${BUILD_DIR}.dir/cache.cmake.in")
+  basis_dump_variables ("${BUILD_DIR}.dir/cache.cmake.tmp")
   # auto-detect programming language (may be as well UNKNOWN)
   if (ARGN_LANGUAGE)
     string (TOUPPER "${ARGN_LANGUAGE}" ARGN_LANGUAGE)
@@ -2282,7 +2282,7 @@
   message (STATUS "Adding script library ${TARGET_UID}...")
   # dump CMake variables for configuration of script
   set (BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TARGET_UID}")
-  basis_dump_variables ("${BUILD_DIR}.dir/cache.cmake.in")
+  basis_dump_variables ("${BUILD_DIR}.dir/cache.cmake.tmp")
   # parse arguments
   CMAKE_PARSE_ARGUMENTS (
     ARGN
@@ -2713,20 +2713,14 @@
   endif ()
   if (SCRIPT_DEFINITIONS)
     set (SCRIPT_CONFIG_FILE "${BUILD_DIR}/ScriptConfig.cmake")
-    file (WRITE "${SCRIPT_CONFIG_FILE}.in" "# DO NOT edit. Automatically generated by BASIS.\n${SCRIPT_DEFINITIONS}\n")
-    add_custom_command (
-      OUTPUT "${SCRIPT_CONFIG_FILE}"
-      COMMAND "${CMAKE_COMMAND}" -E copy_if_different
-              "${SCRIPT_CONFIG_FILE}.in" "${SCRIPT_CONFIG_FILE}"
-    )
+    file (WRITE "${SCRIPT_CONFIG_FILE}.tmp" "# DO NOT edit. Automatically generated by BASIS.\n${SCRIPT_DEFINITIONS}\n")
+    execute_process (COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${SCRIPT_CONFIG_FILE}.tmp" "${SCRIPT_CONFIG_FILE}")
+    file (REMOVE "${SCRIPT_CONFIG_FILE}.tmp")
     list (APPEND CONFIG_FILES "${SCRIPT_CONFIG_FILE}")
   endif ()
   set (CACHE_FILE "${BUILD_DIR}/cache.cmake")
-  add_custom_command (
-    OUTPUT  "${CACHE_FILE}"
-    COMMAND "${CMAKE_COMMAND}" -E copy_if_different
-            "${CACHE_FILE}.in" "${CACHE_FILE}"
-  )
+  execute_process (COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CACHE_FILE}.tmp" "${CACHE_FILE}")
+  file (REMOVE "${CACHE_FILE}.tmp")
   set (OPTIONS)
   foreach (FLAG IN ITEMS COMPILE EXECUTABLE)
     if (${FLAG})
@@ -3035,20 +3029,14 @@
   endif ()
   if (SCRIPT_DEFINITIONS)
     set (SCRIPT_CONFIG_FILE "${BUILD_DIR}/ScriptConfig.cmake")
-    file (WRITE "${SCRIPT_CONFIG_FILE}.in" "# DO NOT edit. Automatically generated by BASIS.\n${SCRIPT_DEFINITIONS}\n")
-    add_custom_command (
-      OUTPUT  "${SCRIPT_CONFIG_FILE}"
-      COMMAND "${CMAKE_COMMAND}" -E copy_if_different
-              "${SCRIPT_CONFIG_FILE}.in" "${SCRIPT_CONFIG_FILE}"
-    )
+    file (WRITE "${SCRIPT_CONFIG_FILE}.tmp" "# DO NOT edit. Automatically generated by BASIS.\n${SCRIPT_DEFINITIONS}\n")
+    execute_process (COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${SCRIPT_CONFIG_FILE}.tmp" "${SCRIPT_CONFIG_FILE}")
+    file (REMOVE "${SCRIPT_CONFIG_FILE}.tmp")
     list (APPEND CONFIG_FILES "${SCRIPT_CONFIG_FILE}")
   endif ()
   set (CACHE_FILE "${BUILD_DIR}/cache.cmake")
-  add_custom_command (
-    OUTPUT  "${CACHE_FILE}"
-    COMMAND "${CMAKE_COMMAND}" -E copy_if_different
-            "${CACHE_FILE}.in" "${CACHE_FILE}"
-  )
+  execute_process (COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CACHE_FILE}.tmp" "${CACHE_FILE}")
+  file (REMOVE "${CACHE_FILE}.tmp")
   set (OPTIONS) # no additional options
   if (COMPILE)
     list (APPEND OPTIONS COMPILE)
@@ -3398,10 +3386,7 @@
   set (BUILD_SCRIPT "${BUILD_DIR}/build.cmake")
   if (EXISTS "${BUILD_SCRIPT}")
     file (WRITE "${BUILD_SCRIPT}.tmp" "${C}")
-    execute_process (
-      COMMAND "${CMAKE_COMMAND}" -E copy_if_different
-          "${BUILD_SCRIPT}.tmp" "${BUILD_SCRIPT}"
-    )
+    execute_process (COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${BUILD_SCRIPT}.tmp" "${BUILD_SCRIPT}")
     file (REMOVE "${BUILD_SCRIPT}.tmp")
   else ()
     file (WRITE "${BUILD_SCRIPT}" "${C}")


changed the revisionTag to fit to the new mitk data

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag 55445f45)
+  set(revision_tag 66dc8282)

   #if(${proj}_REVISION_TAG)
   #  set(revision_tag ${${proj}_REVISION_TAG})


COMP: Add new reference images for overlay tests

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag bd66cd69)
+  set(revision_tag 84372b38)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


- New LLVM directory structure, thanks Brew

--- cmake/Toolchains/native-macintosh-generic.toolchain.cmake
+++ cmake/Toolchains/native-macintosh-generic.toolchain.cmake
@@ -1,16 +1,12 @@
-# Temporary workaround
+set ( CLANG_PATH "/usr/local/opt/llvm@3.8" )
+set ( CMAKE_C_COMPILER ${CLANG_PATH}/bin/clang-3.8  )
+set ( CMAKE_CXX_COMPILER ${CLANG_PATH}/bin/clang++-3.8 )

-if(NOT "$ENV{CXX}" AND NOT "$ENV{CC}")
-    set ( CLANG_PATH "/usr/local/opt/llvm38" )
-    set ( CMAKE_C_COMPILER ${CLANG_PATH}/bin/clang-3.8  )
-    set ( CMAKE_CXX_COMPILER ${CLANG_PATH}/bin/clang++-3.8 )
+include_directories ( "${CLANG_PATH}/lib/llvm-3.8/include/c++/v1" )
+link_directories("${CLANG_PATH}/lib/llvm-3.8/lib")

-    include_directories ( "${CLANG_PATH}/lib/llvm-3.8/include/c++/v1" )
-    link_directories("${CLANG_PATH}/lib/llvm-3.8/lib")
-else()
-    set ( CMAKE_C_COMPILER "$ENV{CC}"  )
-    set ( CMAKE_CXX_COMPILER "$ENV{CXX}" )
-endif()
+set ( CMAKE_C_COMPILER "$ENV{CC}"  )
+set ( CMAKE_CXX_COMPILER "$ENV{CXX}" )

 # Forcing use of C++11 (or later) libc++
 set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11" CACHE STRING "" )


COMP: forgot to add test to MODULE_CUSTOM_TESTS

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -110,6 +110,7 @@
     mitkIOUtilTest.cpp
     mitkSurfaceVtkMapper3DTest
     mitkSurfaceVtkMapper3DTexturedSphereTest.cpp
+    mitkVolumeCalculatorTest.cpp
 )

 # Create an artificial module initializing class for


Remove unneeded zlib dependency

Remove unneeded zlib dependency

--- toolchains/iOS.cmake
+++ toolchains/iOS.cmake
@@ -38,11 +38,6 @@
 add_subdirectory(${PROJECT_SOURCE_DIR}/core)
 include_directories(${CORE_INCLUDE_DIRS})

-find_package(ZLIB REQUIRED)
-if (ZLIB_FOUND)
-    include_directories(${ZLIB_INCLUDE_DIRS})
-endif()
-
 # ios source files
 set(IOS_EXTENSIONS_FILES *.mm *.cpp *.m)
 foreach(_ext ${IOS_EXTENSIONS_FILES})
@@ -54,7 +49,6 @@
 # link and build functions
 function(link_libraries)
     target_link_libraries(${EXECUTABLE_NAME} core)
-    target_link_libraries(${EXECUTABLE_NAME} ${ZLIB_LIBRARIES})

     foreach(_framework ${FRAMEWORKS})
         add_framework(${_framework} ${EXECUTABLE_NAME} ${CMAKE_SYSTEM_FRAMEWORK_PATH})


remove redundant file

remove redundant file

--- cmake/FindPythonLibsNew.cmake
+++ cmake/FindPythonLibsNew.cmake
@@ -1,240 +0,0 @@
-# - Find python libraries
-# This module finds the libraries corresponding to the Python interpeter
-# FindPythonInterp provides.
-# This code sets the following variables:
-#
-#  PYTHONLIBS_FOUND           - have the Python libs been found
-#  PYTHON_PREFIX              - path to the Python installation
-#  PYTHON_LIBRARIES           - path to the python library
-#  PYTHON_INCLUDE_DIRS        - path to where Python.h is found
-#  PYTHON_SITE_PACKAGES       - path to installation site-packages
-#  PYTHON_IS_DEBUG            - whether the Python interpreter is a debug build
-#
-#  PYTHON_INCLUDE_PATH        - path to where Python.h is found (deprecated)
-#
-# A function PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is defined
-# to build modules for python.
-#
-# Thanks to talljimbo for the patch adding the 'LDVERSION' config
-# variable usage.
-
-#=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
-# Copyright 2012-2014 Continuum Analytics, Inc.
-#
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# * Neither the names of Kitware, Inc., the Insight Software Consortium,
-# nor the names of their contributors may be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# Use the Python interpreter to find the libs.
-if(PythonLibsNew_FIND_REQUIRED)
-    find_package(PythonInterp REQUIRED)
-else()
-    find_package(PythonInterp)
-endif()
-
-if(NOT PYTHONINTERP_FOUND)
-    set(PYTHONLIBS_FOUND FALSE)
-    return()
-endif()
-
-# According to http://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter
-# testing whether sys has the gettotalrefcount function is a reliable,
-# cross-platform way to detect a CPython debug interpreter.
-#
-# The library suffix is from the config var LDVERSION sometimes, otherwise
-# VERSION. VERSION will typically be like "2.7" on unix, and "27" on windows.
-#
-# The config var LIBPL is for Linux, and helps on Debian Jessie where the
-# addition of multi-arch support shuffled things around.
-execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
-    "from distutils import sysconfig as s;import sys;import struct;
-print('.'.join(str(v) for v in sys.version_info));
-print(sys.prefix);
-print(s.get_python_inc(plat_specific=True));
-print(s.get_python_lib(plat_specific=True));
-print(s.get_config_var('SO'));
-print(hasattr(sys, 'gettotalrefcount')+0);
-print(struct.calcsize('@P'));
-print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION'));
-print(s.get_config_var('LIBPL'));
-"
-    RESULT_VARIABLE _PYTHON_SUCCESS
-    OUTPUT_VARIABLE _PYTHON_VALUES
-    ERROR_VARIABLE _PYTHON_ERROR_VALUE
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-if(NOT _PYTHON_SUCCESS MATCHES 0)
-    if(PythonLibsNew_FIND_REQUIRED)
-        message(FATAL_ERROR
-            "Python config failure:\n${_PYTHON_ERROR_VALUE}")
-    endif()
-    set(PYTHONLIBS_FOUND FALSE)
-    return()
-endif()
-
-# Convert the process output into a list
-string(REGEX REPLACE ";" "\\\\;" _PYTHON_VALUES ${_PYTHON_VALUES})
-string(REGEX REPLACE "\n" ";" _PYTHON_VALUES ${_PYTHON_VALUES})
-list(GET _PYTHON_VALUES 0 _PYTHON_VERSION_LIST)
-list(GET _PYTHON_VALUES 1 PYTHON_PREFIX)
-list(GET _PYTHON_VALUES 2 PYTHON_INCLUDE_DIR)
-list(GET _PYTHON_VALUES 3 PYTHON_SITE_PACKAGES)
-list(GET _PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION)
-list(GET _PYTHON_VALUES 5 PYTHON_IS_DEBUG)
-list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P)
-list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX)
-list(GET _PYTHON_VALUES 8 PYTHON_LIBRARY_PATH)
-
-# Make sure the Python has the same pointer-size as the chosen compiler
-# Skip the check on OS X, it doesn't consistently have CMAKE_SIZEOF_VOID_P defined
-if((NOT APPLE) AND (NOT "${PYTHON_SIZEOF_VOID_P}" STREQUAL "${CMAKE_SIZEOF_VOID_P}"))
-    if(PythonLibsNew_FIND_REQUIRED)
-        math(EXPR _PYTHON_BITS "${PYTHON_SIZEOF_VOID_P} * 8")
-        math(EXPR _CMAKE_BITS "${CMAKE_SIZEOF_VOID_P} * 8")
-        message(FATAL_ERROR
-            "Python config failure: Python is ${_PYTHON_BITS}-bit, "
-            "chosen compiler is  ${_CMAKE_BITS}-bit")
-    endif()
-    set(PYTHONLIBS_FOUND FALSE)
-    return()
-endif()
-
-# The built-in FindPython didn't always give the version numbers
-string(REGEX REPLACE "\\." ";" _PYTHON_VERSION_LIST ${_PYTHON_VERSION_LIST})
-list(GET _PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
-list(GET _PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
-list(GET _PYTHON_VERSION_LIST 2 PYTHON_VERSION_PATCH)
-
-# Make sure all directory separators are '/'
-string(REGEX REPLACE "\\\\" "/" PYTHON_PREFIX ${PYTHON_PREFIX})
-string(REGEX REPLACE "\\\\" "/" PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR})
-string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES})
-
-if(CMAKE_HOST_WIN32)
-    if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
-        set(PYTHON_LIBRARY
-            "${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
-    else()
-        set(PYTHON_LIBRARY "${PYTHON_PREFIX}/libs/libpython${PYTHON_LIBRARY_SUFFIX}.a")
-    endif()
-elseif(APPLE)
-     # Seems to require "-undefined dynamic_lookup" instead of linking
-     # against the .dylib, otherwise it crashes. This flag is added
-     # below
-    set(PYTHON_LIBRARY "")
-    #set(PYTHON_LIBRARY
-    #    "${PYTHON_PREFIX}/lib/libpython${PYTHON_LIBRARY_SUFFIX}.dylib")
-else()
-    if(${PYTHON_SIZEOF_VOID_P} MATCHES 8)
-        set(_PYTHON_LIBS_SEARCH "${PYTHON_PREFIX}/lib64" "${PYTHON_PREFIX}/lib" "${PYTHON_LIBRARY_PATH}")
-    else()
-        set(_PYTHON_LIBS_SEARCH "${PYTHON_PREFIX}/lib" "${PYTHON_LIBRARY_PATH}")
-    endif()
-    message(STATUS "Searching for Python libs in ${_PYTHON_LIBS_SEARCH}")
-    # Probably this needs to be more involved. It would be nice if the config
-    # information the python interpreter itself gave us were more complete.
-    find_library(PYTHON_LIBRARY
-        NAMES "python${PYTHON_LIBRARY_SUFFIX}"
-        HINTS ${_PYTHON_LIBS_SEARCH}
-        NO_SYSTEM_ENVIRONMENT_PATH)
-    message(STATUS "Found Python lib ${PYTHON_LIBRARY}")
-endif()
-
-# For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal.
-SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL
-          "Path to where Python.h is found (deprecated)")
-
-MARK_AS_ADVANCED(
-  PYTHON_LIBRARY
-  PYTHON_INCLUDE_DIR
-)
-
-# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
-# cache entries because they are meant to specify the location of a single
-# library. We now set the variables listed by the documentation for this
-# module.
-SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
-SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
-SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
-
-
-# Don't know how to get to this directory, just doing something simple :P
-#INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-#FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
-find_package_message(PYTHON
-    "Found PythonLibs: ${PYTHON_LIBRARY}"
-    "${PYTHON_EXECUTABLE}${PYTHON_VERSION}")
-
-
-# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
-FUNCTION(PYTHON_ADD_MODULE _NAME )
-  GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS
-    GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
-  OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
-  OPTION(PYTHON_MODULE_${_NAME}_BUILD_SHARED
-    "Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
-
-  # Mark these options as advanced
-  MARK_AS_ADVANCED(PYTHON_ENABLE_MODULE_${_NAME}
-    PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-
-  IF(PYTHON_ENABLE_MODULE_${_NAME})
-    IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-      SET(PY_MODULE_TYPE MODULE)
-    ELSE(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-      SET(PY_MODULE_TYPE STATIC)
-      SET_PROPERTY(GLOBAL  APPEND  PROPERTY  PY_STATIC_MODULES_LIST ${_NAME})
-    ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-
-    SET_PROPERTY(GLOBAL  APPEND  PROPERTY  PY_MODULES_LIST ${_NAME})
-    ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
-    IF(APPLE)
-      # On OS X, linking against the Python libraries causes
-      # segfaults, so do this dynamic lookup instead.
-      SET_TARGET_PROPERTIES(${_NAME} PROPERTIES LINK_FLAGS
-                          "-undefined dynamic_lookup")
-    ELSE()
-     # In general, we should not link against libpython as we do not embed
-     # the Python interpreter. The python binary itself can then define where
-     # the symbols should loaded from.
-     SET_TARGET_PROPERTIES(${_NAME} PROPERTIES LINK_FLAGS
-         "-Wl,-undefined,dynamic_lookup")
-    ENDIF()
-    IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-      SET_TARGET_PROPERTIES(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
-      SET_TARGET_PROPERTIES(${_NAME} PROPERTIES SUFFIX "${PYTHON_MODULE_EXTENSION}")
-    ELSE()
-    ENDIF()
-
-  ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
-ENDFUNCTION(PYTHON_ADD_MODULE)


look for junit4.jar first, then unversioned

--- cmake_modules/FindJUnit.cmake
+++ cmake_modules/FindJUnit.cmake
@@ -29,10 +29,7 @@

 # easiest case, find a junit.jar
 # TODO: review path hints
-find_file(JUnit_PATH junit.jar HINTS /usr/share/java)
-
-# TODO: look for versioned jars too, if junit.jar did not exist
-# e.g. junit4.jar
+find_file(JUnit_PATH NAMES junit4.jar junit.jar HINTS /usr/share/java)

 # call magic cmake function
 include(FindPackageHandleStandardArgs)


build command update

build command update

--- SuperBuild/External_CCPi-RGL.cmake
+++ SuperBuild/External_CCPi-RGL.cmake
@@ -94,6 +94,7 @@
         -DPYTHON_DEST=${PYTHON_DEST_DIR}
     BUILD_COMMAND make
     INSTALL_COMMAND make install
+    TEST_COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/run_test*.py

 #    CMAKE_ARGS
 #        -DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir}


cmake: remove annoying status messages

cmake: remove annoying status messages

they were in the middle of the output several times

--- scripts/cmake/Modules/LibAddMacros.cmake
+++ scripts/cmake/Modules/LibAddMacros.cmake
@@ -147,12 +147,10 @@

 		find_package (SWIG 4 QUIET)
 		if (NOT SWIG_FOUND)
-			message (STATUS "Search for swig3 instead")
 			find_package (SWIG 3 QUIET)
 		endif ()

 		if (NOT SWIG_FOUND)
-			message (STATUS "Search for swig2 instead")
 			find_package (SWIG 2 QUIET)
 		endif ()


Add ITK_GIT_TAG and ITK_GIT_REPOSITORY variables for Superbuild

Adding these advanced options to the SimpleITK Superbuild allows for
easy experimentation against development versions of ITK and usage of
faster repository. The ITK_REPOSITORY variable is now a legacy option
in favor of ITK_GIT_REPOSITORY.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -41,17 +41,22 @@

 set(proj ITK)  ## Use ITK convention of calling it ITK
-if(NOT DEFINED ITK_REPOSITORY)
-  set(ITK_REPOSITORY "${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git")
-endif()
+
+
+set(ITK_GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git" CACHE STRING "URL of ITK Git repository")
+mark_as_advanced(ITK_GIT_REPOSITORY)
+sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)
+
+# NOTE: it is very important to update the ITK_DIR path with the ITK version
+set(ITK_GIT_TAG "v4.12.0" CACHE STRING "Tag in ITK git repo")
+mark_as_advanced(ITK_GIT_TAG)
+set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")

 set(ITK_USE_GIT_PROTOCOL 0)
 if("${git_protocol}" STREQUAL "git")
   set(ITK_USE_GIT_PROTOCOL 1)
 endif()

-# NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.12.0) # 4.12.0 tag

 if( ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )
@@ -66,7 +71,7 @@
 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_itk_cache}\n${ep_common_cache}" )

 ExternalProject_Add(${proj}
-  GIT_REPOSITORY ${ITK_REPOSITORY}
+  GIT_REPOSITORY ${ITK_GIT_REPOSITORY}
   ${ITK_TAG_COMMAND}
   UPDATE_COMMAND ""
   SOURCE_DIR ${proj}


reduce Boost version requirement when not building Gadgetron

--- version_config.cmake
+++ version_config.cmake
@@ -31,7 +31,12 @@
 else()
      # Use version in Ubuntu 18.04
      set(Boost_VERSION 1.65.1)
-     set(Boost_REQUIRED_VERSION 1.65.1)
+     if (BUILD_GADGETRON)
+       set(Boost_REQUIRED_VERSION 1.65.1)
+     else()
+       # Ubutnu 16.04 version should be fine
+       set(Boost_REQUIRED_VERSION 1.58.0)
+     endif()
      set(Boost_URL http://downloads.sourceforge.net/project/boost/boost/${Boost_VERSION}/boost_1_65_1.zip)
      set(Boost_MD5 9824a7a3e25c9d4fdf2def07bce8651c)
 endif()


we don't need threads any more

we don't need threads any more

--HG--
branch : boost_test

--- CMakeModules/OMPLUtils.cmake
+++ CMakeModules/OMPLUtils.cmake
@@ -1,5 +1,3 @@
-find_package(Threads)
-
 macro(add_ompl_test test_name)
   add_executable(${ARGV})
   target_link_libraries(${test_name}
@@ -9,8 +7,7 @@
     ${Boost_THREAD_LIBRARY}
     ${Boost_DATE_TIME_LIBRARY}
     ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
-    ${Boost_TEST_EXEC_MONITOR_LIBRARY}
-    ${CMAKE_THREAD_LIBS_INIT})
+    ${Boost_TEST_EXEC_MONITOR_LIBRARY})
   add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
 endmacro(add_ompl_test)


use updated Mosek pod

use updated Mosek pod

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -107,8 +107,8 @@
 set(iris_revision 7ae8b0988d917211787effbbfe816c14c4fc2887)
 set(iris_depends)

-set(mosek_url ssh://git@github.com/RobotLocomotion/mosek.git)
-set(mosek_revision fab3ef0148ca1f565abf68fb73369e33fcc38cc4)
+set(mosek_url ssh://git@github.com/rdeits/mosek.git)
+set(mosek_revision 2cdb719539e7255d177b1c3cae25307f044aa908)
 set(mosek_depends)

 set(flycapture_url https://svn.csail.mit.edu/drc/trunk/software/externals/flycapture)


Remove warnings for cdf on linux

Remove warnings for cdf on linux

--- support/cmake/support_macros.cmake
+++ support/cmake/support_macros.cmake
@@ -196,7 +196,7 @@
             if (MSVC)
                 target_compile_options(cdf PUBLIC "/W0" "/MP")
             else ()
-                target_compile_options(ccmc PUBLIC "-w")
+                target_compile_options(cdf PUBLIC "-w")
             endif ()
         endif ()
         set_property(TARGET cdf PROPERTY FOLDER "External")


include IRIS as a pods-compatible external

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -103,6 +103,10 @@
 set(gurobi_revision 46d1985d5a86f7bc660e363cb2d5ff76af4b6fd9)
 set(gurobi_depends)

+set(iris_url ssh://git@github.com/rdeits/iris-distro.git)
+set(iris_revision 8241ee28b05d4bcd0c456be3b446e81cce12bff7)
+set(iris_depends)
+
 set(flycapture_url https://svn.csail.mit.edu/drc/trunk/software/externals/flycapture)
 set(flycapture_revision 8298)
 set(flycapture_depends)
@@ -138,6 +142,7 @@
   spotless
   snopt
   gurobi
+  iris
   )


Fixed bug in installation using EPROSIMA_BUILD

--- cmake/dev/eprosima_libraries.cmake
+++ cmake/dev/eprosima_libraries.cmake
@@ -111,6 +111,11 @@
                 DESTINATION lib/x64Win64VS2013
                 COMPONENT libraries_x64Win64VS2013
                 )
+        elseif(EPROSIMA_BUILD)
+            install(DIRECTORY ${fastcdr_LIB_DIR}
+                DESTINATION lib/${MSVC_ARCH}
+                COMPONENT libraries_${MSVC_ARCH}
+                )
         else()
             install(DIRECTORY ${fastcdr_LIB_DIR}
                 DESTINATION lib


When building from git, add ref-id to PACKAGE_VERSION

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

--- cmake/modules/VersionFromVCS.cmake
+++ cmake/modules/VersionFromVCS.cmake
@@ -15,6 +15,19 @@
     endif()
   elseif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git )
     set(result "${result}git")
+    # Try to get a ref-id
+    find_program(git_executable NAMES git git.exe git.cmd)
+    if( git_executable )
+      execute_process(COMMAND ${git_executable} show-ref HEAD
+	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+	TIMEOUT 5
+	RESULT_VARIABLE git_result
+	OUTPUT_VARIABLE git_output)
+      if( git_result EQUAL 0 )
+	string(SUBSTRING ${git_output} 0 7 git_ref_id)
+	set(result "${result}-${git_ref_id}")
+      endif()
+    endif()
   endif()
   set(${VERS} ${result} PARENT_SCOPE)
 endfunction(add_version_info_from_vcs)


fixed typo in relwithdebinfo build options

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -45,8 +45,8 @@
     #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
     set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT")
     set(CMAKE_C_FLAGS_RELEASE   "-O2 -DNDEBUG")
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-02 -g -Wall -Wno-unused-function")
-    set(CMAKE_C_FLAGS_RELWITHDEBINFO "-02 -g -Wall -Wno-unused-function")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wall -Wno-unused-function")
+    set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -Wall -Wno-unused-function")
     set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall")
     set(CMAKE_C_FLAGS_DEBUG   "-O0 -g -Wall")
     set(CMAKE_CXX_FLAGS_MINSIZEREL "-O1 -DNDEBUG -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT")


clang: remove cache handling

clang: remove cache handling

This is taking too long for every run and does not seem to work as
expected and wastes time instead of saving it. Remove for now..

Signed-off-by: Anas Nashif <0d9952ec84ac43c159f6b7e7ed99a9080c00dd6e@intel.com>

--- cmake/toolchain/llvm/generic.cmake
+++ cmake/toolchain/llvm/generic.cmake
@@ -1,12 +1,4 @@
 # SPDX-License-Identifier: Apache-2.0
-
-find_appropriate_cache_directory(USER_CACHE_DIR)
-
-if((NOT "${USER_CACHE_DIR}" STREQUAL "") AND (EXISTS "${USER_CACHE_DIR}"))
-  message(STATUS "Invalidating toolchain capability cache in ${USER_CACHE_DIR}")
-  execute_process(COMMAND
-    ${CMAKE_COMMAND} -E remove_directory "${USER_CACHE_DIR}")
-endif()

 if(DEFINED $ENV{CLANG_ROOT_DIR})
   set(TOOLCHAIN_HOME ${CLANG_ROOT}/bin/)


Fix TensorBoard SHA256 in cmake

Fix TensorBoard SHA256 in cmake

--- tensorflow/contrib/cmake/tf_python.cmake
+++ tensorflow/contrib/cmake/tf_python.cmake
@@ -908,7 +908,7 @@

 # Copy resources for TensorBoard.
 file(DOWNLOAD http://mirror.bazel.build/tensorboard/index.html ${DOWNLOAD_LOCATION}/tensorboard/index.html
-  EXPECTED_HASH SHA256=60f185c68ff3f906000df9670bf9f46588056b197da7e7b10074411a0c048dae)
+  EXPECTED_HASH SHA256=25554e708552ad8587152f7a444db3f4ca753f9ed72d9f8105203c1d1806d521)
 add_custom_command(TARGET tf_python_touchup_modules PRE_BUILD
   COMMAND ${CMAKE_COMMAND} -E make_directory
   ${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/tensorboard/components/)


Enable ELF hidden symbol visibility

Enable ELF hidden symbol visibility

--- lcm-cmake/config.cmake
+++ lcm-cmake/config.cmake
@@ -44,6 +44,10 @@
 # Build shared by default
 option(BUILD_SHARED_LIBS "Build shared libraries" ON)

+# Enable ELF hidden visibility
+set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
+set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
+
 # Set extra compiler flags
 if(NOT MSVC)
   lcm_add_c_flags(-std=gnu99)


look for mariadb client libraries too

look for mariadb client libraries too

--- cmake/Modules/FindMySQL.cmake
+++ cmake/Modules/FindMySQL.cmake
@@ -15,7 +15,7 @@
   /usr/include/mysql
 )

-SET(MYSQL_NAMES mysqlclient mysqlclient_r)
+SET(MYSQL_NAMES mysqlclient mysqlclient_r mariadbclient mariadbclient_r)
 FIND_LIBRARY(MYSQL_LIBRARY
   NAMES ${MYSQL_NAMES}
   PATHS /usr/lib /usr/local/lib


refine openblas install lib when CAPI

refine openblas install lib when CAPI

--- cmake/external/openblas.cmake
+++ cmake/external/openblas.cmake
@@ -100,6 +100,11 @@
                 \"${CBLAS_INSTALL_DIR}/lib -> ${CMAKE_INSTALL_PREFIX}/${TMP_INSTALL_DIR}\"
             )"
         )
+        INSTALL(CODE "execute_process(
+            COMMAND rm -r ${CMAKE_INSTALL_PREFIX}/${TMP_INSTALL_DIR}/cmake
+                    ${CMAKE_INSTALL_PREFIX}/${TMP_INSTALL_DIR}/pkgconfig
+            )"
+        )
     ENDIF()
 ENDIF(NOT ${CBLAS_FOUND})


ENABLE_wxwidgets=OFF by default since wxPLplotDemo segfaults on Linux.  This
(hopefully temporary) build-system change does not affect -dev wxwidgets
which appears to work on Linux.

svn path=/trunk/; revision=9101

--- cmake/modules/wxwidgets.cmake
+++ cmake/modules/wxwidgets.cmake
@@ -89,7 +89,7 @@
 if(DEFAULT_NO_BINDINGS)
   option(ENABLE_wxwidgets "Enable wxwidgets bindings" OFF)
 else(DEFAULT_NO_BINDINGS)
-  option(ENABLE_wxwidgets "Enable wxwidgets bindings" ON)
+  option(ENABLE_wxwidgets "Enable wxwidgets bindings" OFF)
 endif(DEFAULT_NO_BINDINGS)

 if(ENABLE_wxwidgets AND NOT PLD_wxwidgets)


fixing error when adding new flag to empty flag list.

--- WkCompilerSetup.cmake
+++ WkCompilerSetup.cmake
@@ -63,20 +63,32 @@
 # Usage : WkAddCFlags( Build [newflags] )
 macro(WkAddCFlags Build)
 	IF (${Build} STREQUAL All )
-	    STRING(FIND ${${PROJECT_NAME}_C_FLAGS} ${ARGN} already_stored)
-	    IF( NOT already_stored)
-		    SET(${PROJECT_NAME}_C_FLAGS "${${PROJECT_NAME}_C_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
-		ENDIF( NOT already_stored)
-	ELSEIF (${Build} STREQUAL Debug )
-	    STRING(FIND ${${PROJECT_NAME}_C_FLAGS} ${ARGN} already_stored)
-	    IF( NOT already_stored)
-		    SET(${PROJECT_NAME}_C_FLAGS_DEBUG "${${PROJECT_NAME}_C_FLAGS_DEBUG} ${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C compiler during debug builds." FORCE)
-		ENDIF( NOT already_stored)
-	ELSEIF (${Build} STREQUAL Release )
-	    STRING(FIND ${${PROJECT_NAME}_C_FLAGS} ${ARGN} already_stored)
-	    IF( NOT already_stored)
-		    SET(${PROJECT_NAME}_C_FLAGS_RELEASE "${${PROJECT_NAME}_C_FLAGS_RELEASE} ${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C compiler during release builds." FORCE)
-		ENDIF( NOT already_stored)
+		IF ( ${PROJECT_NAME}_C_FLAGS )
+			STRING(FIND ${${PROJECT_NAME}_C_FLAGS} ${ARGN} already_stored)
+			IF( NOT already_stored)
+				SET(${PROJECT_NAME}_C_FLAGS "${${PROJECT_NAME}_C_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
+			ENDIF( NOT already_stored)
+		ELSE ( ${PROJECT_NAME}_C_FLAGS )
+			SET(${PROJECT_NAME}_C_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
+		ENDIF ( ${PROJECT_NAME}_C_FLAGS )
+	ELSEIF (${Build} STREQUAL Debug )
+		IF ( ${PROJECT_NAME}_C_FLAGS_DEBUG )
+			STRING(FIND ${${PROJECT_NAME}_C_FLAGS_DEBUG} ${ARGN} already_stored)
+			IF( NOT already_stored)
+				SET(${PROJECT_NAME}_C_FLAGS_DEBUG "${${PROJECT_NAME}_C_FLAGS_DEBUG} ${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C compiler during debug builds." FORCE)
+			ENDIF( NOT already_stored)
+		ELSE ( ${PROJECT_NAME}_C_FLAGS_DEBUG )
+			SET(${PROJECT_NAME}_C_FLAGS_DEBUG "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags used by the C compiler during debug builds." FORCE)
+		ENDIF ( ${PROJECT_NAME}_C_FLAGS_DEBUG )
+	ELSEIF (${Build} STREQUAL Release )
+		IF ( ${PROJECT_NAME}_C_FLAGS_RELEASE )
+			STRING(FIND ${${PROJECT_NAME}_C_FLAGS_RELEASE} ${ARGN} already_stored)
+			IF( NOT already_stored)
+				SET(${PROJECT_NAME}_C_FLAGS_RELEASE "${${PROJECT_NAME}_C_FLAGS_RELEASE} ${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C compiler during release builds." FORCE)
+			ENDIF( NOT already_stored)
+		ELSE ( ${PROJECT_NAME}_C_FLAGS_RELEASE )
+			SET(${PROJECT_NAME}_C_FLAGS_RELEASE "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C compiler during release builds." FORCE)
+		ENDIF ( ${PROJECT_NAME}_C_FLAGS_RELEASE )
 	ENDIF (${Build} STREQUAL All )
 endmacro(WkAddCFlags )

@@ -101,20 +113,32 @@
 # Usage : WkAddCXXFlags( Build [newflags] )
 macro(WkAddCXXFlags Build)
 	IF (${Build} STREQUAL All )
-	    STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS} ${ARGN} already_stored)
-	    IF( ${already_stored} LESS 0)
-		    SET(${PROJECT_NAME}_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
-		ENDIF()
-	ELSEIF (${Build} STREQUAL Debug )
-	    STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS} ${ARGN} already_stored)
-	    IF( NOT already_stored)
-		    SET(${PROJECT_NAME}_CXX_FLAGS_DEBUG "${${PROJECT_NAME}_CXX_FLAGS_DEBUG} ${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C compiler during debug builds." FORCE)
-		ENDIF( NOT already_stored)
-	ELSEIF (${Build} STREQUAL Release )
-	    STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS} ${ARGN} already_stored)
-	    IF( NOT already_stored)
-		    SET(${PROJECT_NAME}_CXX_FLAGS_RELEASE "${${PROJECT_NAME}_CXX_FLAGS_RELEASE} ${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C compiler during release builds." FORCE)
-		ENDIF( NOT already_stored)
+		IF ( ${PROJECT_NAME}_CXX_FLAGS )
+			STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS} ${ARGN} already_stored)
+			IF( ${already_stored} LESS 0)
+				SET(${PROJECT_NAME}_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler." FORCE)
+			ENDIF()
+		ELSE( ${PROJECT_NAME}_CXX_FLAGS )
+			SET(${PROJECT_NAME}_CXX_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler." FORCE)
+		ENDIF ( ${PROJECT_NAME}_CXX_FLAGS )
+	ELSEIF (${Build} STREQUAL Debug )
+		IF ( ${PROJECT_NAME}_CXX_FLAGS_DEBUG )
+			STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS_DEBUG} ${ARGN} already_stored)
+			IF( NOT already_stored)
+				SET(${PROJECT_NAME}_CXX_FLAGS_DEBUG "${${PROJECT_NAME}_CXX_FLAGS_DEBUG} ${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C++ compiler during debug builds." FORCE)
+			ENDIF( NOT already_stored)
+		ELSE ( ${PROJECT_NAME}_CXX_FLAGS_DEBUG )
+			SET(${PROJECT_NAME}_CXX_FLAGS_DEBUG "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C++ compiler during debug builds." FORCE)
+		ENDIF ( ${PROJECT_NAME}_CXX_FLAGS_DEBUG )
+	ELSEIF (${Build} STREQUAL Release )
+		IF ( ${PROJECT_NAME}_CXX_FLAGS_RELEASE )
+			STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS_RELEASE} ${ARGN} already_stored)
+			IF( NOT already_stored)
+				SET(${PROJECT_NAME}_CXX_FLAGS_RELEASE "${${PROJECT_NAME}_CXX_FLAGS_RELEASE} ${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C++ compiler during release builds." FORCE)
+			ENDIF( NOT already_stored)
+		ELSE ( ${PROJECT_NAME}_CXX_FLAGS_RELEASE )
+			SET(${PROJECT_NAME}_CXX_FLAGS_RELEASE "${ARGN}" CACHE STRING " ${PROJECT_NAME} Flags used by the C++ compiler during release builds." FORCE)
+		ENDIF ( ${PROJECT_NAME}_CXX_FLAGS_RELEASE )
 	ENDIF (${Build} STREQUAL All )
 endmacro(WkAddCXXFlags )


Bugfixes for catkin_tools compatibility

Bugfixes for catkin_tools compatibility

--- exotica/cmake/AddInitializer.cmake
+++ exotica/cmake/AddInitializer.cmake
@@ -4,7 +4,7 @@
 set(_InitializerOutputFiles)
 set(_InitializerCopyFiles)
 set(_InitializerScriptDir ${CMAKE_CURRENT_LIST_DIR})
-set(_InitializerSearchPaths ${CMAKE_INSTALL_PREFIX})
+set(_InitializerSearchPaths ${CMAKE_INSTALL_PREFIX}:${CATKIN_DEVEL_PREFIX})
 foreach(path ${CMAKE_PREFIX_PATH})
     set(_InitializerSearchPaths "${_InitializerSearchPaths}:${path}")
 endforeach()
@@ -19,6 +19,7 @@
 endmacro(AddInitializer)

 macro(GenInitializers)
+include_directories(${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION})
 add_custom_command(
   OUTPUT ${_InitializerOutputFiles}
   COMMAND python ${_InitializerScriptDir}/GenerateInitializers.py exotica "${_InitializerSearchPaths}" ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION} ${_InitializerInputFiles} ${_InitializerOutputFiles}


make sure rocksdb-engine compoment is in MSI

--- win/packaging/CPackWixConfig.cmake
+++ win/packaging/CPackWixConfig.cmake
@@ -9,7 +9,7 @@
  ENDIF()
 ELSE()
   SET(CPACK_COMPONENTS_USED
-    "Server;Client;Development;SharedLibraries;Documentation;Readme;Debuginfo;Common;connect-engine;ClientPlugins;gssapi-server;gssapi-client;aws-key-management")
+    "Server;Client;Development;SharedLibraries;Documentation;Readme;Debuginfo;Common;connect-engine;ClientPlugins;gssapi-server;gssapi-client;aws-key-management;rocksdb-engine")
 ENDIF()

 SET( WIX_FEATURE_MySQLServer_EXTRA_FEATURES "DBInstance;SharedClientServerComponents")
@@ -57,7 +57,7 @@

  #Miscellaneous (hidden) components, part of server / or client programs
- FOREACH(comp connect-engine ClientPlugins gssapi-server gssapi-client aws-key-management)
+ FOREACH(comp connect-engine ClientPlugins gssapi-server gssapi-client aws-key-management rocksdb-engine)
    STRING(TOUPPER "${comp}" comp)
    SET(CPACK_COMPONENT_${comp}_GROUP "MySQLServer")
    SET(CPACK_COMPONENT_${comp}_HIDDEN 1)


modules: updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -194,7 +194,7 @@
 set(CORRADE_TESTSUITE_LIBRARIES ${CORRADE_TESTSUITE_LIBRARY} ${CORRADE_UTILITY_LIBRARIES})

 # At least static build needs this
-if(UNIX OR CORRADE_TARGET_NACL_GLIBC)
+if((UNIX OR CORRADE_TARGET_NACL) AND NOT CORRADE_TARGET_NACL_NEWLIB)
     set(CORRADE_PLUGINMANAGER_LIBRARIES ${CORRADE_PLUGINMANAGER_LIBRARIES} ${CMAKE_DL_LIBS})
 endif()


ssl change back to none

ssl change back to none

--- tensorflow/contrib/cmake/external/grpc.cmake
+++ tensorflow/contrib/cmake/external/grpc.cmake
@@ -14,47 +14,45 @@
 # ==============================================================================
 include (ExternalProject)

-# perl
-find_package(Perl REQUIRED)
+# # perl
+# find_package(Perl REQUIRED)

-if(${PROTOBUF_VERSION} STREQUAL "3.5.0")
-	# nasm
-	if(NOT CMAKE_ASM_NASM_COMPILER)
-	  if (WIN32)
-	    find_program(CMAKE_ASM_NASM_COMPILER
-	        NAMES nasm
-	        PATHS "$ENV{ProgramFiles}/NASM"
-	        DOC "path to NASM compiler")
-	  else()
-	    find_program(CMAKE_ASM_NASM_COMPILER
-	      NAMES nasm
-	      PATHS "/usr/bin"
-	      DOC "path to NASM compiler")
-	  endif()
-	endif()
+# # nasm
+# if(NOT CMAKE_ASM_NASM_COMPILER)
+#   if (WIN32)
+#     find_program(CMAKE_ASM_NASM_COMPILER
+#         NAMES nasm
+#         PATHS "$ENV{ProgramFiles}/NASM"
+#         DOC "path to NASM compiler")
+#   else()
+#     find_program(CMAKE_ASM_NASM_COMPILER
+#       NAMES nasm
+#       PATHS "/usr/bin"
+#       DOC "path to NASM compiler")
+#   endif()
+# endif()

-	if(NOT CMAKE_ASM_NASM_COMPILER)
-		message(FATAL_ERROR "NASM not found!")
-	endif()
+# if(NOT CMAKE_ASM_NASM_COMPILER)
+# 	message(FATAL_ERROR "NASM not found!")
+# endif()

-	# go
-	if(NOT GO_EXECUTABLE)
-	  if (WIN32)
-	    find_program(GO_EXECUTABLE
-	        NAMES go
-	        PATHS "$ENV{ProgramFiles}/Go/bin"
-	        DOC "path to go compiler")
-	  else()
-	    find_program(GO_EXECUTABLE
-	        NAMES go
-	        PATHS "/usr/bin" "/usr/local/bin" "/usr/local/go"
-	        DOC "path to go compiler")
-	  endif()
-	endif()
-	if(NOT GO_EXECUTABLE)
-	  message(FATAL_ERROR "Go not found!")
-	endif()
-endif()
+# # go
+# if(NOT GO_EXECUTABLE)
+#   if (WIN32)
+#     find_program(GO_EXECUTABLE
+#         NAMES go
+#         PATHS "$ENV{ProgramFiles}/Go/bin"
+#         DOC "path to go compiler")
+#   else()
+#     find_program(GO_EXECUTABLE
+#         NAMES go
+#         PATHS "/usr/bin" "/usr/local/bin" "/usr/local/go"
+#         DOC "path to go compiler")
+#   endif()
+# endif()
+# if(NOT GO_EXECUTABLE)
+#   message(FATAL_ERROR "Go not found!")
+# endif()

 set(GRPC_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/include)
 set(GRPC_URL https://github.com/grpc/grpc.git)
@@ -93,8 +91,9 @@
         -DPROTOBUF_INCLUDE_DIRS:STRING=${PROTOBUF_INCLUDE_DIRS}
         -DPROTOBUF_LIBRARIES:STRING=${protobuf_STATIC_LIBRARIES}
         -DZLIB_ROOT:STRING=${ZLIB_INSTALL}
-        -DCMAKE_ASM_NASM_COMPILER:STRING=${CMAKE_ASM_NASM_COMPILER}
-        -DGO_EXECUTABLE:STRING=${GO_EXECUTABLE}
+        -DgRPC_SSL_PROVIDER:STRING=NONE
+        # -DCMAKE_ASM_NASM_COMPILER:STRING=${CMAKE_ASM_NASM_COMPILER}
+        # -DGO_EXECUTABLE:STRING=${GO_EXECUTABLE}
 )

 # grpc/src/core/ext/census/tracing.c depends on the existence of openssl/rand.h.


add known path for librdkafka on ubuntu for searching

--- cmake_modules/FindLibRDKafka.cmake
+++ cmake_modules/FindLibRDKafka.cmake
@@ -24,12 +24,12 @@

 find_library(LibRDKafka_LIBRARIES
         NAMES rdkafka++
-        HINTS ${LibRDKafka_ROOT_DIR}/lib
+        HINTS ${LibRDKafka_ROOT_DIR}/lib /usr/lib64
         )

 find_library(LibRDKafka_C_LIBRARIES
         NAMES rdkafka
-        HINTS ${LibRDKafka_ROOT_DIR}/lib
+        HINTS ${LibRDKafka_ROOT_DIR}/lib /usr/lib64
         )

 find_path(LibRDKafka_INCLUDE_DIR


Revert "Cleanup"

Revert "Cleanup"

This reverts commit 7fa771e0f37d4a081888dbe7037a1466c8a24a01.

Should have been on a branch.

--- cmake_modules/TokuThirdParty.cmake
+++ cmake_modules/TokuThirdParty.cmake
@@ -118,8 +118,12 @@
           -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
           -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
    )
+#  ExternalProject_Add_Step(backup-enterprise
+#        COMMAND cp "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libHotBackup.so"
   add_library(HotBackup SHARED IMPORTED GLOBAL)
   set_property(TARGET HotBackup PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/backup-enterprise/lib/libHotBackup.so)
+#  set_target_properties(HotBackup PROPERTIES IMPORTED_LOCATION
+#       "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/libHotBackup.so")
   install(DIRECTORY "${install_dir}/lib" DESTINATION .
           COMPONENT tokukv_libs_extra)
 endif ()


BUG: Fix midas_add_test macro

BUG: Fix midas_add_test macro

SVN-Revision: 3266

--- Application/CMakeScript/MIDAS.cmake
+++ Application/CMakeScript/MIDAS.cmake
@@ -134,7 +134,7 @@
 ")

       list(APPEND downloadScripts "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/download_${checksum}.cmake")
-      string(REGEX REPLACE toReplace "${MIDAS_DATA_DIR}/${base_file}" newArg "${arg}")
+      string(REGEX REPLACE ${toReplace} "${MIDAS_DATA_DIR}/${base_file}" newArg "${arg}")
       list(APPEND testArgs ${newArg})
     else(arg MATCHES "MIDAS{[^}]*}")
       list(APPEND testArgs ${arg})