[CMake] Remove directory-wide includes from ROOT_ADD_GTEST.

After adding the INTERFACE include for gtest/gmock, directory-wide
includes are not necessary, any more.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -1517,7 +1517,6 @@
 #
 function(ROOT_ADD_GTEST test_suite)
   CMAKE_PARSE_ARGUMENTS(ARG "WILLFAIL" "" "COPY_TO_BUILDDIR;LIBRARIES;LABELS" ${ARGN})
-  include_directories(${CMAKE_CURRENT_BINARY_DIR} ${GTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR})

   ROOT_GET_SOURCES(source_files . ${ARG_UNPARSED_ARGUMENTS})
   # Note we cannot use ROOT_EXECUTABLE without user-specified set of LIBRARIES to link with.
@@ -1527,6 +1526,7 @@
   # to implement because some ROOT components create more than one library.
   ROOT_EXECUTABLE(${test_suite} ${source_files} LIBRARIES ${ARG_LIBRARIES})
   target_link_libraries(${test_suite} gtest gtest_main gmock gmock_main)
+  target_include_directories(${test_suite} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
   if(MSVC)
     set(test_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch
         /EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index")


[rootcling] Treat warnings coming from ROOT as errors.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -576,13 +576,13 @@

   #---what rootcling command to use--------------------------
   if(ARG_STAGE1)
-    set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $<TARGET_FILE:rootcling_stage1>)
+    set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $<TARGET_FILE:rootcling_stage1> -failOnWarnings)
     set(ROOTCINTDEP rconfigure)
     set(pcm_name)
   else()
     if(CMAKE_PROJECT_NAME STREQUAL ROOT)
       set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}"
-                  "ROOTIGNOREPREFIX=1" $<TARGET_FILE:rootcling> -rootbuild)
+                  "ROOTIGNOREPREFIX=1" $<TARGET_FILE:rootcling> -rootbuild -failOnWarnings)
       # Modules need RConfigure.h copied into include/.
       set(ROOTCINTDEP rootcling rconfigure)
     elseif(TARGET ROOT::rootcling)


Only copy test files to staging area if they've changed.

--- cmake/modules/testhelper.cmake
+++ cmake/modules/testhelper.cmake
@@ -1,37 +1,36 @@
 function(addTestTargetToLibavgPythonPackage testTarget)
     add_custom_target(copy_${testTarget} ALL)
     add_dependencies(copy_${testTarget} ${testTarget})
-    add_custom_command(TARGET copy_${testTarget}
-        COMMAND ${CMAKE_COMMAND} -E copy
-        "${CMAKE_CURRENT_BINARY_DIR}/${testTarget}"
-        "${CMAKE_BINARY_DIR}/python/libavg/test/cpptest"
-        )
+    copyDirIfDifferent("copy_${testTarget}"
+            "${CMAKE_CURRENT_BINARY_DIR}/${testTarget}"
+            "${CMAKE_BINARY_DIR}/python/libavg/test/cpptest")
 endfunction()

 function(addTestDataToLibavgPythonPackage testTarget dataDir)
-    add_custom_command(TARGET copy_${testTarget}
-        COMMAND ${CMAKE_COMMAND} -E copy_directory
-        "${CMAKE_CURRENT_SOURCE_DIR}/${dataDir}"
-        "${CMAKE_BINARY_DIR}/python/libavg/test/cpptest/baseline"
-        )
+    copyDirIfDifferent("copy_${testTarget}"
+            "${CMAKE_CURRENT_SOURCE_DIR}/${dataDir}"
+            "${CMAKE_BINARY_DIR}/python/libavg/test/cpptest/baseline")
 endfunction()

 function(copyToStaging dir)
     set(python_test_package_dir "${CMAKE_BINARY_DIR}/python/libavg/test")
-    add_custom_command(TARGET copy_python_tests
+    copyDirIfDifferent(copy_python_tests
+            "${CMAKE_CURRENT_SOURCE_DIR}/${dir}"
+            "${python_test_package_dir}/${dir}")
+endfunction()
+
+function(copyDirIfDifferent target src_dir dest_dir)
+    add_custom_command(TARGET ${target}
         COMMAND ${CMAKE_COMMAND}
-                ARGS -E make_directory "${python_test_package_dir}/${dir}"
+                ARGS -E make_directory "${dest_dir}"
         )
-    file(MAKE_DIRECTORY "${python_test_package_dir}/${dir}")
-    file(GLOB test_files
-            RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/${dir}"
-            "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*")
-    foreach(cur_file ${test_files})
-        add_custom_command(TARGET copy_python_tests
+    file(GLOB filelist
+            RELATIVE "${src_dir}" "${src_dir}/*")
+    foreach(cur_file ${filelist})
+        add_custom_command(TARGET ${target}
             COMMAND ${CMAKE_COMMAND}
-            ARGS -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${cur_file}"
-                    "${python_test_package_dir}/${dir}/${cur_file}"
+            ARGS -E copy_if_different "${src_dir}/${cur_file}" "${dest_dir}/${cur_file}"
             )
     endforeach()
 endfunction()


Fixed finding libassimp 2

Fixed finding libassimp 2

--- cmake_modules/FindAssimp.cmake
+++ cmake_modules/FindAssimp.cmake
@@ -16,13 +16,13 @@

 # Include dir
 find_path(ASSIMP2_INCLUDE_DIR
-  NAMES assimp.h
-  PATHS ${ASSIMP_PKGCONF_INCLUDE_DIRS} /usr/lib /usr/local/lib /opt/local/lib
+  NAMES assimp/assimp.h
+  PATHS ${ASSIMP_PKGCONF_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include
 )

 find_path(ASSIMP3_INCLUDE_DIR
   NAMES assimp/types.h
-  PATHS ${ASSIMP_PKGCONF_INCLUDE_DIRS} /usr/lib /usr/local/lib /opt/local/lib
+  PATHS ${ASSIMP_PKGCONF_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include
 )

 if (ASSIMP2_INCLUDE_DIR)


Fixed package name in bootstrap script

Fixed package name in bootstrap script

--- bootstrap.cmake
+++ bootstrap.cmake
@@ -1,6 +1,9 @@
 if(NOT SIPLASPLAS_ROOT)
     if(SIPLASPLAS_PACKAGE_URL)
-        set(SIPLASPLAS_PACKAGE "${CMAKE_BINARY_DIR}/siplasplas_package")
+        get_filename_component(SIPLASPLAS_PACKAGE "${SIPLASPLAS_PACKAGE_URL}" NAME)
+        message(STATUS "Downloading siplasplas package (${SIPLASPLAS_PACKAGE}) from ${SIPLASPLAS_PACKAGE_URL} ...")
+        set(SIPLASPLAS_PACKAGE "${CMAKE_SOURCE_DIR}/${SIPLASPLAS_PACKAGE}")
+
         file(DOWNLOAD "${SIPLASPLAS_PACKAGE_URL}" "${SIPLASPLAS_PACKAGE}" SHOW_PROGRESS)
     endif()


kitchen patch for other kitchens.: enables, project(recognition_kitchen)

--- kitchen/kitchen.cmake
+++ kitchen/kitchen.cmake
@@ -9,7 +9,12 @@
   message("PROJECTS: ${ARGN}")
   set(KITCHEN_PROJECTS "ecto;${ARGN}")

-  set(ECTO_KITCHEN_VERSION 11.07.0)
+  set(ECTO_KITCHEN_VERSION 11.07.0)
+  if(NOT ecto_kitchen_SOURCE_DIR)
+    set(ecto_kitchen_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+    set(ecto_kitchen_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+  endif()
+
   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
   enable_testing()


cmake: add idf_component_optional_requires utility function

It can be used in component CMakeLists.txt files when adding "weak"
dependencies between component. A "weak" dependency from A to B is
similar to target_link_libraries(A PRIVATE B), but it gets added only
if B is included in the build.
Use it instead of specifying B as part of PRIV_REQUIRES when the
component can be built (even if with reduced functionality) without
component B being available.

--- tools/cmake/component.cmake
+++ tools/cmake/component.cmake
@@ -576,6 +576,28 @@
       )
 endfunction()

+# idf_component_optional_requires
+#
+# @brief Add a dependency on a given component only if it is included in the build.
+#
+# Calling idf_component_optional_requires(PRIVATE dependency_name) has the similar effect to
+# target_link_libraries(${COMPONENT_LIB} PRIVATE idf::dependency_name), only if 'dependency_name'
+# component is part of the build. Otherwise, no dependency gets added. Multiple names may be given.
+#
+# @param[in]  type of the dependency, one of: PRIVATE, PUBLIC, INTERFACE
+# @param[in, multivalue] list of component names which should be added as dependencies
+#
+function(idf_component_optional_requires req_type)
+    set(optional_reqs ${ARGN})
+    idf_build_get_property(build_components BUILD_COMPONENTS)
+    foreach(req ${optional_reqs})
+        if(req IN_LIST build_components)
+            idf_component_get_property(req_lib ${req} COMPONENT_LIB)
+            target_link_libraries(${COMPONENT_LIB} ${req_type} ${req_lib})
+        endif()
+    endforeach()
+endfunction()
+
 #
 # Deprecated functions
 #


Move forward to test XYZ reader fix in VTK/ParaView

--- versions.cmake
+++ versions.cmake
@@ -80,7 +80,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision locally before proposing a move
-  set(_paraview_revision "tomviz/1.3.0")
+  set(_paraview_revision "13d89b983295f890eb80a5b12ea6b0f0f1988fd2")
 endif()
 # Locally patched ParaView repo, or main repo
 #set(_paraview_repo "https://gitlab.kitware.com/paraview/paraview.git")


BUG: Fix ExternalProject.cmake - Variables in PROJ-git{clone|update}.cmake were not escaped

This was causing problem when the variables contained spaces

--- CMake/ExternalProject.cmake
+++ CMake/ExternalProject.cmake
@@ -687,7 +687,7 @@
     find_program(Git_EXECUTABLE git DOC "git command line client")
     mark_as_advanced(Git_EXECUTABLE)
     if(NOT Git_EXECUTABLE)
-      message(FATAL_ERROR "error: could not git svn for clone of ${name}")
+      message(FATAL_ERROR "error: could not find git to clone ${name} - Make sure Git_EXECUTABLE is set properly")
     endif()

     # TODO  [GIT_REVISION revision]        # Revision to checkout from GIT repo
@@ -710,12 +710,12 @@
     # That script will delete the source directory and call the appropriate git clone command
     file(WRITE ${tmp_dir}/${name}-gitclone.cmake "
 execute_process(
-  COMMAND ${CMAKE_COMMAND} -E remove_directory ${source_dir}
+  COMMAND \"${CMAKE_COMMAND}\" -E remove_directory \"${source_dir}\"
   RESULT_VARIABLE error_code
   )
 execute_process(
-  COMMAND ${Git_EXECUTABLE} clone ${git_repository} ${src_name}
-  WORKING_DIRECTORY ${work_dir}
+  COMMAND \"${Git_EXECUTABLE}\" clone \"${git_repository}\" \"${src_name}\"
+  WORKING_DIRECTORY \"${work_dir}\"
   RESULT_VARIABLE error_code
   )
 if(error_code)
@@ -828,13 +828,13 @@
     # The following script will allow to reset, pull and re-apply patches
     file(WRITE ${tmp_dir}/${name}-gitupdate.cmake "
 execute_process(
-  COMMAND ${Git_EXECUTABLE} reset --hard HEAD
-  WORKING_DIRECTORY ${work_dir}
+  COMMAND \"${Git_EXECUTABLE}\" reset --hard HEAD
+  WORKING_DIRECTORY \"${work_dir}\"
   RESULT_VARIABLE error_code
   )
 execute_process(
-  COMMAND ${Git_EXECUTABLE} pull
-  WORKING_DIRECTORY ${work_dir}
+  COMMAND \"${Git_EXECUTABLE}\" pull
+  WORKING_DIRECTORY \"${work_dir}\"
   RESULT_VARIABLE error_code
   )
 if(error_code)
@@ -842,8 +842,8 @@
 endif()
 if(${patch_cmd_set})
   execute_process(
-    COMMAND ${patch_cmd}
-    WORKING_DIRECTORY ${patch_work_dir}
+    COMMAND \"${patch_cmd}\"
+    WORKING_DIRECTORY \"${patch_work_dir}\"
     RESULT_VARIABLE error_code
     )
   if(error_code)


From Mattias Helsing, "" * Use the CPack ZIP generator on windows (WIN32) * Reformatted according to Philip Lowman's recent submissions"

--- CMakeModules/OsgCPack.cmake
+++ CMakeModules/OsgCPack.cmake
@@ -30,7 +30,6 @@
         SET(SYSTEM_NAME "win32")
     ENDIF()
 ENDIF()
-
 # Guess the compiler (is this desired for other platforms than windows?)
 IF(NOT DEFINED OSG_CPACK_COMPILER)
     INCLUDE(OsgDetermineCompiler)
@@ -40,9 +39,9 @@
 SET(OSG_CPACK_COMPILER "${OSG_COMPILER}" CACHE STRING "This ia short string (vc90, vc80sp1, gcc-4.3, ...) describing your compiler. The string is used for creating package filenames")

 IF(OSG_CPACK_COMPILER)
-    SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}-${OSG_CPACK_COMPILER})
+  SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}-${OSG_CPACK_COMPILER})
 ELSE()
-    SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH})
+  SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH})
 ENDIF()

@@ -50,7 +49,11 @@
 SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${OPENSCENEGRAPH_VERSION}")

 # these goes for all platforms. Setting these stops the CPack.cmake script from generating options about other package compression formats (.z .tz, etc.)
-SET(CPACK_GENERATOR "TGZ")
+IF(WIN32)
+    SET(CPACK_GENERATOR "ZIP")
+ELSE()
+    SET(CPACK_GENERATOR "TGZ")
+ENDIF()
 SET(CPACK_SOURCE_GENERATOR "TGZ")

@@ -81,10 +84,6 @@
 SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL")
 ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME})

-#=============================
-# Macro:
-#    GENERATE_PACKAGING_TARGET()
-#
 MACRO(GENERATE_PACKAGING_TARGET package_name)
     SET(CPACK_PACKAGE_NAME ${package_name})

@@ -103,10 +102,17 @@
     SET(PACKAGE_TARGETNAME "${PACKAGE_TARGET_PREFIX}${package_name}")

     # This is naive and will probably need fixing eventually
-    IF(WIN32)
+    IF(MSVC)
         SET(MOVE_COMMAND "move")
     ELSE()
         SET(MOVE_COMMAND "mv")
+    ENDIF()
+
+    # Set in and out archive filenames. Windows = zip, others = tar.gz
+    IF(WIN32)
+        SET(ARCHIVE_EXT "zip")
+    ELSE()
+        SET(ARCHIVE_EXT "tar.gz")
     ENDIF()

     # Create a target that creates the current package
@@ -114,20 +120,18 @@
     ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME})
     ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_TARGETNAME}
         COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
-        COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.tar.gz" "${OSG_PACKAGE_FILE_NAME}.tar.gz"
-        COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.tar.gz -> ${OSG_PACKAGE_FILE_NAME}.tar.gz"
+        COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
+        COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
         COMMENT "Run CPack packaging for ${package_name}..."
     )
     # Add the exact same custom command to the all package generating target.
     # I can't use add_dependencies to do this because it would allow parallell building of packages so am going brute here
     ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME}
         COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
-        COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.tar.gz" "${OSG_PACKAGE_FILE_NAME}.tar.gz"
-        COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.tar.gz -> ${OSG_PACKAGE_FILE_NAME}.tar.gz"
+        COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
+        COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
     )
 ENDMACRO(GENERATE_PACKAGING_TARGET)
-#
-#=============================

 # Create configs and targets for a package including all components
 SET(OSG_CPACK_COMPONENT ALL)


[INTERANL] Use /W3 for intel compiler on windows

--- util/cmake/SeqAnBuildSystem.cmake
+++ util/cmake/SeqAnBuildSystem.cmake
@@ -217,9 +217,12 @@
     # Set Warnings
     # NOTE(marehr): COMPILER_CLANG on windows uses the same flags as on linux,
     # whereas COMPILER_INTEL uses on windows the same flags as COMPILER_MSVC.
-    if (STDLIB_VS AND (COMPILER_MSVC OR COMPILER_INTEL))
+    if (STDLIB_VS AND COMPILER_MSVC)
         # TODO(h-2): raise this to W4
         set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /W2")
+    elseif (STDLIB_VS AND COMPILER_INTEL)
+        # TODO(h-2): raise this to W4
+        set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /W3")
     else()
         set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -W -Wall -pedantic -fstrict-aliasing -Wstrict-aliasing")
         set (SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64)


(maint) Fix FindDependency invalid C99 macro

FindDependency for a project using hyphens generated invalid macros
according to C99. Convert the project name to a C identifier before use as
a macro to avoid the error with Clang.

--- vendor/FindDependency.cmake
+++ vendor/FindDependency.cmake
@@ -45,8 +45,9 @@
         get_filename_component(${FIND_DEPENDENCY_NAME}_LIBRARY_DIRS ${${FIND_DEPENDENCY_NAME}_LIBRARY} PATH)
         set(${FIND_DEPENDENCY_NAME_LIBRARY} ${${FIND_DEPENDENCY_NAME_LIBRARY}} PARENT_SCOPE)

-        # Add a define for the found package
-        add_definitions(-DUSE_${FIND_DEPENDENCY_NAME})
+        # Add a define for the found package; ensure it's a valid C identifier
+        string(MAKE_C_IDENTIFIER ${FIND_DEPENDENCY_NAME} DEPENDENCY_NAME_ID)
+        add_definitions(-DUSE_${DEPENDENCY_NAME_ID})
     endif()

     # Advanced options for not cluttering the cmake UIs


[cmake]Ajdust indentation

[cmake]Ajdust indentation

--- cmake/FindD.cmake
+++ cmake/FindD.cmake
@@ -32,47 +32,48 @@

 ## Find D compiler and parse its version.
 find_program(DC NAMES dmd ldc)
-if (DC)
+if (DC)
     get_filename_component(dc_path ${DC} PATH)
     if("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR})
-	get_filename_component(DC ${DC} NAME)
+        get_filename_component(DC ${DC} NAME)
     endif("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR})
     exec_program(${DC} ARGS "" OUTPUT_VARIABLE d_output)
     string(REGEX MATCH "Digital Mars D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}")
     if (dmd_version)
-	set(D_IS_MARS true)
-	set(D_IS_DMD true)
-	set(D_COMPILER_NAME "Digital Mars D Compiler")
-	string(REGEX REPLACE "Digital Mars D Compiler v([0-9])\\.[0-9]+" "\\1" D_VERSION "${dmd_version}")
-	string(REGEX REPLACE "Digital Mars D Compiler v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${dmd_version}")
+        set(D_IS_MARS true)
+        set(D_IS_DMD true)
+        set(D_COMPILER_NAME "Digital Mars D Compiler")
+        string(REGEX REPLACE "Digital Mars D Compiler v([0-9])\\.[0-9]+" "\\1" D_VERSION "${dmd_version}")
+        string(REGEX REPLACE "Digital Mars D Compiler v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${dmd_version}")
     else (dmd_version)
-	string(REGEX MATCH "LLVM-based D Compiler" is_ldc "${d_output}")
-	if (is_ldc)
-        if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$")
-            set(LDC_DEFAULT_CPU "i686")
-        elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(amd|x86[_-])64$")
-            set(LDC_DEFAULT_CPU "x86-64")
-        else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$")
-            set(LDC_DEFAULT_CPU "")
-        endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$")
-        set(LDC_CPU ${LDC_DEFAULT_CPU} CACHE STRING "Set the CPU for LLVM to generate for")
-
-	    exec_program(${DC} ARGS "--version" OUTPUT_VARIABLE d_output)
-	    string(REGEX MATCH "based on DMD v[0-9]\\.[0-9]+" ldc_version "${d_output}")
-	    set(D_IS_LLVM true)
-	    set(D_IS_LDC true)
-	    if(ldc_version)
-		set(D_IS_LLVM true)
-		set(D_COMPILER_NAME "LLVM-based D Compiler")
-		string(REGEX REPLACE "based on DMD v([0-9])\\.[0-9]+" "\\1" D_VERSION "${ldc_version}")
-		string(REGEX REPLACE "based on DMD v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${ldc_version}")
-	    else(ldc_version)
-		message(FATAL_ERROR "LDC compiler found, but the version can not be processed")
-	    endif(ldc_version)
-	else (is_ldc)
-	    message(FATAL_ERROR "D compiler are not found")
-	endif(is_ldc)
-    endif(dmd_version)
+        string(REGEX MATCH "LLVM-based D Compiler" is_ldc "${d_output}")
+        if (is_ldc)
+            if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$")
+                set(LDC_DEFAULT_CPU "i686")
+            elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(amd|x86[_-])64$")
+                set(LDC_DEFAULT_CPU "x86-64")
+            else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$")
+                set(LDC_DEFAULT_CPU "")
+            endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$")
+            set(LDC_CPU ${LDC_DEFAULT_CPU} CACHE STRING "Set the CPU for LLVM to generate for")
+
+            exec_program(${DC} ARGS "--version" OUTPUT_VARIABLE d_output)
+            string(REGEX MATCH "based on DMD v[0-9]\\.[0-9]+" ldc_version "${d_output}")
+            set(D_IS_LLVM true)
+            set(D_IS_LDC true)
+
+            if(ldc_version)
+                set(D_IS_LLVM true)
+                set(D_COMPILER_NAME "LLVM-based D Compiler")
+                string(REGEX REPLACE "based on DMD v([0-9])\\.[0-9]+" "\\1" D_VERSION "${ldc_version}")
+                string(REGEX REPLACE "based on DMD v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${ldc_version}")
+            else(ldc_version)
+                message(FATAL_ERROR "LDC compiler found, but the version can not be processed")
+            endif(ldc_version)
+        else (is_ldc)
+            message(FATAL_ERROR "D compiler are not found")
+        endif(is_ldc)
+    endif(dmd_version)
     message(STATUS "D compiler found -- ${D_COMPILER_NAME} v${D_VERSION}.${D_FRONTEND}")
 else (DC)
     message(FATAL_ERROR "D compliler are not found")
@@ -161,7 +162,7 @@

 macro(add_d_flags option)
     foreach(arg_tmp ${ARGN})
-	set(D_FLAGS ${D_FLAGS} ${option}=${arg_tmp})
+        set(D_FLAGS ${D_FLAGS} ${option}=${arg_tmp})
     endforeach(arg_tmp ${ARGN})
 endmacro(add_d_flags option)

@@ -175,47 +176,47 @@

 ## Make a native path.
 ## Usage:
-##	set(path c:/file_path/file_name.cpp)
-##	make_native_path(path)
-##	message(STATUS ${path})
+##   set(path c:/file_path/file_name.cpp)
+##   make_native_path(path)
+##   message(STATUS ${path})
 ## Output:
-##	-- "c:\file_path\file_name.cpp"
+##   -- "c:\file_path\file_name.cpp"
 ## Command "file(TO_NATIVE_PATH ...)" is wrong on Windows
 macro(make_native_path pathname)
     if(CMAKE_HOST_WIN32)
-	# An extra \\ escape is necessary to get a \ through CMake's processing.
-	string(REPLACE "/" "\\" ${pathname} "${${pathname}}")
-	# Enclose with UNESCAPED quotes.  This means we need to escape our
-	# quotes once here, i.e. with \"
-	set(${pathname} \"${${pathname}}\")
-    endif(CMAKE_HOST_WIN32)
+    # An extra \\ escape is necessary to get a \ through CMake's processing.
+    string(REPLACE "/" "\\" ${pathname} "${${pathname}}")
+    # Enclose with UNESCAPED quotes.  This means we need to escape our
+    # quotes once here, i.e. with \"
+    set(${pathname} \"${${pathname}}\")
+    endif(CMAKE_HOST_WIN32)
 endmacro(make_native_path)

 ##
 ## Example:
-##	set(path 24.3+23.bin)
-##	obj_path(path)
-##	message(STATUS ${path})
+##   set(path 24.3+23.bin)
+##   obj_path(path)
+##   message(STATUS ${path})
 ## Example output:
-##	-- 24\.3\+23\.bin
+##   -- 24\.3\+23\.bin
 macro(regex_safe_string outvariable)
     set(${outvariable} ${ARGN})
     set(__regex_chars__ ^ $ . ] [ - * + ? | \( \))
     foreach(__regex_char__ ${__regex_chars__})
-	string(REPLACE "${__regex_char__}"
-	    "\\${__regex_char__}" ${outvariable} ${${outvariable}}
-	    )
+    string(REPLACE "${__regex_char__}"
+        "\\${__regex_char__}" ${outvariable} ${${outvariable}}
+        )
     endforeach(__regex_char__ ${__regex_chars__})
 endmacro(regex_safe_string outvariable)

 ## Remove unnecessary path to the object file.
 ## path -- path to object file.
 ## Example:
-##	set(path ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/target.dir/main.d.obj)
-##	obj_path(path)
-##	message(STATUS ${path})
+##   set(path ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/target.dir/main.d.obj)
+##   obj_path(path)
+##   message(STATUS ${path})
 ## Example output:
-##	-- CMakeFiles/target.dir/main.d.obj
+##   -- CMakeFiles/target.dir/main.d.obj
 macro(obj_path path)
     regex_safe_string(cbd_safe_tmp ${CMAKE_CURRENT_BINARY_DIR})
     regex_safe_string(csd_safe_tmp ${CMAKE_CURRENT_SOURCE_DIR})
@@ -230,7 +231,7 @@
 macro(compile_d_files target objects_list)
     set(${objects_list})
     set(tmp_dir_tmp ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir)
-
+
     set(type_tmp SOURCES)
     set(SOURCES_tmp )
     set(FLAGS_tmp )
@@ -238,96 +239,96 @@
     ## Parse parameters list.
     set(params_tmp SOURCES FLAGS)
     foreach(arg_tmp ${ARGN})
-	set(found_type_tmp)
-	if(NOT found_type_tmp)
-	    foreach(param_tmp ${params_tmp})
-		if(arg_tmp STREQUAL param_tmp)
-		    set(type_tmp ${param_tmp})
-		    set(found_type_tmp 1)
-		    break(param_tmp ${params_tmp})
-		endif(arg_tmp STREQUAL param_tmp)
-	    endforeach(param_tmp ${params_tmp})
-	endif(NOT found_type_tmp)
-	if(NOT found_type_tmp)
-	    set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp})
-	endif(NOT found_type_tmp)
+        set(found_type_tmp)
+        if(NOT found_type_tmp)
+            foreach(param_tmp ${params_tmp})
+                if(arg_tmp STREQUAL param_tmp)
+                    set(type_tmp ${param_tmp})
+                    set(found_type_tmp 1)
+                    break(param_tmp ${params_tmp})
+                endif(arg_tmp STREQUAL param_tmp)
+            endforeach(param_tmp ${params_tmp})
+        endif(NOT found_type_tmp)
+        if(NOT found_type_tmp)
+            set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp})
+        endif(NOT found_type_tmp)
     endforeach(arg_tmp ${ARGN})

     if(NOT SINGLE_D_OBJECT)
-	set(${objects_list})
-	foreach (d_source_p_tmp ${SOURCES_tmp})
-	    get_filename_component(ext_tmp ${d_source_p_tmp} EXT)
-	    find_file(d_source_p_tmp ${d_source_p_tmp} PATHS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
-		  ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
-	    set (d_source_tmp ${d_source_p_tmp})
-	    obj_path(d_source_tmp)
-	    set(d_obj_tmp ${tmp_dir_tmp}/${d_source_tmp}${D_OBJECT_SUFFIX})
-	    set(${objects_list} ${${objects_list}} ${d_obj_tmp})
-	    get_filename_component(path_tmp ${d_obj_tmp} PATH)
-	    file(MAKE_DIRECTORY ${path_tmp})
-	    set(d_obj_out_tmp ${d_obj_tmp})
-	    obj_path(d_obj_out_tmp)
-	    #get_imported_files(depends_tmp ${d_source_p_tmp}) ## Too slow.....
-	    add_custom_command(OUTPUT "${d_obj_tmp}"
-			COMMAND "${DC}"
-			ARGS ${FLAGS_tmp} ${d_source_p_tmp} -c -of${d_obj_tmp}
-			COMMENT "Building ${d_obj_out_tmp}"
-			DEPENDS ${d_source_p_tmp} ${depends_tmp}
-			WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-		    )
-	endforeach (d_source_p_tmp ${SOURCES_tmp})
+        set(${objects_list})
+        foreach (d_source_p_tmp ${SOURCES_tmp})
+            get_filename_component(ext_tmp ${d_source_p_tmp} EXT)
+            find_file(d_source_p_tmp ${d_source_p_tmp} PATHS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
+            ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
+            set (d_source_tmp ${d_source_p_tmp})
+            obj_path(d_source_tmp)
+            set(d_obj_tmp ${tmp_dir_tmp}/${d_source_tmp}${D_OBJECT_SUFFIX})
+            set(${objects_list} ${${objects_list}} ${d_obj_tmp})
+            get_filename_component(path_tmp ${d_obj_tmp} PATH)
+            file(MAKE_DIRECTORY ${path_tmp})
+            set(d_obj_out_tmp ${d_obj_tmp})
+            obj_path(d_obj_out_tmp)
+            #get_imported_files(depends_tmp ${d_source_p_tmp}) ## Too slow.....
+            add_custom_command(OUTPUT "${d_obj_tmp}"
+                COMMAND "${DC}"
+                ARGS ${FLAGS_tmp} ${d_source_p_tmp} -c -of${d_obj_tmp}
+                COMMENT "Building ${d_obj_out_tmp}"
+                DEPENDS ${d_source_p_tmp} ${depends_tmp}
+                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                )
+        endforeach (d_source_p_tmp ${SOURCES_tmp})
     else(NOT SINGLE_D_OBJECT)
-	if(D_IS_LDC)
-	    set(FLAGS_tmp ${FLAGS_tmp} -oq )
-	endif(D_IS_LDC)
-	set(count_objects_tmp 0)
-	set(files${count_objects_tmp}_tmp )
-	set(counter_tmp 0)
-	set(files_tmp )
-	set(objects_tmp )
-	foreach (d_source_p_tmp ${SOURCES_tmp})
-	    math(EXPR counter_tmp "${counter_tmp} + 1")
-	    set(files${count_objects_tmp}_tmp ${files${count_objects_tmp}_tmp} ${d_source_p_tmp})
-	    if(counter_tmp GREATER D_MODULES_PER_OBJECT)
-		math(EXPR count_objects_tmp "${count_objects_tmp} + 1")
-		set(files${count_objects_tmp}_tmp )
-		set(counter_tmp 0)
-	    endif(counter_tmp GREATER D_MODULES_PER_OBJECT)
-	endforeach (d_source_p_tmp ${SOURCES_tmp})
-
-	if(files${count_objects_tmp}_tmp)
-	    math(EXPR count_objects_tmp "${count_objects_tmp} + 1")
-	endif(files${count_objects_tmp}_tmp)
-
-	set(id_tmp 0)
-	while(id_tmp LESS ${count_objects_tmp})
-	    set(object_tmp ${tmp_dir_tmp}/${target}${id_tmp}${D_OBJECT_SUFFIX})
-	    set(d_obj_out_tmp ${${object_tmp}})
-	    obj_path(d_obj_out_tmp)
-	    set(parameters_tmp ${FLAGS_tmp} -c ${files${id_tmp}_tmp} -of${object_tmp})
-	    set(parameters_list_file_tmp ${tmp_dir_tmp}/parameters${id_tmp}_obj)
-	    if(CMAKE_HOST_WIN32)
-		file(REMOVE ${parameters_list_file_tmp})
-		foreach(arg_tmp ${parameters_tmp})
-		    file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n")
-		endforeach(arg_tmp)
-		set(param_tmp @${parameters_list_file_tmp})
-	    elseif(CMAKE_HOST_UNIX)
-		set(param_tmp ${parameters_tmp})
-	    endif(CMAKE_HOST_WIN32)
-	    #get_imported_files(depends_tmp ${ARGN})
-	    add_custom_command(OUTPUT "${object_tmp}"
-			    COMMAND "${DC}"
-			    ARGS ${param_tmp}
-			    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-			    DEPENDS ${files${id_tmp}_tmp} ${depends_tmp}
-			    COMMENT ""
-			)
-	    set(objects_tmp ${objects_tmp} ${object_tmp})
-	    math(EXPR id_tmp "${id_tmp} + 1")
-	endwhile(id_tmp LESS ${count_objects_tmp})
-
-	set(${objects_list} ${objects_tmp})
+        if(D_IS_LDC)
+            set(FLAGS_tmp ${FLAGS_tmp} -oq )
+        endif(D_IS_LDC)
+        set(count_objects_tmp 0)
+        set(files${count_objects_tmp}_tmp )
+        set(counter_tmp 0)
+        set(files_tmp )
+        set(objects_tmp )
+        foreach (d_source_p_tmp ${SOURCES_tmp})
+            math(EXPR counter_tmp "${counter_tmp} + 1")
+            set(files${count_objects_tmp}_tmp ${files${count_objects_tmp}_tmp} ${d_source_p_tmp})
+            if(counter_tmp GREATER D_MODULES_PER_OBJECT)
+                math(EXPR count_objects_tmp "${count_objects_tmp} + 1")
+                set(files${count_objects_tmp}_tmp )
+                set(counter_tmp 0)
+            endif(counter_tmp GREATER D_MODULES_PER_OBJECT)
+        endforeach (d_source_p_tmp ${SOURCES_tmp})
+
+        if(files${count_objects_tmp}_tmp)
+            math(EXPR count_objects_tmp "${count_objects_tmp} + 1")
+        endif(files${count_objects_tmp}_tmp)
+
+        set(id_tmp 0)
+        while(id_tmp LESS ${count_objects_tmp})
+            set(object_tmp ${tmp_dir_tmp}/${target}${id_tmp}${D_OBJECT_SUFFIX})
+            set(d_obj_out_tmp ${${object_tmp}})
+            obj_path(d_obj_out_tmp)
+            set(parameters_tmp ${FLAGS_tmp} -c ${files${id_tmp}_tmp} -of${object_tmp})
+            set(parameters_list_file_tmp ${tmp_dir_tmp}/parameters${id_tmp}_obj)
+            if(CMAKE_HOST_WIN32)
+                file(REMOVE ${parameters_list_file_tmp})
+                foreach(arg_tmp ${parameters_tmp})
+                    file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n")
+                endforeach(arg_tmp)
+                set(param_tmp @${parameters_list_file_tmp})
+            elseif(CMAKE_HOST_UNIX)
+                set(param_tmp ${parameters_tmp})
+            endif(CMAKE_HOST_WIN32)
+            #get_imported_files(depends_tmp ${ARGN})
+            add_custom_command(OUTPUT "${object_tmp}"
+                    COMMAND "${DC}"
+                    ARGS ${param_tmp}
+                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                    DEPENDS ${files${id_tmp}_tmp} ${depends_tmp}
+                    COMMENT ""
+                )
+            set(objects_tmp ${objects_tmp} ${object_tmp})
+            math(EXPR id_tmp "${id_tmp} + 1")
+        endwhile(id_tmp LESS ${count_objects_tmp})
+
+        set(${objects_list} ${objects_tmp})
     endif(NOT SINGLE_D_OBJECT)
     #add_custom_target(${target} DEPENDS "${${objects_list}}")
 endmacro(compile_d_files objects_list)
@@ -336,16 +337,16 @@
 ## Add D target.
 ## name -- target name.
 ## Params:
-##	TYPE -- target type.
-##		STATIC -- static library.
-##		SHARED -- shared library.
-##		BINARY -- executable.
-## 	SOURCES -- sources of the target.
-##	INCLUDES -- include paths.
-## 	FLAGS -- build flags.
-##	LIBS -- libraries for link.
-##	LIB_PATHS -- libraries paths.
-##	DEPENDS -- target depends.
+##   TYPE -- target type.
+##     STATIC -- static library.
+##     SHARED -- shared library.
+##     BINARY -- executable.
+##   SOURCES -- sources of the target.
+##   INCLUDES -- include paths.
+##   FLAGS -- build flags.
+##   LIBS -- libraries for link.
+##   LIB_PATHS -- libraries paths.
+##   DEPENDS -- target depends.
 macro(add_d_target name)
     set(type_tmp SOURCES)
     set(TYPE_tmp)
@@ -365,180 +366,180 @@

     ## Parse parameters list.
     set(params_tmp TYPE INCLUDES FLAGS SOURCES NO_DEPS_SOURCES OBJECTS LIBS LIB_PATHS DEPENDS OUTPUT_PATH)
-
+
     foreach(arg_tmp ${ARGN})
-	set(found_type_tmp)
-	if(${arg_tmp} STREQUAL "NOT_DETECT_DEPENDS")
-	    set(detect_deps_tmp 0)
-	    set(found_type_tmp 1)
-	endif(${arg_tmp} STREQUAL "NOT_DETECT_DEPENDS")
-	if(NOT found_type_tmp)
-	    foreach(param_tmp ${params_tmp})
-		if(arg_tmp STREQUAL param_tmp)
-		    set(type_tmp ${param_tmp})
-		    set(found_type_tmp 1)
-		    break(param_tmp ${params_tmp})
-		endif(arg_tmp STREQUAL param_tmp)
-	    endforeach(param_tmp ${params_tmp})
-	endif(NOT found_type_tmp)
-	if(NOT found_type_tmp)
-	    set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp})
-	endif(NOT found_type_tmp)
+        set(found_type_tmp)
+        if(${arg_tmp} STREQUAL "NOT_DETECT_DEPENDS")
+            set(detect_deps_tmp 0)
+            set(found_type_tmp 1)
+        endif(${arg_tmp} STREQUAL "NOT_DETECT_DEPENDS")
+        if(NOT found_type_tmp)
+            foreach(param_tmp ${params_tmp})
+            if(arg_tmp STREQUAL param_tmp)
+                set(type_tmp ${param_tmp})
+                set(found_type_tmp 1)
+                break(param_tmp ${params_tmp})
+            endif(arg_tmp STREQUAL param_tmp)
+            endforeach(param_tmp ${params_tmp})
+        endif(NOT found_type_tmp)
+        if(NOT found_type_tmp)
+            set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp})
+        endif(NOT found_type_tmp)
     endforeach(arg_tmp ${ARGN})

     ## Init target type.
     if (OUTPUT_PATH_tmp)
-	set(output_name_tmp "${OUTPUT_PATH_tmp}")
+        set(output_name_tmp "${OUTPUT_PATH_tmp}")
     endif (OUTPUT_PATH_tmp)
     if("${TYPE_tmp}" STREQUAL "STATIC")
-	set(link_flags_tmp ${link_flags_tmp} -lib)
-	if(NOT OUTPUT_PATH_tmp)
-	    if(ARCHIVE_OUTPUT_DIRECTORY)
-		set(output_name_tmp ${ARCHIVE_OUTPUT_DIRECTORY})
-	    else(ARCHIVE_OUTPUT_DIRECTORY)
-		set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/lib)
-	    endif(ARCHIVE_OUTPUT_DIRECTORY)
-	endif(NOT OUTPUT_PATH_tmp)
-	set(output_name_tmp ${output_name_tmp}/${D_LIB_PREFIX}${name}${D_LIB_SUFFIX})
+        set(link_flags_tmp ${link_flags_tmp} -lib)
+        if(NOT OUTPUT_PATH_tmp)
+            if(ARCHIVE_OUTPUT_DIRECTORY)
+                set(output_name_tmp ${ARCHIVE_OUTPUT_DIRECTORY})
+            else(ARCHIVE_OUTPUT_DIRECTORY)
+                set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/lib)
+            endif(ARCHIVE_OUTPUT_DIRECTORY)
+        endif(NOT OUTPUT_PATH_tmp)
+        set(output_name_tmp ${output_name_tmp}/${D_LIB_PREFIX}${name}${D_LIB_SUFFIX})
     elseif("${TYPE_tmp}" STREQUAL "BINARY")
-	set(build_binary_tmp 1)
-	if(NOT OUTPUT_PATH_tmp)
-	    if(RUNTIME_OUTPUT_DIRECTORY)
-		set(output_name ${RUNTIME_OUTPUT_DIRECTORY})
-	    else(RUNTIME_OUTPUT_DIRECTORY)
-		set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/bin)
-	    endif(RUNTIME_OUTPUT_DIRECTORY)
-	endif(NOT OUTPUT_PATH_tmp)
-	set(output_name_tmp ${output_name_tmp}/${name}${CMAKE_EXECUTABLE_SUFFIX})
+        set(build_binary_tmp 1)
+        if(NOT OUTPUT_PATH_tmp)
+            if(RUNTIME_OUTPUT_DIRECTORY)
+                set(output_name ${RUNTIME_OUTPUT_DIRECTORY})
+            else(RUNTIME_OUTPUT_DIRECTORY)
+                set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/bin)
+            endif(RUNTIME_OUTPUT_DIRECTORY)
+        endif(NOT OUTPUT_PATH_tmp)
+        set(output_name_tmp ${output_name_tmp}/${name}${CMAKE_EXECUTABLE_SUFFIX})
     elseif("${TYPE_tmp}" STREQUAL "SHARED")
-	if(D_IS_MARS)
-	    message(FATAL_ERROR "DMD not support building shared library")
-	endif(D_IS_MARS)
-	if(NOT OUTPUT_PATH_tmp)
-	    if(LIBRARY_OUTPUT_DIRECTORY)
-		set(output_name_tmp ${LIBRARY_OUTPUT_DIRECTORY})
-	    else(LIBRARY_OUTPUT_DIRECTORY)
-		set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/lib)
-	    endif(LIBRARY_OUTPUT_DIRECTORY)
-	endif(NOT OUTPUT_PATH_tmp)
-	set(build_binary 1)
-	set(output_name_tmp ${output_name_tmp}/${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX})
-	set(link_flags_tmp ${compile_flags_tmp} -L-shared)
-    else("${TYPE_tmp}" STREQUAL "STATIC")
-	message(FATAL_ERROR "D target ${TYPE_tmp} not supported")
+        if(D_IS_MARS)
+            message(FATAL_ERROR "DMD not support building shared library")
+        endif(D_IS_MARS)
+        if(NOT OUTPUT_PATH_tmp)
+            if(LIBRARY_OUTPUT_DIRECTORY)
+                set(output_name_tmp ${LIBRARY_OUTPUT_DIRECTORY})
+            else(LIBRARY_OUTPUT_DIRECTORY)
+                set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/lib)
+            endif(LIBRARY_OUTPUT_DIRECTORY)
+        endif(NOT OUTPUT_PATH_tmp)
+        set(build_binary 1)
+        set(output_name_tmp ${output_name_tmp}/${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX})
+        set(link_flags_tmp ${compile_flags_tmp} -L-shared)
+    else("${TYPE_tmp}" STREQUAL "STATIC")
+        message(FATAL_ERROR "D target ${TYPE_tmp} not supported")
     endif("${TYPE_tmp}" STREQUAL "STATIC")

     ## Include paths.
     foreach(inc_tmp ${INCLUDES_tmp} ${D_INCLUDES})
-	set(compile_flags_tmp ${compile_flags_tmp} -I${inc_tmp})
+        set(compile_flags_tmp ${compile_flags_tmp} -I${inc_tmp})
     endforeach(inc_tmp ${INCLUDES_tmp} ${D_INCLUDES})
-
+
     ## Libraries and paths of them.
     set(libs_tmp)
     if(build_binary_tmp)
-	if(D_IS_MARS AND CMAKE_HOST_WIN32)
-	    foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
-		make_native_path(lib_path_tmp)
-		string(REPLACE "/" "\\" lib_path_tmp "${lib_path_tmp}//")
-		set(lib_path_tmp \"${lib_path_tmp}\")
-		set(link_flags_tmp ${link_flags_tmp} -L+${lib_path_tmp})
-	    endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
-	    #set(additional_commands_tmp COMMAND set ARGS LIB=)
-	    #foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
-		#MAKE_NATIVE_PATH(lib_path_tmp)
-		#set(additional_commands_tmp ${additional_commands_tmp}${lib_path_tmp};)
-	    #endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
-	else(D_IS_MARS AND CMAKE_HOST_WIN32)
-	    foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
-		set(link_flags_tmp ${link_flags_tmp} -L-L${lib_path_tmp})
-	    endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
-	endif(D_IS_MARS AND CMAKE_HOST_WIN32)
-	foreach(lib_tmp ${LIBS_tmp} ${D_LIBS})
-	    if(D_IS_MARS AND CMAKE_HOST_WIN32)
-		set(link_flags_tmp ${link_flags_tmp} -L+${lib_tmp})
-	    else(D_IS_MARS AND CMAKE_HOST_WIN32)
-		set(link_flags_tmp ${link_flags_tmp} -L-l${lib_tmp})
-	    endif(D_IS_MARS AND CMAKE_HOST_WIN32)
-	endforeach(lib_tmp ${LIBS_tmp} ${D_LIBS})
+        if(D_IS_MARS AND CMAKE_HOST_WIN32)
+            foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
+                make_native_path(lib_path_tmp)
+                string(REPLACE "/" "\\" lib_path_tmp "${lib_path_tmp}//")
+                set(lib_path_tmp \"${lib_path_tmp}\")
+                set(link_flags_tmp ${link_flags_tmp} -L+${lib_path_tmp})
+            endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
+            #set(additional_commands_tmp COMMAND set ARGS LIB=)
+            #foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
+            #MAKE_NATIVE_PATH(lib_path_tmp)
+            #set(additional_commands_tmp ${additional_commands_tmp}${lib_path_tmp};)
+            #endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
+    else(D_IS_MARS AND CMAKE_HOST_WIN32)
+        foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
+            set(link_flags_tmp ${link_flags_tmp} -L-L${lib_path_tmp})
+        endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS})
+    endif(D_IS_MARS AND CMAKE_HOST_WIN32)
+        foreach(lib_tmp ${LIBS_tmp} ${D_LIBS})
+            if(D_IS_MARS AND CMAKE_HOST_WIN32)
+                set(link_flags_tmp ${link_flags_tmp} -L+${lib_tmp})
+            else(D_IS_MARS AND CMAKE_HOST_WIN32)
+                set(link_flags_tmp ${link_flags_tmp} -L-l${lib_tmp})
+            endif(D_IS_MARS AND CMAKE_HOST_WIN32)
+        endforeach(lib_tmp ${LIBS_tmp} ${D_LIBS})
     endif(build_binary_tmp)
-
+
     set(not_obj_tmp ${ONE_BUILD_COMMAND})
     ## Ldc not support -lib flag.
     if(ONE_BUILD_COMMAND AND ${TYPE_tmp} STREQUAL "STATIC" AND D_IS_LLVM)
-	set(not_obj_tmp OFF)
+        set(not_obj_tmp OFF)
     endif(ONE_BUILD_COMMAND AND ${TYPE_tmp} STREQUAL "STATIC" AND D_IS_LLVM)

     if(build_binary_tmp AND NOT D_IS_MARS)
-	set(compile_flags_tmp ${compile_flags_tmp} -od${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${name}.dir)
+        set(compile_flags_tmp ${compile_flags_tmp} -od${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${name}.dir)
     endif(build_binary_tmp AND NOT D_IS_MARS)

     if(CMAKE_BUILD_TYPE)
-	string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
-	set(compile_flags_tmp ${compile_flags_tmp} ${D_${CMAKE_BUILD_TYPE_UPPER}_FLAGS})
+        string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
+        set(compile_flags_tmp ${compile_flags_tmp} ${D_${CMAKE_BUILD_TYPE_UPPER}_FLAGS})
     endif(CMAKE_BUILD_TYPE)

     if(detect_deps_tmp)
-	message(STATUS "Getting dependencies for ${name}")
-	get_files_depends(tmp ${SOURCES_tmp})
-	set(SOURCES_tmp ${tmp})
+        message(STATUS "Getting dependencies for ${name}")
+        get_files_depends(tmp ${SOURCES_tmp})
+        set(SOURCES_tmp ${tmp})
     endif(detect_deps_tmp)
     set(SOURCES_tmp ${SOURCES_tmp} ${NO_DEPS_SOURCES_tmp})
-
+
     set(used_ar_tmp)
     get_filename_component(output_path_tmp ${output_name_tmp} PATH)
     if (NOT not_obj_tmp)
-	compile_d_files(${name} objs_tmp ${SOURCES_tmp} FLAGS ${compile_flags_tmp})
-	set(SOURCES_tmp ${objs_tmp})
-	if(NOT D_IS_MARS AND ${TYPE_tmp} STREQUAL "STATIC")
-	    set(parameters_tmp rcs ${output_name_tmp} ${SOURCES_tmp} ${OBJECTS_tmp})
-	    set(parameters_list_file_tmp ${tmp_dir_tmp}/parameters)
-	    if(CMAKE_HOST_WIN32)
-		file(REMOVE ${parameters_list_file_tmp})
-		foreach(arg_tmp ${parameters_tmp})
-		    file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n")
-		endforeach(arg_tmp)
-		set(param_tmp @${parameters_list_file_tmp})
-	    elseif(CMAKE_HOST_UNIX)
-		set(param_tmp ${parameters_tmp})
-	    endif(CMAKE_HOST_WIN32)
-	    add_custom_command(
-				OUTPUT "${output_name_tmp}"
-				COMMAND "${CMAKE_AR}"
-				ARGS ${param_tmp}
-				DEPENDS ${SOURCES_tmp}
-				COMMENT "Linking ${lib_name}"
-			    )
-	    set(used_ar_tmp 1)
-	endif(NOT D_IS_MARS AND ${TYPE_tmp} STREQUAL "STATIC")
+        compile_d_files(${name} objs_tmp ${SOURCES_tmp} FLAGS ${compile_flags_tmp})
+        set(SOURCES_tmp ${objs_tmp})
+        if(NOT D_IS_MARS AND ${TYPE_tmp} STREQUAL "STATIC")
+            set(parameters_tmp rcs ${output_name_tmp} ${SOURCES_tmp} ${OBJECTS_tmp})
+            set(parameters_list_file_tmp ${tmp_dir_tmp}/parameters)
+            if(CMAKE_HOST_WIN32)
+                file(REMOVE ${parameters_list_file_tmp})
+                foreach(arg_tmp ${parameters_tmp})
+                    file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n")
+                endforeach(arg_tmp)
+                set(param_tmp @${parameters_list_file_tmp})
+            elseif(CMAKE_HOST_UNIX)
+                set(param_tmp ${parameters_tmp})
+            endif(CMAKE_HOST_WIN32)
+            add_custom_command(
+                    OUTPUT "${output_name_tmp}"
+                    COMMAND "${CMAKE_AR}"
+                    ARGS ${param_tmp}
+                    DEPENDS ${SOURCES_tmp}
+                    COMMENT "Linking ${lib_name}"
+                    )
+            set(used_ar_tmp 1)
+        endif(NOT D_IS_MARS AND ${TYPE_tmp} STREQUAL "STATIC")
     endif (NOT not_obj_tmp)

     if (NOT used_ar_tmp)
-	set(output_name_native_tmp ${output_name_tmp})
-	if(D_IS_MARS)
-	    set(additional_commands_tmp ${additional_commands_tmp} COMMAND ${CMAKE_COMMAND} -E make_directory ${output_path_tmp})
-	    make_native_path(output_name_native_tmp)
-	endif(D_IS_MARS)
-	set(parameters_tmp ${compile_flags_tmp} ${link_flags_tmp} ${SOURCES_tmp} ${OBJECTS_tmp} -of${output_name_native_tmp})
-	set(parameters_list_file_tmp ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${name}.dir/parameters)
-	if(CMAKE_HOST_WIN32)
-	    file(REMOVE ${parameters_list_file_tmp})
-	    foreach(arg_tmp ${parameters_tmp})
-		file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n")
-	    endforeach(arg_tmp)
-	    set(param_tmp @${parameters_list_file_tmp})
-	elseif(CMAKE_HOST_UNIX)
-	    set(param_tmp ${parameters_tmp})
-	endif(CMAKE_HOST_WIN32)
-	#get_imported_files(depends_tmp ${SOURCES_tmp})
-	add_custom_command(
-		      OUTPUT ${output_name_tmp}
-		      ${additional_commands_tmp}
-		      COMMAND ${DC}
-		      ARGS ${param_tmp}
-		      DEPENDS  ${SOURCES_tmp} ${depends_tmp}
-		      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-		      COMMENT "Linking ${name}"
-		  )
+        set(output_name_native_tmp ${output_name_tmp})
+        if(D_IS_MARS)
+            set(additional_commands_tmp ${additional_commands_tmp} COMMAND ${CMAKE_COMMAND} -E make_directory ${output_path_tmp})
+            make_native_path(output_name_native_tmp)
+        endif(D_IS_MARS)
+        set(parameters_tmp ${compile_flags_tmp} ${link_flags_tmp} ${SOURCES_tmp} ${OBJECTS_tmp} -of${output_name_native_tmp})
+        set(parameters_list_file_tmp ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${name}.dir/parameters)
+        if(CMAKE_HOST_WIN32)
+            file(REMOVE ${parameters_list_file_tmp})
+            foreach(arg_tmp ${parameters_tmp})
+            file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n")
+            endforeach(arg_tmp)
+            set(param_tmp @${parameters_list_file_tmp})
+        elseif(CMAKE_HOST_UNIX)
+            set(param_tmp ${parameters_tmp})
+        endif(CMAKE_HOST_WIN32)
+        #get_imported_files(depends_tmp ${SOURCES_tmp})
+        add_custom_command(
+                OUTPUT ${output_name_tmp}
+                ${additional_commands_tmp}
+                COMMAND ${DC}
+                ARGS ${param_tmp}
+                DEPENDS  ${SOURCES_tmp} ${depends_tmp}
+                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                COMMENT "Linking ${name}"
+            )
     endif(NOT used_ar_tmp)
     add_custom_target(${name} ALL DEPENDS ${DEPENDS_tmp} ${output_name_tmp})
 endmacro(add_d_target name)
@@ -562,9 +563,9 @@
 ## Library will shared if it supported.
 macro(add_d_lib name)
     if(D_IS_MARS)
-	add_d_target(${name} TYPE STATIC ${ARGN})
+        add_d_target(${name} TYPE STATIC ${ARGN})
     else(D_IS_MARS)
-	add_d_target(${name} TYPE SHARED ${ARGN})
+        add_d_target(${name} TYPE SHARED ${ARGN})
     endif(D_IS_MARS)
 endmacro(add_d_lib name)

@@ -573,10 +574,9 @@
     execute_process(COMMAND ${DC} -c -o- -v ${compile_flags_tmp} ${ARGN}
                   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                   OUTPUT_VARIABLE dc_output_tmp
-
     )
     string(REGEX MATCHALL "import[^(]*([^)]*)" dc_output_tmp "${dc_output_tmp}")
-
+
     ## Initial filter.
     regex_safe_string(tmp ${CMAKE_CURRENT_SOURCE_DIR})
     regex_safe_string(tmp2 ${CMAKE_CURRENT_BINARY_DIR})
@@ -584,27 +584,27 @@

     set(${imported})
     foreach(import_tmp ${dc_output_tmp})
-	## Getting a next import.
-	string(REGEX REPLACE "import[^(]*\\(([^)]*)" "\\1" import_tmp ${import_tmp})
-	## Filtering.
-	string(REPLACE "\\" "/" import_tmp ${import_tmp})
-	string(REGEX MATCH "(${regex_includes_tmp})" found "${import_tmp}")
-	if(CMAKE_HOST_WIN32)
-	    string(SUBSTRING "${import_tmp}" 1 2 first_sym_tmp)
-	    set(full_path_tmp)
-	    if(${first_sym_tmp} STREQUAL ":/")
-		set(full_path_tmp 1)
-	    endif(${first_sym_tmp} STREQUAL ":/")
-	elseif(CMAKE_HOST_UNIX)
-	    string(SUBSTRING "${import_tmp}" 0 1 first_sym_tmp)
-	    set(full_path_tmp)
-	    if(${first_sym_tmp} STREQUAL "/")
-		set(full_path_tmp 1)
-	    endif(${first_sym_tmp} STREQUAL "/")
-	endif(CMAKE_HOST_WIN32)
-	if(found OR NOT full_path_tmp)
-	    set(${imported} ${${imported}} ${import_tmp})
-	endif(found OR NOT full_path_tmp)
+        ## Getting a next import.
+        string(REGEX REPLACE "import[^(]*\\(([^)]*)" "\\1" import_tmp ${import_tmp})
+        ## Filtering.
+        string(REPLACE "\\" "/" import_tmp ${import_tmp})
+        string(REGEX MATCH "(${regex_includes_tmp})" found "${import_tmp}")
+        if(CMAKE_HOST_WIN32)
+            string(SUBSTRING "${import_tmp}" 1 2 first_sym_tmp)
+            set(full_path_tmp)
+            if(${first_sym_tmp} STREQUAL ":/")
+                set(full_path_tmp 1)
+            endif(${first_sym_tmp} STREQUAL ":/")
+        elseif(CMAKE_HOST_UNIX)
+            string(SUBSTRING "${import_tmp}" 0 1 first_sym_tmp)
+            set(full_path_tmp)
+            if(${first_sym_tmp} STREQUAL "/")
+                set(full_path_tmp 1)
+            endif(${first_sym_tmp} STREQUAL "/")
+        endif(CMAKE_HOST_WIN32)
+        if(found OR NOT full_path_tmp)
+            set(${imported} ${${imported}} ${import_tmp})
+        endif(found OR NOT full_path_tmp)
     endforeach(import_tmp ${dc_output_tmp})
 endmacro(get_imported_files_old imported)

@@ -614,45 +614,45 @@
     set(include_tmp)
     set(paths_tmp)
     foreach(arg_tmp ${ARGN})
-	set(founded_tmp)
-	if(${arg_tmp} STREQUAL "INCLUDE_PATHS")
-	    set(read_now_tmp includes)
-	    set(founded_tmp 1)
-	elseif(${arg_tmp} STREQUAL "INCLUDE_CURRENT_DIR")
-	    set(locale_tmp 1)
-	    set(read_now_tmp paths)
-	    set(founded_tmp 1)
-	endif(${arg_tmp} STREQUAL "INCLUDE_PATHS")
-	if(NOT founded_tmp)
-	    set(${read_now_tmp}_tmp ${${read_now_tmp}_tmp} ${arg_tmp})
-	endif(NOT founded_tmp)
-    endforeach(arg_tmp ${ARGN})
+        set(founded_tmp)
+        if(${arg_tmp} STREQUAL "INCLUDE_PATHS")
+            set(read_now_tmp includes)
+            set(founded_tmp 1)
+        elseif(${arg_tmp} STREQUAL "INCLUDE_CURRENT_DIR")
+            set(locale_tmp 1)
+            set(read_now_tmp paths)
+            set(founded_tmp 1)
+        endif(${arg_tmp} STREQUAL "INCLUDE_PATHS")
+        if(NOT founded_tmp)
+            set(${read_now_tmp}_tmp ${${read_now_tmp}_tmp} ${arg_tmp})
+        endif(NOT founded_tmp)
+    endforeach(arg_tmp ${ARGN})
     regex_safe_string(include_tmp ${includes_tmp})
     set(regex_include_tmp)
     set(is_first_tmp 1)
     foreach(include_tmp ${includes_tmp})
-	if(is_first_tmp)
-	    set(is_first_tmp 1)
-	else(is_first_tmp)
-	    set(regex_includes_tmp ${regex_includes_tmp}|)
-	endif(is_first_tmp)
-	set(regex_includes_tmp ${regex_includes_tmp}${include_tmp})
+        if(is_first_tmp)
+            set(is_first_tmp 1)
+        else(is_first_tmp)
+            set(regex_includes_tmp ${regex_includes_tmp}|)
+        endif(is_first_tmp)
+        set(regex_includes_tmp ${regex_includes_tmp}${include_tmp})
     endforeach(include_tmp ${include_tmp})
     foreach(path_tmp ${paths_tmp})
-	file(TO_CMAKE_PATH path_tmp ${path_tmp})
-	string(REGEX MATCH "(${regex_includes_tmp})[^/]*" found "${path_tmp}")
-	set(full_path_tmp 1)
-	if(locale_tmp)
-	    string(SUBSTRING "${path_tmp}" 0 1 first_sym_tmp)
-	    set(full_path_tmp)
-	    if(${first_sym_tmp} STREQUAL "/")
-		set(full_path_tmp 1)
-	    endif(${first_sym_tmp} STREQUAL "/")
-	endif(locale_tmp)
-	if(NOT found AND full_path_tmp)
-	else(NOT found AND full_path_tmp)
-	    set(${result} ${${result}} ${path_tmp})
-	endif(NOT found AND full_path_tmp)
+        file(TO_CMAKE_PATH path_tmp ${path_tmp})
+        string(REGEX MATCH "(${regex_includes_tmp})[^/]*" found "${path_tmp}")
+        set(full_path_tmp 1)
+        if(locale_tmp)
+            string(SUBSTRING "${path_tmp}" 0 1 first_sym_tmp)
+            set(full_path_tmp)
+            if(${first_sym_tmp} STREQUAL "/")
+                set(full_path_tmp 1)
+            endif(${first_sym_tmp} STREQUAL "/")
+        endif(locale_tmp)
+        if(NOT found AND full_path_tmp)
+        else(NOT found AND full_path_tmp)
+            set(${result} ${${result}} ${path_tmp})
+        endif(NOT found AND full_path_tmp)
     endforeach(path_tmp ${paths_tmp})
 endmacro(filter_paths )

@@ -660,20 +660,20 @@
     set(deps_file_tmp ${CMAKE_CURRENT_BINARY_DIR}/${ARGN}.deps)
     set(update_deps_tmp 0)
     foreach(arg_tmp ${ARGN})
-	if(NOT IS_ABSOLUTE arg_tmp)
-	    set(arg_tmp ${CMAKE_CURRENT_SOURCE_DIR}/${arg_tmp})
-	endif(NOT IS_ABSOLUTE arg_tmp)
-	if(${arg_tmp} IS_NEWER_THAN ${deps_file_tmp})
-	    set(update_deps_tmp 1)
-	    break(arg_tmp ${ARGN})
-	endif(${arg_tmp} IS_NEWER_THAN ${deps_file_tmp})
+        if(NOT IS_ABSOLUTE arg_tmp)
+            set(arg_tmp ${CMAKE_CURRENT_SOURCE_DIR}/${arg_tmp})
+        endif(NOT IS_ABSOLUTE arg_tmp)
+        if(${arg_tmp} IS_NEWER_THAN ${deps_file_tmp})
+            set(update_deps_tmp 1)
+            break(arg_tmp ${ARGN})
+        endif(${arg_tmp} IS_NEWER_THAN ${deps_file_tmp})
     endforeach(arg_tmp ${ARGN})
     if(update_deps_tmp)
-	get_imported_files_old(${out} ${ARGN})
-	#filter_paths(${out} ${${out}} INCLUDE_CURRENT_DIR INCLUDE_PATHS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
-	set(${out} ${ARGN} ${${out}})
-	file(WRITE ${deps_file_tmp} "${${out}}")
+        get_imported_files_old(${out} ${ARGN})
+        #filter_paths(${out} ${${out}} INCLUDE_CURRENT_DIR INCLUDE_PATHS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+        set(${out} ${ARGN} ${${out}})
+        file(WRITE ${deps_file_tmp} "${${out}}")
     else(update_deps_tmp)
-	file(STRINGS ${deps_file_tmp} ${out})
+        file(STRINGS ${deps_file_tmp} ${out})
     endif(update_deps_tmp)
 endmacro(get_files_depends out)


make flycapture a private pod

make flycapture a private pod

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -129,6 +129,14 @@
 set(atlas-driver_external_args
   ${download_only_args}
   SOURCE_DIR ${source_prefix}/../drivers/atlas
+  )
+
+set(flycapture_url ssh://git@github.com/openhumanoids/flycapture-pod.git)
+set(flycapture_revision be27acc7effd83b0cb5648742b915eb4a6181f49)
+set(flycapture_depends)
+set(flycapture_external_args
+  ${download_only_args}
+  SOURCE_DIR ${source_prefix}/../drivers/flycapture
   )

 set(iris_url ssh://git@github.com/openhumanoids/iris-distro.git)
@@ -268,6 +276,7 @@
     gurobi-private
     gurobi
     snopt
+    flycapture
     )

 endif()


cmake: add XPRESS_PATH compile definition

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -130,6 +130,11 @@
 endif()
 if(USE_XPRESS)
   list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_XPRESS")
+  if(MSVC)
+    list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "XPRESS_PATH=\"${XPRESS_ROOT}\"")
+  else()
+    list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "XPRESS_PATH=${XPRESS_ROOT}")
+  endif()
 endif()

 if(WIN32)


ENH: CI: Fixed order of some git commands.

--- CI/prepare_superbuild.cmake
+++ CI/prepare_superbuild.cmake
@@ -58,11 +58,19 @@
 # This is needed because when using return() function ctest is trying
 # to run the CTEST_COMMAND. And we need it to not produce an error
 set (CTEST_COMMAND "echo \"Exit\"") # HACK FIX ME
-set (CMAKE_COMMAND "cmake")########################################################################
+set (CMAKE_COMMAND "cmake")
+
+########################################################################
 ########################################################################
 # Build process
 ########################################################################
 ########################################################################
+
+# Look for a GIT command-line client.
+find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
+
+# FIXME: Replace ${GIT} variable with $[CTEST_GIT_COMMAND}"
+set( GIT "${CTEST_GIT_COMMAND}" )

 # Sources are already checked out : do nothing for update
 set(CTEST_GIT_UPDATE_CUSTOM echo No update)
@@ -126,12 +134,6 @@
 set ( REMOTE "https://gitlab.orfeo-toolbox.org/gbonnefille/superbuild-artifact/")
 set ( BRANCH_NAME "${IMAGE_NAME}/${SB_MD5}")

-# Look for a GIT command-line client.
-find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
-
-# FIXME: Replace ${GIT} variable with $[CTEST_GIT_COMMAND}"
-set( GIT "git" )
-
 execute_process(
   COMMAND ${GIT} "ls-remote" "${REMOTE}" "${BRANCH_NAME}"
   OUTPUT_VARIABLE IS_SB_BUILD


Updating the FindFMOD.cmake script to current CMake standard pattern.

git-svn-id: 437764123c2e69732731433a8073bc2f24523c07@76 574e1c32-2fce-11df-82ed-5f3c927ac887

--- CMakeModules/FindFMOD.cmake
+++ CMakeModules/FindFMOD.cmake
@@ -1,53 +1,39 @@
-# - Locate FMOD library (By Matt Raykowski, OpenNeL Project http://www.opennel.org/)
-# http://www.opennel.org/fisheye/browse/~raw,r=1353/NeL/trunk/nel/CMakeModules/FindFMOD.cmake
-# (with permission to relicense as LGPL-with-staticlink-exemption by Matt Raykowski)
-# This module defines
-#  FMOD_LIBRARY, the library to link against
-#  FMOD_FOUND, if false, do not try to link to FMOD
-#  FMOD_INCLUDE_DIR, where to find headers.
+# Locate FMOD
+# This module defines FMOD_FOUND, FMOD_INCLUDE_DIR and FMOD_LIBRARIES standard variables

-IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-  # in cache already
-  SET(FMOD_FIND_QUIETLY TRUE)
-ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-
-
-FIND_PATH(FMOD_INCLUDE_DIR
-  fmod.h
-  PATHS
-  $ENV{FMOD_DIR}/include
-  /usr/local/include
-  /usr/include
-  /sw/include
-  /opt/local/include
-  /opt/csw/include
-  /opt/include
-  PATH_SUFFIXES fmod fmod3
+SET( FMOD_SEARCH_PATHS
+	~/Library/Frameworks
+	/Library/Frameworks
+	/usr/local
+	/usr
+	/sw # Fink
+	/opt/local # DarwinPorts
+	/opt/csw # Blastwave
+	/opt
 )

-FIND_LIBRARY(FMOD_LIBRARY
-  NAMES fmod fmodvc libfmod
-  PATHS
-  $ENV{FMOD_DIR}/lib
-  /usr/local/lib
-  /usr/lib
-  /usr/local/X11R6/lib
-  /usr/X11R6/lib
-  /sw/lib
-  /opt/local/lib
-  /opt/csw/lib
-  /opt/lib
-  /usr/freeware/lib64
+FIND_PATH( FMOD_INCLUDE_DIR
+	NAMES fmod.h
+	HINTS
+	$ENV{FMOD_DIR}
+	${FMOD_DIR}
+	PATH_SUFFIXES inc include
+	PATHS ${FMOD_SEARCH_PATHS}
 )

-IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-  SET(FMOD_FOUND "YES")
-  SET( FMOD_LIBRARIES ${FMOD_LIBRARY} )
-  IF(NOT FMOD_FIND_QUIETLY)
-    MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARY}")
-  ENDIF(NOT FMOD_FIND_QUIETLY)
-ELSE(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-  IF(NOT FMOD_FIND_QUIETLY)
-    MESSAGE(STATUS "Warning: Unable to find FMOD!")
-  ENDIF(NOT FMOD_FIND_QUIETLY)
-ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)+FIND_LIBRARY( FMOD_LIBRARY
+	NAMES fmod fmodvc libfmod fmodex_vc
+	HINTS
+	$ENV{FMOD_DIR}
+	${FMOD_DIR}
+	PATH_SUFFIXES lib lib64
+	PATHS ${FMOD_SEARCH_PATHS}
+)
+
+IF( FMOD_LIBRARY )
+    SET( FMOD_LIBRARIES "${FMOD_LIBRARY}")		# Could add "general" keyword, but it is optional
+ENDIF()
+
+# handle the QUIETLY and REQUIRED arguments and set FMOD_FOUND to TRUE if all listed variables are TRUE
+INCLUDE( FindPackageHandleStandardArgs )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS( FMOD DEFAULT_MSG FMOD_LIBRARIES FMOD_INCLUDE_DIR )


Fix Linux build due to FindOGRE script fixes for Mac.

--- CMakeModules/FindOGRE.cmake
+++ CMakeModules/FindOGRE.cmake
@@ -18,7 +18,7 @@
 # Once done, this will define
 #
 #  OGRE_FOUND - system has OGRE
-#  OGRE_INCLUDE_DIRS - the OGRE include directories
+#  OGRE_INCLUDE_DIRS - the OGRE include directories
 #  OGRE_LIBRARIES - link these to use the OGRE core
 #
 # Additionally this script searches for the following optional
@@ -33,7 +33,7 @@
 #
 #  OGRE_${COMPONENT}_FOUND - ${COMPONENT} is available
 #  OGRE_${COMPONENT}_INCLUDE_DIRS - additional include directories for ${COMPONENT}
-#  OGRE_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT}
+#  OGRE_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT}
 #
 # Finally, the following variables are defined:
 #
@@ -66,7 +66,11 @@
 endif ()

-set(OGRE_LIBRARY_NAMES "Ogre${OGRE_LIB_SUFFIX}")
+if(APPLE)
+    set(OGRE_LIBRARY_NAMES "Ogre${OGRE_LIB_SUFFIX}")
+else(APPLE)
+    set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}")
+endif(APPLE)
 get_debug_names(OGRE_LIBRARY_NAMES)

 # construct search paths from environmental hints and
@@ -116,8 +120,8 @@
   Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager
   Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX
   RenderSystem_Direct3D10 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GLES)
-set(OGRE_RESET_VARS
-  OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR
+set(OGRE_RESET_VARS
+  OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR
   OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG
   OGRE_PLUGIN_DIR_DBG OGRE_PLUGIN_DIR_REL OGRE_MEDIA_DIR)
 foreach (comp ${OGRE_COMPONENTS})
@@ -226,13 +230,13 @@
       set(OGRE_DEPS_FOUND FALSE)
     endif ()
   endif ()
-
-
-  set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
-    ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
+
+
+  set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
+    ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
     ${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB}
     ${Cocoa_LIBRARIES})
-
+
   if (NOT ZLIB_FOUND OR NOT ZZip_FOUND)
     set(OGRE_DEPS_FOUND FALSE)
   endif ()
@@ -247,14 +251,14 @@
       set(OGRE_DEPS_FOUND FALSE)
 	endif ()
   endif ()
-
+
   if (OGRE_CONFIG_THREADS)
     find_package(Boost COMPONENTS thread QUIET)
     if (NOT Boost_THREAD_FOUND)
       set(OGRE_DEPS_FOUND FALSE)
     endif ()
   endif ()
-
+
   if (NOT OGRE_DEPS_FOUND)
     pkg_message(OGRE "Could not find all required dependencies for the Ogre package.")
     set(OGRE_FOUND FALSE)
@@ -311,17 +315,17 @@
     set(TMP_CMAKE_LIB_PREFIX ${CMAKE_FIND_LIBRARY_PREFIXES})
     set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "")
   endif()
-
+
   # strip RenderSystem_ or Plugin_ prefix from plugin name
   string(REPLACE "RenderSystem_" "" PLUGIN_TEMP ${PLUGIN})
   string(REPLACE "Plugin_" "" PLUGIN_NAME ${PLUGIN_TEMP})
-
+
   # header files for plugins are not usually needed, but find them anyway if they are present
   set(OGRE_PLUGIN_PATH_SUFFIXES
-    PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN}
+    PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN}
     RenderSystems RenderSystems/${PLUGIN_NAME} ${ARGN})
-  find_path(OGRE_${PLUGIN}_INCLUDE_DIR NAMES ${HEADER}
-    HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE}
+  find_path(OGRE_${PLUGIN}_INCLUDE_DIR NAMES ${HEADER}
+    HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE}
     PATH_SUFFIXES ${OGRE_PLUGIN_PATH_SUFFIXES})
   # find link libraries for plugins
   set(OGRE_${PLUGIN}_LIBRARY_NAMES "${PLUGIN}${OGRE_LIB_SUFFIX}")
@@ -347,7 +351,7 @@
   if (OGRE_${PLUGIN}_FOUND)
     if (NOT OGRE_PLUGIN_DIR_REL OR NOT OGRE_PLUGIN_DIR_DBG)
       if (WIN32)
-        set(OGRE_PLUGIN_SEARCH_PATH_REL
+        set(OGRE_PLUGIN_SEARCH_PATH_REL
           ${OGRE_LIBRARY_DIR_REL}/..
           ${OGRE_LIBRARY_DIR_REL}/../..
         )
@@ -401,7 +405,7 @@
   if (NOT Cg_FOUND)
     set(OGRE_Plugin_CgProgramManager_FOUND FALSE)
   endif ()
-
+
   set(OGRE_RenderSystem_Direct3D9_LIBRARIES ${OGRE_RenderSystem_Direct3D9_LIBRARIES}
     ${DirectX_LIBRARIES}
   )


Fix floating point flags for CM3 architecture

Since there is no FPU on the device, soft floating point
should be enabled

--- toolchains/arm-cm3-gnu.cmake
+++ toolchains/arm-cm3-gnu.cmake
@@ -32,7 +32,7 @@

 # common flags for current platform
 set(CC_PLATFORM_FLAGS "-ffreestanding -mcpu=cortex-m3 -mthumb -fdata-sections \
-	-ffunction-sections -fno-common")
+	-ffunction-sections -fno-common -msoft-float -mfloat-abi=soft")

 # -fno-use-cxa-atexit helps resolve issue with DSO handle undefined reference
 # why????


Install necessary Qt 5 plugins for Windows.

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -35,6 +35,24 @@
 endif()

 if(WIN32)
+  if(MITK_USE_Qt5)
+    get_property(_qmake_location TARGET ${Qt5Core_QMAKE_EXECUTABLE}
+                 PROPERTY IMPORT_LOCATION)
+    get_filename_component(_qmake_path "${_qmake_location}" DIRECTORY)
+    install(FILES "${_qmake_path}/../plugins/platforms/qwindows.dll"
+            DESTINATION "bin/plugins/platforms"
+            CONFIGURATIONS Release)
+    install(FILES "${_qmake_path}/../plugins/sqldrivers/qsqlite.dll"
+            DESTINATION "bin/plugins/sqldrivers"
+            CONFIGURATIONS Release)
+    install(FILES "${_qmake_path}/../plugins/platforms/qwindowsd.dll"
+            DESTINATION "bin/plugins/platforms"
+            CONFIGURATIONS Debug)
+    install(FILES "${_qmake_path}/../plugins/sqldrivers/qsqlited.dll"
+            DESTINATION "bin/plugins/sqldrivers"
+            CONFIGURATIONS Debug)
+  endif()
+
   #DCMTK Dlls install target (shared libs on gcc only)
   if(MINGW AND DCMTK_ofstd_LIBRARY)
     set(_dcmtk_libs


whitespace fix

whitespace fix

--- CMakeModules/FindVMime.cmake
+++ CMakeModules/FindVMime.cmake
@@ -46,7 +46,7 @@
         MESSAGE ( FATAL_ERROR "grep is required" )
     ENDIF (  )

-
+
     IF ( DEFINED PERL_EXECUTABLE )
         EXEC_PROGRAM ( "echo"
             ARGS "${VMIME_VERSION_DEFINE_STRING} | ${PERL_EXECUTABLE} -pe 'if(($_)=/([0-9]+([.][0-9]+)+)/){}'"


build fix

build fix

--- CMakeModules/OMPLUtils.cmake
+++ CMakeModules/OMPLUtils.cmake
@@ -21,7 +21,9 @@
     endmacro(add_ompl_python_test)

 else(OMPL_IN_ROS)
-    include_directories(${GTEST_INCLUDE_DIRS})
+    if(GTEST_FOUND)
+        include_directories(${GTEST_INCLUDE_DIRS})
+    endif()

     macro(add_ompl_test test_name)
         add_executable(${ARGV})


CI: allow job to fail if test is failing

--- CI/main_ci.cmake
+++ CI/main_ci.cmake
@@ -84,6 +84,14 @@
   message( SEND_ERROR "An error occurs during ctest_build.")
 endif()

-ctest_test(PARALLEL_LEVEL 8)
+ctest_test(PARALLEL_LEVEL 8
+           RETURN_VALUE _test_rv
+           CAPTURE_CMAKE_ERROR _test_error
+           )
+
+if ( NOT _test_rv EQUAL 0 )
+  ctest_submit()
+  message( SEND_ERROR "An error occurs during ctest_test.")
+endif()

 ctest_submit()


let's increase against factory

let's increase against factory


cakepg: fix empty dir check

cakepg: fix empty dir check

--- Modules/private/CakePkgClone.cmake
+++ Modules/private/CakePkgClone.cmake
@@ -27,9 +27,10 @@
     else()
       set(ans 0) # existing file
     endif()
-  endif()
-  file(MAKE_DIRECTORY "${dn}") # does not exist
-  set(ans 1)
+  else()
+    file(MAKE_DIRECTORY "${dn}") # does not exist
+    set(ans 1)
+  endif()
 endmacro()

 # pkg_url is the full, decorated URL (with optional query part to specify key-value pairs)


COMP: Update git tag to incorporate MGHIO origin fix

Change-Id: Id60b0bcc4fca43c7e0e743e76989dde29b472c6f

--- Modules/Remote/MGHIO.remote.cmake
+++ Modules/Remote/MGHIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(MGHIO
   "MGHIO ImageIO plugin for ITK"
   GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
-  GIT_TAG 1beeaa5abb18188ded17bf6337b31c572d2594cf
+  GIT_TAG 3566fcdd053249a59ba958586d8c32e5042f285b
   )


Fixed build error by using a different cmake function for checking the compiler flags

--- Core/CppMicroServices/CMake/usFunctionCheckCompilerFlags.cmake
+++ Core/CppMicroServices/CMake/usFunctionCheckCompilerFlags.cmake
@@ -24,29 +24,41 @@

 include(TestCXXAcceptsFlag)

-function(usFunctionCheckCompilerFlags CXX_FLAG_TO_TEST RESULT_VAR)
+function(usFunctionCheckCompilerFlags FLAG_TO_TEST RESULT_VAR)

-  if(CXX_FLAG_TO_TEST STREQUAL "")
-    message(FATAL_ERROR "CXX_FLAG_TO_TEST shouldn't be empty")
+  if(FLAG_TO_TEST STREQUAL "")
+    message(FATAL_ERROR "FLAG_TO_TEST shouldn't be empty")
   endif()

-  set(_test_flag ${CXX_FLAG_TO_TEST})
-  CHECK_CXX_ACCEPTS_FLAG("-Werror=unknown-warning-option" HAS_FLAG_unknown-warning-option)
-  if(HAS_FLAG_unknown-warning-option)
-    set(_test_flag "-Werror=unknown-warning-option ${CXX_FLAG_TO_TEST}")
-  endif()
+  # Clear all flags. If not, existing flags triggering warnings might lead to
+  # false-negatives when checking for certain compiler flags.
+  set(CMAKE_C_FLAGS )
+  set(CMAKE_C_FLAGS_DEBUG )
+  set(CMAKE_C_FLAGS_MINSIZEREL )
+  set(CMAKE_C_FLAGS_RELEASE )
+  set(CMAKE_C_FLAGS_RELWITHDEBINFO )
+  set(CMAKE_CXX_FLAGS )
+  set(CMAKE_CXX_FLAGS_DEBUG )
+  set(CMAKE_CXX_FLAGS_MINSIZEREL )
+  set(CMAKE_CXX_FLAGS_RELEASE )
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO )

-  # Internally, the macro CMAKE_CXX_ACCEPTS_FLAG calls TRY_COMPILE. To avoid
+  # Internally, the macro CMAKE_CXX_COMPILER_FLAG calls TRY_COMPILE. To avoid
   # the cost of compiling the test each time the project is configured, the variable set by
   # the macro is added to the cache so that following invocation of the macro with
   # the same variable name skip the compilation step.
-  # For that same reason, usFunctionCheckCompilerFlags function appends a unique suffix to
-  # the HAS_FLAG variable. This suffix is created using a 'clean version' of the flag to test.
-  string(REGEX REPLACE "-\\s\\$\\+\\*\\{\\}\\(\\)\\#" "" suffix ${CXX_FLAG_TO_TEST})
-  CHECK_CXX_ACCEPTS_FLAG(${_test_flag} HAS_FLAG_${suffix})
+  # For that same reason, the usFunctionCheckCompilerFlags function appends a unique suffix to
+  # the HAS_CXX_FLAG variable. This suffix is created using a 'clean version' of the
+  # flag to test. The value of HAS_CXX_FLAG_${suffix} additonally needs to be a valid
+  # pre-processor token because CHECK_CXX_COMPILER_FLAG adds it as a definition to the compiler
+  # arguments. An invalid token triggers compiler warnings, which in case of the "-Werror" flag
+  # leads to false-negative checks.
+  string(REGEX REPLACE "[/-]" "_" suffix ${FLAG_TO_TEST})
+  string(REGEX REPLACE "[, \\$\\+\\*\\{\\}\\(\\)\\#]" "" suffix ${suffix})
+  CHECK_CXX_COMPILER_FLAG(${FLAG_TO_TEST} HAS_CXX_FLAG_${suffix})

-  if(HAS_FLAG_${suffix})
-    set(${RESULT_VAR} "${${RESULT_VAR}} ${CXX_FLAG_TO_TEST}" PARENT_SCOPE)
+  if(HAS_CXX_FLAG_${suffix})
+    set(${RESULT_VAR} "${${RESULT_VAR}} ${FLAG_TO_TEST}" PARENT_SCOPE)
   endif()

 endfunction()


Clean up

Clean up

--- FindHWLOC.cmake
+++ FindHWLOC.cmake
@@ -26,8 +26,6 @@
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARIES
     HWLOC_INCLUDE_DIRS)
-
-  include_directories(${HWLOC_INCLUDE_DIRS})

   if(${HWLOC_VERSION} VERSION_LESS 1.5.0)
     set(HWLOC_GL_FOUND)


SuperBuild: ALL DEPENDS in package

SuperBuild: ALL DEPENDS in package

--- SuperBuild/Packaging/PMacros.cmake
+++ SuperBuild/Packaging/PMacros.cmake
@@ -116,7 +116,6 @@
       )
   else()
     add_custom_target(PACKAGE-${pkg}
-      ALL DEPENDS
       COMMAND ${MAKESELF_SCRIPT}
       "--quiet"
       "--target"


Added option to link with custom libcxx library

--- Googlify.cmake
+++ Googlify.cmake
@@ -8,6 +8,7 @@

 option(IOS_BUILD "Build for iOS" OFF)
 option(IOS_SIMULATOR_BUILD "Build for iOS simulator" OFF)
+option(ENFORCE_CUSTOM_LIBCXX "Enforce link with custom libcxx" OFF)

 if (IOS_BUILD OR IOS_SIMULATOR_BUILD)
   set(IS_IOS 1)
@@ -317,7 +318,7 @@
   prepare_sources_for_c(SRCS ${ARGN})
   add_executable(${FULL_TARGET} ${SRCS})
   set_target_properties(${FULL_TARGET} PROPERTIES OUTPUT_NAME ${TARGET})
-  if (NOT IS_IOS)
+  if (ENFORCE_CUSTOM_LIBCXX)
     link(${TARGET} third_party.libcxx)
   endif ()
 endfunction()
@@ -350,7 +351,7 @@
     add_library(${FULL_TARGET} ${SRCS})
   endif ()
   set_target_properties(${FULL_TARGET} PROPERTIES OUTPUT_NAME ${TARGET})
-  if (NOT IS_IOS)
+  if (ENFORCE_CUSTOM_LIBCXX)
     link(${TARGET} third_party.libcxx)
   endif ()
 endfunction(cc_library)


COMP: Add -Wunused-local-typedefs to Eternia.

Ignore
/TubeTK-Debug/ITK/Modules/Core/Common/include/itkConceptChecking.h:594:59:
warning: typedef ‘ValueType’ locally defined but not used
[-Wunused-local-typedefs].

--- Eternia_Kitware_TubeTK.cmake
+++ Eternia_Kitware_TubeTK.cmake
@@ -149,7 +149,7 @@
 set( ENV{PATH} "${SITE_EXECUTABLE_DIRS}:$ENV{PATH}" )

 set( SITE_CXX_FLAGS
-  "-fPIC -fdiagnostics-show-option -W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Woverloaded-virtual" )
+  "-fPIC -Wunused-local-typedefs -fdiagnostics-show-option -W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Woverloaded-virtual" )
 set( SITE_C_FLAGS
   "-fPIC -fdiagnostics-show-option -W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings" )
 set( SITE_EXE_LINKER_FLAGS "" )


STYLE: Remove conda installation

STYLE: Remove conda installation

--- Common.cmake
+++ Common.cmake
@@ -130,7 +130,7 @@
   set(INSTALL_LIBRARY_DESTINATION ${Slicer_INSTALL_CLIMODULES_LIB_DIR})
   set(INSTALL_ARCHIVE_DESTINATION ${Slicer_INSTALL_CLIMODULES_LIB_DIR})

-  set( ${PRIMARY_PROJECT_NAME}_DEPENDENCIES ITKv4 SlicerExecutionModel QtToCppXML conda Trafic Teem)
+  set( ${PRIMARY_PROJECT_NAME}_DEPENDENCIES ITKv4 SlicerExecutionModel QtToCppXML Trafic Teem)

   set(USE_SYSTEM_niral_utilities ON)

@@ -139,5 +139,5 @@
   set(INSTALL_RUNTIME_DESTINATION bin)
   set(INSTALL_LIBRARY_DESTINATION lib)
   set(INSTALL_ARCHIVE_DESTINATION lib)
-  set( ${PRIMARY_PROJECT_NAME}_DEPENDENCIES ITKv4 SlicerExecutionModel QtToCppXML ITKTransformTools VTK DTIProcess DTIAtlasFiberAnalyzer ANTs DTI-Reg ResampleDTIlogEuclidean conda Trafic Teem)
+  set( ${PRIMARY_PROJECT_NAME}_DEPENDENCIES ITKv4 SlicerExecutionModel QtToCppXML ITKTransformTools VTK DTIProcess DTIAtlasFiberAnalyzer ANTs DTI-Reg ResampleDTIlogEuclidean Trafic Teem)
 endif()


MANAGE_MESSAGE_LEVEL become CACHE

MANAGE_MESSAGE_LEVEL become CACHE

--- Modules/ManageMessage.cmake
+++ Modules/ManageMessage.cmake
@@ -44,9 +44,7 @@
     ENDIF(NOT DEFINED MANAGE_MESSAGE_LABELS)

     MACRO(M_MSG level msg)
-	IF(NOT DEFINED MANAGE_MESSAGE_LEVEL)
-	    SET(MANAGE_MESSAGE_LEVEL ${M_WARN})
-	ENDIF(NOT DEFINED MANAGE_MESSAGE_LEVEL)
+	SET(MANAGE_MESSAGE_LEVEL ${M_OFF} CACHE STRING "Message (Verbose) Level")
 	IF(${level} GREATER ${MANAGE_MESSAGE_LEVEL})
 	ELSE(${level} GREATER ${MANAGE_MESSAGE_LEVEL})
 	    MATH(EXPR _lvl ${level}-1)


Fixed OpenAL flags in yuni-config using devpacks.

--- src/yuni/cmake/deps/openal-devpack.cmake
+++ src/yuni/cmake/deps/openal-devpack.cmake
@@ -5,4 +5,7 @@
 # We get OPENAL_INCLUDE_DIR from here.
 # We get OPENAL_LIBRARY from here.

+LIBYUNI_CONFIG_INCLUDE_PATH("both" "media" "${OPENAL_INCLUDE_DIR}")
+LIBYUNI_CONFIG_LIB_RAW_COMMAND("both" "media" "${OPENAL_LIBRARY}")
+include_directories(${OPENAL_INCLUDE_DIR})


Upgrade `libunwind` from `v1.4.0` to `v1.5`

--- libunwind.cmake
+++ libunwind.cmake
@@ -1,7 +1,7 @@
 if(NOT EXISTS "${CMAKE_BINARY_DIR}/libunwind")
     execute_process(
         COMMAND
-            git clone -b v1.4.0 --depth 1 https://github.com/libunwind/libunwind.git libunwind
+            git clone -b v1.5 --depth 1 https://github.com/libunwind/libunwind.git libunwind
         WORKING_DIRECTORY
             "${CMAKE_BINARY_DIR}"
         RESULT_VARIABLE


VERIABLE_PARSE_ARGN: Init the option name, so it can be find by IF(DEFINED ...)

--- Modules/ManageVariable.cmake
+++ Modules/ManageVariable.cmake
@@ -364,6 +364,8 @@
 		## Is an option name.
 		## Obtain option name
 		LIST(GET ${validOptions} ${_optIndex} _optName)
+		# Init the option name, so it can be find by IF(DEFINED ...)
+		SET(${var}_${_optName} "")
 		SET(_listName "${var}_${_optName}")
 	    ENDIF(_optIndex EQUAL -1)
 	ENDFOREACH(_arg ${ARGN})


BUG: CXX and C flags were not given to external_projects

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -48,17 +48,12 @@

 #-----------------------------------------------------------------------------
-#set( VTK_DIR_TMP ${VTK_DIR} )
-message(WARNING "Before: "${QT_QMAKE_EXECUTABLE} )
-unsetForSlicer( VERBOSE NAMES VTK_DIR CMAKE_MODULE_PATH CMAKE_C_COMPILER CMAKE_CXX_COMPILER )
+unsetForSlicer( NAMES VTK_DIR CMAKE_MODULE_PATH CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS )
 find_package(Slicer REQUIRED)
 include(${Slicer_USE_FILE})
-unsetAllForSlicerBut( VERBOSE NAMES ITK_DIR SlicerExecutionModel_DIR QT_QMAKE_EXECUTABLE )
-resetForSlicer( VERBOSE NAMES VTK_DIR CMAKE_MODULE_PATH CMAKE_C_COMPILER CMAKE_CXX_COMPILER )
-#set( VTK_DIR ${VTK_DIR_TMP} CACHE PATH "VTK PATH" FORCE )
+unsetAllForSlicerBut( NAMES ITK_DIR SlicerExecutionModel_DIR QT_QMAKE_EXECUTABLE )
+resetForSlicer( NAMES VTK_DIR CMAKE_MODULE_PATH CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS )
 set( BUILD_SHARED_LIBS OFF)
-message(WARNING "After: "${QT_QMAKE_EXECUTABLE} )
-
 #-----------------------------------------------------------------------------
 # Project dependencies
 #-----------------------------------------------------------------------------


Remote #pragma once for multiple inclusions

--- Utilities.cmake
+++ Utilities.cmake
@@ -488,7 +488,6 @@

 # File Header
 file(WRITE "${output_file}.header"
-  "#pragma once\n\n"
   "#ifndef JEMALLOC_H_\n"
   "#define	JEMALLOC_H_\n"
   "#ifdef __cplusplus\n"


Revert the part of r8787 that stopped HAVE_OGRE_BUILDSETTINGS_H getting written to the OgreConfig.h; was breaking external builds

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

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -94,9 +94,12 @@
 configure_file(${OGRE_TEMPLATES_DIR}/buildsettings.h.in ${OGRE_BINARY_DIR}/include/buildsettings.h @ONLY)
 install(FILES ${OGRE_BINARY_DIR}/include/buildsettings.h DESTINATION include/OGRE)

-# Install OgreConfig.h file
-# This used to add HAVE_OGRE_BUILDSETTINGS_H to the top, which is a duplicate of adding -DHAVE_OGRE_BUILDSETTINGS_H
-install(FILES ${OGRE_SOURCE_DIR}/OgreMain/include/OgreConfig.h DESTINATION include/OGRE)
+# Read contents of the OgreConfig.h file
+file(READ "${OGRE_SOURCE_DIR}/OgreMain/include/OgreConfig.h" OGRE_CONFIG_H)
+# add HAVE_OGRE_BUILDSETTINGS_H preprocessor define
+file(WRITE ${OGRE_BINARY_DIR}/include/OgreConfig.h "#define HAVE_OGRE_BUILDSETTINGS_H\n${OGRE_CONFIG_H}")
+install(FILES ${OGRE_BINARY_DIR}/include/OgreConfig.h DESTINATION include/OGRE)
+

 # Create the pkg-config package files on Unix systems
 if (UNIX)


CMake: throw on OgreAssert in Release builds by default

we need this for asserts to work in RelWithDebinfo configuration.
Also this gives us a backtrace in python instead of just instantly
crashing the interpreter.

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -75,7 +75,7 @@

 endif()

-set(OGRE_ASSERT_MODE 0 CACHE STRING
+set(OGRE_ASSERT_MODE 1 CACHE STRING
 	"Enable Ogre asserts and exceptions. Possible values:
 	0 - Standard asserts in debug builds, nothing in release builds.
 	1 - Standard asserts in debug builds, exceptions in release builds.


Specify Boost install libdir for Windows.

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -19,6 +19,7 @@

     set(_boost_libs )
     set(_with_boost_libs )
+    set(_install_lib_dir )

     # Set the boost root to the libraries install directory
     set(BOOST_ROOT "${ep_prefix}")
@@ -48,6 +49,7 @@
           set(_boost_toolset "toolset=msvc-11.0")
         endif()
       endif()
+      set(_install_lib_dir "--libdir=<INSTALL_DIR>/bin")
     else()
       set(_shell_extension .sh)
     endif()
@@ -82,6 +84,7 @@
         ${APPLE_SYSROOT_FLAG}
         --layout=tagged
         "--prefix=<INSTALL_DIR>"
+        ${_install_lib_dir}
         ${_with_boost_libs}
         # Use the option below to view the shell commands (for debugging)
         #-d+4


Fixed compilation for windows where /MTd and /MT were used instead of /MDd and /MD (which is the setting for CTK) when compiling DCMTK. Now, DCMTK does not override CMake's compiler flags on WIN32 any more (disabled DCMTK's CMake option DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS which usually uses /MT and /MTd).

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -42,7 +42,7 @@
         ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS}
         -DBUILD_TESTING:BOOL=OFF
         -DDCMTK_BUILD_APPS:BOOL=ON # Build also dmctk tools (movescu, storescp, ...)
-      )
+        -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS:BOOL=OFF)
     SET(DCMTK_DIR ${ep_install_dir})

 # This was used during heavy development on DCMTK itself.


Added XUL_DIR searching

Added XUL_DIR searching

--- CMakeModules/FindXUL.cmake
+++ CMakeModules/FindXUL.cmake
@@ -102,6 +102,34 @@
     /usr/freeware/include
 )

+FIND_PATH(XUL_DIR
+    NAMES components/appshell.xpt
+    PATHS
+    $ENV{OSG_DIR}/lib
+    $ENV{OSG_DIR}
+    $ENV{OSGDIR}/lib
+    $ENV{OSGDIR}
+    $ENV{OSG_ROOT}/lib
+    ~/Library/Frameworks
+    /Library/Frameworks
+    /usr/local/lib/xulrunner
+    /usr/local/lib
+    /usr/lib/xulrunner
+    /usr/lib
+    /sw/lib/xulrunner
+    /sw/lib
+    /opt/local/lib/xulrunner
+    /opt/local/lib
+    /opt/csw/lib/xulrunner
+    /opt/csw/lib
+    /opt/lib/xulrunner
+    /opt/lib
+    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+    /usr/freeware/lib64/xulrunner
+    /usr/freeware/lib64
+)
+
+
 MACRO(FIND_XUL_LIBRARY MYLIBRARY MYLIBRARYNAME)

     FIND_LIBRARY(${MYLIBRARY}


update version number for beta release

update version number for beta release

--- CMakeModules/Version.cmake
+++ CMakeModules/Version.cmake
@@ -7,9 +7,9 @@
     CMAKE_POLICY(SET CMP0054 OLD)
 ENDIF()

-SET(FG_VERSION_MAJOR "1")
-SET(FG_VERSION_MINOR "0")
-SET(FG_VERSION_PATCH "beta")
+SET(FG_VERSION_MAJOR "0")
+SET(FG_VERSION_MINOR "9")
+SET(FG_VERSION_PATCH "0-beta")

 SET(FG_VERSION "${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}")
 SET(FG_API_VERSION_CURRENT ${FG_VERSION_MAJOR}${FG_VERSION_MINOR})


made format-nonliteral an error

made format-nonliteral an error

--- SetFlags.cmake
+++ SetFlags.cmake
@@ -199,8 +199,7 @@
 			add_flags_cxx("-Wno-error=exit-time-destructors -Wno-error=missing-variable-declarations")
 			add_flags_cxx("-Wno-error=global-constructors -Wno-implicit-fallthrough")
 			add_flags_cxx("-Wno-missing-noreturn -Wno-error=unreachable-code -Wno-error=undef")
-			add_flags_cxx("-Wno-error=format-nonliteral")
-		endif()
-	endif()
-
-endmacro()
+		endif()
+	endif()
+
+endmacro()


Update CodeCoverage.cmake

Update CodeCoverage.cmake

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -27,7 +27,7 @@
     FORCE
 )

-SET(COVERAGE_LIBRARIES -fprofile-arcs -ftest-coverage)
+SET(COVERAGE_LIBRARIES -g -fprofile-arcs -ftest-coverage)

 MARK_AS_ADVANCED(
     COVERAGE_CXX_FLAGS
@@ -37,7 +37,7 @@
 FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
     ADD_CUSTOM_TARGET(${_targetname}
         # Reset all execution counts to zero.
-        ${LCOV_PATH} --directory . --zerocounters
+        ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --directory . --zerocounters

         # Run tests.
         COMMAND ${_testrunner} ${ARGV3}


fixed mkldnn lib name for osx Ref. SINGA-433

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -144,9 +144,8 @@

 IF(USE_MKLDNN)
     FIND_PATH(MKLDNN_INCLUDE_DIR NAME "mkldnn.hpp" PATHS "$ENV{CMAKE_INCLUDE_PATH}")
-    FIND_LIBRARY(MKLDNN_LIBRARIES NAME "libmkldnn.so" PATHS "$ENV{CMAKE_LIBRARY_PATH}")
-    FIND_LIBRARY(MKLML_LIBRARIES NAME "libmklml_intel.so" PATHS "$ENV{CMAKE_LIBRARY_PATH}")
+    FIND_LIBRARY(MKLDNN_LIBRARIES NAME "mkldnn" PATHS "$ENV{CMAKE_LIBRARY_PATH}")
     MESSAGE(STATUS "Found MKLDNN at ${MKLDNN_INCLUDE_DIR}")
     INCLUDE_DIRECTORIES(${MKLDNN_INCLUDE_DIR})
-    LIST(APPEND SINGA_LINKER_LIBS ${MKLDNN_LIBRARIES} ${MKLML_LIBRARIES})
+    LIST(APPEND SINGA_LINKER_LIBS ${MKLDNN_LIBRARIES})
 ENDIF()


Make FindPrimitiv.cmake to check the header version.

--- cmake/FindPrimitiv.cmake
+++ cmake/FindPrimitiv.cmake
@@ -9,6 +9,10 @@
 #   PRIMITIV_C_FOUND - Whether or not the system has the primitiv C API.
 #   PRIMITIV_C_INCLUDE_DIR - primitiv C API include directory.
 #   PRIMITIV_C_LIBRARIES - primitiv C API library files.
+#
+#   PRIMITIV_VERSION - Header version of the installed library.
+#   PRIMITIV_VERSION_OK - `ON` if the installed header satisfies version
+#                         requirement, `OFF` otherwise.
 #
 # This script reads hints about search locations from the following
 # environment variables:
@@ -26,7 +30,7 @@

 #
-# Finding primitiv core library
+# Finds primitiv core library
 #

 find_path(PRIMITIV_INCLUDE_DIR NAMES primitiv/primitiv.h
@@ -46,18 +50,18 @@
 )

 if (PRIMITIV_INCLUDE_DIR AND PRIMITIV_LIBRARIES)
-  message("-- Found Primitiv: " ${PRIMITIV_LIBRARIES})
-  #message("-- Primitiv include dir: " ${PRIMITIV_INCLUDE_DIR})
-  #message("-- Primitiv libraries: " ${PRIMITIV_LIBRARIES})
+  message("-- Found primitiv: " ${PRIMITIV_LIBRARIES})
+  #message("-- primitiv include dir: " ${PRIMITIV_INCLUDE_DIR})
+  #message("-- primitiv libraries: " ${PRIMITIV_LIBRARIES})
   set(PRIMITIV_FOUND ON)
 else()
-  message(STATUS "Primitiv is not installed.")
+  message(STATUS "primitiv is not installed.")
   set(PRIMITIV_FOUND OFF)
 endif()

 #
-# Finding primitiv C API
+# Finds primitiv C API
 #

 find_path(PRIMITIV_C_INCLUDE_DIR NAMES primitiv/c/api.h
@@ -77,12 +81,58 @@
 )

 if (PRIMITIV_C_INCLUDE_DIR AND PRIMITIV_C_LIBRARIES)
-  message("-- Found Primitiv C API: " ${PRIMITIV_C_LIBRARIES})
-  #message("-- Primitiv C API include dir: " ${PRIMITIV_C_INCLUDE_DIR})
-  #message("-- Primitiv C API libraries: " ${PRIMITIV_C_LIBRARIES})
+  message("-- Found primitiv C API: " ${PRIMITIV_C_LIBRARIES})
+  #message("-- primitiv C API include dir: " ${PRIMITIV_C_INCLUDE_DIR})
+  #message("-- primitiv C API libraries: " ${PRIMITIV_C_LIBRARIES})
   set(PRIMITIV_C_FOUND ON)
 else()
   message(STATUS "Primitiv C API is not installed.")
   set(PRIMITIV_C_FOUND OFF)
 endif()

+
+#
+# Checks version
+#
+
+if(NOT Primitiv_FIND_VERSION)
+  set(Primitiv_FIND_VERSION "${Primitiv_FIND_VERSION_MAJOR}.${Primitiv_FIND_VERSION_MINOR}.${Primitiv_FIND_VERSION_PATCH}")
+endif()
+
+file(READ
+  "${PRIMITIV_INCLUDE_DIR}/primitiv/version.h"
+  _primitiv_version_header
+)
+
+string(REGEX MATCH
+  "#[ \t]*define[ \t]+PRIMITIV_VERSION_MAJOR[ \t]+([0-9]+)"
+  _primitiv_version_match "${_primitiv_version_header}"
+)
+set(PRIMITIV_VERSION_MAJOR "${CMAKE_MATCH_1}")
+
+string(REGEX MATCH
+  "#[ \t]*define[ \t]+PRIMITIV_VERSION_MINOR[ \t]+([0-9]+)"
+  _primitiv_version_match "${_primitiv_version_header}"
+)
+set(PRIMITIV_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+string(REGEX MATCH
+  "#[ \t]*define[ \t]+PRIMITIV_VERSION_PATCH[ \t]+([0-9]+)"
+  _primitiv_version_match "${_primitiv_version_header}"
+)
+set(PRIMITIV_VERSION_PATCH "${CMAKE_MATCH_1}")
+
+set(PRIMITIV_VERSION "${PRIMITIV_VERSION_MAJOR}.${PRIMITIV_VERSION_MINOR}.${PRIMITIV_VERSION_PATCH}")
+
+#message("primitiv version requested: ${PRIMITIV_FIND_VERSION}")
+#message("primitiv version found: ${PRIMITIV_VERSION}")
+
+if(${PRIMITIV_VERSION} VERSION_LESS ${Primitiv_FIND_VERSION})
+  message(STATUS
+    "primitiv version ${PRIMITIV_VERSION} found in ${PRIMITIV_INCLUDE_DIR}, "
+    "but at least version ${Primitiv_FIND_VERSION} is required."
+  )
+  set(PRIMITIV_VERSION_OK OFF)
+else()
+  set(PRIMITIV_VERSION_OK ON)
+endif()


updated FindSamtools to work with Cent 6/EPEL pkg

--- cmake/FindSamtools.cmake
+++ cmake/FindSamtools.cmake
@@ -22,7 +22,7 @@
 find_path(Samtools_INCLUDE_DIR
     NAMES bam.h #bgzf.h faidx.h glf.h ksort.h kstring.h
     PATHS ${SAMTOOLS_SEARCH_DIRS}
-    PATH_SUFFIXES include ${_samtools_ver_path}
+    PATH_SUFFIXES include include/samtools ${_samtools_ver_path}
     HINTS ENV SAMTOOLS_ROOT
 )

@@ -31,7 +31,7 @@
     NAMES bam libbam.a bam.a
     PATHS ${Samtools_INCLUDE_DIR} ${SAMTOOLS_SEARCH_DIRS}
     NO_DEFAULT_PATH
-    PATH_SUFFIXES lib ${_samtools_ver_path}
+    PATH_SUFFIXES lib lib64 ${_samtools_ver_path}
     HINTS ENV SAMTOOLS_ROOT
 )


Revert "map 5 channels streams as L/R/C/Ls/Rs"

This reverts commit 8daebbf24aa6765e21bcdf20924a42147e1ade1e.

--- cmake/FindSpeexDSP.cmake
+++ cmake/FindSpeexDSP.cmake
@@ -1,2 +0,0 @@
-include(FindPkgConfig)
-pkg_check_modules(SPEEXDSP speexdsp)


no longer need to undef __OBJC__

no longer need to undef __OBJC__

--- cmake/MCKLFunction.cmake
+++ cmake/MCKLFunction.cmake
@@ -125,10 +125,6 @@
     -D__STDC_CONSTANT_MACROS)
 SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
     -D__CL_ENABLE_EXCEPTIONS)
-IF(APPLE)
-    SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -U__OBJC__)
-    SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -U__OBJC2__)
-ENDIF(APPLE)

 SET(MCKL_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
 SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${MCKL_INCLUDE_DIR})
@@ -281,17 +277,6 @@
 # Make sure __STDC_CONSTANT_MACROS is defined
 SET(MCKL_DEFINITIONS ${MCKL_DEFINITIONS} -D__STDC_CONSTANT_MACROS)

-# Workaround for vanilla GCC on Mac OS X
-IF(APPLE)
-    SET(MCKL_DEFINITIONS ${MCKL_DEFINITIONS} -U__OBJC__)
-    SET(MCKL_DEFINITIONS ${MCKL_DEFINITIONS} -U__OBJC2__)
-ENDIF(APPLE)
-
-# Disable MSVC iterator warning
-IF(MSVC)
-    SET(MCKL_DEFINITIONS ${MCKL_DEFINITIONS} -D_SCL_SECURE_NO_WARNINGS)
-ENDIF(MSVC)
-
 ##############################################################################
 # Defs, includes, and libs
 ##############################################################################


[cmake] add rpath studd following recommendation at https://cmake.org/Wiki/CMake_RPATH_handling

--- cmake/SiconosSetup.cmake
+++ cmake/SiconosSetup.cmake
@@ -153,24 +153,35 @@
   COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/python_install_manifest.txt >> ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt
   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

-# =========== RPATH stuff ===========
-# do not skip the full RPATH for the build tree
-if(FORCE_SKIP_RPATH)
-  set(CMAKE_SKIP_BUILD_RPATH TRUE)
-else(FORCE_SKIP_RPATH)
-  set(CMAKE_SKIP_BUILD_RPATH FALSE)
-endif(FORCE_SKIP_RPATH)
-
-# when building, don't use the install RPATH already
-# (but later on when installing)
-set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-
-# the RPATH to be used when installing
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-
-# don't add the automatically determined parts of the RPATH
-# which point to directories outside the build tree to the install RPATH
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+# # =========== RPATH stuff ===========
+# # we follow recommendation of https://cmake.org/Wiki/CMake_RPATH_handling
+
+if(APPLE)
+  set(CMAKE_MACOSX_RPATH TRUE)
+
+# The following settings were copied from
+# https://cmake.org/Wiki/CMake_RPATH_handling
+# to avoid the rpath issue that appears on OS X El Capitan
+
+  # use, i.e. don't skip the full RPATH for the build tree
+  set(CMAKE_SKIP_BUILD_RPATH  FALSE)
+
+  # when building, don't use the install RPATH already
+  # (but later on when installing)
+  set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) # Changed to TRUE by A.O.
+
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+
+  # add the automatically determined parts of the RPATH
+  # which point to directories outside the build tree to the install RPATH
+  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
+  # the RPATH to be used when installing, but only if it's not a system directory
+  list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
+  if("${isSystemDir}" STREQUAL "-1")
+     set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+  endif("${isSystemDir}" STREQUAL "-1")
+endif()

 # init all common options for enabled components
 set(common_options DOCUMENTATION TESTING UNSTABLE PYTHON_WRAPPER


CMake: extended ivw_project to support forwarding of programming language

* removed Inviwo library dir from global lib directory list

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -39,7 +39,7 @@
 # _cpackName -> modules or qt_modules if QT
 # _pchDisabledForThisModule -> FALSE
 macro(ivw_project project_name)
-    project(${project_name})
+    project(${project_name} ${ARGN})
     set(_projectName ${project_name})
     set(_allLibsDir "")
     set(_allDefinitions "")
@@ -639,8 +639,6 @@
 # Make package (with configure file etc)
 macro(ivw_make_package package_name project_name)
     ivw_private_install_package(${project_name})
-
-    list(APPEND _allLibsDir "${IVW_LIBRARY_DIR}")

     # Set up libraries
     if(WIN32 AND BUILD_SHARED_LIBS)


everything working except for installing python files...

git-svn-id: cf55bc44fb097054a32fc70455a459c940dbbffc@7809 c9849af7-e679-4ec6-a44e-fc146a885bd3

--- cmake/new_lcmtypes.cmake
+++ cmake/new_lcmtypes.cmake
@@ -32,10 +32,8 @@
 #
 #          After invoking this macro, the lcmtypes include directory will
 #          automatically be added, and the target variables will be set:
-#             LCMTYPES_C_TARGET
 #             LCMTYPES_C_LIBRARY
-#             LCMTYPES_CPP_TARGET
-#             LCMTYPES_JAVA_TARGET
+#             LCMTYPES_JAR
 #
 # C
 # ==
@@ -95,9 +93,9 @@
   return()
 endif()

-set(LCMTYPES_DIR ${CMAKE_CURRENT_BINARY_DIR}/lcmtypes)
+set(LCMTYPES_DIR ${CMAKE_CURRENT_BINARY_DIR}/lcmgen/lcmtypes)
 execute_process(COMMAND mkdir -p ${LCMTYPES_DIR})
-include_directories(${LCMTYPES_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/lcmgen/)  # so people include with e.g. <lcmtypes/pod.h>

 set(LCMTYPES_SEARCHDIR ${CMAKE_SOURCE_DIR}/lcmtypes)

@@ -133,6 +131,7 @@
   if (LCMTYPES_C_SOURCEFILES)
     list(REMOVE_DUPLICATES LCMTYPES_C_SOURCEFILES)
     add_library(${LCMTYPES_C_LIBNAME} ${LCMTYPES_C_SOURCEFILES})
+    pods_use_pkg_config_packages(${LCMTYPES_C_LIBNAME} lcm)

     # create a header file aggregating all of the autogenerated .h files
     set(__agg_h_fname "${LCMTYPES_DIR}/${__sanitized_project_name}.h")
@@ -148,7 +147,7 @@

     add_custom_command(OUTPUT ${__agg_h_fname}
       COMMAND echo "${__h_str}" ">" "${__agg_h_fname}"
-      DEPENDS ${LCMTYPES_CPP_SOURCEFILES}
+      DEPENDS ${LCMTYPES_C_SOURCEFILES}
       VERBATIM
     )

@@ -164,7 +163,6 @@

   endif()

-  set(LCMTYPES_C_TARGET lcmtype_agg_h ${LCMTYPES_C_LIBNAME})
   set(LCMTYPES_C_LIBRARY ${LCMTYPES_C_LIBNAME})
 endmacro()

@@ -211,7 +209,6 @@

   endif()

-  set(LCMTYPES_CPP_TARGET lcmtype_agg_hpp)
 endmacro()

 macro(lcmtypes_build_java)
@@ -244,7 +241,26 @@
     	VERSION 0.0.0)
   endif()

-  set(LCMTYPES_JAVA_TARGET ${LCMTYPES_JARNAME})
+  set(LCMTYPES_JAR ${LCMTYPES_JARNAME})
+endmacro()
+
+macro(lcmtypes_build_python)
+  find_lcmtypes(_msgs)
+  foreach(_msg ${_msgs})
+    add_python_lcmtype(${_msg})
+  endforeach()
+
+  if (LCMTYPES_PYTHON_FILES)
+    list(REMOVE_DUPLICATES LCMTYPES_PYTHON_FILES)
+
+    # add a custom target to force generation
+    add_custom_target(lcmtypes_py ALL
+      DEPENDS ${LCMTYPES_PYTHON_FILES})
+
+    # todo: install python files (but the below will fail because the files don't exist yet!)
+    #pods_install_python_packages(${LCMTYPES_DIR})
+  endif()
+
 endmacro()

@@ -256,7 +272,7 @@

   lcmtypes_build_java(${ARGV})

-#  todo: handle python
+  lcmtypes_build_python(${ARGV})

 endmacro()

@@ -272,7 +288,8 @@
   # creates variable ${_package_name}
   # todo: make this more robust

-  execute_process(COMMAND sed -n -e "s/^.*package *\\(.*\\); *$/\\1/p" "${lcmtype}" OUTPUT_VARIABLE _package_name OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND sed -n -e "s/^.*package[[:space:]]*\\(.*\\);[[:space:]]*$/\\1/p" "${lcmtype}" OUTPUT_VARIABLE _package_name OUTPUT_STRIP_TRAILING_WHITESPACE)
+
 endmacro()

 function(add_c_lcmtype lcmtype)
@@ -285,7 +302,7 @@
   endif()
   set(lcmtype_w_package "${package_prefix}${lcmtype_we}")

-  add_custom_command(OUTPUT "${LCMTYPES_DIR}/${lcmtype_w_package}.c" "${LCMTYPES_DIR}/${lcmtype_w_package}.h" PRE_LINK
+  add_custom_command(OUTPUT "${LCMTYPES_DIR}/${lcmtype_w_package}.c" "${LCMTYPES_DIR}/${lcmtype_w_package}.h"
   		     COMMAND "${LCM_GEN_EXECUTABLE}" --c "${lcmtype}"
 		     DEPENDS ${lcmtype}
 		     WORKING_DIRECTORY ${LCMTYPES_DIR})
@@ -318,16 +335,38 @@
   if (_package_name)
     string(REPLACE "." "/" package_prefix "${_package_name}")
     set(package_prefix "${package_prefix}/")
+  else()
+    set(package_prefix "lcmtypes/")   # default package
   endif()
   set(lcmtype_w_package "${package_prefix}${lcmtype_we}")

-  add_custom_command(OUTPUT "${LCMTYPES_DIR}/${lcmtype_w_package}.java" PRE_LINK
-  		     COMMAND "${LCM_GEN_EXECUTABLE}" --java "${lcmtype}"
+  add_custom_command(OUTPUT "${LCMTYPES_DIR}/${lcmtype_w_package}.java"
+  		     COMMAND "${LCM_GEN_EXECUTABLE}" --jdefaultpkg "lcmtypes" --java "${lcmtype}"
 		     DEPENDS ${lcmtype}
 		     WORKING_DIRECTORY ${LCMTYPES_DIR})
   set(LCMTYPES_JAVA_SOURCEFILES ${LCMTYPES_JAVA_SOURCEFILES} "${LCMTYPES_DIR}/${lcmtype_w_package}.java" PARENT_SCOPE)

 endfunction()
+
+function(add_python_lcmtype lcmtype)
+  get_filename_component(lcmtype ${lcmtype} ABSOLUTE)
+  get_filename_component(lcmtype_we ${lcmtype} NAME_WE)
+  get_package_name(${lcmtype})
+  if (_package_name)
+    string(REPLACE "." "/" package_prefix "${_package_name}")
+    set(package_prefix "${package_prefix}/")
+  endif()
+  set(lcmtype_w_package "${package_prefix}${lcmtype_we}")
+
+  add_custom_command(OUTPUT "${LCMTYPES_DIR}/${lcmtype_w_package}.py"
+      		     COMMAND "${LCM_GEN_EXECUTABLE}" --python "${lcmtype}"
+		     DEPENDS ${lcmtype}
+		     WORKING_DIRECTORY ${LCMTYPES_DIR})
+
+  set(LCMTYPES_PYTHON_FILES ${LCMTYPES_PYTHON_FILES} "${LCMTYPES_DIR}/${lcmtype_w_package}.py" PARENT_SCOPE)
+endfunction()
+
+

 function(add_lcmtype)
   add_c_lcmtype(${ARGV})
@@ -339,7 +378,7 @@
   add_java_lcmtype(${ARGV})
   set(LCMTYPES_JAVA_SOURCEFILES ${LCMTYPES_JAVA_SOURCEFILES} PARENT_SCOPE)

-# todo: handle python
-#  add_python_lcmtype(${ARGV})
-endfunction()
-
+  add_python_lcmtype(${ARGV})
+  set(LCMTYPES_PYTHON_FILES ${LCMTYPES_PYTHON_FILES} PARENT_SCOPE)
+endfunction()
+


fix debug package filenames

fix debug package filenames

--- cmake/packages/deb.cmake
+++ cmake/packages/deb.cmake
@@ -59,7 +59,7 @@
 set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARANGODB_PACKAGE_ARCHITECTURE})
 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}")

-set(ARANGODB_DBG_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}")
+set(ARANGODB_DBG_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-dbg-${CPACK_PACKAGE_VERSION}-${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}")

 set(conffiles_list "")
 if ("${INSTALL_CONFIGFILES_LIST}" STREQUAL "")


Allow packaging if TCL OR Python wrapping is enabled.

--- VTKCPack.cmake
+++ VTKCPack.cmake
@@ -8,7 +8,7 @@
     # For now, only build the CPack installer if vtk(.exe) will be available for
     # installation:
     #
-    IF(VTK_WRAP_TCL)
+    IF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON)
       SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VTK - The Visualization Toolkit")
       SET(CPACK_PACKAGE_VENDOR "Kitware, Inc.")
       SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
@@ -33,7 +33,7 @@
       ENDIF(WIN32)

       INCLUDE(CPack)
-    ENDIF(VTK_WRAP_TCL)
+    ENDIF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON)

   ENDIF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
 ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")