Add Macros: Reformat CMake code

Add Macros: Reformat CMake code

--- cmake/Modules/LibAddMacros.cmake
+++ cmake/Modules/LibAddMacros.cmake
@@ -1,39 +1,32 @@
+# ~~~
 # Copy a file from source dir to binary dir
 #
 # copy_file or directory
-#
+# ~~~
 macro (copy_file src dest)
-	execute_process (
-			COMMAND
-			${CMAKE_COMMAND} -E copy
-				"${src}"
-				"${dest}"
-		)
+	execute_process (COMMAND ${CMAKE_COMMAND} -E copy "${src}" "${dest}")
 endmacro (copy_file)

+# ~~~
 # Create a symlink for a plugin both in lib and at installation
 #
 # Parameter: PLUGIN: install symlink in TARGET_PLUGIN_FOLDER subdirectory
 #
 # create_lib_symlink src dest - create a symbolic link from src -> dest
-#
+# ~~~
 macro (create_lib_symlink src dest)

 	cmake_parse_arguments (ARG
-		"PLUGIN" # optional keywords
-		"" # one value keywords
-		"" # multi value keywords
-		${ARGN}
-	)
-
-	execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink
-		"${src}"
-		"${dest}"
-		WORKING_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
-		)
+			       "PLUGIN" # optional keywords
+			       "" # one value keywords
+			       "" # multi value keywords
+			       ${ARGN})
+
+	execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink "${src}" "${dest}"
+			 WORKING_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")

 	if (NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${dest}")
-		file(WRITE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${dest}" "to be overwritten, file needs to exists for some IDEs." )
+		file (WRITE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${dest}" "to be overwritten, file needs to exists for some IDEs.")
 	endif ()

 	if (ARG_PLUGIN)
@@ -42,7 +35,9 @@
 		set (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
 	endif ()

-	install(CODE "
+	install (
+		CODE
+		"
 		message (STATUS \"Installing symlink: \$ENV{DESTDIR}${LIB_INSTALL_DIR}/${dest} -> ${src}\")
 		execute_process (COMMAND \"${CMAKE_COMMAND}\" -E make_directory
 			\"\$ENV{DESTDIR}${LIB_INSTALL_DIR}\"
@@ -60,25 +55,22 @@
 		if (RET)
 			message (WARNING \"Could not install symlink\")
 		endif ()
-		")
+		"
+		)
 endmacro (create_lib_symlink src dest)

+# ~~~
 # Make a directory
 #
 # mkdir dir
-#
+# ~~~
 macro (mkdir dir)
-	execute_process (
-			COMMAND
-			${CMAKE_COMMAND} -E make_directory
-				"${dir}"
-		)
+	execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory "${dir}")
 endmacro (mkdir)

 macro (add_testheaders HDR_FILES)
 	include_directories ("${PROJECT_SOURCE_DIR}/tests/cframework")
-	file (GLOB BIN_HDR_FILES
-		"${PROJECT_SOURCE_DIR}/tests/cframework/*.h")
+	file (GLOB BIN_HDR_FILES "${PROJECT_SOURCE_DIR}/tests/cframework/*.h")
 	list (APPEND ${HDR_FILES} ${BIN_HDR_FILES})
 endmacro (add_testheaders HDR_FILES)

@@ -91,10 +83,10 @@
 	elseif (BUILD_STATIC)
 		target_link_libraries (${TARGET} elektra-static)
 	else ()
-		message(SEND_ERROR "no elektra to link for ${TARGET}, please enable BUILD_FULL, BUILD_STATIC or BUILD_SHARED")
-	endif ()
-
-endfunction()
+		message (SEND_ERROR "no elektra to link for ${TARGET}, please enable BUILD_FULL, BUILD_STATIC or BUILD_SHARED")
+	endif ()
+
+endfunction ()

 function (target_link_elektratools TARGET)
 	if (BUILD_SHARED)
@@ -104,13 +96,13 @@
 	elseif (BUILD_STATIC)
 		target_link_libraries (${TARGET} elektratools-static)
 	else ()
-		message(SEND_ERROR "no elektratools to link for ${TARGET}, please enable BUILD_FULL, BUILD_STATIC or BUILD_SHARED")
-	endif ()
-
-endfunction()
+		message (SEND_ERROR "no elektratools to link for ${TARGET}, please enable BUILD_FULL, BUILD_STATIC or BUILD_SHARED")
+	endif ()
+
+endfunction ()

 # for tools (not tests) use this function to link against elektra
-macro(tool_link_elektra TARGET)
+macro (tool_link_elektra TARGET)
 	if (BUILD_SHARED)
 		target_link_libraries (${TARGET} elektra-core elektra-kdb ${ARGN})
 	elseif (BUILD_FULL)
@@ -118,11 +110,11 @@
 	elseif (BUILD_STATIC)
 		target_link_libraries (${TARGET} elektra-static)
 	else ()
-		message(SEND_ERROR "no elektra to link for ${TARGET}, please enable BUILD_FULL, BUILD_STATIC or BUILD_SHARED")
-	endif ()
-endmacro()
-
-macro(tool_link_elektratools TARGET)
+		message (SEND_ERROR "no elektra to link for ${TARGET}, please enable BUILD_FULL, BUILD_STATIC or BUILD_SHARED")
+	endif ()
+endmacro ()
+
+macro (tool_link_elektratools TARGET)
 	if (BUILD_SHARED)
 		target_link_libraries (${TARGET} elektratools ${ARGN})
 	elseif (BUILD_FULL)
@@ -130,22 +122,21 @@
 	elseif (BUILD_STATIC)
 		target_link_libraries (${TARGET} elektratools-static)
 	else ()
-		message(SEND_ERROR "no elektratools to link for ${TARGET}, please enable BUILD_FULL, BUILD_STATIC or BUILD_SHARED")
-	endif ()
-endmacro()
-
-
-macro(find_swig)
+		message (SEND_ERROR "no elektratools to link for ${TARGET}, please enable BUILD_FULL, BUILD_STATIC or BUILD_SHARED")
+	endif ()
+endmacro ()
+
+macro (find_swig)
 	if (NOT SWIG_FOUND)
-		find_package(SWIG 3)
+		find_package (SWIG 3)
 		if (NOT SWIG_FOUND)
-			message(STATUS "Search for swig2 instead")
-			find_package(SWIG 2)
-		endif()
+			message (STATUS "Search for swig2 instead")
+			find_package (SWIG 2)
+		endif ()
 	endif (NOT SWIG_FOUND)
-endmacro(find_swig)
-
-#
+endmacro (find_swig)
+
+# ~~~
 # find an util to pass to add_custom_command later
 #
 # Parameters:
@@ -165,48 +156,45 @@
 # find_util(elektra-export-symbols EXE_SYM_LOC EXE_SYM_ARG)
 #
 # add_custom_command (
-#		DEPENDS elektra-export-symbols
-#		COMMAND ${EXE_SYM_LOC}
-#		ARGS ${EXE_SYM_ARG} ... other arguments
-#		)
-#
-function(find_util util output_loc output_arg)
+# 		DEPENDS elektra-export-symbols
+# 		COMMAND ${EXE_SYM_LOC}
+# 		ARGS ${EXE_SYM_ARG} ... other arguments
+# 		)
+# ~~~
+function (find_util util output_loc output_arg)
 	if (CMAKE_CROSSCOMPILING)
 		if (WIN32)
-			find_program(${util}_EXE_LOC wine)
+			find_program (${util}_EXE_LOC wine)
 			if (${util}_EXE_LOC)
 				set (ARG_LOC "${CMAKE_BINARY_DIR}/bin/${util}.exe")
-			else()
-				find_program (${util}_EXE_LOC
-					HINTS
-						${CMAKE_BINARY_DIR}
-					${util}.exe)
+			else ()
+				find_program (${util}_EXE_LOC HINTS ${CMAKE_BINARY_DIR} ${util}.exe)
 			endif ()
-		else()
+		else ()
 			find_program (${util}_EXE_LOC ${util})
 		endif ()
 	else (CMAKE_CROSSCOMPILING)
-		set(${util}_EXE_LOC $<TARGET_FILE:${util}>)
+		set (${util}_EXE_LOC $<TARGET_FILE:${util}>)
 	endif (CMAKE_CROSSCOMPILING)
 	set (${output_loc} ${${util}_EXE_LOC} PARENT_SCOPE)
 	set (${output_arg} ${ARG_LOC} PARENT_SCOPE)
-endfunction(find_util util output)
-
-
-#- Adds all headerfiles of global include path to the given variable
+endfunction (find_util util output)
+
+# ~~~
+# - Adds all headerfiles of global include path to the given variable
 #
 #  ADD_HEADERS (variable)
 #
 # example:
-#add_headers (SOURCES)
-#SOURCES now contain the names of all global header files
+# add_headers (SOURCES)
+# SOURCES now contain the names of all global header files
 #
 # thus the necessary directories are also included within the macro
 # don't execute this within a loop.
 #
 # The added files will be always the same anyway. Example see in
 # tests/CMakeLists.txt
-#
+# ~~~
 macro (add_headers HDR_FILES)
 	set (BINARY_INCLUDE_DIR "${PROJECT_BINARY_DIR}/src/include")
 	set (SOURCE_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/src/include")
@@ -223,8 +211,9 @@
 	list (APPEND ${HDR_FILES} "${BINARY_INCLUDE_DIR}/kdberrors.h")
 endmacro (add_headers)

+# ~~~
 # Add all headers needed for cpp bindings
-#
+# ~~~
 macro (add_cppheaders HDR_FILES)
 	include_directories ("${PROJECT_BINARY_DIR}/src/bindings/cpp/include")
 	file (GLOB BIN_HDR_FILES ${PROJECT_BINARY_DIR}/src/bindings/cpp/include/*.hpp)
@@ -245,14 +234,15 @@
 	list (APPEND ${HDR_FILES} ${SRC_HDR_FILES})
 endmacro (add_toolheaders)

-
-#- Removes a plugin from the global cache
+# ~~~
+# - Removes a plugin from the global cache
 #
 #  REMOVE_PLUGIN (name reason)
 #
 # example:
-#remove_plugin (fstab "mntent is missing")
-#
+# remove_plugin (fstab "mntent is missing")
+#
+# ~~~
 macro (remove_plugin name reason)
 	if (NOT ${reason} STREQUAL "silent")
 		message (STATUS "Exclude Plugin ${name} because ${reason}")
@@ -276,7 +266,6 @@
 		set (REMOVED_PLUGINS "${name}" CACHE STRING "${REMOVED_PLUGINS_DOC}" FORCE)
 	endif ()
 endmacro (remove_plugin)
-

 macro (remove_tool name reason)
 	set (TMP ${TOOLS})
@@ -285,6 +274,7 @@
 	set (TOOLS ${TMP} CACHE STRING ${TOOLS_DOC} FORCE)
 endmacro (remove_tool)

+# ~~~
 # LIST_FILTER(<list> <regexp_var>
 # Removes items from <list> which match the specified
 # regular expression. An optional argument OUTPUT_VARIABLE
@@ -294,75 +284,73 @@
 # variable names whose content is the regular expressions.
 #
 # For example:
-#set (XXX "gi_a;gi_b;swig_a;gi_c;swig_d;x;y")
-#set (YYY "swig_.*")
-#list_filter(XXX YYY)
-#message (STATUS "XXX is ${XXX}") will be gi_a;gi_b;gi_c;x;y
-#
-function(list_filter result regex)
-	set(newlist)
-	foreach(r ${${result}})
-		if(r MATCHES ${${regex}})
-		else()
-			list(APPEND newlist ${r})
-		endif()
-	endforeach()
-	set(${result} ${newlist} PARENT_SCOPE)
-endfunction()
-
-#find string in list with regex
-function(list_find input_list regexp_var output)
-  # Reset output variable
-  # Extract input list from arguments
-  set(${output} "0" PARENT_SCOPE)
-  FOREACH(LIST_FILTER_item ${${input_list}})
-    FOREACH(LIST_FILTER_regexp ${${regexp_var}})
-      #message("try to match ${LIST_FILTER_regexp} with ${LIST_FILTER_item}")
-      IF(${LIST_FILTER_item} MATCHES ${LIST_FILTER_regexp})
-        set(${output} "1" PARENT_SCOPE)
-      ENDIF(${LIST_FILTER_item} MATCHES ${LIST_FILTER_regexp})
-    ENDFOREACH(LIST_FILTER_regexp ${regexp_var})
-  ENDFOREACH(LIST_FILTER_item)
-endfunction(list_find)
-
-
-
-#- Add sources for a target
+# set (XXX "gi_a;gi_b;swig_a;gi_c;swig_d;x;y")
+# set (YYY "swig_.*")
+# list_filter(XXX YYY)
+# message (STATUS "XXX is ${XXX}") will be gi_a;gi_b;gi_c;x;y
+# ~~~
+function (list_filter result regex)
+	set (newlist)
+	foreach (r ${${result}})
+		if (r MATCHES ${${regex}})
+		else ()
+			list (APPEND newlist ${r})
+		endif ()
+	endforeach ()
+	set (${result} ${newlist} PARENT_SCOPE)
+endfunction ()
+
+# ~~~
+# find string in list with regex
+# ~~~
+function (list_find input_list regexp_var output) # Reset output variable  Extract input list from arguments
+	set (${output} "0" PARENT_SCOPE)
+	foreach (LIST_FILTER_item ${${input_list}})
+		foreach (LIST_FILTER_regexp ${${regexp_var}}) # message("try to match ${LIST_FILTER_regexp} with ${LIST_FILTER_item}")
+			if (${LIST_FILTER_item} MATCHES ${LIST_FILTER_regexp})
+				set (${output} "1" PARENT_SCOPE)
+			endif (${LIST_FILTER_item} MATCHES ${LIST_FILTER_regexp})
+		endforeach (LIST_FILTER_regexp ${regexp_var})
+	endforeach (LIST_FILTER_item)
+endfunction (list_find)
+
+# ~~~
+# - Add sources for a target
 #
 #  ADD_SOURCES (<target> <source1> [<source2> ...])
 #
 # The target should add the sources using:
 #
-#get_property (elektra_SRCS GLOBAL PROPERTY elektra_SRCS)
-#list (APPEND SRC_FILES ${elektra_SRCS})
-#
-## descend into sub-directories
-#add_subdirectory(a)
-#add_subdirectory(b)
-#
-#get_property(super_SRCS GLOBAL PROPERTY super_SRCS)
-#
-#add_library(super STATIC ${super_SRCS})
-################
-#
-#a/CMakeLists.txt:
-##################
-#add_sources(super
+# get_property (elektra_SRCS GLOBAL PROPERTY elektra_SRCS)
+# list (APPEND SRC_FILES ${elektra_SRCS})
+#
+# descend into sub-directories
+# add_subdirectory(a)
+# add_subdirectory(b)
+#
+# get_property(super_SRCS GLOBAL PROPERTY super_SRCS)
+#
+# add_library(super STATIC ${super_SRCS})
+#
+#
+# a/CMakeLists.txt:
+#
+# add_sources(super
 #  a1.f
 #  a2.f
 #  a3.f
 #  )
-##################
-#
-#b/CMakeLists.txt:
-##################
-#add_sources(super
+#
+#
+# b/CMakeLists.txt:
+#
+# add_sources(super
 #  b1.f
 #  b2.f
 #  )
-##################
-#
-#Thank to Michael Wild
+#
+#
+# Thank to Michael Wild
 #
 #
 # elektra...        are the sources for all elektra targets
@@ -370,82 +358,78 @@
 #                   for elektra SHARED only (excludes elektra-full)
 # elektra-full...   are the additional sources for the versions
 #                   with all plugins built-in (excludes elektra-shared)
-#
-function (add_sources target)
-	# define the <target>_SRCS properties if necessary
+# ~~~
+function (add_sources target) # define the <target>_SRCS properties if necessary
 	get_property (prop_defined GLOBAL PROPERTY ${target}_SRCS DEFINED)
 	if (NOT prop_defined)
-		define_property (GLOBAL PROPERTY ${target}_SRCS
-			BRIEF_DOCS "Sources for the ${target} target"
-			FULL_DOCS "List of source files for the ${target} target")
-	endif (NOT prop_defined)
-	# create list of sources (absolute paths)
+		define_property (GLOBAL
+				 PROPERTY ${target}_SRCS
+				 BRIEF_DOCS "Sources for the ${target} target"
+				 FULL_DOCS "List of source files for the ${target} target")
+	endif (NOT prop_defined) # create list of sources (absolute paths)
 	set (SRCS)
 	foreach (src ${ARGN})
 		if (NOT IS_ABSOLUTE "${src}")
 			get_filename_component (src "${src}" ABSOLUTE)
 		endif (NOT IS_ABSOLUTE "${src}")
 		list (APPEND SRCS "${src}")
-	endforeach (src ${ARGN})
-	# append to global property
+	endforeach (src ${ARGN}) # append to global property
 	set_property (GLOBAL APPEND PROPERTY "${target}_SRCS" "${SRCS}")
 endfunction (add_sources)

-#- Add includes for a target
+# ~~~
+# - Add includes for a target
 #
 #  ADD_INCLUDES (<target> <source1> [<source2> ...])
 #
 # The target should do:
 #
-#get_property (elektra_INCLUDES GLOBAL PROPERTY elektra_INCLUDES)
-#include_directories (${elektra_INCLUDES})
-#
-function (add_includes target)
-	# define the <target>_INCLUDES properties if necessary
+# get_property (elektra_INCLUDES GLOBAL PROPERTY elektra_INCLUDES)
+# include_directories (${elektra_INCLUDES})
+# ~~~
+function (add_includes target) # define the <target>_INCLUDES properties if necessary
 	get_property (prop_defined GLOBAL PROPERTY ${target}_INCLUDES DEFINED)
 	if (NOT prop_defined)
-		define_property (GLOBAL PROPERTY ${target}_INCLUDES
-			BRIEF_DOCS "Sources for the ${target} target"
-			FULL_DOCS "List of source files for the ${target} target")
-	endif (NOT prop_defined)
-	# create list of sources (absolute paths)
+		define_property (GLOBAL
+				 PROPERTY ${target}_INCLUDES
+				 BRIEF_DOCS "Sources for the ${target} target"
+				 FULL_DOCS "List of source files for the ${target} target")
+	endif (NOT prop_defined) # create list of sources (absolute paths)
 	set (INCLUDES)
 	foreach (src ${ARGN})
 		list (APPEND INCLUDES "${src}")
-	endforeach (src ${ARGN})
-	# append to global property
+	endforeach (src ${ARGN}) # append to global property
 	set_property (GLOBAL APPEND PROPERTY "${target}_INCLUDES" "${INCLUDES}")
 endfunction (add_includes)

-
-#- Add libraries for a target
+# ~~~
+# - Add libraries for a target
 #
 #  ADD_LIBRARIES (<target> <source1> [<source2> ...])
 #
 # The target should do:
 #
-#get_property (elektra_LIBRARIES GLOBAL PROPERTY elektra_LIBRARIES)
-#target_link_libraries (elektra ${elektra_LIBRARIES})
-#
-function (add_libraries target)
-	# define the <target>_LIBRARIES properties if necessary
+# get_property (elektra_LIBRARIES GLOBAL PROPERTY elektra_LIBRARIES)
+# target_link_libraries (elektra ${elektra_LIBRARIES})
+#
+# ~~~
+function (add_libraries target) # define the <target>_LIBRARIES properties if necessary
 	get_property (prop_defined GLOBAL PROPERTY ${target}_LIBRARIES DEFINED)
 	if (NOT prop_defined)
-		define_property (GLOBAL PROPERTY ${target}_LIBRARIES
-			BRIEF_DOCS "Sources for the ${target} target"
-			FULL_DOCS "List of source files for the ${target} target")
-	endif (NOT prop_defined)
-	# create list of sources (absolute paths)
+		define_property (GLOBAL
+				 PROPERTY ${target}_LIBRARIES
+				 BRIEF_DOCS "Sources for the ${target} target"
+				 FULL_DOCS "List of source files for the ${target} target")
+	endif (NOT prop_defined) # create list of sources (absolute paths)
 	set (LIBRARIES)
 	foreach (src ${ARGN})
 		list (APPEND LIBRARIES "${src}")
-	endforeach (src ${ARGN})
-	# append to global property
+	endforeach (src ${ARGN}) # append to global property
 	set_property (GLOBAL APPEND PROPERTY "${target}_LIBRARIES" "${LIBRARIES}")
 endfunction (add_libraries)

-
-#- Create a static library from sources collected by MY_ADD_LIBRARY
+# ~~~
+# - Create a static library from sources collected by MY_ADD_LIBRARY
 #
 #  MY_ADD_STATIC_MODULE(<name>)
 #
@@ -454,35 +438,33 @@
 # function must be called after all calls to MY_ADD_LIBRARY()
 # contributing sources to this static module.
 #
-#Thanks to Michael Wild <themiwi@gmail.com>
-#
-function(my_add_static_module name)
-	get_property(srcs GLOBAL PROPERTY
-			MY_STATIC_MODULES_${name}_SOURCES)
+# Thanks to Michael Wild <themiwi@gmail.com>
+# ~~~
+function (my_add_static_module name)
+	get_property (srcs GLOBAL PROPERTY MY_STATIC_MODULES_${name}_SOURCES)
 	if (not SRCS)
-		message(SEND_ERROR "No sources defined for static module ${name}")
+		message (SEND_ERROR "No sources defined for static module ${name}")
 	endif (not SRCS)
-	add_library(${name} STATIC ${srcs})
-endfunction()
-
-macro(remember_for_removal ELEMENTS TO_REMOVE_ELEMENTS)
+	add_library (${name} STATIC ${srcs})
+endfunction ()
+
+macro (remember_for_removal ELEMENTS TO_REMOVE_ELEMENTS)
 	set (MY_ELEMENTS ${${ELEMENTS}})
 	set (MY_REMOVE_ELEMENTS "")
-	foreach(B ${MY_ELEMENTS})
-		if (B MATCHES "^-.*")
-			## remove pseudo "-element"
-			list(REMOVE_ITEM MY_ELEMENTS ${B})
-			string(LENGTH ${B} B_LENGTH)
-			math(EXPR L ${B_LENGTH}-1)
-			string(SUBSTRING ${B} 1 ${L} B_OUT)
-			list(APPEND MY_REMOVE_ELEMENTS ${B_OUT})
-		endif()
-	endforeach(B)
-	set(${TO_REMOVE_ELEMENTS} ${MY_REMOVE_ELEMENTS})
-	set(${ELEMENTS} ${MY_ELEMENTS})
-endmacro()
-
-macro(removal ELEMENTS TO_REMOVE_ELEMENTS)
+	foreach (B ${MY_ELEMENTS})
+		if (B MATCHES "^-.*") # remove pseudo "-element"
+			list (REMOVE_ITEM MY_ELEMENTS ${B})
+			string (LENGTH ${B} B_LENGTH)
+			math (EXPR L ${B_LENGTH}-1)
+			string (SUBSTRING ${B} 1 ${L} B_OUT)
+			list (APPEND MY_REMOVE_ELEMENTS ${B_OUT})
+		endif ()
+	endforeach (B)
+	set (${TO_REMOVE_ELEMENTS} ${MY_REMOVE_ELEMENTS})
+	set (${ELEMENTS} ${MY_ELEMENTS})
+endmacro ()
+
+macro (removal ELEMENTS TO_REMOVE_ELEMENTS)
 	if (${ELEMENTS})
 		set (MY_ELEMENTS ${${ELEMENTS}})
 		list (REMOVE_DUPLICATES MY_ELEMENTS)
@@ -491,64 +473,56 @@
 		endforeach (B)
 		set (${ELEMENTS} ${MY_ELEMENTS})
 	endif ()
-endmacro()
-
+endmacro ()

 function (generate_manpage NAME)
 	if (BUILD_DOCUMENTATION)
 		cmake_parse_arguments (ARG
-			"" # optional keywords
-			"SECTION;FILENAME" # one value keywords
-			"" # multi value keywords
-			${ARGN}
-		)
+				       "" # optional keywords
+				       "SECTION;FILENAME" # one value keywords
+				       "" # multi value keywords
+				       ${ARGN})

 		if (ARG_SECTION)
-			set(SECTION ${ARG_SECTION})
+			set (SECTION ${ARG_SECTION})
 		else ()
-			set(SECTION 1)
+			set (SECTION 1)
 		endif ()

 		if (ARG_FILENAME)
-			set(MDFILE ${ARG_FILENAME})
+			set (MDFILE ${ARG_FILENAME})
 		else ()
-			set(MDFILE ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.md)
-		endif ()
-
-		set(OUTFILE ${CMAKE_SOURCE_DIR}/doc/man/${NAME}.${SECTION})
+			set (MDFILE ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.md)
+		endif ()
+
+		set (OUTFILE ${CMAKE_SOURCE_DIR}/doc/man/${NAME}.${SECTION})

 		if (RONN_LOC)
-			add_custom_command(
-				OUTPUT ${OUTFILE}
-				DEPENDS ${MDFILE}
-				COMMAND export RUBYOPT="-Eutf-8" && ${RONN_LOC} ARGS -r --pipe ${MDFILE} > ${OUTFILE}
-			)
-			add_custom_target(man-${NAME} ALL DEPENDS ${OUTFILE})
-			add_dependencies(man man-${NAME})
+			add_custom_command (OUTPUT ${OUTFILE}
+					    DEPENDS ${MDFILE}
+					    COMMAND export RUBYOPT="-Eutf-8" && ${RONN_LOC} ARGS -r --pipe ${MDFILE} > ${OUTFILE})
+			add_custom_target (man-${NAME} ALL DEPENDS ${OUTFILE})
+			add_dependencies (man man-${NAME})
 		endif (RONN_LOC)

 		if (INSTALL_DOCUMENTATION)
-			install(
-				FILES ${OUTFILE}
-				DESTINATION share/man/man${SECTION}
-				)
+			install (FILES ${OUTFILE} DESTINATION share/man/man${SECTION})
 		endif ()
 	endif (BUILD_DOCUMENTATION)
 endfunction ()

-
 macro (split_plugin_providers PROVIDES)
 	foreach (PROVIDER "${${PROVIDES}}")
-		STRING(REGEX MATCH "([a-zA-Z0-9]+)/([a-zA-Z0-9]+)" PROVIDER_PARTS "${PROVIDER}")
-		STRING(LENGTH "${PROVIDER_PARTS}" PROVIDER_PARTS_LENGTH)
+		string (REGEX MATCH "([a-zA-Z0-9]+)/([a-zA-Z0-9]+)" PROVIDER_PARTS "${PROVIDER}")
+		string (LENGTH "${PROVIDER_PARTS}" PROVIDER_PARTS_LENGTH)
 		if (PROVIDER_PARTS_LENGTH GREATER 0)
-			STRING(REGEX REPLACE "([a-zA-Z0-9]+)/([a-zA-Z0-9]+)" "\\1;\\2" PROVIDER_PARTS "${PROVIDER_PARTS}")
-			list(APPEND ${PROVIDES} "${PROVIDER_PARTS}")
+			string (REGEX REPLACE "([a-zA-Z0-9]+)/([a-zA-Z0-9]+)" "\\1;\\2" PROVIDER_PARTS "${PROVIDER_PARTS}")
+			list (APPEND ${PROVIDES} "${PROVIDER_PARTS}")
 		endif ()
 	endforeach ()
 endmacro ()

-#
+# ~~~
 # Parameter: the pluginname
 #
 # converts a README.md (markdown texts with key/value pairs)
@@ -560,45 +534,98 @@
 # - infos/description =
 # has a special functionality: when it is used the rest of the file
 # is interpreted as description. So this key must be last.
-#
-function (generate_readme p)
-	# rerun cmake when README.md is changed
-	# also allows cmake variable substitution
-	configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_BINARY_DIR}/README.out)
+# ~~~
+function (generate_readme p) # rerun cmake when README.md is changed  also allows cmake variable substitution
+	configure_file (${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_BINARY_DIR}/README.out)

 	# read
-	FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/README.out contents)
-	STRING(REGEX REPLACE "\\\\" "\\\\\\\\" contents "${contents}")
-	STRING(REGEX REPLACE "\"" "\\\\\"" contents "${contents}")
-	STRING(REGEX REPLACE "\n" "\\\\n\"\n\"" contents "${contents}")
-	STRING(REGEX REPLACE "- infos = ([a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/licence *= *([a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/licence\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/author *= *([.@<>a-zéA-Z0-9 %_-]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/author\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-
-	STRING(REGEX MATCH "\"- +infos/provides *= *([a-zA-Z0-9/ ]*)\\\\n\"" PROVIDES "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/provides *= *([a-zA-Z0-9/ ]*)\\\\n\"" "\\1" PROVIDES "${PROVIDES}")
-	STRING(REGEX REPLACE " " ";" PROVIDES "${PROVIDES}")
+	file (READ ${CMAKE_CURRENT_BINARY_DIR}/README.out contents)
+	string (REGEX REPLACE "\\\\" "\\\\\\\\" contents "${contents}")
+	string (REGEX REPLACE "\"" "\\\\\"" contents "${contents}")
+	string (REGEX REPLACE "\n" "\\\\n\"\n\"" contents "${contents}")
+	string (REGEX
+		REPLACE "- infos = ([a-zA-Z0-9 ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+	string (REGEX
+		REPLACE "\"- +infos/licence *= *([a-zA-Z0-9 ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/licence\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+	string (REGEX
+		REPLACE "\"- +infos/author *= *([.@<>a-zéA-Z0-9 %_-]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/author\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+
+	string (REGEX MATCH "\"- +infos/provides *= *([a-zA-Z0-9/ ]*)\\\\n\"" PROVIDES "${contents}")
+	string (REGEX REPLACE "\"- +infos/provides *= *([a-zA-Z0-9/ ]*)\\\\n\"" "\\1" PROVIDES "${PROVIDES}")
+	string (REGEX REPLACE " " ";" PROVIDES "${PROVIDES}")
 	split_plugin_providers (PROVIDES)
-	STRING(REGEX REPLACE ";" " " PROVIDES "${PROVIDES}")
-	STRING(REGEX REPLACE "\"- +infos/provides *= *([a-zA-Z0-9/ ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/provides\",\nKEY_VALUE, \"${PROVIDES}\", KEY_END)," contents "${contents}")
-
-	STRING(REGEX REPLACE "\"- +infos/placements *= *([a-zA-Z0-9/ ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/placements\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/recommends *= *([a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/recommends\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/ordering *= *([a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/ordering\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/stacking *= *([a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/stacking\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/needs *= *([a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/needs\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
+	string (REGEX REPLACE ";" " " PROVIDES "${PROVIDES}")
+	string (REGEX
+		REPLACE "\"- +infos/provides *= *([a-zA-Z0-9/ ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/provides\",\nKEY_VALUE, \"${PROVIDES}\", KEY_END),"
+			contents
+			"${contents}")
+
+	string (REGEX
+		REPLACE "\"- +infos/placements *= *([a-zA-Z0-9/ ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/placements\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+	string (REGEX
+		REPLACE "\"- +infos/recommends *= *([a-zA-Z0-9 ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/recommends\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+	string (REGEX
+		REPLACE "\"- +infos/ordering *= *([a-zA-Z0-9 ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/ordering\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+	string (REGEX
+		REPLACE "\"- +infos/stacking *= *([a-zA-Z0-9 ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/stacking\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+	string (REGEX
+		REPLACE "\"- +infos/needs *= *([a-zA-Z0-9 ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/needs\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
 	if (p STREQUAL ${KDB_DEFAULT_STORAGE} OR p STREQUAL KDB_DEFAULT_RESOLVER)
-	STRING(REGEX REPLACE "\"- +infos/status *= *([-a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/status\",\nKEY_VALUE, \"\\1 default\", KEY_END)," contents "${contents}")
+		string (REGEX
+			REPLACE "\"- +infos/status *= *([-a-zA-Z0-9 ]*)\\\\n\""
+				"keyNew(\"system/elektra/modules/${p}/infos/status\",\nKEY_VALUE, \"\\1 default\", KEY_END),"
+				contents
+				"${contents}")
 	else ()
-	STRING(REGEX REPLACE "\"- +infos/status *= *([-a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/status\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	endif ()
-	STRING(REGEX REPLACE "\"- +infos/metadata *= *([/#a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/metadata\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/plugins *= *([a-zA-Z0-9 ]*)\\\\n\"" "keyNew(\"system/elektra/modules/${p}/infos/plugins\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	STRING(REGEX REPLACE "\"- +infos/description *= *(.*)\\\\n\"\n\"" "keyNew(\"system/elektra/modules/${p}/infos/description\",\nKEY_VALUE, \"\\1\", KEY_END)," contents "${contents}")
-	# allow macros:
-	STRING(REGEX REPLACE "\" *#ifdef ([^\\]*)\\\\n\"" "#ifdef \\1" contents "${contents}")
-	STRING(REGEX REPLACE "\" *#ifndef ([^\\]*)\\\\n\"" "#ifndef \\1" contents "${contents}")
-	STRING(REGEX REPLACE "\" *#else\\\\n\"" "#else" contents "${contents}")
-	STRING(REGEX REPLACE "\" *#endif\\\\n\"" "#endif" contents "${contents}")
-	FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/readme_${p}.c "${contents}\n")
-endfunction()
+		string (REGEX
+			REPLACE "\"- +infos/status *= *([-a-zA-Z0-9 ]*)\\\\n\""
+				"keyNew(\"system/elektra/modules/${p}/infos/status\",\nKEY_VALUE, \"\\1\", KEY_END),"
+				contents
+				"${contents}")
+	endif ()
+	string (REGEX
+		REPLACE "\"- +infos/metadata *= *([/#a-zA-Z0-9 ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/metadata\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+	string (REGEX
+		REPLACE "\"- +infos/plugins *= *([a-zA-Z0-9 ]*)\\\\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/plugins\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}")
+	string (REGEX
+		REPLACE "\"- +infos/description *= *(.*)\\\\n\"\n\""
+			"keyNew(\"system/elektra/modules/${p}/infos/description\",\nKEY_VALUE, \"\\1\", KEY_END),"
+			contents
+			"${contents}") # allow macros:
+	string (REGEX REPLACE "\" *#ifdef ([^\\]*)\\\\n\"" "#ifdef \\1" contents "${contents}")
+	string (REGEX REPLACE "\" *#ifndef ([^\\]*)\\\\n\"" "#ifndef \\1" contents "${contents}")
+	string (REGEX REPLACE "\" *#else\\\\n\"" "#else" contents "${contents}")
+	string (REGEX REPLACE "\" *#endif\\\\n\"" "#endif" contents "${contents}")
+	file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/readme_${p}.c "${contents}\n")
+endfunction ()


cmake: support static and shared swift libraries

Enhance add_wift_target to support building static libraries.  We would
always generate shared libraries previously.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -148,6 +148,7 @@
                          ${documentation})
   else()
     add_library(${target}-static STATIC ${objs})
+    add_dependencies(${target}-static ${AST_DEPENDS})
     get_filename_component(ast_output_bn ${AST_OUTPUT} NAME)
     get_filename_component(ast_output_dn ${AST_OUTPUT} DIRECTORY)
     set_target_properties(${target}-static


cmake nuttx rsync copy only use relative paths

 - this is to work around confusion between cygwin and windows native
   paths
 - closes #6332

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -255,12 +255,15 @@

 	# copy
 	file(GLOB_RECURSE nuttx_all_files ${PX4_SOURCE_DIR}/NuttX/*)
+	file(RELATIVE_PATH nuttx_cp_src ${PX4_BINARY_DIR} ${PX4_SOURCE_DIR}/NuttX)
 	add_custom_command(OUTPUT nuttx_copy_${CONFIG}.stamp
 		COMMAND ${MKDIR} -p ${nuttx_src}
-		COMMAND rsync -a --delete --exclude=.git ${PX4_SOURCE_DIR}/NuttX/ ${nuttx_src}/
+		COMMAND rsync -a --delete --exclude=.git ${nuttx_cp_src}/ ${CONFIG}/NuttX/
 		COMMAND ${TOUCH} nuttx_copy_${CONFIG}.stamp
 		DEPENDS ${DEPENDS} ${nuttx_patches} ${nuttx_all_files}
-		COMMENT "Copying NuttX for ${CONFIG} with ${config_nuttx_config}")
+		COMMENT "Copying NuttX for ${CONFIG} with ${config_nuttx_config}"
+		WORKING_DIRECTORY ${PX4_BINARY_DIR}
+		)
 	add_custom_target(nuttx_copy_${CONFIG} DEPENDS nuttx_copy_${CONFIG}.stamp)

 	# patch


fix missing stack check instrument_flags (#4593)

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -439,6 +439,16 @@

 	set(added_exe_linker_flags) # none currently

+	set(instrument_flags)
+	if ("${config_nuttx_hw_stack_check_${BOARD}}" STREQUAL "y")
+		set(instrument_flags
+			-finstrument-functions
+			-ffixed-r10
+			)
+		list(APPEND c_flags ${instrument_flags})
+		list(APPEND cxx_flags ${instrument_flags})
+	endif()
+
 	set(cpu_flags)
 	if (${BOARD} STREQUAL "px4fmu-v1")
 		set(cpu_flags


ENH: Set proper location of baselines

ENH: Set proper location of baselines

--- CMake/ExamplesTesting.cmake
+++ CMake/ExamplesTesting.cmake
@@ -17,7 +17,7 @@
   set_property(TEST ${KIT}-${EXAMPLE} PROPERTY LABELS WikiExamples)
 endforeach(SOURCE_FILE)
 SET(VTK_BINARY_DIR ${WikiExamples_BINARY_DIR})
-SET(VTK_DATA_ROOT ${WikiExamples_SOURCE_DIR}/Testing)
+SET(VTK_DATA_ROOT ${WikiExamples_SOURCE_DIR}/src/Testing)
 INCLUDE(${WikiExamples_SOURCE_DIR}/CMake/vtkTestingObjectFactory.cmake)
 ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
                ${MyTests})


BUG: Updated ExternlProject.cmake / generation of <project>-gitclone.cmake

In <Project>-gitclone.cmake, error message were displayed using single quote, change
it to use double quote. That error message will be displayer with spaces.

--- CMake/ExternalProject.cmake
+++ CMake/ExternalProject.cmake
@@ -719,7 +719,7 @@
   RESULT_VARIABLE error_code
   )
 if(error_code)
-  message(FATAL_ERROR 'Failed to clone repository: ${git_repository}')
+  message(FATAL_ERROR \"Failed to clone repository: ${git_repository}\")
 endif()
 ")
     set(comment "Performing download step (GIT clone) for '${name}'")


Fixes to find IDL in pre-IDL 8.0 directory scheme as well.

--- CMake/Modules/FindIDL.cmake
+++ CMake/Modules/FindIDL.cmake
@@ -18,7 +18,13 @@
 if (NOT DEFINED IDL_FIND_VERSION)
   set(_IDL_KNOWN_VERSIONS "81" "80" "71" "706")

-  set(_IDL_SEARCH_DIRS "${_IDL_PROGRAM_FILES_DIR}/${_IDL_NAME}")
+  set(_IDL_SEARCH_DIRS "${_IDL_PROGRAM_FILES_DIR}")
+  foreach (_IDL_KNOWN_VERSION ${_IDL_KNOWN_VERSIONS})
+    list(APPEND _IDL_SEARCH_DIRS
+         "${_IDL_PROGRAM_FILES_DIR}${_IDL_KNOWN_VERSION}")
+  endforeach ()
+
+  list(APPEND _IDL_SEARCH_DIRS "${_IDL_PROGRAM_FILES_DIR}/${_IDL_NAME}")
   foreach (_IDL_KNOWN_VERSION ${_IDL_KNOWN_VERSIONS})
     list(APPEND _IDL_SEARCH_DIRS
          "${_IDL_PROGRAM_FILES_DIR}/${_IDL_NAME}${_IDL_KNOWN_VERSION}")


erthink-cmake: fix CMAKE_COMPILER_IS_GNUc typo.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -199,7 +199,7 @@
 endif()

 # Check for LTO support by GCC
-if(CMAKE_COMPILER_IS_GNUC${CMAKE_PRIMARY_LANG})
+if(CMAKE_COMPILER_IS_GNU${CMAKE_PRIMARY_LANG})
   unset(gcc_collect)
   unset(gcc_lto_wrapper)

@@ -347,7 +347,7 @@

 set(HAVE_BFD False)
 if(ENABLE_BACKTRACE)
-  if(NOT CMAKE_COMPILER_IS_GNUC${CMAKE_PRIMARY_LANG})
+  if(NOT (X86_32 OR X86_64) OR NOT CMAKE_COMPILER_IS_GNU${CMAKE_PRIMARY_LANG})
     # We only know this option to work with gcc
     message(FATAL_ERROR "ENABLE_BACKTRACE option is set but the system
       is not x86 based (${CMAKE_SYSTEM_PROCESSOR}) or the compiler


cmake: abandon lsb_release command to check distribution

Signed-off-by: Artur Wojcik <ea75e86c6673ace627dcd6a91fbef5d4fea719d0@intel.com>

--- cmake/platform.cmake
+++ cmake/platform.cmake
@@ -15,46 +15,30 @@
 # ******************************************************************************

 if (NOT WINDOWS)
-    find_program(LSB_RELEASE lsb_release)
-    if (LSB_RELEASE-NOTFOUND)
-        if (EXISTS "/etc/lsb-release")
-            file(STRINGS "/etc/lsb-release" __lsb_release_file_content)
-            foreach(__line ${__lsb_release_file_content})
-                string(STRIP __line ${__line})
-                string(REGEX MATCH "^(.+)=(.*)$" __lsb_release_values_check ${__line})
-                set(${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
-            endforeach()
-        elseif (EXISTS "/etc/os-release")
-            file(STRINGS "/etc/os-release" __os_release_file_content)
-            foreach(__line ${__os_release_file_content})
-                string(STRIP __line ${__line})
-                string(REGEX MATCH "^(.+)=(.*)$" __os_release_values_check ${__line})
-                string(REPLACE "\"" "" __variable_value ${CMAKE_MATCH_2})
-                set(__${CMAKE_MATCH_1} ${__variable_value})
-            endforeach()
-            set(DISTRIB_ID ${__NAME})
-            set(DISTRIB_CODENAME ${__VERSION_CODENAME})
-            set(DISTRIB_RELEASE ${__VERSION_ID})
-            set(DISTRIB_DESCRIPTION ${__PRETTY_NAME})
-        else()
-            unset(DISTRIB_ID "?unknown?")
-            unset(DISTRIB_CODENAME)
-            unset(DISTRIB_RELEASE)
-            unset(DISTRIB_DESCRIPTION)
-        endif()
+    if (EXISTS "/etc/lsb-release")
+        file(STRINGS "/etc/lsb-release" __lsb_release_file_content)
+        foreach(__line ${__lsb_release_file_content})
+            string(STRIP __line ${__line})
+            string(REGEX MATCH "^(.+)=(.*)$" __lsb_release_values_check ${__line})
+            set(${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
+        endforeach()
+    elseif (EXISTS "/etc/os-release")
+        file(STRINGS "/etc/os-release" __os_release_file_content)
+        foreach(__line ${__os_release_file_content})
+            string(STRIP __line ${__line})
+            string(REGEX MATCH "^(.+)=(.*)$" __os_release_values_check ${__line})
+            string(REPLACE "\"" "" __variable_value ${CMAKE_MATCH_2})
+            set(__${CMAKE_MATCH_1} ${__variable_value})
+        endforeach()
+        set(DISTRIB_ID ${__NAME})
+        set(DISTRIB_CODENAME ${__VERSION_CODENAME})
+        set(DISTRIB_RELEASE ${__VERSION_ID})
+        set(DISTRIB_DESCRIPTION ${__PRETTY_NAME})
     else()
-        execute_process(COMMAND ${LSB_RELEASE} -is
-                OUTPUT_VARIABLE DISTRIB_ID
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${LSB_RELEASE} -rs
-                OUTPUT_VARIABLE DISTRIB_RELEASE
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${LSB_RELEASE} -cs
-                OUTPUT_VARIABLE DISTRIB_CODENAME
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${LSB_RELEASE} -ds
-                OUTPUT_VARIABLE DISTRIB_DESCRIPTION
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
+        unset(DISTRIB_ID "?unknown?")
+        unset(DISTRIB_CODENAME)
+        unset(DISTRIB_RELEASE)
+        unset(DISTRIB_DESCRIPTION)
     endif()
 else()
     message(FATAL_ERROR "The software is not designed for platform: ${CMAKE_SYSTEM_NAME}")


fbcode_builder: use build interface generator expression for thrift include directories

Summary:
Fix an error about source directories being included in the include
path in add_thrift_cpp2_library. I don't know why this was failing for
fb303 and not for other projects, but adding a generation expression
appears to fix the issue.

Reviewed By: strager

Differential Revision: D15725024

fbshipit-source-id: 6c02fed6c6703733cf9e0b130c0f90b70e3ea300

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -105,8 +105,8 @@
   target_include_directories(
     ${LIB_NAME}
     PUBLIC
-      ${CMAKE_SOURCE_DIR}
-      ${CMAKE_BINARY_DIR}
+      $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
+      $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
       ${FOLLY_INCLUDE_DIR}
       ${FBTHRIFT_INCLUDE_DIR}
   )


Tidy configure_version_cpp_file.in.cmake.

--- cmake/configure_version_cpp_file.in.cmake
+++ cmake/configure_version_cpp_file.in.cmake
@@ -7,18 +7,15 @@
 set(Zinc_VERSION_MAJOR ${Zinc_VERSION_MAJOR})
 set(Zinc_VERSION_MINOR ${Zinc_VERSION_MINOR})
 set(Zinc_VERSION_PATCH ${Zinc_VERSION_PATCH})
-set(ZINC_REVISION_LONG ${ZINC_REVISION_LONG})
 string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)

 list(APPEND CMAKE_MODULE_PATH "${ZINC_CMAKE_MODULE_PATH}/Modules")
 find_package(Git QUIET)

-set(ZINC_REVISION "no-revision")
+set(ZINC_REVISION_LONG "no-revision")
 if (GIT_FOUND)
     git_get_revision(ZINC_REVISION_LONG WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 endif()

-
-message(STATUS "Configuring the damn file with some values!!!${ZINC_REVISION_LONG}!")
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/source/configure/version.cpp.cmake
 	${ZINC_VERSION_STAGING_SRC} @ONLY)


vpr: suppress RR graph tool comment warning

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

--- xc/common/cmake/arch_define.cmake
+++ xc/common/cmake/arch_define.cmake
@@ -74,7 +74,7 @@
       --bb_factor 10 \
       --initial_pres_fac 4.0 \
       --check_rr_graph off \
-      --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"
+      --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_rr_graph_tool_comment"
       )

   set(YOSYS_CELLS_SIM ${YOSYS_DATADIR}/xilinx/cells_sim.v)


ENH: adding support for template which don't end in ImageFilter

--- CMake/generate_filter_source.cmake
+++ CMake/generate_filter_source.cmake
@@ -12,13 +12,14 @@

   # Get the line from the json file that indicates the correct template
   file(STRINGS ${json_file} template_line REGEX ".*template_code_filename.*")
-  string(REGEX MATCH ":.*\".*ImageFilter" first_strip ${template_line})
+  string(REGEX MATCH ":.*\".*\"" first_strip ${template_line})

   # Only continue if we found something for first_strip
   if(first_strip)

-    # Strip down to just the name and then fill out full path
-    string(REGEX MATCH "[^\"]*ImageFilter" template_name ${first_strip})
+    # strip down to what in between the ""
+    string(REGEX MATCH "\".+\"" second_strip ${first_strip})
+    string(REGEX MATCH "[^\"]+" template_name ${second_strip} )
     set(template_file_h ${input_dir}/templates/sitk${template_name}Template.h.in)
     set(template_file_cxx ${input_dir}/templates/sitk${template_name}Template.cxx.in)

@@ -133,6 +134,7 @@
   # Glob all json files in the current directory
   file ( GLOB json_config_files ${generated_code_input_path}/json/[a-zA-Z]*.json)

+  message( "Processing json files..." )
   # Loop through json files and expand each one
   foreach ( f ${json_config_files} )
     get_filename_component ( class ${f} NAME_WE )


FindVOTCA_TOOLS.cmake: update copyright

FindVOTCA_TOOLS.cmake: update copyright

--- CMakeModules/FindVOTCA_TOOLS.cmake
+++ CMakeModules/FindVOTCA_TOOLS.cmake
@@ -6,7 +6,7 @@
 #  VOTCA_TOOLS_FOUND        - True if expat found.
 #  VOTCA_TOOLS_HAS_SQLITE3  - True if votca tools was build with sqlite3 support
 #
-# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
+# Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org)
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.


Remove conditional to add variables to propagation list

The variables in the superbuild variable propagation list are only
propagated if they are defined, and not empty. Therefore there is no
need to conditionally add the variable.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -222,6 +222,7 @@
   CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO

   CMAKE_STRIP
+  CMAKE_STRIP_FLAGS

   CMAKE_PREFIX_PATH
   CMAKE_FRAMEWORK_PATH
@@ -241,18 +242,11 @@
   SITE
   BUILDNAME

-  SKBUILD )
-
-if( APPLE )
-  list( APPEND ep_common_list
-    CMAKE_OSX_SYSROOT
-    CMAKE_OSX_DEPLOYMENT_TARGET )
-endif()
-
-if( DEFINED CMAKE_STRIP_FLAGS )
-  list( APPEND ep_common_list
-    CMAKE_STRIP_FLAGS )
-endif()
+  SKBUILD
+
+  CMAKE_OSX_SYSROOT
+  CMAKE_OSX_DEPLOYMENT_TARGET
+)

 VariableListToArgs( ep_common_list ep_common_args )


Fix flags (need to split out Algo factory generation)

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -97,8 +97,6 @@
   SET(DOWNLOAD_TOOLKITS OFF)
   SET(BUILD_HEADLESS ON)
   SET(BUILD_WITH_PYTHON OFF)
-  SET(REGENERATE_MODULE_FACTORY_CODE OFF)
-  SET(GENERATE_MODULE_FACTORY_CODE OFF)
 ENDIF()

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


make GSL throw on contract violation

make GSL throw on contract violation

This behaviour can be changed with cmake

--- Dependencies/cmake/ImportGSL.cmake
+++ Dependencies/cmake/ImportGSL.cmake
@@ -1,6 +1,8 @@
 cmake_minimum_required(VERSION 3.2 FATAL_ERROR)

 add_library(GSL INTERFACE IMPORTED)
+
+option(GSL_THROW_ON_CONTRACT_VALIDATION "Sould GSL throw on contract validation?" YES)

 if (APPLE)
   set_property(TARGET GSL PROPERTY INTERFACE_COMPILE_OPTIONS
@@ -11,3 +13,9 @@
     ${DEPENDENCIES_DIR}/GSL/include
   )
 endif()
+
+if(GSL_THROW_ON_CONTRACT_VALIDATION)
+  set_property(TARGET GSL PROPERTY INTERFACE_COMPILE_DEFINITIONS
+    GSL_THROW_ON_CONTRACT_VIOLATION
+  )
+endif()


Remove reference to specific SDK include

--- projects/python.cmake
+++ projects/python.cmake
@@ -1,10 +1,8 @@
-set_property(GLOBAL PROPERTY python_APPEND_PROJECT_ONLY_FLAGS_CMAKE_C_FLAGS -I${CMAKE_OSX_SYSROOT}/usr/include)
 add_external_project_or_use_system(python
   CONFIGURE_COMMAND <SOURCE_DIR>/configure
                     --prefix=<INSTALL_DIR>
                     --enable-unicode=ucs4
                     --enable-shared
-  PROCESS_ENVIRONMENT CFLAGS -I${CMAKE_OSX_SYSROOT}/usr/include
   )
 set (pv_python_executable "${install_location}/bin/python3" CACHE INTERNAL "" FORCE)


[CMake] Make sure add_compiler_rt_resource_file doesn't do unnecessary work

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -138,9 +138,11 @@
 macro(add_compiler_rt_resource_file target_name file_name)
   set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}")
   set(dst_file "${COMPILER_RT_OUTPUT_DIR}/${file_name}")
-  add_custom_target(${target_name}
+  add_custom_command(OUTPUT ${dst_file}
+    DEPENDS ${src_file}
     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file}
-    DEPENDS ${file_name})
+    COMMENT "Copying ${file_name}...")
+  add_custom_target(${target_name} DEPENDS ${dst_file})
   # Install in Clang resource directory.
   install(FILES ${file_name} DESTINATION ${COMPILER_RT_INSTALL_PATH})
 endmacro()


Small update to bundle macro to be able to specify link libraries.

git-svn-id: 2595ac559ac7dd568b108f33b264eba7ab70070c@1651194 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/cmake_celix/Packaging.cmake
+++ cmake/cmake_celix/Packaging.cmake
@@ -160,7 +160,7 @@

 MACRO(bundle)
-    PARSE_ARGUMENTS(_BUNDLE "SOURCES;EXPORT_VERSION;ACTIVATOR;PRIVATE_LIBRARIES;EXPORT_LIBRARIES;IMPORT_LIBRARIES;FILES;DIRECTORIES;INSTALL_FILES" "PRIVATE;EXPORT;INSTALL" ${ARGN})
+    PARSE_ARGUMENTS(_BUNDLE "SOURCES;LINK_LIBRARIES;EXPORT_VERSION;ACTIVATOR;PRIVATE_LIBRARIES;EXPORT_LIBRARIES;IMPORT_LIBRARIES;FILES;DIRECTORIES;INSTALL_FILES" "PRIVATE;EXPORT;INSTALL" ${ARGN})
     LIST(GET _BUNDLE_DEFAULT_ARGS 0 _BUNDLE_NAME)

     CHECK_HEADERS()
@@ -176,6 +176,7 @@

     if(_BUNDLE_SOURCES)
         add_library(${_BUNDLE_NAME} SHARED ${_BUNDLE_SOURCES})
+        target_link_libraries(${_BUNDLE_NAME} ${_BUNDLE_LINK_LIBRARIES})
         SET_HEADERS("Bundle-Activator: ${_BUNDLE_NAME}")
     else(_BUNDLE_SOURCES)
         add_custom_target(${_BUNDLE_NAME})


Need httpserver for root7.

Need httpserver for root7.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -120,6 +120,7 @@
     message(STATUS "ROOT7 interfaces require >= cxx14 which is disabled. Switching OFF root7 option")
     set(root7 OFF CACHE BOOL "" FORCE)
   endif()
+    set(http ON CACHE BOOL "" FORCE)
 endif()

 #---Check for libcxx option------------------------------------------------------------


conan: prevent replacement of parent configuration

--- cmake/modules/ConanPackages.cmake
+++ cmake/modules/ConanPackages.cmake
@@ -1,6 +1,11 @@
 include(CMakeParseArguments)

 function(install_conan_packages)
+  get_directory_property(HAS_PARENT PARENT_DIRECTORY)
+  if(HAS_PARENT)
+    return()
+  endif()
+
   set(OPTIONS SYSTEM_HEADERS)
   set(SV_ARGUMENTS LIBCXX CONANFILE)
   set(MV_ARGUMENTS PKGOPTS)


cmake: see if ln -s works

cmake: see if ln -s works

--- cmake/Modules/LibAddMacros.cmake
+++ cmake/Modules/LibAddMacros.cmake
@@ -27,11 +27,18 @@

 	install(CODE "
 		message (STATUS \"Installing symlink: \$ENV{DESTDIR}${LIB_INSTALL_DIR}/${dest} -> ${src}\")
-		execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
-			\"${src}\"
-			\"${dest}\"
-			WORKING_DIRECTORY \"\$ENV{DESTDIR}${LIB_INSTALL_DIR}\"
+#		execute_process (COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
+#			\"${src}\"
+#			\"${dest}\"
+#			WORKING_DIRECTORY \"\$ENV{DESTDIR}${LIB_INSTALL_DIR}\"
+#			RESULT_VARIABLE RET
+#			)
+		execute_process (COMMAND ln -s \"${src}\" \"\$ENV{DESTDIR}${LIB_INSTALL_DIR}/${dest}\"
+			RESULT_VARIABLE RET
 			)
+		if (RET)
+			message (WARNING \"Could not install symlink\")
+		endif ()
 		")
 endmacro (create_lib_symlink src dest)


Added option for tinyxml2

Added option for tinyxml2

--- cmake/modules/FindTinyXML2.cmake
+++ cmake/modules/FindTinyXML2.cmake
@@ -1,6 +1,8 @@
 # TINYXML2_FOUND
 # TINYXML2_INCLUDE_DIR
 # TINYXML2_SOURCE_DIR
+
+option(TINYXML2_FROM_SOURCE "Integrate TinyXML2 source code inside Fast RTPS" OFF)

 find_package(TinyXML2 CONFIG QUIET)
 if(TinyXML2_FOUND)
@@ -11,6 +13,10 @@
         set(TINYXML2_LIBRARY tinyxml2)
     endif()
 else()
+    if(THIRDPARTY)
+        set(TINYXML2_FROM_SOURCE ON)
+    endif()
+
     if(THIRDPARTY OR ANDROID)
         find_path(TINYXML2_INCLUDE_DIR NAMES tinyxml2.h NO_CMAKE_FIND_ROOT_PATH)
     else()
@@ -18,7 +24,7 @@
     endif()

-    if(THIRDPARTY)
+    if(TINYXML2_FROM_SOURCE)
         find_path(TINYXML2_SOURCE_DIR NAMES tinyxml2.cpp NO_CMAKE_FIND_ROOT_PATH)
     else()
         find_library(TINYXML2_LIBRARY tinyxml2)
@@ -26,7 +32,7 @@

     include(FindPackageHandleStandardArgs)

-    if(THIRDPARTY)
+    if(TINYXML2_FROM_SOURCE)
         find_package_handle_standard_args(tinyxml2 DEFAULT_MSG TINYXML2_SOURCE_DIR TINYXML2_INCLUDE_DIR)

         mark_as_advanced(TINYXML2_INCLUDE_DIR TINYXML2_SOURCE_DIR)


zephyr: Fix the coverage property for linker/lld.

Zephyr has a linker config for clang, but we don't use that and instead
have our own linker definition for ld.lld. If you have code coverage
enabled, the --coverage flag is missing from the link step. This fixes
that.

BUG=b:183007888
TEST=Add CONFIG_COVERAGE=y to test/base32/prj.conf and zmake.
BRANCH=none

Signed-off-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Change-Id: Ibb3d420cf92e48507768f916fa4792d5bc90e2d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2765150
Reviewed-by: Simon Glass <c00b0378376498bd9cd974c388df8854c0131d27@chromium.org>

--- zephyr/cmake/linker/lld/linker_flags.cmake
+++ zephyr/cmake/linker/lld/linker_flags.cmake
@@ -4,3 +4,5 @@

 # Include definitions for bfd as a base.
 include("${ZEPHYR_BASE}/cmake/linker/ld/linker_flags.cmake")
+
+set_property(TARGET linker PROPERTY coverage --coverage)


Fix file extension for windows (.pyd)

Fix file extension for windows (.pyd)

--- cyitk/cyitkConfigureModule.cmake
+++ cyitk/cyitkConfigureModule.cmake
@@ -121,6 +121,15 @@
     file(APPEND ${CYITK_MODULE_BINARY_DIR}/${CYITK_INIT_PY} "from ${MODULE_NAME} import *\n")
   endforeach(CPP_FILE)

+  set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
+  if (CMAKE_HOST_WIN32)
+      set_target_properties(${MODULE_NAME} PROPERTIES SUFFIX ".pyd")
+  endif(CMAKE_HOST_WIN32)
+  set_target_properties(${CYITK_IMAGE_CLASSES_TARGET_NAME} PROPERTIES PREFIX "")
+  if (CMAKE_HOST_WIN32)
+      set_target_properties(${CYITK_IMAGE_CLASSES_TARGET_NAME} PROPERTIES SUFFIX ".pyd")
+  endif(CMAKE_HOST_WIN32)
+
   #install
 endmacro(cyitk_configure_module)


Remove clean-mod targets

Remove clean-mod targets

--- test/module_test.cmake
+++ test/module_test.cmake
@@ -85,20 +85,6 @@
   COMMAND rm -f ${OUTPUT_FILE_CPU} ${OUTPUT_FILE_GPU}
 )

-# Clean module file between compilation as it change
-add_custom_target(
-  clean-mod-file-${TEST_NAME}
-  COMMAND rm -f *.mod
-)
-add_custom_target(
-  clean-mod-file-${TEST_NAME}-gpu
-  COMMAND rm -f *.mod
-)
-add_custom_target(
-  clean-mod-file-${TEST_NAME}-cpu
-  COMMAND rm -f *.mod
-)
-
 # Add target to the global build/clean target
 add_dependencies(${BUILD_TEST_TARGET} transform-${TEST_NAME})
 add_dependencies(${CLEAN_TEST_TARGET} clean-${TEST_NAME})
@@ -112,10 +98,6 @@
 target_compile_definitions(${EXECUTABLE_TRANSFORMED_CPU} PRIVATE -D_CLAW)
 add_executable (${EXECUTABLE_TRANSFORMED_GPU} EXCLUDE_FROM_ALL "${OUTPUT_FILE_GPU}" "${CMAKE_CURRENT_SOURCE_DIR}/${GPU_DIR}/main.f90")
 target_compile_definitions(${EXECUTABLE_TRANSFORMED_GPU} PRIVATE -D_CLAW)
-
-add_dependencies(${EXECUTABLE_ORIGINAL} clean-mod-file-${TEST_NAME})
-add_dependencies(${EXECUTABLE_TRANSFORMED_CPU} clean-mod-file-${TEST_NAME}-cpu)
-add_dependencies(${EXECUTABLE_TRANSFORMED_GPU} clean-mod-file-${TEST_NAME}-gpu)

 if(NOT IGNORE_TEST)
   # Compare reference transformed code and output of the transformation


Fix feature display for SIMD

Fix feature display for SIMD

--HG--
branch : v2-0

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -169,7 +169,7 @@
 var_to_string(OGRE_CONFIG_MEMTRACK_RELEASE _memtrack_release)
 var_to_string(OGRE_CONFIG_STRING_USE_CUSTOM_ALLOCATOR _string)
 var_to_string(OGRE_USE_BOOST _boost)
-var_to_string(OGRE_USE_SIMD _simd)
+var_to_string(OGRE_SIMD _simd)
 # threading settings
 if (OGRE_CONFIG_THREADS EQUAL 0)
 	set(_threads "none")


SuperBuild: Qt4: no-fontconfig if gtk is disabled (for minimal libs)

--- SuperBuild/CMake/External_qt4.cmake
+++ SuperBuild/CMake/External_qt4.cmake
@@ -57,7 +57,7 @@
       message(WARNING "QT4_SB_ENABLE_GTK support is experimental")
       set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -sm -xrender -xrandr -gtkstyle")
     else()
-      set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-gtkstyle -no-glib")
+      set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-gtkstyle -no-glib -no-fontconfig")
     endif()
   endif()
   #common for all unix


Add possibilite of launch local tests in developpement directory
using in trunk/test  this command :  LOCAL_TEST=TRUE ctest

git-svn-id: 8b72b58fb31a931b6e9a2bd3bb08bc6614045fb1@3509 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- test/CTestTestfile.cmake
+++ test/CTestTestfile.cmake
@@ -7,13 +7,23 @@
 #    The unique name of the test ( eg.: testname1 )
 #    The full path to the executable of the test ( eg.: "$ENV{HOME}/bin/TEST_EXECUTABLE_1.sh" )
 #    A List of arguments to the executable ( eg.: "ARGUMENT_1" "ARGUMENT_2" etc. )
-
-
+
 # basic test (just for sample) check that binary directory is readable
 #ADD_TEST(LS_BINARY_PATH "ls" "-all")
 #ADD_TEST(PWD_BINARY_PATH "pwd")

+
+
 ## -- Other Tests : Place a file named DartTestfile.txt in path with tests.
+
+# If you want to run only test in your developpement machine locallly you can run (on bash shell) this command in this directory
+# LOCAL_TEST=TRUE ctest
+IF($ENV{LOCAL_TEST} MATCHES TRUE)
+	set(OV_ROOT_DIR              "$ENV{PWD}/..")
+	set(CTEST_SOURCE_DIRECTORY		"${OV_ROOT_DIR}")
+	set($ENV{OV_BINARY_PATH} "${OV_ROOT_DIR}/dist")
+	message("running local test here= $ENV{OV_BINARY_PATH}")
+ENDIF($ENV{LOCAL_TEST} MATCHES TRUE)

 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-plugins/acquisition/trunc/test")
@@ -57,65 +67,8 @@
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-applications/acquisition-server/trunc/test")
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-documentation/trunc/test")
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe/tags/wip-omk4/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe/trunc/test")
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-toolkit/trunc/test")
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-scenarios/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/acquisition/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/turbofieldtrip/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/tools/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/vrpn/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/stimulation/branches/wip-emaby/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/stimulation/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/feature-extraction/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/classification-gpl/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/signal-processing/branches/wip-emaby/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/signal-processing/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/simple-visualisation/branches/wip-lbonnet-p300/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/simple-visualisation/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/file-io/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/samples/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/examples/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/classification/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/stream-codecs/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/python/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/streaming/branches/wip-emaby/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/streaming/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/signal-processing-gpl/branches/wip-emaby/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/signal-processing-gpl/branches/wip-acellard-ARFeatures/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/signal-processing-gpl/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/matlab/branches/wip-lbonnet-matlabdll/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-plugins/matlab/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/id-generator/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/external-stimulation-connection-example/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/designer/tags/wip-omk4/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/designer/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/ssvep-demo/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/skeleton-generator/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/vr-demo/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/vrpn-simulator/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/plugin-inspector/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/acquisition-server/branches/wip-lbonnet-micromed/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/acquisition-server/branches/wip-lbonnet-gtec/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/acquisition-server/branches/wip-emaby/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/acquisition-server/branches/wip-jfruitet/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-applications/acquisition-server/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-documentation/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe/tags/wip-omk4/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-toolkit/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-scenarios/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-kernel-omk/tags/wip-omk4/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-kernel-omk/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-modules/xml/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-modules/automaton/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-modules/stream/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-modules/ebml/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-modules/socket/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-modules/fs/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/openvibe-modules/system/trunc/test")
-SUBDIRS("${CTEST_SOURCE_DIRECTORY}/test/trunk/scripts/software/tmp/vrpn/java_vrpn/test")
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-kernel-omk/tags/wip-omk4/test")
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-kernel-omk/trunc/test")
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-modules/xml/trunc/test")


Add a Nightly branch

Add a Nightly branch

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

--- deal.II/cmake/scripts/run_testsuite.cmake
+++ deal.II/cmake/scripts/run_testsuite.cmake
@@ -66,7 +66,10 @@
 #                            clean directory and run the build tests
 #                            "build_tests/*"
 #
-#       "Regression Tests" - Reserved for the Regression tester
+#       "Nightly"          - Reserved for nightly regression tests for
+#                            build bots on various architectures
+#
+#       "Regression Tests" - Reserved for the regression tester
 #
 #   CONFIG_FILE
 #     - A configuration file (see ../deal.II/docs/development/Config.sample)
@@ -98,6 +101,7 @@

 IF( NOT "${TRACK}" STREQUAL "Experimental"
     AND NOT "${TRACK}" STREQUAL "Build Tests"
+    AND NOT "${TRACK}" STREQUAL "Nightly"
     AND NOT "${TRACK}" STREQUAL "Regression Tests" )
   MESSAGE(FATAL_ERROR "
 Unknown TRACK \"${TRACK}\" - see the manual for valid values.
@@ -226,6 +230,7 @@

 MESSAGE("-- CTEST_SITE:             ${CTEST_SITE}")

+ENDIF()
 IF( "${TRACK}" STREQUAL "Regression Tests"
     AND NOT CTEST_SITE MATCHES "c0541" )
   MESSAGE(FATAL_ERROR "


PKG: !hack! install all import libs in targets-release.cmake

--- Packaging/install_importlibs.cmake
+++ Packaging/install_importlibs.cmake
@@ -1,23 +1,61 @@
+# This is more messed up that you might think.
+# On windows we cannot track dependency on .lib files like dll
+# In linux, checking all required .so file is enough to have
+# package with all required libraries. But the issue is not all
+# libs files are appearing in objdump's NEEDED section because
+# they are not used by the binary in question. This leads us to
+# another heap of mess that cmake's Targets-release.cmake references
+# them but not included in package. this cmake function is the
+# after effect of this issue
 #TODO: remove commented code
 function(install_importlibs)

-  if(NOT WIN32)
+  if(WIN32)
+    #ALL .lib files are required for building
+    #eg: gdal.dll will have gdal_i.lib which is
+    #needed when you do cmake configure for projects
+    #using OTB. Hence the *.lib regex is non optional
+    #and cannot be optimized at any level.
+    #Only thing you can control is to create only those
+    #required .lib files in install directory. This exclude
+    #all otb*.*testdriver.lib etc..
+    file(GLOB import_lib_files
+      "${SUPERBUILD_INSTALL_DIR}/lib/*.lib")
+    foreach( import_lib_file ${import_lib_files})
+      install_rule(${import_lib_file})
+    endforeach()
     return()
   endif()

-  #ALL .lib files are required for building
-  #eg: gdal.dll will have gdal_i.lib which is
-  #needed when you do cmake configure for projects
-  #using OTB. Hence the *.lib regex is non optional
-  #and cannot be optimized at any level.
-  #Only thing you can control is to create only those
-  #required .lib files in install directory. This exclude
-  #all otb*.*testdriver.lib etc..
-  file(GLOB import_lib_files
-    "${SUPERBUILD_INSTALL_DIR}/lib/*.lib")
-  foreach( import_lib_file ${import_lib_files})
-    install_rule(${import_lib_file})
+  set(search_regex    "..IMPORTED_LOCATION_([A-Z]+)...{_IMPORT_PREFIX}\/lib\/")
+  file(GLOB_RECURSE
+    target_cmake_files
+    "${SUPERBUILD_INSTALL_DIR}/lib/cmake/ITK*/*Targets-*.*"
+    "${SUPERBUILD_INSTALL_DIR}/lib/cmake/OTB*/*Targets-*.*")
+
+  set(lib_files)
+  foreach( target_cmake_file ${target_cmake_files})
+    if(PKG_DEBUG)
+      message("checking ${search_regex} in ${target_cmake_file}")
+    endif()
+    file(STRINGS "${target_cmake_file}" matched_items REGEX "${search_regex}")
+    foreach(matched_item ${matched_items})
+      if(matched_item MATCHES "otbapp_")
+       continue()
+      endif()
+      string(REGEX REPLACE "${search_regex}" "" lib_file "${matched_item}")
+      string(REGEX REPLACE "\"" "" lib_file "${lib_file}")
+      list(APPEND lib_files "${SUPERBUILD_INSTALL_DIR}/lib/${lib_file}")
+    endforeach()
   endforeach()
+
+  foreach(lib_file ${lib_files})
+    if(PKG_DEBUG)
+      message("SPECIAL install_rule for lib_file: ${lib_file}")
+    endif()
+    install_rule(${lib_file})
+  endforeach()
+

 #RK: to hell with cmake targets files.


Linux: revert GL dependency

Linux: revert GL dependency

--- cmake/Qt5Gui_ZZZ_HunterPlugin.cmake
+++ cmake/Qt5Gui_ZZZ_HunterPlugin.cmake
@@ -88,7 +88,7 @@

   # defined: `glBindTexture'
   # Disable for build with xcb from Hunter
-  # _qt_cmake_extra_helpers_add_interface(Qt5::Gui "GL")
+  _qt_cmake_extra_helpers_add_interface(Qt5::Gui "GL")

   # Disable for build with xcb from Hunter
   # _qt_cmake_extra_helpers_add_interface(Qt5::Gui "png")


Updated the PACKAGE_INTERNAL_DEPS_ID

Updated the PACKAGE_INTERNAL_DEPS_ID

--- cmake/projects/OpenSSL/hunter.cmake
+++ cmake/projects/OpenSSL/hunter.cmake
@@ -263,4 +263,4 @@
 endif()

 hunter_cacheable(OpenSSL)
-hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID 2)
+hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID 3)


fix export library path

fix export library path

--- cmake_modules/install_package.cmake
+++ cmake_modules/install_package.cmake
@@ -173,14 +173,11 @@
   # In case we want to export.
   elseif( EXPORT_${PROJECT_NAME} )

-        # add "installed" library to list of required libraries to link against
-        #if( PACKAGE_LIB_NAME )
-        #    cmake_policy( SET CMP0026 OLD )
-        #    get_target_property( _target_library ${PACKAGE_LIB_NAME} LOCATION )
-        #    get_filename_component( _lib ${_target_library} NAME )
-        #    list( APPEND PACKAGE_LINK_LIBS ${CMAKE_CURRENT_BINARY_DIR}/${_lib} )
-        #endif()
-
+      if( PACKAGE_LIB_NAME )
+            cmake_policy( SET CMP0026 OLD )
+            get_target_property( _target_library ${PACKAGE_LIB_NAME} LOCATION )
+            list( APPEND PACKAGE_LINK_LIBS ${_target_library} )
+        endif()

         if( PACKAGE_INSTALL_HEADER_DIRS )
             foreach(dir IN LISTS PACKAGE_INSTALL_HEADER_DIRS )
@@ -199,9 +196,9 @@
             ${CMAKE_CURRENT_BINARY_DIR}/include )

         # install library itself
-        if( PACKAGE_LIB_NAME )
-            set( PACKAGE_LIB_LINK "-l${PACKAGE_LIB_NAME}" )
-        endif()
+        #if( PACKAGE_LIB_NAME )
+        #    set( PACKAGE_LIB_LINK "-l${PACKAGE_LIB_NAME}" )
+        #endif()
    #######################################################
   # Export library for easy inclusion from other cmake projects. APPEND allows
   # call to function even as subdirectory of larger project.


BUG: ITKModuleExternal CMAKE_LIBRARY_OUTPUT_DIRECTORY when wrapping

When building a module externally, deposit its wrapping artifacts with
the rest of the ITK wrapping artifacts and other external module
wrapping artifacts so they can be found during test runtime.

--- CMake/ITKModuleExternal.cmake
+++ CMake/ITKModuleExternal.cmake
@@ -40,7 +40,11 @@
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ITK_DIR}/bin)
 endif()
 if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ITK_DIR}/lib)
+  if(ITK_WRAP_PYTHON)
+    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ITK_DIR}/Wrapping/Generators/Python/itk)
+  else()
+    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ITK_DIR}/lib)
+  endif()
 endif()
 if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
   set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ITK_DIR}/lib)


Added testdata for windows

Added testdata for windows

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -12,7 +12,7 @@
 set(MITK-Data_DEPENDS ${proj})

 if(BUILD_TESTING)
-  set(revision_tag c9ac0917) # first 8 characters of hash-tag
+  set(revision_tag 89ea8fb6) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


cmake: Fix windows build passing Fortran executable to inner-build

--- SuperBuild/External_LAPACK.cmake
+++ SuperBuild/External_LAPACK.cmake
@@ -72,6 +72,7 @@
     # flang
     set(Fortran_COMPILER_ID "Flang")
     find_package(Fortran REQUIRED)
+    mark_as_superbuild(Fortran_${Fortran_COMPILER_ID}_EXECUTABLE)

     set(build_type "Release")


improved arduino path search

improved arduino path search

--- scripts/Arduino.cmake
+++ scripts/Arduino.cmake
@@ -27,20 +27,31 @@
 set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${TUNING_FLAGS} -Wall -std=gnu99")

 # Find arduino root path
-set(ARDUINO_ROOT_SEARCH_PATHS
-    /usr/share/arduino
-    /opt/local/arduino
-    /opt/arduino
-    /usr/local/share/arduino
-    /Applications/Arduino.app/Contents/Java
-    /Applications/Arduino.app/Contents/Resources/Java
-)
-list(APPEND ARDUINO_ROOT_SEARCH_PATHS ${ARDUINO_ROOT} ${ARDUINO_SDK_PATH})
-unset(ARDUINO_ROOT)
-find_path(ARDUINO_ROOT
-    NAMES lib/version.txt
-    PATHS ${ARDUINO_ROOT_SEARCH_PATHS})
+if(ARDUINO_ROOT)
+    # check if path specified is good
+    find_path(ARDUINO_ROOT_VERIFIED
+        NAMES lib/version.txt
+        PATHS ${ARDUINO_ROOT})
+    if(NOT ARDUINO_ROOT_VERIFIED)
+        unset(ARDUINO_ROOT)
+    endif()
+endif()
 if(NOT ARDUINO_ROOT)
+    # if root is not set, search
+    set(ARDUINO_ROOT_SEARCH_PATHS
+        /usr/share/arduino
+        /opt/local/arduino
+        /opt/arduino
+        /usr/local/share/arduino
+        /Applications/Arduino.app/Contents/Java
+        /Applications/Arduino.app/Contents/Resources/Java
+    )
+    find_path(ARDUINO_ROOT
+        NAMES lib/version.txt
+        PATHS ${ARDUINO_ROOT_SEARCH_PATHS})
+endif()
+if(NOT ARDUINO_ROOT)
+    # Arduino SDK not found
     message(FATAL_ERROR "Could not find Arduino SDK root folder. Set the variable ARDUINO_ROOT in your CMakeList.txt file before including Arduino.cmake")
 endif()


Pass ltsan to gcc travis flags

Pass ltsan to gcc travis flags

--- Testing/script/travis_script.cmake
+++ Testing/script/travis_script.cmake
@@ -81,7 +81,7 @@
     #set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE ${CTEST_SCRIPT_DIRECTORY}/MercuryValgrindSuppressions.supp)
   endif()
   if(${MERCURY_MEMORYCHECK_TYPE} MATCHES "ThreadSanitizer")
-    set(MERCURY_MEMCHECK_FLAGS "-O1 -fsanitize=thread -fno-omit-frame-pointer -fPIC")
+    set(MERCURY_MEMCHECK_FLAGS "-O1 -fsanitize=thread -fno-omit-frame-pointer -fPIC -ltsan")
   endif()

   # needed by mercury_common.cmake


Missing fPIC flag to MERCURY_MEMCHECK_FLAGS

--- Testing/script/travis_script.cmake
+++ Testing/script/travis_script.cmake
@@ -81,7 +81,7 @@
     #set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE ${CTEST_SCRIPT_DIRECTORY}/MercuryValgrindSuppressions.supp)
   endif()
   if(${MERCURY_MEMORYCHECK_TYPE} MATCHES "ThreadSanitizer")
-    set(MERCURY_MEMCHECK_FLAGS "-O1 -fsanitize=thread -fno-omit-frame-pointer -shared")
+    set(MERCURY_MEMCHECK_FLAGS "-O1 -fsanitize=thread -fno-omit-frame-pointer -fPIC -shared")
   endif()

   # needed by mercury_common.cmake


Update minimum octave version to 3.2.0 for cmake check.

svn path=/trunk/; revision=12145

--- cmake/modules/octave.cmake
+++ cmake/modules/octave.cmake
@@ -103,7 +103,7 @@
 if(ENABLE_octave)
   message(STATUS "OCTAVE_VERSION = ${OCTAVE_VERSION}")
   # Logic that depends on octave version
-  transform_version(NUMERICAL_OCTAVE_TESTING_MINIMUM_VERSION "2.9.0")
+  transform_version(NUMERICAL_OCTAVE_TESTING_MINIMUM_VERSION "3.2.0")
   transform_version(NUMERICAL_OCTAVE_VERSION "${OCTAVE_VERSION}")
   if(
    NUMERICAL_OCTAVE_VERSION
@@ -111,7 +111,7 @@
    "${NUMERICAL_OCTAVE_TESTING_MINIMUM_VERSION}"
    )
     message(STATUS "WARNING: "
-    "plplot require octave version 2.9 or greater. Disabling octave bindings")
+    "plplot require octave version 3.2 or greater. Disabling octave bindings")
     set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
   endif(
    NUMERICAL_OCTAVE_VERSION


uselib: use only one find_package

uselib: use only one find_package

--- cmake/qibuild/uselib.cmake
+++ cmake/qibuild/uselib.cmake
@@ -31,10 +31,7 @@
     # for upstream Find-*.cmake
     # See: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package
     if (NOT ${_U_PKG}_SEARCHED)
-      find_package(${_pkg} NO_MODULE)
-      if (NOT ${${_pkg}_FOUND})
-        find_package(${_pkg} REQUIRED)
-      endif()
+      find_package(${_pkg} REQUIRED)
       qi_set_global("${_U_PKG}_SEARCHED" TRUE)
     endif()


set static build by default when building for CNK

--- CMake/Platform/BGQCNK.cmake
+++ CMake/Platform/BGQCNK.cmake
@@ -1 +1,3 @@
 add_definitions(-DPK_CNK)
+set(COMMON_LIBRARY_TYPE STATIC)
+


cmake: model 60 is a haswell cpu

cmake: model 60 is a haswell cpu

Thanks Georgios for the info

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -73,6 +73,8 @@
          # Any recent Intel CPU except NetBurst
          if(_cpu_model EQUAL 62)
             set(TARGET_ARCHITECTURE "ivy-bridge")
+         elseif(_cpu_model EQUAL 60)
+            set(TARGET_ARCHITECTURE "haswell")
          elseif(_cpu_model EQUAL 58)
             set(TARGET_ARCHITECTURE "ivy-bridge")
          elseif(_cpu_model EQUAL 47) # Xeon E7 4860


[cmake] change Eigen discovery

[cmake] change Eigen discovery

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -113,15 +113,13 @@
 	list(APPEND DUNE_DEFAULT_LIBS ${BLAS_LIBRARIES})
 endif(HAVE_BLAS)

-pkg_check_modules(EIGEN eigen3)
-set(CMAKE_REQUIRED_INCLUDES ${EIGEN_INCLUDE_DIRS})
-check_include_file_cxx("Eigen/SparseLU" HAVE_EIGEN_SPARSE)
-if(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)
-  include_directories(${EIGEN_INCLUDE_DIRS})
+find_package(Eigen3 3.2.0)
+if(EIGEN3_FOUND)
+  include_directories(${EIGEN3_INCLUDE_DIR})
   set(HAVE_EIGEN 1)
-else(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)
+else(EIGEN3_FOUND)
   set(HAVE_EIGEN 0)
-endif(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)
+endif(EIGEN3_FOUND)

 pkg_check_modules(LIBAMA libama)
 if(LIBAMA_FOUND)


Updated linux install path

Updated linux install path

--- cmake/modules/SetInstallPaths.cmake
+++ cmake/modules/SetInstallPaths.cmake
@@ -18,7 +18,7 @@
   set(RUNTIME_LIBDIR "${BINDIR}\\${CMAKE_BUILD_TYPE}_Out")
   set(DATADIR "${BINDIR}\\data")
 else()
-  set(BINDIR ""
+  set(BINDIR "bin"
       CACHE STRING "Bin Install Dir")
   set(RUNTIME_LIBDIR "lib"
       CACHE STRING "Lib Dir")


Change print order of IDs

Change print order of IDs

--- cmake/modules/hunter_finalize.cmake
+++ cmake/modules/hunter_finalize.cmake
@@ -97,8 +97,8 @@
   )

   set(_id_info "[ Hunter-ID: ${HUNTER_ID} |")
-  set(_id_info "${_id_info} Config-ID: ${HUNTER_CONFIG_ID} |")
-  set(_id_info "${_id_info} Toolchain-ID: ${HUNTER_TOOLCHAIN_ID} ]")
+  set(_id_info "${_id_info} Toolchain-ID: ${HUNTER_TOOLCHAIN_ID} |")
+  set(_id_info "${_id_info} Config-ID: ${HUNTER_CONFIG_ID} ]")

   hunter_status_print("${_id_info}")


Add fix for trailing directory separator in multifile building

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -3,6 +3,7 @@
 if(BUILD_DIR)
   file(GLOB ALLOPROJECT_APP_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${BUILD_APP_DIR}/*.cpp)
   string(REPLACE "/" "_" APP_NAME ${BUILD_APP_DIR})
+  string(REGEX REPLACE "_+$" "" APP_NAME "${APP_NAME}")
   set(SOURCE_DIR ${BUILD_APP_DIR})
 else()
   set(ALLOPROJECT_APP_SRC ${BUILD_APP_FILE})


Minor fix for AlloProject flags.txt anf flags.cmake

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -12,7 +12,7 @@

 if(BUILD_DIR)
   string(REGEX REPLACE "/+$" "" ALLOSYSTEM_BUILD_APP_DIR "${ALLOSYSTEM_BUILD_APP_DIR}") # remove trailing slash
-  file(GLOB ALLOSYSTEM_APP_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${ALLOSYSTEM_BUILD_APP_DIR}/*.cpp)
+  file(GLOB ALLOSYSTEM_APP_SRC RELATIVE ${CMAKE_SOURCE_DIR} ${ALLOSYSTEM_BUILD_APP_DIR}/*.cpp)
   string(REPLACE "/" "_" APP_NAME "${ALLOSYSTEM_BUILD_APP_DIR}")
   string(REGEX REPLACE "_+$" "" APP_NAME "${APP_NAME}")
   set(SOURCE_DIR "${ALLOSYSTEM_BUILD_APP_DIR}")


adding extra args to the pip installer so we can add custom header paths to pip. (needed for pandas as numpy is a rez dependency)

--- src/rezplugins/build_system/cmake_files/RezPipInstall.cmake
+++ src/rezplugins/build_system/cmake_files/RezPipInstall.cmake
@@ -10,12 +10,16 @@
 # URL is the same url you would pass to pip - this can be an http url, or the
 # filepath of a local archive (typically a tar.gz file).
 #
+# Pip args will be passed directly to pip when it runs the install. useful for verbosity
+# or when defining custom include paths from other package in rez
+#
 # Usage:
 # rez_pip_install(
 #   <label>
 #   URL <url>
 #   [PYTHONDIR <pydir>]  # (default: 'python')
 #   [BINDIR <bindir>]  # (default: 'bin')
+#   [PIPARGS <pipargs>] # (default: '')
 # )
 #

@@ -32,7 +36,7 @@
     # parse args
     # --------------------------------------------------------------------------

-    parse_arguments(PIPINST "URL;PYTHONDIR;BINDIR" "" ${ARGN})
+    parse_arguments(PIPINST "URL;PYTHONDIR;BINDIR;PIPARGS" "" ${ARGN})

     list(GET PIPINST_DEFAULT_ARGS 0 label)
     if(NOT label)
@@ -53,6 +57,11 @@
     if(NOT bindir)
         set(bindir "bin")
     endif(NOT bindir)
+
+    list(GET PIPINST_PIPARGS 0 pipargs)
+    if(NOT pipargs)
+        set(pipargs "bin")
+    endif(NOT pipargs)

     # --------------------------------------------------------------------------
     # build/install
@@ -85,7 +94,7 @@
             # Note the lack of double quotes where you would expect around --install-scripts=.
             # CMake escapes the quotes if I try; fortunately it works without.
             #
-            COMMAND pip install --no-deps --target ${destpath} --install-option=--install-scripts=${destbinpath} .
+            COMMAND pip install --no-deps --target ${destpath} ${pipargs} --install-option=--install-scripts=${destbinpath} .
     )

 endmacro (rez_pip_install)


BUG: Allow module examples to be enabled when built externally

Allow module examples to be built when the module is built externally and when
ITK was built with BUILD_EXAMPLES OFF.

Also fix the issue that the variable is exported as ITK_BUILD_EXAMPLES when an
external module build sources ITKConfig.cmake.

Change-Id: Icd7b00fea83dcd970d8c0d3f0a61e1505652629c

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -331,7 +331,11 @@
 endmacro()

 macro(itk_module_examples)
-  cmake_dependent_option(Module_${itk-module}_BUILD_EXAMPLES "Build the examples" OFF "BUILD_EXAMPLES" OFF)
+  set(_build_examples_default OFF)
+  if(BUILD_EXAMPLES OR ITK_BUILD_EXAMPLES)
+    set(_build_examples_default ON)
+  endif()
+  set(Module_${itk-module}_BUILD_EXAMPLES ${_build_examples_default} CACHE BOOL "Build the examples for Module_${itk-module}")
   if(Module_${itk-module}_BUILD_EXAMPLES)
     if(ITK_SOURCE_DIR)
       # If configuration is done from within ITK,


Issue #56: Fix finding of OpenMP to use var OPENMP_FOUND.

--- CMake/mpIncludeOpenMP.cmake
+++ CMake/mpIncludeOpenMP.cmake
@@ -15,9 +15,17 @@
 if(MYPROJECT_USE_OPENMP)
   # Borrowed from PCL-1.8, and modified
   find_package(OpenMP)
-  if(OpenMP_FOUND)
+
+  # Note: Convention would say that for `find_package(OpenMP)`, the variable should be OpenMP_FOUND.
+  # Also: The top of the /usr/local/share/cmake/Modules/FindOpenMP.cmake says it should be OpenMP_FOUND.
+  # But : Both PCL and OpenCV use OPENMP_FOUND, then I checked FindOpenMP.cmake and its OPENMP_FOUND.
+
+  if(OPENMP_FOUND)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+    list(APPEND ALL_THIRD_PARTY_LIBRARIES ${OpenMP_CXX_LIBRARIES})
+    message("OpenMP found, CMAKE_CXX_FLAGS=${OpenMP_CXX_FLAGS}")
+    message("OpenMP found, OpenMP_CXX_LIBRARIES=${OpenMP_CXX_LIBRARIES}")
     if(MSVC)
       if(MSVC_VERSION EQUAL 1500)
         set(OPENMP_DLL VCOMP90)


Add error code 7

Add error code 7

--- cmake/modules/hunter_check_download_error_message.cmake
+++ cmake/modules/hunter_check_download_error_message.cmake
@@ -42,6 +42,8 @@
     set(expected_message "\"Failure when receiving data from the peer\"")
   elseif(x_ERROR_CODE EQUAL 18)
     set(expected_message "\"Transferred a partial file\"")
+  elseif(x_ERROR_CODE EQUAL 7)
+    set(expected_message "\"Couldn't connect to server\"")
   else()
     file(REMOVE "${x_REMOVE_ON_ERROR}")
     hunter_internal_error(


recovered deleted lines

recovered deleted lines

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -61,6 +61,10 @@
   message(STATUS "Python version ${PYTHON_VERSION_STRING}")
 endif()
 find_package(PythonLibs)
+if (PYTHONLIBS_FOUND)
+  message(STATUS "Found PYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIRS}")
+  message(STATUS "Found PYTHON_LIBRARIES=${PYTHON_LIBRARIES}")
+endif()

 set(Matlab_ROOT_DIR $ENV{Matlab_ROOT_DIR} CACHE PATH "Path to Matlab root directory" )