ARROW-2032: [C++] ORC ep installs on each call to ninja build

ExternalProject_add using git is sadly always triggering something.
Using HTTP archives instead don't need to check if they are at the
correct revision.

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #1519 from xhochy/ARROW-2032 and squashes the following commits:

f5ac8228 [Uwe L. Korn] ARROW-2032: [C++] ORC ep installs on each call to ninja build

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -926,8 +926,7 @@
                       -DZLIB_HOME=${ZLIB_HOME})

   ExternalProject_Add(orc_ep
-    GIT_REPOSITORY "https://github.com/apache/orc"
-    GIT_TAG ${ORC_VERSION}
+    URL "https://github.com/apache/orc/archive/${ORC_VERSION}.tar.gz"
     BUILD_BYPRODUCTS ${ORC_STATIC_LIB}
     CMAKE_ARGS ${ORC_CMAKE_ARGS})


set SIRF_TAG to v3.1.0-rc.1

set SIRF_TAG to v3.1.0-rc.1

--- version_config.cmake
+++ version_config.cmake
@@ -190,8 +190,7 @@
   set(DEFAULT_CCPi-Regularisation-Toolkit_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG 17f7fa91704b0b5309d1e2562489aaf7932875e8)
-#  set(DEFAULT_SIRF_TAG v3.0.0)
+  set(DEFAULT_SIRF_TAG v3.1.0-rc.1)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )


Fix cegui_dependent_option so it actually works with conditionals

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -520,8 +520,9 @@
 macro (cegui_dependent_option OPTIONNAME DESC DEPS)
     set (${OPTIONNAME}_DEFAULT TRUE)
     foreach (DEP ${DEPS})
+        string(REGEX REPLACE " +" ";" _DEP "${DEP}")
         # Don't use NOT here, because conditions like 'NOT NOT foo' will break
-        if (${${DEP}})
+        if (${_DEP})
         else()
             set (${OPTIONNAME}_DEFAULT FALSE)
         endif()


MOD: Don't version the demo executables.

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

     add_executable(${CEGUI_TARGET_NAME} ${CORE_SOURCE_FILES} ${CORE_HEADER_FILES})
-    set_target_properties(${CEGUI_TARGET_NAME} PROPERTIES VERSION ${CEGUI_VERSION})

     # append the _d (or whatever) for debug builds as needed.
     if (CEGUI_HAS_BUILD_SUFFIX AND CEGUI_BUILD_SUFFIX)


Properly add the Boost_INCLUDE_DIR to the test project(s).


GEODE-6507: Create a subfolder for all clangformat projects

Just a convenience for developers, cleans up the Visual Studio solution space

--- cmake/ClangFormat.cmake
+++ cmake/ClangFormat.cmake
@@ -58,8 +58,9 @@
     if (_clangformat_SOURCES)
       add_custom_target(${_clangformat}
           SOURCES ${_clangformat_SOURCES}
-          COMMENT "Clang-Format for target ${_target}")
-
+          COMMENT "Clang-Format for target ${_target}"
+      )
+      set_target_properties(${_clangformat} PROPERTIES FOLDER clangformat)
       add_dependencies(${_target} ${_clangformat})
     endif ()


Update tests macro to use the same style as other macros

--- cmake/GluonMacros.cmake
+++ cmake/GluonMacros.cmake
@@ -1,27 +1,32 @@
 # This file contains macros that are used inside the Gluon Project

-MACRO(GLUON_UNIT_TESTS libraries modulename)
-    FOREACH(testname ${ARGN})
-        qt4_automoc(${testname}.cpp)
-        add_executable("${modulename}-${testname}" ${testname}.cpp)
-        target_link_libraries("${modulename}-${testname}" ${libraries} ${QT_QTTEST_LIBRARY})
-        add_test("${modulename}-${testname}" ${modulename}-${testname})
-        if(WINCE)
-            target_link_libraries("${modulename}-${testname}" ${WCECOMPAT_LIBRARIES})
-        endif(WINCE)
-    ENDFOREACH(testname)
-ENDMACRO(GLUON_UNIT_TESTS)
-
-MACRO(GLUON_EXECUTABLE_TESTS libraries modulename1)
-    FOREACH(testname ${ARGN})
-        qt4_automoc(${testname}.cpp)
-        add_executable("${modulename}-${testname}" ${testname}.cpp)
-        target_link_libraries("${modulename}-${testname}" ${libraries} ${QT_QTTEST_LIBRARY})
-        if(WINCE)
-            target_link_libraries("${modulename}-${testname}" ${WCECOMPAT_LIBRARIES})
-        endif(WINCE)
-    ENDFOREACH(testname)
-ENDMACRO(GLUON_EXECUTABLE_TESTS)
+macro(gluon_unit_tests _module)
+    set( _libs "" )
+    set( _tests "" )
+
+    set( _current_target "_libs" )
+
+    foreach( _arg ${ARGN} )
+      string( TOLOWER ${_arg} _arg_lc )
+      if( ${_arg_lc} STREQUAL "libraries" )
+            set( _current_target "_libs" )
+        elseif( ${_arg_lc} STREQUAL "tests" )
+            set( _current_target "_tests" )
+        else()
+            list( APPEND ${_current_target} ${_arg} )
+        endif()
+    endforeach()
+
+    foreach(_test ${_tests})
+	set(_test_target "${_module}-${_test}")
+        add_executable(${_test_target} "${_test}.cpp")
+        if( CMAKE_VERSION VERSION_LESS "2.8.6" )
+	    automoc4( ${_test_target} "${_test}.cpp" )
+	endif()
+        target_link_libraries(${_test_target} ${_libs} ${QT_QTTEST_LIBRARY})
+        add_test(${_test_target} ${_module}-${_test})
+    endforeach()
+endmacro(gluon_unit_tests)

 macro(gluon_add_library _target _type)
     set( _sources "" )


Enable test of Perl/PDL examples by default, but only allow that test if
you have version 0.55 (or later) of PDL::Graphics::PLplot.

svn path=/trunk/; revision=11733

--- cmake/modules/pdl.cmake
+++ cmake/modules/pdl.cmake
@@ -23,7 +23,7 @@
 if(DEFAULT_NO_BINDINGS)
   option(ENABLE_pdl "Enable Perl/PDL examples in tests" OFF)
 else(DEFAULT_NO_BINDINGS)
-  option(ENABLE_pdl "Enable Perl/PDL examples in tests" OFF)
+  option(ENABLE_pdl "Enable Perl/PDL examples in tests" ON)
 endif(DEFAULT_NO_BINDINGS)

 if(ENABLE_pdl)
@@ -37,9 +37,8 @@
 if(ENABLE_pdl)
   option(SKIP_PDL_CHECK "SKIP all PDL checks because libplplotd not yet available at cmake time" OFF)
   if(SKIP_PDL_CHECK)
-    message(STATUS "Assume PDL exists and has version >= 2.4.1")
-    message(STATUS "Assume PDL-Graphics-PLplot exists and has version >= 0.47")
-    set(HAVE_PDL_GRAPHICS_PLPLOT_40 ON CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
+    message(STATUS "Assume PDL exists and has version >= 2.4.7")
+    message(STATUS "Assume PDL-Graphics-PLplot exists and has version >= 0.55")
   else(SKIP_PDL_CHECK)
     # N.B. Some of the checks below only work if the correct version
     # of libplplotd.so (currently libplplotd.so.10) is accessible
@@ -60,11 +59,11 @@
 	  OUTPUT_VARIABLE PDL_VERSION
 	  )
 	message(STATUS "PDL_VERSION = ${PDL_VERSION}")
-	transform_version(NUMERICAL_PDL_MINIMUM_VERSION "2.4.1")
+	transform_version(NUMERICAL_PDL_MINIMUM_VERSION "2.4.7")
 	transform_version(NUMERICAL_PDL_VERSION "${PDL_VERSION}")
 	if(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
           message(STATUS "WARNING: "
-            "PDL version < 2.4.1. Disabling Perl/PDL examples in tests")
+            "PDL version < 2.4.7. Disabling Perl/PDL examples in tests")
           set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
 	else(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
           execute_process(
@@ -76,7 +75,7 @@
             )
 	  if(NOT PDL_GRAPHICS_PLPLOT_RETURN_CODE)
             message(STATUS
-	      "PDL version >= 2.4.1 and  PDL::Graphics::PLplot found."
+	      "PDL version >= 2.4.7 and  PDL::Graphics::PLplot found."
 	      )
             execute_process(
 	      COMMAND ${PERL_EXECUTABLE}
@@ -85,20 +84,19 @@
               ERROR_VARIABLE PDL_PLPLOT_VERSION
               )
             message(STATUS "PDL_PLPLOT_VERSION = ${PDL_PLPLOT_VERSION}")
-            transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.47.0")
+            transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.55.0")
             transform_version(NUMERICAL_PDL_PLPLOT_VERSION "${PDL_PLPLOT_VERSION}.0")
 	    #message("NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION = ${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
 	    #message("NUMERICAL_PDL_PLPLOT_VERSION = ${NUMERICAL_PDL_PLPLOT_VERSION}")
             if(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
               message(STATUS "WARNING: "
-		"perl PDL PLplot version < 0.47\n"
-		"   Using limited set of Perl/PDL examples that work with this old version")
-              set(HAVE_PDL_GRAPHICS_PLPLOT_40 OFF CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
+		"perl PDL PLplot version < 0.55\n"
+		"   Drop testing of Perl/PDL examples.")
+	      set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
             else(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
               message(STATUS
-		"perl PDL PLplot version >= 0.47\n"
-		"   Using full set of Perl/PDL examples that work with this version")
-              set(HAVE_PDL_GRAPHICS_PLPLOT_40 ON CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
+		"perl PDL PLplot version >= 0.55\n"
+		"   Test Perl/PDL examples")
             endif(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
 	  else(NOT PDL_GRAPHICS_PLPLOT_RETURN_CODE)
 	    message(STATUS "WARNING: "


mark pkgcfg_lib_GTK libraries as advanced

issue https://github.com/smanders/externpro/issues/264#issuecomment-588481684

--- projects/use/usexp-wxwidgets-config.cmake
+++ projects/use/usexp-wxwidgets-config.cmake
@@ -105,6 +105,11 @@
       if(GTK_FOUND)
         list(APPEND ${PRJ}_INCLUDE_DIR ${GTK_INCLUDE_DIRS})
         set(_wx_core_libs ${GTK_LIBRARIES})
+        foreach(lib ${GTK_LIBRARIES})
+          if(DEFINED pkgcfg_lib_GTK_${lib})
+            mark_as_advanced(pkgcfg_lib_GTK_${lib})
+          endif()
+        endforeach()
       endif()
     endif()
     checkLibraryConcat(X11 XGetWindowAttributes _wx_core_libs)


FincYuni.cmake: added the '--quiet' option to suppress err msg (#7)

Printing error messages when probing about the availability of some
modules is not really usefull for the end-user.

--- packages/cmake/FindYuni.cmake
+++ packages/cmake/FindYuni.cmake
@@ -118,7 +118,7 @@
     endif()

 	# Check if the required modules, and their dependencies are compiled in.
-	execute_process(COMMAND "${__Yuni_Config}" -c "${__Yuni_Compiler}"
+	execute_process(COMMAND "${__Yuni_Config}" --quiet -c "${__Yuni_Compiler}"
 		-m "${__Yuni_ModsOpts}" --module-deps
 		OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE __Yuni_ModsDeps
 		RESULT_VARIABLE __Yuni_Config_DepsResult)


Use INCLUDE_DIR instead of INCLUDE_PATH. Fixes issue 102.

--- cmake/FindCg.cmake
+++ cmake/FindCg.cmake
@@ -3,7 +3,7 @@
 # Once done this will define
 #
 # CG_FOUND =system has NVIDIA Cg and it can be used.
-# CG_INCLUDE_PATH = directory where cg.h resides
+# CG_INCLUDE_DIR = directory where cg.h resides
 # CG_LIBRARY = full path to libCg.so (Cg.DLL on win32)
 # CG_GL_LIBRARY = full path to libCgGL.so (CgGL.dll on win32)
 # CG_COMPILER = full path to cgc (cgc.exe on win32)
@@ -21,7 +21,7 @@
     ENDFOREACH(dir)

     # Find the include  dir
-    FIND_PATH(CG_INCLUDE_PATH cg.h
+    FIND_PATH(CG_INCLUDE_DIR cg.h
       ${CG_FRAMEWORK_INCLUDES}
       )

@@ -63,7 +63,7 @@
       SET (CG_COMPILER_DIR .)
       SET (CG_COMPILER_SUPER_DIR ..)
     ENDIF (CG_COMPILER)
-    FIND_PATH( CG_INCLUDE_PATH Cg/cg.h
+    FIND_PATH( CG_INCLUDE_DIR Cg/cg.h
       $ENV{CG_INC_PATH}
       $ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/include
       $ENV{PROGRAMFILES}/Cg
@@ -133,7 +133,7 @@
       )
     GET_FILENAME_COMPONENT(CG_COMPILER_DIR "${CG_COMPILER}" PATH)
     GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR "${CG_COMPILER_DIR}" PATH)
-    FIND_PATH( CG_INCLUDE_PATH Cg/cg.h
+    FIND_PATH( CG_INCLUDE_DIR Cg/cg.h
       /usr/include
       /usr/local/include
       ${CG_COMPILER_SUPER_DIR}/include
@@ -163,10 +163,10 @@
   ENDIF (WIN32)
 ENDIF (APPLE)

-IF (CG_INCLUDE_PATH)
+IF (CG_INCLUDE_DIR)
   SET( CG_FOUND 1 CACHE STRING "Set to 1 if CG is found, 0 otherwise")
-ELSE (CG_INCLUDE_PATH)
+ELSE (CG_INCLUDE_DIR)
   SET( CG_FOUND 0 CACHE STRING "Set to 1 if CG is found, 0 otherwise")
-ENDIF (CG_INCLUDE_PATH)
+ENDIF (CG_INCLUDE_DIR)

 MARK_AS_ADVANCED( CG_FOUND )


set SOVERSION for plugins too #1119

set SOVERSION for plugins too #1119

--- cmake/macros.cmake
+++ cmake/macros.cmake
@@ -111,6 +111,10 @@
         ${PDAL_ADD_PLUGIN_LINK_WITH})

     set_property(TARGET ${${_name}} PROPERTY FOLDER "Plugins/${_type}")
+    set_target_properties(${${_name}} PROPERTIES
+        VERSION "${PDAL_BUILD_VERSION}"
+        SOVERSION "${PDAL_API_VERSION}"
+        CLEAN_DIRECT_OUTPUT 1)

     install(TARGETS ${${_name}}
         RUNTIME DESTINATION ${PDAL_BIN_INSTALL_DIR}


disable KNL support on Windows and Mac

disable KNL support on Windows and Mac

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -48,8 +48,8 @@

 ## Macro check for compiler support of ISA ##
 MACRO(OSPRAY_CHECK_COMPILER_SUPPORT ISA)
-  IF (${ISA} STREQUAL "AVX512" AND NOT OSPRAY_COMPILER_ICC)
-    OSPRAY_WARN_ONCE(MISSING_AVX512 "OSPRay Currently requires ICC for KNL support. Disabling KNL ISA target.")
+  IF (${ISA} STREQUAL "AVX512" AND NOT OSPRAY_COMPILER_ICC AND (WIN32 OR APPLE))
+    OSPRAY_WARN_ONCE(MISSING_AVX512 "OSPRay Currently requires ICC on Linux for KNL support. Disabling KNL ISA target.")
     SET(OSPRAY_EMBREE_ENABLE_${ISA} false)
   ELSEIF (OSPRAY_EMBREE_ENABLE_${ISA} AND NOT OSPRAY_COMPILER_SUPPORTS_${ISA})
     OSPRAY_WARN_ONCE(MISSING_${ISA} "Need at least version ${GCC_VERSION_REQUIRED_${ISA}} of gcc for ${ISA}. Disabling ${ISA}.\nTo compile for ${ISA}, please switch to either 'ICC'-compiler, or upgrade your gcc version.")


cmake: use WEST_PYTHON as a preferred python installation if defined.

Fixes: #34368

Now added WEST_PYTHON to list of preferred pythons to check.
WEST_PYTHON is added after PYTHON_PREFER so that a user may still
request a specific python is used by supplying
`-DPYTHON_PREFER=<python>` even when building using `west build`.

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

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -13,7 +13,7 @@

 # We are using foreach here, instead of find_program(PYTHON_EXECUTABLE_SYSTEM_DEFAULT "python" "python3")
 # cause just using find_program directly could result in a python2.7 as python, and not finding a valid python3.
-foreach(PYTHON_PREFER ${PYTHON_PREFER} "python" "python3")
+foreach(PYTHON_PREFER ${PYTHON_PREFER} ${WEST_PYTHON} "python" "python3")
   find_program(PYTHON_PREFER_EXECUTABLE ${PYTHON_PREFER})
   if(PYTHON_PREFER_EXECUTABLE)
       execute_process (COMMAND "${PYTHON_PREFER_EXECUTABLE}" -c


Properly set test tool dependencies for lit tests

The syntax for `set_tests_properties` is `set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)`, so the DEPENDS properties has to be a list here.

This was missed in https://github.com/google/iree/pull/530 because I forgot to rerun the kokoro presubmit after the final commit. It turns out the original had a bug though and CMake was just treating LLVMFileCheck as a test property which it set to IreeFileCheck... That would've been a fun race condition to diagnose later.

Closes https://github.com/google/iree/pull/540

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/540 from GMNGeoffrey:cmake-fix 74c7dcf16e07258bd32a9d5125843b6b0b6d9504
PiperOrigin-RevId: 291235124

--- build_tools/cmake/iree_glob_lit_tests.cmake
+++ build_tools/cmake/iree_glob_lit_tests.cmake
@@ -25,6 +25,7 @@

   iree_package_name(_PACKAGE_NAME)
   file(GLOB_RECURSE _TEST_FILES *.mlir)
+  set(_TOOL_DEPS iree_tool_iree-opt IreeFileCheck)

   foreach(_TEST_FILE ${_TEST_FILES})
     get_filename_component(_TEST_FILE_LOCATION ${_TEST_FILE} DIRECTORY)
@@ -32,6 +33,6 @@
     set(_NAME "${_PACKAGE_NAME}_${_TEST_NAME}")

     add_test(NAME ${_NAME} COMMAND ${CMAKE_SOURCE_DIR}/iree/tools/run_lit.sh ${_TEST_FILE} ${CMAKE_SOURCE_DIR}/iree/tools/IreeFileCheck.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/iree/tools)
-    set_tests_properties(${_NAME} PROPERTIES DEPENDS iree_tools_iree-opt IreeFileCheck)
+    set_tests_properties(${_NAME} PROPERTIES DEPENDS _TOOL_DEPS)
   endforeach()
 endfunction()


point libs to lib folder

point libs to lib folder

--- src/build_options.cmake
+++ src/build_options.cmake
@@ -165,7 +165,7 @@
 # Linker flags (shared)
 string(REPLACE ";" " " CMAKE_SHARED_LINKER_FLAGS  "${CMAKE_SHARED_LINK_FLAGS_LIST}")

-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../lib)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)

 function(build_options_finalize)


cmake: Benchmarks need to build as a separate project (out-of-tree).

--- benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
+++ benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
@@ -1,6 +1,5 @@

 include(CMakeParseArguments)
-

 # Run a shell command and assign output to a variable or fail with an error.
 # Example usage:


changed lemon md5sum

changed lemon md5sum

--- lemon.cmake
+++ lemon.cmake
@@ -18,7 +18,7 @@
 external_source (lemon
     1.3
     lemon-1.3.tar.gz
-    750251a77be450ddddedab14e5163afb
+    814d97757c157c5b46a413cc39aad625
     http://lemon.cs.elte.hu/pub/sources)

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


Sync with Plastimatch version

Sync with Plastimatch version

--- cmake/FindOpenCL.cmake
+++ cmake/FindOpenCL.cmake
@@ -62,11 +62,13 @@
   OPENCL_LIBRARY OPENCL_INCLUDE_DIR
   )

-if(OPENCL_FOUND)
-  set(OPENCL_LIBRARIES ${OPENCL_LIBRARY})
-else(OPENCL_FOUND)
-  set(OPENCL_LIBRARIES)
-endif(OPENCL_FOUND)
+# JAS 2010.12.09
+# Edit to allow OpenCL to be delay loaded
+IF (OPENCL_FOUND)
+    SET (OPENCL_LIBRARIES ${OPENCL_LIBRARY})
+ELSE (OPENCL_FOUND)
+    SET (OPENCL_LIBRARIES)
+ENDIF (OPENCL_FOUND)

 if(MINGW)
   set(OPENCL_FOUND FALSE)


Call pdflatex twice.

Call pdflatex twice.

Needed to get the tables of contents indexed, then filled in.

--- cmake/FindSphinx.cmake
+++ cmake/FindSphinx.cmake
@@ -135,8 +135,12 @@
       "${base_destination}/latex/*.tex"
       )

+    # Needs to be executed twice to get table of contents.
     add_custom_command( TARGET ${target_base_name}_latex
       POST_BUILD
+      COMMAND ${PDFLATEX_COMPILER}
+        ${base_destination}/latex/${_texfile}
+        -output-directory ${base_destination}/latex
       COMMAND ${PDFLATEX_COMPILER}
         ${base_destination}/latex/${_texfile}
         -output-directory ${base_destination}/latex


chore(qt): still trying to suppress Qt warnings

--- cmake/consort/qt.cmake
+++ cmake/consort/qt.cmake
@@ -175,9 +175,9 @@
 			if(CONSORT_CLANG AND NOT APPLE)
 				# Clang seems to be generating warnings from Qt headers, even though
 				# -isystem is used
-				find_path(_qt_include_dir QtCore PATHS ${Qt5Core_INCLUDE_DIRS} NO_DEFAULT_PATH)
-				get_filename_component(_qt_include_dir "${_qt_include_dir}/.." ABSOLUTE)
-				list(APPEND Qt5Core_INCLUDE_DIRS ${_qt_include_dir})
+				foreach(m Core ${_modules})
+					list(APPEND CONSORT_COMPILE_FLAGS -isystem-prefix "Qt${m}/")
+				endforeach()
 			endif()

 			if( NOT QT_TRANSLATIONS_DIR)


cmake: add zephyr_cc_option_nocheck

cmake: add zephyr_cc_option_nocheck

Support adding options without checking them with the compiler. In some
cases the simple check routine fails due to missing symbols.

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

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -100,6 +100,12 @@
 function(zephyr_cc_option)
   foreach(arg ${ARGV})
     target_cc_option(zephyr_interface INTERFACE ${arg})
+  endforeach()
+endfunction()
+
+function(zephyr_cc_option_nocheck)
+  foreach(arg ${ARGV})
+    target_compile_options(zephyr_interface INTERFACE ${arg})
   endforeach()
 endfunction()


cmake: Introduce a key version to invalidate corrupted caches

When a bug in the caching mechanism is detected the cache format must
be bumped to ensure that we no longer get a cache hit on old corrupted
keys.

This fixes #7246 when the cache is corrupted.

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

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -622,8 +622,15 @@
   # We need to create a unique key wrt. testing the toolchain
   # capability. This key must be a valid C identifier that includes
   # everything that can affect the toolchain test.
+
+  # The 'cacheformat' must be bumped if a bug in the caching mechanism
+  # is detected and all old keys must be invalidated.
+  set(cacheformat 2)
+
   set(key_string "")
   set(key_string "${key_string}ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE_")
+  set(key_string "${key_string}cacheformat_")
+  set(key_string "${key_string}${cacheformat}_")
   set(key_string "${key_string}${TOOLCHAIN_SIGNATURE}_")
   set(key_string "${key_string}${lang}_")
   set(key_string "${key_string}${option}_")


NFC. Fixing my consistently incorrect spelling.

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

--- cmake/modules/LLVMExternalProjectUtils.cmake
+++ cmake/modules/LLVMExternalProjectUtils.cmake
@@ -91,11 +91,11 @@
   # Find all variables that start with COMPILER_RT and populate a variable with
   # them.
   get_cmake_property(variableNames VARIABLES)
-  foreach(varaibleName ${variableNames})
-    if(varaibleName MATCHES "^${nameCanon}")
-      string(REPLACE ";" "\;" value "${${varaibleName}}")
+  foreach(variableName ${variableNames})
+    if(variableName MATCHES "^${nameCanon}")
+      string(REPLACE ";" "\;" value "${${variableName}}")
       list(APPEND PASSTHROUGH_VARIABLES
-        -D${varaibleName}=${${value}})
+        -D${variableName}=${${value}})
     endif()
   endforeach()


hunter_autotools_project: refactored behaviour into functions

Refactored to use:
  hunter_get_build_flags
  hunter_get_toolchain_binaries
  hunter_autotoools_configure_command

--- cmake/modules/hunter_autotools_project.cmake
+++ cmake/modules/hunter_autotools_project.cmake
@@ -56,10 +56,8 @@
 include(ExternalProject) # ExternalProject_Add
 include(CMakeParseArguments) # cmake_parse_arguments

-include(hunter_dump_cmake_flags)
+include(hunter_autotools_configure_command)
 include(hunter_fatal_error)
-include(hunter_finalize)
-include(hunter_pick_archiver)
 include(hunter_status_debug)
 include(hunter_test_string_not_empty)

@@ -98,7 +96,7 @@

   if(PARAM_UNPARSED_ARGUMENTS)
     hunter_internal_error(
-        "Invalid arguments passed to hunter_autotools_configure:"
+        "Invalid arguments passed to hunter_autotools_project:"
         " ${PARAM_UNPARSED_ARGUMENTS}"
     )
   endif()
@@ -108,269 +106,64 @@
   hunter_test_string_not_empty("${PARAM_INSTALL_DIR}")
   hunter_test_string_not_empty("${PARAM_PACKAGE_CONFIGURATION_TYPES}")

-  list(LENGTH PARAM_PACKAGE_CONFIGURATION_TYPES len)
-  if(NOT "${len}" EQUAL "1")
-    hunter_fatal_error(
-        "Autotools PACKAGE_CONFIGURATION_TYPES has ${len} elements: ${PARAM_PACKAGE_CONFIGURATION_TYPES}. Only 1 is allowed"
-        WIKI "autools.package.configuration.types"
-    )
+  set(default_path "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin")
+  set(shell_env_path "PATH=${PARAM_GLOBAL_INSTALL_DIR}/bin:${default_path}")
+
+  set(d1 "${root_id}/lib/pkgconfig")
+  set(d2 "${root_id}/share/pkgconfig")
+  set(shell_pkg_config_libdir "PKG_CONFIG_LIBDIR=${d1}:${d2}")
+
+  set(clear_vars_shell_script "${PARAM_HUNTER_SELF}/scripts/clear-all.sh")
+
+  set(shell_env
+      .
+      ${clear_vars_shell_script}
+      &&
+      ${shell_env_path}
+      ${shell_pkg_config_libdir}
+  )
+
+  # Build command and options
+  set(autotools_build_command "make")
+  string(COMPARE NOTEQUAL "${PARAM_PARALLEL_JOBS}" "" have_jobs)
+  if(have_jobs)
+    list(APPEND autotools_build_command "-j" "${PARAM_PARALLEL_JOBS}")
   endif()

-  if(ANDROID)
-    hunter_test_string_not_empty("${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}")
-    # CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX can be empty
-
-    # Extra Android variables that can't be set in toolchain
-    # (some variables available only after toolchain processed).
-    set(
-        CMAKE_C_PREPROCESSOR
-        "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}cpp${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}"
-    )
-    if(NOT EXISTS "${CMAKE_C_PREPROCESSOR}")
-      hunter_internal_error("File not found: ${CMAKE_C_PREPROCESSOR}")
-    endif()
-  endif()
-
-  # -> CMAKE_AR
-  # -> CMAKE_RANLIB
-  hunter_pick_archiver()
-
-  string(TOUPPER ${PARAM_PACKAGE_CONFIGURATION_TYPES} config_type)
-  # Sets the toolchain binaries
-  #   AR=${CMAKE_AR}
-  #   AS=${CMAKE_ASM_COMPILER}
-  #   LD=${CMAKE_LINKER}
-  #   NM=${CMAKE_NM}
-  #   OBJCOPY=${CMAKE_OBJCOPY}
-  #   OBJDUMP=${CMAKE_OBJDUMP}
-  #   RANLIB=${CMAKE_RANLIB}
-  #   STRIP=${CMAKE_STRIP}
-  #   CPP=${CMAKE_C_PREPROCESSOR}
-  #   CC=${CMAKE_C_COMPILER}
-  #   CXX=${CMAKE_CXX_COMPILER}
-  #
-  set(toolchain_binaries)
-  if(CMAKE_AR)
-    list(APPEND toolchain_binaries AR=${CMAKE_AR})
-  endif()
-  if(CMAKE_ASM_COMPILER)
-    list(APPEND toolchain_binaries AS=${CMAKE_ASM_COMPILER})
-  endif()
-  if(CMAKE_LINKER)
-    list(APPEND toolchain_binaries LD=${CMAKE_LINKER})
-  endif()
-  if(CMAKE_NM)
-    list(APPEND toolchain_binaries NM=${CMAKE_NM})
-  endif()
-  if(CMAKE_OBJCOPY)
-    list(APPEND toolchain_binaries OBJCOPY=${CMAKE_OBJCOPY})
-  endif()
-  if(CMAKE_OBJDUMP)
-    list(APPEND toolchain_binaries OBJDUMP=${CMAKE_OBJDUMP})
-  endif()
-  if(CMAKE_RANLIB)
-    list(APPEND toolchain_binaries RANLIB=${CMAKE_RANLIB})
-  endif()
-  if(CMAKE_STRIP)
-    list(APPEND toolchain_binaries STRIP=${CMAKE_STRIP})
-  endif()
-  if(CMAKE_C_PREPROCESSOR)
-    list(APPEND toolchain_binaries CPP=${CMAKE_C_PREPROCESSOR})
-  endif()
-  if(CMAKE_C_COMPILER)
-    list(APPEND toolchain_binaries CC=${CMAKE_C_COMPILER})
-  endif()
-  if(CMAKE_CXX_COMPILER)
-    list(APPEND toolchain_binaries CXX=${CMAKE_CXX_COMPILER})
-  endif()
-
-  string(STRIP "${toolchain_binaries}" toolchain_binaries)
-  if(HUNTER_STATUS_DEBUG)
-    string(
-        REPLACE ";" "\n" toolchain_binaries_new_line "${toolchain_binaries}"
-    )
-    hunter_status_debug("Toolchain Binaries:")
-    foreach(x ${toolchain_binaries})
-      hunter_status_debug("  ${x}")
-    endforeach()
-  endif()
-
-  # CPPFLAGS=${PARAM_CPPFLAGS} [-D${COMPILE_DEFINITIONS}]
-  #          [-I${INCLUDE_DIRECTORIES}]
-  #
-  # C Preprocessor flags
-  set(cppflags "-I${PARAM_GLOBAL_INSTALL_DIR}/include")
-  # build config type definitions
-  get_directory_property(defs
-      COMPILE_DEFINITIONS_${config_type}
-  )
-  foreach(def ${defs})
-    set(cppflags "${cppflags} -D${def}")
-  endforeach()
-  # non-build config specific definitions
-  get_directory_property(defs COMPILE_DEFINITIONS)
-  foreach(def ${defs})
-    set(cppflags "${cppflags} -D${def}")
-  endforeach()
-
-  get_directory_property(include_dirs INCLUDE_DIRECTORIES)
-  foreach(include_dir ${include_dirs})
-    set(cppflags
-        "${cppflags} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${include_dir}"
-    )
-  endforeach()
-
-  hunter_dump_cmake_flags(CPPFLAGS cppflags)
-  # -> CMAKE_C_FLAGS
-  # -> CMAKE_CXX_FLAGS
-
-  set(cppflags "${cppflags} ${PARAM_CPPFLAGS}")
-  string(STRIP "${cppflags}" cppflags)
-  hunter_status_debug("CPPFLAGS=${cppflags}")
-
-  # CFLAGS=${cflags} ${CMAKE_C_FLAGS}
-  #
-  # C Compiler Flags (defines or include directories should not be needed here)
-  set(cflags "${CMAKE_C_FLAGS_${config_type}} ${CMAKE_C_FLAGS} ${PARAM_CFLAGS}")
-  string(STRIP "${cflags}" cflags)
-  hunter_status_debug("CFLAGS=${cflags}")
-
-  # CXXFLAGS=${cxxflags} ${CMAKE_CXX_FLAGS}
-  #
-  # C++ Compiler flags (defines or include directories should not be needed here)
-  set(cxxflags "${CMAKE_CXX_FLAGS_${config_type}} ${CMAKE_CXX_FLAGS} ${PARAM_CXXFLAGS}")
-  string(STRIP "${cxxflags}" cxxflags)
-  hunter_status_debug("CXXFLAGS=${cxxflags}")
-
-  # LDFLAGS=${ldflags}
-  #
-  # Linker flags
-  set(ldflags "-L${PARAM_GLOBAL_INSTALL_DIR}/lib")
-  set(ldflags "${ldflags} ${CMAKE_EXE_LINKER_FLAGS_${config_type}}")
-  string(STRIP "${ldflags}" ldflags)
-  set(ldflags "${ldflags} ${CMAKE_EXE_LINKER_FLAGS}")
-  string(STRIP "${ldflags}" ldflags)
-  set(ldflags "${ldflags} ${PARAM_LDFLAGS}")
-  string(STRIP "${ldflags}" ldflags)
-  hunter_status_debug("LDFLAGS=${ldflags}")
-
-  set(configure_host)
-  string(COMPARE NOTEQUAL "${ANDROID}" "" is_android)
+  set(build_command ${shell_env} ${autotools_build_command})
+
   string(COMPARE NOTEQUAL "${IPHONEOS_ARCHS}${IPHONESIMULATOR_ARCHS}" "" is_ios)
-  string(COMPARE NOTEQUAL "${CROSS_COMPILE_TOOLCHAIN_PREFIX}" "" is_cross_compile)
-  if(is_android)
-    # AWP: the checks below should also be done for the Raspberry Pi
-    #      how could we do it without repetition?
-    hunter_test_string_not_empty("${CMAKE_C_FLAGS}")
-    hunter_test_string_not_empty("${CMAKE_CXX_FLAGS}")
-    hunter_test_string_not_empty("${CMAKE_AR}")
-    hunter_test_string_not_empty("${CMAKE_C_PREPROCESSOR}")
-    hunter_test_string_not_empty("${CMAKE_C_COMPILER}")
-    hunter_test_string_not_empty("${CMAKE_CXX_COMPILER}")
-    hunter_test_string_not_empty("${CMAKE_LINKER}")
-    hunter_test_string_not_empty("${CMAKE_NM}")
-    hunter_test_string_not_empty("${CMAKE_OBJCOPY}")
-    hunter_test_string_not_empty("${CMAKE_OBJDUMP}")
-    hunter_test_string_not_empty("${CMAKE_RANLIB}")
-    hunter_test_string_not_empty("${CMAKE_STRIP}")
-
-    hunter_test_string_not_empty("${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE}")
-    set(configure_host --host=${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE})
-    set(ldflags "${ldflags} ${__libstl}")
-  elseif(is_ios)
+  if(is_ios)
     hunter_status_debug("Autotools iOS IPHONEOS_ARCHS: ${IPHONEOS_ARCHS} IPHONESIMULATOR_ARCHS: ${IPHONESIMULATOR_ARCHS}")
     if(BUILD_SHARED_LIBS)
       hunter_fatal_error("Autotools: building iOS libraries as shared is not supported")
     endif()
     set(ios_architectures)
     list(APPEND ios_architectures ${IPHONEOS_ARCHS} ${IPHONESIMULATOR_ARCHS})
-  elseif(is_cross_compile)
-    set(configure_host --host=${CROSS_COMPILE_TOOLCHAIN_PREFIX})
   endif()

-  # Hunter builds static libraries by default
-  if(BUILD_SHARED_LIBS)
-    list(APPEND PARAM_EXTRA_FLAGS --enable-shared --disable-static)
-  else()
-    list(APPEND PARAM_EXTRA_FLAGS --disable-shared --enable-static)
-  endif()
-
-  if(HUNTER_STATUS_DEBUG)
-    string(REPLACE ";" " " extra_flags "${PARAM_EXTRA_FLAGS}")
-    hunter_status_debug("EXTRA_FLAGS=${extra_flags}")
-  endif()
-
-  # Build command and options
-  set(build_command . "${PARAM_HUNTER_SELF}/scripts/clear-all.sh" && make)
-  set(build_opts)
-  string(COMPARE NOTEQUAL "${PARAM_PARALLEL_JOBS}" "" have_jobs)
-  if(have_jobs)
-    list(APPEND build_opts "-j" "${PARAM_PARALLEL_JOBS}")
-  endif()
-
-  set(configure_command . "${PARAM_HUNTER_SELF}/scripts/clear-all.sh" &&)
-  list(APPEND configure_command AR=${CMAKE_AR})
-
-  # see clear-all.sh
-  # PATH environment variable
-  set(default_path "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin")
-  list(
-      APPEND
-      configure_command
-      "PATH=${PARAM_GLOBAL_INSTALL_DIR}/bin:${default_path}"
-  )
-
-  # PKG_CONFIG_LIBDIR environment variable
-  # This info is also in hunter_finalize.cmake
-  set(d1 "${PARAM_GLOBAL_INSTALL_DIR}/lib/pkgconfig")
-  set(d2 "${PARAM_GLOBAL_INSTALL_DIR}/share/pkgconfig")
-  list(APPEND configure_command "PKG_CONFIG_LIBDIR=${d1}:${d2}")
-
-  string(COMPARE NOTEQUAL "${PARAM_BOOTSTRAP}" "" have_bootstrap)
-  if(have_bootstrap)
-    list(APPEND configure_command "${PARAM_BOOTSTRAP}" &&)
-  endif()
-
-  list(APPEND configure_command "./configure")
-
-  # Build the configure command line options
-  set(configure_opts)
-  string(COMPARE NOTEQUAL "${configure_host}" "" has_configure_host)
-  if(has_configure_host)
-    list(APPEND configure_opts ${configure_host})
-  endif()
-
-  string(COMPARE NOTEQUAL "${toolchain_binaries}" "" has_changes)
-  if(has_changes)
-    list(APPEND configure_opts ${toolchain_binaries})
-  endif()
-
-  string(COMPARE NOTEQUAL "${cppflags}" "" has_cppflags)
-  if(has_cppflags)
-    list(APPEND configure_opts CPPFLAGS=${cppflags})
-  endif()
-
-  string(COMPARE NOTEQUAL "${cflags}" "" has_cflags)
-  if(has_cflags)
-    list(APPEND configure_opts CFLAGS=${cflags})
-  endif()
-
-  string(COMPARE NOTEQUAL "${cxxflags}" "" has_cxxflags)
-  if(has_cxxflags)
-    list(APPEND configure_opts CXXFLAGS=${cxxflags})
-  endif()
-
-  string(COMPARE NOTEQUAL "${ldflags}" "" hasldflags)
-  if(hasldflags)
-    list(APPEND configure_opts LDFLAGS=${ldflags})
-  endif()
-
-  if(PARAM_EXTRA_FLAGS)
-    list(APPEND configure_opts ${PARAM_EXTRA_FLAGS})
-  endif()
-
   if(NOT is_ios)
-    hunter_status_debug("Autotools configure_opts: ${configure_opts} ")
+    hunter_autotools_configure_command(autotools_configure_command
+       PACKAGE_INSTALL_DIR
+         ${PARAM_INSTALL_DIR}
+       EXTRA_FLAGS
+         ${PARAM_EXTRA_FLAGS}
+       INSTALL_DIR
+         ${PARAM_GLOBAL_INSTALL_DIR}
+       PACKAGE_CONFIGURATION_TYPES
+         ${PARAM_PACKAGE_CONFIGURATION_TYPES}
+       CPPFLAGS
+         ${PARAM_CPPFLAGS}
+       CFLAGS
+         ${PARAM_CFLAGS}
+       CXXFLAGS
+         ${PARAM_CXXFLAGS}
+       LDFLAGS
+         ${PARAM_LDFLAGS}
+    )
+
+    set(configure_command ${shell_env} ${autotools_configure_command})
+
     ExternalProject_Add(${target_name}
         URL
           ${PARAM_URL}
@@ -384,12 +177,11 @@
           ${PARAM_INSTALL_DIR}
           # not used, just avoid creating Install/<name> empty directory
         CONFIGURE_COMMAND
+          "${PARAM_BOOTSTRAP}"
+        COMMAND
           ${configure_command}
-          ${configure_opts}
-          "--prefix=${PARAM_INSTALL_DIR}"
         BUILD_COMMAND
           ${build_command}
-          ${build_opts}
         BUILD_IN_SOURCE
           1
         INSTALL_COMMAND
@@ -440,7 +232,6 @@
       endif()

       set(arch_flags)
-      set(configure_opts)
       # Extra space at the end of the arch_flags is needed below when appending
       # to configure_opts, please do not remove!
       if(is_simulator)
@@ -448,13 +239,27 @@
       else()
         set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONEOS_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} ")
       endif()
-      list(APPEND configure_opts --host=${configure_host})
-      list(APPEND configure_opts ${toolchain_binaries})
-      list(APPEND configure_opts CPPFLAGS=${arch_flags}${cppflags})
-      list(APPEND configure_opts CFLAGS=${arch_flags}${cflags})
-      list(APPEND configure_opts CXXFLAGS=${arch_flags}${cxxflags})
-      list(APPEND configure_opts LDFLAGS=${arch_flags}${ldflags})
-      list(APPEND configure_opts ${PARAM_EXTRA_FLAGS})
+      hunter_autotools_configure_command(autotools_configure_command
+          PACKAGE_INSTALL_DIR
+            ${arch_install_dir}
+          EXTRA_FLAGS
+            ${PARAM_EXTRA_FLAGS}
+          CONFIGURE_HOST
+            ${configure_host}
+          INSTALL_DIR
+            ${PARAM_GLOBAL_INSTALL_DIR}
+          PACKAGE_CONFIGURATION_TYPES
+            ${PARAM_PACKAGE_CONFIGURATION_TYPES}
+          CPPFLAGS
+            ${arch_flags}${PARAM_CPPFLAGS}
+          CFLAGS
+            ${arch_flags}${PARAM_CFLAGS}
+          CXXFLAGS
+            ${arch_flags}${PARAM_CXXFLAGS}
+          LDFLAGS
+            ${arch_flags}${PARAM_LDFLAGS}
+      )
+      set(configure_command ${shell_env} ${autotools_configure_command})

       # architecture specific source dir
       set(arch_source_dir
@@ -479,12 +284,11 @@
             ${arch_install_dir}
             # not used, just avoid creating Install/<name> empty directory
           CONFIGURE_COMMAND
+            "${PARAM_BOOTSTRAP}"
+          COMMAND
             ${configure_command}
-            ${configure_opts}
-            "--prefix=${arch_install_dir}"
           BUILD_COMMAND
             ${build_command}
-            ${build_opts}
           BUILD_IN_SOURCE
             1
           INSTALL_COMMAND


Little modification to FindPostgreSQL.cmake: Now will detect PostgreSQL also if pg_config.h only includes some other file. (Needed for PG on RedHat)

--- cmake/FindPostgreSQL.cmake
+++ cmake/FindPostgreSQL.cmake
@@ -47,7 +47,15 @@

 	if(EXISTS "${POSTGRESQL_CLIENT_INCLUDE_DIR}/pg_config.h")
 		# Read and parse postgres version header file for version number
-		file(READ "${POSTGRESQL_CLIENT_INCLUDE_DIR}/pg_config.h" _POSTGRESQL_HEADER_CONTENTS)
+        if(${CMAKE_COMPILER_IS_GNUCC})
+            # If we know the compiler, we can do something that is a little smarter
+            execute_process(
+                COMMAND ${CMAKE_C_COMPILER} -E -dD "${POSTGRESQL_CLIENT_INCLUDE_DIR}/pg_config.h"
+                OUTPUT_VARIABLE _POSTGRESQL_HEADER_CONTENTS
+            )
+        else(${CMAKE_COMPILER_IS_GNUCC})
+            file(READ "${POSTGRESQL_CLIENT_INCLUDE_DIR}/pg_config.h" _POSTGRESQL_HEADER_CONTENTS)
+        endif(${CMAKE_COMPILER_IS_GNUCC})

         string(REGEX REPLACE ".*#define PACKAGE_NAME \"([^\"]+)\".*" "\\1" POSTGRESQL_PACKAGE_NAME "${_POSTGRESQL_HEADER_CONTENTS}")
 		string(REGEX REPLACE ".*#define PG_VERSION \"([0-9.]+)\".*" "\\1" POSTGRESQL_VERSION_STRING "${_POSTGRESQL_HEADER_CONTENTS}")


Squashed '3rdparty/github/cmake-utils/' changes from 75363415..ca4cd210

ca4cd210 cmake/MyPackageStart.cmake: fix
be49657a Revert "MYPACKAGEDEPENDENCY macro revisit"
dd7308ab MYPACKAGEDEPENDENCY macro revisit

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: ca4cd210791f6771eafaca4e16b15300a719cfc1

--- cmake/MyPackageStart.cmake
+++ cmake/MyPackageStart.cmake
@@ -144,13 +144,19 @@
   # unless it is starting with an '_'.
   #
   FILE (GLOB_RECURSE _include include/*.h include/*.hpp)
-  FOREACH (_file ${_include} )
+  FOREACH (_file ${_include})
+    IF (MYPACKAGE_DEBUG)
+      MESSAGE (STATUS "[${PROJECT_NAME}-START-DEBUG] Checking include ${_file}")
+    ENDIF ()
     #
     # Hiden file
     #
     GET_FILENAME_COMPONENT(_basename ${_file} NAME)
     STRING (REGEX MATCH "^_" _hiden ${_basename})
     IF ("${_hiden}" STREQUAL "_")
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-START-DEBUG] Skipping hiden include ${_file}")
+      ENDIF ()
       CONTINUE ()
     ENDIF ()
     #
@@ -159,6 +165,9 @@
     GET_FILENAME_COMPONENT(_directory ${_file} DIRECTORY)
     STRING (REGEX MATCH "/internal/?" _internal ${_directory})
     IF (("${_internal}" STREQUAL "/internal") OR ("${_internal}" STREQUAL "/internal/"))
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-START-DEBUG] Skipping internal include ${_file}")
+      ENDIF ()
       CONTINUE ()
     ENDIF ()
     #
@@ -166,9 +175,10 @@
     #
     FILE (RELATIVE_PATH _relfile ${PROJECT_SOURCE_DIR} ${_file})
     GET_FILENAME_COMPONENT(_dir ${_relfile} DIRECTORY)
-    IF (${packageName}_CAN_INSTALL)
-      INSTALL(FILES ${_file} DESTINATION ${_dir} COMPONENT HeaderComponent)
-      SET (_HAVE_HEADERCOMPONENT TRUE CACHE INTERNAL "Have HeaderComponent" FORCE)
+    INSTALL(FILES ${_file} DESTINATION ${_dir} COMPONENT HeaderComponent)
+    SET (_HAVE_HEADERCOMPONENT TRUE CACHE INTERNAL "Have HeaderComponent" FORCE)
+    IF (MYPACKAGE_DEBUG)
+      MESSAGE (STATUS "[${PROJECT_NAME}-START-DEBUG] Adding install rule for ${_file}")
     ENDIF ()
   ENDFOREACH()
   #


Fix building tests without E2EE

Fix building tests without E2EE

--- cmake/QuotientConfig.cmake
+++ cmake/QuotientConfig.cmake
@@ -1,4 +1,6 @@
 include(CMakeFindDependencyMacro)

-find_dependency(QtOlm)
+if (Quotient_E2EE_ENABLED)
+    find_dependency(QtOlm)
+endif()
 include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake")


Add some basic system checks for function like isnan etc.

svn path=/trunk/; revision=6745


build: update sinsp, scap and the drivers to c4f096099bf81966803d26c40c6c2cb2b8d08033

Signed-off-by: Lorenzo Fontana <0189fb5ac8a393aa741cf57f29cfe3228fcad081@gmail.com>

--- cmake/modules/sysdig.cmake
+++ cmake/modules/sysdig.cmake
@@ -29,8 +29,8 @@
 # default below In case you want to test against another sysdig version just pass the variable - ie., `cmake
 # -DSYSDIG_VERSION=dev ..`
 if(NOT SYSDIG_VERSION)
-  set(SYSDIG_VERSION "fntlnz-aarch64")
-  set(SYSDIG_CHECKSUM "SHA256=cd7e90408825457a049ef626f78ca02022648a71497c34c1fd86b1cfa736479e")
+  set(SYSDIG_VERSION "c4f096099bf81966803d26c40c6c2cb2b8d08033")
+  set(SYSDIG_CHECKSUM "SHA256=9bda3960e14a1d9bc71e951b01b11d1885a5a39fd39d89945e99ae5819c8bb15")
 endif()
 set(PROBE_VERSION "${SYSDIG_VERSION}")


Bump version

Bump version

--- cmake/ospray_options.cmake
+++ cmake/ospray_options.cmake
@@ -20,7 +20,7 @@

 SET(OSPRAY_VERSION_MAJOR 1)
 SET(OSPRAY_VERSION_MINOR 4)
-SET(OSPRAY_VERSION_PATCH 1)
+SET(OSPRAY_VERSION_PATCH 2)
 SET(OSPRAY_VERSION_GITHASH 0)
 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
   FIND_PACKAGE(Git)


reduced inline-factor to 150 for intel compiler on mac os to prevent internal compiler error

--- common/cmake/icc.cmake
+++ common/cmake/icc.cmake
@@ -133,8 +133,12 @@
   SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -restrict")                   # enable restrict keyword
   SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -no-inline-max-total-size")   # no size limit when performing inlining
   SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -no-inline-max-per-compile")  # no maximal number of inlinings per compilation unit
-  SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -inline-factor=200")          # increase default inline factors limits by 2x
-
+  IF (NOT APPLE)
+    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -inline-factor=200")          # increase default inline factors limits by 2x
+  ELSE(NOT APPLE)
+    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -inline-factor=150")
+  ENDIF()
+
   SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
   SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG")                     # enables assertions
   SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DTBB_USE_DEBUG")             # configures TBB in debug mode


add configuration for a local cdash to ctest

--- ctest/CTestConfig.cmake
+++ ctest/CTestConfig.cmake
@@ -1,6 +1,15 @@
-set(CTEST_PROJECT_NAME         "Test-Project")
-set(CTEST_NIGHTLY_START_TIME   "01:00:00 MST")
-set(CTEST_DROP_METHOD          "http")
-set(CTEST_DROP_SITE            "raf.mudaf")
-set(CTEST_DROP_LOCATION        "/cdash/submit.php?project=TestProject")
-set(CTEST_DROP_SITE_CDASH      FALSE)
+## 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 submit to the CDash dashboard:
+##   ENABLE_TESTING()
+##   INCLUDE(CTest)
+
+set(CTEST_PROJECT_NAME "openfast")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "localhost")
+set(CTEST_DROP_LOCATION        "/cdash/public/submit.php?project=openfast")
+set(CTEST_DROP_SITE_CDASH TRUE)


target_compile_options

--- common/cmake/MyGTest.cmake
+++ common/cmake/MyGTest.cmake
@@ -12,8 +12,8 @@
 set_property (TARGET gtest      PROPERTY EXCLUDE_FROM_ALL TRUE)
 set_property (TARGET gtest_main PROPERTY EXCLUDE_FROM_ALL TRUE)

-add_compile_option (gtest      PRIVATE -w)
-add_compile_option (gtest_main PRIVATE -w)
+target_compile_options (gtest      PRIVATE -w)
+target_compile_options (gtest_main PRIVATE -w)

 include (FindGTest)


Revert "disabling RPM changelog, timestamp creates issues in CentOS 6.0"

This reverts commit 27d6b7b83d3cb39c27cd28839e219a79dcbfef47.

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -221,10 +221,10 @@
     SET(CPACK_RPM_devel_PACKAGE_ARCHITECTURE noarch)
     SET(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0") # Apache Software License, Version 2.0
     SET(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
-    #SET(CPACK_RPM_CHANGELOG_FILE ${CMAKE_BINARY_DIR}/rpm_changelog.txt) # ChangeLog of the RPM
-    #STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
-    #SET(RPM_CHANGELOG "* ${CHANGELOG_DATE} Johannes Günther <johannes.guenther@intel.com> - ${EMBREE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n- First package")
-    #FILE(WRITE ${CPACK_RPM_CHANGELOG_FILE} ${RPM_CHANGELOG})
+    SET(CPACK_RPM_CHANGELOG_FILE ${CMAKE_BINARY_DIR}/rpm_changelog.txt) # ChangeLog of the RPM
+    STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
+    SET(RPM_CHANGELOG "* ${CHANGELOG_DATE} Johannes Günther <johannes.guenther@intel.com> - ${EMBREE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n- First package")
+    FILE(WRITE ${CPACK_RPM_CHANGELOG_FILE} ${RPM_CHANGELOG})
     SET(CPACK_RPM_PACKAGE_URL http://embree.github.io/)
     SET(CPACK_RPM_DEFAULT_DIR_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # otherwise cmake directory has wrong 775 permissions


Let WIX set CMake registry ==> Embree will be found without embree_DIR

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -172,8 +172,9 @@
     SET(CPACK_GENERATOR WIX)
     SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}")
     SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Intel\\\\Embree v${EMBREE_VERSION} ${ARCH}")
-	SET(CPACK_WIX_PRODUCT_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_NUMBER}")
-	SET(CPACK_WIX_UPGRADE_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_MAJOR}0000") # upgrade as long as major version is the same
+    SET(CPACK_WIX_PRODUCT_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_NUMBER}")
+    SET(CPACK_WIX_UPGRADE_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_MAJOR}0000") # upgrade as long as major version is the same
+    SET(CPACK_WIX_CMAKE_PACKAGE_REGISTRY TRUE)
     IF (EMBREE_TESTING_PACKAGE)
       ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CPACK_PACKAGE_FILE_NAME}.exe ${CMAKE_BUILD_TYPE})
     ENDIF()


Fixing cmake config problem

Fixing cmake config problem

--- CMake/CPackCreate.cmake
+++ CMake/CPackCreate.cmake
@@ -49,7 +49,7 @@
 ENDIF(APPLE)

 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/CPackOptions.cmake.in"
-  "${ConceptualModelBuilder_BINARY_DIR}/CPackOptions.cmake" @ONLY)
+  "${CMBNuclearSuite_BINARY_DIR}/CPackOptions.cmake" @ONLY)
 SET(CPACK_PROJECT_CONFIG_FILE
   "${ConceptualModelBuilder_BINARY_DIR}/CPackOptions.cmake")


emscripten: replace obsolete --llvm-lto flag with -flto

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -32,8 +32,8 @@
 option(FIPS_EMSCRIPTEN_DEMANGLE "compile with libcxxabi-provided demangling support" OFF)
 option(FIPS_EMSCRIPTEN_USE_FETCH "use fetch API" OFF)
 option(FIPS_EMSCRIPTEN_USE_MINIMAL_RUNTIME "use the minimal JS runtime" OFF)
+option(FIPS_EMSCRIPTEN_USE_LTO "enable link-time optimization" ON)
 set(FIPS_EMSCRIPTEN_TOTAL_MEMORY 33554432 CACHE STRING "initial heap size in bytes")
-set(FIPS_EMSCRIPTEN_LTO_LEVEL 0 CACHE STRING "link-time-optimization level (0..3)")
 set(FIPS_EMSCRIPTEN_MEM_INIT_METHOD 1 CACHE STRING "how to represent initial memory content (0..2)")
 set(FIPS_EMSCRIPTEN_SHELL_HTML "shell.html" CACHE STRING "path to shell html file")

@@ -110,9 +110,8 @@
 if (NOT FIPS_RTTI)
     set(EMSC_CXX_FLAGS "${EMSC_CXX_FLAGS} -fno-rtti")
 endif()
-if (FIPS_EMSCRIPTEN_LTO_LEVEL GREATER 0)
-    set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL}")
-    set(EMSC_COMMON_FLAGS "${EMSC_COMMON_FLAGS} -flto")
+if (FIPS_EMSCRIPTEN_USE_LTO)
+    set(EMSC_COMMON_FLAGS_RELEASE "${EMSC_COMMON_FLAGS_RELEASE} -flto")
 endif()
 if (FIPS_EMSCRIPTEN_USE_WASM)
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=1")


Fixes #436 - removes temporary warning log in StereoDepth

--- 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 "1d690f5ace17b6ab80b835f364e4182005b32b3e")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "afe8d00c868344c73ee897e26278f80a444b9763")

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


Update FW: configurable FPS for OV7251: max 99 for 480p, 117 for 400p

--- 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 "921b8a6a29fa445ea1c250d76dbe8694b5768584")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "af9024d1b2f023f80171f7a36fbeca4718a7b808")

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


Update FW: fix still capture with scaling, add FPS capping (with warnings)

--- 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 "c03b9979b83941cdc9feb1a29f5a1452234a65f9")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "9a713b5a5e4422944a2cf98ba177738d465da19f")

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


Fail to configure if fail-on-missing=ON and zlib is not found

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -42,10 +42,14 @@
   foreach(suffix FOUND INCLUDE_DIR LIBRARY LIBRARY_DEBUG LIBRARY_RELEASE)
     unset(ZLIB_${suffix} CACHE)
   endforeach()
-  find_package(ZLIB)
-  if(NOT ZLIB_FOUND)
-    message(STATUS "Zlib not found. Switching on builtin_zlib option")
-    set(builtin_zlib ON CACHE BOOL "Enabled because Zlib not found (${builtin_zlib_description})" FORCE)
+  if(fail-on-missing)
+    find_package(ZLIB REQUIRED)
+  else()
+    find_package(ZLIB)
+    if(NOT ZLIB_FOUND)
+      message(STATUS "Zlib not found. Switching on builtin_zlib option")
+      set(builtin_zlib ON CACHE BOOL "Enabled because Zlib not found (${builtin_zlib_description})" FORCE)
+    endif()
   endif()
 endif()


Fail to configure if fail-on-missing=ON and libAfterImage is not found

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -332,12 +332,17 @@
 #---Check for AfterImage---------------------------------------------------------------
 if(asimage AND NOT builtin_afterimage)
   message(STATUS "Looking for AfterImage")
-  find_package(AfterImage)
-  if(NOT AFTERIMAGE_FOUND)
-    message(STATUS "AfterImage not found. Switching on builtin_afterimage option")
-    set(builtin_afterimage ON CACHE BOOL "Enabled because asimage requested and AfterImage not found (${builtin_afterimage_description})" FORCE)
-  endif()
-endif()
+  if(fail-on-missing)
+    find_package(AfterImage REQUIRED)
+  else()
+    find_package(AfterImage)
+    if(NOT AFTERIMAGE_FOUND)
+      message(STATUS "AfterImage not found. Switching on builtin_afterimage option")
+      set(builtin_afterimage ON CACHE BOOL "Enabled because asimage requested and AfterImage not found (${builtin_afterimage_description})" FORCE)
+    endif()
+  endif()
+endif()
+
 if(builtin_afterimage)
   set(AFTERIMAGE_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libAfterImage${CMAKE_STATIC_LIBRARY_SUFFIX})
   if(WIN32)


liblzma.dll must also be copied into the install bin directory

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -196,6 +196,7 @@
       INSTALL_COMMAND ${CMAKE_COMMAND} -E copy lib/liblzma.dll <INSTALL_DIR>/bin
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1
       BUILD_BYPRODUCTS ${LZMA_LIBRARIES})
+    install(FILES ${CMAKE_BINARY_DIR}/bin/liblzma.dll DESTINATION ${CMAKE_INSTALL_BINDIR})
     set(LZMA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/LZMA/src/LZMA/include)
   else()
     if(CMAKE_CXX_COMPILER_ID MATCHES Clang)


Bump ITK version to latest release

Bump ITK version to latest release

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -73,7 +73,7 @@

 # Insight Segmentation and Registration Toolkit
 set( ITK_URL ${github_protocol}://github.com/InsightSoftwareConsortium/ITK.git )
-set( ITK_HASH_OR_TAG cb0b6bb10ec2fbad5caf04a6b9b213bbc5420e3d )
+set( ITK_HASH_OR_TAG v4.12.0 )

 # Slicer Execution Model
 set( SlicerExecutionModel_URL


Added INSTALL_FOLDER option to conan_install

--- conan.cmake
+++ conan.cmake
@@ -260,7 +260,7 @@

 macro(parse_arguments)
   set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS NO_OUTPUT_DIRS)
-  set(oneValueArgs CONANFILE DEBUG_PROFILE RELEASE_PROFILE RELWITHDEBINFO_PROFILE MINSIZEREL_PROFILE PROFILE ARCH BUILD_TYPE)
+  set(oneValueArgs CONANFILE DEBUG_PROFILE RELEASE_PROFILE RELWITHDEBINFO_PROFILE MINSIZEREL_PROFILE PROFILE ARCH BUILD_TYPE INSTALL_FOLDER)
   set(multiValueArgs REQUIRES OPTIONS IMPORTS SETTINGS BUILD CONAN_COMMAND)
   cmake_parse_arguments(ARGUMENTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
 endmacro()
@@ -315,7 +315,11 @@
     if(ARGUMENTS_UPDATE)
       set(CONAN_INSTALL_UPDATE --update)
     endif()
-    set(conan_args install ${CONANFILE} ${settings} ${CONAN_BUILD_POLICY} ${CONAN_INSTALL_UPDATE} ${CONAN_OPTIONS})
+    set(CONAN_INSTALL_FOLDER "")
+    if(ARGUMENTS_INSTALL_FOLDER)
+      set(CONAN_INSTALL_FOLDER -if ${ARGUMENTS_INSTALL_FOLDER})
+    endif()
+    set(conan_args install ${CONANFILE} ${settings} ${CONAN_BUILD_POLICY} ${CONAN_INSTALL_UPDATE} ${CONAN_OPTIONS} ${CONAN_INSTALL_FOLDER})

     string (REPLACE ";" " " _conan_args "${conan_args}")
     message(STATUS "Conan executing: ${conan_command} ${_conan_args}")


Use file COPY

Use file COPY

--- math/minuit2/copy_standalone.cmake
+++ math/minuit2/copy_standalone.cmake
@@ -33,6 +33,7 @@
     foreach(FILENAME ${ARGN})
         # All paths are relative to master directory
         set(ORIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${ORIGINAL_DIR}/${FILENAME}")
+        set(NEW_DIR_FULL "${CMAKE_CURRENT_SOURCE_DIR}/${NEW_DIR}")
         set(NEW_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${NEW_DIR}/${FILENAME}")

         # Normalize paths
@@ -52,7 +53,7 @@
             endif()

             # Actually do the copy here
-            configure_file("${ORIG_FILE}" "${NEW_FILE}" COPYONLY)
+            file(COPY "${ORIG_FILE}" DESTINATION "${NEW_DIR_FULL}")

             # Allow cleaning with make purge
             set_property(GLOBAL APPEND PROPERTY COPY_STANDALONE_LISTING "${NEW_FILE}")
@@ -63,7 +64,7 @@
             endif()
         endif()
     endforeach()
-    string(REPLACE ";" " " LISTING "${ARGN}")
-    message(STATUS "Copied ${LISTING}")
+    string(REPLACE ";" ", " LISTING "${ARGN}")
+    message(STATUS "Copied to ${NEW_DIR}: ${LISTING}")
 endfunction()


Updated docstrings for __add_boost_test_executable

--- cmake/Modules/MacroAddBoostTestExecutable.cmake
+++ cmake/Modules/MacroAddBoostTestExecutable.cmake
@@ -1,14 +1,14 @@
 # Helper for compiling and testing executables that uses our naming conventions:
 # source file     = ${TEST_NAME}.cpp
 # executable name = ${TEST_NAME}_${TEST_TYPE}
-# test name       = ${TEST_NAME}
+# test name       = ${TEST_NAME}_${TEST_TYPE}
 #
-# Arguments past the last expected one (TEST_NAME) can be used to specify other libraries to link to.
-# If the test links to MPI_LIBRARIES a special test named ${TEST_NAME}_parallel will be generated,
+# Arguments past the last expected one (TEST_TYPE) can be used to specify other libraries to link to.
+# If the test links to MPI_LIBRARIES a special test named ${TEST_NAME}_${TEST_TYPE}_parallel will be generated,
 # that will execute in parallel.
 #
 # Other variables:
-# BOOST_TEST_LOG_OPTIONS specifies the options to pass to the test executables, see `test_* --help` for more informations.
+# BOOST_TEST_LOG_OPTIONS specifies the options to pass to the test executables, see `tests/degree_centrality_unit --help` for more informations.
 # MPIEXEC_NUMPROCS specifies the number of processes to run in parallel.
 macro(__add_boost_test_executable TEST_NAME TEST_TYPE)
     add_executable(


remove STANDALONE message

remove STANDALONE message

--- examples/include.cmake
+++ examples/include.cmake
@@ -30,7 +30,6 @@
 if ("$ENV{GAMS_BUILD}" STREQUAL "")
     # stand alone subproject
     if ("${GAMSPATH}" STREQUAL "")
-        message("STANDALONE: ${CMAKE_CURRENT_SOURCE_DIR}")
         set(BASEPATH "${CMAKE_CURRENT_SOURCE_DIR}/../..")
     else()
         set(BASEPATH "${GAMSPATH}/apifiles")


fix: GIT_REPOSITORY for eigen

fix: GIT_REPOSITORY for eigen

A missing trailing .git of GIT_REPOSITORY is causing
git clone error on centos 6 machine.

--- tensorflow/lite/tools/cmake/modules/eigen.cmake
+++ tensorflow/lite/tools/cmake/modules/eigen.cmake
@@ -21,7 +21,7 @@

 OverridableFetchContent_Declare(
   eigen
-  GIT_REPOSITORY https://gitlab.com/libeigen/eigen
+  GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
   # Sync with tensorflow/third_party/eigen3/workspace.bzl
   GIT_TAG 085c2fc5d53f391afcccce21c45e15f61c827ab1
   # It's not currently (cmake 3.17) possible to shallow clone with a GIT TAG


ENH: by default on windoww internal ITK is used

--- CMake/ImportITK.cmake
+++ CMake/ImportITK.cmake
@@ -1,6 +1,12 @@
 message(STATUS "Importing ITK...")

-option(OTB_USE_EXTERNAL_ITK "Use an outside build of ITK." ON)
+# Use an external version of ITK by default except on windows (ITK is not packaged in OSGeo4W)
+set(DEFAULT_OTB_USE_EXTERNAL_ITK ON)
+if(WIN32)
+   set(DEFAULT_OTB_USE_EXTERNAL_ITK OFF)
+endif()
+
+option(OTB_USE_EXTERNAL_ITK "Use an outside build of ITK." ${DEFAULT_OTB_USE_EXTERNAL_ITK})
 mark_as_advanced(OTB_USE_EXTERNAL_ITK)

 if(OTB_USE_EXTERNAL_ITK)
@@ -20,8 +26,7 @@
     # Add link directories needed to use ITK.
     link_directories(${ITK_LIBRARY_DIRS})
   else()
-        message(FATAL_ERROR
-                  "Cannot build OTB project without ITK.  Please set ITK_DIR or set OTB_USE_EXTERNAL_ITK OFF to use INTERNAL ITK set on OTB/Utilities repository.")
+    message(FATAL_ERROR "Cannot build OTB project without ITK.  Please set ITK_DIR or set OTB_USE_EXTERNAL_ITK OFF to use INTERNAL ITK set on OTB/Utilities repository.")
   endif()

   # Build shared libraries for otb


add note that gtest target might not be created

--- ament_cmake_gtest/cmake/ament_add_gtest.cmake
+++ ament_cmake_gtest/cmake/ament_add_gtest.cmake
@@ -20,6 +20,9 @@
 #
 # Call add_executable(target ARGN), link it against the gtest libraries
 # and register the executable as a test.
+#
+# If gtest is not available the specified target is not being created and
+# therefore the target existence should be checked before being used.
 #
 # :param target: the target name which will also be used as the test name
 # :type target: string


Properly add the Boost_INCLUDE_DIR to the test project(s).

--HG--
branch : v0-8


Update PythonWheel.cmake

Update PythonWheel.cmake

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

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


adapt dynamic lib suffix

adapt dynamic lib suffix

--- cmake/custom/test.cmake
+++ cmake/custom/test.cmake
@@ -40,7 +40,7 @@
         target_link_libraries(
             fortran_test
             xcint_fortran
-            ${PROJECT_BINARY_DIR}/external/lib/libnumgrid.so
+            ${PROJECT_BINARY_DIR}/external/lib/libnumgrid.${_dyn_lib_suffix}
             ${PROJECT_BINARY_DIR}/external/numgrid-build/src/libnumgrid_fortran.a
             )


Fix #20.

Fix #20.


Tweak commentary.

Tweak commentary.

svn path=/trunk/; revision=7084

--- cmake/modules/gcw.cmake
+++ cmake/modules/gcw.cmake
@@ -26,7 +26,10 @@
 # gcw_LINK_FLAGS	  - individual LINK_FLAGS for dynamic gcw device.
 # gcw_TARGETS		  - list of targets which the gcw dynamic device
 # 			    depends on.
-# DRIVERS_LINK_FLAGS	  - list of LINK_FLAGS for all static devices.
+# DRIVERS_LINK_FLAGS	  - list of LINK_FLAGS for case when
+# 			    ENABLE_DYNDRIVERS OFF.  (gcw_TARGETS not included
+#			    since source code used instead of this target
+#			    for ENABLE_DYNDRIVERS OFF.)
 # gcw_SOURCE		  - list of source files other than gcw.c
 if(PLD_gcw)
   if(NOT PKGCONFIG_EXECUTABLE)
@@ -104,7 +107,13 @@
     )
     set(gcw_TARGETS plplotgnome2${LIB_TAG})
   else(ENABLE_DYNDRIVERS)
-    set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${gcw_LINK_FLAGS})
+    # N.B. no gcw_TARGETS here since use appropriate source code (see below)
+    # instead to break circular linking.
+    set(
+    DRIVERS_LINK_FLAGS
+    ${DRIVERS_LINK_FLAGS}
+    ${gcw_LINK_FLAGS}
+    )
     set(gcw_SOURCE
     ${CMAKE_SOURCE_DIR}/bindings/gnome2/lib/plplotcanvas.c
     ${CMAKE_SOURCE_DIR}/bindings/gnome2/lib/gcw-lib.c


Add hunter generator to mingw toolchain

Add hunter generator to mingw toolchain

--- mingw.cmake
+++ mingw.cmake
@@ -17,3 +17,5 @@

 include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake")
 include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake")
+
+set(HUNTER_CMAKE_GENERATOR "MinGW Makefiles")


back to development mode

back to development mode

--- CMake/cmbNucVersion.cmake
+++ CMake/cmbNucVersion.cmake
@@ -1,5 +1,5 @@
 set (rgg_version_major 2)
-set (rgg_version_minor 0)
+set (rgg_version_minor 1)
 set (rgg_version_patch 0)
-set (rgg_version_suffix ) #Devel
+set (rgg_version_suffix Devel) #Devel
 set (rgg_version "${rgg_version_major}.${rgg_version_minor}")


Revert "osx: bundle ITK again, something change in CMake config"

This reverts commit 2a7f44f5f42f42d86c1b73ba05dad9368093a925.  That
commit was a hacky fix and I found a real solution to the problem.

--- projects/apple/tomviz.bundle.cmake
+++ projects/apple/tomviz.bundle.cmake
@@ -2,12 +2,6 @@

 set(CPACK_GENERATOR DragNDrop)
 include(CPack)
-
-if(itk_ENABLED)
-  set(itk_condition_variable 1)
-else()
-  set(itk_condition_variable 0)
-endif()

 install(CODE "
     # Install the app first.
@@ -32,7 +26,7 @@
          USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
          \"${install_location}/lib/python2.7/site-packages/\")

-    if(${itk_condition_variable})
+    if(${itk_ENABLED})
         message(\"Installing ITK\")
         file(INSTALL DESTINATION \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Libraries\"
              USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES


Remove debug output and switch to quiet search for KHR

--- glbinding-config.cmake
+++ glbinding-config.cmake
@@ -7,9 +7,8 @@
 include(CMakeFindDependencyMacro)

 if (NOT TARGET "KHR::KHR")
-    message(STATUS "${CMAKE_CURRENT_LIST_DIR}/cmake")
     list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
-    find_dependency(KHR)
+    find_dependency(KHR QUIET)
 endif ()

 # List of modules


- исправлена компиляция pch через jom

 - исправлена компиляция pch через jom

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@12266 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/pch.cmake
+++ rdo/packages/cmake/trunk/pch.cmake
@@ -13,23 +13,30 @@

 	SET(PCH_FILE_HEADER_IN_SOURCE ${PROJECT_PATH}/${PCH_PATH_LOCAL_INTERNAL}${PCH_FILE_NAME}.h)
 	SET(PCH_BINARY_OUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_FILE_NAME}.pch)
+	SET(PHP_FILE_CPP ${PCH_PATH_LOCAL_INTERNAL}${PCH_FILE_NAME}.cpp)

 	FOREACH(source_file ${SOURCE_FILES})
 		GET_FILENAME_COMPONENT(CPP ${source_file} EXT)
-		IF (${CPP} STREQUAL ".cpp")
-			LIST(FIND NO_PCH_FILES ${source_file} no_pch_index)
-			IF (${no_pch_index} EQUAL -1)
-				SET_SOURCE_FILES_PROPERTIES(${source_file}
-					PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} /Yu${PCH_FILE_HEADER_IN_SOURCE} /Fp${PCH_BINARY_OUT}"
+		IF(${CPP} STREQUAL ".cpp")
+			IF(${source_file} STREQUAL ${PHP_FILE_CPP})
+				SET_SOURCE_FILES_PROPERTIES(${PHP_FILE_CPP}
+					PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} /Yc${PCH_FILE_HEADER_IN_SOURCE} /Fp${PCH_BINARY_OUT}"
 				)
-			ENDIF (${no_pch_index} EQUAL -1)
-		ENDIF (${CPP} STREQUAL ".cpp")
+				SET_SOURCE_FILES_PROPERTIES(${PHP_FILE_CPP}
+					PROPERTIES OBJECT_OUTPUTS ${PCH_BINARY_OUT}
+				)
+			ELSE()
+				LIST(FIND NO_PCH_FILES ${source_file} no_pch_index)
+				IF(${no_pch_index} EQUAL -1)
+					SET_SOURCE_FILES_PROPERTIES(${source_file}
+						PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} /Yu${PCH_FILE_HEADER_IN_SOURCE} /Fp${PCH_BINARY_OUT}"
+					)
+					SET_SOURCE_FILES_PROPERTIES(${source_file}
+						PROPERTIES OBJECT_DEPENDS ${PCH_BINARY_OUT}
+					)
+				ENDIF(${no_pch_index} EQUAL -1)
+			ENDIF()
+		ENDIF()
 	ENDFOREACH(source_file)

-	SET_SOURCE_FILES_PROPERTIES(${PCH_PATH_LOCAL_INTERNAL}${PCH_FILE_NAME}.cpp
-		PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} /Yc${PCH_FILE_HEADER_IN_SOURCE} /Fp${PCH_BINARY_OUT}"
-	)
-
-	SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PCH_BINARY_OUT})
-
 ENDMACRO(ADD_PCH)


Suppressing a cmake warning

Suppressing a cmake warning

--- python_module/cmake/add_python_export_library.cmake
+++ python_module/cmake/add_python_export_library.cmake
@@ -109,11 +109,8 @@
   # Link against boost::python
   target_link_libraries(${TARGET_NAME} ${Boost_LIBRARIES})

-  # On OSX and Linux, the python library must end in the extension .so. Build this
-  # filename here.
-  get_property(PYLIB_OUTPUT_FILE TARGET ${TARGET_NAME} PROPERTY LOCATION)
-  get_filename_component(PYLIB_OUTPUT_NAME ${PYLIB_OUTPUT_FILE} NAME_WE)
-  set(PYLIB_SO_NAME ${PYLIB_OUTPUT_NAME}.so)
+  # On OSX and Linux, the python library must end in the extension .so.
+  set(PYLIB_SO_NAME lib${TARGET_NAME}.so)

   if(APPLE)
     SET(DIST_DIR site-packages)
@@ -130,7 +127,7 @@
   set(PYTHON_LIB_DIR ${CATKIN_DEVEL_PREFIX}/lib/python2.7/${DIST_DIR}/${PYTHON_PACKAGE_NAME})
   add_custom_command(TARGET ${TARGET_NAME}
     POST_BUILD
-    COMMAND mkdir -p ${PYTHON_LIB_DIR} && cp -v ${PYLIB_OUTPUT_FILE} ${PYTHON_LIB_DIR}/${PYLIB_SO_NAME}
+    COMMAND mkdir -p ${PYTHON_LIB_DIR} && cp -v $<TARGET_FILE:${TARGET_NAME}> ${PYTHON_LIB_DIR}/${PYLIB_SO_NAME}
     WORKING_DIRECTORY ${CATKIN_DEVEL_PREFIX}
     COMMENT "Copying library files to python directory" )


added ifort

added ifort

--- Dwarfs/4_Nbody/cmake/Modules/FindIntelCompilers.cmake
+++ Dwarfs/4_Nbody/cmake/Modules/FindIntelCompilers.cmake
@@ -1,19 +1,35 @@

 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/Languages")
 enable_language(ICPC OPTIONAL)
-#enable_language(IFORT OPTIONAL)
+enable_language(IFORT OPTIONAL)

-set(ICPC_FOUND False)
+set(ICPC_FOUND True)
 if (${CMAKE_ICPC_COMPILER} STREQUAL "CMAKE_ICPC_COMPILER-NOTFOUND")
+  set(ICPC_FOUND False)
 else()
+  function(icpc_source)
+    set_source_files_properties(${ARGN} PROPERTIES LANGUAGE ICPC)
+    foreach (file ${ARGN})
+      set_property(SOURCE ${file} APPEND_STRING PROPERTY COMPILE_FLAGS " -I${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_CXX_FLAGS} ")
+    endforeach()
+  endfunction()
   function(icpc_add_executable icpc_target)
     add_executable(${icpc_target} ${ARGN})
-    foreach(file ${ARGN})
-      set_source_files_properties(${file} PROPERTIES LANGUAGE ICPC)
-    endforeach()
     set_target_properties(${icpc_target} PROPERTIES LINKER_LANGUAGE ICPC)
   endfunction()
-  set(ICPC_FOUND True)
+endif()

-  #  function(icpc_copy
+set(IFORT_FOUND True)
+if (${CMAKE_IFORT_COMPILER} STREQUAL "CMAKE_IFORT_COMPILER-NOTFOUND")
+  set(IFORT_FOUND False)
+else()
+  function(ifort_source)
+    set_source_files_properties(${ARGN} PROPERTIES LANGUAGE IFORT)
+  endfunction()
+  function(ifort_add_executable ifort_target)
+    add_executable(${ifort_target} ${ARGN})
+    set_target_properties(${ifort_target} PROPERTIES LINKER_LANGUAGE IFORT)
+  endfunction()
 endif()
+
+


[INTERNAL] Setting package formats on Windows to ZIP only.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@13995 e6417c60-b987-48fd-844e-b20f0fcc1017

--- util/cmake/package.cmake
+++ util/cmake/package.cmake
@@ -50,7 +50,11 @@
     # Archive Packages (.tar & .tar.bz2)
     # ===========================================================================

-    SET(CPACK_GENERATOR "ZIP;TBZ2;DEB")
+    if (WIN32)
+        SET (CPACK_GENERATOR "ZIP")
+    else ()
+        SET (CPACK_GENERATOR "ZIP;TBZ2")
+    endif ()
     if ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE")
       SET(CPACK_PACKAGE_NAME "seqan")
     elseif ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_LIBRARY")


h5py: Upgraded to v2.1.3

h5py: Upgraded to v2.1.3

--- h5py.cmake
+++ h5py.cmake
@@ -15,10 +15,10 @@
 include (numpy)

 external_source (h5py
-    2.1.0
-    h5py-2.1.0.tar.gz
-    a6f0d15cc5e51c322479822f5cc6c1d6
-    http://h5py.googlecode.com/files/h5py-2.1.0.tar.gz)
+    2.1.3
+    h5py-2.1.3.tar.gz
+    afd3c14f763339e186dd9cd24eb2eb74
+    http://h5py.googlecode.com/files)

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


Added optional GLUT/GLUI/ASSIMP/GLPK/OMPL dependencies using the USE_X cmake command line argument

--- CMakeModules/KrisLibraryDependencies.cmake
+++ CMakeModules/KrisLibraryDependencies.cmake
@@ -43,28 +43,34 @@

 # GLUI
-SET(GLUI_ROOT_DIR "${KRISLIBRARY_ROOT}/glui-2.36/src" CACHE PATH "Root of src directory in GLUI Package" FORCE)
-# GLUI
-FIND_PACKAGE(GLUI)
-IF(GLUI_FOUND)
-  MESSAGE("GLUI library found")
-  SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_GLUI=1)
-  SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${GLUI_INCLUDE_DIR} )
-  SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${GLUI_LIBRARY})
-ELSE(GLUI_FOUND)
-  MESSAGE("GLUI library not found, setting HAVE_GLUI=0")
-ENDIF(GLUI_FOUND)
+OPTION(USE_GLUI "Build with GLUI support" ON)
+IF(USE_GLUI)
+  SET(GLUI_ROOT_DIR "${KRISLIBRARY_ROOT}/glui-2.36/src" CACHE PATH "Root of src directory in GLUI Package" FORCE)
+  # GLUI
+  FIND_PACKAGE(GLUI)
+  IF(GLUI_FOUND)
+    MESSAGE("GLUI library found")
+    SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_GLUI=1)
+    SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${GLUI_INCLUDE_DIR} )
+    SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${GLUI_LIBRARY})
+  ELSE(GLUI_FOUND)
+    MESSAGE("GLUI library not found, setting HAVE_GLUI=0")
+  ENDIF(GLUI_FOUND)
+ENDIF(USE_GLUI)

 # GLUT
-FIND_PACKAGE(GLUT)
-IF(GLUT_FOUND)
-  MESSAGE("GLUT library found")
-  SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_GLUT=1)
-  SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${GLUT_INCLUDE_DIR})
-  SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${GLUT_LIBRARIES})
-ELSE(GLUT_FOUND)
-  MESSAGE("GLUT library not found, setting HAVE_GLUT=0")
-ENDIF(GLUT_FOUND)
+OPTION(USE_GLUT "Build with GLUT support" ON)
+IF(USE_GLUT)
+  FIND_PACKAGE(GLUT)
+  IF(GLUT_FOUND)
+    MESSAGE("GLUT library found")
+    SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_GLUT=1)
+    SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${GLUT_INCLUDE_DIR})
+    SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${GLUT_LIBRARIES})
+  ELSE(GLUT_FOUND)
+    MESSAGE("GLUT library not found, setting HAVE_GLUT=0")
+  ENDIF(GLUT_FOUND)
+ENDIF(USE_GLUT)

 # OpenGL
 FIND_PACKAGE(OpenGL REQUIRED)
@@ -72,16 +78,19 @@
 SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${OPENGL_LIBRARIES})

 # GLPK
-SET(GLPK_ROOT "${KRISLIBRARY_ROOT}/glpk-4.52" CACHE PATH "Root of GLPK Package" FORCE)
-FIND_PACKAGE(GLPK)
-IF(GLPK_FOUND)
-  MESSAGE("GLPK library found")
-  SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_GLPK=1)
-  SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${GLPK_INCLUDE_DIR})
-  SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${GLPK_LIBRARY})
-ELSE(GLPK_FOUND)
-  MESSAGE("GLPK library not found, setting HAVE_GLPK=0")
-ENDIF(GLPK_FOUND)
+OPTION(USE_GLPK "Build with GLPK support" ON)
+IF(USE_GLPK)
+  SET(GLPK_ROOT "${KRISLIBRARY_ROOT}/glpk-4.52" CACHE PATH "Root of GLPK Package" FORCE)
+  FIND_PACKAGE(GLPK)
+  IF(GLPK_FOUND)
+    MESSAGE("GLPK library found")
+    SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_GLPK=1)
+    SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${GLPK_INCLUDE_DIR})
+    SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${GLPK_LIBRARY})
+  ELSE(GLPK_FOUND)
+    MESSAGE("GLPK library not found, setting HAVE_GLPK=0")
+  ENDIF(GLPK_FOUND)
+ENDIF(USE_GLPK)

 # TinyXML
 SET(TINYXML_ROOT "${KRISLIBRARY_ROOT}/tinyxml"
@@ -99,31 +108,38 @@
 ENDIF(TINYXML_FOUND)

 # Assimp
-SET(ASSIMP_ROOT "${KRISLIBRARY_ROOT}/assimp--3.0.1270-sdk"
-   CACHE PATH
-   "Root of Assimp package"
-   FORCE
-)
-FIND_PACKAGE(Assimp)
-IF(ASSIMP_FOUND)
-  MESSAGE("Assimp library found")
-  SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_ASSIMP=1 ${ASSIMP_DEFINITIONS})
-  SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${ASSIMP_INCLUDE_DIR})
-  SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${ASSIMP_LIBRARY})
-ELSE(ASSIMP_FOUND)
-  MESSAGE("Assimp library not found, setting HAVE_ASSIMP=0")
-ENDIF(ASSIMP_FOUND)
+OPTION(USE_ASSIMP "Build with ASSIMP support" ON)
+IF(USE_ASSIMP)
+  SET(ASSIMP_ROOT "${KRISLIBRARY_ROOT}/assimp--3.0.1270-sdk"
+     CACHE PATH
+     "Root of Assimp package"
+     FORCE
+  )
+  FIND_PACKAGE(Assimp)
+  IF(ASSIMP_FOUND)
+    MESSAGE("Assimp library found")
+    SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_ASSIMP=1 ${ASSIMP_DEFINITIONS})
+    SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${ASSIMP_INCLUDE_DIR})
+    SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${ASSIMP_LIBRARY})
+  ELSE(ASSIMP_FOUND)
+    MESSAGE("Assimp library not found, setting HAVE_ASSIMP=0")
+  ENDIF(ASSIMP_FOUND)
+ENDIF(USE_ASSIMP)

 # Open Motion Planning Library
-FIND_PACKAGE(OMPL)
-IF(OMPL_FOUND)
-  MESSAGE("OMPL library found")
-  SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_OMPL=1)
-  SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${OMPL_INCLUDE_DIR})
-  SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${OMPL_LIBRARIES})
-ELSE(OMPL_FOUND)
-  MESSAGE("OMPL library not found, setting HAVE_OMPL=0")
-ENDIF(OMPL_FOUND)
+
+OPTION(USE_OMPL "Build with OMPL support" OFF)
+IF(USE_OMPL)
+  FIND_PACKAGE(OMPL)
+  IF(OMPL_FOUND)
+    MESSAGE("OMPL library found")
+    SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_OMPL=1)
+    SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${OMPL_INCLUDE_DIR})
+    SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${OMPL_LIBRARIES})
+  ELSE(OMPL_FOUND)
+    MESSAGE("OMPL library not found, setting HAVE_OMPL=0")
+  ENDIF(OMPL_FOUND)
+ENDIF(USE_OMPL)

 IF(WIN32)
   SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DNOMINMAX -DGLUI_NO_LIB_PRAGMA)


Small fix for OS X cmake config

Small fix for OS X cmake config

--- toolchains/darwin.cmake
+++ toolchains/darwin.cmake
@@ -42,15 +42,13 @@
     find_library(IOKIT_FRAMEWORK IOKit)
     find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
     find_library(CORE_VIDEO_FRAMEWORK CoreVideo)
-    find_library(GLFW glfw3)

     list(APPEND GLFW_LIBRARIES
         ${OPENGL_FRAMEWORK}
         ${COCOA_FRAMEWORK}
         ${IOKIT_FRAMEWORK}
         ${CORE_FOUNDATION_FRAMEWORK}
-        ${CORE_VIDEO_FRAMEWORK}
-        ${GLFW})
+        ${CORE_VIDEO_FRAMEWORK})

     target_link_libraries(${EXECUTABLE_NAME} -lcurl) #use system libcurl
     target_link_libraries(${EXECUTABLE_NAME} core ${GLFW_LIBRARIES})


consider clang 3.3 as non-experimental now, only few days remaining until release

--- test.cmake
+++ test.cmake
@@ -148,7 +148,7 @@
 elseif(COMPILER_VERSION MATCHES "Open64")
    set(compiler "Open64")
 endif()
-if(COMPILER_VERSION MATCHES "\\((experimental|prerelease)\\)" OR COMPILER_VERSION MATCHES "clang version 3.3")
+if(COMPILER_VERSION MATCHES "\\((experimental|prerelease)\\)" OR COMPILER_VERSION MATCHES "clang version 3.4")
    set(compiler "experimental")
 endif()


[cmake] search for tesh in ${SimGrid_PATH}/bin

--- tools/cmake/Tests.cmake
+++ tools/cmake/Tests.cmake
@@ -1,5 +1,4 @@
-
-find_program(TESH_COMMAND tesh PATHS /opt/simgrid/bin ENV PATH)
+find_program(TESH_COMMAND tesh PATHS /opt/simgrid/bin ENV PATH ${SimGrid_PATH}/bin)

 if(NOT TESH_COMMAND)
     message(FATAL_ERROR "Tesh not found! Please reinstall Simgrid with Tesh activated.")


add c++11 to performance tests (#92)

add c++11 to performance tests (#92)

Builds in environments where the C++11 standard is not enabled by default
encounter problems building the performance tests in the `bench` target.
This change adds C++11 to the compilation flags for performance tests so
that they can be built without issue.

This fixes #91, which can be referenced for more details.

Co-authored-by: Aravind Padmanabhan <98fce83ca112b2e5fa925457ab41cd3b46a083c1@netcore.co.in>

--- tools/cmake/test.cmake
+++ tools/cmake/test.cmake
@@ -6,6 +6,7 @@
   set(function_test_compile_flags "-D_CRT_SECURE_NO_WARNINGS -DGTEST_LINKED_AS_SHARED_LIBRARY=1")
 else()
   set(function_test_compile_flags "-std=gnu++11 -DGTEST_LINKED_AS_SHARED_LIBRARY=1")
+  set(performance_test_compile_flags "-std=c++11")
 endif(MSVC)

 function(private_add_function_test)
@@ -79,6 +80,7 @@

   set_target_properties(performance-test-${FUNCTION_PERF_ARG_NAME}
     PROPERTIES
+    COMPILE_FLAGS "${performance_test_compile_flags}"
     OUTPUT_NAME performance-test-${FUNCTION_PERF_ARG_NAME}
   )


Fixing warning C4702: unreachable code

Fixing warning C4702: unreachable code

--- modules/fmt.cmake
+++ modules/fmt.cmake
@@ -5,7 +5,8 @@
   list(FILTER SOURCE_FILES EXCLUDE REGEX ".*/fmt.cc")
   add_library(fmt ${SOURCE_FILES})
   if(MSVC)
-    set_target_properties(fmt PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}")
+    # C4702: unreachable code
+    set_target_properties(fmt PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} /wd4702")
   else()
     set_target_properties(fmt PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} -Wno-shadow")
   endif()


Do not limit number of link jobs on Azure

--- azure.cmake
+++ azure.cmake
@@ -81,8 +81,6 @@
     BUILD_EXAMPLES:BOOL=OFF
     BUILD_SHARED_LIBS:BOOL=OFF
     BUILD_TESTING:BOOL=ON
-    CMAKE_JOB_POOLS:STRING=link=1
-    CMAKE_JOB_POOL_LINK:STRING=link
     SimpleITK_EXPLICIT_INSTANTIATION:BOOL=OFF

     WRAP_DEFAULT:BOOL=OFF


define _GNU_SOURCE

define _GNU_SOURCE

--- flags.cmake
+++ flags.cmake
@@ -1,4 +1,4 @@
-add_definitions(-g -funwind-tables -ffast-math)
+add_definitions(-g -funwind-tables -ffast-math -D_GNU_SOURCE)
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
 if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")


Update the boost versions to look for.

Update the boost versions to look for.

--HG--
branch : v1-7


ExternalData: Do not re-stage staged object files

The ExternalData_LINK_CONTENT option tells ExternalData to convert real
data files it finds into content links and to "stage" the original
content in a ".ExternalData_<algo>_<hash>" file.  However, after a data
object has been staged it is possible that a user-provided pattern in
the "REGEX:" option will later match the staged object file.  We must
not process staged object files even when a user pattern matches them.

Fix the implementation to not match a staged object file as a normal
data file for conversion.

Change-Id: Ie9340855e0b1af93bfeae284805339b8ee8e0295

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -569,7 +569,10 @@
       set(relname "${entry}")
       set(alg "")
     endif()
-    if("x${relname}" MATCHES "^x${regex}$" AND NOT IS_DIRECTORY "${top_src}/${entry}")
+    if("x${relname}" MATCHES "^x${regex}$" # matches
+        AND NOT IS_DIRECTORY "${top_src}/${entry}" # not a directory
+        AND NOT "x${relname}" MATCHES "(^x|/)\\.ExternalData_" # not staged obj
+        )
       set(name "${top_src}/${relname}")
       set(file "${top_bin}/${relname}")
       if(alg)