Check if there are resourcs to compile.

Check if there are resourcs to compile.

--- sigma_setup.cmake
+++ sigma_setup.cmake
@@ -42,107 +42,109 @@
         set(package_PACKAGE_ROOT "${CMAKE_CURRENT_LIST_DIR}")
     endif()

-    get_target_property(include_dirs ${target} INCLUDE_DIRECTORIES)
-    set(include_args -I${package_PACKAGE_ROOT})
-    foreach(inc ${include_dirs})
-        list(APPEND include_args -I${inc})
-    endforeach()
-    list(REMOVE_DUPLICATES include_args)
+    if(package_UNPARSED_ARGUMENTS)
+        get_target_property(include_dirs ${target} INCLUDE_DIRECTORIES)
+        set(include_args -I${package_PACKAGE_ROOT})
+        foreach(inc ${include_dirs})
+            list(APPEND include_args -I${inc})
+        endforeach()
+        list(REMOVE_DUPLICATES include_args)

-    set(TIME_STAMPS)
-    set(resource_files ${package_UNPARSED_ARGUMENTS})
-    list(REMOVE_DUPLICATES resource_files)
+        set(TIME_STAMPS)
+        set(resource_files ${package_UNPARSED_ARGUMENTS})
+        list(REMOVE_DUPLICATES resource_files)

-    set(texture_files ${resource_files})
-    list(FILTER texture_files INCLUDE REGEX ${SIGMA_ENGINE_TEXTURE_REGEX})
-    foreach(texture ${texture_files})
-        file(RELATIVE_PATH texture_time_stamp ${package_PACKAGE_ROOT} ${texture})
-        set(texture_time_stamp "${CMAKE_BINARY_DIR}/data/${texture_time_stamp}.stamp")
+        set(texture_files ${resource_files})
+        list(FILTER texture_files INCLUDE REGEX ${SIGMA_ENGINE_TEXTURE_REGEX})
+        foreach(texture ${texture_files})
+            file(RELATIVE_PATH texture_time_stamp ${package_PACKAGE_ROOT} ${texture})
+            set(texture_time_stamp "${CMAKE_BINARY_DIR}/data/${texture_time_stamp}.stamp")

-        get_filename_component(directory ${texture_time_stamp} DIRECTORY)
-        file(MAKE_DIRECTORY ${directory})
+            get_filename_component(directory ${texture_time_stamp} DIRECTORY)
+            file(MAKE_DIRECTORY ${directory})

-        add_custom_command(
-            OUTPUT ${texture_time_stamp}
-            COMMAND ${TEXTURE_COMPILER} ARGS --output="${CMAKE_BINARY_DIR}/data" ${texture}
-            COMMAND ${CMAKE_COMMAND} ARGS -E touch ${texture_time_stamp}
-            MAIN_DEPENDENCY "${texture}"
-            WORKING_DIRECTORY ${package_PACKAGE_ROOT}
-            COMMENT ""
-            SOURCES ${texture}
-        )
-        set(TIME_STAMPS ${TIME_STAMPS} ${texture_time_stamp})
-    endforeach()
+            add_custom_command(
+                OUTPUT ${texture_time_stamp}
+                COMMAND ${TEXTURE_COMPILER} ARGS --output="${CMAKE_BINARY_DIR}/data" ${texture}
+                COMMAND ${CMAKE_COMMAND} ARGS -E touch ${texture_time_stamp}
+                MAIN_DEPENDENCY "${texture}"
+                WORKING_DIRECTORY ${package_PACKAGE_ROOT}
+                COMMENT ""
+                SOURCES ${texture}
+            )
+            set(TIME_STAMPS ${TIME_STAMPS} ${texture_time_stamp})
+        endforeach()

-    set(shader_files ${resource_files})
-    list(FILTER shader_files INCLUDE REGEX ${SIGMA_ENGINE_SHADER_REGEX})
-    foreach(shader ${shader_files})
-        file(RELATIVE_PATH shader_time_stamp ${package_PACKAGE_ROOT} ${shader})
-        set(shader_time_stamp "${CMAKE_BINARY_DIR}/data/${shader_time_stamp}.stamp")
+        set(shader_files ${resource_files})
+        list(FILTER shader_files INCLUDE REGEX ${SIGMA_ENGINE_SHADER_REGEX})
+        foreach(shader ${shader_files})
+            file(RELATIVE_PATH shader_time_stamp ${package_PACKAGE_ROOT} ${shader})
+            set(shader_time_stamp "${CMAKE_BINARY_DIR}/data/${shader_time_stamp}.stamp")

-        get_filename_component(directory ${shader_time_stamp} DIRECTORY)
-        file(MAKE_DIRECTORY ${directory})
+            get_filename_component(directory ${shader_time_stamp} DIRECTORY)
+            file(MAKE_DIRECTORY ${directory})

-        add_custom_command(
-            OUTPUT ${shader_time_stamp}
-            COMMAND ${SHADER_COMPILER} ARGS --output="${CMAKE_BINARY_DIR}/data" ${include_args} ${shader}
-            COMMAND ${CMAKE_COMMAND} ARGS -E touch ${shader_time_stamp}
-            MAIN_DEPENDENCY "${shader}"
-            WORKING_DIRECTORY ${package_PACKAGE_ROOT}
-            COMMENT ""
-            SOURCES ${shader}
-        )
-        set(TIME_STAMPS ${TIME_STAMPS} ${shader_time_stamp})
-    endforeach()
+            add_custom_command(
+                OUTPUT ${shader_time_stamp}
+                COMMAND ${SHADER_COMPILER} ARGS --output="${CMAKE_BINARY_DIR}/data" ${include_args} ${shader}
+                COMMAND ${CMAKE_COMMAND} ARGS -E touch ${shader_time_stamp}
+                MAIN_DEPENDENCY "${shader}"
+                WORKING_DIRECTORY ${package_PACKAGE_ROOT}
+                COMMENT ""
+                SOURCES ${shader}
+            )
+            set(TIME_STAMPS ${TIME_STAMPS} ${shader_time_stamp})
+        endforeach()

-    set(material_files ${resource_files})
-    list(FILTER material_files INCLUDE REGEX ${SIGMA_ENGINE_MATERIAL_REGEX})
-    foreach(material ${material_files})
-        file(RELATIVE_PATH material_time_stamp ${package_PACKAGE_ROOT} ${material})
-        set(material_time_stamp "${CMAKE_BINARY_DIR}/data/${material_time_stamp}.stamp")
+        set(material_files ${resource_files})
+        list(FILTER material_files INCLUDE REGEX ${SIGMA_ENGINE_MATERIAL_REGEX})
+        foreach(material ${material_files})
+            file(RELATIVE_PATH material_time_stamp ${package_PACKAGE_ROOT} ${material})
+            set(material_time_stamp "${CMAKE_BINARY_DIR}/data/${material_time_stamp}.stamp")

-        get_filename_component(directory ${material_time_stamp} DIRECTORY)
-        file(MAKE_DIRECTORY ${directory})
+            get_filename_component(directory ${material_time_stamp} DIRECTORY)
+            file(MAKE_DIRECTORY ${directory})

-        add_custom_command(
-            OUTPUT ${material_time_stamp}
-            COMMAND ${MATERIAL_COMPILER} ARGS --output="${CMAKE_BINARY_DIR}/data" ${material}
-            COMMAND ${CMAKE_COMMAND} ARGS -E touch ${material_time_stamp}
-            MAIN_DEPENDENCY "${material}"
-            WORKING_DIRECTORY ${package_PACKAGE_ROOT}
-            COMMENT ""
-            SOURCES ${material}
-        )
-        set(TIME_STAMPS ${TIME_STAMPS} ${material_time_stamp})
-    endforeach()
+            add_custom_command(
+                OUTPUT ${material_time_stamp}
+                COMMAND ${MATERIAL_COMPILER} ARGS --output="${CMAKE_BINARY_DIR}/data" ${material}
+                COMMAND ${CMAKE_COMMAND} ARGS -E touch ${material_time_stamp}
+                MAIN_DEPENDENCY "${material}"
+                WORKING_DIRECTORY ${package_PACKAGE_ROOT}
+                COMMENT ""
+                SOURCES ${material}
+            )
+            set(TIME_STAMPS ${TIME_STAMPS} ${material_time_stamp})
+        endforeach()

-    set(model_files ${resource_files})
-    list(FILTER model_files INCLUDE REGEX ${SIGMA_ENGINE_MODEL_REGEX})
-    foreach(model ${MODEL_SOURCES})
-        file(RELATIVE_PATH model_time_stamp ${package_PACKAGE_ROOT} ${model})
-        set(model_time_stamp "${CMAKE_BINARY_DIR}/data/${model_time_stamp}.stamp")
+        set(model_files ${resource_files})
+        list(FILTER model_files INCLUDE REGEX ${SIGMA_ENGINE_MODEL_REGEX})
+        foreach(model ${MODEL_SOURCES})
+            file(RELATIVE_PATH model_time_stamp ${package_PACKAGE_ROOT} ${model})
+            set(model_time_stamp "${CMAKE_BINARY_DIR}/data/${model_time_stamp}.stamp")

-        get_filename_component(directory ${model_time_stamp} DIRECTORY)
-        file(MAKE_DIRECTORY ${directory})
+            get_filename_component(directory ${model_time_stamp} DIRECTORY)
+            file(MAKE_DIRECTORY ${directory})

-        add_custom_command(
-            OUTPUT ${model_time_stamp}
-            COMMAND ${MODEL_COMPILER} ARGS --output="${CMAKE_BINARY_DIR}/data" ${model}
-            COMMAND ${CMAKE_COMMAND} ARGS -E touch ${model_time_stamp}
-            MAIN_DEPENDENCY "${model}"
-            WORKING_DIRECTORY ${package_PACKAGE_ROOT}
-            COMMENT ""
-            SOURCES ${model}
-        )
-        set(TIME_STAMPS ${TIME_STAMPS} ${model_time_stamp})
-    endforeach()
+            add_custom_command(
+                OUTPUT ${model_time_stamp}
+                COMMAND ${MODEL_COMPILER} ARGS --output="${CMAKE_BINARY_DIR}/data" ${model}
+                COMMAND ${CMAKE_COMMAND} ARGS -E touch ${model_time_stamp}
+                MAIN_DEPENDENCY "${model}"
+                WORKING_DIRECTORY ${package_PACKAGE_ROOT}
+                COMMENT ""
+                SOURCES ${model}
+            )
+            set(TIME_STAMPS ${TIME_STAMPS} ${model_time_stamp})
+        endforeach()

-    add_custom_target(${target}-resources ALL DEPENDS ${TIME_STAMPS})
-    add_dependencies(${target} ${target}-resources)
-    target_include_directories(${target} PUBLIC ${package_PACKAGE_ROOT})
+        add_custom_target(${target}-resources ALL DEPENDS ${TIME_STAMPS})
+        add_dependencies(${target} ${target}-resources)
+        target_include_directories(${target} PUBLIC ${package_PACKAGE_ROOT})

-    if(NOT DEFINED CONAN_BIN_DIRS_SIGMA-ENGINE)
-        add_dependencies(${target}-resources sctexture scshader scmaterial scmodel)
+        if(NOT DEFINED CONAN_BIN_DIRS_SIGMA-ENGINE)
+            add_dependencies(${target}-resources sctexture scshader scmaterial scmodel)
+        endif()
     endif()
 endfunction()


version bump projectM test

version bump projectM test

git-svn-id: 647c2dfdf120d9af8205d960f30c8711574448cd@1405 6778bc44-b910-0410-a7a0-be141de4315d

--- src/projectM-test/cmake/CPack-projectM.cmake
+++ src/projectM-test/cmake/CPack-projectM.cmake
@@ -17,8 +17,8 @@
 #SET(CPACK_BINARY_TGZ ON)
 #SET(CPACK_SOURCE_Z OFF)
 SET(CPACK_PACKAGE_VERSION_MAJOR "2")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
-SET(CPACK_PACKAGE_VERSION_PATCH "1")
+SET(CPACK_PACKAGE_VERSION_MINOR "1")
+SET(CPACK_PACKAGE_VERSION_PATCH "0")

 INCLUDE(CPack)


SuperBuild: build monteverdi module if asked

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -87,6 +87,12 @@
   ADD_SUPERBUILD_CMAKE_VAR(OTB GLUT_LIBRARY)
 endif()

+if(OTB_USE_QWT)
+  ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OTB QWT)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB QWT_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB QWT_LIBRARY)
+endif()
+
 ADD_SUPERBUILD_CMAKE_VAR(OTB GDAL_INCLUDE_DIR)
 ADD_SUPERBUILD_CMAKE_VAR(OTB GDAL_LIBRARY)

@@ -148,10 +154,13 @@
   -DOTB_USE_GLEW:BOOL=${OTB_USE_GLEW}
   -DOTB_USE_GLFW:BOOL=${OTB_USE_GLFW}
   -DOTB_USE_GLUT:BOOL=${OTB_USE_GLUT}
+  -DOTB_USE_QWT:BOOL=${OTB_USE_QWT}
+  -DModule_OTBMapla:BOOL=${ENABLE_MONTEVERDI}
+  -DModule_OTBMonteverdi:BOOL=${ENABLE_MONTEVERDI}
+  -DOTB_WRAP_PYTHON:BOOL=${OTB_WRAP_PYTHON}
+  -DOTB_WRAP_JAVA:BOOL=${OTB_WRAP_JAVA}
   ${OTB_SB_CONFIG}
   ${OTB_SB_LARGEINPUT_CONFIG}
-  -DOTB_WRAP_PYTHON:BOOL=${OTB_WRAP_PYTHON}
-  -DOTB_WRAP_JAVA:BOOL=${OTB_WRAP_JAVA}
   ${OTB_ADDITIONAL_CACHE}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND}
   )


Use experimental Qt's version

Use experimental Qt's version

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

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


Updating zinc packaging to have a better os description and also adding in a generator for Mac OSX.  https://tracker.physiomeproject.org/show_bug.cgi?id=3439

--- cmake/ZincPackaging.cmake
+++ cmake/ZincPackaging.cmake
@@ -11,8 +11,39 @@
 SET(CPACK_PACKAGE_VERSION_MINOR "${ZINC_MINOR_VERSION}")
 SET(CPACK_PACKAGE_VERSION_PATCH "${ZINC_PATCH_VERSION}")

-SET( CPACK_GENERATOR "TGZ;DEB" )
-SET( CPACK_DEBIAN_PACKAGE_MAINTAINER "Hugh Sorby" ) #required
-SET( CPACK_PACKAGE_FILE_NAME "zinc-${ZINC_VERSION}-${ZINC_ARCHITECTURE}-${CMAKE_SYSTEM}" )
+IF( UNIX AND NOT APPLE )
+	SET( ZINC_SYSTEM "Linux" )
+	SET( CPACK_GENERATOR "TGZ" )
+
+	EXECUTE_PROCESS(COMMAND cat /etc/issue RESULT_VARIABLE COMMAND_RESULT OUTPUT_VARIABLE COMMAND_OUTPUT ERROR_VARIABLE ERR_OUT)
+	IF( COMMAND_RESULT EQUAL 0 )
+		STRING( REGEX MATCH "^[^\\]*" COMMAND_OUTPUT ${COMMAND_OUTPUT} )
+		STRING( STRIP ${COMMAND_OUTPUT} COMMAND_OUTPUT )
+		message(STATUS "${COMMAND_OUTPUT}" )
+		STRING( REPLACE " " "-" ZINC_SYSTEM ${COMMAND_OUTPUT} )
+		STRING( FIND ${ZINC_SYSTEM} "Ubuntu" INDEX )
+		IF( INDEX EQUAL 0 )
+			SET( CPACK_DEBIAN_PACKAGE_MAINTAINER "Hugh Sorby" ) #required
+			SET( CPACK_GENERATOR "DEB" )
+		ENDIF()
+	ENDIF()
+ELSEIF( APPLE )
+	LIST( LENGTH LENGTH_ARCHS CMAKE_OSX_ARCHITECTURES )
+	message(STATUS "la=${LENGTH_ARCHS}-${CMAKE_OSX_ARCHITECTURES}")
+	message(STATUS "la=${CMAKE_SYSTEM_NAME}-${CMAKE_OSX_ARCHITECTURES}")
+	SET( ZINC_ARCHITECTURE "universal" )
+	EXECUTE_PROCESS(COMMAND sw_vers -productName RESULT_VARIABLE COMMAND_RESULT OUTPUT_VARIABLE PRODUCT_NAME )
+	STRING( STRIP ${PRODUCT_NAME} PRODUCT_NAME )
+	EXECUTE_PROCESS(COMMAND sw_vers -productVersion RESULT_VARIABLE COMMAND_RESULT OUTPUT_VARIABLE PRODUCT_VERSION )
+	STRING( STRIP ${PRODUCT_VERSION} PRODUCT_VERSION )
+	STRING( REPLACE " " "-" ZINC_SYSTEM "${PRODUCT_NAME} ${PRODUCT_VERSION}" )
+	SET( CPACK_GENERATOR "DragNDrop" )
+	SET( CPACK_BUNDLE_NAME "OpenCMISS(Zinc)" )
+ELSEIF( WIN32 )
+ENDIF()
+
+message(STATUS "'zinc-${ZINC_VERSION}-${ZINC_ARCHITECTURE}-${ZINC_SYSTEM}'" )
+SET( CPACK_PACKAGE_FILE_NAME "zinc-${ZINC_VERSION}-${ZINC_ARCHITECTURE}-${ZINC_SYSTEM}" )

 INCLUDE(CPack)
+


add simple test for examples

add simple test for examples

--- cmake/vSMCFunctions.cmake
+++ cmake/vSMCFunctions.cmake
@@ -32,6 +32,11 @@
             ENDIF (${exe} STREQUAL "std")

             ADD_DEPENDENCIES (${basename} ${exe_name})
+            ADD_TEST (NAME ${exe_name} COMMAND ${exe_name}
+                "--partile_num 100 --prior2 100"
+                "--burnin_num 1000 --iter_num 1000"
+                WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+                CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel)
         ENDFOREACH(alg)
     ENDFOREACH (exe)
 ENDFUNCTION (ADD_EXAMPLE)


Spell CMAKE_COMPILER_IS_GNUCC correctly.

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -130,7 +130,7 @@
 IF(UNIX)

   # Default GCC flags
-  IF(CMAKE_COMPILER_IS_GNUC)
+  IF(CMAKE_COMPILER_IS_GNUCC)
     SET(COMMON_C_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer")
     SET(CMAKE_C_FLAGS_DEBUG          "-O ${COMMON_C_FLAGS}")
     SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")


Remove dumb dependencies

Remove dumb dependencies

Signed-off-by: Jose Bollo <08496fd66cc394b517cafa0b18bcb9ce79fe4230@iot.bzh>

--- conf.d/cmake/config.cmake
+++ conf.d/cmake/config.cmake
@@ -69,9 +69,7 @@
 # -----------------------------
 set (PKG_REQUIRED_LIST
 	json-c
-	libsystemd>=222
 	afb-daemon
-	libmicrohttpd>=0.9.55
 )


Use generator expression to specify C/C++ flags

--- templates/CMake/cpp.cmake
+++ templates/CMake/cpp.cmake
@@ -1,5 +1,7 @@
 cmake_minimum_required(VERSION <%= executable('cmake') ? split(systemlist('cmake --version')[0], ' ')[2] : '3.1' %>)
 project(<+DIR+> C CXX)
+
+set(BUILD_TARGET "main"<+CURSOR+>)

 set(CMAKE_C_STANDARD 11)
 set(CMAKE_C_STANDARD_REQUIRED ON)
@@ -9,24 +11,27 @@
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)

+# set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_USE_RELATIVE_PATHS ON)
+

 # C Compiler Version Requirements
-if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
   if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
     message(FATAL_ERROR "GCC version must be at least 4.4!")
   endif()
-elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
   if(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.1)
     message(FATAL_ERROR "Clang version must be at least 3.1!")
   endif()
 endif()

 # C++ Compiler Version Requirements
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
     message(FATAL_ERROR "GCC version must be at least 4.4!")
   endif()
-elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
     message(FATAL_ERROR "Clang version must be at least 3.1!")
   endif()
@@ -41,63 +46,62 @@
 endif()

-file(GLOB SRCS *.c *.cpp *.cxx *.cc)
+file(GLOB SRCS *.c *.cpp *.cxx *.cc *.h *.hpp *.hxx *.hh *.inl)
 add_executable(
-  main<+CURSOR+>
+  ${BUILD_TARGET}
   ${SRCS})

-# include_directories(${CMAKE_SOURCE_DIR})
+# target_include_directories(${BUILD_TARGET} PRIVATE ${CMAKE_SOURCE_DIR})

 # find_package(Threads REQUIRED)
-# target_link_libraries(main m Threads::Threads)
-
-if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
+# target_link_libraries(${BUILD_TARGET} PRIVATE m Threads::Threads)
+
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
   set(SYSTEM_PROCESSOR_IS_X86 TRUE)
 endif()
-if (CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
   set(SYSTEM_PROCESSOR_IS_X64 TRUE)
 endif()

+if(MSVC OR CYGWIN OR MINGW OR MSYS)
+  list(APPEND DEFINES "WIN32_LEAN_AND_MEAN;NOMINMAX")
+endif()
 if(MSVC)
-  set(USE_RELATIVE_PATHS ON)
-
+  list(APPEND DEFINES "_USE_MATH_DEFINES;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS")
+  list(APPEND DEFINES_DEBUG "_DEBUG")
+  list(APPEND DEFINES_RELWITHDEBINFO "_DEBUG")
+else()
+  list(APPEND DEFINES_RELEASE "NDEBUG")
+  list(APPEND DEFINES_MINSIZEREL "NDEBUG")
+  list(APPEND DEFINES_DEBUG "_FORTIFY_SOURCE=2;_GLIBCXX_DEBUG")
+endif()
+
+if(MSVC)
   foreach(TARGET_FLAG
-      C_FLAGS
-      C_FLAGS_DEBUG
-      C_FLAGS_RELEASE
-      C_FLAGS_MINSIZEREL
-      C_FLAGS_RELWITHDEBINFO
-      CXX_FLAGS
-      CXX_FLAGS_DEBUG
-      CXX_FLAGS_RELEASE
-      CXX_FLAGS_MINSIZEREL
-      CXX_FLAGS_RELWITHDEBINFO)
-    string(REGEX REPLACE "/RTC[^ ]*" "" ${TARGET_FLAG} "${CMAKE_${TARGET_FLAG}}")
+      CMAKE_C_FLAGS
+      CMAKE_C_FLAGS_DEBUG
+      CMAKE_C_FLAGS_RELEASE
+      CMAKE_C_FLAGS_MINSIZEREL
+      CMAKE_C_FLAGS_RELWITHDEBINFO
+      CMAKE_CXX_FLAGS
+      CMAKE_CXX_FLAGS_DEBUG
+      CMAKE_CXX_FLAGS_RELEASE
+      CMAKE_CXX_FLAGS_MINSIZEREL
+      CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+    string(REGEX REPLACE "/RTC[^ ]*" "" ${TARGET_FLAG} "${${TARGET_FLAG}}")
+    string(REGEX REPLACE "/W[0-4]" "/W4" ${TARGET_FLAG} "${${TARGET_FLAG}}")
   endforeach(TARGET_FLAG)

-  foreach(
-      TARGET_FLAG
-      C_FLAGS
-      CXX_FLAGS)
-    if(TARGET_FLAG MATCHES "/W[0-4]")
-      string(REGEX REPLACE "/W[0-4]" "/W4" ${TARGET_FLAG} "${${TARGET_FLAG}}")
-    else()
-      set("${TARGET_FLAG}" "${${TARGET_FLAG}} /W4")
-    endif()
-  endforeach()
-
-  set(DEFLIST "-DWIN32_LEAN_AND_MEAN;-DNOMINMAX;-D_USE_MATH_DEFINES;-D_CRT_NONSTDC_NO_WARNINGS;-D_CRT_SECURE_NO_WARNINGS")
-
-  set(C_FLAGS_DEBUG "${C_FLAGS_DEBUG} /Oi /Oy")
-  set(C_FLAGS_RELEASE "${C_FLAGS_RELEASE} /Ob2 /Oi /Ot /Ox /Oy /GL")
-  set(C_FLAGS_MINSIZEREL "${C_FLAGS_MINSIZEREL} /Os")
-
-  set(CXX_FLAGS_DEBUG "${CXX_FLAGS_DEBUG} /Oi /Oy")
-  set(CXX_FLAGS_RELEASE "${CXX_FLAGS_RELEASE} /Ob2 /Oi /Ot /Ox /Oy /GL")
-  set(CXX_FLAGS_MINSIZEREL "${CXX_FLAGS_MINSIZEREL} /Os")
-
-  set(EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
+  list(APPEND C_FLAGS_DEBUG "/Oi;/Oy")
+  list(APPEND C_FLAGS_RELEASE "/Ob2;/Oi;/Ot;/Ox;/Oy;/GL")
+  list(APPEND C_FLAGS_MINSIZEREL "/Os")
+
+  list(APPEND CXX_FLAGS_DEBUG "/Oi;/Oy")
+  list(APPEND CXX_FLAGS_RELEASE "/Ob2;/Oi;/Ot;/Ox;/Oy;/GL")
+  list(APPEND CXX_FLAGS_MINSIZEREL "/Os")
+
+  list(APPEND EXE_LINKER_FLAGS_RELEASE "/LTCG")
 else()
   foreach(WARNING_FLAG
       -Wall
@@ -123,23 +127,23 @@
       -Wunreachable-code
       -Wwrite-strings
       -pedantic)
-    set(GNU_CLANG_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS} ${WARNING_FLAG}")
+    list(APPEND GNU_CLANG_COMMON_WARNING_FLAGS ${WARNING_FLAG})
   endforeach(WARNING_FLAG)

   option(ENABLE_ADDITIONAL_WARNING_FLAGS "Enable additional warning flags." OFF)
   if(ENABLE_ADDITIONAL_WARNING_FLAGS)
-    set(GNU_CLANG_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS} -Winline -Wsign-conversion")
-  endif()
-
-  set(GNU_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS} -Wlogical-op")
+    list(APPEND GNU_CLANG_COMMON_WARNING_FLAGS "-Winline;-Wsign-conversion")
+  endif()
+
+  list(APPEND GNU_COMMON_WARNING_FLAGS "-Wlogical-op")
   if(ENABLE_ADDITIONAL_WARNING_FLAGS)
-    set(GNU_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS} -Wunsafe-loop-optimizations")
-  endif()
-
-  set(CLANG_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS} -Wsign-promo")
+    list(APPEND GNU_COMMON_WARNING_FLAGS "-Wunsafe-loop-optimizations")
+  endif()
+
+  list(APPEND CLANG_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS};-Wsign-promo")

   if(CMAKE_COMPILER_IS_GNUCC)
-    set(C_WARNING_FLAGS "${GNU_COMMON_WARNING_FLAGS}")
+    set(C_WARNING_FLAGS ${GNU_COMMON_WARNING_FLAGS})
     foreach(WARNING_FLAG
         -Wc++-compat
         -Wbad-function-cast
@@ -147,18 +151,18 @@
         -Wnested-externs
         -Wold-style-definition
         -Wstrict-prototypes)
-      set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
+      list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
     endforeach(WARNING_FLAG)

-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.5 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.5)
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5)
       message(STATUS "Add warning flags implemented in gcc 4.5")
       foreach(WARNING_FLAG
           -Wjump-misses-init
           -Wunsuffixed-float-constants)
-        set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.6)
+        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6)
       message(STATUS "Add warning flags implemented in gcc 4.6")
       foreach(WARNING_FLAG
           -Wdouble-promotion
@@ -166,39 +170,39 @@
           -Wsuggest-attribute=noreturn
           -Wsuggest-attribute=pure
           -Wtrampolines)
-        set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.7 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.7)
+        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.7)
       message(STATUS "Add warning flags implemented in gcc 4.7")
       foreach(WARNING_FLAG
           -Wno-return-local-addr
           -Wvector-operation-performance)
-        set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.8 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.8)
+        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
       message(STATUS "Add warning flags implemented in gcc 4.8")
-      set(C_WARNING_FLAGS "${C_WARNING_FLAGS} -Wsuggest-attribute=format")
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 5.1 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.1)
+      list(APPEND C_WARNING_FLAGS "-Wsuggest-attribute=format")
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.1)
       message(STATUS "Add warning flags implemented in gcc 5.1")
       foreach(WARNING_FLAG
           -Wformat-signedness
           -Wsuggest-final-methods
           -Wsuggest-final-types)
-        set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6.0 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 6.0)
+        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
       message(STATUS "Add warning flags implemented in gcc 6.0")
       foreach(WARNING_FLAG
           -Wduplicated-cond
           -Wshift-overflow=2)
-        set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 7.0 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 7.0)
+        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
       message(STATUS "Add warning flags implemented in gcc 7.0")
       string(REGEX REPLACE "-Wabi" "-Wabi=11" C_WARNING_FLAGS "${C_WARNING_FLAGS}")
       foreach(WARNING_FLAG
@@ -209,73 +213,73 @@
           -Wrestrict
           -Wshadow-local
           -Wstringop-overflow=4)
-        set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 8.0 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 8.0)
+        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
       message(STATUS "Add warning flags implemented in gcc 8.0")
       string(REGEX REPLACE "-Wcast-align" "-Wcast-align=strict" C_WARNING_FLAGS "${C_WARNING_FLAGS}")
-      set(C_WARNING_FLAGS "${C_WARNING_FLAGS} -Wsuggest-attribute=malloc")
-    endif()
-
-    set(C_FLAGS "${CMAKE_C_FLAGS} -pipe ${C_WARNING_FLAGS}")
-    set(C_FLAGS_DEBUG "-g3 -O0 -ftrapv -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_DEBUG")
-    set(C_FLAGS_RELEASE "-O3 -DNDEBUG")
-    set(C_FLAGS_MINSIZEREL "-s -DNDEBUG")
+      list(APPEND C_WARNING_FLAGS "-Wsuggest-attribute=malloc")
+    endif()
+
+    set(C_FLAGS "-pipe;${C_WARNING_FLAGS}")
+    set(C_FLAGS_DEBUG "-g3;-O0;-ftrapv -fstack-protector-all")
+    set(C_FLAGS_RELEASE "-O3")
+    set(C_FLAGS_MINSIZEREL "-s")
     if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
-      set(C_FLAGS_RELEASE "${C_FLAGS_RELEASE} -mtune=native -march=native")
-      set(C_FLAGS_MINSIZEREL "${C_FLAGS_MINSIZEREL} -mtune=native -march=native")
+      list(APPEND C_FLAGS_RELEASE "-mtune=native;-march=native")
+      set(C_FLAGS_MINSIZEREL "${C_FLAGS_MINSIZEREL};-mtune=native;-march=native")
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
-      set(C_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG")
+      set(C_FLAGS_RELWITHDEBINFO "-g;-O2")
     else()
-      set(C_FLAGS_RELWITHDEBINFO "-g -Og -DNDEBUG")
-    endif()
-  elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
-    set(C_WARNING_FLAGS "${CLANG_COMMON_WARNING_FLAGS}")
+      set(C_FLAGS_RELWITHDEBINFO "-g;-Og")
+    endif()
+  elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+    set(C_WARNING_FLAGS ${CLANG_COMMON_WARNING_FLAGS})
     foreach(WARNING_FLAG
         -Wc++-compat
         -Wbad-function-cast
         -Wmissing-prototypes)
-      set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
+      list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
     endforeach(WARNING_FLAG)

-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 3.5 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 3.5)
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
       message(STATUS "Add warning flags implemented in clang 3.5")
-      set(C_WARNING_FLAGS "${C_WARNING_FLAGS} -Wc++14-compat")
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 3.8 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 3.8)
+      list(APPEND C_WARNING_FLAGS "-Wc++14-compat")
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.8)
       message(STATUS "Add warning flags implemented in clang 3.8")
-      set(C_WARNING_FLAGS "${C_WARNING_FLAGS} -Wdouble-promotion")
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.0)
+      list(APPEND C_WARNING_FLAGS "-Wdouble-promotion")
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
       message(STATUS "Add warning flags implemented in clang 5.0")
-      set(C_WARNING_FLAGS "${C_WARNING_FLAGS} -Wzero-as-null-pointer-constant")
-    endif()
-
-    set(C_FLAGS "${CMAKE_C_FLAGS} -pipe ${C_WARNING_FLAGS}")
-    set(C_FLAGS_DEBUG "-g3 -O0 -ftrapv -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_DEBUG")
-    set(C_FLAGS_RELEASE "-O3 -DNDEBUG")
-    set(C_FLAGS_MINSIZEREL "-s -DNDEBUG")
+      list(APPEND C_WARNING_FLAGS "-Wzero-as-null-pointer-constant")
+    endif()
+
+    set(C_FLAGS "${CMAKE_C_FLAGS};-pipe;${C_WARNING_FLAGS}")
+    set(C_FLAGS_DEBUG "-g3;-O0;-ftrapv;-fstack-protector-all")
+    set(C_FLAGS_RELEASE "-O3")
+    set(C_FLAGS_MINSIZEREL "-s")
     if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
-      set(C_FLAGS_RELEASE "${C_FLAGS_RELEASE} -mtune=native -march=native")
-      set(C_FLAGS_MINSIZEREL "${C_FLAGS_MINSIZEREL} -mtune=native -march=native")
+      list(APPEND C_FLAGS_RELEASE "-mtune=native;-march=native")
+      list(APPEND C_FLAGS_MINSIZEREL "-mtune=native;-march=native")
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
-      set(C_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG")
+      set(C_FLAGS_RELWITHDEBINFO "-g;-O2")
     else()
-      set(C_FLAGS_RELWITHDEBINFO "-g -Og -DNDEBUG")
+      set(C_FLAGS_RELWITHDEBINFO "-g;-Og")
     endif()
   else()
-    set(C_FLAGS "${CMAKE_C_FLAGS}")
-    set(C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
-    set(C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
-    set(C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
-    set(C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+    set(C_FLAGS ${CMAKE_C_FLAGS})
+    set(C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+    set(C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
+    set(C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
+    set(C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
   endif()

   if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CXX_WARNING_FLAGS "${GNU_COMMON_WARNING_FLAGS}")
+    set(CXX_WARNING_FLAGS ${GNU_COMMON_WARNING_FLAGS})
     foreach(WARNING_FLAG
         -Weffc++
         -Wctor-dtor-privacy
@@ -285,14 +289,14 @@
         -Wreorder
         -Wsign-promo
         -Wstrict-null-sentinel)
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
+      list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
     endforeach(WARNING_FLAG)

-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.3)
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3)
       message(STATUS "Add warning flags implemented in g++ 4.3")
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wc++0x-compat")
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6)
+      list(APPEND CXX_WARNING_FLAGS "-Wc++0x-compat")
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6)
       message(STATUS "Add warning flags implemented in g++ 4.6")
       foreach(WARNING_FLAG
           -Wdouble-promotion
@@ -301,10 +305,10 @@
           -Wsuggest-attribute=noreturn
           -Wsuggest-attribute=pure
           -Wtrampolines)
-        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.7)
+        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.7)
       message(STATUS "Add warning flags implemented in g++ 4.7")
       string(REGEX REPLACE "-Wc\\+\\+0x-compat" "-Wc++11-compat" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
       foreach(WARNING_FLAG
@@ -312,22 +316,22 @@
           -Wvector-operation-performance
           -Wno-return-local-addr
           -Wzero-as-null-pointer-constant)
-        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.8)
+        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
       message(STATUS "Add warning flags implemented in g++ 4.8")
       foreach(WARNING_FLAG
           -Wsuggest-attribute=format
           -Wuseless-cast)
-        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9)
+        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.9)
       message(STATUS "Add warning flags implemented in g++ 4.9")
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wconditionally-supported")
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.1 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.1)
+      list(APPEND CXX_WARNING_FLAGS "-Wconditionally-supported")
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.1)
       message(STATUS "Add warning flags implemented in g++ 5.1")
       foreach(WARNING_FLAG
           -Wc++14-compat
@@ -335,19 +339,19 @@
           -Wsuggest-final-methods
           -Wsuggest-final-types
           -Wsuggest-override)
-        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.0)
+        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
       message(STATUS "Add warning flags implemented in g++ 6.0")
       foreach(WARNING_FLAG
           -Wduplicated-cond
           -Wplacement-new=2
           -Wshift-overflow=2)
-        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0)
+        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
       message(STATUS "Add warning flags implemented in g++ 7.0")
       string(REGEX REPLACE "-Wabi" "-Wabi=11" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
       foreach(WARNING_FLAG
@@ -360,30 +364,30 @@
           -Wrestrict
           -Wshadow-local
           -Wstringop-overflow=4)
-        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.0)
+        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
       message(STATUS "Add warning flags implemented in g++ 8.0")
       string(REGEX REPLACE "-Wcast-align" "-Wcast-align=strict" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wsuggest-attribute=malloc")
-    endif()
-
-    set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${CXX_WARNING_FLAGS}")
-    set(CXX_FLAGS_DEBUG "-g3 -O0 -ftrapv -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_DEBUG")
-    set(CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
-    set(CXX_FLAGS_MINSIZEREL "-s -DNDEBUG")
+      list(APPEND CXX_WARNING_FLAGS "-Wsuggest-attribute=malloc")
+    endif()
+
+    set(CXX_FLAGS "${CMAKE_CXX_FLAGS};-pipe;${CXX_WARNING_FLAGS}")
+    set(CXX_FLAGS_DEBUG "-g3;-O0;-ftrapv;-fstack-protector-all")
+    set(CXX_FLAGS_RELEASE "-O3")
+    set(CXX_FLAGS_MINSIZEREL "-s")
+    if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
+      list(APPEND CXX_FLAGS_RELEASE "-mtune=native;-march=native")
+      list(APPEND CXX_FLAGS_MINSIZEREL "-mtune=native;-march=native")
+    endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
-      set(CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG")
+      set(CXX_FLAGS_RELWITHDEBINFO "-g;-O2")
     else()
-      set(CXX_FLAGS_RELWITHDEBINFO "-g -Og -DNDEBUG")
-    endif()
-    if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
-      set(CXX_FLAGS_RELEASE "${CXX_FLAGS_RELEASE} -mtune=native -march=native")
-      set(CXX_FLAGS_MINSIZEREL "${CXX_FLAGS_MINSIZEREL} -mtune=native -march=native")
-    endif()
-  elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-    set(CXX_WARNING_FLAGS "${CLANG_COMMON_WARNING_FLAGS}")
+      set(CXX_FLAGS_RELWITHDEBINFO "-g;-Og")
+    endif()
+  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    set(CXX_WARNING_FLAGS ${CLANG_COMMON_WARNING_FLAGS})
     foreach(WARNING_FLAG
         -Wc++11-compat
         -Weffc++
@@ -393,52 +397,52 @@
         -Wold-style-cast
         -Woverloaded-virtual
         -Wreorder)
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
+      list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
     endforeach(WARNING_FLAG)

-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.5 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.5)
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
       message(STATUS "Add warning flags implemented in clang++ 3.5")
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wc++14-compat")
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.8 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.8)
+      list(APPEND CXX_WARNING_FLAGS "-Wc++14-compat")
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.8)
       message(STATUS "Add warning flags implemented in clang++ 3.8")
       foreach(WARNING_FLAG
           -Wc++1z-compat
           -Wdouble-promotion)
-        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
-      endforeach(WARNING_FLAG)
-    endif()
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.0)
+        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
+      endforeach(WARNING_FLAG)
+    endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
       message(STATUS "Add warning flags implemented in clang++ 5.0")
       string(REGEX REPLACE "-Wc\\+\\+1z-compat" "-Wc++17-compat" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wzero-as-null-pointer-constant")
-    endif()
-
-    set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${CXX_WARNING_FLAGS}")
-    set(CXX_FLAGS_DEBUG "-g3 -O0 -ftrapv -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_DEBUG")
-    set(CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
-    set(CXX_FLAGS_MINSIZEREL "-s -DNDEBUG")
+      list(CXX_WARNING_FLAGS "-Wzero-as-null-pointer-constant")
+    endif()
+
+    set(CXX_FLAGS "${CMAKE_CXX_FLAGS};-pipe;${CXX_WARNING_FLAGS}")
+    set(CXX_FLAGS_DEBUG "-g3;-O0;-ftrapv;-fstack-protector-all")
+    set(CXX_FLAGS_RELEASE "-O3")
+    set(CXX_FLAGS_MINSIZEREL "-s")
     if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
-      set(CXX_FLAGS_RELEASE "${CXX_FLAGS_RELEASE} -mtune=native -march=native")
-      set(CXX_FLAGS_MINSIZEREL "${CXX_FLAGS_MINSIZEREL} -mtune=native -march=native")
+      list(APPEND CXX_FLAGS_RELEASE "-mtune=native;-march=native")
+      list(APPEND CXX_FLAGS_MINSIZEREL "-mtune=native;-march=native")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
-      set(CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG")
+      set(CXX_FLAGS_RELWITHDEBINFO "-g;-O2")
     else()
-      set(CXX_FLAGS_RELWITHDEBINFO "-g -Og -DNDEBUG")
+      set(CXX_FLAGS_RELWITHDEBINFO "-g;-Og")
     endif()
   else()
-    set(CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-    set(CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
-    set(CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
-    set(CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
-    set(CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
-  endif()
-
-  set(EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s -Wl,-O1")
-  set(EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -s")
-
-  install(TARGETS main
+    set(CXX_FLAGS ${CMAKE_CXX_FLAGS})
+    set(CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+    set(CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+    set(CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
+    set(CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
+  endif()
+
+  set(EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE};-s;-Wl,-O1")
+  set(EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL};-s")
+
+  install(TARGETS ${BUILD_TARGET}
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION lib
     ARCHIVE DESTINATION lib/static)
@@ -446,30 +450,59 @@
   add_custom_target(uninstall xargs rm < install_manifest.txt)
 endif()

-if(DEFLIST)
-  foreach(DEF "${DEFLIST}")
-    add_definitions(${DEF})
-  endforeach(DEF)
-endif()
-
-foreach(TARGET_FLAG
-    C_FLAGS
-    C_FLAGS_DEBUG
-    C_FLAGS_RELEASE C_FLAGS_RELWITHDEBINFO
-    C_FLAGS_MINSIZEREL
-    CXX_FLAGS
-    CXX_FLAGS_DEBUG
-    CXX_FLAGS_RELEASE
-    CXX_FLAGS_RELWITHDEBINFO
-    CXX_FLAGS_MINSIZEREL
-    EXE_LINKER_FLAGS
-    EXE_LINKER_FLAGS_DEBUG
-    EXE_LINKER_FLAGS_RELEASE
-    EXE_LINKER_FLAGS_RELWITHDEBINFO
-    EXE_LINKER_FLAGS_MINSIZEREL)
-  string(REGEX REPLACE "^ +" "" "${TARGET_FLAG}" "${${TARGET_FLAG}}")
-  string(REGEX REPLACE "  +" " " "CMAKE_${TARGET_FLAG}" "${${TARGET_FLAG}}")
-endforeach(TARGET_FLAG)
+target_compile_definitions(
+  ${BUILD_TARGET} PRIVATE
+  ${DEFINES}
+  $<$<CONFIG:Release>:${DEFINES_RELEASE}>
+  $<$<CONFIG:Debug>:${DEFINES_DEBUG}>
+  $<$<CONFIG:RelWithDebInfo>:${DEFINES_RELWITHDEBINFO}>
+  $<$<CONFIG:MinSizeRel>:${DEFINES_MINSIZEREL}>)
+
+get_property(PROJECT_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+
+if("C" IN_LIST PROJECT_LANGUAGES)
+  target_compile_options(
+    ${BUILD_TARGET} PRIVATE
+    $<$<COMPILE_LANGUAGE:C>:
+      ${C_FLAGS}
+      $<$<CONFIG:Release>:${C_FLAGS_RELEASE}>
+      $<$<CONFIG:Debug>:${C_FLAGS_DEBUG}>
+      $<$<CONFIG:RelWithDebInfo>:${C_FLAGS_RELWITHDEBINFO}>
+      $<$<CONFIG:MinSizeRel>:${C_FLAGS_MINSIZEREL}>
+    >)
+endif()
+
+if("CXX" IN_LIST PROJECT_LANGUAGES)
+  target_compile_options(
+    ${BUILD_TARGET} PRIVATE
+    $<$<COMPILE_LANGUAGE:CXX>:
+      ${CXX_FLAGS}
+      $<$<CONFIG:Release>:${CXX_FLAGS_RELEASE}>
+      $<$<CONFIG:Debug>:${CXX_FLAGS_DEBUG}>
+      $<$<CONFIG:RelWithDebInfo>:${CXX_FLAGS_RELWITHDEBINFO}>
+      $<$<CONFIG:MinSizeRel>:${CXX_FLAGS_MINSIZEREL}>
+    >)
+endif()
+
+if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
+  target_link_options(
+    ${BUILD_TARGET} PRIVATE
+    ${EXE_LINKER_FLAGS}
+    $<$<CONFIG:Release>:${EXE_LINKER_FLAGS_RELEASE}>
+    $<$<CONFIG:Debug>:${EXE_LINKER_FLAGS_DEBUG}>
+    $<$<CONFIG:RelWithDebInfo>:${EXE_LINKER_FLAGS_RELWITHDEBINFO}>
+    $<$<CONFIG:MinSizeRel>:${EXE_LINKER_FLAGS_MINSIZEREL}>)
+else()
+  foreach(TARGET_FLAG
+      EXE_LINKER_FLAGS
+      EXE_LINKER_FLAGS_DEBUG
+      EXE_LINKER_FLAGS_RELEASE
+      EXE_LINKER_FLAGS_RELWITHDEBINFO
+      EXE_LINKER_FLAGS_MINSIZEREL)
+    string(REPLACE ";" " " ${TARGET_FLAG} "${${TARGET_FLAG}}")
+    string(REGEX REPLACE "  +" " " "CMAKE_${TARGET_FLAG}" "${${TARGET_FLAG}}")
+  endforeach(TARGET_FLAG)
+endif()

 option(ENABLE_TESTING "Enable testing with Google Test." OFF)
@@ -482,7 +515,7 @@
 option(ENABLE_DOXYGEN "Enable to generate document with Doxygen." OFF)
 if(ENABLE_DOXYGEN)
   include(cmake/doxygen.cmake)
-  add_doxygen(main)
+  add_doxygen(${BUILD_TARGET})
 endif()


BUG: ITK_FUTURE_LEGACY_REMOVE must be propogated from ITK version

The use of ITK_FUTURE_LEGACY_REMOVE must be defined in ITK build
and propogated to the dependant tools.  Setting this flag
in the dependant builds will result in an inconsistent interface
definition that results in runtime errors.

--- Common.cmake
+++ Common.cmake
@@ -115,11 +115,11 @@
 #-------------------------------------------------------------------------
 include(ITKSetStandardCompilerFlags)
 if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_DEBUG_DESIRED_FLAGS} -DITK_FUTURE_LEGACY_REMOVE " )
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_DEBUG_DESIRED_FLAGS} -DITK_FUTURE_LEGACY_REMOVE " )
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_DEBUG_DESIRED_FLAGS} " )
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_DEBUG_DESIRED_FLAGS} " )
 else() # Release, or anything else
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_RELEASE_DESIRED_FLAGS} -DITK_FUTURE_LEGACY_REMOVE " )
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_RELEASE_DESIRED_FLAGS} -DITK_FUTURE_LEGACY_REMOVE " )
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_RELEASE_DESIRED_FLAGS} " )
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_RELEASE_DESIRED_FLAGS} " )
 endif()

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


BUG: Missing base classes for filters using RGBAPixel

--- Wrapping/WrapITK/Modules/Base/wrap_itkImageSource.cmake
+++ Wrapping/WrapITK/Modules/Base/wrap_itkImageSource.cmake
@@ -1,6 +1,6 @@
 WRAP_CLASS("itk::ImageSource" POINTER)
   # Force uchar and ulong image sources for saving in 8 bits and watershed filter
-  UNIQUE(image_types "UC;RGBUC;UL;${WRAP_ITK_ALL_TYPES}")
+  UNIQUE(image_types "UC;RGBUC;RGBAUC;UL;${WRAP_ITK_ALL_TYPES}")
   WRAP_IMAGE_FILTER("${image_types}" 1)

   UNIQUE(to_types "${WRAP_ITK_SCALAR};UC")


Synchronize adm files

Synchronize adm files

--- adm_local_without_kernel/cmake_files/SalomeMacros.cmake
+++ adm_local_without_kernel/cmake_files/SalomeMacros.cmake
@@ -636,3 +636,40 @@
     ENDIF()
   ENDFOREACH()
 ENDMACRO(SALOME_ACCUMULATE_HEADERS)
+
+#########################################################################
+# SALOME_ACCUMULATE_ENVIRONMENT()
+#
+# USAGE: SALOME_ACCUMULATE_ENVIRONMENT(var value)
+#
+# ARGUMENTS:
+#   var   [in] environment variable name, e.g. PATH
+#   value [in] value(s) to be added to environment variable
+#
+# This macro is called in the various FindSalomeXYZ.cmake modules to
+# accumulate environment variables, to be used later to run some command
+# in proper environment.
+#
+# 1. Each envrironment variable is stored in specific CMake variable
+#      _${PROJECT_NAME}_EXTRA_ENV_<var>
+# where <var> is name of variable.
+# 2. Full list of environment variable names is stored in CMake variable
+# _${PROJECT_NAME}_EXTRA_ENV.
+#
+MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar val)
+  FOREACH(_item ${val})
+    LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)
+    IF(_res EQUAL -1)
+      LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item})
+    ENDIF()
+  ENDFOREACH()
+  LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res)
+  IF(_res EQUAL -1)
+    LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV ${envvar})
+  ENDIF()
+  SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "SET\(${PROJECT_NAME}_EXTRA_ENV ${_${PROJECT_NAME}_EXTRA_ENV}\)")
+  FOREACH(_res ${_${PROJECT_NAME}_EXTRA_ENV})
+    SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "${_${PROJECT_NAME}_EXTRA_ENV_FULL}\nSET\(${PROJECT_NAME}_EXTRA_ENV_${_res} ${_${PROJECT_NAME}_EXTRA_ENV_${_res}}\)")
+  ENDFOREACH()
+ENDMACRO(SALOME_ACCUMULATE_ENVIRONMENT)
+


CastXML 0.3.3

CastXML 0.3.3

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,7 +1,7 @@
 # CastXML version number components.
 set(CastXML_VERSION_MAJOR 0)
 set(CastXML_VERSION_MINOR 3)
-set(CastXML_VERSION_PATCH 2)
+set(CastXML_VERSION_PATCH 3)
 set(CastXML_VERSION_RC 0)
 set(CastXML_VERSION_IS_DIRTY 0)


update cdash testsuite file to use mercurial

--- test/testsuite.cmake
+++ test/testsuite.cmake
@@ -39,7 +39,7 @@
 # VERSION=opensuse-11.1
 # WORK_DIR=/home/gael/Coding/eigen2/cdash
 # # get the last version of the script
-# svn cat svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen2/test/testsuite.cmake > $WORK_DIR/testsuite.cmake
+# wget http://bitbucket.org/eigen/eigen2/raw/tip/test/testsuite.cmake -o $WORK_DIR/testsuite.cmake
 # COMMON="ctest -S $WORK_DIR/testsuite.cmake,EIGEN_WORK_DIR=$WORK_DIR,EIGEN_SITE=$SITE,EIGEN_MODE=$1,EIGEN_BUILD_STRING=$OS_VERSION-$ARCH"
 # $COMMON-gcc-3.4.6,EIGEN_CXX=g++-3.4
 # $COMMON-gcc-4.0.1,EIGEN_CXX=g++-4.0.1
@@ -132,8 +132,8 @@

 ## mandatory variables (the default should be ok in most cases):

-SET (CTEST_CVS_COMMAND "svn")
-SET (CTEST_CVS_CHECKOUT "${CTEST_CVS_COMMAND} co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen2 \"${CTEST_SOURCE_DIRECTORY}\"")
+SET (CTEST_CVS_COMMAND "hg")
+SET (CTEST_CVS_CHECKOUT "${CTEST_CVS_COMMAND} clone http://bitbucket.org/eigen/eigen2 \"${CTEST_SOURCE_DIRECTORY}\"")

 # which ctest command to use for running the dashboard
 SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE}")


modules: updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -129,7 +129,7 @@
 find_program(CORRADE_RC_EXECUTABLE corrade-rc)

 # Include dir
-find_path(CORRADE_INCLUDE_DIR
+find_path(_CORRADE_INCLUDE_DIR
     NAMES Corrade/PluginManager Corrade/Utility)

 # CMake module dir
@@ -149,7 +149,7 @@
     CORRADE_INTERCONNECT_LIBRARY
     CORRADE_PLUGINMANAGER_LIBRARY
     CORRADE_TESTSUITE_LIBRARY
-    CORRADE_INCLUDE_DIR
+    _CORRADE_INCLUDE_DIR
     CORRADE_RC_EXECUTABLE
     _CORRADE_MODULE_DIR)

@@ -208,7 +208,7 @@
 set(CORRADE_TESTSUITE_LIBRARIES ${CORRADE_TESTSUITE_LIBRARY} ${CORRADE_UTILITY_LIBRARIES})

 # At least static build needs this
-if((UNIX OR CORRADE_TARGET_NACL) AND NOT CORRADE_TARGET_NACL_NEWLIB)
+if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_NACL_GLIBC)
     set(CORRADE_PLUGINMANAGER_LIBRARIES ${CORRADE_PLUGINMANAGER_LIBRARIES} ${CMAKE_DL_LIBS})
 endif()

@@ -216,11 +216,14 @@
     CORRADE_INTERCONNECT_LIBRARY
     CORRADE_PLUGINMANAGER_LIBRARY
     CORRADE_TESTSUITE_LIBRARY
+    _CORRADE_INCLUDE_DIR
     _CORRADE_MODULE_DIR)

 # Add Corrade dir to include path if this is deprecated build
 if(CORRADE_BUILD_DEPRECATED)
-    set(CORRADE_INCLUDE_DIR ${CORRADE_INCLUDE_DIR} ${CORRADE_INCLUDE_DIR}/Corrade)
+    set(CORRADE_INCLUDE_DIR ${_CORRADE_INCLUDE_DIR} ${CORRADE_INCLUDE_DIR}/Corrade)
+else()
+    set(CORRADE_INCLUDE_DIR ${_CORRADE_INCLUDE_DIR})
 endif()

 # Include our module dir, if we have any


fixes in boost.cmake

fixes in boost.cmake

--- modules/boost/boost.cmake
+++ modules/boost/boost.cmake
@@ -5,7 +5,7 @@
 # Autocmake update time.
 # Note that the build-up commands are not Windows-compatible!
 #
-# Your autocmake.yml should contain::
+# Your autocmake.yml should look like this::
 #
 # - boost:
 #   - major: 1
@@ -61,7 +61,7 @@
 #     - "%(url_root)modules/boost/boost_install.cmake"
 #     - "%(url_root)modules/boost/boost_headers.cmake"
 #     - "%(url_root)modules/boost/boost_cleanup.cmake"
-#     - "http://sourceforge.net/projects/boost/files/boost/%(major)s.%(minor)s.%(patch)s/boost_%(major)s_%(minor)s_%(patch)s.zip"
+#     - "http://sourceforge.net/projects/boost/files/boost/%(major).%(minor).%(patch)/boost_%(major)_%(minor)_%(patch).zip"
 #   docopt:
 #     - "--boost-headers=<BOOST_INCLUDEDIR> Include directories for Boost [default: '']."
 #     - "--boost-libraries=<BOOST_LIBRARYDIR> Library directories for Boost [default: '']."
@@ -70,8 +70,8 @@
 #     - "'-DBOOST_INCLUDEDIR=\"{0}\"'.format(arguments['--boost-headers'])"
 #     - "'-DBOOST_LIBRARYDIR=\"{0}\"'.format(arguments['--boost-libraries'])"
 #     - "'-DFORCE_CUSTOM_BOOST=\"{0}\"'.format(arguments['--build-boost'])"
-#     - "'-DBOOST_MINIMUM_REQUIRED="%(major)s.%(minor)s.%(patch)s"'"
-#     - "'-DBOOST_COMPONENTS_REQUIRED="%(components)s"'"
+#     - "'-DBOOST_MINIMUM_REQUIRED=\"%(major).%(minor).%(patch)\"'"
+#     - "'-DBOOST_COMPONENTS_REQUIRED=\"%(components)\"'"

 # FIXME Maintainer should be able to choose between fail (end-user has to satisfy dependency
 #       on its own) and soft-fail (self-build of Boost)


fix cygpath location error

fix cygpath location error

git-svn-id: fe3cd4388a6e5a968b09397a3d721fe124e8117a@117 5b54908e-ead4-fc18-b48a-0285e6dbc711

--- tests/runsuite.cmake
+++ tests/runsuite.cmake
@@ -148,15 +148,17 @@
   endif (NOT EXISTS "${DRvmk_path}")
 endif (arg_vmk_only OR arg_test_vmk)

-# build and run cygwin only if cygwin is installed
-find_program(CYGPATH cygpath)
-if (cygpath)
-  set(have_cygwin ON)
-  set(test_cygwin ON)
-else (cygpath)
-  set(have_cygwin OFF)
-  set(test_cygwin OFF)
-endif (cygpath)
+if (WIN32)
+  # build and run cygwin only if cygwin is installed
+  find_program(CYGPATH cygpath)
+  if (CYGPATH)
+    set(have_cygwin ON)
+    set(test_cygwin ON)
+  else (CYGPATH)
+    set(have_cygwin OFF)
+    set(test_cygwin OFF)
+  endif (CYGPATH)
+endif (WIN32)

 # allow setting the base cache variables via an include file
 set(base_cache "")


Support codesigning bundles and forcing

Support codesigning bundles and forcing

Summary:
Clangd's framework is assembled by copying binaries from the lib and bin directories into a bundle shape. This results in an invalid bundle code signature because the signature only applies to the binaries not the resources.

This patch adds two new options to `llvm_codesign` to enable re-signing the library and XPC service as bundles.

The `BUNDLE_PATH` option allow specifying an explicit path to codesign, which enables signing bundles which aren't generated using CMake's `FRAMEWORK` or `BUNDLE` target properties.

The `FORCE` option allows re-signing binaries that have already been signed. This is required for how clangd exposes the clangd library and tools as both XPC and non-XPC services using the same binary.

Reviewers: jkorous, bogner

Reviewed By: bogner

Subscribers: mgorny, ilya-biryukov, dexonsmith, arphaman, kadircet, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@362169 91177308-0d34-0410-b5e6-96231b3b80d8

--- clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
+++ clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
@@ -70,4 +70,9 @@
     ${target}
     ${CLANGD_FRAMEWORK_LOCATION}
   )
+
+  # clangd is already signed as a standalone executable, so it must be forced.
+  llvm_codesign(ClangdXPC BUNDLE_PATH "${CLANGD_FRAMEWORK_OUT_LOCATION}/XPCServices/${CLANGD_XPC_SERVICE_NAME}.xpc/" FORCE)
+  # ClangdXPC library is already signed as a standalone library, so it must be forced.
+  llvm_codesign(ClangdXPC BUNDLE_PATH "${CLANGD_FRAMEWORK_LOCATION}" FORCE)
 endmacro(create_clangd_xpc_framework)


Potential Win32 compile fix

Potential Win32 compile fix

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[x] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation

--- PurpleAddAmalgamation.cmake
+++ PurpleAddAmalgamation.cmake
@@ -15,7 +15,7 @@

   set(THIS_SOURCES)
   set(THIS_LIBRARIES)
-  set(THIS_DEFINITIONS)
+  set(THIS_DEFINITIONS EQ_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}\")

   foreach(LIBRARY ${LIBRARIES})
     get_property(SOURCES TARGET ${LIBRARY} PROPERTY SOURCES)
@@ -30,7 +30,7 @@
     endforeach(SOURCE ${SOURCES})

     get_property(LINK_LIBRARIES TARGET ${LIBRARY} PROPERTY LINK_LIBRARIES)
-	list(APPEND THIS_LIBRARIES ${LINK_LIBRARIES})
+    list(APPEND THIS_LIBRARIES ${LINK_LIBRARIES})

     get_property(DEFINITIONS TARGET ${LIBRARY} PROPERTY COMPILE_DEFINITIONS)
     list(APPEND THIS_DEFINITIONS ${DEFINITIONS})
@@ -38,7 +38,7 @@

   add_library(${NAME} SHARED ${THIS_SOURCES})
   set_target_properties(${NAME} PROPERTIES
-    COMPILE_DEFINITIONS "${THIS_DEFINITIONS} -DEQ_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}\""
+    COMPILE_DEFINITIONS ${THIS_DEFINITIONS}
     VERSION ${VERSION} SOVERSION ${API_VERSION}
     )


nxphlite-v3:add fxas21002c driver to board build

--- cmake/configs/nuttx_nxphlite-v3_default.cmake
+++ cmake/configs/nuttx_nxphlite-v3_default.cmake
@@ -20,6 +20,7 @@
 	drivers/ets_airspeed
 	drivers/frsky_telemetry
 	drivers/fxos8700cq
+	drivers/fxas21002c
 	drivers/gps
 	drivers/hmc5883
 	drivers/hott


added pic for shared libraries

added pic for shared libraries

--- cmake_compiler_settings/cmake/gcc_flags.cmake
+++ cmake_compiler_settings/cmake/gcc_flags.cmake
@@ -152,4 +152,4 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,relro")
 endif()

-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fpie")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fpie -fpic -fPIC")


modules: yet another, hopefully last, FindBullet update.

--- modules/FindBullet.cmake
+++ modules/FindBullet.cmake
@@ -223,10 +223,18 @@
                 IMPORTED_LOCATION_DEBUG ${Bullet_${_library}_LIBRARY_DEBUG})
         endif()

-        # Everything depends on LinearMath, so put the include dir there
+        # Everything depends on LinearMath, so put the include dir as well as
+        # compile definitions (such as BT_USE_DOUBLE_PRECISION) there
         if(_library STREQUAL LinearMath)
             set_property(TARGET Bullet::${_library} APPEND PROPERTY
                 INTERFACE_INCLUDE_DIRECTORIES ${Bullet_INCLUDE_DIR})
+            # BULLET_DEFINITIONS gets defined by BulletConfig from the
+            # find_package() we did at first. That's also the only useful
+            # thing from it, the rest we can find by hand as well.
+            if(BULLET_DEFINITIONS)
+                set_property(TARGET Bullet::${_library} APPEND PROPERTY
+                    INTERFACE_COMPILE_OPTIONS "${BULLET_DEFINITIONS}")
+            endif()

         # Collision depends on LinearMath
         elseif(_library STREQUAL Collision)


Remove debug output

Remove debug output

--- Dependencies/cmake/ImportConcurrentqueue.cmake
+++ Dependencies/cmake/ImportConcurrentqueue.cmake
@@ -13,7 +13,6 @@
   )

   ExternalProject_Get_Property(ConcurrentQueue_EP SOURCE_DIR)
-  message("CQ SOURCE_DIR=${SOURCE_DIR}")

   add_library(ConcurrentQueue INTERFACE)
   if("${CMAKE_GENERATOR}" STREQUAL "Xcode")


ENH: Bump cppcheck version

ENH: Bump cppcheck version

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -33,7 +33,7 @@

 # Cppcheck
 set( Cppcheck_URL ${github_protocol}://github.com/KitwareMedical/cppcheck.git )
-set( Cppcheck_HASH_OR_TAG d54f112aa1381184a177be05a8172c68bcd861c6 )
+set( Cppcheck_HASH_OR_TAG 08e242fc2a4c1105b836668c786592dcbd7b065b )

 # TubeTK Image Viewer
 set( ImageViewer_URL


 * Make sure the mkl include directory ends up in LAPACKE_INCLUDE_DIR

Former-commit-id: 5c8e157ead4c20469ac5693e76eb0aa2f8db613d

--- cmake-modules/FindLapacke.cmake
+++ cmake-modules/FindLapacke.cmake
@@ -19,10 +19,14 @@

             if(LAPACKE_COMPILES)
                 add_library(lapacke::lapacke INTERFACE IMPORTED)
-                get_target_property(LAPACKE_INCLUDE_DIR mkl::mkl INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
                 target_link_libraries(lapacke::lapacke INTERFACE mkl::mkl)
-                target_include_directories(lapacke::lapacke SYSTEM INTERFACE ${LAPACKE_INCLUDE_DIR})
-                lapacke_message(STATUS "Looking for Lapacke in Intel MKL - found")
+                get_target_property(MKL_INCLUDE_DIR mkl::mkl INTERFACE_INCLUDE_DIRECTORIES)
+                if(MKL_INCLUDE_DIR)
+                    target_include_directories(lapacke::lapacke SYSTEM INTERFACE ${MKL_INCLUDE_DIR})
+                    set(LAPACKE_INCLUDE_DIR ${MKL_INCLUDE_DIR})
+                endif()
+                mark_as_advanced(MKL_INCLUDE_DIR)
+                lapacke_message(STATUS "Looking for Lapacke in Intel MKL - found: ${LAPACKE_INCLUDE_DIR}")
             else()
                 message(STATUS "Looking for Lapacke in Intel MKL - not found")
                 message(WARNING "Intel MKL is expected to bundle Lapacke")


Do not use -Og for debug mode (won't work on Mac/clang)

--- cmake/EthCompilerSettings.cmake
+++ cmake/EthCompilerSettings.cmake
@@ -71,7 +71,7 @@
 	add_compile_options(-fPIC)

 	# Configuration-specific compiler settings.
-	set(CMAKE_CXX_FLAGS_DEBUG          "-Og -g -DETH_DEBUG")
+	set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -DETH_DEBUG")
 	set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
 	set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG")
 	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")


verify_app instead of fixup_bundle

verify_app instead of fixup_bundle

--- cmake/EthExecutableHelper.cmake
+++ cmake/EthExecutableHelper.cmake
@@ -86,8 +86,8 @@
 		# TODO check, how fixup_bundle works and if it is required
 		install(CODE "
 			include(BundleUtilities)
-			set(BU_CHMOD_BUNDLE_ITEMS 1)
-			fixup_bundle(\"${APP_BUNDLE_PATH}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\")
+            set(BU_CHMOD_BUNDLE_ITEMS 1)
+            verify_app(\"${APP_BUNDLE_PATH}\")
 			" COMPONENT RUNTIME )
 		# Cleanup duplicate libs from macdeployqt
 		install(CODE "


Squashed '3rdparty/github/cmake-utils-remote/' changes from d9d0d5b..293f037

293f037 Fix depend options parsing

git-subtree-dir: 3rdparty/github/cmake-utils-remote
git-subtree-split: 293f03762dc4c3424a978e1984beccbf97d89ef1

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -2,22 +2,47 @@
   #
   # Optional argument: TESTS, LIBS, EXES
   #
-  SET (_TESTS TRUE)
-  SET (_LIBS TRUE)
-  SET (_EXES TRUE)
+  SET (_ALL TRUE)
+  SET (_TESTS FALSE)
+  SET (_LIBS FALSE)
+  SET (_EXES FALSE)
   FOREACH (_var ${ARGN})
-    IF ("\"${_var}\"" STREQUAL TESTS)
+    IF (${_var} STREQUAL TESTS)
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} test scope argument")
+      ENDIF ()
+      SET (_ALL FALSE)
       SET (_TESTS TRUE)
     ELSE ()
-      IF ("\"${_var}\"" STREQUAL LIBS)
+      IF (${_var} STREQUAL LIBS)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} library scope argument")
+        ENDIF ()
+        SET (_ALL FALSE)
         SET (_LIBS TRUE)
       ELSE ()
-        IF ("\"${_var}\"" STREQUAL EXES)
+        IF (${_var} STREQUAL EXES)
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} executables scope argument")
+          ENDIF ()
+          SET (_ALL FALSE)
           SET (_EXES TRUE)
+        ELSE ()
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} unknown scope argument: ${_var}")
+          ENDIF ()
         ENDIF ()
       ENDIF ()
     ENDIF ()
   ENDFOREACH ()
+  IF (_ALL)
+    SET (_TESTS TRUE)
+    SET (_LIBS TRUE)
+    SET (_EXES TRUE)
+  ENDIF ()
+  IF (MYPACKAGE_DEBUG)
+    MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency scopes are: ALL=${_ALL} TEST=${_TESTS} LIBS=${_LIBS} EXES=${_EXES}")
+  ENDIF ()
   #
   # Check if inclusion was already done - via us or another mechanism... guessed with TARGET check
   #


Use the CMake find_library command to find the FFmpeg libraries.

--- cmake/OpenCVFindLibsVideo.cmake
+++ cmake/OpenCVFindLibsVideo.cmake
@@ -229,28 +229,27 @@
     if(FFMPEG_INCLUDE_DIR)
       set(HAVE_GENTOO_FFMPEG TRUE)
       set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
-      if(EXISTS "${FFMPEG_LIB_DIR}/libavcodec.a")
-        set(HAVE_FFMPEG_CODEC 1)
-        set(ALIASOF_libavcodec_VERSION "Unknown")
-        if(EXISTS "${FFMPEG_LIB_DIR}/libavformat.a")
-          set(HAVE_FFMPEG_FORMAT 1)
-          set(ALIASOF_libavformat_VERSION "Unknown")
-          if(EXISTS "${FFMPEG_LIB_DIR}/libavutil.a")
-            set(HAVE_FFMPEG_UTIL 1)
-            set(ALIASOF_libavutil_VERSION "Unknown")
-            if(EXISTS "${FFMPEG_LIB_DIR}/libswscale.a")
-              set(HAVE_FFMPEG_SWSCALE 1)
-              set(ALIASOF_libswscale_VERSION "Unknown")
-              set(HAVE_FFMPEG 1)
-            endif()
-          endif()
-        endif()
+      find_library(FFMPEG_CODEC_LIB
+                   NAMES "libavcodec.a" "libavcodec.dylib"
+                   PATHS "${FFMPEG_LIB_DIR}")
+      find_library(FFMPEG_FORMAT_LIB
+                   NAMES "libavformat.a" "libavformat.dylib"
+                   PATHS "${FFMPEG_LIB_DIR}")
+      find_library(FFMPEG_UTIL_LIB
+                   NAMES "libavutil.a" "libavutil.dylib"
+                   PATHS "${FFMPEG_LIB_DIR}")
+      find_library(FFMPEG_SWSCALE_LIB
+                   NAMES "libswscale.a" "libswscale.dylib"
+                   PATHS "${FFMPEG_LIB_DIR}")
+      if(FFMPEG_CODEC_LIB AND FFMPEG_FORMAT_LIB AND
+         FFMPEG_UTIL_LIB AND FFMPEG_SWSCALE_LIB)
+        set(HAVE_FFMPEG 1)
       endif()
     endif(FFMPEG_INCLUDE_DIR)
     if(HAVE_FFMPEG)
-      set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
-          "${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
-          "${FFMPEG_LIB_DIR}/libswscale.a")
+      set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES}
+          ${FFMPEG_CODEC_LIB} ${FFMPEG_FORMAT_LIB}
+          ${FFMPEG_UTIL_LIB} ${FFMPEG_SWSCALE_LIB})
       ocv_include_directories(${FFMPEG_INCLUDE_DIR})
     endif()
   endif(APPLE)


cmake/compiler/gcc: Fall back to host compiler for x86_64

If we don't have a detected cross compiler for x86_64, use the host
compiler instead.

Signed-off-by: Andy Ross <c70f9a6bf6ee0cd69c8af4ce5e6b131945769315@intel.com>

--- cmake/compiler/gcc/target.cmake
+++ cmake/compiler/gcc/target.cmake
@@ -13,6 +13,29 @@
 find_program(CMAKE_READELF    ${CROSS_COMPILE}readelf PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
 find_program(CMAKE_GDB        ${CROSS_COMPILE}gdb     PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
 find_program(CMAKE_NM         ${CROSS_COMPILE}nm      PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
+
+# x86_64 should pick up a proper cross compiler if one is provided,
+# but falling back to using the host toolchain is a very sane behavior
+# too.
+if(CONFIG_X86_64)
+  if(CMAKE_C_COMPILER STREQUAL CMAKE_C_COMPILER-NOTFOUND)
+    find_program(CMAKE_C_COMPILER   gcc    )
+    find_program(CMAKE_OBJCOPY      objcopy)
+    find_program(CMAKE_OBJDUMP      objdump)
+    find_program(CMAKE_AR           ar     )
+    find_program(CMAKE_RANLILB      ranlib )
+    find_program(CMAKE_READELF      readelf)
+    find_program(CMAKE_GDB          gdb    )
+  endif()
+
+  # When building in x32 mode with a host compiler, there is no libgcc
+  # shipped (because it's an x86_64 compiler, not x32).  That's
+  # actually non-fatal, as no known features we hit in existing code
+  # actually require the library.  But I can't find an exaustive list
+  # of exactly what can break, so this is fragile.  Long term we
+  # really need to be blessing a proper cross toolchain.
+  set(no_libgcc Y)
+endif()

 if(CONFIG_CPLUSPLUS)
   set(cplusplus_compiler ${CROSS_COMPILE}${C++})


[CMake] Fix creation of swiftmodule directories on Apple platforms

The way it was set up before worked for Ninja but not for Xcode, due
to me not listing the swiftmodule directories as actual outputs of the
create-directories target. The resulting fix here is actually simpler
and involves fewer processes anyway, so good for us.

https://bugs.swift.org/browse/SR-10029

--- cmake/modules/SwiftSource.cmake
+++ cmake/modules/SwiftSource.cmake
@@ -283,17 +283,10 @@

   list(APPEND swift_flags ${SWIFTFILE_FLAGS})

-  set(obj_dirs)
+  set(dirs_to_create)
   foreach(output ${SWIFTFILE_OUTPUT})
     get_filename_component(objdir "${output}" PATH)
-    list(APPEND obj_dirs "${objdir}")
-  endforeach()
-  list(REMOVE_DUPLICATES obj_dirs)
-
-  set(command_create_dirs)
-  foreach(objdir ${obj_dirs})
-    list(APPEND command_create_dirs
-      COMMAND "${CMAKE_COMMAND}" -E make_directory "${objdir}")
+    list(APPEND dirs_to_create "${objdir}")
   endforeach()

   set(module_file)
@@ -333,11 +326,9 @@
     endif()

     if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
-      list(APPEND command_create_dirs
-          COMMAND "${CMAKE_COMMAND}" -E make_directory "${specific_module_dir}")
+      list(APPEND dirs_to_create "${specific_module_dir}")
     else()
-      list(APPEND command_create_dirs
-          COMMAND "${CMAKE_COMMAND}" -E make_directory "${module_dir}")
+      list(APPEND dirs_to_create "${module_dir}")
     endif()

     # If we have extra regexp flags, check if we match any of the regexps. If so
@@ -398,7 +389,7 @@
   endif()

   if (SWIFT_REPORT_STATISTICS)
-    list(GET obj_dirs 0 first_obj_dir)
+    list(GET dirs_to_create 0 first_obj_dir)
     list(APPEND swift_flags "-stats-output-dir" ${first_obj_dir})
   endif()

@@ -433,12 +424,12 @@
   endif()

   # First generate the obj dirs
+  list(REMOVE_DUPLICATES dirs_to_create)
   add_custom_command_target(
-      obj_dirs_dependency_target
-      ${command_create_dirs}
-      COMMAND ""
-      OUTPUT ${obj_dirs}
-      COMMENT "Generating obj dirs for ${first_output}")
+      create_dirs_dependency_target
+      COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create}
+      OUTPUT ${dirs_to_create}
+      COMMENT "Generating dirs for ${first_output}")

   # Then we can compile both the object files and the swiftmodule files
   # in parallel in this target for the object file, and ...
@@ -478,7 +469,7 @@
         ${swift_compiler_tool_dep}
         ${file_path} ${source_files} ${SWIFTFILE_DEPENDS}
         ${swift_ide_test_dependency}
-        ${obj_dirs_dependency_target}
+        ${create_dirs_dependency_target}
         ${copy_legacy_layouts_dep}
       COMMENT "Compiling ${first_output}")
   set("${dependency_target_out_var_name}" "${dependency_target}" PARENT_SCOPE)
@@ -513,7 +504,7 @@
           ${swift_compiler_tool_dep}
           ${source_files} ${SWIFTFILE_DEPENDS}
           ${swift_ide_test_dependency}
-          ${obj_dirs_dependency_target}
+          ${create_dirs_dependency_target}
         COMMENT "Generating ${module_file}")
     set("${dependency_module_target_out_var_name}" "${module_dependency_target}" PARENT_SCOPE)

@@ -529,7 +520,7 @@
         DEPENDS
           ${swift_compiler_tool_dep}
           ${source_files} ${SWIFTFILE_DEPENDS}
-          ${obj_dirs_dependency_target}
+          ${create_dirs_dependency_target}
         COMMENT "Generating ${sib_file}"
         EXCLUDE_FROM_ALL)
     set("${dependency_sib_target_out_var_name}" "${sib_dependency_target}" PARENT_SCOPE)
@@ -545,7 +536,7 @@
         DEPENDS
           ${swift_compiler_tool_dep}
           ${source_files} ${SWIFTFILE_DEPENDS}
-          ${obj_dirs_dependency_target}
+          ${create_dirs_dependency_target}
         COMMENT "Generating ${sibopt_file}"
         EXCLUDE_FROM_ALL)
     set("${dependency_sibopt_target_out_var_name}" "${sibopt_dependency_target}" PARENT_SCOPE)
@@ -562,7 +553,7 @@
         DEPENDS
           ${swift_compiler_tool_dep}
           ${source_files} ${SWIFTFILE_DEPENDS}
-          ${obj_dirs_dependency_target}
+          ${create_dirs_dependency_target}
           COMMENT "Generating ${sibgen_file}"
           EXCLUDE_FROM_ALL)
     set("${dependency_sibgen_target_out_var_name}" "${sibgen_dependency_target}" PARENT_SCOPE)


Fix reversed installation directories.

Fix reversed installation directories.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -272,12 +272,12 @@
       IF(NOT ${PROJECT_NAME} STREQUAL "zorba")
         STRING(REPLACE "-" "_"  component_name ${PROJECT_NAME})
         INSTALL(TARGETS ${module_lib_target}
-          ${target_type} DESTINATION ${ZORBA_CORE_LIB_DIR}/${module_path}
+          ${target_type} DESTINATION ${ZORBA_NONCORE_LIB_DIR}/${module_path}
           COMPONENT ${component_name})

       ELSE(NOT ${PROJECT_NAME} STREQUAL "zorba")
         INSTALL(TARGETS ${module_lib_target}
-          ${target_type} DESTINATION ${ZORBA_NONCORE_LIB_DIR}/${module_path})
+          ${target_type} DESTINATION ${ZORBA_CORE_LIB_DIR}/${module_path})
       ENDIF(NOT ${PROJECT_NAME} STREQUAL "zorba")
     ENDIF (NOT MODULE_TEST_ONLY)

@@ -427,7 +427,7 @@
         IF(NOT _is_core)
           STRING(REPLACE "-" "_"  component_name ${PROJECT_NAME})
           INSTALL (FILES "${INPUT_FILE}"
-            DESTINATION "${ZORBA_CORE_URI_DIR}/${_output_path}"
+            DESTINATION "${ZORBA_NONCORE_URI_DIR}/${_output_path}"
             RENAME "${_output_filename}"
             COMPONENT "${component_name}")

@@ -447,11 +447,9 @@

         ELSE(NOT _is_core)
           INSTALL (FILES "${INPUT_FILE}"
-          DESTINATION "${ZORBA_NONCORE_URI_DIR}/${_output_path}"
+          DESTINATION "${ZORBA_CORE_URI_DIR}/${_output_path}"
           RENAME "${_output_filename}")
         ENDIF(NOT _is_core)
-
-

       ENDIF (${_output_ext} STREQUAL ".xq" OR ${_output_ext} STREQUAL ".xsd")
     ENDIF (NOT ${TEST_ONLY} EQUAL 1)


Revert "ENH: fix directory too long for MSVC (limitation of windows api)"

This reverts commit caf7ccfbb9c3fe9c67159f6a31ad80d2e76d3b28.

--- SuperBuild/CMake/SuperBuild_Macro.cmake
+++ SuperBuild/CMake/SuperBuild_Macro.cmake
@@ -20,7 +20,7 @@
   list(APPEND FROM_SUPERBUILD_LIST ${NEW_SB_PROJECT})
   set(${NEW_SB_PROJECT}_DEPENDENCIES "")
   set(${NEW_SB_PROJECT}_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${NEW_SB_PROJECT}/build)
-  set(${NEW_SB_PROJECT}_SB_SRC ${CMAKE_BINARY_DIR}/${NEW_SB_PROJECT}/src)
+  set(${NEW_SB_PROJECT}_SB_SRC ${CMAKE_BINARY_DIR}/${NEW_SB_PROJECT}/src/${NEW_SB_PROJECT})
   set(${NEW_SB_PROJECT}_SB_CONFIG)
   set(_SB_${NEW_SB_PROJECT}_ROOT ${SB_INSTALL_PREFIX})
 endmacro(SETUP_SUPERBUILD)


bumped STIR and SIRF tags

bumped STIR and SIRF tags

--- version_config.cmake
+++ version_config.cmake
@@ -104,11 +104,11 @@
   set(DEFAULT_ISMRMRD_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG 6409e3753940136077b658af67112bd28545a3ce)
+  set(DEFAULT_SIRF_TAG d8975119e4134fb86620e5d31ed15526d793243c)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )
-  set(DEFAULT_STIR_TAG f482bcc5c7c3b8f92a0dc05dc04bd501caf6967e )
+  set(DEFAULT_STIR_TAG bbc4acd55ad88c2040d22e2a192633841821f588 )

   ## Gadgetron
   set(DEFAULT_Gadgetron_URL https://github.com/gadgetron/gadgetron )


cmake: add missing license header

cmake: add missing license header

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

--- config.cmake
+++ config.cmake
@@ -1,3 +1,25 @@
+#
+# Copyright (c) 2016 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+
 include(CheckFunctionExists)

 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")


try for a cleaner find_package for boost

--- Modules/ThirdParty/Boost/otb-module-init.cmake
+++ Modules/ThirdParty/Boost/otb-module-init.cmake
@@ -1,24 +1,13 @@
-# Required
-message(STATUS "Looking for required Boost headers")
-find_package ( Boost
-  1.35.0
-  REQUIRED
-  )
-
 # Mandatory components
 # - date_time -> ossim plugins
-set(OTB_Boost_MANDATORY_COMPONENTS date_time)
+set(OTB_Boost_COMPONENTS date_time)
 # Optional components
-# Boost (OPTIONAL_COMPONENTS does not work with Boost find_package)
-# unit_test_framework component is used only in GdalAdapters module
 if (BUILD_TESTING)
-  set(OTB_Boost_OPTIONAL_COMPONENTS unit_test_framework)
+  list(APPEND OTB_Boost_COMPONENTS unit_test_framework)
 endif()

-#Quiet find package to avoid message "Could not find boost" because unit_testing_framework is not installed
-message(STATUS "Looking for optional Boost components : ${OTB_Boost_OPTIONAL_COMPONENTS}")
 find_package ( Boost
-  QUIET
+  REQUIRED
   1.35.0
-  COMPONENTS ${OTB_Boost_MANDATORY_COMPONENTS} ${OTB_Boost_OPTIONAL_COMPONENTS}
+  COMPONENTS ${OTB_Boost_COMPONENTS}
   )


Temporarily disable LLVM 12 support (for 1.6 release)

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -39,7 +39,6 @@
     NAMES
       "llvmtce-config"
       "llvm-config"
-      "llvm-config-mp-12.0" "llvm-config-12" "llvm-config120"
       "llvm-config-mp-11.0" "llvm-config-11" "llvm-config110"
       "llvm-config-mp-10.0" "llvm-config-10" "llvm-config100"
       "llvm-config-mp-9.0" "llvm-config-9" "llvm-config90"
@@ -195,11 +194,8 @@
 elseif(LLVM_VERSION MATCHES "^11[.]")
   set(LLVM_MAJOR 11)
   set(LLVM_11_0 1)
-elseif(LLVM_VERSION MATCHES "^12[.]")
-  set(LLVM_MAJOR 12)
-  set(LLVM_12_0 1)
 else()
-  message(FATAL_ERROR "LLVM version between 6.0 and 12.0 required, found: ${LLVM_VERSION}")
+  message(FATAL_ERROR "LLVM version between 6.0 and 11.0 required, found: ${LLVM_VERSION}")
 endif()

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


fix: Prefer “libarpack” over “libparpack” in FindARPACK

When using libparpack installed with Homebrew, undefined symbols were encountered. Use of libarpack fixed it.

--- CMake/Modules/FindARPACK.cmake
+++ CMake/Modules/FindARPACK.cmake
@@ -1,5 +1,5 @@
 find_library(ARPACK_LIBRARY
-  NAMES parpack arpack
+  NAMES arpack parpack
   PATHS ${ARPACK_DIR}/lib
 )


Fixed bug with output in configuration file.

--- CMake/TBTKConfigTemplate.cmake
+++ CMake/TBTKConfigTemplate.cmake
@@ -1,6 +1,6 @@
 FUNCTION(TBTK_MESSAGE msg)
 	IF(NOT TBTK_QUIET)
-		MESSAGE(msg)
+		MESSAGE(${msg})
 	ENDIF(NOT TBTK_QUIET)
 ENDFUNCTION(TBTK_MESSAGE)


bumping version

bumping version

--- CMakeModules/OMPLVersion.cmake
+++ CMakeModules/OMPLVersion.cmake
@@ -1,5 +1,5 @@
 # set the version in a way CMake can use
 set(OMPL_MAJOR_VERSION 0)
 set(OMPL_MINOR_VERSION 9)
-set(OMPL_PATCH_VERSION 3)
+set(OMPL_PATCH_VERSION 4)
 set(OMPL_VERSION "${OMPL_MAJOR_VERSION}.${OMPL_MINOR_VERSION}.${OMPL_PATCH_VERSION}")


Make missing override a warning again

Make missing override a warning again

--- CMake/mitkFunctionCreateModule.cmake
+++ CMake/mitkFunctionCreateModule.cmake
@@ -363,6 +363,7 @@
         mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=static-member-init" module_c_flags module_cxx_flags)
         mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=unknown-warning" module_c_flags module_cxx_flags)
         mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=gnu" module_c_flags module_cxx_flags)
+        mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=inconsistent-missing-override" module_c_flags module_cxx_flags)
       endif()
     endif(MODULE_WARNINGS_AS_ERRORS)


Hardcode OpenAL include path on MSVC.

Hardcode OpenAL include path on MSVC.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@2012 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -280,6 +280,10 @@
         NAMES OpenAL openal
         COMPONENTS al OpenAL32
         PREFIXES ${ENV_NAALI_DEP_PATH}/OpenAL ${ENV_NAALI_DEP_PATH}/OpenAL/libs/Win32)
+        # Force include dir on MSVC
+        if (MSVC)
+  		   set (OPENAL_INCLUDE_DIRS ${ENV_NAALI_DEP_PATH}/OpenAL/include)
+        endif ()
     sagase_configure_report (OPENAL)
 endmacro (configure_openal)


Temporaly fix to cmake OpenSSL issue.

Temporaly fix to cmake OpenSSL issue.

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -370,22 +370,21 @@
 endmacro (configure_mumbleclient)

 macro (configure_openssl)
-	# NOTE: This doesn't work with CMake 2.8 Windows version
-	#       CMake 2.6 must be used
     sagase_configure_package(OPENSSL
         NAMES openssl
         COMPONENTS libeay32 ssleay32 ssl
         PREFIXES ${ENV_NAALI_DEP_PATH}/OpenSSL)
-    # remove 'NOTFOUND' entry which makes to linking impossible
+    # remove 'NOTFOUND' entry which makes to linking impossible
     if (MSVC)
-        list(REMOVE_ITEM OPENSSL_LIBRARIES NOTFOUND)
+        list(REMOVE_ITEM OPENSSL_LIBRARIES debug optimized SSL_EAY_RELEASE-NOTFOUND LIB_EAY_RELEASE-NOTFOUND SSL_EAY_DEBUG-NOTFOUND LIB_EAY_DEBUG-NOTFOUND NOTFOUND)
+    message(----------)
+    message(${OPENSSL_LIBRARIES})
+    message(----------)
     endif ()
     sagase_configure_report (OPENSSL)
 endmacro (configure_openssl)

 macro (configure_protobuf)
-	message(PROTOBUF_INCLUDE_DIR=${PROTOBUF_INCLUDE_DIR})
-	message(PROTOBUF_LIBRARY=${PROTOBUF_LIBRARY})
     sagase_configure_package(PROTOBUF
         NAMES google protobuf
         COMPONENTS libprotobuf


Removed forced disable of microphone redirection for android builds.

--- channels/audin/ChannelOptions.cmake
+++ channels/audin/ChannelOptions.cmake
@@ -4,7 +4,6 @@
 set(OPTION_SERVER_DEFAULT ON)

 if(ANDROID)
-	set(OPTION_CLIENT_DEFAULT OFF)
 	set(OPTION_SERVER_DEFAULT OFF)
 endif()


[FIX] fixes find java

[FIX] fixes find java

--- util/cmake/FindJava.cmake
+++ util/cmake/FindJava.cmake
@@ -69,7 +69,8 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)

-include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
+#include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
+include(${CMAKE_MODULE_PATH}/CMakeFindJavaCommon.cmake)

 # The HINTS option should only be used for values computed from the system.
 set(_JAVA_HINTS)


Issue #53: OpenCV calib3d also requires features and flann module.

--- CMake/ExternalProjects/OpenCV.cmake
+++ CMake/ExternalProjects/OpenCV.cmake
@@ -76,8 +76,8 @@
       -DBUILD_opencv_imgproc:BOOL=ON
       -DBUILD_opencv_apps:BOOL=OFF
       -DBUILD_opencv_dnn:BOOL=OFF
-      -DBUILD_opencv_features2d:BOOL=OFF
-      -DBUILD_opencv_flann:BOOL=OFF
+      -DBUILD_opencv_features2d:BOOL=ON
+      -DBUILD_opencv_flann:BOOL=ON
       -DBUILD_opencv_gapi:BOOL=OFF
       -DBUILD_opencv_highgui:BOOL=OFF
       -DBUILD_opencv_imgcodecs:BOOL=OFF


update build system for windows

update build system for windows

git-svn-id: 931ab4487dc05a11552de95f7d42b8249ade56b7@2492 a5045d30-4826-4484-9c7f-6e55a06ddc77

--- Code/cmake/Modules/RDKitUtils.cmake
+++ Code/cmake/Modules/RDKitUtils.cmake
@@ -24,6 +24,7 @@
   CDR(RDKLIB_SOURCES ${RDKLIB_DEFAULT_ARGS})
   if(MSVC)
     add_library(${RDKLIB_NAME} ${RDKLIB_SOURCES})
+    target_link_libraries(${RDKLIB_NAME} ${Boost_SYSTEM_LIBRARY} )
     INSTALL(TARGETS ${RDKLIB_NAME} EXPORT ${RDKit_EXPORTED_TARGETS}
             DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
             COMPONENT dev )


Let DataMan_ROOT_DIR be specified by either a CMake or Env variable

--- cmake/FindDataMan.cmake
+++ cmake/FindDataMan.cmake
@@ -21,8 +21,16 @@
 # You can also set the following variable to help guide the search:
 #   DataMan_ROOT_DIR - The install prefix for DataMan containing the
 #                      include and lib folders
+#                      Note: this can be set as a CMake variable or an
+#                            environment variable.  If specified as a CMake
+#                            variable, it will override any setting specified
+#                            as an environment variable.

 if(NOT DataMan_FOUND)
+  if((NOT DataMan_ROOT_DIR) AND (NOT (ENV{DataMan_ROOT_DIR} STREQUAL "")))
+    set(DataMan_ROOT_DIR "$ENV{DataMan_ROOT_DIR}")
+  endif()
+
   # Search for the core libraries
   if(DataMan_ROOT_DIR)
     # If a root directory is specified, then don't look anywhere else


Added a few more hints for OpenCV location.

--- cmake/find/opencv.cmake
+++ cmake/find/opencv.cmake
@@ -31,7 +31,15 @@
   LIST(APPEND OpenCV_Components_List ${OpenCV_Advanced_Components_List})
 ENDIF()

-SET(OPENCV_HINTS "/usr/local/share/OpenCV" "${USERPROFILE}/Documents/opencv/build" "C:/Users/Public/Documents/opencv/build" "${USERPROFILE}/Documents/Code/BUILDS/opencv/build" "${USERPROFILE}/Documents/GitHub/BUILDS/OpenCV")
+SET(OPENCV_HINTS
+	"/usr/local/share/OpenCV"
+	"${USERPROFILE}/Documents/opencv/build"
+	"C:/Users/Public/Documents/opencv/build"
+	"${USERPROFILE}/Downloads/opencv/build"
+	"C:/Users/Public/Downloads/opencv/build"
+	"${USERPROFILE}/Documents/Code/BUILDS/opencv/build"
+	"${USERPROFILE}/Documents/GitHub/BUILDS/OpenCV"
+	"${USERPROFILE}/Documents/GitHub/BUILDS/OpenCV" )
 find_package(OpenCV 2.4.8 COMPONENTS ${OpenCV_Components_List} QUIET)

 IF(OpenCV_USE_ADVANCED_COMPONENTS AND NOT OPENCV_VIZ_FOUND) # If you can't find OpenCV with viz, exclude it and try again


Look for gnat library with specific versioned names in reverse order so
newest is first (after generic gnat name).

Add gnat-4.5 (first) in versioned list.  gnat-4.5 is used in latest MinGW
release and probably in up-to-date Linux distros as well.

svn path=/trunk/; revision=10883

--- cmake/modules/ada.cmake
+++ cmake/modules/ada.cmake
@@ -43,7 +43,7 @@
 endif(ENABLE_ada)

 if(ENABLE_ada)
-  find_library(GNAT_LIB NAMES gnat gnat-4.1 gnat-4.2 gnat-4.3 gnat-4.4)
+  find_library(GNAT_LIB NAMES gnat gnat-4.5 gnat-4.4 gnat-4.3 gnat-4.2 gnat-4.1)
   if(NOT GNAT_LIB)
     message(STATUS "WARNING: "
       "gnat library not found. Disabling ada bindings")
@@ -52,8 +52,6 @@
     message(STATUS "FOUND gnat library ${GNAT_LIB}")
   endif(NOT GNAT_LIB)
 endif(ENABLE_ada)
-
-

 # New stuff by Jerry for source modifications for Ada 2007 or not Ada 2007.
 option(HAVE_ADA_2007 "Ada 2007?" OFF)


build: Workaround windows installation problems

I think this can be done without an if/else but this works for now.

--- cmake/wrap-python.cmake
+++ cmake/wrap-python.cmake
@@ -26,9 +26,16 @@
   SET(VTK_INSTALL_LIB_DIR_CM24 "${PV_INSTALL_LIB_DIR}")
   SET(VTK_INSTALL_BIN_DIR_CM24 "${PV_INSTALL_BIN_DIR}")

+if(WIN32 AND NOT CYGWIN)
+  INSTALL(TARGETS ${library_name}PythonD ${library_name}Python
+    RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries
+    LIBRARY DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries
+    ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development)
+else()
   INSTALL(TARGETS ${library_name}PythonD ${library_name}Python
     RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries
     LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries
     ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development)
+endif()

 endfunction()


ENH: CI: PKG: Added (temporary) debug traces.

--- Packaging/detect_using_file_command.cmake
+++ Packaging/detect_using_file_command.cmake
@@ -18,7 +18,7 @@
 # limitations under the License.
 #
 function(detect_using_file_command input_file result_type result_dir)
-
+
   execute_process(COMMAND "${FILE_COMMAND}" "${input_file}"
     RESULT_VARIABLE file_rv
     OUTPUT_VARIABLE file_ov
@@ -32,6 +32,11 @@
   get_filename_component(input_file_NAME ${input_file} NAME)
   string(REPLACE "${input_file}" " _file_full_ " file_ov "${file_ov}")
   string(TOLOWER "${file_ov}" file_ov_lower)
+
+  message( "input_file: '${input_file}'" )
+  message( "input_file_NAME: '${input_file_NAME}'" )
+  message( "file_ov: '${file_ov}'" )
+  message( "file_ov_lower: '${file_ov_lower}'" )

   set(detected_type)
   set(detected_dir)
@@ -85,9 +90,9 @@

     set(is_this_a_symbolic_link FALSE)
     set(target_file)
-    isfile_symlink("${input_file}" is_this_a_symbolic_link target_file)
+    isfile_symlink("${input_file}" is_this_a_symbolic_link target_file)
     if(is_this_a_symbolic_link)
-
+
       if(target_file)
 	set(libdir "lib")
 	setif_value_in_list(is_gtk_lib "${input_file_NAME}" GTK_LIB_LIST_1)


Changing CreateLibrary binary path (#636)

* Correcting TensileCreateLibrary command to use paths derived via cmake

--- Tensile/Source/TensileCreateLibrary.cmake
+++ Tensile/Source/TensileCreateLibrary.cmake
@@ -1,5 +1,5 @@
 ################################################################################
-# Copyright (C) 2016 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2016-2019 Advanced Micro Devices, Inc. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -36,16 +36,7 @@
   message(STATUS "Tensile_CODE_OBJECT_VERSION from TensileCreateLibraryCmake : ${Tensile_CODE_OBJECT_VERSION}")
   message(STATUS "Tensile_COMPILER            from TensileCreateLibraryCmake : ${Tensile_COMPILER}")

-  # Tensile_ROOT can be specified instead of using the installed path.
-  set(oneValueArgs Tensile_ROOT)
-  cmake_parse_arguments(PARSE "" "${oneValueArgs}" "" ${ARGN})
-
-  if(PARSE_Tensile_ROOT)
-    # python not pre-installed, use scripts downloaded to extern/Tensile
-    set(Tensile_CREATE_COMMAND "${Tensile_ROOT}/TensileCreateLibrary")
-  else()
-    set(Tensile_CREATE_COMMAND tensileCreateLibrary)
-  endif()
+  set(Tensile_CREATE_COMMAND "${Tensile_ROOT}/bin/TensileCreateLibrary")

   set(Tensile_SOURCE_PATH "${PROJECT_BINARY_DIR}/Tensile")
@@ -137,7 +128,7 @@
     target_compile_definitions( Tensile PUBLIC
       -DTensile_RUNTIME_LANGUAGE_OCL=1 -DTensile_RUNTIME_LANGUAGE_HIP=0 )
     target_include_directories( Tensile SYSTEM
-      PUBLIC  ${OPENCL_INCLUDE_DIRS} )
+      PUBLIC  ${OPENCL_INCLUDE_DIRS} )
   else()
     #find_package( HIP REQUIRED )
     set (CMAKE_CXX_COMPILER ${HIPCC})
@@ -149,5 +140,3 @@
   endif()

 endfunction()
-
-


fix: Build of ImageIO module WITH_NiftiCLib=ON on Ubuntu [ImageIO]

--- Modules/ImageIO/config/Depends.cmake
+++ Modules/ImageIO/config/Depends.cmake
@@ -68,5 +68,5 @@
   )
   set(NiftiCLib_LIBRARIES nifticlib)
   set(NiftiCLib_FOUND TRUE)
-  include_directories(${NiftiCLib_INCLUDE_DIRS})
 endif ()
+include_directories(${NiftiCLib_INCLUDE_DIRS})


SuperBuild: support GDAL extra args also for Windows

--- SuperBuild/CMake/External_gdal.cmake
+++ SuperBuild/CMake/External_gdal.cmake
@@ -43,12 +43,12 @@
 set(GDAL_BUILD_COMMAND)
 set(GDAL_INSTALL_COMMAND)

+set(GDAL_SB_EXTRA_OPTIONS "" CACHE STRING "Extra options to be passed to GDAL configure script")
+mark_as_advanced(GDAL_SB_EXTRA_OPTIONS)
+#Convert GDAL_SB_EXTRA_OPTIONS to a list to allow to add multiple instructions to the CONFIGURE_COMMAND
+separate_arguments(GDAL_SB_EXTRA_OPTIONS)

 if(UNIX)
-  set(GDAL_SB_EXTRA_OPTIONS "" CACHE STRING "Extra options to be passed to GDAL configure script")
-  mark_as_advanced(GDAL_SB_EXTRA_OPTIONS)
-  #Convert GDAL_SB_EXTRA_OPTIONS to a list to allow to add multiple instructions to the CONFIGURE_COMMAND
-  separate_arguments(GDAL_SB_EXTRA_OPTIONS)
   #we don't do any framework build on osx. So let's be sure on case of gdal
   if(APPLE)
     list(APPEND GDAL_SB_CONFIG "--with-macosx-framework=no")
@@ -111,6 +111,10 @@
   configure_file(
     ${CMAKE_SOURCE_DIR}/patches/GDAL/nmake_gdal_extra.opt.in
     ${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt)
+
+  foreach(opt_line ${GDAL_SB_EXTRA_OPTIONS})
+    file(APPEND "${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt" "${opt_line}")
+  endforeach()

   if(OTB_TARGET_SYSTEM_ARCH_IS_X64)
     file(APPEND "${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt" "WIN64=YES")


SuperBuild: apply patch for setmode on for unix

--- SuperBuild/CMake/External_jpeg.cmake
+++ SuperBuild/CMake/External_jpeg.cmake
@@ -33,12 +33,16 @@
     -DWITH_SIMD=FALSE
     -DWITH_TURBOJPEG=FALSE
     CMAKE_COMMAND ${SB_CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${SB_INSTALL_PREFIX}
-    PATCH_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/patches/${proj}/patch.cmake
     )

   if(MSVC)
     ExternalProject_Add_Step(${proj} patch_jconfigint
       COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/${proj}/jconfigint.h.in ${JPEG_SB_SRC}/win/
+      DEPENDERS configure)
+  endif()
+  if(UNIX)
+    ExternalProject_Add_Step(${proj} patch_setmode
+      COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/patches/${proj}/patch.cmake
       DEPENDERS configure)
   endif()


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

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


Small bug fix to run script for multifile building

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -44,7 +44,7 @@
 set(ALLO_APP_NAME_SUFFIX "${${ALLO_APP_NAME}}")
 endif()

-add_executable("${ALLO_APP_NAME_SUFFIX}" EXCLUDE_FROM_ALL "${${ALLO_APP_SRC}}")
+add_executable("${ALLO_APP_NAME_SUFFIX}" EXCLUDE_FROM_ALL ${${ALLO_APP_SRC}})

 if(NOT ${DEFINES} STREQUAL "")
 #message("Adding defines ${DEFINES}")


removed a cmake hack

removed a cmake hack

--- config/VIGRA_ADD_NUMPY_MODULE.cmake
+++ config/VIGRA_ADD_NUMPY_MODULE.cmake
@@ -25,6 +25,7 @@

 FUNCTION(VIGRA_ADD_NUMPY_MODULE target)
+
     # parse the args
     set(v SOURCES)
     set(PART_OF_VIGRANUMPY 0)


SVN_SILENT made messages (.desktop file)

--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -17,6 +17,7 @@
 Name[ko]=인스턴트 메시지
 Name[lt]=Tikralaikiai pokalbiai
 Name[nb]=Lynmelding
+Name[nds]=Kortnarichten
 Name[nl]=Instant Messaging
 Name[pl]=Komunikator internetowy
 Name[pt]=Mensagens Instantâneas
@@ -54,6 +55,7 @@
 Comment[ko]=IM 대화 상대와 대화를 시작하거나 상태 바꾸기
 Comment[lt]=Pradėti pokalbį su bet kuriuo TP kontaktu arba pakeiskite savo TP būseną
 Comment[nb]=Start en prat med en av dine LM-kontakter eller endre din LM-status
+Comment[nds]=En Klöönsnack mit een vun Dien KM-Kontakten starten oder Dien KN-Status ännern
 Comment[nl]=Begin een chat met een van uw IM-contactpersonen of wijzig uw IM-status
 Comment[pl]=Rozpocznij rozmowę z którymkolwiek z twoich kontaktów lub zmień swoja dostępność
 Comment[pt]=Iniciar uma conversa com qualquer um dos seus contactos MI ou mudar o seu estado


vigra.cmake: Fetch from origin before checking out the vigra version.

--- vigra.cmake
+++ vigra.cmake
@@ -46,7 +46,7 @@
 if("${VIGRA_VERSION}" STREQUAL "master")
     set(VIGRA_UPDATE_COMMAND git checkout master && git pull)
 else()
-    set(VIGRA_UPDATE_COMMAND git checkout ${VIGRA_VERSION})
+    set(VIGRA_UPDATE_COMMAND git fetch origin && git checkout ${VIGRA_VERSION})
 endif()

 message ("Installing ${vigra_NAME}/${VIGRA_VERSION} into FlyEM build area: ${BUILDEM_DIR} ...")