cmake-modules:
* updated the python cmake rule to utilize the delayed load

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@3203 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/cmake-modules/FindThirdPartyPython.cmake
+++ trunk/cmake-modules/FindThirdPartyPython.cmake
@@ -1,51 +1,52 @@
-# ---------------------------------
-# Finds Python
-# Adds library to target
-# Adds include path
-# ---------------------------------
-
-IF(WIN32)
-FIND_PATH(PATH_PYTHON include/Python.h PATHS
-		"C:\Python27"
-		$ENV{OpenViBE_dependencies} NO_DEFAULT_PATH)
-	IF(PATH_PYTHON)
-		MESSAGE(STATUS "  Found Python...")
-		INCLUDE_DIRECTORIES(${PATH_PYTHON}/include)
-
-		FILE(GLOB_RECURSE lib_files ${PATH_PYTHON}/libs/*.lib)
-
-		FOREACH(PYTHON_LIB ${lib_files})
-			MESSAGE(STATUS "    [  OK  ] Third party lib ${PYTHON_LIB}")
-			TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic debug ${PYTHON_LIB})
-			TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic optimized ${PYTHON_LIB})
-		ENDFOREACH(PYTHON_LIB)
-
-		ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyPython)
-	ELSE(PATH_PYTHON)
-		MESSAGE(STATUS "  FAILED to find Python")
-	ENDIF(PATH_PYTHON)
-ENDIF(WIN32)
-
-IF(UNIX)
-	INCLUDE("FindPythonLibs")
-	IF(PYTHONLIBS_FOUND)
-		MESSAGE(STATUS "  Found Python...")
-		INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
-
-		FOREACH(PYTHON_LIB ${PYTHON_LIBRARIES})
-			SET(PYTHON_LIB1 "PYTHON_LIB1-NOTFOUND")
-			FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS NO_DEFAULT_PATH)
-			FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS "/")
-			IF(PYTHON_LIB1)
-				MESSAGE(STATUS "    [  OK  ] Third party lib ${PYTHON_LIB1}")
-				TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${PYTHON_LIB1})
-			ELSE(PYTHON_LIB1)
-				MESSAGE(STATUS "    [FAILED] Third party lib ${PYTHON_LIB}")
-			ENDIF(PYTHON_LIB1)
-		ENDFOREACH(PYTHON_LIB)
-
-		ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyPython)
-	ELSE(PYTHONLIBS_FOUND)
-		MESSAGE(STATUS "  FAILED to find Python")
-	ENDIF(PYTHONLIBS_FOUND)
-ENDIF(UNIX)
+# ---------------------------------
+# Finds Python
+# Adds library to target
+# Adds include path
+# ---------------------------------
+
+IF(WIN32)
+FIND_PATH(PATH_PYTHON include/Python.h PATHS "c:\python27" $ENV{OpenViBE_dependencies})
+	IF(PATH_PYTHON)
+		MESSAGE(STATUS "  Found Python...")
+		INCLUDE_DIRECTORIES(${PATH_PYTHON}/include)
+
+		FILE(GLOB_RECURSE lib_files ${PATH_PYTHON}/libs/*.lib)
+
+		FOREACH(PYTHON_LIB ${lib_files})
+			MESSAGE(STATUS "    [  OK  ] Third party lib ${PYTHON_LIB}")
+			TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic debug ${PYTHON_LIB})
+			TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic optimized ${PYTHON_LIB})
+		ENDFOREACH(PYTHON_LIB)
+
+		TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic Delayimp )
+		SET_TARGET_PROPERTIES(${PROJECT_NAME}-dynamic PROPERTIES LINK_FLAGS "/DELAYLOAD:python27.dll")
+
+		ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyPython)
+	ELSE(PATH_PYTHON)
+		MESSAGE(STATUS "  FAILED to find Python")
+	ENDIF(PATH_PYTHON)
+ENDIF(WIN32)
+
+IF(UNIX)
+	INCLUDE("FindPythonLibs")
+	IF(PYTHONLIBS_FOUND)
+		MESSAGE(STATUS "  Found Python...")
+		INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
+
+		FOREACH(PYTHON_LIB ${PYTHON_LIBRARIES})
+			SET(PYTHON_LIB1 "PYTHON_LIB1-NOTFOUND")
+			FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS NO_DEFAULT_PATH)
+			FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS "/")
+			IF(PYTHON_LIB1)
+				MESSAGE(STATUS "    [  OK  ] Third party lib ${PYTHON_LIB1}")
+				TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${PYTHON_LIB1})
+			ELSE(PYTHON_LIB1)
+				MESSAGE(STATUS "    [FAILED] Third party lib ${PYTHON_LIB}")
+			ENDIF(PYTHON_LIB1)
+		ENDFOREACH(PYTHON_LIB)
+
+		ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyPython)
+	ELSE(PYTHONLIBS_FOUND)
+		MESSAGE(STATUS "  FAILED to find Python")
+	ENDIF(PYTHONLIBS_FOUND)
+ENDIF(UNIX)


fix /usr/lib/debug location for suse

fix /usr/lib/debug location for suse

--- cmake/ArangoDBInstall.cmake
+++ cmake/ArangoDBInstall.cmake
@@ -17,8 +17,12 @@
 endif()

 # debug info directory:
-set(CMAKE_INSTALL_DEBINFO_DIR "${CMAKE_INSTALL_LIBDIR}/debug/${CMAKE_PROJECT_NAME}")
-
+if (${CMAKE_INSTALL_LIBDIR} STREQUAL "usr/lib64")
+  # some systems have weird places for usr/lib:
+  set(CMAKE_INSTALL_DEBINFO_DIR "usr/lib/debug/${CMAKE_PROJECT_NAME}")
+else ()
+  set(CMAKE_INSTALL_DEBINFO_DIR "${CMAKE_INSTALL_LIBDIR}/debug/${CMAKE_PROJECT_NAME}")
+endif ()

 set(CMAKE_INSTALL_SYSCONFDIR_ARANGO "${CMAKE_INSTALL_SYSCONFDIR}/${CMAKE_PROJECT_NAME}")
 set(CMAKE_INSTALL_FULL_SYSCONFDIR_ARANGO "${CMAKE_INSTALL_FULL_SYSCONFDIR}/${CMAKE_PROJECT_NAME}")
@@ -35,7 +39,6 @@
 FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/log/${CMAKE_PROJECT_NAME}")

 set(INSTALL_ICU_DT_DEST "${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}")
-
 include(InstallMacros)
 # install ----------------------------------------------------------------------
 install(DIRECTORY ${PROJECT_SOURCE_DIR}/Documentation/man/


Updated

Updated

--- cmake/CMakeBuildFlags.cmake
+++ cmake/CMakeBuildFlags.cmake
@@ -11,11 +11,11 @@
 if(CMAKE_COMPILER_IS_GNUC OR CMAKE_COMPILER_IS_CLANG)
 	FIND_LIBRARY(LIBM m)

-	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -Ofast -DCML_DOUBLE_PRECISION=ON -Dmfloat_t=double")
+	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Ofast -DCML_DOUBLE_PRECISION=ON -Dmfloat_t=double")
 endif()

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


tiny correction in path of cmake configuration file

--- cmake/CompilerOptions.cmake
+++ cmake/CompilerOptions.cmake
@@ -2,7 +2,7 @@

 if (UNIX AND NOT APPLE)
 	if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
-		include(cmake/platforms/Linux-gcc.cmake)
+		include(cmake/platforms/Linux64-gcc/config.cmake)
 	endif()

 	if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")


Add documentation header to FindODB.cmake

--- cmake/Modules/FindODB.cmake
+++ cmake/Modules/FindODB.cmake
@@ -1,5 +1,29 @@
 #
-# Doc is still TODO
+# This module defines the following variables:
+#
+#   ODB_USE_FILE - Path to the UseODB.cmake file. Use it to include the ODB use file.
+#                  The use file defines the needed functionality to compile and use
+#                  odb generated headers.
+#
+#   ODB_FOUND - All required components and the core library were found
+#   ODB_INCLUDR_DIRS - Combined list of all components include dirs
+#   ODB_LIBRARIES - Combined list of all componenets libraries
+#
+#   ODB_LIBODB_FOUND - Libodb core library was found
+#   ODB_LIBODB_INCLUDE_DIRS - Include dirs for libodb core library
+#   ODB_LIBODB_LIBRARIES - Libraries for libodb core library
+#
+# For each requested component the following variables are defined:
+#
+#   ODB_<component>_FOUND - The component was found
+#   ODB_<component>_INCLUDE_DIRS - The components include dirs
+#   ODB_<component>_LIBRARIES - The components libraries
+#
+# <component> is the original or uppercase name of the component
+#
+# The component names relate directly to the odb module names.
+# So for the libodb-mysql.so library, the component is named mysql,
+# for the libodb-qt.so module it's qt, and so on.
 #

 set(ODB_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/UseODB.cmake")
@@ -15,7 +39,7 @@
 	find_path(ODB_${component}_INCLUDE_DIR
 		NAMES odb/${component}/version.hxx
 		HINTS
-			${LIBODB_INCLUDE_DIRS}
+			${ODB_LIBODB_INCLUDE_DIRS}
 			${PC_ODB_${component}_INCLUDE_DIRS})

 	find_library(ODB_${component}_LIBRARY
@@ -63,18 +87,18 @@
 	HINTS
 		${libodb_INCLUDE_DIR}/../bin)

-set(LIBODB_INCLUDE_DIRS ${libodb_INCLUDE_DIR} CACHE STRING "ODB libodb include dirs")
-set(LIBODB_LIBRARIES ${libodb_LIBRARY} CACHE STRING "ODB libodb library")
+set(ODB_LIBODB_INCLUDE_DIRS ${libodb_INCLUDE_DIR} CACHE STRING "ODB libodb include dirs")
+set(ODB_LIBODB_LIBRARIES ${libodb_LIBRARY} CACHE STRING "ODB libodb library")
 set(ODB_EXECUTABLE ${odb_BIN} CACHE STRING "ODB executable")

 mark_as_advanced(libodb_INCLUDE_DIR libodb_LIBRARY odb_BIN)

-if(LIBODB_INCLUDE_DIRS AND LIBODB_LIBRARIES)
-	set(LIBODB_FOUND TRUE)
+if(ODB_LIBODB_INCLUDE_DIRS AND ODB_LIBODB_LIBRARIES)
+	set(ODB_LIBODB_FOUND TRUE)
 endif()

-set(ODB_INCLUDE_DIRS ${LIBODB_INCLUDE_DIRS})
-set(ODB_LIBRARIES ${LIBODB_LIBRARIES})
+set(ODB_INCLUDE_DIRS ${ODB_LIBODB_INCLUDE_DIRS})
+set(ODB_LIBRARIES ${ODB_LIBODB_LIBRARIES})

 foreach(component ${ODB_FIND_COMPONENTS})
 	find_odb_api(${component})
@@ -83,5 +107,5 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(ODB
 	FOUND_VAR ODB_FOUND
-	REQUIRED_VARS ODB_EXECUTABLE LIBODB_FOUND
+	REQUIRED_VARS ODB_EXECUTABLE ODB_LIBODB_FOUND
 	HANDLE_COMPONENTS)


Install of export file

Install of export file

--- cmake/MyPackageExport.cmake
+++ cmake/MyPackageExport.cmake
@@ -10,5 +10,7 @@
     EXPORT_FILE_NAME "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h"
     STATIC_DEFINE ${PROJECT_NAME}_STATIC)
   ADD_CUSTOM_TARGET(${PROJECT_NAME}Export SOURCES "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
+  INSTALL(FILES ${_file} DESTINATION ${_dir})
+  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION ${PROJECT_NAME})

 ENDMACRO()


Packaging fixes for Ubuntu 16.04.

Packaging fixes for Ubuntu 16.04.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -98,15 +98,15 @@
     set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
     set(CPACK_DEB_DEV_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
   else()
-    set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "cuda-cudart-${cuda_version_suffix}, cuda-npp-${cuda_version_suffix}")
-    set(CPACK_DEB_DEV_PACKAGE_DEPENDS "cuda-cudart-dev-${cuda_version_suffix}, cuda-npp-dev-${cuda_version_suffix}")
+    set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "cuda-cudart-${cuda_version_suffix} | libcudart${CUDA_VERSION}, cuda-npp-${cuda_version_suffix} | libnppc${CUDA_VERSION}, cuda-npp-${cuda_version_suffix} | libnppi${CUDA_VERSION}, cuda-npp-${cuda_version_suffix} | libnpps${CUDA_VERSION}")
+    set(CPACK_DEB_DEV_PACKAGE_DEPENDS "cuda-cudart-dev-${cuda_version_suffix} | nvidia-cuda-dev (>=${CUDA_VERSION}), cuda-npp-dev-${cuda_version_suffix} | nvidia-cuda-dev (>=${CUDA_VERSION})")
     if(HAVE_CUFFT)
-      set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "${CPACK_DEB_LIBS_PACKAGE_DEPENDS}, cuda-cufft-${cuda_version_suffix}")
-      set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, cuda-cufft-dev-${cuda_version_suffix}")
+      set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "${CPACK_DEB_LIBS_PACKAGE_DEPENDS}, cuda-cufft-${cuda_version_suffix} | libcufft${CUDA_VERSION}")
+      set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, cuda-cufft-dev-${cuda_version_suffix} | nvidia-cuda-dev (>=${CUDA_VERSION})")
     endif()
     if(HAVE_HAVE_CUBLAS)
-      set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "${CPACK_DEB_LIBS_PACKAGE_DEPENDS}, cuda-cublas-${cuda_version_suffix}")
-      set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, cuda-cublas-dev-${cuda_version_suffix}")
+      set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "${CPACK_DEB_LIBS_PACKAGE_DEPENDS}, cuda-cublas-${cuda_version_suffix} |  libcublas${CUDA_VERSION}")
+      set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, cuda-cublas-dev-${cuda_version_suffix} | nvidia-cuda-dev (>=${CUDA_VERSION})")
     endif()
   endif()
 endif()
@@ -122,10 +122,17 @@
 set(STD_OPENCV_LIBS opencv-data)
 set(STD_OPENCV_DEV libopencv-dev)

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


[CMake] Accept ENTITLEMENTS in llvm_add_library()

Summary: We added support for code signing entitlements in add_llvm_executable() with D54443. In the future it would be useful to have this functionality available also for libraries.

Reviewers: beanz, bogner

Reviewed By: bogner

Subscribers: mgorny, llvm-commits, lldb-commits, #lldb

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -380,7 +380,7 @@
 function(llvm_add_library name)
   cmake_parse_arguments(ARG
     "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME;NO_INSTALL_RPATH"
-    "OUTPUT_NAME;PLUGIN_TOOL"
+    "OUTPUT_NAME;PLUGIN_TOOL;ENTITLEMENTS"
     "ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS"
     ${ARGN})
   list(APPEND LLVM_COMMON_DEPENDS ${ARG_DEPENDS})
@@ -584,7 +584,7 @@

   if(ARG_SHARED OR ARG_MODULE)
     llvm_externalize_debuginfo(${name})
-    llvm_codesign(${name})
+    llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS})
   endif()
 endfunction()


[cmake] Clean up add_llvm_subdirectory

[cmake] Clean up add_llvm_subdirectory

I found the pattern of setting the project_BUILD variable to OFF after
processing the project to be pretty confusing. Using global properties
to explicitly keep track of whether a project has been processed or not
seems much more straightforward, and it also allows us to convert the
macro into a function (which is required for the early return).

Factor the project+type+name combination out into a variable while I'm
here, since it's used a whole bunch of times.

I don't believe this should result in any functional changes.

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -978,47 +978,50 @@
 # Custom add_subdirectory wrapper
 # Takes in a project name (i.e. LLVM), the subdirectory name, and an optional
 # path if it differs from the name.
-macro(add_llvm_subdirectory project type name)
+function(add_llvm_subdirectory project type name)
   set(add_llvm_external_dir "${ARGN}")
   if("${add_llvm_external_dir}" STREQUAL "")
     set(add_llvm_external_dir ${name})
   endif()
   canonicalize_tool_name(${name} nameUPPER)
+  set(canonical_full_name ${project}_${type}_${nameUPPER})
+  get_property(already_processed GLOBAL PROPERTY ${canonical_full_name}_PROCESSED)
+  if(already_processed)
+    return()
+  endif()
+  set_property(GLOBAL PROPERTY ${canonical_full_name}_PROCESSED YES)
+
   if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}/CMakeLists.txt)
     # Treat it as in-tree subproject.
-    option(${project}_${type}_${nameUPPER}_BUILD
+    option(${canonical_full_name}_BUILD
            "Whether to build ${name} as part of ${project}" On)
     mark_as_advanced(${project}_${type}_${name}_BUILD)
-    if(${project}_${type}_${nameUPPER}_BUILD)
+    if(${canonical_full_name}_BUILD)
       add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir} ${add_llvm_external_dir})
-      # Don't process it in add_llvm_implicit_projects().
-      set(${project}_${type}_${nameUPPER}_BUILD OFF)
     endif()
   else()
     set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR
       "${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}"
       CACHE PATH "Path to ${name} source directory")
-    set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT ON)
+    set(${canonical_full_name}_BUILD_DEFAULT ON)
     if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR OR NOT EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR})
-      set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT OFF)
+      set(${canonical_full_name}_BUILD_DEFAULT OFF)
     endif()
     if("${LLVM_EXTERNAL_${nameUPPER}_BUILD}" STREQUAL "OFF")
-      set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT OFF)
-    endif()
-    option(${project}_${type}_${nameUPPER}_BUILD
+      set(${canonical_full_name}_BUILD_DEFAULT OFF)
+    endif()
+    option(${canonical_full_name}_BUILD
       "Whether to build ${name} as part of LLVM"
-      ${${project}_${type}_${nameUPPER}_BUILD_DEFAULT})
-    if (${project}_${type}_${nameUPPER}_BUILD)
+      ${${canonical_full_name}_BUILD_DEFAULT})
+    if (${canonical_full_name}_BUILD)
       if(EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR})
         add_subdirectory(${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} ${add_llvm_external_dir})
       elseif(NOT "${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}" STREQUAL "")
         message(WARNING "Nonexistent directory for ${name}: ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}")
       endif()
-      # FIXME: It'd be redundant.
-      set(${project}_${type}_${nameUPPER}_BUILD Off)
-    endif()
-  endif()
-endmacro()
+    endif()
+  endif()
+endfunction()

 # Add external project that may want to be built as part of llvm such as Clang,
 # lld, and Polly. This adds two options. One for the source directory of the


[CMake] Add LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR for custom dSYM target directory on Darwin

Summary: When using `LLVM_EXTERNALIZE_DEBUGINFO` in LLDB, the default dSYM location for the shared library in LLDB.framework is inside the framework bundle. With `LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR` we can easily fix that. I consider it a useful feature to be able to set a global output directory for external debug info (rather then having a target-specific one). Only implemented for Darwin so far.

Reviewers: beanz, aprantl

Reviewed By: aprantl

Subscribers: mgorny, aprantl, #lldb, lldb-commits, llvm-commits

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1597,6 +1597,13 @@
     endif()
   endif()

+  if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
+    if(APPLE)
+      set(output_name "$<TARGET_FILE_NAME:${name}>.dSYM")
+      set(output_path "-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
+    endif()
+  endif()
+
   if(APPLE)
     if(CMAKE_CXX_FLAGS MATCHES "-flto"
       OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")
@@ -1609,7 +1616,7 @@
       set(CMAKE_DSYMUTIL xcrun dsymutil)
     endif()
     add_custom_command(TARGET ${name} POST_BUILD
-      COMMAND ${CMAKE_DSYMUTIL} $<TARGET_FILE:${name}>
+      COMMAND ${CMAKE_DSYMUTIL} ${output_path} $<TARGET_FILE:${name}>
       ${strip_command}
       )
   else()


CELIX-71: Applied patch

CELIX-71: Applied patch

git-svn-id: b0a1bd8fd09963d3661abf01547333b64b62a32b@1524743 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/modules/FindAPR.cmake
+++ cmake/modules/FindAPR.cmake
@@ -31,12 +31,13 @@
 /usr/local/include/apr-1.0
 /usr/include/apr-1
 /usr/include/apr-1.0
+/usr/local/apr/include/apr-1
 )

 SET(APR_NAMES ${APR_NAMES} apr-1)
 FIND_LIBRARY(APR_LIBRARY
   NAMES ${APR_NAMES}
-  PATHS /usr/lib /usr/local/lib
+  PATHS /usr/lib /usr/local/lib /usr/local/apr/lib
   )

 IF (APR_LIBRARY AND APR_INCLUDE_DIR)
@@ -73,12 +74,13 @@
 /usr/local/include/apr-1.0
 /usr/include/apr-1
 /usr/include/apr-1.0
+/usr/local/apr/include/apr-1
 )

 SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1)
 FIND_LIBRARY(APRUTIL_LIBRARY
   NAMES ${APRUTIL_NAMES}
-  PATHS /usr/lib /usr/local/lib
+  PATHS /usr/lib /usr/local/lib /usr/local/apr/lib
   )

 IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)


update re2c to v2.0

update re2c to v2.0

--- cmake/modules/GetRE2C.cmake
+++ cmake/modules/GetRE2C.cmake
@@ -20,7 +20,7 @@
     download_project(
             PROJ                re2c
             GIT_REPOSITORY      https://github.com/skvadrik/re2c.git
-            GIT_TAG             eb48666e20f621a2b42940e0702e205147909e52
+            GIT_TAG             2.0
             GIT_PROGRESS        1
     )


If perl cannot be found, then do not allow a build of the docbook
documentation since all backends for that build require perl.

svn path=/trunk/; revision=12485

--- cmake/modules/docbook.cmake
+++ cmake/modules/docbook.cmake
@@ -21,12 +21,12 @@
 # Configuration for the building of DocBook documentation

 option(BUILD_DOC "Enable build of DocBook documentation" OFF)
-if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
+if(NOT (PERL_FOUND AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
   set(
   BUILD_DOC OFF CACHE INTERNAL
   "Enable build of DocBook documentation"
   )
-endif(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
+endif(NOT (PERL_FOUND AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))

 option(PREBUILT_DOC "Assume documentation is already built and present in doc/docbooks/src, ready to be installed. This option is useful for package maintainers" OFF)


Don't check for FIONREAD on windows. Execution of platforms tests are slow/flaky when building on windows. in PB:mysql-next-mr-opt-team on 2011-05-18 for win x86 debug_max, i see: -- Looking for FIONREAD -- Looking for FIONREAD - found and the build fails.

--- cmake/os/WindowsCache.cmake
+++ cmake/os/WindowsCache.cmake
@@ -341,6 +341,7 @@
 SET(C_HAS_inline CACHE INTERNAL "")
 SET(C_HAS___inline 1 CACHE INTERNAL "")
 SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "")
+SET(FIONREAD_IN_SYS_FILIO CACHE INTERNAL "")
 SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "")
 SET(HAVE_CXXABI_H CACHE INTERNAL "")
 SET(HAVE_NDIR_H CACHE INTERNAL "")


Skip header files in clang-tidy

Skip header files in clang-tidy

--- cmake/ClangTidy.cmake
+++ cmake/ClangTidy.cmake
@@ -113,14 +113,16 @@
     # COMMAND ${CLANG_TIDY_COMMAND} $<TARGET_PROPERTY:${TARGET},SOURCES>
     # COMMAND ${CLANG_TIDY_COMMAND} $<JOIN:$<TARGET_PROPERTY:${TARGET},SOURCES>, >
     foreach(SOURCE ${SOURCES})
-        string(MAKE_C_IDENTIFIER "${SOURCE}" tidy_file)
-        add_custom_target(tidy-${TARGET}-${tidy_file}
-            COMMAND ${CLANG_TIDY_COMMAND} ${SOURCE}
-            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-            COMMENT "clang-tidy: Running clang-tidy on target ${SOURCE}..."
-        )
-        add_dependencies(tidy-${TARGET}-${tidy_file} ${TARGET})
-        add_dependencies(tidy tidy-${TARGET}-${tidy_file})
+        if(NOT "${SOURCE}" MATCHES "(h|hpp|hxx)$")
+            string(MAKE_C_IDENTIFIER "${SOURCE}" tidy_file)
+            add_custom_target(tidy-${TARGET}-${tidy_file}
+                COMMAND ${CLANG_TIDY_COMMAND} ${SOURCE}
+                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                COMMENT "clang-tidy: Running clang-tidy on target ${SOURCE}..."
+            )
+            add_dependencies(tidy-${TARGET}-${tidy_file} ${TARGET})
+            add_dependencies(tidy tidy-${TARGET}-${tidy_file})
+        endif()
     endforeach()
 endfunction()


Find Epoxy under Android. Android doesn't support shared libraries not ending with ".so", so the library ABI version should be included in the library name (I've fixed Epoxy so that under Android it's built with a name like "libepoxy_0.so", where "0" is the ABI version).

--HG--
branch : android

--- cmake/FindEpoxy.cmake
+++ cmake/FindEpoxy.cmake
@@ -4,7 +4,7 @@
 include(FindPackageHandleStandardArgs)

 find_path(EPOXY_H_PATH NAMES epoxy/gl.h)
-find_library(EPOXY_LIB NAMES epoxy)
+find_library(EPOXY_LIB NAMES epoxy epoxy_0)
 mark_as_advanced(EPOXY_H_PATH EPOXY_LIB EPOXY_LIB_DBG)

 find_package_handle_standard_args(EPOXY DEFAULT_MSG EPOXY_LIB EPOXY_H_PATH)


File removed as this has been merged into FindGTest (#39).

--- cmake/FindGMock.cmake
+++ cmake/FindGMock.cmake
@@ -1,27 +0,0 @@
-
-find_package(PkgConfig)
-pkg_check_modules(PKG_GMock QUIET libGMock)
-set(GMock_DEFINITIONS ${PKG_GMock_CFLAGS_OTHER})
-
-find_path(GMock_INCLUDE_DIR "gmock/gmock.h"
-                                HINTS ${PKG_GMock_INCLUDE_DIRS}
-                                        "${GMock_DIR}/include"
-                                )
-
-find_library(GMock_LIBRARY NAMES gmock
-                                HINTS ${PKG_GMock_LIBDIR}
-                                        ${PKG_GMock_LIBRARY_DIRS}
-                                )
-
-
-set(GMock_LIBRARIES ${GMock_LIBRARY})
-set(GMock_INCLUDE_DIRS ${GMock_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GMock DEFAULT_MSG
-                                        GMock_LIBRARY
-                                        GMock_INCLUDE_DIR
-                                        )
-
-mark_as_advanced(GMock_INCLUDE_DIR GMock_LIBRARY)
-


Add debug info for cmake

Add debug info for cmake

--- cmake/VIZConfig.cmake
+++ cmake/VIZConfig.cmake
@@ -5,3 +5,7 @@

 set(VIZ_LIBRARIES ${VIZ_LIBRARY} )
 set(VIZ_INCLUDE_DIRS ${VIZ_INCLUDE_DIR} )
+
+message(STATUS "VIZ found")
+message(STATUS "  includes: " ${VIZ_INCLUDE_DIRS})
+message(STATUS "  libs: " ${VIZ_LIBRARIES} )


Fix the target specific "-msse3" flag check in CMake. NFC

msse3 is a target dependent flag and must be guarded as check_cxx_compiler_flag()
checks only for compiler error messages and ignores warnings. Earlier COMPILER_RT_HAS_MSSE3_FLAG
is set to "TRUE" for all targets as clang emits warnings and the compilation spits unnecessary
warnings for non-X86 targets. This issue is fixed by coupling the flag with "-Werror"

Differential Revision: http://reviews.llvm.org/D15362

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@255165 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -27,7 +27,7 @@
 check_cxx_compiler_flag(-std=c++11           COMPILER_RT_HAS_STD_CXX11_FLAG)
 check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC)
 check_cxx_compiler_flag(-fno-lto             COMPILER_RT_HAS_FNO_LTO_FLAG)
-check_cxx_compiler_flag(-msse3               COMPILER_RT_HAS_MSSE3_FLAG)
+check_cxx_compiler_flag("-Werror -msse3" COMPILER_RT_HAS_MSSE3_FLAG)
 check_cxx_compiler_flag(-std=c99             COMPILER_RT_HAS_STD_C99_FLAG)
 check_cxx_compiler_flag(--sysroot=.          COMPILER_RT_HAS_SYSROOT_FLAG)

@@ -574,14 +574,6 @@
   set(COMPILER_RT_HAS_UBSAN FALSE)
 endif()

-# -msse3 flag is not valid for Mips therefore clang gives a warning
-# message with -msse3. But check_c_compiler_flags() checks only for
-# compiler error messages. Therefore COMPILER_RT_HAS_MSSE3_FLAG turns out to be
-# true on Mips, so we make it false here.
-if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips")
-  set(COMPILER_RT_HAS_MSSE3_FLAG FALSE)
-endif()
-
 if (COMPILER_RT_HAS_SANITIZER_COMMON AND SAFESTACK_SUPPORTED_ARCH AND
     OS_NAME MATCHES "Darwin|Linux|FreeBSD")
   set(COMPILER_RT_HAS_SAFESTACK TRUE)


[UBSan] [MIPS] Adding support of UBSan for mipsel arch

Summary:
Changed files:
config-ix.cmake: Added mipsel to UBSAN_SUPPORTED_ARCH

Reviewers: rsmith, kcc, dsanders, petarj, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits, mohit.bhakkad, farazs, kumarsukhani

Differential Revision: http://reviews.llvm.org/D5750

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@219822 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -178,7 +178,7 @@
 filter_available_targets(MSAN_SUPPORTED_ARCH x86_64)
 filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm mips mips64 mipsel mips64el aarch64)
 filter_available_targets(TSAN_SUPPORTED_ARCH x86_64)
-filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips)
+filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips mipsel)

 if(ANDROID)
   set(OS_NAME "Android")


fix 'compat' rpm for fedora18

fix 'compat' rpm for fedora18

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -85,6 +85,7 @@
 SET(CPACK_RPM_common_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf")
 SET(CPACK_RPM_shared_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*")
 SET(CPACK_RPM_client_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*")
+SET(CPACK_RPM_compat_USER_FILELIST ${ignored})
 SET(CPACK_RPM_devel_USER_FILELIST ${ignored})
 SET(CPACK_RPM_test_USER_FILELIST ${ignored})


cpack: Update package logic to build DEB debuginfo (#5843)

This enables a component install for DEB (only). This is required in
CMake version 3.17.0 (planned) and lower to produce a debuginfo version.

One side-effect is we have to gate the stripping for DEB.

--- cmake/packaging.cmake
+++ cmake/packaging.cmake
@@ -128,44 +128,45 @@
     endif()

     # bin
-    install(TARGETS osqueryd DESTINATION bin)
-    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink osqueryd osqueryi)")
-    install(FILES "${CMAKE_BINARY_DIR}/osqueryi" DESTINATION bin)
+    install(TARGETS osqueryd DESTINATION bin COMPONENT osquery)
+    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink osqueryd osqueryi)" COMPONENT osquery)
+    install(FILES "${CMAKE_BINARY_DIR}/osqueryi" DESTINATION bin COMPONENT osquery)
     file(COPY "${CMAKE_SOURCE_DIR}/tools/deployment/osqueryctl" DESTINATION "${CMAKE_BINARY_DIR}/package/linux")
-    install(PROGRAMS "${CMAKE_BINARY_DIR}/package/linux/osqueryctl" DESTINATION bin)
+    install(PROGRAMS "${CMAKE_BINARY_DIR}/package/linux/osqueryctl" DESTINATION bin COMPONENT osquery)

     # lib
     file(COPY "${CMAKE_SOURCE_DIR}/tools/deployment/osqueryd.service" DESTINATION "${CMAKE_BINARY_DIR}/package/linux")
-    install(FILES "${CMAKE_BINARY_DIR}/package/linux/osqueryd.service" DESTINATION lib/systemd/system)
+    install(FILES "${CMAKE_BINARY_DIR}/package/linux/osqueryd.service" DESTINATION lib/systemd/system COMPONENT osquery)

     # share
     file(COPY "${CMAKE_SOURCE_DIR}/tools/deployment/osquery.example.conf" DESTINATION "${CMAKE_BINARY_DIR}/package/linux")
-    install(FILES "${CMAKE_BINARY_DIR}/package/linux/osquery.example.conf" DESTINATION share/osquery)
+    install(FILES "${CMAKE_BINARY_DIR}/package/linux/osquery.example.conf" DESTINATION share/osquery COMPONENT osquery)

     install(DIRECTORY "${augeas_lenses_path}/"
             DESTINATION share/osquery/lenses
+            COMPONENT osquery
             FILES_MATCHING PATTERN "*.aug"
             PATTERN "tests" EXCLUDE)

     file(COPY "${CMAKE_SOURCE_DIR}/packs" DESTINATION "${CMAKE_BINARY_DIR}/package/linux")
-    install(DIRECTORY "${CMAKE_BINARY_DIR}/package/linux/packs" DESTINATION share/osquery)
-
-    install(FILES "${CMAKE_SOURCE_DIR}/tools/deployment/certs.pem" DESTINATION share/osquery/certs)
+    install(DIRECTORY "${CMAKE_BINARY_DIR}/package/linux/packs" DESTINATION share/osquery COMPONENT osquery)
+
+    install(FILES "${CMAKE_SOURCE_DIR}/tools/deployment/certs.pem" DESTINATION share/osquery/certs COMPONENT osquery)

     # etc
     file(COPY "${CMAKE_SOURCE_DIR}/tools/deployment/osqueryd.sysconfig" DESTINATION "${CMAKE_BINARY_DIR}/package/linux")
     if("${PACKAGING_SYSTEM}"  STREQUAL "DEB")
-      install(FILES "${CMAKE_BINARY_DIR}/package/linux/osqueryd.sysconfig" DESTINATION /etc/default RENAME osqueryd)
+      install(FILES "${CMAKE_BINARY_DIR}/package/linux/osqueryd.sysconfig" DESTINATION /etc/default RENAME osqueryd COMPONENT osquery)
     else()
-      install(FILES "${CMAKE_BINARY_DIR}/package/linux/osqueryd.sysconfig" DESTINATION /etc/sysconfig RENAME osqueryd)
+      install(FILES "${CMAKE_BINARY_DIR}/package/linux/osqueryd.sysconfig" DESTINATION /etc/sysconfig RENAME osqueryd COMPONENT osquery)
     endif()

     file(COPY "${CMAKE_SOURCE_DIR}/tools/deployment/osqueryd.initd" DESTINATION "${CMAKE_BINARY_DIR}/package/linux")
-    install(PROGRAMS "${CMAKE_BINARY_DIR}/package/linux/osqueryd.initd" DESTINATION /etc/init.d RENAME "osqueryd")
-    install(DIRECTORY DESTINATION /etc/osquery)
+    install(PROGRAMS "${CMAKE_BINARY_DIR}/package/linux/osqueryd.initd" DESTINATION /etc/init.d RENAME "osqueryd" COMPONENT osquery)
+    install(DIRECTORY DESTINATION /etc/osquery COMPONENT osquery)
     # var
-    install(DIRECTORY DESTINATION /var/log/osquery)
-    install(DIRECTORY DESTINATION /var/osquery)
+    install(DIRECTORY DESTINATION /var/log/osquery COMPONENT osquery)
+    install(DIRECTORY DESTINATION /var/osquery COMPONENT osquery)

   elseif(DEFINED PLATFORM_WINDOWS)
     # .
@@ -245,6 +246,7 @@
 list(GET OSQUERY_VERSION_COMPONENTS 2 CPACK_PACKAGE_VERSION_PATCH)

 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "osquery is an operating system instrumentation toolchain.")
+set(CPACK_COMPONENT_OSQUERY_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
 set(CPACK_PACKAGE_NAME "osquery")
 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 set(CPACK_PACKAGE_VENDOR "osquery")
@@ -253,11 +255,16 @@
 set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/package/CPackConfig.cmake")
 set(CPACK_PACKAGE_RELOCATABLE ON)
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/package/LICENSE.txt")
-set(CPACK_STRIP_FILES ON)
+set(CPACK_COMPONENTS_ALL osquery)

 configure_file(cmake/CPackConfig.cmake.in package/CPackConfig.cmake @ONLY)

 set(CPACK_GENERATOR "${PACKAGING_SYSTEM}")
+
+# Set this on by default and off for DEB
+if(NOT CPACK_GENERATOR STREQUAL "DEB")
+  set(CPACK_STRIP_FILES ON)
+endif()

 if(DEFINED PLATFORM_LINUX)
   set(OSQUERY_PACKAGE_RELEASE "1.linux")
@@ -269,12 +276,15 @@
   endif()

   if(CPACK_GENERATOR STREQUAL "DEB")
+    set(CPACK_DEBIAN_OSQUERY_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
     set(CPACK_DEBIAN_PACKAGE_RELEASE "${OSQUERY_PACKAGE_RELEASE}")
-    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${OSQUERY_PACKAGE_RELEASE}.amd64")
+    set(CPACK_DEBIAN_OSQUERY_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${OSQUERY_PACKAGE_RELEASE}.amd64.deb")
     set(CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
     set(CPACK_DEBIAN_PACKAGE_SECTION "default")
     set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.12), zlib1g")
     set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_PACKAGE_HOMEPAGE_URL}")
+    set(CPACK_DEB_COMPONENT_INSTALL ON)
+    set(CPACK_DEBIAN_DEBUGINFO_PACKAGE ON)

   elseif(CPACK_GENERATOR STREQUAL "RPM")
     set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${OSQUERY_PACKAGE_RELEASE}.x86_64")
@@ -309,7 +319,7 @@

 include(CPack)

-if(DEFINED PLATFORM_MACOS)
+if(DEFINED PLATFORM_MACOS OR DEFINED PLATFORM_LINUX)
   cpack_add_component(osquery REQUIRED)
 endif()
 endfunction()


use boost 1.36 or above

use boost 1.36 or above

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -34,7 +34,7 @@

 # This is required to enable the new version
 SET(Boost_ADDITIONAL_VERSIONS 1.40 1.40.0 1.39 1.39.0 1.38 1.38.0 1.37 1.37.0)
-FIND_PACKAGE(Boost 1.37)
+FIND_PACKAGE(Boost 1.36)

 ##################################################
 # Threads


Use print status functions [skip ci]

Use print status functions [skip ci]

--- Common.cmake
+++ Common.cmake
@@ -14,25 +14,30 @@
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/find")
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/utilities")

+include(polly_fatal_error)
+include(polly_status_print)
+include(polly_status_debug)
+
 # All well-known variables must be CACHE type:
 #     http://www.cmake.org/pipermail/cmake/2012-January/048429.html

 # Check and print customization variables
 if(NOT POLLY_TOOLCHAIN_NAME)
-  message(FATAL_ERROR "POLLY_TOOLCHAIN_NAME is empty")
+  polly_fatal_error("POLLY_TOOLCHAIN_NAME is empty")
 endif()

 if(NOT POLLY_TOOLCHAIN_TAG)
-  message(FATAL_ERROR "POLLY_TOOLCHAIN_TAG is empty")
+  polly_fatal_error("POLLY_TOOLCHAIN_TAG is empty")
 endif()

-message(STATUS "[polly] Used toolchain: ${POLLY_TOOLCHAIN_NAME}")
+polly_status_print("Used toolchain: ${POLLY_TOOLCHAIN_NAME}")

 # support for hunter (github.com/ruslo/hunter)
 set(HUNTER_INSTALL_TAG ${POLLY_TOOLCHAIN_TAG})

 # Other
 if(NOT CMAKE_DEBUG_POSTFIX)
+  polly_status_debug("CMAKE_DEBUG_POSTFIX is empty")
   set(
       CMAKE_DEBUG_POSTFIX
       "d"
@@ -40,4 +45,5 @@
       STRING
       "Debug postfix (e.g. libmy.a libmyd.a)"
   )
+  polly_status_debug("CMAKE_DEBUG_POSTFIX set to '${CMAKE_DEBUG_POSTFIX}'")
 endif()


Add POCO_NO_UNWINDOWS and WIN32_LEAN_AND_MEAN to BlueBerry apps.

--- BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
+++ BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
@@ -91,11 +91,19 @@
 # Create the executable and link libraries
 # -----------------------------------------------------------------------

+set(_app_compile_flags )
+if(WIN32)
+  set(_app_compile_flags "${_app_compile_flags} -DPOCO_NO_UNWINDOWS -DWIN32_LEAN_AND_MEAN")
+endif()
+
 if(_APP_SHOW_CONSOLE)
   add_executable(${_APP_NAME} MACOSX_BUNDLE ${_APP_SOURCES} ${WINDOWS_ICON_RESOURCE_FILE})
 else()
   add_executable(${_APP_NAME} MACOSX_BUNDLE WIN32 ${_APP_SOURCES} ${WINDOWS_ICON_RESOURCE_FILE})
 endif()
+
+set_target_properties(${_APP_NAME} PROPERTIES
+                      COMPILE_FLAGS "${_app_compile_flags}")

 target_link_libraries(${_APP_NAME} org_blueberry_osgi ${_APP_LINK_LIBRARIES})
 if(WIN32)


ENH:  Add refactoring and more testing.

ENH:  Add refactoring and more testing.

--- Modules/Remote/AdaptiveDenoising.remote.cmake
+++ Modules/Remote/AdaptiveDenoising.remote.cmake
@@ -56,5 +56,5 @@
   "
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/ntustison/ITKAdaptiveDenoising.git
-  GIT_TAG ef309a1f050a2f7b1102f5024cf4997cd284266b
+  GIT_TAG 734e3fe8e94cc804d199f323eb949fdc0859c527
 )


64bit版コンパイラで32bit版プログラムをビルドする際のフラグ設定

64bit版コンパイラで32bit版プログラムをビルドする際のフラグ設定

--- Common.cmake
+++ Common.cmake
@@ -7,7 +7,16 @@
 #	set(NEON_LEVEL 1)

 include_directories(${PROJECT_SOURCE_DIR})
-
+# 対象のビット数でフラグを分ける
+if(DEFINED M64)
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
+	#64bitプロセッサならSSE2は付いているはずなのでフラグを追加
+	if(NOT (${SSE_LEVEL} GREATER 2))
+		set(SSE_LEVEL 2)
+	endif()
+else()
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
+endif()
 # SSEが設定されているならコンパイラのフラグを付ける
 if(DEFINED SSE_LEVEL)
 	if(${SSE_LEVEL} GREATER 0)


cmake-modules:
 * FindThirdPartyEmotivAPI.cmake : added the /DELAYLOAD flag in the link properties.

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@3084 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/cmake-modules/FindThirdPartyEmotivAPI.cmake
+++ trunk/cmake-modules/FindThirdPartyEmotivAPI.cmake
@@ -16,7 +16,7 @@
 			TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${LIB_EmotivAPI} )
 			# To delay load EDK.dll and redistribute binary
 			TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic Delayimp.lib )
-
+			SET_TARGET_PROPERTIES(${PROJECT_NAME}-dynamic PROPERTIES LINK_FLAGS "/DELAYLOAD:edk.dll")
 		ELSE(LIB_EmotivAPI)
 			MESSAGE(STATUS "    [FAILED] lib Emotiv edk.lib")
 		ENDIF(LIB_EmotivAPI)


fix for CRAN/solaris

fix for CRAN/solaris

--- configure/cmake/FindR.cmake
+++ configure/cmake/FindR.cmake
@@ -11,11 +11,22 @@
 find_program(R_EXEC NAMES R R.exe)
 set(CMAKE_FIND_APPBUNDLE ${TEMP_CMAKE_FIND_APPBUNDLE})

+set(ENV{R_HOME} "blah")

 #---Find includes and libraries if R exists
 if(R_EXEC)

   set(R_FOUND TRUE)
+
+  # On CRAN/Solaris an R_HOME env variable is set and causes
+  # assignment of R_ROOT_DIR to fail since 'R RHOME'
+  # issues a warning as its first output.   Unset if needed.
+
+  # if((CMAKE_HOST_SOLARIS) AND (DEFINED ENV{R_HOME}))
+  if((TRUE) AND (DEFINED ENV{R_HOME}))
+      message(STATUS "Rogue R_HOME defined on Solaris.  Will ignore.")
+      unset(ENV{R_HOME})
+  endif()

   execute_process(WORKING_DIRECTORY .
   COMMAND ${R_EXEC} RHOME


applied mingw patch, #3335

applied mingw patch, #3335

--- core/rosbuild/private.cmake
+++ core/rosbuild/private.cmake
@@ -330,8 +330,12 @@
     set_target_properties(${lib} PROPERTIES OUTPUT_NAME ${libname})
     # Also add -fPIC, because CMake leaves it out when building static
     # libs, even though it's necessary on 64-bit machines for linking this
-    # lib against shared libs downstream.
-    rosbuild_add_compile_flags(${lib} -fPIC)
+    # lib against shared libs downstream. The only exception is mingw gcc
+    # which doesn't specifically need to worry about building
+    # position independant libs.
+    if(NOT MINGW)
+        rosbuild_add_compile_flags(${lib} -fPIC)
+    endif()
   endif(${type} STREQUAL STATIC)

   # Add explicit dependency of each file on our manifest.xml and those of


Only use fast-math in exes

Only use fast-math in exes

--- SetFlags.cmake
+++ SetFlags.cmake
@@ -1,4 +1,3 @@
-
 macro (add_flags_lnk FLAGS)
 	set(CMAKE_EXE_LINKER_FLAGS            "${CMAKE_EXE_LINKER_FLAGS}            ${FLAGS}")
 	set(CMAKE_EXE_LINKER_FLAGS_DEBUG      "${CMAKE_EXE_LINKER_FLAGS_DEBUG}      ${FLAGS}")
@@ -49,9 +48,6 @@
 		else()
 			add_flags_cxx("-pthread")
 		endif()
-
-		#we support non-IEEE 754 fpus so can make no guarentees about error
-		add_flags_cxx("-ffast-math")

 	else()
 		# Let gcc / clang know that we're compiling a multi-threaded app:
@@ -65,8 +61,6 @@
 		# We use a signed char (fixes #640 on RasPi)
 		add_flags_cxx("-fsigned-char")

-		#we support non-IEEE 754 fpus so can make no guarentees about error
-		add_flags_cxx("-ffast-math")
 	endif()

@@ -189,6 +183,9 @@
 		string(REPLACE "-w" "" CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}")
 		string(REPLACE "-w" "" CMAKE_C_FLAGS_DEBUG     "${CMAKE_C_FLAGS_DEBUG}")
 		add_flags_cxx("-Wall -Wextra")
+
+		#we support non-IEEE 754 fpus so can make no guarentees about error
+		add_flags_cxx("-ffast-math")
 	endif()

 endmacro()


build: Fix dependency management for workbenches

Previously the workbench was not disabled even when dependencies
were unmet, resulting in eventual compile failure.

--- cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake
+++ cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake
@@ -6,11 +6,12 @@
     # modules.  Warns if any of the prerequisite modules are disabled.
     function(REQUIRES_MODS dependent)
         if(${dependent})
-            foreach(prerequisite ${ARGN})
+            foreach(prerequisite IN LISTS ARGN)
                 if(NOT ${prerequisite})
-                    message(WARNING
-                            "${dependent} requires ${ARGN} each be ON, but "
-                            "${prerequisite} is \"${${prerequisite}}\"")
+                    message(STATUS "${dependent} requires ${prerequisite} to be ON, but it"
+                                   " is \"${${prerequisite}}\"")
+                    set(${dependent} OFF PARENT_SCOPE)
+                    break()
                 endif(NOT ${prerequisite})
             endforeach()
         endif(${dependent})


Remove translator specific flag as it is no handle by --debug

#24

--- test/base_test.cmake
+++ test/base_test.cmake
@@ -23,7 +23,7 @@
 if(${TEST_DEBUG}) # with debug option
   add_custom_command(
     OUTPUT  ${OUTPUT_FILE}
-    COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --target=openacc --debug -J ${XMOD_DIR} --Wx-d -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
+    COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --target=openacc --debug -J ${XMOD_DIR} -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
     DEPENDS ${ORIGINAL_FILE}
     COMMENT "Translating CLAW directive with ${CLAWFC}"


Fix wrong name for PDF cache option.

Fix wrong name for PDF cache option.

--- build-aux/doxygen.cmake
+++ build-aux/doxygen.cmake
@@ -362,7 +362,7 @@

   string(TOUPPER "${arg_TARGET}" target_upcase)
   set(pdf_cachevar WANT_${target_upcase}_PDF)
-  set(html_cachevar WANT_${target_upcase}_PDF)
+  set(html_cachevar WANT_${target_upcase}_HTML)
   set(rebuild_cachevar "WANT_${target_upcase}_REBUILD")
   set(doxyfile_cachevar "${target_upcase}_DOXYFILE_TEMPLATE")

@@ -581,7 +581,7 @@
     endforeach()

     if (DOXYGEN_CMAKE_VERBOSE AND is_none)
-      message("add_doxygen(): outputs are forced to none.")
+      message("add_doxygen(): OUTPUTS have the value \"none\" - everthing will be forced off.")
     endif()

     set(possible_outs "HTML" "MAN" "LATEX")


Don't add largeaddressaware if building with mingw

git-svn-id: e0b5bbb11d0e9fdbbfcabba14dc32ad5d6b235bd@606 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCompiler.cmake
+++ cmake/ACGCompiler.cmake
@@ -15,9 +15,11 @@
   set( ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS )

   if ( WINDOWS_LARGE_MEMORY_SUPPORT )
-	list(APPEND ADDITIONAL_CMAKE_EXE_LINKER_FLAGS       "/LARGEADDRESSAWARE" )
-	list(APPEND ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
-	list(APPEND ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+        if( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
+	  list(APPEND ADDITIONAL_CMAKE_EXE_LINKER_FLAGS       "/LARGEADDRESSAWARE" )
+  	  list(APPEND ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+	  list(APPEND ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+        endif()
   endif()


FIX: Resolve issues with build on OS X where resources and libs would not get put into the debug app bundles with the _d suffix (but would overwite the release versions), and /all/ versions of the libs could be copied into release versions of the app bundles (without the _d suffix).  Resolves: http://www.cegui.org.uk/mantis/view.php?id=513

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

     if (${_INSTALL_HEADERS} AND UNIX AND NOT APPLE AND NOT WIN32)
-        string (REPLACE "cegui/src" "" _REL_HEADER_DIR ${_REL_SRC_DIR})
+        string (REPLACE "cegui/src/" "" _REL_HEADER_DIR ${_REL_SRC_DIR})
         install(FILES ${${_HEADER_FILES_VAR}} DESTINATION "${CEGUI_INCLUDE_INSTALL_DIR}/${CMAKE_PROJECT_NAME}/${_REL_HEADER_DIR}")
     endif()
 endmacro()
@@ -297,29 +297,41 @@
         set (_ACTIONMSG "copies of")
     endif()

-    file (REMOVE_RECURSE
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources
-    )
-    file (MAKE_DIRECTORY
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources
-    )
+    # depending on the generator used, we need to examine different things to discover the build type
+    if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
+        set(_CEGUI_BUILD_CONFIG ${CMAKE_BUILD_TYPE})
+    else()
+        set(_CEGUI_BUILD_CONFIG "$(CONFIGURATION)")
+    endif()
+
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; rm -rf \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks\"
+        COMMENT "Removing old Frameworks in ${_TARGET_NAME}.app")
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; rm -rf \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources\"
+        COMMENT "Removing old Resources in ${_TARGET_NAME}.app")
+
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; mkdir -p \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks\"
+        COMMENT "Creating Frameworks directory ${_TARGET_NAME}.app")
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; mkdir -p \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources\"
+        COMMENT "Creating Resources directory ${_TARGET_NAME}.app")

     if (NOT ${_STATIC})
         if (NOT CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES)
             add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-                COMMAND ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/dynamic/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks/
+                COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; ce_libglob=\"*${CEGUI_BUILD_SUFFIX}.dylib\"\; else ce_ext=\"\"\; shopt -s extglob\; ce_libglob=\"!\(*${CEGUI_BUILD_SUFFIX}\).dylib\"\; fi\; ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/dynamic/$$ce_libglob \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks/\"
                 COMMENT "Creating ${_ACTIONMSG} dependency libraries in ${_TARGET_NAME}.app")
         endif()

         add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-            COMMAND ${_ACTIONCMD} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks/
+            COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; ce_libglob=\"*${CEGUI_BUILD_SUFFIX}.dylib\"\; else ce_ext=\"\"\; shopt -s extglob\; ce_libglob=\"!\(*${CEGUI_BUILD_SUFFIX}\).dylib\"\; fi\; ${_ACTIONCMD} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$$ce_libglob \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks/\"
             COMMENT "Creating ${_ACTIONMSG} built cegui libraries in ${_TARGET_NAME}.app")
     endif()

     add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-        COMMAND ${_ACTIONCMD} ${CMAKE_SOURCE_DIR}/datafiles ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources/
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; ${_ACTIONCMD} ${CMAKE_SOURCE_DIR}/datafiles \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources/\"
         COMMENT "Creating ${_ACTIONMSG} sample datafiles ${_TARGET_NAME}.app")
 endmacro()


add /opt/local, better output in error case

svn path=/trunk/kdesupport/strigi/; revision=844769

--- cmake/FindCLucene.cmake
+++ cmake/FindCLucene.cmake
@@ -24,6 +24,7 @@
   $ENV{CLUCENE_HOME}/lib${LIB_SUFFIX}
   ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
   /usr/local/lib${LIB_SUFFIX}
+  /opt/local/lib${LIB_SUFFIX}
   /usr/lib${LIB_SUFFIX}
   /sw/lib${LIB_SUFFIX}
   )
@@ -72,6 +73,8 @@
       SET(CLUCENE_GOOD_VERSION FALSE)
 	ENDIF (CLUCENE_VERSION STREQUAL "0.9.17")
   ENDIF (CLMATCH)
+ELSE (CLUCENE_LIBRARY_DIR)
+  MESSAGE(STATUS "CLucene library dir not found.")
 ENDIF (CLUCENE_LIBRARY_DIR)

 IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)


Create tbag_modules__add_rpath() cmake macro.

--- cmake/TbagModules.cmake
+++ cmake/TbagModules.cmake
@@ -45,10 +45,10 @@
     #list (APPEND TBAG_PROJECT_DEFINITIONS  ${__tbag_project_upper_name})
     list  (APPEND TBAG_PROJECT_INCLUDE_DIRS ${TBAG_PROJECT_CONST_DIR_PATH})

-    if (UNIX AND APPLE AND IS_DIRECTORY "${THIRD_PREFIX}")
-        list (APPEND TBAG_PROJECT_LDFLAGS "-Wl,-rpath,${THIRD_PREFIX}/lib"
-                                          "-Wl,-rpath,${THIRD_PREFIX}/Library/Frameworks")
-    endif ()
+    #if (UNIX AND APPLE AND IS_DIRECTORY "${THIRD_PREFIX}")
+    #    list (APPEND TBAG_PROJECT_LDFLAGS "-Wl,-rpath,${THIRD_PREFIX}/lib"
+    #                                      "-Wl,-rpath,${THIRD_PREFIX}/Library/Frameworks")
+    #endif ()
 endmacro ()

 macro (tbag_modules__apply_name __name)
@@ -133,6 +133,12 @@
     list (APPEND TBAG_PROJECT_CXXFLAGS -include ${TbagProjectPCH_COPY_PATH})
 endmacro ()

+macro (tbag_modules__add_rpath __dir)
+    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+        list (APPEND TBAG_PROJECT_LDFLAGS "-Wl,-rpath,${__dir}")
+    endif ()
+endmacro ()
+
 macro (tbag_modules__add_whole_archive __lib_name)
     if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND MSVC_VERSION)
         if (NOT MSVC_VERSION LESS 1900)
@@ -235,7 +241,7 @@
     if (CMAKE_USE_WIN32_THREADS_INIT)
     endif ()
     if (CMAKE_USE_PTHREADS_INIT)
-        list (APPEND TBAG_PROJECT_LDFLAGS -lpthread)
+        list (APPEND TBAG_PROJECT_LDFLAGS -lpthread) # -pthread
     endif ()
     if (CMAKE_HP_PTHREADS_INIT)
     endif ()


fix imgui dependency

fix imgui dependency

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -355,30 +355,34 @@

   # imgui
   elseif(NAME STREQUAL "imgui")
-    if(NOT TARGET imgui)
-      require_external(glfw)
-      external_get_property(glfw INSTALL_DIR)
-
-      if(WIN32)
-        set(IMGUI_LIB "lib/imgui.lib")
-      else()
-        set(IMGUI_LIB "lib/libimgui.a")
-      endif()
-
-      add_external_project(imgui STATIC
-        GIT_REPOSITORY https://github.com/ocornut/imgui.git
-        GIT_TAG 085cff2fe58077a4a0bf1f9e9284814769141801 # docking branch > version "1.82"
-        BUILD_BYPRODUCTS "<INSTALL_DIR>/${IMGUI_LIB}"
-        PATCH_COMMAND ${CMAKE_COMMAND} -E copy
-          "${CMAKE_SOURCE_DIR}/externals/imgui/CMakeLists.txt"
-          "<SOURCE_DIR>/CMakeLists.txt"
-        CMAKE_ARGS
-          -DGLAD_INCLUDE_DIR:PATH=${CMAKE_SOURCE_DIR}/externals/glad/include
-          -DGLFW_INCLUDE_DIR:PATH=${INSTALL_DIR}/include)
-
-      add_external_library(imgui
-        LIBRARY ${IMGUI_LIB})
-    endif()
+    if(TARGET imgui)
+      return()
+    endif()
+
+    require_external(glfw)
+    external_get_property(glfw INSTALL_DIR)
+
+    if(WIN32)
+      set(IMGUI_LIB "lib/imgui.lib")
+    else()
+      set(IMGUI_LIB "lib/libimgui.a")
+    endif()
+
+    add_external_project(imgui STATIC
+      GIT_REPOSITORY https://github.com/ocornut/imgui.git
+      GIT_TAG 085cff2fe58077a4a0bf1f9e9284814769141801 # docking branch > version "1.82"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${IMGUI_LIB}"
+      PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+        "${CMAKE_SOURCE_DIR}/externals/imgui/CMakeLists.txt"
+        "<SOURCE_DIR>/CMakeLists.txt"
+      DEPENDS
+        glfw
+      CMAKE_ARGS
+        -DGLAD_INCLUDE_DIR:PATH=${CMAKE_SOURCE_DIR}/externals/glad/include
+        -DGLFW_INCLUDE_DIR:PATH=${INSTALL_DIR}/include)
+
+    add_external_library(imgui
+      LIBRARY ${IMGUI_LIB})

   # imguizmoquat
   elseif(NAME STREQUAL "imguizmoquat")


print cmake variables

print cmake variables

--- cmake/DetectOpenCV.cmake
+++ cmake/DetectOpenCV.cmake
@@ -70,6 +70,10 @@
     message(STATUS "OpenCV_LIBS=${OpenCV_LIBS}")
     message(STATUS "OpenCV_Libs=${OpenCV_Libs}")
     message(STATUS "OpenCV_LIBRARIES=${OpenCV_LIBRARIES}")
+    message(STATUS "OpenCV_LIBRARY_DIRS=${OpenCV_LIBRARY_DIRS}")
+    message(STATUS "OpenCV_LDFLAGS=${OpenCV_LDFLAGS}")
+    message(STATUS "OpenCV_LDFLAGS_OTHER=${OpenCV_LDFLAGS_OTHER}")
+    message(STATUS "OpenCV_LIBDIR=${OpenCV_LIBDIR}")
     list(APPEND ${ROOT_PROJECT}_LIBS ${OpenCV_LIBS} ${OpenCV_LIBRARIES})

     # Define OpenCV_LIBRARY_DIR if missing


Always enable /bigobj for tests to avoid a compile error in MSVC 2015

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -61,7 +61,7 @@

   ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_FUNC=${testname}")

-  if(MSVC AND NOT EIGEN_SPLIT_LARGE_TESTS)
+  if(MSVC)
     ei_add_target_property(${targetname} COMPILE_FLAGS "/bigobj")
   endif()


fix cuda arch for cuda 6.5

fix cuda arch for cuda 6.5

--- cmake/FindCudaArch.cmake
+++ cmake/FindCudaArch.cmake
@@ -3,7 +3,11 @@

 # Known NVIDIA GPU achitectures Torch can be compiled for.
 # This list will be used for CUDA_ARCH_NAME = All option
-SET(KNOWN_GPU_ARCHITECTURES "2.0 2.1(2.0) 3.0 3.5 5.0 5.2")
+SET(KNOWN_GPU_ARCHITECTURES "2.0 2.1(2.0) 3.0 3.5 5.0")
+
+IF (CUDA_VERSION VERSION_GREATER "6.5")
+   SET(KNOWN_GPU_ARCHITECTURES "${KNOWN_GPU_ARCHITECTURES} 5.2")
+ENDIF (CUDA_VERSION VERSION_GREATER "6.5")

 ################################################################################################
 # Removes duplicates from LIST(s)


Fixed samples install permissions for Debian packaging.

(cherry picked from commit cf852972d1c40ce16a56b8e7d5fbf060716560eb)

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -865,7 +865,7 @@
     file(GLOB sample_files "${samples_path}/*")
     install(FILES ${sample_files}
             DESTINATION ${OPENCV_SAMPLES_SRC_INSTALL_PATH}/${module_id}
-            PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+            PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
   endif()
 endfunction()


CMake: Added line I missed in previous commit (inviwo/inviwo-dev#982 inviwo/inviwo-dev#1068)

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -1007,6 +1007,7 @@
         remove_library_list(uniqueNewLibs "${ARGN}" ${_allLibs})
         set(${ARGN} ${uniqueNewLibs})
         target_link_libraries(${_projectName} ${ARGN})
+        list (APPEND _allLibs ${ARGN})
   endif()

 endmacro()


changed vigra update command

changed vigra update command

--- vigra.cmake
+++ vigra.cmake
@@ -37,7 +37,7 @@
 set(vigra_NAME vigra)

 if("${VIGRA_VERSION}" STREQUAL "master")
-    set(VIGRA_UPDATE_COMMAND git pull)
+    set(VIGRA_UPDATE_COMMAND git checkout master && git pull)
 else()
     set(VIGRA_UPDATE_COMMAND git checkout ${VIGRA_VERSION})
 endif()


Require Boost 1.48 as minimum version

Require Boost 1.48 as minimum version

--- config/IRTKInclude.cmake
+++ config/IRTKInclude.cmake
@@ -22,7 +22,8 @@
 ENDIF (GSL_FOUND)

 # add boost dependencies
-find_package( Boost 1.46 REQUIRED)
+SET(BOOST_MIN_VERSION "1.48")
+find_package( Boost ${BOOST_MIN_VERSION} REQUIRED)

 if ( NOT Boost_FOUND )
 message( STATUS "Boost could not be found." )


Suppress compiler warnings

Suppress compiler warnings

remove no attribute

--- configurecompiler.cmake
+++ configurecompiler.cmake
@@ -485,6 +485,7 @@
     add_compile_options(-Wno-unused-variable)
     add_compile_options(-Wno-unused-but-set-variable)
     add_compile_options(-fms-extensions)
+    add_compile_options(-Wno-unknown-pragmas)
   endif()

   # Some architectures (e.g., ARM) assume char type is unsigned while CoreCLR assumes char is signed


Fix Linux compilation flags (#25801)

Fix Linux compilation flags (#25801)

`configureoptimization.cmake` was being included before `CLR_CMAKE_PLATFORM_UNIX`
was set, though it depends on that variable to set Linux optimization
flags. Move the include lower, after `CLR_CMAKE_PLATFORM_UNIX` is set.

This leads to Debug builds being built with `-O0` and Checked builds built
with `-O2`, instead of the default due to no `-O` flag being passed. Release
is still built `-O3`; somehow, it was being built that way already.

Fixes #25273 (Although Alpine will still see a stack overflow in the failing
test case with Debug builds, it won't affect Checked build CI runs, which is
the primary flavor tested in coreclr CI.)

--- configurecompiler.cmake
+++ configurecompiler.cmake
@@ -10,8 +10,6 @@
 set(CLR_DEFINES_CHECKED_INIT            DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
 set(CLR_DEFINES_RELEASE_INIT            NDEBUG URTBLDENV_FRIENDLY=Retail)
 set(CLR_DEFINES_RELWITHDEBINFO_INIT     NDEBUG URTBLDENV_FRIENDLY=Retail)
-
-include(${CMAKE_CURRENT_LIST_DIR}/configureoptimization.cmake)

 #----------------------------------------
 # Detect and set platform variable names
@@ -113,6 +111,9 @@
   set(CLR_CMAKE_PLATFORM_SUNOS 1)
 endif(CMAKE_SYSTEM_NAME STREQUAL SunOS)

+# "configureoptimization.cmake" must be included after CLR_CMAKE_PLATFORM_UNIX has been set.
+include(${CMAKE_CURRENT_LIST_DIR}/configureoptimization.cmake)
+
 #--------------------------------------------
 # This repo builds two set of binaries
 # 1. binaries which execute on target arch machine


Minor system.cmake tweak

Minor system.cmake tweak

--- System.cmake
+++ System.cmake
@@ -9,3 +9,6 @@
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
   set(SYSTEM Linux)
 endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
+if(NOT SYSTEM)
+  message(FATAL_ERROR "Unable to determine OS")
+endif()


Removed EAGLE_ADD_ON dependency

Removed EAGLE_ADD_ON dependency

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

--- cmake/configs/qurt_eagle_release.cmake
+++ cmake/configs/qurt_eagle_release.cmake
@@ -1,10 +1,10 @@
 include(qurt/px4_impl_qurt)

-if ("$ENV{EAGLE_ADDON_ROOT}" STREQUAL "")
-	message(FATAL_ERROR "Enviroment variable EAGLE_ADDON_ROOT must be set")
-else()
-	set(EAGLE_ADDON_ROOT $ENV{EAGLE_ADDON_ROOT})
-endif()
+#if ("$ENV{EAGLE_ADDON_ROOT}" STREQUAL "")
+#	message(FATAL_ERROR "Enviroment variable EAGLE_ADDON_ROOT must be set")
+#else()
+#	set(EAGLE_ADDON_ROOT $ENV{EAGLE_ADDON_ROOT})
+#endif()

 if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
 	message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
@@ -21,8 +21,12 @@
 STRING(REGEX REPLACE "//" "/" EAGLE_DRIVERS_SRC ${EAGLE_DRIVERS_SRC})
 STRING(REGEX REPLACE "/" "__" EAGLE_DRIVERS_MODULE_PREFIX ${EAGLE_DRIVERS_SRC})

-include_directories(${EAGLE_ADDON_ROOT}/flight_controller/hexagon/inc)
-include_directories(${HEXAGON_SDK_ROOT}/lib/common/qurt/ADSPv5MP/include)
+#include_directories(${EAGLE_ADDON_ROOT}/flight_controller/hexagon/inc)
+include_directories(
+	${HEXAGON_SDK_ROOT}/inc
+	${HEXAGON_SDK_ROOT}/inc/stddef
+	${HEXAGON_SDK_ROOT}/lib/common/qurt/ADSPv5MP/include
+	)

 message("hexagon_sdk_root is ${HEXAGON_SDK_ROOT}")

@@ -30,9 +34,9 @@

 set(CONFIG_SHMEM "1")

+#-L${EAGLE_ADDON_ROOT}/flight_controller/hexagon/libs
 # For Actual flight we need to link against the driver dynamic libraries
 set(target_libraries
-	-L${EAGLE_ADDON_ROOT}/flight_controller/hexagon/libs
 	mpu9x50
 	uart_esc
 	csr_gps
@@ -54,10 +58,10 @@
 	#
 	drivers/device
 	modules/sensors
-	${EAGLE_DRIVERS_SRC}/mpu9x50
+	#${EAGLE_DRIVERS_SRC}/mpu9x50
 	${EAGLE_DRIVERS_SRC}/uart_esc
-	${EAGLE_DRIVERS_SRC}/rc_receiver
-	${EAGLE_DRIVERS_SRC}/csr_gps
+	#${EAGLE_DRIVERS_SRC}/rc_receiver
+	#${EAGLE_DRIVERS_SRC}/csr_gps

 	#
 	# System commands


Perform auto-load sanity checks only if the module is actually enabled.

--- CMake/mitkFunctionCreateModule.cmake
+++ CMake/mitkFunctionCreateModule.cmake
@@ -180,14 +180,6 @@
     endforeach()
   endif()

-  # check and set-up auto-loading
-  if(MODULE_AUTOLOAD_WITH)
-    set(_module_autoload_meta_target "${MODULE_AUTOLOAD_WITH}-autoload")
-    if(NOT TARGET "${MODULE_AUTOLOAD_WITH}")
-      message(SEND_ERROR "The module target \"${MODULE_AUTOLOAD_WITH}\" specified as the auto-loading module for \"${MODULE_NAME}\" does not exist")
-    endif()
-  endif()
-
   # assume worst case
   set(MODULE_IS_ENABLED 0)
   # first we check if we have an explicit module build list
@@ -240,6 +232,14 @@
         set(Q${KITNAME}_GENERATED_MOC_CPP )
         set(Q${KITNAME}_GENERATED_QRC_CPP )
         set(Q${KITNAME}_GENERATED_UI_CPP )
+
+        # check and set-up auto-loading
+        if(MODULE_AUTOLOAD_WITH)
+          set(_module_autoload_meta_target "${MODULE_AUTOLOAD_WITH}-autoload")
+          if(NOT TARGET "${MODULE_AUTOLOAD_WITH}")
+            message(SEND_ERROR "The module target \"${MODULE_AUTOLOAD_WITH}\" specified as the auto-loading module for \"${MODULE_NAME}\" does not exist")
+          endif()
+        endif()

         # Convert relative include dirs to absolute dirs
         set(_include_dirs . ${MODULE_INCLUDE_DIRS})


restore windows boost to static

restore windows boost to static

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@2408 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -6,8 +6,8 @@
 # remain generic.

 macro (configure_boost)
-    if (MSVC OR APPLE)
-        set (Boost_USE_STATIC_LIBS OFF)
+    if (MSVC)
+        set (Boost_USE_STATIC_LIBS ON)
     else ()
         set (Boost_USE_STATIC_LIBS OFF)
     endif ()


update libs needed by communication module, setting up the appropriate gstreamer libs

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1915 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -206,7 +206,7 @@
 macro (configure_telepathy_qt4)
     sagase_configure_package (TELEPATHY_QT4
         NAMES QtTelepathy Telepathy-QT4 telepathy-qt4 TelepathyQt4
-        COMPONENTS QtTelepathyCore QtTelepathyCommon QtTelepathyClient telepathy-qt4 connection # connection added here to help sagase to find include folder with connection.h file
+        COMPONENTS QtTelepathyCore QtTelepathyCommon QtTelepathyClient telepathy-qt4 telepathy-qt4-farsight connection # connection added here to help sagase to find include folder with connection.h file
         PREFIXES ${ENV_NAALI_DEP_PATH} )
     sagase_configure_report (TELEPATHY_QT4)
 endmacro (configure_telepathy_qt4)
@@ -214,7 +214,7 @@
 macro (configure_gstreamer)
     sagase_configure_package (GSTREAMER
         NAMES gstreamer gst gstreamer-0.10
-        COMPONENTS libavcodec libavformat libavutil libgstapp-0.10 libgstaudio-0.10 libgstbase-0.10 libgstcontroller-0.10 ibgstdataprotocol-0.10 libgstdshow-0.10 libgstinterfaces-0.10 libgstnet-0.10 libgstnetbuffer-0.10 libgstpbutils-0.10 libgstriff-0.10 libgstreamer-0.10 libgstrtp-0.10 libgstrtsp-0.10 libgstsdp-0.10 libgsttag-0.10 libgstvideo-0.10 libjpeg-static libjpeg gst # gst added to help sagese to find include folder with gst.h file
+        COMPONENTS gstreamer gstfarsight gstinterfaces gst # gst added to help sagese to find include folder with gst.h file
         PREFIXES ${ENV_NAALI_DEP_PATH})
     sagase_configure_report (GSTREAMER)
 endmacro (configure_gstreamer)


cmake: reformat

cmake: reformat

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

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


CMake: Fix link interface for static blas/lapack

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@29966 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/configure/configure_1_lapack.cmake
+++ deal.II/cmake/configure/configure_1_lapack.cmake
@@ -18,6 +18,20 @@

 MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
   FIND_PACKAGE(LAPACK)
+
+  #
+  # Well, in case of static archives we have to manually pick up the
+  # complete link interface. *sigh*
+  #
+  # Do this unconditionally for the most common case:
+  # TODO: Non-GNU setups...
+  #
+  IF(NOT m_lib MATCHES "-NOTFOUND")
+    LIST(APPEND LAPACK_LIBRARIES ${m_lib})
+  ENDIF()
+
+  ENABLE_IF_LINKS(LAPACK_LINKER_FLAGS "-lgfortran")
+  ENABLE_IF_LINKS(LAPACK_LINKER_FLAGS "-lquadmath")

   IF(LAPACK_FOUND)
     MARK_AS_ADVANCED(
@@ -52,15 +66,6 @@

 MACRO(CHECK_FOR_LAPACK_FUNCTIONS)
   SET(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
-  #
-  # For some static lapack versions it is necessary to link with -lm.
-  # So link with it as well if -lm is already present in our link
-  # interface:
-  #
-  IF(NOT m_lib MATCHES "-NOTFOUND")
-    LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${m_lib})
-  ENDIF()
-
   ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")

   FOREACH(_func ${DEAL_II_LAPACK_FUNCTIONS})


removed unused stuff from cmake dependency file

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -36,72 +36,6 @@
   set(CMAKE_C_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-Xcompiler ${CMAKE_C_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}" )
   set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-Xcompiler ${CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}" )
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch sm_35")
-endif()
-
-# Test dependencies
-if(BUILD_TEST)
-  if(NOT DEPENDENCIES_FORCE_DOWNLOAD)
-    find_package(GTest QUIET)
-  endif()
-  if(NOT GTEST_FOUND)
-    message(STATUS "GTest not found. Downloading and building GTest.")
-    set(GTEST_ROOT ${CMAKE_CURRENT_BINARY_DIR}/gtest CACHE PATH "")
-    download_project(PROJ        googletest
-             GIT_REPOSITORY      https://github.com/google/googletest.git
-             GIT_TAG             master
-             INSTALL_DIR         ${GTEST_ROOT}
-             CMAKE_ARGS          -DBUILD_GTEST=ON -DINSTALL_GTEST=ON -Dgtest_force_shared_crt=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-             LOG_DOWNLOAD        TRUE
-             LOG_CONFIGURE       TRUE
-             LOG_BUILD           TRUE
-             LOG_INSTALL         TRUE
-             BUILD_PROJECT       TRUE
-             UPDATE_DISCONNECTED TRUE
-    )
-  endif()
-  find_package(GTest REQUIRED)
-  # Download some test matrices
-  set(TEST_MATRICES
-    nos1
-    nos2
-    nos3
-    nos4
-    nos5
-    nos6
-    nos7
-  )
-  foreach(m ${TEST_MATRICES})
-    if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/matrices/${m}.mtx")
-      file(DOWNLOAD ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/lanpro/${m}.mtx.gz
-           ${CMAKE_CURRENT_BINARY_DIR}/matrices/${m}.mtx.gz)
-      execute_process(COMMAND gzip -d -f ${m}.mtx.gz
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/matrices)
-    endif()
-  endforeach()
-endif()
-
-# Benchmark dependencies
-if(BUILD_BENCHMARK)
-  if(NOT DEPENDENCIES_FORCE_DOWNLOAD)
-    find_package(benchmark QUIET)
-  endif()
-  if(NOT benchmark_FOUND)
-    message(STATUS "Google Benchmark not found. Downloading and building Google Benchmark.")
-    set(GOOGLEBENCHMARK_ROOT ${CMAKE_CURRENT_BINARY_DIR}/googlebenchmark CACHE PATH "")
-    download_project(PROJ        googlebenchmark
-             GIT_REPOSITORY      https://github.com/google/benchmark.git
-             GIT_TAG             master
-             INSTALL_DIR         ${GOOGLEBENCHMARK_ROOT}
-             CMAKE_ARGS          -DCMAKE_BUILD_TYPE=RELEASE -DBENCHMARK_ENABLE_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-             LOG_DOWNLOAD        TRUE
-             LOG_CONFIGURE       TRUE
-             LOG_BUILD           TRUE
-             LOG_INSTALL         TRUE
-             BUILD_PROJECT       TRUE
-             UPDATE_DISCONNECTED TRUE
-    )
-  endif()
-  find_package(benchmark REQUIRED CONFIG PATHS ${GOOGLEBENCHMARK_ROOT})
 endif()

 # rocPRIM package


Fix comment

Fix comment

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -32,7 +32,7 @@
 find_package(OpenEXR REQUIRED)

 if(NOT APPLE)
-    # Apple has these available macos repo
+    # Apple has these available hardcoded and matched in macos repo, see Config_OSX.cmake
     find_package(TIFF REQUIRED)
     find_package(JPEG REQUIRED)
     find_package(PNG REQUIRED)


ENH: Added retry for failed download on windows

--- cmake/ExternalData.cmake
+++ cmake/ExternalData.cmake
@@ -1003,15 +1003,18 @@

   if(found)
     file(RENAME "${tmp}" "${obj}")
+	set(obj_downloaded 1 PARENT_SCOPE)
     message(STATUS "Downloaded object: \"${obj}\"")
   elseif(EXISTS "${staged}")
     set(obj "${staged}")
+	set(obj_downloaded 1 PARENT_SCOPE)
     message(STATUS "Staged object: \"${obj}\"")
   else()
     if(NOT tried)
       set(tried "\n  (No ExternalData_URL_TEMPLATES given)")
     endif()
-    message(FATAL_ERROR "Object ${algo}=${hash} not found at:${tried}")
+	set(obj_downloaded 0 PARENT_SCOPE)
+    #message(FATAL_ERROR "Object ${algo}=${hash} not found at:${tried}")
   endif()

   set("${var_obj}" "${obj}" PARENT_SCOPE)
@@ -1033,8 +1036,16 @@
     message(FATAL_ERROR "Unknown hash algorithm extension \"${ext}\"")
   endif()

-  _ExternalData_download_object("${name}" "${hash}" "${algo}" obj)
-
+  set(obj_downloaded 0)
+  set(retry 3)
+  while(retry)
+    math(EXPR retry "${retry} - 1")
+	_ExternalData_download_object("${name}" "${hash}" "${algo}" obj)
+	if(${obj_downloaded})
+	  break()
+	endif()
+  endwhile()
+
   # Check if file already corresponds to the object.
   set(stamp "${ext}-stamp")
   set(file_up_to_date 0)


l10n script todo markers

l10n script todo markers

--- cmake/scripts/l10n.cmake
+++ cmake/scripts/l10n.cmake
@@ -214,39 +214,45 @@
         # Interpreter mode, extract messages to pot file, generate or
         # merge po files for translation, compile mo files
         message(STATUS "Interpreter mode - extract strings, generate po files")
-    set(XGETTEXT_OPTIONS ${OPTIONS})
-
-    if (PACKAGE)
-        list(APPEND XGETTEXT_OPTIONS --package-name=${PACKAGE})
-    endif()
-    if (PACKAGE_VERSION)
-        list(APPEND XGETTEXT_OPTIONS --package-version=${PACKAGE_VERSION})
-    endif()
-    if (COPYRIGHT)
-        list(APPEND XGETTEXT_OPTIONS --copyright-holder=${COPYRIGHT})
-    else()
-        list(APPEND XGETTEXT_OPTIONS --foreign-user)
-    endif()
-    if (BUGS)
-        list(APPEND XGETTEXT_OPTIONS --msgid-bugs-address=${BUGS})
-    endif()
-
-    add_custom_command(
-        OUTPUT ${out_file_name}
-        DEPENDS ${PROGRAM} ${SOURCES}
-        COMMENT "Extract strings for localization in domain ${DOMAIN}"
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        COMMAND ${PROGRAM} ${XGETTEXT_OPTIONS} -o ${out_file_name} ${SOURCES}
-    )
-    set(l10n_target "${DOMAIN}.l10n")
-        add_custom_target(
-            ${l10n_target} ALL
-            DEPENDS ${out_file_name})
-    if(TARGET)
-        add_dependencies(${TARGET} ${l10n_target})
-    endif()
+        set(XGETTEXT_OPTIONS ${OPTIONS})
+
+        if (PACKAGE)
+            list(APPEND XGETTEXT_OPTIONS --package-name=${PACKAGE})
+        endif()
+        if (PACKAGE_VERSION)
+            list(APPEND XGETTEXT_OPTIONS --package-version=${PACKAGE_VERSION})
+        endif()
+        if (COPYRIGHT)
+            list(APPEND XGETTEXT_OPTIONS --copyright-holder=${COPYRIGHT})
+        else()
+            list(APPEND XGETTEXT_OPTIONS --foreign-user)
+        endif()
+        if (BUGS)
+            list(APPEND XGETTEXT_OPTIONS --msgid-bugs-address=${BUGS})
+        endif()
+
+        # TODO Generate a list of sources with paths relative to pot file
+        # for correct references in the
+        # TODO Check if file exists and merge existing
+        add_custom_command(
+            OUTPUT ${out_file_name}
+            DEPENDS ${PROGRAM} ${SOURCES}
+            COMMENT "Extract strings for localization in domain ${DOMAIN}"
+            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+            COMMAND ${PROGRAM} ${XGETTEXT_OPTIONS} -o ${out_file_name} ${SOURCES}
+        )
+        set(l10n_target "${DOMAIN}.l10n")
+            add_custom_target(
+                ${l10n_target} ALL
+                DEPENDS ${out_file_name})
+        if(TARGET)
+            add_dependencies(${TARGET} ${l10n_target})
+        endif()
+        if (TEST_TRANSLATION)
+            enable_testing()
+        endif()
         msgmerge(${DOMAIN} ${out_file_name} INSTALL ${INSTALL} TEST_TRANSLATION ${TEST_TRANSLATION})
-    add_dependencies(${PACKAGE}.i18n ${l10n_target})
+        add_dependencies(${PACKAGE}.i18n ${l10n_target})
     endif()

     if (NOT L10N_DOMAINS)


SVN_SILENT made messages (.desktop file)

--- ds9/ds9.desktop.cmake
+++ ds9/ds9.desktop.cmake
@@ -13,7 +13,7 @@
 Name[ca@valencia]=DirectShow9
 Name[cs]=DirectShow9
 Name[da]=DirectShow9
-Name[de]=DirectShow9
+Name[de]=DirectShow 9
 Name[es]=DirectShow9
 Name[et]=DirectShow9
 Name[hu]=DirectShow9
@@ -38,7 +38,7 @@
 Comment[ca@valencia]=Dorsal DirectShow9 del Phonon
 Comment[cs]=Podpůrná vrstva DirectShow9 pro Phonon
 Comment[da]=Phonon DirectShow9-motor
-Comment[de]=Phonon-Treiber für DirectShow9
+Comment[de]=Phonon-Back-End für DirectShow 9
 Comment[es]=Motor DirectShow9 para Phonon
 Comment[et]=Phononi DirectShow9 taustaprogramm
 Comment[hu]=Phonon DirectShow9-modul


address review comments

address review comments

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- common/cmake/litex.cmake
+++ common/cmake/litex.cmake
@@ -44,10 +44,6 @@
     "${ARGN}"
   )

-  # Create a dependency list
-
-  # sv2v conversion
-
   set(NAME ${ADD_LITEX_TEST_NAME})
   set(LITEX_DIR ${ADD_LITEX_TEST_LITEX_DIR})
   set(LITEX_BOARD ${ADD_LITEX_TEST_LITEX_BOARD})
@@ -63,8 +59,11 @@

   list(TRANSFORM LITEX_SOURCES PREPEND ${LITEX_GATEWARE})

+  set(DEPS "")
   append_file_dependency(DEPS ${GENERATE_SCRIPT})
   append_file_dependency(DEPS ${FIXUP_SCRIPT})
+
+  get_target_property_required(PYTHON3 env PYTHON3)

   add_custom_command(
     OUTPUT ${LITEX_SOURCES}


Support MSVC 2015 and later.

Support MSVC 2015 and later.

--- FindFBX.cmake
+++ FindFBX.cmake
@@ -52,22 +52,16 @@
 endif()

 function(_fbx_find_library _name _lib _suffix)
-    if(MSVC12)
-        set(VS_PREFIX vs2013)
-    endif()
-    if(MSVC11)
-        set(VS_PREFIX vs2012)
-    endif()
-    if(MSVC10)
-        set(VS_PREFIX vs2010)
-    endif()
-    if(MSVC90)
-        set(VS_PREFIX vs2008)
+    if(MSVC_VERSION VERSION_GREATER_EQUAL 1900)
+        set(VS_PREFIX vs2015)
     endif()
     find_library(${_name}
         NAMES ${_lib}
         HINTS ${FBX_SEARCH_LOCATIONS}
-        PATH_SUFFIXES lib/${fbx_compiler}/release lib/${fbx_compiler}/ub/${_suffix} lib/${VS_PREFIX}/x64/${_suffix}
+        PATH_SUFFIXES
+            lib/${fbx_compiler}/release
+            lib/${fbx_compiler}/ub/${_suffix}
+            lib/${VS_PREFIX}/x64/${_suffix}
     )
     mark_as_advanced(${_name})
 endfunction()


SK:

SK:

-BUG: Make sure the dox is also checked for updates during testing

--- src/Testing/Dashboard/elxDashboardCommon.cmake
+++ src/Testing/Dashboard/elxDashboardCommon.cmake
@@ -85,6 +85,9 @@
     AND CTEST_UPDATE_COMMAND)
   set( CTEST_CHECKOUT_COMMAND "\"${CTEST_UPDATE_COMMAND}\" co --username elastixguest --password elastixguest \"${dashboard_url}\" ." )
 endif()
+
+# Also check the dox directory for updates, not only the src directory.
+SET( CTEST_EXTRA_UPDATES_1 "${CTEST_DASHBOARD_ROOT}/dox" )

 # Send the main script as a note, and this script
 list( APPEND CTEST_NOTES_FILES


CI: enable strict mode by default

CI: enable strict mode by default

--- ci-build.cmake
+++ ci-build.cmake
@@ -83,6 +83,7 @@
 execute_process(COMMAND cmake
     -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
     -DOGRE_BUILD_TESTS=ON
+    -DOGRE_RESOURCEMANAGER_STRICT=ON
     -DOGRE_BUILD_DEPENDENCIES=${BUILD_DEPS}
     -DSWIG_EXECUTABLE=/usr/bin/swig3.0
     ${RENDERSYSTEMS}


cmake: Remove support for CMake < 2.8.3

cmake: Remove support for CMake < 2.8.3


FindMagnum: don't expose internal ${COMPONENT}_INCLUDE_DIR to users.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -147,6 +147,9 @@
         find_path(_MAGNUM_${_COMPONENT}_INCLUDE_DIR
             NAMES ${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES}
             PATHS ${MAGNUM_INCLUDE_DIR}/${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX})
+
+        # Don't expose this variable to end users
+        mark_as_advanced(FORCE _MAGNUM_${_COMPONENT}_INCLUDE_DIR)
     endif()

     # Decide if the library was found


COMP: Fix VariationalRegistration for future const GetMacro support

Minor const adherance needed for compiling with
future removal of deprecated interfaces.

Change-Id: Ie266a0e5a65705b6364cd80f7f244eb18d65a74c

--- Modules/Remote/VariationalRegistration.remote.cmake
+++ Modules/Remote/VariationalRegistration.remote.cmake
@@ -5,5 +5,5 @@
 itk_fetch_module(VariationalRegistration
   "A module to perform variational image registration. https://hdl.handle.net/10380/3460"
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKVariationalRegistration.git
-  GIT_TAG 5110f1b4304f450b46bbbaf0f3818a4bac65b154
+  GIT_TAG 5c6fb14e84ad27a38d1a794f0b279ad3190484b3
   )


Add C++11 to common.cmake

Add C++11 to common.cmake

--- common.cmake
+++ common.cmake
@@ -12,6 +12,7 @@
     add_definitions("/W2")
 else()
     add_definitions("-Wall -Wextra")
+    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 -stdlib=libc++")
 endif()

 if(TODO MATCHES "ON")


Fix doxygit script invokation

Fix doxygit script invokation

--- Doxygit.cmake
+++ Doxygit.cmake
@@ -119,9 +119,11 @@
 execute_process(COMMAND "${GIT_EXECUTABLE}" add images ${ENTRIES}
     WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")

-foreach(FOLDER ${GIT_DOCUMENTATION_INSTALL})
-  install(DIRECTORY ${FOLDER} DESTINATION share/${CMAKE_PROJECT_NAME}
+if(VERSION_MAJOR) # hack to detect that not invoked as script
+  foreach(FOLDER ${GIT_DOCUMENTATION_INSTALL})
+    install(DIRECTORY ${FOLDER} DESTINATION share/${CMAKE_PROJECT_NAME}
+      CONFIGURATIONS Release)
+  endforeach()
+  install(FILES index.html DESTINATION share/${CMAKE_PROJECT_NAME}
     CONFIGURATIONS Release)
-endforeach()
-install(FILES index.html DESTINATION share/${CMAKE_PROJECT_NAME}
-  CONFIGURATIONS Release)
+endif()


Reverted default BN precision.

Reverted default BN precision.

--- cmake/bn.cmake
+++ cmake/bn.cmake
@@ -1,6 +1,6 @@
 message(STATUS "Multiple precision arithmetic configuration (BN module):\n")

-message("   ** Options for the multiple precision module (default = 1024,DOUBLE,0):")
+message("   ** Options for the multiple precision module (default = 256,DOUBLE,0):")
 message("      BN_PRECI=n        The base precision in bits. Let w be n in words.")
 message("      BN_MAGNI=DOUBLE   A multiple precision integer can store 2w words.")
 message("      BN_MAGNI=CARRY    A multiple precision integer can store w+1 words.")
@@ -36,7 +36,7 @@

 # Choose the arithmetic precision.
 if (NOT BN_PRECI)
-	set(BN_PRECI 1024)
+	set(BN_PRECI 256)
 endif(NOT BN_PRECI)
 set(BN_PRECI ${BN_PRECI} CACHE INTEGER "Arithmetic precision in bits")


Workaround to handle new release numbering since 4.9.1

--- FindICU.cmake
+++ FindICU.cmake
@@ -154,8 +154,19 @@
     endif()

     string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MAJOR_NUM *([0-9]+).*" "\\1" ICU_MAJOR_VERSION "${_icu_contents}")
-    string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ICU_MINOR_VERSION "${_icu_contents}")
-    string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ICU_PATCH_VERSION "${_icu_contents}")
+    #
+    # From 4.9.1, ICU release version numbering was totaly changed, see:
+    # - http://site.icu-project.org/download/49
+    # - http://userguide.icu-project.org/design#TOC-Version-Numbers-in-ICU
+    #
+    if(ICU_MAJOR_VERSION LESS 49)
+        string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ICU_MINOR_VERSION "${_icu_contents}")
+        string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ICU_PATCH_VERSION "${_icu_contents}")
+    else(ICU_MAJOR_VERSION LESS 49)
+        string(REGEX MATCH [0-9]$ ICU_MINOR_VERSION "${ICU_MAJOR_VERSION}")
+        string(REGEX REPLACE [0-9]$ "" ICU_MAJOR_VERSION "${ICU_MAJOR_VERSION}")
+        string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ICU_PATCH_VERSION "${_icu_contents}")
+    endif(ICU_MAJOR_VERSION LESS 49)
     set(ICU_VERSION "${ICU_MAJOR_VERSION}.${ICU_MINOR_VERSION}.${ICU_PATCH_VERSION}")
 endif(ICU_FOUND)


Fix FindDBXML.

Fix FindDBXML.

--- cmake/FindDBXML.cmake
+++ cmake/FindDBXML.cmake
@@ -1,17 +1,11 @@
-# Find the Oracle Berkeley DB XML library and its requirements
+# Find the Oracle Berkeley DB XML library

-find_path(DBXML_INCLUDE_DIR names dbxml/DbXml.hpp)
+find_path(DBXML_INCLUDE_DIR NAMES dbxml/DbXml.hpp)

-find_library(XQILLA_LIBRARY NAMES xqilla)
-find_library(XERCES_LIBRARY NAMES xerces-c)
 find_library(DBXML_LIBRARY NAMES dbxml)
-find_library(DBCXX_LIBRARY NAMES db_cxx)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(DBXML DEFAULT_MSG
                                   DBXML_INCLUDE_DIR DBXML_LIBRARY)
-find_package_handle_standard_args(DBCXX DEFAULT_MSG DBCXX_LIBRARY)
-find_package_handle_standard_args(XERCES DEFAULT_MSG XERCES_LIBRARY)
-find_package_handle_standard_args(XQILLA DEFAULT_MSG XQILLA_LIBRARY)

-mark_as_advanced(DBXML_LIBRARIES)
+mark_as_advanced(DBXML_INCLUDE_DIR DBXML_LIBRARY)


Add default Eigen install location on Windows to search paths.

Change-Id: If2e9999b04550269c94a86b8512d9dcc2842b91d

--- cmake/FindEigen.cmake
+++ cmake/FindEigen.cmake
@@ -87,28 +87,22 @@
 #
 # TODO: Add standard Windows search locations for Eigen.
 LIST(APPEND EIGEN_CHECK_INCLUDE_DIRS
-  /usr/local/include/eigen3
-  /usr/local/homebrew/include/eigen3 # Mac OS X
-  /opt/local/var/macports/software/eigen3 # Mac OS X.
-  /opt/local/include/eigen3
-  /usr/include/eigen3)
+  /usr/local/include
+  /usr/local/homebrew/include # Mac OS X
+  /opt/local/var/macports/software # Mac OS X.
+  /opt/local/include
+  /usr/include)
+# Additional suffixes to try appending to each search path.
+LIST(APPEND EIGEN_CHECK_PATH_SUFFIXES
+  eigen3 # Default root directory for Eigen.
+  Eigen/include/eigen3 ) # Windows (for C:/Program Files prefix).

 # Search supplied hint directories first if supplied.
 FIND_PATH(EIGEN_INCLUDE_DIR
   NAMES Eigen/Core
   PATHS ${EIGEN_INCLUDE_DIR_HINTS}
-  ${EIGEN_CHECK_INCLUDE_DIRS})
-IF (NOT EIGEN_INCLUDE_DIR)
-  # Handle case where user / CMAKE_PREFIX_PATH does not specify the
-  # required eigen3 subdirectory, prepend it to search target and retry.
-  FIND_PATH(EIGEN_INCLUDE_DIR
-    NAMES eigen3/Eigen/Core
-    PATHS ${EIGEN_INCLUDE_DIR_HINTS}
-    ${EIGEN_CHECK_INCLUDE_DIRS})
-  IF (EIGEN_INCLUDE_DIR AND EXISTS ${EIGEN_INCLUDE_DIR})
-    UPDATE_CACHE_VARIABLE(EIGEN_INCLUDE_DIR "${EIGEN_INCLUDE_DIR}/eigen3")
-  ENDIF (EIGEN_INCLUDE_DIR AND EXISTS ${EIGEN_INCLUDE_DIR})
-ENDIF(NOT EIGEN_INCLUDE_DIR)
+  ${EIGEN_CHECK_INCLUDE_DIRS}
+  PATH_SUFFIXES ${EIGEN_CHECK_PATH_SUFFIXES})

 IF (NOT EIGEN_INCLUDE_DIR OR
     NOT EXISTS ${EIGEN_INCLUDE_DIR})


Issue #72 - custom implementation of FFTW find module to avoid license conflicts

--- cmake/FindFFTW3.cmake
+++ cmake/FindFFTW3.cmake
@@ -1,94 +1,27 @@
-# - Try to find FFTW3.
-# Usage: find_package(FFTW3 [COMPONENTS [single double long-double threads]])
-#
-# Variables used by this module:
-#  FFTW3_ROOT_DIR             - FFTW3 root directory
-# Variables defined by this module:
-#  FFTW3_FOUND                - system has FFTW3
-#  FFTW3_INCLUDE_DIR          - the FFTW3 include directory (cached)
-#  FFTW3_INCLUDE_DIRS         - the FFTW3 include directories
-#                               (identical to FFTW3_INCLUDE_DIR)
-#  FFTW3[FL]?_LIBRARY         - the FFTW3 library - double, single(F),
-#                               long-double(L) precision (cached)
-#  FFTW3[FL]?_THREADS_LIBRARY - the threaded FFTW3 library - double, single(F),
-#                               long-double(L) precision (cached)
-#  FFTW3_LIBRARIES            - list of all FFTW3 libraries found
+# Module that searches for the FFTW3 lib

-# Copyright (C) 2009-2010
-# ASTRON (Netherlands Institute for Radio Astronomy)
-# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-#
-# This file is part of the LOFAR software suite.
-# The LOFAR software suite is free software: you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# The LOFAR software suite is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-#
-# $Id: FindFFTW3.cmake 15918 2010-06-25 11:12:42Z loose $
+# Steps to use this module
+# 1) Set FFTW3_ROOT_DIR variable to the path where FFTW3 is located (if necessary)
+# 2) Call find_package(FFTW3) where needed
+# 3) Use the variables that are set by the module:
+#  a) FFTW3_FOUND
+#  b) FFTW3_INCLUDE_DIR
+#  c) FFTW3_LIBRARIES

-# Use double precision by default.
-if(FFTW3_FIND_COMPONENTS MATCHES "^$")
-  set(_components double)
-else()
-  set(_components ${FFTW3_FIND_COMPONENTS})
-endif()
+find_path(
+    FFTW3_INCLUDE_DIR fftw3.h
+    HINTS ${FFTW3_ROOT_DIR}
+    PATH_SUFFIXES include
+)

-# Loop over each component.
-set(_libraries)
-foreach(_comp ${_components})
-  if(_comp STREQUAL "single")
-    list(APPEND _libraries fftw3f)
-  elseif(_comp STREQUAL "double")
-    list(APPEND _libraries fftw3)
-  elseif(_comp STREQUAL "long-double")
-    list(APPEND _libraries fftw3l)
-  elseif(_comp STREQUAL "threads")
-    set(_use_threads ON)
-  else(_comp STREQUAL "single")
-    message(FATAL_ERROR "FindFFTW3: unknown component `${_comp}' specified. "
-      "Valid components are `single', `double', `long-double', and `threads'.")
-  endif(_comp STREQUAL "single")
-endforeach(_comp ${_components})
+find_library(
+    FFTW3_LIBRARIES
+    NAMES fftw3 libfftw3.a libfftw3-3.a libfftw3-3
+    HINTS ${FFTW3_ROOT_DIR}
+    PATH_SUFFIXES lib
+)

-# If using threads, we need to link against threaded libraries as well.
-if(_use_threads)
-  set(_thread_libs)
-  foreach(_lib ${_libraries})
-    list(APPEND _thread_libs ${_lib}_threads)
-  endforeach(_lib ${_libraries})
-  set(_libraries ${_thread_libs} ${_libraries})
-endif(_use_threads)
-
-# Keep a list of variable names that we need to pass on to
-# find_package_handle_standard_args().
-set(_check_list)
-
-# Search for all requested libraries.
-foreach(_lib ${_libraries})
-  string(TOUPPER ${_lib} _LIB)
-  find_library(${_LIB}_LIBRARY
-    NAMES lib${_lib}.a ${_lib} lib${_lib}-3.a ${_lib} lib${_lib}-3
-    HINTS ${FFTW3_ROOT_DIR} PATH_SUFFIXES lib)
-  mark_as_advanced(${_LIB}_LIBRARY)
-  list(APPEND FFTW3_LIBRARIES ${${_LIB}_LIBRARY})
-  list(APPEND _check_list ${_LIB}_LIBRARY)
-endforeach(_lib ${_libraries})
-
-# Search for the header file.
-find_path(FFTW3_INCLUDE_DIR fftw3.h
-  HINTS ${FFTW3_ROOT_DIR} PATH_SUFFIXES include)
-mark_as_advanced(FFTW3_INCLUDE_DIR)
-list(APPEND _check_list FFTW3_INCLUDE_DIR)
-
-# Handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
-# all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(FFTW3 DEFAULT_MSG ${_check_list})
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW3 DEFAULT_MSG
+    FFTW3_LIBRARIES FFTW3_INCLUDE_DIR
+)


Ignore if LIBAV_ROOT_DIR was not found

Ignore if LIBAV_ROOT_DIR was not found

--- cmake/FindLibAV.cmake
+++ cmake/FindLibAV.cmake
@@ -24,6 +24,7 @@
 # Copyright (c) 2013 Sergiu Dotenco
 # Changed 2015 by Jan Schlüter: https://bitbucket.org/sergiu/libav-cmake/issue/2
 # Changed 2016 by Jan Schlüter: support both ffmpeg and libav
+# Changed 2017 by Sergey Smirnov: support architecture-specific include dirs
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -227,7 +228,8 @@
  SET (_LIBAV_FPHSA_ADDITIONAL_ARGS HANDLE_COMPONENTS)
 ENDIF (NOT _LIBAV_CHECK_COMPONENTS)

-FIND_PACKAGE_HANDLE_STANDARD_ARGS (LibAV REQUIRED_VARS LIBAV_ROOT_DIR
-  LIBAV_INCLUDE_DIR ${_LIBAV_MISSING_LIBRARIES} VERSION_VAR LIBAV_VERSION
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (LibAV
+  REQUIRED_VARS LIBAV_INCLUDE_DIR ${_LIBAV_MISSING_LIBRARIES}
+  VERSION_VAR LIBAV_VERSION
   ${_LIBAV_FPHSA_ADDITIONAL_ARGS})


Missed one library to mark as advanced

Missed one library to mark as advanced

--- cmake/FindPhysX.cmake
+++ cmake/FindPhysX.cmake
@@ -202,4 +202,4 @@
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PhysX  DEFAULT_MSG  PhysX_INCLUDE_DIR PhysX_LIBRARY_DEBUG PhysX_LIBRARY_RELEASE ${NECESSARY_COMPONENTS})

-MARK_AS_ADVANCED(PhysX_INCLUDE_DIR PhysX_LIBRARY_DIR PhysX_LIBRARY_DEBUG PhysX_LIBRARY_RELEASE)+MARK_AS_ADVANCED(PhysX_INCLUDE_DIR PhysX_LIBRARY_DIR PhysX_LIBRARY_DEBUG PhysX_LIBRARY_RELEASE PhysX_LIBRARY_PROFILE)


Hotfix: Updates documentation for pv_add_test()

--- cmake/PVAddTest.cmake
+++ cmake/PVAddTest.cmake
@@ -1,6 +1,9 @@
-# pv_add_test([ONLY_MPI | NO_MPI] [MAX_MPI_COPIES] [FLAGS] [BASE_NAME])
-#
-# All arguments are optional
+# pv_add_test([PARAMS | NO_PARAMS] [MPI_ONLY | NO_MPI] [MIN_MPI_COPIES] [MAX_MPI_COPIES] [FLAGS] [BASE_NAME] [SRCFILES])
+#
+# All arguments except SRCFILES are optional.
+# SRCFILES and PARAMS each take one or more string arguments.
+# MIN_MPI_COPIES and MAX_MPI_COPIES each take one numerical argument.
+# FLAGS and BASE_NAME each take one string argument.
 #
 # Add a test case for the OpenPV library. This creates the binary and adds
 # test tests. Multiple test cases are added by default.
@@ -9,7 +12,7 @@
 #
 # Most files will have a single line:
 #
-#   pv_add_test()
+#   pv_add_test(SRCFILES main.cpp file1.cpp file2.cpp file1.hpp file2.hpp)
 #
 #   This will add a test with a base name based on the test's directory name. The params file
 #   will be named input/directory_name.params
@@ -18,26 +21,33 @@
 #
 # No params files:
 #
-#   pv_add_test(NO_PARAMS)
+#   pv_add_test(NO_PARAMS SRCFILES main.cpp)
 #
 # Alternate param files:
 #
-#   pv_add_test(PARAMS test_kernel test_kernel_normalizepost test_kernel_normalizepost_shrunken)
+#   pv_add_test(PARAMS test_kernel test_kernel_normalizepost test_kernel_normalizepost_shrunken SRCFILES main.cpp)
 #
 # No params files, no MPI:
 #
-#   pv_add_test(NO_PARAMS NO_MPI)
+#   pv_add_test(NO_PARAMS NO_MPI SRCFILES main.cpp)
 #
 # Append special flags to the command line
 #
-#   pv_add_test(FLAGS "-c checkpoints/Checkpoint06 --testall")
+#   pv_add_test(FLAGS "-c checkpoints/Checkpoint06 --testall" SRCFILES main.cpp)
 #
 # Specify the number of MPI copies, only test MPI, and special flags
 #
-#   pv_add_test(MIN_MPI_COPIES 4 MPI_ONLY FLAGS "-batchwidth 4")
+#   pv_add_test(MIN_MPI_COPIES 4 MPI_ONLY FLAGS "-batchwidth 4" SRCFILES main.cpp)
 #
 # --------------------------------------------------------------------------------
 # Options:
+#
+# PARAMS - by default, this is set to BASE_NAME and a params file of name input/BASE_NAME.params
+#   is searched for. If multiple params files are specified, then a separate set of tests
+#   will be run for each of the params files
+#
+# NO_PARAMS - if set, then no params files will be used for this test. Setting PARAMS and
+#   NO_PARAMS will result in an error
 #
 # MPI_ONLY and NO_MPI are mutually exclusive. Both arguments are options.
 # By default, one non-MPI test case is created, and two MPI test cases are created, for
@@ -55,13 +65,8 @@
 # BASE_NAME - by default, this is the last component of the path ${CMAKE_CURRENT_SOURCE_DIR}.
 #  Set BASE_NAME to override
 #
-# PARAMS - by default, this is set to BASE_NAME and a params file of name input/BASE_NAME.params
-#   is searched for. If multiple params files are specified, then a separate set of tests
-#   will be run for each of the params files
-#
-# NO_PARAMS - if set, then no params files will be used for this test. Setting PARAMS and
-#   NO_PARAMS will result in an error
-#
+# SRCFILES - The list source files for the executable that this test runs. There must be
+#  at least one source file. This list of files will be passed to pv_add_executable().

 function(pv_add_test_error TEST_NAME MESSAGE)
     message(ERROR "Cannot add OpenPV test ${TEST_NAME}. ${MESSAGE}")
@@ -78,7 +83,7 @@
   endif()

   if (PARSED_ARGS_MPI_ONLY AND PARSED_ARGS_NO_MPI)
-    pv_add_test_error(${BASE_NAME} "ONLY_MPI and NO_MPI are both set. These options are mutually exclusive.")
+    pv_add_test_error(${BASE_NAME} "MPI_ONLY and NO_MPI are both set. These options are mutually exclusive.")
     set(ERROR_STATE ON)
   endif()


Add support for logic in the configure files

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -27,6 +27,8 @@
     file(APPEND "${configure_script}"
       "set(${arg} \"${${arg}}\")\n")
   endforeach (arg)
+
+  file(APPEND "${configure_script}" "${configure_code}")

   file(APPEND "${configure_script}" "
 configure_file(


cmake: fix avr target

cmake: fix avr target

--- cmake/Arduino.cmake
+++ cmake/Arduino.cmake
@@ -619,9 +619,9 @@
     # Compile elf
     add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
             COMMAND ${AVR_C_COMPILER}
-            ARGS ${COMPILE_FLAGS}
+            ARGS -o ${TARGET_PATH}.elf
             ${ALL_SRCS}
-            -o ${TARGET_PATH}.elf
+            ${COMPILE_FLAGS}
             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
             COMMENT "Compiling ELF"
             VERBATIM)


adding verbose messages

adding verbose messages

--- cmake/FindUsd.cmake
+++ cmake/FindUsd.cmake
@@ -19,9 +19,11 @@

 # Tangent specific build variables
 if(DEFINED ENV{REZ_HOUDINI_ROOT})
+    message(STATUS "Rez Houdini USD override")
     set(USE_HOUDINI_USD TRUE)
     set(HOUDINI_ROOT $ENV{HFS})
 else()
+    message(STATUS "Rez Pixar USD override")
     set(USE_HOUDINI_USD FALSE)
     set(USD_ROOT $ENV{REZ_USD_ROOT})
 endif()
@@ -30,8 +32,10 @@
 add_library(UsdInterface INTERFACE)
 add_library(Usd::Usd ALIAS UsdInterface)

+message(STATUS "Use Houdini Usd ${USE_HOUDINI_USD}")
+
 if(${USE_HOUDINI_USD})
     include(cmake/FindHoudiniUsd.cmake)
 else()
     include(cmake/FindPixarUsd.cmake)
-endif()+endif()


fix ssl symbol not found (#46832)

fix ssl symbol not found (#46832)

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -96,7 +96,7 @@
   link_libraries(${CMAKE_THREAD_LIBS_INIT})
   if(WITH_PSLIB OR WITH_DISTRIBUTE)
     set(CMAKE_CXX_LINK_EXECUTABLE
-        "${CMAKE_CXX_LINK_EXECUTABLE} -pthread -ldl -lrt -lz -lssl")
+        "${CMAKE_CXX_LINK_EXECUTABLE} -pthread -ldl -lrt -lz -lssl -lcrypto")
   else()
     set(CMAKE_CXX_LINK_EXECUTABLE
         "${CMAKE_CXX_LINK_EXECUTABLE} -pthread -ldl -lrt")


added macro for searching sources in a list of directories

--- cmake/sources.cmake
+++ cmake/sources.cmake
@@ -1,22 +1,20 @@
-# TODO: make macro for expanding all of these variables using directory list
-file(GLOB SOURCES_ALL
-        But/*.cpp
-        But/Log/*.cpp
-        But/Log/detail/*.cpp
-        But/Threading/*.cpp
-    )
-file(GLOB SOURCES_MT
-        But/*.mt.cpp
-        But/Log/*.mt.cpp
-        But/Log/detail/*.mt.cpp
-        But/Threading/*.mt.cpp
-    )
-file(GLOB SOURCES_UT
-        But/*.ut.cpp
-        But/Log/*.ut.cpp
-        But/Log/detail/*.ut.cpp
-        But/Threading/*.ut.cpp
-    )
+macro(expand_names variable ending)
+  foreach(d ${ARGN})
+    file(GLOB tmp_srcs ${d}/*.${ending})
+    list(APPEND ${variable} ${tmp_srcs})
+  endforeach()
+endmacro()
+
+set(SRC_DIRS
+        But
+        But/Log
+        But/Log/detail
+        But/Threading
+   )
+
+expand_names(SOURCES_ALL "cpp"    ${SRC_DIRS})
+expand_names(SOURCES_UT  "ut.cpp" ${SRC_DIRS})
+expand_names(SOURCES_MT  "mt.cpp" ${SRC_DIRS})

 set(SOURCES_LIB ${SOURCES_ALL})
 list(REMOVE_ITEM SOURCES_LIB ${SOURCES_UT} ${SOURCES_MT})


ENH (#1520): new options to create GUI dependend tests which are not application/functionality tests

--- CMake/TestingHelpers.cmake
+++ CMake/TestingHelpers.cmake
@@ -2,6 +2,8 @@
 #
 # CMake variables used:
 #
+# ${${KITNAME}_GUI_TESTS} : filenames of all tests that run without a parameter
+# ${${KITNAME}_IMAGE_GUI_TESTS : filenames of all tests that run with an image filename as parameter
 # ${${KITNAME}_TESTS} : filenames of all tests that run without a parameter
 # ${${KITNAME}_IMAGE_TESTS : filenames of all tests that run with an image filename as parameter
 # ${${KITNAME}_TESTIMAGES} : list of images passed as parameter for the IMAGE_TESTS
@@ -9,9 +11,15 @@
 #                              of these has to be specified manually with the ADD_TEST CMake command.
 #
 MACRO(MITK_CREATE_DEFAULT_TESTS)
+  # add tests which need a GUI if it is not disabled
+  IF(NOT MITK_GUI_TESTS_DISABLED)
+    SET( ${KITNAME}_TESTS  ${${KITNAME}_TESTS} ${${KITNAME}_GUI_TESTS} )
+    SET( ${KITNAME}_IMAGE_TESTS  ${${KITNAME}_IMAGE_TESTS} ${${KITNAME}_IMAGE_GUI_TESTS} )
+  ENDIF(NOT MITK_GUI_TESTS_DISABLED)
+
   #
   # Create the TestDriver binary which contains all the tests.
-  #
+  #
   CREATE_TEST_SOURCELIST(MITKTEST_SOURCE ${KITNAME}TestDriver.cpp
     ${${KITNAME}_TESTS} ${${KITNAME}_IMAGE_TESTS} ${${KITNAME}_CUSTOM_TESTS}
   )