added: SEQAN_C++11_STANDARD option

added: SEQAN_C++11_STANDARD option

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

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -1,6 +1,21 @@
 # ===========================================================================
 # FindSeqAn.cmake -- Utilities for building SeqAn applications.
 # ===========================================================================
+
+# ---------------------------------------------------------------------------
+# Options
+# ---------------------------------------------------------------------------
+
+# Use c++11 standard for compilation
+option (SEQAN_C++11_STANDARD "Use the c++11 standard for compilation." OFF)
+if (SEQAN_C++11_STANDARD)
+  if (APPLE)
+    set (CMAKE_XCODE_ATTRIBUTE_GCC_VERSION com.apple.compilers.llvm.clang.macports CACHE STRING "" FORCE)
+  endif (APPLE)
+  if (UNIX)
+    list (APPEND CMAKE_CXX_FLAGS -std=c++0x)
+  endif (UNIX)
+endif (SEQAN_C++11_STANDARD)

 # ---------------------------------------------------------------------------
 # Macro seqan_workshop_instrumentation_cmake ()
@@ -31,7 +46,7 @@
 macro (seqan_instrumentation_target TARGET)
 	if(SEQAN_INSTRUMENTATION)
 	    add_dependencies(${TARGET} seqan_instrumentation_build)
-
+
 	    if(CMAKE_HOST_WIN32)
 	      add_custom_command(TARGET ${TARGET}
 	                         PRE_BUILD


modify util.cmake

modify util.cmake

--- mk/util.cmake
+++ mk/util.cmake
@@ -47,7 +47,7 @@
         add_definitions(-DIOS_USER_MODE)
         message("ios Platform")
     elseif ("${PLATFORM}" STREQUAL "linux")
-        include (mk/ios.cmake)
+        include (mk/linux.cmake)
         add_definitions(-DLINUX_USER_MODE)
         message("linux Platform")
     else ()


Removed unused variable.

Removed unused variable.

--- cmake/Findcodecov.cmake
+++ cmake/Findcodecov.cmake
@@ -83,8 +83,6 @@
 # Find the reuired flags foreach language.
 set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
 set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY})
-
-set(_COVERAGE_ENABLED_LANGUAGES)

 get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
 foreach (LANG ${ENABLED_LANGUAGES})
@@ -128,7 +126,6 @@
 				set(COVERAGE_${LANG}_FLAGS "${FLAG}"
 					CACHE STRING "${LANG} compiler flags for code coverage.")
 				mark_as_advanced(COVERAGE_${LANG}_FLAGS)
-				list(APPEND _COVERAGE_ENABLED_LANGUAGES ${LANG})
 				break()
 			endif ()
 		endforeach ()


Fix warnings about MT vs. MD options with MSVC. (#1285)

MSVC has different runtime support libraries for static vs. dynamically
linked programs. Because gRPC does not support shared libraries on
Windows, we must link statically when we use gRPC. But adding the "use
static runtime" option (/MT or /MTd) creates a warning because the "use
dynamic runtime" option is already in the command-line. The solution is
to *replace* the option instead.

--- cmake/IncludeGrpc.cmake
+++ cmake/IncludeGrpc.cmake
@@ -125,11 +125,25 @@
                 "Expected protobuf::libprotobuf target created by FindProtobuf")
     endif ()

-    if (VCPKG_TARGET_TRIPLET MATCHES "-static$")
+    if (VCPKG_TARGET_TRIPLET MATCHES "-static$" AND MSVC)
+        # Replace the runtime flags because all the dependencies are linked
+        # statically in this case.
         message(STATUS " RELEASE=${CMAKE_CXX_FLAGS_RELEASE}")
         message(STATUS " DEBUG=${CMAKE_CXX_FLAGS_DEBUG}")
-        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
-        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+        foreach (flag_var
+                 CMAKE_CXX_FLAGS
+                 CMAKE_CXX_FLAGS_DEBUG
+                 CMAKE_CXX_FLAGS_RELEASE
+                 CMAKE_CXX_FLAGS_MINSIZEREL
+                 CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+            if (${flag_var} MATCHES "/MD")
+                string(REGEX
+                       REPLACE "/MD"
+                               "/MT"
+                               ${flag_var}
+                               "${${flag_var}}")
+            endif ()
+        endforeach (flag_var)
         message(STATUS " RELEASE=${CMAKE_CXX_FLAGS_RELEASE}")
         message(STATUS " DEBUG=${CMAKE_CXX_FLAGS_DEBUG}")
         message(STATUS " DEFAULT=${CMAKE_CXX_FLAGS}")


Test out a method of determining the gnat version from the CMAKE_Ada_COMPILER variable to ensure we look for the right version of libgnat.

svn path=/trunk/; revision=12119

--- cmake/modules/ada.cmake
+++ cmake/modules/ada.cmake
@@ -43,7 +43,13 @@
 endif(ENABLE_ada)

 if(ENABLE_ada)
-  find_library(GNAT_LIB NAMES gnat gnat-4.5 gnat-4.4 gnat-4.3 gnat-4.2 gnat-4.1)
+  # Find the gnat version used in order to search for the right version of libgnat
+  execute_process(COMMAND ${CMAKE_Ada_COMPILER} --version OUTPUT_VARIABLE ADA_OUTPUT)
+  string(REGEX MATCH "gnatgcc [(][^)]*[)] ([0-9]*[.][0-9]*)[.][0-9]" ADA_OUTPUT_TRIM ${ADA_OUTPUT})
+  set(GNATVERSION ${CMAKE_MATCH_1})
+  message(STATUS "DEBUG: gnat output ${ADA_OUTPUT}")
+  message(STATUS "DEBUG: gnat version ${GNATVERSION}")
+  find_library(GNAT_LIB NAMES gnat gnat-${GNATVERSION})
   if(NOT GNAT_LIB)
     message(STATUS "WARNING: "
       "gnat library not found. Disabling ada bindings")


set RELEASE_OUTPUT_NAME for executables on Windows

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

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -187,7 +187,9 @@
     #
     # Only link if needed
     if(WIN32 AND MSVC)
-      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX})
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF
+                                                DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX}
+                                                RELEASE_OUTPUT_NAME ${_name}${CMAKE_RELEASE_POSTFIX})
     elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
     elseif(__COMPILER_PATHSCALE)
@@ -227,7 +229,9 @@
     #
     # Only link if needed
     if(WIN32 AND MSVC)
-      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX})
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF
+                                                DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX}
+                                                RELEASE_OUTPUT_NAME ${_name}${CMAKE_RELEASE_POSTFIX})
     elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
     elseif(__COMPILER_PATHSCALE)
@@ -267,7 +271,9 @@
     #
     # Only link if needed
     if(WIN32 AND MSVC)
-      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX})
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF
+                                                DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX}
+                                                RELEASE_OUTPUT_NAME ${_name}${CMAKE_RELEASE_POSTFIX})
     elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
     else()


cmake: fix issue with fail at build time

Fix issue that next build retry does not succeed once the requirement is
satisfied.

--- tools/cmake/utilities.cmake
+++ tools/cmake/utilities.cmake
@@ -201,9 +201,15 @@
     foreach(message_line ${ARGN})
         set(message_lines ${message_lines} COMMAND ${CMAKE_COMMAND} -E echo "${message_line}")
     endforeach()
+    # Generate a timestamp file that gets included. When deleted on build, this forces CMake
+    # to rerun.
+    string(RANDOM filename)
+    set(filename "${CMAKE_CURRENT_BINARY_DIR}/${filename}.cmake")
+    file(WRITE "${filename}" "")
+    include("${filename}")
     add_custom_target(${target_name} ALL
         ${message_lines}
-        COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_BINARY_DIR}/CMakeCache.txt"
+        COMMAND ${CMAKE_COMMAND} -E remove "${filename}"
         COMMAND ${CMAKE_COMMAND} -P ${idf_path}/tools/cmake/scripts/fail.cmake
         VERBATIM)
 endfunction()


New version: 0.4.10

New version: 0.4.10

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "9")
+SET(HAWKEY_PATCH "10")


[FindIPOPT.cmake] synch with YCM 0.4.0

[FindIPOPT.cmake] synch with YCM 0.4.0

In particular, add the workaround for https://github.com/robotology/icub-main/issues/418 , that should solve https://github.com/robotology/idyntree/issues/329 as well

--- cmake/FindIPOPT.cmake
+++ cmake/FindIPOPT.cmake
@@ -8,8 +8,8 @@
 # if this fails then try to locate the library in the directory pointed by
 # the IPOPT_DIR enviromental variable.
 #
-# On Windows systems,  just try to find the library using the IPOPT_DIR
-# enviromental variable.
+# On Windows systems,  just try to find the library using the IPOPT_DIR
+# enviromental variable.
 #
 # Create the following variables::
 #
@@ -60,7 +60,10 @@
         find_library(${_LIBRARY}_PATH
                      NAMES ${_LIBRARY}
                      PATHS ${_PC_IPOPT_LIBRARY_DIRS})
-        list(APPEND IPOPT_LIBRARIES ${${_LIBRARY}_PATH})
+        # Workaround for https://github.com/robotology/icub-main/issues/418
+        if(${_LIBRARY}_PATH)
+          list(APPEND IPOPT_LIBRARIES ${${_LIBRARY}_PATH})
+        endif()
       endforeach()
     else()
       set(IPOPT_DEFINITIONS "")
@@ -142,12 +145,7 @@
   # libraries embedded in the library, newer releases require them to
   # be explicitly linked.
   if(IPOPT_IPOPT_LIBRARY)
-    # FIXME Remove this check when CMake 2.8.11 or later is required
-    if(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
-      get_filename_component(_MSVC_BINDIR "${CMAKE_LINKER}" PATH)
-    else()
-      get_filename_component(_MSVC_DIR "${CMAKE_LINKER}" DIRECTORY)
-    endif()
+    get_filename_component(_MSVC_DIR "${CMAKE_LINKER}" DIRECTORY)

     # Find the lib.exe executable
     find_program(LIB_EXECUTABLE
@@ -200,12 +198,7 @@
     unset(_path)

     if(NOT "${_lib_output}" MATCHES "libifcoremd.dll")
-      # FIXME Remove this check when CMake 2.8.11 or later is required
-      if(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
-        get_filename_component(_IPOPT_IPOPT_LIBRARY_DIR "${_IPOPT_LIB}" PATH)
-      else()
-        get_filename_component(_IPOPT_IPOPT_LIBRARY_DIR "${_IPOPT_LIB}" DIRECTORY)
-      endif()
+      get_filename_component(_IPOPT_IPOPT_LIBRARY_DIR "${_IPOPT_LIB}" DIRECTORY)

       foreach(_lib ifconsol
                    libifcoremd


Copy latest changes from mysql connector library

--- cmake/FindMySQL.cmake
+++ cmake/FindMySQL.cmake
@@ -24,7 +24,11 @@
             NAMES mysql_version.h
             PATH_SUFFIXES mysql
         )
-        find_library(MySQL_LIBRARY NAMES mysqlclient mysqlclient_r)
+        find_library(MySQL_LIBRARY
+            NAMES mysqlclient mysqlclient_r
+            PATH_SUFFIXES mysql  # for CentOS 7
+        )
+
 endif()

 include(FindPackageHandleStandardArgs)


Polish code

Polish code

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -115,7 +115,7 @@
         set(ENV{CUDNN_INCLUDE_DIR} ${CUDNN_INCLUDE_DIR})
         get_filename_component(CUDNN_LIBRARY_DIR ${CUDNN_LIBRARY} DIRECTORY)
         set(ENV{CUDNN_LIBRARY} ${CUDNN_LIBRARY_DIR})
-        message(STATUS "Set Anakin CUDNN_LIBRARY_DIR:" ${CUDNN_LIBRARY_DIR})
+        message(STATUS "Set Anakin build arg, CUDNN_LIBRARY_DIR: " ${CUDNN_LIBRARY_DIR})
     endif()
 elseif(WITH_AMD_GPU)
     add_definitions(-DPADDLE_WITH_HIP)


Fixed #582

Fixed #582

--- cmake/sanitizer.cmake
+++ cmake/sanitizer.cmake
@@ -4,67 +4,70 @@
 set(ALLOWED_BUILD_TYPES Debug Release RelWithDebInfo MinSizeRel)
 set(ALL_SAN_FLAGS "")

-# Thread sanitizer
-set(THREAD_SAN_FLAGS "-fsanitize=thread")
-set(PREV_FLAG ${CMAKE_REQUIRED_FLAGS})
-set(CMAKE_REQUIRED_FLAGS "${THREAD_SAN_FLAGS}")
-check_cxx_source_runs("int main() { return 0; }" THREAD_SANITIZER_AVAILABLE)
-set(CMAKE_REQUIRED_FLAGS ${PREV_FLAG})
-if(THREAD_SANITIZER_AVAILABLE)
-    list(APPEND ALLOWED_BUILD_TYPES ThreadSan)
-    # Do not add Thread sanitizer to all sanitizer because it is incompatible with other sanitizer
+ # No sanitizers when cross compiling to prevent stuff like this: https://github.com/whoshuu/cpr/issues/582
+if(NOT CMAKE_CROSSCOMPILING)
+    # Thread sanitizer
+    set(THREAD_SAN_FLAGS "-fsanitize=thread")
+    set(PREV_FLAG ${CMAKE_REQUIRED_FLAGS})
+    set(CMAKE_REQUIRED_FLAGS "${THREAD_SAN_FLAGS}")
+    check_cxx_source_runs("int main() { return 0; }" THREAD_SANITIZER_AVAILABLE)
+    set(CMAKE_REQUIRED_FLAGS ${PREV_FLAG})
+    if(THREAD_SANITIZER_AVAILABLE)
+        list(APPEND ALLOWED_BUILD_TYPES ThreadSan)
+        # Do not add Thread sanitizer to all sanitizer because it is incompatible with other sanitizer
+    endif()
+    set(CMAKE_C_FLAGS_THREADSAN "${CMAKE_C_FLAGS_DEBUG} ${THREAD_SAN_FLAGS}" CACHE INTERNAL "Flags used by the C compiler during thread sanitizer builds." FORCE)
+    set(CMAKE_CXX_FLAGS_THREADSAN "${CMAKE_CXX_FLAGS_DEBUG} ${THREAD_SAN_FLAGS}" CACHE INTERNAL "Flags used by the C++ compiler during thread sanitizer builds." FORCE)
+    set(CMAKE_SHARED_LINKER_FLAGS_THREADSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during thread sanitizer builds" FORCE)
+
+    # Address sanitizer
+    set(ADDR_SAN_FLAGS "-fsanitize=address")
+    set(PREV_FLAG ${CMAKE_REQUIRED_FLAGS})
+    set(CMAKE_REQUIRED_FLAGS "${ADDR_SAN_FLAGS}")
+    check_cxx_source_runs("int main() { return 0; }" ADDRESS_SANITIZER_AVAILABLE)
+    set(CMAKE_REQUIRED_FLAGS ${PREV_FLAG})
+    if(ADDRESS_SANITIZER_AVAILABLE)
+        list(APPEND ALLOWED_BUILD_TYPES AddrSan)
+        set(ALL_SAN_FLAGS "${ALL_SAN_FLAGS} ${ADDR_SAN_FLAGS}")
+    endif()
+    set(CMAKE_C_FLAGS_ADDRSAN "${CMAKE_C_FLAGS_DEBUG} ${ADDR_SAN_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE INTERNAL "Flags used by the C compiler during address sanitizer builds." FORCE)
+    set(CMAKE_CXX_FLAGS_ADDRSAN "${CMAKE_CXX_FLAGS_DEBUG} ${ADDR_SAN_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE INTERNAL "Flags used by the C++ compiler during address sanitizer builds." FORCE)
+    set(CMAKE_SHARED_LINKER_FLAGS_ADDRSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during address sanitizer builds" FORCE)
+
+    # Leak sanitizer
+    set(LEAK_SAN_FLAGS "-fsanitize=leak")
+    check_cxx_compiler_flag(${LEAK_SAN_FLAGS} LEAK_SANITIZER_AVAILABLE)
+    if(LEAK_SANITIZER_AVAILABLE)
+        list(APPEND ALLOWED_BUILD_TYPES LeakSan)
+        set(ALL_SAN_FLAGS "${ALL_SAN_FLAGS} ${LEAK_SAN_FLAGS}")
+    endif()
+    set(CMAKE_C_FLAGS_LEAKSAN "${CMAKE_C_FLAGS_DEBUG} ${LEAK_SAN_FLAGS} -fno-omit-frame-pointer" CACHE INTERNAL "Flags used by the C compiler during leak sanitizer builds." FORCE)
+    set(CMAKE_CXX_FLAGS_LEAKSAN "${CMAKE_CXX_FLAGS_DEBUG} ${LEAK_SAN_FLAGS} -fno-omit-frame-pointer" CACHE INTERNAL "Flags used by the C++ compiler during leak sanitizer builds." FORCE)
+    set(CMAKE_SHARED_LINKER_FLAGS_LEAKSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during leak sanitizer builds" FORCE)
+
+    # Undefined behavior sanitizer
+    set(UDEF_SAN_FLAGS "-fsanitize=undefined")
+    check_cxx_compiler_flag(${UDEF_SAN_FLAGS} UNDEFINED_BEHAVIOUR_SANITIZER_AVAILABLE)
+    if(UNDEFINED_BEHAVIOUR_SANITIZER_AVAILABLE)
+        list(APPEND ALLOWED_BUILD_TYPES UdefSan)
+        set(ALL_SAN_FLAGS "${ALL_SAN_FLAGS} ${UDEF_SAN_FLAGS}")
+    endif()
+    set(CMAKE_C_FLAGS_UDEFSAN "${CMAKE_C_FLAGS_DEBUG} ${UDEF_SAN_FLAGS}" CACHE INTERNAL "Flags used by the C compiler during undefined behaviour sanitizer builds." FORCE)
+    set(CMAKE_CXX_FLAGS_UDEFSAN "${CMAKE_CXX_FLAGS_DEBUG} ${UDEF_SAN_FLAGS}" CACHE INTERNAL "Flags used by the C++ compiler during undefined behaviour sanitizer builds." FORCE)
+    set(CMAKE_SHARED_LINKER_FLAGS_UDEFSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during undefined behaviour sanitizer builds" FORCE)
+
+    # All sanitizer (without thread sanitizer)
+    if(NOT ALL_SAN_FLAGS STREQUAL "")
+        set(PREV_FLAG ${CMAKE_REQUIRED_FLAGS})
+        set(CMAKE_REQUIRED_FLAGS "${ALL_SAN_FLAGS}")
+        check_cxx_source_runs("int main() { return 0; }" ALL_SANITIZERS_AVAILABLE)
+        set(CMAKE_REQUIRED_FLAGS ${PREV_FLAG})
+        if(ALL_SANITIZERS_AVAILABLE)
+            list(APPEND ALLOWED_BUILD_TYPES AllSan)
+        endif()
+    endif()
+
+    set(CMAKE_C_FLAGS_ALLSAN "${CMAKE_C_FLAGS_DEBUG} ${ALL_SAN_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE INTERNAL "Flags used by the C compiler during most possible sanitizer builds." FORCE)
+    set(CMAKE_CXX_FLAGS_ALLSAN "${CMAKE_CXX_FLAGS_DEBUG} ${ALL_SAN_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE INTERNAL "Flags used by the C++ compiler during most possible sanitizer builds." FORCE)
+    set(CMAKE_SHARED_LINKER_FLAGS_ALLSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during most possible sanitizer builds" FORCE)
 endif()
-set(CMAKE_C_FLAGS_THREADSAN "${CMAKE_C_FLAGS_DEBUG} ${THREAD_SAN_FLAGS}" CACHE INTERNAL "Flags used by the C compiler during thread sanitizer builds." FORCE)
-set(CMAKE_CXX_FLAGS_THREADSAN "${CMAKE_CXX_FLAGS_DEBUG} ${THREAD_SAN_FLAGS}" CACHE INTERNAL "Flags used by the C++ compiler during thread sanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_THREADSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during thread sanitizer builds" FORCE)
-
-# Address sanitizer
-set(ADDR_SAN_FLAGS "-fsanitize=address")
-set(PREV_FLAG ${CMAKE_REQUIRED_FLAGS})
-set(CMAKE_REQUIRED_FLAGS "${ADDR_SAN_FLAGS}")
-check_cxx_source_runs("int main() { return 0; }" ADDRESS_SANITIZER_AVAILABLE)
-set(CMAKE_REQUIRED_FLAGS ${PREV_FLAG})
-if(ADDRESS_SANITIZER_AVAILABLE)
-    list(APPEND ALLOWED_BUILD_TYPES AddrSan)
-    set(ALL_SAN_FLAGS "${ALL_SAN_FLAGS} ${ADDR_SAN_FLAGS}")
-endif()
-set(CMAKE_C_FLAGS_ADDRSAN "${CMAKE_C_FLAGS_DEBUG} ${ADDR_SAN_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE INTERNAL "Flags used by the C compiler during address sanitizer builds." FORCE)
-set(CMAKE_CXX_FLAGS_ADDRSAN "${CMAKE_CXX_FLAGS_DEBUG} ${ADDR_SAN_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE INTERNAL "Flags used by the C++ compiler during address sanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_ADDRSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during address sanitizer builds" FORCE)
-
-# Leak sanitizer
-set(LEAK_SAN_FLAGS "-fsanitize=leak")
-check_cxx_compiler_flag(${LEAK_SAN_FLAGS} LEAK_SANITIZER_AVAILABLE)
-if(LEAK_SANITIZER_AVAILABLE)
-    list(APPEND ALLOWED_BUILD_TYPES LeakSan)
-    set(ALL_SAN_FLAGS "${ALL_SAN_FLAGS} ${LEAK_SAN_FLAGS}")
-endif()
-set(CMAKE_C_FLAGS_LEAKSAN "${CMAKE_C_FLAGS_DEBUG} ${LEAK_SAN_FLAGS} -fno-omit-frame-pointer" CACHE INTERNAL "Flags used by the C compiler during leak sanitizer builds." FORCE)
-set(CMAKE_CXX_FLAGS_LEAKSAN "${CMAKE_CXX_FLAGS_DEBUG} ${LEAK_SAN_FLAGS} -fno-omit-frame-pointer" CACHE INTERNAL "Flags used by the C++ compiler during leak sanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_LEAKSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during leak sanitizer builds" FORCE)
-
-# Undefined behavior sanitizer
-set(UDEF_SAN_FLAGS "-fsanitize=undefined")
-check_cxx_compiler_flag(${UDEF_SAN_FLAGS} UNDEFINED_BEHAVIOUR_SANITIZER_AVAILABLE)
-if(UNDEFINED_BEHAVIOUR_SANITIZER_AVAILABLE)
-    list(APPEND ALLOWED_BUILD_TYPES UdefSan)
-    set(ALL_SAN_FLAGS "${ALL_SAN_FLAGS} ${UDEF_SAN_FLAGS}")
-endif()
-set(CMAKE_C_FLAGS_UDEFSAN "${CMAKE_C_FLAGS_DEBUG} ${UDEF_SAN_FLAGS}" CACHE INTERNAL "Flags used by the C compiler during undefined behaviour sanitizer builds." FORCE)
-set(CMAKE_CXX_FLAGS_UDEFSAN "${CMAKE_CXX_FLAGS_DEBUG} ${UDEF_SAN_FLAGS}" CACHE INTERNAL "Flags used by the C++ compiler during undefined behaviour sanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_UDEFSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during undefined behaviour sanitizer builds" FORCE)
-
-# All sanitizer (without thread sanitizer)
-if(NOT ALL_SAN_FLAGS STREQUAL "")
-    set(PREV_FLAG ${CMAKE_REQUIRED_FLAGS})
-    set(CMAKE_REQUIRED_FLAGS "${ALL_SAN_FLAGS}")
-    check_cxx_source_runs("int main() { return 0; }" ALL_SANITIZERS_AVAILABLE)
-    set(CMAKE_REQUIRED_FLAGS ${PREV_FLAG})
-    if(ALL_SANITIZERS_AVAILABLE)
-        list(APPEND ALLOWED_BUILD_TYPES AllSan)
-    endif()
-endif()
-
-set(CMAKE_C_FLAGS_ALLSAN "${CMAKE_C_FLAGS_DEBUG} ${ALL_SAN_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE INTERNAL "Flags used by the C compiler during most possible sanitizer builds." FORCE)
-set(CMAKE_CXX_FLAGS_ALLSAN "${CMAKE_CXX_FLAGS_DEBUG} ${ALL_SAN_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE INTERNAL "Flags used by the C++ compiler during most possible sanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_ALLSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Flags used for the linker during most possible sanitizer builds" FORCE)


Don't explicitly link Python on OS X

Don't explicitly link Python on OS X

Explicitly linking to a Python framework on OS X prevents modules from
being built against one Python (i.e. system python) and imported from
another (i.e. Homebrew python); the interpreter segfaults if there's a
linkage to a foreign Python. Building the module with `-undefined
dynamic_lookup` instead of an explicit link allows the symbols to be
resolved at load time from a compatible python.

--- modules/python/common.cmake
+++ modules/python/common.cmake
@@ -50,7 +50,11 @@
 if(PYTHON_DEBUG_LIBRARIES AND NOT PYTHON_LIBRARIES MATCHES "optimized.*debug")
   ocv_target_link_libraries(${the_module} debug ${PYTHON_DEBUG_LIBRARIES} optimized ${PYTHON_LIBRARIES})
 else()
-  ocv_target_link_libraries(${the_module} ${PYTHON_LIBRARIES})
+  if(APPLE)
+    set_target_properties(${the_module} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+  else()
+    ocv_target_link_libraries(${the_module} ${PYTHON_LIBRARIES})
+  endif()
 endif()
 ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})


flags/sanitize_memory: update C flags too

--- flags/sanitize_memory.cmake
+++ flags/sanitize_memory.cmake
@@ -8,6 +8,11 @@
 endif()

 include(polly_add_cache_flag)
+
 polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=memory")
 polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize-memory-track-origins")
 polly_add_cache_flag(CMAKE_CXX_FLAGS "-g")
+
+polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=memory")
+polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize-memory-track-origins")
+polly_add_cache_flag(CMAKE_C_FLAGS "-g")


memcheck: show all leak kinds

memcheck: show all leak kinds

--- scripts/cmake/ElektraCache.cmake
+++ scripts/cmake/ElektraCache.cmake
@@ -353,7 +353,7 @@
 	""
 	CACHE STRING "Optional suffix to use on lib folders (e.g. 64 for lib64)")

-set (MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --gen-suppressions=all --error-exitcode=1")
+set (MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --show-leak-kinds=all --gen-suppressions=all --error-exitcode=1")
 set (
 	MEMORYCHECK_SUPPRESSIONS_FILE
 	"${CMAKE_SOURCE_DIR}/tests/valgrind.suppression"


compile fix for windows

compile fix for windows

--- common/cmake/msvc.cmake
+++ common/cmake/msvc.cmake
@@ -14,12 +14,12 @@
 ## limitations under the License.                                           ##
 ## ======================================================================== ##

-SET(FLAGS_SSE2  "/D__SSE__ /D__SSE2__")
+SET(FLAGS_SSE2  "")
 SET(FLAGS_SSE42 "${FLAGS_SSE2} /D__SSE3__ /D__SSSE3__ /D__SSE4_1__ /D__SSE4_2__")
 SET(FLAGS_AVX   "${FLAGS_SSE42} /arch:AVX")
 SET(FLAGS_AVX2  "${FLAGS_SSE42} /arch:AVX2")

-SET(COMMON_CXX_FLAGS "/EHsc /MP /GR /GS-")
+SET(COMMON_CXX_FLAGS "/EHsc /MP /GR /GS- /D__SSE__ /D__SSE2__")

 SET(CMAKE_CXX_FLAGS_DEBUG          "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}")
 SET(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE}        ${COMMON_CXX_FLAGS} /Ox /Oi /Gy")


Fix CPackConfig

Fix CPackConfig

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[x] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -81,16 +81,20 @@

 if(MSVC)
   set(CPACK_GENERATOR "NSIS")
-else(MSVC)
-  set(CPACK_SET_DESTDIR ON)
 endif(MSVC)

 if(APPLE)
   set(CPACK_GENERATOR "PackageMaker")
+  set(CPACK_SET_DESTDIR ON)
 endif(APPLE)

 if(LINUX)
-  set(CPACK_GENERATOR "TGZ;DEB;RPM")
+  find_program(RPM_EXE rpmbuild)
+  if(${RPM_EXE} MATCHES RPM_EXE-NOTFOUND)
+    set(CPACK_GENERATOR "TGZ;DEB")
+  else()
+    set(CPACK_GENERATOR "TGZ;DEB;RPM")
+  endif()
 endif(LINUX)

 set(CPACK_STRIP_FILES TRUE)


#4001: Update submit URL

#4001: Update submit URL

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -22,7 +22,7 @@

 IF(CTEST_DROP_METHOD STREQUAL "http")
   SET(CTEST_DROP_SITE "cdash.cmiclab.cs.ucl.ac.uk")
-  SET(CTEST_DROP_LOCATION "/cdash/submit.php?project=NiftyLink")
+  SET(CTEST_DROP_LOCATION "/submit.php?project=NiftyLink")
   SET(CTEST_DROP_SITE_CDASH TRUE)
 ENDIF(CTEST_DROP_METHOD STREQUAL "http")


changed FATAL_ERROR to WARNING for llvm-config --system-libs

Newer versions of llvm (at least it's true for 4.0) appear to normally have the --system-libs option empty

Former-commit-id: 0a1a8aecb55d943cc8542d5e01a29d9e481fcb4d [formerly 534a6a4811c50c3f4fe2c8b90a9881ed53ccb7b9]
Former-commit-id: 769e3e8ef3664653e873e21fb65ded72c7542d9d

--- halide.cmake
+++ halide.cmake
@@ -618,7 +618,7 @@
   if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/halide_config.cmake")
     include("${CMAKE_CURRENT_LIST_DIR}/halide_config.cmake")
   else()
-    message(FATAL_ERROR "HALIDE_SYSTEM_LIBS is not set and we could not find halide_config.cmake")
+    message(WARNING "HALIDE_SYSTEM_LIBS is not set and we could not find halide_config.cmake")
   endif()
 endif()


emscripten: add a FIPS_EMSCRIPTEN_USE_CLOSURE cmake option (default OFF)

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -56,6 +56,7 @@
 option(FIPS_EMSCRIPTEN_USE_CPU_PROFILER "emscripten: enable the built-in CPU profiler" OFF)
 option(FIPS_EMSCRIPTEN_USE_MEMORY_PROFILER "emscripten: enable the built-in memory profiler" OFF)
 option(FIPS_EMSCRIPTEN_USE_WEBGL2 "emscripten: use WebGL2" OFF)
+option(FIPS_EMSCRIPTEN_USE_CLOSURE "emscripten: run closure compiler on JS code" OFF)
 set(FIPS_EMSCRIPTEN_TOTAL_MEMORY 134217728 CACHE STRING "emscripten: total heap size in bytes")
 set(FIPS_EMSCRIPTEN_LTO_LEVEL 1 CACHE STRING "emscripten: Link-time-optimization level (0..3)")
 set(FIPS_EMSCRIPTEN_OUTLINING_LIMIT 60000 CACHE STRING "emscripten: outlining limit")
@@ -126,7 +127,11 @@
 endif()
 set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL}")
 set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")
-set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --closure 0")
+if (FIPS_EMSCRIPTEN_USE_CLOSURE)
+    set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --closure 1")
+else()
+    set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --closure 0")
+endif()
 set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} -s ASSERTIONS=0")

 if (FIPS_EMSCRIPTEN_USE_WASM)


Set pullup for IMU wakeup pin

Set pullup for IMU wakeup pin

--- 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 "28471d4d80ffe0dcd9c251544e5da2aecfc2ec48")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "33287b3eaf62cb0d12b98454459f2f09d22200a3")

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


Update FW: ColorCamera memory optimization when `still` is not connected, properly handle width-multiple-of-32 (only needed for VideoEncoder), don't enforce it on `video` by default, allow `still` size smaller than `video`

--- 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 "f2876f23bebca25cc5db0889c06376572f5227d6")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "bfc09cbb3a84193709558b60fbd4adc3d744f361")

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


TMP: OV9782(color) working on Left and/or Right sockets

--- 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 "d2b298e834f3cf746071059e2c1e1c4d37b724af")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "4ceaec0afc1891083c8fb041e2788731ec699850")

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


cmake changes for OSX 10.7

cmake changes for OSX 10.7

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -100,9 +100,9 @@
   set(DARWIN 1)

   # To support a different SDK update these Xcode settings:
-  set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
-  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
-  set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0")
+  set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
+  set(CMAKE_OSX_SYSROOT macosx10.6)
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
   set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)

   # NOTE: To attempt an i386/PPC Universal build, add this on the configure line:


Add a clearer and more prescriptive message for LLVM 10 error (#1206)

Spell out the exact requirements when building against LLVM 10,
which option to set to bump to C++14, which compiler versions are
necessary.

Closes #1205

Signed-off-by: Larry Gritz <f0a1ce6f80112d72f7276457fd261d671b827567@larrygritz.com>

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -244,7 +244,13 @@
 endif ()
 if (LLVM_VERSION VERSION_GREATER_EQUAL 10.0.0 AND
     CMAKE_CXX_STANDARD VERSION_LESS 14)
-    message (FATAL_ERROR "LLVM 10+ requires C++14 or higher (was ${CMAKE_CXX_STANDARD}).")
+    message (FATAL_ERROR
+             "LLVM 10+ requires C++14 or higher (was ${CMAKE_CXX_STANDARD}). "
+             "To build against this LLVM ${LLVM_VERSION}, you need to set "
+             "build option CMAKE_CXX_STANDARD=14. The minimum requirements "
+             "for that are gcc >= 5.1, clang >= 3.5, Apple clang >= 7, "
+             "icc >= 7, MSVS >= 2017. "
+             "If you must use C++11, you need to build against LLVM 9 or earlier.")
 endif ()

 checked_find_package (partio)


ENH: Update neoseg revision. Previous revision does not compile due to missing files

--- SuperBuild/External_neoseg.cmake
+++ SuperBuild/External_neoseg.cmake
@@ -62,7 +62,7 @@

   ### --- End Project specific additions
   set(${proj}_REPOSITORY "https://www.nitrc.org/svn/neoseg")
-  set(${proj}_SVN_REVISION -r "4")
+  set(${proj}_SVN_REVISION -r "5")
   ExternalProject_Add(${proj}
     SVN_REPOSITORY ${${proj}_REPOSITORY}
     SVN_REVISION ${${proj}_SVN_REVISION}


Fix FindCollage

Fix FindCollage

--- FindCollage.cmake
+++ FindCollage.cmake
@@ -188,8 +188,6 @@
   endif()
 endif()

-endif()
-
 if(_co_EPIC_FAIL)
   # Zero out everything, we didn't meet version requirements
   set(COLLAGE_FOUND FALSE)


Fixed findopenssl.cmake

Fixed findopenssl.cmake

--- FindOpenSSL.cmake
+++ FindOpenSSL.cmake
@@ -71,9 +71,9 @@
 if (OPENSSL_INCLUDE_DIR)
   if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
     file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
-         REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
+         REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-zA-Z])+.*")

-    string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
+    string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z]).*$"
            "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
     list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
     list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)


Pick-up zlib/libpng directly from ports for EMCC (#962)

--- lib/jxl_extras.cmake
+++ lib/jxl_extras.cmake
@@ -73,6 +73,24 @@
   endif()  # JPEGXL_DEP_LICENSE_DIR
 endif()

+if ("${JPEGXL_EMSCRIPTEN}")
+include(FetchContent)
+
+FetchContent_Declare(
+  zlib
+  GIT_REPOSITORY https://github.com/emscripten-ports/zlib.git
+  GIT_TAG        69f24a21cab163b09c81f85857ef1b2c850f8707
+)
+
+FetchContent_Declare(
+  libpng
+  GIT_REPOSITORY https://github.com/emscripten-ports/libpng.git
+  GIT_TAG        918d23f658cb31e6db539ee0411d212408a9fcea
+)
+
+FetchContent_MakeAvailable(zlib libpng)
+endif()  # JPEGXL_EMSCRIPTEN
+
 find_package(ZLIB)  # dependency of PNG
 find_package(PNG)
 if(PNG_FOUND AND ZLIB_FOUND)


Enable /bigobj for the unittests under windows

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -158,6 +158,10 @@
             VERBATIM)
     endif()

+	# Enable bigobj for unit tests, this lets us buid the bigger templated unit tests without problems
+	if(MSVC)
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
+	endif()

 	# copy all ${UNIT_TEST_SHARED..._LIBS} to the test executable directory:
 	surgsim_copy_to_target_directory(${TEST_NAME}


Remove flags not supported by Valgrind on the build machines.

Also tweak the other flags in a non-user-visible way.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -21,7 +21,8 @@
 option(SURGSIM_TESTS_BUILD "Include the unit tests in the build" ON)
 option(SURGSIM_TESTS_RUN "Run the unit tests at the end of the build" ON)
 if(NOT WIN32)
-	option(SURGSIM_TESTS_RUN_WITH_VALGRIND "Run the unit tests under Valgrind" OFF)
+	option(SURGSIM_TESTS_RUN_WITH_VALGRIND
+		"Run the unit tests using Valgrind's memcheck tool." OFF)
 endif(NOT WIN32)
 option(SURGSIM_TESTS_ALL_IN_ONE
 	"Build a single binary with all unit tests.  [Does not work yet!]" OFF)
@@ -32,8 +33,8 @@
 set(SURGSIM_TEST_RUN_PREFIX)
 if(NOT WIN32)
 	if(SURGSIM_TESTS_RUN_WITH_VALGRIND)
-		set(SURGSIM_TEST_RUN_PREFIX valgrind -v --error-exitcode=1
-			--fullpath-after= --leak-check=full --redzone-size=64)
+		set(SURGSIM_TEST_RUN_PREFIX valgrind -v --tool=memcheck --error-exitcode=1
+			--fullpath-after= --leak-check=full)
 	endif(SURGSIM_TESTS_RUN_WITH_VALGRIND)
 endif(NOT WIN32)


chore: cleanup cmake file and early exit if already defined

--- cmake/CMakePlatforms.cmake
+++ cmake/CMakePlatforms.cmake
@@ -1,20 +1,24 @@
 cmake_minimum_required(VERSION 3.2)

+if(PLATFORM_NAME)
+	return()	# Already set
+endif()
+
 # Detect which platform we have
-if( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
 	set(PLATFORM_WINDOWS 1)
 	set(PLATFORM_NAME "Windows")
-elseif( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
+elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
 	if(PLATFORM_IOS)
 		set(PLATFORM_NAME "iOS")
 	else()
 		set(PLATFORM_OSX 1)
 		set(PLATFORM_NAME "OS X")
 	endif()
-elseif( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
+elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
 	set(PLATFORM_LINUX 1)
 	set(PLATFORM_NAME "Linux")
-elseif( ${CMAKE_SYSTEM_NAME} STREQUAL "Android" )
+elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
 	set(PLATFORM_ANDROID 1)
 	set(PLATFORM_NAME "Android")
 else()


Enable swig-generated octave bindings (as opposed to matwrapped ones) by
default.

svn path=/trunk/; revision=11432

--- cmake/modules/octave.cmake
+++ cmake/modules/octave.cmake
@@ -263,5 +263,5 @@
   if(PL_DOUBLE)
     set(DEFINE_PL_DOUBLE "#define PL_DOUBLE")
   endif(PL_DOUBLE)
-  option(ENABLE_swig_octave "Enable Octave bindings generated by SWIG" OFF)
-endif(ENABLE_octave)
+  option(ENABLE_swig_octave "Enable Octave bindings generated by SWIG" ON)
+endif(ENABLE_octave)


Restore isnan test since some/all Linux/Unix systems do not have it.  Combine
finite and _finite tests properly.  Combine isnan and _isnan tests properly.
Drop extra _isnan test with variable PREFIX_UNDERSCORE since that variable
unused anywhere.

svn path=/trunk/; revision=7000

--- cmake/modules/plplot.cmake
+++ cmake/modules/plplot.cmake
@@ -153,9 +153,15 @@
 check_function_exists(usleep HAVE_USLEEP)
 check_function_exists(isinf HAVE_ISINF)
 check_function_exists(finite HAVE_FINITE)
-check_function_exists(_finite HAVE_FINITE)
-check_function_exists(_isnan HAVE_ISNAN)
-check_function_exists(_isnan PREFIX_UNDERSCORE)
+if(NOT HAVE_FINITE)
+  check_function_exists(_finite _HAVE_FINITE)
+  set(HAVE_FINITE ${_HAVE_FINITE} CACHE INTERNAL "Have function _finite")
+endif(NOT HAVE_FINITE)
+check_function_exists(isnan HAVE_ISNAN)
+if(NOT HAVE_ISNAN)
+  check_function_exists(_isnan _HAVE_ISNAN)
+  set(HAVE_ISNAN ${_HAVE_ISNAN} CACHE INTERNAL "Have function _isnan")
+endif(NOT HAVE_ISNAN)

 # =======================================================================
 # Language bindings


Update msp430-elf-gcc.cmake

Update msp430-elf-gcc.cmake

--- cmake/msp430-elf-gcc.cmake
+++ cmake/msp430-elf-gcc.cmake
@@ -20,10 +20,16 @@
 set(CMAKE_CXX_COMPILER_WORKS 1)

 # The location of the msp430-elf-gcc toolchain. This may vary and need to be modified.
-if(CMAKE_HOST_WIN32)
-    set(MSP430_PATH "C:/Program Files/msp430")
+
+
+if(DEFINED ENV{MSP430_FIND_ROOT_PATH})
+    set(MSP430_PATH $ENV{MSP430_FIND_ROOT_PATH})
 else()
-    set(MSP430_PATH /usr/local/msp430)
+    if(CMAKE_HOST_WIN32)
+        set(MSP430_PATH "C:/Program Files/msp430")
+    else()
+        set(MSP430_PATH /usr/local/msp430)
+    endif()
 endif()

 # Specify the cross compiler
@@ -34,6 +40,8 @@
     set(CMAKE_C_COMPILER ${MSP430_PATH}/bin/msp430-elf-gcc)
     set(CMAKE_CXX_COMPILER ${MSP430_PATH}/bin/msp430-elf-g++)
 endif()
+set(CMAKE_C_COMPILER_ENV_VAR CC)
+set(CMAKE_CXX_COMPILER_ENV_VAR CXX)

 # Where is the target environment located
 set(CMAKE_FIND_ROOT_PATH ${MSP430_PATH})
@@ -47,7 +55,7 @@

 # Include The header directory
 include_directories(SYSTEM ${MSP430_PATH}/include ${MSP430_PATH}/msp430-elf/include)
-link_directories(${MSP430_PATH}/include)
+set(CMAKE_EXE_LINKER_FLAGS "-L${MSP430_PATH}/include")

 # Create a function that will instantiate a flash target command using mspdebug.
 # you may have to set the path to mspdebug if it is different. In this case we are
@@ -56,7 +64,7 @@

 function(setup_flash_target TARGET_NAME DRIVER)
     add_custom_target(flash
-        COMMAND ${MSPDEBUG_PATH} ${DRIVER} 'prog ${TARGET_NAME}'
+        COMMAND ${MSPDEBUG_PATH} ${DRIVER} --allow-fw-update 'prog ${TARGET_NAME}'
         DEPENDS ${TARGET_NAME}
     )
 endfunction()


Add iostreams as required component

Add iostreams as required component

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

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -10,7 +10,7 @@
   SET(Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0")
 endif(${CMAKE_VERSION} VERSION_LESS 2.8.5)

-find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time)
+find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time iostreams)

 if(Boost_FOUND)
   # Obtain diagnostic information about Boost's automatic linking outputted


posix_sitl_default.cmake: add modules/events

It's not used yet, just to make sure it compiles fine.

--- cmake/configs/posix_sitl_default.cmake
+++ cmake/configs/posix_sitl_default.cmake
@@ -37,6 +37,7 @@
 	modules/commander
 	modules/dataman
 	modules/ekf2
+	modules/events
 	modules/fw_att_control
 	modules/fw_pos_control_l1
 	modules/land_detector


boostutils: fix for boost-locale on mingw

--- cmake/qibuild/modules/boostutils.cmake
+++ cmake/qibuild/modules/boostutils.cmake
@@ -47,10 +47,14 @@

   set (_mingw_names_debug
     "libboost_${_libname}-mgw44-mt-d-${BOOST_VERSION}"
+    # for boost-locale
+    "libboost_${_libname}"
   )

   set (_mingw_names_release
     "libboost_${_libname}-mgw44-mt-${BOOST_VERSION}"
+    # for boost-locale
+    "libboost_${_libname}"
   )

   if(WIN32)


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -100,7 +100,7 @@
     # if we could extract them, compare with the requested version number
     if (SFML_VERSION_MAJOR)
         # transform version numbers to an integer
-		math(EXPR SFML_VERSION "${2 * 10000 + 1 * 100")
+		math(EXPR SFML_VERSION "2 * 10000 + 1 * 100")

         # compare them
         if(SFML_VERSION LESS SFML_REQUESTED_VERSION)


update cmake file, to avoid CMP0026 policy problem

--- CMacros.cmake
+++ CMacros.cmake
@@ -58,6 +58,16 @@
 	endforeach()
 endmacro()

+function( get_target_location_property _variableName _target_NAME )
+	cmake_policy(PUSH)
+	if ( ${CMAKE_MAJOR_VERSION} EQUAL "3" )
+		cmake_policy( SET CMP0026 OLD )
+	endif()
+	get_target_property( _var ${_target_NAME} LOCATION )
+	set( ${_variableName} ${_var} PARENT_SCOPE )
+	cmake_policy(POP)
+endfunction()
+
 function( prepare_installer )

 	message( STATUS "prepare installer" )
@@ -99,7 +109,7 @@

 function( generate_installer_target _Target )

-	get_property( _ExePath TARGET ${_Target} PROPERTY LOCATION )
+	get_target_location_property( _ExePath ${_Target} )
 	get_filename_component( _ExeName ${_ExePath} NAME )

 	set( APP_PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/PACKAGE" )


Support Yocto SDK environment in search paths for included fidl files.

--- cmake/common/CommonAPICodeGenCommonConfig.cmake
+++ cmake/common/CommonAPICodeGenCommonConfig.cmake
@@ -66,12 +66,18 @@
             set(FULL_INCLUDE_PATH ${include_path})
         # ... otherwise construct one based on the relative path
         else()
-            set(FULL_INCLUDE_PATH ${CMAKE_INSTALL_PREFIX}/${FRANCA_IDLS_LOCATION}/${include_path})
-            # COMMONAPI_INTEGRATION_SYSROOT should be set by e.g. a yocto recipe to point out the
-            # location of the build
-            if(DEFINED COMMONAPI_INTEGRATION_SYSROOT)
-                set(FULL_INCLUDE_PATH ${COMMONAPI_INTEGRATION_SYSROOT}/${FULL_INCLUDE_PATH})
-            endif(DEFINED COMMONAPI_INTEGRATION_SYSROOT)
+            # CMAKE_STAGING_PREFIX is used as absolute installation prefix when cross-compiling, e.g. in an SDK
+            # generated by Yocto, otherwise CMAKE_INSTALL_PREFIX is the installation prefix to look into
+            if(NOT "${CMAKE_STAGING_PREFIX}" STREQUAL "")
+                set(FULL_INCLUDE_PATH ${CMAKE_STAGING_PREFIX}/${FRANCA_IDLS_LOCATION}/${include_path})
+            else()
+                set(FULL_INCLUDE_PATH ${CMAKE_INSTALL_PREFIX}/${FRANCA_IDLS_LOCATION}/${include_path})
+                # COMMONAPI_INTEGRATION_SYSROOT is used to prefix the include path based on CMAKE_INSTALL_PREFIX
+                # in special cases, e.g. Yocto build context with a common out-of-tree sysroot unavailable to CMake.
+	            if(DEFINED COMMONAPI_INTEGRATION_SYSROOT)
+	                set(FULL_INCLUDE_PATH ${COMMONAPI_INTEGRATION_SYSROOT}/${FULL_INCLUDE_PATH})
+	            endif()
+            endif()
         endif()
         file(GLOB FIDL_FILES_HERE ${FULL_INCLUDE_PATH}/*.fidl)
         set(FIDL_FILES "${FIDL_FILES};${FIDL_FILES_HERE}")


[CMake][Python] The Python installation directory is now the standard one.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -113,8 +113,6 @@
   # Offer the user the choice of overriding the installation directories
   set (INSTALL_LIB_DIR ${LIBDIR} CACHE PATH
 	"Installation directory for libraries")
-  set (INSTALL_PY_LIB_DIR ${LIBDIR}/python${PYTHONLIBS_VERSION}/${PROJECT_NAME}
-	CACHE PATH "Installation directory for Python libraries")
   set (INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
   set (INSTALL_LIBEXEC_DIR CACHE PATH
 	"Installation directory for internal executables")
@@ -498,7 +496,11 @@
       PYTHONLIBS_VERSION "${PYTHONLIBS_LIB_FILENAME}")
 	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION}")

-    # Update the list of include directories for the project
+	# Set the Python installation directory
+	set (INSTALL_PY_LIB_DIR ${INSTALL_LIB_DIR}/python${PYTHONLIBS_VERSION}/site-packages/libpy${PROJECT_NAME}
+	  CACHE PATH "Installation directory for Python libraries")
+
+	# Update the list of include directories for the project
     include_directories (${PYTHON_INCLUDE_DIRS})

     # Update the list of dependencies for the project
@@ -1420,7 +1422,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/${PACKAGE})
+  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/site-packages/libpy${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)


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

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

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

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

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

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

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

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


update SIRF_TAG to current master as test and STIR_TAG to 4.0.0-alpha

--- version_config.cmake
+++ version_config.cmake
@@ -183,11 +183,11 @@
   set(DEFAULT_CCPi-Astra_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG v2.0.0)
+  set(DEFAULT_SIRF_TAG b9b8bcd0589ea64737a186ab2fdc79cc37d42d34)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )
-  set(DEFAULT_STIR_TAG 74676768610b7d8be9792e1192ac6dd68bff2424)
+  set(DEFAULT_STIR_TAG stir_rel_4_00_alpha)
   #set(DEFAULT_STIR_TAG 3a277f7a819f35a553a8d6097402ea25cf55a240)

   ## siemens_to_ismrmrd


Update SIRF_TAG

Update SIRF_TAG

Closes #124

--- version_config.cmake
+++ version_config.cmake
@@ -120,7 +120,7 @@

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )
-  set(DEFAULT_STIR_TAG cc7c16451abe1af7d0c02cc790f5d0752c2a7b68 )
+  set(DEFAULT_STIR_TAG 9ecbf0abd048cd0a8f19250f6cc7b4c199870c26)

   ## Gadgetron
   set(DEFAULT_Gadgetron_URL https://github.com/gadgetron/gadgetron )


Minor clean up to remove redundant linker flag. [ci skip]

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -572,6 +572,7 @@
             if (NOT URHO3D_NOABI)
                 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DASH_MBIT}")
                 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DASH_MBIT}")
+                # Required only when cross-compling from i686 to x86_64, in other cases the flag is redundantly duplicated during linking phase for shared lib
                 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${DASH_MBIT}")
             endif ()
         endif ()
@@ -582,7 +583,6 @@
             if (URHO3D_THREADING)
                 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_PTHREADS=1")
                 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_PTHREADS=1")
-                set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s USE_PTHREADS=1")
             endif ()
             # Prior to version 1.31.3 emcc does not consistently add the cpp standard and remove Emscripten-specific compiler flags
             # before passing on the work to the underlying LLVM/Clang compiler, this has resulted in preprocessing error when enabling the PCH and ccache


COMP: Added missing OTB_DEBUG pre-processor definition.

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -21,6 +21,17 @@

 include(OTB_CheckCCompilerFlag)
 include(OTB_CheckCXXCompilerFlag)
+
+macro( set_debug_flags )
+  string( TOUPPER "${CMAKE_BUILD_TYPE}" MODE )
+
+  if( "${MODE}" STREQUAL "DEBUG" )
+    message( STATUS "Adding -DOTB_DEBUG" )
+
+    set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DOTB_DEBUG" )
+    set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOTB_DEBUG" )
+  endif()
+endmacro()

 function(check_c_compiler_warning_flags c_flag_var)
   set(local_c_flags "")
@@ -316,6 +327,8 @@
 set(CMAKE_C_FLAGS "${C_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CXX_WARNING_FLAGS} ${CMAKE_CXX_FLAGS}")

+set_debug_flags()
+
 #-----------------------------------------------------------------------------
 #Check the set of platform flags the compiler supports
 check_compiler_platform_flags()


COMP: Remove used flags to JsonCpp build.

For:

CMake Warning:
  Manually-specified variables were not used by the project:

      CMAKE_EXE_LINKER_FLAGS
      CMAKE_SHARED_LINKER_FLAGS

--- CMake/Superbuild/External_JsonCpp.cmake
+++ CMake/Superbuild/External_JsonCpp.cmake
@@ -62,11 +62,8 @@
     CMAKE_GENERATOR ${gen}
     CMAKE_ARGS
       -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-      -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
       -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
       -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-      -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-      -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
       -DCMAKE_BUILD_TYPE:STRING=${build_type}
       ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS}
       -DBUILD_SHARED_LIBS:BOOL=OFF


update moab to enable dagmc

update moab to enable dagmc

--- meshkit/Projects/moab.cmake
+++ meshkit/Projects/moab.cmake
@@ -34,6 +34,7 @@
     --with-cgm=<INSTALL_DIR>
     --without-damsel
     --without-ccmio
+    --enable-dagmc
     --enable-shared
     "CFLAGS=${cflags}" "CXXFLAGS=${cxxflags}"
 )


Prospective -fsanitize=memory build fix following r212586

This -f group flag appears to influence linker flags, breaking the usual rules
and causing CMake's link invocation to fail during feature detection due to
missing link dependencies (msan_*).

Let's forcibly add it for now to get things the way they were before feature
detection started working.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -343,12 +343,12 @@
   if (LLVM_ON_UNIX)
     if (LLVM_USE_SANITIZER STREQUAL "Address")
       append_common_sanitizer_flags()
-      add_flag_or_print_warning("-fsanitize=address" FSANITIZE_ADDRESS)
+      append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
       append_common_sanitizer_flags()
-      add_flag_or_print_warning("-fsanitize=memory" FSANITIZE_MEMORY)
+      append("-fsanitize=memory" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
       if(LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
-        add_flag_or_print_warning("-fsanitize-memory-track-origins" FSANITIZE_MEMORY_TRACK_ORIGINS)
+        append("-fsanitize-memory-track-origins" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
       endif()
     else()
       message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")


qi_generate_qt_conf: fix for mac

qi_generate_qt_conf: fix for mac

Change-Id: I469a74aa9abda6d88e3f101d644350ae886040e8

--- cmake/qibuild/modules/qt5-tools.cmake
+++ cmake/qibuild/modules/qt5-tools.cmake
@@ -24,6 +24,10 @@

     get_target_property(_lib_loc ${_lib} LOCATION)
     get_filename_component(_lib_path ${_lib_loc} PATH)
+    if(APPLE)
+      # location is: <prefix>/lib/QtCore.framework/QtCore
+      get_filename_component(_lib_path ${_lib_path} PATH)
+    endif()
     get_filename_component(_root_path ${_lib_path} PATH)
   endif()


[t:4871] turn -Werror back on

[t:4871] turn -Werror back on

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -116,12 +116,14 @@
   ## set icc warnings
   set(WARN_CFLAGS
     -Wall
+    -Werror
     -Wcheck  ## icc version of -Wextra
     )
 else()
   ## set gcc warnings
   set(WARN_CFLAGS
     -Wall
+    -Werror
     -Wextra
     -Wcast-align
     -Wbad-function-cast


Adding the number of filters that each plugin is compiling as additional information during cmake time

--- ImageProcessingFilters/SourceList.cmake
+++ ImageProcessingFilters/SourceList.cmake
@@ -49,6 +49,10 @@
 )

+
+list(LENGTH _PublicFilters PluginNumFilters)
+set_property(GLOBAL PROPERTY PluginNumFilters ${PluginNumFilters})
+
 #--------------
 # Loop on all the filters adding each one. In this loop we default to making each filter exposed in the user
 # interface in DREAM3D. If you want to have the filter compiled but NOT exposed to the user then use the next loop


Adjusting compiler name for icc/icpc

--- Resources/MXAFindBoost.cmake
+++ Resources/MXAFindBoost.cmake
@@ -138,7 +138,7 @@
     /opt/local/lib
     /sw/lib
   )
-  # MESSAGE (STATUS "BOOST_LIBRARIES_SEARCH_DIRS: ${BOOST_LIBRARIES_SEARCH_DIRS}")
+ # MESSAGE (STATUS "BOOST_LIBRARIES_SEARCH_DIRS: ${BOOST_LIBRARIES_SEARCH_DIRS}")
   IF (WIN32)
     # In windows, automatic linking is performed, so you do not have to specify the libraries.
     # If you are linking to a dynamic runtime, then you can choose to link to either a static or a
@@ -164,7 +164,7 @@
     PATH_SUFFIXES
       ${BOOST_PATH_SUFFIX}
   )
-  MESSAGE (STATUS "BOOST_INCLUDE_DIR: ${BOOST_INCLUDE_DIR}")
+ # MESSAGE (STATUS "BOOST_INCLUDE_DIR: ${BOOST_INCLUDE_DIR}")

 ############################################
 #
@@ -232,7 +232,7 @@
   IF ( WIN32 )
     SET (BOOST_LIB_PREFIX "lib")
   ENDIF ( WIN32 )
-  SET (BOOST_COMPILER "gcc")
+  SET (BOOST_COMPILER "-gcc")
   IF (MSVC71)
     SET (BOOST_COMPILER "-vc71")
   ENDIF(MSVC71)
@@ -246,13 +246,16 @@
     SET (BOOST_COMPILER "-gcc")
   ENDIF (CYGWIN)
   IF (UNIX)
+
     IF (APPLE)
         SET (BOOST_COMPILER "")
     ELSE (APPLE)
 	IF (NOT CMAKE_COMPILER_IS_GNUCC)
           # This is for the intel compiler
-	  SET (BOOST_COMPILER "-il")
-	ELSEIF (NOT CMAKE_COMPILER_IS_GNUCC)
+	   SET (BOOST_COMPILER "-il")
+	  #MESSAGE(STATUS "COMPILER IS ICC")
+	ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
+	  #MESSAGE(STATUS "COMPILER IS GCC")
           SET (BOOST_COMPILER "-gcc34")
 	ENDIF (NOT CMAKE_COMPILER_IS_GNUCC)
     ENDIF (APPLE)


Add reused tag to hierarchy display.

Add reused tag to hierarchy display.

--- CPM.cmake
+++ CPM.cmake
@@ -1225,10 +1225,14 @@
   _cpm_set_target_output_dirs(_ep_output_bin_dirs "${__CPM_MODULE_BIN_DIR}")

   if ((DEFINED CPM_SHOW_HIERARCHY) AND (CPM_SHOW_HIERARCHY))
+    set(_cpm_is_module_resued_var)
+    if (DEFINED CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID})
+      set(_cpm_is_module_resued_var " (reused)")
+    endif()
     if(__CPM_USING_GIT)
-      _cpm_print_with_hierarchy_level("${name} - GIT - Tag: ${__CPM_NEW_GIT_TAG} - Unid: ${__CPM_FULL_UNID}")
+      _cpm_print_with_hierarchy_level("${name} ${_cpm_is_module_resued_var} - GIT - Tag: ${__CPM_NEW_GIT_TAG} - Unid: ${__CPM_FULL_UNID}")
     else()
-      _cpm_print_with_hierarchy_level("${name} - Source - Unid: ${__CPM_FULL_UNID}")
+      _cpm_print_with_hierarchy_level("${name} ${_cpm_is_module_resued_var} - Source - Unid: ${__CPM_FULL_UNID}")
     endif()
   endif()


adding copyright header

adding copyright header

Summary: as in the title

Reviewed By: Croohand

Differential Revision: D30041822

fbshipit-source-id: 923158fcba241f5cd2ace8f87fa12083fd22356c

--- build/fbcode_builder/CMake/RustStaticLibrary.cmake
+++ build/fbcode_builder/CMake/RustStaticLibrary.cmake
@@ -1,3 +1,5 @@
+# Copyright (c) Facebook, Inc. and its affiliates.
+
 include(FBCMakeParseArgs)

 set(
@@ -286,4 +288,4 @@
     RENAME ${staticlib_output_name}
     DESTINATION ${ARG_INSTALL_DIR}
   )
-endfunction()+endfunction()


Fix hdf5 library names.

Fix hdf5 library names.

Change-Id: Iad597e207a4296dabf765ac084b28e2dcc2251de

--- ThirdParty/hdf5/vtkhdf5/config/cmake/HDFMacros.cmake
+++ ThirdParty/hdf5/vtkhdf5/config/cmake/HDFMacros.cmake
@@ -74,28 +74,29 @@
 ENDMACRO (INSTALL_PROGRAM_PDB)

 #-------------------------------------------------------------------------------
-MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype)
+MACRO (HDF_SET_LIB_OPTIONS libtarget _libname libtype)
+  set (libname "${_libname}${VTK_CUSTOM_LIBRARY_SUFFIX}")
   # message (STATUS "${libname} libtype: ${libtype}")
   if (${libtype} MATCHES "SHARED")
     if (WIN32)
       set (LIB_RELEASE_NAME "${libname}")
-      set (LIB_DEBUG_NAME "${libname}_D")
+      set (LIB_DEBUG_NAME "${libname}")
     else (WIN32)
       set (LIB_RELEASE_NAME "${libname}")
-      set (LIB_DEBUG_NAME "${libname}_debug")
+      set (LIB_DEBUG_NAME "${libname}")
     endif (WIN32)
   else (${libtype} MATCHES "SHARED")
     if (WIN32)
       set (LIB_RELEASE_NAME "lib${libname}")
-      set (LIB_DEBUG_NAME "lib${libname}_D")
+      set (LIB_DEBUG_NAME "lib${libname}")
     else (WIN32)
       # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value
       if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
         set (LIB_RELEASE_NAME "${libname}")
-        set (LIB_DEBUG_NAME "${libname}_debug")
+        set (LIB_DEBUG_NAME "${libname}")
       else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
         set (LIB_RELEASE_NAME "lib${libname}")
-        set (LIB_DEBUG_NAME "lib${libname}_debug")
+        set (LIB_DEBUG_NAME "lib${libname}")
       endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
     endif (WIN32)
   endif (${libtype} MATCHES "SHARED")


Wrapped CTK libraries are now exported

Wrapped CTK libraries are now exported

Doing so will allow other project to properly linked against and initialize
the wrappers.

--- Utilities/LastConfigureStep/CTKGenerateCTKConfig.cmake
+++ Utilities/LastConfigureStep/CTKGenerateCTKConfig.cmake
@@ -64,9 +64,17 @@
 # The "use" file.
 SET(CTK_USE_FILE ${CTK_SUPERBUILD_BINARY_DIR}/UseCTK.cmake)

+# Generate list of target to exports
+SET(CTK_TARGETS_TO_EXPORT ${CTK_LIBRARIES} ${CTK_PLUGIN_LIBRARIES})
+
+# Append CTK PythonQt static libraries
+FOREACH(lib ${CTK_WRAPPED_LIBRARIES_PYTHONQT})
+  LIST(APPEND CTK_TARGETS_TO_EXPORT ${lib}PythonQt)
+ENDFOREACH()
+
 # Export targets so they can be imported by a project using CTK
 # as an external library
-EXPORT(TARGETS ${CTK_LIBRARIES} ${CTK_PLUGIN_LIBRARIES} FILE ${CTK_SUPERBUILD_BINARY_DIR}/CTKExports.cmake)
+EXPORT(TARGETS ${CTK_TARGETS_TO_EXPORT} FILE ${CTK_SUPERBUILD_BINARY_DIR}/CTKExports.cmake)

 # Write a set of variables containing plugin specific include directories
 SET(CTK_PLUGIN_INCLUDE_DIRS_CONFIG)


Updated

Updated

--- cmake/CMakeBuildFlags.cmake
+++ cmake/CMakeBuildFlags.cmake
@@ -16,6 +16,6 @@

 if(CMAKE_COMPILER_IS_GNUC)
 	if(CMAKE_C_COMPILER_VERSION VERSION_GREATER "5.3.0" AND NOT APPLE)
-		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -Ofast -DCML_DOUBLE_PRECISION=ON -Dmfloat_t=double")
+		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Ofast -DCML_DOUBLE_PRECISION=ON -Dmfloat_t=double")
 	endif()
 endif()


Fix configure check HAVE_READLINE_READLINE_H on MacOSX

"stdio.h" is required to ensure the test is not failing because
FILE struct is not defined.

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -239,7 +239,7 @@
 check_include_files(pthread.h HAVE_PTHREAD_H)
 check_include_files(pty.h HAVE_PTY_H)
 check_include_files(pwd.h HAVE_PWD_H)
-check_include_files(readline/readline.h HAVE_READLINE_READLINE_H)
+check_include_files("stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H)
 check_include_files(semaphore.h HAVE_SEMAPHORE_H)
 check_include_files(shadow.h HAVE_SHADOW_H)
 check_include_files(signal.h HAVE_SIGNAL_H)


Add support for nlohmann json

Add support for nlohmann json

--- cmake/DevBaseExternal.cmake
+++ cmake/DevBaseExternal.cmake
@@ -309,6 +309,22 @@
 endif()

+if(DEVBASE_NLOHMANN_JSON_REQUIRED)
+    find_package(nlohmann_json REQUIRED)
+
+    if(NOT nlohmann_json_FOUND)
+        message(FATAL_ERROR "nlohmann json not found")
+    endif()
+
+    message(STATUS "Found nlohmann json: ${JSON_INCLUDE_DIR}")
+
+    include_directories(
+        SYSTEM
+        ${JSON_INCLUDE_DIR}
+    )
+endif()
+
+
 if(DEVBASE_LOKI_REQUIRED)
     find_package(Loki REQUIRED)
 endif()


Solve the problem seen when using recent versions of CMake (such as 2.8.11): OpenCVConfig.cmake violates the policy CMP0004.

Symptoms:
CMake Error at CMakeLists.txt:10 (add_executable):
Target "my_app" links to item "C:/Program Files " which has leading
or trailing whitespace. This is now an error according to policy CMP0004.

This problem occurs when building on Windows when we depend on libraries located (for example) in "C:\Program Files (x86)..."

--- cmake/OpenCVGenConfig.cmake
+++ cmake/OpenCVGenConfig.cmake
@@ -84,7 +84,7 @@

     set(OPENCV_DEPENDENCIES_MAP_${suffix} "${OPENCV_DEPENDENCIES_MAP_${suffix}}set(OpenCV_${__ocv_lib}_LIBNAME_${suffix} \"${__libname}\")\n")
     set(OPENCV_DEPENDENCIES_MAP_${suffix} "${OPENCV_DEPENDENCIES_MAP_${suffix}}set(OpenCV_${__ocv_lib}_DEPS_${suffix} ${__mod_deps})\n")
-    set(OPENCV_DEPENDENCIES_MAP_${suffix} "${OPENCV_DEPENDENCIES_MAP_${suffix}}set(OpenCV_${__ocv_lib}_EXTRA_DEPS_${suffix} ${__ext_deps})\n")
+    set(OPENCV_DEPENDENCIES_MAP_${suffix} "${OPENCV_DEPENDENCIES_MAP_${suffix}}set(OpenCV_${__ocv_lib}_EXTRA_DEPS_${suffix} \"${__ext_deps}\")\n")

     list(APPEND OPENCV_PROCESSED_LIBS ${__ocv_lib})
     list(APPEND OPENCV_LIBS_TO_PROCESS ${${__ocv_lib}_MODULE_DEPS_${suffix}})


Updated to Boost 1.55.

Updated to Boost 1.55.

--- cmake/ThirdPartyBoost.cmake
+++ cmake/ThirdPartyBoost.cmake
@@ -26,8 +26,8 @@
         EXTERNALPROJECT_ADD(
             boost
             PREFIX ${TPSRC}
-            URL ${TPURL}/boost_1_49_0.tar.bz2
-            URL_MD5 "0d202cb811f934282dea64856a175698"
+            URL ${TPURL}/boost_1_55_0.tar.bz2
+            URL_MD5 "d6eef4b4cacb2183f2bf265a5a03a354"
             DOWNLOAD_DIR ${TPSRC}
             CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ./bootstrap.sh --prefix=${TPSRC}/dist
             BUILD_COMMAND NO_BZIP2=1 ./b2
@@ -83,8 +83,8 @@
         EXTERNALPROJECT_ADD(
             boost
             PREFIX ${TPSRC}
-            URL ${TPURL}/boost_1_49_0.tar.bz2
-            URL_MD5 "0d202cb811f934282dea64856a175698"
+            URL ${TPURL}/boost_1_55_0.tar.bz2
+            URL_MD5 "d6eef4b4cacb2183f2bf265a5a03a354"
             DOWNLOAD_DIR ${TPSRC}
             CONFIGURE_COMMAND bootstrap.bat --prefix=${TPSRC}/boost
             BUILD_COMMAND b2 --layout=system install


Clang: Do not use new pointer option

Clang: Do not use new pointer option

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -650,9 +650,10 @@
 		-D__CUSTOM_FILE_IO__
 		)

-	if (NOT "${OS}" STREQUAL "qurt")
-		# -fcheck-new is not supported by clang-3.5 from
-		# HEXAGON_Tools/7.2.10/Tools/bin/hexagon-clang.
+	if (NOT (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*"))
+		# -fcheck-new is a no-op for Clang in general
+		# and has no effect, but can generate a compile
+		# error for some OS
 		list(APPEND cxx_compile_flags
 			-fcheck-new
 		)


Android API version switch

Android API version switch

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -20,18 +20,15 @@
 #   * https://github.com/ruslo/hunter/wiki/dev.modules#hunter_config

 include(hunter_config)
+include(hunter_user_error)

 # NOTE: no names with spaces!

 hunter_config(Android-Apk VERSION 1.1.5)
 hunter_config(Android-Build-Tools VERSION 22.0.1)
-hunter_config(Android-Google-APIs VERSION 21) # API 21
-hunter_config(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 21) # API 21
 hunter_config(Android-Google-Repository VERSION 19)
-hunter_config(Android-Intel-x86-Atom-System-Image VERSION 21) # API 21
 hunter_config(Android-Modules VERSION 1.0.0)
 hunter_config(Android-SDK VERSION 0.0.2)
-hunter_config(Android-SDK-Platform VERSION 21_r02) # API 21
 hunter_config(Android-SDK-Platform-tools VERSION r22)
 hunter_config(Android-SDK-Tools VERSION 24.3.3)
 hunter_config(Android-Support-Repository VERSION 16)
@@ -67,7 +64,6 @@
 hunter_config(RapidJSON VERSION 0.11-hunter)
 hunter_config(SQLite3 VERSION autoconf-3080803) #R-Tree enabled
 hunter_config(Sober VERSION 0.1.2)
-hunter_config(Sources-for-Android-SDK VERSION 21) # API 21
 hunter_config(Sugar VERSION 1.2.2)
 hunter_config(TIFF VERSION 4.0.2-p3)
 hunter_config(Washer VERSION 0.1.2)
@@ -88,3 +84,40 @@
 hunter_config(sparsehash VERSION 2.0.2)
 hunter_config(szip VERSION 2.1.0-p1)
 hunter_config(wxWidgets VERSION 3.0.2)
+
+if(ANDROID)
+  string(COMPARE EQUAL "${ANDROID_NATIVE_API_LEVEL}" "" _is_empty)
+  if(_is_empty)
+    hunter_user_error("ANDROID_NATIVE_API_LEVEL is empty")
+  endif()
+
+  string(COMPARE EQUAL "${ANDROID_NATIVE_API_LEVEL}" "21" _is_api_21)
+  string(COMPARE EQUAL "${ANDROID_NATIVE_API_LEVEL}" "19" _is_api_19)
+  string(COMPARE EQUAL "${ANDROID_NATIVE_API_LEVEL}" "16" _is_api_16)
+
+  if(_is_api_21)
+    hunter_config(Android-Google-APIs VERSION 21)
+    hunter_config(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 21)
+    hunter_config(Android-Intel-x86-Atom-System-Image VERSION 21)
+    hunter_config(Android-SDK-Platform VERSION 21_r02)
+    hunter_config(Sources-for-Android-SDK VERSION 21)
+  elseif(_is_api_19)
+    hunter_config(Android-Google-APIs VERSION 19)
+    # No package Android-Google-APIs-Intel-x86-Atom-System-Image (?)
+    hunter_config(Android-Intel-x86-Atom-System-Image VERSION 19)
+    hunter_config(Android-SDK-Platform VERSION 19_r04)
+    hunter_config(Sources-for-Android-SDK VERSION 19)
+  elseif(_is_api_16)
+    hunter_config(Android-Google-APIs VERSION 16)
+    # No package Android-Google-APIs-Intel-x86-Atom-System-Image (?)
+    hunter_config(Android-Intel-x86-Atom-System-Image VERSION 16)
+    hunter_config(Android-SDK-Platform VERSION 16_r05)
+    hunter_config(Sources-for-Android-SDK VERSION 16)
+  else()
+    hunter_user_error(
+        "Android API (ANDROID_NATIVE_API_LEVEL)"
+        " Expected: `21`, `19`, `16`"
+        " Got: `${ANDROID_NATIVE_API_LEVEL}`"
+    )
+  endif()
+endif()


CMake: Partial revert

CMake: Partial revert

--- cmake/macros/FindPoco.cmake
+++ cmake/macros/FindPoco.cmake
@@ -142,51 +142,7 @@
         ${LIB_FOUNDATION_RELEASE}
         ${LIB_NET_RELEASE}
         ${LIB_XML_RELEASE}
-      )
-
-    FIND_LIBRARY(SHARED_DATA_LIB
-      NAMES
-        ${LIB_DATA}.so.
-      PATHS
-        ${POCO_LIBRARIES_DIR}
-    )
-
-    FIND_LIBRARY(SHARED_DATA_MYSQL_LIB
-      NAMES
-        ${LIB_DATA_MYSQL}.so.
-      PATHS
-        ${POCO_LIBRARIES_DIR}
-    )
-
-    FIND_LIBRARY(SHARED_FOUNDATION_LIB
-      NAMES
-        ${LIB_FOUNDATION}.so.
-      PATHS
-        ${POCO_LIBRARIES_DIR}
-    )
-
-    FIND_LIBRARY(SHARED_NET_LIB
-      NAMES
-        ${LIB_NET}.so.
-      PATHS
-        ${POCO_LIBRARIES_DIR}
-    )
-
-    FIND_LIBRARY(SHARED_XML_LIB
-      NAMES
-        ${LIB_XML}.so.
-      PATHS
-        ${POCO_LIBRARIES_DIR}
-    )
-
-    set( POCO_RUNTIME
-        ${SHARED_DATA_LIB}
-        ${SHARED_DATA_MYSQL_LIB}
-        ${SHARED_FOUNDATION_LIB}
-        ${SHARED_NET_LIB}
-        ${SHARED_XML_LIB}
-      )
-
+      )
 else ()
     if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
       set( POCO_LIBRARIES


Install libLLVM if needed with LLVM_INSTALL_TOOLCHAIN_ONLY

Summary:
When LLVM_LINK_LLVM_DYLIB is set, the libLLVM shared
library needs to be installed in the toolchain.  Without
this chanage LLVM_INSTALL_TOOLCHAIN_ONLY combined with
LLVM_LINK_LLVM_DYLIB results in a broken install.

Patch by Sam Clegg

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -555,7 +555,8 @@
   elseif(ARG_BUILDTREE_ONLY)
     set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
   else()
-    if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO")
+    if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR
+        (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM"))
       set(install_dir lib${LLVM_LIBDIR_SUFFIX})
       if(ARG_SHARED OR BUILD_SHARED_LIBS)
         if(WIN32 OR CYGWIN OR MINGW)


fix typo

fix typo

--- cmake/modules/FindCAP.cmake
+++ cmake/modules/FindCAP.cmake
@@ -9,7 +9,7 @@
 		cap
 )

-SET(CAP_INCLUDE_DIR ${CAP_INCLUDE_DIR})
+SET(CAP_INCLUDE_DIRS ${CAP_INCLUDE_DIR})
 SET(CAP_LIBRARIES ${CAP_LIBRARY})

 IF(CAP_INCLUDE_DIRS)


io component library was named ustdio in version 2.4

--- FindICU.cmake
+++ FindICU.cmake
@@ -92,7 +92,7 @@
 icu_declare_component(data icudata)
 icu_declare_component(uc   icuuc)         # Common and Data libraries
 icu_declare_component(i18n icui18n icuin) # Internationalization library
-icu_declare_component(io   icuio)         # Stream and I/O Library
+icu_declare_component(io   icuio ustdio)  # Stream and I/O Library
 icu_declare_component(le   icule)         # Layout library
 icu_declare_component(lx   iculx)         # Paragraph Layout library


New version: 0.4.8

New version: 0.4.8

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "7")
+SET(HAWKEY_PATCH "8")


Updating version to 0.6.0 for development

--- Version.cmake
+++ Version.cmake
@@ -1,6 +1,6 @@
 # Version info
 set(SimpleITK_Major 0)
-set(SimpleITK_Minor 5)
+set(SimpleITK_Minor 6)
 set(SimpleITK_Patch 0)

 include(GetGitRevisionDescription)


Fix append object description on typesystem only when this was found.

Reviewer: Marcelo Lira <6be3b93b2f09145ada72571578cc4097e4ba9a9e@openbossa.org>
          Hugo Parente Lima <hugo.pl@gmail.com>

--- cmake/Macros/PySideModules.cmake
+++ cmake/Macros/PySideModules.cmake
@@ -73,7 +73,6 @@
     else ()
         set (include_file ${module})
     endif ()
-    append_class_xml(${commom_xml} "${CMAKE_CURRENT_SOURCE_DIR}/optional/${class}.xml")
     string(TOLOWER ${class} _class)
     string(TOUPPER ${module} _module)
     if (${namespace})
@@ -111,6 +110,7 @@
         if(Q_WORKS)
             message(STATUS "Checking for ${class} in ${module} -- found")
             list(APPEND ${global_sources} ${_cppfile})
+            append_class_xml(${commom_xml} "${CMAKE_CURRENT_SOURCE_DIR}/optional/${class}.xml")
         else()
             message(STATUS "Checking for ${class} in ${module} -- not found")
         endif()


- Add SSL as a root include, necessary for good builds

--- cmake/Modules/BuildOptions.cmake
+++ cmake/Modules/BuildOptions.cmake
@@ -64,4 +64,10 @@
 # Toggle some preprocessor flags
 if(COFFEE_BUILD_OCULUSVR)
     add_definitions(-DCOFFEE_OCULUSVR_ENABLED)
+endif()
+
+# Include SSL if built
+if(COFFEE_BUILD_OPENSSL)
+    find_package ( OpenSSL REQUIRED )
+    include_directories ( ${OPENSSL_INCLUDE_DIR} )
 endif()


Fixed feature matching module linking problem

--- cmake/UseDOFeatureMatching.cmake
+++ cmake/UseDOFeatureMatching.cmake
@@ -26,7 +26,8 @@

 macro (do_create_variables_for_featurematching_library)
   set(DO_FeatureMatching_LIBRARIES DO_FeatureMatching)
-  set(DO_FeatureMatching_LINK_LIBRARIES "${DO_Graphics_LIBRARIES};flann_cpp_s")
+  set(DO_FeatureMatching_LINK_LIBRARIES
+      "${DO_Graphics_LIBRARIES};${DO_Core_LIBRARIES};flann_cpp_s")
 endmacro (do_create_variables_for_featurematching_library)

 do_load_packages_for_featurematching_library()


lcov: don't reset counters after each test

Signed-off-by: Noah Watkins <86ecd7d1c53cf33a85014f7cab78876cb4491020@gmail.com>

--- cmake/modules/CodeCoverage.cmake
+++ cmake/modules/CodeCoverage.cmake
@@ -140,7 +140,7 @@
 	ADD_CUSTOM_TARGET(${_targetname}

 		# Cleanup lcov
-		${LCOV_PATH} --directory . --zerocounters
+        #${LCOV_PATH} --directory . --zerocounters

 		# Run tests
 		COMMAND ${test_command} ${ARGV3}


wxWidgets driver is now OFF by default. The driver won't compile for some days due to huge code changes.

svn path=/trunk/; revision=8395

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -126,7 +126,7 @@
 "tk:tk:ON"
 "tkwin:tkwin:ON"
 "wingcc:wingcc:ON"
-"wxwidgets:wxwidgets:ON"
+"wxwidgets:wxwidgets:OFF"
 "xfig:xfig:ON"
 "xwin:xwin:ON"
 )


Use C++17 mode with newer clang

Use C++17 mode with newer clang

--- cmake_modules/IMPFindC++11.cmake
+++ cmake_modules/IMPFindC++11.cmake
@@ -37,7 +37,8 @@
     message(STATUS "clang version: ${CLANG_VERSION}")
     # Modern clang (6 or later) uses C++14 by default; don't force older C++11
     if(CLANG_VERSION VERSION_GREATER 6.0)
-      message(STATUS "Using clang C++11 (or later) support")
+      message(STATUS "Enabling clang C++17 support")
+      set(IMP_CXX11_FLAGS "--std=c++17" CACHE INTERNAL "" FORCE)
     # c++11's std::move (which boost/CGAL use) doesn't work until
     # OS X 10.9 (Darwin version 13)
     elseif(APPLE AND DARWIN_VERSION LESS 13)


TRAVIS: typo in error message

TRAVIS: typo in error message

--- Utilities/Maintenance/TravisBuild.cmake
+++ Utilities/Maintenance/TravisBuild.cmake
@@ -11,7 +11,7 @@
   set(BUILD_NAME_PREFIX "PR-travis-$ENV{TRAVIS_PULL_REQUEST}")
 endif()

-set(CTEST_BUILD_NAME "${BUILD_NAME_PREFIX}-$ENV{TRAVIS_BRANCH}-$ENV{CC}-${CTEST_BUILD_CONFIGURATION}")
+set(CTEST_BUILD_NAME "${BUILD_NAME_PREFIX}-$ENV{CC}-${CTEST_BUILD_CONFIGURATION}-$ENV{TRAVIS_BRANCH}")
 set(CTEST_SITE "travis-ci.org")

 set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/orfeotoolbox/OTB")
@@ -24,13 +24,13 @@
 if(DEFINED ENV{MAKE_CMD})
   set(CMAKE_MAKE_PROGRAM "$ENV{MAKE_CMD}")
 else()
-  message(FATAL_ERROR "MAKE_CMD evironment variable is not defined")
+  message(FATAL_ERROR "MAKE_CMD environment variable is not defined")
 endif()

 if(DEFINED ENV{CMAKE_GEN})
   set(CTEST_CMAKE_GENERATOR "$ENV{CMAKE_GEN}")
 else()
-  message(FATAL_ERROR "CMAKE_GEN evironment variable is not defined")
+  message(FATAL_ERROR "CMAKE_GEN environment variable is not defined")
 endif()

 set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000)


Update Go to 1.4.2

Update Go to 1.4.2

--- golang.cmake
+++ golang.cmake
@@ -11,10 +11,10 @@
 include (BuildSupport)

 external_source (golang
-    1.3.3
-    go1.3.3.src.tar.gz
-    2cdbad6baefcf1007f3cf54a5bc878b7
-    http://golang.org/dl)
+    1.4.2
+    go1.4.2.src.tar.gz
+    907f85c8fa765d31f7f955836fec4049
+    https://storage.googleapis.com/golang)

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


adding support for EMBREE_INCLUDE_DIRS and EMBREE_LIBRARY again to embree-config.cmake

--- common/cmake/embree-config.cmake
+++ common/cmake/embree-config.cmake
@@ -3,6 +3,10 @@

 SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIV_ROOT_DIR@)
 GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE)
+
+SET(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@)
+SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@)
+SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY})

 MARK_AS_ADVANCED(embree_DIR)


CMake: correct own error in FindSuperLU

CMake: correct own error in FindSuperLU

--- toonz/cmake/FindSuperLU.cmake
+++ toonz/cmake/FindSuperLU.cmake
@@ -19,8 +19,7 @@
         ${THIRDPARTY_LIBS_HINTS}
     )
     set(_lib_suffixes
-        lzo/2.09/lib
-        lzo/2.03/lib/LZO_lib
+        superlu
     )
 endif()


Also update ARM.cmake

Also update ARM.cmake

--- tools/cmake/toolchains/ARM.cmake
+++ tools/cmake/toolchains/ARM.cmake
@@ -8,48 +8,40 @@
 set(ARM_ELF2BIN "fromelf")
 set_property(GLOBAL PROPERTY ELF2BIN ${ARM_ELF2BIN})

+# tell cmake about compiler targets.
+# This will cause it to add the --target flag.
+set(CMAKE_C_COMPILER_TARGET arm-arm-none-eabi)
+set(CMAKE_CXX_COMPILER_TARGET arm-arm-none-eabi)
+
 # Sets toolchain options
-function(mbed_set_toolchain_options target)
-    list(APPEND common_options
-        "-c"
-        "--target=arm-arm-none-eabi"
-        "-mthumb"
-        "-Wno-armcc-pragma-push-pop"
-        "-Wno-armcc-pragma-anon-unions"
-        "-Wno-reserved-user-defined-literal"
-        "-Wno-deprecated-register"
-        "-fdata-sections"
-        "-fno-exceptions"
-        "-fshort-enums"
-        "-fshort-wchar"
+list(APPEND common_options
+    "-mthumb"
+    "-Wno-armcc-pragma-push-pop"
+    "-Wno-armcc-pragma-anon-unions"
+    "-Wno-reserved-user-defined-literal"
+    "-Wno-deprecated-register"
+    "-fdata-sections"
+    "-fno-exceptions"
+    "-fshort-enums"
+    "-fshort-wchar"
     )

-    target_compile_options(${target}
-        INTERFACE
-            $<$<COMPILE_LANGUAGE:C>:${common_options}>
+list(APPEND asm_compile_options
+    -masm=auto
+    --target=arm-arm-none-eabi
     )

-    target_compile_options(${target}
-        INTERFACE
-            $<$<COMPILE_LANGUAGE:CXX>:${common_options}>
+list(APPEND link_options
+    "--map"
     )

-    target_compile_options(${target}
-        INTERFACE
-            $<$<COMPILE_LANGUAGE:ASM>:--target=arm-arm-none-eabi -masm=auto>
-    )
+# Add linking time preprocessor macro for TFM targets
+if(MBED_CPU_CORE MATCHES "-NS$")
+        )
+endif()

-    # Add linking time preprocessor macro for TFM targets
-    if(MBED_CPU_CORE MATCHES "\-NS$")
-        list(APPEND link_options
-            "--predefine=\"-DDOMAIN_NS=0x1\""
-        )
-    endif()
-
-    target_link_options(${target}
-        INTERFACE
-            ${link_options}
-    )
+function(mbed_set_toolchain_options target)
+    # blank for ARMClang
 endfunction()

 # Configure the toolchain to select the selected C library


Added build of rc_receiver to qurt_eagle_legacy_driver_default

Signed-off-by: Mark Charlebois <f1891e7fc976ae1bd489627e2954fb730751d728@gmail.com>

--- cmake/configs/qurt_eagle_legacy_driver_default.cmake
+++ cmake/configs/qurt_eagle_legacy_driver_default.cmake
@@ -70,7 +70,7 @@
 	#
 	# FC_ADDON drivers
 	#
-	#platforms/qurt/fc_addon/rc_receiver
+	platforms/qurt/fc_addon/rc_receiver
 	#platforms/qurt/fc_addon/mpu_spi

 	#


new: compile test

new: compile test

--- testing/run_tests.sh.cmake
+++ testing/run_tests.sh.cmake
@@ -14,9 +14,12 @@
 ###############################################################
 WD=$PWD/test_output
 FLAG_KEEP_OUTPUT=1
+if [ "x$CFLAGS" = "x" ]; then
+	CFLAGS=""
+fi
 ###############################################################
 set -u
-set -e
+#set -e
 TIMESTAMP=$(date +%m-%d-%Y_%H-%M-%S)
 LOGFILE=$PWD/run_tests.log.$TIMESTAMP
 WD=$WD/$TIMESTAMP
@@ -24,21 +27,79 @@
 mkdir -p $WD
 cd $WD

-NUM_SUCCESS=0
-NUM_FAIL=0
+NUM_SUCCESS_TRANS=0
+NUM_FAIL_TRANS=0
+NUM_SUCCESS_COMPILE=0
+NUM_FAIL_COMPILE=0
+NUM_SUCCESS_EXEC=0
+NUM_FAIL_EXEC=0

 function finish()
 {
-	echo "All tests completed. #SUCCESS: $NUM_SUCCESS, #FAIL: $NUM_FAIL."
+	echo "All tests completed."
+	echo  "[TRANSLATE] #SUCCESS: $NUM_SUCCESS_TRANS, #FAIL: $NUM_FAIL_TRANS."
+	echo  "[COMPILE]   #SUCCESS: $NUM_SUCCESS_COMPILE, #FAIL: $NUM_FAIL_COMPILE."
+	echo  "[EXECUTE]   #SUCCESS: $NUM_SUCCESS_EXEC, #FAIL: $NUM_FAIL_EXEC."
 	cd $ORIGINAL_DIRECTORY
 	if [ $FLAG_KEEP_OUTPUT -eq 0 ]; then
 		rm -rf $WD
 	fi
-	if [ $NUM_FAIL -eq 0 ]; then
+	if [ $NUM_FAIL_TRANS -eq 0 -a $NUM_FAIL_COMPILE -eq 0 -a \
+		$NUM_FAIL_EXEC -eq 0 ]; then
 		exit 0
 	else
 		exit 1
 	fi
+}
+
+function compile()
+{
+	src=$1
+	target=$2
+	echo compilation of $src for $target
+	src_file=$(basename $src .c).$target
+	echo $src_file
+	if [ "${MPI_ENABLED}" = "TRUE" ]; then
+		MPI_C_FLAGS="-pthread"
+		for mpiinc in $(echo "${MPI_INCLUDE_PATH}" | sed 's/;/ /g'); do
+			MPI_C_FLAGS+=" -I$mpiinc"
+		done
+	fi
+	case $target in
+		ref)
+			src_file+=".c"
+			cc -c $src_file -I${CMAKE_SOURCE_DIR}/include $CFLAGS
+			;;
+		cuda)
+			if [ "${CUDA_ENABLED}" != "TRUE" ]; then
+				echo "[COMPILE] Skipping CUDA compilation (not supported)"
+				return 0
+			fi
+			src_file+=".cu"
+			nvcc -c $src_file -I${CMAKE_SOURCE_DIR}/include -Xcompiler $CFLAGS
+			;;
+		mpi)
+			if [ "${MPI_ENABLED}" != "TRUE" ]; then
+				echo "[COMPILE] Skipping MPI compilation (not supported)"
+				return 0
+			fi
+			src_file+=".c"
+			cc -c $src_file -I${CMAKE_SOURCE_DIR}/include $MPI_C_FLAGS $CFLAGS
+			;;
+		mpi-cuda)
+			if [ "${MPI_ENABLED}" != "TRUE" -o "${CUDA_ENABLED}" != "TRUE" ]; then
+				echo "[COMPILE] Skipping MPI-CUDA compilation (not supported)"
+				return 0
+			fi
+			src_file+=".cu"
+			nvcc -c $src_file -I${CMAKE_SOURCE_DIR}/include \
+				$MPI_C_FLAGS -Xcompiler $CFLAGS
+			;;
+		*)
+			echo "Error: Unsupported target"
+			finish
+			;;
+	esac
 }

 {
@@ -51,15 +112,25 @@
 	for TARGET in $TARGETS; do
 		for TEST in $TESTS; do
 			SHORTNAME=$(basename $TEST)
-			echo "[TRANSLATION] Processing $SHORTNAME for $TARGET target"
+			echo "[TRANSLATE] Processing $SHORTNAME for $TARGET target"
 			if $PHYSISC --$TARGET -I${CMAKE_SOURCE_DIR}/include $TEST \
 				> $(basename $TEST).$TARGET.log 2>&1; then
-				echo "[TRANSLATION] SUCCESS"
-				NUM_SUCCESS=$(($NUM_SUCCESS + 1))
+				echo "[TRANSLATE] SUCCESS"
+				NUM_SUCCESS_TRANS=$(($NUM_SUCCESS_TRANS + 1))
 			else
-				echo "[TRANSLATION] FAIL"
-				NUM_FAIL=$(($NUM_FAIL + 1))
-			# Terminates immediately when failed
+				echo "[TRANSLATE] FAIL"
+				NUM_FAIL_TRANS=$(($NUM_FAIL_TRANS + 1))
+			    # Terminates immediately when failed
+				finish
+			fi
+			echo "[COMPILE] Processing $SHORTNAME for $TARGET target"
+			if compile $SHORTNAME $TARGET; then
+				echo "[COMPILE] SUCCESS"
+				NUM_SUCCESS_COMPILE=$(($NUM_SUCCESS_COMPILE + 1))
+			else
+				echo "[COMPILE] FAIL"
+				NUM_FAIL_COMPILE=$(($NUM_FAIL_COMPILE + 1))
+				# Terminates immediately when failed
 				finish
 			fi
 		done


fix the harmless but annoying plugin-not-found message from cmake

--- lib/orogen/templates/config/FindRTTPlugin.cmake
+++ lib/orogen/templates/config/FindRTTPlugin.cmake
@@ -28,7 +28,8 @@
     set(PLUGIN_NAME   ${COMPONENT} ${COMPONENT}-${OROCOS_TARGET} )
     #STRING(TOUPPER ${COMPONENT} COMPONENT)

-    set(RTT_PLUGIN_${COMPONENT}_INCLUDE_DIR ${OROCOS_RTT_INCLUDE_DIRS} )
+    set(RTT_PLUGIN_${COMPONENT}_INCLUDE_DIR ${OROCOS_RTT_INCLUDE_DIRS}
+        ${OrocosRTT_INCLUDE_DIRS})
     # Find plugins
     if(OROCOS_ROOT_DIR)
         # Use location specified by environment variable


Added initial regression tests based on sample data

--- biicode.cmake
+++ biicode.cmake
@@ -12,3 +12,22 @@
 set_tests_properties(run_pmuc PROPERTIES PASS_REGULAR_EXPRESSION "usage")
 set_tests_properties(run_pmuc PROPERTIES PASS_REGULAR_EXPRESSION "--x3d")
 set_tests_properties(run_pmuc PROPERTIES PASS_REGULAR_EXPRESSION "--collada")
+
+add_test(NAME pmuc_collada COMMAND ${BII_src_main_TARGET} --collada ${CMAKE_CURRENT_SOURCE_DIR}/data/plm-sample_11072013.rvm)
+add_test(NAME pmuc_x3d COMMAND ${BII_src_main_TARGET} --x3d ${CMAKE_CURRENT_SOURCE_DIR}/data/plm-sample_11072013.rvm)
+add_test(NAME pmuc_x3db COMMAND ${BII_src_main_TARGET} --x3db ${CMAKE_CURRENT_SOURCE_DIR}/data/plm-sample_11072013.rvm)
+
+
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "315 group")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "118 pyramid")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "173 box")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "74 rectangualr torus")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "38 circular torus")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "  2 elliptical dish")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "  0 spherical dish")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "  22 snout")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "  139 cylinder")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "  0 sphere")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "  12 line")
+set_tests_properties(pmuc_collada pmuc_x3d pmuc_x3db PROPERTIES PASS_REGULAR_EXPRESSION "  80 facet group")
+


Add vtkIOCore to the required modules.

Add vtkIOCore to the required modules.

Since vtkIOSQL was removed, vtkIOCore must be explicitly used.

--- module.cmake
+++ module.cmake
@@ -10,6 +10,7 @@
   DEPENDS
     vtkImagingCore
     vtkIOImage
+    vtkIOCore
   PRIVATE_DEPENDS
     vtkzlib
   COMPILE_DEPENDS


added -stdlib=libc++ flag when using clang

--- CMake/config.cmake
+++ CMake/config.cmake
@@ -90,7 +90,7 @@
 endif()

 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11")
   message(STATUS "added flag -std=c++11 to g++")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
   message(WARNING "clang support is currently experimental")


better handling of framework and system framework include directories

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -860,23 +860,42 @@
 	set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
 endfunction()

-macro (cotire_add_frameworks_to_cmd _cmdVar _language)
+function (cotire_add_frameworks_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
 	if (APPLE)
-		set (_frameWorkDirs "")
-		foreach (_include ${ARGN})
+		set (_frameworkDirs "")
+		foreach (_include ${${_includesVar}})
 			if (IS_ABSOLUTE "${_include}" AND _include MATCHES "\\.framework$")
-				get_filename_component(_frameWorkDir "${_include}" DIRECTORY)
-				list (APPEND _frameWorkDirs "${_frameWorkDir}")
+				get_filename_component(_frameworkDir "${_include}" DIRECTORY)
+				list (APPEND _frameworkDirs "${_frameworkDir}")
 			endif()
 		endforeach()
-		if (_frameWorkDirs)
-			list (REMOVE_DUPLICATES _frameWorkDirs)
-			foreach (_frameWorkDir ${_frameWorkDirs})
-				list (APPEND ${_cmdVar} "${CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG}${_frameWorkDir}")
+		set (_systemFrameworkDirs "")
+		foreach (_include ${${_systemIncludesVar}})
+			if (IS_ABSOLUTE "${_include}" AND _include MATCHES "\\.framework$")
+				get_filename_component(_frameworkDir "${_include}" DIRECTORY)
+				list (APPEND _systemFrameworkDirs "${_frameworkDir}")
+			endif()
+		endforeach()
+		if (_systemFrameworkDirs)
+			list (APPEND _frameworkDirs ${_systemFrameworkDirs})
+		endif()
+		if (_frameworkDirs)
+			list (REMOVE_DUPLICATES _frameworkDirs)
+			foreach (_frameworkDir ${_frameworkDirs})
+				set (_index -1)
+				if ("${CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG}" MATCHES ".+")
+					list (FIND _systemFrameworkDirs "${_frameworkDir}" _index)
+				endif()
+				if (_index GREATER -1)
+					list (APPEND ${_cmdVar} "${CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG}${_frameworkDir}")
+				else()
+					list (APPEND ${_cmdVar} "${CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG}${_frameworkDir}")
+				endif()
 			endforeach()
 		endif()
 	endif()
-endmacro()
+	set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
+endfunction()

 macro (cotire_add_compile_flags_to_cmd _cmdVar)
 	foreach (_flag ${ARGN})
@@ -1143,7 +1162,7 @@
 	cotire_add_definitions_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_COMPILE_DEFINITIONS})
 	cotire_add_compile_flags_to_cmd(_cmd ${_option_COMPILE_FLAGS})
 	cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
-	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_INCLUDE_DIRECTORIES})
+	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
 	cotire_add_makedep_flags("${_option_LANGUAGE}" "${_option_COMPILER_ID}" "${_option_COMPILER_VERSION}" _cmd)
 	# only consider existing source files for scanning
 	set (_existingSourceFiles "")
@@ -1746,7 +1765,7 @@
 	cotire_add_definitions_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_COMPILE_DEFINITIONS})
 	cotire_add_compile_flags_to_cmd(_cmd ${_option_COMPILE_FLAGS})
 	cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
-	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_INCLUDE_DIRECTORIES})
+	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
 	cotire_add_pch_compilation_flags(
 		"${_option_LANGUAGE}" "${_option_COMPILER_ID}" "${_option_COMPILER_VERSION}"
 		"${_prefixFile}" "${_pchFile}" "${_hostFile}" _cmd)
@@ -2093,8 +2112,10 @@
 		XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
 		CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
 		CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
-		CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
-		CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG CMAKE_INCLUDE_FLAG_${_language}_SEP
+		CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_${_language}_SEP
+		CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
+		CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
+		CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
 		CMAKE_${_language}_SOURCE_FILE_EXTENSIONS)
 		if (DEFINED ${_var})
 			string (REPLACE "\"" "\\\"" _value "${${_var}}")


update common.cmake with proper env var handling

--- common.cmake
+++ common.cmake
@@ -46,7 +46,7 @@

         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
     elseif(${CMAKE_MAKE_PROGRAM} MATCHES "(msdev|devenv|nmake|MSBuild)")
-        add_definitions("/W3")
+        add_definitions("/W2")
     else ()
         message(FATAL_ERROR "Your C++ compiler does not support C++11.")
     endif ()


add generated constant definitions to library

Summary: when trying to build openr with `getDeps.py` constant definitions where not available since they were not part of the generated thrift lib. this fixes it.

Reviewed By: chadaustin

Differential Revision: D16064417

fbshipit-source-id: ee2b3e061caf67235f4a873405cf6cd6fb663ef4

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -59,12 +59,12 @@
   # Compute the list of generated files
   list(APPEND generated_headers
     "${output_dir}/gen-cpp2/${base}_constants.h"
-    "${output_dir}/gen-cpp2/${base}_constants.cpp"
     "${output_dir}/gen-cpp2/${base}_types.h"
     "${output_dir}/gen-cpp2/${base}_types.tcc"
     "${output_dir}/gen-cpp2/${base}_types_custom_protocol.h"
   )
   list(APPEND generated_sources
+    "${output_dir}/gen-cpp2/${base}_constants.cpp"
     "${output_dir}/gen-cpp2/${base}_data.h"
     "${output_dir}/gen-cpp2/${base}_data.cpp"
     "${output_dir}/gen-cpp2/${base}_types.cpp"


clarify comment

clarify comment

--- CMake/toolchain.cmake
+++ CMake/toolchain.cmake
@@ -58,7 +58,7 @@
 endif()

-# post-process elf files into .bin files:
+# post-process elf files into .bin files (legacy backwards-compatible command):
 set(YOTTA_POSTPROCESS_COMMAND "${ARM_NONE_EABI_OBJCOPY} -O binary YOTTA_CURRENT_EXE_NAME YOTTA_CURRENT_EXE_NAME.bin")


[cmake] Add more flags, variable predef.

--- cmake/Modules/WintermuteVariables.cmake
+++ cmake/Modules/WintermuteVariables.cmake
@@ -25,23 +25,26 @@
   -Wctor-dtor-privacy
   -Wenum-compare
   -fmessage-length=0
+  -Wnon-virtual-dtor
   )

 SET(WINTERMUTE_COMPILE_FLAGS_DEBUG
   -O0
-  -g3
   -Wextra
+  -Woverloaded-virtual
+  -Wno-deprecated
+  -Wswitch-default
+  -Wno-unused-parameter
+  -Wold-style-cast
+  -Wswitch-enum
   -Wno-conversion-null
-  -Wno-deprecated
   -Wno-system-headers
-  -Wno-unused-parameter
-  -Woverloaded-virtual
   -Wshadow
   -Wunused-function
   -Wunused-parameter
   -Wunused-variable
   -Wwrite-strings
-  -Werror=unused
+  -Woverloaded-virtual
   -ggdb3
   )

@@ -68,12 +71,21 @@
     list(APPEND WINTERMUTE_COMPILE_FLAGS_DEBUG
       -fprofile-arcs
       -ftest-coverage
-      -gstabs+
+      #-gstabs+
     )
   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     list(APPEND WINTERMUTE_COMPILE_FLAGS_DEBUG
     )
   endif()
+endif()
+
+if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL Linux)
+  set(CMAKE_EXE_LINKER_FLAGS
+    "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
+  set(CMAKE_SHARED_LINKER_FLAGS
+    "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
+  set(CMAKE_MODULE_LINKER_FLAGS
+    "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
 endif()

 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
@@ -86,3 +98,7 @@
     --std=c++14
   )
 endif()
+
+if (NOT DEFINED WINTERMUTE_SOURCE_INCLUDE_DIRS)
+  set(WINTERMUTE_SOURCE_INCLUDE_DIRS "")
+endif()


FIX: set fixed directories where required

--- CMakeLists.unix.cmake
+++ CMakeLists.unix.cmake
@@ -4,10 +4,12 @@
 	find_library(RT_LIB NAMES rt)
 	message(STATUS "RT library found at ${RT_LIB}")

+	# Fixed directory for systemd
 	set(CMAKE_INSTALL_SYSTEMD_UNIT_PATH /usr/lib/systemd/system)
 	set(CMAKE_BUILD_SYSTEMD_UNIT_PATH ${CMAKE_BINARY_DIR}/target/${CMAKE_INSTALL_SYSTEMD_UNIT_PATH})

-	set(CMAKE_INSTALL_SYSCONFIG_PATH ${CMAKE_INSTALL_SYSCONFDIR}/sysconfig)
+	# Fixed directory
+	set(CMAKE_INSTALL_SYSCONFIG_PATH /etc/sysconfig)
 	set(CMAKE_BUILD_SYSCONFIG_PATH ${CMAKE_BINARY_DIR}/target/${CMAKE_INSTALL_SYSCONFIG_PATH})
 else (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
 	message(STATUS "Compiling for " ${CMAKE_SYSTEM_NAME} "")