cmake/MyPackageDependency.cmake and recursivity

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -73,116 +73,127 @@
     ENDIF ()
     SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend} "DONE")
     #
-    # Manage dependencies
+    # Remember all eventual packageDepend variables we depend upon
     #
-    SET (_test_candidates ${${PROJECT_NAME}_TEST_EXECUTABLE})
-    SET (_lib_candidates  ${PROJECT_NAME} ${PROJECT_NAME}_static)
-    SET (_exe_candidates  ${${PROJECT_NAME}_EXECUTABLE})
-    SET (_candidates)
-    IF (_TESTS)
-      LIST (APPEND _candidates ${_test_candidates})
-    ENDIF ()
-    IF (_LIBS)
-      LIST (APPEND _candidates ${_lib_candidates})
-    ENDIF ()
-    IF (_EXES)
-      LIST (APPEND _candidates ${_exe_candidates})
-    ENDIF ()
-    FOREACH (_target ${_candidates})
-      IF (TARGET ${_target})
-        IF (ALL_IN_ONE)
-          #
-          # Dependency by target
-          #
-          IF (TARGET ${packageDepend})
-            IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${packageDepend} dependency to ${_target}")
-            ENDIF ()
-            TARGET_LINK_LIBRARIES(${_target} ${packageDepend})
-          ELSE ()
-            #
-            # Bad luck, this target does not generate a library
-            #
-            FOREACH (_include_directory ${packageDependSourceDir}/output/include ${packageDependSourceDir}/include)
-              IF (MYPACKAGE_DEBUG)
-                MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
-              ENDIF ()
-              TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
-            ENDFOREACH ()
+    FOREACH (_what INCLUDE_DIRS LIBRARIES C_FLAGS_SHARED LINK_FLAGS)
+      SET (_val ${${_PACKAGEDEPEND}_${_what})
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Setting property MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} to ${_val}")
+      ENDIF ()
+      SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} ${_val})
+    ENDFOREACH ()
+  ENDIF ()
+
+  #
+  # Manage dependencies
+  #
+  SET (_test_candidates ${${PROJECT_NAME}_TEST_EXECUTABLE})
+  SET (_lib_candidates  ${PROJECT_NAME} ${PROJECT_NAME}_static)
+  SET (_exe_candidates  ${${PROJECT_NAME}_EXECUTABLE})
+  SET (_candidates)
+  IF (_TESTS)
+    LIST (APPEND _candidates ${_test_candidates})
+  ENDIF ()
+  IF (_LIBS)
+    LIST (APPEND _candidates ${_lib_candidates})
+  ENDIF ()
+  IF (_EXES)
+    LIST (APPEND _candidates ${_exe_candidates})
+  ENDIF ()
+  FOREACH (_target ${_candidates})
+    IF (TARGET ${_target})
+      IF (ALL_IN_ONE)
+        #
+        # Dependency by target
+        #
+        IF (TARGET ${packageDepend})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${packageDepend} dependency to ${_target}")
           ENDIF ()
+          TARGET_LINK_LIBRARIES(${_target} ${packageDepend})
         ELSE ()
           #
-          # Include dependency
+          # Bad luck, this target does not generate a library
           #
-          FOREACH (_include_directory ${${_PACKAGEDEPEND}_INCLUDE_DIRS})
+          FOREACH (_include_directory ${packageDependSourceDir}/output/include ${packageDependSourceDir}/include)
             IF (MYPACKAGE_DEBUG)
               MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
             ENDIF ()
             TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
           ENDFOREACH ()
-          #
-          # Library dependency
-          #
-          FOREACH (_library ${${_PACKAGEDEPEND}_LIBRARIES})
-            IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library dependency to ${_target}")
-            ENDIF ()
-            TARGET_LINK_LIBRARIES(${_target} PUBLIC ${_library})
-          ENDFOREACH ()
-          #
-          # Compile definitions
-          #
-          FOREACH (_flag ${${_PACKAGEDEPEND}_C_FLAGS_SHARED})
-            IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile definition dependency to ${_target}")
-            ENDIF ()
-            TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC ${_library})
-          ENDFOREACH ()
-          #
-          # Link flags
-          #
-          FOREACH (_flag ${${_PACKAGEDEPEND}_LINK_FLAGS})
-            IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} link flag dependency to ${_target}")
-            ENDIF ()
-            SET_TARGET_PROPERTIES(${_target}
-              PROPERTIES
-              LINK_FLAGS ${_flag}
-              )
-          ENDFOREACH ()
         ENDIF ()
+      ELSE ()
+        #
+        # Include dependency
+        #
+        FOREACH (_include_directory ${MYPACKAGE_DEPENDENCY_${packageDepend}_INCLUDE_DIRS})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
+          ENDIF ()
+          TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
+        ENDFOREACH ()
+        #
+        # Library dependency
+        #
+        FOREACH (_library ${MYPACKAGE_DEPENDENCY_${packageDepend}_LIBRARIES})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library dependency to ${_target}")
+          ENDIF ()
+          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${_library})
+        ENDFOREACH ()
+        #
+        # Compile definitions
+        #
+        FOREACH (_flag ${MYPACKAGE_DEPENDENCY_${packageDepend}_C_FLAGS_SHARED})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile definition dependency to ${_target}")
+          ENDIF ()
+          TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC ${_library})
+        ENDFOREACH ()
+        #
+        # Link flags
+        #
+        FOREACH (_flag ${MYPACKAGE_DEPENDENCY_${packageDepend}_LINK_FLAGS})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} link flag dependency to ${_target}")
+          ENDIF ()
+          SET_TARGET_PROPERTIES(${_target}
+            PROPERTIES
+            LINK_FLAGS ${_flag}
+            )
+        ENDFOREACH ()
       ENDIF ()
-    ENDFOREACH ()
-    #
-    # Test path management
-    #
-    GET_PROPERTY(_test_path_set GLOBAL PROPERTY MYPACKAGE_TEST_PATH SET)
-    IF (${_test_path_set})
-      GET_PROPERTY(_test_path GLOBAL PROPERTY MYPACKAGE_TEST_PATH)
-    ELSE ()
-      SET (_test_path "")
     ENDIF ()
+  ENDFOREACH ()
+  #
+  # Test path management
+  #
+  GET_PROPERTY(_test_path_set GLOBAL PROPERTY MYPACKAGE_TEST_PATH SET)
+  IF (${_test_path_set})
+    GET_PROPERTY(_test_path GLOBAL PROPERTY MYPACKAGE_TEST_PATH)
+  ELSE ()
+    SET (_test_path "")
+  ENDIF ()

-    SET (_dependLibraryRuntimeDirectory "${packageDependSourceDirAbsolute}/output/lib")
-    IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
-      STRING(REGEX REPLACE "/" "\\\\"  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
-    ELSE ()
-      STRING(REGEX REPLACE " " "\\\\ "  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
-    ENDIF ()
-    SET(${_PACKAGEDEPEND}_RUNTIME_DIRECTORY "${_dependLibraryRuntimeDirectory}")
-    IF ("${_test_path}" STREQUAL "")
-      MESSAGE(STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initializing TEST_PATH with PATH")
-      SET (_test_path "$ENV{PATH}" )
-    ENDIF ()
-    IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
-      SET (SEP "\\;")
-    ELSE ()
-      SET (SEP ":")
-    ENDIF ()
-    SET (_test_path "${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY}${SEP}${_test_path}")
-    IF (MYPACKAGE_DEBUG)
-      MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Prepended ${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY} to TEST_PATH")
-    ENDIF ()
-    SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_TEST_PATH "${_test_path}")
+  SET (_dependLibraryRuntimeDirectory "${packageDependSourceDirAbsolute}/output/lib")
+  IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
+    STRING(REGEX REPLACE "/" "\\\\"  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
+  ELSE ()
+    STRING(REGEX REPLACE " " "\\\\ "  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
   ENDIF ()
+  SET(${_PACKAGEDEPEND}_RUNTIME_DIRECTORY "${_dependLibraryRuntimeDirectory}")
+  IF ("${_test_path}" STREQUAL "")
+    MESSAGE(STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initializing TEST_PATH with PATH")
+    SET (_test_path "$ENV{PATH}" )
+  ENDIF ()
+  IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
+    SET (SEP "\\;")
+  ELSE ()
+    SET (SEP ":")
+  ENDIF ()
+  SET (_test_path "${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY}${SEP}${_test_path}")
+  IF (MYPACKAGE_DEBUG)
+    MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Prepended ${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY} to TEST_PATH")
+  ENDIF ()
+  SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_TEST_PATH "${_test_path}")
 ENDMACRO()


Removed duplicate print of CMAKE_CXX_FLAGS

--- cmake/MyPackagePrintSetup.cmake
+++ cmake/MyPackagePrintSetup.cmake
@@ -26,7 +26,6 @@
   MESSAGE(STATUS "             CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
   MESSAGE(STATUS "          CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
   MESSAGE(STATUS "                CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
-  MESSAGE(STATUS "                CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
   MESSAGE(STATUS "     CMAKE_CXX_COMPILE_FEATURES: ${CMAKE_CXX_COMPILE_FEATURES}")
   MESSAGE(STATUS "                   CMAKE_LINKER: ${CMAKE_LINKER}")
   MESSAGE(STATUS "                  CMAKE_DL_LIBS: ${CMAKE_DL_LIBS}")


Add distortosTargetLinkerScripts() CMake function

--- cmake/distortos-utilities.cmake
+++ cmake/distortos-utilities.cmake
@@ -70,3 +70,28 @@
 			VERBATIM
 			USES_TERMINAL)
 endfunction()
+
+#
+# Specifies linker script(s) used for linking `target`.
+#
+# `distortosTargetLinkerScripts(target [linker-script.ld ...])`
+#
+# Most common use will be with single linker script provided by distortos:
+# `distortosTargetLinkerScripts(target $ENV{DISTORTOS_LINKER_SCRIPT})`
+#
+# Proper linker flag is added, as well as CMake dependency via LINK_DEPENDS target property.
+#
+
+function(distortosTargetLinkerScripts target)
+	foreach(linkerScript IN LISTS ARGN)
+		target_link_libraries(${target} PRIVATE
+				-T"${linkerScript}")
+		get_target_property(linkDepends ${target} LINK_DEPENDS)
+		if(NOT linkDepends)
+			unset(linkDepends)
+		endif()
+		list(APPEND linkDepends "${linkerScript}")
+		set_target_properties(${target} PROPERTIES
+				LINK_DEPENDS "${linkDepends}")
+	endforeach()
+endfunction()


Remove includes from the Grantlee_USE_FILE.

The includes and defines from a USE_FILE are obsoleted
by target usage requirements in CMake 2.8.11.

Grantlee ships no useful cmake modules, so no need to adjust
the cmake module path.

--- cmake/modules/GrantleeUse.cmake
+++ cmake/modules/GrantleeUse.cmake
@@ -1,9 +1,3 @@
-
-# Set up the include directories and link directories
-include_directories(${Grantlee_INCLUDE_DIRS})
-
-# Add the Grantlee modules directory to the CMake module path
-set(CMAKE_MODULE_PATH ${Grantlee_MODULE_DIR} ${CMAKE_MODULE_PATH})

 include(CMakeParseArguments)


Improve the reliability of determining the Tcl and Tk library version
numbers by only version parsing the library name rather the full path
of the library name.  This change solved a bug where the library
version was being parsed from the wine (!) version number that I
happened to be using in my build tree prefix to keep track of various
results for various wine versions.

Add some additional names (with a compact numeric suffix and with no
numerical suffix at all) to search for the itcl and itk libraries.
This change solved a bug where epa_build creates itcl and itk
libraries with compact numerical suffixes on the MinGW/MSYS platform.

svn path=/trunk/; revision=12929

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -128,7 +128,8 @@

   # Sanity checking of Tcl version consistency _if_ a Tcl version string
   # can be extracted from the Tcl library name.
-  string(REGEX MATCH "[0-9]+[.]?[0-9]+" library_version ${TCL_LIBRARY})
+  get_filename_component(library_name ${TCL_LIBRARY} NAME)
+  string(REGEX MATCH "[0-9]+[.]?[0-9]+" library_version ${library_name})
   if(library_version)
     # If no decimal point in version insert as the second character.
     if(NOT library_version MATCHES "[.]")
@@ -226,8 +227,9 @@
       if(ENABLE_itcl)
         message(STATUS "Looking for itcl library")
 	# Search first for epa_build install location.
-        find_library(ITCL_LIBRARY itcl${PLPLOT_ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH}/itcl${PLPLOT_ITCL_VERSION})
-        find_library(ITCL_LIBRARY itcl${PLPLOT_ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH})
+	string(REGEX REPLACE "\\." "" COMPACT_PLPLOT_ITCL_VERSION ${PLPLOT_ITCL_VERSION})
+        find_library(ITCL_LIBRARY NAMES itcl${PLPLOT_ITCL_VERSION} itcl${COMPACT_PLPLOT_ITCL_VERSION} itcl HINTS ${TCL_LIBRARY_PATH}/itcl${PLPLOT_ITCL_VERSION})
+        find_library(ITCL_LIBRARY NAMES itcl${PLPLOT_ITCL_VERSION} itcl${COMPACT_PLPLOT_ITCL_VERSION} itcl HINTS ${TCL_LIBRARY_PATH})
         if(ITCL_LIBRARY)
           message(STATUS "Looking for itcl library - found")
 	  message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}")
@@ -305,7 +307,8 @@
 		# Sanity checking of Tk version consistency _if_ a Tk
 		# version string can be extracted from the Tk library
 		# name.
-		string(REGEX MATCH "[0-9]+[.]?[0-9]+" library_version ${TK_LIBRARY})
+		get_filename_component(library_name ${TK_LIBRARY} NAME)
+		string(REGEX MATCH "[0-9]+[.]?[0-9]+" library_version ${library_name})
 		if(library_version)
 		  # If no decimal point in version insert as the second character.
 		  if(NOT library_version MATCHES "[.]")
@@ -467,8 +470,9 @@
       if(ENABLE_itk)
         message(STATUS "Looking for itk library")
 	# Search first for epa_build install location.
-        find_library(ITK_LIBRARY itk${PLPLOT_ITK_VERSION} HINTS ${TCL_LIBRARY_PATH}/itk${PLPLOT_ITK_VERSION})
-        find_library(ITK_LIBRARY itk${PLPLOT_ITK_VERSION} HINTS ${TCL_LIBRARY_PATH})
+	string(REGEX REPLACE "\\." "" COMPACT_PLPLOT_ITK_VERSION ${PLPLOT_ITK_VERSION})
+        find_library(ITK_LIBRARY NAMES itk${PLPLOT_ITK_VERSION} itk${COMPACT_PLPLOT_ITK_VERSION} itk HINTS ${TK_LIBRARY_PATH}/itk${PLPLOT_ITK_VERSION})
+        find_library(ITK_LIBRARY NAMES itk${PLPLOT_ITK_VERSION} itk${COMPACT_PLPLOT_ITK_VERSION} itk HINTS ${TK_LIBRARY_PATH})
         if(ITK_LIBRARY)
           message(STATUS "Looking for itk library - found")
 	  message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}")


cmake script updated

cmake script updated

--- cmake-modules/sl-ext-libs.cmake
+++ cmake-modules/sl-ext-libs.cmake
@@ -11,18 +11,18 @@
 #  RtMidi                                                                                #
 # ------------------------------------------------------------------------------------------------ #
 function (addRtMidi)
-  if(DEFINED RTMIDI_INCLUDE_DIR)
+  if(DEFINED RTMIDI_INCLUDE_DIRS)
     message(STATUS "RtMidi is already available")
   else()
     checkout_external_project(rtmidi https://github.com/thestk/rtmidi.git master)
-    set(RTMIDI_INCLUDE_DIR ${CMAKE_BINARY_DIR}/rtmidi/src/rtmidi PARENT_SCOPE)
-    set(RTMIDI_INCLUDE_DIR ${CMAKE_BINARY_DIR}/rtmidi/src/rtmidi)
-    message(STATUS "RtMidi path: ${RTMIDI_INCLUDE_DIR}")
+    set(RTMIDI_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/rtmidi/src/rtmidi PARENT_SCOPE)
+    set(RTMIDI_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/rtmidi/src/rtmidi)
+    message(STATUS "RtMidi path: ${RTMIDI_INCLUDE_DIRS}")

     set(
       lib_rtmidi_LIBRARY
-        ${RTMIDI_INCLUDE_DIR}/RtMidi.h
-        ${RTMIDI_INCLUDE_DIR}/RtMidi.cpp
+        ${RTMIDI_INCLUDE_DIRS}/RtMidi.h
+        ${RTMIDI_INCLUDE_DIRS}/RtMidi.cpp
     )
     source_group("src"  FILES  ${lib_rtmidi_LIBRARY})
     add_library( rtmidi STATIC ${lib_rtmidi_LIBRARY})
@@ -53,13 +53,13 @@
 #  Catch                                                                                #
 # ------------------------------------------------------------------------------------------------ #
 function (addCatch)
-  if(DEFINED CATCH_INCLUDE_DIR)
+  if(DEFINED CATCH_INCLUDE_DIRS)
     message(STATUS "Catch is already available")
   else()
     checkout_external_project(catch https://github.com/philsquared/Catch.git master)
-    set(CATCH_INCLUDE_DIR ${CMAKE_BINARY_DIR}/catch/src/catch/include PARENT_SCOPE)
-    set(CATCH_INCLUDE_DIR ${CMAKE_BINARY_DIR}/catch/src/catch/include)
-    message(STATUS "Catch path: ${CATCH_INCLUDE_DIR}")
+    set(CATCH_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/catch/src/catch/include PARENT_SCOPE)
+    set(CATCH_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/catch/src/catch/include)
+    message(STATUS "Catch path: ${CATCH_INCLUDE_DIRS}")
   endif()
 endfunction()

@@ -68,13 +68,13 @@
 #  MPL                                                                                #
 # ------------------------------------------------------------------------------------------------ #
 function (addMPL)
-  if(DEFINED MPL_INCLUDE_DIR)
+  if(DEFINED MPL_INCLUDE_DIRS)
     message(STATUS "Catch is already available")
   else()
     checkout_external_project(mpl https://github.com/rabauke/mpl.git master)
-    set(MPL_INCLUDE_DIR ${CMAKE_BINARY_DIR}/mpl/src/mpl/mpl PARENT_SCOPE)
-    set(MPL_INCLUDE_DIR ${CMAKE_BINARY_DIR}/mpl/src/mpl/mpl)
-    message(STATUS "MPL path: ${MPL_INCLUDE_DIR}")
+    set(MPL_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/mpl/src/mpl/mpl PARENT_SCOPE)
+    set(MPL_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/mpl/src/mpl/mpl)
+    message(STATUS "MPL path: ${MPL_INCLUDE_DIRS}")
   endif()
 endfunction()

@@ -83,13 +83,13 @@
 #  unMIDIfy                                                                                #
 # ------------------------------------------------------------------------------------------------ #
 function (addUnmidify)
-  if(DEFINED UNMIDIFY_INCLUDE_DIR)
+  if(DEFINED UNMIDIFY_INCLUDE_DIRS)
     message(STATUS "Unmidify is already available")
   else()
     checkout_external_project(unmidify https://bitbucket.org/shaduzlabs/unmidify.git develop)
-    set(UNMIDIFY_INCLUDE_DIR ${CMAKE_BINARY_DIR}/unmidify/src/unmidify/include PARENT_SCOPE)
-    set(UNMIDIFY_INCLUDE_DIR ${CMAKE_BINARY_DIR}/unmidify/src/unmidify/include)
-    message(STATUS "Unmidify path: ${UNMIDIFY_INCLUDE_DIR}")
+    set(UNMIDIFY_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/unmidify/src/unmidify/include PARENT_SCOPE)
+    set(UNMIDIFY_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/unmidify/src/unmidify/include)
+    message(STATUS "Unmidify path: ${UNMIDIFY_INCLUDE_DIRS}")
   endif()
 endfunction()

@@ -172,13 +172,13 @@
 #  HIDAPI                                                                                #
 # ------------------------------------------------------------------------------------------------ #
 function (addHIDAPI)
-  if(DEFINED HIDAPI_INCLUDE_DIR)
+  if(DEFINED HIDAPI_INCLUDE_DIRS)
     message(STATUS "HIDAPI is already available")
   else()
     checkout_external_project(hidapi https://github.com/signal11/hidapi.git master)
     set(HIDAPI_BASE_DIR ${CMAKE_BINARY_DIR}/hidapi/src/hidapi/)
-    set(HIDAPI_INCLUDE_DIR ${CMAKE_BINARY_DIR}/hidapi/src/hidapi/hidapi PARENT_SCOPE)
-    set(HIDAPI_INCLUDE_DIR ${CMAKE_BINARY_DIR}/hidapi/src/hidapi/hidapi)
+    set(HIDAPI_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/hidapi/src/hidapi/hidapi PARENT_SCOPE)
+    set(HIDAPI_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/hidapi/src/hidapi/hidapi)

     message(STATUS "HIDAPI path: ${HIDAPI_BASE_DIR}")

@@ -211,7 +211,7 @@
         OUTPUT_NAME         "hidapi"
         OUTPUT_NAME_DEBUG   "hidapi${DEBUG_SUFFIX}"
     )
-    target_include_directories(hidapi PUBLIC ${HIDAPI_INCLUDE_DIR})
-
-  endif()
-endfunction()
+    target_include_directories(hidapi PUBLIC ${HIDAPI_INCLUDE_DIRS})
+
+  endif()
+endfunction()


Fixed path typo and copy/paste error in FindHorde3D.cmake.

--- cmake/Modules/FindHorde3D.cmake
+++ cmake/Modules/FindHorde3D.cmake
@@ -14,13 +14,13 @@
 find_path(HORDE3D_INCLUDE_DIR Horde3D.h
 			PATHS
 				/usr/include
-				/user/local/include
+				/usr/local/include
 				${CMAKE_SOURCE_DIR}/deps
 			PATH_SUFFIXES
 				horde3d
 				Horde3D.framework/Headers
 )
-if (HORDE3D_INCLUDE_DIR)
+if(HORDE3D_INCLUDE_DIR)
 	message (STATUS "Found Horde3D includes: " ${HORDE3D_INCLUDE_DIR})
 	set(Horde3D_INCLUDE_DIRS ${HORDE3D_INCLUDE_DIR})
 else()
@@ -32,14 +32,14 @@
 find_path(HORDE3DUTILS_INCLUDE_DIR Horde3DUtils.h
 			PATHS
 				/usr/include
-				/user/local/include
+				/usr/local/include
 				${CMAKE_SOURCE_DIR}/deps
 			PATH_SUFFIXES
 				horde3d
 				Horde3DUtils.framework/Headers
 )

-if (HORDE3DUTILS_INCLUDE_DIR)
+if(HORDE3DUTILS_INCLUDE_DIR)
 	message (STATUS "Found Horde3DUtils includes: " ${HORDE3DUTILS_INCLUDE_DIR})
 	set(Horde3D_INCLUDE_DIRS ${Horde3D_INCLUDE_DIRS} ${HORDE3DUTILS_INCLUDE_DIR})
 else()
@@ -50,16 +50,16 @@
 # Find Horde3D Libraries
 #------------------------------------------------------------------------------

-find_path(HORDE3D_LIBRARY Horde3D
+find_library(HORDE3D_LIBRARY Horde3D
 			PATHS
 				/usr/lib
-				/user/local/lib
+				/usr/local/lib
 				${CMAKE_SOURCE_DIR}/deps
 			PATH_SUFFIXES
 				horde3d
 				Horde3D.framework
 )
-if (HORDE3D_LIBRARY)
+if(HORDE3D_LIBRARY)
 	message (STATUS "Found Horde3D lib: " ${HORDE3D_LIBRARY})
 	set(Horde3D_LIBRARIES ${HORDE3D_LIBRARY})
 else()
@@ -68,16 +68,16 @@

 #------------------------------------------------------------------------------

-find_path(HORDE3DUTILS_LIBRARY Horde3DUtils
+find_library(HORDE3DUTILS_LIBRARY Horde3DUtils
 			PATHS
 				/usr/lib
-				/user/local/lib
+				/usr/local/lib
 				${CMAKE_SOURCE_DIR}/deps
 			PATH_SUFFIXES
 				horde3d
 				Horde3DUtils.framework
 )
-if (HORDE3DUTILS_LIBRARY)
+if(HORDE3DUTILS_LIBRARY)
 	message (STATUS "Found Horde3DUtils lib: " ${HORDE3DUTILS_LIBRARY})
 	set(Horde3D_LIBRARIES ${Horde3D_LIBRARIES} ${HORDE3DUTILS_LIBRARY})
 else()


Minor message update

Minor message update

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/OpenVDBHoudiniSetup.cmake
+++ cmake/OpenVDBHoudiniSetup.cmake
@@ -388,10 +388,9 @@
       message(STATUS "  Current CXX11 ABI matches Houdini configuration "
         "(_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}).")
     else()
-      message(WARNING "A problem or mismatch was detected between the CXX11 ABI "
+      message(WARNING "A potential mismatch was detected between the CXX11 ABI "
         "of GCC and Houdini. The following ABI configuration will be used: "
-        "-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}. Make sure all "
-        "dependencies have been built with the same CXX11 ABI. See: "
+        "-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}. See: "
         "https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html and "
         "https://vfxplatform.com/#footnote-gcc6 for more information.")
     endif()


CMake: disable libdispatch when targeting Wasm/WASI (#39274)

Wasm/WASI doesn't currently support multi-threading, and libdispatch should be disabled when building for this target.

Related to SR-12097.

--- cmake/modules/Libdispatch.cmake
+++ cmake/modules/Libdispatch.cmake
@@ -47,7 +47,8 @@
 # Build any target libdispatch if needed.
 foreach(sdk ${SWIFT_SDKS})
   # Darwin targets have libdispatch available, do not build it.
-  if(NOT "${sdk}" IN_LIST SWIFT_DARWIN_PLATFORMS)
+  # Wasm/WASI doesn't support libdispatch yet. See https://bugs.swift.org/browse/SR-12097 for more details.
+  if(NOT "${sdk}" IN_LIST SWIFT_DARWIN_PLATFORMS AND NOT "${sdk}" STREQUAL WASI)
     list(APPEND DISPATCH_SDKS "${sdk}")
   endif()
 endforeach()


cmake: Fixed some dependency problems.

cmake: Fixed some dependency problems.

--- cmake/modules/TpQt4Macros.cmake
+++ cmake/modules/TpQt4Macros.cmake
@@ -204,7 +204,8 @@
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_gen/cli-${spec}.h ${CMAKE_CURRENT_BINARY_DIR}/_gen/cli-${spec}-body.hpp
         COMMAND ${PYTHON_EXECUTABLE}
         ARGS ${ARGS}
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        DEPENDS ${CMAKE_SOURCE_DIR}/tools/qt4-client-gen.py)
     add_custom_target(generate_cli-${spec}-body DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_gen/cli-${spec}-body.hpp)

     if (client_generator_depends)
@@ -237,7 +238,8 @@
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}.h ${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}-body.hpp
         COMMAND ${PYTHON_EXECUTABLE}
         ARGS ${ARGS}
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        DEPENDS ${CMAKE_SOURCE_DIR}/tools/qt4-client-gen.py)
     add_custom_target(generate_future-${spec}-body DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}-body.hpp)

     if (future_client_generator_depends)
@@ -260,7 +262,9 @@

                        ARGS    ${CMAKE_SOURCE_DIR}/tools/manager-file.py
                                ${MANAGER_FILE}
-                               _gen)
+                               _gen
+
+                       DEPENDS ${CMAKE_SOURCE_DIR}/tools/manager-file.py)

     set_source_files_properties(${DEPEND_FILENAME}
                                 PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_gen/param-spec-struct.h)
@@ -280,7 +284,8 @@
                             ${xincludator_gen_args}
                             > ${_OUTPUT_FILE}

-                       DEPENDS ${_INPUT_FILE} ${depends_xml_files})
+                       DEPENDS ${CMAKE_SOURCE_DIR}/tools/xincludator.py
+                               ${_INPUT_FILE} ${depends_xml_files})
     add_custom_target(${_TARGET_NAME} DEPENDS ${_OUTPUT_FILE})

     if (xincludator_gen_depends)
@@ -302,7 +307,8 @@
                                --specxml=${_SPEC_XML}
                                > ${_OUTFILE}

-                       DEPENDS ${_SPEC_XML} ${depends_xml_files})
+                       DEPENDS ${CMAKE_SOURCE_DIR}/tools/qt4-constants-gen.py
+                               ${_SPEC_XML} ${depends_xml_files})
     add_custom_target(${_TARGET_NAME} DEPENDS ${_OUTFILE})

     if (constants_gen_depends)
@@ -325,7 +331,9 @@
                             --prettyinclude=${_PRETTYINCLUDE}
                             ${types_gen_args}
                             --specxml=${_SPEC_XML}
-                       DEPENDS ${_SPEC_XML} ${depends_xml_files})
+
+                       DEPENDS ${CMAKE_SOURCE_DIR}/tools/qt4-types-gen.py
+                               ${_SPEC_XML} ${depends_xml_files})
     add_custom_target(${_TARGET_NAME} DEPENDS ${_OUTFILE_IMPL})

     if (types_gen_depends)


Have all the macros affecting spec files depend on them

--- cmake/modules/TpQt4Macros.cmake
+++ cmake/modules/TpQt4Macros.cmake
@@ -268,6 +268,9 @@

 function(tpqt4_xincludator _TARGET_NAME _INPUT_FILE _OUTPUT_FILE)
     tpqt4_extract_depends(xincludator_gen_args xincludator_gen_depends ${ARGN})
+    # Gather all .xml files in TelepathyQt4 and spec/ and make this target depend on those
+    file(GLOB depends_xml_files ${CMAKE_SOURCE_DIR}/TelepathyQt4/*.xml ${CMAKE_SOURCE_DIR}/spec/*.xml)
+
     add_custom_command(OUTPUT ${_OUTPUT_FILE}

                        COMMAND ${PYTHON_EXECUTABLE}
@@ -275,7 +278,9 @@
                        ARGS ${CMAKE_SOURCE_DIR}/tools/xincludator.py
                             ${_INPUT_FILE}
                             ${xincludator_gen_args}
-                            > ${_OUTPUT_FILE})
+                            > ${_OUTPUT_FILE}
+
+                       DEPENDS ${_INPUT_FILE} ${depends_xml_files})
     add_custom_target(${_TARGET_NAME} DEPENDS ${_OUTPUT_FILE})

     if (xincludator_gen_depends)
@@ -285,6 +290,9 @@

 function(tpqt4_constants_gen _TARGET_NAME _SPEC_XML _OUTFILE)
     tpqt4_extract_depends(constants_gen_args constants_gen_depends ${ARGN})
+    # Gather all .xml files in TelepathyQt4 and spec/ and make this target depend on those
+    file(GLOB depends_xml_files ${CMAKE_SOURCE_DIR}/TelepathyQt4/*.xml ${CMAKE_SOURCE_DIR}/spec/*.xml)
+
     add_custom_command(OUTPUT ${_OUTFILE}

                        COMMAND ${PYTHON_EXECUTABLE}
@@ -292,7 +300,9 @@
                        ARGS    ${CMAKE_SOURCE_DIR}/tools/qt4-constants-gen.py
                                ${constants_gen_args}
                                --specxml=${_SPEC_XML}
-                               > ${_OUTFILE})
+                               > ${_OUTFILE}
+
+                       DEPENDS ${_SPEC_XML} ${depends_xml_files})
     add_custom_target(${_TARGET_NAME} DEPENDS ${_OUTFILE})

     if (constants_gen_depends)
@@ -302,6 +312,9 @@

 function(tpqt4_types_gen _TARGET_NAME _SPEC_XML _OUTFILE_DECL _OUTFILE_IMPL _NAMESPACE _REALINCLUDE _PRETTYINCLUDE)
     tpqt4_extract_depends(types_gen_args types_gen_depends ${ARGN})
+    # Gather all .xml files in TelepathyQt4 and spec/ and make this target depend on those
+    file(GLOB depends_xml_files ${CMAKE_SOURCE_DIR}/TelepathyQt4/*.xml ${CMAKE_SOURCE_DIR}/spec/*.xml)
+
     add_custom_command(OUTPUT ${_OUTFILE_DECL} ${_OUTFILE_IMPL}
                        COMMAND ${PYTHON_EXECUTABLE}
                        ARGS ${CMAKE_SOURCE_DIR}/tools/qt4-types-gen.py
@@ -311,7 +324,8 @@
                             --realinclude=${_REALINCLUDE}
                             --prettyinclude=${_PRETTYINCLUDE}
                             ${types_gen_args}
-                            --specxml=${_SPEC_XML})
+                            --specxml=${_SPEC_XML}
+                       DEPENDS ${_SPEC_XML} ${depends_xml_files})
     add_custom_target(${_TARGET_NAME} DEPENDS ${_OUTFILE_IMPL})

     if (types_gen_depends)


tcl: Add PACKAGE_INTERNAL_DEPS_ID of 1

tcl: Add PACKAGE_INTERNAL_DEPS_ID of 1

--- cmake/projects/tcl/hunter.cmake
+++ cmake/projects/tcl/hunter.cmake
@@ -18,4 +18,6 @@
 hunter_configuration_types(tcl CONFIGURATION_TYPES Release)
 hunter_pick_scheme(DEFAULT url_sha1_tcl_autotools)
 hunter_cacheable(tcl)
-hunter_download(PACKAGE_NAME tcl)
+hunter_download(PACKAGE_NAME tcl
+    PACKAGE_INTERNAL_DEPS_ID "1"
+)


Interpreting the second parameter of ADD_TEST_DIRECTORY as an exception list. Those tests will be removed from the tests to be executed.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -553,11 +553,21 @@

 ENDMACRO(expected_failure)

-# Convenience macro for adding tests in a standard format. QQQ doc!
-MACRO(ADD_TEST_DIRECTORY TEST_DIR)
+# Convenience macro for adding tests in a standard format.
+# Parameters:
+#   TEST_DIR - all the .xq files in this directory will be added as tests
+#   ARGV1    - if this is present, it will be interpreted as a list of
+#              exceptions. The list items will be removed from the list of
+#              files found in TEST_DIR.
+MACRO (ADD_TEST_DIRECTORY TEST_DIR)
   # QQQ error-check: Queries directory exists, some tests found...
   FILE(GLOB_RECURSE TESTFILES FOLLOW_SYMLINKS
     RELATIVE "${TEST_DIR}/Queries" "${TEST_DIR}/Queries/*.xq")
+
+  FOREACH (EXCEPTION ${ARGV1})
+    LIST (REMOVE_ITEM TESTFILES ${EXCEPTION})
+  ENDFOREACH (EXCEPTION)
+
   SET(TESTCOUNTER 0)
   FOREACH(TESTFILE ${TESTFILES})
     SET(TESTNAME "${PROJECT_NAME}/${TESTFILE}")
@@ -579,7 +589,7 @@
     ENDIF (${TESTMOD} EQUAL 0)
   ENDFOREACH(TESTFILE)
   MESSAGE(STATUS "Added ${TESTCOUNTER} tests in ${TEST_DIR}")
-ENDMACRO(ADD_TEST_DIRECTORY)
+ENDMACRO (ADD_TEST_DIRECTORY)

 # Macro to install a basic CMake config file for a module. Provide a
 # source and binary directory. Result will be installed in binary


CMake quickfix: Linux debug builds put plugins.cfg to the wrong location

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%40645

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -100,7 +100,7 @@
   set(OGRE_PLUGIN_DIR_DBG ".")
 elseif (UNIX)
   set(OGRE_PLUGIN_DIR_REL "../lib")
-  set(OGRE_PLUGIN_DIR_DBG "../../lib/OGRE")
+  set(OGRE_PLUGIN_DIR_DBG "../lib")
 endif ()
 if (WIN32)
   # create resources.cfg


cmake: clean script intermediate files

cmake: clean script intermediate files

--- CMakeModules/gitscript.cmake
+++ CMakeModules/gitscript.cmake
@@ -24,3 +24,5 @@
 file(WRITE "${OUTPUT}.tmp" "${NEW_CONTENT}")
 file(COPY "${OUTPUT}.tmp" DESTINATION "${OUTPUT}.tmp.x" FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OUTPUT}.tmp.x/${OUTPUT}.tmp ${OUTPUT})
+execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${OUTPUT}.tmp ${OUTPUT}.tmp.x/${OUTPUT}.tmp)
+execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${OUTPUT}.tmp.x)


gitscript.cmake: fix replacement

gitscript.cmake: fix replacement

--- CMakeModules/gitscript.cmake
+++ CMakeModules/gitscript.cmake
@@ -20,7 +20,7 @@
   set (THIS_GIT_ID)
 endif()
 file(READ ${INPUT} CONTENT)
-string(REGEX REPLACE "#CSG_GIT_ID#" "${THIS_GIT_ID}" NEW_CONTENT "${CONTENT}")
+string(REGEX REPLACE "#TOOLS_GIT_ID#" "${THIS_GIT_ID}" NEW_CONTENT "${CONTENT}")
 file(WRITE "${OUTPUT}.tmp" "${NEW_CONTENT}")
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OUTPUT}.tmp ${OUTPUT})
 execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${OUTPUT}.tmp)


CMake: Bugfix

CMake: Bugfix

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

--- deal.II/cmake/modules/FindUMFPACK.cmake
+++ deal.II/cmake/modules/FindUMFPACK.cmake
@@ -113,7 +113,6 @@
   "-shared"
   ${SuiteSparse_config_LIBRARY}
   )
-SET(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS})
 CHECK_CXX_SOURCE_COMPILES("extern int SuiteSparse_version (int[3]);
   void foo(int bar[3]) { SuiteSparse_version(bar);}"
   LAPACK_SUITESPARSECONFIG_WITH_PIC


Temporarily disable -gz flag

Temporarily disable -gz flag

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -34,9 +34,9 @@
   list(APPEND SPAGHETTI_FLAGS -pedantic)

   list(APPEND SPAGHETTI_FLAGS_DEBUG -ggdb3 -O0 -fno-inline -fno-omit-frame-pointer -fno-optimize-sibling-calls)
-  if (UNIX)
-    list(APPEND SPAGHETTI_FLAGS_DEBUG -gz)
-  endif ()
+#  if (UNIX)
+#    list(APPEND SPAGHETTI_FLAGS_DEBUG -gz)
+#  endif ()
   list(APPEND SPAGHETTI_FLAGS_RELEASE -O3 -flto -fuse-linker-plugin)
   list(APPEND SPAGHETTI_FLAGS_LINKER -Wl,-O1 -Wl,--fatal-warnings -Wl,--discard-all -Wl,--build-id=sha1)


fix for documentation creation in subprojects

--- cmake/DoxygenTarget.cmake
+++ cmake/DoxygenTarget.cmake
@@ -14,10 +14,11 @@
   add_custom_target(${DOC_TARGET_NAME} ${TARGET_ALL}
       ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/documentation-config.doxygen
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      COMMENT "Generating API documentation using doxygen" VERBATIM)
+      COMMENT "Generating API documentation using doxygen for ${PROJECT_NAME}" VERBATIM)

-  make_directory(${CMAKE_CURRENT_BINARY_DIR}/html) # needed for install
+  set(INSTALL_DOC_DIR ${CMAKE_BINARY_DIR}/doc/${PROJECT_NAME}/html)
+  file(MAKE_DIRECTORY ${INSTALL_DOC_DIR}) # needed for install

-  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/${PROJECT_NAME}-${VERSION_MAJOR} COMPONENT doc)
+  install(DIRECTORY ${INSTALL_DOC_DIR} DESTINATION share/${PROJECT_NAME}-${VERSION_MAJOR} COMPONENT doc)

 endfunction()


Use experimental Qt version

Use experimental Qt version

--- cmake/Hunter/config.cmake
+++ cmake/Hunter/config.cmake
@@ -34,7 +34,7 @@
 hunter_config(cereal VERSION 1.1.2-p5)
 hunter_config(OpenCV VERSION 3.0.0-p6 CMAKE_ARGS "${OPENCV_CMAKE_ARGS}")
 hunter_config(spdlog VERSION 1.0.0-p0)
-hunter_config(Qt VERSION ${HUNTER_Qt_VERSION})
+hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-p0)

 #  CMAKE_ARGS
 #  CMAKE_REQUIRED_FLAGS "-Wno-error=unused-command-line-argument-hard-error-in-future"


Spdlog version change (#239)

Spdlog version change (#239)

* added spdlog fix

--- cmake/Hunter/config.cmake
+++ cmake/Hunter/config.cmake
@@ -25,6 +25,8 @@
     CMAKE_ARGS
         SPDLOG_BUILD_EXAMPLE=OFF
         SPDLOG_FMT_EXTERNAL=OFF
+        CMAKE_CXX_VISIBILITY_PRESET=hidden
+        CMAKE_C_VISIBILITY_PRESET=hidden
 )

 # libarchive, luxonis fork


Supress ROOT_CINT_WRAPPER

Supress ROOT_CINT_WRAPPER

--- cmake/MacroRootDict.cmake
+++ cmake/MacroRootDict.cmake
@@ -1,11 +1,3 @@
-IF(APPLE)
-    SET( LD_LIBRARY_PATH_VAR DYLD_LIBRARY_PATH )
-ELSE()
-    SET( LD_LIBRARY_PATH_VAR LD_LIBRARY_PATH )
-ENDIF()
-SET( LD_LIBRARY_PATH_CONTENTS $ENV{${LD_LIBRARY_PATH_VAR}} )
-#MESSAGE( STATUS "LD_LIBRARY_PATH_CONTENTS: ${LD_LIBRARY_PATH_CONTENTS}" )
-
 IF( NOT DEFINED ROOT_DICT_OUTPUT_DIR )
     SET( ROOT_DICT_OUTPUT_DIR "${PROJECT_BINARY_DIR}/lib" )
 ENDIF()


cmake: update MKL library searching

cmake: update MKL library searching

- allow to specify MKL_LIBRARIES through command-line

--- cmake/OpenCVFindMKL.cmake
+++ cmake/OpenCVFindMKL.cmake
@@ -3,7 +3,14 @@
 # installation/package
 #
 # Parameters:
-# MKL_WITH_TBB
+# MKL_ROOT_DIR / ENV{MKLROOT}
+# MKL_INCLUDE_DIR
+# MKL_LIBRARIES
+# MKL_USE_SINGLE_DYNAMIC_LIBRARY - use single dynamic library mkl_rt.lib / libmkl_rt.so
+# MKL_WITH_TBB / MKL_WITH_OPENMP
+#
+# Extra:
+# MKL_LIB_FIND_PATHS
 #
 # On return this will define:
 #
@@ -12,12 +19,6 @@
 # MKL_INCLUDE_DIRS  - MKL include folder
 # MKL_LIBRARIES     - MKL libraries that are used by OpenCV
 #
-
-macro (mkl_find_lib VAR NAME DIRS)
-    find_path(${VAR} ${NAME} ${DIRS} NO_DEFAULT_PATH)
-    set(${VAR} ${${VAR}}/${NAME})
-    unset(${VAR} CACHE)
-endmacro()

 macro(mkl_fail)
     set(HAVE_MKL OFF)
@@ -39,43 +40,50 @@
     set(MKL_VERSION_STR "${MKL_VERSION_MAJOR}.${MKL_VERSION_MINOR}.${MKL_VERSION_UPDATE}" CACHE STRING "MKL version" FORCE)
 endmacro()

+OCV_OPTION(MKL_USE_SINGLE_DYNAMIC_LIBRARY "Use MKL Single Dynamic Library thorugh mkl_rt.lib / libmkl_rt.so" OFF)
+OCV_OPTION(MKL_WITH_TBB "Use MKL with TBB multithreading" OFF)#ON IF WITH_TBB)
+OCV_OPTION(MKL_WITH_OPENMP "Use MKL with OpenMP multithreading" OFF)#ON IF WITH_OPENMP)

-if(NOT DEFINED MKL_USE_MULTITHREAD)
-    OCV_OPTION(MKL_WITH_TBB "Use MKL with TBB multithreading" OFF)#ON IF WITH_TBB)
-    OCV_OPTION(MKL_WITH_OPENMP "Use MKL with OpenMP multithreading" OFF)#ON IF WITH_OPENMP)
+if(NOT MKL_ROOT_DIR AND DEFINED MKL_INCLUDE_DIR AND EXISTS "${MKL_INCLUDE_DIR}/mkl.h")
+  file(TO_CMAKE_PATH "${MKL_INCLUDE_DIR}" MKL_INCLUDE_DIR)
+  get_filename_component(MKL_ROOT_DIR "${MKL_INCLUDE_DIR}/.." ABSOLUTE)
+endif()
+if(NOT MKL_ROOT_DIR)
+  file(TO_CMAKE_PATH "${MKL_ROOT_DIR}" mkl_root_paths)
+  if(DEFINED ENV{MKLROOT})
+      file(TO_CMAKE_PATH "$ENV{MKLROOT}" path)
+      list(APPEND mkl_root_paths "${path}")
+  endif()
+
+  if(WITH_MKL AND NOT mkl_root_paths)
+    if(WIN32)
+      set(ProgramFilesx86 "ProgramFiles(x86)")
+      file(TO_CMAKE_PATH "$ENV{${ProgramFilesx86}}" path)
+      list(APPEND mkl_root_paths ${path}/IntelSWTools/compilers_and_libraries/windows/mkl)
+    endif()
+    if(UNIX)
+      list(APPEND mkl_root_paths "/opt/intel/mkl")
+    endif()
+  endif()
+
+  find_path(MKL_ROOT_DIR include/mkl.h PATHS ${mkl_root_paths})
 endif()

-#check current MKL_ROOT_DIR
 if(NOT MKL_ROOT_DIR OR NOT EXISTS "${MKL_ROOT_DIR}/include/mkl.h")
-    set(mkl_root_paths "${MKL_ROOT_DIR}")
-    if(DEFINED ENV{MKLROOT})
-        list(APPEND mkl_root_paths "$ENV{MKLROOT}")
-    endif()
-
-    if(WITH_MKL AND NOT mkl_root_paths)
-      if(WIN32)
-        set(ProgramFilesx86 "ProgramFiles(x86)")
-        list(APPEND mkl_root_paths $ENV{${ProgramFilesx86}}/IntelSWTools/compilers_and_libraries/windows/mkl)
-      endif()
-      if(UNIX)
-        list(APPEND mkl_root_paths "/opt/intel/mkl")
-      endif()
-    endif()
-
-    find_path(MKL_ROOT_DIR include/mkl.h PATHS ${mkl_root_paths})
+  mkl_fail()
 endif()

-set(MKL_INCLUDE_DIRS "${MKL_ROOT_DIR}/include" CACHE PATH "Path to MKL include directory")
+set(MKL_INCLUDE_DIR "${MKL_ROOT_DIR}/include" CACHE PATH "Path to MKL include directory")

 if(NOT MKL_ROOT_DIR
     OR NOT EXISTS "${MKL_ROOT_DIR}"
-    OR NOT EXISTS "${MKL_INCLUDE_DIRS}"
-    OR NOT EXISTS "${MKL_INCLUDE_DIRS}/mkl_version.h"
+    OR NOT EXISTS "${MKL_INCLUDE_DIR}"
+    OR NOT EXISTS "${MKL_INCLUDE_DIR}/mkl_version.h"
 )
-    mkl_fail()
+  mkl_fail()
 endif()

-get_mkl_version(${MKL_INCLUDE_DIRS}/mkl_version.h)
+get_mkl_version(${MKL_INCLUDE_DIR}/mkl_version.h)

 #determine arch
 if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
@@ -95,52 +103,66 @@
     set(MKL_ARCH_SUFFIX "c")
 endif()

-if(MKL_VERSION_STR VERSION_GREATER "11.3.0" OR MKL_VERSION_STR VERSION_EQUAL "11.3.0")
-    set(mkl_lib_find_paths
-        ${MKL_ROOT_DIR}/lib)
-    foreach(MKL_ARCH ${MKL_ARCH_LIST})
-      list(APPEND mkl_lib_find_paths
-        ${MKL_ROOT_DIR}/lib/${MKL_ARCH}
-        ${MKL_ROOT_DIR}/../tbb/lib/${MKL_ARCH}
-        ${MKL_ROOT_DIR}/${MKL_ARCH})
-    endforeach()
+set(mkl_lib_find_paths ${MKL_LIB_FIND_PATHS} ${MKL_ROOT_DIR}/lib)
+foreach(MKL_ARCH ${MKL_ARCH_LIST})
+  list(APPEND mkl_lib_find_paths
+    ${MKL_ROOT_DIR}/lib/${MKL_ARCH}
+    ${MKL_ROOT_DIR}/${MKL_ARCH}
+  )
+endforeach()

-    set(mkl_lib_list "mkl_intel_${MKL_ARCH_SUFFIX}")
+if(MKL_USE_SINGLE_DYNAMIC_LIBRARY AND NOT (MKL_VERSION_STR VERSION_LESS "10.3.0"))

-    if(MKL_WITH_TBB)
-        list(APPEND mkl_lib_list mkl_tbb_thread tbb)
-    elseif(MKL_WITH_OPENMP)
-        if(MSVC)
-            list(APPEND mkl_lib_list mkl_intel_thread libiomp5md)
-        else()
-            list(APPEND mkl_lib_list mkl_gnu_thread)
-        endif()
+  # https://software.intel.com/content/www/us/en/develop/articles/a-new-linking-model-single-dynamic-library-mkl_rt-since-intel-mkl-103.html
+  set(mkl_lib_list "mkl_rt")
+
+elseif(NOT (MKL_VERSION_STR VERSION_LESS "11.3.0"))
+
+  foreach(MKL_ARCH ${MKL_ARCH_LIST})
+    list(APPEND mkl_lib_find_paths
+      ${MKL_ROOT_DIR}/../tbb/lib/${MKL_ARCH}
+    )
+  endforeach()
+
+  set(mkl_lib_list "mkl_intel_${MKL_ARCH_SUFFIX}")
+
+  if(MKL_WITH_TBB)
+    list(APPEND mkl_lib_list mkl_tbb_thread tbb)
+  elseif(MKL_WITH_OPENMP)
+    if(MSVC)
+      list(APPEND mkl_lib_list mkl_intel_thread libiomp5md)
     else()
-        list(APPEND mkl_lib_list mkl_sequential)
+      list(APPEND mkl_lib_list mkl_gnu_thread)
     endif()
+  else()
+    list(APPEND mkl_lib_list mkl_sequential)
+  endif()

-    list(APPEND mkl_lib_list mkl_core)
+  list(APPEND mkl_lib_list mkl_core)
 else()
-    message(STATUS "MKL version ${MKL_VERSION_STR} is not supported")
-    mkl_fail()
+  message(STATUS "MKL version ${MKL_VERSION_STR} is not supported")
+  mkl_fail()
 endif()

-set(MKL_LIBRARIES "")
-foreach(lib ${mkl_lib_list})
-    find_library(${lib} NAMES ${lib} ${lib}_dll HINTS ${mkl_lib_find_paths})
-    mark_as_advanced(${lib})
-    if(NOT ${lib})
-        mkl_fail()
+if(NOT MKL_LIBRARIES)
+  set(MKL_LIBRARIES "")
+  foreach(lib ${mkl_lib_list})
+    set(lib_var_name MKL_LIBRARY_${lib})
+    find_library(${lib_var_name} NAMES ${lib} ${lib}_dll HINTS ${mkl_lib_find_paths})
+    mark_as_advanced(${lib_var_name})
+    if(NOT ${lib_var_name})
+      mkl_fail()
     endif()
-    list(APPEND MKL_LIBRARIES ${${lib}})
-endforeach()
+    list(APPEND MKL_LIBRARIES ${${lib_var_name}})
+  endforeach()
+endif()

 message(STATUS "Found MKL ${MKL_VERSION_STR} at: ${MKL_ROOT_DIR}")
 set(HAVE_MKL ON)
 set(MKL_ROOT_DIR "${MKL_ROOT_DIR}" CACHE PATH "Path to MKL directory")
-set(MKL_INCLUDE_DIRS "${MKL_INCLUDE_DIRS}" CACHE PATH "Path to MKL include directory")
-set(MKL_LIBRARIES "${MKL_LIBRARIES}" CACHE STRING "MKL libraries")
-if(UNIX AND NOT MKL_LIBRARIES_DONT_HACK)
+set(MKL_INCLUDE_DIRS "${MKL_INCLUDE_DIR}")
+set(MKL_LIBRARIES "${MKL_LIBRARIES}")
+if(UNIX AND NOT MKL_USE_SINGLE_DYNAMIC_LIBRARY AND NOT MKL_LIBRARIES_DONT_HACK)
     #it's ugly but helps to avoid cyclic lib problem
     set(MKL_LIBRARIES ${MKL_LIBRARIES} ${MKL_LIBRARIES} ${MKL_LIBRARIES} "-lpthread" "-lm" "-ldl")
 endif()


Fixed name of the package version file

Fixed name of the package version file

Update #172

--- cmake/PackageConfig.cmake
+++ cmake/PackageConfig.cmake
@@ -9,5 +9,5 @@
 #
 # This can easily be done from a very basic project configuration
 #---------------------------------------------------------------------------------
-set(PACKAGE_VERSION_FILE_NAME "${PROJECT_NAME}-config-${PROJECT_VERSION}.cmake")
+set(PACKAGE_VERSION_FILE_NAME "${PROJECT_NAME}-config-version.cmake")
 set(PACKAGE_CONFIG_FILE_NAME "${PROJECT_NAME}-config.cmake")


Remove debug message.

Remove debug message.

--- cmake/ToyBuildTools.cmake
+++ cmake/ToyBuildTools.cmake
@@ -5,7 +5,11 @@

 macro(toy_StdReady)
 	if(NOT MSVC)
-		add_definitions(-O2 -g -Werror -Wall -Wextra)
+		if( TOY_RELEASE )
+			add_definitions(-O2 -s -Werror -Wall -Wextra)
+		else()
+			add_definitions(-O2 -g -Werror -Wall -Wextra)
+		endif()

 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")


cmake/test.cmake: Fix for latest changes

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -22,7 +22,7 @@
     set(ARG_TIMEOUT 20)
   endif()

-  set(_bin_path ${QI_SDK_DIR}/${QI_SDK_BIN}/${target_name})
+  set(_bin_path ${QI_SDK_DIR}/${target_name})
   if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL "DEBUG")
     set(_bin_path ${_bin_path}_d)
   endif()


i#638 MinGW build: set preprocessor path and flags on MinGW the same as on Unix (#3845)

The preprocessor location and flags on MSYS2 MinGW are the same as on Unix-like system. This is just a second step toward building with MinGW.

Issue: #638
Signed-off-by: ofry <2af60ffb505c444e934158ef9fe01fbddcc22749@bmail.ru>

--- make/cpp2asm_support.cmake
+++ make/cpp2asm_support.cmake
@@ -132,7 +132,14 @@
 ##################################################
 # Preprocessor location and flags

-if (UNIX)
+if (MSVC)
+  set(CMAKE_CPP ${CMAKE_C_COMPILER})
+
+  set(CPP_KEEP_COMMENTS /C)
+  set(CPP_NO_LINENUM /EP)
+  set(CPP_KEEP_WHITESPACE "")
+  set(CMAKE_CPP_FLAGS "/nologo")
+else ()
   # "gcc -E" on a non-.c-extension file gives message:
   #   "linker input file unused because linking not done"
   # and doesn't produce any output, so we must use cpp for our .asm files.
@@ -153,14 +160,7 @@
   set(CPP_NO_LINENUM -P)
   set(CPP_KEEP_WHITESPACE -traditional-cpp)
   set(CMAKE_CPP_FLAGS "")
-else (UNIX)
-  set(CMAKE_CPP ${CMAKE_C_COMPILER})
-
-  set(CPP_KEEP_COMMENTS /C)
-  set(CPP_NO_LINENUM /EP)
-  set(CPP_KEEP_WHITESPACE "")
-  set(CMAKE_CPP_FLAGS "/nologo")
-endif (UNIX)
+endif (MSVC)

 ##################################################
 # Assembler location and flags


project GIT_TRACKING_BRANCH option

project GIT_TRACKING_BRANCH option

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -37,7 +37,7 @@
 endfunction()

 function(xpRepo)
-  set(oneValueArgs NAME SUPERPRO GIT_ORIGIN GIT_UPSTREAM GIT_TAG GIT_REF PATCH)
+  set(oneValueArgs NAME SUPERPRO GIT_ORIGIN GIT_UPSTREAM GIT_TRACKING_BRANCH GIT_TAG GIT_REF PATCH)
   cmake_parse_arguments(P "" "${oneValueArgs}" "" ${ARGN})
   string(TOLOWER ${P_NAME} prj)
   string(TOUPPER ${P_NAME} PRJ)
@@ -51,10 +51,15 @@
       set(patchCmd ${CMAKE_COMMAND} -E echo "no patch for ${prj}")
     endif()
     if(DEFINED P_GIT_UPSTREAM)
+      if(DEFINED P_GIT_TRACKING_BRANCH)
+        set(trackingBranch ${P_GIT_TRACKING_BRANCH})
+      else()
+        set(trackingBranch master)
+      endif()
       if(GIT_VERSION_STRING VERSION_LESS 1.8)
-        set(upstreamCmd --set-upstream master upstream/master)
+        set(upstreamCmd --set-upstream ${trackingBranch} upstream/${trackingBranch})
       else()
-        set(upstreamCmd --set-upstream-to=upstream/master master)
+        set(upstreamCmd --set-upstream-to=upstream/${trackingBranch} ${trackingBranch})
       endif()
       ExternalProject_Add(${prj}_repo
         GIT_REPOSITORY ${P_GIT_ORIGIN} GIT_TAG ${P_GIT_TAG}


d'oh, forgot to add back some q libs to the build when reverting to older linux package; here they are.

--- indra/cmake/WebKitLibPlugin.cmake
+++ indra/cmake/WebKitLibPlugin.cmake
@@ -67,6 +67,8 @@
         QtNetwork
         QtGui
         QtCore
+        qgif
+        qjpeg
         jpeg
         fontconfig
         X11


SVN_SILENT made messages (.desktop file)

--- ds9/ds9.desktop.cmake
+++ ds9/ds9.desktop.cmake
@@ -25,6 +25,7 @@
 Name[pa]=ਡਾਇਰੈਕਟ-ਸ਼ੋ9
 Name[pt]=DirectShow9
 Name[pt_BR]=DirectShow9
+Name[ro]=DirectShow9
 Name[ru]=DirectShow9
 Name[sr]=Дајректшоу‑9
 Name[sr@ijekavian]=Дајректшоу‑9
@@ -53,6 +54,7 @@
 Comment[pa]=ਫੋਨੋਨ DirectShow9 ਬੈਕਐਂਡ
 Comment[pt]=Infra-estrutura do DirectShow9 para o Phonon
 Comment[pt_BR]=Infraestrutura do DirectShow9 para o Phonon
+Comment[ro]=Suportul DirectShow9 pentru Phonon
 Comment[ru]=Механизм DirectShow9 для Phonon
 Comment[sr]=Дајректшоу‑9 као позадина Фонона
 Comment[sr@ijekavian]=Дајректшоу‑9 као позадина Фонона


Fix CMake >= 3.2 problems with soname

Fix CMake >= 3.2 problems with soname

When compiling QCA:

   fatal error: -soname: must take a non-empty argument

Solution from:
http://stackoverflow.com/a/32399514/2319028

--- tools/android.toolchain.cmake
+++ tools/android.toolchain.cmake
@@ -598,7 +598,7 @@
  endif()
  if( NOT __availableToolchains )
   file( GLOB __availableToolchainsLst RELATIVE "${ANDROID_NDK_TOOLCHAINS_PATH}" "${ANDROID_NDK_TOOLCHAINS_PATH}/*" )
-  if( __availableToolchains )
+  if( __availableToolchainsLst )
    list(SORT __availableToolchainsLst) # we need clang to go after gcc
   endif()
   __LIST_FILTER( __availableToolchainsLst "^[.]" )
@@ -987,7 +987,7 @@
   set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" )
  elseif( ANDROID_STL MATCHES "gabi" )
   if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
-   message( FATAL_ERROR "gabi++ is not awailable in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.")
+   message( FATAL_ERROR "gabi++ is not available in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.")
   endif()
   set( ANDROID_RTTI             ON )
   set( ANDROID_EXCEPTIONS       OFF )
@@ -1098,7 +1098,12 @@
  endif()
  set( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}"     CACHE PATH "assembler" )
  set( CMAKE_STRIP        "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}"   CACHE PATH "strip" )
- set( CMAKE_AR           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}"      CACHE PATH "archive" )
+ if( EXISTS "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc-ar${TOOL_OS_SUFFIX}" )
+  # Use gcc-ar if we have it for better LTO support.
+  set( CMAKE_AR           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc-ar${TOOL_OS_SUFFIX}"      CACHE PATH "archive" )
+ else()
+  set( CMAKE_AR           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}"      CACHE PATH "archive" )
+ endif()
  set( CMAKE_LINKER       "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ld${TOOL_OS_SUFFIX}"      CACHE PATH "linker" )
  set( CMAKE_NM           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-nm${TOOL_OS_SUFFIX}"      CACHE PATH "nm" )
  set( CMAKE_OBJCOPY      "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}" CACHE PATH "objcopy" )
@@ -1500,6 +1505,7 @@
     set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for Android libs" )
   endif()
 endif()
+string(REPLACE "<CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME>" "" CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")

 # copy shaed stl library to build directory
 if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" AND DEFINED LIBRARY_OUTPUT_PATH )


update our FindSimGrid.cmake file

update our FindSimGrid.cmake file

--- tools/cmake/FindSimGrid.cmake
+++ tools/cmake/FindSimGrid.cmake
@@ -1,60 +1,129 @@
-# Cmake macro to search for the SimGrid library.
+# CMake find module to search for the SimGrid library.

-# Copyright (c) 2016. The SimGrid Team (version 20161210).
+# Copyright (c) 2016-2018. The SimGrid Team.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.

-# The user can hint a path using the SimGrid_PATH option.
 #
-# Once done, the following will be defined:
-#
-#  SimGrid_INCLUDE_DIR - the SimGrid include directories
-#  SimGrid_LIBRARY - link your simulator against it to use SimGrid
+# USERS OF PROGRAMS USING SIMGRID
+# -------------------------------
 #
-# Afterward, you should probably do the following:
+# If cmake does not find this file, add its path to CMAKE_PREFIX_PATH:
+#    CMAKE_PREFIX_PATH="/path/to/FindSimGrid.cmake:$CMAKE_PREFIX_PATH"  cmake .
 #
-#  include_directories("${SimGrid_INCLUDE_DIR}" SYSTEM)
-#  target_link_libraries(your-simulator ${SimGrid_LIBRARY})
+# If this file does not find SimGrid, define SimGrid_PATH:
+#    SimGrid_PATH=/path/to/simgrid  cmake .
+
 #
-# This could be improved in many ways (patches welcome):
-#  - Not finding SimGrid is fatal. But who would want to
-#    overcome such a desperate situation anyway? ;)
-#  - No way to specify a minimal version
-#  - No proper find_package() integration
+# DEVELOPERS OF PROGRAMS USING SIMGRID
+# ------------------------------------
+#
+#  1. Include this file in your own CMakeLists.txt
+#     Either by copying it in your tree, or (recommended) by using the
+#     version automatically installed by SimGrid.
+#
+#  2. Afterward, if you have CMake >= 2.8.12, this will define a
+#     target called 'SimGrid::Simgrid'. Use it as:
+#       target_link_libraries(your-simulator SimGrid::SimGrid)
+#
+#    With older CMake (< 2.8.12), it simply defines several variables:
+#       SimGrid_INCLUDE_DIR - the SimGrid include directories
+#       SimGrid_LIBRARY - link your simulator against it to use SimGrid
+#    Use as:
+#      include_directories("${SimGrid_INCLUDE_DIR}" SYSTEM)
+#      target_link_libraries(your-simulator ${SimGrid_LIBRARY})
+#
+#  In both cases, it also define a SimGrid_VERSION macro, that you
+#    can use to deal with API evolutions as follows:
+#
+#    #if SimGrid_VERSION < 31800
+#      (code to use if the installed version is lower than v3.18)
+#    #elif SimGrid_VERSION < 31900
+#      (code to use if we are using SimGrid v3.18.x)
+#    #else
+#      (code to use with SimGrid v3.19+)
+#    #endif

-set(SimGrid_PATH ${SimGrid_PATH} CACHE PATH "Path to SimGrid library and include")
+#
+# IMPROVING THIS FILE
+# -------------------
+#  - Use automatic SimGridConfig.cmake creation via export/install(EXPORT in main CMakeLists.txt:
+#    https://cliutils.gitlab.io/modern-cmake/chapters/exporting.html
+#    https://cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
+#    https://github.com/boostcon/cppnow_presentations_2017/blob/master/05-19-2017_friday/effective_cmake__daniel_pfeifer__cppnow_05-19-2017.pdf
+
+cmake_minimum_required(VERSION 2.8)
+
 find_path(SimGrid_INCLUDE_DIR
-  NAMES simgrid_config.h
-  HINTS ${SimGrid_PATH}/include /usr/include /usr/local/include /opt/simgrid/include
+  NAMES simgrid/config.h
+  PATHS ${SimGrid_PATH}/include /opt/simgrid/include
 )
+if (NOT SimGrid_INCLUDE_DIR)
+  # search under the old name
+  find_path(SimGrid_INCLUDE_DIR
+    NAMES simgrid_config.h
+    PATHS ${SimGrid_PATH}/include /opt/simgrid/include
+  )
+endif()
 find_library(SimGrid_LIBRARY
   NAMES simgrid
-  HINTS ${SimGrid_PATH}/lib /usr/lib /usr/local/lib /opt/simgrid/lib
+  PATHS ${SimGrid_PATH}/lib /opt/simgrid/lib
 )
 mark_as_advanced(SimGrid_INCLUDE_DIR)
 mark_as_advanced(SimGrid_LIBRARY)

-if (NOT EXISTS "${SimGrid_INCLUDE_DIR}")
-  message(FATAL_ERROR "Unable to find SimGrid header file. Please point the SimGrid_PATH variable to the installation directory.")
-endif ()
-if (NOT EXISTS "${SimGrid_LIBRARY}")
-  message(FATAL_ERROR "Unable to find SimGrid library. Please point the SimGrid_PATH variable to the installation directory.")
+if (SimGrid_INCLUDE_DIR)
+  set(SimGrid_VERSION_REGEX "^#define SIMGRID_VERSION_(MAJOR|MINOR|PATCH) ([0-9]+)$")
+  if (EXISTS "${SimGrid_INCLUDE_DIR}/simgrid/config.h")
+    file(STRINGS "${SimGrid_INCLUDE_DIR}/simgrid/config.h" SimGrid_VERSION_STRING REGEX ${SimGrid_VERSION_REGEX})
+  else()
+    file(STRINGS "${SimGrid_INCLUDE_DIR}/simgrid_config.h" SimGrid_VERSION_STRING REGEX ${SimGrid_VERSION_REGEX})
+  endif()
+  set(SimGrid_VERSION "")
+
+  # Concat the matches to MAJOR.MINOR.PATCH assuming they appear in this order
+  foreach(match ${SimGrid_VERSION_STRING})
+    if(SimGrid_VERSION)
+      set(SimGrid_VERSION "${SimGrid_VERSION}.")
+    endif()
+    string(REGEX REPLACE ${SimGrid_VERSION_REGEX} "${SimGrid_VERSION}\\2" SimGrid_VERSION ${match})
+    set(SimGrid_VERSION_${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
+  endforeach()
+  unset(SimGrid_VERSION_STRING)
+  unset(SimGrid_VERSION_REGEX)
 endif ()

-# Extract the actual path
-if (NOT "$SimGrid_INCLUDE_DIR" STREQUAL "${SimGrid_PATH}/include")
-      string(REGEX REPLACE "(.*)/include" "\\1" SimGrid_PATH "${SimGrid_INCLUDE_DIR}")
-endif()
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SimGrid
+  FOUND_VAR SimGrid_FOUND
+  REQUIRED_VARS SimGrid_INCLUDE_DIR SimGrid_LIBRARY
+  VERSION_VAR SimGrid_VERSION
+)

-# Extract the actual version number
-file(READ "${SimGrid_INCLUDE_DIR}/simgrid_config.h" _SimGrid_CONFIG_H_CONTENTS)
-set(_SimGrid_VERSION_REGEX ".*#define SIMGRID_VERSION_STRING \"SimGrid version ([^\"]*)\".*")
-if ("${_SimGrid_CONFIG_H_CONTENTS}" MATCHES "${_SimGrid_VERSION_REGEX}")
-      string(REGEX REPLACE "${_SimGrid_VERSION_REGEX}" "\\1" SimGrid_VERSION "${_SimGrid_CONFIG_H_CONTENTS}")
-endif ("${_SimGrid_CONFIG_H_CONTENTS}" MATCHES "${_SimGrid_VERSION_REGEX}")
-
+if (SimGrid_FOUND AND NOT CMAKE_VERSION VERSION_LESS 2.8.12)
+  add_library(SimGrid::SimGrid SHARED IMPORTED)
+  set_target_properties(SimGrid::SimGrid PROPERTIES
+    INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${SimGrid_INCLUDE_DIR}
+    INTERFACE_COMPILE_FEATURES cxx_alias_templates
+    IMPORTED_LOCATION ${SimGrid_LIBRARY}
+  )
+  # We need C++11, so check for it just in case the user removed it since compiling SimGrid
+  if (NOT CMAKE_VERSION VERSION_LESS 3.8)
+    # 3.8+ allows us to simply require C++11 (or higher)
+    set_property(TARGET SimGrid::SimGrid PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_11)
+  elseif (NOT CMAKE_VERSION VERSION_LESS 3.1)
+    # 3.1+ is similar but for certain features. We pick just one
+    set_property(TARGET SimGrid::SimGrid PROPERTY INTERFACE_COMPILE_FEATURES cxx_alias_templates)
+  else ()
+    # Old CMake can't do much. Just check the CXX_FLAGS and inform the user when a C++11 feature does not work
+    include(CheckCXXSourceCompiles)
+    set(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS}")
+    check_cxx_source_compiles("using Foo = int; int main(){}" _SIMGRID_CXX11_ENABLED)
+    if (NOT _SIMGRID_CXX11_ENABLED)
+        message(WARNING "C++11 is required to use SimGrid. Enable it with e.g. -std=c++11")
+    endif ()
+    unset(_SIMGRID_CXX11_ENABLED CACHE)
+  endif ()
+endif ()

-message("-- SimGrid found in ${SimGrid_PATH} (version ${SimGrid_VERSION})")
-
-


BUG: Restored ctest_update() in SuperBuild, hoping to have specified CTEST_SOURCE_DIRECTORY correctly by now.

Based upon a suggestion by Matt McCormick, "Re: [SuperElastix] Dashboard questions", Tue Feb 20, 2018.

--- SuperBuild/CTest.cmake
+++ SuperBuild/CTest.cmake
@@ -18,7 +18,7 @@
 #=========================================================================

 # Directories relative to the build directory.
-set(CTEST_SOURCE_DIRECTORY "../src/SuperBuild")
+set(CTEST_SOURCE_DIRECTORY "../src")
 set(CTEST_BINARY_DIRECTORY ".")

 set(CTEST_SITE "lkeb-selx01")
@@ -45,10 +45,11 @@
 set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} --build ${CTEST_BINARY_DIRECTORY}")
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DWITH_TESTING:BOOL=ON ${CTEST_BUILD_OPTIONS}")
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"-G${CTEST_CMAKE_GENERATOR}\"")
-set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_SOURCE_DIRECTORY}\"")
+set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_SOURCE_DIRECTORY}\"/SuperBuild")

 ctest_start("Nightly")
-# TODO Add ctest_update() to ensure that the commit SHA will be passed to CDash, and GitHub.
+# Added ctest_update() to ensure that the commit SHA will be passed to CDash, and GitHub.
+ctest_update()
 ctest_configure()
 ctest_build()
 ctest_submit( PARTS Configure Build )


Fix location of installed man pages.

Fix location of installed man pages.

svn path=/trunk/; revision=12666

--- cmake/build_projects/iwidgets4.0/bp.cmake
+++ cmake/build_projects/iwidgets4.0/bp.cmake
@@ -89,8 +89,9 @@
   # itcl header.
   CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${${BP_PACKAGE}_SET_CFLAGS} "CPPFLAGS=-I${INCRTCL3_PREFIX}/include/itcl${ITCL3_LIBVERSION} -I${BP_CMAKE_INSTALL_PREFIX}/include" ${source_PATH}/configure --prefix=${INCRTCL3_PREFIX} --exec-prefix=${INCRTCL3_PREFIX} --includedir=${INCRTCL3_PREFIX}/include/itcl${ITCL3_LIBVERSION} --mandir=${INCRTCL3_PREFIX}/share/man --with-tcl=${BP_CMAKE_INSTALL_PREFIX}/lib --with-tk=${BP_CMAKE_INSTALL_PREFIX}/lib
   # Possible make race conditions so use non-parallel make
-  BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_MAKE_COMMAND}
-  INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_MAKE_COMMAND} install
+  # Also, above --mandir option is ignored, so must specify MAN_INSTALL_DIR
+  BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_MAKE_COMMAND} MAN_INSTALL_DIR=${INCRTCL3_PREFIX}/share/man/mann
+  INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_MAKE_COMMAND} MAN_INSTALL_DIR=${INCRTCL3_PREFIX}/share/man/mann install
   )

 add_custom_command(


Dennis: install for static versions

Dennis: install for static versions

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

--- cmake/ACGCommon.cmake
+++ cmake/ACGCommon.cmake
@@ -448,6 +448,12 @@
                RUNTIME DESTINATION ${ACG_PROJECT_BINDIR}
                LIBRARY DESTINATION ${ACG_PROJECT_LIBDIR}
                ARCHIVE DESTINATION ${ACG_PROJECT_LIBDIR})
+      if (_and_static)
+        install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static.a
+                 DESTINATION ${ACG_PROJECT_LIBDIR}
+                 RENAME lib${_target}.a
+                 PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+      endif ()
     elseif (${_type} STREQUAL MODULE)
       install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_PLUGINDIR})
     endif ()


Properly set the CEGUI_INCLUDE_DIRS variable.

Hl: Enter commit message.  Lines beginning with 'HG:' are removed.

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


[axl_cmake] make find_package QUIET

[axl_cmake] make find_package QUIET

--- cmake/import_qt.cmake
+++ cmake/import_qt.cmake
@@ -21,26 +21,26 @@
 set (QTNETWORK_FOUND FALSE)

 if (NOT QT_CMAKE_DIR)
-	find_package (Qt5Core)
+	find_package (Qt5Core QUIET)
 	if (Qt5Core_FOUND)
 	 	set (QT_FOUND TRUE)
 		set (QTCORE_FOUND TRUE)
 		set (QTCORE_CMAKE_DIR ${Qt5Core_DIR})
 	endif ()

-	find_package (Qt5Gui)
+	find_package (Qt5Gui QUIET)
 	if (Qt5Gui_FOUND)
 		set (QTGUI_FOUND TRUE)
 		set (QTGUI_CMAKE_DIR ${Qt5Gui_DIR})
 	endif ()

-	find_package (Qt5Widgets)
+	find_package (Qt5Widgets QUIET)
 	if (Qt5Widgets_FOUND)
 		set (QTWIDGETS_FOUND TRUE)
 		set (QTWIDGETS_CMAKE_DIR ${Qt5Widgets_DIR})
 	endif ()

-	find_package (Qt5Network)
+	find_package (Qt5Network QUIET)
 	if (Qt5Network_FOUND)
 		set (QTNETWORK_FOUND TRUE)
 		set (QTNETWORK_CMAKE_DIR ${Qt5Network_DIR})


Removed unused macros

Removed unused macros

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

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -40,85 +40,6 @@
         list(APPEND ${_output} "${_prefix}${_item}")
     endforeach(_item)
 endmacro(PREFIX_LIST)
-
-
-###############################################################################
-# Find a pkg-config file and use it.
-# _pkg The name of the package to search for.
-# _required Set to "REQUIRED" to cause an error if the package is not found.
-include(FindPkgConfig)
-macro(GET_PKG_CONFIG_INFO _pkg _required)
-    if(PKG_CONFIG_FOUND)
-        pkg_check_modules(${_pkg}_PKG ${_required} ${_pkg})
-        if(${_pkg}_PKG_CFLAGS_OTHER)
-            LIST_TO_STRING("${${_pkg}_PKG_CFLAGS_OTHER}" ${_pkg}_CFLAGS)
-        else(${_pkg}_PKG_CFLAGS_OTHER)
-            set(${_pkg}_CFLAGS "")
-        endif(${_pkg}_PKG_CFLAGS_OTHER)
-        set(${_pkg}_INCLUDE_DIRS ${${_pkg}_PKG_INCLUDE_DIRS})
-        set(${_pkg}_LINK_LIBS ${${_pkg}_PKG_LIBRARIES})
-        set(${_pkg}_LIBRARY_DIRS ${${_pkg}_PKG_LIBRARY_DIRS})
-        if(${_pkg}_PKG_LDFLAGS_OTHER)
-            LIST_TO_STRING("${${_pkg}_PKG_LDFLAGS_OTHER}" ${_pkg}_LINK_FLAGS)
-        else(${_pkg}_PKG_LDFLAGS_OTHER)
-            set(${_pkg}_LINK_FLAGS "")
-        endif(${_pkg}_PKG_LDFLAGS_OTHER)
-    else(PKG_CONFIG_FOUND)
-        message(STATUS "Could not find pkg-config.")
-        message(STATUS
-            "You will need to set the following variables manually:")
-        message(STATUS "${_pkg}_INCLUDE_DIRS ${_pkg}_CFLAGS_OTHER ${_pkg}_LINK_LIBS ${_pkg}_LIBRARY_DIRS ${_pkg}_LINK_FLAGS")
-    endif(PKG_CONFIG_FOUND)
-endmacro(GET_PKG_CONFIG_INFO)
-
-
-###############################################################################
-# Apply the results of a pkg-config search to the include and link directory
-# settings.
-# _pkg The name of the package who's settings should be applied.
-macro(APPLY_PKG_CONFIG_DIRS _pkg)
-    if(${_pkg}_INCLUDE_DIRS)
-        include_directories(${${_pkg}_INCLUDE_DIRS})
-    endif(${_pkg}_INCLUDE_DIRS)
-    if(${_pkg}_LIBRARY_DIRS)
-        link_directories(${${_pkg}_LIBRARY_DIRS})
-    endif(${_pkg}_LIBRARY_DIRS)
-endmacro(APPLY_PKG_CONFIG_DIRS)
-
-
-###############################################################################
-# Apply the results of a pkg-config search to a list of targets, setting the
-# link flags and libraries to link to on each target based on the information
-# from the pkg-config file.
-# _pkg The name of the package who's settings should be applied.
-# Extra arguments: The targets to apply to.
-macro(APPLY_PKG_CONFIG_TO_TGTS _pkg)
-    if(${_pkg}_LINK_FLAGS)
-        foreach(_tgt ${ARGN})
-            set_target_properties(${_tgt} PROPERTIES
-                LINK_FLAGS "${${_pkg}_LINK_FLAGS}")
-        endforeach(_tgt)
-    endif(${_pkg}_LINK_FLAGS)
-    if(${_pkg}_LINK_LIBS)
-        foreach(_tgt ${ARGN})
-            target_link_libraries(${_tgt} ${${_pkg}_LINK_LIBS})
-        endforeach(_tgt)
-    endif(${_pkg}_LINK_LIBS)
-endmacro(APPLY_PKG_CONFIG_TO_TGTS)
-
-
-###############################################################################
-# Apply the results of a pkg-config search to a list of source files, setting
-# the compile flags on each file based on the information from the pkg-config
-# file.
-# _pkg The name of the package who's settings should be applied.
-# Extra arguments: The files to apply to.
-macro(APPLY_PKG_CONFIG_TO_SRCS _pkg)
-    if(${_pkg}_CFLAGS)
-        set_source_files_properties(${ARGN}
-            PROPERTIES COMPILE_FLAGS "${${_pkg}_CFLAGS}")
-    endif(${_pkg}_CFLAGS)
-endmacro(APPLY_PKG_CONFIG_TO_SRCS)

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


remove verbosity

remove verbosity

--- cmake/rosbuild2.cmake
+++ cmake/rosbuild2.cmake
@@ -20,7 +20,6 @@
     set(_output_wikidoc ${CATKIN_PACKAGE_SHARE_DESTINATION}/docs/${_cfg_bare}Config.wikidoc)
     set(_output_usage ${CATKIN_PACKAGE_SHARE_DESTINATION}/docs/${_cfg_bare}Config-usage.dox)

-message(INFO ${_output_cpp} ${_output_dox} ${_output_usage} ${_output_py} ${_output_wikidoc})
     add_custom_command(OUTPUT
       ${_output_cpp} ${_output_dox} ${_output_usage} ${_output_py} ${_output_wikidoc}
       COMMAND ${CATKIN_ENV}


release(v0.1.0-alpha): Release commit

release(v0.1.0-alpha): Release commit

--- cmake/variables.cmake
+++ cmake/variables.cmake
@@ -1,7 +1,7 @@
 # Versions of the project
 set (ParallaxEngine_API_VERSION     100)
-set (ParallaxEngine_VERSION_MAJOR 	1)
-set (ParallaxEngine_VERSION_MINOR 	0)
+set (ParallaxEngine_VERSION_MAJOR 	0)
+set (ParallaxEngine_VERSION_MINOR 	1)
 set (ParallaxEngine_VERSION_PATCH   0)
 string (TIMESTAMP ParallaxEngine_MAKE_DATE "%m%d%y")
 string (TIMESTAMP ParallaxEngine_MAKE_HOUR "%H%M%S")


Add plugin.xml in cmake file

Add plugin.xml in cmake file

--- Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/files.cmake
+++ Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/files.cmake
@@ -18,6 +18,7 @@

 SET(CACHED_RESOURCE_FILES
   resources/pointset_interaction.png
+  plugin.xml
 )

 SET(QRC_FILES


Some changes to make GCC 4.8.1 happy.

Some changes to make GCC 4.8.1 happy.

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -166,7 +166,7 @@
       OUTPUT_STRIP_TRAILING_WHITESPACE)

   #<FS:ND> Gentoo defines _FORTIFY_SOURCE by default
-  if (NOT ${GXX_VERSION} MATCHES "Gentoo 4.7.*")
+  if (NOT ${GXX_VERSION} MATCHES "Gentoo 4.[78].*")
   #</FS:ND>

   if (${GXX_VERSION} STREQUAL ${CXX_VERSION})
@@ -178,7 +178,7 @@
   endif (${GXX_VERSION} STREQUAL ${CXX_VERSION})

   #<FS:ND> Gentoo defines _FORTIFY_SOURCE by default
-  endif (NOT ${GXX_VERSION} MATCHES "Gentoo 4.7.*")
+  endif (NOT ${GXX_VERSION} MATCHES "Gentoo 4.[78].*")
   #</FS:ND>

   # Let's actually get a numerical version of gxx's version
@@ -212,6 +212,13 @@
     set(CMAKE_CXX_FLAGS "-Wno-attributes ${CMAKE_CXX_FLAGS}")
   endif (${CXX_VERSION_NUMBER} GREATER 470)
   #</FS:ND>
+  #<FS:ND> Disable unsed local typedef warnings for GCC >= 4.8. It causes a lot of warning/errors in boost.
+  if(${CXX_VERSION_NUMBER} GREATER 480)
+    set(CMAKE_CXX_FLAGS "-Wno-unused-local-typedefs ${CMAKE_CXX_FLAGS}")
+  endif (${CXX_VERSION_NUMBER} GREATER 480)
+  #</FS:ND>
+
+

   # End of hacks.


for now, turn off precompiled header usage by default (so Incredibuild will work).

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -148,7 +148,7 @@
 endif (LINUX AND SERVER AND VIEWER)

-set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")
+set(USE_PRECOMPILED_HEADERS OFF CACHE BOOL "Enable use of precompiled header directives where supported.")

 source_group("CMake Rules" FILES CMakeLists.txt)


changed: allow lib to provide patterns/suffix

git-svn-id: 9c86407f91444b2cc93bb44d37d96a685973386f@2401 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/BuildFunctions.cmake
+++ CMake/BuildFunctions.cmake
@@ -188,6 +188,13 @@
     SET(${PROJECT_NAME}_EXCL_FILES)

     SET(${PROJECT_NAME}_BASE_DIR)
+
+    SET(${PROJECT_NAME}_SRC_PATTERNS)
+    SET(${PROJECT_NAME}_HDR_PATTERNS)
+    SET(${PROJECT_NAME}_INL_PATTERNS)
+
+    SET(${PROJECT_NAME}_SUFFIX)
+
 ENDMACRO(OSG_SELECT_PROJECT)

 #############################################################################
@@ -414,13 +421,32 @@

     OSG_MSG("Adding directory: ${DIRNAME}")

+    SET(_OSG_ADD_SRC_LOOKUP)
+    SET(_OSG_ADD_HDR_LOOKUP)
+    SET(_OSG_ADD_INL_LOOKUP)
+
     IF(EXISTS "${CMAKE_SOURCE_DIR}/${DIRNAME}")
         SET(_OSG_CURR_DIRNAME "${CMAKE_SOURCE_DIR}/${DIRNAME}")

+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_SRC_PATTERNS})
+          LIST(APPEND _OSG_ADD_SRC_LOOKUP "${CMAKE_SOURCE_DIR}/${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_HDR_PATTERNS})
+          LIST(APPEND _OSG_ADD_HDR_LOOKUP "${CMAKE_SOURCE_DIR}/${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_INL_PATTERNS})
+          LIST(APPEND _OSG_ADD_INL_LOOKUP "${CMAKE_SOURCE_DIR}/${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
         FILE(GLOB LOCAL_SRC          "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.cpp"
-                                     "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.mm")
-        FILE(GLOB LOCAL_HDR          "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.h")
-        FILE(GLOB LOCAL_INL          "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.inl")
+                                     "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.mm"
+                                      ${_OSG_ADD_SRC_LOOKUP}                )
+        FILE(GLOB LOCAL_HDR          "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.h"
+                                      ${_OSG_ADD_HDR_LOOKUP}               )
+        FILE(GLOB LOCAL_INL          "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.inl"
+                                      ${_OSG_ADD_INL_LOOKUP}                 )
         FILE(GLOB LOCAL_INS          "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.ins")
         FILE(GLOB LOCAL_FCD          "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.fcd")
         FILE(GLOB LOCAL_LL           "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*.ll")
@@ -433,10 +459,25 @@
     ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}")
         SET(_OSG_CURR_DIRNAME "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}")

+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_SRC_PATTERNS})
+          LIST(APPEND _OSG_ADD_SRC_LOOKUP "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_HDR_PATTERNS})
+          LIST(APPEND _OSG_ADD_HDR_LOOKUP "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_INL_PATTERNS})
+          LIST(APPEND _OSG_ADD_INL_LOOKUP "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
         FILE(GLOB LOCAL_SRC          "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.cpp"
-                                     "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.mm")
-        FILE(GLOB LOCAL_HDR          "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.h")
-        FILE(GLOB LOCAL_INL          "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.inl")
+                                     "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.mm"
+                                      ${_OSG_ADD_SRC_LOOKUP}                        )
+        FILE(GLOB LOCAL_HDR          "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.h"
+                                     ${_OSG_ADD_HDR_LOOKUP}                        )
+        FILE(GLOB LOCAL_INL          "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.inl"
+                                     ${_OSG_ADD_INL_LOOKUP}                          )
         FILE(GLOB LOCAL_INS          "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.ins")
         FILE(GLOB LOCAL_FCD          "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.fcd")
         FILE(GLOB LOCAL_LL           "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.ll")
@@ -449,10 +490,26 @@
     ELSE()
         SET(_OSG_CURR_DIRNAME "${DIRNAME}")

+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_SRC_PATTERNS})
+          LIST(APPEND _OSG_ADD_SRC_LOOKUP "${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_HDR_PATTERNS})
+          LIST(APPEND _OSG_ADD_HDR_LOOKUP "${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
+        FOREACH(_OSG_FILE_PATTERN ${${PROJECT_NAME}_INL_PATTERNS})
+          LIST(APPEND _OSG_ADD_INL_LOOKUP "${DIRNAME}/${_OSG_FILE_PATTERN}")
+        ENDFOREACH()
+
         # Guess it's an absolute dir we got as the rel one is not there
-        FILE(GLOB LOCAL_SRC          "${DIRNAME}/OSG*.cpp" "${DIRNAME}/OSG*.mm")
-        FILE(GLOB LOCAL_HDR          "${DIRNAME}/OSG*.h")
-        FILE(GLOB LOCAL_INL          "${DIRNAME}/OSG*.inl")
+        FILE(GLOB LOCAL_SRC          "${DIRNAME}/OSG*.cpp"
+                                     "${DIRNAME}/OSG*.mm"
+                                      ${_OSG_ADD_SRC_LOOKUP})
+        FILE(GLOB LOCAL_HDR          "${DIRNAME}/OSG*.h"
+                                      ${_OSG_ADD_HDR_LOOKUP})
+        FILE(GLOB LOCAL_INL          "${DIRNAME}/OSG*.inl"
+                                      ${_OSG_ADD_INL_LOOKUP})
         FILE(GLOB LOCAL_INS          "${DIRNAME}/OSG*.ins")
         FILE(GLOB LOCAL_FCD          "${DIRNAME}/OSG*.fcd")
         FILE(GLOB LOCAL_LL           "${DIRNAME}/OSG*.ll")
@@ -835,6 +892,11 @@
         DEBUGOPT_POSTFIX "DO"
         RELEASENOOPT_POSTFIX "RN")

+    IF(${PROJECT_NAME}_SUFFIX)
+      SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
+                            SUFFIX ${${PROJECT_NAME}_SUFFIX})
+
+    ENDIF(${PROJECT_NAME}_SUFFIX)
     # dependencies - OpenSG
     OSG_GET_ALL_DEP_OSG_LIB(
         "${${PROJECT_NAME}_DEP_OSG_LIB}" DEP_OSG_LIST DEP_MISSING_LIST)


Another fixup for Boost patch

Another fixup for Boost patch

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -146,7 +146,7 @@
       COMMAND ${CMAKE_COMMAND} -E copy_directory "<SOURCE_DIR>/boost" "<INSTALL_DIR>/${_boost_install_include_dir}")
   endif()

-  set(_boost_patch_cmd PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/Boost.patch)
+  set(_boost_patch_cmd PATCH_COMMAND ${PATCH_COMMAND} --binary -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/Boost.patch)

   ExternalProject_Add(${proj}
     LIST_SEPARATOR ${sep}


Remove superfluous COMMAND command

Remove superfluous COMMAND command

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -210,8 +210,7 @@
           contains slashes. ]]

       if(toolset)
-        set(configure_cmd COMMAND
-          sed -i.backup "\
+        set(configure_cmd sed -i.backup "\
 s|\
 using[[:space:]][[:space:]]*${toolset}[[:space:]]*$<SEMICOLON>|\
 using ${toolset} : : ${CMAKE_CXX_COMPILER} $<SEMICOLON>|\


Update exclusion glob

Update exclusion glob

git-svn-id: 59f82343654cec32357d3b049d399063e4e4cfc7@31307 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/CTestConfig.cmake
+++ deal.II/CTestConfig.cmake
@@ -45,6 +45,8 @@

 SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
   "/bundled"
+  "/cmake/scripts/"
   "/contrib"
-  "/cmake/scripts/"
+  "/examples"
+  "/tests"
   )


Fix output file-path determination in cmake

Signed-off-by: Robert Young <42c59959a3f4413d6a1b4d7b4f99db457d199e49@gmail.com>

--- cmake/modules/Utilities.cmake
+++ cmake/modules/Utilities.cmake
@@ -45,7 +45,7 @@

 # Helper to translate a source file to an absolute path.
 function(ab_resolve_source_name output_var file_name)
-	get_filename_component(resolved_file_name ${ARG_INPUT} ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR})
+	get_filename_component(resolved_file_name ${ARG_INPUT} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 	set(${output_var} ${resolved_file_name} PARENT_SCOPE)
 endfunction(ab_resolve_source_name)

@@ -59,16 +59,19 @@
 #  )
 function(ab_add_jinja_template)
 	cmake_parse_arguments("ARG" "" "INPUT;OUTPUT" "DATA_FILES;TEMPLATE_INCLUDES" "${ARGN}")
-	ab_resolve_source_name(input ${ARG_INPUT})
+
+	get_filename_component(ARG_INPUT  ${ARG_INPUT}  ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+	get_filename_component(ARG_OUTPUT ${ARG_OUTPUT} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
 	add_custom_command(
 		COMMAND
 			python3 ${CMAKE_SOURCE_DIR}/scripts/jinja-generate.py
-			--data-dir=${CMAKE_SOURCE_DIR}/data
-			--include-dir=${CMAKE_SOURCE_DIR}/templates
-			${input}
-			${ARG_OUTPUT}
+				--data-dir=${CMAKE_SOURCE_DIR}/data
+				--include-dir=${CMAKE_SOURCE_DIR}/templates
+				${ARG_INPUT}
+				${ARG_OUTPUT}
 		MAIN_DEPENDENCY ${ARG_INPUT}
-		OUTPUT ${ARG_OUTPUT}
+		OUTPUT          ${ARG_OUTPUT}
 		DEPENDS
 			${CMAKE_SOURCE_DIR}/scripts/jinja-generate.py
 			${ARG_DATA_FILES}
@@ -86,13 +89,16 @@
 #  )
 function(ab_add_jinja_cxx_template)
 	cmake_parse_arguments("ARG" "" "INPUT;OUTPUT" "DATA_FILES;TEMPLATE_INCLUDES" "${ARGN}")
-	get_filename_component(ARG_INPUT ${ARG_INPUT} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
+	get_filename_component(ARG_INPUT  ${ARG_INPUT}  ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 	get_filename_component(ARG_OUTPUT ${ARG_OUTPUT} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
 	ab_add_jinja_template(
 		INPUT      ${ARG_INPUT}
 		OUTPUT     ${ARG_OUTPUT}.dirty
 		DATA_FILES ${ARG_DATA_FILES}
 	)
+
 	clang_formatx(
 		INPUT  ${ARG_OUTPUT}.dirty
 		OUTPUT ${ARG_OUTPUT}


Moved the Houdini framework into the Houdini applications folder for both the
dev and end-user environments.  The major benefit of this change is that the
end-user installation is now standalone.  /Library/Frameworks/Houdini.framework
is no longer created.  This means that users can now move the Houdini
installation to other locations and everything will still work.

Another benefit with this change is that the dev environment better matches the
end-user environment.  Paths inside $HFS/Applications are identical to
/Applications/Houdini X.Y.ZZZ.  This helps reduce places in code where we
try to handle both environments by searching multiple library and resource
locations.

$SHM/C++MakeFrameworkMBSD:
- Switched to $DEV_FRAMEWORK for frameworks paths.
- Added '@' for all recipe commands to reduce the noise in the output.
- Added Frameworks rule for generating the new location of the Frameworks
  directory and creating a symbolic link for the old location.  The symbolic
  link is also necessary so that $HFS in the dev environment has the same
  Frameworks/Python.framework subdirectory that appears in $HFS in the end-user
  environment.
- Removed mozilla rules which are no longer needed.

$SHM/C++Defs,
$SHM/C++MakeApp,
$S/cmake/*.cmake,
$hqueue/Makefile,
$SHC/HOM/PYHOM/Makefile,
$SHC/PDG/Makefile,
$SHC/SOHO/Makefile,
$SHC/hjson/Makefile,
$SHC/htext/Makefile,
$SHM/list_link_libs.py:
- Moved $HFS/Frameworks to $HFS/Applications/Frameworks.
- Swept Makefiles to use $DEV_FRAMEWORK instead of hard-coded
  $HFS/Applications/Frameworks paths.  I left the hard-coded frameworks path in
  list_link_libs.py so that the script can still run correctly even when
  invoked outside of `make` (i.e. $DEV_FRAMEWORK is a make variable, not an
  environment variable).
- In C++MakeApp, also replaced hard-coded $HFS/dsolib with $DEV_DSOLIB which
  points to the real location of the libraries folder instead of the symbolic
  link.  This generates a relative path to the libraries folder which works in
  both the dev and end-user environments.

$SHM/C++HoudiniTools:
- Bumped up PySide package to 1.2.2-8.  The new package fixes rpaths in the
  compiled modules so that they can find the Qt libraries in the new framework
  library location.

$gplay/*,
$hotlview/*,
$mplay/*,
$orbolt_utl/*,
$SHK/hkey/*,
$RE/RE_QtUtils.C,
$SHS/mbsd/bundle_files/BundleRules,
$SHS/mbsd/bundle_files/MakeBundle.cmake:
- Moved applications into the Utilities and Administrative Tools sub-folders
  in the dev environment.

$SHS/mbsd/bundle_files/launch_app.py:
- Updated application search path to a path relative to the bin directory.
- Removed logic for dealing with different application search paths.  The
  relative search path is now the same for both the dev and end-user
  environments.

$SHS/mbsd/bundle_files/terminal/houdini_terminal.applescript.tmpl:
- Updated Houdini Terminal script to find the framework in
  /Applications/Houdini X.Y.ZZZ instead of /Library/Frameworks.

$hqueue/export_shared.sh,
$hqueue/pack_hfs_osx.py:
- Scrapped the pack_hfs_osx.py script since installing a Houdini distro onto
  the HQueue shared folder is just a matter of copying the
  /Applications/Houdini X.Y.ZZZ folder.
- We create a symbolic link from $HQROOT/houdini_distros/hfs.macosx-x86_64 to
  the Resources subdirectory because hfs.macosx-x86_64 must point to $HFS.

$S/package/common.mk,
$S/package/mbsd/Makefile,
$S/package/mbsd/framelist.plist:
- Fixed staging directory so that the Houdini and Python frameworks are
  installed in the same paths that they appear in in the dev environment's
  $HFS.
- Removed steps for changing rpaths in the HARS executable.  The relative
  rpaths that were originally installed into HARS should also work in the
  end-user environment.
- Scrapped the update_framework.py script since the framework is no longer
  installed to /Library/Frameworks and doesn't require updates to the 'Current'
  symlink.
- Scrapped the pack_hfs_osx.py script since it is no longer used by the HQueue
  installer.
- Modified Framework.pkg rule so that the Frameworks directory is the root
  directory instead of Houdini.framework/Versions/Current.
- Scrapped framework.plist.  Added a rule to generate the file on-the-fly.

$SHC/HAPI/*,
$SHK/sesinetd/com.sidefx.sesinetd.plist,
$S/package/mbsd/installer_scripts/load_sesinetd.py,
$S/package/mbsd/installer_scripts/local_licensing.py:
- Updated files to look for the Houdini framework in /Applications/Houdini
  X.Y.ZZZ/Frameworks instead of in /Library/Frameworks.
- Install sesinetd into /Library/SESI/sesinetd so that it is standalone and
  doesn't depend on anything in /Library/Frameworks/Houdini.framework.

$S/package/mbsd/HoudiniUninstaller/*:
- Handle uninstalling both the new standalone sesinetd and the old sesinetd
  that depended on /Library/Frameworks.
- Handle uninstalling old Houdini applications and new self-contained Houdini
  applications.
- Handle updating the Houdini Current framework symlink when uninstalling old
  Houdini applications.

--- cmake/Modules/FindHoudiniEngine.cmake
+++ cmake/Modules/FindHoudiniEngine.cmake
@@ -44,7 +44,7 @@
 #    elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
 #        set( _houdiniengine_root "$ENV{ProgramFiles}/Side\ Effects\ Software/Houdini\ ${HoudiniEngine_FIND_VERSION}/bin" )
 #    elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
-#        set( _houdiniengine_root "/Library/Frameworks/Houdini.framework/Versions/${HoudiniEngine_FIND_VERSION}/Resources" )
+#        set( _houdiniengine_root "/Applications/Houdini ${HoudiniEngine_FIND_VERSION}/Houdini.framework/Versions/Current/Resources" )
 #    endif ()
 endif ()
 if ( _houdiniengine_root )


LLVM_BUILD_32_BITS: Add -m32 with CMAKE_C*_FLAGS. [CMP0056]

With CMP0056, try_compile() uses also CMAKE_EXE_LINKER_FLAG.
It caused mismatch between CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS, to fail to examine CXX_SUPPORTS_CXX11 with -m32.

FYI, before this, try_compile() tries without -m32 regardless of LLVM_BUILD_32_BITS.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -166,7 +166,8 @@
   # TODO: support other platforms and toolchains.
   if( LLVM_BUILD_32_BITS )
     message(STATUS "Building 32 bits executables and libraries.")
-    add_llvm_definitions( -m32 )
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
     set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -m32")


Fixed target path of precompiled headers binary.

--- cmake/modules/PrecompiledHeader.cmake
+++ cmake/modules/PrecompiledHeader.cmake
@@ -87,8 +87,8 @@
   endif()

   if(MSVC)
-    set(_pch_cxx_pch "${CMAKE_CFG_INTDIR}/cxx_${_input_we}.pch")
-    set(_pch_c_pch "${CMAKE_CFG_INTDIR}/c_${_input_we}.pch")
+    set(_pch_cxx_pch "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/cxx_${_input_we}.pch")
+    set(_pch_c_pch "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/c_${_input_we}.pch")

     get_target_property(sources ${_target} SOURCES)
     foreach(_source ${sources})


Fix for ROOT-8068 - File protections for bin/setxrd.* bin/thisroot.*

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -640,12 +640,17 @@
   configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.bat ${thisrootbat} @ONLY)
 endif()

-install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe
-              ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh
+install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.csh
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.sh
               ${thisrootbat}
+              PERMISSIONS OWNER_WRITE OWNER_READ
+                          GROUP_READ
+                          WORLD_READ
+              DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config
               ${CMAKE_SOURCE_DIR}/cmake/scripts/setenvwrap.csh
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/roots


disable -fimplicit-templates on clang #6

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -92,14 +92,15 @@
   )
 ## set_cflags_if_supported_named("-Weffc++" -Weffcpp)

-# must append this because mysql sets -fno-implicit-templates and we need to override it
-check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_-fimplicit-templates)
-if (HAVE_CXX_-fimplicit-templates)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fimplicit-templates")
-endif ()
-
 ## Clang has stricter POD checks.  So, only enable this warning on our other builds (Linux + GCC)
 if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
+  # must append this because mysql sets -fno-implicit-templates and we need to override it
+  # also clang doesn't support it on osx but also doesn't seem to know that
+  check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_-fimplicit-templates)
+  if (HAVE_CXX_-fimplicit-templates)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fimplicit-templates")
+  endif ()
+
   set_cflags_if_supported(
     -Wpacked
     )


Important bug fix

Important bug fix

Without this change, I get problems such as this one:
```
[100%] Linking CXX shared library ../../../../../fips-deploy/Oryolized/emsc-make-debug/simple_shell.js
WARNING:root:output suffix .js requested, but wasm side modules are just wasm files; emitting only a .wasm, no .js
```

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -141,7 +141,7 @@
 if (FIPS_EMSCRIPTEN_USE_WASM)
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=1 -s \"BINARYEN_METHOD='native-wasm'\"")
 else()
-    set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} -s WASM=0 -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")
+    set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS_RELEASE} -s WASM=0 -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")
 endif()
 if (FIPS_EMSCRIPTEN_USE_CLOSURE)
     set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --closure 1")


FMUv4: Enable RC lib

FMUv4: Enable RC lib

--- cmake/configs/nuttx_px4fmu-v4_default.cmake
+++ cmake/configs/nuttx_px4fmu-v4_default.cmake
@@ -109,6 +109,7 @@
 	#lib/mathlib/CMSIS
 	lib/mathlib
 	lib/mathlib/math/filter
+	lib/rc
 	lib/ecl
 	lib/external_lgpl
 	lib/geo


Fix for ROOT-8792 - Compilation with builtin XRootD fails with GCC 7

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -3,7 +3,6 @@
 include(FindPackageHandleStandardArgs)

 set(lcgpackages http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources)
-set(repository_tarfiles http://service-spi.web.cern.ch/service-spi/external/tarFiles)

 #---On MacOSX, try to find frameworks after standard libraries or headers------------
 set(CMAKE_FIND_FRAMEWORK LAST)
@@ -404,7 +403,7 @@
     ExternalProject_Add(
       GSL
       # http://mirror.switch.ch/ftp/mirror/gnu/gsl/gsl-${gsl_version}.tar.gz
-      URL ${repository_tarfiles}/gsl-${gsl_version}.tar.gz
+      URL ${lcgpackages}/gsl-${gsl_version}.tar.gz
       INSTALL_DIR ${CMAKE_BINARY_DIR}
       CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR>
                         --libdir=<INSTALL_DIR>/lib
@@ -594,7 +593,7 @@
     set(OPENSSL_LIBRARIES ${CMAKE_BINARY_DIR}/OPENSSL-prefix/lib/libssl.a ${CMAKE_BINARY_DIR}/OPENSSL-prefix/lib/libcrypto.a)
     ExternalProject_Add(
       OPENSSL
-      URL ${repository_tarfiles}/openssl-${openssl_version}.tar.gz
+      URL ${lcgpackages}/openssl-${openssl_version}.tar.gz
       CONFIGURE_COMMAND ${openssl_config_cmd} no-shared --prefix=<INSTALL_DIR>
       BUILD_COMMAND make -j1 CC=${CMAKE_C_COMPILER}\ -fPIC
       INSTALL_COMMAND make install_sw
@@ -770,7 +769,7 @@
   set(FFTW_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libfftw3.a)
   ExternalProject_Add(
     FFTW3
-    URL ${repository_tarfiles}/fftw-${FFTW_VERSION}.tar.gz
+    URL ${lcgpackages}/fftw-${FFTW_VERSION}.tar.gz
     INSTALL_DIR ${CMAKE_BINARY_DIR}
     CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR>
     BUILD_COMMAND make CFLAGS=-fPIC
@@ -793,7 +792,7 @@
     ExternalProject_Add(
       CFITSIO
       # ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio${cfitsio_version_no_dots}.tar.gz
-      URL ${repository_tarfiles}/cfitsio${cfitsio_version_no_dots}.tar.gz
+      URL ${lcgpackages}/cfitsio${cfitsio_version_no_dots}.tar.gz
       INSTALL_DIR ${CMAKE_BINARY_DIR}
       CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR>
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
@@ -856,7 +855,7 @@
   endif()
 endif()
 if(builtin_xrootd)
-  set(xrootd_version 4.3.0)
+  set(xrootd_version 4.6.1)
   set(xrootd_versionnum 400030000)
   message(STATUS "Downloading and building XROOTD version ${xrootd_version}")
   string(REPLACE "-Wall " "" __cxxflags "${CMAKE_CXX_FLAGS}")  # Otherwise it produces many warnings
@@ -868,7 +867,7 @@
   ExternalProject_Add(
     XROOTD
     # http://xrootd.org/download/v${xrootd_version}/xrootd-${xrootd_version}.tar.gz
-    URL ${repository_tarfiles}/xrootd-${xrootd_version}.tar.gz
+    URL ${lcgpackages}/xrootd-${xrootd_version}.tar.gz
     INSTALL_DIR ${CMAKE_BINARY_DIR}
     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
                -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
@@ -1087,7 +1086,7 @@
     ExternalProject_Add(
       DAVIX
       # http://grid-deployment.web.cern.ch/grid-deployment/dms/lcgutil/tar/davix/davix-embedded-${DAVIX_VERSION}.tar.gz
-      URL ${repository_tarfiles}/davix-embedded-${DAVIX_VERSION}.tar.gz
+      URL ${lcgpackages}/davix-embedded-${DAVIX_VERSION}.tar.gz
       PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/cmake/patches/davix-${DAVIX_VERSION}.patch
       CMAKE_CACHE_ARGS -DCMAKE_PREFIX_PATH:STRING=${OPENSSL_PREFIX}
       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
@@ -1171,12 +1170,12 @@
   endif()
 endif()
 if(builtin_tbb)
-  set(tbb_version 2017_20170226)
+  set(tbb_version 2017_U5)
   ROOT_ADD_CXX_FLAG(_tbb_cxxflags -mno-rtm)
   set(TBB_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libtbb${CMAKE_SHARED_LIBRARY_SUFFIX})
   ExternalProject_Add(
     TBB
-    URL ${repository_tarfiles}/tbb${tbb_version}oss_src.tgz
+    URL ${lcgpackages}/tbb${tbb_version}.tar.gz
     INSTALL_DIR ${CMAKE_BINARY_DIR}
     CONFIGURE_COMMAND ""
     BUILD_COMMAND make CXXFLAGS=${_tbb_cxxflags} CPLUS=${CMAKE_CXX_COMPILER} CONLY=${CMAKE_C_COMPILER}
@@ -1433,7 +1432,7 @@
     set(VDT_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}vdt${CMAKE_SHARED_LIBRARY_SUFFIX})
     ExternalProject_Add(
       VDT
-      URL ${repository_tarfiles}/vdt-${vdt_version}.tar.gz
+      URL ${lcgpackages}/vdt-${vdt_version}.tar.gz
       INSTALL_DIR ${CMAKE_BINARY_DIR}
       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1


Revert "Disable ssl option rather than enabling builtin_openssl by default"

This reverts commit d7b7eb83251f49105e444a9c154d2612b463e0f8.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -599,16 +599,18 @@
   else()
     find_package(OpenSSL)
     if(NOT OPENSSL_FOUND)
-      message(STATUS "Switching OFF 'ssl' option.")
-      set(ssl OFF CACHE BOOL "" FORCE)
+      if(WIN32) # builtin OpenSSL does not work on Windows
+        message(STATUS "Switching OFF 'ssl' option.")
+        set(ssl OFF CACHE BOOL "" FORCE)
+      else()
+        message(STATUS "OpenSSL not found, switching ON 'builtin_openssl' option.")
+        set(builtin_openssl ON CACHE BOOL "" FORCE)
+      endif()
     endif()
   endif()
 endif()

 if(builtin_openssl)
-  if(WIN32)
-    message(FATAL_ERROR "The builtin OpenSSL in ROOT is not supported on Windows.")
-  endif()
   list(APPEND ROOT_BUILTINS OpenSSL)
   add_subdirectory(builtins/openssl)
 endif()


Linux autobuild fix: Remove extra include and added missing include directories.

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -338,8 +338,9 @@

 else (STANDALONE)
   set(${ARCH}_linux_INCLUDES
-      ELFIO
       atk-1.0
+      cairo
+      freetype
       glib-2.0
       gstreamer-0.10
       gtk-2.0


Updated FindPython.cmake to work when variables are set to not found.

--- CMake/Modules/FindPython.cmake
+++ CMake/Modules/FindPython.cmake
@@ -10,6 +10,10 @@
 	NAMES python3.0m python3.1 python3.2 python3.4 python3.5 python3.6 python3.7 python3.8 python3.0m python3.1m python3.2m python3.4m python3.5m python3.6m python3.7m python3.8m python3.0m python3.1d python3.2d python3.4d python3.5d python3.6d python3.7d python3.8d python3.0m python3.1u python3.2u python3.4u python3.5u python3.6u python3.7u python3.8u
 	PATH_SUFFIXES lib lib32 lib64
 )
+IF(("${PYTHON_INCLUDES}" MATCHES "PYTHON_INCLUDES-NOTFOUND") OR ("${PYTHON_LIBRARIES}" MATCHES "PYTHON_LIBRARIES-NOTFOUND"))
+	UNSET(PYTHON_INCLUDES CACHE)
+	UNSET(PYTHON_LIBRARIES CACHE)
+ENDIF(("${PYTHON_INCLUDES}" MATCHES "PYTHON_INCLUDES-NOTFOUND") OR ("${PYTHON_LIBRARIES}" MATCHES "PYTHON_LIBRARIES-NOTFOUND"))
 IF((NOT DEFINED PYTHON_INCLUDES) OR (NOT DEFINED PYTHON_LIBRARIES))
 	UNSET(PYTHON_INCLUDES CACHE)
 	UNSET(PYTHON_LIBRARIES CACHE)