added components to FindFFTW

added components to FindFFTW

--- cmake/FindFFTW.cmake
+++ cmake/FindFFTW.cmake
@@ -1,15 +1,15 @@
 # - Find the FFTW library
 #
 # Usage:
-#   find_package(FFTW [REQUIRED] [QUIET] )
+#   find_package(FFTW [REQUIRED] [QUIET] [COMPONENTS ...])
 #
 # It sets the following variables:
-#   FFTW_FOUND               ... true if fftw is found on the system
-#   FFTW_LIBRARIES           ... full path to fftw library
-#   FFTW_INCLUDES            ... fftw include directory
-#   FFTW_FOUND_SERIAL_LIBS   ... full path to serial fftw library
-#   FFTW_FOUND_THREADS_LIBS  ... full path to pthreads fftw library
-#   FFTW_FOUND_OPENMP_LIBS   ... full path to openmp fftw library
+#   FFTW_FOUND          ... true if fftw is found on the system
+#   FFTW_LIBRARIES      ... full path to fftw library (will be filled with serial/openmp/pthreads enabled file names if present)
+#   FFTW_INCLUDES       ... fftw include directory
+#   FFTW_SERIAL_LIBS	... full path to serial fftw library
+#   FFTW_THREADS_LIBS	... full path to pthreads fftw library
+#   FFTW_OPENMP_LIBS	... full path to openmp fftw library
 #
 # The following variables will be checked by the function
 #   FFTW_USE_STATIC_LIBS    ... if true, only static libraries are found
@@ -18,10 +18,51 @@
 #   FFTW_LIBRARY            ... fftw library to use
 #   FFTW_INCLUDE_DIR        ... fftw include directory
 #
+# Besides these command line defines, the environment is searched for FFTWDIR and FFTW_ROOT to be filled
+# if these variables are defined, it's assumed that they point to the FFTW installation root path
+
+
+#sanity check of components
+if(NOT FFTW_FIND_COMPONENTS)
+  set(FFTW_FIND_COMPONENTS "float;double")
+endif()
+
+set(FFTW_ALLOWED_COMPONENTS "single;float;double;long;quad")
+foreach(_COMPONENT IN LISTS FFTW_FIND_COMPONENTS)
+  list(FIND FFTW_ALLOWED_COMPONENTS ${_COMPONENT}  ALLOWED_INDEX)
+  if(${ALLOWED_INDEX} LESS 0)
+    if(NOT FFTW_FIND_QUIETLY)
+      message("-- [FindFFTW.cmake] ignoring unknown component ${_COMPONENT}, allowed values are ${FFTW_ALLOWED_COMPONENTS}")
+    endif()
+    list(REMOVE_ITEM FFTW_FIND_COMPONENTS ${_COMPONENT})
+  endif()
+endforeach()
+
+#prepare fftw library precision stub
+set(FFTW_LIBRARY_STUBS)
+foreach(_COMPONENT IN LISTS FFTW_FIND_COMPONENTS)
+  if(_COMPONENT MATCHES "float" OR _COMPONENT MATCHES "single")
+    list(APPEND FFTW_LIBRARY_STUBS "fftw3f")
+  endif()
+  if(_COMPONENT MATCHES "double")
+    list(APPEND FFTW_LIBRARY_STUBS "fftw3")
+  endif()
+  if(_COMPONENT MATCHES "long")
+    list(APPEND FFTW_LIBRARY_STUBS "fftw3l")
+  endif()
+  if(_COMPONENT MATCHES "quad")
+    list(APPEND FFTW_LIBRARY_STUBS "fftw3q")
+  endif()
+endforeach()

 #If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT
-if( NOT FFTW_ROOT AND ENV{FFTWDIR} )
-  set( FFTW_ROOT $ENV{FFTWDIR} )
+if( NOT FFTW_ROOT AND (ENV{FFTWDIR} OR ENV{FFTW_ROOT}))
+  if(EXISTS ENV{FFTWDIR})
+    set( FFTW_ROOT $ENV{FFTWDIR} )
+  endif()
+  if(EXISTS ENV{FFTW_ROOT})
+    set( FFTW_ROOT $ENV{FFTW_ROOT} )
+  endif()
 endif()

 # Check if we can use PkgConfig
@@ -41,83 +82,90 @@
   set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
 endif()

+#initialize library variables
+foreach(_LIBSTUB IN LISTS FFTW_LIBRARY_STUBS)
+
+  if( FFTW_ROOT )
+
+    find_library(
+      FFTW_SERIAL_STUBLIB
+      NAMES ${_LIBSTUB} lib${_LIBSTUB}
+      PATHS ${FFTW_ROOT}
+      PATH_SUFFIXES "lib" "lib64"
+      NO_DEFAULT_PATH
+      )
+
+    find_library(
+      FFTW_OPENMP_STUBLIB
+      NAMES ${_LIBSTUB}_omp lib${_LIBSTUB}_omp
+      PATHS ${FFTW_ROOT}
+      PATH_SUFFIXES "lib" "lib64"
+      NO_DEFAULT_PATH
+      )
+
+    find_library(
+      FFTW_THREADS_STUBLIB
+      NAMES ${_LIBSTUB}_threads lib${_LIBSTUB}_threads
+      PATHS ${FFTW_ROOT}
+      PATH_SUFFIXES "lib" "lib64"
+      NO_DEFAULT_PATH
+      )
+
+  else( FFTW_ROOT )
+    find_library(
+      FFTW_SERIAL_STUBLIB
+      NAMES ${_LIBSTUB} lib${_LIBSTUB}
+      PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+      )
+
+    find_library(
+      FFTW_OPENMP_STUBLIB
+      NAMES ${_LIBSTUB}_omp lib${_LIBSTUB}_omp
+      PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+      )
+
+
+    find_library(
+      FFTW_THREADS_STUBLIB
+      NAMES ${_LIBSTUB}_threads lib${_LIBSTUB}_threads
+      PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+      )
+
+  endif( FFTW_ROOT )
+
+  if(EXISTS ${FFTW_SERIAL_STUBLIB})
+    list(APPEND FFTW_SERIAL_LIBS ${FFTW_SERIAL_STUBLIB})
+  else()
+    if(NOT FFTW_FIND_QUIETLY)
+      message("FFTW_SERIAL_STUBLIB empty for ${_LIBSTUB} .. :${FFTW_SERIAL_STUBLIB}:")
+    endif()
+  endif()
+
+  if(EXISTS ${FFTW_OPENMP_STUBLIB})
+    list(APPEND FFTW_OPENMP_LIBS ${FFTW_OPENMP_STUBLIB})
+  else()
+    if(NOT FFTW_FIND_QUIETLY)
+      message("FFTW_OPENMP_STUBLIB empty for ${_LIBSTUB} .. :${FFTW_OPENMP_STUBLIB}:")
+    endif()
+  endif()
+
+  if(EXISTS ${FFTW_THREADS_STUBLIB})
+    list(APPEND FFTW_THREADS_LIBS ${FFTW_THREADS_STUBLIB})
+  else()
+    if(NOT FFTW_FIND_QUIETLY)
+      message("FFTW_OPENMP_STUBLIB empty for ${_LIBSTUB} .. :${FFTW_THREADS_STUBLIB}:")
+    endif()
+  endif()
+
+  unset(FFTW_SERIAL_STUBLIB CACHE)
+  unset(FFTW_THREADS_STUBLIB CACHE)
+  unset(FFTW_OPENMP_STUBLIB CACHE)
+
+endforeach()
+
+#find includes
 if( FFTW_ROOT )

-  #find libs
-  find_library(
-    FFTW_LIB
-    NAMES fftw3
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-
-  find_library(
-    FFTW_OPENMP_LIB
-    NAMES fftw3_omp
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-  find_library(
-    FFTW_THREADS_LIB
-    NAMES fftw3_threads
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-  find_library(
-    FFTWF_LIB
-    NAMES "fftw3f"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-  find_library(
-    FFTWF_OPENMP_LIB
-    NAMES "fftw3f_omp"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-  find_library(
-    FFTWF_THREADS_LIB
-    NAMES "fftw3f_threads"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-  find_library(
-    FFTWL_LIB
-    NAMES "fftw3l"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-  find_library(
-    FFTWL_OPENMP_LIB
-    NAMES "fftw3f_omp"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-  find_library(
-    FFTWL_THREADS_LIB
-    NAMES "fftw3f_threads"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    NO_DEFAULT_PATH
-    )
-
-  #find includes
   find_path(
     FFTW_INCLUDES
     NAMES "fftw3.h"
@@ -128,109 +176,36 @@

 else()

-  find_library(
-    FFTW_LIB
-    NAMES fftw3
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-find_library(
-    FFTW_OPENMP_LIB
-    NAMES fftw3_omp
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-
-find_library(
-    FFTW_THREADS_LIB
-    NAMES fftw3_threads
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_library(
-    FFTWF_LIB
-    NAMES "fftw3f"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-
-find_library(
-    FFTWF_OPENMP_LIB
-    NAMES fftw3f_omp
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-
-find_library(
-    FFTWF_THREADS_LIB
-    NAMES fftw3f_threads
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_library(
-    FFTWL_LIB
-    NAMES "fftw3l"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-
-find_library(
-    FFTWL_OPENMP_LIB
-    NAMES fftw3l_omp
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-
-find_library(
-    FFTWL_THREADS_LIB
-    NAMES fftw3l_threads
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-
   find_path(
     FFTW_INCLUDES
     NAMES "fftw3.h"
     PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
-  )
+    )

 endif( FFTW_ROOT )

-set(FFTW_FOUND_SERIAL_LIBS           ${FFTW_LIB}             )
-set(FFTW_FOUND_THREADS_LIBS   ${FFTW_THREADS_LIB}     )
-set(FFTW_FOUND_OPENMP_LIBS    ${FFTW_OPENMP_LIB}      )
-
-if(EXISTS ${FFTWF_LIB})
-
-  list(APPEND FFTW_FOUND_SERIAL_LIBS		${FFTWF_LIB}		)
-  list(APPEND FFTW_FOUND_THREADS_LIBS	${FFTWF_THREADS_LIB}	)
-  list(APPEND FFTW_FOUND_OPENMP_LIBS	${FFTWF_OPENMP_LIB}	)
-
-endif()
-
-if(EXISTS ${FFTWL_LIB})
-  list(APPEND FFTW_FOUND_SERIAL_LIBS		${FFTWL_LIB}		)
-  list(APPEND FFTW_FOUND_THREADS_LIBS	${FFTWL_THREADS_LIB}	)
-  list(APPEND FFTW_FOUND_OPENMP_LIBS	${FFTWL_OPENMP_LIB}	)
-endif()
-
+# fill libraries
 set(FFTW_LIBRARIES)
-
-foreach(_ITEM IN LISTS FFTW_FOUND_SERIAL_LIBS FFTW_FOUND_THREADS_LIBS FFTW_FOUND_OPENMP_LIBS )
+foreach(_ITEM IN LISTS FFTW_SERIAL_LIBS FFTW_THREADS_LIBS FFTW_OPENMP_LIBS )
   if(EXISTS ${_ITEM})
     set(FFTW_LIBRARIES "${FFTW_LIBRARIES} ${_ITEM}")
   endif()
 endforeach()

+
 #revert CMAKE_FIND_LIBRARY_SUFFIXES
 set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(FFTW DEFAULT_MSG
-                                  FFTW_INCLUDES FFTW_LIBRARIES)
-
-mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES
-  FFTW_FOUND_SERIAL_LIBS #individual serial libs
-  FFTW_FOUND_THREADS_LIBS FFTW_FOUND_OPENMP_LIBS #individual parallel libs
+  FFTW_INCLUDES
+  FFTW_LIBRARIES
   )

+mark_as_advanced(FFTW_INCLUDES #include directory
+  FFTW_LIBRARIES
+  FFTW_SERIAL_LIBS #individual serial libs
+  FFTW_THREADS_LIBS #pthreads libraries
+  FFTW_OPENMP_LIBS #openmp libraries
+  )
+


removed duplicate FindJAVA cmake module

removed duplicate FindJAVA cmake module

--- cmake/FindJAVA.cmake
+++ cmake/FindJAVA.cmake
@@ -1,236 +0,0 @@
-##################################################################################
-# cmake module for finding JAVA
-#
-#   looks in following locations in the following order:
-#       JAVA_DIR, JAVA_HOME, JDK_HOME, ENV{JAVA_HOME}, ENV{JDK_HOME}
-#
-# sets following variables:
-#
-# JAVA_FOUND    - set to TRUE or FALSE (javadoc is ignored for the test)
-#
-# JAVA_DIR      - base dir where subdirs bin, lib, jre and include are located
-# JAVA_HOME     - same as JAVA_DIR
-# JAVA_BIN_PATH - path to subdirectory "${JAVA_DIR}/bin"
-#
-# JAVA_RUNTIME  - path to ${JAVA_BIN_PATH}/java
-# JAVA_COMPILE  - path to ${JAVA_BIN_PATH}/javac
-# JAVA_ARCHIVE  - path to ${JAVA_BIN_PATH}/jar
-# JAVA_DOC      - path to ${JAVA_BIN_PATH}/javadoc
-#
-# JAVA_VERSION_MAJOR
-# JAVA_VERSION_MINOR
-# JAVA_VERSION_PATCH
-# JAVA_VERSION (MAJOR.MINOR.PATCH)
-#
-# @author Jan Engels, DESY
-##################################################################################
-
-SET( JAVA_FOUND FALSE )
-MARK_AS_ADVANCED( JAVA_FOUND )
-
-IF( NOT JAVA_DIR AND JAVA_HOME )
-    SET( JAVA_DIR "${JAVA_HOME}" )
-ENDIF()
-
-IF( NOT JAVA_DIR AND JDK_HOME )
-    SET( JAVA_DIR "${JDK_HOME}" )
-ENDIF()
-
-IF( NOT JAVA_DIR AND DEFINED ENV{JAVA_HOME} )
-    SET( JAVA_DIR "$ENV{JAVA_HOME}" )
-ENDIF()
-
-IF( NOT JAVA_DIR AND DEFINED ENV{JDK_HOME} )
-    SET( JAVA_DIR "$ENV{JDK_HOME}" )
-ENDIF()
-
-
-IF( NOT JAVA_FIND_QUIETLY )
-    MESSAGE( STATUS "Check for Java: ${JAVA_DIR}" )
-ENDIF()
-
-IF( JAVA_DIR )
-
-    SET( JAVA_BIN_PATH JAVA_BIN_PATH-NOTFOUND )
-    FIND_PATH( JAVA_BIN_PATH
-        javac
-        ${JAVA_DIR}/bin
-        ${JAVA_DIR}/Commands
-        NO_DEFAULT_PATH )
-
-    IF( NOT JAVA_BIN_PATH AND NOT JAVA_FIND_QUIETLY )
-        MESSAGE( STATUS "${JAVA_DIR} is not a valid path for Java!!" )
-    ENDIF()
-
-    IF( JAVA_BIN_PATH )
-        # find java, javac, jar and javadoc
-        SET( JAVA_RUNTIME JAVA_RUNTIME-NOTFOUND )
-        FIND_PROGRAM( JAVA_RUNTIME
-            java
-            ${JAVA_BIN_PATH}
-            NO_DEFAULT_PATH )
-
-        SET( JAVA_COMPILE JAVA_COMPILE-NOTFOUND )
-        FIND_PROGRAM( JAVA_COMPILE
-            javac
-            ${JAVA_BIN_PATH}
-            NO_DEFAULT_PATH )
-
-        SET( JAVA_ARCHIVE JAVA_ARCHIVE-NOTFOUND )
-        FIND_PROGRAM( JAVA_ARCHIVE
-            jar
-            ${JAVA_BIN_PATH}
-            NO_DEFAULT_PATH )
-
-        SET( JAVA_DOC JAVA_DOC-NOTFOUND )
-        FIND_PROGRAM( JAVA_DOC
-            javadoc
-            ${JAVA_BIN_PATH}
-            NO_DEFAULT_PATH )
-
-        # abort if not found
-        IF( NOT JAVA_RUNTIME AND NOT JAVA_FIND_QUIETLY )
-            MESSAGE( STATUS "Could not find java!!" )
-        ENDIF()
-        IF( NOT JAVA_COMPILE AND NOT JAVA_FIND_QUIETLY )
-            MESSAGE( STATUS "Could not find javac!!" )
-        ENDIF()
-        IF( NOT JAVA_ARCHIVE AND NOT JAVA_FIND_QUIETLY )
-            MESSAGE( STATUS "Could not find jar!!" )
-        ENDIF()
-        IF( NOT JAVA_DOC AND NOT JAVA_FIND_QUIETLY )
-            MESSAGE( STATUS "Could not find javadoc!!" )
-        ENDIF()
-    ENDIF()
-
-
-ELSE() # try to autodetect java
-
-
-    IF( NOT JAVA_FIND_QUIETLY )
-        MESSAGE( STATUS "Autodetecting Java..." )
-    ENDIF()
-
-    # use the CMake FindJava.cmake module
-    FIND_PACKAGE( Java )
-
-    #MESSAGE( STATUS "JAVA_RUNTIME: ${JAVA_RUNTIME}" )
-    #MESSAGE( STATUS "JAVA_COMPILE: ${JAVA_COMPILE}" )
-    #MESSAGE( STATUS "JAVA_ARCHIVE: ${JAVA_ARCHIVE}" )
-
-    IF( JAVA_RUNTIME AND JAVA_COMPILE AND JAVA_ARCHIVE )
-
-        IF( UNIX AND NOT APPLE )
-
-            # look for the readlink binary
-            FIND_PROGRAM( READLINK_BIN readlink )
-            MARK_AS_ADVANCED( READLINK_BIN )
-
-            IF( READLINK_BIN )
-
-                # dereference links
-                EXEC_PROGRAM( ${READLINK_BIN} ARGS "-f ${JAVA_COMPILE}"
-                    OUTPUT_VARIABLE javac_dereferenced
-                    RETURN_VALUE return_value )
-
-                IF( NOT return_value )
-                    GET_FILENAME_COMPONENT( JAVA_BIN_PATH ${javac_dereferenced} PATH )
-                ELSE()
-                    GET_FILENAME_COMPONENT( JAVA_BIN_PATH ${JAVA_COMPILE} PATH )
-                ENDIF()
-            ENDIF()
-
-            GET_FILENAME_COMPONENT( JAVA_DIR ${JAVA_BIN_PATH} PATH )
-
-        ELSE()
-
-            SET( JAVA_HOME_MAC JAVA_HOME_MAC-NOTFOUND )
-            FIND_PROGRAM( JAVA_HOME_MAC
-                java_home
-                /usr/libexec/
-            )
-
-            IF( JAVA_HOME_MAC )
-
-                EXEC_PROGRAM( "${JAVA_HOME_MAC}"
-                    OUTPUT_VARIABLE JAVA_DIR
-                    RETURN_VALUE _exit_code
-                )
-
-                IF( _exit_code )
-                    IF( NOT JAVA_FIND_QUIETLY )
-                        MESSAGE( STATUS "Failed to execute java_home" )
-                    ENDIF()
-                ENDIF()
-
-                SET( JAVA_BIN_PATH JAVA_BIN_PATH-NOTFOUND )
-                FIND_PATH( JAVA_BIN_PATH
-                    javac
-                    ${JAVA_DIR}/bin
-                    ${JAVA_DIR}/Commands
-                    NO_DEFAULT_PATH )
-
-                IF( NOT JAVA_BIN_PATH AND NOT JAVA_FIND_QUIETLY )
-                    MESSAGE( STATUS "${JAVA_DIR} is not a valid path for Java!!" )
-                ENDIF()
-
-            ELSE()
-                IF( NOT JAVA_FIND_QUIETLY )
-                    MESSAGE( STATUS "Failed to autodetect Java!!" )
-                ENDIF()
-            ENDIF()
-
-        ENDIF()
-    ELSE()
-        IF( NOT JAVA_FIND_QUIETLY )
-            MESSAGE( STATUS "Failed to autodetect Java!!" )
-        ENDIF()
-    ENDIF()
-
-ENDIF()
-
-IF( JAVA_DIR )
-    SET( JAVA_HOME "${JAVA_DIR}" )
-    IF( NOT JAVA_FIND_QUIETLY )
-        MESSAGE( STATUS "JAVA_HOME set to ${JAVA_DIR}" )
-    ENDIF()
-ENDIF()
-
-IF( JAVA_RUNTIME AND JAVA_COMPILE AND JAVA_ARCHIVE )
-
-    SET( JAVA_FOUND TRUE )
-
-    # parse the output of java -version
-    EXEC_PROGRAM( "${JAVA_RUNTIME}" ARGS "-version"
-            OUTPUT_VARIABLE out_tmp
-            RETURN_VALUE _exit_code )
-
-    IF( _exit_code )
-        IF( NOT JAVA_FIND_QUIETLY )
-            MESSAGE( STATUS "Failed to execute java -version!! JAVA_VERSION will not be set!!" )
-        ENDIF()
-    ELSE()
-        # extract major/minor version and patch level from "java -version" output
-        STRING( REGEX REPLACE ".* version \"([0-9]+)\\.[0-9]+\\.[0-9]+.*"
-                "\\1" JAVA_VERSION_MAJOR "${out_tmp}" )
-        STRING( REGEX REPLACE ".* version \"[0-9]+\\.([0-9]+)\\.[0-9]+.*"
-                "\\1" JAVA_VERSION_MINOR "${out_tmp}" )
-        STRING( REGEX REPLACE ".* version \"[0-9]+\\.[0-9]+\\.([0-9]+).*"
-                "\\1" JAVA_VERSION_PATCH "${out_tmp}" )
-
-        SET( JAVA_VERSION "${JAVA_VERSION_MAJOR}.${JAVA_VERSION_MINOR}.${JAVA_VERSION_PATCH}" )
-
-        # display info
-        IF( NOT JAVA_FIND_QUIETLY )
-            MESSAGE( STATUS "Found Java (version ${JAVA_VERSION})" )
-        ENDIF()
-    ENDIF()
-ELSE()
-    IF( JAVA_FIND_REQUIRED )
-        MESSAGE( FATAL_ERROR "Failed to find Java!!" )
-    ENDIF()
-    IF( NOT JAVA_FIND_QUIETLY )
-        MESSAGE( STATUS "Failed to find Java!!" )
-    ENDIF()
-ENDIF()
-


cleanup

cleanup

--- cmake/cryptopp.cmake
+++ cmake/cryptopp.cmake
@@ -1,26 +0,0 @@
-
-FIND_PATH (CRYPTOPP_ROOT_DIR
-  NAMES cryptopp/cryptlib.h include/cryptopp/cryptlib.h
-  PATHS ENV CRYPTOPPROOT
-  DOC "CryptoPP root directory")
-
-FIND_PATH (CRYPTOPP_INCLUDE_DIR
-  NAMES cryptopp/cryptlib.h
-  HINTS ${CRYPTOPP_ROOT_DIR}
-  PATH_SUFFIXES include
-  DOC "CryptoPP include directory")
-
-FIND_LIBRARY (CRYPTOPP_LIBRARY
-  NAMES cryptlib cryptopp
-  HINTS ${CRYPTOPP_ROOT_DIR}
-  PATH_SUFFIXES lib
-  DOC "CryptoPP release library")
-
-
-MARK_AS_ADVANCED (CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY)
-
-IF(CRYPTOPP_LIBRARY)
-    MESSAGE(STATUS "Crypto++ - found")
-ELSE(CRYPTOPP_LIBRARY)
-    MESSAGE(FATAL_ERROR "Crypto++ - not found")
-ENDIF(CRYPTOPP_LIBRARY)


Updates on OS version extract

Updates on OS version extract

--- cmake/ex_osver.cmake
+++ cmake/ex_osver.cmake
@@ -71,7 +71,7 @@
                     OUTPUT_STRIP_TRAILING_WHITESPACE)

             # extract the os name by regex
-            if (_TMP_LSB_RELEASE_OUTPUT_OS MATCHES "^NAME=[\'\"]*(.*)[\'\"]*")
+            if (_TMP_LSB_RELEASE_OUTPUT_OS MATCHES "^NAME=[\'\"]*([^\'\"]+)")
                 set(_TMP_LSB_RELEASE_OUTPUT_OS ${CMAKE_MATCH_1})
             else()
                 message(FATAL_ERROR "Failed to extract OS version from /etc/os-release")


added Compiler include

added Compiler include

--- Sanitizer.cmake
+++ Sanitizer.cmake
@@ -11,11 +11,14 @@
 #       thread
 #
 # Note: This modifies CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS
+# Usage: add this when doing cmake configuration: -DSANITIZER=address

 option(SANITIZER "Sanitizer: one of address/thread/undefined, depending on compiler" OFF)
 if(NOT SANITIZER)
   return()
 endif()
+
+include(Compiler)

 #According to: http://clang.llvm.org/docs/AddressSanitizer.html#usage
 # the following compiler flags allow us to keep -O1 on, if desired, but
@@ -43,6 +46,5 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_SANITIZER_COMPILE_OPTIONS} ${_SANITIZER}" )
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_SANITIZER}")
 else()
-  message(WARNING "Sanitizer ${SANITIZER} not set, check compiler support")
+  message(WARNING "Sanitizer '${SANITIZER}' not set, check compiler support")
 endif()
-


SVN_SILENT made messages (.desktop file)

--- ds9/ds9.desktop.cmake
+++ ds9/ds9.desktop.cmake
@@ -31,6 +31,7 @@
 Name[sv]=DirectShow 9
 Name[uk]=DirectShow9
 Name[x-test]=xxDirectShow9xx
+Name[zh_TW]=DirectShow9

 Comment=Phonon DirectShow9 backend
 Comment[ca]=Dorsal DirectShow9 del Phonon
@@ -55,3 +56,4 @@
 Comment[sv]=Phonon Directshow 9-gränssnitt
 Comment[uk]=Модуль DirectShow9 для Phonon
 Comment[x-test]=xxPhonon DirectShow9 backendxx
+Comment[zh_TW]=Phonon DirectShow9 後端介面


Build libpng as part of deps on Linux

Build libpng as part of deps on Linux

- We've found counter case where the system provided one is missing or is too old.

--- deps/deps-linux.cmake
+++ deps/deps-linux.cmake
@@ -3,10 +3,11 @@

 include("deps-unix-common.cmake")

-find_package(PNG QUIET)
-if (NOT PNG_FOUND)
-    message(WARNING "No PNG dev package found in system, building static library. You should install the system package.")
-endif ()
+# Some Linuxes may have very old libpng, so it's best to bundle it instead of relying on the system version.
+# find_package(PNG QUIET)
+# if (NOT PNG_FOUND)
+#     message(WARNING "No PNG dev package found in system, building static library. You should install the system package.")
+# endif ()

 #TODO UDEV


cmake: Use real source path for flatbuffers-flatc

This to able to override the source path for flatbuffers-flatc with the
CMake parameter FETCHCONTENT_SOURCE_DIR_FLATBUFFERS.

--- tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
+++ tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
@@ -68,7 +68,7 @@

 ExternalProject_Add(flatbuffers-flatc
   PREFIX ${CMAKE_BINARY_DIR}/flatbuffers-flatc
-  SOURCE_DIR ${CMAKE_BINARY_DIR}/flatbuffers
+  SOURCE_DIR ${flatbuffers_SOURCE_DIR}
   CMAKE_ARGS -DCMAKE_CXX_FLAGS="-DNOMINMAX=1"
              -DFLATBUFFERS_BUILD_TESTS=OFF
              -DFLATBUFFERS_BUILD_FLATLIB=OFF


Pass Fortran variables to eigen config

Pass Fortran variables to eigen config

--- modules/LookUpEigen3.cmake
+++ modules/LookUpEigen3.cmake
@@ -64,6 +64,7 @@
     FILENAME "${EXTERNAL_ROOT}/src/Eigen3Variables.cmake"
     PATTERNS
         "CMAKE_[^_]*_R?PATH"
+        "CMAKE_Fortran_.*"
         "CMAKE_C_.*"
         "CMAKE_CXX_.*"
         "BLAS_.*" "FFTW3_.*"


cmake: get include_directories from mp++

--- python/cmake/QifConfig.cmake
+++ python/cmake/QifConfig.cmake
@@ -8,7 +8,7 @@
 	file(GLOB LIB_SOURCES src/*.cpp)							# get all src/*.cpp files in LIB_SOURCES
 	add_library(qif SHARED ${LIB_SOURCES})						# libqif, depends on all src/*.cpp files

-	include_directories("${CMAKE_CURRENT_BINARY_DIR}/include" include)
+	target_include_directories(qif PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/include" include)

 	# enable precompiled headers in cmake >= 3.16.0
 	if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
@@ -26,7 +26,7 @@
 #
 # PRIVATE, only needed for qif itself
 if(${BUILD_QIF})
-	target_link_libraries(qif PRIVATE osqpstatic gsl gslcblas)
+	target_link_libraries(qif PRIVATE osqpstatic gsl gslcblas mp++)		# mp++ is not really needed, we only list it to get its include_directories
 endif()

 # INTERFACE, needed for targets _using_ qif


Add license to javascript generated code

Change-Id: I0014df3c3662c01f149fe58aaa50b501671bb184

--- CMake/CodeGenerator.cmake
+++ CMake/CodeGenerator.cmake
@@ -578,6 +578,13 @@
       COMMAND ${KurentoModuleCreator_EXECUTABLE} -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -c ${CMAKE_BINARY_DIR}/js/lib -it js
     )

+    if (EXISTS ${CMAKE_SOURCE_DIR}/LICENSE)
+      file (READ ${CMAKE_SOURCE_DIR}/LICENSE LICENSE)
+      file (WRITE ${CMAKE_BINARY_DIR}/js/LICENSE ${LICENSE})
+    else()
+      message (WARNING "LICENSE file on project root directory is missing")
+    endif()
+
     if (${Npm_FOUND})
       add_custom_target(js
         COMMAND ${Npm_EXECUTABLE} pack


preliminary cmake function to setup LTO

preliminary cmake function to setup LTO

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -83,3 +83,9 @@
         endif()
 endfunction()

+# setup LTO
+function(setup_lto)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
+        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
+endfunction()
+


Improved building of Assimp on Windows.

Improved building of Assimp on Windows.

--- External/FindAssimp.cmake
+++ External/FindAssimp.cmake
@@ -53,7 +53,7 @@
     ExternalProject_Add(project_assimp
         URL https://github.com/assimp/assimp/archive/v3.3.1.zip
         URL_MD5 c20ae75c10d1569cd6fa435eef079f56
-        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_SHARED_LIBS=OFF -DASSIMP_BUILD_TESTS=OFF
+        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_SHARED_LIBS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF
         LOG_DOWNLOAD 1
         LOG_UPDATE 1
         LOG_CONFIGURE 1
@@ -75,6 +75,7 @@
     ELSE(WIN32)
         SET(ASSIMP_LIBRARY
             ${install_dir}/lib/libassimp.a
+            png
         )
     ENDIF(WIN32)


cmake: Fix SSP compiler flag check

cmake: Fix SSP compiler flag check

Need to use CMAKE_REQUIRED_FLAGS when checking SSP, not
CMAKE_REQUIRED_DEFINITIONS.

Signed-off-by: Joel Carlson <d7b603241b8a42129a6a698ae087a34c06f1e1a1@gmail.com>
Reviewed-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- cmake/Modules/CheckCCompilerFlagSSP.cmake
+++ cmake/Modules/CheckCCompilerFlagSSP.cmake
@@ -20,10 +20,10 @@
 include(CheckCSourceCompiles)

 macro(CHECK_C_COMPILER_FLAG_SSP _FLAG _RESULT)
-   set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-   set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+   set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+   set(CMAKE_REQUIRED_FLAGS "${_FLAG}")

    check_c_source_compiles("int main(int argc, char **argv) { char buffer[256]; return buffer[argc]=0;}" ${_RESULT})

-   set(CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+   set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
 endmacro(CHECK_C_COMPILER_FLAG_SSP)


Fixed missing include path for SDL.

Fixed missing include path for SDL.

--- build/cmake/SDL2.cmake
+++ build/cmake/SDL2.cmake
@@ -33,10 +33,8 @@
 			set(SDL2_LIBRARIES ${SDL2_BUILD_DIR}/${SDL2_LIBRARY})
 		endif()

-		execute_process(COMMAND rm -f include WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
-		execute_process(COMMAND ln -s lib/SDL/include WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+		list(APPEND EXTRA_CFLAGS "-w -I ${SDL2_BUILD_DIR}/include")

-		list(APPEND EXTRA_CFLAGS "-w")
 		if(APPLE)
 			list(APPEND EXTRA_CFLAGS "-fobjc-exceptions")
 			find_library(CARBON_LIBRARY Carbon REQUIRED)


When compiling in QtCreator on Windows, there are no Debug/Release dirs.

--- CMakeModules/install/windows.cmake
+++ CMakeModules/install/windows.cmake
@@ -1,13 +1,25 @@
 # SDK : main libs - debug
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/Debug
-	DESTINATION ${PREFIX}/sdk/lib
-	CONFIGURATIONS Debug
-)
-# SDK : main libs - release
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/Release
-	DESTINATION ${PREFIX}/sdk/lib
-	CONFIGURATIONS Release RelWithDebInfo MinSizeRel
-)
+if(MSVC_IDE)
+    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/Debug
+            DESTINATION ${PREFIX}/sdk/lib
+            CONFIGURATIONS Debug
+    )
+    # SDK : main libs - release
+    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/Release
+            DESTINATION ${PREFIX}/sdk/lib
+            CONFIGURATIONS Release RelWithDebInfo MinSizeRel
+    )
+else()
+    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib
+            DESTINATION ${PREFIX}/sdk/lib
+            CONFIGURATIONS Debug
+    )
+    # SDK : main libs - release
+    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib
+            DESTINATION ${PREFIX}/sdk/lib
+            CONFIGURATIONS Release RelWithDebInfo MinSizeRel
+    )
+endif(MSVC_IDE)
 # SDK : Ogitor includes
 install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Ogitor/include
 	DESTINATION ${PREFIX}/sdk


Fix mistake in ca9e1261918dc97d7a0 checking ARTIFACT_UPLOAD_VERSION

I was checking ARTIFACT_VERSION instead of ARTIFACT_UPLOAD_VERSION in
one place. This didn't get noticed locally because I had
ARTIFACTORY_SUBMIT=OFF set in my CMake configuration. Sorry!

--- Artifactory.cmake
+++ Artifactory.cmake
@@ -359,7 +359,8 @@

     ensure_all_arguments_parsed(artifactory_upload "${ARTIFACT_UNPARSED_ARGUMENTS}")
     require_arguments(artifactory_upload ARTIFACT GROUP LOCAL_DIRECTORY LOCAL_TARGET NAME REPO VERSION UPLOAD_VERSION)
-    _artifactory_check_upload_version(${ARTIFACT_VERSION})
+    _artifactory_check_version(${ARTIFACT_VERSION})
+    _artifactory_check_upload_version(${ARTIFACT_UPLOAD_VERSION})

     set(extra_args)


BUG: Revert changes on FindShark

BUG: Revert changes on FindShark

--- CMake/FindShark.cmake
+++ CMake/FindShark.cmake
@@ -55,12 +55,12 @@

 mark_as_advanced( SHARK_INCLUDE_DIR  SHARK_LIBRARY )

-# find_package( Boost 1.48.0 REQUIRED QUIET
-#   COMPONENTS serialization
-#   )
-# if(NOT Boost_FOUND)
-#   message(FATAL_ERROR "Please make sure Boost 1.48.0 is installed on your system")
-# endif()
+find_package( Boost 1.48.0 REQUIRED QUIET
+  COMPONENTS serialization
+  )
+if(NOT Boost_FOUND)
+  message(FATAL_ERROR "Please make sure Boost 1.48.0 is installed on your system")
+endif()

 if(NOT SHARK_LIBRARY)
   message(FATAL_ERROR "Cannot find SHARK_LIBRARY. set it with cmake -DSHARK_LIBRARY=")
@@ -144,8 +144,8 @@
   VERSION_VAR SHARK_VERSION_STRING)

 if(SHARK_FOUND)
-  set(SHARK_INCLUDE_DIRS ${SHARK_INCLUDE_DIR} ${OTBBoost_SYSTEM_INCLUDE_DIRS} )
-  set(SHARK_LIBRARIES ${SHARK_LIBRARY} ${OTBBoost_LIBRARIES} )
+  set(SHARK_INCLUDE_DIRS ${SHARK_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
+  set(SHARK_LIBRARIES ${SHARK_LIBRARY} ${Boost_LIBRARIES} )
   if(REQUIRED_CBLAS_LIB)
     set(SHARK_LIBRARIES ${SHARK_LIBRARIES} ${CBLAS_LIBRARY})
   endif()


Escape special regex characters from filenames.

This is especially important on Windows, where \ and () are
prevalent in filenames.

--- CMakeUnitRunner.cmake
+++ CMakeUnitRunner.cmake
@@ -98,8 +98,28 @@

     if (CMAKE_UNIT_LOG_COVERAGE)

+        # Escape characters out of filenames that will cause problems when
+        # attempting to regex match them later
+        foreach (COVERAGE_FILE ${BOOTSTRAP_COVERAGE_FILES})
+
+            string (REPLACE "\\" "/" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "(" "\\(" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE ")" "\\)" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "[" "\\[" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "]" "\\]" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "*" "\\*" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "+" "\\+" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "$" "\\$" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "^" "\\^" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "}" "\\}" COVERAGE_FILE "${COVERAGE_FILE}")
+            string (REPLACE "{" "\\{" COVERAGE_FILE "${COVERAGE_FILE}")
+
+            list (APPEND ESCAPED_COVERAGE_FILES "${COVERAGE_FILE}")
+
+        endforeach ()
+
         set (_CMAKE_UNIT_COVERAGE_LOGGING_FILES
-             ${BOOTSTRAP_COVERAGE_FILES} PARENT_SCOPE)
+             ${ESCAPED_COVERAGE_FILES} PARENT_SCOPE)

         # Clobber the coverage report
         file (WRITE "${CMAKE_UNIT_COVERAGE_FILE}" "")


config for cx11

config for cx11

--- cxx11_check.cmake
+++ cxx11_check.cmake
@@ -30,7 +30,7 @@

     if( MSVC )                                          ### MS

-        set( ${COMMAND_VAR} "" )
+        set( ${COMMAND_VAR} "-D_VARIADIC_MAX=9" )

     elseif( CMAKE_COMPILER_IS_GNUCXX )                  ### CNU


--- src/vlc.desktop.cmake
+++ src/vlc.desktop.cmake
@@ -18,6 +18,7 @@
 Name[da]=VLC
 Name[de]=VLC
 Name[el]=VLC
+Name[en_GB]=VLC
 Name[es]=VLC
 Name[et]=VLC
 Name[eu]=VLC
@@ -63,6 +64,7 @@
 Comment[da]=Phonon VLC-motor
 Comment[de]=Phonon-Treiber für VLC
 Comment[el]=Σύστημα υποστήριξης Phonon VLC
+Comment[en_GB]=Phonon VLC backend
 Comment[es]=Motor VLC para Phonon
 Comment[et]=Phononi VLC taustaprogramm
 Comment[eu]=Phonon-en VLC bizkarraldekoa


[cmake] bump version number

[cmake] bump version number

need to make a package for internal use

--- version.cmake
+++ version.cmake
@@ -11,7 +11,7 @@

 set(JANCY_VERSION_MAJOR     1)
 set(JANCY_VERSION_MINOR     8)
-set(JANCY_VERSION_REVISION  5)
+set(JANCY_VERSION_REVISION  7)
 set(JANCY_VERSION_TAG)

 set(JANCY_VERSION_FULL "${JANCY_VERSION_MAJOR}.${JANCY_VERSION_MINOR}.${JANCY_VERSION_REVISION}")


Set version to 1.8.0 (#64)

Set version to 1.8.0 (#64)

--- version.cmake
+++ version.cmake
@@ -1,4 +1,4 @@
 # Copyright (C) 2017 Prism Skylabs
 set(ConnectSDK_VERSION_MAJOR 1)
-set(ConnectSDK_VERSION_MINOR 7)
-set(ConnectSDK_VERSION_REVISION 1)
+set(ConnectSDK_VERSION_MINOR 8)
+set(ConnectSDK_VERSION_REVISION 0)


Split off 8.0.62

Split off 8.0.62

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

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


Only follow current branch when describing.

--- version.cmake
+++ version.cmake
@@ -4,7 +4,7 @@

 if (GIT_FOUND)
 	execute_process(
-		COMMAND ${GIT_EXECUTABLE} describe --always --long
+		COMMAND ${GIT_EXECUTABLE} describe --always --long --first-parent
 		RESULT_VARIABLE GIT_DESCRIBE_EXIT
 		OUTPUT_VARIABLE MBC_VERSION
 		OUTPUT_STRIP_TRAILING_WHITESPACE


Graph Control 5.2.0-rc3 Release Candidate 3

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

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


fptu-cmake: check git result codes.

fptu-cmake: check git result codes.

--- cmake.fptu/utils.cmake
+++ cmake.fptu/utils.cmake
@@ -49,27 +49,47 @@
     execute_process(COMMAND ${GIT} describe --tags --long --dirty=-dirty
       OUTPUT_VARIABLE ${name}_GIT_DESCRIBE
       OUTPUT_STRIP_TRAILING_WHITESPACE
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      RESULT_VARIABLE rc)
+    if(rc)
+      message(FATAL_ERROR "Please install latest version of git ('describe --tags --long --dirty' failed)")
+    endif()

     execute_process(COMMAND ${GIT} show --no-patch --format=%cI HEAD
       OUTPUT_VARIABLE ${name}_GIT_TIMESTAMP
       OUTPUT_STRIP_TRAILING_WHITESPACE
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      RESULT_VARIABLE rc)
+    if(rc)
+      message(FATAL_ERROR "Please install latest version of git ('show --no-patch --format=%cI HEAD' failed)")
+    endif()

     execute_process(COMMAND ${GIT} show --no-patch --format=%T HEAD
       OUTPUT_VARIABLE ${name}_GIT_TREE
       OUTPUT_STRIP_TRAILING_WHITESPACE
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      RESULT_VARIABLE rc)
+    if(rc)
+      message(FATAL_ERROR "Please install latest version of git ('show --no-patch --format=%T HEAD' failed)")
+    endif()

     execute_process(COMMAND ${GIT} show --no-patch --format=%H HEAD
       OUTPUT_VARIABLE ${name}_GIT_COMMIT
       OUTPUT_STRIP_TRAILING_WHITESPACE
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      RESULT_VARIABLE rc)
+    if(rc)
+      message(FATAL_ERROR "Please install latest version of git ('show --no-patch --format=%H HEAD' failed)")
+    endif()

     execute_process(COMMAND ${GIT} rev-list --count --no-merges HEAD
       OUTPUT_VARIABLE ${name}_GIT_REVISION
       OUTPUT_STRIP_TRAILING_WHITESPACE
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      RESULT_VARIABLE rc)
+    if(rc)
+      message(FATAL_ERROR "Please install latest version of git ('rev-list --count --no-merges HEAD' failed)")
+    endif()

     string(REGEX MATCH "^(v)?([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?" git_version_valid "${${name}_GIT_DESCRIBE}")
     if(git_version_valid)


Remove OPENMS_CHECKLIB macro

Remove OPENMS_CHECKLIB macro

BALL obviously shouldn't use that...

--- cmake/BALLMacros.cmake
+++ cmake/BALLMacros.cmake
@@ -1,25 +1,3 @@
-## fills ${varname} with the names of Debug and Release libraries (which usually only differ on MSVC)
-## @param varname Name of the variable which will hold the result string (e.g. "optimized myLib.so debug myLibDebug.so")
-## @param libnames   List of library names which are searched (release libs)
-## @param libnames_d List of library names which are searched (debug libs)
-## @param human_libname Name of the library (for display only)
-MACRO (OPENMS_CHECKLIB varname libnames libnames_d human_libname)
-	FIND_LIBRARY(${varname}_OPT NAMES ${libnames} PATHS ${CONTRIB_LIB_DIR} DOC "${human_libname} library dir" NO_DEFAULT_PATH)
-	if ("${varname}_OPT" STREQUAL "${varname}_OPT-NOTFOUND")
-		MESSAGE(FATAL_ERROR "Unable to find ${human_libname} library! Searched names are: [${libnames}] Please make sure it is part of the contrib (which we assume to be at: ${CONTRIB_DIR}")
-	else()
-		MESSAGE(STATUS "Found ${human_libname} library (Release) at: " ${${varname}_OPT})
-	endif()
-	FIND_LIBRARY(${varname}_DBG NAMES ${libnames_d} PATHS ${CONTRIB_LIB_DIR} DOC "${human_libname} (Debug) library dir" NO_DEFAULT_PATH)
-	if ("${varname}_DBG" STREQUAL "${varname}_DBG-NOTFOUND")
-		MESSAGE(FATAL_ERROR "Unable to find ${human_libname} (Debug) library! Searched names are: [${libnames_d}] Please make sure it is part of the contrib (which we assume to be at: ${CONTRIB_DIR}")
-	else()
-		MESSAGE(STATUS "Found ${human_libname} library (Debug) at: " ${${varname}_DBG})
-	endif()
-	## combine result and include "optimized" and "debug" keywords which are essential for target_link_libraries()
-	set(${varname} optimized ${${varname}_OPT} debug ${${varname}_DBG})
-ENDMACRO (OPENMS_CHECKLIB)
-
 ### This macro is a terrible ugly hack and if life was fair, it would never exist.
 ### However, the QT4_WRAP_UI - macro from FindQt4.cmake does not allow changing the
 ### output directory, and the default choice is unacceptable.


Revert previous commit, enable xcursor for cmake builds

Signed-off-by: falkTX <d7e5958cbb080ba57e41fb602ade747e1a2da17c@falktx.com>

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -468,9 +468,9 @@
   if(NOT APPLE)
     target_sources(dgl-cairo PRIVATE
       "${DPF_ROOT_DIR}/dgl/src/pugl.cpp")
-  else()
-    target_sources(dgl-opengl PRIVATE
-     "${DPF_ROOT_DIR}/dgl/src/pugl.mm")
+  else() # Note: macOS pugl will be built as part of DistrhoUI_macOS.mm
+    #target_sources(dgl-opengl PRIVATE
+    #  "${DPF_ROOT_DIR}/dgl/src/pugl.mm")
   endif()
   target_include_directories(dgl-cairo PUBLIC
     "${DPF_ROOT_DIR}/dgl")
@@ -530,9 +530,9 @@
   if(NOT APPLE)
     target_sources(dgl-opengl PRIVATE
       "${DPF_ROOT_DIR}/dgl/src/pugl.cpp")
-  else()
-    target_sources(dgl-opengl PRIVATE
-      "${DPF_ROOT_DIR}/dgl/src/pugl.mm")
+  else() # Note: macOS pugl will be built as part of DistrhoUI_macOS.mm
+    #target_sources(dgl-opengl PRIVATE
+    #  "${DPF_ROOT_DIR}/dgl/src/pugl.mm")
   endif()
   target_include_directories(dgl-opengl PUBLIC
     "${DPF_ROOT_DIR}/dgl")
@@ -596,22 +596,22 @@
     target_include_directories(dgl-system-libs INTERFACE "${X11_INCLUDE_DIR}")
     target_link_libraries(dgl-system-libs INTERFACE "${X11_X11_LIB}")
     target_compile_definitions(dgl-system-libs-definitions INTERFACE "HAVE_X11")
+    if(X11_Xcursor_FOUND)
+      target_link_libraries(dgl-system-libs INTERFACE "${X11_Xcursor_LIB}")
+      target_compile_definitions(dgl-system-libs-definitions INTERFACE "HAVE_XCURSOR")
+    endif()
     if(X11_Xext_FOUND)
       target_link_libraries(dgl-system-libs INTERFACE "${X11_Xext_LIB}")
       target_compile_definitions(dgl-system-libs-definitions INTERFACE "HAVE_XEXT")
+    endif()
+    if(X11_Xrandr_FOUND)
+      target_link_libraries(dgl-system-libs INTERFACE "${X11_Xrandr_LIB}")
+      target_compile_definitions(dgl-system-libs-definitions INTERFACE "HAVE_XRANDR")
     endif()
     if(X11_XSync_FOUND)
       target_link_libraries(dgl-system-libs INTERFACE "${X11_XSync_LIB}")
       target_compile_definitions(dgl-system-libs-definitions INTERFACE "HAVE_XSYNC")
     endif()
-    if(X11_Xrandr_FOUND)
-      target_link_libraries(dgl-system-libs INTERFACE "${X11_Xrandr_LIB}")
-      target_compile_definitions(dgl-system-libs-definitions INTERFACE "HAVE_XRANDR")
-    endif()
-    #if(X11_Xcursor_FOUND)
-    #  target_link_libraries(dgl-system-libs INTERFACE "${X11_Xcursor_LIB}")
-    #  target_compile_definitions(dgl-system-libs-definitions INTERFACE "HAVE_XCURSOR")
-    #endif()
    endif()

    if(MSVC)


FindDCMTK2 can now use RelWithDebugInfo builds and finds dcmjpls

--- cmake/FindDCMTK2.cmake
+++ cmake/FindDCMTK2.cmake
@@ -15,41 +15,69 @@
 # Written for VXL by Amitha Perera.
 #

-UNSET(DCMTK_FOUND)
+unset(DCMTK_FOUND)

 # Construct consitent error messages for use below.
-SET(DCMTK_DIR_DESCRIPTION "directory containing DCMTK install files.  This is either the root of the build or install tree.")
-SET(DCMTK_SOURCE_DIR_DESCRIPTION "directory containing DCMTK source files.  This is root of the source tree.")
-SET(DCMTK_DIR_MESSAGE "DCMTK not found.  Set the DCMTK_DIR cmake cache entry to the ${DCMTK_DIR_DESCRIPTION}")
-SET(DCMTK_SOURCE_DIR_MESSAGE "DCMTK not found.  Set the DCMTK_SOURCE_DIR cmake cache entry to the ${DCMTK_SOURCE_DIR_DESCRIPTION}")
-
-SET(DCMTK_DIR $ENV{DCMTK_DIR})
-SET(DCMTK_SOURCE_DIR $ENV{DCMTK_SOURCE_DIR})
-
-FIND_PATH( DCMTK_root_INCLUDE_DIR dcmtk/config/osconfig.h
+set(DCMTK_DIR_DESCRIPTION "directory containing DCMTK install files.  This is either the root of the build or install tree.")
+set(DCMTK_SOURCE_DIR_DESCRIPTION "directory containing DCMTK source files.  This is root of the source tree.")
+set(DCMTK_DIR_MESSAGE "DCMTK not found.  Set the DCMTK_DIR cmake cache entry to the ${DCMTK_DIR_DESCRIPTION}")
+set(DCMTK_SOURCE_DIR_MESSAGE "DCMTK not found.  Set the DCMTK_SOURCE_DIR cmake cache entry to the ${DCMTK_SOURCE_DIR_DESCRIPTION}")
+
+set(DCMTK_DIR $ENV{DCMTK_DIR})
+set(DCMTK_SOURCE_DIR $ENV{DCMTK_SOURCE_DIR})
+
+find_path( DCMTK_root_INCLUDE_DIR dcmtk/config/osconfig.h
   PATHS
   ${DCMTK_DIR}/include
   ${DCMTK_DIR}/config/include
 )

-FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
-  ${DCMTK_DIR}/config/include
-  ${DCMTK_DIR}/include/config
-  ${DCMTK_DIR}/include/dcmtk/config
-  ${DCMTK_DIR}/config/include/dcmtk/config
-)
-
-FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
-  ${DCMTK_DIR}/ofstd/include
-  ${DCMTK_DIR}/include/ofstd
-  ${DCMTK_DIR}/include/dcmtk/ofstd
-)
-
-IF(NOT DCMTK_ofstd_INCLUDE_DIR)
-  FIND_PATH( DCMTK_ofstd_INCLUDE_DIR dcmtk/ofstd/ofstdinc.h
-    ${DCMTK_SOURCE_DIR}/ofstd/include
-  )
-ENDIF(NOT DCMTK_ofstd_INCLUDE_DIR)
+# A list of (incName,incFile) pairs specifying the name to generate and the file to search for.
+# DCMTK_${incName}_INCLUDE_DIR is set by finding ${incFile}
+set(dcmtk_INCLUDE_DIR_NAMES_FILES
+  config    osconfig.h
+  ofstd     ofstdinc.h
+  oflog     logger.h
+  dcmdata   dctypes.h
+  dcmimgle  dcmimage.h
+  dcmjpeg   djdecode.h
+  dcmjpls   djlsutil.h
+  )
+
+# A list of libraries to search for.
+# DCMTK_${libName}_LIBRARY and optionally, DCMTK_${libName}_LIBRARY_DEBUG are set.
+set(dcmtk_LIBRARY_NAMES
+  ofstd oflog dcmdata dcmimgle dcmjpeg ijg8 ijg12 ijg16 dcmqrdb dcmnet dcmjpls charls
+  )
+
+#Loop over include dirs, find them.
+list(LENGTH dcmtk_INCLUDE_DIR_NAMES_FILES dcmtk_INCLUDE_DIR_NAMES_FILES_LEN)
+
+set(elemNum 0)
+while(${elemNum} LESS ${dcmtk_INCLUDE_DIR_NAMES_FILES_LEN} )
+  list(GET dcmtk_INCLUDE_DIR_NAMES_FILES ${elemNum} incName)
+  math(EXPR elemNum "${elemNum} + 1")
+  list(GET dcmtk_INCLUDE_DIR_NAMES_FILES ${elemNum} incFile)
+  math(EXPR elemNum "${elemNum} + 1")
+
+  find_path( DCMTK_${incName}_INCLUDE_DIR ${incFile}
+    ${DCMTK_DIR}/${incName}/include
+    ${DCMTK_DIR}/include/${incName}
+    ${DCMTK_DIR}/include/dcmtk/${incName}
+    ${DCMTK_DIR}/config/include/dcmtk/${incName}
+  )
+
+  if(NOT DCMTK_${incName}_INCLUDE_DIR)
+    find_path( DCMTK_${incName}_INCLUDE_DIR dcmtk/${incName}/${incFile}
+      ${DCMTK_SOURCE_DIR}/${incName}/include
+    )
+  endif()
+
+  if(NOT DCMTK_${incName}_INCLUDE_DIR)
+    message(WARNING "FindDCMTK2.cmake : DCMTK_${incName}_INCLUDE_DIR=${DCMTK_${incName}_INCLUDE_DIR}")
+  endif()
+endwhile()
+

 get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)

@@ -61,196 +89,48 @@
   endif()
 endif()

-FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
-  ${DCMTK_DIR}/ofstd/libsrc
-  ${DCMTK_DIR}/ofstd/libsrc/Release
-  ${DCMTK_DIR}/ofstd/Release
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_ofstd_LIBRARY_DEBUG ofstd
-  ${DCMTK_DIR}/ofstd/libsrc/Debug
-  ${DCMTK_DIR}/ofstd/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_PATH( DCMTK_oflog_INCLUDE_DIR logger.h
-  ${DCMTK_DIR}/oflog/include
-  ${DCMTK_DIR}/include/oflog
-  ${DCMTK_DIR}/include/dcmtk/oflog
-)
-
-IF(NOT DCMTK_oflog_INCLUDE_DIR)
-  FIND_PATH( DCMTK_oflog_INCLUDE_DIR dcmtk/oflog/logger.h
-    ${DCMTK_SOURCE_DIR}/oflog/include
-  )
-ENDIF(NOT DCMTK_oflog_INCLUDE_DIR)
-
-FIND_LIBRARY( DCMTK_oflog_LIBRARY oflog
-  ${DCMTK_DIR}/oflog/libsrc
-  ${DCMTK_DIR}/oflog/libsrc/Release
-  ${DCMTK_DIR}/oflog/Release
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_oflog_LIBRARY_DEBUG oflog
-  ${DCMTK_DIR}/oflog/libsrc/Debug
-  ${DCMTK_DIR}/oflog/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
-  ${DCMTK_DIR}/dcmdata/include
-  ${DCMTK_DIR}/include/dcmdata
-  ${DCMTK_DIR}/include/dcmtk/dcmdata
-)
-
-IF(NOT DCMTK_dcmdata_INCLUDE_DIR)
-  FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dcmtk/dcmdata/dctypes.h
-    ${DCMTK_SOURCE_DIR}/dcmdata/include
-  )
-ENDIF(NOT DCMTK_dcmdata_INCLUDE_DIR)
-
-FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
-  ${DCMTK_DIR}/dcmdata/libsrc
-  ${DCMTK_DIR}/dcmdata/libsrc/Release
-  ${DCMTK_DIR}/dcmdata/Release
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_dcmdata_LIBRARY_DEBUG dcmdata
-  ${DCMTK_DIR}/dcmdata/libsrc/Debug
-  ${DCMTK_DIR}/dcmdata/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
-  ${DCMTK_DIR}/dcmimgle/include
-  ${DCMTK_DIR}/include/dcmimgle
-  ${DCMTK_DIR}/include/dcmtk/dcmimgle
-)
-
-IF(NOT DCMTK_dcmimgle_INCLUDE_DIR)
-  FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmtk/dcmimgle/dcmimage.h
-    ${DCMTK_SOURCE_DIR}/dcmimgle/include
-  )
-ENDIF(NOT DCMTK_dcmimgle_INCLUDE_DIR)
-
-FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
-  ${DCMTK_DIR}/dcmimgle/libsrc
-  ${DCMTK_DIR}/dcmimgle/libsrc/Release
-  ${DCMTK_DIR}/dcmimgle/Release
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY_DEBUG dcmimgle
-  ${DCMTK_DIR}/dcmimgle/libsrc/Debug
-  ${DCMTK_DIR}/dcmimgle/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_PATH( DCMTK_dcmjpeg_INCLUDE_DIR djdecode.h
-  ${DCMTK_DIR}/dcmjpeg/include
-  ${DCMTK_DIR}/include/dcmjpeg
-  ${DCMTK_DIR}/include/dcmtk/dcmjpeg
-)
-
-IF(NOT DCMTK_dcmjpeg_INCLUDE_DIR)
-  FIND_PATH( DCMTK_dcmjpeg_INCLUDE_DIR dcmtk/dcmjpeg/djdecode.h
-    ${DCMTK_SOURCE_DIR}/dcmjpeg/include
-  )
-ENDIF(NOT DCMTK_dcmjpeg_INCLUDE_DIR)
-
-FIND_LIBRARY( DCMTK_dcmjpeg_LIBRARY dcmjpeg
-  ${DCMTK_DIR}/dcmjpeg/libsrc
-  ${DCMTK_DIR}/dcmjpeg/libsrc/Release
-  ${DCMTK_DIR}/dcmjpeg/Release
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_dcmjpeg_LIBRARY_DEBUG dcmjpeg
-  ${DCMTK_DIR}/dcmjpeg/libsrc/Debug
-  ${DCMTK_DIR}/dcmjpeg/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_ijg8_LIBRARY ijg8
-  ${DCMTK_DIR}/dcmjpeg/libijg8/
-  ${DCMTK_DIR}/dcmjpeg/libijg8/Release
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_ijg8_LIBRARY_DEBUG ijg8
-  ${DCMTK_DIR}/dcmjpeg/libijg8/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_ijg12_LIBRARY ijg12
-  ${DCMTK_DIR}/dcmjpeg/libijg12/
-  ${DCMTK_DIR}/dcmjpeg/libijg12/Release
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_ijg12_LIBRARY_DEBUG ijg12
-  ${DCMTK_DIR}/dcmjpeg/libijg12/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_ijg16_LIBRARY ijg16
-  ${DCMTK_DIR}/dcmjpeg/libijg16/
-  ${DCMTK_DIR}/dcmjpeg/libijg16/Release
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY( DCMTK_ijg16_LIBRARY_DEBUG ijg16
-  ${DCMTK_DIR}/dcmjpeg/libijg16/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY(DCMTK_dcmqrdb_LIBRARY dcmqrdb
-  ${DCMTK_DIR}/dcmqrdb/libsrc/Release
-  ${DCMTK_DIR}/dcmqrdb/libsrc/
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY(DCMTK_dcmqrdb_LIBRARY_DEBUG dcmqrdb
-  ${DCMTK_DIR}/dcmqrdb/libsrc/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
-  ${DCMTK_DIR}/dcmnet/libsrc/Release
-  ${DCMTK_DIR}/dcmnet/libsrc/
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-FIND_LIBRARY(DCMTK_dcmnet_LIBRARY_DEBUG dcmnet
-  ${DCMTK_DIR}/dcmnet/libsrc/Debug
-  ${DCMTK_DIR}/lib${LIBSUFFIX}
-  ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
-)
-
-
-IF( DCMTK_root_INCLUDE_DIR
+# Loop over libraries, finding them.
+foreach(libName ${dcmtk_LIBRARY_NAMES})
+
+  find_library( DCMTK_${libName}_LIBRARY ${libName}
+    ${DCMTK_DIR}/${libName}/libsrc
+    ${DCMTK_DIR}/${libName}/libsrc/Release
+    ${DCMTK_DIR}/${libName}/Release
+    ${DCMTK_DIR}/${libName}/libsrc/RelWithDebInfo
+    ${DCMTK_DIR}/${libName}/RelWithDebInfo
+    ${DCMTK_DIR}/${libName}/libsrc/MinSizeRel
+    ${DCMTK_DIR}/${libName}/MinSizeRel
+    ${DCMTK_DIR}/dcmjpeg/lib${libName}
+    ${DCMTK_DIR}/dcmjpeg/lib${libName}/Release
+    ${DCMTK_DIR}/dcmjpeg/lib${libName}/RelWithDebInfo
+    ${DCMTK_DIR}/dcmjpeg/lib${libName}/MinSizeRel
+    ${DCMTK_DIR}/dcmjpls/lib${libName}
+    ${DCMTK_DIR}/dcmjpls/lib${libName}/Release
+    ${DCMTK_DIR}/dcmjpls/lib${libName}/RelWithDebInfo
+    ${DCMTK_DIR}/dcmjpls/lib${libName}/MinSizeRel
+    ${DCMTK_DIR}/lib${LIBSUFFIX}
+    ${DCMTK_DIR}/lib${LIBSUFFIX}/dcmtk
+    ${DCMTK_DIR}/lib${LIBSUFFIX}/Release
+    ${DCMTK_DIR}/lib${LIBSUFFIX}/RelWithDebInfo
+    ${DCMTK_DIR}/lib${LIBSUFFIX}/MinSizeRel
+  )
+
+ find_library( DCMTK_${libName}_LIBRARY_DEBUG ${libName}
+    ${DCMTK_DIR}/${libName}/libsrc/Debug
+    ${DCMTK_DIR}/${libName}/Debug
+    ${DCMTK_DIR}/lib${LIBSUFFIX}/Debug
+    ${DCMTK_DIR}/dcmjpeg/lib${libName}/Debug
+    ${DCMTK_DIR}/dcmjpls/lib${libName}/Debug
+  )
+
+  if(NOT DCMTK_${libName}_LIBRARY)
+    message(WARNING "FindDCMTK2.cmake : DCMTK_${libName}_LIBRARY=${DCMTK_${libName}_LIBRARY}")
+  endif()
+
+endforeach()
+
+
+if( DCMTK_root_INCLUDE_DIR
     AND DCMTK_config_INCLUDE_DIR
     AND DCMTK_ofstd_INCLUDE_DIR
     AND DCMTK_ofstd_LIBRARY
@@ -258,132 +138,137 @@
     AND DCMTK_dcmdata_LIBRARY
     AND DCMTK_dcmimgle_INCLUDE_DIR
     AND DCMTK_dcmimgle_LIBRARY
-    AND DCMTK_dcmjpeg_LIBRARY )
-
-  SET( DCMTK_FOUND 1)
-
-  SET( DCMTK_INCLUDE_DIR
+    AND DCMTK_dcmjpeg_LIBRARY
+    AND DCMTK_dcmjpls_LIBRARY
+    AND DCMTK_dcmjpls_INCLUDE_DIR)
+
+  set( DCMTK_FOUND 1)
+
+  set( DCMTK_INCLUDE_DIR
     ${DCMTK_root_INCLUDE_DIR}
     ${DCMTK_config_INCLUDE_DIR}
     ${DCMTK_ofstd_INCLUDE_DIR}
     ${DCMTK_dcmdata_INCLUDE_DIR}
     ${DCMTK_dcmimgle_INCLUDE_DIR}
     ${DCMTK_dcmjpeg_INCLUDE_DIR}
-  )
-  IF( WIN32 )
+    ${DCMTK_dcmjpls_INCLUDE_DIR}
+  )
+  if( WIN32 )
     set (OPTIMIZED optimized)
   endif(WIN32)

-  SET( DCMTK_LIBRARIES
+  set( DCMTK_LIBRARIES
     ${OPTIMIZED} ${DCMTK_dcmjpeg_LIBRARY}
     ${OPTIMIZED} ${DCMTK_ijg8_LIBRARY}
     ${OPTIMIZED} ${DCMTK_ijg12_LIBRARY}
     ${OPTIMIZED} ${DCMTK_ijg16_LIBRARY}
     ${OPTIMIZED} ${DCMTK_dcmimgle_LIBRARY}
     ${OPTIMIZED} ${DCMTK_dcmdata_LIBRARY}
-  )
-  SET (DCMTK_LIBRARIES_DEBUG
+    ${OPTIMIZED} ${DCMTK_charls_LIBRARY}
+    ${OPTIMIZED} ${DCMTK_dcmjpls_LIBRARY}
+  )
+  set (DCMTK_LIBRARIES_DEBUG
     debug     ${DCMTK_dcmjpeg_LIBRARY_DEBUG}
     debug     ${DCMTK_ijg8_LIBRARY_DEBUG}
     debug     ${DCMTK_ijg12_LIBRARY_DEBUG}
     debug     ${DCMTK_ijg16_LIBRARY_DEBUG}
     debug     ${DCMTK_dcmimgle_LIBRARY_DEBUG}
     debug     ${DCMTK_dcmdata_LIBRARY_DEBUG}
-  )
-
-  IF ( DCMTK_oflog_LIBRARY )#oflog only in dcmtk>=3.5.5
-    SET( DCMTK_INCLUDE_DIR
+    debug     ${DCMTK_charls_LIBRARY_DEBUG}
+    debug     ${DCMTK_dcmjpls_LIBRARY_DEBUG}
+  )
+
+  if ( DCMTK_oflog_LIBRARY )#oflog only in dcmtk>=3.5.5
+    set( DCMTK_INCLUDE_DIR
       ${DCMTK_oflog_INCLUDE_DIR}
       ${DCMTK_INCLUDE_DIR}
     )
-    SET( DCMTK_LIBRARIES
+    set( DCMTK_LIBRARIES
       ${DCMTK_LIBRARIES}
       ${OPTIMIZED} ${DCMTK_oflog_LIBRARY} #must be defined before ofstd
     )
-    SET( DCMTK_LIBRARIES_DEBUG
+    set( DCMTK_LIBRARIES_DEBUG
       ${DCMTK_LIBRARIES_DEBUG}
       debug     ${DCMTK_oflog_LIBRARY_DEBUG} #must be defined before ofstd
     )

-  ENDIF ( DCMTK_oflog_LIBRARY )
+  endif ( DCMTK_oflog_LIBRARY )

-  SET( DCMTK_LIBRARIES
+  set( DCMTK_LIBRARIES
    ${DCMTK_LIBRARIES}
    ${OPTIMIZED} ${DCMTK_ofstd_LIBRARY}
-#   ${OPTIMIZED} ${DCMTK_config_LIBRARY}
-  )
-  SET( DCMTK_LIBRARIES_DEBUG
+  )
+  set( DCMTK_LIBRARIES_DEBUG
    ${DCMTK_LIBRARIES_DEBUG}
    debug     ${DCMTK_ofstd_LIBRARY_DEBUG}
-#  debug     ${DCMTK_config_LIBRARY_DEBUG}
-  )
-
-
-  IF(NOT WIN32)
-    SET( DCMTK_LIBRARIES
+  )
+
+
+  if(NOT WIN32)
+    set( DCMTK_LIBRARIES
     ${DCMTK_LIBRARIES}
     z
     )
-  ENDIF(NOT WIN32)
+  endif(NOT WIN32)

-IF(DCMTK_dcmqrdb_LIBRARY)
-  SET( DCMTK_LIBRARIES
+if(DCMTK_dcmqrdb_LIBRARY)
+  set( DCMTK_LIBRARIES
     ${OPTIMIZED} ${DCMTK_dcmqrdb_LIBRARY}
     ${DCMTK_LIBRARIES}
     )
-  SET( DCMTK_LIBRARIES_DEBUG
+  set( DCMTK_LIBRARIES_DEBUG
     debug     ${DCMTK_dcmqrdb_LIBRARY_DEBUG}
     ${DCMTK_LIBRARIES_DEBUG}
     )

-ENDIF(DCMTK_dcmqrdb_LIBRARY)
-
-IF(DCMTK_dcmnet_LIBRARY)
-
-  FIND_PATH( DCMTK_dcmnet_INCLUDE_DIR assoc.h
+endif(DCMTK_dcmqrdb_LIBRARY)
+
+if(DCMTK_dcmnet_LIBRARY)
+
+  find_path( DCMTK_dcmnet_INCLUDE_DIR assoc.h
     ${DCMTK_DIR}/dcmnet/include
     ${DCMTK_DIR}/include/dcmnet
     ${DCMTK_DIR}/include/dcmtk/dcmnet
   )

-  IF(NOT DCMTK_dcmnet_INCLUDE_DIR)
-    FIND_PATH( DCMTK_dcmnet_INCLUDE_DIR dcmtk/dcmnet/assoc.h
+  if(NOT DCMTK_dcmnet_INCLUDE_DIR)
+    find_path( DCMTK_dcmnet_INCLUDE_DIR dcmtk/dcmnet/assoc.h
       ${DCMTK_SOURCE_DIR}/dcmnet/include
     )
-  ENDIF(NOT DCMTK_dcmnet_INCLUDE_DIR)
-
-  SET( DCMTK_INCLUDE_DIR
+  endif(NOT DCMTK_dcmnet_INCLUDE_DIR)
+
+  set( DCMTK_INCLUDE_DIR
     ${DCMTK_dcmnet_INCLUDE_DIR}
     ${DCMTK_INCLUDE_DIR}
     )

-  SET( DCMTK_LIBRARIES
+  set( DCMTK_LIBRARIES
     ${OPTIMIZED} ${DCMTK_dcmnet_LIBRARY}
     ${DCMTK_LIBRARIES}
     )
-  SET( DCMTK_LIBRARIES_DEBUG
+  set( DCMTK_LIBRARIES_DEBUG
     debug ${DCMTK_dcmnet_LIBRARY_DEBUG}
     ${DCMTK_LIBRARIES_DEBUG}
     )

     if (UNIX)
-    SET( DCMTK_LIBRARIES
+    set( DCMTK_LIBRARIES
     ${DCMTK_LIBRARIES}
     wrap
     )
     endif (UNIX)
-ENDIF(DCMTK_dcmnet_LIBRARY)
-
-IF( WIN32 )
-  SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
-  IF ( DCMTK_dcmdata_LIBRARY_DEBUG )
-      SET (DCMTK_LIBRARIES
+endif(DCMTK_dcmnet_LIBRARY)
+
+if( WIN32 )
+  set( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
+  if ( DCMTK_dcmdata_LIBRARY_DEBUG )
+      set (DCMTK_LIBRARIES
           ${DCMTK_LIBRARIES}
           ${DCMTK_LIBRARIES_DEBUG})
-  ENDIF( DCMTK_dcmdata_LIBRARY_DEBUG)
-ENDIF( WIN32 )
-
-ENDIF( DCMTK_root_INCLUDE_DIR
+  endif( DCMTK_dcmdata_LIBRARY_DEBUG)
+endif( WIN32 )
+
+endif( DCMTK_root_INCLUDE_DIR
     AND DCMTK_config_INCLUDE_DIR
     AND DCMTK_ofstd_INCLUDE_DIR
     AND DCMTK_ofstd_LIBRARY
@@ -391,22 +276,24 @@
     AND DCMTK_dcmdata_LIBRARY
     AND DCMTK_dcmimgle_INCLUDE_DIR
     AND DCMTK_dcmimgle_LIBRARY
-    AND DCMTK_dcmjpeg_LIBRARY )
+    AND DCMTK_dcmjpeg_LIBRARY
+    AND DCMTK_dcmjpls_LIBRARY
+    AND DCMTK_dcmjpls_INCLUDE_DIR)

 #-----------------------------------------------------------------------------
-IF(NOT DCMTK_FOUND)
-
-  SET( DCMTK_DIR "" CACHE PATH ${DCMTK_DIR_MESSAGE} )
-  SET( DCMTK_SOURCE_DIR "" CACHE PATH ${DCMTK_SOURCE_DIR_MESSAGE} )
-
+if(NOT DCMTK_FOUND)
+
+  set( DCMTK_DIR "" CACHE PATH ${DCMTK_DIR_MESSAGE} )
+  set( DCMTK_SOURCE_DIR "" CACHE PATH ${DCMTK_SOURCE_DIR_MESSAGE} )
+
   # DCMTK not found, explain to the user how to specify its location.
-  IF(DCMTK2_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR ${DCMTK_DIR_MESSAGE})
-  ELSE(DCMTK2_FIND_REQUIRED)
-    IF(NOT DCMTK2_FIND_QUIETLY)
-      MESSAGE(STATUS ${DCMTK_DIR_MESSAGE})
-    ENDIF(NOT DCMTK2_FIND_QUIETLY)
-  ENDIF(DCMTK2_FIND_REQUIRED)
+  if(DCMTK2_FIND_REQUIRED)
+    message(FATAL_ERROR ${DCMTK_DIR_MESSAGE})
+  else(DCMTK2_FIND_REQUIRED)
+    if(NOT DCMTK2_FIND_QUIETLY)
+      message(STATUS ${DCMTK_DIR_MESSAGE})
+    endif(NOT DCMTK2_FIND_QUIETLY)
+  endif(DCMTK2_FIND_REQUIRED)

-ENDIF()
+endif()


Do not write the found message

Do not write the found message

It is handled by CMake itself anyway.

--- cmake/FindDEXELA.cmake
+++ cmake/FindDEXELA.cmake
@@ -17,5 +17,3 @@
     DEXELA_INCLUDE_DIRS
     DEXELA_LIBRARIES
 )
-
-message("-- Dexela libraries found: ${DEXELA_FOUND}")


[cmake] FindMATLAB: correctly get extension on win

--- cmake/FindMATLAB.cmake
+++ cmake/FindMATLAB.cmake
@@ -111,6 +111,12 @@
     "${MATLAB_ROOT}/extern/include"
     )

+   EXECUTE_PROCESS(
+       COMMAND "${MATLAB_ROOT}/bin/mexext.bat"
+       OUTPUT_VARIABLE MATLAB_MEXEXT
+       OUTPUT_STRIP_TRAILING_WHITESPACE
+       )
+
 ELSE(WIN32)

   IF((NOT DEFINED MATLAB_ROOT)


[cmake] FindMATLAB: also look for 7.12

[cmake] FindMATLAB: also look for 7.12

--- cmake/FindMATLAB.cmake
+++ cmake/FindMATLAB.cmake
@@ -40,7 +40,7 @@
 SET(MATLAB_FOUND 0)
 IF(WIN32)
   # Search for a version of Matlab available, starting from the most modern one to older versions
-  FOREACH(MATVER "7.14" "7.11" "7.10" "7.9" "7.8" "7.7" "7.6" "7.5" "7.4")
+  FOREACH(MATVER "7.14" "7.12" "7.11" "7.10" "7.9" "7.8" "7.7" "7.6" "7.5" "7.4")
     IF((NOT DEFINED MATLAB_ROOT)
         OR ("${MATLAB_ROOT}" STREQUAL "")
         OR ("${MATLAB_ROOT}" STREQUAL "/registry"))


[cmake] FindOctave: search cruft only for < 3.8.0

--- cmake/FindOctave.cmake
+++ cmake/FindOctave.cmake
@@ -114,14 +114,16 @@
                NAMES octave liboctave
                HINTS ${OCTAVE_LIBRARIES_PATHS}
              )
- find_library( OCTAVE_CRUFT_LIBRARY
-               NAMES cruft libcruft
-               HINTS ${OCTAVE_LIBRARIES_PATHS}
-             )

  set ( OCTAVE_LIBRARIES ${OCTAVE_OCTINTERP_LIBRARY} )
  list ( APPEND OCTAVE_LIBRARIES ${OCTAVE_OCTAVE_LIBRARY} )
- list ( APPEND OCTAVE_LIBRARIES ${OCTAVE_CRUFT_LIBRARY} )
+
+ if (OCTAVE_VERSION_STRING LESS 3.8.0)
+     find_library( OCTAVE_CRUFT_LIBRARY
+                   NAMES cruft libcruft
+                  HINTS ${OCTAVE_LIBRARIES_PATHS})
+     list ( APPEND OCTAVE_LIBRARIES ${OCTAVE_CRUFT_LIBRARY} )
+ endif ()

  find_path ( OCTAVE_INCLUDE_DIR
              NAMES mex.h


force zlib version to 1.2.8

force zlib version to 1.2.8

--- cmake/ImportZLIB.cmake
+++ cmake/ImportZLIB.cmake
@@ -1,4 +1,4 @@
-find_package(ZLIB)
+find_package(ZLIB 1.2.8)
 mark_as_advanced(ZLIB_INCLUDE_DIR)
 mark_as_advanced(ZLIB_LIBRARY)
 if(ZLIB_FOUND)


dont build tests by default

dont build tests by default

--- cmake/SetupGTest.cmake
+++ cmake/SetupGTest.cmake
@@ -9,6 +9,7 @@
     # disable install step
     INSTALL_COMMAND ""
 )
+set_target_properties(googletest PROPERTIES EXCLUDE_FROM_ALL TRUE)

 # specify include dir
 ExternalProject_Get_Property(googletest source_dir)


add WindowsDriver to llvm_raw_libs

add WindowsDriver to llvm_raw_libs

Upstream https://reviews.llvm.org/D118070 added a new
llvm raw lib LLVMWindowsDriver and this caused bcc
compilation error like below:

  ...
  /home/yhs/work/bcc/build/src/cc/libbcc.so: undefined reference to
    `llvm::getUniversalCRTSdkDir(llvm::vfs::FileSystem&,
     llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>,
     llvm::Optional<llvm::StringRef>,
     std::__cxx11::basic_string<char, std::char_traits<char>,
     std::allocator<char> >&,
     std::__cxx11::basic_string<char, std::char_traits<char>,
     std::allocator<char> >&)'
  /home/yhs/work/bcc/build/src/cc/libbcc.so: undefined reference to
     `llvm::useUniversalCRT(llvm::ToolsetLayout,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > const&, llvm::Triple::ArchType,
      llvm::vfs::FileSystem&)'
  ...

Add this library explicitly for llvm >= 15 and
Compilation succeeded.

Signed-off-by: Yonghong Song <e76892bbe783db2f627de1232e139db4de43da60@fb.com>

--- cmake/clang_libs.cmake
+++ cmake/clang_libs.cmake
@@ -21,6 +21,9 @@
 if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 6 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 6)
   list(APPEND llvm_raw_libs bpfasmparser)
   list(APPEND llvm_raw_libs bpfdisassembler)
+endif()
+if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 15 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 15)
+  list(APPEND llvm_raw_libs windowsdriver)
 endif()
 llvm_map_components_to_libnames(_llvm_libs ${llvm_raw_libs})
 llvm_expand_dependencies(llvm_libs ${_llvm_libs})


cmake: extensions: fix copy/paste issues in DT error messages

These were copied from dt_reg_addr and not changed.

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

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -2734,12 +2734,12 @@
   cmake_parse_arguments(DT_REG "" "${req_single_args};${single_args}" "" ${ARGN})

   if(${ARGV0} IN_LIST req_single_args)
-    message(FATAL_ERROR "dt_reg_addr(${ARGV0} ...) missing return parameter.")
+    message(FATAL_ERROR "dt_reg_size(${ARGV0} ...) missing return parameter.")
   endif()

   foreach(arg ${req_single_args})
     if(NOT DEFINED DT_REG_${arg})
-      message(FATAL_ERROR "dt_reg_addr(${ARGV0} ...) "
+      message(FATAL_ERROR "dt_reg_size(${ARGV0} ...) "
                           "missing required argument: ${arg}"
       )
     endif()


Add "-ldl" for static linking

Add "-ldl" for static linking

Hi Rado,

to fix dirac.x static linking ( OpenMPI+GNU+OPENBLAS ) I had to inser -ldl after -lpthread command.

Please proprage it into DIRAC repo. Thanks.

--- modules/math_libs.cmake
+++ modules/math_libs.cmake
@@ -506,7 +506,7 @@
         BLAS_TYPE MATCHES SYSTEM_NATIVE OR
         BLAS_TYPE MATCHES OPENBLAS)
         #cc_blas_static with ATLAS on travis-ci needs -lm
-        set(MATH_LIBS ${MATH_LIBS} -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -lm)
+        set(MATH_LIBS ${MATH_LIBS} -Wl,--whole-archive -lpthread -ldl -Wl,--no-whole-archive -lm)
     endif()
     if (LAPACK_TYPE MATCHES MKL OR
         BLAS_TYPE MATCHES MKL)


build...

build...

--- cmake/CFlags.cmake
+++ cmake/CFlags.cmake
@@ -1,4 +1,4 @@
-set(CMAKE_CXX_FLAGS "-std=c++0x -ftemplate-depth=500 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wdelete-non-virtual-dtor${CMAKE_CXX_FLAGS} -Wno-predefined-identifier-outside-function")
+set(CMAKE_CXX_FLAGS "-std=c++0x -ftemplate-depth=500 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wdelete-non-virtual-dtor ${CMAKE_CXX_FLAGS} -Wno-predefined-identifier-outside-function")
 set(CMAKE_C_FLAGS "-std=c11 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -pedantic ${CMAKE_C_FLAGS}")

 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lz -lpthread")


disable -fsanitize=address

disable -fsanitize=address

--- cmake/CFlags.cmake
+++ cmake/CFlags.cmake
@@ -4,8 +4,9 @@
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lprotobuf -lz -lpthread")

 set(CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_CXX_FLAGS_DEBUG}")
-set(CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize=address ${CMAKE_CXX_FLAGS_DEBUG}")
-set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+set(CMAKE_CXX_FLAGS_DEBUG "-g ${CMAKE_CXX_FLAGS_DEBUG}")
+#set(CMAKE_CXX_FLAGS_DEBUG "-fsanitize=address ${CMAKE_CXX_FLAGS_DEBUG}")
+#set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")

 # OSX FLAGS
 if(APPLE)


Remove debugging message

Remove debugging message

--- cmake/FindCEGUI.cmake
+++ cmake/FindCEGUI.cmake
@@ -493,7 +493,6 @@
 # its parent rather than directly the subdirectory. Otherwise we'll get compiler errors.
 if ("${CEGUI_VERSION}" VERSION_GREATER "0.8.0")
     add_parent_dir(CEGUI_INCLUDE_DIRS_TEMP CEGUI_INCLUDE_DIR)
-    message(${CEGUI_INCLUDE_DIRS_TEMP})
     set(${CEGUI_INCLUDE_DIRS} ${CEGUI_INCLUDE_DIRS_TEMP})
 endif()
 set(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS})


vulkan: fix LD_LIBRARY_PATH on amdspv invocation

RGA only provides a nude exec with a .so.
Because the packaging is not available on our platforms,
we need to manually add the directory to the library path.

--- cmake/amdrga.cmake
+++ cmake/amdrga.cmake
@@ -18,13 +18,19 @@
 # Set generated_files to the name of the output variable you want to retrieve (and later depend on)
 # Pass a list of SPIR-V files to generate GCN ISA for in the rest of the arguments.
 function(add_spirv_to_gcn_targets generated_files)
+    # On unix we need to manually add spvgen.so to the library path
+    if(UNIX)
+        get_filename_component(AMD_RGA_PATH ${AMD_RGA_EXEC} DIRECTORY)
+        set(UNIX_SPECIFIC "LD_LIBRARY_PATH=${AMD_RGA_PATH}")
+    endif()
+
     set(OUTPUT_GCN_FILES)
     foreach(INPUT_SPIRV IN LISTS ARGN)
         set(OUTPUT_GCN_ISA_FILE "${INPUT_SPIRV}.gcn")
         set(OUTPUT_GCN_STATS_FILE "${INPUT_SPIRV}.gcn-stats")

         add_custom_command(OUTPUT ${OUTPUT_GCN_ISA_FILE} ${OUTPUT_GCN_STATS_FILE}
-            COMMAND ${AMD_RGA_EXEC}
+            COMMAND ${UNIX_SPECIFIC} ${AMD_RGA_EXEC}
                 -gfxip 8 -set defaultOutput=0 in.spv=${INPUT_SPIRV}
                 out.vert.isaText=${OUTPUT_GCN_ISA_FILE} out.vert.isaInfo=${OUTPUT_GCN_STATS_FILE}
                 out.geom.isaText=${OUTPUT_GCN_ISA_FILE} out.geom.isaInfo=${OUTPUT_GCN_STATS_FILE}


Moved stm32_get_memory_info in cmsis_generate_default_linker_script

--- cmake/FindCMSIS.cmake
+++ cmake/FindCMSIS.cmake
@@ -69,13 +69,6 @@
     endif()

     set(OUTPUT_LD_FILE "${CMAKE_CURRENT_BINARY_DIR}/${DEVICE}${CORE_U}.ld")
-
-    stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} FLASH SIZE FLASH_SIZE ORIGIN FLASH_ORIGIN)
-    stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} RAM SIZE RAM_SIZE ORIGIN RAM_ORIGIN)
-    stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} CCRAM SIZE CCRAM_SIZE ORIGIN CCRAM_ORIGIN)
-    stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} RAM_SHARE SIZE RAM_SHARE_SIZE ORIGIN RAM_SHARE_ORIGIN)
-    stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} HEAP SIZE HEAP_SIZE)
-    stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} STACK SIZE STACK_SIZE)

     if(${FAMILY} STREQUAL MP1)
         string(TOLOWER ${FAMILY} FAMILY_L)
@@ -87,7 +80,14 @@
         add_custom_command(OUTPUT "${OUTPUT_LD_FILE}"
             COMMAND ${CMAKE_COMMAND}
                 -E copy ${CMSIS_${FAMILY}${CORE_U}_LD_SCRIPT} ${OUTPUT_LD_FILE})
-    else()
+    else()
+        stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} FLASH SIZE FLASH_SIZE ORIGIN FLASH_ORIGIN)
+        stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} RAM SIZE RAM_SIZE ORIGIN RAM_ORIGIN)
+        stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} CCRAM SIZE CCRAM_SIZE ORIGIN CCRAM_ORIGIN)
+        stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} RAM_SHARE SIZE RAM_SHARE_SIZE ORIGIN RAM_SHARE_ORIGIN)
+        stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} HEAP SIZE HEAP_SIZE)
+        stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} STACK SIZE STACK_SIZE)
+
         add_custom_command(OUTPUT "${OUTPUT_LD_FILE}"
             COMMAND ${CMAKE_COMMAND}
                 -DFLASH_ORIGIN="${FLASH_ORIGIN}"


Some cleaning up making it 'faster' to build tests (#57).

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -540,11 +540,21 @@
                AND EXISTS ${PROJECT_SOURCE_DIR}/${TEST_HEADER_MOC_FILE})
                 # The test exists, so build it

-                # Definition to make sure that the test can properly use bits
-                # which come from the Core plugin
+                # On Linux and Mac OS X, we need to refer to some bits from the
+                # Core plugin even if we don't use them, so...

                 IF(WIN32)
-                    ADD_DEFINITIONS(-DCore_PLUGIN)
+                    SET(CORE_SOURCES_MOC)
+                    SET(CORE_SOURCES)
+                ELSE()
+                    SET(CORE_SOURCES_MOC
+                        ../../misc/Core/src/dockwidget.h
+                    )
+
+                    SET(CORE_SOURCES
+                        ../../misc/Core/src/commonwidget.cpp
+                        ../../misc/Core/src/dockwidget.cpp
+                    )
                 ENDIF()

                 # Rules to build the test
@@ -553,8 +563,7 @@
                     ../../plugin.h
                     ../../pluginmanager.h

-                    ../../misc/Core/src/dockwidget.h
-                    ../../misc/Core/src/widget.h
+                    ${CORE_SOURCES_MOC}

                     ${HEADERS_MOC}
                     ${TEST_HEADER_MOC_FILE}
@@ -569,9 +578,7 @@
                     ../../plugininfo.cpp
                     ../../pluginmanager.cpp

-                    ../../misc/Core/src/commonwidget.cpp
-                    ../../misc/Core/src/dockwidget.cpp
-                    ../../misc/Core/src/widget.cpp
+                    ${CORE_SOURCES}

                     ${TEST_SOURCE_FILE}
                     ${TEST_SOURCES_MOC}


Added extra path to find ga.h

Added extra path to find ga.h

--- cmake/FindGALIB.cmake
+++ cmake/FindGALIB.cmake
@@ -10,6 +10,7 @@

 FIND_PATH(GALIB_INCLUDE_DIR
   NAMES
+  ga.h
   ga/ga.h
   PATHS
   /usr/include


correctly specify working directory for dtrace_prelink. Also, generate _dtrace.o in the object directory

--- cmake/dtrace.cmake
+++ cmake/dtrace.cmake
@@ -74,7 +74,7 @@
      # link it together with target.
     IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
       SET(objdir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir)
-      SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${target}_dtrace.o)
+      SET(outfile ${objdir}/${target}_dtrace.o)

       ADD_CUSTOM_COMMAND(
         TARGET ${target} PRE_LINK
@@ -84,7 +84,7 @@
           -DDFILE=${CMAKE_BINARY_DIR}/include/probes_mysql.d
           -DDTRACE_FLAGS=${DTRACE_FLAGS}
           -P ${CMAKE_SOURCE_DIR}/cmake/dtrace_prelink.cmake
-        WORKING_DIRECTORY ${OBJDIR}
+        WORKING_DIRECTORY ${objdir}
       )
       SET_TARGET_PROPERTIES(${target} PROPERTIES LINK_FLAGS "${outfile}")
     ENDIF()


pass generator and other stuff when configure the other one

--- cmake/SuperFind.cmake
+++ cmake/SuperFind.cmake
@@ -33,24 +33,23 @@
       DOWNLOAD_COMMAND ""
       CONFIGURE_COMMAND ""
       UPDATE_COMMAND ""
-      INSTALL_COMMAND
-      )
-
+      INSTALL_COMMAND)
     set(${PKG_NAME}_INSTALL_DIR ${ep_base}/Install/${PKG_NAME})

+    #download source code.
     if(NOT EXISTS "${ep_base}/Stamp/${PKG_NAME}/${PKG_NAME}-download")
-
       execute_process(COMMAND git clone ${EP_URL}/${PKG_REPO} ${PKG_NAME}
         WORKING_DIRECTORY  ${ep_base}/Source)
-
       execute_process(COMMAND ${CMAKE_COMMAND}  -E touch "${PKG_NAME}-download"
         WORKING_DIRECTORY ${ep_base}/Stamp/${PKG_NAME} )
     endif()
-
+    #configure
     execute_process(COMMAND ${CMAKE_COMMAND} ${ep_base}/Source/${PKG_NAME}
       "-DCMAKE_INSTALL_PREFIX=${${PKG_NAME}_INSTALL_DIR}"
+      "-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}"
+      "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+      "-G${CMAKE_GENERATOR}"
       WORKING_DIRECTORY ${ep_base}/Build/${PKG_NAME} )
-
     include(${ep_base}/Build/${PKG_NAME}/${PKG_NAME}Config.cmake)

   endif()


cmake: Fix python call

cmake: Fix python call

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -141,8 +141,8 @@
   COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pywraplp> ${PROJECT_NAME}/linear_solver
   COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pywrapsat> ${PROJECT_NAME}/sat
   COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pywraprcpsp> ${PROJECT_NAME}/data
-  #COMMAND ${PYTHON_EXECUTABLE} setup.py bdist_egg bdist_wheel
-  COMMAND ${PYTHON_EXECUTABLE} setup.py bdist_wheel
+  #COMMAND ${Python_EXECUTABLE} setup.py bdist_egg bdist_wheel
+  COMMAND ${Python_EXECUTABLE} setup.py bdist_wheel
   BYPRODUCTS
     python/${PROJECT_NAME}
     python/build


Don't rename .lib files

Don't rename .lib files

--- cmake/bootstrap.cmake
+++ cmake/bootstrap.cmake
@@ -184,7 +184,8 @@
   y_git_clone("https://git.xiph.org/ogg.git" DIR ${_package})
   y_cmake(${_package}
     TARGET "ogg"
-    CONFIG ${CONFIGS})
+    CONFIG ${CONFIGS}
+    OPTIONS -DCMAKE_DEBUG_POSTFIX=d)
   file(INSTALL
     ${BUILD_DIR}/${_package}/include/ogg/config_types.h
     ${BUILD_DIR}/${_package}/include/ogg/ogg.h
@@ -198,11 +199,10 @@
         DESTINATION ${PREFIX_DIR}/lib)
     endif()
     if(WITH_DEBUG)
-      file(RENAME ${BUILD_DIR}/${_package}/Debug/ogg.lib ${BUILD_DIR}/${_package}/Debug/oggd.lib)
-      file(RENAME ${BUILD_DIR}/${_package}/Debug/ogg.pdb ${BUILD_DIR}/${_package}/Debug/oggd.pdb)
+      file(RENAME ${BUILD_DIR}/${_package}/ogg.dir/Debug/ogg.pdb ${BUILD_DIR}/${_package}/ogg.dir/Debug/oggd.pdb)
       file(INSTALL
         ${BUILD_DIR}/${_package}/Debug/oggd.lib
-        ${BUILD_DIR}/${_package}/Debug/oggd.pdb
+        ${BUILD_DIR}/${_package}/ogg.dir/Debug/oggd.pdb
         DESTINATION ${PREFIX_DIR}/lib)
     endif()
   endif()
@@ -283,7 +283,7 @@
   y_cmake(${_package}
     TARGET "jpeg-static"
     CONFIG ${CONFIGS}
-    OPTIONS -DNASM=${NASM_EXECUTABLE} -DWITH_CRT_DLL=ON -DWITH_TURBOJPEG=OFF)
+    OPTIONS -DCMAKE_DEBUG_POSTFIX=d -DNASM=${NASM_EXECUTABLE} -DWITH_CRT_DLL=ON -DWITH_TURBOJPEG=OFF)
   file(INSTALL
     ${BUILD_DIR}/${_package}/jconfig.h
     ${BUILD_DIR}/${_package}/jerror.h
@@ -298,11 +298,10 @@
         DESTINATION ${PREFIX_DIR}/lib)
     endif()
     if(WITH_DEBUG)
-      file(RENAME ${BUILD_DIR}/${_package}/Debug/jpeg-static.lib ${BUILD_DIR}/${_package}/Debug/jpeg-staticd.lib)
-      file(RENAME ${BUILD_DIR}/${_package}/Debug/jpeg-static.pdb ${BUILD_DIR}/${_package}/Debug/jpeg-staticd.pdb)
+      file(RENAME ${BUILD_DIR}/${_package}/jpeg-static.dir/Debug/jpeg-static.pdb ${BUILD_DIR}/${_package}/jpeg-static.dir/Debug/jpeg-staticd.pdb)
       file(INSTALL
         ${BUILD_DIR}/${_package}/Debug/jpeg-staticd.lib
-        ${BUILD_DIR}/${_package}/Debug/jpeg-staticd.pdb
+        ${BUILD_DIR}/${_package}/jpeg-static.dir/Debug/jpeg-staticd.pdb
         DESTINATION ${PREFIX_DIR}/lib)
     endif()
   endif()
@@ -354,7 +353,7 @@
   y_cmake(${_package}
     TARGET "vorbisfile"
     CONFIG ${CONFIGS}
-    OPTIONS -DOGG_ROOT=${PREFIX_DIR})
+    OPTIONS -DCMAKE_DEBUG_POSTFIX=d -DOGG_ROOT=${PREFIX_DIR})
   file(INSTALL
     ${BUILD_DIR}/${_package}/include/vorbis/codec.h
     ${BUILD_DIR}/${_package}/include/vorbis/vorbisfile.h
@@ -369,16 +368,14 @@
         DESTINATION ${PREFIX_DIR}/lib)
     endif()
     if(WITH_DEBUG)
-      file(RENAME ${BUILD_DIR}/${_package}/lib/Debug/vorbis.lib ${BUILD_DIR}/${_package}/lib/Debug/vorbisd.lib)
-      file(RENAME ${BUILD_DIR}/${_package}/lib/Debug/vorbis.pdb ${BUILD_DIR}/${_package}/lib/Debug/vorbisd.pdb)
-      file(RENAME ${BUILD_DIR}/${_package}/lib/Debug/vorbisfile.lib ${BUILD_DIR}/${_package}/lib/Debug/vorbisfiled.lib)
-      file(RENAME ${BUILD_DIR}/${_package}/lib/Debug/vorbisfile.pdb ${BUILD_DIR}/${_package}/lib/Debug/vorbisfiled.pdb)
+      file(RENAME ${BUILD_DIR}/${_package}/lib/vorbis.dir/Debug/vorbis.pdb ${BUILD_DIR}/${_package}/lib/vorbis.dir/Debug/vorbisd.pdb)
+      file(RENAME ${BUILD_DIR}/${_package}/lib/vorbisfile.dir/Debug/vorbisfile.pdb ${BUILD_DIR}/${_package}/lib/vorbisfile.dir/Debug/vorbisfiled.pdb)
       file(INSTALL
         ${BUILD_DIR}/${_package}/lib/Debug/vorbisd.lib
-        ${BUILD_DIR}/${_package}/lib/Debug/vorbisd.pdb
+        ${BUILD_DIR}/${_package}/lib/vorbis.dir/Debug/vorbisd.pdb
         ${BUILD_DIR}/${_package}/lib/Debug/vorbisfiled.lib
-        ${BUILD_DIR}/${_package}/lib/Debug/vorbisfiled.pdb
-        DESTINATION ${PREFIX_DIR}/lib)
-    endif()
-  endif()
-endif()
+        ${BUILD_DIR}/${_package}/lib/vorbisfile.dir/Debug/vorbisfiled.pdb
+        DESTINATION ${PREFIX_DIR}/lib)
+    endif()
+  endif()
+endif()


cmake(python): improve non rebuild

cmake(python): improve non rebuild

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -155,6 +155,13 @@
   OUTPUT ${PROJECT_BINARY_DIR}/python/$<CONFIG>/setup.py
   INPUT ${PROJECT_BINARY_DIR}/python/setup.py.in)

+add_custom_command(
+  OUTPUT python/setup.py
+  DEPENDS ${PROJECT_BINARY_DIR}/python/$<CONFIG>/setup.py
+  COMMAND ${CMAKE_COMMAND} -E copy ./$<CONFIG>/setup.py setup.py
+  WORKING_DIRECTORY python
+)
+
 configure_file(
   ${PROJECT_SOURCE_DIR}/tools/README.pypi.txt
   ${PROJECT_BINARY_DIR}/python/README.txt
@@ -164,10 +171,10 @@
 search_python_module(setuptools setuptools)
 search_python_module(wheel wheel)

-# Main Target
-add_custom_target(python_package ALL
-  COMMAND ${CMAKE_COMMAND} -E copy ./$<CONFIG>/setup.py setup.py
+add_custom_command(
+  OUTPUT python/dist
   COMMAND ${CMAKE_COMMAND} -E remove_directory dist
+  #COMMAND ${CMAKE_COMMAND} -E make_directory dist
   COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_PROJECT}/.libs
   # Don't need to copy static lib on windows.
   COMMAND ${CMAKE_COMMAND} -E $<IF:$<STREQUAL:$<TARGET_PROPERTY:${PYTHON_PROJECT},TYPE>,SHARED_LIBRARY>,copy,true>
@@ -183,15 +190,25 @@
   COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:sorted_interval_list> ${PYTHON_PROJECT}/util
   #COMMAND ${Python3_EXECUTABLE} setup.py bdist_egg bdist_wheel
   COMMAND ${Python3_EXECUTABLE} setup.py bdist_wheel
+  MAIN_DEPENDENCY
+    ortools # can't use TARGET alias here
+  DEPENDS
+    python/setup.py
+    Py${PROJECT_NAME}_proto
   BYPRODUCTS
-    python/${PYTHON_PROJECT}
-    python/build
-    python/dist
-    python/${PYTHON_PROJECT}.egg-info
-  WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
+   python/${PYTHON_PROJECT}
+   python/build
+   python/${PYTHON_PROJECT}.egg-info
+  WORKING_DIRECTORY python
   COMMAND_EXPAND_LISTS
   )
-add_dependencies(python_package ortools::ortools Py${PROJECT_NAME}_proto)
+
+# Main Target
+add_custom_target(python_package ALL
+  DEPENDS
+    python/dist
+  WORKING_DIRECTORY python
+)

 # Install rules
 configure_file(


Updated flags to allow add_vulkan_application to be used externally.

--- cmake/build_apk.cmake
+++ cmake/build_apk.cmake
@@ -259,6 +259,7 @@
     add_executable(${target} ${ADDITIONAL_ARGS}
       ${EXE_SOURCES} ${EXE_UNPARSED_ARGS})
     setup_folders(${target})
+    target_include_directories(${target} PRIVATE ${VulkanTestApplications_SOURCE_DIR})
     mathfu_configure_flags(${target})
     if (EXE_LIBS)
       target_link_libraries(${target} PRIVATE ${EXE_LIBS})


fix typo in comment [NFC]

fix typo in comment [NFC]

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -113,7 +113,7 @@
 endif()

 # Don't look for these libraries on Windows. Also don't look for them if we're
-# using MSan, since uninstrmented third party code may call MSan interceptors
+# using MSan, since uninstrumented third party code may call MSan interceptors
 # like strlen, leading to false positives.
 if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
   if (LLVM_ENABLE_ZLIB)


New 64-bit check from #86

New 64-bit check from #86

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@585 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -141,11 +141,11 @@
 # Sets LINUX if the operating system is Linux.
 macro(GET_OS_INFO)
     string(REGEX MATCH "Linux" OS_IS_LINUX ${CMAKE_SYSTEM_NAME})
-    if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
         set(OS_IS_64BIT TRUE)
-    else(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+    else(CMAKE_SIZEOF_VOID_P EQUAL 8)
         set(OS_IS_64BIT FALSE)
-    endif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+    endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
 endmacro(GET_OS_INFO)


cpack: Generate tarball compressed with xz

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -18,7 +18,7 @@

 ### source generator
-set(CPACK_SOURCE_GENERATOR "TGZ")
+set(CPACK_SOURCE_GENERATOR "TXZ")
 set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/obj*;tags;cscope.*;.ycm_extra_conf.pyc")
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")


CMake: Disable innocuous ICC warnings about inlining getting disabled.

--- cmake/CubBuildCompilerTargets.cmake
+++ cmake/CubBuildCompilerTargets.cmake
@@ -74,6 +74,12 @@
     append_option_if_available("-Wno-unneeded-internal-declaration" cxx_compile_options)
   endif()

+  if ("Intel" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
+    # Disable warning that inlining is inhibited by compiler thresholds.
+    append_option_if_available("-diag-disable=11074" cxx_compile_options)
+    append_option_if_available("-diag-disable=11076" cxx_compile_options)
+  endif()
+
   if ("NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}")
     # Today:
     # * NVCC accepts CUDA C++ in .cu files but not .cpp files.


GCC 4.6 has new -march switches: corei7 and corei7-avx

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -126,14 +126,17 @@
       endif()
    elseif(TARGET_ARCHITECTURE STREQUAL "nehalem")
       list(APPEND _march_flag_list "nehalem")
+      list(APPEND _march_flag_list "corei7")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
    elseif(TARGET_ARCHITECTURE STREQUAL "westmere")
       list(APPEND _march_flag_list "westmere")
+      list(APPEND _march_flag_list "corei7")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
    elseif(TARGET_ARCHITECTURE STREQUAL "sandy-bridge")
       list(APPEND _march_flag_list "sandybridge")
+      list(APPEND _march_flag_list "corei7-avx")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx")
    elseif(TARGET_ARCHITECTURE STREQUAL "atom")


fix oss build failure due undefined symbol in folly

Summary: Fix for the issue https://github.com/facebookincubator/mvfst/issues/22

Reviewed By: mingtaoy

Differential Revision: D15709201

fbshipit-source-id: 474a4af4d08f631dbf294210181b13e582c972eb

--- cmake/BuildFizz.cmake
+++ cmake/BuildFizz.cmake
@@ -36,7 +36,12 @@
 set(FIZZ_BINARY_DIR ${binary_dir})

 # Setup fizz libraries and include dirs
-set(LIBFIZZ_LIBRARY
+set(LIBFIZZ_LIBRARY_LOCATION
   "${FIZZ_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}fizz${CMAKE_STATIC_LIBRARY_SUFFIX}"
 )
+add_library(mvfst_fizz STATIC IMPORTED)
+set_target_properties(mvfst_fizz PROPERTIES IMPORTED_LOCATION "${LIBFIZZ_LIBRARY_LOCATION}")
+set_target_properties(mvfst_fizz PROPERTIES INTERFACE_LINK_LIBRARIES Folly::folly)
+
+set(LIBFIZZ_LIBRARY mvfst_fizz)
 set(LIBFIZZ_INCLUDE_DIR "${source_dir}")


Changed FindBISON.cmake line endings to unix

--- cmake/FindBISON.cmake
+++ cmake/FindBISON.cmake
@@ -1,166 +1,166 @@
-# - Find bison executable and provides macros to generate custom build rules
-# The module defined the following variables:
-#  BISON_EXECUTABLE - path to the bison program
-#  BISON_VERSION - version of bison
-#  BISON_FOUND - true if the program was found
-# If bison is found, the module defines the macros:
-#  BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
-#              [COMPILE_FLAGS <string>])
-# which will create  a custom rule to generate  a parser. <YaccInput> is
-# the path to  a yacc file. <CodeOutput> is the name  of the source file
-# generated by bison.  A header file is also  be generated, and contains
-# the  token  list.  If  COMPILE_FLAGS  option is  specified,  the  next
-# parameter is  added in the bison  command line.  if  VERBOSE option is
-# specified, <file> is created  and contains verbose descriptions of the
-# grammar and parser. The macro defines a set of variables:
-#  BISON_${Name}_DEFINED - true is the macro ran successfully
-#  BISON_${Name}_INPUT - The input source file, an alias for <YaccInput>
-#  BISON_${Name}_OUTPUT_SOURCE - The source file generated by bison
-#  BISON_${Name}_OUTPUT_HEADER - The header file generated by bison
-#  BISON_${Name}_OUTPUTS - The sources files generated by bison
-#  BISON_${Name}_COMPILE_FLAGS - Options used in the bison command line
-#
-# Example:
-# FIND_PACKAGE(BISON)
-# BISON_TARGET(MyParser parser.y ${PROJECT_BINARY_DIR}/parser.cpp)
-# ADD_EXECUTABLE(Foo main.cpp ${BISON_MyParser_OUTPUTS})
-#
-
-# Copyright (c) 2006, Tristan Carel
-# All rights reserved.
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of the University of California, Berkeley nor the
-#       names of its contributors may be used to endorse or promote products
-#       derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# $Id:: FindBISON.cmake 3 2006-11-03 02:42:02Z ken                            $
-
-SET(BISON_FOUND FALSE)
-
-FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
-MARK_AS_ADVANCED(BISON_EXECUTABLE)
-
-IF(BISON_EXECUTABLE)
-  SET(BISON_FOUND TRUE)
-
-  EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version
-    OUTPUT_VARIABLE BISON_version_output
-    ERROR_VARIABLE BISON_version_error
-    RESULT_VARIABLE BISON_version_result
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-  IF(NOT ${BISON_version_result} EQUAL 0)
-    MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
-  ELSE(NOT ${BISON_version_result} EQUAL 0)
-    STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
-      BISON_VERSION "${BISON_version_output}")
-  ENDIF(NOT ${BISON_version_result} EQUAL 0)
-
-  # internal macro
-  MACRO(BISON_TARGET_option_verbose Name BisonOutput filename)
-    LIST(APPEND BISON_TARGET_cmdopt "--verbose")
-    GET_FILENAME_COMPONENT(BISON_TARGET_output_path "${BisonOutput}" PATH)
-    GET_FILENAME_COMPONENT(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
-    ADD_CUSTOM_COMMAND(OUTPUT ${filename}
-      COMMAND ${CMAKE_COMMAND}
-      ARGS -E copy
-      "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
-      "${filename}"
-      DEPENDS
-      "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
-      COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
-      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-    SET(BISON_${Name}_VERBOSE_FILE ${filename})
-    LIST(APPEND BISON_TARGET_extraoutputs
-      "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
-  ENDMACRO(BISON_TARGET_option_verbose)
-
-  # internal macro
-  MACRO(BISON_TARGET_option_extraopts Options)
-    SET(BISON_TARGET_extraopts "${Options}")
-    SEPARATE_ARGUMENTS(BISON_TARGET_extraopts)
-    LIST(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
-  ENDMACRO(BISON_TARGET_option_extraopts)
-
-  MACRO(BISON_TARGET Name BisonInput BisonOutput)
-    SET(BISON_TARGET_output_header "")
-    SET(BISON_TARGET_command_opt "")
-    SET(BISON_TARGET_outputs "${BisonOutput}")
-    IF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
-      MESSAGE(SEND_ERROR "Usage")
-    ELSE(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
-      # Parsing parameters
-      IF(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
-	IF("${ARGV3}" STREQUAL "VERBOSE")
-	  BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV4}")
-	ENDIF("${ARGV3}" STREQUAL "VERBOSE")
-	IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
-	  BISON_TARGET_option_extraopts("${ARGV4}")
-	ENDIF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
-      ENDIF(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
-      IF(${ARGC} EQUAL 7)
-	IF("${ARGV5}" STREQUAL "VERBOSE")
-	  BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV6}")
-	ENDIF("${ARGV5}" STREQUAL "VERBOSE")
-	IF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
-	  BISON_TARGET_option_extraopts("${ARGV6}")
-	ENDIF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
-      ENDIF(${ARGC} EQUAL 7)
-
-      # Header's name generated by bison (see option -d)
-      LIST(APPEND BISON_TARGET_cmdopt "-d")
-      STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
-      STRING(REPLACE "c" "h" _fileext ${_fileext})
-      STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
-	BISON_${Name}_OUTPUT_HEADER "${ARGV2}")
-      LIST(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
-
-      ADD_CUSTOM_COMMAND(OUTPUT ${BISON_TARGET_outputs}
-        ${BISON_TARGET_extraoutputs}
-        COMMAND ${BISON_EXECUTABLE}
-        ARGS ${BISON_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
-        DEPENDS ${ARGV1}
-        COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
-      # define target variables
-      SET(BISON_${Name}_DEFINED TRUE)
-      SET(BISON_${Name}_INPUT ${ARGV1})
-      SET(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
-      SET(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
-      SET(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
-
-    ENDIF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
-  ENDMACRO(BISON_TARGET)
-
-ENDIF(BISON_EXECUTABLE)
-
-
-IF(NOT BISON_FOUND)
-  IF(NOT BISON_FIND_QUIETLY)
-    MESSAGE(STATUS "BISON was not found.")
-  ELSE(NOT BISON_FIND_QUIETLY)
-    IF(BISON_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "BISON was not found.")
-    ENDIF(BISON_FIND_REQUIRED)
-  ENDIF(NOT BISON_FIND_QUIETLY)
-ENDIF(NOT BISON_FOUND)
-
-# FindBISON.cmake ends here
+# - Find bison executable and provides macros to generate custom build rules
+# The module defined the following variables:
+#  BISON_EXECUTABLE - path to the bison program
+#  BISON_VERSION - version of bison
+#  BISON_FOUND - true if the program was found
+# If bison is found, the module defines the macros:
+#  BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
+#              [COMPILE_FLAGS <string>])
+# which will create  a custom rule to generate  a parser. <YaccInput> is
+# the path to  a yacc file. <CodeOutput> is the name  of the source file
+# generated by bison.  A header file is also  be generated, and contains
+# the  token  list.  If  COMPILE_FLAGS  option is  specified,  the  next
+# parameter is  added in the bison  command line.  if  VERBOSE option is
+# specified, <file> is created  and contains verbose descriptions of the
+# grammar and parser. The macro defines a set of variables:
+#  BISON_${Name}_DEFINED - true is the macro ran successfully
+#  BISON_${Name}_INPUT - The input source file, an alias for <YaccInput>
+#  BISON_${Name}_OUTPUT_SOURCE - The source file generated by bison
+#  BISON_${Name}_OUTPUT_HEADER - The header file generated by bison
+#  BISON_${Name}_OUTPUTS - The sources files generated by bison
+#  BISON_${Name}_COMPILE_FLAGS - Options used in the bison command line
+#
+# Example:
+# FIND_PACKAGE(BISON)
+# BISON_TARGET(MyParser parser.y ${PROJECT_BINARY_DIR}/parser.cpp)
+# ADD_EXECUTABLE(Foo main.cpp ${BISON_MyParser_OUTPUTS})
+#
+
+# Copyright (c) 2006, Tristan Carel
+# All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in the
+#       documentation and/or other materials provided with the distribution.
+#     * Neither the name of the University of California, Berkeley nor the
+#       names of its contributors may be used to endorse or promote products
+#       derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# $Id:: FindBISON.cmake 3 2006-11-03 02:42:02Z ken                            $
+
+SET(BISON_FOUND FALSE)
+
+FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
+MARK_AS_ADVANCED(BISON_EXECUTABLE)
+
+IF(BISON_EXECUTABLE)
+  SET(BISON_FOUND TRUE)
+
+  EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version
+    OUTPUT_VARIABLE BISON_version_output
+    ERROR_VARIABLE BISON_version_error
+    RESULT_VARIABLE BISON_version_result
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  IF(NOT ${BISON_version_result} EQUAL 0)
+    MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
+  ELSE(NOT ${BISON_version_result} EQUAL 0)
+    STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
+      BISON_VERSION "${BISON_version_output}")
+  ENDIF(NOT ${BISON_version_result} EQUAL 0)
+
+  # internal macro
+  MACRO(BISON_TARGET_option_verbose Name BisonOutput filename)
+    LIST(APPEND BISON_TARGET_cmdopt "--verbose")
+    GET_FILENAME_COMPONENT(BISON_TARGET_output_path "${BisonOutput}" PATH)
+    GET_FILENAME_COMPONENT(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
+    ADD_CUSTOM_COMMAND(OUTPUT ${filename}
+      COMMAND ${CMAKE_COMMAND}
+      ARGS -E copy
+      "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
+      "${filename}"
+      DEPENDS
+      "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
+      COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
+      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+    SET(BISON_${Name}_VERBOSE_FILE ${filename})
+    LIST(APPEND BISON_TARGET_extraoutputs
+      "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
+  ENDMACRO(BISON_TARGET_option_verbose)
+
+  # internal macro
+  MACRO(BISON_TARGET_option_extraopts Options)
+    SET(BISON_TARGET_extraopts "${Options}")
+    SEPARATE_ARGUMENTS(BISON_TARGET_extraopts)
+    LIST(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
+  ENDMACRO(BISON_TARGET_option_extraopts)
+
+  MACRO(BISON_TARGET Name BisonInput BisonOutput)
+    SET(BISON_TARGET_output_header "")
+    SET(BISON_TARGET_command_opt "")
+    SET(BISON_TARGET_outputs "${BisonOutput}")
+    IF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+      MESSAGE(SEND_ERROR "Usage")
+    ELSE(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+      # Parsing parameters
+      IF(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
+	IF("${ARGV3}" STREQUAL "VERBOSE")
+	  BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV4}")
+	ENDIF("${ARGV3}" STREQUAL "VERBOSE")
+	IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+	  BISON_TARGET_option_extraopts("${ARGV4}")
+	ENDIF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+      ENDIF(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
+      IF(${ARGC} EQUAL 7)
+	IF("${ARGV5}" STREQUAL "VERBOSE")
+	  BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV6}")
+	ENDIF("${ARGV5}" STREQUAL "VERBOSE")
+	IF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
+	  BISON_TARGET_option_extraopts("${ARGV6}")
+	ENDIF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
+      ENDIF(${ARGC} EQUAL 7)
+
+      # Header's name generated by bison (see option -d)
+      LIST(APPEND BISON_TARGET_cmdopt "-d")
+      STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
+      STRING(REPLACE "c" "h" _fileext ${_fileext})
+      STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
+	BISON_${Name}_OUTPUT_HEADER "${ARGV2}")
+      LIST(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
+
+      ADD_CUSTOM_COMMAND(OUTPUT ${BISON_TARGET_outputs}
+        ${BISON_TARGET_extraoutputs}
+        COMMAND ${BISON_EXECUTABLE}
+        ARGS ${BISON_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
+        DEPENDS ${ARGV1}
+        COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+      # define target variables
+      SET(BISON_${Name}_DEFINED TRUE)
+      SET(BISON_${Name}_INPUT ${ARGV1})
+      SET(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
+      SET(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
+      SET(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
+
+    ENDIF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+  ENDMACRO(BISON_TARGET)
+
+ENDIF(BISON_EXECUTABLE)
+
+
+IF(NOT BISON_FOUND)
+  IF(NOT BISON_FIND_QUIETLY)
+    MESSAGE(STATUS "BISON was not found.")
+  ELSE(NOT BISON_FIND_QUIETLY)
+    IF(BISON_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "BISON was not found.")
+    ENDIF(BISON_FIND_REQUIRED)
+  ENDIF(NOT BISON_FIND_QUIETLY)
+ENDIF(NOT BISON_FOUND)
+
+# FindBISON.cmake ends here