Refactor gmock-cmake to make each phase step more consise.

There's now three distinct actions:

 - Importing some system library: _gmock_find_and_import_from_system
 - Importing from an external project: _add_external_project_with_gmock_cflags
 - Finding a source dir: _gmock_find_src_dirs_from_include_paths

--- FindGoogleMock.cmake
+++ FindGoogleMock.cmake
@@ -100,11 +100,11 @@
 endif (GMOCK_ALWAYS_DOWNLOAD_SOURCES)

 # Already found, return
-if (GTEST_FOUND AND GMOCK_FOUND)
+if (GMOCK_FOUND)

     return ()

-endif (GTEST_FOUND AND GMOCK_FOUND)
+endif (GMOCK_FOUND)

 set (GMOCK_CXX_FLAGS "")

@@ -113,6 +113,7 @@
      "-Wno-missing-field-initializers")
 set (GMOCK_FORCE_CXX98_FLAG "-std=c++98")

+# Adds a flag to CXXFLAGS_VARIABLE if it is supported by the current compiler.
 function (_gmock_add_cxx_flag FLAG_VARIABLE CXXFLAGS_VARIABLE)

     check_cxx_compiler_flag ("${${FLAG_VARIABLE}}" HAVE_${FLAG_VARIABLE})
@@ -130,6 +131,8 @@
 _gmock_add_cxx_flag (GMOCK_NO_ERROR_MISSING_FIELD_INITIALIZERS_FLAG
                      GMOCK_CXX_FLAGS)

+# A wrapper around polysquare_import_external_project. This will cause
+# CXXFLAGS to be set as desired, but only when importing the external project.
 function (_add_external_project_with_gmock_cflags PROJECT_NAME EXPORTS)

     set (ADD_WITH_FLAGS_MULTIVAR_ARGS OPTIONS TARGETS INCLUDE_DIRS NAMESPACES)
@@ -160,6 +163,209 @@

 endfunction (_add_external_project_with_gmock_cflags)

+# Converts a library name to uppercase and appends LIBRARY
+function (_gmock_library_var_from_library_name LIBRARY_NAME
+                                               LIBRARY_VARIABLE_RETURN)
+
+    string (TOUPPER "${LIBRARY_NAME}" LIBRARY_NAME_UPPER)
+    set (${LIBRARY_VARIABLE_RETURN} ${LIBRARY_NAME_UPPER}_LIBRARY PARENT_SCOPE)
+
+endfunction (_gmock_library_var_from_library_name)
+
+# Finds the very first component of an include path, uppercases it and
+# appends _INCLUDE_DIR
+function (_gmock_include_dir_var_from_include_path INCLUDE_PATH
+                                                   INCLUDE_DIR_VARIABLE_RETURN)
+
+    get_filename_component (FIRST_DIRECTORY "${INCLUDE_PATH}" PATH)
+    string (TOUPPER "${FIRST_DIRECTORY}" INCLUDE_DIR_UPPER)
+    set (${INCLUDE_DIR_VARIABLE_RETURN}
+         ${INCLUDE_DIR_UPPER}_INCLUDE_DIR
+         PARENT_SCOPE)
+
+endfunction (_gmock_include_dir_var_from_include_path)
+
+macro (_gmock_fail_find_and_import_if_unset VARIABLE)
+
+    if (NOT ${VARIABLE})
+
+        # Make sure to unset all cache entries
+        foreach (LIBRARY_NAME ${FIND_AND_IMPORT_LIBRARIES})
+
+            _gmock_library_var_from_library_name (${LIBRARY_NAME}
+                                                  LIBRARY_VARIABLE)
+            unset (${LIBRARY_VARIABLE}_PATH CACHE)
+
+        endforeach ()
+
+        foreach (INCLUDE_PATH ${FIND_AND_IMPORT_INCLUDE_PATHS})
+
+            _gmock_include_dir_var_from_include_path (${INCLUDE_PATH}
+                                                      INCLUDE_DIR_VARIABLE)
+            unset (${INCLUDE_DIR_VARIABLE}_PATH CACHE)
+
+        endforeach ()
+
+        set (${SUCCESS_RETURN} FALSE PARENT_SCOPE)
+        return ()
+
+    endif (NOT ${VARIABLE})
+
+endmacro (_gmock_fail_find_and_import_if_unset)
+
+# Finds libraries and include dirs as installed on the system and
+# creates import targets for all of them (and puts them into the cache
+# as (LIBRARY_UPPERCASE|INCLUDE_DIR_UPPERCASE)_(LIBRARY|INCLUDE_DIR))
+#
+# SUCCESS_RETURN will be true if the import operation was successful.
+#
+# For example, specifying gtest in LIBRARIES and gtest/gtest.h in
+# INCLUDE_PATHS will insert GTEST_LIBRARY and GTEST_LIBRARY_LOCATION into
+# the cache as well as GTEST_INCLUDE_DIR
+function (_gmock_find_and_import_from_system SUCCESS_RETURN)
+
+    set (FIND_AND_IMPORT_FROM_SYSTEM_MULTIVAR_ARGS LIBRARIES INCLUDE_PATHS)
+    cmake_parse_arguments (FIND_AND_IMPORT
+                           ""
+                           ""
+                           "${FIND_AND_IMPORT_FROM_SYSTEM_MULTIVAR_ARGS}"
+                           ${ARGN})
+
+    # Phase 1 just finds libraries and include dirs. If any are not
+    # found then we bail out
+    foreach (LIBRARY_NAME ${FIND_AND_IMPORT_LIBRARIES})
+
+        _gmock_library_var_from_library_name (${LIBRARY_NAME} LIBRARY_VARIABLE)
+        find_library (${LIBRARY_VARIABLE}_PATH ${LIBRARY_NAME})
+        _gmock_fail_find_and_import_if_unset (${LIBRARY_VARIABLE}_PATH)
+
+    endforeach ()
+
+    foreach (INCLUDE_PATH ${FIND_AND_IMPORT_INCLUDE_PATHS})
+
+        _gmock_include_dir_var_from_include_path (${INCLUDE_PATH}
+                                                  INCLUDE_DIR_VARIABLE)
+        find_path (${INCLUDE_DIR_VARIABLE}_PATH ${INCLUDE_PATH})
+        _gmock_fail_find_and_import_if_unset (${INCLUDE_DIR_VARIABLE}_PATH)
+
+    endforeach ()
+
+    # Phase 2 looks through all the libraries and include dirs again,
+    # assumes that ${LIBRARY_VARIABLE}_PATH / ${INCLUDE_DIR_VARIABLE}_PATH
+    # have been set and imports those libraries, making them available in
+    # the cache
+    foreach (LIBRARY_NAME ${FIND_AND_IMPORT_LIBRARIES})
+
+        _gmock_library_var_from_library_name (${LIBRARY_NAME} LIBRARY_VARIABLE)
+        polysquare_import_utils_import_library (${LIBRARY_VARIABLE}
+                                                ${LIBRARY_NAME} STATIC
+                                                ${${LIBRARY_VARIABLE}_PATH})
+        unset (${LIBRARY_VARIABLE}_PATH CACHE)
+
+    endforeach ()
+
+    foreach (INCLUDE_PATH ${FIND_AND_IMPORT_INCLUDE_PATHS})
+
+        _gmock_include_dir_var_from_include_path (${INCLUDE_PATH}
+                                                  INCLUDE_DIR_VARIABLE)
+        set (${INCLUDE_DIR_VARIABLE} ${${INCLUDE_DIR_VARIABLE}_PATH}
+             CACHE FILEPATH "" FORCE)
+        unset (${INCLUDE_DIR_VARIABLE}_PATH CACHE)
+
+    endforeach ()
+
+    set (${SUCCESS_RETURN} TRUE PARENT_SCOPE)
+
+endfunction (_gmock_find_and_import_from_system)
+
+# Removes INCLUDE_BASE from INCLUDE_DIR to find an installation prefix
+function (_gmock_find_prefix_from_base INCLUDE_BASE INCLUDE_DIR PREFIX_VAR)
+
+    string (LENGTH ${INCLUDE_BASE} INCLUDE_BASE_LENGTH)
+    string (LENGTH ${INCLUDE_DIR} INCLUDE_DIR_LENGTH)
+
+    math (EXPR
+          INCLUDE_PREFIX_LENGTH
+          "${INCLUDE_DIR_LENGTH} - ${INCLUDE_BASE_LENGTH}")
+    string (SUBSTRING
+            ${INCLUDE_DIR}
+            0
+            ${INCLUDE_PREFIX_LENGTH}
+            INCLUDE_PREFIX)
+
+    set (${PREFIX_VAR} ${INCLUDE_PREFIX} PARENT_SCOPE)
+
+endfunction (_gmock_find_prefix_from_base)
+
+# Finds corresponding installed source directories for an include path.
+#
+# For example, if gtest/gtest.h is passed, then this function will find
+# ${PREFIX}/src/gtest and store the result in GTEST_SRC_DIR
+function (_gmock_find_src_dirs_from_include_paths)
+
+    set (FIND_SRC_DIRS_MULTIVAR_OPTIONS INCLUDE_PATHS)
+    cmake_parse_arguments (FIND_SRC_DIRS
+                           ""
+                           ""
+                           "${FIND_SRC_DIRS_MULTIVAR_OPTIONS}"
+                           ${ARGN})
+
+    foreach (INCLUDE_PATH ${FIND_SRC_DIRS_INCLUDE_PATHS})
+
+        get_filename_component (FIRST_DIRECTORY "${INCLUDE_PATH}" PATH)
+        string (TOUPPER "${FIRST_DIRECTORY}" PREFIX_UPPER)
+
+        find_path (${PREFIX_UPPER}_INCLUDE_DIR_CACHE ${INCLUDE_PATH})
+
+        if (${PREFIX_UPPER}_INCLUDE_DIR_CACHE)
+
+            _gmock_find_prefix_from_base ("include/"
+                                          ${${PREFIX_UPPER}_INCLUDE_DIR_CACHE}
+                                          ${PREFIX_UPPER}_INCLUDE_PREFIX)
+
+            find_path (${PREFIX_UPPER}_SRC_DIR_CACHE
+                       CMakeLists.txt
+                       PATHS
+                       ${${PREFIX_UPPER}_INCLUDE_PREFIX}/src/${FIRST_DIRECTORY}
+                       NO_DEFAULT_PATH)
+
+            if (${PREFIX_UPPER}_SRC_DIR_CACHE)
+
+                set (${PREFIX_UPPER}_SRC_DIR
+                     ${${PREFIX_UPPER}_SRC_DIR_CACHE}
+                     PARENT_SCOPE)
+                unset (${PREFIX_UPPER}_SRC_DIR_CACHE CACHE)
+
+            endif (${PREFIX_UPPER}_SRC_DIR_CACHE)
+
+        endif (${PREFIX_UPPER}_INCLUDE_DIR_CACHE)
+
+        unset (${PREFIX_UPPER}_INCLUDE_DIR_CACHE CACHE)
+
+    endforeach ()
+
+endfunction (_gmock_find_src_dirs_from_include_paths)
+
+function (_gmock_set_found FOUND_WHERE)
+
+    set (GMOCK_SET_FOUND_OPTION_ARGS EXTERNALLY_OVERRIDDEN)
+    cmake_parse_arguments (GMOCK_SET_FOUND
+                           "${GMOCK_SET_FOUND_OPTION_ARGS}" "" ""
+                           ${ARGN})
+
+    if (NOT GMOCK_SET_FOUND_EXTERNALLY_OVERRIDDEN)
+
+        set (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT
+             ON CACHE BOOL "" FORCE)
+        mark_as_advanced (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT)
+
+    endif (NOT GMOCK_SET_FOUND_EXTERNALLY_OVERRIDDEN)
+
+    set (GMOCK_FOUND TRUE PARENT_SCOPE)
+    set (GMOCK_FOUND_WHERE "${FOUND_WHERE}" PARENT_SCOPE)
+
+endfunction (_gmock_set_found)
+
 # Situation 0. Google Test and Google Mock were provided by the user. Ignore
 # any cache versions of these if we're actually just inside the same project
 # (and reconfiguring it as such)
@@ -183,8 +389,10 @@
                                                 gmock_main STATIC
                                                 ${GMOCK_MAIN_LIBRARY_LOCATION})

-        set (GTEST_FOUND 1)
-        set (GMOCK_FOUND 1)
+        set (LIBRARY_LOCATIONS
+             "${GTEST_LIBRARY_LOCATION} ${GMOCK_LIBRARY_LOCATION}")
+        _gmock_set_found ("-- overridden by ${LIBRARY_LOCATIONS}"
+                          EXTERNALLY_OVERRIDDEN)

     endif (GTEST_INCLUDE_DIR AND
            GMOCK_INCLUDE_DIR AND
@@ -197,235 +405,128 @@

 # Situation 1. Google Test and Google Mock are shipped in library form.
 # Use the libraries unless there we've been asked not to.
-if (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
-
-    if (NOT GTEST_PREFER_SOURCE_BUILD)
-
-        find_package (GTest QUIET)
-
-    endif (NOT GTEST_PREFER_SOURCE_BUILD)
-
-    if (NOT GMOCK_PREFER_SOURCE_BUILD)
-
-        # We must try to find google-mock first, if that is unavailable then
-        # building gmock will build both it and google-test
-        if (GTEST_FOUND)
-
-            find_library (GMOCK_LIBRARY_PATH gmock)
-            find_library (GMOCK_MAIN_LIBRARY_PATH gmock_main)
-
-            # Find the Google Mock include directory by
-            # searching the system paths
-            find_path (GMOCK_INCLUDE_DIR_PATH
-                       gmock/gmock.h)
-
-            if (GMOCK_LIBRARY_PATH AND
-                GMOCK_MAIN_LIBRARY_PATH AND
-                GMOCK_INCLUDE_DIR_PATH)
-
-                # Library forms are available and acceptable, we have found
-                # both Google Test and Google Mock
-                polysquare_import_utils_import_library (GTEST_LIBRARY
-                                                        gtest STATIC
-                                                        ${GTEST_LIBRARY_PATH})
-                polysquare_import_utils_import_library (GMOCK_LIBRARY
-                                                        gmock STATIC
-                                                        ${GMOCK_LIBRARY_PATH})
-                polysquare_import_utils_import_library (GTEST_MAIN_LIBRARY
-                                                        gtest_main STATIC
-                                                        ${GTEST_MAIN_LIBRARY_PATH})
-                polysquare_import_utils_import_library (GMOCK_MAIN_LIBRARY
-                                                        gmock_main STATIC
-                                                        ${GMOCK_MAIN_LIBRARY_PATH})
-
-                set (GMOCK_INCLUDE_DIR ${GMOCK_INCLUDE_DIR_PATH}
-                     CACHE FILEPATH "" FORCE)
-                set (GTEST_INCLUDE_DIR ${GTEST_INCLUDE_DIR_PATH}
-                     CACHE FILEPATH "" FORCE)
-
-                set (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT
-                     ON CACHE BOOL "" FORCE)
-                mark_as_advanced (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT)
-
-                set (GTEST_FOUND TRUE)
-                set (GMOCK_FOUND TRUE)
-
-            endif (GMOCK_LIBRARY_PATH AND
-                   GMOCK_MAIN_LIBRARY_PATH AND
-                   GMOCK_INCLUDE_DIR_PATH)
-
-        endif (GTEST_FOUND)
-
-    endif (NOT GMOCK_PREFER_SOURCE_BUILD)
-
-endif (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
-
-function (_gmock_find_prefix_from_base INCLUDE_BASE INCLUDE_DIR PREFIX_VAR)
-
-    string (LENGTH ${INCLUDE_BASE} INCLUDE_BASE_LENGTH)
-    string (LENGTH ${INCLUDE_DIR} INCLUDE_DIR_LENGTH)
-
-    math (EXPR
-          INCLUDE_PREFIX_LENGTH
-          "${INCLUDE_DIR_LENGTH} - ${INCLUDE_BASE_LENGTH}")
-    string (SUBSTRING
-            ${INCLUDE_DIR}
-            0
-            ${INCLUDE_PREFIX_LENGTH}
-            INCLUDE_PREFIX)
-
-    set (${PREFIX_VAR} ${INCLUDE_PREFIX} PARENT_SCOPE)
-
-endfunction (_gmock_find_prefix_from_base)
+if (NOT GMOCK_FOUND AND
+    NOT GMOCK_PREFER_SOURCE_BUILD AND
+    NOT GTEST_PREFER_SOURCE_BUILD)
+
+        # Find both gtest and google-mock in library form first
+        _gmock_find_and_import_from_system (SUCCESS
+                                            LIBRARIES
+                                            gtest gtest_main
+                                            gmock gmock_main
+                                            INCLUDE_PATHS
+                                            gtest/gtest.h
+                                            gmock/gmock.h)
+
+
+        if (SUCCESS)
+
+            set (GMOCK_SYSTEM_PATHS
+                 "${GTEST_LIBRARY_LOCATION} ${GMOCK_LIBRARY_LOCATION}")
+            _gmock_set_found ("-- in system paths ${GMOCK_SYSTEM_PATHS}")
+
+        endif (SUCCESS)
+
+endif (NOT GMOCK_FOUND AND
+       NOT GMOCK_PREFER_SOURCE_BUILD AND
+       NOT GTEST_PREFER_SOURCE_BUILD)

 # Situation 2. Google Mock was not shipped in source form, but Google
 # Test was, and it is acceptable to use Google Mock in library form.
-if (NOT GTEST_FOUND AND NOT GMOCK_FOUND AND NOT GMOCK_PREFER_SOURCE_BUILD)
-
-    # Google Mock must be found in library form first, otherwise
-    # we end up calling add_subdirectory twice.
-    find_library (GMOCK_LIBRARY_PATH gmock)
-    find_library (GMOCK_MAIN_LIBRARY_PATH gmock_main)
-
-    if (GMOCK_LIBRARY_PATH AND GMOCK_MAIN_LIBRARY_PATH)
-
-        # Find the the Google Test include directory
-        # by searching the system-wide include directory
-        # paths
-        find_path (GTEST_INCLUDE_DIR_PATH
-                   gtest/gtest.h)
-
-        if (GTEST_INCLUDE_DIR_PATH)
-
-            set (GTEST_INCLUDE_BASE "include/")
-            _gmock_find_prefix_from_base (${GTEST_INCLUDE_BASE}
-                                          ${GTEST_INCLUDE_DIR_PATH}
-                                          GTEST_INCLUDE_PREFIX)
-
-            find_path (GTEST_SRC_DIR
-                       CMakeLists.txt
-                       PATHS ${GTEST_INCLUDE_PREFIX}/src/gtest
-                       NO_DEFAULT_PATH)
-
-            if (GTEST_SRC_DIR)
-
-                _add_external_project_with_gmock_cflags (GoogleMock
-                                                         gtest-exports
-                                                         OPTIONS
-                                                         URL ${GTEST_SRC_DIR}
-                                                         TARGETS
-                                                         GTEST_LIBRARY
-                                                         gtest
-                                                         GTEST_MAIN_LIBRARY
-                                                         gtest_main
-                                                         INCLUDE_DIRS)
-
-                polysquare_import_utils_import_library (GMOCK_LIBRARY
-                                                        gmock STATIC
-                                                        ${GMOCK_LIBRARY_PATH})
-                polysquare_import_utils_import_library (GMOCK_MAIN_LIBRARY
-                                                        gmock_main STATIC
-                                                        ${GMOCK_MAIN_LIBRARY_PATH})
-
-                set (GMOCK_INCLUDE_DIR ${GMOCK_INCLUDE_DIR_PATH}
-                     CACHE FILEPATH "" FORCE)
-                set (GTEST_INCLUDE_DIR ${GTEST_INCLUDE_DIR_PATH}
-                     CACHE FILEPATH "" FORCE)
-
-                set (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT
-                     ON CACHE BOOL "" FORCE)
-                mark_as_advanced (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT)
-
-                set (GTEST_FOUND TRUE)
-                set (GMOCK_FOUND TRUE)
-
-            endif (GTEST_SRC_DIR)
-
-        endif (GTEST_INCLUDE_DIR_PATH)
-
-    endif (GMOCK_LIBRARY_PATH AND GMOCK_MAIN_LIBRARY_PATH)
-
-endif (NOT GTEST_FOUND AND NOT GMOCK_FOUND AND NOT GMOCK_PREFER_SOURCE_BUILD)
+if (NOT GMOCK_FOUND AND NOT GMOCK_PREFER_SOURCE_BUILD)
+
+    # Find Google Test source directory
+    _gmock_find_src_dirs_from_include_paths (INCLUDE_PATHS gtest/gtest.h)
+
+    if (GTEST_SRC_DIR)
+
+        # We have a source dir. Import Google Mock from the system
+        # and then use the source dir to build Google Test.
+        _gmock_find_and_import_from_system (SUCCESS
+                                            LIBRARIES
+                                            gmock gmock_main
+                                            INCLUDE_PATHS
+                                            gtest/gtest.h
+                                            gmock/gmock.h)
+
+        if (SUCCESS)
+
+            _add_external_project_with_gmock_cflags (GoogleMock
+                                                     gtest-exports
+                                                     OPTIONS
+                                                     URL ${GTEST_SRC_DIR}
+                                                     TARGETS
+                                                     GTEST_LIBRARY
+                                                     gtest
+                                                     GTEST_MAIN_LIBRARY
+                                                     gtest_main)
+
+            set (GMOCK_FIND_DETAILS
+                 "-- in system path ${GMOCK_LIBRARY_LOCATION} and "
+                 "building from ${GTEST_SRC_DIR}")
+            string (REPLACE ";" "" GMOCK_FIND_DETAILS "${GMOCK_FIND_DETAILS}")
+            _gmock_set_found ("${GMOCK_FIND_DETAILS}")
+
+        endif (SUCCESS)
+
+    endif (GTEST_SRC_DIR)
+
+endif (NOT GMOCK_FOUND AND NOT GMOCK_PREFER_SOURCE_BUILD)

 # Situation 3. Either we don't want to use the library forms, or
 # Google Test or Google Mock wasn't shipped in library form.
 # Try to see if Google Mock was shipped in source form and build
 # both libraries.
-if (NOT GMOCK_ALWAYS_DOWNLOAD_SOURCES)
-
-    if (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
-
-        # Find the Google Mock include directory by
-        # searching the system paths
-        find_path (GMOCK_INCLUDE_DIR_PATH
-                   gmock/gmock.h)
-        find_path (GTEST_INCLUDE_DIR_PATH
-                   gtest/gtest.h)
-
-        if (GMOCK_INCLUDE_DIR_PATH AND GTEST_INCLUDE_DIR_PATH)
-
-            set (GMOCK_INCLUDE_BASE "include/")
-            _gmock_find_prefix_from_base (${GMOCK_INCLUDE_BASE}
-                                          ${GMOCK_INCLUDE_DIR_PATH}
-                                          GMOCK_INCLUDE_PREFIX)
-
-            find_path (GMOCK_SRC_DIR
-                       CMakeLists.txt
-                       PATHS ${GMOCK_INCLUDE_PREFIX}/src/gmock
-                       NO_DEFAULT_PATH)
-            find_path (GTEST_SRC_DIR
-                       CMakeLists.txt
-                       PATHS ${GMOCK_INCLUDE_PREFIX}/src/gtest
-                       NO_DEFAULT_PATH)
-
-            if (GMOCK_SRC_DIR AND GTEST_SRC_DIR)
-
-                # Because gmock tries to reference gtest on a relative path
-                # to itself, copy the entire build-tree into a subdirectory
-                set (GMOCK_TREE ${CMAKE_CURRENT_BINARY_DIR}/GoogleMock/tree)
-                file (COPY ${GMOCK_SRC_DIR} DESTINATION ${GMOCK_TREE}
-                      NO_SOURCE_PERMISSIONS)
-                file (COPY ${GTEST_SRC_DIR} DESTINATION ${GMOCK_TREE}
-                      NO_SOURCE_PERMISSIONS)
-
-                _add_external_project_with_gmock_cflags (GoogleMock
-                                                         gmock-exports
-                                                         OPTIONS
-                                                         SOURCE_DIR
-                                                         ${GMOCK_TREE}/gmock
-                                                         TARGETS
-                                                         GTEST_LIBRARY
-                                                         gtest
-                                                         GMOCK_LIBRARY
-                                                         gmock
-                                                         GTEST_MAIN_LIBRARY
-                                                         gtest_main
-                                                         GMOCK_MAIN_LIBRARY
-                                                         gmock_main)
-
-                set (GMOCK_INCLUDE_DIR ${GMOCK_INCLUDE_DIR_PATH}
-                     CACHE FILEPATH "" FORCE)
-                set (GTEST_INCLUDE_DIR ${GTEST_INCLUDE_DIR_PATH}
-                     CACHE FILEPATH "" FORCE)
-
-                set (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT
-                     ON CACHE BOOL "" FORCE)
-                mark_as_advanced (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT)
-
-                set (GTEST_FOUND TRUE)
-                set (GMOCK_FOUND TRUE)
-
-            endif (GMOCK_SRC_DIR AND GTEST_SRC_DIR)
-
-        endif (GMOCK_INCLUDE_DIR_PATH AND GTEST_INCLUDE_DIR_PATH)
-
-    endif (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
-
-endif (NOT GMOCK_ALWAYS_DOWNLOAD_SOURCES)
+if (NOT GMOCK_FOUND AND NOT GMOCK_ALWAYS_DOWNLOAD_SOURCES)
+
+    # Find Google Test and Google Mock source directories
+    _gmock_find_src_dirs_from_include_paths (INCLUDE_PATHS
+                                             gtest/gtest.h
+                                             gmock/gmock.h)
+
+    if (GMOCK_SRC_DIR AND GTEST_SRC_DIR)
+
+        # Because gmock tries to reference gtest on a relative path
+        # to itself, copy the entire build-tree into a subdirectory
+        set (GMOCK_TREE ${CMAKE_CURRENT_BINARY_DIR}/GoogleMock/tree)
+        file (COPY ${GMOCK_SRC_DIR} DESTINATION ${GMOCK_TREE}
+              NO_SOURCE_PERMISSIONS)
+        file (COPY ${GTEST_SRC_DIR} DESTINATION ${GMOCK_TREE}
+              NO_SOURCE_PERMISSIONS)
+
+        _gmock_find_and_import_from_system (SUCCESS
+                                            INCLUDE_PATHS
+                                            gtest/gtest.h
+                                            gmock/gmock.h)
+
+        if (SUCCESS)
+
+            _add_external_project_with_gmock_cflags (GoogleMock
+                                                     gmock-exports
+                                                     OPTIONS
+                                                     SOURCE_DIR
+                                                     ${GMOCK_TREE}/gmock
+                                                     TARGETS
+                                                     GTEST_LIBRARY
+                                                     gtest
+                                                     GMOCK_LIBRARY
+                                                     gmock
+                                                     GTEST_MAIN_LIBRARY
+                                                     gtest_main
+                                                     GMOCK_MAIN_LIBRARY
+                                                     gmock_main)
+
+            _gmock_set_found ("-- building from ${GTEST_SRC_DIR}")
+
+        endif (SUCCESS)
+
+    endif (GMOCK_SRC_DIR AND GTEST_SRC_DIR)
+
+endif (NOT GMOCK_FOUND AND NOT GMOCK_ALWAYS_DOWNLOAD_SOURCES)

 # Situation 4. Neither was shipped in source form.
 # Set up an external project, download it and build it there.
-if (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
+if (NOT GMOCK_FOUND)

     set (GMOCK_DOWNLOAD_VERSION "SVN" CACHE STRING
          "Version of Google Mock to download. Allowable: SVN, 1.7.0")
@@ -478,9 +579,7 @@

     endif (GMOCK_DOWNLOAD_VERSION STREQUAL "SVN")

-    set (EXTPROJECT_TARGET GoogleMock)
-
-    _add_external_project_with_gmock_cflags (${EXTPROJECT_TARGET} gmock-exports
+    _add_external_project_with_gmock_cflags (GoogleMock gmock-exports
                                              OPTIONS
                                              ${GMOCK_DOWNLOAD_OPTIONS}
                                              TARGETS
@@ -493,14 +592,9 @@
                                              GMOCK_INCLUDE_DIR include
                                              NAMESPACES GTEST GMOCK)

-    set (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT
-         ON CACHE BOOL "" FORCE)
-    mark_as_advanced (_GMOCK_AND_GTEST_INSIDE_FINDING_PROJECT)
-
-    set (GTEST_FOUND 1)
-    set (GMOCK_FOUND 1)
-
-endif (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
+    _gmock_set_found ("-- downloading version ${GMOCK_DOWNLOAD_VERSION}")
+
+endif (NOT GMOCK_FOUND)

 function (_override_gmock_compile_flags TARGET)

@@ -511,7 +605,7 @@

 endfunction (_override_gmock_compile_flags)

-if (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
+if (NOT GMOCK_FOUND)

     if (GoogleMock_FIND_REQUIRED)

@@ -519,7 +613,7 @@

     endif (GoogleMock_FIND_REQUIRED)

-else (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
+else (NOT GMOCK_FOUND)

     # Set the library names as variables for other binaries to use.
     set (GTEST_LIBRARY gtest)
@@ -540,8 +634,9 @@

     if (NOT GoogleMock_FIND_QUIETLY)

-        message (STATUS "Google Test and Google Mock Found")
+        message (STATUS
+                 "Google Test and Google Mock Found ${GMOCK_FOUND_WHERE}")

     endif (NOT GoogleMock_FIND_QUIETLY)

-endif (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
+endif (NOT GMOCK_FOUND)


Return directly if GTEST_FOUND and GMOCK_FOUND were already set.

We might be in a superproject which has already built Google Test
and Google Mock. No need to build it twice.

--- FindGoogleMock.cmake
+++ FindGoogleMock.cmake
@@ -57,6 +57,13 @@
 option (GMOCK_PREFER_SOURCE_BUILD
         "Whether or not to prefer a source build of Google Mock." OFF)

+# Situation 0. Google Test and Google Mock were already found. Use those
+if (GTEST_FOUND AND GMOCK_FOUND)
+
+    return ()
+
+endif (GTEST_FOUND AND GMOCK_FOUND)
+
 # Situation 1. Google Test and Google Mock are shipped in library form.
 # Use the libraries unless there we've been asked not to.
 if (NOT GTEST_PREFER_SOURCE_BUILD)


ENH: Update elastix to revision 5184

ENH: Update elastix to revision 5184

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -2,7 +2,7 @@

 file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )
 set( ELASTIX_REPOSITORY https://svn.bigr.nl/elastix/trunkpublic/ )
-set( ELASTIX_REVISION 5182 )
+set( ELASTIX_REVISION 5184 )

 ExternalProject_Add( ${proj}
   SVN_REPOSITORY ${ELASTIX_REPOSITORY}


Refine openblas find package.

Refine openblas find package.

--- cmake/external/openblas.cmake
+++ cmake/external/openblas.cmake
@@ -29,7 +29,12 @@

     IF(CMAKE_COMPILER_IS_GNUCC)
         ENABLE_LANGUAGE(Fortran)
-        LIST(APPEND CBLAS_LIBRARIES gfortran pthread)
+        find_library(GFORTRAN_LIBRARY NAMES gfortran)
+        if (NOT GFORTRAN_LIBRARY)
+            message(FATAL_ERROR "Cannot found gfortran library which it is used by openblas")
+        endif()
+        find_package(Threads REQUIRED)
+        LIST(APPEND CBLAS_LIBRARIES ${GFORTRAN_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
     ENDIF(CMAKE_COMPILER_IS_GNUCC)

     IF(NOT CMAKE_Fortran_COMPILER)


Use thumb instruction set for ldb-server on android arm

Differential revision: http://reviews.llvm.org/D14816

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

--- cmake/platforms/Android.cmake
+++ cmake/platforms/Android.cmake
@@ -103,7 +103,7 @@
 elseif( ANDROID_ABI STREQUAL "armeabi" )
  # 64 bit atomic operations used in c++ libraries require armv7-a instructions
  # armv5te and armv6 were tried but do not work.
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv7-a" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv7-a -mthumb" )
  if( LLVM_BUILD_STATIC )
   # Temporary workaround for static linking with the latest API.
   set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -DANDROID_ARM_BUILD_STATIC" )


Fixed a typo in LPSCommon "VTK_INC_DIRS" should have been "VTK_INC_DIR". I'd swear I've fixed this same problem more than once in the past ...

--- cmake_modules/LPSCommon.cmake
+++ cmake_modules/LPSCommon.cmake
@@ -697,7 +697,7 @@
         file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "\n")
         file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "set(VTK_BIN_DIR @VTK_BIN_DIR@ CACHE PATH  \"VTK DLL path\")\n")
         file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "\n")
-        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "set(VTK_INC_DIRS @VTK_INC_DIRS@ CACHE PATH  \"VTK DLL path\")\n")
+        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "set(VTK_INC_DIR @VTK_INC_DIRS@ CACHE PATH  \"VTK DLL path\")\n")
         file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "\n")
         file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "set(VTK_LIBS ${VTK_LIBS} CACHE STRING \"VTK Libraries\")\n")
         file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "\n")


Codesign macro now force-signs app, thereby not causing an error if app is already sign (no clean required)

--- macros.cmake
+++ macros.cmake
@@ -178,7 +178,7 @@
   add_custom_command(
     TARGET ${target}
     POST_BUILD
-    COMMAND codesign -s ${codesigning_id} --deep
+    COMMAND codesign -s ${codesigning_id} --deep -f
     "${app_path}/${app_name}"
     VERBATIM
   )


Added the HAVE_BOOST flag

Added the HAVE_BOOST flag

--- CMakeModules/KrisLibraryDependencies.cmake
+++ CMakeModules/KrisLibraryDependencies.cmake
@@ -29,7 +29,7 @@
 endif()
 FIND_PACKAGE(Boost COMPONENTS thread system)
 IF(Boost_FOUND)
-  SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DUSE_BOOST_THREADS=1)
+  SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_BOOST=1 -DUSE_BOOST_THREADS=1)
   SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
   SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${Boost_LIBRARIES})
 ELSE(Boost_FOUND)


Fix missing gmpxx from dep_GMP

Fix missing gmpxx from dep_GMP

--- deps/GMP/GMP.cmake
+++ deps/GMP/GMP.cmake
@@ -20,7 +20,7 @@
     ExternalProject_Add(dep_GMP
         URL  https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
         BUILD_IN_SOURCE ON
-        CONFIGURE_COMMAND ./configure --enable-shared=no --enable-static=yes "--prefix=${DESTDIR}/usr/local" --with-pic
+        CONFIGURE_COMMAND ./configure --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" --with-pic
         BUILD_COMMAND     make -j
         INSTALL_COMMAND   make install
     )


Improve detection of Linux system name.

Improve detection of Linux system name.

--- cmake/FunctionDefinitions.cmake
+++ cmake/FunctionDefinitions.cmake
@@ -114,9 +114,18 @@
         if (NOT SYSTEM_NAME)
             EXECUTE_PROCESS(COMMAND cat /etc/issue RESULT_VARIABLE COMMAND_RESULT OUTPUT_VARIABLE COMMAND_OUTPUT ERROR_VARIABLE ERROR_OUTPUT)
             if (COMMAND_RESULT EQUAL 0)
-                STRING( REGEX MATCH "^[^\\]*" COMMAND_OUTPUT ${COMMAND_OUTPUT} )
-                STRING( STRIP ${COMMAND_OUTPUT} COMMAND_OUTPUT )
-                STRING( REPLACE " " "-" SYSTEM_NAME ${COMMAND_OUTPUT} )
+                if (NOT COMMAND_OUTPUT MATCHES "^\\\\")
+                    STRING( REGEX MATCH "^[^\\]*" COMMAND_OUTPUT ${COMMAND_OUTPUT} )
+                    STRING( STRIP ${COMMAND_OUTPUT} COMMAND_OUTPUT )
+                    STRING( REPLACE " " "-" SYSTEM_NAME ${COMMAND_OUTPUT} )
+                endif ()
+            endif ()
+        endif ()
+        if (NOT SYSTEM_NAME)
+            EXECUTE_PROCESS(COMMAND cat /etc/os-release RESULT_VARIABLE COMMAND_RESULT OUTPUT_VARIABLE COMMAND_OUTPUT ERROR_VARIABLE ERROR_OUTPUT)
+            if (COMMAND_RESULT EQUAL 0)
+                string(REGEX MATCH "^NAME=\\\"([^\\\"]*)" NAME_OUTPUT ${COMMAND_OUTPUT})
+                string(REPLACE " " "-" SYSTEM_NAME ${CMAKE_MATCH_1})
             endif ()
         endif ()
         if (NOT SYSTEM_NAME)


In order to use protobuf 3.0 on Mac, add variable MAC_PROTOBUF_VERSION.

By default, it's still built against version 2.5.0.

Change-Id: I8e5f9f0cda1bc0a0f7fd52df9041796f1d4b07ec
Reviewed-on: https://gerrit.mozy.lab.emc.com/114928
Reviewed-by: Revin Yin <0b28512a1f8f670d94208bceb5421c5604b891a1@emc.com>

--- cmake/configureThirdParty.cmake
+++ cmake/configureThirdParty.cmake
@@ -206,9 +206,13 @@
         set(PROTOBUF_LIBRARIES_DIRECTORY ${THIRDPARTY_LIB_ROOT}/protobuf/protobuf-3.0/vc${VS_VERSION}-${ARCH}/lib)
         set(PROTOBUF_FOUND ON)
     elseif(CMAKE_HOST_APPLE)
-        include_directories (SYSTEM ${THIRDPARTY_LIB_ROOT}/protobuf/protobuf-2.5.0/include)
-        set(PROTOBUF_LIBRARIES ${THIRDPARTY_LIB_ROOT}/protobuf/protobuf-2.5.0/lib/libprotobuf.a)
-        set(PROTOBUF_PROTOC_EXECUTABLE ${THIRDPARTY_LIB_ROOT}/protobuf/protobuf-2.5.0/bin/protoc)
+        set(_mac_protobuf_version "2.5.0")
+        if (MAC_PROTOBUF_VERSION)
+            set(_mac_protobuf_version ${MAC_PROTOBUF_VERSION})
+        endif()
+        include_directories (SYSTEM ${THIRDPARTY_LIB_ROOT}/protobuf/protobuf-${_mac_protobuf_version}/include)
+        set(PROTOBUF_LIBRARIES ${THIRDPARTY_LIB_ROOT}/protobuf/protobuf-${_mac_protobuf_version}/lib/libprotobuf.a)
+        set(PROTOBUF_PROTOC_EXECUTABLE ${THIRDPARTY_LIB_ROOT}/protobuf/protobuf-${_mac_protobuf_version}/bin/protoc)

         set(PROTOBUF_FOUND On)
     else()


build: remove libyaml from cpack rpm

build: remove libyaml from cpack rpm

Signed-off-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>

--- cmake/modules/CPackConfig.cmake
+++ cmake/modules/CPackConfig.cmake
@@ -37,7 +37,7 @@

 set(CPACK_RPM_PACKAGE_LICENSE "Apache v2.0")
 set(CPACK_RPM_PACKAGE_URL "https://www.falco.org")
-set(CPACK_RPM_PACKAGE_REQUIRES "dkms, kernel-devel, libyaml, ncurses")
+set(CPACK_RPM_PACKAGE_REQUIRES "dkms, kernel-devel, ncurses")
 set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/scripts/rpm/postinstall")
 set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/scripts/rpm/preuninstall")
 set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/scripts/rpm/postuninstall")


[LLVM][MIPS] Introduce 64 bit atomic check in CheckAtomic.cmake

Patch by Nitesh Jain.

Summary: On some target like MIPS32 we need to explicitly link atomic library for 64 bit atomic operations. This module then can be used in LLDB (http://reviews.llvm.org/D20464) or Libcxx (http://reviews.llvm.org/D16613) for explicitly link to atomic library.

Reviewers: chandlerc, beanz
Differential: reviews.llvm.org/D20896

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

--- cmake/modules/CheckAtomic.cmake
+++ cmake/modules/CheckAtomic.cmake
@@ -18,6 +18,22 @@
   set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
 endfunction(check_working_cxx_atomics)

+function(check_working_cxx_atomics64 varname)
+  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+  set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}")
+  CHECK_CXX_SOURCE_COMPILES("
+#include <atomic>
+#include <cstdint>
+std::atomic<uint64_t> x (0);
+int main() {
+  uint64_t i = x.load(std::memory_order_relaxed);
+  return 0;
+}
+" ${varname})
+  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_working_cxx_atomics64)
+
+
 # This isn't necessary on MSVC, so avoid command-line switch annoyance
 # by only running on GCC-like hosts.
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
@@ -35,6 +51,27 @@
     else()
       message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
     endif()
+  endif()
+endif()
+
+# Check for 64 bit atomic operations.
+if(MSVC)
+  set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
+else()
+  check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+endif()
+
+# If not, check if the library exists, and atomics work with it.
+if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+  check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
+  if(HAVE_CXX_LIBATOMICS64)
+    list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+    check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
+    if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
+      message(FATAL_ERROR "Host compiler must support std::atomic!")
+    endif()
+  else()
+    message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
   endif()
 endif()


Added no default path option.

Added no default path option.

--- cmake/modules/FindArduino.cmake
+++ cmake/modules/FindArduino.cmake
@@ -533,75 +533,82 @@

 # Setting up Arduino enviroment settings
-if(NOT ARDUINO_FOUND)
-    find_file(ARDUINO_CORES_PATH
-              NAMES cores
-              PATHS ${ARDUINO_SDK_PATH}
-              PATH_SUFFIXES hardware/arduino)
-
-    find_file(ARDUINO_LIBRARIES_PATH
-              NAMES libraries
-              PATHS ${ARDUINO_SDK_PATH})
-
-    find_file(ARDUINO_BOARDS_PATH
-              NAMES boards.txt
-              PATHS ${ARDUINO_SDK_PATH}
-              PATH_SUFFIXES hardware/arduino)
-
-    find_file(ARDUINO_PROGRAMMERS_PATH
-              NAMES programmers.txt
-              PATHS ${ARDUINO_SDK_PATH}
-              PATH_SUFFIXES hardware/arduino)
-
-    find_file(ARDUINO_REVISIONS_PATH
-              NAMES revisions.txt
-              PATHS ${ARDUINO_SDK_PATH})
-
-    find_file(ARDUINO_VERSION_PATH
-              NAMES lib/version.txt
-              PATHS ${ARDUINO_SDK_PATH})
-
-    find_program(ARDUINO_AVRDUDE_PROGRAM
-                 NAMES avrdude
-                 PATHS ${ARDUINO_SDK_PATH}
-                 PATH_SUFFIXES hardware/tools)
-
-    find_program(ARDUINO_AVRDUDE_CONFIG_PATH
-                 NAMES avrdude.conf
-                 PATHS ${ARDUINO_SDK_PATH} /etc/avrdude
-                 PATH_SUFFIXES hardware/tools
-                               hardware/tools/avr/etc)
-
-     set(ARDUINO_OBJCOPY_EEP_FLAGS -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
-         CACHE STRING "")
-     set(ARDUINO_OBJCOPY_HEX_FLAGS -O ihex -R .eeprom
-         CACHE STRING "")
-     set(ARDUINO_AVRDUDE_FLAGS -V -F
-         CACHE STRING "Arvdude global flag list.")
-
-     if(ARDUINO_SDK_PATH)
-         detect_arduino_version(ARDUINO_SDK_VERSION)
-         set(ARDUINO_SDK_VERSION ${ARDUINO_SDK_VERSION} CACHE STRING "Arduino SDK Version")
-     endif(ARDUINO_SDK_PATH)
-
-    include(FindPackageHandleStandardArgs)
-    find_package_handle_standard_args(Arduino
-                                      REQUIRED_VARS ARDUINO_SDK_PATH
-                                                    ARDUINO_SDK_VERSION
-                                      VERSION_VAR ARDUINO_SDK_VERSION)
-
-
-     mark_as_advanced(ARDUINO_CORES_PATH
-                      ARDUINO_SDK_VERSION
-                      ARDUINO_LIBRARIES_PATH
-                      ARDUINO_BOARDS_PATH
-                      ARDUINO_PROGRAMMERS_PATH
-                      ARDUINO_REVISIONS_PATH
-                      ARDUINO_AVRDUDE_PROGRAM
-                      ARDUINO_AVRDUDE_CONFIG_PATH
-                      ARDUINO_OBJCOPY_EEP_FLAGS
-                      ARDUINO_OBJCOPY_HEX_FLAGS)
-    load_board_settings()
+find_file(ARDUINO_CORES_PATH
+    NAMES cores
+    PATHS ${ARDUINO_SDK_PATH}
+    PATH_SUFFIXES hardware/arduino
+    NO_DEFAULT_PATH)
+
+find_file(ARDUINO_LIBRARIES_PATH
+    NAMES libraries
+    PATHS ${ARDUINO_SDK_PATH}
+    NO_DEFAULT_PATH)
+
+find_file(ARDUINO_BOARDS_PATH
+    NAMES boards.txt
+    PATHS ${ARDUINO_SDK_PATH}
+    PATH_SUFFIXES hardware/arduino
+    NO_DEFAULT_PATH)
+
+find_file(ARDUINO_PROGRAMMERS_PATH
+    NAMES programmers.txt
+    PATHS ${ARDUINO_SDK_PATH}
+    PATH_SUFFIXES hardware/arduino
+    NO_DEFAULT_PATH)
+
+find_file(ARDUINO_REVISIONS_PATH
+    NAMES revisions.txt
+    PATHS ${ARDUINO_SDK_PATH}
+    NO_DEFAULT_PATH)
+
+find_file(ARDUINO_VERSION_PATH
+    NAMES lib/version.txt
+    PATHS ${ARDUINO_SDK_PATH}
+    NO_DEFAULT_PATH)
+
+find_program(ARDUINO_AVRDUDE_PROGRAM
+    NAMES avrdude
+    PATHS ${ARDUINO_SDK_PATH}
+    PATH_SUFFIXES hardware/tools
+    NO_DEFAULT_PATH)
+
+find_file(ARDUINO_AVRDUDE_CONFIG_PATH
+    NAMES avrdude.conf
+    PATHS ${ARDUINO_SDK_PATH} /etc/avrdude
+    PATH_SUFFIXES hardware/tools
+                  hardware/tools/avr/etc
+    NO_DEFAULT_PATH)
+
+set(ARDUINO_OBJCOPY_EEP_FLAGS -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
+    CACHE STRING "")
+set(ARDUINO_OBJCOPY_HEX_FLAGS -O ihex -R .eeprom
+    CACHE STRING "")
+set(ARDUINO_AVRDUDE_FLAGS -V -F
+    CACHE STRING "Arvdude global flag list.")
+
+if(ARDUINO_SDK_PATH)
+    detect_arduino_version(ARDUINO_SDK_VERSION)
+    set(ARDUINO_SDK_VERSION ${ARDUINO_SDK_VERSION} CACHE STRING "Arduino SDK Version")
+endif(ARDUINO_SDK_PATH)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Arduino
+                                  REQUIRED_VARS ARDUINO_SDK_PATH
+                                                ARDUINO_SDK_VERSION
+                                  VERSION_VAR ARDUINO_SDK_VERSION)
+
+
+mark_as_advanced(ARDUINO_CORES_PATH
+    ARDUINO_SDK_VERSION
+    ARDUINO_LIBRARIES_PATH
+    ARDUINO_BOARDS_PATH
+    ARDUINO_PROGRAMMERS_PATH
+    ARDUINO_REVISIONS_PATH
+    ARDUINO_AVRDUDE_PROGRAM
+    ARDUINO_AVRDUDE_CONFIG_PATH
+    ARDUINO_OBJCOPY_EEP_FLAGS
+    ARDUINO_OBJCOPY_HEX_FLAGS)
+load_board_settings()

 endif()


Remove quotes from CFITSIO_LIBRARIES variable

CMake gets confused otherwise, as seen in the link below:
http://cdash.cern.ch/viewBuildError.php?buildid=669849

--- cmake/modules/FindCFITSIO.cmake
+++ cmake/modules/FindCFITSIO.cmake
@@ -56,7 +56,7 @@
     if(${CFITSIO_VERSION} VERSION_GREATER_EQUAL 3.42)
       find_package(CURL QUIET)
       if(CURL_FOUND)
-        set(CFITSIO_LIBRARIES "${CFITSIO_LIBRARIES} ${CURL_LIBRARIES}")
+        set(CFITSIO_LIBRARIES ${CFITSIO_LIBRARIES} ${CURL_LIBRARIES})
       endif()
     endif()
   endif()


cmake: Add documentation for the new _tpqt4_add_check_targets() internal macro

--- cmake/modules/TpQt4Macros.cmake
+++ cmake/modules/TpQt4Macros.cmake
@@ -92,6 +92,13 @@
 #       source file named ${name}.cpp. fancyName will be used as the test and target's name, and you can specify as a third
 #       and optional argument a set of additional libraries the target will link to. Please remember that you need to
 #       set up the DBus environment by calling TPQT4_SETUP_DBUS_TEST_ENVIRONMENT BEFORE you call this macro.
+#
+# macro _TPQT4_ADD_CHECK_TARGETS (fancyName name command [args])
+#       This is an internal macro which is meant to be used by TPQT4_ADD_DBUS_UNIT_TEST and TPQT4_ADD_GENERIC_UNIT_TEST.
+#       It takes care of generating a check target for each test method available (currently normal execution, valgrind and
+#       callgrind). This macro accepts the same arguments as the add test macros, but accepts a command and a list of
+#       arguments for running the test instead of the link libraries. However, you are not meant to call this macro from
+#       your CMakeLists.txt files.
 #
 # function TPQT4_SETUP_DBUS_TEST_ENVIRONMENT ()
 #          This function MUST be called before calling TPQT4_ADD_DBUS_UNIT_TEST. It takes care of preparing the test


Backup. Removed default "Doxygen found" message.

--- cmake_modules/FindDoxygen.cmake
+++ cmake_modules/FindDoxygen.cmake
@@ -112,18 +112,13 @@
 if((${Doxygen_VERSION} STREQUAL ${REQ_VER}) OR (${Doxygen_VERSION} STRGREATER ${REQ_VER}))

      set(DOC_TARGETS ON CACHE BOOL "Toggles generation of documentation targets")
-    # Check
-#    set(Doxygen_VERSION_VALID)
-
-#    if(Doxygen_VERSION)
-      set(Doxygen_VERSION_VALID 1)
-#    endif()
+     set(Doxygen_VERSION_VALID 1)

     # handle the QUIETLY and REQUIRED arguments and set DOXYGEN_FOUND to TRUE if
     # all listed variables are TRUE
     include(FindPackageHandleStandardArgs)
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen DEFAULT_MSG DOXYGEN_EXECUTABLE Doxygen_VERSION_VALID)
-
+#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen DEFAULT_MSG DOXYGEN_EXECUTABLE Doxygen_VERSION_VALID)
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen "" DOXYGEN_EXECUTABLE Doxygen_VERSION_VALID)
     message(STATUS "Doxygen version is: " ${Doxygen_VERSION})

     configure_file(${CMAKE_MODULE_PATH}/doxygen_definitions.cmake.in ${CMAKE_BINARY_DIR}/doxygen_definitions.cmake)


updated FindUtiLite.cmake

updated FindUtiLite.cmake

git-svn-id: 5c3bb4a0fea81dff653294223dbc7ab7b926c710@248 f169173b-cf89-36c8-b27e-44dbe73f0c83

--- cmake_modules/FindUtiLite.cmake
+++ cmake_modules/FindUtiLite.cmake
@@ -1,82 +1,80 @@
-# - Find UTILITE
-# This module finds an installed UTILITE package.
-#
-# It sets the following variables:
-#  UTILITE_FOUND              - Set to false, or undefined, if UTILITE isn't found.
-#  UTILITE_INCLUDE_DIR        - The UTILITE include directory.
-#  UTILITE_LIBRARY            - The UTILITE library to link against.
-#  URESOURCEGENERATOR_EXEC    - The resource generator tool executable
-#
-#
-
-SET(UTILITE_VERSION_REQUIRED 0.2.11)
-
-SET(UTILITE_ROOT)
-
-# Add ROS UtiLite directory if ROS is installed
-FIND_PROGRAM(ROSPACK_EXEC NAME rospack PATHS)
-IF(ROSPACK_EXEC)
-	EXECUTE_PROCESS(COMMAND ${ROSPACK_EXEC} find utilite
-			   	    OUTPUT_VARIABLE UTILITE_ROS_PATH
-					OUTPUT_STRIP_TRAILING_WHITESPACE
-					WORKING_DIRECTORY "./"
-	)
-	IF(UTILITE_ROS_PATH)
-	    MESSAGE(STATUS "Found UtiLite ROS pkg : ${UTILITE_ROS_PATH}")
-	    SET(UTILITE_ROOT
-	        ${UTILITE_ROS_PATH}/utilite
-	        ${UTILITE_ROOT}
-	    )
-	ENDIF(UTILITE_ROS_PATH)
-ENDIF(ROSPACK_EXEC)
-
-MESSAGE(STATUS ${UTILITE_POSSIBLE_ROOT_DIRS})
-
-FIND_PROGRAM(URESOURCEGENERATOR_EXEC NAME uresourcegenerator PATHS ${UTILITE_ROOT}/bin)
-IF(URESOURCEGENERATOR_EXEC)
-	EXECUTE_PROCESS(COMMAND ${URESOURCEGENERATOR_EXEC} -v
-			   	    OUTPUT_VARIABLE UTILITE_VERSION
-					OUTPUT_STRIP_TRAILING_WHITESPACE
-					WORKING_DIRECTORY "./"
-	)
-
-	IF(UTILITE_VERSION VERSION_LESS UTILITE_VERSION_REQUIRED)
-	    IF(UtiLite_FIND_REQUIRED)
-	    	MESSAGE(FATAL_ERROR "Your version of UtiLite is too old (${UTILITE_VERSION}), UtiLite ${UTILITE_VERSION_REQUIRED} is required.")
-	    ENDIF(UtiLite_FIND_REQUIRED)
-	ENDIF(UTILITE_VERSION VERSION_LESS UTILITE_VERSION_REQUIRED)
-
-	IF(WIN32)
-		FIND_PATH(UTILITE_INCLUDE_DIR
-				utilite/UEventsManager.h
-				PATH_SUFFIXES "../include")
-
-		FIND_LIBRARY(UTILITE_LIBRARY NAMES utilite
-			 	PATH_SUFFIXES "../lib")
-
-	ELSE()
-		FIND_PATH(UTILITE_INCLUDE_DIR
-				utilite/UEventsManager.h
-				PATHS ${UTILITE_ROOT}/include)
-
-		FIND_LIBRARY(UTILITE_LIBRARY
-				NAMES utilite
-				PATHS ${UTILITE_ROOT}/lib)
-	ENDIF()
-
-	IF (UTILITE_INCLUDE_DIR AND UTILITE_LIBRARY)
-	   SET(UTILITE_FOUND TRUE)
-	ENDIF (UTILITE_INCLUDE_DIR AND UTILITE_LIBRARY)
-ENDIF(URESOURCEGENERATOR_EXEC)
-
-IF (UTILITE_FOUND)
-   # show which UTILITE was found only if not quiet
-   IF (NOT UtiLite_FIND_QUIETLY)
-      MESSAGE(STATUS "Found UtiLite ${UTILITE_VERSION}")
-   ENDIF (NOT UtiLite_FIND_QUIETLY)
-ELSE ()
-   # fatal error if UTILITE is required but not found
-   IF (UtiLite_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find UtiLite. Verify your PATH if it is already installed or download it at http://utilite.googlecode.com")
-   ENDIF (UtiLite_FIND_REQUIRED)
-ENDIF ()
+# - Find UTILITE
+# This module finds an installed UTILITE package.
+#
+# It sets the following variables:
+#  UTILITE_FOUND              - Set to false, or undefined, if UTILITE isn't found.
+#  UTILITE_INCLUDE_DIR        - The UTILITE include directory.
+#  UTILITE_LIBRARY            - The UTILITE library to link against.
+#  URESOURCEGENERATOR_EXEC    - The resource generator tool executable
+#
+#
+
+SET(UTILITE_VERSION_REQUIRED 0.2.11)
+
+SET(UTILITE_ROOT)
+
+# Add ROS UtiLite directory if ROS is installed
+FIND_PROGRAM(ROSPACK_EXEC NAME rospack PATHS)
+IF(ROSPACK_EXEC)
+	EXECUTE_PROCESS(COMMAND ${ROSPACK_EXEC} find utilite
+			   	    OUTPUT_VARIABLE UTILITE_ROS_PATH
+					OUTPUT_STRIP_TRAILING_WHITESPACE
+					WORKING_DIRECTORY "./"
+	)
+	IF(UTILITE_ROS_PATH)
+	    MESSAGE(STATUS "Found UtiLite ROS pkg : ${UTILITE_ROS_PATH}")
+	    SET(UTILITE_ROOT
+	        ${UTILITE_ROS_PATH}/utilite
+	        ${UTILITE_ROOT}
+	    )
+	ENDIF(UTILITE_ROS_PATH)
+ENDIF(ROSPACK_EXEC)
+
+FIND_PROGRAM(URESOURCEGENERATOR_EXEC NAME uresourcegenerator PATHS ${UTILITE_ROOT}/bin)
+IF(URESOURCEGENERATOR_EXEC)
+	EXECUTE_PROCESS(COMMAND ${URESOURCEGENERATOR_EXEC} -v
+			   	    OUTPUT_VARIABLE UTILITE_VERSION
+					OUTPUT_STRIP_TRAILING_WHITESPACE
+					WORKING_DIRECTORY "./"
+	)
+
+	IF(UTILITE_VERSION VERSION_LESS UTILITE_VERSION_REQUIRED)
+	    IF(UtiLite_FIND_REQUIRED)
+	    	MESSAGE(FATAL_ERROR "Your version of UtiLite is too old (${UTILITE_VERSION}), UtiLite ${UTILITE_VERSION_REQUIRED} is required.")
+	    ENDIF(UtiLite_FIND_REQUIRED)
+	ENDIF(UTILITE_VERSION VERSION_LESS UTILITE_VERSION_REQUIRED)
+
+	IF(WIN32)
+		FIND_PATH(UTILITE_INCLUDE_DIR
+				utilite/UEventsManager.h
+				PATH_SUFFIXES "../include")
+
+		FIND_LIBRARY(UTILITE_LIBRARY NAMES utilite
+			 	PATH_SUFFIXES "../lib")
+
+	ELSE()
+		FIND_PATH(UTILITE_INCLUDE_DIR
+				utilite/UEventsManager.h
+				PATHS ${UTILITE_ROOT}/include)
+
+		FIND_LIBRARY(UTILITE_LIBRARY
+				NAMES utilite
+				PATHS ${UTILITE_ROOT}/lib)
+	ENDIF()
+
+	IF (UTILITE_INCLUDE_DIR AND UTILITE_LIBRARY)
+	   SET(UTILITE_FOUND TRUE)
+	ENDIF (UTILITE_INCLUDE_DIR AND UTILITE_LIBRARY)
+ENDIF(URESOURCEGENERATOR_EXEC)
+
+IF (UTILITE_FOUND)
+   # show which UTILITE was found only if not quiet
+   IF (NOT UtiLite_FIND_QUIETLY)
+      MESSAGE(STATUS "Found UtiLite ${UTILITE_VERSION}")
+   ENDIF (NOT UtiLite_FIND_QUIETLY)
+ELSE ()
+   # fatal error if UTILITE is required but not found
+   IF (UtiLite_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could not find UtiLite. Verify your PATH if it is already installed or download it at http://utilite.googlecode.com")
+   ENDIF (UtiLite_FIND_REQUIRED)
+ENDIF ()


Fixes gh-365 - Invalid .deb file in debug build

gpkg complains about the _ in the _debug suffix we added. Use -
instead.

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- cmake_modules/commonSetup.cmake
+++ cmake_modules/commonSetup.cmake
@@ -136,7 +136,7 @@
   set(version ${majorver}.${minorver}.${point})

   IF ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
-    set( stagever "${stagever}_Debug" )
+    set( stagever "${stagever}-Debug" )
   ENDIF ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")

   ###########################################################################


Update CMake script. - Improving a function searching protobuf file.


fixed eigen include and how mosra libs want libigl (wanted the source target)

--- cmake/mtao_fetch_dependencies.cmake
+++ cmake/mtao_fetch_dependencies.cmake
@@ -25,11 +25,7 @@
         set(BUILD_TESTING OFF)
         fetch_dep(eigen https://gitlab.com/libeigen/eigen.git bcbaad6d874d451817457ae0603f953cda3c0c06 OFF)
         set(EIGEN3_INCLUDE_DIR ${eigen_SOURCE_DIR})
-        if(EIGEN3_FOUND AND NOT TARGET Eigen3::Eigen)
-            add_library(Eigen3::Eigen INTERFACE IMPORTED GLOBAL)
-            set_target_properties(Eigen3::Eigen PROPERTIES
-                INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}")
-        endif()
+        find_package(Eigen3 REQUIRED)
 ENDIF()
 if(MTAO_USE_OPENGL)
     find_package(GLFW)
@@ -48,10 +44,9 @@
     if(NOT DEFINED IMGUI_DIR)
         fetch_dep(imgui https://github.com/ocornut/imgui.git v1.74 OFF)
         set(IMGUI_DIR ${imgui_SOURCE_DIR})
-        set(ImGui_INCLUDE_DIR ${imgui_SOURCE_DIR} CACHE STRING "Location of the imgui library headers")
-        MESSAGE(STATUS "IMGUI DIR: ${IMGUI_DIR}")
     endif()
-    find_package(ImGui REQUIRED)
+    find_package(ImGui COMPONENTS Sources REQUIRED)
+    set(ImGui_INCLUDE_DIR ${ImGui_INCLUDE_DIR} CACHE STRING "Location of the imgui library headers")
 endif()

 if(NOT DEFINED TRIANGLE_DIR)
@@ -67,7 +62,7 @@
 endif()

 if(MTAO_USE_OPENGL)
-    set(BUILD_TESTS OFF)
+    OPTION(BUILD_TESTS "Build tests (for mosra libs)" OFF)
     if(NOT Corrade_FOUND)
         fetch_dep(corrade https://github.com/mosra/corrade v2019.10 ON)
     endif()


FindSuitesparse script updated (ARM libraries)

--- cmake_modules/FindSUITESPARSE.cmake
+++ cmake_modules/FindSUITESPARSE.cmake
@@ -62,7 +62,10 @@
                             /usr/lib/x86_64-linux-gnu
                             /usr/lib/i386-linux-gnu
                             /usr/local/lib
-                            /usr/lib/arm-linux-gnueabihf/)
+                            /usr/lib/arm-linux-gnueabihf/
+                            /usr/lib/aarch64-linux-gnu/
+                            /usr/lib/arm-linux-gnueabi/
+                            /usr/lib/arm-linux-gnu)
    ENDIF(APPLE)

    # Add cholmod include directory to collection include directories


[CLI-16] Configure Virgil C++ SDK more precisely

--- ext/virgil_sdk/virgil_sdk.cmake
+++ ext/virgil_sdk/virgil_sdk.cmake
@@ -42,8 +42,12 @@

 # Configure additional CMake parameters
 file (WRITE "@VIRGIL_DEPENDS_ARGS_FILE@"
-    "set (INSTALL_EXT_LIBS @INSTALL_EXT_LIBS@ CACHE INTERNAL \"\")\n"
-    "set (INSTALL_EXT_HEADERS @INSTALL_EXT_HEADERS@ CACHE INTERNAL \"\")\n"
+    "set (ENABLE_TESTING OFF CACHE INTERNAL \"\")\n"
+    "set (ENABLE_EXAMPLES OFF CACHE INTERNAL \"\")\n"
+    "set (INSTALL_EXAMPLES OFF CACHE INTERNAL \"\")\n"
+    "set (INSTALL_EXT_LIBS ON CACHE INTERNAL \"\")\n"
+    "set (INSTALL_EXT_HEADERS ON CACHE INTERNAL \"\")\n"
+    "set (UCLIBC @UCLIBC@ CACHE INTERNAL \"\")\n"
 )

 ExternalProject_Add (${PROJECT_NAME}


config for cx11

config for cx11


use long and short git tags...   not sure how this got lost

--- kitchen/cmake/git.cmake
+++ kitchen/cmake/git.cmake
@@ -73,7 +73,7 @@
       RESULT_VARIABLE ${PROJECT}_GITTAG_STATUS
       )

-    execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags
+    execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0
       WORKING_DIRECTORY ${${PROJECT}_SOURCE_DIR}
       OUTPUT_VARIABLE ${PROJECT}_GITTAG_SHORT
       OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -87,7 +87,8 @@
   endif()

   message(STATUS "${PROJECT} commit:       ${${PROJECT}_COMMITHASH}")
-  message(STATUS "${PROJECT} tag:          ${${PROJECT}_GITTAG}")
+  message(STATUS "${PROJECT} tag (long):   ${${PROJECT}_GITTAG_LONG}")
+  message(STATUS "${PROJECT} tag (short):  ${${PROJECT}_GITTAG_SHORT}")
   message(STATUS "${PROJECT} last_mod:     ${${PROJECT}_LAST_MODIFIED}")


Fix x64 package name.

Fix x64 package name.

--- packaging/WiX/CPackWixConfig.cmake
+++ packaging/WiX/CPackWixConfig.cmake
@@ -4,7 +4,11 @@
  SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")
  SET(CPACK_WIX_UI "WixUI_InstallDir")
  MATH(EXPR bits ${CMAKE_SIZEOF_VOID_P}*8)
- SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-win${bits}")
+ IF(64BIT)
+  SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-winx64")
+ ELSE()
+  SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-win32")
+ ENDIF()
 ELSE()
   SET(CPACK_COMPONENTS_USED
     "Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts")


ENH: Prefer https vs http for ctest submission.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,7 +1,7 @@
 set(CTEST_PROJECT_NAME "RTK")
 set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")

-set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_METHOD "https")
 set(CTEST_DROP_SITE "my.cdash.org")
 set(CTEST_DROP_LOCATION "/submit.php?project=RTK")
 set(CTEST_DROP_SITE_CDASH TRUE)


CDash server migrate (#356)

CDash server migrate (#356)

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -5,12 +5,12 @@
 ## Set test timeout (secs) by -DDART_TESTING_TIMEOUT=.. in cmake args
 ######################################################################

-set(CTEST_PROJECT_NAME "Gismo-stable")
+set(CTEST_PROJECT_NAME "Gismo")
 set(CTEST_NIGHTLY_START_TIME "00:00:01 UTC")
 set(CTEST_DROP_METHOD "https")
 set(CTEST_CURL_OPTIONS "CURLOPT_SSL_VERIFYPEER_OFF" "CURLOPT_SSL_VERIFYHOST_OFF")
-set(CTEST_DROP_SITE "cdash.ricam.oeaw.ac.at")
-set(CTEST_DROP_LOCATION "/submit.php?project=Gismo-stable")
+set(CTEST_DROP_SITE "cdash-ci.inria.fr")
+set(CTEST_DROP_LOCATION "/submit.php?project=Gismo")
 set(CTEST_DROP_SITE_CDASH TRUE)
 set(CTEST_OUTPUT_ON_FAILURE TRUE)
 set(CTEST_LABELS_FOR_SUBPROJECTS "")


[t:4814] fix the thing that makes it so perf tests don't run by default

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -102,12 +102,12 @@

 set(perf_tests
   perf_checkpoint_var.tdb
-  perf_cursor_nop.c
-  perf_malloc_free.c
-  perf_nop.c
-  perf_ptquery.c
-  perf_ptquery2.c
-  perf_xmalloc_free.c
+  perf_cursor_nop.tdb
+  perf_malloc_free.tdb
+  perf_nop.tdb
+  perf_ptquery.tdb
+  perf_ptquery2.tdb
+  perf_xmalloc_free.tdb
   )

 ## we also don't need to run perf tests every time


Mention all variables used in surgsim_add_unit_tests

Readd mention of UNIT_TEST_SHARED_LIBS, UNIT_TEST_SHARED_RELEASE_LIBS,
and UNIT_TEST_SHARED_DEBUG_LIBS in the comment of
surgsim_add_unit_tests. This was lost in the merging of the unit test
macros into one macro.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -139,7 +139,9 @@
 endmacro()

 # Build the unit test executable.
-# Uses UNIT_TEST_SOURCES, UNIT_TEST_HEADERS and LIBS for this unit test.
+# Uses UNIT_TEST_SOURCES, UNIT_TEST_HEADERS, LIBS, UNIT_TEST_SHARED_LIBS,
+# UNIT_TEST_SHARED_RELEASE_LIBS and UNIT_TEST_SHARED_DEBUG_LIBS.
+#
 macro(surgsim_add_unit_tests TESTNAME)
 	add_executable(${TESTNAME} ${UNIT_TEST_SOURCES} ${UNIT_TEST_HEADERS})
 	target_link_libraries(${TESTNAME} SurgSimTesting ${LIBS})


Bump GAPID version to v0.9.3

Bump GAPID version to v0.9.3

--- version.cmake
+++ version.cmake
@@ -16,7 +16,7 @@
 # Increment these numbers immediately after releasing a new version.
 set(GAPID_VERSION_MAJOR 0)
 set(GAPID_VERSION_MINOR 9)
-set(GAPID_VERSION_POINT 2)
+set(GAPID_VERSION_POINT 3)

 if (NOT DEFINED GAPID_BUILD_NUMBER)
     set(GAPID_BUILD_NUMBER 0)


Split off 7.12.58

Split off 7.12.58

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 12 )
-set ( HPCC_POINT 57 )
+set ( HPCC_POINT 59 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 8.4.54

Split off 8.4.54

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 53 )
+set ( HPCC_POINT 55 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 7.6.56

Split off 7.6.56

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 6 )
-set ( HPCC_POINT 55 )
+set ( HPCC_POINT 57 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Graph Control 4.0.0-rc4 Release Candidate 4

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -6,7 +6,7 @@
 set ( HPCC_MINOR 0 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 3 )
+set ( HPCC_SEQUENCE 4 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Small changes to package into .tgz on Ubuntu (at least)

--- cmake/Modules/DefineCPackConfig.cmake
+++ cmake/Modules/DefineCPackConfig.cmake
@@ -31,24 +31,23 @@
   set(CPACK_NSIS_COMPRESSOR "/SOLID zlib")
   set(CPACK_NSIS_MENU_LINKS "http://www.lastcraft.com/cgreen.php" "cgreen homepage")
   set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
+else()
+  set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
+  set(CPACK_GENERATOR "TGZ")
 endif(WIN32)

-if(CYGWIN)
-  set(CPACK_GENERATOR "TGZ")
-  set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
-endif()
-
 set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
-set(CPACK_INSTALL_DIRECTORY "")
 set(CPACK_PACKAGE_FILE_NAME ${APPLICATION_NAME}-${CPACK_PACKAGE_VERSION})

 set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
-set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C/C++ Headers")
 set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
   "Libraries used to build programs which use cgreen")
+
+set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C/C++ Headers")
 set(CPACK_COMPONENT_HEADERS_DESCRIPTION
   "C/C++ header files for use with cgreen")
 set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
+
 set(CPACK_COMPONENT_APPLICATIONS_GROUP "Runtime")
 set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
 set(CPACK_COMPONENT_HEADERS_GROUP "Development")


cmake: Error instead of warning and dropping invalid LLVM_USE_SANITIZER

Currently, if you call cmake with a typo in an LLVM_USE_SANITIZER
value, there's a cmake warning and the build goes on with no
sanitizers at all. This isn't a good behaviour, since cmake warnings
are fairly easy to miss and the resulting behaviour is that it looks
like the build is sanitizer clean.

Upgrade these warnings to errors so misconfigurations are more
obvious.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -507,17 +507,17 @@
       append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
               CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     else()
-      message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
+      message(FATAL_ERROR "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
     endif()
   elseif(MSVC)
     if (LLVM_USE_SANITIZER STREQUAL "Address")
       append_common_sanitizer_flags()
       append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     else()
-      message(WARNING "This sanitizer not yet supported in the MSVC environment: ${LLVM_USE_SANITIZER}")
+      message(FATAL_ERROR "This sanitizer not yet supported in the MSVC environment: ${LLVM_USE_SANITIZER}")
     endif()
   else()
-    message(WARNING "LLVM_USE_SANITIZER is not supported on this platform.")
+    message(FATAL_ERROR "LLVM_USE_SANITIZER is not supported on this platform.")
   endif()
   if (LLVM_USE_SANITIZE_COVERAGE)
     append("-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)


Don't pass -Wl,z,defs for now.

Don't pass -Wl,z,defs for now.

It broke the msan build.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -104,13 +104,6 @@
   set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
 endif()

-# Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO
-# build might work on ELF but fail on MachO/COFF.
-if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32))
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
-endif()
-
-
 function(append value)
   foreach(variable ${ARGN})
     set(${variable} "${${variable}} ${value}" PARENT_SCOPE)


ISSUE #526 look for v3 synchro reader

ISSUE #526 look for v3 synchro reader

--- cmake_modules/FindSYNCHROREADER.cmake
+++ cmake_modules/FindSYNCHROREADER.cmake
@@ -25,11 +25,11 @@
 	find_path(SYNCHRO_READER_INCLUDE_DIR interface
 		${SYNCHRO_READER_ROOT}/include
 		)
-	find_library(SYNCHRO_READER_LIBRARIES_RELEASE NAMES 3drepoSynchroReader_2_0_0
+	find_library(SYNCHRO_READER_LIBRARIES_RELEASE NAMES 3drepoSynchroReader_3_0_0
 		PATHS
 		${SYNCHRO_READER_ROOT}/lib
 	)
-find_library(SYNCHRO_READER_LIBRARIES_DEBUG NAMES 3drepoSynchroReader_2_0_0d 3drepoSynchroReader_2_0_0
+find_library(SYNCHRO_READER_LIBRARIES_DEBUG NAMES 3drepoSynchroReader_3_0_0d 3drepoSynchroReader_3_0_0
 		PATHS
 		${SYNCHRO_READER_ROOT}/lib
 	)
@@ -49,14 +49,14 @@
 		/opt/local/include
     )

-	find_library(SYNCHRO_READER_LIBRARIES_RELEASE NAMES 3drepoSynchroReader_2_0_0
+	find_library(SYNCHRO_READER_LIBRARIES_RELEASE NAMES 3drepoSynchroReader_3_0_0
     	PATHS
     	/usr/lib/
     	/usr/local/lib/
     	/opt/local/lib/
     )

-	find_library(SYNCHRO_READER_LIBRARIES_DEBUG NAMES 3drepoSynchroReader_2_0_0d 3drepoSynchroReader_2_0_0
+	find_library(SYNCHRO_READER_LIBRARIES_DEBUG NAMES 3drepoSynchroReader_3_0_0d 3drepoSynchroReader_3_0_0
     	PATHS
     	/usr/lib/
     	/usr/local/lib/


[t:4871] fixing warning options

[t:4871] fixing warning options

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -58,7 +58,6 @@

 include(CheckCCompilerFlag)

-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
 ## adds a compiler flag if the compiler supports it
 macro(set_cflags_if_supported)
   foreach(flag ${ARGN})
@@ -115,13 +114,11 @@
   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -debug all")

   ## set icc warnings
-  set(WARN_CFLAGS
-    -Wcheck  ## icc version of -Wextra
-    )
+  set(CMAKE_C_FLAGS "-Wcheck ${CMAKE_C_FLAGS}")
 else()
   ## set gcc warnings
+  set(CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")
   set(WARN_CFLAGS
-    -Wextra
     -Wcast-align
     -Wbad-function-cast
     -Wno-missing-noreturn
@@ -135,6 +132,8 @@
 endif()

 set_cflags_if_supported(${WARN_CFLAGS})
+## always want these
+set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")

 ## function for adding -fvisibility=hidden to targets
 function(set_targets_visibility_hidden)


[t:4871] disable -Wshadow on osx

[t:4871] disable -Wshadow on osx

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -127,8 +127,12 @@
     -Wmissing-declarations
     -Wpointer-arith
     -Wmissing-format-attribute
-    -Wshadow
     )
+  if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
+    message(WARNING "Disabling -Wshadow on osx.  TODO: fix shadowed declarations and re-enable it.")
+  else ()
+    list(APPEND WARN_CFLAGS -Wshadow)
+  endif ()
 endif()

 set_cflags_if_supported(${WARN_CFLAGS})


Revert "Reuse MARBLE_PLUGIN_INSTALL_PATH."

Note that this will break a cmake install when using a local
install path and QTONLY=TRUE, so needs a better approach in
the future. Workarounds are using sudo/root for make install
or disabling designer plugins (WITH_DESIGNER_PLUGIN=FALSE)

This reverts commit 2773f06af5f57563d5c5c8e0ea8e74d56c8300bb.

CCBUG: 327690

--- MarbleMacros.cmake
+++ MarbleMacros.cmake
@@ -112,7 +112,7 @@
                                            ${QT_QTMAIN_LIBRARY}
                                            ${${_target_name}_LIBS}
                                            marblewidget )
-    install( TARGETS ${_target_name} DESTINATION ${MARBLE_PLUGIN_INSTALL_PATH}/designer )
+    install( TARGETS ${_target_name} DESTINATION ${QT_PLUGINS_DIR}/designer )
 else( QTONLY )
     kde4_add_plugin( ${_target_name} ${_src} )
     target_link_libraries( ${_target_name} ${QT_QTCORE_LIBRARY}
@@ -127,7 +127,7 @@
                                            ${QT_QTMAIN_LIBRARY}
                                            ${${_target_name}_LIBS}
                                            marblewidget )
-    install( TARGETS ${_target_name} DESTINATION ${MARBLE_PLUGIN_INSTALL_PATH}/plugins/designer )
+    install( TARGETS ${_target_name} DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/designer )
 endif( QTONLY )

 set_target_properties( ${_target_name} PROPERTIES


Separate git origin organization in original and lower-case variants

--- DoxygenRule.cmake
+++ DoxygenRule.cmake
@@ -24,20 +24,18 @@
 if(GIT_EXECUTABLE)
   execute_process(COMMAND ${GIT_EXECUTABLE} config --get remote.origin.url
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_ORIGIN_URL)
-  if(GIT_ORIGIN_URL) # can be empty for git-svn repos
-    string(REGEX REPLACE ".*github.com[\\/:](.*)\\/.*" "\\1" GIT_ORIGIN_ORG
-      ${GIT_ORIGIN_URL})
-    string(TOLOWER ${GIT_ORIGIN_ORG} GIT_ORIGIN_ORG)
-  endif()
+  string(REGEX REPLACE ".*github.com[\\/:](.*)\\/.*" "\\1" GIT_ORIGIN_ORG
+    "${GIT_ORIGIN_URL}")
 endif()
 if(NOT GIT_ORIGIN_ORG)
-  set(GIT_ORIGIN_ORG eyescale)
+  set(GIT_ORIGIN_ORG Eyescale)
 endif()
+string(TOLOWER ${GIT_ORIGIN_ORG} GIT_ORIGIN_org)

 add_custom_target(github
-  COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/../${GIT_ORIGIN_ORG}/${PROJECT_NAME}-${VERSION}
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/doc/html ${CMAKE_SOURCE_DIR}/../${GIT_ORIGIN_ORG}/${PROJECT_NAME}-${VERSION}
-  COMMENT "Copying API documentation to ${GIT_ORIGIN_ORG}.github.com/${PROJECT_NAME}-${VERSION}"
+  COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/../${GIT_ORIGIN_org}/${PROJECT_NAME}-${VERSION}
+  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/doc/html ${CMAKE_SOURCE_DIR}/../${GIT_ORIGIN_org}/${PROJECT_NAME}-${VERSION}
+  COMMENT "Copying API documentation to ${GIT_ORIGIN_org}.github.com/${PROJECT_NAME}-${VERSION}"
   VERBATIM)
 add_dependencies(github doxygen)


Reduce verbose debug info in CircleCI

Reduce verbose debug info in CircleCI

--- scripts/circle/EnvironmentModules.cmake
+++ scripts/circle/EnvironmentModules.cmake
@@ -103,7 +103,6 @@
       file(WRITE ${tempfile_name} "")
       string(REPLACE "\n" ";" out_var "${out_var}")
       foreach(sh_cmd IN LISTS out_var)
-        message("DEBUG: sh_cmd: ${sh_cmd}")
         if(sh_cmd MATCHES "^ *unset *([^ ]*)")
           set(cmake_cmd "unset(ENV{${CMAKE_MATCH_1}})")
         elseif(sh_cmd MATCHES "^ *export *([^ ]*)")
@@ -111,8 +110,6 @@
         elseif(sh_cmd MATCHES " *([^ =]*) *= *(.*)")
           set(var_name "${CMAKE_MATCH_1}")
           set(var_value "${CMAKE_MATCH_2}")
-          message("DEBUG: var_name: ${var_name}")
-          message("DEBUG: var_value: ${var_value}")
           if(var_value MATCHES "^\"(.*[^\\])\"")
             # If it's in quotes, take the value as is
             set(var_value "${CMAKE_MATCH_1}")
@@ -125,7 +122,6 @@
         else()
           continue()
         endif()
-        message("DEBUG: cmake_cmd: ${cmake_cmd}")
         file(APPEND ${tempfile_name} "${cmake_cmd}\n")
       endforeach()
     endif()


FindEigen3.cmake: Add reading hints of Eigen directory location from environment variables EIGEN3_ROOT and EIGEN3_ROOT_DIR .

--HG--
branch : traversaro/findeigen3cmake-add-reading-hints-of-eig-1407426517521

--- cmake/FindEigen3.cmake
+++ cmake/FindEigen3.cmake
@@ -9,6 +9,12 @@
 #  EIGEN3_FOUND - system has eigen lib with correct version
 #  EIGEN3_INCLUDE_DIR - the eigen include directory
 #  EIGEN3_VERSION - eigen version
+#
+# This module reads hints about search locations from
+# the following enviroment variables:
+#
+# EIGEN3_ROOT
+# EIGEN3_ROOT_DIR

 # Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
 # Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
@@ -62,6 +68,9 @@
 else (EIGEN3_INCLUDE_DIR)

   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
+      HINTS
+      ENV EIGEN3_ROOT
+      ENV EIGEN3_ROOT_DIR
       PATHS
       ${CMAKE_INSTALL_PREFIX}/include
       ${KDE4_INCLUDE_DIR}


Fixed FindMatlab.cmake to find R2012a.

Fixed FindMatlab.cmake to find R2012a.

--- cmake/FindMatlab.cmake
+++ cmake/FindMatlab.cmake
@@ -67,7 +67,7 @@
       SET(MATLAB_ROOT $ENV{MATLAB_ROOT})
     ELSE($ENV{MATLAB_ROOT})
       SET(MATLAB_ROOT /opt/matlab)
-    ENDIF($ENV{MATLAB_ROOT})
+    ENDIF($ENV{MATLAB_ROOT})
   ENDIF(NOT MATLAB_ROOT)
   # Regular x86
   IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
@@ -76,12 +76,13 @@
       /usr/local/matlab-7sp1/bin/glnx86/
       /opt/matlab-7sp1/bin/glnx86/
       )
-  # AMD64:
+  # AMD64:
   ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
     SET(MATLAB_SYS
       $ENV{MATLAB_ROOT}/bin/glnxa64/
       /usr/local/MATLAB/R2011a/bin/glnxa64/
       /usr/local/MATLAB/R2011b/bin/glnxa64/
+      /usr/local/MATLAB/R2012a/bin/glnxa64/
       /usr/local/matlab/bin/glnxa64/
       /data/MATLAB/R2011b/bin/glnxa64/
       /Applications/MATLAB_R2011a.app/bin/maci64
@@ -95,13 +96,14 @@
   find_library(MATLAB_QT_QTCORE_LIBRARY QtCore ${MATLAB_SYS})
   find_library(MATLAB_QT_QTGUI_LIBRARY QtGui ${MATLAB_SYS})
   find_library(MATLAB_QT_QTXML_LIBRARY QtXml ${MATLAB_SYS})
-
+
   find_path(MATLAB_INCLUDE_DIR
     "mex.h"
     PATHS
     $ENV{MATLAB_ROOT}/extern/include/
     /usr/local/MATLAB/R2011a/extern/include
     /usr/local/MATLAB/R2011b/extern/include
+    /usr/local/MATLAB/R2012a/extern/include
     /usr/local/matlab/extern/include/
     /data/MATLAB/R2011b/extern/include/
     /Applications/MATLAB_R2011a.app/extern/include/


cmake: Fix invalid warning related to rimage

Fixes an issue on SOF-supported boards where the build system
incorrectly believed that the rimage target was changing when rerunning
CMake, even though the user did not change any configuration. This issue
was introduced in commit 525fa76f4dd13d42549261c9fc846a150ee291bc.

Create initial build dir:
$ west build --board intel_adsp_cavs18 samples/subsys/audio/sof

Re-run CMake with no arguments in that build dir:
$ cd build
$ cmake .

CMake Warning at /home/mhelm/zephyrproject/zephyr/cmake/extensions.cmake:2403 (message):
  The build directory must be cleaned pristinely when changing rimage target,

  Current value="", Ignored value="cnl"
Call Stack (most recent call first):
  /home/mhelm/zephyrproject/zephyr/cmake/extensions.cmake:829 (zephyr_check_cache)
  /home/mhelm/zephyrproject/zephyr/boards/xtensa/intel_adsp_cavs18/board.cmake:6 (board_set_rimage_target)
  /home/mhelm/zephyrproject/zephyr/cmake/app/boilerplate.cmake:635 (include)
  /home/mhelm/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/mhelm/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
  CMakeLists.txt:5 (find_package)

Signed-off-by: Maureen Helm <87a696db5547fa477bda9f9e0f00013c839c14d3@intel.com>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -826,8 +826,8 @@
 endfunction()

 function(board_set_rimage_target target)
+  set(RIMAGE_TARGET ${target} CACHE STRING "rimage target")
   zephyr_check_cache(RIMAGE_TARGET)
-  set(RIMAGE_TARGET ${target} CACHE STRING "rimage target")
 endfunction()

 # Zephyr board revision:


Remove debugging messages.

svn path=/trunk/; revision=6854

--- cmake/modules/gd.cmake
+++ cmake/modules/gd.cmake
@@ -82,7 +82,5 @@
     set(gd_LINK_FLAGS "${gd_LINK_FLAGS} ${LIBSHORT}")
   endforeach(LIB ${GD_LIBRARIES})
   set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${gd_LINK_FLAGS})
-  MESSAGE("${gd_COMPILE_FLAGS}")
-  MESSAGE("${gd_LINK_FLAGS}")
 endif(PLD_png OR PLD_jpeg OR PLD_gif)


added hidden run_tests hierarchy which enables the run_tests target to clean the test result before running all tests without performing any cleaning for project-specific run_tests_* targets

--- cmake/test/tests.cmake
+++ cmake/test/tests.cmake
@@ -19,14 +19,9 @@
 endif()

 # create target to clean test results
-if(NOT TARGET clean-test-results)
-  # clean out previous test results before running tests
-  add_custom_target(clean-test-results
+if(NOT TARGET clean_test_results)
+  add_custom_target(clean_test_results
     COMMAND ${CMAKE_COMMAND} -E remove_directory ${CATKIN_TEST_RESULTS_DIR})
-  # make the 'tests' target depend on 'clean-test-results'
-  # which will ensure that test results are deleted before we try to build all tests
-  # and thus before we try to run all tests
-  add_dependencies(tests clean-test-results)
 endif()

 #
@@ -47,12 +42,18 @@
   # create meta target to trigger all tests of a project
   if(NOT TARGET run_tests_${PROJECT_NAME})
     add_custom_target(run_tests_${PROJECT_NAME})
-    add_dependencies(run_tests run_tests_${PROJECT_NAME})
+    # create hidden meta target which depends on hidden test targets which depend on clean_test_results
+    add_custom_target(.run_tests_${PROJECT_NAME})
+    # run_tests depends on this hidden target hierarchy to clear test results before running all tests
+    add_dependencies(run_tests .run_tests_${PROJECT_NAME})
   endif()
   # create meta target to trigger all tests of a specific type of a project
   if(NOT TARGET run_tests_${PROJECT_NAME}_${type})
     add_custom_target(run_tests_${PROJECT_NAME}_${type})
     add_dependencies(run_tests_${PROJECT_NAME} run_tests_${PROJECT_NAME}_${type})
+    # hidden meta target which depends on hidden test targets which depend on clean_test_results
+    add_custom_target(.run_tests_${PROJECT_NAME}_${type})
+    add_dependencies(.run_tests_${PROJECT_NAME} .run_tests_${PROJECT_NAME}_${type})
   endif()
   # create target for test execution
   set(results ${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME}/${xunit_filename})
@@ -60,8 +61,14 @@
     set(working_dir_arg "--working-dir" ${_testing_WORKING_DIRECTORY})
   endif()
   assert(CATKIN_ENV)
+  set(cmd ${CATKIN_ENV} ${PYTHON_EXECUTABLE}
+    ${catkin_EXTRAS_DIR}/test/run_tests.py --results ${results} ${working_dir_arg} ${_testing_COMMAND})
   add_custom_target(run_tests_${PROJECT_NAME}_${type}_${name}
-    COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE}
-    ${catkin_EXTRAS_DIR}/test/run_tests.py --results ${results} ${working_dir_arg} ${_testing_COMMAND})
+    COMMAND ${cmd})
   add_dependencies(run_tests_${PROJECT_NAME}_${type} run_tests_${PROJECT_NAME}_${type}_${name})
+  # hidden test target which depends on clean_test_results
+  add_custom_target(.run_tests_${PROJECT_NAME}_${type}_${name}
+    COMMAND ${cmd})
+  add_dependencies(.run_tests_${PROJECT_NAME}_${type} .run_tests_${PROJECT_NAME}_${type}_${name})
+  add_dependencies(.run_tests_${PROJECT_NAME}_${type}_${name} clean_test_results)
 endfunction()


prefer local joedb over system joedb

prefer local joedb over system joedb

--- compcmake/joedbc.cmake
+++ compcmake/joedbc.cmake
@@ -7,13 +7,13 @@
 set(JOEDB_DIR ${CMAKE_CURRENT_LIST_DIR})

 find_program(JOEDBC joedbc
- HINTS
-  ${JOEDB_DIR}/${JOEDB_BUILD_PATH}
+ HINTS ${JOEDB_DIR}/${JOEDB_BUILD_PATH}
+ NO_DEFAULT_PATH
 )

 find_library(JOEDB_LIB joedb
- HINTS
-  ${JOEDB_DIR}/${JOEDB_BUILD_PATH}
+ HINTS ${JOEDB_DIR}/${JOEDB_BUILD_PATH}
+ NO_DEFAULT_PATH
 )

 message("== JOEDBC = ${JOEDBC}")


ccache configuration check hardening

ccache configuration check hardening

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -1928,19 +1928,25 @@
 	else()
 		set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
 	endif()
+	# check if ccache is used as a compiler launcher
 	get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
-	if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
+	get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" REALPATH)
+	if (_realCompilerExe MATCHES "ccache" OR _launcher MATCHES "ccache")
+		# verify that ccache configuration is compatible with precompiled headers
+		# always check environment variable CCACHE_SLOPPINESS, because earlier versions of ccache
+		# do not report the "sloppiness" setting correctly upon printing ccache configuration
 		if (DEFINED ENV{CCACHE_SLOPPINESS})
-			if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
+			if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR
+				NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
 				set (${_msgVar}
 					"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
 					PARENT_SCOPE)
 			endif()
 		else()
-			if (_launcher MATCHES "ccache")
-				get_filename_component(_ccacheExe "${_launcher}" REALPATH)
+			if (_realCompilerExe MATCHES "ccache")
+				set (_ccacheExe "${_realCompilerExe}")
 			else()
-				get_filename_component(_ccacheExe "${CMAKE_${_language}_COMPILER}" REALPATH)
+				set (_ccacheExe "${_launcher}")
 			endif()
 			execute_process(
 				COMMAND "${_ccacheExe}" "--print-config"
@@ -1948,9 +1954,10 @@
 				RESULT_VARIABLE _result
 				OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
 				ERROR_QUIET)
-			if (_result OR NOT
-				_ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR NOT
-				_ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
+			if (_result)
+				set (${_msgVar} "ccache configuration cannot be determined." PARENT_SCOPE)
+			elseif (NOT _ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR
+				NOT _ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
 				set (${_msgVar}
 					"ccache requires configuration setting \"sloppiness\" to be set to \"pch_defines,time_macros\"."
 					PARENT_SCOPE)


FIX: added the right executable name to add_test.

--- cmake/DOMacros.cmake
+++ cmake/DOMacros.cmake
@@ -289,7 +289,7 @@
     COMPILE_FLAGS "${ENABLE_CXX11} -DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR}"
     COMPILE_DEFINITIONS DO_STATIC)
   add_test(${_unit_test_name}
-           "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DO_${_unit_test_name}_test")
+           "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_unit_test_name}")

   if (DEFINED test_group_name)
     set_property(TARGET ${_unit_test_name}


removed redundant log in cmake utils

removed redundant log in cmake utils

--- cmake/EthUtils.cmake
+++ cmake/EthUtils.cmake
@@ -74,8 +74,6 @@
 		list(APPEND filenames "${${resource}}")
 	endforeach(resource)

-	message(STATUS "filenames; ${filenames}")
-
 	add_custom_command(OUTPUT ${OUTPUT}
 		COMMAND ${CMAKE_COMMAND} -DETH_RES_FILE="${RESOURCE_FILE}" -P "${ETH_SCRIPTS_DIR}/resources.cmake"
 		DEPENDS ${filenames}


update cmake for loadpng

update cmake for loadpng

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@6638 662fdd30-d327-0410-a531-f549c87e1e9e

--- cmake/FileList.cmake
+++ cmake/FileList.cmake
@@ -134,9 +134,9 @@
 src/openbor/data.cpp)

 set(LOADPNG_SRC
-src/util/loadpng/loadpng.c
-src/util/loadpng/regpng.c
-src/util/loadpng/savepng.c)
+src/util/allegro/loadpng/loadpng.c
+src/util/allegro/loadpng/regpng.c
+src/util/allegro/loadpng/savepng.c)

 set(MENU_SRC
 src/util/menu/actionfactory.cpp


Fix "FindGLEW.cmake" to also look for library names with "glew" rather then "GLEW".

--HG--
branch : mingw

--- cmake/FindGLEW.cmake
+++ cmake/FindGLEW.cmake
@@ -4,13 +4,13 @@
 include(FindPackageHandleStandardArgs)

 find_path(GLEW_H_PATH NAMES GL/glew.h)
-find_library(GLEW_LIB NAMES GLEW libGLEW PATH_SUFFIXES dynamic)
-find_library(GLEW_LIB_DBG NAMES GLEW_d libGLEW_d PATH_SUFFIXES dynamic)
+find_library(GLEW_LIB NAMES GLEW libGLEW glew libglew PATH_SUFFIXES dynamic)
+find_library(GLEW_LIB_DBG NAMES GLEW_d libGLEW_d glew_d libglew_d PATH_SUFFIXES dynamic)
 mark_as_advanced(GLEW_H_PATH GLEW_LIB GLEW_LIB_DBG)

 if (WIN32 OR APPLE)
-    find_library(GLEW_LIB_STATIC NAMES GLEW libGLEW PATH_SUFFIXES static)
-    find_library(GLEW_LIB_STATIC_DBG NAMES GLEW_d libGLEW_d PATH_SUFFIXES static)
+    find_library(GLEW_LIB_STATIC NAMES GLEW libGLEW glew libglew PATH_SUFFIXES static)
+    find_library(GLEW_LIB_STATIC_DBG NAMES GLEW_d libGLEW_d glew_d libglew_d PATH_SUFFIXES static)
     mark_as_advanced(GLEW_LIB_STATIC GLEW_LIB_STATIC_DBG)
 endif()


add suppresion file fix

add suppresion file fix

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@8124 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -74,7 +74,7 @@
 #find_program( MEMORYCHECK_COMMAND valgrind )
 #--gen-suppressions=all --trace-children=yes --track-origins=yes
 set( MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-reachable=yes --gen-suppressions=all" CACHE INTERNAL "")
-set( MEMORYCHECK_SUPPRESSIONS_FILE "${gismo_SOURCE_DIR}/valgrind_supp.txt" CACHE INTERNAL "")
+set( MEMORYCHECK_SUPPRESSIONS_FILE "${gismo_SOURCE_DIR}/cmake/valgrind_supp.txt" CACHE INTERNAL "")

 # Enable C++ 11 features if present
 if(GISMO_BUILD_CPP11 AND NOT MSVC)


Use CTK version with fixed SQL statements.

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   IF(NOT DEFINED CTK_DIR)

-    SET(revision_tag 34a638b)
+    SET(revision_tag 3d73e05)
     IF(${proj}_REVISION_TAG)
       SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


Update Options.cmake

Update Options.cmake

--- logrotate/Options.cmake
+++ logrotate/Options.cmake
@@ -20,10 +20,10 @@

 SET(G3_LIBRARY_PATH "" CACHE FILEPATH "Path to g3log libraries")
-IF(EXISTS "${G3_LIBRARY_PATH}/libg3logger_shared.so" )
+IF(EXISTS "${G3_LIBRARY_PATH}/libg3logger.a")
    MESSAGE("SUCCESS lib")
 ELSE()
-  MESSAGE(SEND_ERROR "Can't find g3logger library file in G3_LIBRARY_PATH/libg3logger_shared.so:'${G3_LIBRARY_PATH}/libg3logger_shared.so'. Please set it with '-DG3_LIBRARY_PATH'")
+  MESSAGE(SEND_ERROR "Can't find g3logger library file in G3_LIBRARY_PATH/libg3logger.a:' ${G3_LIBRARY_PATH}'. Please set it with '-DG3_LIBRARY_PATH'")
 ENDIF()

@@ -32,7 +32,7 @@
 IF(EXISTS ${G3_HEADER_PATH}/g3log/g3log.hpp)
    MESSAGE("SUCCESS path")
 ELSE()
-  MESSAGE(FATAL_ERROR "Can't find g3log.hpp at  G3_HEADER_PATH/g3log/g3log.hpp, i.e. '${G3_HEADER_PATH}/g3log/g3log.hpp'. Please set it with '-DG3_HEADER_PATH'")
+  MESSAGE(FATAL_ERROR "Can't find g3log.hpp at G3_HEADER_PATH/g3log/g3log.hpp, i.e. '${G3_HEADER_PATH}/g3log/g3log.hpp'. Please set it with '-DG3_HEADER_PATH'")
 ENDIF()

@@ -66,4 +66,3 @@

 #MESSAGE("G3_HEADER_PATH = " ${G3_HEADER_PATH})
 #MESSAGE("You can change it with  cmake -DUSE_G3_HEADER_PATH=path_to_headers (i.e. something like /usr/local/include)")
-


New version: 0.4.9

New version: 0.4.9

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


Newer boost versions

Newer boost versions


Remove useless hanafuda-llvm find

Remove useless hanafuda-llvm find

--- atdna/FindLLVM.cmake
+++ atdna/FindLLVM.cmake
@@ -31,9 +31,6 @@
 set(LLVM_FIND_COMPONENTS "")
 if(WIN32)
 get_filename_component(LLVM_ROOT_DIR [HKEY_LOCAL_MACHINE\\Software\\LLVM\\LLVM] ABSOLUTE)
-if(NOT LLVM_ROOT_DIR OR ${LLVM_ROOT_DIR} STREQUAL "/registry")
-get_filename_component(LLVM_ROOT_DIR [HKEY_LOCAL_MACHINE\\Software\\AxioDL\\llvm-hanafuda] ABSOLUTE)
-endif()
 endif()

 set(llvm_config_names llvm-config-3.9 llvm-config39


Looks like I broke Android builds on nearly all platforms. This should fix it up.

--HG--
branch : v1-9

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -11,10 +11,18 @@

 # Default build output paths
 if (NOT OGRE_ARCHIVE_OUTPUT)
-  set(OGRE_ARCHIVE_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
+  if(APPLE AND NOT OGRE_BUILD_PLATFORM_ANDROID)
+    set(OGRE_ARCHIVE_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
+  else()
+    set(OGRE_ARCHIVE_OUTPUT ${OGRE_BINARY_DIR}/lib)
+  endif()
 endif ()
 if (NOT OGRE_LIBRARY_OUTPUT)
-  set(OGRE_LIBRARY_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
+  if(APPLE AND NOT OGRE_BUILD_PLATFORM_ANDROID)
+    set(OGRE_LIBRARY_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
+  else()
+    set(OGRE_LIBRARY_OUTPUT ${OGRE_BINARY_DIR}/lib)
+  endif()
 endif ()
 if (NOT OGRE_RUNTIME_OUTPUT)
   set(OGRE_RUNTIME_OUTPUT ${OGRE_BINARY_DIR}/bin)


upgrade to boost 1.65.0 for cubic_b_spline interpolation

--- version_config.cmake
+++ version_config.cmake
@@ -22,10 +22,10 @@
 #=========================================================================

 ## BOOST
-set(Boost_VERSION 1.64.0)
-set(Boost_REQUIRED_VERSION 1.64.0)
-set(Boost_URL http://downloads.sourceforge.net/project/boost/boost/1.64.0/boost_1_64_0.zip)
-set(Boost_MD5 36093e4018aecd5b0e31e80457ac5fc1)
+set(Boost_VERSION 1.65.0)
+set(Boost_REQUIRED_VERSION 1.65.0)
+set(Boost_URL http://downloads.sourceforge.net/project/boost/boost/1.65.0/boost_1_65_0.zip)
+set(Boost_MD5 eb1e11262e0cfc6949d054f6d8d25dc6)

 ## Armadillo
 set(Armadillo_URL   https://downloads.sourceforge.net/project/arma/armadillo-7.800.2.tar.xz)


revert to ISMRMRD v1.4.1

revert to ISMRMRD v1.4.1

We need to work-around https://github.com/SyneRBI/SIRF-SuperBuild/issues/568 first

--- version_config.cmake
+++ version_config.cmake
@@ -113,7 +113,7 @@
   set(DEFAULT_ISMRMRD_TAG program_options_fix)
 else()
   set(DEFAULT_ISMRMRD_URL https://github.com/ismrmrd/ismrmrd )
-  set(DEFAULT_ISMRMRD_TAG v1.4.2.1)
+  set(DEFAULT_ISMRMRD_TAG v1.4.1)
 endif()

 ## Gadgetron


fixed jenkins build error

fixed jenkins build error

--- examples/include.cmake
+++ examples/include.cmake
@@ -22,8 +22,19 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 #
-set(CMAKE_CXX_STANDARD 17)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
+if(WIN32)
+    set(VSVERSION "vs2019" CACHE STRING "Visual Studio version")
+    link_directories("${BASEPATH}/C++/lib/${VSVERSION}")
+else()
+    link_directories("${BASEPATH}/C++/lib")
+endif()
+
+if(UNIX) # Apple or Linux
+    link_libraries(dl)
+    if (NOT APPLE)
+        link_libraries(stdc++fs pthread)
+    endif()
+endif()

 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 if ("$ENV{GAMS_BUILD}" STREQUAL "")
@@ -41,22 +52,3 @@
                     "${BASEPATH}/C++/api"
                     "${gtest_SOURCE_DIR}/include")

-if(WIN32)
-    set(VSVERSION "vs2019" CACHE STRING "Visual Studio version")
-    link_directories("${BASEPATH}/C++/lib/${VSVERSION}")
-else()
-    link_directories("${BASEPATH}/C++/lib")
-endif()
-
-if(UNIX) # Apple or Linux
-    link_libraries(dl)
-    if (NOT APPLE)
-        link_libraries(stdc++fs pthread)
-    endif()
-    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-        if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
-            set(CMAKE_C_COMPILER "gcc-8")
-            set(CMAKE_CXX_COMPILER "g++-8")
-        endif()
-    endif()
-endif()


Some minor work for building our tests.

Some minor work for building our tests.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -531,10 +531,29 @@
             IF(    EXISTS ${PROJECT_SOURCE_DIR}/${TEST_SOURCE_FILE}
                AND EXISTS ${PROJECT_SOURCE_DIR}/${TEST_HEADER_MOC_FILE})
                 # The test exists, so build it
+                # Note: some features (e.g. the interfaces) may not be needed,
+                #       but we need a solution that works for all possible
+                #       tests, hence they are included...
+
+                IF(WIN32)
+                    SET(CORE_SOURCES_MOC)
+                    SET(CORE_SOURCES)
+                ELSE()
+                    SET(CORE_SOURCES_MOC
+                        ../../misc/Core/src/dockwidget.h
+                    )
+
+                    SET(CORE_SOURCES
+                        ../../misc/Core/src/commonwidget.cpp
+                        ../../misc/Core/src/dockwidget.cpp
+                    )
+                ENDIF()

                 QT5_WRAP_CPP(TEST_SOURCES_MOC
                     ../../plugin.h
                     ../../pluginmanager.h
+
+                    ${CORE_SOURCES_MOC}

                     ${HEADERS_MOC}
                     ${TEST_HEADER_MOC_FILE}
@@ -550,6 +569,8 @@
                     ../../plugininfo.cpp
                     ../../pluginmanager.cpp
                     ../../solverinterface.cpp
+
+                    ${CORE_SOURCES}

                     ${TEST_SOURCE_FILE}
                     ${TEST_SOURCES_MOC}


cmake: include the binary dir's common include dir

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -31,3 +31,5 @@

 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/common/include/nomad/config.h.in"
 	"${CMAKE_CURRENT_BINARY_DIR}/src/common/include/nomad/config.h")
+
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/src/common/include")


Revert unintended commit

Revert unintended commit

--- build_settings.cmake
+++ build_settings.cmake
@@ -60,7 +60,7 @@
 endif()

 # C and C++ compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} -DXXH_INLINE_ALL -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} ${EXTRA_C_FLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} -DXXH_INLINE_ALL -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} ${EXTRA_C_FLAGS}")
 # AddressSanitizer/ThreadSanitizer work for both GCC and Clang
 if (VESPA_USE_SANITIZER)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${VESPA_USE_SANITIZER}")


option to link boost statically

option to link boost statically


Remove uneeded Cmake quoting for Windows that cause warnings. #6079

The quoting in these rules work for cmake 3.x, but now cause
issues in cmake 2.x.  Fact is the quotes or these rules themselves
are completely reduntant, so best fix is to simply remove them.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -37,11 +37,6 @@
 	endif()
 	add_definitions(-D_CRT_SECURE_NO_WARNINGS)

-	# don't set -DWINDOWS if we are just going to set -DWINDOWS="WINDOWS_6.X" later... it just causes warnings...
-	if (NOT (${OS_NAME} STREQUAL \""WINDOWS\""))
-	   add_definitions(-DWINDOWS)
-	endif ()
-
 	if(NOT (MSVC_VERSION LESS 1700))
 		set(PREFER_CPP11 TRUE)
 	endif()
@@ -741,8 +736,8 @@
 # above the addition of the .../src/classads subdir:
 if (LINUX
     AND PROPER
-    AND ("\"${CMAKE_CXX_COMPILER_ID}\"" STREQUAL "GNU")
-    AND NOT ("\"${CMAKE_CXX_COMPILER_VERSION}\"" VERSION_LESS 4.4.6))
+    AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+    AND NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.4.6))

     # I wrote a nice macro for testing linker flags, but it is useless
     # because at least some older versions of linker ignore all '-z'


Correct accidental checkin of debug compiler options.


Explicitly enable RemotingViewsPython

Explicitly enable RemotingViewsPython

This will hopefully fix a linking error on windows...

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -37,6 +37,7 @@
     -DPARAVIEW_USE_VTKM:BOOL=OFF
     -DPARAVIEW_PLUGINS_DEFAULT:BOOL=OFF
     -DVTK_MODULE_ENABLE_ParaView_VTKExtensionsExtractionPython:STRING=YES
+    -DVTK_MODULE_ENABLE_ParaView_RemotingViewsPython:STRING=YES
     # Disable for now as kits requires CMake 3.12
     #    -DPARAVIEW_ENABLE_KITS:BOOL=ON
     -DPARAVIEW_ENABLE_FFMPEG:BOOL=ON


upgrade to GLM 0.9.6.3

upgrade to GLM 0.9.6.3

--- cmake/EmbedGlm.cmake
+++ cmake/EmbedGlm.cmake
@@ -5,8 +5,8 @@
 ###############################################
 ExternalProject_Add(
   glm
-  URL https://github.com/g-truc/glm/archive/0.9.5.4.zip
-  URL_MD5 f4ccdcbe80530995905c8d127cb834dc
+  URL https://github.com/g-truc/glm/archive/0.9.6.3.zip
+  URL_MD5 e7dc7970e1cb1a2a04874eddded0709e
   PREFIX "${CMAKE_CURRENT_BINARY_DIR}/glm"
   CONFIGURE_COMMAND ""
   BUILD_IN_SOURCE 1


add class to handle gradients

add class to handle gradients

--- cmake/FileList.cmake
+++ cmake/FileList.cmake
@@ -120,6 +120,7 @@
 src/util/ftalleg.cpp
 src/util/funcs.cpp
 src/util/file-system.cpp
+src/util/gradient-glow.cpp
 src/util/ebox.cpp
 src/util/joystick.cpp
 src/util/allegro-joystick.cpp