add more options

add more options

--- project/cmake/modules/FindConfigurePackage.cmake
+++ project/cmake/modules/FindConfigurePackage.cmake
@@ -16,13 +16,15 @@
 #     SCONS_FLAGS [scons options...]
 #     CUSTOM_BUILD_COMMAND [custom build cmd...]
 #     MAKE_FLAGS [make options...]
-#     PREBUILD_COMMAND [pre build cmd...]
+#     PREBUILD_COMMAND [run cmd before build ...]
+#     AFTERBUILD_COMMAND [run cmd after build ...]
 #     RESET_FIND_VARS [cmake vars]
 #     WORKING_DIRECTORY <work directory>
 #     BUILD_DIRECTORY <build directory>
 #     PREFIX_DIRECTORY <prefix directory>
 #     SRC_DIRECTORY_NAME <source directory name>
 #     MSVC_CONFIGURE [Debug/Release/RelWithDebInfo/MinSizeRel]
+#     INSTALL_TARGET <target name: install>
 #     ZIP_URL <zip url>
 #     TAR_URL <tar url>
 #     SVN_URL <svn url>
@@ -138,10 +140,13 @@
 macro (FindConfigurePackage)
     include(CMakeParseArguments)
     set(optionArgs BUILD_WITH_CONFIGURE BUILD_WITH_CMAKE BUILD_WITH_SCONS BUILD_WITH_CUSTOM_COMMAND CMAKE_INHIRT_BUILD_ENV)
-    set(oneValueArgs PACKAGE WORKING_DIRECTORY BUILD_DIRECTORY PREFIX_DIRECTORY SRC_DIRECTORY_NAME PROJECT_DIRECTORY MSVC_CONFIGURE ZIP_URL TAR_URL SVN_URL GIT_URL GIT_BRANCH)
-    set(multiValueArgs CONFIGURE_CMD CONFIGURE_FLAGS CMAKE_FLAGS RESET_FIND_VARS SCONS_FLAGS MAKE_FLAGS CUSTOM_BUILD_COMMAND PREBUILD_COMMAND)
+    set(oneValueArgs PACKAGE WORKING_DIRECTORY BUILD_DIRECTORY PREFIX_DIRECTORY SRC_DIRECTORY_NAME PROJECT_DIRECTORY MSVC_CONFIGURE ZIP_URL TAR_URL SVN_URL GIT_URL GIT_BRANCH INSTALL_TARGET)
+    set(multiValueArgs CONFIGURE_CMD CONFIGURE_FLAGS CMAKE_FLAGS RESET_FIND_VARS SCONS_FLAGS MAKE_FLAGS CUSTOM_BUILD_COMMAND PREBUILD_COMMAND AFTERBUILD_COMMAND)
     cmake_parse_arguments(FindConfigurePackage "${optionArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

+    if (NOT FindConfigurePackage_INSTALL_TARGET)
+        set (FindConfigurePackage_INSTALL_TARGET "install")
+    endif ()
     # some module is not match standard, using upper case but package name
     string(TOUPPER "${FindConfigurePackage_PACKAGE}_FOUND" FIND_CONFIGURE_PACKAGE_UPPER_NAME)

@@ -298,7 +303,7 @@
                 )

                 execute_process(
-                    COMMAND "make" ${FindConfigurePackage_MAKE_FLAGS} "install"
+                    COMMAND "make" ${FindConfigurePackage_MAKE_FLAGS} ${FindConfigurePackage_INSTALL_TARGET}
                     WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                 )

@@ -364,13 +369,13 @@
                         set(FindConfigurePackage_MSVC_CONFIGURE RelWithDebInfo)
                     endif()
                     execute_process(
-                        COMMAND ${CMAKE_COMMAND} --build . --target install --config ${FindConfigurePackage_MSVC_CONFIGURE}
+                        COMMAND ${CMAKE_COMMAND} --build . --target ${FindConfigurePackage_INSTALL_TARGET} --config ${FindConfigurePackage_MSVC_CONFIGURE}
                             ${FindConfigurePackageCMakeBuildMultiJobs}
                         WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                     )
                 else()
                     execute_process(
-                        COMMAND ${CMAKE_COMMAND} --build . --target install
+                        COMMAND ${CMAKE_COMMAND} --build . --target ${FindConfigurePackage_INSTALL_TARGET}
                             ${FindConfigurePackageCMakeBuildMultiJobs}
                         WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                     )
@@ -413,6 +418,15 @@
                 message(FATAL_ERROR "build type is required")
             endif()

+            # afterbuild commands
+            foreach(cmd ${FindConfigurePackage_AFTERBUILD_COMMAND})
+                message(STATUS "FindConfigurePackage - Run: ${cmd} @ ${FindConfigurePackage_BUILD_DIRECTORY}")
+                execute_process(
+                    COMMAND ${cmd}
+                    WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
+                )
+            endforeach()
+
             # reset vars before retry to find package
             foreach (RESET_VAR ${FindConfigurePackage_RESET_FIND_VARS})
                 unset (${RESET_VAR} CACHE)
@@ -420,6 +434,7 @@
             find_package(${FindConfigurePackage_PACKAGE})
         endif()
     endif()
+    unset (FindConfigurePackage_INSTALL_TARGET)
 endmacro(FindConfigurePackage)


ENH: fix advanced bug

ENH: fix advanced bug

--- CMake/FindTCL.cmake
+++ CMake/FindTCL.cmake
@@ -205,8 +205,6 @@
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK DEFAULT_MSG TK_LIBRARY TK_INCLUDE_PATH)

 MARK_AS_ADVANCED(
-  TCL_TCLSH_PATH
-  TK_WISH_PATH
   TCL_INCLUDE_PATH
   TK_INCLUDE_PATH
   TCL_LIBRARY


TEST: windows uses /q flag to run non-interactive mode

--- Packaging/testing.cmake
+++ Packaging/testing.cmake
@@ -3,7 +3,13 @@
 #          [WORKING_DIRECTORY <dir>])

 set(testing_dir ${CMAKE_BINARY_DIR}/tests)
-execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${testing_dir})
+
+if(EXISTS "${testing_dir}")
+  execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${testing_dir})
+  execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory   ${testing_dir})
+else()
+  execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory   ${testing_dir})
+endif()

 set(pkg_extracted_dir "${testing_dir}/${PKG_STAGE_DIR}")
 if(WIN32)
@@ -23,9 +29,15 @@
   WORKING_DIRECTORY ${testing_dir}
   )

+set(Tu_selftester_ARGS)
+if(WIN32)
+  set(Tu_selftester_ARGS "/q")
+endif()
+
 add_test(
   NAME Tu_selftester
   COMMAND ${pkg_extracted_dir}/tools/selftester${my_ext}
+  ${Tu_selftester_ARGS}
   WORKING_DIRECTORY ${pkg_extracted_dir}
   )

@@ -36,3 +48,5 @@
   COMMAND ${pkg_extracted_dir}/tools/uninstall_otb${my_ext}
   WORKING_DIRECTORY ${testing_dir}
   )
+
+set_tests_properties ( Tu_uninstall_otb PROPERTIES DEPENDS Tu_install_package)


AVX512 support

AVX512 support

--- Plugin/cmake/ISPC.cmake
+++ Plugin/cmake/ISPC.cmake
@@ -47,11 +47,12 @@
             ${object}
             "${arg_OUTDIR}/${name}_sse4${CMAKE_CXX_OUTPUT_EXTENSION}"
             "${arg_OUTDIR}/${name}_avx${CMAKE_CXX_OUTPUT_EXTENSION}"
+            "${arg_OUTDIR}/${name}_avx512skx${CMAKE_CXX_OUTPUT_EXTENSION}"
         )
         set(outputs ${header} ${objects})
         add_custom_command(
             OUTPUT ${outputs}
-            COMMAND ${ISPC} ${source} -o ${object} -h ${header} --pic --target=sse4,avx --arch=x86-64 --opt=fast-masked-vload --opt=fast-math
+            COMMAND ${ISPC} ${source} -o ${object} -h ${header} --pic --target=sse4-i32x4,avx1-i32x8,avx512skx-i32x16 --arch=x86-64 --opt=fast-masked-vload --opt=fast-math
             DEPENDS ${source} ${arg_HEADERS}
         )


In "FindCEGUI.cmake", change "CEGUI_VERSION_MAJOR_DEFAULT" to "9999".

--- cmake/FindCEGUI.cmake
+++ cmake/FindCEGUI.cmake
@@ -371,7 +371,7 @@
 #########################################################

-set(CEGUI_VERSION_MAJOR_DEFAULT "0")
+set(CEGUI_VERSION_MAJOR_DEFAULT "9999")

 # Register var to check change on base
 set(CEGUI_RESET_VARS CEGUI_CONFIG_INCLUDE_DIR CEGUI_INCLUDE_DIR CEGUI_LIBRARY_REL CEGUI_LIBRARY_DBG)


FIX compilation on OSX using homebrew

FIX compilation on OSX using homebrew

Former-commit-id: 4d1e317b0ed02c8b7c2491a2bac70973c94d97fe

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -135,7 +135,7 @@
 function(UseQt)
     set(ENV{QTDIR} "${SOFA-EXTERNAL_QT_PATH}")
     set(ENV{CONFIG} "qt;uic")
-    find_package(Qt4 COMPONENTS qtcore qtgui qtopengl qt3support qtxml REQUIRED)
+    find_package(Qt4 COMPONENTS qtcore qtgui qtopengl qt3support qtxml qtnetwork REQUIRED)
     set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE} CACHE INTERNAL "QMake executable path")

     include(${QT_USE_FILE})


Remove flags and elf target

Remove flags and elf target

Unnecessary compile flags are removed.
The explicit ELF target is removed.

--- cmake/gcc_stm32.cmake
+++ cmake/gcc_stm32.cmake
@@ -45,9 +45,9 @@
 SET(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objdump CACHE INTERNAL "objdump tool")
 SET(CMAKE_DEBUGER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gdb CACHE INTERNAL "debuger")

-SET(CMAKE_C_FLAGS_DEBUG "--specs=rdimon.specs -lgcc -lc -lm -lrdimon -lnosys -Og -g" CACHE INTERNAL "c compiler flags debug")
-SET(CMAKE_CXX_FLAGS_DEBUG "--specs=rdimon.specs -lgcc -lc -lm -lrdimon -Og -g" CACHE INTERNAL "cxx compiler flags debug")
-SET(CMAKE_ASM_FLAGS_DEBUG "-g -gstabs+" CACHE INTERNAL "asm compiler flags debug")
+SET(CMAKE_C_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "c compiler flags debug")
+SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "cxx compiler flags debug")
+SET(CMAKE_ASM_FLAGS_DEBUG "-g" CACHE INTERNAL "asm compiler flags debug")
 SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "linker flags debug")

 SET(CMAKE_C_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "c compiler flags release")
@@ -68,7 +68,6 @@
     ENDIF()
     ADD_CUSTOM_TARGET(${TARGET}.hex DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oihex ${FILENAME} ${FILENAME}.hex)
     ADD_CUSTOM_TARGET(${TARGET}.bin DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Obinary ${FILENAME} ${FILENAME}.bin)
-    ADD_CUSTOM_TARGET(${TARGET}.elf DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oelf32-little ${FILENAME} ${FILENAME}.elf)
 ENDFUNCTION()

 STRING(TOLOWER ${STM32_FAMILY} STM32_FAMILY_LOWER)


No need to publish testing-resources Nuget pkg

--- cmake/utilities.cmake
+++ cmake/utilities.cmake
@@ -87,7 +87,9 @@

 macro(do_packaging)
     if(PLATFORM_WINDOWS AND MSVC)
-        install (FILES nuget/${PROJECT_NAME}.autopkg DESTINATION nuget)
+        if (NOT (${PROJECT_NAME} STREQUAL "testing-resources"))
+            install (FILES nuget/${PROJECT_NAME}.autopkg DESTINATION nuget)
+        endif()
     endif()

     if(SIMPLE_INSTALL)


EMSCRIPTEN: REDUCING EXECUTABLE SIZE

EMSCRIPTEN: REDUCING EXECUTABLE SIZE

--- core/cmake/test.cmake
+++ core/cmake/test.cmake
@@ -154,7 +154,7 @@

     configure_file("${CROSS_ROOT}/cmake/emscripten/template.html.in" template.html)
     set(CMAKE_EXECUTABLE_SUFFIX .html)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --emrun --shell-file template.html")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os --closure 1 --emrun --shell-file template.html")

     if (RESOURCE_COUNT)
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --preload-file ../../res")


cmake-modules:
+ [FindThirdPartyEmotivAPI.cmake] added paths for the 1.0.0.5 version of the Emotiv API

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

--- cmake-modules/FindThirdPartyEmotivAPI.cmake
+++ cmake-modules/FindThirdPartyEmotivAPI.cmake
@@ -7,12 +7,14 @@
 # edkErrorCode.h EmoStateDLL.h
 	#FIND_PATH(PATH_EmotivAPI edk.h  PATHS "C:/Program Files/Emotiv Development Kit_v1.0.0.3-PREMIUM"  "C:/Program Files/Emotiv Development Kit_v1.0.0.3-PREMIUM/doc/examples/include" "C:/Program Files (x86)/Emotiv Development Kit_v1.0.0.3-PREMIUM" "C:/Program Files (x86)/Emotiv Development Kit_v1.0.0.3-PREMIUM/doc/examples/include" $ENV{OpenViBE_dependencies})
 	FIND_PATH(PATH_EmotivAPI edk.h  PATHS
-		"C:/Program Files/Emotiv Development Kit_v1.0.0.3-PREMIUM"
+		"C:/Program Files/Emotiv Development Kit_v1.0.0.3-PREMIUM"
 		"C:/Program Files/Emotiv Development Kit_v1.0.0.3-PREMIUM/doc/examples/include"
 		"C:\Program Files\Emotiv Research Edition SDK_v1.0.0.4-PREMIUM"
 		"C:\Program Files\Emotiv Research Edition SDK_v1.0.0.4-PREMIUM/doc/examples/include"
 		"C:\Program Files (x86)\Emotiv Research Edition SDK_v1.0.0.4-PREMIUM"
-		"C:\Program Files (x86)\Emotiv Research Edition SDK_v1.0.0.4-PREMIUM/doc/examples/include" $ENV{OpenViBE_dependencies})
+		"C:\Program Files (x86)\Emotiv Research Edition SDK_v1.0.0.4-PREMIUM/doc/examples/include"
+		"C:/Program Files/Emotiv Research Edition SDK_v1.0.0.5-PREMIUM"
+		"C:/Program Files/Emotiv Research Edition SDK_v1.0.0.5-PREMIUM/doc/examples/include" $ENV{OpenViBE_dependencies})
 	IF(PATH_EmotivAPI)
 		MESSAGE(STATUS "  Found Emotiv API...")
 		INCLUDE_DIRECTORIES(${PATH_EmotivAPI})


Updated FW for UsbSpeed handling

Updated FW for UsbSpeed handling

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "b5d2239124f9b66d056222676e9e845824329928")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "02668d20837db9d90cd66a9f47b5a4a8f359f9e7")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Add the new mag system command to the px4fmu build

--- cmake/configs/nuttx_px4fmu-v4_default.cmake
+++ cmake/configs/nuttx_px4fmu-v4_default.cmake
@@ -62,6 +62,7 @@
 	systemcmds/dumpfile
 	systemcmds/ver
 	systemcmds/tests
+	systemcmds/mag

 	#
 	# General system control


[cmake] help users get rid of "pyroot_experimental is a deprecated":

Just specifying -Dpyroot=ON does not prevent pyroot_experimental from being set.
And the "deprecated" warning will be issues as long as pyroot_experimental is set.
So tell people to set it to OFF, which will get rid of the warning.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1611,7 +1611,8 @@

 #---Check for deprecated PyROOT experimental ---------------------------------------------
 if(pyroot_experimental)
-  message(WARNING "pyroot_experimental is a deprecated flag from 6.22.00. To build the new PyROOT, just configure with -Dpyroot=ON.")
+  message(WARNING "pyroot_experimental is a deprecated flag from 6.22.00."
+                  "To build the new PyROOT, just configure with -Dpyroot=ON -Dpyroot_experimental=OFF.")
 endif()

 #---Check for MPI---------------------------------------------------------------------


Supress Wuffs compiler warnings

Supress Wuffs compiler warnings

--- Source/cmake_core.cmake
+++ Source/cmake_core.cmake
@@ -267,7 +267,8 @@
             " $<$<CXX_COMPILER_ID:Clang>: -Wno-reserved-identifier>"
             " $<$<CXX_COMPILER_ID:Clang>: -Wno-missing-prototypes>"
             " $<$<CXX_COMPILER_ID:Clang>: -Wno-suggest-override>"
-            " $<$<CXX_COMPILER_ID:Clang>: -Wno-used-but-marked-unused>")
+            " $<$<CXX_COMPILER_ID:Clang>: -Wno-used-but-marked-unused>"
+            " $<$<CXX_COMPILER_ID:Clang>: -Wno-noexcept-type>")

     set_source_files_properties(astcenccli_image_external.cpp
         PROPERTIES


fix and use relative path.

fix and use relative path.

--- CMake/Utilities.cmake
+++ CMake/Utilities.cmake
@@ -40,7 +40,7 @@

   # build library
   configure_file(
-    ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/lib${lib_name}-CMakeLists.txt
+    ./CMake/Dependencies/lib${lib_name}-CMakeLists.txt
     ${KINESIS_VIDEO_OPEN_SOURCE_SRC}/lib${lib_name}/CMakeLists.txt COPYONLY)
   execute_process(
     COMMAND ${CMAKE_COMMAND} ${build_args}


Fixed multithreaded building. Thanks Gustavo.

--- BuildPlugin.cmake
+++ BuildPlugin.cmake
@@ -37,7 +37,8 @@
     install(FILES ${QM_FILES}      DESTINATION ${PLUGIN_SHARE_DIR})
     install(FILES ${CONFIG_FILES}  DESTINATION ${PLUGIN_SHARE_DIR})
     install(FILES ${DESKTOP_FILES} DESTINATION ${PROG_SHARE_DIR})
-
+
+    add_dependencies(${Name} razorqt)
 ENDMACRO(BUILD_RAZOR_PLUGIN)


ARROW-14210: [C++] Add AR and RANLIB flags to bzip2

Add `AR` or `RANLIB` flags to bzip2 when it's built as an external dependency and `CMAKE_AR` or `CMAKE_RANLIB` are set.

This happens when running a `BUNDLED` build with the conda compiler tools.

Closes #11334 from karldw/arrow-14210

Authored-by: karldw <0724a95f4c9bc7fb13f5d2cd3f39632b05f72819@users.noreply.github.com>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -2248,6 +2248,14 @@

   if(CMAKE_OSX_SYSROOT)
     list(APPEND BZIP2_EXTRA_ARGS "SDKROOT=${CMAKE_OSX_SYSROOT}")
+  endif()
+
+  if(CMAKE_AR)
+    list(APPEND BZIP2_EXTRA_ARGS AR=${CMAKE_AR})
+  endif()
+
+  if(CMAKE_RANLIB)
+    list(APPEND BZIP2_EXTRA_ARGS RANLIB=${CMAKE_RANLIB})
   endif()

   externalproject_add(bzip2_ep


[t:4871] switch ctestconfig to use lex1's cdash server instead of munchkin (only works if you're running in tokulex)

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

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -8,6 +8,6 @@
 set(CTEST_NIGHTLY_START_TIME "23:59:00 EDT")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "munchkin.leifwalsh.com")
+set(CTEST_DROP_SITE "192.168.1.114")
 set(CTEST_DROP_LOCATION "/CDash/submit.php?project=tokudb")
 set(CTEST_DROP_SITE_CDASH TRUE)


RM: duplicated with OTB

RM: duplicated with OTB

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,13 +0,0 @@
-## This file should be placed in the root directory of your project.
-## Then modify the CMakeLists.txt file in the root directory of your
-## project to incorporate the testing dashboard.
-## # The following are required to uses Dart and the Cdash dashboard
-##   ENABLE_TESTING()
-##   INCLUDE(Dart)
-set (CTEST_PROJECT_NAME "Monteverdi2")
-set (CTEST_NIGHTLY_START_TIME "20:00:00 CEST")
-
-set (CTEST_DROP_METHOD "http")
-set (CTEST_DROP_SITE "dash.orfeo-toolbox.org")
-set (CTEST_DROP_LOCATION "/submit.php?project=Monteverdi2")
-set (CTEST_DROP_SITE_CDASH TRUE)


skip one more custom warning that I do not need on the dashboard

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -1,5 +1,6 @@
 set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION}
    "used uninitialized in this function"
+   "Skipping compilation of tests gatherStruct and gather2dim because of clang bug" # Not a helpful warning for the dashboard
    "GCC < 4.3 does not have full support for SSE2 intrinsics." # Ignore self-made warning, though what I really want is a message when the warning is absent
    "call to .*Vc::Warnings::_operator_bracket_warning.* declared with attribute warning"
    "warning is a GCC extension"


Check for incompatible lcov/gcc combinations

--- CommonCTest.cmake
+++ CommonCTest.cmake
@@ -5,33 +5,49 @@
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
 endif()

-find_program(LCOV lcov)
-find_program(GENHTML genhtml)
-if(LCOV AND GENHTML AND (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG))
-  set(COVERAGE ON)
-  add_custom_target(lcov-clean
-    COMMAND ${LCOV} -q --directory ${CMAKE_BINARY_DIR} --zerocounters
-    COMMENT "Resetting code coverage counters")
-else()
-  set(COVERAGE_MISSING)
-  if(NOT LCOV)
-    set(COVERAGE_MISSING " lcov")
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+  find_program(GENHTML genhtml)
+  find_program(LCOV lcov)
+  if(LCOV)
+    execute_process(COMMAND
+      ${LCOV} --version OUTPUT_VARIABLE LCOV_VERSION
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+    string(REGEX REPLACE ".+([0-9]+\\.[0-9]+)" "\\1" LCOV_VERSION
+      ${LCOV_VERSION})
   endif()
-  if(NOT GENHTML)
-    set(COVERAGE_MISSING "${COVERAGE_MISSING} genhtml")
+  if( GCC_COMPILER_VERSION VERSION_GREATER 4.6.99 AND
+      LCOV_VERSION VERSION_LESS 1.10)
+    message(STATUS "Need lcov >= 1.10 for gcc ${GCC_COMPILER_VERSION}, found lcov ${LCOV_VERSION}")
+    set(LCOV)
   endif()
-  if(COVERAGE_MISSING)
-    set(COVERAGE_MISSING "missing${COVERAGE_MISSING}")
+
+  if(LCOV AND GENHTML)
+    set(COVERAGE ON)
+    add_custom_target(lcov-clean
+      COMMAND ${LCOV} -q --directory ${CMAKE_BINARY_DIR} --zerocounters
+      COMMENT "Resetting code coverage counters")
   else()
-    set(COVERAGE_MISSING "unsupported compiler")
+    set(COVERAGE_MISSING)
+    if(NOT LCOV)
+      set(COVERAGE_MISSING " lcov")
+    endif()
+    if(NOT GENHTML)
+      set(COVERAGE_MISSING "${COVERAGE_MISSING} genhtml")
+    endif()
+    if(COVERAGE_MISSING)
+      set(COVERAGE_MISSING "missing${COVERAGE_MISSING}")
+    else()
+      set(COVERAGE_MISSING "unsupported compiler")
+    endif()
+    if(LSB_DISTRIBUTOR_ID STREQUAL "Ubuntu")
+      set(COVERAGE_MISSING "")
+    endif()
+
+    message(STATUS "No code coverage report, ${COVERAGE_MISSING}")
   endif()
-  message(STATUS "No code coverage report, ${COVERAGE_MISSING}")
 endif()

-include_directories(
-  ${CMAKE_CURRENT_LIST_DIR}/test
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  )
+include_directories(${CMAKE_CURRENT_LIST_DIR}/test ${CMAKE_CURRENT_SOURCE_DIR})

 file(GLOB_RECURSE TEST_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
 list(SORT TEST_FILES)


Cmake: Add style test on dicom_viewer_test

--- plugins/dicom_viewer/plugin.cmake
+++ plugins/dicom_viewer/plugin.cmake
@@ -9,7 +9,7 @@
   plugins/dicom_viewer/000003.dcm
 )

-set(_pluginDir "${CMAKE_CURRENT_LIST_DIR}")
 get_filename_component(_pluginName "${CMAKE_CURRENT_LIST_DIR}" NAME)

 add_eslint_test(${_pluginName}_webpack "${_pluginDir}/webpack.helper.js")
+add_python_style_test(python_static_anaysis_${_pluginName}_tests "${_pluginDir}/plugin_tests")


Add back in Tomviz Python directory install

It isn't clear why the install directory for lib isn't bringing in
Tomviz, but the Tomviz directory was missing, so giving this a try.

Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>

--- projects/unix/tomviz.bundle.cmake
+++ projects/unix/tomviz.bundle.cmake
@@ -1,7 +1,7 @@
 include(tomviz.bundle.common)
 include(CPack)

-# install all ParaView's shared libraries.
+# Install all ParaView's shared libraries.
 install(DIRECTORY "${install_location}/lib"
   DESTINATION "lib"
   USE_SOURCE_PERMISSIONS
@@ -12,6 +12,12 @@
   USE_SOURCE_PERMISSIONS
   COMPONENT superbuild
   PATTERN "pyconfig.h")
+
+# Install tomviz's python modules.
+install(DIRECTORY "${install_location}/lib/tomviz"
+  DESTINATION "lib"
+  USE_SOURCE_PERMISSIONS
+  COMPONENT superbuild)

 install(DIRECTORY "${install_location}/share/tomviz"
   DESTINATION "share"


Remove superfluous message

Remove superfluous message

--- GitExternal.cmake
+++ GitExternal.cmake
@@ -93,11 +93,6 @@
         message(STATUS "git rebase failed, aborting ${DIR} merge")
         execute_process(COMMAND ${GIT_EXECUTABLE} rebase --abort
           WORKING_DIRECTORY "${DIR}")
-        if(RESULT)
-          message(STATUS "git rebase failed, aborting ${DIR} merge")
-          execute_process(COMMAND ${GIT_EXECUTABLE} rebase --abort
-            WORKING_DIRECTORY "${DIR}")
-        endif()
       endif()

       # checkout requested tag


CMake now find loki when loki is simply extracted into the ThirdParty directory.

git-svn-id: b7791fb0f5d07d96612766859ad70a13be88ea96@1211 305cdda6-5ce1-45b3-a98d-dfc68c8b3305

--- library/FindLoki.cmake
+++ library/FindLoki.cmake
@@ -3,6 +3,8 @@
 	/usr/include
 	/usr/local/include
 	${CMAKE_SOURCE_DIR}/../ThirdParty/loki/include/
+	${CMAKE_SOURCE_DIR}/../ThirdParty/loki-0.1.3/include
+      ${CMAKE_SOURCE_DIR}/../ThirdParty/loki-0.1.3/loki-0.1.3/include
 	"C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include"
 	"C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include"
 )


improve compiler and architecture detection

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -298,23 +298,31 @@

     if( my_service_pack )
       set(${VAR} ${my_service_pack})
-	else()
-	  set(${VAR} "na")
-    endif()
-  else()
-    # on all other system we rely on ${CMAKE_CXX_COMPILER}
-	# supporting a "--version" flag
-	exec_program(${CMAKE_CXX_COMPILER}
-	  ARGS --version
-	  OUTPUT_VARIABLE eigen_cxx_compiler_version
-	)
-	# here I try to extract the version string
-	# - TODO: this can most likely be improved and fixed
-    string(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1.\\2.\\3"
-      eigen_cxx_compiler_version ${eigen_cxx_compiler_version})
-	# again, here is room for improvement
-	# what if the compiler is not "g++" !?
-    set(${VAR} "g++${eigen_cxx_compiler_version}")
+    else()
+      set(${VAR} "na")
+    endif()
+  else()
+    # on all other system we rely on ${CMAKE_CXX_COMPILER}
+    # supporting a "--version" flag
+    exec_program( ${CMAKE_CXX_COMPILER}
+                  ARGS --version
+                  OUTPUT_VARIABLE eigen_cxx_compiler_version_raw
+                )
+    # first extract the compiler name which is the first word
+    string( REGEX REPLACE ".*(llvm\\-g\\+\\+|g\\+\\+|icpc|clang).*" "\\1"
+            eigen_cxx_compiler_name ${eigen_cxx_compiler_version_raw})
+
+    if(eigen_cxx_compiler_name MATCHES ".*g\\+\\+.*")
+      string( REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1.\\2.\\3"
+              eigen_cxx_compiler_version ${eigen_cxx_compiler_version_raw})
+    elseif(eigen_cxx_compiler_name MATCHES "icpc|clang")
+      string( REGEX REPLACE ".* ([0-9]*)\\.([0-9]*) .*" "\\1.\\2"
+              eigen_cxx_compiler_version ${eigen_cxx_compiler_version_raw})
+    else()
+      set(eigen_cxx_compiler_version "_")
+    endif()
+
+    set(${VAR} "${eigen_cxx_compiler_name}-${eigen_cxx_compiler_version}")
   endif()
 endmacro(ei_get_compilerver)

@@ -378,7 +386,17 @@
 endmacro(ei_set_build_string)

 macro(ei_is_64bit_env VAR)
-  if(CMAKE_CL_64)
+
+  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
+      "int main() { return (sizeof(int*) == 8 ? 1 : 0); }
+      ")
+  try_run(run_res compile_res
+         ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
+          RUN_OUTPUT_VARIABLE run_output)
+
+  if(compile_res AND run_res)
+    set(${VAR} ${run_res})
+  elseif(CMAKE_CL_64)
     set(${VAR} 1)
   elseif("$ENV{Platform}" STREQUAL "X64") # nmake 64 bit
     set(${VAR} 1)


Drop support for NVIDIA Kepler SM30 architecture (dropped in CUDA 11)

Resolves #252

--- cmake/FindCudaArch.cmake
+++ cmake/FindCudaArch.cmake
@@ -5,7 +5,7 @@

 # Known NVIDIA GPU achitectures Chrono can be compiled for.
 # This list will be used for CUDA_ARCH_NAME = All option
-SET(KNOWN_GPU_ARCHITECTURES "3.0 3.5 5.0 6.0 6.1 7.0 7.5")
+SET(KNOWN_GPU_ARCHITECTURES "3.5 3.7 5.0 5.2 5.3 6.0 6.1 6.2 7.0 7.2 7.5")

 ################################################################################################
 # Removes duplicates from LIST(s)
@@ -103,23 +103,25 @@

   # IF(${CUDA_ARCH_NAME} STREQUAL "Fermi")
   #   SET(__cuda_arch_bin "2.0 2.1(2.0)")
-  IF(${CUDA_ARCH_NAME} STREQUAL "Kepler")
-    SET(__cuda_arch_bin "3.0 3.5")
-  elseIF(${CUDA_ARCH_NAME} STREQUAL "Maxwell")
-    SET(__cuda_arch_bin "5.0")
-  elseIF(${CUDA_ARCH_NAME} STREQUAL "Pascal")
-    SET(__cuda_arch_bin "6.0 6.1")
+  #IF(${CUDA_ARCH_NAME} STREQUAL "Kepler")
+  #  SET(__cuda_arch_bin "3.0 3.5")
+  if(${CUDA_ARCH_NAME} STREQUAL "Kepler")
+    SET(__cuda_arch_bin "3.5 3.7")
+  elseif(${CUDA_ARCH_NAME} STREQUAL "Maxwell")
+    SET(__cuda_arch_bin "5.0 5.2 5.3")
+  elseif(${CUDA_ARCH_NAME} STREQUAL "Pascal")
+    SET(__cuda_arch_bin "6.0 6.1 6.2")
   elseIF(${CUDA_ARCH_NAME} STREQUAL "Volta")
-    SET(__cuda_arch_bin "7.0")
-  elseIF(${CUDA_ARCH_NAME} STREQUAL "Turing")
+    SET(__cuda_arch_bin "7.0 7.2")
+  elseif(${CUDA_ARCH_NAME} STREQUAL "Turing")
     SET(__cuda_arch_bin "7.5")
-  elseIF(${CUDA_ARCH_NAME} STREQUAL "All")
+  elseif(${CUDA_ARCH_NAME} STREQUAL "All")
     SET(__cuda_arch_bin ${KNOWN_GPU_ARCHITECTURES})
-  elseIF(${CUDA_ARCH_NAME} STREQUAL "Auto")
+  elseif(${CUDA_ARCH_NAME} STREQUAL "Auto")
     DETECT_INSTALLED_GPUS(__cuda_arch_bin)
   else()  # (${CUDA_ARCH_NAME} STREQUAL "Manual")
     SET(__cuda_arch_bin ${CUDA_ARCH_BIN})
-  ENDIF()
+  endif()

   MESSAGE(STATUS "Compiling for CUDA architecture: ${__cuda_arch_bin}")


Simplify if() conditions on check result variables to fix CMP0054 warnings

Remove use of an old hack that takes advantage of the auto-dereference
behavior of the if() command to detect if a variable is defined.  The
hack has the form:

 if("${VAR} MATCHES "^${VAR}$")

where "${VAR}" is a macro argument reference.  Use if(NOT DEFINED) instead.
This also avoids warnings for CMake Policy CMP0054.

This commit fixes the following warnings:

CMake Warning (dev) at cmake/PlatformTest.cmake:69 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "DOUBLE_IS_LITTLE_ENDIAN_IEEE754" will no longer be
  dereferenced when the policy is set to NEW.  Since the policy is not set
  the OLD behavior will be used.
Call Stack (most recent call first):
  cmake/ConfigureChecks.cmake:642 (python_platform_test_run)
  CMakeLists.txt:104 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/PlatformTest.cmake:10 (IF):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "HAVE_GCC_ASM_FOR_X87_COMPILED" will no longer be
  dereferenced when the policy is set to NEW.  Since the policy is not set
  the OLD behavior will be used.
Call Stack (most recent call first):
  cmake/ConfigureChecks.cmake:693 (python_platform_test)
  CMakeLists.txt:104 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

--- cmake/PlatformTest.cmake
+++ cmake/PlatformTest.cmake
@@ -7,7 +7,7 @@
 endif()

 macro(python_platform_test var description srcfile invert)
-  IF("${var}_COMPILED" MATCHES "^${var}_COMPILED$")
+  if(NOT DEFINED "${var}_COMPILED")
     message(STATUS "${description}")

     set(MACRO_CHECK_FUNCTION_DEFINITIONS
@@ -66,7 +66,7 @@
 endmacro()

 macro(python_platform_test_run var description srcfile invert)
-  if("${var}" MATCHES "^${var}$")
+  if(NOT DEFINED "${var}")
     message(STATUS "${description}")

     set(MACRO_CHECK_FUNCTION_DEFINITIONS


CMake: fix for msvc

CMake: fix for msvc

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -1059,9 +1059,10 @@
     elseif(APPLE)
         set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_GCC_WARN_INHIBIT_ALL_WARNINGS YES)
     elseif(WIN32)
-        set_target_properties(${target} PROPERTIES COMPILE_FLAGS /W0 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo /IGNORE:4006)
-    endif()
-endmacro()
-
-
-
+        set_target_properties(${target} PROPERTIES COMPILE_FLAGS "/W0 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo")
+        set_target_properties(${target} PROPERTIES LINK_FLAGS "/IGNORE:4006")
+    endif()
+endmacro()
+
+
+


implemented file search with GLOB.  robustified existing parsing.

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

--- cmake/new_lcmtypes.cmake
+++ cmake/new_lcmtypes.cmake
@@ -99,7 +99,25 @@

 set(LCMTYPES_SEARCHDIR ${CMAKE_SOURCE_DIR}/lcmtypes)

+function(find_lcmtypes msgvar)
+  # get a list of all LCM types and store it in msgvar
+  file(GLOB __tmplcmtypes "${LCMTYPES_SEARCHDIR}/*.lcm")
+  foreach(_msg ${__tmplcmtypes})
+    # Try to filter out temporary and backup files
+    if(${_msg} MATCHES "^[^\\.].*\\.lcm$")
+      list(APPEND ${msgvar} ${_msg})
+    endif(${_msg} MATCHES "^[^\\.].*\\.lcm$")
+  endforeach(_msg)
+
+  set(${msgvar} ${${msgvar}} PARENT_SCOPE)
+endfunction()
+
 macro(lcmtypes_build_c)
+  find_lcmtypes(_msgs)
+  foreach(_msg ${_msgs})
+    add_c_lcmtype(${_msg})
+  endforeach()
+
   cmake_parse_arguments("LCMTYPES" "" "C_AGGREGATE_HEADER;C_LIBNAME" "" ${ARGV})
   string(REGEX REPLACE "[^a-zA-Z0-9]" "_" __sanitized_project_name "${PROJECT_NAME}")

@@ -111,6 +129,7 @@
   endif()

   if (LCMTYPES_C_SOURCEFILES)
+    list(REMOVE_DUPLICATES LCMTYPES_C_SOURCEFILES)
     add_library(${LCMTYPES_C_LIBNAME} ${LCMTYPES_C_SOURCEFILES})

     # create a header file aggregating all of the autogenerated .h files
@@ -124,7 +143,6 @@
       install(FILES ${h_file} DESTINATION "include/lcmtypes/${__tmp_dir}")
     endforeach()
     set(__h_str "${__h_str}\\n#endif\\n")
-    message(STATUS "${__h_str}")

     add_custom_command(OUTPUT ${__agg_h_fname}
       COMMAND echo "${__h_str}" ">" "${__agg_h_fname}"
@@ -136,6 +154,7 @@
     add_custom_target(lcmtype_agg_h ALL
       DEPENDS ${__agg_h_fname})

+    pods_install_libraries(${LCMTYPES_C_LIBNAME})
     install(FILES ${__agg_h_fname} DESTINATION lcmtypes)

     unset(__h_str)
@@ -145,6 +164,11 @@
 endmacro()

 macro(lcmtypes_build_cpp)
+  find_lcmtypes(_msgs)
+  foreach(_msg ${_msgs})
+    add_cpp_lcmtype(${_msg})
+  endforeach()
+
   cmake_parse_arguments("LCMTYPES" "" "CPP_AGGREGATE_HEADER" "" ${ARGV})
   string(REGEX REPLACE "[^a-zA-Z0-9]" "_" __sanitized_project_name "${PROJECT_NAME}")

@@ -153,6 +177,8 @@
   endif()

   if (LCMTYPES_CPP_HEADERFILES)
+    list(REMOVE_DUPLICATES LCMTYPES_CPP_HEADERFILES)
+
     # create a header file aggregating all of the autogenerated .hpp files
     set(__agg_hpp_fname "${LCMTYPES_DIR}/${__sanitized_project_name}.hpp")
     set(__hpp_str "#ifndef __lcmtypes_${__sanitized_project_name}_hpp__\\n#define __lcmtypes_${__sanitized_project_name}_hpp__\\n\\n")
@@ -181,6 +207,11 @@
 endmacro()

 macro(lcmtypes_build_java)
+  find_lcmtypes(_msgs)
+  foreach(_msg ${_msgs})
+    add_java_lcmtype(${_msg})
+  endforeach()
+
   cmake_parse_arguments("LCMTYPES" "" "JARNAME" "" ${ARGV})
   string(REGEX REPLACE "[^a-zA-Z0-9]" "_" __sanitized_project_name "${PROJECT_NAME}")

@@ -189,6 +220,8 @@
   endif()

   if (LCMTYPES_JAVA_SOURCEFILES)
+    list(REMOVE_DUPLICATES LCMTYPES_JAVA_SOURCEFILES)
+
     find_package(Java REQUIRED)
     include(UseJava)

@@ -229,10 +262,11 @@
   # creates variable ${_package_name}
   # todo: make this more robust

-  execute_process(COMMAND sed -n -e "s/^.*package *\\(.*\\); *$/\\1/p" ${CMAKE_CURRENT_SOURCE_DIR}/${lcmtype} OUTPUT_VARIABLE _package_name OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND sed -n -e "s/^.*package *\\(.*\\); *$/\\1/p" "${lcmtype}" OUTPUT_VARIABLE _package_name OUTPUT_STRIP_TRAILING_WHITESPACE)
 endmacro()

 function(add_c_lcmtype lcmtype)
+  get_filename_component(lcmtype ${lcmtype} ABSOLUTE)
   get_filename_component(lcmtype_we ${lcmtype} NAME_WE)
   get_package_name(${lcmtype})
   if (_package_name)
@@ -242,7 +276,7 @@
   set(lcmtype_w_package "${package_prefix}${lcmtype_we}")

   add_custom_command(OUTPUT "${LCMTYPES_DIR}/${lcmtype_w_package}.c" "${LCMTYPES_DIR}/${lcmtype_w_package}.h" PRE_LINK
-  		     COMMAND "${LCM_GEN_EXECUTABLE}" --c "${CMAKE_CURRENT_SOURCE_DIR}/${lcmtype}"
+  		     COMMAND "${LCM_GEN_EXECUTABLE}" --c "${lcmtype}"
 		     DEPENDS ${lcmtype}
 		     WORKING_DIRECTORY ${LCMTYPES_DIR})
   set(LCMTYPES_C_SOURCEFILES ${LCMTYPES_C_SOURCEFILES} "${LCMTYPES_DIR}/${lcmtype_w_package}.c" PARENT_SCOPE)
@@ -250,6 +284,7 @@
 endfunction()

 function(add_cpp_lcmtype lcmtype)
+  get_filename_component(lcmtype ${lcmtype} ABSOLUTE)
   get_filename_component(lcmtype_we ${lcmtype} NAME_WE)
   get_package_name(${lcmtype})
   if (_package_name)
@@ -259,7 +294,7 @@
   set(lcmtype_w_package "${package_prefix}${lcmtype_we}")

   add_custom_command(OUTPUT "${LCMTYPES_DIR}/${lcmtype_w_package}.hpp"
-  		     COMMAND "${LCM_GEN_EXECUTABLE}" --cpp "${CMAKE_CURRENT_SOURCE_DIR}/${lcmtype}"
+  		     COMMAND "${LCM_GEN_EXECUTABLE}" --cpp "${lcmtype}"
 		     DEPENDS ${lcmtype}
 		     WORKING_DIRECTORY ${LCMTYPES_DIR})
   set(LCMTYPES_CPP_HEADERFILES ${LCMTYPES_CPP_HEADERFILES} "${LCMTYPES_DIR}/${lcmtype_w_package}.hpp" PARENT_SCOPE)
@@ -267,6 +302,7 @@
 endfunction()

 function(add_java_lcmtype lcmtype)
+  get_filename_component(lcmtype ${lcmtype} ABSOLUTE)
   get_filename_component(lcmtype_we ${lcmtype} NAME_WE)
   get_package_name(${lcmtype})
   if (_package_name)
@@ -276,7 +312,7 @@
   set(lcmtype_w_package "${package_prefix}${lcmtype_we}")

   add_custom_command(OUTPUT "${LCMTYPES_DIR}/${lcmtype_w_package}.java" PRE_LINK
-  		     COMMAND "${LCM_GEN_EXECUTABLE}" --java "${CMAKE_CURRENT_SOURCE_DIR}/${lcmtype}"
+  		     COMMAND "${LCM_GEN_EXECUTABLE}" --java "${lcmtype}"
 		     DEPENDS ${lcmtype}
 		     WORKING_DIRECTORY ${LCMTYPES_DIR})
   set(LCMTYPES_JAVA_SOURCEFILES ${LCMTYPES_JAVA_SOURCEFILES} "${LCMTYPES_DIR}/${lcmtype_w_package}.java" PARENT_SCOPE)
@@ -293,6 +329,7 @@
   add_java_lcmtype(${ARGV})
   set(LCMTYPES_JAVA_SOURCEFILES ${LCMTYPES_JAVA_SOURCEFILES} PARENT_SCOPE)

+# todo: handle python
 #  add_python_lcmtype(${ARGV})
 endfunction()


cmake: Link ext libraries after OS

cmake: Link ext libraries after OS

--- cmake/post.service.cmake
+++ cmake/post.service.cmake
@@ -205,6 +205,7 @@
 endif()

 # add all extra libs
+set(LIBR_CMAKE_NAMES)
 foreach(LIBR ${LIBRARIES})
   # if relative path but not local, use includeos lib.
   if(NOT IS_ABSOLUTE ${LIBR} AND NOT EXISTS ${LIBR})
@@ -219,7 +220,7 @@
   set_target_properties(libr_${LNAME} PROPERTIES LINKER_LANGUAGE CXX)
   set_target_properties(libr_${LNAME} PROPERTIES IMPORTED_LOCATION ${LIBR})

-  target_link_libraries(service libr_${LNAME})
+  list(APPEND LIBR_CMAKE_NAMES "libr_${LNAME}")
 endforeach()

@@ -453,6 +454,7 @@
 # all the OS and C/C++ libraries + crt end
 target_link_libraries(service
   libos
+  ${LIBR_CMAKE_NAMES}
   libbotan
   ${OPENSSL_LIBS}
   libosdeps


cmake: find: added export_lib_pkgconfig

cmake: find: added export_lib_pkgconfig

--- cmake/qibuild/find.cmake
+++ cmake/qibuild/find.cmake
@@ -167,6 +167,23 @@
   _qi_call_fphsa(${prefix})
 endfunction()

+####################################################################
+#
+# export_lib
+#
+####################################################################
+function(export_lib_pkgconfig prefix)
+  qi_set_cache(${prefix}_INCLUDE_DIR "${${prefix}_INCLUDE_DIRS}")
+  #qi_set_cache(${prefix}_DEFINITIONS "${${prefix}_CFLAGS_OTHER}")
+
+  # Finally, display informations if not in quiet mode
+  qi_verbose("library ${prefix}:" )
+  qi_verbose("  includes   : ${${prefix}_INCLUDE_DIR}" )
+  qi_verbose("  libraries  : ${${prefix}_LIBRARIES}" )
+  qi_verbose("  definitions: ${${prefix}_DEFINITIONS}" )
+
+  _qi_call_fphsa(${prefix})
+endfunction()

 ####################################################################
@@ -189,6 +206,10 @@
 #
 ####################################################################
 function(export_header prefix)
+  # Finally, display informations if not in quiet mode
+  qi_verbose("header library ${prefix}:" )
+  qi_verbose("  includes   : ${${prefix}_INCLUDE_DIR}" )
+  qi_verbose("  definitions: ${${prefix}_DEFINITIONS}" )
   _qi_call_fphsa(${prefix} HEADER)
 endfunction()


stamp env hook before copying (#1075)

stamp env hook before copying (#1075)

--- cmake/catkin_add_env_hooks.cmake
+++ cmake/catkin_add_env_hooks.cmake
@@ -94,6 +94,7 @@
         @ONLY)
     elseif (EXISTS ${base})
       # copy plain file
+      stamp("${base}")
       file(COPY ${base} DESTINATION ${CATKIN_DEVEL_PREFIX}/etc/catkin/profile.d)
     else()
       message(FATAL_ERROR "catkin_add_env_hooks() could not find environment hook.  Either '${base}', '${base}.em', '${base}.develspace.em' or '${base}.in' must exist.")


build: only add dependencies if needed

build: only add dependencies if needed

The dependencies may be empty which will fail.  Guard against that.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -151,7 +151,9 @@
                          ${documentation})
   else()
     add_library(${target}-static STATIC ${objs})
-    add_dependencies(${target}-static ${AST_DEPENDS})
+    if(AST_DEPENDS)
+      add_dependencies(${target}-static ${AST_DEPENDS})
+    endif()
     get_filename_component(ast_output_bn ${AST_OUTPUT} NAME)
     string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" ast_output_bn ${ast_output_bn})
     string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" ast_output_bn ${ast_output_bn})


PARQUET-883: Support non-standard gcc version strings

Author: Korn, Uwe <Uwe.Korn@blue-yonder.com>

Closes #249 from xhochy/PARQUET-883 and squashes the following commits:

0fdeeda [Korn, Uwe] PARQUET-883: Support non-standard gcc version strings

--- cmake_modules/CompilerInfo.cmake
+++ cmake_modules/CompilerInfo.cmake
@@ -20,6 +20,7 @@
 execute_process(COMMAND "${CMAKE_CXX_COMPILER}" -v
                 ERROR_VARIABLE COMPILER_VERSION_FULL)
 message(INFO " ${COMPILER_VERSION_FULL}")
+string(TOLOWER "${COMPILER_VERSION_FULL}" COMPILER_VERSION_FULL_LOWER)

 # clang on Linux and Mac OS X before 10.9
 if("${COMPILER_VERSION_FULL}" MATCHES ".*clang version.*")
@@ -37,10 +38,10 @@
   set(COMPILER_FAMILY "clang")

 # gcc
-elseif("${COMPILER_VERSION_FULL}" MATCHES ".*gcc version.*")
+elseif("${COMPILER_VERSION_FULL_LOWER}" MATCHES ".*gcc[ -]version.*")
   set(COMPILER_FAMILY "gcc")
-  string(REGEX REPLACE ".*gcc version ([0-9\\.]+).*" "\\1"
-    COMPILER_VERSION "${COMPILER_VERSION_FULL}")
+  string(REGEX REPLACE ".*gcc[ -]version ([0-9\\.]+).*" "\\1"
+      COMPILER_VERSION "${COMPILER_VERSION_FULL_LOWER}")
 else()
   message(FATAL_ERROR "Unknown compiler. Version info:\n${COMPILER_VERSION_FULL}")
 endif()


ENH: Remove explicit ITKCommon dependency.

--- itk-module.cmake
+++ itk-module.cmake
@@ -18,7 +18,6 @@

 itk_module(TwoProjectionRegistration
   DEPENDS
-    ITKCommon
     ITKImageFunction
     ITKImageGradient
     ITKOptimizers


BUG: Dependency is on ITKIOMeshBase vs ITKIOMesh

--- itk-module.cmake
+++ itk-module.cmake
@@ -13,7 +13,7 @@
   ENABLE_SHARED
   DEPENDS
     ITKCommon
-    ITKIOMesh
+    ITKIOMeshBase
   TEST_DEPENDS
     ITKTestKernel
     ITKQuadEdgeMesh


add fbvlc and vlc versions to mac package name

--- Mac/installer.cmake
+++ Mac/installer.cmake
@@ -36,7 +36,7 @@
     COMMAND ${CMD_OSASCRIPT} ${CMAKE_CURRENT_SOURCE_DIR}/Mac/dmgdesign.applescript ${PLUGIN_NAME}.plugin "${INSTALLER_NAME}"
     COMMAND ${CMD_SLEEP} 2

-    COMMAND ${CMD_HDIUTIL} convert ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PLUGIN_NAME}-temp.dmg -format UDZO -imagekey zlib-level=9 -o ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PLUGIN_NAME}.dmg
+    COMMAND ${CMD_HDIUTIL} convert ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PLUGIN_NAME}-temp.dmg -format UDZO -imagekey zlib-level=9 -o ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PLUGIN_NAME}_${PLUGIN_VERSION}_vlc_${VLC_VERSION}.dmg

     COMMAND ${CMD_RM} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PLUGIN_NAME}-temp.dmg
     COMMAND ${CMD_RM} -rf ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/dmg_template


only removed else() ect statements

only removed else() ect statements

--- CMake/FindOpenCL.cmake
+++ CMake/FindOpenCL.cmake
@@ -54,7 +54,7 @@
         FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" ENV OpenCL_INCPATH)
         FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" ENV OpenCL_INCPATH)

-    ELSE (WIN32)
+    ELSE ()

         # Unix style platforms
         FIND_LIBRARY(OPENCL_LIBRARIES OpenCL
@@ -70,9 +70,9 @@
         FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include" "/opt/AMDAPP/include" ENV OpenCL_INCPATH)
         FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include" "/opt/AMDAPP/include" ENV OpenCL_INCPATH)

-    ENDIF (WIN32)
+    ENDIF ()

-ENDIF (APPLE)
+ENDIF ()

 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS)

@@ -81,7 +81,7 @@
     LIST( APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS} )
     # This is often the same, so clean up
     LIST( REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS )
-ENDIF(_OPENCL_CPP_INCLUDE_DIRS)
+ENDIF()

 MARK_AS_ADVANCED(
     OPENCL_INCLUDE_DIRS


BUG: Pass TubeTK_REQUIRED_QT_VERSION in superbuild.

Change-Id: If961c73f2b1ab03ec84e9ffbbf2b4792018ca2c4

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -428,6 +428,7 @@
     -DSlicerExecutionModel_DIR:PATH=${SlicerExecutionModel_DIR}
     -DCTK_DIR:PATH=${CTK_DIR}
     -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+    -DTubeTK_REQUIRED_QT_VERSION=${TubeTK_REQUIRED_QT_VERSION}
     ${TubeTK_SimpleITK_Def}
   INSTALL_COMMAND ""
   DEPENDS


GCC Cross Compile: fixed call polly_add_cache_flag

--- compiler/gcc-cross-compile.cmake
+++ compiler/gcc-cross-compile.cmake
@@ -23,18 +23,18 @@
 string(COMPARE EQUAL
     "${CROSS_COMPILE_TOOLCHAIN_PATH}"
     ""
-    _is_empty_cross_compile_toolchain_path
+    _is_empty
 )
-if(_is_empty_cross_compile_toolchain_path)
+if(_is_empty)
   polly_fatal_error("CROSS_COMPILE_TOOLCHAIN_PATH not set. Set it to the absolute path of the \"bin\" directory for the toolchain")
 endif()

 string(COMPARE EQUAL
     "${CROSS_COMPILE_TOOLCHAIN_PREFIX}"
     ""
-    _is_empty_cross_compile_toolchain_prefix
+    _is_empty
 )
-if(_is_empty_cross_compile_toolchain_prefix)
+if(_is_empty)
   polly_fatal_error("CROSS_COMPILE_TOOLCHAIN_PREFIX not set. Set it to the triplet of the toolchain")
 endif()

@@ -45,11 +45,11 @@
   set(SYSROOT_COMPILE_FLAG "--sysroot=${CROSS_COMPILE_SYSROOT}")
   polly_add_cache_flag(
       CMAKE_C_FLAGS
-      "${CMAKE_C_FLAGS} ${SYSROOT_COMPILE_FLAG}"
+      "${SYSROOT_COMPILE_FLAG}"
   )
   polly_add_cache_flag(
       CMAKE_CXX_FLAGS
-      "${CMAKE_CXX_FLAGS} ${SYSROOT_COMPILE_FLAG}"
+      "${SYSROOT_COMPILE_FLAG}"
   )
 endif()


Fix "multiple target" ninja error

Fix "multiple target" ninja error

--- CommonCPPCTest.cmake
+++ CommonCPPCTest.cmake
@@ -50,23 +50,24 @@
     list(APPEND ALL_CPP_TESTS ${PROJECT_NAME}_${NAME})
   endif()

-  add_executable(${PROJECT_NAME}_${NAME} ${FILE})
-  set_target_properties(${PROJECT_NAME}_${NAME} PROPERTIES
-    FOLDER "Tests" OUTPUT_NAME ${NAME})
+  set(TEST_NAME ${PROJECT_NAME}_${NAME})
+  if(NOT TARGET ${NAME}) # Create target without project prefix if possible
+    set(TEST_NAME ${NAME})
+  endif()

-  if(NOT TARGET ${NAME}) # Create target without project prefix if possible
-    add_custom_target(${NAME} DEPENDS ${PROJECT_NAME}_${NAME})
-  endif()
+  add_executable(${TEST_NAME} ${FILE})
+  set_target_properties(${TEST_NAME} PROPERTIES FOLDER "Tests"
+    OUTPUT_NAME ${NAME})

   # Per target INCLUDE_DIRECTORIES if supported
   if(CMAKE_VERSION VERSION_GREATER 2.8.7 AND ${NAME}_INCLUDE_DIRECTORIES)
-    set_target_properties(${PROJECT_NAME}_${NAME} PROPERTIES
+    set_target_properties(${TEST_NAME} PROPERTIES
       INCLUDE_DIRECTORIES "${${NAME}_INCLUDE_DIRECTORIES}")
   endif()

   # Test link libraries
-  target_link_libraries(${PROJECT_NAME}_${NAME}
-                    ${${NAME}_LINK_LIBRARIES} ${TEST_LIBRARIES})
+  target_link_libraries(${TEST_NAME}
+    ${${NAME}_LINK_LIBRARIES} ${TEST_LIBRARIES})
   # Per target test command customisation with
   # ${NAME}_TEST_PREFIX and ${NAME}_TEST_ARGS
   set(RUN_PREFIX ${TEST_PREFIX})
@@ -78,13 +79,13 @@
     set(RUN_ARGS ${${NAME}_TEST_ARGS})
   endif()

-  add_test(NAME ${PROJECT_NAME}_${NAME}
-    COMMAND ${RUN_PREFIX} $<TARGET_FILE:${PROJECT_NAME}_${NAME}> ${RUN_ARGS})
+  add_test(NAME ${TEST_NAME}
+    COMMAND ${RUN_PREFIX} $<TARGET_FILE:${TEST_NAME}> ${RUN_ARGS})

   # Add test labels
   set(TEST_LABELS ${TEST_LABEL} ${${NAME}_TEST_LABEL})
   if(TEST_LABELS)
-    set_tests_properties(${PROJECT_NAME}_${NAME} PROPERTIES
+    set_tests_properties(${TEST_NAME} PROPERTIES
       LABELS "${TEST_LABELS}")
   endif()
 endforeach()


px4/fmu-v6x: remove some modules to reduce flash

--- boards/px4/fmu-v6x/test.cmake
+++ boards/px4/fmu-v6x/test.cmake
@@ -50,7 +50,6 @@
 		pwm_out
 		px4io
 		rc_input
-		roboclaw
 		rpm
 		safety_button
 		telemetry # all available telemetry drivers
@@ -95,7 +94,6 @@
 	SYSTEMCMDS
 		bl_update
 		dmesg
-		dumpfile
 		esc_calib
 		gpio
 		hardfault_log
@@ -103,7 +101,6 @@
 		led_control
 		mft
 		mixer
-		motor_ramp
 		motor_test
 		mtd
 		nshterm
@@ -112,7 +109,6 @@
 		perf
 		pwm
 		reboot
-		reflect
 		sd_bench
 		serial_test
 		system_time


增加获取 IMPORTED_LOCATION 的接口

增加获取 IMPORTED_LOCATION 的接口

--- project/cmake/modules/ProjectBuildTools.cmake
+++ project/cmake/modules/ProjectBuildTools.cmake
@@ -500,3 +500,15 @@
         message(STATUS "Patch: ${PROPERTY_NAME} of ${TARGET_NAME} from \"${OLD_LINK_LIBRARIES}\" to \"${PATCH_INNER_LIBS}\"")
     endif ()
 endfunction()
+
+macro(project_build_tools_get_imported_location OUTPUT_VAR_NAME TARGET_NAME)
+    get_target_property(${OUTPUT_VAR_NAME} ${TARGET_NAME} IMPORTED_LOCATION)
+    if (NOT ${OUTPUT_VAR_NAME})
+        unset(project_build_tools_get_imported_location_IMPORTED_CONFIGURATIONS)
+        get_target_property(project_build_tools_get_imported_location_IMPORTED_CONFIGURATIONS ${TARGET_NAME} IMPORTED_CONFIGURATIONS)
+        if (project_build_tools_get_imported_location_IMPORTED_CONFIGURATIONS)
+            get_target_property(${OUTPUT_VAR_NAME} ${TARGET_NAME} "IMPORTED_LOCATION_${project_build_tools_get_imported_location_IMPORTED_CONFIGURATIONS}")
+            unset(project_build_tools_get_imported_location_IMPORTED_CONFIGURATIONS)
+        endif ()
+    endif()
+endmacro()


add runtime library directory variables for LibraryLink, MathLink and WSTP

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -2091,11 +2091,15 @@
 # internal macro to setup WolframLibrary library related variables
 macro (_setup_wolframlibrary_library_variables)
 	if (Mathematica_WolframLibrary_LIBRARY)
+		set (Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS "")
+		set (Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS_DEBUG "")
 		_setup_libraries_var(Mathematica_WolframLibrary_LIBRARY Mathematica_WolframLibrary_LIBRARIES)
 		foreach (_library ${Mathematica_WolframLibrary_LIBRARIES})
 			get_filename_component (_libraryDir ${_library} DIRECTORY)
 			list (APPEND Mathematica_LIBRARY_DIRS ${_libraryDir})
 			if (NOT Mathematica_USE_STATIC_LIBRARIES)
+				list (APPEND Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS ${_libraryDir})
+				list (APPEND Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS_DEBUG ${_libraryDir})
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS ${_libraryDir})
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS_DEBUG ${_libraryDir})
 			endif()
@@ -2107,6 +2111,8 @@
 				if (EXISTS "${_kernelBinariesDir}")
 					list (APPEND Mathematica_LIBRARY_DIRS ${_kernelBinariesDir})
 					if (NOT Mathematica_USE_STATIC_LIBRARIES)
+						list (APPEND Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS "${_kernelBinariesDir}")
+						list (APPEND Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS_DEBUG "${_kernelBinariesDir}")
 						list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS "${_kernelBinariesDir}")
 						list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS_DEBUG "${_kernelBinariesDir}")
 					endif()
@@ -2114,6 +2120,8 @@
 			endforeach()
 		endif()
 		_append_wolframlibrary_needed_system_libraries(Mathematica_WolframLibrary_LIBRARIES)
+		list (REMOVE_DUPLICATES Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS)
+		list (REMOVE_DUPLICATES Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS_DEBUG)
 		list (APPEND Mathematica_LIBRARIES ${Mathematica_WolframLibrary_LIBRARIES})
 	endif()
 endmacro()
@@ -2129,6 +2137,8 @@
 		else()
 			set (Mathematica_MathLink_DEFINITIONS "")
 		endif()
+		set (Mathematica_MathLink_RUNTIME_LIBRARY_DIRS "")
+		set (Mathematica_MathLink_RUNTIME_LIBRARY_DIRS_DEBUG "")
 		if (APPLE)
 			set (Mathematica_MathLink_LINKER_FLAGS "")
 			foreach (_library ${Mathematica_MathLink_LIBRARIES})
@@ -2143,6 +2153,8 @@
 				set (_CompilerAdditions "${Mathematica_MathLink_ROOT_DIR}/CompilerAdditions")
 			endif()
 			if (IS_DIRECTORY "${_CompilerAdditions}")
+				list (APPEND Mathematica_MathLink_RUNTIME_LIBRARY_DIRS "${_CompilerAdditions}")
+				list (APPEND Mathematica_MathLink_RUNTIME_LIBRARY_DIRS_DEBUG "${_CompilerAdditions}")
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS "${_CompilerAdditions}")
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS_DEBUG "${_CompilerAdditions}")
 			endif()
@@ -2152,6 +2164,8 @@
 				get_filename_component (_libraryDir ${_library} DIRECTORY)
 				list (APPEND Mathematica_LIBRARY_DIRS ${_libraryDir})
 				if (NOT Mathematica_USE_STATIC_LIBRARIES)
+					list (APPEND Mathematica_MathLink_RUNTIME_LIBRARY_DIRS ${_libraryDir})
+					list (APPEND Mathematica_MathLink_RUNTIME_LIBRARY_DIRS_DEBUG ${_libraryDir})
 					list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS ${_libraryDir})
 					list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS_DEBUG ${_libraryDir})
 				endif()
@@ -2165,15 +2179,19 @@
 			# Windows MathLink SDK has runtime DLLs in a separate directory
 			set (_runtimeDir "${Mathematica_MathLink_ROOT_DIR}/SystemAdditions")
 			if (IS_DIRECTORY "${_runtimeDir}")
+				list (APPEND Mathematica_MathLink_RUNTIME_LIBRARY_DIRS "${_runtimeDir}")
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS "${_runtimeDir}")
 			endif()
 			# Windows MathLink SDK also ships with debug DLLs in AlternativeComponents
 			set (_runtimeDir "${Mathematica_MathLink_ROOT_DIR}/AlternativeComponents/DebugLibraries")
 			if (IS_DIRECTORY "${_runtimeDir}")
+				list (APPEND Mathematica_MathLink_RUNTIME_LIBRARY_DIRS_DEBUG "${_runtimeDir}")
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS_DEBUG "${_runtimeDir}")
 			endif()
 		endif()
 		_append_mathlink_needed_system_libraries(Mathematica_MathLink_LIBRARIES)
+		list (REMOVE_DUPLICATES Mathematica_MathLink_RUNTIME_LIBRARY_DIRS)
+		list (REMOVE_DUPLICATES Mathematica_MathLink_RUNTIME_LIBRARY_DIRS_DEBUG)
 		list (APPEND Mathematica_LIBRARIES ${Mathematica_MathLink_LIBRARIES})
 	endif()
 endmacro()
@@ -2189,6 +2207,8 @@
 		else()
 			set (Mathematica_WSTP_DEFINITIONS "")
 		endif()
+		set (Mathematica_WSTP_RUNTIME_LIBRARY_DIRS "")
+		set (Mathematica_WSTP_RUNTIME_LIBRARY_DIRS_DEBUG "")
 		if (APPLE)
 			set (Mathematica_WSTP_LINKER_FLAGS "")
 			foreach (_library ${Mathematica_WSTP_LIBRARIES})
@@ -2203,6 +2223,8 @@
 				set (_CompilerAdditions "${Mathematica_WSTP_ROOT_DIR}/CompilerAdditions")
 			endif()
 			if (IS_DIRECTORY "${_CompilerAdditions}")
+				list (APPEND Mathematica_WSTP_RUNTIME_LIBRARY_DIRS ${_libraryDir})
+				list (APPEND Mathematica_WSTP_RUNTIME_LIBRARY_DIRS_DEBUG ${_libraryDir})
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS "${_CompilerAdditions}")
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS_DEBUG "${_CompilerAdditions}")
 			endif()
@@ -2212,6 +2234,8 @@
 				get_filename_component (_libraryDir ${_library} DIRECTORY)
 				list (APPEND Mathematica_LIBRARY_DIRS ${_libraryDir})
 				if (NOT Mathematica_USE_STATIC_LIBRARIES)
+					list (APPEND Mathematica_WSTP_RUNTIME_LIBRARY_DIRS ${_libraryDir})
+					list (APPEND MathematicaWSTP_RUNTIME_LIBRARY_DIRS_DEBUG ${_libraryDir})
 					list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS ${_libraryDir})
 					list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS_DEBUG ${_libraryDir})
 				endif()
@@ -2225,15 +2249,19 @@
 			# Windows WSTP SDK has runtime DLLs in a separate directory
 			set (_runtimeDir "${Mathematica_WSTP_ROOT_DIR}/SystemAdditions")
 			if (IS_DIRECTORY "${_runtimeDir}")
+				list (APPEND Mathematica_WSTP_RUNTIME_LIBRARY_DIRS "${_runtimeDir}")
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS "${_runtimeDir}")
 			endif()
 			# Windows WSTP SDK also ships with debug DLLs in AlternativeComponents
 			set (_runtimeDir "${Mathematica_WSTP_ROOT_DIR}/AlternativeComponents/DebugLibraries")
 			if (IS_DIRECTORY "${_runtimeDir}")
+				list (APPEND Mathematica_WSTP_RUNTIME_LIBRARY_DIRS_DEBUG "${_runtimeDir}")
 				list (APPEND Mathematica_RUNTIME_LIBRARY_DIRS_DEBUG "${_runtimeDir}")
 			endif()
 		endif()
 		_append_WSTP_needed_system_libraries(Mathematica_WSTP_LIBRARIES)
+		list (REMOVE_DUPLICATES Mathematica_WSTP_RUNTIME_LIBRARY_DIRS)
+		list (REMOVE_DUPLICATES Mathematica_WSTP_RUNTIME_LIBRARY_DIRS_DEBUG)
 		list (APPEND Mathematica_LIBRARIES ${Mathematica_WSTP_LIBRARIES})
 	endif()
 endmacro()
@@ -2304,6 +2332,8 @@
 			message (STATUS "WolframLibrary include dir ${Mathematica_WolframLibrary_INCLUDE_DIR}")
 			message (STATUS "WolframLibrary library ${Mathematica_WolframLibrary_LIBRARY}")
 			message (STATUS "WolframLibrary libraries ${Mathematica_WolframLibrary_LIBRARIES}")
+			message (STATUS "WolframLibrary runtime library dirs ${Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS}")
+			message (STATUS "WolframLibrary runtime debug library dirs ${Mathematica_WolframLibrary_RUNTIME_LIBRARY_DIRS_DEBUG}")
 			message (STATUS "LibraryLink package dir ${Mathematica_LibraryLink_PACKAGE_DIR}")
 		else()
 			message (STATUS "WolframLibrary not found")
@@ -2318,6 +2348,8 @@
 			message (STATUS "MathLink mprep executable ${Mathematica_MathLink_MPREP_EXECUTABLE}")
 			message (STATUS "MathLink definitions ${Mathematica_MathLink_DEFINITIONS}")
 			message (STATUS "MathLink linker flags ${Mathematica_MathLink_LINKER_FLAGS}")
+			message (STATUS "MathLink runtime library dirs ${Mathematica_MathLink_RUNTIME_LIBRARY_DIRS}")
+			message (STATUS "MathLink runtime debug library dirs ${Mathematica_MathLink_RUNTIME_LIBRARY_DIRS_DEBUG}")
 		else()
 			message (STATUS "MathLink not found")
 		endif()
@@ -2331,6 +2363,8 @@
 			message (STATUS "WSTP wsprep executable ${Mathematica_WSTP_WSPREP_EXECUTABLE}")
 			message (STATUS "WSTP definitions ${Mathematica_WSTP_DEFINITIONS}")
 			message (STATUS "WSTP linker flags ${Mathematica_WSTP_LINKER_FLAGS}")
+			message (STATUS "WSTP runtime library dirs ${Mathematica_WSTP_RUNTIME_LIBRARY_DIRS}")
+			message (STATUS "WSTP runtime debug library dirs ${Mathematica_WSTP_RUNTIME_LIBRARY_DIRS_DEBUG}")
 		else()
 			message (STATUS "WSTP not found")
 		endif()


Fix URHO3D_PACKAGING support for Android build. When the option is enabled, PackageTool host tool will be built and used to package the assets into pak files.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -1281,7 +1281,11 @@
         # Populate all the variables required by resource packaging
         foreach (DIR ${RESOURCE_DIRS})
             get_filename_component (NAME ${DIR} NAME)
-            set (RESOURCE_${DIR}_PATHNAME ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${NAME}.pak)
+            if (ANDROID)
+                set (RESOURCE_${DIR}_PATHNAME ${CMAKE_BINARY_DIR}/assets/${NAME}.pak)
+            else ()
+                set (RESOURCE_${DIR}_PATHNAME ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${NAME}.pak)
+            endif ()
             list (APPEND RESOURCE_PAKS ${RESOURCE_${DIR}_PATHNAME})
             if (EMSCRIPTEN AND NOT EMSCRIPTEN_SHARE_DATA)
                 # Set the custom EMCC_OPTION property to preload the *.pak individually
@@ -1349,10 +1353,6 @@
     list (APPEND SOURCE_FILES ${RESOURCE_DIRS} ${RESOURCE_PAKS} ${RESOURCE_FILES})

     if (ANDROID)
-        # todo: Fix this later - Android build tree has a hard-coded resource dirs symlinks
-        if (URHO3D_PACKAGING)
-            message (WARNING "Resource packaging is not fully supported for Android build currently.")
-        endif ()
         # Add SDL native init function, SDL_Main() entry point must be defined by one of the source files in ${SOURCE_FILES}
         find_Urho3D_file (ANDROID_MAIN_C_PATH SDL_android_main.c
             HINTS ${URHO3D_HOME}/include/Urho3D/ThirdParty/SDL/android ${CMAKE_SOURCE_DIR}/Source/ThirdParty/SDL/src/main/android
@@ -1800,11 +1800,13 @@
     endif ()
     # Create symbolic links in the build tree
     file (MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/Android/assets)
-    foreach (I CoreData Data)
-        if (NOT EXISTS ${CMAKE_SOURCE_DIR}/Android/assets/${I})
-            create_symlink (${CMAKE_SOURCE_DIR}/bin/${I} ${CMAKE_SOURCE_DIR}/Android/assets/${I} FALLBACK_TO_COPY)
-        endif ()
-    endforeach ()
+    if (NOT URHO3D_PACKAGING)
+        foreach (I CoreData Data)
+            if (NOT EXISTS ${CMAKE_SOURCE_DIR}/Android/assets/${I})
+                create_symlink (${CMAKE_SOURCE_DIR}/bin/${I} ${CMAKE_SOURCE_DIR}/Android/assets/${I} FALLBACK_TO_COPY)
+            endif ()
+        endforeach ()
+    endif ()
     foreach (I AndroidManifest.xml build.xml custom_rules.xml project.properties src res assets jni)
         if (EXISTS ${CMAKE_SOURCE_DIR}/Android/${I} AND NOT EXISTS ${CMAKE_BINARY_DIR}/${I})    # No-ops when 'Android' is used as build tree
             create_symlink (${CMAKE_SOURCE_DIR}/Android/${I} ${CMAKE_BINARY_DIR}/${I} FALLBACK_TO_COPY)


Add c++14 support in gcc in xpCommonFlags

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1297,13 +1297,18 @@
           xpStringAppendIfDne(CMAKE_SHARED_LINKER_FLAGS "-stdlib=libc++")
         endif()
       endif()
-      check_cxx_compiler_flag("-std=c++11" has_cxx11) # should be available gcc >= 4.7
-      if(has_cxx11)
-        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-std=c++11")
+      check_cxx_compiler_flag("-std=c++14" has_cxx14) # should be available gcc >= 4.9
+      if(has_cxx14)
+        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-std=c++14")
       else()
-        check_cxx_compiler_flag("-std=c++0x" has_cxx0x)
-        if(has_cxx0x)
-          xpStringAppendIfDne(CMAKE_CXX_FLAGS "-std=c++0x")
+        check_cxx_compiler_flag("-std=c++11" has_cxx11) # should be available gcc >= 4.7
+        if(has_cxx11)
+          xpStringAppendIfDne(CMAKE_CXX_FLAGS "-std=c++11")
+        else()
+          check_cxx_compiler_flag("-std=c++0x" has_cxx0x)
+          if(has_cxx0x)
+            xpStringAppendIfDne(CMAKE_CXX_FLAGS "-std=c++0x")
+          endif()
         endif()
       endif()
       check_cxx_compiler_flag("-fPIC" has_cxx_fPIC)


(split) ENH: ITK legacy and compatibility.

ITKApps needs ITK to be configured with ITK_LEGACY_REMOVE OFF and
ITKV3_COMPATIBILITY ON.

Change-Id: I2f19bc5e4c9f0581c79b90fe41a60cdd7101cdb7

--- External-ITK.cmake
+++ External-ITK.cmake
@@ -2,7 +2,7 @@
 # Get and build itk

 set( ITK_TAG "v4.2.0" )
-
+set(ITK_TAG "2a7eed39f0a26f5eb9d0d9ec413938e9f0b9995c") # July 17, 2012
 ExternalProject_Add( ITK
   GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git"
   GIT_TAG "${ITK_TAG}"
@@ -15,7 +15,8 @@
     -DBUILD_EXAMPLES:BOOL=OFF
     -DBUILD_TESTING:BOOL=OFF
     -DITK_BUILD_ALL_MODULES:BOOL=ON
-    -DITK_LEGACY_REMOVE:BOOL=ON
+    -DITK_LEGACY_REMOVE:BOOL=OFF
+    -DITKV3_COMPATIBILITY:BOOL=ON
     -DVTK_DIR:PATH=${VTK_DIR}
     -DModule_ITKVtkGlue:BOOL=ON
   INSTALL_COMMAND ""


ARROW-845: [Python] Sync changes from PARQUET-955; explicit ARROW_HOME will override pkgconfig

This will avoid build failures due to a stale system-level Arrow install

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #558 from wesm/ARROW-845 and squashes the following commits:

4f89207 [Wes McKinney] Sync changes from PARQUET-955; explicit ARROW_HOME will override pkgconfig

--- python/cmake_modules/FindArrow.cmake
+++ python/cmake_modules/FindArrow.cmake
@@ -25,68 +25,75 @@

 include(FindPkgConfig)

-set(ARROW_SEARCH_HEADER_PATHS
-  $ENV{ARROW_HOME}/include
-)
+if ("$ENV{ARROW_HOME}" STREQUAL "")
+  pkg_check_modules(ARROW arrow)
+  if (ARROW_FOUND)
+    pkg_get_variable(ARROW_ABI_VERSION arrow abi_version)
+    message(STATUS "Arrow ABI version: ${ARROW_ABI_VERSION}")
+    pkg_get_variable(ARROW_SO_VERSION arrow so_version)
+    message(STATUS "Arrow SO version: ${ARROW_SO_VERSION}")
+    set(ARROW_INCLUDE_DIR ${ARROW_INCLUDE_DIRS})
+    set(ARROW_LIBS ${ARROW_LIBRARY_DIRS})
+  endif()
+else()
+  set(ARROW_HOME "$ENV{ARROW_HOME}")

-set(ARROW_SEARCH_LIB_PATH
-  $ENV{ARROW_HOME}/lib
-)
+  set(ARROW_SEARCH_HEADER_PATHS
+    ${ARROW_HOME}/include
+    )

-pkg_check_modules(ARROW arrow)
-if (ARROW_FOUND)
-  pkg_get_variable(ARROW_ABI_VERSION arrow abi_version)
-  message(STATUS "Arrow ABI version: ${ARROW_ABI_VERSION}")
-  pkg_get_variable(ARROW_SO_VERSION arrow so_version)
-  message(STATUS "Arrow SO version: ${ARROW_SO_VERSION}")
-  set(ARROW_INCLUDE_DIR ${ARROW_INCLUDE_DIRS})
-  set(ARROW_LIBS ${ARROW_LIBRARY_DIRS})
-else()
+  set(ARROW_SEARCH_LIB_PATH
+    ${ARROW_HOME}/lib
+    )
+
   find_path(ARROW_INCLUDE_DIR arrow/array.h PATHS
     ${ARROW_SEARCH_HEADER_PATHS}
     # make sure we don't accidentally pick up a different version
     NO_DEFAULT_PATH
-  )
+    )

   find_library(ARROW_LIB_PATH NAMES arrow
     PATHS
     ${ARROW_SEARCH_LIB_PATH}
     NO_DEFAULT_PATH)
   get_filename_component(ARROW_LIBS ${ARROW_LIB_PATH} DIRECTORY)
+
+  find_library(ARROW_JEMALLOC_LIB_PATH NAMES arrow_jemalloc
+    PATHS
+    ${ARROW_SEARCH_LIB_PATH}
+    NO_DEFAULT_PATH)
+
+  find_library(ARROW_PYTHON_LIB_PATH NAMES arrow_python
+    PATHS
+    ${ARROW_SEARCH_LIB_PATH}
+    NO_DEFAULT_PATH)
+
+  if (ARROW_INCLUDE_DIR AND ARROW_LIBS)
+    set(ARROW_FOUND TRUE)
+
+    if (MSVC)
+      set(ARROW_STATIC_LIB ${ARROW_LIB_PATH})
+      set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH})
+      set(ARROW_JEMALLOC_STATIC_LIB ${ARROW_JEMALLOC_LIB_PATH})
+      set(ARROW_SHARED_LIB ${ARROW_STATIC_LIB})
+      set(ARROW_PYTHON_SHARED_LIB ${ARROW_PYTHON_STATIC_LIB})
+      set(ARROW_JEMALLOC_SHARED_LIB ${ARROW_JEMALLOC_STATIC_LIB})
+    else()
+      set(ARROW_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow.a)
+      set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_python.a)
+      set(ARROW_JEMALLOC_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_jemalloc.a)
+
+      set(ARROW_SHARED_LIB ${ARROW_LIBS}/libarrow${CMAKE_SHARED_LIBRARY_SUFFIX})
+      set(ARROW_JEMALLOC_SHARED_LIB ${ARROW_LIBS}/libarrow_jemalloc${CMAKE_SHARED_LIBRARY_SUFFIX})
+      set(ARROW_PYTHON_SHARED_LIB ${ARROW_LIBS}/libarrow_python${CMAKE_SHARED_LIBRARY_SUFFIX})
+    endif()
+  endif()
 endif()

-find_library(ARROW_JEMALLOC_LIB_PATH NAMES arrow_jemalloc
-  PATHS
-  ${ARROW_SEARCH_LIB_PATH}
-  NO_DEFAULT_PATH)
-
-find_library(ARROW_PYTHON_LIB_PATH NAMES arrow_python
-  PATHS
-  ${ARROW_SEARCH_LIB_PATH}
-  NO_DEFAULT_PATH)
-
-if (ARROW_INCLUDE_DIR AND ARROW_LIBS)
-  set(ARROW_FOUND TRUE)
-
-  if (MSVC)
-    set(ARROW_STATIC_LIB ${ARROW_LIB_PATH})
-    set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH})
-    set(ARROW_JEMALLOC_STATIC_LIB ${ARROW_JEMALLOC_LIB_PATH})
-    set(ARROW_SHARED_LIB ${ARROW_STATIC_LIB})
-    set(ARROW_PYTHON_SHARED_LIB ${ARROW_PYTHON_STATIC_LIB})
-    set(ARROW_JEMALLOC_SHARED_LIB ${ARROW_JEMALLOC_STATIC_LIB})
-  else()
-    set(ARROW_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow.a)
-    set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_python.a)
-    set(ARROW_JEMALLOC_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_jemalloc.a)
-
-    set(ARROW_SHARED_LIB ${ARROW_LIBS}/libarrow${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(ARROW_JEMALLOC_SHARED_LIB ${ARROW_LIBS}/libarrow_jemalloc${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(ARROW_PYTHON_SHARED_LIB ${ARROW_LIBS}/libarrow_python${CMAKE_SHARED_LIBRARY_SUFFIX})
-  endif()
-
+if (ARROW_FOUND)
   if (NOT Arrow_FIND_QUIETLY)
     message(STATUS "Found the Arrow core library: ${ARROW_LIB_PATH}")
+    message(STATUS "Found the Arrow Python library: ${ARROW_PYTHON_LIB_PATH}")
     message(STATUS "Found the Arrow jemalloc library: ${ARROW_JEMALLOC_LIB_PATH}")
   endif ()
 else ()
@@ -105,9 +112,10 @@

 mark_as_advanced(
   ARROW_INCLUDE_DIR
-  ARROW_LIBS
   ARROW_STATIC_LIB
   ARROW_SHARED_LIB
+  ARROW_PYTHON_STATIC_LIB
+  ARROW_PYTHON_SHARED_LIB
   ARROW_JEMALLOC_STATIC_LIB
   ARROW_JEMALLOC_SHARED_LIB
 )


final toolchain script

final toolchain script

--- lib/cmake/CMake4Mbed_toolchain.cmake
+++ lib/cmake/CMake4Mbed_toolchain.cmake
@@ -25,37 +25,23 @@
         set(HOST_EXE_SUFFIX ".exe")
     endif()

-    # ToolChain directory
-    set(TOOLCHAIN_SYSROOT "${CMAKE4MBED_DIR}/deps/gcc-arm-none-eabi")
+    # GCC for Arm
+    if(TOOLCHAIN STREQUAL "armgcc")

-    # Override toolchain exe's
-    CMAKE_FORCE_C_COMPILER   ("${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-gcc${HOST_EXE_SUFFIX}" GNU)
-    CMAKE_FORCE_CXX_COMPILER ("${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-g++${HOST_EXE_SUFFIX}" GNU)
-    set(SIZE_COMMAND          "${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-size${HOST_EXE_SUFFIX}")
-    set(OBJCOPY_COMMAND       "${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-objcopy${HOST_EXE_SUFFIX}")
+        # ToolChain directory
+        if(NOT DEFINED TOOLCHAIN_SYSROOT)
+            set(TOOLCHAIN_SYSROOT "${CMAKE4MBED_DIR}/deps/gcc-arm-none-eabi")
+        endif()

-    message(STATUS "ToolChain Variables Set")
-    #message(STATUS "HOST_EXE_SUFFIX: ${HOST_EXE_SUFFIX}")
-    #message(STATUS "CMAKE_FORCE_C_COMPILER: ${CMAKE_FORCE_C_COMPILER}")
-    #message(STATUS "CMAKE_FORCE_CXX_COMPILER: ${CMAKE_FORCE_CXX_COMPILER}")
-    #message(STATUS "SIZE_COMMAND: ${SIZE_COMMAND}")
-    #message(STATUS "OBJCOPY_COMMAND: ${OBJCOPY_COMMAND}")
+        # Set toolchain exe's
+        CMAKE_FORCE_C_COMPILER   ("${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-gcc${HOST_EXE_SUFFIX}" GNU)
+        CMAKE_FORCE_CXX_COMPILER ("${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-g++${HOST_EXE_SUFFIX}" GNU)
+        set(SIZE_COMMAND          "${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-size${HOST_EXE_SUFFIX}")
+        set(OBJCOPY_COMMAND       "${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-objcopy${HOST_EXE_SUFFIX}")

-endmacro()
-
-
-
-
-
-
-
-
-# This macro sets up the toolchain variables based on the set options
-macro(SetupToolChain2)
-
-    # Custom
-    if (TOOLCHAIN STREQUAL "custom")
-        # TODO Check definitions have been set
+    # Custom
+    elseif (TOOLCHAIN STREQUAL "custom")
+        # Check definitions have been set

 	if(NOT DEFINED CMAKE_CXX_COMPILER)
             message( FATAL_ERROR "For Custom Toolchain, CMAKE_CXX_COMPILER must be defined" )
@@ -67,18 +53,16 @@
             message( FATAL_ERROR "For Custom Toolchain, SIZE_COMMAND must be defined" )
         endif()

-    # GCC for Arm
-    elseif(TOOLCHAIN STREQUAL "armgcc")
-	set(TOOLCHAIN_SYSROOT "${CMAKE4MBED_DIR}/deps/gcc-arm-none-eabi")
-        set(CMAKE_CXX_COMPILER "${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-g++${CMAKE_EXECUTABLE_SUFFIX}")
-        set(CMAKE_C_COMPILER   "${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-gcc${CMAKE_EXECUTABLE_SUFFIX}")
-        set(SIZE_COMMAND       "${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-size${CMAKE_EXECUTABLE_SUFFIX}")
-        set(OBJCOPY_COMMAND    "${TOOLCHAIN_SYSROOT}/bin/arm-none-eabi-objcopy${CMAKE_EXECUTABLE_SUFFIX}")
+    # ARM CC
+    # TODO this is currently hardcoded for one specific device target and not tested
+    elseif (TOOLCHAIN STREQUAL "armcc")

-    # ARM CC
-    # TODO this is currently hardcoded for one specific device target
-    elseif (TOOLCHAIN STREQUAL "armcc")
-        set(TOOLCHAIN_SYSROOT "${CMAKE4MBED_DIR}/deps/ARMCompiler")
+        # ToolChain directory
+        if(NOT DEFINED TOOLCHAIN_SYSROOT)
+            set(TOOLCHAIN_SYSROOT "${CMAKE4MBED_DIR}/deps/ARMCompiler")
+        endif()
+
+        # Set toolchain exe's
         set(CMAKE_CXX_COMPILER "${TOOLCHAIN_SYSROOT}/bin/armcc${CMAKE_EXECUTABLE_SUFFIX}")
         set(CMAKE_C_COMPILER   "${TOOLCHAIN_SYSROOT}/bin/armcc${CMAKE_EXECUTABLE_SUFFIX}")
         set(SIZE_COMMAND       "size${CMAKE_EXECUTABLE_SUFFIX}")
@@ -91,9 +75,12 @@

     endif()

-    message(STATUS "C++ compiler: ${CMAKE_CXX_COMPILER}")
-    message(STATUS "C compiler  : ${CMAKE_C_COMPILER}")
-    message(STATUS "Size command: ${SIZE_COMMAND}")
-    message(STATUS "Objcopy command: ${OBJCOPY_COMMAND}")
+    #message(STATUS "HOST_EXE_SUFFIX: ${HOST_EXE_SUFFIX}")
+    #message(STATUS "C compiler  : ${CMAKE_C_COMPILER}")
+    #message(STATUS "C++ compiler: ${CMAKE_CXX_COMPILER}")
+    #message(STATUS "Size command: ${SIZE_COMMAND}")
+    #message(STATUS "Objcopy command: ${OBJCOPY_COMMAND}")
+
+    message(STATUS "ToolChain Variables Set")
+
 endmacro()
-


Checking user input in case qhull is not found by cmake

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@1196 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindQhull.cmake
+++ cmake/Modules/FindQhull.cmake
@@ -9,25 +9,29 @@

 set(QHULL_MAJOR_VERSION 6)

-find_path(QHULL_INCLUDE_DIR_PRE2011
-          NAMES qhull.h
-          HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
+find_file(QHULL_HEADER
+          NAMES libqhull/libqhull.h qhull.h
+          HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}" "${QHULL_INCLUDE_DIR}"
           PATHS "$ENV{PROGRAMFILES}/qhull 6.2.0.1373" "$ENV{PROGRAMW6432}/qhull 6.2.0.1373"
           PATH_SUFFIXES qhull src/libqhull libqhull include)

-find_path(QHULL_INCLUDE_DIR_2011
-          NAMES libqhull/libqhull.h
-          HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
-          PATHS "$ENV{PROGRAMFILES}/qhull 6.2.0.1373" "$ENV{PROGRAMW6432}/qhull 6.2.0.1373"
-          PATH_SUFFIXES qhull src/libqhull libqhull include)
+set(QHULL_HEADER "${QHULL_HEADER}" CACHE INTERNAL "QHull header" FORCE )

-if(QHULL_INCLUDE_DIR_PRE2011)
-   set(HAVE_QHULL_2011 OFF)
-   set(QHULL_INCLUDE_DIR "${QHULL_INCLUDE_DIR_PRE2011}")
-elseif(QHULL_INCLUDE_DIR_2011)
-   set(HAVE_QHULL_2011 ON)
-   set(QHULL_INCLUDE_DIR "${QHULL_INCLUDE_DIR_2011}")
-endif()
+if(QHULL_HEADER)
+    get_filename_component(qhull_header ${QHULL_HEADER} NAME_WE)
+    if("${qhull_header}" STREQUAL "qhull")
+        set(HAVE_QHULL_2011 OFF)
+        get_filename_component(QHULL_INCLUDE_DIR ${QHULL_HEADER} PATH)
+    elseif("${qhull_header}" STREQUAL "libqhull")
+        set(HAVE_QHULL_2011 ON)
+        get_filename_component(QHULL_INCLUDE_DIR ${QHULL_HEADER} PATH)
+        get_filename_component(QHULL_INCLUDE_DIR ${QHULL_INCLUDE_DIR} PATH)
+    endif()
+else(QHULL_HEADER)
+    set(QHULL_INCLUDE_DIR "QHULL_INCLUDE_DIR-NOTFOUND")
+endif(QHULL_HEADER)
+
+set(QHULL_INCLUDE_DIR "${QHULL_INCLUDE_DIR}" CACHE PATH "QHull include dir." FORCE)

 # Prefer static libraries in Windows over shared ones
 if(WIN32)


Remove

Remove

set(QHULL_LIBRARY_DIR "")

statement.  Clearing that variable makes no sense to me since the one
that is actually set right after is spelled differently
("QHULL_LIBRARY_DIRS" rather than "QHULL_LIBRARY_DIR") and does not
need to be cleared beforehand in any case.

svn path=/trunk/; revision=12268

--- cmake/modules/FindQHULL.cmake
+++ cmake/modules/FindQHULL.cmake
@@ -21,7 +21,6 @@
     PATHS /usr/local/lib /usr/lib
   )
   if( QHULL_LIBRARY )
-    set(QHULL_LIBRARY_DIR "")
     get_filename_component(QHULL_LIBRARY_DIRS ${QHULL_LIBRARY} PATH)
     # Set uncached variables as per standard.
     set(QHULL_FOUND ON)


PolysquareCommon: Print compiler standard

--- PolysquareCommon.cmake
+++ PolysquareCommon.cmake
@@ -57,6 +57,7 @@

     endif ()

+    message (STATUS "Using compiler standard ${PSQ_COMPILER_STANDARD}")
     set (PSQ_CXX11 "-std=${PSQ_COMPILER_STANDARD}")
     set (PSQ_WALL "-Wall")
     set (PSQ_WFOUR "/W4")


[CMAKE] Add the test suite to the log name

Summary:
This prevents naming collision to occur, e.g. when running with and
without upgrade activated.

Test Plan:
  ninja check-bitcoin check-bitcoin-upgrade-activated
Check the logs are now available for each test suite variant.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7024

--- cmake/modules/TestSuite.cmake
+++ cmake/modules/TestSuite.cmake
@@ -59,7 +59,7 @@
 	add_test_custom_target(${TARGET}
 		TEST_COMMAND
 			"${CMAKE_SOURCE_DIR}/cmake/utils/test_wrapper.sh"
-			"${NAME}.log"
+			"${SUITE}-${NAME}.log"
 			${CMAKE_CROSSCOMPILING_EMULATOR} "$<TARGET_FILE:${EXECUTABLE}>" ${ARGN}
 		CUSTOM_TARGET_ARGS
 			COMMENT "${SUITE}: testing ${NAME}"


Allow sysroot and python to be specified for Android build.

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

--- cmake/platforms/Android.cmake
+++ cmake/platforms/Android.cmake
@@ -70,16 +70,15 @@
  message( SEND_ERROR "Unknown ANDROID_ABI = \"${ANDROID_ABI}\"." )
 endif()

-set( ANDROID_TOOLCHAIN_DIR "${ANDROID_TOOLCHAIN_DIR}" CACHE INTERNAL "Android standalone toolchain directory" FORCE )
-set( ANDROID_SYSROOT "${ANDROID_TOOLCHAIN_DIR}/sysroot" CACHE INTERNAL "Android Sysroot" FORCE )
+set( ANDROID_TOOLCHAIN_DIR "${ANDROID_TOOLCHAIN_DIR}" CACHE PATH "Android standalone toolchain directory" )
+set( ANDROID_SYSROOT "${ANDROID_TOOLCHAIN_DIR}/sysroot" CACHE PATH "Android Sysroot" )

 # CMAKE_EXECUTABLE_SUFFIX is undefined in CMAKE_TOOLCHAIN_FILE
 if( WIN32 )
  set( EXECUTABLE_SUFFIX ".exe" )
 endif()

-# force python exe to be the one in Android toolchian
-set( PYTHON_EXECUTABLE "${ANDROID_TOOLCHAIN_DIR}/bin/python${EXECUTABLE_SUFFIX}" CACHE INTERNAL "Python exec path" FORCE )
+set( PYTHON_EXECUTABLE "${ANDROID_TOOLCHAIN_DIR}/bin/python${EXECUTABLE_SUFFIX}" CACHE PATH "Python exec path" )

 if( NOT CMAKE_C_COMPILER )
  set( CMAKE_C_COMPILER   "${ANDROID_TOOLCHAIN_DIR}/bin/${ANDROID_TOOLCHAIN_NAME}-gcc${EXECUTABLE_SUFFIX}"     CACHE PATH "C compiler" )
@@ -119,27 +118,6 @@
 set( ANDROID_CXX_FLAGS    "${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections" )
 set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" )

-################# BEGIN EVIL HACK ##################
-# lldb-server links against libdl even though it's not being used and
-# libdl.a is currently missing from the toolchain (b.android.com/178517).
-# Therefore, in order to statically link lldb-server, we need a temporary
-# workaround. This creates a dummy libdl.a stub until the actual
-# libdl.a can be implemented in the toolchain.
-if( LLVM_BUILD_STATIC )
- set( ANDROID_LIBDL_STUB "${CMAKE_BINARY_DIR}/libdl_stub" )
- file( MAKE_DIRECTORY ${ANDROID_LIBDL_STUB} )
- file( WRITE "${ANDROID_LIBDL_STUB}/libdl.c" "
-#include <dlfcn.h>
-void *       dlopen  (const char *filename, int flag)   { return 0; }
-const char * dlerror (void)                             { return 0; }
-void *       dlsym   (void *handle, const char *symbol) { return 0; }
-int          dlclose (void *handle)                     { return 0; }")
- execute_process( COMMAND ${CMAKE_C_COMPILER} -c ${ANDROID_LIBDL_STUB}/libdl.c -o ${ANDROID_LIBDL_STUB}/libdl.o )
- execute_process( COMMAND ${CMAKE_AR} rcs ${ANDROID_LIBDL_STUB}/libdl.a ${ANDROID_LIBDL_STUB}/libdl.o )
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -L${ANDROID_LIBDL_STUB}" )
-endif()
-################# END EVIL HACK ##################
-
 # cache flags
 set( CMAKE_CXX_FLAGS           ""                        CACHE STRING "c++ flags" )
 set( CMAKE_C_FLAGS             ""                        CACHE STRING "c flags" )
@@ -164,3 +142,28 @@
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+
+################# BEGIN EVIL HACK ##################
+# lldb-server links against libdl even though it's not being used and
+# libdl.a is currently missing from the toolchain (b.android.com/178517).
+# Therefore, in order to statically link lldb-server, we need a temporary
+# workaround. This creates a dummy libdl.a stub until the actual
+# libdl.a can be implemented in the toolchain.
+if( LLVM_BUILD_STATIC )
+ set( ANDROID_LIBDL_STUB "${CMAKE_BINARY_DIR}/libdl_stub" )
+ file( MAKE_DIRECTORY ${ANDROID_LIBDL_STUB} )
+ file( WRITE "${ANDROID_LIBDL_STUB}/libdl.c" "
+#include <dlfcn.h>
+void *       dlopen  (const char *filename, int flag)   { return 0; }
+const char * dlerror (void)                             { return 0; }
+void *       dlsym   (void *handle, const char *symbol) { return 0; }
+int          dlclose (void *handle)                     { return 0; }")
+ set( SEPARATED_C_FLAGS "${CMAKE_C_FLAGS}" )
+ separate_arguments( SEPARATED_C_FLAGS )
+ execute_process( COMMAND ${CMAKE_C_COMPILER} ${SEPARATED_C_FLAGS} -c ${ANDROID_LIBDL_STUB}/libdl.c -o ${ANDROID_LIBDL_STUB}/libdl.o )
+ execute_process( COMMAND ${CMAKE_AR} rcs ${ANDROID_LIBDL_STUB}/libdl.a ${ANDROID_LIBDL_STUB}/libdl.o )
+ set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ANDROID_LIBDL_STUB}" )
+ unset( ANDROID_LIBDL_STUB )
+ unset( SEPARATED_C_FLAGS )
+endif()
+################# END EVIL HACK ##################


added: Added a feature to the CMake build system that organizes the code for generated build environments.
       The files are grouped hierarchically based on the directory structure of the sources location in the repository.
       This greatly improves the usability of generated Visual Studio, Eclipse, KDevelop, and other IDE generated projects from CMake.

       From: David Kabala

git-svn-id: 9c86407f91444b2cc93bb44d37d96a685973386f@2355 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/BuildFunctions.cmake
+++ CMake/BuildFunctions.cmake
@@ -112,6 +112,7 @@
     PROJECT(${PNAME})
     IF(${OSG_CMAKE_PASS} STREQUAL "OSGCOLLECT")
         OPTION(OSGBUILD_${PROJECT_NAME} "Build the ${PROJECT_NAME} library" ON)
+        SET(${PROJECT_NAME}_SOURCE_GROUPS "" CACHE INTERNAL "" FORCE)
     ENDIF(${OSG_CMAKE_PASS} STREQUAL "OSGCOLLECT")
 ENDMACRO(OSG_ADD_PROJECT)

@@ -456,13 +457,13 @@

     IF(BASE_MM)
         FOREACH(BaseMMFile ${BASE_MM})
-	    STRING(REGEX REPLACE mm$ cpp BaseMMFileCPP ${BaseMMFile})
-	    LIST(APPEND BASE_MM_CPP ${BaseMMFileCPP})
-	ENDFOREACH()
+        STRING(REGEX REPLACE mm$ cpp BaseMMFileCPP ${BaseMMFile})
+        LIST(APPEND BASE_MM_CPP ${BaseMMFileCPP})
+    ENDFOREACH()
     ENDIF(BASE_MM)

     IF(BASE_MM_CPP)
-	    LIST(REMOVE_ITEM LOCAL_SRC ${BASE_MM_CPP})
+        LIST(REMOVE_ITEM LOCAL_SRC ${BASE_MM_CPP})
     ENDIF(BASE_MM_CPP)

     IF(${PROJECT_NAME}_EXCL_FILES)
@@ -525,7 +526,49 @@
         FILE(APPEND ${${PROJECT_NAME}_BUILD_FILE}
              "LIST(APPEND ${PROJECT_NAME}_MOC \"${LOCAL_MOC}\")\n\n")
     ENDIF(LOCAL_MOC)
-
+
+    # Add the source files to the source group
+    #Strip the path down to a relative one
+    IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}")
+        FILE(RELATIVE_PATH THE_SOURCE_GROUP
+                           ${CMAKE_CURRENT_SOURCE_DIR}/Source
+                           ${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME})
+    ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/${DIRNAME}")
+        FILE(RELATIVE_PATH THE_SOURCE_GROUP
+                           ${CMAKE_SOURCE_DIR}/Source
+                           ${CMAKE_SOURCE_DIR}/${DIRNAME})
+    ELSE()
+        FILE(RELATIVE_PATH THE_SOURCE_GROUP
+                           ${CMAKE_SOURCE_DIR}/Source
+                           ${CMAKE_SOURCE_DIR}/${DIRNAME})
+    ENDIF()
+
+    IF(THE_SOURCE_GROUP)
+         STRING(REPLACE "/" "\\" THE_SOURCE_GROUP ${THE_SOURCE_GROUP})
+    ELSE(THE_SOURCE_GROUP)
+         SET(THE_SOURCE_GROUP "\\")
+    ENDIF(THE_SOURCE_GROUP)
+
+
+    LIST(APPEND ${PROJECT_NAME}_SOURCE_GROUPS ${THE_SOURCE_GROUP})
+    SET(${PROJECT_NAME}_SOURCE_GROUPS ${${PROJECT_NAME}_SOURCE_GROUPS}
+                                      CACHE INTERNAL "" FORCE)
+
+    STRING(REPLACE "\\" "_" THE_SOURCE_GROUP ${THE_SOURCE_GROUP})
+    LIST(APPEND ${PROJECT_NAME}_SOURCE_GROUP_${THE_SOURCE_GROUP}
+                ${LOCAL_SRC}
+                ${LOCAL_HDR}
+                ${LOCAL_INL}
+                ${LOCAL_INS}
+                ${LOCAL_FCD}
+                ${LOCAL_LL}
+                ${LOCAL_YY}
+                ${LOCAL_MOC})
+
+    SET(${PROJECT_NAME}_SOURCE_GROUP_${THE_SOURCE_GROUP}
+          ${${PROJECT_NAME}_SOURCE_GROUP_${THE_SOURCE_GROUP}}
+          CACHE INTERNAL "" FORCE)
+
     # unittests
     IF(LOCAL_UNITTEST_SRC)
         FILE(APPEND ${${PROJECT_NAME}_BUILD_FILE}
@@ -742,7 +785,15 @@
         LINK_DIRECTORIES(${${LIBDIR}})
     ENDFOREACH(LIBDIR)

-
+
+    #Add Source Files to Source Groups
+    #Loop through all of the groups for this Project
+    FOREACH(PROJECT_SOURCE_GROUP_NAME ${${PROJECT_NAME}_SOURCE_GROUPS})
+        STRING(REPLACE "\\" "_" THE_SOURCE_GROUP ${PROJECT_SOURCE_GROUP_NAME})
+        SOURCE_GROUP(${PROJECT_SOURCE_GROUP_NAME} FILES
+                     ${${PROJECT_NAME}_SOURCE_GROUP_${THE_SOURCE_GROUP}})
+    ENDFOREACH(PROJECT_SOURCE_GROUP_NAME)
+
     ADD_LIBRARY(${PROJECT_NAME} ${${PROJECT_NAME}_SRC}
                                 ${${PROJECT_NAME}_HDR}
                                 ${${PROJECT_NAME}_INL}


Revert the part of r8787 that stopped HAVE_OGRE_BUILDSETTINGS_H getting written to the OgreConfig.h; was breaking external builds

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -94,9 +94,12 @@
 configure_file(${OGRE_TEMPLATES_DIR}/buildsettings.h.in ${OGRE_BINARY_DIR}/include/buildsettings.h @ONLY)
 install(FILES ${OGRE_BINARY_DIR}/include/buildsettings.h DESTINATION include/OGRE)

-# Install OgreConfig.h file
-# This used to add HAVE_OGRE_BUILDSETTINGS_H to the top, which is a duplicate of adding -DHAVE_OGRE_BUILDSETTINGS_H
-install(FILES ${OGRE_SOURCE_DIR}/OgreMain/include/OgreConfig.h DESTINATION include/OGRE)
+# Read contents of the OgreConfig.h file
+file(READ "${OGRE_SOURCE_DIR}/OgreMain/include/OgreConfig.h" OGRE_CONFIG_H)
+# add HAVE_OGRE_BUILDSETTINGS_H preprocessor define
+file(WRITE ${OGRE_BINARY_DIR}/include/OgreConfig.h "#define HAVE_OGRE_BUILDSETTINGS_H\n${OGRE_CONFIG_H}")
+install(FILES ${OGRE_BINARY_DIR}/include/OgreConfig.h DESTINATION include/OGRE)
+

 # Create the pkg-config package files on Unix systems
 if (UNIX)


Fix NaCl builds with Lua

Fix NaCl builds with Lua

- Update NaCl deps version to get the new lua prebuilt.
- Update librocket to fix _L variable define badness

--- cmake/DaemonGame.cmake
+++ cmake/DaemonGame.cmake
@@ -101,7 +101,7 @@
                     -DBUILD_CLIENT=0
                     -DBUILD_TTY_CLIENT=0
                     -DBUILD_SERVER=0
-                BUILD_COMMAND ${PNACLPYTHON} ${CMAKE_COMMAND} --build -j8 .
+                BUILD_COMMAND ${PNACLPYTHON} ${CMAKE_COMMAND} --build .
                 INSTALL_COMMAND ""
             )
             ExternalProject_Add_Step(${vm} forcebuild


cmake: extensions: Added a new macro zephyr_library_ifdef

Checks if a certain Kconfig is enabled and then do the same
operation as zephyr_library.
If it finds that the Kconfig is not set it will not
create a new library and will stop processing the rest of
the CMakeFile.txt. Usefull in processing the driver Cmake
files.

Signed-off-by: Adithya Baglody <06b44f6fa9a97a2b955c2d2cd070279967447860@intel.com>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -904,6 +904,18 @@
     list(APPEND ${list} ${ARGN})
   endif()
 endmacro()
+
+# Checks if a feature is enabled and then does the same operation as
+# zephyr_library. If it finds that the feature is not set it will not
+# create a new library and will stop processing the rest of
+# the CMakeFile.txt
+macro(zephyr_library_ifdef feature_toggle)
+    if(${${feature_toggle}})
+      zephyr_library()
+      else()
+      return()
+    endif()
+  endmacro()

 # 3.2. *_ifndef
 # See 3.1 *_ifdef


update code coverage cmake

update code coverage cmake

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -135,7 +135,13 @@
   )

   ADD_CUSTOM_TARGET(${_targetname}-generate
-    COMMAND ${_testrunner} $ARGV3
+    COMMAND ${_testrunner} ${ARGN}
+  )
+
+  ADD_CUSTOM_TARGET(${_targetname}-generate-clean
+	DEPENDS ${_targetname}-clean
+
+	COMMAND ${_testrunner} ${ARGN}
   )

   ADD_CUSTOM_TARGET(${_targetname}-info
@@ -145,10 +151,11 @@
     COMMAND ${CMAKE_COMMAND} -E rename ${_outputname}.info.cleaned ${_outputname}.info
   )

+
 	# Setup target
 	ADD_CUSTOM_TARGET(${_targetname}

-		DEPENDS ${_targetname}-clean ${_targetname}-generate ${_targetname}-info
+		DEPENDS ${_targetname}-generate-clean ${_targetname}-info

 		COMMAND ${CMAKE_COMMAND} -E remove_directory ${_outputname}
 		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info


fixes issue #79 by moving cmake's FIND_PACKAGE behind the search in DEPENDENCY_SEARCH_PREFIX

--- config/VigraFindPackage.cmake
+++ config/VigraFindPackage.cmake
@@ -42,7 +42,6 @@
     endif()

     MESSAGE(STATUS "Searching for ${package}${VERSION_MESSAGE}")
-    FIND_PACKAGE(${package} ${VERSION_SPEC} ${COMPONENTS})

     foreach(path ${DEPENDENCY_SEARCH_PREFIX})
         if(NOT ${package}_FOUND)
@@ -71,5 +70,9 @@
             ENDIF()
         endif()
     endforeach(path)
-
+
+    # search the package in the default locations if not found
+    # in the DEPENDENCY_SEARCH_PREFIX
+    FIND_PACKAGE(${package} ${VERSION_SPEC} ${COMPONENTS})
+
 ENDMACRO(VIGRA_FIND_PACKAGE)


v2x.cmake: use yosys to generate eblif for v2x testing

Signed-off-by: Karol Gugala <38af71640571ee4b5093d4f69ffca1ac454f2948@antmicro.com>

--- common/cmake/v2x.cmake
+++ common/cmake/v2x.cmake
@@ -179,19 +179,22 @@
   add_file_target(FILE "${VPR_TEST_PB_TYPE_NAME}.arch.xml" GENERATED)

   set(DEPENDS_EBLIF "")
-  append_file_dependency(DEPENDS_EBLIF "${VPR_TEST_PB_TYPE_NAME}.pb_type.xml")
-  add_custom_command(
-    OUTPUT "${VPR_TEST_PB_TYPE_NAME}.test.eblif"
-    DEPENDS
-      ${PYTHON3} ${PYTHON3_TARGET}
-      ${XMLLINT} ${XMLLINT_TARGET}
-      ${symbiflow-arch-defs_SOURCE_DIR}/utils/vpr_pbtype_to_eblif.py
-      ${DEPENDS_EBLIF}
-    COMMAND
-      ${PYTHON3} ${symbiflow-arch-defs_SOURCE_DIR}/utils/vpr_pbtype_to_eblif.py
-      --pb_type ${CMAKE_CURRENT_BINARY_DIR}/${VPR_TEST_PB_TYPE_NAME}.pb_type.xml
-      --output  ${CMAKE_CURRENT_BINARY_DIR}/${VPR_TEST_PB_TYPE_NAME}.test.eblif
-    WORKING_DIRECTORY ${symbiflow-arch-defs_SOURCE_DIR}/utils
+  append_file_dependency(DEPENDS_EBLIF "${VPR_TEST_PB_TYPE_NAME}.sim.v")
+
+  set(PB_TYPE_VERILOG "${VPR_TEST_PB_TYPE_NAME}.sim.v")
+  set(YOSYS_OUTPUT_BLIF "${VPR_TEST_PB_TYPE_NAME}.test.eblif")
+
+  get_target_property_required(YOSYS env YOSYS)
+  get_target_property(YOSYS_TARGET env YOSYS_TARGET)
+  add_custom_command(
+    OUTPUT "${YOSYS_OUTPUT_BLIF}"
+    DEPENDS
+      ${YOSYS} ${YOSYS_TARGET}
+      ${DEPENS_EBLIF}
+    COMMAND
+      ${YOSYS} -p "read_verilog ${PB_TYPE_VERILOG}\; proc\; opt\; write_blif ${YOSYS_OUTPUT_BLIF}"
+    WORKING_DIRECTORY
+      ${CMAKE_CURRENT_BINARY_DIR}
   )
   add_file_target(FILE "${VPR_TEST_PB_TYPE_NAME}.test.eblif" GENERATED)


(split) ENH: Update to ITK 4.2.0.

(split) ENH: Update to ITK 4.2.0.

Change-Id: Ie087c81f1be6211a13df55a93a9953338a537e11


[CMake] Make llvm_ExternalProject always call the build action

This makes it so that when running 'ninja test-suite' from the top-level LLVM ninja build it *always* re-runs the ninja command in the test-suite directory.

This mechanism is required because the top-level ninja file doesn't have a view into the subdirectory dependency tree, so it can't know what, if anything, needs to be rebuilt.

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

--- cmake/modules/LLVMExternalProjectUtils.cmake
+++ cmake/modules/LLVMExternalProjectUtils.cmake
@@ -2,12 +2,12 @@

 # llvm_ExternalProject_BuildCmd(out_var target)
 #   Utility function for constructing command lines for external project targets
-function(llvm_ExternalProject_BuildCmd out_var target)
+function(llvm_ExternalProject_BuildCmd out_var target bin_dir)
   if (CMAKE_GENERATOR MATCHES "Make")
     # Use special command for Makefiles to support parallelism.
-    set(${out_var} "$(MAKE)" "${target}" PARENT_SCOPE)
+    set(${out_var} "$(MAKE)" "-C" "${BINARY_DIR}" "${target}" PARENT_SCOPE)
   else()
-    set(${out_var} ${CMAKE_COMMAND} --build . --target ${target}
+    set(${out_var} ${CMAKE_COMMAND} --build ${bin_dir} --target ${target}
                                     --config $<CONFIGURATION> PARENT_SCOPE)
   endif()
 endfunction()
@@ -63,6 +63,7 @@

   if(CMAKE_VERSION VERSION_GREATER 3.1.0)
     set(cmake_3_1_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL 1)
+    set(cmake_3_1_BUILD_ALWAYS BUILD_ALWAYS 1)
   endif()

   if(CMAKE_VERSION VERSION_GREATER 3.3.20150708)
@@ -138,14 +139,21 @@
                ${PASSTHROUGH_VARIABLES}
     INSTALL_COMMAND ""
     STEP_TARGETS configure build
+    ${cmake_3_1_BUILD_ALWAYS}
     ${cmake_3_4_USES_TERMINAL_OPTIONS}
     )

-  if(ARG_USE_TOOLCHAIN)
+  if(CMAKE_VERSION VERSION_LESS 3.1.0)
+    set(ALWAYS_REBUILD ${CMAKE_CURRENT_BINARY_DIR}/${name}-always-rebuild)
+    add_custom_target(${name}-always-rebuild
+      COMMAND ${CMAKE_COMMAND} -E touch ${STAMP_DIR}/${name}-clobber-stamp)
+
+    llvm_ExternalProject_BuildCmd(run_build all ${BINARY_DIR})
     ExternalProject_Add_Step(${name} force-rebuild
-      COMMENT "Forcing rebuild becaues tools have changed"
-      DEPENDERS configure
-      DEPENDS ${TOOLCHAIN_BINS}
+      COMMAND ${run_build}
+      COMMENT "Forcing rebuild of ${name}"
+      DEPENDEES configure clean
+      DEPENDS ${ALWAYS_REBUILD} ${ARG_DEPENDS} ${TOOLCHAIN_BINS}
       ${cmake_3_4_USES_TERMINAL} )
   endif()

@@ -153,7 +161,7 @@
     set(force_deps DEPENDS ${TOOLCHAIN_BINS})
   endif()

-  llvm_ExternalProject_BuildCmd(run_clean clean)
+  llvm_ExternalProject_BuildCmd(run_clean clean ${BINARY_DIR})
   ExternalProject_Add_Step(${name} clean
     COMMAND ${run_clean}
     COMMENT "Cleaning ${name}..."
@@ -184,7 +192,7 @@

   # Add top-level targets
   foreach(target ${ARG_EXTRA_TARGETS})
-    llvm_ExternalProject_BuildCmd(build_runtime_cmd ${target})
+    llvm_ExternalProject_BuildCmd(build_runtime_cmd ${target} ${BINARY_DIR})
     add_custom_target(${target}
       COMMAND ${build_runtime_cmd}
       DEPENDS ${name}-configure


fix(cmake): Typo

fix(cmake): Typo

--- cmake/build/summary.cmake
+++ cmake/build/summary.cmake
@@ -75,5 +75,5 @@
 colored_option(STATUS " XCOMPOSITE support   ${WITH_XCOMPOSITE}" WITH_XCOMPOSITE "32;1" "37;2")
 colored_option(STATUS " XKB support          ${WITH_XKB}" WITH_XKB "32;1" "37;2")
 message(STATUS "--------------------------")
-colored_option(STATUS " xcb-util-xrm         ${WITH_XCB_UTIL_XRM}" WITH_XCB_UTIL_XRM "32;1" "37;2")
+colored_option(STATUS " xcb-util-xrm         ${WITH_XRM}" WITH_XRM "32;1" "37;2")
 message(STATUS "--------------------------")


fix(cmake): Use new config path

fix(cmake): Use new config path

--- cmake/build/targets.cmake
+++ cmake/build/targets.cmake
@@ -52,7 +52,7 @@
 add_custom_command(TARGET memcheck COMMAND valgrind
   --leak-check=summary
   --suppressions=${PROJECT_SOURCE_DIR}/.valgrind-suppressions
-  ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} example --config=${PROJECT_SOURCE_DIR}/examples/config)
+  ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} example --config=${PROJECT_SOURCE_DIR}/doc/config)

 add_custom_target(memcheck-full)
 add_custom_command(TARGET memcheck-full COMMAND valgrind
@@ -60,6 +60,6 @@
   --track-origins=yes
   --track-fds=yes
   --suppressions=${PROJECT_SOURCE_DIR}/.valgrind-suppressions
-  ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} example --config=${PROJECT_SOURCE_DIR}/examples/config)
+  ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} example --config=${PROJECT_SOURCE_DIR}/doc/config)

 # }}}


[CMake] Add variable IOS to iOS toolchain

This is useful for some edge cases where detecting things gets tricky. Specifically LLDB needs this to support iOS because CMake doesn't support running tests using obj-c code.

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

--- cmake/platforms/iOS.cmake
+++ cmake/platforms/iOS.cmake
@@ -4,6 +4,7 @@
 SET(CMAKE_SYSTEM_VERSION 13)
 SET(CMAKE_CXX_COMPILER_WORKS True)
 SET(CMAKE_C_COMPILER_WORKS True)
+SET(IOS True)

 if(NOT CMAKE_OSX_SYSROOT)
   execute_process(COMMAND xcodebuild -version -sdk iphoneos Path


fix ver usage - it is a cmd builtin

fix ver usage - it is a cmd builtin

--- test.cmake
+++ test.cmake
@@ -16,12 +16,10 @@
    execute_process(COMMAND ${UNAME} -m OUTPUT_VARIABLE chip OUTPUT_STRIP_TRAILING_WHITESPACE)
    string(TOLOWER "${chip}" chip)
 else()
-   find_program(VER ver)
-   if(VER)
-      execute_process(COMMAND ${VER} OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
-      string(REPLACE "Microsoft " "" arch "${arch}")
-      string(REPLACE "[Version  " "" arch "${arch}")
-      string(REPLACE "]" "" arch "${arch}")
+   find_program(CMD cmd)
+   if(CMD)
+      execute_process(COMMAND cmd /D /Q /C ver OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
+      string(REGEX REPLACE "^.*Windows[^0-9]*([.0-9]+).*$" "Windows \\1" arch "${arch}")
    else()
       string(TOLOWER "$ENV{TARGET_PLATFORM}" arch)
       if(arch)


Fix compiler warnings with CMAKE and TORQUE_DISABLE_MEMORY_MANAGER.

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -339,10 +339,6 @@
     include( "modules/module_hydra.cmake" )
 endif()

-if(TORQUE_DISABLE_MEMORY_MANAGER)
-    addDef(TORQUE_DISABLE_MEMORY_MANAGER)
-endif()
-
 if(TORQUE_DEDICATED)
     addDef(TORQUE_DEDICATED)
 endif()
@@ -456,11 +452,10 @@
 ###############################################################################
 ###############################################################################

+message(STATUS "writing ${projectSrcDir}/torqueConfig.h")
+CONFIGURE_FILE("${cmakeDir}/torqueConfig.h.in" "${projectSrcDir}/torqueConfig.h")
+
 # configure the relevant files only once
-if(NOT EXISTS "${projectSrcDir}/torqueConfig.h")
-    message(STATUS "writing ${projectSrcDir}/torqueConfig.h")
-    CONFIGURE_FILE("${cmakeDir}/torqueConfig.h.in" "${projectSrcDir}/torqueConfig.h")
-endif()
 if(NOT EXISTS "${projectSrcDir}/torque.ico")
     CONFIGURE_FILE("${cmakeDir}/torque.ico" "${projectSrcDir}/torque.ico" COPYONLY)
 endif()


fix directory naming and target dependency chain

--- arangosh/install.cmake
+++ arangosh/install.cmake
@@ -2,8 +2,8 @@
 # these are the install targets for the client package.
 # we can't use RUNTIME DESTINATION here.

-set(STRIP_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/strip")
-
+set(STRIP_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/cstrip")
+add_custom_target(strip_install_client ALL)
 strip_install_bin_and_config(arangobench   ${STRIP_DIR} ${CMAKE_INSTALL_BINDIR} strip_install_client)
 strip_install_bin_and_config(arangodump    ${STRIP_DIR} ${CMAKE_INSTALL_BINDIR} strip_install_client)
 strip_install_bin_and_config(arangoimp     ${STRIP_DIR} ${CMAKE_INSTALL_BINDIR} strip_install_client)


cmake/BuildPCRE2.cmake: still win32 and make program that would not be make [ci skip]

--- cmake/BuildPCRE2.cmake
+++ cmake/BuildPCRE2.cmake
@@ -36,14 +36,31 @@
 # We force the install command with DESTDIR= in any case, so that it always remains local
 # even if user says "make install DESTDIR=/somewhere/else
 #
-EXTERNALPROJECT_ADD(pcre2
-  URL "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23-patched.tar.gz"
-  UPDATE_COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23/CMakeLists_fixed.txt" "${CMAKE_CURRENT_BINARY_DIR}/pcre2/src/pcre2/CMakeLists.txt"
-  PREFIX "${CMAKE_CURRENT_BINARY_DIR}/pcre2"
-  CMAKE_ARGS ${_PCRE2_CMAKE_ARGS}
-  CMAKE_CACHE_ARGS ${_CMAKE_CACHE_ARGS}
-  # INSTALL_COMMAND "${CMAKE_MAKE_PROGRAM}" install "DESTDIR="
-  )
+# On Unix this is make
+# On Unix this is nmake, usually lowercase (I have never seen this with capital letter(s))
+#
+IF ("${CMAKE_MAKE_PROGRAM}" MATCHES ".*make")
+  EXTERNALPROJECT_ADD(pcre2
+    URL "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23-patched.tar.gz"
+    UPDATE_COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23/CMakeLists_fixed.txt" "${CMAKE_CURRENT_BINARY_DIR}/pcre2/src/pcre2/CMakeLists.txt"
+    PREFIX "${CMAKE_CURRENT_BINARY_DIR}/pcre2"
+    CMAKE_ARGS ${_PCRE2_CMAKE_ARGS}
+    CMAKE_CACHE_ARGS ${_CMAKE_CACHE_ARGS}
+    INSTALL_COMMAND "${CMAKE_MAKE_PROGRAM}" install DESTDIR=
+    )
+ELSE ()
+  EXTERNALPROJECT_ADD(pcre2
+    URL "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23-patched.tar.gz"
+    UPDATE_COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23/CMakeLists_fixed.txt" "${CMAKE_CURRENT_BINARY_DIR}/pcre2/src/pcre2/CMakeLists.txt"
+    PREFIX "${CMAKE_CURRENT_BINARY_DIR}/pcre2"
+    CMAKE_ARGS ${_PCRE2_CMAKE_ARGS}
+    CMAKE_CACHE_ARGS ${_CMAKE_CACHE_ARGS}
+    #
+    # Only make (nmake) can handle the install DESTDIR= argument AFAIK
+    #
+    # INSTALL_COMMAND "${CMAKE_MAKE_PROGRAM}" install DESTDIR=
+    )
+ENDIF ()
 SET (PCRE2_INCLUDE_DIR "${3RDPARTY_OUTPUT_PATH}/include")
 IF (WIN32 AND ((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)))
   SET (PCRE2_LINK_FLAGS  "${3RDPARTY_OUTPUT_PATH}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pcre2-8d${CMAKE_STATIC_LIBRARY_SUFFIX}")