BUG: In DCMTK/CMakeLists.txt, files osconfig.h.in and cf{unix|win32}.h.in are now configured and installed properly

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -48,8 +48,8 @@
 FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
   ${DCMTK_DIR}/config/include
   ${DCMTK_DIR}/config
+  ${DCMTK_DIR}/include/dcmtk/config
   ${DCMTK_DIR}/include
-  ${DCMTK_DIR}/include/dcmtk
 )

 FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
@@ -121,12 +121,9 @@
     AND DCMTK_dcmimgle_INCLUDE_DIR
     AND DCMTK_dcmimgle_LIBRARY )

-  # Wrap library is required on Linux
+#   # Wrap library is required on Linux
 #   IF(NOT WIN32)
-#     FIND_LIBRARY(DCMTK_wrap_LIBRARY wrap
-#       /usr/lib
-#       /lib
-#       /usr/local/lib)
+#     FIND_LIBRARY(DCMTK_wrap_LIBRARY wrap)
 #     MESSAGE(DCMTK_wrap_LIBRARY:${DCMTK_wrap_LIBRARY})
 #     IF(NOT DCMTK_wrap_LIBRARY)
 #       MESSAGE(FATAL_ERROR "error: Wrap library is required to use DCMTK. "


Fix build name generation within template dashboard script

Introduce variable MY_R_VERSION

--- CMake/VisomicsDashboardScript.TEMPLATE.cmake
+++ CMake/VisomicsDashboardScript.TEMPLATE.cmake
@@ -25,6 +25,7 @@
 set(MY_OPERATING_SYSTEM   "Linux") # Windows, Linux, Darwin...
 set(MY_COMPILER           "g++4.4.3")
 set(MY_QT_VERSION         "4.7")
+set(MY_R_VERSION          "2.11.1")
 set(QT_QMAKE_EXECUTABLE   "$ENV{HOME}/Dashboards/Support/qtsdk-2010.05/qt/bin/qmake")
 set(R_COMMAND             "$ENV{HOME}/Dashboards/Support/R-2.11.1/bin/R")
 set(CTEST_SITE            "karakoram.kitware") # for example: mymachine.kitware, mymachine.bwh.harvard.edu, ...
@@ -139,7 +140,7 @@
 #-----------------------------------------------------------------------------
 # Note: If you have multiple dashboard scripts checking out different GIT TAG and/or REPOSITORY
 #       Make sure you append a suffix to the source directory to differentate them.
-setIfNotDefined(BUILD_OPTIONS_STRING "Qt4.7-R-2.11.1-${GIT_TAG}")
+setIfNotDefined(BUILD_OPTIONS_STRING "-${GIT_TAG}")

 #-----------------------------------------------------------------------------
 # Build directory
@@ -166,7 +167,7 @@
 # Project specific properties
 #
 set(CTEST_PROJECT_NAME "Visomics")
-set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM}-${MY_COMPILER}-QT${MY_QT_VERSION}-${BUILD_OPTIONS_STRING}-${CTEST_BUILD_CONFIGURATION}")
+set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM}-${MY_COMPILER}-Qt${MY_QT_VERSION}-R${MY_R_VERSION}-${BUILD_OPTIONS_STRING}-${CTEST_BUILD_CONFIGURATION}")

 #
 # Display build info


fix copy-paste typo

fix copy-paste typo

--- modules/omp.cmake
+++ modules/omp.cmake
@@ -24,7 +24,7 @@
     find_package(OpenMP)
     if(OPENMP_FOUND)
         if(DEFINED CMAKE_Fortran_COMPILER_ID)
-            set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_C_FLAGS}")
+            set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}")
         endif()
         if(DEFINED CMAKE_C_COMPILER_ID)
             set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")


Minor: removing misleading commentary

Minor: removing misleading commentary

--- salome_adm/cmake_files/FindSalomePythonLibs.cmake
+++ salome_adm/cmake_files/FindSalomePythonLibs.cmake
@@ -27,7 +27,6 @@
 # Use the PYTHON_ROOT_DIR if PYTHONLIBS_ROOT_DIR is not defined:
 SET(PYTHON_ROOT_DIR "$ENV{PYTHON_ROOT_DIR}" CACHE PATH "Path to the Python installation (libs+interpreter)")
 IF(EXISTS "${PYTHON_ROOT_DIR}" AND (NOT PYTHONLIBS_ROOT_DIR))
-  # Extract sub-directory "paraview-x.xx":
   MESSAGE(STATUS "Setting PYTHONLIBS_ROOT_DIR to: ${PYTHON_ROOT_DIR}")
   SET(PYTHONLIBS_ROOT_DIR "${PYTHON_ROOT_DIR}" CACHE PATH "Path to PythonLibs directory")
 ENDIF()


COMP: Fix `find_package(Boost, ...)` call

Unlike what is said in the documentation, the `REQUIRED` parameter cannot be
used before the `COMPONENTS`. Even when the requested components do exist and
are found otherwise.

Don't ask me why.

--- Modules/ThirdParty/Boost/otb-module-init.cmake
+++ Modules/ThirdParty/Boost/otb-module-init.cmake
@@ -6,8 +6,9 @@
   list(APPEND OTB_Boost_COMPONENTS unit_test_framework)
 endif()

+message(STATUS "Looking for boost components: ${OTB_Boost_COMPONENTS}")
 find_package ( Boost
-  REQUIRED
   1.35.0
   COMPONENTS ${OTB_Boost_COMPONENTS}
+  REQUIRED
   )


add definition ENABLE_MPI

add definition ENABLE_MPI

--- modules/mpi.cmake
+++ modules/mpi.cmake
@@ -34,6 +34,8 @@
             set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_COMPILE_FLAGS}")
         endif()
         include_directories(${MPI_INCLUDE_PATH})
+
+        add_definitions(-DENABLE_MPI)
     else()
         message(FATAL_ERROR "-- You asked for MPI, but CMake could not find any MPI installation, check $PATH")
     endif()


added comment

added comment

--- modules/omp.cmake
+++ modules/omp.cmake
@@ -42,6 +42,7 @@
         endif()
     endif()

+    # this is only needed for CMake below 3.5
     if(DEFINED CMAKE_Fortran_COMPILER_ID AND NOT DEFINED OpenMP_Fortran_FLAGS)
         # we do this in a pedestrian way because the Fortran support is relatively recent
         if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)


move FindCVODE module into cmake folder

move FindCVODE module into cmake folder

--- examples/cvode-integrator/FindCVODE.cmake
+++ examples/cvode-integrator/FindCVODE.cmake
@@ -1,45 +0,0 @@
-# - Find CVODE
-# Find the CVODE includes and library
-# This module defines
-#  CVODE_INCLUDE_DIR, where to find CVODE header files.
-#  CVODE_LIBRARIES, the libraries needed to use CVODE.
-#  CVODE_FOUND, If false, do not try to use CVODE.
-# also defined, but not for general use are
-#  CVODE_LIBRARY, where to find CVODE.
-#  CVODE_NVECTOR_SERIAL_LIBRARY, where to find NVECTOR_SERIAL.
-
-FIND_PATH(CVODE_INCLUDE_DIR cvode/cvode.h
-    ${DEPENDENCY_DIR}/include
-    /usr/include/
-    /usr/local/include/
-)
-
-FIND_LIBRARY(CVODE_LIBRARY sundials_cvode
-    ${DEPENDENCY_DIR}/lib
-    /usr/lib
-    /usr/local/lib
-)
-
-FIND_LIBRARY(CVODE_NVECTOR_SERIAL_LIBRARY sundials_nvecserial
-    ${CSIM_DEPENDENCY_DIR}/lib
-    /usr/lib
-    /usr/local/lib
-)
-
-IF (CVODE_INCLUDE_DIR AND CVODE_LIBRARY AND CVODE_NVECTOR_SERIAL_LIBRARY)
-   SET(CVODE_LIBRARIES ${CVODE_LIBRARY} ${CVODE_NVECTOR_SERIAL_LIBRARY})
-   SET(CVODE_FOUND TRUE)
-ENDIF (CVODE_INCLUDE_DIR AND CVODE_LIBRARY AND CVODE_NVECTOR_SERIAL_LIBRARY)
-
-
-IF (CVODE_FOUND)
-   IF (NOT CVODE_FIND_QUIETLY)
-      MESSAGE(STATUS "Found CVODE: ${CVODE_LIBRARIES}")
-   ENDIF (NOT CVODE_FIND_QUIETLY)
-ELSE (CVODE_FOUND)
-   IF (CVODE_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find CVODE")
-   ELSE (CVODE_FIND_REQUIRED)
-      MESSAGE(STATUS "CVODE not found")
-   ENDIF (CVODE_FIND_REQUIRED)
-ENDIF (CVODE_FOUND)


Remove unused args from flatbuffers_c_library macro.

--- build_tools/cmake/flatbuffer_c_library.cmake
+++ build_tools/cmake/flatbuffer_c_library.cmake
@@ -21,10 +21,6 @@
 # Parameters:
 # NAME: name of target (see Note)
 # SRCS: List of source files for the library
-# DEPS: List of other libraries to be linked in to the binary targets
-# COPTS: List of private compile options
-# DEFINES: List of public defines
-# LINKOPTS: List of link options
 # FLATCC_ARGS: List of flattbuffers arguments. Default:
 #             "--common"
 #             "--reader"
@@ -39,32 +35,28 @@
 #
 # flatbuffer_c_library(
 #   NAME
-#     base_schema
+#     some_def
 #   SRCS
-#     "a.fbs"
-# )
-# flatbuffer_c_library(
-#   NAME
-#     other_schemas
-#   SRCS
-#     "b.fbs"
-#   DEPS
-#     iree::schemas::base_schema
+#     "some_def.fbs"
+#   FLATCC_ARGS
+#     "--reader"
+#     "--builder"
+#     "--verifier"
+#     "--json"
 #   PUBLIC
 # )
-#
 # iree_cc_binary(
 #   NAME
 #     main_lib
 #   ...
 #   DEPS
-#     iree::schemas::other_schemas
+#     iree::schemas::some_def
 # )
 function(flatbuffer_c_library)
   cmake_parse_arguments(_RULE
     "PUBLIC;TESTONLY"
     "NAME"
-    "SRCS;COPTS;DEFINES;LINKOPTS;DEPS;FLATCC_ARGS"
+    "SRCS;FLATCC_ARGS"
     ${ARGN}
   )

@@ -128,7 +120,6 @@
     ${_GEN_TARGET}
     DEPENDS
       ${_OUTS}
-      ${_RULE_DEPS}
   )

   add_library(${_NAME} INTERFACE)
@@ -142,11 +133,6 @@
     INTERFACE
       flatcc::runtime
       ${IREE_DEFAULT_LINKOPTS}
-      ${_RULE_LINKOPTS}
-  )
-  target_compile_definitions(${_NAME}
-    INTERFACE
-      ${_RULE_DEFINES}
   )
   target_compile_options(${_NAME}
     INTERFACE


cmake_ [skip ci] print major, minor and build number of boost

--- cMake/FreeCAD_Helpers/PrintFinalReport.cmake
+++ cMake/FreeCAD_Helpers/PrintFinalReport.cmake
@@ -27,7 +27,7 @@
         message(STATUS "pybind11:            not enabled")
     endif(DEFINED pybind11_FOUND)

-    message(STATUS "Boost:               ${Boost_VERSION}")
+    message(STATUS "Boost:               ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} (${Boost_VERSION})")

     message(STATUS "XercesC:             [${XercesC_LIBRARIES}] [${XercesC_INCLUDE_DIRS}]")


Update ReportXINDEXErrors parsing logic

Update ReportXINDEXErrors parsing logic

Add a '%' to the regular expressions that are used to capture the name of
the reported routine.  The parser would normally miss routines that
started with %, "%ZTLOAD" in the Kernel Package.

OSEHRA-Id: http://issues.osehra.org/browse/OAT-113
Change-Id: I065eefc7cdfd400c91276321034f5b0b9376eda5

--- CMake/CommonFunctions.cmake
+++ CMake/CommonFunctions.cmake
@@ -28,8 +28,8 @@
    string(REPLACE "_" " " PACKAGE_NAME ${PACKAGE_NAME})
    foreach (line ${OUTPUT})
       # the XINDEX will always check the integrity of the routine using checksum
-      if(line MATCHES "^[A-Z0-9][^ ]+ +\\* \\* .*[cC]hecksum:.*")
-        string(REGEX MATCH "^[A-Z0-9]+[^ ]" routine_name "${line}")
+      if(line MATCHES "^[A-Z0-9%][^ ]+ +\\* \\* .*[cC]hecksum:.*")
+        string(REGEX MATCH "^[A-Z0-9%]+[^ ]" routine_name "${line}")
       elseif(line MATCHES ${FAILURE_CONDITION})
         # also assume the file name is ${PACKAGE_NAME}.${routinename}
         set(ExceptionFound FALSE)


COMP: ExternalProject - Re-added PATHS hint to find_program(git ..)

Also removed legacy trying to set git_EXECUTABLE using Git_EXECUTABLE

--- CMake/ExternalProject.cmake
+++ CMake/ExternalProject.cmake
@@ -771,11 +771,12 @@
     list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
   elseif(git_repository)
     #find_package(Git)
-    # Legacy - Some dashboard are configured using Git_EXECUTABLE
-    if(DEFINED Git_EXECUTABLE)
-      set(git_EXECUTABLE ${Git_EXECUTABLE})
-    endif()
-    find_program(git_EXECUTABLE NAMES git.cmd git eg.cmd eg DOC "git command line client")
+    find_program(git_EXECUTABLE
+      NAMES git.cmd git eg.cmd eg
+      PATHS
+       "C:/Program Files/Git/bin"
+       "C:/Program Files (x86)/Git/bin"
+      DOC "git command line client")
     if(NOT git_EXECUTABLE)
       message(FATAL_ERROR "error: could not find git for clone of ${name} - Make sure git_EXECUTABLE is set properly")
     endif()


BUG: allow 3 retry for remote module cloning

--- CMake/OTBModuleRemote.cmake
+++ CMake/OTBModuleRemote.cmake
@@ -22,12 +22,17 @@

 # Helper to perform the initial git clone and checkout.
 function(_git_clone git_executable git_repository git_tag module_dir)
-  execute_process(
-    COMMAND "${git_executable}" clone "${git_repository}" "${module_dir}"
-    RESULT_VARIABLE error_code
-    OUTPUT_QUIET
-    ERROR_QUIET
-    )
+  set(retryCount 0)
+  set(error_code 1)
+  while(error_code AND (retryCount LESS 3))
+    execute_process(
+      COMMAND "${git_executable}" clone "${git_repository}" "${module_dir}"
+      RESULT_VARIABLE error_code
+      OUTPUT_QUIET
+      ERROR_QUIET
+      )
+    math(EXPR retryCount "${retryCount}+1")
+  endwhile()
   if(error_code)
     message(FATAL_ERROR "Failed to clone repository: '${git_repository}'")
   endif()


Remove space (style convention)

Remove space (style convention)

--- CMakeModules/FindHDF4.cmake
+++ CMakeModules/FindHDF4.cmake
@@ -29,7 +29,7 @@
 if(DF_LIBRARY)
   set(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${SZIP_LIBRARIES})
   check_library_exists(${DF_LIBRARY} Hopen "" HAVE_DF_LIBRARY)
-endif (DF_LIBRARY)
+endif(DF_LIBRARY)

 find_library(MFHDF_LIBRARY NAMES mfhdf libmfhdf PATHS ${HDF4_LIBRARY_DIR})
 if(MFHDF_LIBRARY)


Enable coverage output

Enable coverage output

--- cmake/coverallsGcovJsons.cmake
+++ cmake/coverallsGcovJsons.cmake
@@ -134,7 +134,7 @@
 	# If -p is not specified then the file is named only "the_file.c.gcov"
 	#
 	execute_process(
-		COMMAND "${GCOV_EXECUTABLE} -p -o ${GCDA_DIR} ${GCDA} >/dev/null"
+		COMMAND "${GCOV_EXECUTABLE} -p -o ${GCDA_DIR} ${GCDA}"
 		WORKING_DIRECTORY ${GCDA_DIR}
 	)
 endforeach()


include FindPhononInternal in phonon finder

this previously happened in phonon's cmake config which is wrong and bad
and stuff, so it is now moved to the finders used in the backends

--- cmake/modules/FindPhonon.cmake
+++ cmake/modules/FindPhonon.cmake
@@ -7,12 +7,12 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

 find_package(Phonon NO_MODULE)
-if(PHONON_FOUND)
+
+if(PHONON_BUILDSYSTEM_DIR)
     set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PHONON_BUILDSYSTEM_DIR})
+    include(${PHONON_BUILDSYSTEM_DIR}/FindPhononInternal.cmake )
 endif()

 include(FindPackageHandleStandardArgs)

 find_package_handle_standard_args(Phonon  DEFAULT_MSG  Phonon_DIR )
-
-


cmake: use all compile options arguments for uniqueness

zephyr_library_compile_options() was attempting to create
unique hashes for compile options in order to prevent creating
them multiple times.  However, it was only using the first
argument to create the hash, so if multiple libraries had
different compile options but the first line was the same,
the second set would be mistaken for the first set and would
actually be passed the first set during compilation instead
of its own set.

The fix should be to use the entire compile options argument
list to create the hash so they should only match if the entire
options list is exactly the same.

This is a continued fix for #43835

Signed-off-by: Nicholas Lowell <78486efcf866b347534ad8bb2c5fbf2e8d21f397@lexmark.com>

--- cmake/modules/extensions.cmake
+++ cmake/modules/extensions.cmake
@@ -497,7 +497,7 @@
   # zephyr_interface will be the first interface library that flags
   # are taken from.

-  string(MD5 uniqueness ${item})
+  string(MD5 uniqueness "${ARGV}")
   set(lib_name options_interface_lib_${uniqueness})

   if (NOT TARGET ${lib_name})


CMake: do not overwrite default threading config (std)

--- CMake/PrepareThreadingOptions.cmake
+++ CMake/PrepareThreadingOptions.cmake
@@ -17,29 +17,6 @@

 if (Boost_THREAD_FOUND AND Boost_DATE_TIME_FOUND)
 	set(Boost_THREADING TRUE)
-endif ()
-
-if (Boost_THREADING AND NOT OGRE_THREAD_SUPPORT_AVAILABLE)
-	set(OGRE_THREAD_SUPPORT_AVAILABLE TRUE)
-	set(OGRE_THREAD_DEFAULT_PROVIDER "boost")
-	set(OGRE_THREAD_TYPE "2")
-endif ()
-
-if (POCO_FOUND AND NOT OGRE_THREAD_SUPPORT_AVAILABLE)
-	set(OGRE_THREAD_SUPPORT_AVAILABLE TRUE)
-	set(OGRE_THREAD_DEFAULT_PROVIDER "poco")
-	set(OGRE_THREAD_TYPE "2")
-endif ()
-
-if (TBB_FOUND AND NOT OGRE_THREAD_SUPPORT_AVAILABLE)
-	set(OGRE_THREAD_SUPPORT_AVAILABLE TRUE)
-	set(OGRE_THREAD_DEFAULT_PROVIDER "tbb")
-	set(OGRE_THREAD_TYPE "2")
-endif ()
-
-if (OGRE_CONFIG_THREAD_PROVIDER STREQUAL "std")
-	set(OGRE_THREAD_DEFAULT_PROVIDER "std")
-	set(OGRE_THREAD_TYPE "2")
 endif ()

 set(OGRE_CONFIG_THREADS ${OGRE_THREAD_TYPE} CACHE STRING


build: check if spidermonkey compiles at all before further tests

--- CMakeModules/FindSpidermonkey.cmake
+++ CMakeModules/FindSpidermonkey.cmake
@@ -60,12 +60,26 @@

 set(SPIDERMONKEY_LIBRARIES ${SPIDERMONKEY_LIBRARY})

+set(CMAKE_REQUIRED_INCLUDES ${SPIDERMONKEY_INCLUDE_DIR})
+set(CMAKE_REQUIRED_DEFINITIONS ${SPIDERMONKEY_DEFINITIONS})
+set(CMAKE_REQUIRED_LIBRARIES ${SPIDERMONKEY_LIBRARY})
+check_cxx_source_runs(
+    "#include <js/jsapi.h>
+     int main() {
+        JSRuntime *rt = JS_NewRuntime(8L * 1024L * 1024L);
+        if (!rt)
+            return 1;
+        return 0;
+     }"
+    SPIDERMONKEY_RUNS)
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(
     Spidermonkey
     DEFAULT_MSG
     SPIDERMONKEY_LIBRARIES
-    SPIDERMONKEY_INCLUDE_DIR)
+    SPIDERMONKEY_INCLUDE_DIR
+    SPIDERMONKEY_RUNS)

 if(SPIDERMONKEY_FOUND)
     set(CMAKE_REQUIRED_INCLUDES ${SPIDERMONKEY_INCLUDE_DIR})


ERR: Remove mesages

ERR: Remove mesages

--- CMake/vtkLoadCMakeExtensions.cmake
+++ CMake/vtkLoadCMakeExtensions.cmake
@@ -2,14 +2,11 @@
 # Macro to load VTK's CMake extension commands.  The argument should
 # be the directory containing the command modules.
 MACRO(VTK_LOAD_SINGLE_CMAKE_EXTENSION name dir)
-  MESSAGE(STATUS "Loading VTK command ${name}")
   IF(COMMAND ${name})
-    MESSAGE("Command ${name} already exists")
   ELSE(COMMAND ${name})
     LOAD_COMMAND(${name} ${dir} ${dir}/Debug)
   ENDIF(COMMAND ${name})
   IF(COMMAND ${name})
-    MESSAGE(STATUS "Loading VTK command ${name} - done")
   ELSE(COMMAND ${name})
     MESSAGE(FATAL_ERROR "Loading VTK command ${name} - failed")
   ENDIF(COMMAND ${name})


FindVOTCA_TOOLS.cmake: fix adding eigen3 includedir

--- CMakeModules/FindVOTCA_TOOLS.cmake
+++ CMakeModules/FindVOTCA_TOOLS.cmake
@@ -43,7 +43,7 @@

 find_library(VOTCA_TOOLS_LIBRARY NAMES votca_tools HINTS ${PC_VOTCA_TOOLS_LIBRARY_DIRS} )

-set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR};${SQLITE3_INCLUDE_DIR};${EIGEN3_INCLUDE_DIRS};${MKL_INCLUDE_DIRS}" )
+set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR};${SQLITE3_INCLUDE_DIR};${EIGEN3_INCLUDE_DIR};${MKL_INCLUDE_DIRS}" )
 set(VOTCA_TOOLS_LIBRARIES "${VOTCA_TOOLS_LIBRARY};${MKL_LIBRARIES}" )

 include(FindPackageHandleStandardArgs)


allow and prefer MariaDB connector

allow and prefer MariaDB connector

--- cmake/FindMySQLCAPI.cmake
+++ cmake/FindMySQLCAPI.cmake
@@ -31,6 +31,7 @@
     find_library(
 		MYSQLCAPI_LIBRARY
 		NAMES
+		"libmariadb.lib"
 		"libmysql.lib"
 		HINTS
 		${MYSQLCAPI_ROOT_DIR}
@@ -41,6 +42,7 @@
 	find_file(
 		MYSQLCAPI_LIBRARY_SHARED
 		NAMES
+		"libmariadb.dll"
 		"libmysql.dll"
 		HINTS
 		${MYSQLCAPI_ROOT_DIR}


fixed wrong cmake macro name

fixed wrong cmake macro name

--- cmake/V4RDetectCUDA.cmake
+++ cmake/V4RDetectCUDA.cmake
@@ -159,7 +159,7 @@

   message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")

-  OCV_OPTION(CUDA_FAST_MATH "Enable --use_fast_math for CUDA compiler " OFF)
+  V4R_OPTION(CUDA_FAST_MATH "Enable --use_fast_math for CUDA compiler " OFF)

   if(CUDA_FAST_MATH)
     set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --use_fast_math)


Related to #42, create the required directories for the simlinks.

--- cmake/enable_python.cmake
+++ cmake/enable_python.cmake
@@ -66,6 +66,8 @@
     endif()
     include(${${pkg_name}_BINARY_DIR}/setup_py_interrogation.cmake)

+    file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+    file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
     foreach(pkg ${${pkg_name}_PACKAGES})
       get_filename_component(name ${pkg} NAME)
       #prevent recursive sim links by checking first?


fix  CMake can't find check_symbol_exists function. On windows this problem doesn't appear. Enviroment: OSX 0.13 cmake version 3.8.2

--- build/cmake/FindResSearch.cmake
+++ build/cmake/FindResSearch.cmake
@@ -1,6 +1,7 @@
 include(CheckSymbolExists)

 if (ENABLE_SRV STREQUAL ON OR ENABLE_SRV STREQUAL AUTO)
+include(CheckSymbolExists)
    if (WIN32)
       set (RESOLV_LIBS Dnsapi)
       set (MONGOC_HAVE_DNSAPI 1)


replace SB_CMAKE_COMMAND with nmake where it is only used

--- CMake/External_GDAL.cmake
+++ CMake/External_GDAL.cmake
@@ -41,14 +41,15 @@
     list(APPEND ${proj}_DEPENDENCIES PNG)
   endif()

-  # if(USE_SYSTEM_JPEG)
-    # set(GDAL_SB_JPEG_CONFIG)
-  # else()
-    # set(GDAL_SB_JPEG_CONFIG
-      # --with-jpeg=${CMAKE_INSTALL_PREFIX}
-      # )
-    # list(APPEND ${proj}_DEPENDENCIES JPEG)
-  # endif()
+  #gdal on msvc link with internal jpeg .
+  if(USE_SYSTEM_JPEG)
+    set(GDAL_SB_JPEG_CONFIG)
+  else()
+    set(GDAL_SB_JPEG_CONFIG
+      --with-jpeg=${CMAKE_INSTALL_PREFIX}
+      )
+    list(APPEND ${proj}_DEPENDENCIES JPEG)
+  endif()

   if(USE_SYSTEM_OPENJPEG)
     set(GDAL_SB_OPENJPEG_CONFIG)
@@ -156,12 +157,13 @@
        PREFIX ${proj}
        URL "http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz"
        URL_MD5 9fdf0f2371a3e9863d83e69951c71ec4
+       SOURCE_DIR ${GDAL_SB_SRC}
        BINARY_DIR ${GDAL_SB_BUILD_DIR}
        INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
        DEPENDS ${${proj}_DEPENDENCIES}
        PATCH_COMMAND  ${CMAKE_COMMAND} -E copy_directory  ${GDAL_SB_SRC} ${GDAL_SB_BUILD_DIR}
        CONFIGURE_COMMAND ""
-       BUILD_COMMAND ${SB_MAKE_CMD} /f ${GDAL_SB_BUILD_DIR}/Makefile.vc MSVC_VER=${SB_MSVC_VER} EXT_NMAKE_OPT=${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt
+       BUILD_COMMAND nmake /f ${GDAL_SB_BUILD_DIR}/Makefile.vc MSVC_VER=${MSVC_VERSION} EXT_NMAKE_OPT=${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt
        INSTALL_COMMAND ${CMAKE_COMMAND} -E copy  ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
       ${CMAKE_BINARY_DIR}/${proj}/_install
     )
@@ -175,8 +177,7 @@
       CMAKE_CACHE_ARGS
         -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
         -DCMAKE_BUILD_TYPE:STRING=Release
-        -DGDAL_INCLUDE_DIR:STRING=${GDAL_SB_BUILD_DIR}
-        -DGDAL_LIB_DIR:STRING=${GDAL_SB_BUILD_DIR}
+        -DGDAL_BUILD_DIR:STRING=${GDAL_SB_BUILD_DIR}
       DEPENDS ${proj}_build
       CMAKE_COMMAND
     )


[brief] Fixes typo on source_group for GLX.

[detailed]

--- config/SourceGroups.cmake
+++ config/SourceGroups.cmake
@@ -2,10 +2,8 @@
 source_group("include\\atlas" FILES ${ATLAS_INCLUDE_ROOT_GROUP})
 source_group("include\\atlas\\core" FILES ${ATLAS_INCLUDE_CORE_GROUP})
 source_group("include\\atlas\\math" FILES ${ATLAS_INCLUDE_MATH_GROUP})
-source_group("include\\atlas\\gl" FILES ${ATLAS_INCLUDE_GL_GROUP})
-source_group("include\\atlas\\glex" FILES ${ATLAS_INCLUDE_GLX_GROUP})
+source_group("include\\atlas\\glx" FILES ${ATLAS_INCLUDE_GLX_GROUP})

 source_group("source" FILES)
 source_group("source\\atlas" FILES)
-source_group("source\\atlas\\gl" FILES ${ATLAS_SOURCE_GL_GROUP})
-source_group("source\\atlas\\glex" FILES ${ATLAS_SOURCE_GLX_GROUP})
+source_group("source\\atlas\\glx" FILES ${ATLAS_SOURCE_GLX_GROUP})


update: cpack specify architecture for debian packages

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

--- cmake/modules/CPackConfig.cmake
+++ cmake/modules/CPackConfig.cmake
@@ -30,9 +30,15 @@
 endif()

 message(STATUS "Using package generators: ${CPACK_GENERATOR}")
+message(STATUS "Package architecture: ${CMAKE_SYSTEM_PROCESSOR}")
+set(CPACK_DEBIAN_PACKAGE_SECTION "utils")

-set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
-set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
+if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+  set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
+endif()
+if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
+  set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
+endif()
 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.falco.org")
 set(CPACK_DEBIAN_PACKAGE_DEPENDS "dkms (>= 2.1.0.0)")
 set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA


[build/cygwin] Workaround only for Cygwin - affect to all platforms.

--- cmake/modules/SwiftSource.cmake
+++ cmake/modules/SwiftSource.cmake
@@ -378,7 +378,7 @@
       # the overlay sees.
       ${command_create_apinotes}
       COMMAND
-        "${line_directive_tool}" "${source_files}" --
+#       "${line_directive_tool}" "${source_files}" --
         "${swift_compiler_tool}" "${main_command}" ${swift_flags}
         ${output_option} "${source_files}"
       OUTPUT


cmake: Fixes quark_se_c1000_devboard flashing

Fixes: #4905

Signed-off-by: Andrei Emeltchenko <a6565233ddc88e4fb9c66c1d70743223493f2ed4@intel.com>

--- boards/x86/quark_se_c1000_devboard/board.cmake
+++ boards/x86/quark_se_c1000_devboard/board.cmake
@@ -1,7 +1,9 @@
 include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake)

 set(OPENOCD_PRE_CMD "targets 1")
+set(OPENOCD_LOAD_CMD "load_image     ${PROJECT_BINARY_DIR}/${KERNEL_BIN_NAME} ${CONFIG_FLASH_BASE_ADDRESS}")

 set_property(GLOBAL APPEND PROPERTY FLASH_SCRIPT_ENV_VARS
   OPENOCD_PRE_CMD
+  OPENOCD_LOAD_CMD
   )


Inadvertent inclusion of vtkGUISupportMFC causes VS Express builds to fail.

Including Rendering in the vtkGUISupportMFC module causes a
build failure in Visual Studio 2010 because MFC is not suported.
Thanks to Bill Lorenson for quickly pinpointing the problem.

Change-Id: Idd554487b0fc6187c5a438e9ef84d58cf2544f45
Signed-off-by: Andrew Maclean <c9b2f5a1dba95786ee62d836bcc66ea197719bbe@gmail.com>

--- GUISupport/MFC/module.cmake
+++ GUISupport/MFC/module.cmake
@@ -2,7 +2,6 @@
 if(WIN32)
   vtk_module(vtkGUISupportMFC
     GROUPS
-      Rendering
     DEPENDS
     vtkRenderingOpenGL
     vtkInteractionStyle


ENH: add cesbio's modules to the list of packaged modules

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -131,7 +131,7 @@

 set(OTB_MODULES_CONFIG)
 if(WITH_REMOTE_MODULES)
-  foreach(remote_module SertitObject Mosaic otbGRM OTBFFSforGMM)
+  foreach(remote_module SertitObject Mosaic otbGRM OTBFFSforGMM OTBTemporalGapFilling OTBBioVars OTBPhenology)
     list(APPEND OTB_MODULES_CONFIG -DModule_${remote_module}:BOOL=ON)
   endforeach()
 else()


SuperBuild: enable qttranslations

SuperBuild: enable qttranslations

--- SuperBuild/CMake/External_qt5.cmake
+++ SuperBuild/CMake/External_qt5.cmake
@@ -52,6 +52,7 @@
 #Common options for all cases
 # -skip qtbase
 # -skip qttools  (need linguist)
+# -skip qttranslations
 set(QT5_SB_CONFIG
   "-prefix ${QT5_INSTALL_PREFIX_NATIVE} -L ${QT5_LIB_PREFIX_NATIVE} \
   -I ${QT5_INCLUDE_PREFIX_NATIVE} -I ${QT5_INCLUDE_FREETYPE_NATIVE} \
@@ -84,7 +85,6 @@
   -skip qtserialport  \
   -skip qtspeech \
   -skip qtsvg  \
-  -skip qttranslations  \
   -skip qtvirtualkeyboard  \
   -skip qtwayland  \
   -skip qtwebchannel  \


Revert "BUG: force usage of the ld gold linker for linux QT5 build in the Superbuild (link errors with ld bfd)"

This reverts commit 9df40e7f1b038be9a709a1f338f4d6480e898fe7.

--- SuperBuild/CMake/External_qt5.cmake
+++ SuperBuild/CMake/External_qt5.cmake
@@ -98,7 +98,7 @@
     set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-framework")
   else()
       #Linux
-      set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -linker gold -no-glib -no-fontconfig")
+      set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-glib -no-fontconfig")
   endif()
   #common for all unix
   set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-dbus -no-icu -v")


bugfix find blas

bugfix find blas

closes #233

--- SuperBuild/External_Gadgetron.cmake
+++ SuperBuild/External_Gadgetron.cmake
@@ -65,7 +65,7 @@
 endif ()

   # BLAS
-  find_package(blas)
+  find_package(BLAS)
   if (APPLE AND NOT (CBLAS_LIBRARY AND CBLAS_INCLUDE_DIR))
     message(FATAL_ERROR "Gadgetron needs CBLAS_LIBRARY and CBLAS_INCLUDE_DIR. If
       these variables do not exist in your CMake, create them manually. CBLAS_LIBRARY


BUILDEM_ENV_STRING: Add CC and CXX environment variables, based on CMAKE compiler vars.

--- BuildSupport.cmake
+++ BuildSupport.cmake
@@ -64,7 +64,7 @@
 # Initialize environment variables string to use for commands.
 set (BUILDEM_BIN_PATH     ${BUILDEM_BIN_DIR}:$ENV{PATH})
 set (BUILDEM_LIB_PATH     ${BUILDEM_LIB_DIR}:$ENV{${BUILDEM_LD_LIBRARY_VAR}})
-set (BUILDEM_ENV_STRING   env PATH=${BUILDEM_BIN_PATH} ${BUILDEM_LD_LIBRARY_VAR}=${BUILDEM_LIB_PATH} ${BUILDEM_PLATFORM_SPECIFIC_ENV})
+set (BUILDEM_ENV_STRING   env PATH=${BUILDEM_BIN_PATH} ${BUILDEM_LD_LIBRARY_VAR}=${BUILDEM_LIB_PATH} ${BUILDEM_PLATFORM_SPECIFIC_ENV} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER})
 set (BUILDEM_LDFLAGS      "-Wl,-rpath,${BUILDEM_LIB_DIR} -L${BUILDEM_LIB_DIR}")

 # All library builds should go to BPD/lib


--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2248,7 +2248,7 @@
 			else()
 				file (RELATIVE_PATH _pchFileLogPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
 			endif()
-			# make precompiled header compilation depend on the actual compiler executable to force
+			# make precompiled header compilation depend on the actual compiler executable used to force
 			# re-compilation when the compiler executable is updated. This prevents "created by a different GCC executable"
 			# warnings when the precompiled header is included.
 			get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
@@ -2491,8 +2491,12 @@
 	cotire_set_cmd_to_prologue(_prefixCmd)
 	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" ${_unityFiles})
 	set_property (SOURCE "${_prefixFile}" PROPERTY GENERATED TRUE)
+	# make prefix header generation depend on the actual compiler executable used to force
+	# re-generation when the compiler executable is updated. This prevents "file not found"
+	# errors for compiler version specific system header files.
+	get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
 	if (COTIRE_DEBUG)
-		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources}")
+		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources} ${_realCompilerExe}")
 	endif()
 	if (MSVC_IDE)
 		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileLogPath)
@@ -2524,7 +2528,7 @@
 	add_custom_command(
 		OUTPUT "${_prefixFile}" "${_prefixFile}.log"
 		COMMAND ${_prefixCmd}
-		DEPENDS ${_unityFiles} ${_dependencySources}
+		DEPENDS ${_unityFiles} ${_dependencySources} "${_realCompilerExe}"
 		COMMENT "${_comment}"
 		WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 		VERBATIM)


honor CMake 3.4 target properties

honor CMake 3.4 target properties

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2919,6 +2919,8 @@
 		INCLUDE_DIRECTORIES
 		INTERPROCEDURAL_OPTIMIZATION INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
 		POSITION_INDEPENDENT_CODE
+		C_COMPILER_LAUNCHER CXX_COMPILER_LAUNCHER
+		C_INCLUDE_WHAT_YOU_USE CXX_INCLUDE_WHAT_YOU_USE
 		C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN)
 	# copy compile features
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
@@ -2948,22 +2950,31 @@
 		IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
 	# copy Apple platform specific stuff
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
-		BUNDLE BUNDLE_EXTENSION FRAMEWORK INSTALL_NAME_DIR MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST
-		MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH OSX_ARCHITECTURES
-		OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE)
+		BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
+		MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
+		OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST)
 	# copy Windows platform specific stuff
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		GNUtoMS
 		COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
 		COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
 		PDB_NAME PDB_NAME_<CONFIG> PDB_OUTPUT_DIRECTORY PDB_OUTPUT_DIRECTORY_<CONFIG>
-		VS_DOTNET_REFERENCES VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE
-		VS_KEYWORD VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER
-		VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES VS_WINRT_COMPONENT
-		VS_DOTNET_TARGET_FRAMEWORK_VERSION WIN32_EXECUTABLE)
+		VS_DESKTOP_EXTENSIONS_VERSION VS_DOTNET_REFERENCES VS_DOTNET_TARGET_FRAMEWORK_VERSION
+		VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE
+		VS_IOT_EXTENSIONS_VERSION VS_IOT_STARTUP_TASK
+		VS_KEYWORD VS_MOBILE_EXTENSIONS_VERSION
+		VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER
+		VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
+		VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
+		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS)
 	# copy Android platform specific stuff
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
-		ANDROID_API ANDROID_API_MIN ANDROID_GUI)
+		ANDROID_API ANDROID_API_MIN ANDROID_GUI
+		ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES
+		ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR
+		ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES
+		ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH
+		ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE)
 	# use output name from original target
 	get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
 	if (NOT _targetOutputName)


Add documentation comment for PyKEP.

Add documentation comment for PyKEP.

--- Dependencies.cmake
+++ Dependencies.cmake
@@ -112,6 +112,8 @@
 endif(NOT APPLE)

 # -------------------------------
+
+# pykep: https://github.com/esa/pykep

 if(NOT BUILD_DEPENDENCIES)
   find_package(PyKEP)


update build script

update build script

--- build.cmake
+++ build.cmake
@@ -1,13 +1,14 @@
 cmake_minimum_required(VERSION 2.8)

 set(build_dir ${CMAKE_CURRENT_LIST_DIR}/build)
+set(src_dir ${CMAKE_CURRENT_LIST_DIR}/src)

 if(NOT EXISTS ${build_dir})
   file(MAKE_DIRECTORY ${build_dir})
 endif()

 execute_process(
-  COMMAND ${CMAKE_COMMAND} ..
+  COMMAND ${CMAKE_COMMAND} ${src_dir}
   WORKING_DIRECTORY ${build_dir}
 )


fixed: fallback to older gcc -std for gcc < 4.7

--- CMake/OSGSetupCompiler.cmake
+++ CMake/OSGSetupCompiler.cmake
@@ -250,6 +250,10 @@

 IF(CMAKE_COMPILER_IS_GNUCC)

+    EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                    OUTPUT_VARIABLE GCC_VERSION)
+    MESSAGE("GOT gcc ${GCC_VERSION}")
+
     IF(OSG_PLATFORM_64 AND LINUX)
         SET(OSG_CXX_FLAGS "${OSG_CXX_FLAGS} -m64")
         SET(OSG_C_FLAGS   "${OSG_C_FLAGS} -m64")
@@ -263,7 +267,11 @@
     SET(OSG_C_FLAGS   "${OSG_C_FLAGS} -D__STDC_FORMAT_MACROS -fPIC")

     IF(OSG_ENABLE_C++11)
-      SET(OSG_CXX_FLAGS "${OSG_CXX_FLAGS} -std=c++11")
+      IF(${GCC_VERSION} VERSION_LESS "4.7")
+        SET(OSG_CXX_FLAGS "${OSG_CXX_FLAGS} -std=c++0x")
+      ELSE()
+        SET(OSG_CXX_FLAGS "${OSG_CXX_FLAGS} -std=c++11")
+      ENDIF()
     ENDIF()

 ENDIF(CMAKE_COMPILER_IS_GNUCC)


BUG: fix installation of scripts

BUG: fix installation of scripts

--- CMake/OTBWrapperMacros.cmake
+++ CMake/OTBWrapperMacros.cmake
@@ -62,10 +62,10 @@
                DESTINATION ${APPLICATION_BINARY_PATH}
                FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

-          if (APPLICATION_INSTALL_PATH)
-              # Install a version of this script
+          if (OTB_INSTALL_BIN_DIR_CM24)
+              # Install a version of this script if we are inside the OTB build
               install(PROGRAMS ${APPLICATION_BINARY_PATH}/otbcli_${APPLICATION_NAME}
-                      DESTINATION ${APPLICATION_INSTALL_PATH})
+                      DESTINATION ${OTB_INSTALL_BIN_DIR_CM24})
           endif()
       endif()

@@ -80,11 +80,11 @@
           file(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/otbgui_${APPLICATION_NAME}
                DESTINATION ${APPLICATION_BINARY_PATH}
                FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
-
-          if (APPLICATION_INSTALL_PATH)
-              # Install a version of this script
+
+          if (OTB_INSTALL_BIN_DIR_CM24)
+              # Install a version of this script if we are inside the OTB build
               install(PROGRAMS ${APPLICATION_BINARY_PATH}/otbgui_${APPLICATION_NAME}
-                      DESTINATION ${APPLICATION_INSTALL_PATH})
+                      DESTINATION ${OTB_INSTALL_BIN_DIR_CM24})
           endif()
       endif()
    endif(NOT WIN32)


Modified FindTBB.cmake to cope with TBB 3 paths

--HG--
branch : v1-7

--- CMake/Packages/FindTBB.cmake
+++ CMake/Packages/FindTBB.cmake
@@ -62,13 +62,21 @@
   foreach (dir ${TBB_PREFIX_PATH})
     if (CMAKE_CL_64)
       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia64/${COMPILER_PREFIX}/lib)
+      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia64/${COMPILER_PREFIX})
       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${COMPILER_PREFIX}/lib)
+      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${COMPILER_PREFIX})
     else ()
       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${COMPILER_PREFIX}/lib)
+      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${COMPILER_PREFIX})
     endif ()
   endforeach ()
 endif ()

+foreach (dir ${TBB_PREFIX_PATH})
+  list(APPEND TBB_LIB_SEARCH_PATH ${dir}/$ENV{TBB_ARCH_PLATFORM}/lib)
+  list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/$ENV{TBB_ARCH_PLATFORM})
+  list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib)
+endforeach ()

 set(TBB_LIBRARY_NAMES tbb)


cmake: check if FFTW3_LIBRARIES really work

--- CMakeModules/FindFFTW3.cmake
+++ CMakeModules/FindFFTW3.cmake
@@ -36,4 +36,12 @@

 find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR )

+if (FFTW3_FOUND)
+  include(CheckLibraryExists)
+  check_library_exists("${FFTW3_LIBRARIES}" fftw_plan_r2r_1d "" FOUND_FFTW_PLAN)
+  if(NOT FOUND_FFTW_PLAN)
+    message(FATAL_ERROR "Could not find fftw_plan_r2r_1d in ${FFTW3_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set FFTW3_LIBRARY by hand (i.e. -DFFTW3_LIBRARY='/path/to/libfftw3.so') !")
+  endif(NOT FOUND_FFTW_PLAN)
+endif (FFTW3_FOUND)
+
 mark_as_advanced(FFTW3_INCLUDE_DIR FFTW3_LIBRARY )


small fix in creating symlinks

small fix in creating symlinks

--- CMakeModules/OMPLUtils.cmake
+++ CMakeModules/OMPLUtils.cmake
@@ -25,14 +25,13 @@
     set(OMPL_INSTALL_SUFFIX "-${OMPL_MAJOR_VERSION}.${OMPL_MINOR_VERSION}")
     macro(ompl_install_symlink path file)
         get_filename_component(base ${file} NAME_WE)
-        string(REPLACE "${OMPL_VERSION}" "${OMPL_INSTALL_SUFFIX}" new_base "${base}")
         get_filename_component(ext ${file} EXT)
         install(CODE "execute_process(COMMAND mkdir -p \"${CMAKE_INSTALL_PREFIX}/${path}\"
             COMMAND ln -sf
-            \"${CMAKE_INSTALL_PREFIX}/${path}/${new_base}${OMPL_INSTALL_SUFFIX}${ext}\"
+            \"${CMAKE_INSTALL_PREFIX}/${path}/${base}${OMPL_INSTALL_SUFFIX}${ext}\"
             \"${CMAKE_INSTALL_PREFIX}/${path}/${file}\")")
             message("execute_process(COMMAND ln -sf
-            \"${CMAKE_INSTALL_PREFIX}/${path}/${new_base}${OMPL_INSTALL_SUFFIX}${ext}\"
+            \"${CMAKE_INSTALL_PREFIX}/${path}/${base}${OMPL_INSTALL_SUFFIX}${ext}\"
             \"${CMAKE_INSTALL_PREFIX}/${path}/${file}\")")
     endmacro(ompl_install_symlink)
 else()


Another attempt at improving FindFLINT.cmake.

--- cmake/FindFLINT.cmake
+++ cmake/FindFLINT.cmake
@@ -33,7 +33,7 @@
     set(FLINT_FIND_QUIETLY TRUE)
 endif()

-find_path(FLINT_INCLUDE_DIR NAMES flint/fmpz.h)
+find_path(FLINT_INCLUDE_DIR NAMES fmpz.h PATH_SUFFIXES flint)
 find_library(FLINT_LIBRARY NAMES flint)

 include(FindPackageHandleStandardArgs)
@@ -45,7 +45,7 @@
 # NOTE: this has been adapted from CMake's FindPNG.cmake.
 if(FLINT_FOUND AND NOT TARGET FLINT::FLINT)
     add_library(FLINT::FLINT UNKNOWN IMPORTED)
-    set_target_properties(FLINT::FLINT PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FLINT_INCLUDE_DIR};${FLINT_INCLUDE_DIR}/flint"
+    set_target_properties(FLINT::FLINT PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FLINT_INCLUDE_DIR}"
         IMPORTED_LINK_INTERFACE_LANGUAGES "C"
         IMPORTED_LOCATION "${FLINT_LIBRARY}")
 endif()


Fix xp build support

Fix xp build support

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -36,7 +36,7 @@
 # include (CheckCXXSourceCompiles)
 # include (CompilerFlags)

-if(CMAKE_GENERATOR_TOOLSET MATCHES "*xp")
+if(CMAKE_GENERATOR_TOOLSET MATCHES "v([0-9]+)_xp")
     add_definitions(-D_WIN32_WINNT=0x0501)
 endif()


Change env var from ROOTFS to SYSROOT

Change env var from ROOTFS to SYSROOT

Change-Id: I54405cfac4caccab74b95f23303eb66ce2a7dc93

--- cmake/cross-imx.cmake
+++ cmake/cross-imx.cmake
@@ -3,7 +3,7 @@
 set (CROSSCOMPILE_TARGET_NAME "IMX")

 set (CMAKE_SYSTEM_NAME "Linux")
-set (CMAKE_SYSROOT ${ROOTFS_PATH})
+set (CMAKE_SYSROOT ${SYSROOT_PATH})
 set (PLAFTFORM_MODULES "IMX_MODULES")
 set (CROSS_COMPILE "ON")


Fix: add double qutoes around string else MacOS cries

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


'gst_plugins_good' depends on 'xext'

'gst_plugins_good' depends on 'xext'

--- cmake/projects/gst_plugins_good/hunter.cmake
+++ cmake/projects/gst_plugins_good/hunter.cmake
@@ -24,7 +24,7 @@
 hunter_cmake_args(
     gst_plugins_good
     CMAKE_ARGS
-    DEPENDS_ON_PACKAGES=gst_plugins_base
+    DEPENDS_ON_PACKAGES=gst_plugins_base;xext
     DEPENDS_ON_PKGCONFIGS=gstreamer-plugins-base-1.0 # ???
 )


warn the user about the consequences of not having OCL

--- lib/orogen/templates/config/TaskLib.cmake
+++ lib/orogen/templates/config/TaskLib.cmake
@@ -73,8 +73,11 @@

 pkg_check_modules(OrocosOCL "orocos-ocl-${OROCOS_TARGET}>=2.1.0")
 if (OrocosOCL_FOUND)
+    message(STATUS "OCL found, the generated task library will be compatible with the deployer component")
     add_definitions(-DRTT_COMPONENT)
     include_directories(${OrocosOCL_INCLUDE_DIRS})
     list(APPEND <%= component.name.upcase %>_TASKLIB_SOURCES "${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/tasks/DeployerComponent.cpp")
+else()
+    message(STATUS "OCL not found, the generated task library won't be loadable by the deployer component")
 endif()


ENH: Update SuperBuild to compile DTIProcess statically and to get the last version of DTIReg

--- SuperBuild/FindExternalTools.cmake
+++ SuperBuild/FindExternalTools.cmake
@@ -298,10 +298,10 @@

 # ===== dtiprocessTK ==============================================================
 set( SourceCodeArgs
-  SVN_REPOSITORY "http://www.nitrc.org/svn/dtiprocess/branches/Slicer4Extension" # /dtiprocess"
+  SVN_REPOSITORY "http://www.nitrc.org/svn/dtiprocess/trunk" # /dtiprocess"
   SVN_USERNAME slicerbot
   SVN_PASSWORD slicer
-  SVN_REVISION -r 149 # 01/31/2013 # 144 # 01/30/2013 version modified by Adrien for windows compilation # 137 # 01/16/2013 # 113 # 12/20/2012 updated for ITKv4.4.0
+  SVN_REVISION -r 206
   )
 set( CMAKE_ExtraARGS
   -DBUILD_TESTING:BOOL=OFF
@@ -474,7 +474,7 @@
   SVN_REPOSITORY "http://www.nitrc.org/svn/dtireg/trunk"
   SVN_USERNAME slicerbot
   SVN_PASSWORD slicer
-  SVN_REVISION -r 47 # 10/28/2013
+  SVN_REVISION -r 48
   )
 set( CMAKE_ExtraARGS
   -DANTSTOOL:PATH=${ANTSPath}


Remove unused superbuild definition and MSVC bigobj flag

The added definition had not effect and the MSVC flag just needs to be
handled in the SimpleITK project, and language projects.

Change-Id: I2b705922cb499729602b8475aa27f405bc08cdce


Ensure PYTHONQT_INSTALL_DIR is not reset in project including CTK

This commit is an attempt to fix a regression introduced by fc92239
that was causing the Slicer packaging to fail (mainly because the
variable PYTHONQT_INSTALL_DIR was reset to an empty value after
"find_path" was called in FindPythonQt.cmake)

Note that this a workaround, the issue is being discussed with CMake
developer.

--- Utilities/CMake/FindPythonQt.cmake
+++ Utilities/CMake/FindPythonQt.cmake
@@ -9,7 +9,9 @@
   message(FATAL_ERROR "error: Python is required to build PythonQt")
 endif()

-find_path(PYTHONQT_INSTALL_DIR include/PythonQt/PythonQt.h DOC "Directory where PythonQt was installed.")
+if(NOT EXISTS "${PYTHONQT_INSTALL_DIR}")
+  find_path(PYTHONQT_INSTALL_DIR include/PythonQt/PythonQt.h DOC "Directory where PythonQt was installed.")
+endif()
 find_path(PYTHONQT_INCLUDE_DIR PythonQt.h "${PYTHONQT_INSTALL_DIR}/include/PythonQt" DOC "Path to the PythonQt include directory")
 find_library(PYTHONQT_LIBRARY_RELEASE PythonQt PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "The PythonQt library.")
 find_library(PYTHONQT_LIBRARY_DEBUG NAMES PythonQt${CTK_CMAKE_DEBUG_POSTFIX} PythonQt${CMAKE_DEBUG_POSTFIX} PythonQt PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "The PythonQt library.")


Export include dir

Export include dir

--- Plugins/PluginTemplate.cmake
+++ Plugins/PluginTemplate.cmake
@@ -73,6 +73,8 @@

 endif(WIN32)

+set(${PROJECT_NAME}_PLUGIN_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}/src/" CACHE PATH "" FORCE)
+
 ADD_DEFINITIONS(-DPLUGIN_NAME=${PROJECT_NAME})
 set(PLUGIN_NAME "${PROJECT_NAME}")
 CONFIGURE_FILE("../PluginExport.hpp.in" "${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}/src/${PROJECT_NAME}Export.hpp" @ONLY)


Add __CUDADEVRT_INTERNAL__ define to bitcode generation, needed to avoid duplicate cudaMalloc symbols with CUDA9+ (#1271)

Co-authored-by: Declan Russell <903e9e0bc4f64e63855c224b1eb194f6dfaeaadd@autodesk.com>

--- src/cmake/cuda_macros.cmake
+++ src/cmake/cuda_macros.cmake
@@ -80,7 +80,7 @@
             "-I${ILMBASE_INCLUDE_DIR}"
             "-I${Boost_INCLUDE_DIRS}"
             ${LLVM_COMPILE_FLAGS} ${CUDA_LIB_FLAGS}
-            -D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE
+            -D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__
             --language=cuda --cuda-device-only --cuda-gpu-arch=${CUDA_TARGET_ARCH}
             -Wno-deprecated-register -Wno-format-security
             -O3 -fno-math-errno -ffast-math -S -emit-llvm ${extra_clang_args}


Split off 8.0.0

Split off 8.0.0

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 0 )
-set ( HPCC_POINT 0 )
+set ( HPCC_POINT 1 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Added an include guard to macros

Added an include guard to macros

--- build/macros.cmake
+++ build/macros.cmake
@@ -1,3 +1,8 @@
+
+if(ORK_MACROS_INCLUDED)
+	return()
+endif()
+set(ORK_MACROS_INCLUDED 1)

 macro(ensure_non_empty _var)
 	if(NOT ${_var})


cmake: dts: give each DTS_ROOT a vendor-prefixes.txt

Now that the infrastructure we need is in place, we can allow every
element of DTS_ROOT to have its own dts/bindings/vendor-prefixes.txt
file instead of just special-casing ZEPHYR_BASE (which is always in
DTS_ROOT).

This treats all modules equally and eases out of tree management of
downstream-specific vendor prefixes.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -23,8 +23,9 @@
 set(DEVICETREE_UNFIXED_H        ${PROJECT_BINARY_DIR}/include/generated/devicetree_unfixed.h)
 set(DEVICE_EXTERN_H             ${PROJECT_BINARY_DIR}/include/generated/device_extern.h)
 set(DTS_POST_CPP                ${PROJECT_BINARY_DIR}/${BOARD}.dts.pre.tmp)
-# A list of generally accepted vendor prefixes.
-set_ifndef(VENDOR_PREFIXES      ${ZEPHYR_BASE}/dts/bindings/vendor-prefixes.txt)
+# The location of a list of known vendor prefixes.
+# This is relative to each element of DTS_ROOT.
+set(VENDOR_PREFIXES             dts/bindings/vendor-prefixes.txt)

 set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts)

@@ -113,6 +114,11 @@
         DTS_ROOT_BINDINGS
         ${bindings_path}
         )
+    endif()
+
+    set(vendor_prefixes ${dts_root}/${VENDOR_PREFIXES})
+    if(EXISTS ${vendor_prefixes})
+      list(APPEND EXTRA_GEN_DEFINES_ARGS --vendor-prefixes ${vendor_prefixes})
     endif()
   endforeach()

@@ -228,7 +234,6 @@
   --device-header-out ${DEVICE_EXTERN_H}
   --dts-out ${ZEPHYR_DTS} # As a debugging aid
   --edt-pickle-out ${EDT_PICKLE}
-  --vendor-prefixes ${VENDOR_PREFIXES}
   ${EXTRA_GEN_DEFINES_ARGS}
   )


Add support Ninja (use manual set CMAKE_VS_PLATHORM_TOOLSET)

--- conan.cmake
+++ conan.cmake
@@ -145,6 +145,8 @@

         if (CMAKE_GENERATOR_TOOLSET)
             set(_SETTINGS ${_SETTINGS} -s compiler.toolset=${CMAKE_GENERATOR_TOOLSET})
+        elseif(CMAKE_VS_PLATHORM_TOOLSET AND (CMAKE_GENERATOR STREQUAL "Ninja"))
+            set(_SETTINGS ${_SETTINGS} -s compiler.toolset=${CMAKE_VS_PLATHORM_TOOLSET})
         endif()
     else()
         message(FATAL_ERROR "Conan: compiler setup not recognized")


Fix test, not insert toolset if not specified

--- conan.cmake
+++ conan.cmake
@@ -143,8 +143,8 @@
         message(STATUS "Detected VS runtime: ${_vs_runtime}")
         set(_SETTINGS ${_SETTINGS} -s compiler.runtime=${_vs_runtime})

-        if (CMAKE_VS_PLATFORM_TOOLSET)
-            set(_SETTINGS ${_SETTINGS} -s compiler.toolset=${CMAKE_VS_PLATFORM_TOOLSET})
+        if (CMAKE_GENERATOR_TOOLSET)
+            set(_SETTINGS ${_SETTINGS} -s compiler.toolset=${CMAKE_GENERATOR_TOOLSET})
         endif()
     else()
         message(FATAL_ERROR "Conan: compiler setup not recognized")


Set sysroot/target defaults for Xcode 7.3 and 8

--- standard/StandardProject.cmake
+++ standard/StandardProject.cmake
@@ -104,6 +104,21 @@
   set(CMAKE_CXX_STANDARD_REQUIRED ON PARENT_SCOPE)
   set(CMAKE_CXX_EXTENSIONS OFF PARENT_SCOPE)

+  if(APPLE AND NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm"))
+    if(NOT CMAKE_OSX_SYSROOT)
+      set(_developer_sdk_version 10.11)
+      # CLANG_VERSION requires a sysroot to obtain, so resort to execute_process() here
+      execute_process(COMMAND clang -v ERROR_VARIABLE _clang_version)
+      if(_clang_version MATCHES "clang-8")
+        set(_developer_sdk_version 10.12)
+      endif()
+      set(CMAKE_OSX_SYSROOT "macosx${_developer_sdk_version}" CACHE STRING "Mac OS X build environment" FORCE)
+    endif()
+    if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+      set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Mac OS X deployment target" FORCE)
+    endif()
+  endif()
+
   #CMAKE_OSX_DEPLOYMENT_TARGET < 10.9 implies -stdlib=libstdc++, which doesn't have
   #complete c++11 support. override with libc++
   if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.9)


Split off 7.8.10

Split off 7.8.10

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 8 )
-set ( HPCC_POINT 9 )
+set ( HPCC_POINT 11 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Bug 775: propagate generator when workingaround cmake bug 9220


only strip string if not empty

only strip string if not empty

--- modules/git_info/git_info_sub.cmake
+++ modules/git_info/git_info_sub.cmake
@@ -42,7 +42,10 @@
         OUTPUT_VARIABLE _git_branch
         ERROR_QUIET
         )
-    string(STRIP ${_git_branch} _git_branch)
+
+    if(_git_branch)
+        string(STRIP ${_git_branch} _git_branch)
+    endif()
 endif()

 # CMAKE_CURRENT_LIST_DIR is undefined in CMake 2.8.2


Adding support for easybuild

Adding support for easybuild

Former-commit-id: 512573a311683ea875e0cfb03eae0017eb7a4a9f

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -76,13 +76,13 @@
     endif()
     if(HDF5_IS_PARALLEL)
         if(HDF5_USE_STATIC_LIBRARIES)
-            set(MPI_COMPILER_FLAGS -static-mpi)
-            set(MPI_C_COMPILER_FLAGS -static-mpi)
+        message(STATUS "The HDF5 library is parallel and you are linking with -static.\n   The find_package(MPI) command is likely to give a shared library")
         endif()
-        find_package(MPI REQUIRED)
-        target_link_libraries(hdf5 INTERFACE MPI::MPI_C -static-mpi  )
-        get_target_property(MPI_LIB MPI::MPI_C INTERFACE_LINK_LIBRARIES)
-        message("Adding MPI Library: ${MPI_LIB}")
+#        set(MPI_C_COMPILER mpicc)
+#        find_package(MPI)
+        target_link_libraries(hdf5 INTERFACE -lmpi )
+#        get_target_property(MPI_LIB MPI::MPI_C INTERFACE_LINK_LIBRARIES)
+#        message("Found MPI Library: ${MPI_LIB}")
 #        include(cmake-modules/PrintTargetProperties.cmake)
 #        print_target_properties(MPI::MPI_C)
     endif()


ssse3 is also required in the list for bulldozer; be so nice to say what CPU you detected; document bulldozer

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -11,7 +11,7 @@
 endmacro(_my_find)

 macro(OptimizeForArchitecture)
-   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\".")
+   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
       message(STATUS "${TARGET_ARCHITECTURE} changed")
@@ -106,8 +106,9 @@
             if(_cpu_model GREATER 64) # I don't know the right number to put here. This is just a guess from the hardware I have access to
                set(TARGET_ARCHITECTURE "k8-sse3")
             endif(_cpu_model GREATER 64)
-         endif(_cpu_family EQUAL 16)
+         endif()
       endif(_vendor_id STREQUAL "GenuineIntel")
+      message(STATUS "Detected CPU: ${TARGET_ARCHITECTURE}")
    endif(TARGET_ARCHITECTURE STREQUAL "auto")

    if(TARGET_ARCHITECTURE STREQUAL "core")
@@ -154,22 +155,25 @@
       list(APPEND _march_flag_list "k8-sse3")
       list(APPEND _march_flag_list "k8")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3")
+   elseif(TARGET_ARCHITECTURE STREQUAL "interlagos")
+      list(APPEND _march_flag_list "bulldozer")
+      list(APPEND _march_flag_list "barcelona")
+      list(APPEND _march_flag_list "core2")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a" "sse4.1" "sse4.2" "avx" "xop" "fma4")
    elseif(TARGET_ARCHITECTURE STREQUAL "bulldozer")
-      list(APPEND _march_flag_list "barcelona")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "sse4a" "sse4.1" "sse4.2" "avx" "xop" "fma4")
+      list(APPEND _march_flag_list "bulldozer")
+      list(APPEND _march_flag_list "barcelona")
+      list(APPEND _march_flag_list "core2")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a" "sse4.1" "sse4.2" "avx" "xop" "fma4")
    elseif(TARGET_ARCHITECTURE STREQUAL "barcelona")
       list(APPEND _march_flag_list "barcelona")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "sse4a")
    elseif(TARGET_ARCHITECTURE STREQUAL "istanbul")
-      list(APPEND _march_flag_list "istanbul")
       list(APPEND _march_flag_list "barcelona")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "sse4a")
    elseif(TARGET_ARCHITECTURE STREQUAL "magny-cours")
-      list(APPEND _march_flag_list "magnycours")
-      list(APPEND _march_flag_list "istanbul")
       list(APPEND _march_flag_list "barcelona")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "sse4a")


Fix typo

Fix typo

--- cmake/StandardProjectSettings.cmake
+++ cmake/StandardProjectSettings.cmake
@@ -23,7 +23,7 @@
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

 option(ENABLE_IPO
-       "Enable Iterprocedural Optimization, aka Link Time Optimization (LTO)"
+       "Enable Interprocedural Optimization, aka Link Time Optimization (LTO)"
        OFF)

 if(ENABLE_IPO)


Fixed include directory variables when dependencies are not found or available

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -49,6 +49,7 @@
 else()
   if(NOT GAMMA_LIBRARY)
     set(GAMMA_LIBRARY "")
+    set(GAMMA_INCLUDE_DIR "")
     message("Not building GAMMA and no usable GAMMA binary found. Not linking application to GAMMA")
   endif(NOT GAMMA_LIBRARY)
 endif(TARGET Gamma)
@@ -60,6 +61,7 @@
 else()
   if(NOT GLV_LIBRARY)
     set(GLV_LIBRARY "")
+    set(GLV_INCLUDE_DIR "")
     message("Not building GLV and no usable GLV binary found. Not linking application to GLV")
   endif(NOT GLV_LIBRARY)
 endif(TARGET GLV)
@@ -75,6 +77,7 @@
 else()
   if(NOT VSR_LIBRARY)
     set(VSR_LIBRARY "")
+    set(VSR_INCLUDE_DIR "")
     message("Not building VSR and no usable VSR binary found. Not linking application to VSR")
   endif(NOT VSR_LIBRARY)
 endif(TARGET VSR)
@@ -87,6 +90,7 @@
 else()
   if(NOT ALLOUTIL_LIBRARY)
     set(ALLOUTIL_LIBRARY "")
+    set(ALLOUTIL_INCLUDE_DIR "")
     message("Not building ALLOUTIL and no usable ALLOUTIL binary found. Not linking application to ALLOUTIL")
   endif(NOT ALLOUTIL_LIBRARY)
 endif(TARGET alloutil)
@@ -99,6 +103,7 @@
 else()
   if(NOT ALLOGLV_LIBRARY)
     set(ALLOGLV_LIBRARY "")
+    set(ALLOGLV_INCLUDE_DIR "")
     message("Not building alloGLV and no usable alloGLV binary found. Not linking application to alloGLV")
   endif(NOT ALLOGLV_LIBRARY)
 endif(TARGET alloGLV)


fix possible build failure on Debian 9

fix possible build failure on Debian 9

--- cMake/FindCoin3DDoc.cmake
+++ cMake/FindCoin3DDoc.cmake
@@ -21,7 +21,7 @@
     ELSE(APPLE)
       # Unix systems
       find_path(COIN3D_DOC_PATH index.html
-                /usr/share/doc/libcoin60-doc/html
+                /usr/share/doc/libcoin80-doc/html
                 /usr/share/doc/coin/html
       )
       IF( EXISTS ${COIN3D_DOC_PATH})


- Okay, fixed Gamecube toolchain for sure

--- toolchain/cmake/Toolchains/none-cube-powerpc-eabi_linux.toolchain.cmake
+++ toolchain/cmake/Toolchains/none-cube-powerpc-eabi_linux.toolchain.cmake
@@ -26,7 +26,7 @@
 set ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

 set ( CMAKE_EXE_LINKER_FLAGS
-    "${CMAKE_EXE_LINKER_FLAGS} -I$ENV{PPCPORTLIBS_CUBE}/include -L$ENV{PPCPORTLIBS_CUBE}/lib/cube -logc -lm"
+    "${CMAKE_EXE_LINKER_FLAGS} -I$ENV{PPCPORTLIBS_CUBE}/include -L$ENV{PPCPORTLIBS_CUBE}/lib -logc -lm"
     CACHE STRING ""
     )


COMP: boost optional components are set only with testing

--- Modules/ThirdParty/Boost/otb-module-init.cmake
+++ Modules/ThirdParty/Boost/otb-module-init.cmake
@@ -10,12 +10,10 @@
 # unit_test_framework component is used only in GdalAdapters module
 if (BUILD_TESTING)
   set(OTB_Boost_OPTIONAL_COMPONENTS unit_test_framework)
+  message(STATUS "Looking for optional Boost components : ${OTB_Boost_OPTIONAL_COMPONENTS}")
+  find_package ( Boost
+    QUIET
+    1.35.0
+    COMPONENTS ${OTB_Boost_OPTIONAL_COMPONENTS}
+    )
 endif()
-
-#Quiet find package to avoid message "Could not find boost" because unit_testing_framework is not installed
-message(STATUS "Looking for optional Boost components : ${OTB_Boost_OPTIONAL_COMPONENTS}")
-find_package ( Boost
-  QUIET
-  1.35.0
-  COMPONENTS ${OTB_Boost_OPTIONAL_COMPONENTS}
-  )


Remove warnings

Remove warnings

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -17,6 +17,7 @@
   # the flag -ftest-coverage causes nvcc to barf, so exclude that one
   if (CMAKE_COMPILER_IS_GNUCC)
     string (REPLACE "-ftest-coverage" "" TMP "${CMAKE_CXX_FLAGS}")
+    string (REPLACE "-ftemplate-depth-50" "" TMP "${TMP}")
     string (REPLACE " " "," TMP "${TMP}")
     set (CUDA_CXX_FLAGS ${CUDA_CXX_FLAGS} ${TMP})
   endif ()


Modify spacing a bit, just a test.

Modify spacing a bit, just a test.

--- cmake/FindGengetopt.cmake
+++ cmake/FindGengetopt.cmake
@@ -7,7 +7,7 @@
 # If set, process ggo files (http://www.gnu.org/software/gengetopt/)
 MACRO (WRAP_GGO GGO_SRCS)
   FOREACH(GGO_FILE ${ARGN})
-      GET_FILENAME_COMPONENT(GGO_BASEFILENAME ${GGO_FILE} NAME_WE)
+    GET_FILENAME_COMPONENT(GGO_BASEFILENAME ${GGO_FILE} NAME_WE)
     GET_FILENAME_COMPONENT(GGO_FILE_ABS ${GGO_FILE} ABSOLUTE)
     SET(GGO_H ${GGO_BASEFILENAME}_ggo.h)
     SET(GGO_C ${GGO_BASEFILENAME}_ggo.c)
@@ -31,5 +31,3 @@
   ENDFOREACH(GGO_FILE)
   SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES GENERATED TRUE)
 ENDMACRO (WRAP_GGO)
-
-


Various fixes taken from VV v1.3

Various fixes taken from VV v1.3

--- cmake/FindGengetopt.cmake
+++ cmake/FindGengetopt.cmake
@@ -2,7 +2,8 @@
 # Attempt to find gengetopt. If not found, compile it.
 FIND_PROGRAM(GENGETOPT gengetopt)
 IF (GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
-  ADD_SUBDIRECTORY(${CMAKE_CURRENT_LIST_DIR}/../utilities/gengetopt ${CMAKE_CURRENT_BINARY_DIR}/gengetopt)
+  GET_FILENAME_COMPONENT(CLITK_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+  ADD_SUBDIRECTORY(${CLITK_CMAKE_DIR}/../utilities/gengetopt ${CMAKE_CURRENT_BINARY_DIR}/gengetopt)
 ELSE(GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
   ADD_EXECUTABLE(gengetopt IMPORTED)
   SET_PROPERTY(TARGET gengetopt PROPERTY IMPORTED_LOCATION ${GENGETOPT})
@@ -32,6 +33,10 @@
   ENDFOREACH(GGO_FILE)
   SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES GENERATED TRUE)
   IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable")
+    FIND_PROGRAM(DEFAULT_GCC gcc)
+    EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)
+    IF("${GCCVER}" VERSION_GREATER "4.5.2")
+      SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable")
+    ENDIF("${GCCVER}" VERSION_GREATER "4.5.2")
   ENDIF(CMAKE_COMPILER_IS_GNUCXX)
 ENDMACRO (WRAP_GGO)


Fix compiler flags.

Fix compiler flags.

--- cmake/UseDOGraphics.cmake
+++ cmake/UseDOGraphics.cmake
@@ -53,7 +53,8 @@
                       ${Qt5OpenGL_INCLUDE_DIRS})
   include(${DO_Core_USE_FILE})
   add_definitions(${Qt5Widgets_DEFINITIONS})
-  set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
+  set(CMAKE_CXX_FLAGS
+      "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
 endmacro (do_load_packages_for_graphics_library)

 macro (do_create_variables_for_graphics_library)


clean up toolchain file

clean up toolchain file

--- scripts/pinned_toolchain.cmake
+++ scripts/pinned_toolchain.cmake
@@ -4,19 +4,12 @@
 set(CMAKE_C_COMPILER ${OPT_PATH}/clang8/bin/clang)
 set(CMAKE_CXX_COMPILER ${OPT_PATH}/clang8/bin/clang++)

-#set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${OPT_PATH}/gcc/include/c++/7.1.0 ${OPT_PATH}/gcc/include/c++/7.1.0/x86_64-pc-linux-gnu)
 set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${OPT_PATH}/clang8/include/c++/v1 /usr/local/include /usr/include)
+
 set(CMAKE_CXX_FLAGS_INIT "-nostdinc++")
+
 set(CMAKE_EXE_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")
+set(CMAKE_SHARED_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")
+set(CMAKE_MODULE_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")

-if(NOT APPLE)
-   set(CMAKE_SHARED_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")
-   set(CMAKE_MODULE_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")
-   set(CMAKE_CXX_STANDARD_LIBRARIES "-stdlib=libc++ -nostdlib++ ${OPT_PATH}/clang8/lib/libc++.a ${OPT_PATH}/clang8/lib/libc++abi.a")
-   #set(CMAKE_CXX_STANDARD_LIBRARIES "${OPT_PATH}/gcc/lib64/libstdc++.a ${OPT_PATH}/gcc/lib64/libsupc++.a")
-   #set(CMAKE_CXX_STANDARD_LIBRARIES "-static -Wl,-L${OPT_PATH}/gcc/lib64 -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lz  -Wl,-Bdynamic, -lpthread -Wl,-Bdynamic -lm -Wl,-Bdynamic -lc -Wl,-Bdynamic -lgcc -Wl,-nostdlib -Wl,--no-whole-archive ${OPT_PATH}/gcc/lib64/libstdc++.a -Wl,--no-whole-archive ${OPT_PATH}/gcc/lib64/libsupc++.a -Wl,-Bdynamic -lpthread")
-else()
-   set(CMAKE_SHARED_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")
-   set(CMAKE_MODULE_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")
-   set(CMAKE_CXX_STANDARD_LIBRARIES "${OPT_PATH}/clang8/lib/libc++.a ${OPT_PATH}/clang8/lib/libc++abi.a")
-endif()
+set(CMAKE_CXX_STANDARD_LIBRARIES "${OPT_PATH}/clang8/lib/libc++.a ${OPT_PATH}/clang8/lib/libc++abi.a")


fixing test linker problem on windows

fixing test linker problem on windows

--- conf/RTFTestHelpers.cmake
+++ conf/RTFTestHelpers.cmake
@@ -30,7 +30,7 @@

 macro(ADD_RTF_CPPTEST TESTNAME SOURCES)
     add_library(${TESTNAME} MODULE ${SOURCES})
-    target_link_libraries(${TESTNAME} ${RTF_LIBRARIES})
+    target_link_libraries(${TESTNAME} ${RTF_LIBS})
 endmacro()

 macro(ADD_RTF_LUATEST SOURCE)


fix cmake warning due to inconsistent naming

--- cMake/FindNETGEN.cmake
+++ cMake/FindNETGEN.cmake
@@ -187,4 +187,4 @@
   ELSE()
       SET(NETGEN_FOUND FALSE)
   ENDIF()
-endif(Netgen_Found)+endif(Netgen_FOUND)


Adding lld to LLVM_ENABLE_PROJECTS so that we can build/install it.

--- build_tools/cmake/iree_copts.cmake
+++ build_tools/cmake/iree_copts.cmake
@@ -440,12 +440,8 @@
 set(LLVM_TARGETS_TO_BUILD "WebAssembly;X86;ARM;AArch64;RISCV;NVPTX;AMDGPU"
     CACHE STRING "" FORCE)

-set(LLVM_ENABLE_PROJECTS "mlir" CACHE STRING "" FORCE)
+set(LLVM_ENABLE_PROJECTS "mlir;lld" CACHE STRING "" FORCE)
 set(LLVM_ENABLE_BINDINGS OFF CACHE BOOL "" FORCE)
-
-if(IREE_USE_LINKER)
-  set(LLVM_USE_LINKER ${IREE_USE_LINKER} CACHE STRING "" FORCE)
-endif()

 set(MLIR_TABLEGEN_EXE mlir-tblgen)
 # iree-tblgen is not defined using the add_tablegen mechanism as other TableGen


fix(nc): fix multiple imported bsd (#3932)

--- tools/cmake/macros_public.cmake
+++ tools/cmake/macros_public.cmake
@@ -428,12 +428,6 @@
 #   [FILE_CSV]      Optional path to the .csv file containing the node ids, e.g. 'OpcUaDiModel.csv'
 #   [FILE_BSD]      Optional path to the .bsd file containing the type definitions, e.g. 'Opc.Ua.Di.Types.bsd'. Multiple files can be
 #                   passed which will all combined to one resulting code.
-#   [IMPORT_BSD]    Optional combination of types array and path to the .bsd file containing additional type definitions referenced by
-#                   the FILES_BSD files. The value is separated with a hash sign, i.e.
-#                   'UA_TYPES#${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd'
-#                   Multiple files can be passed which will all be imported.
-#   [NAMESPACE_MAP] Array of Namespace index mappings to indicate the final namespace index of a namespace uri when the server is started.
-#                   This parameter is mandatory if FILE_CSV or FILE_BSD is set.
 #   [BLACKLIST]     Blacklist file passed as --blacklist to the nodeset compiler. All the given nodes will be removed from the generated
 #                   nodeset, including all the references to and from that node. The format is a node id per line.
 #                   Supported formats: "i=123" (for NS0), "ns=2;s=asdf" (matches NS2 in that specific file), or recommended
@@ -441,6 +435,12 @@
 #   [TARGET_PREFIX] Optional prefix for the resulting targets. Default `open62541-generator`
 #
 #   Arguments taking multiple values:
+#   [NAMESPACE_MAP] Array of Namespace index mappings to indicate the final namespace index of a namespace uri when the server is started.
+#                   This parameter is mandatory if FILE_CSV or FILE_BSD is set.
+#   [IMPORT_BSD]    Optional combination of types array and path to the .bsd file containing additional type definitions referenced by
+#                   the FILES_BSD files. The value is separated with a hash sign, i.e.
+#                   'UA_TYPES#${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd'
+#                   Multiple files can be passed which will all be imported.
 #   [DEPENDS]       Optional list of nodeset names on which this nodeset depends. These names must match any name from a previous
 #                   call to this funtion. E.g. 'di' if you are generating the 'plcopen' nodeset
 #
@@ -448,8 +448,8 @@
 function(ua_generate_nodeset_and_datatypes)

     set(options INTERNAL)
-    set(oneValueArgs NAME FILE_NS FILE_CSV FILE_BSD IMPORT_BSD OUTPUT_DIR TARGET_PREFIX BLACKLIST)
-    set(multiValueArgs DEPENDS NAMESPACE_MAP)
+    set(oneValueArgs NAME FILE_NS FILE_CSV FILE_BSD OUTPUT_DIR TARGET_PREFIX BLACKLIST)
+    set(multiValueArgs DEPENDS IMPORT_BSD NAMESPACE_MAP)
     cmake_parse_arguments(UA_GEN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

     if(NOT DEFINED open62541_TOOLS_DIR)


Try and make cmake happy

Try and make cmake happy

--- test/ctest/test_setup.cmake
+++ test/ctest/test_setup.cmake
@@ -12,7 +12,7 @@

 if (ENABLE_STATIC MATCHES "ON")
     SET (BUILDNAME "${BUILDNAME}-static")
-endif()
+endif ()

 if (NOT SINGLE_PRECISION MATCHES "ON")
     SET (BUILDNAME "${BUILDNAME}-double")
@@ -32,11 +32,11 @@

 if (ENABLE_MPI MATCHES "ON")
     SET (BUILDNAME "${BUILDNAME}-mpi")
-endif()
+endif ()

 if (GPU_GENERATION)
     SET (BUILDNAME "${BUILDNAME}-${GPU_GENERATION}")
-endif()
+endif ()

 if (ENABLE_COVERAGE)
     SET (COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage")


correcting find arpack

correcting find arpack

Former-commit-id: c9ada55c8f86a62a43d2eb73c06b0134ee9cd808

--- cmake-modules/Fetch_OpenBLAS.cmake
+++ cmake-modules/Fetch_OpenBLAS.cmake
@@ -138,7 +138,6 @@
     target_link_libraries(blas INTERFACE lapacke)
 endif()

-
 target_link_libraries(lapack INTERFACE blas)

 set(FC_LDLAGS -fPIC ${PTHREAD_LIBRARY})
@@ -154,6 +153,8 @@
 endif()

-
-add_definitions(-DOpenBLAS_AVAILABLE)
-
+include(CheckIncludeFileCXX)
+check_include_file_cxx(cblas.h    has_cblas_h)
+if(has_cblas_h)
+    add_definitions(-DOpenBLAS_AVAILABLE)
+endif()


- Fixes to coffee_add_example function

- Fixes to coffee_add_example function

--- cmake/Modules/BuildFunctions.cmake
+++ cmake/Modules/BuildFunctions.cmake
@@ -58,11 +58,14 @@
             SOVERSION 1
             )
     elseif(APPLE)
+        set ( OSX_ICON "${CMAKE_SOURCE_DIR}/desktop/osx/Coffee.icns" )
+
+        set_source_files_properties ( "${OSX_ICON}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources" )
+
         set ( MACOSX_BUNDLE_LONG_VERSION_STRING ${COFFEE_BUILD_STRING} )
         set ( MACOSX_BUNDLE_BUNDLE_VERSION "${COFFEE_BUILD_STRING}" )
         set ( MACOSX_BUNDLE_SHORT_VERSION_STRING ${COFFEE_VERSION_CODE} )
-
-        set ( MACOSX_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/desktop/osx/Coffee.icns" )
+        set ( MACOSX_BUNDLE_ICON_FILE "Coffee.icns" )

         set ( MACOSX_BUNDLE_COPYRIGHT "Some of this code is under the MIT license" )
         set ( MACOSX_BUNDLE_BUNDLE_NAME "${TITLE}" )
@@ -79,13 +82,23 @@
         ${LIBRARIES}
         )

-    install(
-        TARGETS
-        ${TARGET}
+    if(APPLE)
+        install(
+            TARGETS
+            ${TARGET}

-        DESTINATION
-        bin
-        )
+            DESTINATION
+            app
+            )
+    else()
+        install(
+            TARGETS
+            ${TARGET}
+
+            DESTINATION
+            bin
+            )
+    endif()

     if(ANDROID)


Convert the error stream before comparing with reference

--- cmake/modules/RootTestDriver.cmake
+++ cmake/modules/RootTestDriver.cmake
@@ -151,28 +151,28 @@
     endif()

     if(CNVCMD)
-      set(_outvar, "")
       string(REPLACE "^" ";" _outcnvcmd "${CNVCMD}^${OUT}")
       execute_process(COMMAND ${_outcnvcmd} ${_chkout} ${_chkerr} RESULT_VARIABLE _rc)
       file(WRITE ${OUT} "${_outvar}")
-
-      if(DEFINED RC AND (NOT _rc EQUAL RC))
-        message(FATAL_ERROR "error code: ${_rc}")
-      elseif(NOT DEFINED RC AND _rc)
-        message(FATAL_ERROR "error code: ${_rc}")
+      if(_rc)
+        message(FATAL_ERROR "out conversion error code: ${_rc}")
       endif()
     endif()

     if(CNV)
-      set(_outvar, "")
       string(REPLACE "^" ";" _outcnv "sh;${CNV}")
       execute_process(COMMAND ${_outcnv} INPUT_FILE "${OUT}" OUTPUT_VARIABLE _outvar RESULT_VARIABLE _rc)
       file(WRITE ${OUT} "${_outvar}")
-
-      if(DEFINED RC AND (NOT _rc EQUAL RC))
-        message(FATAL_ERROR "error code: ${_rc}")
-      elseif(NOT DEFINED RC AND _rc)
-        message(FATAL_ERROR "error code: ${_rc}")
+      if(_rc)
+        message(FATAL_ERROR "out conversion error code: ${_rc}")
+      endif()
+
+      if(ERR)
+        execute_process(COMMAND ${_outcnv} INPUT_FILE "${ERR}" OUTPUT_VARIABLE _errvar RESULT_VARIABLE _rc)
+        file(WRITE ${ERR} "${_errvar}")
+        if(_rc)
+          message(FATAL_ERROR "err conversion error code: ${_rc}")
+        endif()
       endif()
     endif()
   else()


always print status info on vlc finding (even when not found)

Summary:
this is arguably more valuable information when LIBVLC_FOUND is falsy
as it aids diagnostics, so only printing it when vlc was actually found
is rather pointless. to not change behavior to much we'll now print status
in both scenarios instead.

Test Plan: prints all the time

Reviewers: bshah

Reviewed By: bshah

Differential Revision: https://phabricator.kde.org/D17473

--- cmake/FindLIBVLC.cmake
+++ cmake/FindLIBVLC.cmake
@@ -1,6 +1,6 @@
 # CMake module to search for LIBVLC (VLC library)
 #
-# Copyright (C) 2011-2012, Harald Sitter <sitter@kde.org>
+# Copyright (C) 2011-2018, Harald Sitter <sitter@kde.org>
 # Copyright (C) 2010, Rohit Yadav <rohityadav89@gmail.com>
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
@@ -94,15 +94,13 @@
 #     set(LIBVLC_FOUND FALSE)
 endif (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}")

-if (LIBVLC_FOUND)
-    if (NOT LIBVLC_FIND_QUIETLY)
-        message(STATUS "Found LibVLC include-dir path: ${LIBVLC_INCLUDE_DIR}")
-        message(STATUS "Found LibVLC library path:${LIBVLC_LIBRARY}")
-        message(STATUS "Found LibVLCcore library path:${LIBVLCCORE_LIBRARY}")
-        message(STATUS "Found LibVLC version: ${LIBVLC_VERSION} (searched for: ${LIBVLC_MIN_VERSION})")
-    endif (NOT LIBVLC_FIND_QUIETLY)
-else (LIBVLC_FOUND)
-    if (LIBVLC_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find LibVLC")
-    endif (LIBVLC_FIND_REQUIRED)
-endif (LIBVLC_FOUND)
+if (NOT LIBVLC_FIND_QUIETLY)
+    message(STATUS "Found LibVLC include-dir path: ${LIBVLC_INCLUDE_DIR}")
+    message(STATUS "Found LibVLC library path:${LIBVLC_LIBRARY}")
+    message(STATUS "Found LibVLCcore library path:${LIBVLCCORE_LIBRARY}")
+    message(STATUS "Found LibVLC version: ${LIBVLC_VERSION} (searched for: ${LIBVLC_MIN_VERSION})")
+endif (NOT LIBVLC_FIND_QUIETLY)
+
+if (NOT LIBVLC_FOUND AND LIBVLC_FIND_REQUIRED)
+    message(FATAL_ERROR "Could not find LibVLC/LibVLCcore")
+endif ()


Fix some drunken path placement on my part as well as fix the way headers are located and add an extra search possibility for include files

--- cmake/FindOpenCL.cmake
+++ cmake/FindOpenCL.cmake
@@ -75,7 +75,7 @@

 find_path(OpenCL_INCLUDE_DIR
   NAMES
-    CL/cl.h OpenCL/cl.h
+    cl.h
   PATHS
     ENV "PROGRAMFILES(X86)"
     ENV AMDAPPSDKROOT
@@ -83,6 +83,8 @@
     ENV NVSDKCOMPUTE_ROOT
     ENV CUDA_PATH
     ENV ATISTREAMSDKROOT
+
+    /usr/include/CL
   PATH_SUFFIXES
     include
     OpenCL/common/inc
@@ -93,7 +95,7 @@
 # Once we have a working include directory, try looking specifically for cl2.hpp
 find_path(OpenCL_CL2_INCLUDE_DIR
   NAMES
-    CL/cl2.hpp OpenCL/cl2.hpp
+    cl2.hpp cl2.hpp
   PATHS
     ENV "PROGRAMFILES(X86)"
     ENV AMDAPPSDKROOT
@@ -101,6 +103,9 @@
     ENV NVSDKCOMPUTE_ROOT
     ENV CUDA_PATH
     ENV ATISTREAMSDKROOT
+
+    /usr/include/CL
+    ${OpenCL_INCLUDE_DIR}
   PATH_SUFFIXES
     include
     OpenCL/common/inc
@@ -121,13 +126,14 @@
     ENV CUDA_PATH
     ENV NVSDKCOMPUTE_ROOT
     ENV ATISTREAMSDKROOT
+
+    /usr/lib/x86_64-linux-gnu
+    /usr/lib/i386-linux-gnu
   PATH_SUFFIXES
     "AMD APP/lib/x86"
     lib/x86
     lib/Win32

-    /usr/lib/x86_64-linux-gnu
-    /usr/lib/i386-linux-gnu
     OpenCL/common/lib/Win32)

 set(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
@@ -144,4 +150,5 @@

 mark_as_advanced(
   OpenCL_INCLUDE_DIR
+  OpenCL_CL2_INCLUDE_DIR
   OpenCL_LIBRARY)


cmake/FindSodium: Use lower case cmake commands throughout

--- cmake/FindSodium.cmake
+++ cmake/FindSodium.cmake
@@ -7,12 +7,12 @@
 #  SODIUM_FOUND          - True if libsodium found.
 #

-FIND_LIBRARY(SODIUM_LIBRARY NAMES sodium libsodium HINTS ${SODIUM_ROOT_DIR}/lib)
+find_library(SODIUM_LIBRARY NAMES sodium libsodium HINTS ${SODIUM_ROOT_DIR}/lib)
 find_path(SODIUM_INCLUDE_DIR NAMES sodium.h HINTS ${SODIUM_ROOT_DIR}/include)

 # handle the QUIETLY and REQUIRED arguments and set SODIUM_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sodium REQUIRED_VARS SODIUM_LIBRARY SODIUM_INCLUDE_DIR)

-MARK_AS_ADVANCED(SODIUM_LIBRARY SODIUM_INCLUDE_DIR)
+mark_as_advanced(SODIUM_LIBRARY SODIUM_INCLUDE_DIR)


Resolve merge conflicts

Resolve merge conflicts

--- cmake/FindWebRTC.cmake
+++ cmake/FindWebRTC.cmake
@@ -1,4 +1,3 @@
-<<<<<<< HEAD
 ########################################################################
 # CMake module for finding WEBRTC
 #
@@ -168,7 +167,7 @@
     list(APPEND WEBRTC_INCLUDE_DIRS ${WEBRTC_INCLUDE_DIR} ${WEBRTC_INCLUDE_DIR}/third_party/boringssl/src/include)
   endif()

-  # workaround for fixing error WEBRTC_LIBRARY-NOTFOUND
+  # Workaround for fixing error WEBRTC_LIBRARY-NOTFOUND
   set(WEBRTC_LIBRARY_RELEASE ${WEBRTC_LIBRARIES_RELEASE})
   set(WEBRTC_LIBRARY_DEBUG ${WEBRTC_LIBRARIES_DEBUG})
   include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
@@ -203,204 +202,3 @@
                  WEBRTC_LIBRARIES_DEBUG WEBRTC_LIBRARIES_RELEASE
                  WEBRTC_BUILD_DIR_SUFFIX_DEBUG WEBRTC_BUILD_DIR_SUFFIX_RELEASE
                  WEBRTC_DEPENDENCIES)
-=======
-########################################################################
-# CMake module for finding WEBRTC
-#
-# The best way to build WebRTC is with the forked `webrtcbuilds` project here:
-# https://github.com/sourcey/webrtcbuilds
-#
-# The following variables will be defined:
-#
-#  WEBRTC_FOUND
-#  WEBRTC_INCLUDE_DIR
-#  WEBRTC_LIBRARIES
-#  WEBRTC_DEPENDENCIES
-#
-
-# unset(WEBRTC_INCLUDE_DIR)
-# unset(WEBRTC_INCLUDE_DIR CACHE)
-# unset(WEBRTC_LIBRARY)
-# unset(WEBRTC_LIBRARY CACHE)
-# unset(WEBRTC_LIBRARIES)
-# unset(WEBRTC_LIBRARIES CACHE)
-# unset(WEBRTC_LIBRARIES_DEBUG)
-# unset(WEBRTC_LIBRARIES_DEBUG CACHE)
-# unset(WEBRTC_LIBRARIES_RELEASE)
-# unset(WEBRTC_LIBRARIES_RELEASE CACHE)
-
-# Set required variables
-set(WEBRTC_ROOT_DIR "" CACHE STRING "Where is the WebRTC root directory located?")
-# set(WEBRTC_BUILD_DIR_SUFFIX_DEBUG "out/Debug" CACHE STRING "What is the WebRTC debug build directory suffix?")
-# set(WEBRTC_BUILD_DIR_SUFFIX_RELEASE "out/Release" CACHE STRING "What is the WebRTC release build directory suffix?")
-
-# ----------------------------------------------------------------------
-# Find WEBRTC include path
-# ----------------------------------------------------------------------
-find_path(WEBRTC_INCLUDE_DIR
-  NAMES
-    webrtc/config.h
-  PATHS
-    ${WEBRTC_ROOT_DIR}
-    ${WEBRTC_ROOT_DIR}/include
-    $ENV{HOME}/tmp/webrtcbuilds/out/src
-    $ENV{HOME}/sourcey/webrtcbuilds/out/src
-)
-
-# ----------------------------------------------------------------------
-# Find WEBRTC libraries
-# ----------------------------------------------------------------------
-if(WEBRTC_INCLUDE_DIR)
-  find_existing_directory(debug_dir
-      ${WEBRTC_ROOT_DIR}/lib/x64/Debug
-      ${WEBRTC_ROOT_DIR}/out/x64/Debug
-      ${WEBRTC_ROOT_DIR}/out/Debug_x64
-      ${WEBRTC_ROOT_DIR}/out/Debug-x64
-      ${WEBRTC_ROOT_DIR}/out/Debug)
-
-  find_existing_directory(release_dir
-      ${WEBRTC_ROOT_DIR}/lib/x64/Release
-      ${WEBRTC_ROOT_DIR}/out/x64/Release
-      ${WEBRTC_ROOT_DIR}/out/Release_x64
-      ${WEBRTC_ROOT_DIR}/out/Release-x64
-      ${WEBRTC_ROOT_DIR}/out/Release)
-
-  # Attempt to find the monolithic library built with `webrtcbuilds`
-  find_library_extended(WEBRTC
-    NAMES webrtc webrtc_full libwebrtc_full
-    PATHS_DEBUG ${debug_dir}
-    PATHS_RELEASE ${release_dir}
-  )
-
-  # # Otherwise generate a library from available .o objects
-  # if(NOT WEBRTC_LIBRARY)
-  #   if(EXISTS ${_WEBRTC_BUILD_DIR_DEBUG})
-  #     message("Generating WebRTC Debug library")
-  #     set(lib_cmd "${LibSourcey_DIR}/cmake/webrtc_lib_generator.sh" -o ${_WEBRTC_BUILD_DIR_DEBUG} -x ${_WEBRTC_GENERATOR_EXCLUDES})
-  #     execute_process(COMMAND ${lib_cmd})
-  #   endif()
-  #
-  #   if(EXISTS ${_WEBRTC_BUILD_DIR_RELEASE})
-  #     message("Generating WebRTC Release library")
-  #     set(lib_cmd "${LibSourcey_DIR}/cmake/webrtc_lib_generator.sh" -o ${_WEBRTC_BUILD_DIR_RELEASE} -x ${_WEBRTC_GENERATOR_EXCLUDES})
-  #     execute_process(COMMAND ${lib_cmd})
-  #   endif()
-  #
-  #   # Attempt to find our library again...
-  #   find_library_extended(WEBRTC
-  #     NAMES webrtc_scy
-  #     PATHS_DEBUG ${_WEBRTC_BUILD_DIR_DEBUG}
-  #     PATHS_RELEASE ${_WEBRTC_BUILD_DIR_RELEASE}
-  #   )
-  # endif()
-
-  # Otherwise fallback to library objects (slower and unreliable)
-  if(NOT WEBRTC_LIBRARIES)
-    #unset(WEBRTC_LIBRARY CACHE)
-    #unset(WEBRTC_LIBRARIES CACHE)
-    #set(WEBRTC_LIBRARIES "")
-
-    if(MSVC)
-      set(lib_suffix "lib")
-    else()
-      set(lib_suffix "a")
-    endif()
-
-    # obj/third_party/boringssl/libboringssl.a
-    # obj/third_party/protobuf/libprotobuf_full.a
-    # obj/webrtc/system_wrappers/libfield_trial_default.a
-    # obj/webrtc/system_wrappers/libmetrics_default.a
-    # obj/webrtc/libwebrtc.a
-
-    set(_WEBRTC_DEPENDENCY_INCLUDES "webrtc\\.a|boringssl|protobuf_full|field_trial_default|metrics_default") #|common|video|media
-
-    # Debug
-    if (EXISTS ${debug_dir})
-      file(GLOB_RECURSE debug_libs "${debug_dir}/*.${lib_suffix}")
-      foreach(lib ${debug_libs})
-        # if(${lib} NOT MATCHES ${_WEBRTC_DEPENDENCY_EXCLUDES})
-        if(${lib} MATCHES ${_WEBRTC_DEPENDENCY_INCLUDES})
-          list(APPEND WEBRTC_LIBRARIES_DEBUG ${lib})
-        endif()
-        # endif()
-      endforeach()
-      foreach(lib ${WEBRTC_LIBRARIES_DEBUG})
-        if(WIN32 AND (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE))
-          list(APPEND WEBRTC_LIBRARIES "debug" ${lib})
-        else()
-          list(APPEND WEBRTC_LIBRARIES ${lib})
-        endif()
-      endforeach()
-    endif()
-
-    # Release
-    if (EXISTS ${release_dir})
-      file(GLOB_RECURSE release_libs "${release_dir}/*.${lib_suffix}")
-      foreach(lib ${release_libs})
-        # if(${lib} NOT MATCHES ${_WEBRTC_DEPENDENCY_EXCLUDES})
-        if(${lib} MATCHES ${_WEBRTC_DEPENDENCY_INCLUDES})
-          list(APPEND WEBRTC_LIBRARIES_RELEASE ${lib})
-        endif()
-      endforeach()
-      foreach(lib ${WEBRTC_LIBRARIES_RELEASE})
-        if(WIN32 AND (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE))
-          list(APPEND WEBRTC_LIBRARIES "optimized" ${lib})
-        else()
-          list(APPEND WEBRTC_LIBRARIES ${lib})
-        endif()
-      endforeach()
-    endif()
-  endif()
-
-  # Add required system libraries
-  if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND MSVC)
-    add_definitions(-DWEBRTC_WIN)
-    set(WEBRTC_DEPENDENCIES Secur32.lib Winmm.lib msdmo.lib dmoguids.lib wmcodecdspuuid.lib) # strmbase.lib
-  elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-    add_definitions(-DWEBRTC_POSIX)
-
-    # For ABI compatability between precompiled WebRTC libraries using clang and new GCC versions
-    add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
-    set(WEBRTC_DEPENDENCIES -lrt -lX11 -lGLU) # -lGL
-
-    # Enable libstdc++ debugging if you build WebRTC with `enable_iterator_debugging=true`
-    # set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG=1")
-  endif()
-
-  # Add vendor include directories
-  if(WEBRTC_INCLUDE_DIR)
-    list(APPEND WEBRTC_INCLUDE_DIRS ${WEBRTC_INCLUDE_DIR} ${WEBRTC_INCLUDE_DIR}/third_party/boringssl/src/include)
-  endif()
-
-  # workaround for fixing error WEBRTC_LIBRARY-NOTFOUND
-  set(WEBRTC_LIBRARY_RELEASE ${WEBRTC_LIBRARIES_RELEASE})
-  set(WEBRTC_LIBRARY_DEBUG ${WEBRTC_LIBRARIES_DEBUG})
-  include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
-  select_library_configurations(WEBRTC)
-
-  # message("WEBRTC_LIBRARIES_DEBUG: ${WEBRTC_LIBRARIES_DEBUG}")
-  # message("WEBRTC_LIBRARIES_RELEASE: ${WEBRTC_LIBRARIES_RELEASE}")
-  # message("WEBRTC_LIBRARIES: ${WEBRTC_LIBRARIES}")
-endif()
-
-# ----------------------------------------------------------------------
-# Display status
-# ----------------------------------------------------------------------
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(WEBRTC DEFAULT_MSG WEBRTC_LIBRARIES WEBRTC_INCLUDE_DIR)
-
-# print_module_variables(WEBRTC)
-
-# HACK: WEBRTC_LIBRARIES and WEBRTC_DEPENDENCIES not propagating to parent scope
-# while the WEBRTC_DEBUG_LIBRARY and WEBRTC_RELEASE_LIBRARY vars are.
-# Setting PARENT_SCOPE fixes this solves theis issue for now.
-set(WEBRTC_LIBRARIES ${WEBRTC_LIBRARIES} CACHE INTERNAL "")
-set(WEBRTC_DEPENDENCIES ${WEBRTC_DEPENDENCIES} CACHE INTERNAL "")
-set(WEBRTC_INCLUDE_DIRS ${WEBRTC_INCLUDE_DIRS} CACHE INTERNAL "")
-set(WEBRTC_FOUND ${WEBRTC_FOUND} CACHE INTERNAL "")
-
-mark_as_advanced(WEBRTC_LIBRARIES WEBRTC_INCLUDE_DIR
-                 WEBRTC_LIBRARIES_DEBUG WEBRTC_LIBRARIES_RELEASE
-                 WEBRTC_BUILD_DIR_SUFFIX_DEBUG WEBRTC_BUILD_DIR_SUFFIX_RELEASE
-                 WEBRTC_DEPENDENCIES)
->>>>>>> 5bdee0ed0e745fe0c54636d496039cfab20e228a


more intricate argument evaluation for alpaka_add_library because the order of arguments of add_library is different than for cuda_add_library -.-

--- cmake/addLibrary.cmake
+++ cmake/addLibrary.cmake
@@ -18,22 +18,107 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0)

 #------------------------------------------------------------------------------
-# Calls CUDA_ADD_EXECUTABLE or ADD_EXECUTABLE depending on the enabled alpaka accelerators.
+# Calls CUDA_ADD_LIBRARY or ADD_LIBRARY depending on the enabled alpaka
+# accelerators.
+#
+# ALPAKA_ADD_LIBRARY( cuda_target file0 file1 ... [STATIC | SHARED | MODULE]
+#   [EXCLUDE_FROM_ALL] [OPTIONS <nvcc-flags> ... ] )
+#
+# In order to be compliant with both ADD_LIBRARY and CUDA_ADD_LIBRARY
+# the position of STATIC, SHARED, MODULE, EXCLUDE_FROM_ALL options don't matter.
+# This also means you won't be able to include files with those exact same
+# case-sensitive names.
+# After OPTIONS only nvcc compiler flags are allowed though. And for readiblity
+# and portability you shouldn't completely mix STATIC, ... with the source
+# code filenames!
+# OPTIONS and the arguments thereafter are ignored if not using CUDA, they
+# won't throw an error in that case.
 #------------------------------------------------------------------------------
-FUNCTION(ALPAKA_ADD_LIBRARY In_Name)
-    IF(ALPAKA_ACC_GPU_CUDA_ENABLE)
-        FOREACH(_file ${ARGN})
-            IF((${_file} MATCHES "\\.cpp$") OR (${_file} MATCHES "\\.cxx$"))
-                SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ)
+FUNCTION(ALPAKA_ADD_LIBRARY libraryName)
+    # CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
+    #                   [STATIC | SHARED | MODULE]
+    #                   [EXCLUDE_FROM_ALL] [OPTIONS <nvcc-flags> ... ] )
+    # add_library( <name> [STATIC | SHARED | MODULE]
+    #              [EXCLUDE_FROM_ALL]
+    #              source1 [source2 ...] )
+
+    # traverse arguments and sort them by option and source files
+    SET( arguments ${ARGN} )
+    SET( optionsEncountered OFF )
+    UNSET( libraryType )
+    UNSET( excludeFromAll )
+    UNSET( optionArguments )
+    FOREACH( argument IN LISTS arguments )
+        # 1.) check for OPTIONS
+        IF( argument STREQUAL "OPTIONS" )
+            IF ( optionsEncountered )
+                MESSAGE( FATAL_ERROR "[ALPAKA_ADD_LIBRARY] OPTIONS subcommand specified more than one time. This is not allowed!" )
+            ELSE()
+                SET( optionsEncountered ON )
+            ENDIF()
+        ENDIF()
+
+        # 2.) check if inside OPTIONS, because then all other checks are
+        # unnecessary although they could give hints about wrong locations
+        # of those subcommands
+        IF( optionsEncountered )
+            LIST( APPEND optionArguments "${argument}" )
+            CONTINUE()
+        ENDIF()
+
+        # 3.) check for libraryType and EXCLUDE_FROM_ALL
+        IF( ( argument STREQUAL "STATIC" ) OR
+            ( argument STREQUAL "SHARED" ) OR
+            ( argument STREQUAL "MODULE" )
+        )
+            IF( DEFINED libraryType )
+                message( FATAL_ERROR "Setting more than one library type option ( STATIC SHARED MODULE ) not allowed!" )
+            ENDIF()
+            set( libraryType ${argument} )
+            CONTINUE()
+        ENDIF()
+        IF( argument STREQUAL "EXCLUDE_FROM_ALL" )
+            SET( excludeFromAll ${argument} )
+            CONTINUE()
+        ENDIF()
+
+        # 4.) ELSE the argument is a file name
+        list( APPEND sourceFileNames "${argument}" )
+    ENDFOREACH()
+    UNSET( optionsEncountered )
+    #message( "libraryType = ${libraryType}" )
+    #message( "sourceFileNames = ${sourceFileNames}" )
+
+    # call add_library or cuda_add_library now
+    IF( ALPAKA_ACC_GPU_CUDA_ENABLE )
+        FOREACH( _file ${ARGN} )
+            IF( ( ${_file} MATCHES "\\.cpp$" ) OR
+                ( ${_file} MATCHES "\\.cxx$" )
+            )
+                SET_SOURCE_FILES_PROPERTIES( ${_file} PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ )
             ENDIF()
         ENDFOREACH()
         CMAKE_POLICY(SET CMP0023 OLD)   # CUDA_ADD_LIBRARY calls TARGET_LINK_LIBRARIES without keywords.
         CUDA_ADD_LIBRARY(
-            ${In_Name}
-            ${ARGN})
+            ${libraryName}
+            ${sourceFileNames}
+            ${libraryType}
+            ${excludeFromAll}
+            ${optionArguments}
+        )
     ELSE()
+        #message( "add_library( ${libraryName} ${libraryType} ${excludeFromAll} ${sourceFileNames} )" )
         ADD_LIBRARY(
-            ${In_Name}
-            ${ARGN})
+            ${libraryName}
+            ${libraryType}
+            ${excludeFromAll}
+            ${sourceFileNames}
+        )
     ENDIF()
+
+    # UNSET variables (not sure if necessary)
+    UNSET( libraryType )
+    UNSET( sourceFileNames )
+    UNSET( excludeFromAll )
+    UNSET( optionArguments )
 ENDFUNCTION()


cmake: add IMGTOOL optional dependency

cmake: add IMGTOOL optional dependency

This will be used in subsequent patches to integrate imgtool into the
build when the user has set CONFIG_BOOTLOADER_MCUBOOT=y.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- cmake/host-tools.cmake
+++ cmake/host-tools.cmake
@@ -57,5 +57,13 @@
   bossac
   )

+# imgtool is an optional dependency (the build may also fall back to
+# scripts/imgtool.py in the mcuboot repository if that's present in
+# some cases)
+find_program(
+  IMGTOOL
+  imgtool
+  )
+
 # TODO: Should we instead find one qemu binary for each ARCH?
 # TODO: This will probably need to be re-organized when there exists more than one SDK.


Fix: rely on cmake to find OpenMP flags
The hand made macro wasn't successful on Mac OS while cmake one works

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

--- cmake/pcl_openmp.cmake
+++ cmake/pcl_openmp.cmake
@@ -9,34 +9,12 @@
 # found.
 # The flags are stored in OPENMP_FLAGS.
 macro(PCL_FIND_OPENMP_FLAGS)
-    include(CheckFunctionExists)
-    set(_possible_flags "-fopenmp" # GCC
-        "-openmp" # ICC
-        "-mp" #SGI and PGI
-        "-xopenmp" # Sun
-        "-omp" # Tru64
-        "-qsmp=omp" #AIX
-        )
-
-    # Have not found the flag yet
-    set(OPENMP_FLAGS_FOUND FALSE)
-    set(OPENMP_FLAGS)
-
-    foreach(_flag ${_possible_flags})
-        if(NOT OPENMP_FLAGS_FOUND)
-            set(CMAKE_REQUIRED_FLAGS ${_flag})
-            check_function_exists(omp_set_num_threads OPENMP_FLAGS_${_flag})
-            if(OPENMP_FLAGS_${_flag})
-                set(OPENMP_FLAGS ${_flag})
-                message(STATUS "Found OpenMP flags: ${OPENMP_FLAGS}")
-                set(OPENMP_FLAGS_FOUND true)
-            endif(OPENMP_FLAGS_${_flag})
-        endif(NOT OPENMP_FLAGS_FOUND)
-    endforeach(_flag)
-
-    if(NOT OPENMP_FLAGS_FOUND)
-        message(STATUS "OpenMP flags were not found.")
-    endif(NOT OPENMP_FLAGS_FOUND)
+	include(FindOpenMP)
+	if(OPENMP_FOUND)
+		set(OPENMP_FLAGS_FOUND FALSE)
+	else(OPENMP_FOUND)
+		set(OPENMP_FLAGS_FOUND true)
+	endif(OPENMP_FOUND)
 endmacro(PCL_FIND_OPENMP_FLAGS)


cmake: use /utf-8 with Visual Studio

cmake: use /utf-8 with Visual Studio

To keep your sanity... When the locales are not english... please always
consider source files with utf-8 encoding... Thank you VS.

--- src/cmake/common-settings.cmake
+++ src/cmake/common-settings.cmake
@@ -180,12 +180,12 @@
 endif()

 if(MSVC)
-	set(CMAKE_C_FLAGS_DEBUG   "${COMMON_MSVC_FLAGS} /MD /GR /Ot /Od /EHsc /std:c++latest")
-	set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_MSVC_FLAGS} /MD /GR /Ot /Od /EHsc /fp:except /std:c++latest")
+	set(CMAKE_C_FLAGS_DEBUG   "${COMMON_MSVC_FLAGS} /MD /GR /Ot /Od /EHsc /std:c++latest /utf-8")
+	set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_MSVC_FLAGS} /MD /GR /Ot /Od /EHsc /fp:except /std:c++latest /utf-8")
 	set(MSVC_RELEASE_FLAGS)

 	# Use the latest C++ standard
-	set(MSVC_RELEASE_FLAGS "${MSVC_RELEASE_FLAGS} /std:c++latest")
+	set(MSVC_RELEASE_FLAGS "${MSVC_RELEASE_FLAGS} /std:c++latest /utf-8")
 	# O2x: optimization
 	set(MSVC_RELEASE_FLAGS "${MSVC_RELEASE_FLAGS} /Ox")
 	# Prefer speed instead of size


add imported wx library if target DNE

add imported wx library if target DNE

issue https://github.com/smanders/externpro/issues/210#issue-352318913

--- projects/use/usexp-wxwidgets-config.cmake
+++ projects/use/usexp-wxwidgets-config.cmake
@@ -123,29 +123,31 @@
   # standard way is to get these _wx_link libs from 'wx-config --libs'
   set(_wx_link wxexpat wxjpeg wxpng wxregex wxscintilla wxtiff wxzlib)
   foreach(lib ${wx_all_libs} ${_wx_link})
-    add_library(wx::${lib} STATIC IMPORTED)
-    getLibname(${lib} ${lib}filename)
-    set(${lib}_RELEASE ${XP_ROOTDIR}/lib/lib${${lib}filename}.a)
-    if(EXISTS "${${lib}_RELEASE}")
-      set_property(TARGET wx::${lib} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
-      set_target_properties(wx::${lib} PROPERTIES
-        IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C;CXX"
-        IMPORTED_LOCATION_RELEASE "${${lib}_RELEASE}"
-        )
-      if(_wx_${lib}_deps OR _wx_${lib}_link OR _wx_${lib}_libs)
-        unset(linkLibs)
-        foreach(dep ${_wx_${lib}_deps})
-          list(APPEND linkLibs wx::${dep})
-        endforeach()
-        foreach(dep ${_wx_${lib}_link})
-          list(APPEND linkLibs \$<LINK_ONLY:wx::${dep}>)
-        endforeach()
-        foreach(dep ${_wx_${lib}_libs})
-          list(APPEND linkLibs \$<LINK_ONLY:${dep}>)
-        endforeach()
+    if(NOT TARGET wx::${lib})
+      add_library(wx::${lib} STATIC IMPORTED)
+      getLibname(${lib} ${lib}filename)
+      set(${lib}_RELEASE ${XP_ROOTDIR}/lib/lib${${lib}filename}.a)
+      if(EXISTS "${${lib}_RELEASE}")
+        set_property(TARGET wx::${lib} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
         set_target_properties(wx::${lib} PROPERTIES
-          INTERFACE_LINK_LIBRARIES "${linkLibs}"
+          IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C;CXX"
+          IMPORTED_LOCATION_RELEASE "${${lib}_RELEASE}"
           )
+        if(_wx_${lib}_deps OR _wx_${lib}_link OR _wx_${lib}_libs)
+          unset(linkLibs)
+          foreach(dep ${_wx_${lib}_deps})
+            list(APPEND linkLibs wx::${dep})
+          endforeach()
+          foreach(dep ${_wx_${lib}_link})
+            list(APPEND linkLibs \$<LINK_ONLY:wx::${dep}>)
+          endforeach()
+          foreach(dep ${_wx_${lib}_libs})
+            list(APPEND linkLibs \$<LINK_ONLY:${dep}>)
+          endforeach()
+          set_target_properties(wx::${lib} PROPERTIES
+            INTERFACE_LINK_LIBRARIES "${linkLibs}"
+            )
+        endif()
       endif()
     endif()
   endforeach()


Fix building assimp on Windows

Fix building assimp on Windows

- Remove assimps FindZLIB module to use the builtin one

--- cmake/External_assimp.cmake
+++ cmake/External_assimp.cmake
@@ -13,6 +13,9 @@
 ##
 ##===------------------------------------------------------------------------------------------===##

+# Pass location of zlib if we build it
+sequoia_extract_cmake_package_args(zlib cmake_args)
+
 ExternalProject_Add(
   assimp
   DOWNLOAD_DIR "${SEQUOIA_EXTERNAL_DOWNLOAD_DIR}/assimp"
@@ -20,13 +23,17 @@
   URL_MD5 ${assimp_md5}
   BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/assimp"
   INSTALL_DIR "${SEQUOIA_EXTERNAL_INSTALL_PREFIX}/assimp"
+  # Remove the custom FinZLIB to force using the CMake builtin one
+  PATCH_COMMAND ${CMAKE_COMMAND} -E remove -f "<SOURCE_DIR>/cmake-modules/FindZLIB.cmake"
   CMAKE_ARGS
+    ${cmake_args}
     ${SEQUOIA_EXTERNAL_CMAKE_ARGS}
     ${SEQUOIA_EXTERNAL_PROJECTS_CMAKE_ARGS}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
     -DASSIMP_BUILD_TESTS:BOOL=OFF
     -DASSIMP_BUILD_SAMPLES:BOOL=OFF
     -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF
+    -DASSIMP_INSTALL_PDB:BOOL=OFF

     -DASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT:BOOL=OFF
     -DASSIMP_BUILD_OBJ_IMPORTER:BOOL=ON


Add missing packages to the Debian conflict list

And refactor the code to make sure that the dev and runtime package lists are
in sync.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -107,15 +107,14 @@
   endif()
 endif()

-set(STD_OPENCV_LIBS opencv-data libopencv-calib3d2.4 libopencv-contrib2.4 libopencv-core2.4
-    libopencv-features2d2.4 libopencv-flann2.4 libopencv-gpu2.4 libopencv-imgproc2.4
-    libopencv-ml2.4 libopencv-ocl2.4 libopencv-stitching2.4 libopencv-ts2.4 libopencv-videostab2.4)
+set(STD_OPENCV_LIBS opencv-data)
+set(STD_OPENCV_DEV libopencv-dev)

-set(STD_OPENCV_DEV libopencv-calib3d-dev libopencv-contrib-dev libopencv-core-dev
-    libopencv-dev libopencv-features2d-dev libopencv-flann-dev libopencv-gpu-dev
-    libopencv-highgui-dev libopencv-imgproc-dev libopencv-legacy-dev libopencv-ml-dev
-    libopencv-objdetect-dev libopencv-ocl-dev libopencv-photo-dev libopencv-stitching-dev
-    libopencv-superres-dev libopencv-ts-dev libopencv-video-dev libopencv-videostab-dev)
+foreach(module calib3d contrib core features2d flann gpu highgui imgproc legacy
+               ml objdetect ocl photo stitching superres ts video videostab)
+  list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4")
+  list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev")
+endforeach()

 string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_CONFLICTS "${STD_OPENCV_LIBS}")
 string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_PROVIDES "${STD_OPENCV_LIBS}")