Add support for Cython API and public generated headers to UseCython.cmake.

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -110,8 +110,16 @@
       endif()
   endif()

-  # Determining generated file name.
-  set( _generated_files "${_name}.${extension}" )
+  # Determining generated file names.
+  get_source_file_property( property_is_public ${pyx_file} CYTHON_PUBLIC )
+  get_source_file_property( property_is_api ${pyx_file} CYTHON_API )
+  if( ${property_is_api} )
+      set( _generated_files "${_name}.${extension}" "${_name}.h" "${name}_api.h")
+  elseif( ${property_is_public} )
+      set( _generated_files "${_name}.${extension}" "${_name}.h")
+  else()
+      set( _generated_files "${_name}.${extension}")
+  endif()
   set_source_files_properties( ${_generated_files} PROPERTIES GENERATED TRUE )
   set( ${generated_files} ${_generated_files} PARENT_SCOPE )


[cmake] fix precompiled headers on MacOS (add -F and -isysroot)

--- cmake/axl_utils.cmake
+++ cmake/axl_utils.cmake
@@ -540,11 +540,15 @@
 	)

     set (_ARG_LIST ${ARGN})
-	string (STRIP ${_PREFIX} _PREFIX)

 	foreach (_ARG ${_ARG_LIST})
 		if (_ARG)
-			list (APPEND ${_FLAGS} "${_PREFIX}${_ARG}")
+			if (${_PREFIX} STREQUAL "-I" AND ${_ARG} MATCHES "\\.framework/?$")
+            	string(REGEX REPLACE "/[^/]+\\.framework" "" _FRAMEWORK "${_ARG}")
+				list (APPEND ${_FLAGS} "-F${_FRAMEWORK}")
+  			else ()
+				list (APPEND ${_FLAGS} "${_PREFIX}${_ARG}")
+			endif ()
 		endif ()
 	endforeach ()
 endmacro ()
@@ -627,6 +631,17 @@
 			"-D"
 			${_DIR_FLAGS}
 			${_TARGET_FLAGS}
+			)
+	endif ()
+
+	# add -isysroot on MacOS
+
+	if (APPLE AND NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
+		list (
+			APPEND
+			_COMPILE_FLAGS
+			"-isysroot"
+			"${CMAKE_OSX_SYSROOT}"
 			)
 	endif ()

@@ -871,8 +886,6 @@
 axl_chain_include
     _FILE_NAME
 	)
-
-    message ("axl_chain_include CMAKE_CURRENT_LIST_DIR = ${CMAKE_CURRENT_LIST_DIR}")

 	axl_find_file_recurse_parent_dirs (_FILE_PATH ${_FILE_NAME} ${CMAKE_CURRENT_LIST_DIR}/..)


Fixed comment

Fixed comment

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -170,7 +170,7 @@
   check_symbol_exists(siglongjmp setjmp.h HAVE_SIGLONGJMP)
   check_symbol_exists(sigsetjmp setjmp.h HAVE_SIGSETJMP)
 endif()
-// AddressSanitizer conflicts with lib/Support/Unix/Signals.inc
+# AddressSanitizer conflicts with lib/Support/Unix/Signals.inc
 if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*")
   check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK)
 endif()


[CMake] Make simple source used for CMake checks a C file

The source being compiled is plain C, but using .cc extension forces it
to be compiled as C++ which requires a working C++ compiler including
C++ library which may not be the case when we're building compiler-rt
together with libcxx as part of runtimes build.

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

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -125,7 +125,7 @@
 # platform. We use the results of these tests to build only the various target
 # runtime libraries supported by our current compilers cross-compiling
 # abilities.
-set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc)
+set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.c)
 file(WRITE ${SIMPLE_SOURCE} "#include <stdlib.h>\n#include <stdio.h>\nint main() { printf(\"hello, world\"); }\n")

 # Detect whether the current target platform is 32-bit or 64-bit, and setup


Try to fix the libcxx build with mingw64

Summary:
mingw64 has lots of default libs that libc++ and its test programs
should link against.

With this patch, cmake now runs successfully with GCC on Windows.

Reviewers: mati865, EricWF

Subscribers: mgorny, cfe-commits

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

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@299144 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -35,6 +35,11 @@
   elseif (LIBCXX_HAS_GCC_S_LIB)
     list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
   endif ()
+  if (MINGW)
+    # Mingw64 requires quite a few "C" runtime libraries in order for basic
+    # programs to link successfully with -nodefaultlibs.
+    list(APPEND CMAKE_REQUIRED_LIBRARIES mingw32 gcc gcc_eh mingwex msvcrt gcc)
+  endif()
   if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
     set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
   endif ()


MDEV-4646 No mysqld-debug or debuginfo in MariaDB-Server RPM

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -32,6 +32,7 @@
   SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
 ELSE()
   SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
+  SET(CPACK_RPM_DEBUGINFO_PACKAGE ON)
 ENDIF()

 SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")


Added the required CPACK_BUNDLE_NAME for OS X bundles from CPack

--- cmake/packaging.cmake
+++ cmake/packaging.cmake
@@ -7,4 +7,5 @@
 set(CPACK_PACKAGE_VERSION_PATCH "${TABLE_PATCH_VERSION}")
 set(CPACK_PACKAGE_VERSION "${TABLE_VERSION}")
 set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
+set(CPACK_BUNDLE_NAME "libtable")
 include(CPack)


Revert: r519 partially: don't configure 3rdparty/*/*.in

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

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -7,51 +7,23 @@
 find_program(RPM_PROGRAM rpm)
 if(EXISTS ${RPM_PROGRAM})
   list(APPEND CPACK_GENERATOR "RPM")
-  list(APPEND PACKAGE_EXTENSION ".rpm")
 endif(EXISTS ${RPM_PROGRAM})
 # DEB
 find_program(DPKG_PROGRAM dpkg)
 if(EXISTS ${DPKG_PROGRAM})
   list(APPEND CPACK_GENERATOR "DEB")
-  list(APPEND PACKAGE_EXTENSION ".deb")
 endif(EXISTS ${DPKG_PROGRAM})
 # NSIS
 find_program(NSIS_PROGRAM makensis MakeNSIS)
 if(EXISTS ${NSIS_PROGRAM})
   list(APPEND CPACK_GENERATOR "NSIS")
-  list(APPEND PACKAGE_EXTENSION ".exe;")
 endif(EXISTS ${NSIS_PROGRAM})
 # dpkg
 find_program(PACKAGE_MAKER_PROGRAM PackageMaker
 	    HINTS /Developer/Applications/Utilities)
 if(EXISTS ${PACKAGE_MAKER_PROGRAM})
   list(APPEND CPACK_GENERATOR "PackageMaker")
-  list(APPEND PACKAGE_EXTENSION ".dmg;")
 endif(EXISTS ${PACKAGE_MAKER_PROGRAM})
-
-list(LENGTH PACKAGE_EXTENSION nb_extensions)
-if(nb_extensions GREATER 0)
-  list(GET PACKAGE_EXTENSION 0 ext)
-  set(COPY_PACKAGE_COMMAND "cp *${ext} ../../")
-  math(EXPR before_last "${nb_extensions} - 1")
-  if(${before_last} GREATER 0)
-    foreach(ext RANGE 1 ${before_last})
-      list(GET PACKAGE_EXTENSION ${ext} ext_name)
-      set(COPY_PACKAGE_COMMAND "${COPY_PACKAGE_COMMAND} && \\
-  cp *${ext_name} ../../")
-    endforeach(ext)
-  endif(${before_last} GREATER 0)
-
-  #now configure all the 3rdpaty Makefile
-  file(GLOB parties ${PCL_SOURCE_DIR}/3rdparty/*)
-  foreach(party ${parties})
-    if(EXISTS ${party}/Makefile.in)
-      configure_file(${party}/Makefile.in ${party}/Makefile @ONLY)
-      configure_file(${party}/cpack.patch.in ${party}/cpack.patch @ONLY)
-    endif(EXISTS ${party}/Makefile.in)
-  endforeach(party)
-endif(nb_extensions GREATER 0)
-

 include(InstallRequiredSystemLibraries)


Fix CPack for Documents

Fix CPack for Documents

BUILD_documentation option is already deprecated.

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -85,12 +85,12 @@
     PCL_CPACK_MAKE_COMPS_OPTS(PCL_CPACK_COMPONENTS "${_comps}")

     # add documentation
-    if(BUILD_documentation)
+    if(WITH_DOCS)
         set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL} doc")
         set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_DOC_GROUP \"PCL\")\n")
         set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_DOC_DISPLAY_NAME \"Documentation\")\n")
         set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_DOC_DESCRIPTION \"API documentation and tutorials\")\n")
-    endif(BUILD_documentation)
+    endif(WITH_DOCS)
     # add PCLConfig
     set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL} pclconfig")
     set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_PCLCONFIG_GROUP \"PCL\")\n")


COMP: Bump Slicer version to integrate latest SlicerExecutionModel

By default, Slicer uses SlicerExecutionModel's FindJsonCpp which was
lacking behind TubeTK's. The SlicerExecutionModel's FindJsonCpp was updated
and Slicer pulls the latest version of the SlicerExecutionModel.

--- CMake/Superbuild/External_Slicer.cmake
+++ CMake/Superbuild/External_Slicer.cmake
@@ -80,7 +80,7 @@
     set(${proj}_SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj})
     list(APPEND ${proj}_EP_ARGS
       GIT_REPOSITORY "${git_protocol}://github.com/Slicer/Slicer.git"
-      GIT_TAG "ac265f6c8ab75d97525ca52bb62cff4a6b066c86"
+      GIT_TAG "297b145ecffbf84695d933b9056a27e0fc219ef3"
       )
   endif()


COMP: Set CMake policies only if they exist in used CMake version.

--- CMakeExternals/PatchSOFA-386a3a7.cmake
+++ CMakeExternals/PatchSOFA-386a3a7.cmake
@@ -102,9 +102,17 @@

 # Set CMake policies to prevent configure warnings

-string(REPLACE "set(SOLUTION_NAME" "cmake_policy(SET CMP0039 OLD)
-cmake_policy(SET CMP0043 OLD)
-cmake_policy(SET CMP0054 OLD)
+string(REPLACE "set(SOLUTION_NAME" "if(POLICY CMP0039)
+  cmake_policy(SET CMP0039 OLD)
+endif()
+
+if(POLICY CMP0043)
+  cmake_policy(SET CMP0043 OLD)
+  endif()
+
+if(POLICY CMP0054)
+  cmake_policy(SET CMP0054 OLD)
+endif()

 set(SOLUTION_NAME"
 CONTENTS ${CONTENTS})


Fix typo in FindMediaFoundation.cmake

Fix typo in FindMediaFoundation.cmake

--- CMakeModules/FindMediaFoundation.cmake
+++ CMakeModules/FindMediaFoundation.cmake
@@ -12,7 +12,7 @@
 IF (MediaFoundation_FOUND)
   IF (NOT MediaFoundation_FIND_QUIETLY)
     MESSAGE(STATUS "Found MediaFoundation: ${MediaFoundation_LIBRARIES}")
-  ENDIF (NOT MediaFoundation FIND_QUIETLY)
+  ENDIF (NOT MediaFoundation_FIND_QUIETLY)
 ELSE (MediaFoundation_FOUND)
   IF (MediaFoundation_FIND_REQUIRED)
     MESSAGE(FATAL_ERROR "Could not find MediaFoundation")


BUG: Update JsonCPP External Project to use URL instead of SVN

--- CMake/Superbuild/External_JsonCpp.cmake
+++ CMake/Superbuild/External_JsonCpp.cmake
@@ -60,8 +60,8 @@
   set( ${proj}_DIR ${CMAKE_BINARY_DIR}/${proj}-build )

   ExternalProject_Add( ${proj}
-    SVN_REPOSITORY ${${proj}_URL}
-    SVN_REVISION -r ${${proj}_HASH_OR_TAG}
+    URL ${${proj}_URL}
+    URL_MD5 ${${proj}_HASH_OR_TAG}
     DOWNLOAD_DIR ${${proj}_SOURCE_DIR}
     SOURCE_DIR ${${proj}_SOURCE_DIR}
     BINARY_DIR ${${proj}_DIR}


xmllint seems to be completely unused, at least I couldn't find any users of it

Alex

svn path=/trunk/KDE/kdenetwork/kopete/; revision=835493

--- config-kopete.h.cmake
+++ config-kopete.h.cmake
@@ -19,9 +19,6 @@

 /* Define to 1 if you want IDN support. */
 #define LIBIDN 1
-
-/* Defines the executable of xmllint */
-#define XMLLINT "/usr/bin/xmllint"

 /* Jingle support is enabled */
 /* #undef SUPPORT_JINGLE */


SuperBuild: update cmake macro: superbuild_patch_source

--- SuperBuild/CMake/SuperBuild_Macro.cmake
+++ SuperBuild/CMake/SuperBuild_Macro.cmake
@@ -131,18 +131,8 @@
 endmacro(ADD_SUPERBUILD_CONFIGURE_VAR)

 macro(SUPERBUILD_PATCH_SOURCE project external_project_step_name)
-  set (extra_args ${ARGN})
-  # Did we get any optional args?
-  list(LENGTH extra_args num_extra_args)
-  if (${num_extra_args} GREATER 0)
-    list(GET extra_args 0 patch_dir_arg)
-    #if there is third argument set is as ${project}_PATCH_DIR
-    set(${project}_PATCH_DIR ${patch_dir_arg})
-  else()
-    #default value
-    set(${project}_PATCH_DIR ${CMAKE_SOURCE_DIR}/patches/${project})
-  endif()
-
+  set(${project}_PATCH_DIR ${CMAKE_SOURCE_DIR}/patches/${project})
+  string(TOLOWER ${project} project_)
   if(WIN32)
     set(DIFF_FILE_MATCH_STRING "win")
   else()
@@ -152,9 +142,10 @@
       set(DIFF_FILE_MATCH_STRING "linux")
     endif()
   endif() #WIN32
-  file(GLOB files_list "${PATCH_DIR}/*${DIFF_FILE_MATCH_STRING}*diff")
+  file(GLOB files_list "${${project}_PATCH_DIR}/${project_}*${DIFF_FILE_MATCH_STRING}*diff")
   if(files_list)
-    ExternalProject_Add_Step(${project} ${external_project_step_name}
+    message(STATUS "  Custom patches required for ${project}")
+    ExternalProject_Add_Step(${project} ${project}_custom_patch
       COMMAND
       ${CMAKE_COMMAND}
       -DSOURCE_DIR=${${project}_SB_SRC}
@@ -164,5 +155,4 @@
       DEPENDEES patch update
       DEPENDERS configure
       )
-  endif()
 endmacro(SUPERBUILD_PATCH_SOURCE)


Fix variadic template handling with -std=c++0x in gcc

--- cmake/CheckCXX11Features.cmake
+++ cmake/CheckCXX11Features.cmake
@@ -75,7 +75,13 @@
         set(CXX11_COMPILER_FLAGS "-std=c++11")
     endif ()
 elseif (_HAS_CXX0X_FLAG)
-    set(CXX11_COMPILER_FLAGS "-std=c++0x")
+    # to avoid problems with variadic template handling in gcc 4.6.3
+    # with -std=c++0x mode in gmock-matchers.h
+    # error: unimplemented: cannot expand ‘Tail ...’ into a fixed-length argument list
+    # TODO: check if there's a version
+    IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.6.3")
+        set(CXX11_COMPILER_FLAGS "-std=c++0x")
+    ENDIF()
 endif ()

 function(cxx11_check_feature FEATURE_NAME RESULT_VAR)


Propeller Build System Operational

Propeller Build System Operational

--- cmake/platform/Propeller.cmake
+++ cmake/platform/Propeller.cmake
@@ -21,92 +21,120 @@
 # C Flags ######################################################################

 set(PROPELLER_C_FLAGS
-"-ffunction-sections -fdata-sections -m32bit-doubles -mfcache")
+"-ffunction-sections -fdata-sections -m32bit-doubles -mfcache"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_C_FLAGS
-"-Os ${PROPELLER_C_FLAGS} -std=c99") # removed -g
+"-Os ${PROPELLER_C_FLAGS} -std=c99" # removed -g
+CACHE INTERNAL "" FORCE)

 set(CMAKE_C_FLAGS_DEBUG
-"-g ${PROPELLER_C_FLAGS} -std=c99")
+"-g ${PROPELLER_C_FLAGS} -std=c99"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_C_FLAGS_MINSIZEREL
-"-Os -DNDEBUG ${PROPELLER_C_FLAGS} -std=c99")
+"-Os -DNDEBUG ${PROPELLER_C_FLAGS} -std=c99"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_C_FLAGS_RELEASE
-"-Os -DNDEBUG -w ${PROPELLER_C_FLAGS} -std=c99")
+"-Os -DNDEBUG -w ${PROPELLER_C_FLAGS} -std=c99"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_C_FLAGS_RELWITHDEBINFO
-"-Os -g -w ${PROPELLER_C_FLAGS} -std=c99")
+"-Os -g -w ${PROPELLER_C_FLAGS} -std=c99"
+CACHE INTERNAL "" FORCE)

 # C++ Flags ####################################################################

 set(PROPELLER_CXX_FLAGS
-"${PROPELLER_C_FLAGS} -fno-exceptions -fno-rtti")
+"${PROPELLER_C_FLAGS} -fno-exceptions -fno-rtti"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_CXX_FLAGS
-"-Os ${PROPELLER_CXX_FLAGS} -std=gnu++0x") # removed -g
+"-Os ${PROPELLER_CXX_FLAGS} -std=gnu++0x" # removed -g
+CACHE INTERNAL "" FORCE)

 set(CMAKE_CXX_FLAGS_DEBUG
-"-g ${PROPELLER_CXX_FLAGS} -std=gnu++0x")
+"-g ${PROPELLER_CXX_FLAGS} -std=gnu++0x"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_CXX_FLAGS_MINSIZEREL
-"-Os -DNDEBUG ${PROPELLER_CXX_FLAGS} -std=gnu++0x")
+"-Os -DNDEBUG ${PROPELLER_CXX_FLAGS} -std=gnu++0x"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_CXX_FLAGS_RELEASE
-"-Os -DNDEBUG ${PROPELLER_CXX_FLAGS} -std=gnu++0x")
+"-Os -DNDEBUG ${PROPELLER_CXX_FLAGS} -std=gnu++0x"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
-"-Os -g ${PROPELLER_CXX_FLAGS} -std=gnu++0x")
+"-Os -g ${PROPELLER_CXX_FLAGS} -std=gnu++0x"
+CACHE INTERNAL "" FORCE)

 # Linker Flags #################################################################

 set(PROPELLER_LINKER_FLAGS
-"-Wl,--gc-sections -lm -lpthread -ltiny")
+"-Wl,--gc-sections -lm -lpthread -ltiny"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_EXE_LINKER_FLAGS
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_EXE_LINKER_FLAGS_DEBUG
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_EXE_LINKER_FLAGS_RELEASE
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_SHARED_LINKER_FLAGS
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_SHARED_LINKER_FLAGS_DEBUG
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_SHARED_LINKER_FLAGS_RELEASE
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_MODULE_LINKER_FLAGS
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_MODULE_LINKER_FLAGS_DEBUG
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_MODULE_LINKER_FLAGS_RELEASE
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

 set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
-"${PROPELLER_LINKER_FLAGS}")
+"${PROPELLER_LINKER_FLAGS}"
+CACHE INTERNAL "" FORCE)

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

@@ -543,6 +571,8 @@
 ################################################################################
 # parse_file_or_folder_path() - Gets source paths from a file or folder path.
 #
+# PARENT VAR = NO_RECURSE - Don't search folder recursively for code.
+#
 # INPUT = FF_PATH - Full path to input file or folder path.
 # OUTPUT = FF_PATH_SOURCES - Source file list.
 # OUTPUT = FF_PATH_HEADERS - Header file list.
@@ -570,8 +600,16 @@

         else()

-            file(GLOB_RECURSE SIDE_FILES
-            "${FF_PATH}/*.side")
+            if(NOT DEFINED NO_RECURSE)
+                file(GLOB_RECURSE SIDE_FILES
+                "${FF_PATH}/*.side")
+            else()
+                file(GLOB SIDE_FILES
+                "${FF_PATH}/*.side")
+                file(GLOB SIDE_FILES_2
+                "${FF_PATH}/utility/*.side")
+                list(APPEND SIDE_FILES ${SIDE_FILES_2})
+            endif()

             foreach(SIDE_FILE ${SIDE_FILES})

@@ -585,9 +623,19 @@

             endforeach()

-            file(GLOB_RECURSE COGC_FILES
-            "${FF_PATH}/*.cogc"
-            "${FF_PATH}/*.cogcpp")
+            if(NOT DEFINED NO_RECURSE)
+                file(GLOB_RECURSE COGC_FILES
+                "${FF_PATH}/*.cogc"
+                "${FF_PATH}/*.cogcpp")
+            else()
+                file(GLOB COGC_FILES
+                "${FF_PATH}/*.cogc"
+                "${FF_PATH}/*.cogcpp")
+                file(GLOB COGC_FILES_2
+                "${FF_PATH}/utility/*.cogc"
+                "${FF_PATH}/utility/*.cogcpp")
+                list(APPEND COGC_FILES ${COGC_FILES_2})
+            endif()

             foreach(COGC_FILE ${COGC_FILES})

@@ -599,8 +647,16 @@

             endforeach()

-            file(GLOB_RECURSE SPIN_FILES
-            "${FF_PATH}/*.spin")
+            if(NOT DEFINED NO_RECURSE)
+                file(GLOB_RECURSE SPIN_FILES
+                "${FF_PATH}/*.spin")
+            else()
+                file(GLOB SPIN_FILES
+                "${FF_PATH}/*.spin")
+                file(GLOB SPIN_FILES_2
+                "${FF_PATH}/utility/*.spin")
+                list(APPEND SPIN_FILES ${SPIN_FILES_2})
+            endif()

             foreach(SPIN_FILE ${SPIN_FILES})

@@ -612,39 +668,87 @@

             endforeach()

-            file(GLOB_RECURSE SOURCE_FILES
-            "${FF_PATH}/*.c"
-            "${FF_PATH}/*.i"
-            "${FF_PATH}/*.cpp"
-            "${FF_PATH}/*.ii"
-            "${FF_PATH}/*.cc"
-            "${FF_PATH}/*.cp"
-            "${FF_PATH}/*.cxx"
-            "${FF_PATH}/*.c++"
-            "${FF_PATH}/*.s"
-            "${FF_PATH}/*.sx")
+            if(NOT DEFINED NO_RECURSE)
+                file(GLOB_RECURSE SOURCE_FILES
+                "${FF_PATH}/*.c"
+                "${FF_PATH}/*.i"
+                "${FF_PATH}/*.cpp"
+                "${FF_PATH}/*.ii"
+                "${FF_PATH}/*.cc"
+                "${FF_PATH}/*.cp"
+                "${FF_PATH}/*.cxx"
+                "${FF_PATH}/*.c++"
+                "${FF_PATH}/*.s"
+                "${FF_PATH}/*.sx")
+            else()
+                file(GLOB SOURCE_FILES
+                "${FF_PATH}/*.c"
+                "${FF_PATH}/*.i"
+                "${FF_PATH}/*.cpp"
+                "${FF_PATH}/*.ii"
+                "${FF_PATH}/*.cc"
+                "${FF_PATH}/*.cp"
+                "${FF_PATH}/*.cxx"
+                "${FF_PATH}/*.c++"
+                "${FF_PATH}/*.s"
+                "${FF_PATH}/*.sx")
+                file(GLOB SOURCE_FILES_2
+                "${FF_PATH}/utility/*.c"
+                "${FF_PATH}/utility/*.i"
+                "${FF_PATH}/utility/*.cpp"
+                "${FF_PATH}/utility/*.ii"
+                "${FF_PATH}/utility/*.cc"
+                "${FF_PATH}/utility/*.cp"
+                "${FF_PATH}/utility/*.cxx"
+                "${FF_PATH}/utility/*.c++"
+                "${FF_PATH}/utility/*.s"
+                "${FF_PATH}/utility/*.sx")
+                list(APPEND SOURCE_FILES ${SOURCE_FILES_2})
+            endif()

             foreach(SOURCE_FILE ${SOURCE_FILES})
+
                 get_filename_component(FILE_D "${SOURCE_FILE}" DIRECTORY)
                 list(APPEND FF_PATH_FOLDER_LIST "${FILE_D}")
+
+                list(APPEND FF_PATH_SOURCE_LIST "${SOURCE_FILE}")
+
             endforeach()

-            list(APPEND FF_PATH_SOURCE_LIST ${SOURCE_FILES})
-
-            file(GLOB_RECURSE HEADER_FILES
-            "${FF_PATH}/*.h"
-            "${FF_PATH}/*.hpp"
-            "${FF_PATH}/*.hh"
-            "${FF_PATH}/*.hp"
-            "${FF_PATH}/*.hxx"
-            "${FF_PATH}/*.h++")
+            if(NOT DEFINED NO_RECURSE)
+                file(GLOB_RECURSE HEADER_FILES
+                "${FF_PATH}/*.h"
+                "${FF_PATH}/*.hpp"
+                "${FF_PATH}/*.hh"
+                "${FF_PATH}/*.hp"
+                "${FF_PATH}/*.hxx"
+                "${FF_PATH}/*.h++")
+            else()
+                file(GLOB HEADER_FILES
+                "${FF_PATH}/*.h"
+                "${FF_PATH}/*.hpp"
+                "${FF_PATH}/*.hh"
+                "${FF_PATH}/*.hp"
+                "${FF_PATH}/*.hxx"
+                "${FF_PATH}/*.h++")
+                file(GLOB HEADER_FILES_2
+                "${FF_PATH}/utility/*.h"
+                "${FF_PATH}/utility/*.hpp"
+                "${FF_PATH}/utility/*.hh"
+                "${FF_PATH}/utility/*.hp"
+                "${FF_PATH}/utility/*.hxx"
+                "${FF_PATH}/utility/*.h++")
+                list(APPEND HEADER_FILES ${HEADER_FILES_2})
+            endif()

             foreach(HEADER_FILE ${HEADER_FILES})
+
                 get_filename_component(FILE_D "${HEADER_FILE}" DIRECTORY)
                 list(APPEND FF_PATH_FOLDER_LIST "${FILE_D}")
+
+                list(APPEND FF_PATH_HEADER_LIST "${HEADER_FILE}")
+
             endforeach()
-
-            list(APPEND FF_PATH_HEADER_LIST ${HEADER_FILES})

         endif()

@@ -705,6 +809,8 @@
 ################################################################################
 # setup_library() - Setup a library to be built.
 #
+# PARENT VAR = NO_RECURSE - Don't search folder recursively for code.
+#
 # INPUT = FF_PATH - Full path to library project file or folder.
 # INPUT = EXTRA_COMPILE_FLAGS - Extra compile flags for the library.
 # INPUT = EXTRA_LINK_FLAGS - Extra link flags for the library.
@@ -727,8 +833,8 @@
             add_library("${FF_PATH_NAME}" STATIC ${FF_PATH_SOURCES})

             set_target_properties("${FF_PATH_NAME}" PROPERTIES
-            COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} ${COMPILE_FLAGS}"
-            LINK_FLAGS "${EXTRA_LINK_FLAGS} ${LINK_FLAGS}"
+            COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS}"
+            LINK_FLAGS "${EXTRA_LINK_FLAGS}"
             SUFFIX ".a")

             set(LIB_TARGET "${FF_PATH_NAME}" PARENT_SCOPE)
@@ -768,8 +874,8 @@
             add_executable("${FF_PATH_NAME}" ${FF_PATH_SOURCES})

             set_target_properties("${FF_PATH_NAME}" PROPERTIES
-            COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} ${COMPILE_FLAGS}"
-            LINK_FLAGS "${EXTRA_LINK_FLAGS} ${LINK_FLAGS}"
+            COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS}"
+            LINK_FLAGS "${EXTRA_LINK_FLAGS}"
             SUFFIX ".elf")

             set(EXE_TARGET "${FF_PATH_NAME}" PARENT_SCOPE)
@@ -939,9 +1045,13 @@

     foreach(LIBRARY_PATH ${LIBRARY_PATH_LIST})

+        set(NO_RECURSE NO_RECURSE)
+
         setup_library("${LIBRARY_PATH}"
         "${EXTRA_COMPILE_FLAGS}"
         "${EXTRA_LINK_FLAGS}")
+
+        unset(NO_RECURSE)

         if(LIB_TARGET)
             list(APPEND LIB_TARGET_LIST "${LIB_TARGET}")
@@ -995,6 +1105,7 @@
             foreach(LIBRARY ${LIBRARIES})

                 get_filename_component(LIB_PATH "${LIBRARY}" DIRECTORY)
+
                 list(APPEND LIBRARY_PATH_LIST
                 "-I" "${LIB_PATH}")

@@ -1063,6 +1174,7 @@
             foreach(LIBRARY ${LIBRARIES})

                 get_filename_component(LIB_PATH "${LIBRARY}" DIRECTORY)
+
                 list(APPEND LIBRARY_PATH_LIST
                 "-I" "${LIB_PATH}")

@@ -1091,6 +1203,18 @@

 ################################################################################
 # generate_propeller_firmware() - Main Function.
+#
+# PARENT VAR = C_COMPILE_FLAGS_TO_ADD - C compile flags to add (list)
+# PARENT VAR = C_COMPILE_FLAGS_TO_REMOVE - C compile flags to remove (list)
+#
+# PARENT VAR = CXX_COMPILE_FLAGS_TO_ADD - C++ compile flags to add (list)
+# PARENT VAR = CXX_COMPILE_FLAGS_TO_REMOVE - C++ compile flags to remove (list)
+#
+# PARENT VAR = COMPILE_FLAGS_TO_ADD - Compile flags to add (list)
+# PARENT VAR = COMPILE_FLAGS_TO_REMOVE - Compile flags to remove (list)
+#
+# PARENT VAR = LINKER_FLAGS_TO_ADD - Linker flags to add (list)
+# PARENT VAR = LINKER_FLAGS_TO_REMOVE - Linker flags to remove (list)
 #
 # INPUT = TARGET_NAME - Target name.
 # INPUT = ${TARGET_NAME}_LIBS - Library root folder paths.
@@ -1104,6 +1228,188 @@

 function(generate_propeller_firmware TARGET_NAME)

+    if(DEFINED C_COMPILE_FLAGS_TO_ADD)
+        foreach(FLAG ${C_COMPILE_FLAGS_TO_ADD})
+            set(CMAKE_C_FLAGS
+            "${CMAKE_C_FLAGS} ${FLAG}")
+            set(CMAKE_C_FLAGS_DEBUG
+            "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
+            set(CMAKE_C_FLAGS_MINSIZEREL
+            "${CMAKE_C_FLAGS_MINSIZEREL} ${FLAG}")
+            set(CMAKE_C_FLAGS_RELEASE
+            "${CMAKE_C_FLAGS_RELEASE} ${FLAG}")
+            set(CMAKE_C_FLAGS_RELWITHDEBINFO
+            "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${FLAG}")
+        endforeach()
+    endif()
+
+    if(DEFINED CXX_COMPILE_FLAGS_TO_ADD)
+        foreach(FLAG ${CXX_COMPILE_FLAGS_TO_ADD})
+            set(CMAKE_CXX_FLAGS
+            "${CMAKE_CXX_FLAGS} ${FLAG}")
+            set(CMAKE_CXX_FLAGS_DEBUG
+            "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
+            set(CMAKE_CXX_FLAGS_MINSIZEREL
+            "${CMAKE_CXX_FLAGS_MINSIZEREL} ${FLAG}")
+            set(CMAKE_CXX_FLAGS_RELEASE
+            "${CMAKE_CXX_FLAGS_RELEASE} ${FLAG}")
+            set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
+            "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${FLAG}")
+        endforeach()
+    endif()
+
+    if(DEFINED COMPILE_FLAGS_TO_ADD)
+        foreach(FLAG ${COMPILE_FLAGS_TO_ADD})
+            set(CMAKE_C_FLAGS
+            "${CMAKE_C_FLAGS} ${FLAG}")
+            set(CMAKE_C_FLAGS_DEBUG
+            "${CMAKE_C_FLAGS_DEBUG} ${FLAG}")
+            set(CMAKE_C_FLAGS_MINSIZEREL
+            "${CMAKE_C_FLAGS_MINSIZEREL} ${FLAG}")
+            set(CMAKE_C_FLAGS_RELEASE
+            "${CMAKE_C_FLAGS_RELEASE} ${FLAG}")
+            set(CMAKE_C_FLAGS_RELWITHDEBINFO
+            "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${FLAG}")
+            set(CMAKE_CXX_FLAGS
+            "${CMAKE_CXX_FLAGS} ${FLAG}")
+            set(CMAKE_CXX_FLAGS_DEBUG
+            "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
+            set(CMAKE_CXX_FLAGS_MINSIZEREL
+            "${CMAKE_CXX_FLAGS_MINSIZEREL} ${FLAG}")
+            set(CMAKE_CXX_FLAGS_RELEASE
+            "${CMAKE_CXX_FLAGS_RELEASE} ${FLAG}")
+            set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
+            "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${FLAG}")
+        endforeach()
+    endif()
+
+    if(DEFINED LINKER_FLAGS_TO_ADD)
+        foreach(FLAG ${LINKER_FLAGS_TO_ADD})
+            set(CMAKE_EXE_LINKER_FLAGS
+            "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}")
+            set(CMAKE_EXE_LINKER_FLAGS_DEBUG
+            "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FLAG}")
+            set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
+            "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} ${FLAG}")
+            set(CMAKE_EXE_LINKER_FLAGS_RELEASE
+            "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${FLAG}")
+            set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
+            "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} ${FLAG}")
+            set(CMAKE_SHARED_LINKER_FLAGS
+            "${CMAKE_SHARED_LINKER_FLAGS} ${FLAG}")
+            set(CMAKE_SHARED_LINKER_FLAGS_DEBUG
+            "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${FLAG}")
+            set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
+            "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} ${FLAG}")
+            set(CMAKE_SHARED_LINKER_FLAGS_RELEASE
+            "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${FLAG}")
+            set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
+            "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} ${FLAG}")
+            set(CMAKE_MODULE_LINKER_FLAGS
+            "${CMAKE_MODULE_LINKER_FLAGS} ${FLAG}")
+            set(CMAKE_MODULE_LINKER_FLAGS_DEBUG
+            "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${FLAG}")
+            set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
+            "${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL} ${FLAG}")
+            set(CMAKE_MODULE_LINKER_FLAGS_RELEASE
+            "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${FLAG}")
+            set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
+            "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} ${FLAG}")
+        endforeach()
+    endif()
+
+    if(DEFINED C_COMPILE_FLAGS_TO_REMOVE)
+        foreach(FLAG ${C_COMPILE_FLAGS_TO_REMOVE})
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS
+            "${CMAKE_C_FLAGS}")
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS_DEBUG
+            "${CMAKE_C_FLAGS_DEBUG}")
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS_MINSIZEREL
+            "${CMAKE_C_FLAGS_MINSIZEREL}")
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS_RELEASE
+            "${CMAKE_C_FLAGS_RELEASE}")
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS_RELWITHDEBINFO
+            "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+        endforeach()
+    endif()
+
+    if(DEFINED CXX_COMPILE_FLAGS_TO_REMOVE)
+        foreach(FLAG ${CXX_COMPILE_FLAGS_TO_REMOVE})
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS
+            "${CMAKE_CXX_FLAGS}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS_DEBUG
+            "${CMAKE_CXX_FLAGS_DEBUG}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS_MINSIZEREL
+            "${CMAKE_CXX_FLAGS_MINSIZEREL}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS_RELEASE
+            "${CMAKE_CXX_FLAGS_RELEASE}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
+            "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+        endforeach()
+    endif()
+
+    if(DEFINED COMPILE_FLAGS_TO_REMOVE)
+        foreach(FLAG ${COMPILE_FLAGS_TO_REMOVE})
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS
+            "${CMAKE_C_FLAGS}")
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS_DEBUG
+            "${CMAKE_C_FLAGS_DEBUG}")
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS_MINSIZEREL
+            "${CMAKE_C_FLAGS_MINSIZEREL}")
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS_RELEASE
+            "${CMAKE_C_FLAGS_RELEASE}")
+            string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS_RELWITHDEBINFO
+            "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS
+            "${CMAKE_CXX_FLAGS}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS_DEBUG
+            "${CMAKE_CXX_FLAGS_DEBUG}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS_MINSIZEREL
+            "${CMAKE_CXX_FLAGS_MINSIZEREL}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS_RELEASE
+            "${CMAKE_CXX_FLAGS_RELEASE}")
+            string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
+            "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+        endforeach()
+    endif()
+
+    if(DEFINED LINKER_FLAGS_TO_REMOVE)
+        foreach(FLAG ${LINKER_FLAGS_TO_REMOVE})
+            string(REPLACE "${FLAG}" "" CMAKE_EXE_LINKER_FLAGS
+            "${CMAKE_EXE_LINKER_FLAGS}")
+            string(REPLACE "${FLAG}" "" CMAKE_EXE_LINKER_FLAGS_DEBUG
+            "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+            string(REPLACE "${FLAG}" "" CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
+            "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL}")
+            string(REPLACE "${FLAG}" "" CMAKE_EXE_LINKER_FLAGS_RELEASE
+            "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
+            string(REPLACE "${FLAG}" "" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
+            "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
+            string(REPLACE "${FLAG}" "" CMAKE_SHARED_LINKER_FLAGS
+            "${CMAKE_SHARED_LINKER_FLAGS}")
+            string(REPLACE "${FLAG}" "" CMAKE_SHARED_LINKER_FLAGS_DEBUG
+            "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
+            string(REPLACE "${FLAG}" "" CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
+            "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL}")
+            string(REPLACE "${FLAG}" "" CMAKE_SHARED_LINKER_FLAGS_RELEASE
+            "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
+            string(REPLACE "${FLAG}" ""
+            CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
+            "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}")
+            string(REPLACE "${FLAG}" "" CMAKE_MODULE_LINKER_FLAGS
+            "${CMAKE_MODULE_LINKER_FLAGS}")
+            string(REPLACE "${FLAG}" "" CMAKE_MODULE_LINKER_FLAGS_DEBUG
+            "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
+            string(REPLACE "${FLAG}" "" CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
+            "${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL}")
+            string(REPLACE "${FLAG}" "" CMAKE_MODULE_LINKER_FLAGS_RELEASE
+            "${CMAKE_MODULE_LINKER_FLAGS_RELEASE}")
+            string(REPLACE "${FLAG}" ""
+            CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
+            "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO}")
+        endforeach()
+    endif()
+
     if(NOT DEFINED ${TARGET_NAME}_FPATH)
         message(FATAL_ERROR "File or folder path is not defined!")
     endif()
@@ -1130,7 +1436,8 @@

         if("${FILE_TYPE}" STREQUAL ".spin")

-            set(FILE_NAME_BINARY "${CMAKE_BINARY_DIR}/${FILE_NAME}.binary")
+            set(FILE_NAME_BINARY
+            "${CMAKE_BINARY_DIR}/${FILE_NAME}.binary")

             set_source_files_properties("${FILE_NAME_BINARY}" PROPERTIES
             EXTERNAL_OBJECT TRUE GENERATED TRUE)
@@ -1268,7 +1575,8 @@
         message(FATAL_ERROR "Unknown mem model \"${${TARGET_NAME}_MM}\"!")
     endif()

-    if("${PROPELLER_C_FLAGS}" MATCHES "-m32bit-doubles")
+    if(("${CMAKE_C_FLAGS}" MATCHES "-m32bit-doubles")
+    OR ("${CMAKE_CXX_FLAGS}" MATCHES "-m32bit-doubles"))
         add_definitions("-D__PROPELLER_32BIT_DOUBLES__")
     else()
         add_definitions("-D__PROPELLER_64BIT_DOUBLES__")


Fix for Gtest force install (#182)

Fix for Gtest force install (#182)

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -70,6 +70,7 @@
       BUILD_PROJECT       TRUE
       UPDATE_DISCONNECTED TRUE # Never update automatically from the remote repository
     )
+    list( APPEND CMAKE_PREFIX_PATH ${GTEST_ROOT} )
     find_package(GTest CONFIG REQUIRED PATHS ${GTEST_ROOT})
   endif()
 endif()


make .deb xz compression configurable

make .deb xz compression configurable

--- cmake/packages/deb.cmake
+++ cmake/packages/deb.cmake
@@ -6,7 +6,7 @@
 set(CPACK_DEBIAN_PACKAGE_SECTION "database")
 set(CPACK_DEBIAN_PACKAGE_CONFLICTS "arangodb, ${CPACKG_PACKAGE_CONFLICTS}, ${CPACKG_PACKAGE_CONFLICTS}-client, ${CPACK_PACKAGE_NAME}-client")
 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
-if(!DISABLE_XZ_DEB)
+if(NOT DISABLE_XZ_DEB)
   set(CPACK_DEBIAN_COMPRESSION_TYPE "xz")
 endif()
 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${ARANGODB_URL_INFO_ABOUT})


SuperBuild: Upgrade to OpenCV 3.4.1

SuperBuild: Upgrade to OpenCV 3.4.1

--- SuperBuild/CMake/External_opencv.cmake
+++ SuperBuild/CMake/External_opencv.cmake
@@ -34,8 +34,8 @@

 ExternalProject_Add(OPENCV
   PREFIX OPENCV
-  URL "https://github.com/opencv/opencv/archive/2.4.13.2.tar.gz"
-  URL_MD5 fe52791ce523681a67036def4c25261b
+  URL "https://github.com/opencv/opencv/archive/3.4.1.tar.gz"
+  URL_MD5 a0b7a47899e67b3490ea31edc4f6e8e6
   BINARY_DIR ${OPENCV_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}


- Fix unit testing with Emscripten, correct directory and file extension

--- cmake/Modules/BuildFunctions.cmake
+++ cmake/Modules/BuildFunctions.cmake
@@ -414,8 +414,8 @@
     elseif(EMSCRIPTEN)
         add_test (
             NAME ${TITLE}
-            WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-            COMMAND nodejs $<TARGET_FILE:${TARGET}>
+            WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}.bundle
+            COMMAND nodejs ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}.bundle/${TARGET}.js
             )
     else()
         add_test (


Handle find_package() options in FindAfterImage.cmake

Use FindPackageHandleStandardArgs.cmake to handle common options
passed to find_package(), like QUIET, REQUIRED, etc.

--- cmake/modules/FindAfterImage.cmake
+++ cmake/modules/FindAfterImage.cmake
@@ -1,35 +1,37 @@
-# Find the AfterImage includes and libraries.
-#  (See http://afterstep.sourceforge.net/afterimage/)
-# This module defines
-# AFTERIMAGE_INCLUDE_DIR, where to locate libAfterImage header files
-# AFTERIMAGE_LIBRARIES, the libraries to link against to use libAfterImage
-# AFTERIMAGE_FOUND. If false, you cannot build anything that requires libAfterImage
+#.rst:
+# FindAfterImage (http://www.afterstep.org/afterimage)
+# -------
+#
+# Find the AfterImage library header and define variables.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following variables:
+#
+# ::
+#
+#   AFTERIMAGE_FOUND          - True if AfterImage is found
+#   AFTERIMAGE_VERSION        - The version of AfterImage found (x.y)
+#   AFTERIMAGE_INCLUDE_DIR    - Where to find afterimage.h
+#   AFTERIMAGE_LIBRARIES      - Libraries to link against to use libAfterImage
+
+find_program(AFTERIMAGE_CONFIG_EXECUTABLE afterimage-config)
+mark_as_advanced(AFTERIMAGE_CONFIG_EXECUTABLE)

 if(AFTERIMAGE_CONFIG_EXECUTABLE)
-  set(AFTERIMAGE_FIND_QUIETLY 1)
-endif()
-set(AFTERIMAGE_FOUND 0)
+  execute_process(COMMAND ${AFTERIMAGE_CONFIG_EXECUTABLE} --version
+    OUTPUT_VARIABLE AFTERIMAGE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND ${AFTERIMAGE_CONFIG_EXECUTABLE} --cflags
+    OUTPUT_VARIABLE AFTERIMAGE_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND ${AFTERIMAGE_CONFIG_EXECUTABLE} --libs
+    OUTPUT_VARIABLE AFTERIMAGE_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)

-find_program(AFTERIMAGE_CONFIG_EXECUTABLE afterimage-config)
-
-if(AFTERIMAGE_CONFIG_EXECUTABLE)
-  execute_process(COMMAND ${AFTERIMAGE_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE AFTERIMAGE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-  #---TODO (check that the version is sufficient)
-  execute_process(COMMAND ${AFTERIMAGE_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE AFTERIMAGE_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
   separate_arguments(AFTERIMAGE_CFLAGS)
-  string( REGEX MATCH "-I[^;]+" AFTERIMAGE_INCLUDE_DIR "${AFTERIMAGE_CFLAGS}" )
-  string( REPLACE "-I" "" AFTERIMAGE_INCLUDE_DIR "${AFTERIMAGE_INCLUDE_DIR}")
-  execute_process(COMMAND ${AFTERIMAGE_CONFIG_EXECUTABLE} --libs OUTPUT_VARIABLE AFTERIMAGE_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
-  set(AFTERIMAGE_FOUND 1)
+  string(REGEX MATCH "-I[^;]+" AFTERIMAGE_INCLUDE_DIR "${AFTERIMAGE_CFLAGS}")
+  string(REPLACE "-I" "" AFTERIMAGE_INCLUDE_DIR "${AFTERIMAGE_INCLUDE_DIR}")
 endif()

-if(AFTERIMAGE_FOUND)
-  if(NOT AFTERIMAGE_FIND_QUIETLY)
-    message(STATUS "Found AfterImage version ${AFTERIMAGE_VERSION}")
-    message(STATUS "Found AfterImage includedir ${AFTERIMAGE_INCLUDE_DIR}")
-    message(STATUS "Found AfterImage libraries ${AFTERIMAGE_LIBRARIES}")
-  endif()
-endif()
-
-mark_as_advanced(AFTERIMAGE_CONFIG_EXECUTABLE)
-
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(AfterImage
+  REQUIRED_VARS AFTERIMAGE_INCLUDE_DIR AFTERIMAGE_LIBRARIES VERSION_VAR AFTERIMAGE_VERSION)


[CMake] Use llvm-tblgen from NATIVE LLVM build when cross-compiling

Summary:
When cross-compiling LLDB, we want to use llvm-tblgen built for the
host, not the target.

Reviewers: compnerd, sgraenitz

Subscribers: mgorny, lldb-commits

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

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@352235 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -29,8 +29,31 @@
   set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR} CACHE PATH "Path to LLVM build tree")
   set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")

-  find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
-    NO_DEFAULT_PATH)
+  if(CMAKE_CROSSCOMPILING)
+    set(LLVM_NATIVE_BUILD "${LLDB_PATH_TO_LLVM_BUILD}/NATIVE")
+    if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
+      message(FATAL_ERROR
+        "Attempting to cross-compile LLDB standalone but no native LLVM build
+        found. Please cross-compile LLVM as well.")
+    endif()
+
+    if (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+      set(HOST_EXECUTABLE_SUFFIX ".exe")
+    endif()
+
+    if (NOT CMAKE_CONFIGURATION_TYPES)
+      set(LLVM_TABLEGEN_EXE
+        "${LLVM_NATIVE_BUILD}/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+    else()
+      # NOTE: LLVM NATIVE build is always built Release, as is specified in
+      # CrossCompile.cmake
+      set(LLVM_TABLEGEN_EXE
+        "${LLVM_NATIVE_BUILD}/Release/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+    endif()
+  else()
+    find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
+      NO_DEFAULT_PATH)
+  endif()

   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)


Add OpenCV 3.4.6

Add OpenCV 3.4.6

--- cmake/projects/OpenCV/hunter.cmake
+++ cmake/projects/OpenCV/hunter.cmake
@@ -21,6 +21,17 @@
     "https://github.com/hunter-packages/opencv/archive/v4.0.0-p0.tar.gz"
     SHA1
     90680ea3b971c2323e0049c48fa7867a1fd9f3fe
+)
+
+hunter_add_version(
+    PACKAGE_NAME
+    OpenCV
+    VERSION
+    "3.4.6-p0"
+    URL
+    "https://github.com/hunter-packages/opencv/archive/v3.4.6-p0.tar.gz"
+    SHA1
+    70f4da99e5d824c463848d4df8667d5d705af141
 )

 hunter_add_version(


OpenCV: disable tests, docs and examples

--- cmake/projects/OpenCV/hunter.cmake
+++ cmake/projects/OpenCV/hunter.cmake
@@ -8,10 +8,11 @@
 endif()

 # Load used modules
+include(hunter_add_package)
 include(hunter_add_version)
+include(hunter_cmake_args)
 include(hunter_download)
 include(hunter_pick_scheme)
-include(hunter_add_package)

 # List of versions here...
 hunter_add_version(
@@ -47,6 +48,16 @@
     a0c2d5944364fc4f26b6160b33c03082b1fa08c1
 )

+hunter_cmake_args(
+    OpenCV
+    CMAKE_ARGS
+        BUILD_DOCS=OFF
+        BUILD_TESTS=OFF
+        BUILD_PERF_TESTS=OFF
+        BUILD_opencv_apps=OFF
+        BUILD_EXAMPLES=OFF
+)
+
 # Pick a download scheme
 hunter_pick_scheme(
     DEFAULT


ISSUE #519 adding a check for the third party libs folder

(cherry picked from commit 7987e584c8a886de99cb4153d9957408ae0ecc5d)

--- cmake_modules/FindCRYPTOLENS.cmake
+++ cmake_modules/FindCRYPTOLENS.cmake
@@ -80,11 +80,16 @@

 # exit if we found libs/includes
 if(CRYPTOLENS_INCLUDE_DIR AND CRYPTOLENS_LIBRARIES)
-	set(CRYPTOLENS_FOUND TRUE)
-	message(STATUS "CRYPTOLENS installation found.")
-	message(STATUS "CRYPTOLENS_INCLUDE_DIR: ${CRYPTOLENS_INCLUDE_DIR}")
-	message(STATUS "CRYPTOLENS_LIBRARIES: ${CRYPTOLENS_LIBRARIES}")
-
+	# confirm structure of the folder is correct
+	get_filename_component(THIRD_PARTY_FULLPATH "${CRYPTOLENS_INCLUDE_DIR}/../third_party" REALPATH)
+    if (NOT EXISTS "${THIRD_PARTY_FULLPATH}")
+		message(FATAL_ERROR "cryptolens third party folder not found")
+    else()
+		set(CRYPTOLENS_FOUND TRUE)
+		message(STATUS "CRYPTOLENS installation found.")
+		message(STATUS "CRYPTOLENS_INCLUDE_DIR: ${CRYPTOLENS_INCLUDE_DIR}")
+		message(STATUS "CRYPTOLENS_LIBRARIES: ${CRYPTOLENS_LIBRARIES}")
+	endif()
 # cannot find CRYPTOLENS anywhere!
 else(CRYPTOLENS_INCLUDE_DIR AND CRYPTOLENS_LIBRARIES)
 	set(CRYPTOLENS_FOUND FALSE)


Add sources & folders to doxygen in architecture

--- source/architecture/ARM/ARMv6-M-ARMv7-M/distortos-sources.cmake
+++ source/architecture/ARM/ARMv6-M-ARMv7-M/distortos-sources.cmake
@@ -27,4 +27,8 @@
 			${CMAKE_CURRENT_LIST_DIR}/ARMv6-M-ARMv7-M-SVC_Handler.cpp
 			${CMAKE_CURRENT_LIST_DIR}/ARMv6-M-ARMv7-M-SysTick_Handler.cpp)

+	doxygen(INPUT ${CMAKE_CURRENT_LIST_DIR}
+			INCLUDE_PATH ${CMAKE_CURRENT_LIST_DIR}/include ${CMAKE_CURRENT_LIST_DIR}/external/CMSIS
+			EXCLUDE ${CMAKE_CURRENT_LIST_DIR}/external)
+
 endif()


LTO (IPO): check CMake version

LTO (IPO): check CMake version

--- cmake/modules/hunter_finalize.cmake
+++ cmake/modules/hunter_finalize.cmake
@@ -161,4 +161,8 @@
   # original path expected. E.g. NMake build:
   # * https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1412/job/o8a21ue85ivt5d0p
   string(REPLACE "\\" "\\\\" CMAKE_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}")
+
+  if(CMAKE_INTERPROCEDURAL_OPTIMIZATION AND NOT POLICY CMP0069)
+    hunter_user_error("Unsuitable CMake version")
+  endif()
 endmacro()


vpr: add check_route quick option

vpr: add check_route quick option

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

--- xc/common/cmake/arch_define.cmake
+++ xc/common/cmake/arch_define.cmake
@@ -64,7 +64,7 @@
       --place_delta_delay_matrix_calculation_method dijkstra \
       --place_delay_model delta_override \
       --router_lookahead connection_box_map \
-      --quick_check_route on \
+      --check_route quick \
       --strict_checks off \
       --allow_dangling_combinational_nodes on \
       --disable_errors check_unbuffered_edges:check_route \
@@ -77,7 +77,7 @@
       --suppress_warnings \${OUT_NOISY_WARNINGS},sum_pin_class:check_unbuffered_edges:load_rr_indexed_data_T_values:check_rr_node:trans_per_R:check_route"
       )

-  set(YOSYS_CELLS_SIM ${YOSYS_DATADIR}/xilinx/cells_sim.v)
+  set(YOSYS_CELLS_SIM ${YOSYS_DATADIR}/xilinx/cells_sim.v)
   set(VPR_CELLS_SIM ${symbiflow-arch-defs_SOURCE_DIR}/xc/${FAMILY}/techmap/cells_sim.v)

   get_file_target(YOSYS_CELLS_SIM_TARGET ${YOSYS_CELLS_SIM})


Only accept semicolon-separated EXTRA_CMAKE_ARGS

--- CMake/SetExternalProjectFlags.cmake
+++ CMake/SetExternalProjectFlags.cmake
@@ -23,8 +23,8 @@

 macro(SetExternalProjectFlags proj)

-	set(${proj}_EXTRA_CMAKE_ARGS "" CACHE STRING "Optional extra CMake arguments to be appended to the flags set by the SuperBuild")
+	set(${proj}_EXTRA_CMAKE_ARGS "" CACHE STRING "Optional extra CMake arguments to be appended to the flags set by the SuperBuild(use semi-colons for multiple arguments)")
 	mark_as_advanced(${proj}_EXTRA_CMAKE_ARGS)
-	string(REPLACE " " ";" ${proj}_EXTRA_CMAKE_ARGS_LIST "${${proj}_EXTRA_CMAKE_ARGS}")
-	message(STATUS ${proj}_EXTRA_CMAKE_ARGS_LIST= "${${proj}_EXTRA_CMAKE_ARGS_LIST}")
+	# string(REPLACE " " ";" ${proj}_EXTRA_CMAKE_ARGS_LIST "${${proj}_EXTRA_CMAKE_ARGS}")
+	message(STATUS ${proj}_EXTRA_CMAKE_ARGS= "${${proj}_EXTRA_CMAKE_ARGS}")
 endmacro()


Search for libmozjs-1.9.2.so for Ubuntu PPA's

--- CMakeModules/FindSpidermonkey.cmake
+++ CMakeModules/FindSpidermonkey.cmake
@@ -50,13 +50,13 @@
 if(SPIDERMONKEY_ROOT)
     find_library(
         SPIDERMONKEY_LIBRARY
-        NAMES mozjs js js32 js3250
+        NAMES mozjs-1.9.2 mozjs js js32 js3250
         PATHS "${SPIDERMONKEY_ROOT}/lib"
         NO_DEFAULT_PATH)
 else()
     find_library(
         SPIDERMONKEY_LIBRARY
-        NAMES mozjs js js32 js3250)
+        NAMES mozjs-1.9.2 mozjs js js32 js3250)
 endif()

 set(SPIDERMONKEY_LIBRARIES ${SPIDERMONKEY_LIBRARY})


adding the toplevel universal include dir to see which number systems you include

--- tools/cmake/UNIVERSALCommon.cmake
+++ tools/cmake/UNIVERSALCommon.cmake
@@ -1,10 +1,10 @@
 ############################
 #This configuration file defines some cmake variables:
-#UNIVERSAL_INCLUDE_DIRS: list of include directories for the universal library
-#UNIVERSAL_LIBRARIES: libraries needed for interfaces like umfpack and arprec, see below
-#UNIVERSAL_CXX_DEFINITIONS: definitions to enable the requested interfaces
-#UNIVERSAL_VERSION: version (current: 1)
-#UNIVERSAL_MINOR_VERSION: minor version
+# UNIVERSAL_INCLUDE_DIRS: list of include directories for the universal library
+# UNIVERSAL_LIBRARIES: libraries needed for interfaces like umfpack and arprec, see below
+# UNIVERSAL_CXX_DEFINITIONS: definitions to enable the requested interfaces
+# UNIVERSAL_VERSION: version (current: 1)
+# UNIVERSAL_MINOR_VERSION: minor version
 #
 #supported components:
 #
@@ -22,9 +22,10 @@
 endif()

 if(EXISTS ${UNIVERSAL_DIR}/include/universal/posit/posit.hpp)
-	list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/include/universal/posit")
+  list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/include")
+  list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/include/universal/posit")
 else()
-	list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/../../include")
+  message(STATUS "Couldn't find the posit include directory at ${UNIVERSAL_DIR}/include")
 endif(EXISTS ${UNIVERSAL_DIR}/include/universal/posit/posit.hpp)

 macro(unum_check_cxx_compiler_flag FLAG RESULT)


Provide some more information about auxiliary compiler in detailed.log

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

--- deal.II/cmake/setup_finalize.cmake
+++ deal.II/cmake/setup_finalize.cmake
@@ -124,10 +124,15 @@
 #                                ${CMAKE_CXX_COMPILER}
 "
   )
-_detailed(
-"#        CMAKE_GENERATOR:        ${CMAKE_GENERATOR}
-"
-  )
+
+IF(CMAKE_C_COMPILER_WORKS)
+  _detailed("#        CMAKE_C_COMPILER:       ${CMAKE_C_COMPILER}\n")
+ENDIF()
+IF(CMAKE_Fortran_COMPILER_WORKS)
+  _detailed("#        CMAKE_Fortran_COMPILER: ${CMAKE_Fortran_COMPILER}\n")
+ENDIF()
+_detailed("#        CMAKE_GENERATOR:        ${CMAKE_GENERATOR}\n")
+
 IF(CMAKE_CROSSCOMPILING)
   _both(
     "#\n#        CROSSCOMPILING!\n"


COMP: Add ITK include dirs in otbIncludeDirectories.cmake when we select INTERNAL ITK

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -91,6 +91,10 @@
         INCLUDE(${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/itkThirdParty.cmake)
  	INCLUDE(${OTB_SOURCE_DIR}/Utilities/ITK/itkIncludeDirectories.cmake)
 	SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
+# 2008/12/18: Added ITK include dir
+        ${ITK_INCLUDE_DIRS_BUILD_TREE}
+        ${ITK_INCLUDE_DIRS_BUILD_TREE_CXX}
+        ${ITK_INCLUDE_DIRS_SYSTEM}
 	${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/vxl/v3p/netlib
 	${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/vxl/v3p/netlib/opt)
 ENDIF(OTB_USE_EXTERNAL_ITK)


Correction include pour les fichiers generes a partir de fluid dans OTB_BINARY_DIR

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -16,6 +16,7 @@
   ${OTB_SOURCE_DIR}/Code/FeatureExtraction
   ${OTB_SOURCE_DIR}/Code/Learning
   ${OTB_SOURCE_DIR}/Code/Visu
+  ${OTB_BINARY_DIR}/Code/Visu
 )

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


cleanup externals

cleanup externals

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -9,10 +9,6 @@

 # Include external script
 include("${CMAKE_BINARY_DIR}/script-externals/cmake/External.cmake")
-
-# other includes
-# TODO: remove when uploading
-include(CMakePrintHelpers)

 #
 # Centralized function to require externals to add them once by invoking


Switches platform from spike to sparrow

Switches platform from spike to sparrow

Change-Id: Ie086289080bb94e6cf3bc0e28a101d2e0db2000c
GitOrigin-RevId: 6de1d47766d977281f5cab7671637c31b2220d52

--- easy-settings.cmake
+++ easy-settings.cmake
@@ -1,6 +1,6 @@
 set(CAMKES_APP "system" CACHE STRING "The one and only CAmkES application in this project")

-set(PLATFORM "spike" CACHE STRING "The one and only seL4 platform for Sparrow")
+set(PLATFORM "sparrow" CACHE STRING "The one and only seL4 platform for Sparrow")
 set(KernelSel4Arch "riscv32" CACHE STRING "Specifies 32-bit branch of the seL4 spike platform")

 set(LibUtilsDefaultZfLogLevel 5 CACHE STRING "seL4 internal logging level (0-5).")


Try running without such fine grained stack resolution to solve CI problem

--- tools/cmake/SpecialtyBuilds.cmake
+++ tools/cmake/SpecialtyBuilds.cmake
@@ -43,7 +43,7 @@
         message(FATAL_ERROR
                 "The Address Sanitizer is not yet supported on Visual Studio builds")
     else()
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -O1 -g")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -O1 -g")
         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
     endif()
 endif()
@@ -57,7 +57,7 @@
         message(FATAL_ERROR
                 "The Thread Sanitizer is not yet supported on Visual Studio builds")
     else()
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -O2 -g -fPIE")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -O2 -g -fPIE")
         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")
         # According to the clang docs, if -fsanitize=thread is specified then compiling
         # and linking with PIE is turned on automatically.


ENH: allow dependencies on remote modules

--- CMake/ITKModuleEnablement.cmake
+++ CMake/ITKModuleEnablement.cmake
@@ -1,46 +1,57 @@
 # This script sorts out the module dependencies, provides user options for customizing
 # the list of modules to be built, and enables modules accordingly.

-# Load the module DAG.
-set(ITK_MODULES_ALL)
-file(GLOB_RECURSE meta RELATIVE "${ITK_SOURCE_DIR}"
-   "${ITK_SOURCE_DIR}/*/*/*/itk-module.cmake" # grouped modules
-  )
-foreach(f ${meta})
-  include(${ITK_SOURCE_DIR}/${f})
-  list(APPEND ITK_MODULES_ALL ${itk-module})
-  get_filename_component(${itk-module}_BASE ${f} PATH)
-  set(${itk-module}_SOURCE_DIR ${ITK_SOURCE_DIR}/${${itk-module}_BASE})
-  set(${itk-module}_BINARY_DIR ${ITK_BINARY_DIR}/${${itk-module}_BASE})
-  if(BUILD_TESTING AND NOT DISABLE_MODULE_TESTS AND EXISTS ${${itk-module}_SOURCE_DIR}/test)
-    list(APPEND ITK_MODULES_ALL ${itk-module-test})
-    set(${itk-module-test}_SOURCE_DIR ${${itk-module}_SOURCE_DIR}/test)
-    set(${itk-module-test}_BINARY_DIR ${${itk-module}_BINARY_DIR}/test)
-    set(${itk-module-test}_IS_TEST 1)
-    set(${itk-module}_TESTED_BY ${itk-module-test})
-    set(${itk-module-test}_TESTS_FOR ${itk-module})
-  endif()
-
-  # Reject bad dependencies.
-  string(REGEX MATCHALL ";(ITKDeprecated|ITKReview|ITKIntegratedTest);"
-    _bad_deps ";${ITK_MODULE_${itk-module}_DEPENDS};${ITK_MODULE_${itk-module-test}_DEPENDS};")
-  foreach(dep ${_bad_deps})
-    if(NOT "${itk-module}" MATCHES "^(${dep}|ITKIntegratedTest)$")
-      message(FATAL_ERROR
-        "Module \"${itk-module}\" loaded from\n"
-        "  ${${itk-module}_BASE}/itk-module.cmake\n"
-        "may not depend on module \"${dep}\".")
-    endif()
-  endforeach()
-endforeach()
-# Clear variables set later in each module.
-unset(itk-module)
-unset(itk-module-test)
+macro(itk_module_load_DAG)
+  set(ITK_MODULES_ALL)
+  file(GLOB_RECURSE meta RELATIVE "${ITK_SOURCE_DIR}"
+     "${ITK_SOURCE_DIR}/*/*/*/itk-module.cmake" # grouped modules
+    )
+  foreach(f ${meta})
+    include(${ITK_SOURCE_DIR}/${f})
+    list(APPEND ITK_MODULES_ALL ${itk-module})
+    get_filename_component(${itk-module}_BASE ${f} PATH)
+    set(${itk-module}_SOURCE_DIR ${ITK_SOURCE_DIR}/${${itk-module}_BASE})
+    set(${itk-module}_BINARY_DIR ${ITK_BINARY_DIR}/${${itk-module}_BASE})
+    if(BUILD_TESTING AND NOT DISABLE_MODULE_TESTS AND EXISTS ${${itk-module}_SOURCE_DIR}/test)
+      list(APPEND ITK_MODULES_ALL ${itk-module-test})
+      set(${itk-module-test}_SOURCE_DIR ${${itk-module}_SOURCE_DIR}/test)
+      set(${itk-module-test}_BINARY_DIR ${${itk-module}_BINARY_DIR}/test)
+      set(${itk-module-test}_IS_TEST 1)
+      set(${itk-module}_TESTED_BY ${itk-module-test})
+      set(${itk-module-test}_TESTS_FOR ${itk-module})
+    endif()
+
+    # Reject bad dependencies.
+    string(REGEX MATCHALL ";(ITKDeprecated|ITKReview|ITKIntegratedTest);"
+      _bad_deps ";${ITK_MODULE_${itk-module}_DEPENDS};${ITK_MODULE_${itk-module-test}_DEPENDS};")
+    foreach(dep ${_bad_deps})
+      if(NOT "${itk-module}" MATCHES "^(${dep}|ITKIntegratedTest)$")
+        message(FATAL_ERROR
+          "Module \"${itk-module}\" loaded from\n"
+          "  ${${itk-module}_BASE}/itk-module.cmake\n"
+          "may not depend on module \"${dep}\".")
+      endif()
+    endforeach()
+  endforeach()
+  # Clear variables set later in each module.
+  unset(itk-module)
+  unset(itk-module-test)
+endmacro()

 # Validate the module DAG.
 macro(itk_module_check itk-module _needed_by stack)
   if(NOT ITK_MODULE_${itk-module}_DECLARED)
-    message(AUTHOR_WARNING "No such module \"${itk-module}\" needed by \"${_needed_by}\"")
+    string(SUBSTRING ${itk-module} 0 3 module-name-prefix)
+    if (${module-name-prefix} EQUAL "ITK")
+      message(AUTHOR_WARNING "No such module \"${itk-module}\" needed by \"${_needed_by}\"")
+    else() # This is a remote module which has not been downloaded yet
+      message(STATUS "Including remote module \"${itk-module}\" needed by \"${_needed_by}\"")
+      set(Module_${itk-module} ON CACHE BOOL "Needed by ${_needed_by}" FORCE) # turn it on
+      include("${CMAKE_CURRENT_LIST_DIR}/../Modules/Remote/${itk-module}.remote.cmake")
+      set(Module_${itk-module} OFF CACHE BOOL "Needed by ${_needed_by}" FORCE) # turn it back off
+      set(ModuleEnablementNeedsToRerun ON)
+    endif()
+    unset(module-name-prefix)
   elseif(check_started_${itk-module} AND NOT check_finished_${itk-module})
     # We reached a module while traversing its own dependencies recursively.
     set(msg "")
@@ -61,9 +72,15 @@
   endif()
 endmacro()

-foreach(itk-module ${ITK_MODULES_ALL})
-  itk_module_check("${itk-module}" "" "")
-endforeach()
+set(ModuleEnablementNeedsToRerun ON) # this needs to run at least once
+while(ModuleEnablementNeedsToRerun)
+  itk_module_load_DAG()
+  set(ModuleEnablementNeedsToRerun OFF)
+  message(STATUS "Running module dependency checks")
+  foreach(itk-module ${ITK_MODULES_ALL})
+    itk_module_check("${itk-module}" "" "")
+  endforeach()
+endwhile()

 #----------------------------------------------------------------------
 # Provide an option to build the default set of ITK modules. Only a small


STYLE: Use keyword style for HeaderTest target_link_libraries

Use the more modern explicit keyword-style.

--- CMake/ITKModuleHeaderTest.cmake
+++ CMake/ITKModuleHeaderTest.cmake
@@ -85,7 +85,7 @@
         ${_test_num}
         )
       add_executable( ${_test_name} ${_header_test_src} )
-      target_link_libraries( ${_test_name} ${${_name}_LIBRARIES} itksys )
+      target_link_libraries( ${_test_name} PUBLIC ${${_name}_LIBRARIES} itksys )

       add_dependencies(${_name}-all ${_test_name})
       math( EXPR _test_num "${_test_num} + 1" )


Fixed install path of dependency binaries in CMake script

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -22,30 +22,30 @@
 option(OGRE_COPY_DEPENDENCIES "Copy dependency libs to the build directory" TRUE)

 macro(install_debug INPUT)
-  if (EXISTS ${OGRE_DEP_DIR}/lib/debug/${INPUT})
-    if (IS_DIRECTORY ${OGRE_DEP_DIR}/lib/debug/${INPUT})
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
+  if (EXISTS ${OGRE_DEP_DIR}/bin/debug/${INPUT})
+    if (IS_DIRECTORY ${OGRE_DEP_DIR}/bin/debug/${INPUT})
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
     else ()
-      install(FILES ${OGRE_DEP_DIR}/lib/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
+      install(FILES ${OGRE_DEP_DIR}/bin/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
     endif ()
   else()
-    message(send_error "${OGRE_DEP_DIR}/lib/debug/${INPUT} did not exist, can't install!")
+    message(send_error "${OGRE_DEP_DIR}/bin/debug/${INPUT} did not exist, can't install!")
   endif ()
 endmacro()

 macro(install_release INPUT)
-  if (EXISTS ${OGRE_DEP_DIR}/lib/release/${INPUT})
-    if (IS_DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT})
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
+  if (EXISTS ${OGRE_DEP_DIR}/bin/release/${INPUT})
+    if (IS_DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT})
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
     else ()
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
     endif ()
   else()
-    message(send_error "${OGRE_DEP_DIR}/lib/release/${INPUT} did not exist, can't install!")
+    message(send_error "${OGRE_DEP_DIR}/bin/release/${INPUT} did not exist, can't install!")
   endif ()
 endmacro()


CMake: Fix modifying URHO3D_FEATURES not working after initial cache generation.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -89,7 +89,7 @@

 # Enable features user has chosen
 foreach(FEATURE in ${URHO3D_FEATURES})
-    set (URHO3D_${FEATURE}_DEFAULT ON)
+    set (URHO3D_${FEATURE} ON CACHE BOOL "" FORCE)
 endforeach()

 macro (_option NAME DESCRIPTION)


Adding additional directories to search for the Ogre framework when using a prebuilt SDK with your own projects under OS X

--HG--
branch : v1-7

--- CMake/Utils/FindPkgMacros.cmake
+++ CMake/Utils/FindPkgMacros.cmake
@@ -131,6 +131,10 @@
       /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Release
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
+      ${OGRE_PREFIX_PATH}/lib/Release
+      ${OGRE_PREFIX_PATH}/lib/Debug
+      ${OGRE_PREFIX_BUILD}/lib/Release
+      ${OGRE_PREFIX_BUILD}/lib/Debug
     )
     FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
       SET(fwkpath ${dir}/${fwk}.framework)


Updated to use omegalib freetype distrib

--- CMakeModules/FindFreetype.cmake
+++ CMakeModules/FindFreetype.cmake
@@ -1,122 +1,22 @@
-# - Locate FreeType library
-# This module defines
-#  FREETYPE_LIBRARY, the library to link against
-#  FREETYPE_FOUND, if false, do not try to link to FREETYPE
-#  FREETYPE_INCLUDE_DIRS, where to find headers.
-#  This is the concatenation of the paths:
-#  FREETYPE_INCLUDE_DIR_ft2build
-#  FREETYPE_INCLUDE_DIR_freetype2
-#
-# $FREETYPE_DIR is an environment variable that would
-# correspond to the ./configure --prefix=$FREETYPE_DIR
-# used in building FREETYPE.
-# Created by Eric Wing.
-
-# Ugh, FreeType seems to use some #include trickery which
-# makes this harder than it should be. It looks like they
-# put ft2build.h in a common/easier-to-find location which
-# then contains a #include to a more specific header in a
-# more specific location (#include <freetype/config/ftheader.h>).
-# Then from there, they need to set a bunch of #define's
-# so you can do something like:
-# #include FT_FREETYPE_H
-# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES()
-# wants explicit full paths and this trickery doesn't work too well.
-# I'm going to attempt to cut out the middleman and hope
-# everything still works.
-
 FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
   PATHS
   ${FREETYPE_DIR}
   NO_DEFAULT_PATH
   PATH_SUFFIXES include
 )
-FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
-  PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
-  NO_DEFAULT_PATH
-  PATH_SUFFIXES include
-)
-FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
-  PATHS
-  /usr/local
-  /usr
-  /usr/local/X11R6
-  /usr/local/X11
-  /usr/X11R6
-  /usr/X11
-  /sw
-  /opt/local
-  /opt/csw
-  /opt
-  /usr/freeware
-  PATH_SUFFIXES include include/freetype2
-)
+

 FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
-  $ENV{FREETYPE_DIR}/include/freetype2
+  ${FREETYPE_DIR}/include
   NO_DEFAULT_PATH
-)
-FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
-  PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
-  NO_DEFAULT_PATH
-  PATH_SUFFIXES include/freetype2
-)
-FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
-  /usr/local/include/freetype2
-  /usr/include/freetype2
-  /usr/local/X11R6/include/freetype2
-  /usr/local/X11/include/freetype2
-  /usr/X11R6/include/freetype2
-  /usr/X11/include/freetype2
-  /sw/include/freetype2
-  /opt/local/include/freetype2
-  /opt/csw/include/freetype2
-  /opt/include/freetype2
-  /usr/freeware/include/freetype2
-)
-
-FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
-  /usr/local/include/freetype2
-  /usr/include/freetype2
-  /usr/local/X11R6/include/freetype2
-  /usr/local/X11/include/freetype2
-  /usr/X11R6/include/freetype2
-  /usr/X11/include/freetype2
-  /sw/include/freetype2
-  /opt/local/include/freetype2
-  /opt/csw/include/freetype2
-  /opt/include/freetype2
-  /usr/freeware/include/freetype2
 )

 FIND_LIBRARY(FREETYPE_LIBRARY
   NAMES freetype libfreetype freetype219
   PATHS
-  $ENV{FREETYPE_DIR}
+  ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
   NO_DEFAULT_PATH
-  PATH_SUFFIXES lib64 lib
-)
-FIND_LIBRARY(FREETYPE_LIBRARY
-  NAMES freetype libfreetype freetype219
-  PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
-  NO_DEFAULT_PATH
-  PATH_SUFFIXES lib64 lib
-)
-FIND_LIBRARY(FREETYPE_LIBRARY
-  NAMES freetype libfreetype freetype219
-  PATHS
-  /usr/local
-  /usr
-  /usr/local/X11R6
-  /usr/local/X11
-  /usr/X11R6
-  /usr/X11
-  /sw
-  /opt/local
-  /opt/csw
-  /opt
-  /usr/freeware
-  PATH_SUFFIXES lib64 lib
+  #PATH_SUFFIXES lib64 lib
 )

 IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
@@ -128,5 +28,3 @@
 IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
   SET(FREETYPE_FOUND "YES")
 ENDIF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
-
-


From Jean-Christophe Lombardo, "On Fedora 14, dcmtk libs are under /usr/lib/dcmtk. I've added a PATH_SUFFIX to take that into account"

--- CMakeModules/FindOurDCMTK.cmake
+++ CMakeModules/FindOurDCMTK.cmake
@@ -44,18 +44,20 @@
 )

 FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
-    ${DCMTK_DIR}/ofstd/libsrc
-    ${DCMTK_DIR}/ofstd/libsrc/Release
-    ${DCMTK_DIR}/ofstd/libsrc/Debug
-    ${DCMTK_DIR}/ofstd/Release
-    ${DCMTK_DIR}/ofstd/Debug
-    ${DCMTK_DIR}/lib
-    /usr/local/dicom/lib
-    /usr/local/lib64
-    /usr/lib64
-    /usr/local/lib
-    /usr/lib
-    /usr/local/dicom/lib
+    PATHS
+        ${DCMTK_DIR}/ofstd/libsrc
+        ${DCMTK_DIR}/ofstd/libsrc/Release
+        ${DCMTK_DIR}/ofstd/libsrc/Debug
+        ${DCMTK_DIR}/ofstd/Release
+        ${DCMTK_DIR}/ofstd/Debug
+        ${DCMTK_DIR}/lib
+        /usr/local/dicom/lib
+        /usr/local/lib64
+        /usr/lib64
+        /usr/local/lib
+        /usr/lib
+        /usr/local/dicom/lib
+    PATH_SUFFIXES dcmtk
 )

@@ -70,18 +72,20 @@
 )

 FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
-    ${DCMTK_DIR}/dcmdata/libsrc
-    ${DCMTK_DIR}/dcmdata/libsrc/Release
-    ${DCMTK_DIR}/dcmdata/libsrc/Debug
-    ${DCMTK_DIR}/dcmdata/Release
-    ${DCMTK_DIR}/dcmdata/Debug
-    ${DCMTK_DIR}/lib
-    /usr/local/dicom/lib
-    /usr/local/lib64
-    /usr/lib64
-    /usr/local/lib
-    /usr/lib
-    /usr/local/dicom/lib
+    PATHS
+        ${DCMTK_DIR}/dcmdata/libsrc
+        ${DCMTK_DIR}/dcmdata/libsrc/Release
+        ${DCMTK_DIR}/dcmdata/libsrc/Debug
+        ${DCMTK_DIR}/dcmdata/Release
+        ${DCMTK_DIR}/dcmdata/Debug
+        ${DCMTK_DIR}/lib
+        /usr/local/dicom/lib
+        /usr/local/lib64
+        /usr/lib64
+        /usr/local/lib
+        /usr/lib
+        /usr/local/dicom/lib
+    PATH_SUFFIXES dcmtk
 )

@@ -96,18 +100,20 @@
 )

 FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
-    ${DCMTK_DIR}/dcmimgle/libsrc
-    ${DCMTK_DIR}/dcmimgle/libsrc/Release
-    ${DCMTK_DIR}/dcmimgle/libsrc/Debug
-    ${DCMTK_DIR}/dcmimgle/Release
-    ${DCMTK_DIR}/dcmimgle/Debug
-    ${DCMTK_DIR}/lib
-    /usr/local/dicom/lib
-    /usr/local/lib64
-    /usr/lib64
-    /usr/local/lib
-    /usr/lib
-    /usr/local/dicom/lib
+    PATHS
+        ${DCMTK_DIR}/dcmimgle/libsrc
+        ${DCMTK_DIR}/dcmimgle/libsrc/Release
+        ${DCMTK_DIR}/dcmimgle/libsrc/Debug
+        ${DCMTK_DIR}/dcmimgle/Release
+        ${DCMTK_DIR}/dcmimgle/Debug
+        ${DCMTK_DIR}/lib
+        /usr/local/dicom/lib
+        /usr/local/lib64
+        /usr/lib64
+        /usr/local/lib
+        /usr/lib
+        /usr/local/dicom/lib
+    PATH_SUFFIXES dcmtk
 )

 FIND_PATH( DCMTK_dcmimage_INCLUDE_DIR diregist.h
@@ -121,66 +127,80 @@
 )

 FIND_LIBRARY( DCMTK_dcmimage_LIBRARY dcmimage
-    ${DCMTK_DIR}/dcmimage/libsrc
-    ${DCMTK_DIR}/dcmimage/libsrc/Release
-    ${DCMTK_DIR}/dcmimage/libsrc/Debug
-    ${DCMTK_DIR}/dcmimage/Release
-    ${DCMTK_DIR}/dcmimage/Debug
-    ${DCMTK_DIR}/lib
-    /usr/local/dicom/lib
-    /usr/local/lib64
-    /usr/lib64
-    /usr/local/lib
-    /usr/lib
-    /usr/local/dicom/lib
+    PATHS
+        ${DCMTK_DIR}/dcmimage/libsrc
+        ${DCMTK_DIR}/dcmimage/libsrc/Release
+        ${DCMTK_DIR}/dcmimage/libsrc/Debug
+        ${DCMTK_DIR}/dcmimage/Release
+        ${DCMTK_DIR}/dcmimage/Debug
+        ${DCMTK_DIR}/lib
+        /usr/local/dicom/lib
+        /usr/local/lib64
+        /usr/lib64
+        /usr/local/lib
+        /usr/lib
+        /usr/local/dicom/lib
+    PATH_SUFFIXES dcmtk
 )

 FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
-    ${DCMTK_DIR}/imagectn/libsrc/Release
-    ${DCMTK_DIR}/imagectn/libsrc/
-    ${DCMTK_DIR}/imagectn/libsrc/Debug
-    /usr/local/dicom/lib
-    /usr/local/lib64
-    /usr/lib64
-    /usr/local/lib
-    /usr/lib
-    /usr/local/dicom/lib
+    PATHS
+        ${DCMTK_DIR}/imagectn/libsrc/Release
+        ${DCMTK_DIR}/imagectn/libsrc/
+        ${DCMTK_DIR}/imagectn/libsrc/Debug
+        ${DCMTK_DIR}/lib
+        /usr/local/dicom/lib
+        /usr/local/lib64
+        /usr/lib64
+        /usr/local/lib
+        /usr/lib
+        /usr/local/dicom/lib
+    PATH_SUFFIXES dcmtk
 )

 FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
-    ${DCMTK_DIR}/dcmnet/libsrc/Release
-    ${DCMTK_DIR}/dcmnet/libsrc/Debug
-    ${DCMTK_DIR}/dcmnet/libsrc/
-    /usr/local/dicom/lib
-    /usr/local/lib64
-    /usr/lib64
-    /usr/local/lib
-    /usr/lib
-    /usr/local/dicom/lib
+    PATHS
+        ${DCMTK_DIR}/dcmnet/libsrc/Release
+        ${DCMTK_DIR}/dcmnet/libsrc/Debug
+        ${DCMTK_DIR}/dcmnet/libsrc/
+        ${DCMTK_DIR}/lib
+        /usr/local/dicom/lib
+        /usr/local/lib64
+        /usr/lib64
+        /usr/local/lib
+        /usr/lib
+        /usr/local/dicom/lib
+    PATH_SUFFIXES dcmtk
 )

 FIND_LIBRARY(DCMTK_oflog_LIBRARY oflog
-    ${DCMTK_DIR}/dcmnet/libsrc/Release
-    ${DCMTK_DIR}/dcmnet/libsrc/Debug
-    ${DCMTK_DIR}/dcmnet/libsrc/
-    /usr/local/dicom/lib
-    /usr/local/lib64
-    /usr/lib64
-    /usr/local/lib
-    /usr/lib
-    /usr/local/dicom/lib
+    PATHS
+        ${DCMTK_DIR}/dcmnet/libsrc/Release
+        ${DCMTK_DIR}/dcmnet/libsrc/Debug
+        ${DCMTK_DIR}/dcmnet/libsrc/
+        ${DCMTK_DIR}/lib
+        /usr/local/dicom/lib
+        /usr/local/lib64
+        /usr/lib64
+        /usr/local/lib
+        /usr/lib
+        /usr/local/dicom/lib
+    PATH_SUFFIXES dcmtk
 )

 FIND_LIBRARY(DCMTK_ofstd_LIBRARY ofstd
-    ${DCMTK_DIR}/dcmnet/libsrc/Release
-    ${DCMTK_DIR}/dcmnet/libsrc/Debug
-    ${DCMTK_DIR}/dcmnet/libsrc/
-    /usr/local/dicom/lib
-    /usr/local/lib64
-    /usr/lib64
-    /usr/local/lib
-    /usr/lib
-    /usr/local/dicom/lib
+    PATHS
+        ${DCMTK_DIR}/dcmnet/libsrc/Release
+        ${DCMTK_DIR}/dcmnet/libsrc/Debug
+        ${DCMTK_DIR}/dcmnet/libsrc/
+        ${DCMTK_DIR}/lib
+        /usr/local/dicom/lib
+        /usr/local/lib64
+        /usr/lib64
+        /usr/local/lib
+        /usr/lib
+        /usr/local/dicom/lib
+    PATH_SUFFIXES dcmtk
 )

 IF( DCMTK_config_INCLUDE_DIR


ENH: Superbuild - Ctk library options are now marked as advanced

--- CMake/ctkMacroAddCtkLibraryOptions.cmake
+++ CMake/ctkMacroAddCtkLibraryOptions.cmake
@@ -37,6 +37,7 @@
     FOREACH(option ${ctk_library_options})
       ctkFunctionExtractOptionNameAndValue(${option} option_name option_value)
       OPTION(CTK_LIB_${lib}_${option_name} "Enable ${lib} Library ${option_name} option." ${option_value})
+      MARK_AS_ADVANCED(CTK_LIB_${lib}_${option_name})
     ENDFOREACH()

   ENDIF()


[FIX] fixed wrong cmake syntax

[FIX] fixed wrong cmake syntax

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@14522 e6417c60-b987-48fd-844e-b20f0fcc1017

--- util/cmake/SeqAnBuildSystem.cmake
+++ util/cmake/SeqAnBuildSystem.cmake
@@ -424,9 +424,9 @@
         elseif (WIN32)
           # Add ".exe" suffix for all other Windows compilers, e.g. MinGW.
             set (ARGS "--binary-path" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}.exe")
-        else (WIN32)
+        else ()
             set (ARGS "--binary-path" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}")
-        endif (WIN32)
+        endif ()

         if (EXISTS "${STDOUT_PATH}")
             set (ARGS ${ARGS} "--stdout-path" "${STDOUT_PATH}")


On OS X Qt framework installs, QtCore/qglobal.h may not exist.  Instead,
use the QtCore header directory from cmake to find the qglobal.h file.

CCMAIL: kde-bindings@kde.org

svn path=/trunk/KDE/kdebindings/smoke/; revision=638848

--- qt/qtguess.pl.cmake
+++ qt/qtguess.pl.cmake
@@ -35,7 +35,7 @@
 my %qtundefs=();

 my $tmp = gettmpfile();
-my $qtinc = '@QT_INCLUDE_DIR@';
+my $qtcoreinc = '@QT_QTCORE_INCLUDE_DIR@';
 my $allinc = '@all_includes@';
 my $alllib = '-L@QT_LIBRARY_DIR@';
 my $qtflags = '@qtflags@';
@@ -52,7 +52,7 @@
 #
 # $qtflags =~ s/\$\((.*?)\)/$x{$1}/g;

- -e "$qtinc/QtCore/qglobal.h" or die "Invalid Qt include directory.\n";
+ -e "$qtcoreinc/qglobal.h" or die "Invalid Qt include directory.\n";

 my $ccmd = "$cc $ccflags $allinc $alllib -o $tmp $tmp.cpp $qtflags";

@@ -94,7 +94,7 @@

 sub grab_qglobal_symbols
 {
-	my $cmd = "$cc -E -D__cplusplus -dM -I$qtinc/QtCore $qtinc/QtCore/qglobal.h 2>/dev/null";
+	my $cmd = "$cc -E -D__cplusplus -dM -I$qtcoreinc $qtcoreinc/qglobal.h 2>/dev/null";
 	my $symbols = `$cmd`;
         for(0..1)
         {
@@ -115,7 +115,7 @@
 	    elsif(! $_) # first try
 	    {
 		print  "Failed to run $cmd.\nTrying without __cplusplus (might be already defined)\n";
-                $cmd = "$cc -E -dM -I$qtinc/QtCore $qtinc/QtCore/qglobal.h 2>/dev/null";
+                $cmd = "$cc -E -dM -I$qtcoreinc $qtcoreinc/qglobal.h 2>/dev/null";
                 $symbols = `$cmd`;
                 next;
 	    }


BUG: use fork of otbGRM to fix DocumentationTest

--- Modules/Remote/otbGRM.remote.cmake
+++ Modules/Remote/otbGRM.remote.cmake
@@ -11,6 +11,6 @@
 A more detailed description can be found on the project website:
 http://tully.ups-tlse.fr/lassallep/grm
 "
-  GIT_REPOSITORY http://tully.ups-tlse.fr/lassallep/grm.git
-  GIT_TAG a08d2309bc8d4f4ceaf1dba8bda33aa1e21fc4aa
+  GIT_REPOSITORY https://github.com/orfeotoolbox/GRM
+  GIT_TAG c53a61d12b895a85c3909130021988730c309cb7
 )


Forced non-parallel build for the icestorm project.

Signed-off-by: Maciej Kurc <572803cc6e8d7bb35033942e4b03254951a2e0d6@antmicro.com>

--- ice40/icestorm.cmake
+++ ice40/icestorm.cmake
@@ -54,7 +54,7 @@
     NAME icestorm
     PROVIDES iceprog icebox_hlc2asc icebox_vlog icepack icetime
     FILES share/icebox/timings_hx1k.txt
-    BUILD_INSTALL_COMMAND "make -C ${ICESTORM_SRC} clean && make -C ${ICESTORM_SRC} ${ICESTORM_PREFIX} PKG_CONFIG=${PKG-CONFIG} install"
+    BUILD_INSTALL_COMMAND "make -j1 -C ${ICESTORM_SRC} clean && make -j1 -C ${ICESTORM_SRC} ${ICESTORM_PREFIX} PKG_CONFIG=${PKG-CONFIG} install"
     DEPENDS ${LIBFTDI_TARGET} ${PKG-CONFIG} ${PKG-CONFIG_TARGET}
     )


SuperBuild: include otb version number in xdk package

--- SuperBuild/CMake/GenerateXDK.cmake
+++ SuperBuild/CMake/GenerateXDK.cmake
@@ -1,7 +1,22 @@

 message(STATUS "Setup OTB xdk...")

-set(PACKAGE_VERSION xdk)
+if(EXISTS "${CMAKE_SOURCE_DIR}/../CMakeLists.txt")
+  file(STRINGS "${CMAKE_SOURCE_DIR}/../CMakeLists.txt" _otb_version_vars   REGEX "set\\\(OTB_VERSION_")
+  file(WRITE  ${CMAKE_BINARY_DIR}/CMakeFiles/version_vars.cmake "#OTB version\n")
+  foreach(_otb_version_var ${_otb_version_vars})
+    file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/version_vars.cmake "${_otb_version_var}\n")
+  endforeach()
+  include(${CMAKE_BINARY_DIR}/CMakeFiles/version_vars.cmake)
+  if(OTB_VERSION_STRING)
+    set(PACKAGE_VERSION ${OTB_VERSION_STRING})
+  else()
+    message(FATAL_ERROR "Packaging: Cannot find OTB_VERSION_STRING!")
+  endif()
+else()
+  message(FATAL_ERROR "Packaging: File '${CMAKE_SOURCE_DIR}/../CMakeLists.txt' does not exists")
+endif()
+
 set(PACKAGE_NAME OTB)
 set(PACKAGE_LONG_NAME OrfeoToolBox)

@@ -10,7 +25,7 @@
   set(PACKAGE_ARCH Linux64)
 endif()

-set(ARCHIVE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION}-${PACKAGE_ARCH})
+set(ARCHIVE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION}-xdk-${PACKAGE_ARCH})

 set(MAKESELF_SCRIPT ${CMAKE_BINARY_DIR}/GENERATE-XDK/build/makeself.sh)


lookup_package always looks to EXTERNAL_ROOT first

Adds following when doing find_package in lookup:

- Inserts EXTERNAL_ROOT in first position of CMAKE_PREFIX_PATH if not changing root
- do find_package
- undo change to CMAKE_PREFIX_PATH

This is the only way to ensure that a newly installed packages will be found.
Had an issue where enthought has its own old version of SWIG that shadowed ours.

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -116,6 +116,10 @@
     if(dolook OR do_rootchange)
         if(do_rootchange)
             _set_root_path("${EXTERNAL_ROOT}" ONLY)
+        else()
+            # Set external root as first place to look
+            set(_SAVE_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
+            list(INSERT CMAKE_PREFIX_PATH 0 "${EXTERNAL_ROOT}")
         endif()
         find_package(${package} ${ARGN}
             ${required} ${quiet}
@@ -127,6 +131,8 @@
                 message(STATUS "Found ${package} in external "
                     "projects directory ${EXTERNAL_ROO}")
             endif()
+        else()
+            set(CMAKE_PREFIX_PATH ${_SAVE_CMAKE_PREFIX_PATH})
         endif()
     endif()
 endmacro()


install externpro/winundef.h to include/wx-ver dir

* makes it accessible if project has access to wxWidgets
* see issue https://github.com/smanders/externpro/issues/142

--- projects/wx.cmake
+++ projects/wx.cmake
@@ -148,7 +148,7 @@
       PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory
         ${wxINSTALL_DIR}/include/ ${STAGE_DIR}/include/
       CONFIGURE_COMMAND ${CMAKE_COMMAND} -Dsrc:STRING=${wxWINUNDEF}
-        -Ddst:STRING=${STAGE_DIR}/include/externpro/
+        -Ddst:STRING=<INSTALL_DIR>/externpro/
         -P ${MODULES_DIR}/cmscopyfiles.cmake
       BUILD_COMMAND ${CMAKE_COMMAND} -Dsrc:STRING=${wxSOURCE_DIR}/${TIFF_HDRS}
         -Ddst:STRING=<INSTALL_DIR>/wx/tiff/


ENH: update git tag of remote module FFSForGMM (bug in doc generation)

--- Modules/Remote/otbFFSforGMM.remote.cmake
+++ Modules/Remote/otbFFSforGMM.remote.cmake
@@ -25,5 +25,5 @@
 https://github.com/Laadr/otbFFSforGMM
 "
   GIT_REPOSITORY https://github.com/Laadr/otbFFSforGMM.git
-  GIT_TAG 1164391d09b9987f7f7ea6718347c772e31a396a
+  GIT_TAG f9aa7988fc399d8713f9e28fac15e637a783be6e
   )


CUDA SEP

CUDA SEP

--- test/BuildGPUTests.cmake
+++ test/BuildGPUTests.cmake
@@ -105,7 +105,7 @@
         ${TestHeaders} ${TestSources})
     target_link_libraries(${name} gtest_main)
     set_target_properties(${name} PROPERTIES
-        CUDA_SEPARABLE_COMPILATION OFF
+        CUDA_SEPARABLE_COMPILATION ON
         OUTPUT_NAME ${name}
         CUDA_ARCHITECTURES 35 60 70
         COMPILE_FLAGS "${GPU_GE_flags}")


修复一处声明匹配

修复一处声明匹配

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -38,7 +38,7 @@
         list(APPEND CMAKE_MODULE_LINKER_FLAGS ${def})
         list(APPEND CMAKE_SHARED_LINKER_FLAGS ${def})
 	endforeach()
-endmacro(add_linker_flags_for_all)
+endmacro(add_linker_flags_for_runtime)

 # 编译器选项 (仅做了GCC、VC和Clang兼容)


Amend HADOOP-8659. Native libraries must build with soft-float ABI for Oracle JVM on ARM. Contributed by Colin Patrick McCabe

git-svn-id: 87fadc70c6d1ec4cad1ab866a1bdcf2d7235de87@1372584 13f79535-47bb-0310-9956-ffa450edef68

--- hadoop-common-project/hadoop-common/src/JNIFlags.cmake
+++ hadoop-common-project/hadoop-common/src/JNIFlags.cmake
@@ -18,17 +18,18 @@

 cmake_minimum_required(VERSION 2.6 FATAL_ERROR)

-find_package(JNI REQUIRED)
-
 # If JVM_ARCH_DATA_MODEL is 32, compile all binaries as 32-bit.
 # This variable is set by maven.
 if (JVM_ARCH_DATA_MODEL EQUAL 32)
     # Force 32-bit code generation on amd64/x86_64, ppc64, sparc64
     if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_PROCESSOR MATCHES ".*64")
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
         set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -m32")
     endif ()
     if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
+        # Set CMAKE_SYSTEM_PROCESSOR to ensure that find_package(JNI) will use
+        # the 32-bit version of libjvm.so.
         set(CMAKE_SYSTEM_PROCESSOR "i686")
     endif ()
 endif (JVM_ARCH_DATA_MODEL EQUAL 32)
@@ -63,3 +64,5 @@
         endif ()
     endif (READELF MATCHES "NOTFOUND")
 endif (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
+
+find_package(JNI REQUIRED)


Improve CMakeBoostHelper, h/t @janoc for the suggestion.

--- cmake-local/CMakeBoostHelper.cmake
+++ cmake-local/CMakeBoostHelper.cmake
@@ -1,5 +1,11 @@
 # Help CMake find recent Boost MSVC binaries without manual configuration.
+if(MSVC)
+    if(NOT DEFINED Boost_USE_MULTITHREADED)
+        set(Boost_USE_MULTITHREADED ON) # Most common ABI
+    endif()
+endif()
 if(MSVC AND (NOT Boost_INCLUDE_DIR OR NOT Boost_LIBRARY_DIR))
+
     math(EXPR _vs_ver "${MSVC_VERSION} / 100 - 6")
     if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
         set(_libdir "lib64-msvc-${_vs_ver}.0")


VS with hardening: added guard flag, moved dynamicbase and safeseh to linker flags

--- cmake/OpenCVCompilerDefenses.cmake
+++ cmake/OpenCVCompilerDefenses.cmake
@@ -37,9 +37,13 @@

 if(MSVC)
   ocv_add_defense_compiler_flag("/GS")
-  ocv_add_defense_compiler_flag("/DynamicBase")
-  ocv_add_defense_compiler_flag("/SafeSEH")
   ocv_add_defense_compiler_flag("/sdl")
+  ocv_add_defense_compiler_flag("/guard:cf")
+  ocv_add_defense_compiler_flag("/w34018 /w34146 /w34244 /w34267 /w34302 /w34308 /w34509 /w34532 /w34533 /w34700 /w34789 /w34995 /w34996")
+  set(OPENCV_LINKER_DEFENSES_FLAGS_COMMON "${OPENCV_LINKER_DEFENSES_FLAGS_COMMON} /guard:cf /dynamicbase" )
+  if(NOT X86_64)
+    set(OPENCV_LINKER_DEFENSES_FLAGS_COMMON "${OPENCV_LINKER_DEFENSES_FLAGS_COMMON} /safeseh")
+  endif()
 elseif(CMAKE_COMPILER_IS_GNUCXX)
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
     ocv_add_defense_compiler_flag("-fstack-protector")
@@ -67,10 +71,10 @@
 endif()

 set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
-if(NOT CMAKE_CXX_FLAGS MATCHES "-fPIC")
-  ocv_add_defense_compiler_flag("-fPIC")
-endif()
 if(CMAKE_COMPILER_IS_GNUCXX)
+    if(NOT CMAKE_CXX_FLAGS MATCHES "-fPIC")
+      ocv_add_defense_compiler_flag("-fPIC")
+    endif()
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie")
 endif()


Fixed shared/static option on build.py

Fixed shared/static option on build.py

--- cmake/SetupDependenciesConan.cmake
+++ cmake/SetupDependenciesConan.cmake
@@ -37,10 +37,11 @@
     ##################################################################
     ### Install dependencies from conanfile.txt                    ###
     ##################################################################
-
+    unset(CONAN_COMMAND CACHE)
     find_program (CONAN_COMMAND conan
             HINTS ${DMRG_CONAN_CANDIDATE_PATHS}
-            PATH_SUFFIXES bin envs/dmrg/bin)
+            PATH_SUFFIXES bin envs/dmrg/bin
+            NO_CACHE)
     if(NOT CONAN_COMMAND)
         message(FATAL_ERROR "Could not find conan program executable")
     else()
@@ -68,7 +69,7 @@
     endif()

-    conan_add_remote(NAME conan-dmrg URL http://thinkstation.duckdns.org:8081/artifactory/api/conan/conan-dmrg)
+    conan_add_remote(CONAN_COMMAND ${CONAN_COMMAND} NAME conan-dmrg URL https://thinkstation.duckdns.org/artifactory/api/conan/conan-dmrg)
     conan_cmake_autodetect(CONAN_AUTODETECT)
     conan_cmake_install(
             CONAN_COMMAND ${CONAN_COMMAND}


Fix broken porting to pkg_check_modules.

svn path=/trunk/KDE/kdepim/; revision=891446

--- cmake/modules/FindOpenChange.cmake
+++ cmake/modules/FindOpenChange.cmake
@@ -24,7 +24,7 @@

   set(LIBMAPI_DEFINITIONS ${LIBMAPI_CFLAGS})
   set(LIBMAPI_INCLUDE_DIRS ${LIBMAPI_INCLUDE_DIRS})
-  set(LIBMAPI_LIBRARIES ${LIBMAPI_LIBRARY_DIRS})
+  set(LIBMAPI_LIBRARIES ${LIBMAPI_LIBRARIES})

   if (LIBMAPI_INCLUDE_DIRS AND LIBMAPI_LIBRARIES)
      set(LIBMAPI_FOUND TRUE)


Fix for ROOT-8159 - CTest doesn't test current build

--- cmake/modules/RootTestDriver.cmake
+++ cmake/modules/RootTestDriver.cmake
@@ -79,9 +79,17 @@
   endforeach()
 endif()

-if(WIN32 AND SYS)
-  file(TO_NATIVE_PATH ${SYS}/bin _path)
-  set(ENV{PATH} "${_path};$ENV{PATH}")
+if(SYS)
+  if(WIN32)
+    file(TO_NATIVE_PATH ${SYS}/bin _path)
+    set(ENV{PATH} "${_path};$ENV{PATH}")
+  elseif(APPLE)
+    set(ENV{PATH} ${SYS}/bin:$ENV{PATH})
+    set(ENV{DYLD_LIBRARY_PATH} ${SYS}/lib:$ENV{DYLD_LIBRARY_PATH})
+  else()
+    set(ENV{PATH} ${SYS}/bin:$ENV{PATH})
+    set(ENV{LD_LIBRARY_PATH} ${SYS}/lib:$ENV{LD_LIBRARY_PATH})
+  endif()
 endif()

 #---Copy files to current direcotory----------------------------------------------------------------


Add small inline documentation for some cmake utilities scripts

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -596,6 +596,7 @@

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

+# This function configures the package `NAME` for installation and for further import in client project using `find_package(<NAME>)`.
 # mandatory parameters :
 #   NAME : The name of the package to install
 #   PACKAGE_CONFIG : The package configuration file
@@ -632,6 +633,8 @@
     )
 endfunction()

+# This function configures the `<TARGET>` according to Radium requisite (exported target, namespace, package, ...), for installation and, if the parameter
+# `PACKAGE_CONFIG`is given for further import in client project using `find_package(<TARGET>)`.
 # mandatory parameters :
 #   TARGET : The name of the target to install
 #   FILES : The list of files (headers) to install
@@ -640,6 +643,7 @@
 #   TARGET_DIR : The directory where FILES will be installed (default : <prefix>/include/<TARGET>
 #   NAMESPACE : The namespace in which the library will be added (default Radium)
 #   PACKAGE_DIR : The directory in which the cmake package config file will be installed (default <prefix>/lib/cmake/Radium)
+#   PACKAGE_CONFIG : If given, a configure script, to be used by `find_package`, will be generated.
 function(configure_radium_library)
     # parse and verify args
     cmake_parse_arguments(


ENH: ExternalData: Factor atomic file write into private function

Create private atomic_write function that writes content to a temporary
file name and then atomically renames it to the final location.

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -208,6 +208,13 @@
 set(_ExternalData_SELF "${CMAKE_CURRENT_LIST_FILE}")
 get_filename_component(_ExternalData_SELF_DIR "${_ExternalData_SELF}" PATH)

+function(_ExternalData_atomic_write file content)
+  string(RANDOM LENGTH 6 random)
+  set(tmp "${file}.tmp${random}")
+  file(WRITE "${tmp}" "${content}")
+  file(RENAME "${tmp}" "${file}")
+endfunction()
+
 function(_ExternalData_arg target arg data var_file)
   # Convert to full path.
   if(IS_ABSOLUTE "${data}")
@@ -449,10 +456,7 @@
   endif()

   # Atomically update the hash/timestamp file to record the object referenced.
-  string(RANDOM LENGTH 6 random)
-  set(tmp "${file}${ext}.tmp${random}")
-  file(WRITE "${tmp}" "${hash}\n")
-  file(RENAME "${tmp}" "${file}${ext}")
+  _ExternalData_atomic_write("${file}${ext}" "${hash}\n")
 elseif("${ExternalData_ACTION}" STREQUAL "local")
   foreach(v file name)
     if(NOT DEFINED "${v}")


Updated CTK revision

Updated CTK revision

This revision contains the fix which solves the issue that data is loaded twice on double click

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

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 9331130f)
+    set(revision_tag 9331130f+65420ed0)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()
@@ -64,7 +64,7 @@
       BINARY_DIR ${proj}-build
       PREFIX ${proj}-cmake
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 c6f66556103c8d0dcae4e7db5eb0f77e
+      URL_MD5 0bdb6e34552d6a547f29408b9bf82649
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


[add_launch_test] Correct default python executable for windows debug (#239)

* Correct add_launch_test macro in windows debug

Signed-off-by: ivanpauno <f493a283e6aff807b3cc3b53203cbbb64f272da1@ekumenlabs.com>

* Use 'namespace' variable when setting Python exectuble

Signed-off-by: Jacob Perron <f862f167b85d41b225785c70d70808bc7337c1fe@openrobotics.org>

--- launch_testing_ament_cmake/cmake/add_launch_test.cmake
+++ launch_testing_ament_cmake/cmake/add_launch_test.cmake
@@ -61,6 +61,11 @@

   if(NOT ${namespace}_PYTHON_EXECUTABLE)
     set(${namespace}_PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}")
+    if(WIN32)
+      if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+        set(${namespace}_PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_DEBUG}")
+      endif()
+    endif()
   endif()

   set(${namespace}_FILE_NAME NOTFOUND)


[CMAKE] Install DLL to bin/ by default

[CMAKE] Install DLL to bin/ by default

Summary:
The shared libraries are installed by CMake to `lib/` by default, with
the exception of windows DLLs which are installed under `bin/`.
This behavior was changed in D4229 to reflect the location of the
delivered files from our release.

However it appears that the windows Gitian build is searching for the
DLL files in the `bin/` directory, before copying it to `lib/`. This
workaround is then unnecessary as it is handled by Gitian, and can be
simply removed.

Test Plan:
Cross-build for Windows:
  ninja install

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D4403

--- cmake/modules/InstallationHelper.cmake
+++ cmake/modules/InstallationHelper.cmake
@@ -3,19 +3,9 @@
 include(GNUInstallDirs)

 function(install_target _target)
-	set(RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}")
-	# CMake installs Windows shared libraries to the RUNTIME destination folder,
-	# but autotools install them into the LIBRARY destination folder.
-	# This special case only purpose is to provide identical installation trees
-	# between CMake and autotools.
-	get_target_property(_target_type ${_target} TYPE)
-	if(${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND _target_type STREQUAL "SHARED_LIBRARY")
-		set(RUNTIME_DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-	endif()
-
 	install(
 		TARGETS ${_target}
-		RUNTIME DESTINATION "${RUNTIME_DESTINATION}"
+		RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
 		LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
 		PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
 	)


[cmake] Add SOURCE_DIR argument to llvm_check_source_file_list

The motivation is to be able to check sources outside the current
directory. See D31363 for example usage.

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

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

--- cmake/modules/LLVMProcessSources.cmake
+++ cmake/modules/LLVMProcessSources.cmake
@@ -68,17 +68,29 @@

 function(llvm_check_source_file_list)
-  set(listed ${ARGN})
-  file(GLOB globbed *.c *.cpp)
+  cmake_parse_arguments(ARG "" "SOURCE_DIR" "" ${ARGN})
+  set(listed ${ARG_UNPARSED_ARGUMENTS})
+  if(ARG_SOURCE_DIR)
+    file(GLOB globbed
+         RELATIVE "${CMAKE_CURRENT_LIST_DIR}"
+         "${ARG_SOURCE_DIR}/*.c" "${ARG_SOURCE_DIR}/*.cpp")
+  else()
+    file(GLOB globbed *.c *.cpp)
+  endif()
   foreach(g ${globbed})
     get_filename_component(fn ${g} NAME)
+    if(ARG_SOURCE_DIR)
+      set(entry "${g}")
+    else()
+      set(entry "${fn}")
+    endif()

     # Don't reject hidden files. Some editors create backups in the
     # same directory as the file.
     if (NOT "${fn}" MATCHES "^\\.")
-      list(FIND LLVM_OPTIONAL_SOURCES ${fn} idx)
+      list(FIND LLVM_OPTIONAL_SOURCES ${entry} idx)
       if( idx LESS 0 )
-        list(FIND listed ${fn} idx)
+        list(FIND listed ${entry} idx)
         if( idx LESS 0 )
           message(SEND_ERROR "Found unknown source file ${g}
 Please update ${CMAKE_CURRENT_LIST_FILE}\n")


fix regression of #676

fix regression of #676

--- cmake/catkin_generate_environment.cmake
+++ cmake/catkin_generate_environment.cmake
@@ -76,10 +76,13 @@

   if(NOT CATKIN_BUILD_BINARY_PACKAGE)
     # install empty workspace marker if it doesn't already exist
-    install(CODE "
-      if (NOT EXISTS \"\${CMAKE_INSTALL_PREFIX}/.catkin\")
-        file(WRITE \"\${CMAKE_INSTALL_PREFIX}/.catkin\" \"\")
-      endif()")
+    install(CODE "
+      if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")
+        file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")
+      endif()
+      if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/.catkin\")
+        file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/.catkin\" \"\")
+      endif()")

     # generate and install Python setup util
     configure_file(${catkin_EXTRAS_DIR}/templates/_setup_util.py.in


cmake: Set TOOLCHAIN_ARCH based on OS_PLATFORM

To support a host environment of aarch64 (arm64) or x86_64 set
TOOLCHAIN_ARCH based on what OS_PLATFORM reports (which Linux will be
result of 'uname -m').

Signed-off-by: Kumar Gala <a5e5248af4cd4f0ed8c515f61d40a6e2db46a66e@linaro.org>

--- cmake/toolchain/zephyr/host-tools.cmake
+++ cmake/toolchain/zephyr/host-tools.cmake
@@ -12,7 +12,7 @@

 # This is the minimum required version for Zephyr to work (Old style)
 set(REQUIRED_SDK_VER 0.11.1)
-set(TOOLCHAIN_ARCH x86_64)
+cmake_host_system_information(RESULT TOOLCHAIN_ARCH QUERY OS_PLATFORM)

 set_ifndef(ZEPHYR_TOOLCHAIN_VARIANT $ENV{ZEPHYR_TOOLCHAIN_VARIANT} "")
 set_ifndef(ZEPHYR_SDK_INSTALL_DIR   $ENV{ZEPHYR_SDK_INSTALL_DIR} "")


fixed toolchaincompilerversion regex

fixed toolchaincompilerversion regex

--- Toolchains/android.toolchain.cmake
+++ Toolchains/android.toolchain.cmake
@@ -465,7 +465,7 @@
  else()
   execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" --version
    OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )
-  string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
+  string( REGEX MATCH "[0-9]+[.][0-9]+[.]*[0-9]*" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
  endif()
 endif()


[Conf] Now filters out the Python compiled/object files from the source package.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -253,8 +253,9 @@
   set (EDIT_IGNRD "\\\\.swp$;\\\\.#;/#;~$")
   set (SCM_IGNRD
     "/CVS/;/\\\\.svn/;/\\\\.bzr/;/\\\\.hg/;/\\\\.git/;\\\\.gitignore$")
+  set (PYTHON_IGNRD "\\\\.pyc$;\\\\.pyo$")
   set (CPACK_SOURCE_IGNORE_FILES
-    "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD}"
+    "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD};${PYTHON_IGNRD}"
     CACHE STRING "CPACK will ignore these files")
   #set (CPACK_SOURCE_IGNORE_DIRECTORY ${CPACK_SOURCE_IGNORE_FILES} .git)


set prefix

set prefix

--- share/cmake/InstallGMP.cmake
+++ share/cmake/InstallGMP.cmake
@@ -4,7 +4,8 @@
 # gmp definition
 include(ExternalProject)

-set(${MODULE_NAME}_CONFIGURE "./configure --prefix=$ENV{HOME}/local/$ENV{UNAME} --enable-fat --enable-cxx" )
+set(${MODULE_NAME}_INSTALL_DIR "$ENV{HOME}/local/$ENV{UNAME}")
+set(${MODULE_NAME}_CONFIGURE "./configure --enable-fat --enable-cxx" )
 set(${MODULE_NAME}_BUILD "make && make check")
 set(${MODULE_NAME}_INSTALL "make install")

@@ -17,6 +18,7 @@
   # SOURCE_DIR ${${MODULE_NAME}_INSTALL}
   CONFIGURE_COMMAND ${${MODULE_NAME}_CONFIGURE}
   BUILD_COMMAND ${${MODULE_NAME}_BUILD}
+  INSTALL_DIR ${${MODULE_NAME}_INSTALL_DIR}
   INSTALL_COMMAND ${${MODULE_NAME}_INSTALL}
   # Wrap download, configure and build steps in a script to log output
   LOG_DOWNLOAD ON


Suppress build and configure output on bgfx by default.

--- cmake/bgfx.cmake
+++ cmake/bgfx.cmake
@@ -52,7 +52,8 @@
     BUILD_COMMAND ${bgfx_BUILD_COMMAND}
     INSTALL_COMMAND ""
     BUILD_IN_SOURCE 1
-    # LOG_BUILD 1
+    LOG_CONFIGURE 1
+    LOG_BUILD 1
 )

 # Recover BGFX paths for additional settings.