Updated FindMagnum.cmake from Magnum repository.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -7,8 +7,12 @@
 # This command tries to find Magnum library and then defines:
 #
 #  MAGNUM_FOUND                 - Whether the library was found
-#  MAGNUM_LIBRARY               - Magnum library
-#  MAGNUM_INCLUDE_DIR           - Root include dir
+#  MAGNUM_TARGET_GLES           - Defined if Magnum was built for OpenGL ES,
+#   slightly reducing feature count. The same variable is also #defined in
+#   Magnum headers.
+#  MAGNUM_LIBRARIES             - Magnum library and dependent libraries
+#  MAGNUM_INCLUDE_DIRS          - Root include dir and include dirs of
+#   dependencies
 #  MAGNUM_PLUGINS_IMPORTER_DIR  - Directory with importer plugins
 #
 # This command will try to find only the base library, not the optional
@@ -16,12 +20,15 @@
 # Additional dependencies are specified by the components. The optional
 # components are:
 #
-#  GlutContext   - GLUT context (depends on GLUT package)
 #  MeshTools     - MeshTools library
 #  Physics       - Physics library
 #  Primitives    - Library with stock geometric primitives (static)
 #  Shaders       - Library with stock shaders
 #
+#  EglContext    - EGL context (depends on EGL and X11 libraries)
+#  GlutContext   - GLUT context (depends on GLUT library)
+#  Sdl2Context   - SDL2 context (depends on SDL2 library)
+#
 # Example usage with specifying additional components is:
 #
 #  find_package(Magnum [REQUIRED|COMPONENTS] MeshTools Primitives GlutContext)
@@ -29,9 +36,13 @@
 # For each component is then defined:
 #
 #  MAGNUM_*_FOUND   - Whether the component was found
-#  MAGNUM_*_LIBRARY - Component library
+#  MAGNUM_*_LIBRARIES - Component library and dependent libraries
 #
 # Additionally these variables are defined for internal usage:
+#
+#  MAGNUM_INCLUDE_DIR                   - Root include dir (w/o dependencies)
+#  MAGNUM_LIBRARY                       - Magnum library (w/o dependencies)
+#  MAGNUM_*_LIBRARY                     - Component libraries (w/o dependencies)
 #
 #  MAGNUM_LIBRARY_INSTALL_DIR           - Library installation directory
 #  MAGNUM_PLUGINS_INSTALL_DIR           - Plugin installation directory
@@ -43,8 +54,6 @@

 # Dependencies
 find_package(Corrade REQUIRED)
-find_package(OpenGL REQUIRED)
-find_package(GLEW REQUIRED)

 # Magnum library
 find_library(MAGNUM_LIBRARY Magnum)
@@ -52,8 +61,23 @@
 # Root include dir
 find_path(MAGNUM_INCLUDE_DIR
     NAMES Magnum.h
-    PATH_SUFFIXES Magnum
-)
+    PATH_SUFFIXES Magnum)
+
+# Configuration
+file(READ ${MAGNUM_INCLUDE_DIR}/magnumConfigure.h _magnumConfigure)
+
+# Built for OpenGL ES?
+string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_GLES" _TARGET_GLES)
+if(NOT _TARGET_GLES EQUAL -1)
+    set(MAGNUM_TARGET_GLES 1)
+endif()
+
+if(NOT MAGNUM_TARGET_GLES)
+    find_package(OpenGL REQUIRED)
+    find_package(GLEW REQUIRED)
+else()
+    find_package(OpenGLES2 REQUIRED)
+endif()

 # Additional components
 foreach(component ${Magnum_FIND_COMPONENTS})
@@ -72,7 +96,9 @@
         # GLUT context dependencies
         if(${component} STREQUAL GlutContext)
             find_package(GLUT)
-            if(NOT GLUT_FOUND)
+            if(GLUT_FOUND)
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${GLUT_LIBRARIES})
+            else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()
         endif()
@@ -80,7 +106,20 @@
         # SDL2 context dependencies
         if(${component} STREQUAL Sdl2Context)
             find_package(SDL2)
-            if(NOT SDL2_FOUND)
+            if(SDL2_FOUND)
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARY})
+            else()
+                unset(MAGNUM_${_COMPONENT}_LIBRARY)
+            endif()
+        endif()
+
+        # X/EGL context dependencies
+        if(${component} STREQUAL EglContext)
+            find_package(EGL)
+            find_package(X11)
+            if(EGL_FOUND AND X11_FOUND)
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY} ${X11_LIBRARIES})
+            else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()
         endif()
@@ -110,12 +149,12 @@
     if(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES)
         find_path(_MAGNUM_${_COMPONENT}_INCLUDE_DIR
             NAMES ${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES}
-            PATHS ${MAGNUM_INCLUDE_DIR}/${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX}
-        )
+            PATHS ${MAGNUM_INCLUDE_DIR}/${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX})
     endif()

     # Decide if the library was found
     if(MAGNUM_${_COMPONENT}_LIBRARY AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR)
+        set(MAGNUM_${_COMPONENT}_LIBRARIES ${MAGNUM_${_COMPONENT}_LIBRARY} ${_MAGNUM_${_COMPONENT}_LIBRARIES})
         set(Magnum_${component}_FOUND TRUE)
     else()
         set(Magnum_${component}_FOUND FALSE)
@@ -125,8 +164,22 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Magnum
     REQUIRED_VARS MAGNUM_INCLUDE_DIR MAGNUM_LIBRARY
-    HANDLE_COMPONENTS
-)
+    HANDLE_COMPONENTS)
+
+# Dependent libraries and includes
+set(MAGNUM_INCLUDE_DIRS ${MAGNUM_INCLUDE_DIR}
+    ${CORRADE_INCLUDE_DIR})
+set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARY}
+    ${CORRADE_UTILITY_LIBRARY}
+    ${CORRADE_PLUGINMANAGER_LIBRARY})
+if(NOT MAGNUM_TARGET_GLES)
+    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES}
+        ${OPENGL_gl_LIBRARY}
+        ${GLEW_LIBRARY})
+else()
+    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES}
+        ${OPENGLES2_LIBRARY})
+endif()

 # Installation dirs
 set(MAGNUM_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
@@ -136,13 +189,14 @@
 set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum)
 set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum/Plugins)
 mark_as_advanced(FORCE
+    MAGNUM_LIBRARY
+    MAGNUM_INCLUDE_DIR
     MAGNUM_LIBRARY_INSTALL_DIR
     MAGNUM_PLUGINS_INSTALL_DIR
     MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR
     MAGNUM_CMAKE_MODULE_INSTALL_DIR
     MAGNUM_INCLUDE_INSTALL_DIR
-    MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR
-)
+    MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR)

 # Importer plugins dir
 if(NOT WIN32)


Basic might be built separately from pthread

--- config.h.in.cmake
+++ config.h.in.cmake
@@ -74,7 +74,7 @@

-#ifdef ENABLE_HOST_CPU_DEVICES
+#if defined(BUILD_BASIC) || defined(BUILD_PTHREAD)

 #define HOST_AS_FLAGS  "@HOST_AS_FLAGS@"


added support for 64 bit linux in FindOpenCASCADE.cmake

--- contrib/FindOpenCASCADE.cmake
+++ contrib/FindOpenCASCADE.cmake
@@ -20,7 +20,7 @@
     else (APPLE)
       set( _testlibname libTKernel.so )
     endif (APPLE)
-    set( _libsearchpath /usr/lib /opt/occ/lib $ENV{CASROOT}/lib )
+    set( _libsearchpath /usr/lib64 /usr/lib /opt/occ/lib $ENV{CASROOT}/lib64 $ENV{CASROOT}/lib )
   ELSE(UNIX)
     IF (WIN32)
       # MESSAGE("************ FindOpenCASCADE.cmake has not been tried on windows and may or may not work! *************")


Add NDEBUG to RelWithDebInfo builds

Add NDEBUG to RelWithDebInfo builds

--- Common.cmake
+++ Common.cmake
@@ -23,6 +23,10 @@
     set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
   endif()
 endif(NOT CMAKE_BUILD_TYPE)
+if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+endif()

 set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
 string(TOUPPER ${CMAKE_PROJECT_NAME} UPPER_PROJECT_NAME)


documentation fix

documentation fix

--- src/docbook/index.xml.cmake
+++ src/docbook/index.xml.cmake
@@ -261,9 +261,16 @@
       <title>Installation on Mac OS X</title>

 <para>
-To install fastphylo on a Mac OS X v10.5 ( Leopard ) on a Mac computer with Intel cpu, first download the fastphylo-@PACKAGE_VERSION@-Darwin.tar.gz   and then
-<programlisting><![CDATA[
-$ tar xfz fastphylo-@PACKAGE_VERSION@-Darwin.tar.gz
+To install fastphylo on a Mac OS X v10.5 ( Leopard ) on a Mac computer with Intel cpu, first download the fastphylo-@PACKAGE_VERSION@-MacOSX10.5.tar.gz   and then
+<programlisting><![CDATA[
+$ tar xfz fastphylo-@PACKAGE_VERSION@-MacOSX10.5.tar.gz
+]]></programlisting>
+
+    </para>
+<para>
+To install fastphylo on a Mac OS X v10.4 ( Tiger ) on a Mac computer with Intel cpu, first download the fastphylo-@PACKAGE_VERSION@-MacOSX10.4.tar.gz   and then
+<programlisting><![CDATA[
+$ tar xfz fastphylo-@PACKAGE_VERSION@-MacOSX10.4.tar.gz
 ]]></programlisting>

     </para>


cleaned up spaces/tabs and added a debug find

--- cmake-modules/FindPhysFS.cmake
+++ cmake-modules/FindPhysFS.cmake
@@ -1,9 +1,9 @@
 #source: http://docdb.fnal.gov/ILC/sid/stanitz/ilcsoft-latest/cmake-2.4.8/Modules/FindPhysFS.cmake
 # - Locate PhysFS library
 # This module defines
-#  PHYSFS_LIBRARY, the name of the library to link with
-#  PHYSFS_FOUND, if false, do not try to link to PHYSFS
-#  PHYSFS_INCLUDE_DIR, where to find PHYSFS/PHYSFS.h
+#	PHYSFS_LIBRARY, the name of the library to link with
+#	PHYSFS_FOUND, if false, do not try to link to PHYSFS
+#	PHYSFS_INCLUDE_DIR, where to find PHYSFS/PHYSFS.h
 #
 # $PHYSFSDIR is an environment variable that would
 # correspond to the ./configure --prefix=$PHYSFSDIR
@@ -15,67 +15,83 @@
 # On OSX, this will prefer the Framework version (if found) over others.
 # People will have to manually change the cache values of
 # PHYSFS_LIBRARY to override this selection.
+
 FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h
-  $ENV{PHYSFSDIR}/include
-  $ENV{PHYSFSDIR}
-  $ENV{PHYSFSDIR}/..
-  ~/Library/Frameworks/PhysFS.framework/Headers
-  /Library/Frameworks/PhysFS.framework/Headers
-  /usr/local/include/physfs
-  /usr/local/include
-  /usr/include/physfs
-  /usr/include
-  /sw/include/physfs # Fink
-  /sw/include
-  /opt/local/include/physfs # DarwinPorts
-  /opt/local/include
-  /opt/csw/include/physfs # Blastwave
-  /opt/csw/include
-  /opt/include/physfs
-  /opt/include
-  )
+	$ENV{PHYSFSDIR}/include
+	$ENV{PHYSFSDIR}
+	$ENV{PHYSFSDIR}/..
+	~/Library/Frameworks/PhysFS.framework/Headers
+	/Library/Frameworks/PhysFS.framework/Headers
+	/usr/local/include/physfs
+	/usr/local/include
+	/usr/include/physfs
+	/usr/include
+	/sw/include/physfs # Fink
+	/sw/include
+	/opt/local/include/physfs # DarwinPorts
+	/opt/local/include
+	/opt/csw/include/physfs # Blastwave
+	/opt/csw/include
+	/opt/include/physfs
+	/opt/include
+	)
+
 # I'm not sure if I should do a special casing for Apple. It is
 # unlikely that other Unix systems will find the framework path.
 # But if they do ([Next|Open|GNU]Step?),
 # do they want the -framework option also?
 IF(${PHYSFS_INCLUDE_DIR} MATCHES ".framework")
-  STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" PHYSFS_FRAMEWORK_PATH_TMP ${PHYSFS_INCLUDE_DIR})
-  IF("${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
-      OR "${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
-      )
-    # String is in default search path, don't need to use -F
-    SET(PHYSFS_LIBRARY "-framework PhysFS" CACHE STRING "PhysFS framework for OSX")
-  ELSE("${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
-      OR "${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
-      )
-    # String is not /Library/Frameworks, need to use -F
-    SET(PHYSFS_LIBRARY "-F${PHYSFS_FRAMEWORK_PATH_TMP} -framework PhysFS" CACHE STRING "PhysFS framework for OSX")
-  ENDIF("${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
-    OR "${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
-    )
-  # Clear the temp variable so nobody can see it
-  SET(PHYSFS_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
-
+	STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" PHYSFS_FRAMEWORK_PATH_TMP ${PHYSFS_INCLUDE_DIR})
+	IF("${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
+			OR "${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
+			)
+		# String is in default search path, don't need to use -F
+		SET(PHYSFS_LIBRARY_RELEASE "-framework PhysFS" CACHE STRING "PhysFS framework for OSX")
+	ELSE("${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
+			OR "${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
+			)
+		# String is not /Library/Frameworks, need to use -F
+		SET(PHYSFS_LIBRARY_RELEASE "-F${PHYSFS_FRAMEWORK_PATH_TMP} -framework PhysFS" CACHE STRING "PhysFS framework for OSX")
+	ENDIF("${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
+		OR "${PHYSFS_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
+		)
+	# Clear the temp variable so nobody can see it
+	SET(PHYSFS_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
+
+	SET(PHYSFS_LIBRARY_DEBUG PHYSFS_LIBRARY_RELEASE)
 ELSE(${PHYSFS_INCLUDE_DIR} MATCHES ".framework")
-	SET(PHYSFS_BUILD_TARGET "MinSizeRel" CACHE STRING "If needed, the build configuration of the library")
-  FIND_LIBRARY(PHYSFS_LIBRARY
-    NAMES physfs PhysFS
-    PATHS
-    $ENV{PHYSFSDIR}/lib
-	$ENV{PHYSFSDIR}/lib/${PHYSFS_BUILD_TARGET}
-    /usr/local/lib
-    /usr/lib
-    /sw/lib
-    /opt/local/lib
-    /opt/csw/lib
-    /opt/lib
-    )
+	FIND_LIBRARY(PHYSFS_LIBRARY_DEBUG
+		NAMES physfs PhysFS
+		PATHS
+		$ENV{PHYSFSDIR}/lib
+		$ENV{PHYSFSDIR}/lib/Debug
+		/usr/local/lib
+		/usr/lib
+		/sw/lib
+		/opt/local/lib
+		/opt/csw/lib
+		/opt/lib
+		)
+
+	FIND_LIBRARY(PHYSFS_LIBRARY_RELEASE
+		NAMES physfs PhysFS
+		PATHS
+		$ENV{PHYSFSDIR}/lib
+		$ENV{PHYSFSDIR}/lib/Release
+		/usr/local/lib
+		/usr/lib
+		/sw/lib
+		/opt/local/lib
+		/opt/csw/lib
+		/opt/lib
+		)
 ENDIF(${PHYSFS_INCLUDE_DIR} MATCHES ".framework")

 SET(PHYSFS_FOUND "NO")
-IF(PHYSFS_LIBRARY)
-  SET(PHYSFS_FOUND "YES")
-ENDIF(PHYSFS_LIBRARY)
+IF(PHYSFS_LIBRARY_DEBUG AND PHYSFS_LIBRARY_RELEASE)
+	SET(PHYSFS_FOUND "YES")
+	SET(PHYSFS_LIBRARY debug ${PHYSFS_LIBRARY_DEBUG} optimized ${PHYSFS_LIBRARY_RELEASE})
+ENDIF(PHYSFS_LIBRARY_DEBUG AND PHYSFS_LIBRARY_RELEASE)

 if(PHYSFS_DEBUG)
 	message("env physfsdir: $ENV{PHYSFSDIR}")


Removing wrong -m32 (Jochen)

Removing wrong -m32 (Jochen)

--- cmake/CMakelinuxx8664gcc.cmake
+++ cmake/CMakelinuxx8664gcc.cmake
@@ -86,10 +86,10 @@
 elseif(${CMAKE_Fortran_COMPILER} MATCHES "gfortran")

   set(FFLAGS "-DFORTRAN_GFORTRAN ${FFLAGS}")
-  execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -m32 -print-file-name=libgfortran.so
+  execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -print-file-name=libgfortran.so
                   OUTPUT_VARIABLE _shlib
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
-  execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -m32 -print-file-name=libgfortranbegin.a
+  execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -print-file-name=libgfortranbegin.a
                   OUTPUT_VARIABLE SHLIB
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
   set(SHLIB "${_shlib} ${SHLIB}")


Workaround powerpc processor detection.

Workaround powerpc processor detection.

--- cmake/DetermineProcessor.cmake
+++ cmake/DetermineProcessor.cmake
@@ -10,6 +10,10 @@
 		#IF("${val}" GREATER 0 OR NV_SYSTEM_PROCESSOR STREQUAL "unknown")
 			EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE NV_SYSTEM_PROCESSOR RETURN_VALUE val)
 		#ENDIF("${val}" GREATER 0 OR NV_SYSTEM_PROCESSOR STREQUAL "unknown")
+
+		IF(NV_SYSTEM_PROCESSOR STREQUAL "Power Macintosh")
+			SET(NV_SYSTEM_PROCESSOR "powerpc")
+		ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "Power Macintosh")

 		# processor may have double quote in the name, and that needs to be removed
 		STRING(REGEX REPLACE "\"" "" NV_SYSTEM_PROCESSOR "${NV_SYSTEM_PROCESSOR}")


Update TBB SHA1 for new TBB repository name (#1551)

--- cmake/Modules/FindTBB_EP.cmake
+++ cmake/Modules/FindTBB_EP.cmake
@@ -248,7 +248,7 @@
       ExternalProject_Add(ep_tbb
         PREFIX "externals"
         URL "https://github.com/intel/tbb/archive/v2020.1.tar.gz"
-        URL_HASH SHA1=493a1faf80a7ab320448eec0fbfaedf40e9574ee
+        URL_HASH SHA1=c42a33b5fc42aedeba75c204a5367593e28a6977
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""
         UPDATE_COMMAND ""


Empty OpenCV_DEFINITIONS if OpenCV is not found.

--- cmake/modules/FindOpenCV.cmake
+++ cmake/modules/FindOpenCV.cmake
@@ -17,7 +17,12 @@
 find_library(OpenCV_HIGHGUI_LIBRARY opencv_highgui         HINTS ${OpenCV_DIR}/lib ${OpenCV_DIR}/lib64)
 find_library(OpenCV_VIDEOIO_LIBRARY opencv_videoio         HINTS ${OpenCV_DIR}/lib ${OpenCV_DIR}/lib64)
 find_library(OpenCV_CUDAFILTERS_LIBRARY opencv_cudafilters HINTS ${OpenCV_DIR}/lib ${OpenCV_DIR}/lib64)
-set(OpenCV_DEFINITIONS "-D OPENCV")
+set(OpenCV_DEFINITIONS "")
+if(NOT OpenCV_CORE_LIBRARY)
+    set(OpenCV_CORE_LIBRARY "")
+else()
+    set(OpenCV_DEFINITIONS "-D OPENCV")
+endif()
 if(OpenCV_CUDAFILTERS_LIBRARY)
     set(OpenCV_DEFINITIONS "${OpenCV_DEFINITIONS} -D OPENCV_CUDA_FOUND")
 else()
@@ -32,9 +37,6 @@
 if(NOT OpenCV_IMGPROC_LIBRARY)
     set(OpenCV_IMGPROC_LIBRARY "")
 endif()
-if(NOT OpenCV_CORE_LIBRARY)
-    set(OpenCV_CORE_LIBRARY "")
-endif()

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(OpenCV DEFAULT_MSG OpenCV_INCLUDE_DIR OpenCV_CORE_LIBRARY)


Changes...

Changes...

--- cmake/platform/Propeller.cmake
+++ cmake/platform/Propeller.cmake
@@ -110,14 +110,21 @@

 # Executable Paths #############################################################

-find_program(CMAKE_OBJCOPY NAMES "propeller-elf-objcopy")
-find_program(CMAKE_OBJDUMP NAMES "propeller-elf-objdump")
-
-find_program(CMAKE_OBJLOAD NAMES "propeller-load")
-find_program(CMAKE_OBJSPIN NAMES "openspin")
-
-find_program(CMAKE_OBJSIZE_BIN NAMES "propeller-bin-size.cmake")
-find_program(CMAKE_OBJSIZE_ELF NAMES "propeller-elf-size.cmake")
+find_program(CMAKE_OBJCOPY "propeller-elf-objcopy")
+find_program(CMAKE_OBJDUMP "propeller-elf-objdump")
+
+find_program(OPENSPIN "openspin")
+
+# Size Stuff ###################################################################
+
+find_program(PROPELLER_ELF_SIZE "propeller-elf-size")
+
+find_program(PROPELLER_BIN_SIZE_SCRIPT "propeller-bin-size.cmake")
+find_program(PROPELLER_ELF_SIZE_SCRIPT "propeller-elf-size.cmake")
+
+# Upload Stuff #################################################################
+
+find_program(PROPELLER_LOAD "propeller-load")

 ################################################################################
 # generate_cogc_object() - Compiles cogc source into a linkable cogc object.
@@ -133,10 +140,10 @@

     if("${COGC_FILE_EXT}" STREQUAL ".cogc")
         set(COGC_COMPILIER "${CMAKE_C_COMPILER}")
-        set(COGC_FLAGS "${CMAKE_C_FLAGS} -xc -mcog -r")
+        set(COGC_FLAGS "${CMAKE_C_FLAGS} -mcog -r -xc")
     elseif("${COGC_FILE_EXT}" STREQUAL ".cogcpp")
         set(COGC_COMPILIER "${CMAKE_CXX_COMPILER}")
-        set(COGC_FLAGS "${CMAKE_CXX_FLAGS} -xc++ -mcog -r")
+        set(COGC_FLAGS "${CMAKE_CXX_FLAGS} -mcog -r -xc++")
     else()
         message(FATAL_ERROR "Unknown file type \"${COGC_FILE_EXT}\"!")
     endif()
@@ -150,9 +157,9 @@
     set_source_files_properties("${COGC_FILE_OBJ}" PROPERTIES
     EXTERNAL_OBJECT TRUE GENERATED TRUE)

+    get_filename_component(COGC_FILE_OBJ_NAME "${COGC_FILE_OBJ}" NAME_WE)
+
     separate_arguments(COGC_FLAGS)
-
-    get_filename_component(COGC_FILE_OBJ_NAME "${COGC_FILE_OBJ}" NAME)

     add_custom_command(OUTPUT "${COGC_FILE_OBJ}"
     COMMAND "${COGC_COMPILIER}"
@@ -161,7 +168,7 @@
     ARGS -c "${COGC_FILE}"
     COMMAND "${CMAKE_OBJCOPY}"
     ARGS --localize-text --rename-section
-    ARGS .text="${COGC_FILE_OBJ_NAME}"
+    ARGS .text="${COGC_FILE_OBJ_NAME}.cog"
     ARGS "${COGC_FILE_OBJ}"
     DEPENDS "${COGC_FILE}")

@@ -194,15 +201,28 @@
     set_source_files_properties("${SPIN_FILE_OBJ}" PROPERTIES
     EXTERNAL_OBJECT TRUE GENERATED TRUE)

+    get_filename_component(SPIN_FILE_OBJ_PATH "${SPIN_FILE_OBJ}" DIRECTORY)
+    get_filename_component(SPIN_FILE_OBJ_NAME "${SPIN_FILE_OBJ}" NAME_WE)
+
+    set(SPIN_FILE_DAT "${SPIN_FILE_OBJ_PATH}/${SPIN_FILE_OBJ_NAME}.dat")
+    get_filename_component(SPIN_FILE_DAT_NAME "${SPIN_FILE_DAT}" NAME)
+
+    get_filename_component(SPATH "${SPIN_FILE}" DIRECTORY)
+
     add_custom_command(OUTPUT "${SPIN_FILE_OBJ}"
-    COMMAND "${CMAKE_OBJSPIN}"
+    COMMAND "${OPENSPIN}"
     ARGS -I "${PROPELLER_SDK_PATH}/propeller-gcc/spin"
-    ARGS -o "${SPIN_FILE_OBJ}"
+    ARGS -I "${SPATH}"
+    ARGS -o "${SPIN_FILE_DAT}"
     ARGS -c "${SPIN_FILE}"
-    COMMAND "${CMAKE_OBJCOPY}"
+    COMMAND "${CMAKE_COMMAND}"
+    ARGS -E chdir "${SPIN_FILE_OBJ_PATH}"
+    ARGS "${CMAKE_OBJCOPY}"
     ARGS -I binary -B propeller -O propeller-elf-gcc
+    ARGS "${SPIN_FILE_DAT_NAME}"
     ARGS "${SPIN_FILE_OBJ}"
-    ARGS "${SPIN_FILE_OBJ}"
+    COMMAND "${CMAKE_COMMAND}"
+    ARGS -E remove "${SPIN_FILE_DAT}"
     DEPENDS "${SPIN_FILE}")

     set(SPIN_FILE_OBJECT "${SPIN_FILE_OBJ}" PARENT_SCOPE)
@@ -285,19 +305,37 @@
     list(REMOVE_DUPLICATES SIDE_FILE_HEADER_LIST)
     list(REMOVE_DUPLICATES SIDE_FILE_FOLDER_LIST)

-    # foreach(SIDE_FILE_SOURCE ${SIDE_FILE_SOURCE_LIST})
-        # get_source_file_property(OBJ_DEPS "${SIDE_FILE_SOURCE}" OBJECT_DEPENDS)
-        # list(APPEND OBJ_DEPS "${SIDE_FILE}")
-        # set_source_files_properties("${SIDE_FILE_SOURCE}" PROPERTIES
-        # OBJECT_DEPENDS "${OBJ_DEPS}")
-    # endforeach()
-
-    # foreach(SIDE_FILE_HEADER ${SIDE_FILE_HEADER_LIST})
-        # get_source_file_property(OBJ_DEPS "${SIDE_FILE_HEADER}" OBJECT_DEPENDS)
-        # list(APPEND OBJ_DEPS "${SIDE_FILE}")
-        # set_source_files_properties("${SIDE_FILE_HEADER}" PROPERTIES
-        # OBJECT_DEPENDS "${OBJ_DEPS}")
-    # endforeach()
+    foreach(SIDE_FILE_SOURCE ${SIDE_FILE_SOURCE_LIST})
+
+        set(DEP_LIST "${SIDE_FILE}")
+
+        get_source_file_property(OBJ_DEPS "${SIDE_FILE_SOURCE}" OBJECT_DEPENDS)
+
+        if(OBJ_DEPS)
+            list(APPEND DEP_LIST "${OBJ_DEPS}")
+        endif()
+
+        list(REMOVE_DUPLICATES DEP_LIST)
+        set_source_files_properties("${SIDE_FILE_SOURCE}" PROPERTIES
+        OBJECT_DEPENDS "${DEP_LIST}")
+
+    endforeach()
+
+    foreach(SIDE_FILE_HEADER ${SIDE_FILE_HEADER_LIST})
+
+        set(DEP_LIST "${SIDE_FILE}")
+
+        get_source_file_property(OBJ_DEPS "${SIDE_FILE_HEADER}" OBJECT_DEPENDS)
+
+        if(OBJ_DEPS)
+            list(APPEND DEP_LIST "${OBJ_DEPS}")
+        endif()
+
+        list(REMOVE_DUPLICATES DEP_LIST)
+        set_source_files_properties("${SIDE_FILE_HEADER}" PROPERTIES
+        OBJECT_DEPENDS "${DEP_LIST}")
+
+    endforeach()

     set(SIDE_FILE_SOURCES ${SIDE_FILE_SOURCE_LIST} PARENT_SCOPE)
     set(SIDE_FILE_HEADERS ${SIDE_FILE_HEADER_LIST} PARENT_SCOPE)
@@ -365,7 +403,7 @@
             endforeach()

             file(GLOB_RECURSE SPIN_FILES
-            "${LIBRARY_PATH}/*.spin")
+            "${FF_PATH}/*.spin")

             foreach(SPIN_FILE ${SPIN_FILES})

@@ -538,6 +576,113 @@
 endfunction()

 ################################################################################
+# setup_bin_size() - Setup size.
+#
+# INPUT = TARGET_NAME - Target name.
+################################################################################
+
+function(setup_bin_size TARGET_NAME)
+
+    add_custom_command(TARGET "${TARGET_NAME}" POST_BUILD
+    COMMAND "${CMAKE_COMMAND}"
+    ARGS "-DBIN_FILE_PATH=\"${CMAKE_BINARY_DIR}/${TARGET_NAME}.binary\""
+    -P "${PROPELLER_BIN_SIZE_SCRIPT}")
+
+endfunction()
+
+################################################################################
+# setup_elf_size() - Setup size.
+#
+# INPUT = TARGET_NAME - Target name.
+################################################################################
+
+function(setup_elf_size TARGET_NAME)
+
+    add_custom_command(TARGET "${TARGET_NAME}" POST_BUILD
+    COMMAND "${CMAKE_COMMAND}"
+    ARGS "-DELF_FILE_PATH=\"${CMAKE_BINARY_DIR}/${TARGET_NAME}.elf\""
+    "-DPROPELLER_ELF_SIZE=\"${PROPELLER_ELF_SIZE}\""
+    -P "${PROPELLER_ELF_SIZE_SCRIPT}")
+
+endfunction()
+
+################################################################################
+# setup_bin_upload() - Setup upload.
+#
+# INPUT = TARGET_NAME - Target name.
+################################################################################
+
+function(setup_bin_upload TARGET_NAME)
+
+    set(UPLOAD_COMMAND_LIST "-r" "-e")
+
+    if((DEFINED ${TARGET_NAME}_BOARD)
+    AND (NOT "${${TARGET_NAME}_BOARD}" STREQUAL ""))
+        list(APPEND UPLOAD_COMMAND_LIST "-b" "${${TARGET_NAME}_BOARD}")
+    endif()
+
+    if((DEFINED ${TARGET_NAME}_PORT)
+    AND (NOT "${${TARGET_NAME}_PORT}" STREQUAL ""))
+        list(APPEND UPLOAD_COMMAND_LIST "-p" "${${TARGET_NAME}_PORT}")
+    endif()
+
+    if((DEFINED ${TARGET_NAME}_CF)
+    AND (NOT "${${TARGET_NAME}_CF}" STREQUAL ""))
+        list(APPEND UPLOAD_COMMAND_LIST "-D" "clkfreq=${${TARGET_NAME}_CF}")
+    endif()
+
+    if((DEFINED ${TARGET_NAME}_CM)
+    AND (NOT "${${TARGET_NAME}_CM}" STREQUAL ""))
+        list(APPEND UPLOAD_COMMAND_LIST "-D" "clkmode=${${TARGET_NAME}_CM}")
+    endif()
+
+    add_custom_target("upload"
+    COMMAND "${PROPELLER_LOAD}"
+    ${UPLOAD_COMMAND_LIST}
+    "${CMAKE_BINARY_DIR}/${TARGET_NAME}.binary"
+    DEPENDS "${TARGET_NAME}")
+
+endfunction()
+
+################################################################################
+# setup_elf_upload() - Setup upload.
+#
+# INPUT = TARGET_NAME - Target name.
+################################################################################
+
+function(setup_elf_upload TARGET_NAME)
+
+    set(UPLOAD_COMMAND_LIST "-r" "-e")
+
+    if((DEFINED ${TARGET_NAME}_BOARD)
+    AND (NOT "${${TARGET_NAME}_BOARD}" STREQUAL ""))
+        list(APPEND UPLOAD_COMMAND_LIST "-b" "${${TARGET_NAME}_BOARD}")
+    endif()
+
+    if((DEFINED ${TARGET_NAME}_PORT)
+    AND (NOT "${${TARGET_NAME}_PORT}" STREQUAL ""))
+        list(APPEND UPLOAD_COMMAND_LIST "-p" "${${TARGET_NAME}_PORT}")
+    endif()
+
+    if((DEFINED ${TARGET_NAME}_CF)
+    AND (NOT "${${TARGET_NAME}_CF}" STREQUAL ""))
+        list(APPEND UPLOAD_COMMAND_LIST "-D" "clkfreq=${${TARGET_NAME}_CF}")
+    endif()
+
+    if((DEFINED ${TARGET_NAME}_CM)
+    AND (NOT "${${TARGET_NAME}_CM}" STREQUAL ""))
+        list(APPEND UPLOAD_COMMAND_LIST "-D" "clkmode=${${TARGET_NAME}_CM}")
+    endif()
+
+    add_custom_target("upload"
+    COMMAND "${PROPELLER_LOAD}"
+    ${UPLOAD_COMMAND_LIST}
+    "${CMAKE_BINARY_DIR}/${TARGET_NAME}.elf"
+    DEPENDS "${TARGET_NAME}")
+
+endfunction()
+
+################################################################################
 # setup_libraries() - Setup all libraries to be built.
 #
 # INPUT = LIBRARY_PATHS - Library root folder paths.
@@ -599,66 +744,10 @@
 endfunction()

 ################################################################################
-# setup_size() - Setup size.
+# generate_propeller_firmware() - Main Function.
 #
 # INPUT = TARGET_NAME - Target name.
-################################################################################
-
-function(setup_size TARGET_NAME)
-
-    find_program(PROPELLER_ELF_SIZE "propeller-elf-size")
-
-    add_custom_command(TARGET "${TARGET_NAME}" POST_BUILD
-    COMMAND "${CMAKE_COMMAND}"
-    ARGS "-DELF_FILE_PATH=\"${CMAKE_BINARY_DIR}/${TARGET_NAME}.elf\""
-    "-DPROPELLER_ELF_SIZE=\"${PROPELLER_ELF_SIZE}\""
-    -P "${CMAKE_OBJSIZE_ELF}")
-
-endfunction()
-
-################################################################################
-# setup_upload() - Setup upload.
-#
-# INPUT = TARGET_NAME - Target name.
-################################################################################
-
-function(setup_upload TARGET_NAME)
-
-    set(UPLOAD_COMMAND_LIST "-r" "-e")
-
-    if(DEFINED ${TARGET_NAME}_BOARD
-    AND NOT "${${TARGET_NAME}_BOARD}" STREQUAL "")
-        list(APPEND UPLOAD_COMMAND_LIST "-b" "${${TARGET_NAME}_BOARD}")
-    endif()
-
-    if(DEFINED ${TARGET_NAME}_PORT
-    AND NOT "${${TARGET_NAME}_PORT}" STREQUAL "")
-        list(APPEND UPLOAD_COMMAND_LIST "-p" "${${TARGET_NAME}_PORT}")
-    endif()
-
-    if(DEFINED ${TARGET_NAME}_CF
-    AND NOT "${${TARGET_NAME}_CF}" STREQUAL "")
-        list(APPEND UPLOAD_COMMAND_LIST "-D" "clkfreq=${${TARGET_NAME}_CF}")
-    endif()
-
-    if(DEFINED ${TARGET_NAME}_CM
-    AND NOT "${${TARGET_NAME}_CM}" STREQUAL "")
-        list(APPEND UPLOAD_COMMAND_LIST "-D" "clkmode=${${TARGET_NAME}_CM}")
-    endif()
-
-    add_custom_target("upload"
-    COMMAND "${CMAKE_OBJLOAD}"
-    ${UPLOAD_COMMAND_LIST}
-    "${CMAKE_BINARY_DIR}/${TARGET_NAME}.elf"
-    DEPENDS "${TARGET_NAME}")
-
-endfunction()
-
-################################################################################
-# generate_propeller_firmware() - Main Function.
-#
-# INPUT = TARGET_NAME - Target name.
-# INPUT = ${PROJECT_NAME}_LIBS - Library root folder paths.
+# INPUT = ${TARGET_NAME}_LIBS - Library root folder paths.
 # INPUT = ${TARGET_NAME}_FPATH - File or folder path.
 # INPUT = ${TARGET_NAME}_MM - Memory model.
 # INPUT = ${TARGET_NAME}_BOARD - Board name (optional).
@@ -677,6 +766,43 @@
         message(FATAL_ERROR "File or folder path is empty!")
     endif()

+    if(NOT IS_DIRECTORY "${${TARGET_NAME}_FPATH}")
+
+        get_filename_component(FILE_TYPE "${${TARGET_NAME}_FPATH}" EXT)
+        string(TOLOWER "${FILE_TYPE}" FILE_TYPE)
+
+        if("${FILE_TYPE}" STREQUAL ".spin")
+
+            get_filename_component(FILE_NAME "${${TARGET_NAME}_FPATH}" NAME_WE)
+            string(REGEX REPLACE "[^0-9A-Za-z]" "_" FILE_NAME "${FILE_NAME}")
+
+            set(FILE_NAME_BINARY "${CMAKE_BINARY_DIR}/${FILE_NAME}.binary")
+
+            set_source_files_properties("${FILE_NAME_BINARY}" PROPERTIES
+            EXTERNAL_OBJECT TRUE GENERATED TRUE)
+
+            get_filename_component(SPATH "${${TARGET_NAME}_FPATH}" DIRECTORY)
+
+            add_custom_command(OUTPUT "${FILE_NAME_BINARY}"
+            COMMAND "${OPENSPIN}"
+            ARGS -I "${PROPELLER_SDK_PATH}/propeller-gcc/spin"
+            ARGS -I "${SPATH}"
+            ARGS -o "${FILE_NAME_BINARY}"
+            ARGS -b "${${TARGET_NAME}_FPATH}"
+            DEPENDS "${${TARGET_NAME}_FPATH}")
+
+            add_custom_target("${FILE_NAME}" ALL
+            DEPENDS "${FILE_NAME_BINARY}")
+
+            setup_bin_size("${FILE_NAME}")
+            setup_bin_upload("${FILE_NAME}")
+
+            return()
+
+        endif()
+
+    endif()
+
     if(NOT DEFINED ${TARGET_NAME}_MM)
         message(FATAL_ERROR "Memory model is not defined!")
     endif()
@@ -690,21 +816,29 @@
         message(FATAL_ERROR "Unknown mem model \"${${TARGET_NAME}_MM}\"!")
     endif()

-    add_definitions("-D__PROPELLER__" "")
-
-    setup_libraries("${${PROJECT_NAME}_LIBS}"
-    "-m${${TARGET_NAME}_MM}"
-    "-m${${TARGET_NAME}_MM}")
+    add_definitions("-D__PROPELLER__")
+
+    if((DEFINED ${TARGET_NAME}_LIBS) AND ${TARGET_NAME}_LIBS)
+        setup_libraries("${${TARGET_NAME}_LIBS}"
+        "-m${${TARGET_NAME}_MM}"
+        "-m${${TARGET_NAME}_MM}")
+    endif()

     setup_executable("${${TARGET_NAME}_FPATH}"
     "-m${${TARGET_NAME}_MM}"
     "-m${${TARGET_NAME}_MM}")

-    target_link_libraries("${EXE_TARGET}"
-    "-Wl,--start-group" ${LIB_TARGETS} "-Wl,--end-group")
-
-    setup_size("${EXE_TARGET}")
-    setup_upload("${EXE_TARGET}")
+    if(NOT "${EXE_TARGET}" STREQUAL "")
+
+        if((DEFINED LIB_TARGETS) AND LIB_TARGETS)
+            target_link_libraries("${EXE_TARGET}"
+            "-Wl,--start-group" ${LIB_TARGETS} "-Wl,--end-group")
+        endif()
+
+        setup_elf_size("${EXE_TARGET}")
+        setup_elf_upload("${EXE_TARGET}")
+
+    endif()

 endfunction()


fixed DMD GNU/Linux compile with target, updated downloads

--- cmaked/CMakeDInformation.cmake
+++ cmaked/CMakeDInformation.cmake
@@ -157,7 +157,7 @@
   ELSE(CMAKE_COMPILER_IS_GDC)
     IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
       SET(CMAKE_D_LINK_EXECUTABLE
-	"gcc <FLAGS> <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -lphobos -lpthread -lm")
+	"gcc <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -lphobos -lpthread -lm")
     ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
       SET(CMAKE_D_LINK_EXECUTABLE
 	"<CMAKE_D_COMPILER> <FLAGS> <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> ${CMAKE_OUTPUT_D_FLAG}<TARGET> <LINK_LIBRARIES>")


MOD: Added cmake project dependencies of SampleFramework to the Sample projects

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -336,11 +336,15 @@
 # Define a CEGUI sample app
 #
 macro (cegui_add_sample _NAME)
+    add_dependencies(${CEGUI_TARGET_NAME} ${CEGUI_SAMPLEFRAMEWORK_EXENAME}
+                            ${CEGUI_TARGET_NAME} ${_NAME}${CEGUI_SLOT_VERSION}
+    )
+
     set (CEGUI_TARGET_NAME ${_NAME}${CEGUI_SLOT_VERSION})

     include_directories(${CMAKE_SOURCE_DIR}/samples/common/include)

-
+

     if (CEGUI_SAMPLES_USE_DIRECT3D9 OR CEGUI_SAMPLES_USE_DIRECT3D10 OR CEGUI_SAMPLES_USE_DIRECT3D11)
         link_directories(${DIRECTXSDK_LIBRARY_DIR})
@@ -352,6 +356,9 @@
 		${CMAKE_SOURCE_DIR}/samples/common/include/Sample.h
 		${CMAKE_SOURCE_DIR}/samples/common/include/SampleBase.h
 	)
+
+
+

     ###########################################################################
     #                   Dynamically Linked Library


Coverage must be supported by all compilers to use it.

--- cmake/Findcodecov.cmake
+++ cmake/Findcodecov.cmake
@@ -107,35 +107,47 @@
 # Check for coverage compiler flags in C and CXX, if one of those languages is
 # enabled. At least one language must pass this test to continue processing this
 # module.
-include(CheckCCompilerFlag)
-include(CheckCXXCompilerFlag)
-
-set(COVERAGE_FOUND false)
+set(_COVERAGE_REQUIRED_VARS)
 get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
 foreach (LANG ${LANGUAGES})
-	# check compiler for coverage support.
+	list(APPEND _COVERAGE_REQUIRED_VARS HAVE_COVERAGE_${LANG})
+
+	set(CMAKE_REQUIRED_FLAGS "${COVERAGE_LINKER_FLAGS}")
 	if (${LANG} STREQUAL C)
-		set(CMAKE_REQUIRED_FLAGS "${COVERAGE_LINKER_FLAGS}")
+		include(CheckCCompilerFlag)
 		check_c_compiler_flag("${COVERAGE_CFLAGS}" HAVE_COVERAGE_C)
-		unset(CMAKE_REQUIRED_FLAGS)

 	elseif (${LANG} STREQUAL CXX)
-		set(CMAKE_REQUIRED_FLAGS "${COVERAGE_LINKER_FLAGS}")
+		include(CheckCXXCompilerFlag)
 		check_cxx_compiler_flag("${COVERAGE_CFLAGS}" HAVE_COVERAGE_CXX)
-		unset(CMAKE_REQUIRED_FLAGS)
+
+	elseif (${LANG} STREQUAL Fortran)
+		include(CheckFortranCompilerFlag OPTIONAL RESULT_VARIABLE INCLUDED)
+		if (INCLUDED)
+			check_fortran_compiler_flag("${COVERAGE_CFLAGS}" HAVE_COVERAGE_Fortran)
+		else ()
+			message("-- Performing Test HAVE_COVERAGE_Fortran")
+			message("-- Performing Test HAVE_COVERAGE_Fortran - Failed (Check not supported)")
+		endif ()
 	endif()
-
-	# If compiler supports coverage, announce that we have found a compiler with
-	# coverage support.
-	if (HAVE_COVERAGE_${LANG})
-		set(COVERAGE_FOUND true)
-	endif ()
+	unset(CMAKE_REQUIRED_FLAGS)
 endforeach()
+
+
+if (_COVERAGE_REQUIRED_VARS)
+	include(FindPackageHandleStandardArgs)
+	find_package_handle_standard_args(codecov REQUIRED_VARS ${_COVERAGE_REQUIRED_VARS})
+	mark_as_advanced(${_COVERAGE_REQUIRED_VARS})
+	unset(_COVERAGE_REQUIRED_VARS)
+else()
+	message(SEND_ERROR "Codecoverage requires C, CXX or Fortran language to be enabled")
+	return()
+endif()
+

 # Abort, if no coverage support by compiler. Disable coverage for further
 # processing, so add_coverage will ignore it.
-if (NOT COVERAGE_FOUND)
-	message(WARNING "No compiler supports coverage.")
+if (NOT codecov_FOUND)
 	set(ENABLE_COVERAGE OFF)
 	return()
 endif()


Install licenses typo check

Install licenses typo check

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -270,10 +270,12 @@
 		COMPONENT fast
 )
 # Install licenses
+if(EXISTS ${PROJECT_BINARY_DIR}/licenses)
 install(DIRECTORY ${PROJECT_BINARY_DIR}/licenses/
 		DESTINATION fast/licenses
         COMPONENT fast
 )
+endif()
 install(DIRECTORY ${PROJECT_BINARY_DIR}/licences/
 		DESTINATION fast/licenses
         COMPONENT fast


Code sign executables on mac as well.

Code sign executables on mac as well.

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -56,7 +56,9 @@
 		install(CODE "
     file(GLOB installedSOs
             \"$ENV\{DESTDIR\}/$\{CMAKE_INSTALL_PREFIX\}/fast/lib/*.dylib*\"
-            \"$ENV\{DESTDIR\}/$\{CMAKE_INSTALL_PREFIX\}/fast/lib/*.so*\")
+            \"$ENV\{DESTDIR\}/$\{CMAKE_INSTALL_PREFIX\}/fast/lib/*.so*\"
+            \"$ENV\{DESTDIR\}/$\{CMAKE_INSTALL_PREFIX\}/fast/bin/*\"
+	)

     foreach(SO $\{installedSOs\})
 		execute_process(COMMAND codesign -s \"Erik Smistad\" --timestamp --signature-size=12000 $\{SO\} RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE err)


PyhtonINterp only required for tests

PyhtonINterp only required for tests

--- cmake/flann_utils.cmake
+++ cmake/flann_utils.cmake
@@ -79,7 +79,7 @@
     endif(NOT _file_name)

     # find python
-    find_package(PythonInterp REQUIRED)
+    find_package(PythonInterp)

     # add target for running test
     string(REPLACE "/" "_" _testname ${file})
@@ -99,7 +99,7 @@
     string(REPLACE "/" "_" _dataset_name dataset_${_name})

     # find python
-    find_package(PythonInterp REQUIRED)
+    find_package(PythonInterp)

     add_custom_target(${_dataset_name}
         COMMAND ${PROJECT_SOURCE_DIR}/bin/download_checkmd5.py http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/${_name} ${TEST_OUTPUT_PATH}/${_name} ${_md5}


add a check to build only for 32-bit projects because SDK lib is 32-bit

--- cmake/FindSMI.cmake
+++ cmake/FindSMI.cmake
@@ -64,49 +64,43 @@

 if(WIN32)
     # Test 32/64 bits
-    if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
-        set(SMI_LIBRARY_PATH_SUFFIX "lib/x64")
-    else()
-        set(SMI_LIBRARY_PATH_SUFFIX "lib")
+    if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
+        # Get desired program files directory
+        set(_PF86_ENV "ProgramFiles(x86)")
+        set(_PF86 $ENV{${_PF86_ENV}})
+
+        if(NOT "$ENV{${_PF86}}" STREQUAL "")
+        # 32-bit dir: only set on win64
+            file(TO_CMAKE_PATH "$ENV{_PF86}" _progfiles)
+        else()
+        # 32-bit dir on win32
+            file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles)
+        endif()
+
+        find_library(SMI_HMDAPI_LIBRARY
+            NAMES
+            iViewHMDAPI
+            PATHS
+            "${SMI_ROOT_DIR}"
+            "${_progfiles}/SMI/iViewNG-HMD/SDK/libs")
+
+        if(SMI_HMDAPI_LIBRARY)
+            get_filename_component(_libdir "${SMI_HMDAPI_LIBRARY}" DIRECTORY)
+        endif()
+
+        find_path(SMI_INCLUDE_DIR
+            NAMES
+            iViewHMDAPI.h
+            HINTS
+            "${_libdir}/../include"
+            "${_libdir}/../../include"
+            PATHS
+            "${SMI_ROOT_DIR}"
+            "${_progfiles}/SMI/iViewNG-HMD/SDK/include"
+            PATH_SUFFIXES
+            inc
+        )
     endif()
-
-    # Get desired program files directory
-    set(_PF86_ENV "ProgramFiles(x86)")
-    set(_PF86 $ENV{${_PF86_ENV}})
-
-    if(NOT "$ENV{${_PF86}}" STREQUAL "")
-    # 32-bit dir: only set on win64
-        file(TO_CMAKE_PATH "$ENV{_PF86}" _progfiles)
-    else()
-    # 32-bit dir on win32
-        file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles)
-    endif()
-
-    find_library(SMI_HMDAPI_LIBRARY
-        NAMES
-        iViewHMDAPI
-        PATHS
-        "${SMI_ROOT_DIR}"
-        "${_progfiles}/SMI/iViewNG-HMD/SDK/libs"
-        PATH_SUFFIXES
-        ${SMI_LIBRARY_PATH_SUFFIX})
-
-    if(SMI_HMDAPI_LIBRARY)
-        get_filename_component(_libdir "${SMI_HMDAPI_LIBRARY}" DIRECTORY)
-    endif()
-
-    find_path(SMI_INCLUDE_DIR
-        NAMES
-        iViewHMDAPI.h
-        HINTS
-        "${_libdir}/../include"
-        "${_libdir}/../../include"
-        PATHS
-        "${SMI_ROOT_DIR}"
-        "${_progfiles}/SMI/iViewNG-HMD/SDK/include"
-        PATH_SUFFIXES
-        inc
-    )
 endif() # WIN32

 include(FindPackageHandleStandardArgs)


fix cmake to find TBB installed from source

there was a problem with the FindTBB script for cmake where it cmake was
not looking in paths specified by the environment variable LIBRARY_PATH,
which meant that it was not finding the TBB library files when TBB had
been installed from source and configured with tbbvars.sh

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -178,7 +178,7 @@
     # Search for the libraries
     find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}
         HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
-        PATHS ${TBB_DEFAULT_SEARCH_DIR}
+        PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH
         PATH_SUFFIXES "${TBB_LIB_PATH_SUFFIX}")

     find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}_debug


Use master branch for website deployment

Merged all changes from web-updates -> master

--- cmake/Website.cmake
+++ cmake/Website.cmake
@@ -21,8 +21,7 @@
       WORKING_DIRECTORY "${WEB_DIR}"
       COMMAND rm -rf ${WEB_DIR} && mkdir ${WEB_DIR}
       COMMAND git clone https://github.com/BioDynaMo/website.git .
-      # TODO: merge into master to avoid this
-      COMMAND git checkout web-updates
+      COMMAND git checkout master
       COMMENT "Generate website"
       COMMAND ./build_website.sh --dir ${CMAKE_CURRENT_SOURCE_DIR} ${FLAGS}
       VERBATIM)


scripts: kconfig: Switch 'menuconfig' over to menuconfig.py

Make 'make/ninja menuconfig' run menuconfig.py instead of mconf from the
C Kconfig tools. Get rid of the 'pymenuconfig' target.

Signed-off-by: Ulf Magnusson <f650684f780c6b48c0158c4e0f2e27f74aabc755@gmail.com>

--- cmake/kconfig.cmake
+++ cmake/kconfig.cmake
@@ -22,19 +22,17 @@
   config
   gconfig
   menuconfig
-  pymenuconfig
   oldconfig
   xconfig
   )

-set(COMMAND_FOR_config       ${KCONFIG_CONF} --oldaskconfig ${KCONFIG_ROOT})
-set(COMMAND_FOR_gconfig      gconf                          ${KCONFIG_ROOT})
-set(COMMAND_FOR_menuconfig   ${KCONFIG_MCONF}               ${KCONFIG_ROOT})
-set(COMMAND_FOR_pymenuconfig ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/kconfig/menuconfig.py ${KCONFIG_ROOT})
-set(COMMAND_FOR_oldconfig    ${KCONFIG_CONF} --oldconfig    ${KCONFIG_ROOT})
-set(COMMAND_FOR_xconfig      qconf                          ${KCONFIG_ROOT})
+set(COMMAND_FOR_config     ${KCONFIG_CONF} --oldaskconfig ${KCONFIG_ROOT})
+set(COMMAND_FOR_gconfig    gconf                          ${KCONFIG_ROOT})
+set(COMMAND_FOR_menuconfig ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/kconfig/menuconfig.py ${KCONFIG_ROOT})
+set(COMMAND_FOR_oldconfig  ${KCONFIG_CONF} --oldconfig    ${KCONFIG_ROOT})
+set(COMMAND_FOR_xconfig    qconf                          ${KCONFIG_ROOT})

-set(COMMAND_RUNS_ON_WIN_pymenuconfig 1)
+set(COMMAND_RUNS_ON_WIN_menuconfig 1)

 # Set environment variables so that Kconfig can prune Kconfig source
 # files for other architectures


cmake: menuconfig: Fix missing SOC_DIR macro

menuconfig was being invoked without an initialized SOC_DIR, leading to
errors when parsing the top-level Kconfig.zephyr file.

Signed-off-by: Carles Cufi <853081dc8dca4fe6a7e3c984752718b5db36e060@nordicsemi.no>

--- cmake/kconfig.cmake
+++ cmake/kconfig.cmake
@@ -32,6 +32,7 @@
   KCONFIG_CONFIG=${DOTCONFIG}
   ARCH=$ENV{ARCH}
   BOARD_DIR=$ENV{BOARD_DIR}
+  SOC_DIR=$ENV{SOC_DIR}
   ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/kconfig/menuconfig.py ${KCONFIG_ROOT}
   WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/kconfig
   USES_TERMINAL


Fix call to find_package_handle_standard_args

--- cmake/FindFOX.cmake
+++ cmake/FindFOX.cmake
@@ -55,7 +55,7 @@
 endif()

 find_package_handle_standard_args(FOX
-  FOX DEFAULT_MSG
+  DEFAULT_MSG
   FOX_INCLUDE_DIR
   FOX_LIBRARY
 )


cmake: Check if Fortran compiler is usable before enabling it.

--- cmake/f_check.cmake
+++ cmake/f_check.cmake
@@ -20,19 +20,16 @@
 # NEEDBUNDERSCORE
 # NEED2UNDERSCORES

-if (NOT NO_LAPACK)
-  include(CheckLanguage)
-  check_language(Fortran)
-  if(CMAKE_Fortran_COMPILER)
-    enable_language(Fortran)
-  else()
-  message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")
+include(CheckLanguage)
+check_language(Fortran)
+if(CMAKE_Fortran_COMPILER)
+  enable_language(Fortran)
+else()
+  if (NOT NO_LAPACK)
+    message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")
+  endif()
   set (NOFORTRAN 1)
   set (NO_LAPACK 1)
-  endif()
-else()
-  include(CMakeForceCompiler)
-  CMAKE_FORCE_Fortran_COMPILER(gfortran GNU)
 endif()

 if (NOT ONLY_CBLAS)


vulkan: add spirv-val to the shader build command

--- cmake/glslang.cmake
+++ cmake/glslang.cmake
@@ -8,8 +8,15 @@
 find_program(VULKAN_GLSLANGVALIDATOR_EXEC glslangValidator
     HINT "$ENV{VULKAN_SDK}/Bin")

+find_program(VULKAN_SPIRV_VAL_EXEC spirv-val
+    HINT "$ENV{VULKAN_SDK}/Bin")
+
 if(NOT VULKAN_GLSLANGVALIDATOR_EXEC)
     message(FATAL_ERROR "${VULKAN_GLSLANGVALIDATOR_EXEC} not found")
+endif()
+
+if(NOT VULKAN_SPIRV_VAL_EXEC)
+    message(FATAL_ERROR "${VULKAN_SPIRV_VAL_EXEC} not found")
 endif()

 # This function will create SPIR-V targets for each input glsl file and append it
@@ -27,6 +34,7 @@
         add_custom_command(OUTPUT ${OUTPUT_SPIRV}
             COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_SPIRV_PATH}
             COMMAND ${VULKAN_GLSLANGVALIDATOR_EXEC} -V ${INPUT_GLSL} -o ${OUTPUT_SPIRV}
+            COMMAND ${VULKAN_SPIRV_VAL_EXEC} ${OUTPUT_SPIRV}
             MAIN_DEPENDENCY ${INPUT_GLSL}
             COMMENT "Compiling GLSL shader ${INPUT_GLSL_REL} into SPIR-V (${OUTPUT_SPIRV_NAME})"
             VERBATIM


r9616/sofa : ADD: cmake SOFA-MISC_USE_FLOAT and SOFA-MISC_USE_DOUBLE

Former-commit-id: c5647717155fad734c4284b79bbc6ee290b8fb5d

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -332,6 +332,15 @@
 	list(APPEND compilerDefines SOFA_DEV)
 endif()

+# float / double or both
+option(SOFA-MISC_USE_FLOAT "Use single precision floating point (float)" OFF)
+option(SOFA-MISC_USE_DOUBLE "Use double precision floating point (double)" OFF)
+if(SOFA-MISC_USE_FLOAT AND NOT SOFA-MISC_USE_DOUBLE)
+	list(APPEND compilerDefines SOFA_FLOAT)
+elseif(SOFA-MISC_USE_DOUBLE AND NOT SOFA-MISC_USE_FLOAT)
+	list(APPEND compilerDefines SOFA_DOUBLE)
+endif()
+
 # os-specific
 if(XBOX)
 	if(SOFA-EXTERNAL_HAVE_BOOST)


Fix version detection in cmake

Fix version detection in cmake

- use currenlty active branch when determining merge-revision
- when .git is not available use mtime of NEWS file for dateinfo

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -10,23 +10,31 @@
 	IF (NOT GIT_FOUND)
 		MESSAGE(FATAL_ERROR "The source is checked out from a git repository, but cannot find git executable!")
 	ENDIF()
-
+
+
 	EXECUTE_PROCESS(
-	     COMMAND ${GIT_EXECUTABLE} log -1 --pretty=%h
-	     OUTPUT_VARIABLE REVISION
-	     OUTPUT_STRIP_TRAILING_WHITESPACE
+		COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
+		OUTPUT_VARIABLE BRANCH
+		OUTPUT_STRIP_TRAILING_WHITESPACE
 	)

 	EXECUTE_PROCESS(
-	     COMMAND ${GIT_EXECUTABLE} merge-base master HEAD
-	     OUTPUT_VARIABLE BRANCH_POINT
-	     OUTPUT_STRIP_TRAILING_WHITESPACE
+		COMMAND ${GIT_EXECUTABLE} log -1 --pretty=%h
+		OUTPUT_VARIABLE REVISION
+		OUTPUT_STRIP_TRAILING_WHITESPACE
+	)
+
+
+	EXECUTE_PROCESS(
+		COMMAND ${GIT_EXECUTABLE} merge-base ${BRANCH} HEAD
+		OUTPUT_VARIABLE BRANCH_POINT
+		OUTPUT_STRIP_TRAILING_WHITESPACE
 	)

 	EXECUTE_PROCESS(
-	     COMMAND ${GIT_EXECUTABLE} log -1 --pretty=%ai ${BRANCH_POINT}
-	     OUTPUT_VARIABLE DATEINFO
-	     OUTPUT_STRIP_TRAILING_WHITESPACE
+		COMMAND ${GIT_EXECUTABLE} log -1 --pretty=%ai ${BRANCH_POINT}
+		OUTPUT_VARIABLE DATEINFO
+		OUTPUT_STRIP_TRAILING_WHITESPACE
 	)

 	STRING(REGEX REPLACE "([0-9]+)-.*" "\\1" VERSION_YEAR "${DATEINFO}")
@@ -46,16 +54,16 @@
 	SET(REVISION ${MAINVERSION})

 	EXECUTE_PROCESS(
-	     COMMAND
-	     OUTPUT_VARIABLE DATEINFO
-	     OUTPUT_STRIP_TRAILING_WHITESPACE
+		COMMAND stat -c %y "${ROOT_DIR}/NEWS"
+		OUTPUT_VARIABLE DATEINFO
+		OUTPUT_STRIP_TRAILING_WHITESPACE
 	)

 	STRING(REGEX REPLACE "([0-9]+)-.*" "\\1" VERSION_YEAR "${DATEINFO}")
-	STRING(REGEX REPLACE ".*-([0-9]+)-.*" "\\1" VERSION_MONTH "${DATEINFO}")
-	STRING(REGEX REPLACE ".*-.*-([0-9]+).*" "\\1" VERSION_DAY "${DATEINFO}")
-	STRING(REGEX REPLACE ".* ([0-9]+):.*" "\\1" VERSION_HOUR "${DATEINFO}")
-	STRING(REGEX REPLACE ".*:([0-9]+):.*" "\\1" VERSION_MINUTE "${DATEINFO}")
+	STRING(REGEX REPLACE ".*-0*([0-9]+)-.*" "\\1" VERSION_MONTH "${DATEINFO}")
+	STRING(REGEX REPLACE ".*-.*-0*([0-9]+).*" "\\1" VERSION_DAY "${DATEINFO}")
+	STRING(REGEX REPLACE ".* 0*([0-9]+):.*" "\\1" VERSION_HOUR "${DATEINFO}")
+	STRING(REGEX REPLACE ".*:0*([0-9]+):.*" "\\1" VERSION_MINUTE "${DATEINFO}")

 ELSE()
 	SET(EXTRA "UNKNOWN_VERSION")


ENH:  Update itk.

ENH:  Update itk.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -161,7 +161,7 @@

   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG c98c5ddd9a01f311b4dd95f036acde0fd9a4e155) ##
+  set(${proj}_GIT_TAG fc03bcc92b11326b87c232c14eb234fc1f791f9f) ##
   set(ITK_VERSION_ID ITK-4.9) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


Update ITKv5 hash to libminc update for HDF5 1.8.x format

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -148,7 +148,7 @@

   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
-  set(${proj}_GIT_TAG 732e53944f3fda761df83a11546f568237811915 ) ##
+  set(${proj}_GIT_TAG 05226185feb360139e954a1bf3b6eb86f11e5abc ) ##
   set(ITK_VERSION_ID ITK-5.0) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


updated findjsoncpp.cmake

updated findjsoncpp.cmake

--- cmake/FindJSONCPP.cmake
+++ cmake/FindJSONCPP.cmake
@@ -26,8 +26,10 @@
 #       http://jsoncpp.sourceforge.net
 #

-find_path(JSONCPP_INCLUDE_DIR NAMES jsoncpp/json.h DOC "Directory containing jsoncpp/json.h")
-find_library(JSONCPP_LIBRARY NAMES json_linux-gcc-4.2.1_libmt DOC "Path to jsoncpp library")
+#find_path(JSONCPP_INCLUDE_DIR NAMES jsoncpp/json.h DOC "Directory containing jsoncpp/json.h")
+#find_library(JSONCPP_LIBRARY NAMES json_linux-gcc-4.2.1_libmt DOC "Path to jsoncpp library")
+find_path(JSONCPP_INCLUDE_DIR NAMES json.h DOC "Directory containing json.h")
+find_library(JSONCPP_LIBRARY NAMES jsoncpp DOC "Path to jsoncpp library")

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(JSONCPP DEFAULT_MSG JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)


CMake: Linux fix

CMake: Linux fix

--- cmake/globalutils.cmake
+++ cmake/globalutils.cmake
@@ -504,7 +504,7 @@
             set(${retval} 32 PARENT_SCOPE)
             return()
         endif()
-    else()
+    elif(APPLE)
         execute_process(COMMAND file -L -b ${lib} OUTPUT_VARIABLE result)
         string(REGEX MATCH "(x86_64)" found_64bit ${result})
         if(CMAKE_MATCH_1)
@@ -516,6 +516,18 @@
             set(${retval} 32 PARENT_SCOPE)
             return()
        endif()
+    else()
+        execute_process(COMMAND file -L -b ${lib} OUTPUT_VARIABLE result)
+        string(REGEX MATCH "x86_64" found_64bit ${result})
+        if(CMAKE_MATCH_1)
+            set(${retval} 64 PARENT_SCOPE)
+            return()
+       endif()
+       string(REGEX MATCH "80386" found_32bit ${result})
+       if(CMAKE_MATCH_1)
+            set(${retval} 32 PARENT_SCOPE)
+            return()
+       endif()
     endif()

     set(${retval} 0 PARENT_SCOPE)


Use the compiler flag constructions from OpenFlipper

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

--- cmake/ACGCompiler.cmake
+++ cmake/ACGCompiler.cmake
@@ -1,6 +1,45 @@
 ################################################################################
 # Custom settings for compiler flags and similar
 ################################################################################
+
+if ( WIN32 )
+  ################################################################################
+  # Windows large memory support
+  ################################################################################
+  if ( NOT DEFINED WINDOWS_LARGE_MEMORY_SUPPORT )
+    set( WINDOWS_LARGE_MEMORY_SUPPORT true CACHE BOOL "Enable or disable binary support for large memory" )
+  endif()
+
+  set( ADDITIONAL_CMAKE_EXE_LINKER_FLAGS )
+  set( ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS )
+  set( ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS )
+
+  if ( WINDOWS_LARGE_MEMORY_SUPPORT )
+	list(APPEND ADDITIONAL_CMAKE_EXE_LINKER_FLAGS       "/LARGEADDRESSAWARE" )
+	list(APPEND ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+	list(APPEND ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+  endif()
+
+
+  foreach( flag ${ADDITIONAL_CMAKE_EXE_LINKER_FLAGS} )
+    if( NOT CMAKE_EXE_LINKER_FLAGS MATCHES "${flag}" )
+      set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag} ")
+    endif()
+  endforeach()
+
+  foreach( flag ${ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS} )
+    if( NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "${flag}" )
+      set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${flag} ")
+    endif()
+  endforeach()
+
+  foreach( flag ${ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS} )
+    if( NOT CMAKE_MODULE_LINKER_FLAGS MATCHES "${flag}" )
+      set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${flag} ")
+    endif()
+  endforeach()
+
+endif( WIN32 )

 if (UNIX)

@@ -57,22 +96,28 @@
   ################################################################################
   # Warnings
   ################################################################################
-
-  IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
-    list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS          "-W" "-Wall" "-Wno-unused" )
-    list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS        "-W" "-Wall" "-Wno-unused" )
-    list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-W" "-Wall" "-Wno-unused" )
+
+  # Add the standard compiler warnings
+  if ( NOT COMPILER_WARNINGS )
+
+    IF ( APPLE  )
+      # Skip unused parameters as it has to be used for the documentation via doxygen and the interfaces
+      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+    ELSEIF ( CMAKE_SYSTEM MATCHES "SunOS*" )
+      set ( COMPILER_WARNINGS "" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+    ELSE ()
+      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+    ENDIF()
+
+  endif ( NOT COMPILER_WARNINGS )
+
+  list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS          ${COMPILER_WARNINGS} )
+  list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS        ${COMPILER_WARNINGS} )
+  list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS ${COMPILER_WARNINGS} )

-    list(APPEND ADDITIONAL_C_DEBUG_FLAGS            "-W" "-Wall" "-Wno-unused" )
-    list(APPEND ADDITIONAL_C_RELEASE_FLAGS          "-W" "-Wall" "-Wno-unused" )
-    list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS   "-W" "-Wall" "-Wno-unused" )
-  ENDIF()
-
-  if (APPLE)
-    list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS          "-Wno-non-virtual-dtor" )
-    list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS        "-Wno-non-virtual-dtor" )
-    list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-Wno-non-virtual-dtor" )
-  endif ()
+  list(APPEND ADDITIONAL_C_DEBUG_FLAGS            ${COMPILER_WARNINGS} )
+  list(APPEND ADDITIONAL_C_RELEASE_FLAGS          ${COMPILER_WARNINGS} )
+  list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS   ${COMPILER_WARNINGS} )

   ################################################################################
   # STL Vector checks


Also search for the kpeoplewidgets library

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

 find_library(KPEOPLE_LIBRARY NAMES kpeople HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
+find_library(KPEOPLEWIDGETS_LIBRARY NAMES kpeoplewidgets HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})

 find_path(KPEOPLE_INCLUDE_DIR NAMES kpeople_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} PATH_SUFFIXES kpeople)


Fix FindOpenEXR cmake script. Fixes issue 97.

git-svn-id: bd2008fbba0f7d30fd6598b54f2cd88503fdd2e4@1055 95f4ed2b-212e-0410-8b90-d31948207fce

--- cmake/FindOpenEXR.cmake
+++ cmake/FindOpenEXR.cmake
@@ -53,11 +53,7 @@
 IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
 	SET(OPENEXR_FOUND TRUE)
 	SET(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR")
-	SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${ZLIB_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR")
-
-	IF(OPENEXR_ILMTHREAD_LIBRARY)
-		SET(OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES} ${OPENEXR_ILMTHREAD_LIBRARY})
-	ENDIF(OPENEXR_ILMTHREAD_LIBRARY)
+	SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ZLIB_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR")
 ENDIF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)

 IF(OPENEXR_FOUND)


Adding LL USB for several more controller series

--- cmake/FindSTM32LL.cmake
+++ cmake/FindSTM32LL.cmake
@@ -18,7 +18,7 @@

 ELSEIF(STM32_FAMILY STREQUAL "F2")
     SET(LL_COMPONENTS	adc bus cortex crc dac dma exti gpio i2c i2s iwdg pwr
-						rcc rng rtc spi system tim usart utils wwdg)
+						rcc rng rtc spi system tim usart usb utils wwdg)

     SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils)

@@ -34,7 +34,7 @@

 ELSEIF(STM32_FAMILY STREQUAL "F4")
     SET(LL_COMPONENTS	adc bus cortex crc dac dma2d dma exti gpio i2c i2s iwdg
-						lptim pwr rcc rng rtc spi system tim usart utils wwdg)
+						lptim pwr rcc rng rtc spi system tim usart usb utils wwdg)

     SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils)

@@ -42,7 +42,7 @@

 ELSEIF(STM32_FAMILY STREQUAL "F7")
     SET(LL_COMPONENTS	adc bus cortex crc dac dma2d dma exti gpio i2c i2s iwdg
-						lptim pwr rcc rng rtc spi system tim usart utils wwdg)
+						lptim pwr rcc rng rtc spi system tim usart usb utils wwdg)

     SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils)

@@ -60,7 +60,7 @@
 ELSEIF(STM32_FAMILY STREQUAL "L4")
     SET(LL_COMPONENTS	adc bus comp cortex crc crs dac dma2d dmamux dma exti
 						gpio i2c iwdg lptim lpuart opamp pwr rcc rng rtc spi
-						system tim usart utils wwdg)
+						system tim usart usb utils wwdg)

     SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils)


cmake: Update Gluon macros to make use of recent CMake features

Now each target will have the appropriate libraries and include
directories set so it is only necessary to link against the target.

--- cmake/GluonMacros.cmake
+++ cmake/GluonMacros.cmake
@@ -1,188 +1,117 @@
 # This file contains macros that are used inside the Gluon Project
+include( CMakeParseArguments )

-macro(gluon_unit_tests _module)
-    set( _libs "" )
-    set( _tests "" )
-
-    set( _current_target "_libs" )
-
-    foreach( _arg ${ARGN} )
-      string( TOLOWER ${_arg} _arg_lc )
-      if( ${_arg_lc} STREQUAL "libraries" )
-            set( _current_target "_libs" )
-        elseif( ${_arg_lc} STREQUAL "tests" )
-            set( _current_target "_tests" )
-        else()
-            list( APPEND ${_current_target} ${_arg} )
-        endif()
-    endforeach()
+macro( gluon_unit_tests )
+    cmake_parse_arguments("" "" "MODULE" "LIBRARIES;TESTS" ${ARGN})
+    if( _UNPARSED_ARGUMENTS )
+        message(FATAL_ERROR "Unknown keywords given to gluon_unit_tests: ${_UNPARSED_ARGUMENTS}")
+    endif()

-    foreach(_test ${_tests})
-	set(_test_target "${_module}-${_test}")
+    string( REGEX REPLACE "([^a-zA-Z])" "" _module_simple ${_MODULE} )
+
+    foreach(_test ${_TESTS})
+	set(_test_target "${_module_simple}-${_test}")
         add_executable(${_test_target} "${_test}.cpp")
-        if( CMAKE_VERSION VERSION_LESS "2.8.6" )
-	    automoc4( ${_test_target} "${_test}.cpp" )
-	endif()
-        target_link_libraries(${_test_target} ${_libs} Qt5::Test)
-        add_test(${_test_target} ${_module}-${_test})
+        target_link_libraries(${_test_target} ${_LIBRARIES} Qt5::Test)
+        add_test(${_test_target} ${_module_simple}-${_test})
     endforeach()
 endmacro(gluon_unit_tests)

-macro(gluon_add_library _target _type)
-    set( _sources "" )
-    set( _headers "" )
-    set( _libs "" )
-
-    set( _current_target "_sources" )
-
-    foreach( _arg ${ARGN} )
-        string( TOLOWER ${_arg} _arg_lc )
-        if( ${_arg_lc} STREQUAL "sources" )
-            set( _current_target "_sources" )
-        elseif( ${_arg_lc} STREQUAL "headers" )
-            set( _current_target "_headers" )
-        elseif( ${_arg_lc} STREQUAL "libraries" )
-            set( _current_target "_libs" )
-        else()
-            list( APPEND ${_current_target} ${_arg} )
-        endif()
-    endforeach()
-
-    add_library( ${_target} ${_type} ${_sources} ${_headers} )
-    if( CMAKE_VERSION VERSION_LESS "2.8.6" )
-        automoc4( ${_target} ${_sources} )
+macro( gluon_add_library _target _type )
+    cmake_parse_arguments("" "" "" "SOURCES;HEADERS;LIBRARIES;INCLUDES" ${ARGN})
+    if( _UNPARSED_ARGUMENTS )
+        message(FATAL_ERROR "Unknown keywords given to gluon_add_library: ${_UNPARSED_ARGUMENTS}")
     endif()

-    string( TOUPPER ${_target} _target_uc )
-    set_target_properties( ${_target} PROPERTIES
+    string( REGEX REPLACE "([^a-zA-Z])" "" _target_simple ${_target} )
+
+    add_library( ${_target_simple} ${_type} ${_SOURCES} ${_HEADERS} )
+    if( NOT ${_target_simple} STREQUAL ${_target} )
+        add_library( ${_target} ALIAS ${_target_simple} )
+    endif()
+
+    string( REGEX REPLACE "[A-Z][a-z]+([A-Z][a-z]+).*" "\\1" _target_short ${_target_simple} )
+    string( TOUPPER ${_target_simple} _target_uc )
+    string( TOLOWER ${_target_short} _target_include_dir )
+
+    set_target_properties( ${_target_simple} PROPERTIES
         VERSION ${GLUON_VERSION_STRING}
         SOVERSION ${GLUON_VERSION_STRING}
         DEFINE_SYMBOL MAKE_${_target_uc}_LIB
+        EXPORT_NAME ${_target_short}
     )

-    target_link_libraries( ${_target} ${_libs} )
-    set(${_target_uc}_LIBRARIES
-        ${_target}
-        ${_libs}
-        CACHE INTERNAL "Libraries required for ${_target}"
-    )
+    target_include_directories( ${_target_simple} PUBLIC ${_INCLUDES} )
+    target_include_directories( ${_target_simple} PUBLIC "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/${_target_include_dir}>" )
+    target_link_libraries( ${_target_simple} PUBLIC ${_LIBRARIES} )

-    if( APPLE )
-        _gluon_setup_framework( ${_target} ${_headers} )
-    endif()
-
-    install( TARGETS ${_target}
+    install( TARGETS ${_target_simple}
+        EXPORT ${_target_simple}Targets
         RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT ${_target}
         LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${_target}
         ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${_target}
         FRAMEWORK DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${_target}
     )

-    string( REGEX REPLACE "[A-Z][a-z]+([A-Z][a-z]+).*" "\\1" _target_include_dir ${_target} )
-    string( TOLOWER ${_target_include_dir} _target_include_dir )
+    install( FILES ${_headers}
+        DESTINATION ${INCLUDE_INSTALL_DIR}/${_target_include_dir}
+        COMPONENT ${_target}
+    )

-    install( FILES ${_headers}
-        DESTINATION ${INCLUDE_INSTALL_DIR}/${_target_include_dir} COMPONENT ${_target}
+    install( EXPORT ${_target_simple}Targets
+        DESTINATION ${LIB_INSTALL_DIR}/cmake/${_target_simple}
+        NAMESPACE Gluon::
+        COMPONENT ${_target}
     )
 endmacro(gluon_add_library)

-macro(gluon_add_plugin _target _component)
-    set( _sources "" )
-    set( _libs "" )
-    set( _dest "" )
-
-    set( _current_target "_sources" )
-
-    foreach( _arg ${ARGN} )
-        string( TOLOWER ${_arg} _arg_lc )
-        if( ${_arg_lc} STREQUAL "sources" )
-            set( _current_target "_sources" )
-        elseif( ${_arg_lc} STREQUAL "libraries" )
-            set( _current_target "_libs" )
-        elseif( ${_arg_lc} STREQUAL "destination" )
-            set( _current_target "_dest" )
-        else()
-            list( APPEND ${_current_target} ${_arg} )
-        endif()
-    endforeach()
-
-    if( "${_dest}" STREQUAL "" )
-        set( _dest ${PLUGIN_INSTALL_DIR} )
+macro(gluon_add_plugin _target)
+    cmake_parse_arguments("" "" "DESTINATION;MODULE" "SOURCES;LIBRARIES" ${ARGN})
+    if( _UNPARSED_ARGUMENTS )
+        message(FATAL_ERROR "Unknown keywords given to gluon_add_plugin: ${_UNPARSED_ARGUMENTS}")
     endif()

-    string( TOUPPER "${_component}_libraries" _comp_uc )
-    list( APPEND _libs ${${_comp_uc}} )
-
-    add_library( ${_target} MODULE ${_sources} )
-    if( CMAKE_VERSION VERSION_LESS "2.8.6" )
-        automoc4( ${_target} ${_sources} )
+    if( "${_DESTINATION}" STREQUAL "" )
+        set( _DESTINATION ${PLUGIN_INSTALL_DIR} )
     endif()

+    add_library( ${_target} MODULE ${_SOURCES} )
+
     string( TOUPPER ${_target} _target_uc )
-    set_target_properties(${_target} PROPERTIES
-        PREFIX ""
-    )
+    set_target_properties(${_target} PROPERTIES PREFIX "" )

-    target_link_libraries( ${_target} ${_libs} )
+    target_link_libraries( ${_target} ${_MODULE} ${_LIBRARIES} )

-    install( TARGETS ${_target}
-        DESTINATION ${_dest} COMPONENT ${_component}
-    )
+    install( TARGETS ${_target} DESTINATION ${_DESTINATION} COMPONENT ${_MODULE}    )
 endmacro(gluon_add_plugin)

 macro(gluon_add_executable _target)
-    set( _sources "" )
-    set( _headers "" )
-    set( _libs "" )
-
-    set( _current_target "_sources" )
-
-    foreach( _arg ${ARGN} )
-        string( TOLOWER ${_arg} _arg_lc )
-        if( ${_arg_lc} STREQUAL "sources" )
-            set( _current_target "_sources" )
-        elseif( ${_arg_lc} STREQUAL "headers" )
-            set( _current_target "_headers" )
-        elseif( ${_arg_lc} STREQUAL "libraries" )
-            set( _current_target "_libs" )
-        else()
-            list( APPEND ${_current_target} ${_arg} )
-        endif()
-    endforeach()
-
-    add_executable( ${_target} ${_sources} )
-    if( CMAKE_VERSION VERSION_LESS "2.8.6" )
-        automoc4( ${_target} ${_sources} )
+    cmake_parse_arguments("" "" "" "SOURCES;HEADERS;LIBRARIES" ${ARGN})
+    if( _UNPARSED_ARGUMENTS )
+        message(FATAL_ERROR "Unknown keywords given to gluon_add_executable: ${_UNPARSED_ARGUMENTS}")
     endif()

-    target_link_libraries( ${_target} ${_libs} )
+    add_executable( ${_target} ${_SOURCES} )
+
+    target_link_libraries( ${_target} ${_LIBRARIES} )

     install(TARGETS ${_target} DESTINATION ${BIN_INSTALL_DIR} COMPONENT ${_target})
 endmacro(gluon_add_executable)

-macro(gluon_include_directories _target)
-    include_directories(${ARGN})
-    string(TOUPPER ${_target} _target_uc)
-    set(${_target_uc}_INCLUDE_DIRS
-        ${ARGN}
-        CACHE INTERNAL "Includes required for ${_target}"
-    )
-endmacro(gluon_include_directories)
-
-macro( _gluon_setup_framework _target )
-
-    #hack for being able to set headers as public in a osx framework
-    set(_public_headers ${ARGN})
-    list(APPEND _public_headers ${_public_headers})
-
-    set_target_properties(${_target} PROPERTIES FRAMEWORK TRUE)
-    set_target_properties(${_target} PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path/../Frameworks")
-    set_target_properties(${_target} PROPERTIES PUBLIC_HEADER "${_public_headers}")
-
-    set(MACOSX_FRAMEWORK_IDENTIFIER ${_target})
-    set(MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${GLUON_VERSION_STRING})
-    set(MACOSX_FRAMEWORK_BUNDLE_VERSION ${GLUON_VERSION_STRING})
-endmacro( _gluon_setup_framework )
+# macro( _gluon_setup_framework _target )
+#
+#     #hack for being able to set headers as public in a osx framework
+#     set(_public_headers ${ARGN})
+#     list(APPEND _public_headers ${_public_headers})
+#
+#     set_target_properties(${_target} PROPERTIES FRAMEWORK TRUE)
+#     set_target_properties(${_target} PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path/../Frameworks")
+#     set_target_properties(${_target} PROPERTIES PUBLIC_HEADER "${_public_headers}")
+#
+#     set(MACOSX_FRAMEWORK_IDENTIFIER ${_target})
+#     set(MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${GLUON_VERSION_STRING})
+#     set(MACOSX_FRAMEWORK_BUNDLE_VERSION ${GLUON_VERSION_STRING})
+# endmacro( _gluon_setup_framework )

 macro( log_status _target )
     string( TOUPPER ${_target} _target_uc )


copy dll from CMAKE_BUILD_TYPE folder

copy dll from CMAKE_BUILD_TYPE folder

--- cmake/get-tinyxml.cmake
+++ cmake/get-tinyxml.cmake
@@ -19,8 +19,8 @@
     URL_MD5               2a0aaf609c9e670ec9748cd01ed52dae
     PATCH_COMMAND         ${CMAKE_COMMAND} -E copy ${CMAKE_MODULE_PATH}/patches/tinyxml/CMakeLists.txt  ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml
     INSTALL_COMMAND       ${CMAKE_COMMAND} -E make_directory ${DEPENDENCY_INSTALL_DIR}/include/tinyxml
-      COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml-build/Release/tinyxml.dll  ${DEPENDENCY_INSTALL_DIR}/bin/tinyxml.dll
-      COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml-build/Release/tinyxml.lib  ${DEPENDENCY_INSTALL_DIR}/lib/tinyxml.lib
+      COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml-build/${CMAKE_BUILD_TYPE}/tinyxml.dll  ${DEPENDENCY_INSTALL_DIR}/bin/tinyxml.dll
+      COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml-build/${CMAKE_BUILD_TYPE}/tinyxml.lib  ${DEPENDENCY_INSTALL_DIR}/lib/tinyxml.lib
       COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml/tinystr.h                  ${DEPENDENCY_INSTALL_DIR}/include/tinyxml/tinystr.h
       COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml/tinyxml.h                  ${DEPENDENCY_INSTALL_DIR}/include/tinyxml/tinyxml.h
   )


Tweak messages.

Tweak messages.

svn path=/trunk/; revision=9276

--- cmake/modules/pdl.cmake
+++ cmake/modules/pdl.cmake
@@ -29,7 +29,7 @@
 if(ENABLE_pdl)
   if(NOT BUILD_SHARED_LIBS)
     message(STATUS "WARNING: "
-    "Disabling Perl/PDL examples because BUILD_SHARED_LIBS=OFF")
+      "Disabling Perl/PDL examples because BUILD_SHARED_LIBS=OFF")
     set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
   endif(NOT BUILD_SHARED_LIBS)
 endif(ENABLE_pdl)
@@ -37,59 +37,60 @@
 if(ENABLE_pdl)
   if(PERL_FOUND)
     execute_process(
-    COMMAND ${PERL_EXECUTABLE}
-    -e "use PDL"
-    RESULT_VARIABLE PDL_RETURNCODE
-    OUTPUT_QUIET
-    ERROR_QUIET
-    )
+      COMMAND ${PERL_EXECUTABLE}
+      -e "use PDL"
+      RESULT_VARIABLE PDL_RETURNCODE
+      OUTPUT_QUIET
+      ERROR_QUIET
+      )
     if(NOT PDL_RETURNCODE)
       execute_process(
-      COMMAND ${PERL_EXECUTABLE}
-      "-e use PDL; print \"$PDL::VERSION\""
-      OUTPUT_VARIABLE PDL_VERSION
-      )
-    message("PDL_VERSION = ${PDL_VERSION}")
+	COMMAND ${PERL_EXECUTABLE}
+	"-e use PDL; print \"$PDL::VERSION\""
+	OUTPUT_VARIABLE PDL_VERSION
+	)
+      message(STATUS "PDL_VERSION = ${PDL_VERSION}")
       transform_version(NUMERICAL_PDL_MINIMUM_VERSION "2.4.1")
       transform_version(NUMERICAL_PDL_VERSION "${PDL_VERSION}")
       if(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
         message(STATUS "WARNING: "
-        "perl PDL version < 2.4.1. "
-	"Disabling Perl/PDL examples")
+          "PDL version < 2.4.1. Disabling Perl/PDL examples in tests")
         set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
       else(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
         message(STATUS
-	   "Perl and PDL are available and PDL passes version test.\n"
-	"   Enable Perl/PDL examples in tests"
-	)
+	  "PDL version >= 2.4.1.  Enabling Perl/PDL examples in tests"
+	  )
         execute_process(
 	  COMMAND ${PERL_EXECUTABLE}
 	  -MPDL::Graphics::PLplot "-e print \"$PDL::Graphics::PLplot::VERSION\""
           OUTPUT_VARIABLE PDL_PLPLOT_VERSION
           ERROR_VARIABLE PDL_PLPLOT_VERSION
           )
-        #message("PDL_PLPLOT_VERSION = ${PDL_PLPLOT_VERSION}")
+        message(STATUS "PDL_PLPLOT_VERSION = ${PDL_PLPLOT_VERSION}")
         transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.47.0")
         transform_version(NUMERICAL_PDL_PLPLOT_VERSION "${PDL_PLPLOT_VERSION}.0")
 	#message("NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION = ${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
 	#message("NUMERICAL_PDL_PLPLOT_VERSION = ${NUMERICAL_PDL_PLPLOT_VERSION}")
         if(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
           message(STATUS "WARNING: "
-          "perl PDL PLplot version < 0.47 "
-          "Using more limited set of Perl/PDL examples that work with old versions")
+            "perl PDL PLplot version < 0.47\n"
+            "   Using limited set of Perl/PDL examples that work with this old version")
           set(HAVE_PDL_GRAPHICS_PLPLOT_40 OFF CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
         else(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+          message(STATUS
+            "perl PDL PLplot version >= 0.47\n"
+            "   Using full set of Perl/PDL examples that work with this version")
           set(HAVE_PDL_GRAPHICS_PLPLOT_40 ON CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
         endif(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
       endif(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
     else(NOT PDL_RETURNCODE)
       message(STATUS "WARNING: "
-      "perl PDL module not found. Disabling Perl/PDL examples")
+	"perl PDL module not found. Disabling Perl/PDL examples")
       set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
     endif(NOT PDL_RETURNCODE)
   else(PERL_FOUND)
     message(STATUS "WARNING: "
-    "perl not found. Disabling Perl/PDL examples")
+      "perl not found. Disabling Perl/PDL examples")
     set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
   endif(PERL_FOUND)
 endif(ENABLE_pdl)


Do some CMake reorganization (don't mix find_package and ExternalProject)

--- cmake/vc.cmake
+++ cmake/vc.cmake
@@ -1,5 +1,6 @@
 set(Vc_PREFIX ${GLOBAL_OUTPUT_PATH}/vc)

+set(Vc_SOURCE_DIR ${CMAKE_SOURCE_DIR}/ext/Vc-1.3.1)

 ExternalProject_Add(
   Vc
@@ -7,21 +8,14 @@
   UPDATE_COMMAND ""
   PATCH_COMMAND ""

-  SOURCE_DIR "${CMAKE_SOURCE_DIR}/ext/Vc-1.3.1"
-  CMAKE_ARGS -BUILD_SHARED_LIBS=OFF -DTARGET_ARCHITECTURE=skylake -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=True -DCMAKE_INSTALL_PREFIX=${Vc_PREFIX}
+  SOURCE_DIR "${Vc_SOURCE_DIR}"
+  CMAKE_ARGS -BUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=True -DCMAKE_INSTALL_PREFIX=${Vc_PREFIX}

   TEST_COMMAND ""
 )

-find_package(Vc QUIET NO_MODULE PATHS ${Vc_PREFIX})
-
-include(ext/Vc-1.3.1/cmake/VcMacros.cmake)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Vc CONFIG_MODE)
+include(${Vc_SOURCE_DIR}/cmake/VcMacros.cmake)

 set(Vc_STATIC_LIBRARY "${Vc_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}Vc${CMAKE_STATIC_LIBRARY_SUFFIX}")
+include_directories(SYSTEM ${Vc_PREFIX}/include)

-
-include_directories(SYSTEM ${Vc_INCLUDE_DIR})
-


added intensity cmake option

added intensity cmake option

--- common/cmake/test.cmake
+++ common/cmake/test.cmake
@@ -35,32 +35,34 @@
   SET(EMBREE_TESTING_SDE OFF CACHE STRING "Uses SDE to run tests for specified CPU.")
   SET_PROPERTY(CACHE EMBREE_TESTING_SDE PROPERTY STRINGS OFF pnr nhm wsm snb ivb hsw bdw knl skl skx cnl)

-  IF(   NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-subdiv.txt"
-     OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-win32.txt"
-     OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-x64.txt"
-     OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-large.txt")
-    MESSAGE(FATAL_ERROR "Invalid Embree testing model repository. Either disable BUILD_TESTING or properly set EMBREE_TESTING_MODEL_DIR.")
-  ENDIF()
+  IF (EMBREE_TESTING_INTENSITY GREATER 1)
+    IF(   NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-subdiv.txt"
+       OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-win32.txt"
+       OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-x64.txt"
+       OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-large.txt")
+      MESSAGE(FATAL_ERROR "Invalid Embree testing model repository. Either disable BUILD_TESTING or properly set EMBREE_TESTING_MODEL_DIR.")
+    ENDIF()

-  FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-subdiv.txt" models_subdiv)
-  STRING(REGEX REPLACE "\n" ";" models_subdiv "${models_subdiv}")
+    FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-subdiv.txt" models_subdiv)
+    STRING(REGEX REPLACE "\n" ";" models_subdiv "${models_subdiv}")

-  FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-win32.txt" models_small_win32)
-  STRING(REGEX REPLACE "\n" ";" models_small_win32 "${models_small_win32}")
+    FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-win32.txt" models_small_win32)
+    STRING(REGEX REPLACE "\n" ";" models_small_win32 "${models_small_win32}")

-  FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-x64.txt" models_small_x64)
-  STRING(REGEX REPLACE "\n" ";" models_small_x64 "${models_small_x64}")
+    FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-x64.txt" models_small_x64)
+    STRING(REGEX REPLACE "\n" ";" models_small_x64 "${models_small_x64}")

-  FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-large.txt" models_large)
-  STRING(REGEX REPLACE "\n" ";" models_large "${models_large}")
+    FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-large.txt" models_large)
+    STRING(REGEX REPLACE "\n" ";" models_large "${models_large}")

-  IF (EMBREE_TESTING_INTENSITY GREATER 2)
-    SET(models ${models_small_x64})
-    IF (${memory} GREATER 10000)
-      SET(models ${models} ${models_large})
+    IF (EMBREE_TESTING_INTENSITY GREATER 2)
+      SET(models ${models_small_x64})
+      IF (${memory} GREATER 10000)
+        SET(models ${models} ${models_large})
+      ENDIF()
+    ELSE()
+      SET(models ${models_small_win32})
     ENDIF()
-  ELSE()
-    SET(models ${models_small_win32})
   ENDIF()

   IF (WIN32)


Minor warning fix with common_library

Minor warning fix with common_library

--- CommonLibrary.cmake
+++ CommonLibrary.cmake
@@ -60,8 +60,7 @@
   add_library(${Name} SHARED ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
   target_link_libraries(${Name} ${LINK_LIBRARIES})
   set_target_properties(${Name}
-    PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_ABI}
-    PUBLIC_HEADER "${PUBLIC_HEADERS}")
+    PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_ABI})

   install(TARGETS ${Name}
     ARCHIVE DESTINATION lib COMPONENT dev


Fix comment placement. (#22580)

Fix comment placement. (#22580)

--- configurecompiler.cmake
+++ configurecompiler.cmake
@@ -439,8 +439,6 @@
   endif(CLR_CMAKE_PLATFORM_DARWIN)

   add_definitions(-DDISABLE_CONTRACTS)
-  # The -ferror-limit is helpful during the porting, it makes sure the compiler doesn't stop
-  # after hitting just about 20 errors.

   if (CLR_CMAKE_WARNINGS_ARE_ERRORS)
     # All warnings that are not explicitly disabled are reported as errors
@@ -448,6 +446,8 @@
   endif(CLR_CMAKE_WARNINGS_ARE_ERRORS)

   if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    # The -ferror-limit is helpful during the porting, it makes sure the compiler doesn't stop
+    # after hitting just about 20 errors.
     add_compile_options(-ferror-limit=4096)

     # Disabled warnings


Also show rules

Also show rules

--- VeraPPUtilities.cmake
+++ VeraPPUtilities.cmake
@@ -321,6 +321,7 @@
                         ${_verapp_profile_check_command}
                         ${_verapp_profile_check_target_sources_paths}
                         -profile ${PROFILE}
+                        -showrules
                         WORKING_DIRECTORY ${VERAPP_DIRECTORY})

 endfunction (verapp_profile_check_source_files_conformance)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   28)
+SET(KWSYS_DATE_STAMP_DAY   29)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   25)
+SET(KWSYS_DATE_STAMP_DAY   26)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   28)
+SET(KWSYS_DATE_STAMP_DAY   29)


add -Wall on compilation by default

add -Wall on compilation by default

--- lib/orogen/templates/config/OrocosComponent.cmake
+++ lib/orogen/templates/config/OrocosComponent.cmake
@@ -1,4 +1,5 @@
 INCLUDE(FindPkgConfig) # This is the Cmake 2.6 FindPkgConfig macro
+SET (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall)

 INCLUDE(RPATHHandling)
 CMAKE_USE_FULL_RPATH("${CMAKE_INSTALL_PREFIX}/lib")


Updated FindMagnum.cmake from Magnum repository.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -16,7 +16,8 @@
 # libraries. Additional dependencies are specified by the components. The
 # optional components are:
 #  MeshTools     - MeshTools library
-#  Physics       - Physics library
+#  Physics       - Physics library (depends on Primitives and SceneGraph
+#                  components)
 #  Primitives    - Library with stock geometric primitives (static)
 #  SceneGraph    - Scene graph library
 #  Shaders       - Library with stock shaders
@@ -77,6 +78,13 @@
     find_package(OpenGLES2 REQUIRED)
 endif()

+# On Windows, *WindowContext libraries need to have ${MAGNUM_LIBRARY} listed
+# in dependencies also after *WindowContext.lib static library name to avoid
+# linker errors
+if(WIN32)
+    set(_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY ${MAGNUM_LIBRARY})
+endif()
+
 # Additional components
 foreach(component ${Magnum_FIND_COMPONENTS})
     string(TOUPPER ${component} _COMPONENT)
@@ -95,7 +103,7 @@
         if(${component} STREQUAL GlutWindowContext)
             find_package(GLUT)
             if(GLUT_FOUND)
-                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${GLUT_LIBRARIES})
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${GLUT_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()
@@ -105,7 +113,7 @@
         if(${component} STREQUAL Sdl2WindowContext)
             find_package(SDL2)
             if(SDL2_FOUND)
-                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARY})
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARY} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
                 set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
@@ -116,7 +124,7 @@
         if(${component} STREQUAL GlxWindowContext)
             find_package(X11)
             if(X11_FOUND)
-                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES})
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()
@@ -127,7 +135,7 @@
             find_package(EGL)
             find_package(X11)
             if(EGL_FOUND AND X11_FOUND)
-                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY} ${X11_LIBRARIES})
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY} ${X11_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()


CMake subproject support, part 3: ability to override configure.h location.

Similarly as in Corrade, but this did not require any user-facing
changes.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -180,17 +180,21 @@
 find_path(MAGNUM_INCLUDE_DIR
     NAMES Magnum/Magnum.h)

+# Configuration file
+find_file(_MAGNUM_CONFIGURE_FILE configure.h
+    HINTS ${MAGNUM_INCLUDE_DIR}/Magnum/)
+
 # We need to open configure.h file from MAGNUM_INCLUDE_DIR before we check for
 # the components. Bail out with proper error message if it wasn't found. The
 # complete check with all components is further below.
 if(NOT MAGNUM_INCLUDE_DIR)
     include(FindPackageHandleStandardArgs)
     find_package_handle_standard_args(Magnum
-        REQUIRED_VARS MAGNUM_LIBRARY MAGNUM_INCLUDE_DIR)
+        REQUIRED_VARS MAGNUM_LIBRARY MAGNUM_INCLUDE_DIR _MAGNUM_CONFIGURE_FILE)
 endif()

 # Configuration
-file(READ ${MAGNUM_INCLUDE_DIR}/Magnum/configure.h _magnumConfigure)
+file(READ ${_MAGNUM_CONFIGURE_FILE} _magnumConfigure)
 set(_magnumFlags
     BUILD_DEPRECATED
     BUILD_STATIC
@@ -222,6 +226,15 @@
 elseif(MAGNUM_TARGET_GLES3)
     find_package(OpenGLES3 REQUIRED)
     set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGLES3_LIBRARY})
+endif()
+
+# If the configure file is somewhere else than in root include dir (e.g. when
+# using CMake subproject), we need to include that dir too
+if(NOT ${MAGNUM_INCLUDE_DIR}/Magnum/configure.h STREQUAL ${_MAGNUM_CONFIGURE_FILE})
+    # Go two levels up
+    get_filename_component(_MAGNUM_CONFIGURE_FILE_INCLUDE_DIR ${_MAGNUM_CONFIGURE_FILE} DIRECTORY)
+    get_filename_component(_MAGNUM_CONFIGURE_FILE_INCLUDE_DIR ${_MAGNUM_CONFIGURE_FILE_INCLUDE_DIR} DIRECTORY)
+    list(APPEND MAGNUM_INCLUDE_DIRS ${_MAGNUM_CONFIGURE_FILE_INCLUDE_DIR})
 endif()

 # Emscripten needs special flag to use WebGL 2
@@ -623,7 +636,8 @@
     MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_INSTALL_DIR
     MAGNUM_CMAKE_MODULE_INSTALL_DIR
     MAGNUM_INCLUDE_INSTALL_DIR
-    MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR)
+    MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR
+    _MAGNUM_CONFIGURE_FILE)

 # Get base plugin directory from main library location
 set(MAGNUM_PLUGINS_DEBUG_DIR ${_MAGNUM_LIBRARY_PATH}/magnum-d


Check DONE stamp on server

Check DONE stamp on server

--- cmake/modules/hunter_download_cache_meta_file.cmake
+++ cmake/modules/hunter_download_cache_meta_file.cmake
@@ -35,7 +35,8 @@
   set(cache_directory "${HUNTER_CACHED_ROOT}/_Base/Cache")
   hunter_lock_directory("${cache_directory}" "")

-  string(REPLACE "${cache_directory}/meta/" "" suffix "${x_LOCAL}")
+  string(REPLACE "${cache_directory}/meta/" "" local_suffix "${x_LOCAL}")
+  string(REPLACE "${cache_directory}/meta/" "" done_suffix "${x_DONE}")

   if(EXISTS "${x_DONE}")
     return()
@@ -63,15 +64,48 @@
         "${server}"
     )

-    set(url "${url}/master/${suffix}")
+    set(local_url "${url}/master/${local_suffix}")
+    set(done_url "${url}/master/${done_suffix}")

     set(total_retry 3)
     foreach(x RANGE ${total_retry})
       hunter_status_debug("Downloading file (try #${x} of ${total_retry}):")
-      hunter_status_debug("  ${url}")
+      hunter_status_debug("  ${done_url}")
+      hunter_status_debug("  -> ${x_DONE}")
+
+      file(DOWNLOAD "${done_url}" "${x_DONE}" STATUS status)
+
+      list(GET status 0 error_code)
+      list(GET status 1 error_message)
+
+      hunter_check_download_error_message(
+          ERROR_CODE "${error_code}"
+          ERROR_MESSAGE "${error_message}"
+          REMOVE_ON_ERROR "${x_DONE}"
+      )
+
+      if(error_code EQUAL 0)
+        break()
+      elseif(error_code EQUAL 22)
+        hunter_status_debug("File not found")
+        break()
+      else()
+        hunter_status_debug("Downloading error, retry...")
+      endif()
+    endforeach()
+
+    if(NOT EXISTS "${x_DONE}")
+      # DONE stamp not found on this server, try next
+      continue()
+    endif()
+
+    set(total_retry 3)
+    foreach(x RANGE ${total_retry})
+      hunter_status_debug("Downloading file (try #${x} of ${total_retry}):")
+      hunter_status_debug("  ${local_url}")
       hunter_status_debug("  -> ${x_LOCAL}")

-      file(DOWNLOAD "${url}" "${x_LOCAL}" STATUS status)
+      file(DOWNLOAD "${local_url}" "${x_LOCAL}" STATUS status)

       list(GET status 0 error_code)
       list(GET status 1 error_message)
@@ -83,14 +117,22 @@
       )

       if(error_code EQUAL 0)
-        file(WRITE "${x_DONE}" "")
         return()
       elseif(error_code EQUAL 22)
-        hunter_status_debug("File not found")
-        break()
+        file(REMOVE "${x_DONE}")
+        hunter_internal_error(
+            "Server error. File not exists but DONE stamp found.\n"
+            "  file: ${local_url}"
+            "  done: ${done_url}"
+        )
       else()
         hunter_status_debug("Downloading error, retry...")
       endif()
     endforeach()
+
+    if(NOT EXISTS "${x_LOCAL}")
+      # some errors, remove DONE stamp and try next server
+      file(REMOVE "${x_DONE}")
+    endif()
   endforeach()
 endfunction()


Dependencies: update to latest SDL2 release

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -111,15 +111,15 @@
     if(MSVC OR MINGW OR SKBUILD) # other platforms dont need this
         message(STATUS "Building SDL2")
         file(DOWNLOAD
-            https://libsdl.org/release/SDL2-2.0.18.tar.gz
-            ${PROJECT_BINARY_DIR}/SDL2-2.0.18.tar.gz)
+            https://libsdl.org/release/SDL2-2.0.20.tar.gz
+            ${PROJECT_BINARY_DIR}/SDL2-2.0.20.tar.gz)
         execute_process(COMMAND ${CMAKE_COMMAND}
-            -E tar xf SDL2-2.0.18.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
+            -E tar xf SDL2-2.0.20.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
         execute_process(COMMAND ${CMAKE_COMMAND}
             -E make_directory ${PROJECT_BINARY_DIR}/SDL2-build)
         execute_process(COMMAND ${BUILD_COMMAND_COMMON}
             -DSDL_STATIC=FALSE
-            ${PROJECT_BINARY_DIR}/SDL2-2.0.18
+            ${PROJECT_BINARY_DIR}/SDL2-2.0.20
             WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/SDL2-build)
         execute_process(COMMAND ${CMAKE_COMMAND}
             --build ${PROJECT_BINARY_DIR}/SDL2-build ${BUILD_COMMAND_OPTS})


VTKTargets is hardcoded as the export name

Rather than VTKTargets this should be ${VTK_INSTALL_EXPORT_NAME}
so other projects such as ParaView can change it.

Change-Id: Id687a59227f25e7bed525f1f2799ffb42f7e0f01

--- CMake/vtkModuleTop.cmake
+++ CMake/vtkModuleTop.cmake
@@ -253,7 +253,7 @@
   DESTINATION ${VTK_INSTALL_PACKAGE_DIR})
 get_property(VTK_TARGETS GLOBAL PROPERTY VTK_TARGETS)
 if(VTK_TARGETS)
-  install(EXPORT VTKTargets DESTINATION ${VTK_INSTALL_PACKAGE_DIR})
+  install(EXPORT ${VTK_INSTALL_EXPORT_NAME}  DESTINATION ${VTK_INSTALL_PACKAGE_DIR})
 else()
   set(CMAKE_CONFIGURABLE_FILE_CONTENT "# No targets!")
   configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in


Update CTK to current master

Update CTK to current master

Summary: Necessary because only the newest CTK version is python 3 compatible

Test Plan: covered by current tests. successful builds on ubuntu und windows 10

Reviewers: O1 MITK Core, kislinsk

Reviewed By: O1 MITK Core, kislinsk

Maniphest Tasks: T26467

Differential Revision: https://phabricator.mitk.org/D208

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

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 6c0eddaa)
+    set(revision_tag b93e8dca)

     set(ctk_optional_cache_args )
     if(MITK_USE_Python)
@@ -58,7 +58,7 @@
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 c8025c0009d5dd207cd442eadca409b4
+      URL_MD5 C86289F25E79B0C5C12E424BD706388F
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}
@@ -84,7 +84,7 @@
         -DCTK_PLUGIN_org.commontk.configadmin:BOOL=ON
         -DCTK_USE_GIT_PROTOCOL:BOOL=OFF
         -DDCMTK_DIR:PATH=${DCMTK_DIR}
-        -DPythonQt_URL:STRING=${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/PythonQt_e39be131.tar.gz # From https://github.com/kislinsk/PythonQt.git
+        -DPythonQt_URL:STRING=${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/PythonQt_fae23012.tar.gz # From https://github.com/kislinsk/PythonQt.git
         ${${proj}_CUSTOM_CMAKE_ARGS}
       CMAKE_CACHE_ARGS
         ${ep_common_cache_args}


Some slight improvement to our CMake file [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -525,11 +525,19 @@

     # External binaries

-    IF(NOT "${EXTERNAL_BINARIES_DIR}" STREQUAL "")
+    IF(NOT "${EXTERNAL_BINARIES}" STREQUAL "")
         FOREACH(EXTERNAL_BINARY ${EXTERNAL_BINARIES})
-            TARGET_LINK_LIBRARIES(${PROJECT_NAME}
-                ${EXTERNAL_BINARIES_DIR}/${EXTERNAL_BINARY}
-            )
+            IF("${EXTERNAL_BINARIES_DIR}" STREQUAL "")
+                SET(FULL_EXTERNAL_BINARY ${EXTERNAL_BINARY})
+            ELSE()
+                SET(FULL_EXTERNAL_BINARY "${EXTERNAL_BINARIES_DIR}/${EXTERNAL_BINARY}")
+            ENDIF()
+
+            IF(EXISTS ${FULL_EXTERNAL_BINARY})
+                TARGET_LINK_LIBRARIES(${PROJECT_NAME}
+                    ${FULL_EXTERNAL_BINARY}
+                )
+            ENDIF()
         ENDFOREACH()
     ENDIF()

@@ -672,11 +680,19 @@

                 # External binaries

-                IF(NOT "${EXTERNAL_BINARIES_DIR}" STREQUAL "")
+                IF(NOT "${EXTERNAL_BINARIES}" STREQUAL "")
                     FOREACH(EXTERNAL_BINARY ${EXTERNAL_BINARIES})
-                        TARGET_LINK_LIBRARIES(${TEST_NAME}
-                            ${EXTERNAL_BINARIES_DIR}/${EXTERNAL_BINARY}
-                        )
+                        IF("${EXTERNAL_BINARIES_DIR}" STREQUAL "")
+                            SET(FULL_EXTERNAL_BINARY ${EXTERNAL_BINARY})
+                        ELSE()
+                            SET(FULL_EXTERNAL_BINARY "${EXTERNAL_BINARIES_DIR}/${EXTERNAL_BINARY}")
+                        ENDIF()
+
+                        IF(EXISTS ${FULL_EXTERNAL_BINARY})
+                            TARGET_LINK_LIBRARIES(${TEST_NAME}
+                                ${FULL_EXTERNAL_BINARY}
+                            )
+                        ENDIF()
                     ENDFOREACH()
                 ENDIF()


Implement SETUPTOOLS_DEB_LAYOUT to handle non debian systems.

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -5,13 +5,19 @@

 set(PYTHON_VERSION_XDOTY ${PYTHON_VERSION_XDOTY} CACHE STRING "python version")

-# this should actually be for anything non-dist-packages
+#This should be resolved automatically one day...
+option(SETUPTOOLS_DEB_LAYOUT "ON for debian style python packages layout" ON)
+
 if(APPLE)
+  set(SETUPTOOLS_DEB_LAYOUT OFF)
+endif()
+
+if(SETUPTOOLS_DEB_LAYOUT)
+  set(PYTHON_PACKAGES_DIR dist-packages CACHE STRING "dist-packages or site-packages")
+  set(SETUPTOOLS_ARG_EXTRA "--install-layout=deb" CACHE STRING "extra arguments to setuptools")
+else()
   set(PYTHON_PACKAGES_DIR site-packages CACHE STRING "dist-packages or site-packages")
   set(SETUPTOOLS_ARG_EXTRA "" CACHE STRING "extra arguments to setuptools")
-else()
-  set(PYTHON_PACKAGES_DIR dist-packages CACHE STRING "dist-packages or site-packages")
-  set(SETUPTOOLS_ARG_EXTRA "--install-layout=deb" CACHE STRING "extra arguments to setuptools")
 endif()

 set(INSTALLED_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_XDOTY}/${PYTHON_PACKAGES_DIR}


modules: added comment explaining include path issues with SDL1/OSX.

--- modules/FindSDL2.cmake
+++ modules/FindSDL2.cmake
@@ -43,6 +43,13 @@

 # Include dir
 find_path(SDL2_INCLUDE_DIR
+    # We must search file which is present only in SDL2 and not in SDL1.
+    # Apparently when both SDL.h and SDL_scancode.h are specified, CMake is
+    # happy enough that it found SDL.h and doesn't bother about the other.
+    #
+    # On OSX, where the includes are not in SDL2/SDL.h form (which would solve
+    # this issue), but rather SDL2.framework/Headers/SDL.h, CMake might find
+    # SDL.framework/Headers/SDL.h if SDL1 is installed, which is wrong.
     NAMES SDL_scancode.h
     PATH_SUFFIXES ${PATH_SUFFIXES}
 )


Improve not found error reporting

Improve not found error reporting

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -52,7 +52,7 @@
   "\n"
   "      if(\${_component}_libraryname MATCHES "\${_component}_libraryname-NOTFOUND")\n"
   "        if(${CMAKE_PROJECT_NAME}_FIND_REQUIRED_\${_component})\n"
-  "          set(_fail TRUE)\n"
+  "          set(_fail \"Component library \${_component} not found\")\n"
   "        endif()\n"
   "        if(_out)\n"
   "          message(\${_output_type} \"   ${CMAKE_PROJECT_NAME}_\${_component} \"\n"
@@ -73,7 +73,7 @@
   "      find_library(\${_librarynameUC}_LIBRARY \${_libraryname} NO_DEFAULT_PATH\n"
   "                   PATHS \${PACKAGE_PREFIX_DIR} PATH_SUFFIXES lib ${PYTHON_LIBRARY_PREFIX})\n"
   "      if(${UPPER_PROJECT_NAME}_LIBRARY MATCHES "${UPPER_PROJECT_NAME}_LIBRARY-NOTFOUND")\n"
-  "        set(_fail TRUE)\n"
+  "        set(_fail \"\${_libraryname} not found\")\n"
   "        if(_out)\n"
   "          message(\${_output_type} \"   Missing the ${CMAKE_PROJECT_NAME} \"\n"
   "            \"library in \${PACKAGE_PREFIX_DIR}/lib.\")\n"
@@ -99,6 +99,9 @@
   "  set(${UPPER_PROJECT_NAME}_DEB_DEPENDENCIES)\n"
   "  set(${UPPER_PROJECT_NAME}_LIBRARY)\n"
   "  set(${UPPER_PROJECT_NAME}_COMPONENTS)\n"
+  "  if(_out)\n"
+  "    message(STATUS \"Could not find ${CMAKE_PROJECT_NAME}: \${_fail}\")\n"
+  "  endif()\n"
   "else()\n"
   "  set(${UPPER_PROJECT_NAME}_FOUND TRUE)\n"
   "  if(_out)\n"


Extend PackageConfig to set transitive include directories

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -50,7 +50,7 @@
   "if(NOT _fail)\n"
 # setup VERSION, INCLUDE_DIRS and DEB_DEPENDENCIES
   "  set(${UPPER_PROJECT_NAME}_VERSION ${VERSION})\n"
-  "  set_and_check(${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${CMAKE_PROJECT_NAME}_PREFIX_DIR}/include)\n"
+  "  list(APPEND ${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${CMAKE_PROJECT_NAME}_PREFIX_DIR}/include)\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEPENDENCIES \"${LOWER_PROJECT_NAME}${VERSION_ABI} (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_LIB_DEPENDENCY \"${LOWER_PROJECT_NAME}${VERSION_ABI}-lib (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEV_DEPENDENCY \"${LOWER_PROJECT_NAME}${VERSION_ABI}-dev (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
@@ -186,6 +186,7 @@
     "find_package(${_dependent} ${${${_dependent}_name}_VERSION} ${${${_dependent}_name}_findmode} \${_req} \${_quiet})\n"
     "if(${${_dependent}_name}_FOUND)\n"
     "  list(APPEND ${UPPER_PROJECT_NAME}_LIBRARIES \${${${_dependent}_name}_LIBRARIES})\n"
+    "  list(APPEND ${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${${_dependent}_name}_INCLUDE_DIRS})\n"
     "else()\n"
     "  set(_fail TRUE)\n"
     "endif()\n\n")


Disable FEATURE_INTERPRETER for crossgen (#24662)

--- crossgen.cmake
+++ crossgen.cmake
@@ -10,6 +10,7 @@
     -DFEATURE_CODE_VERSIONING
     -DEnC_SUPPORTED
     -DFEATURE_EVENT_TRACE=1
+    -DFEATURE_INTERPRETER
     -DFEATURE_MULTICOREJIT
     -DFEATURE_PERFMAP
     -DFEATURE_REJIT