Windows ok

Windows ok

--- blocks/boost/install/install.cmake
+++ blocks/boost/install/install.cmake
@@ -1,305 +1,301 @@
-include(boost/install/utils)
-include(CMakeParseArguments)
-
-
-function(BII_BOOST_PRINT_SETUP)
-    message(STATUS "Boost version: ${BII_BOOST_VERSION}")
-    message(STATUS "Libraries: ${BII_BOOST_LIBS}")
-    message(STATUS "Upstream URL: ${BII_BOOST_DOWNLOAD_URL}")
-    message(STATUS "Package: ${BII_BOOST_PACKAGE}")
-    message(STATUS "Path to package: ${BII_BOOST_PACKAGE_PATH}")
-    message(STATUS "Boost directory: ${BII_BOOST_DIR}")
-    message(STATUS "Toolset: ${BII_BOOST_TOOLSET}")
-    message(STATUS "Bootstrapper: ${__BII_BOOST_BOOSTRAPER}")
-endfunction()
-
-function(BII_BOOST_INSTALL_SETUP)
-    #Misc
-    set(__BII_BOOST_VERSION_DEFAULT 1.57.0)
-
-    #Lets go!
-    message(STATUS "Setting up biicode Boost configuration...")
-
-    if(NOT (BII_BOOST_VERSION))
-        if(BII_BOOST_VERBOSE)
-            message(STATUS "BII_BOOST_VERSION not specified. Using Boost ${__BII_BOOST_VERSION_DEFAULT}")
-        endif()
-
-        set(BII_BOOST_VERSION ${__BII_BOOST_VERSION_DEFAULT} CACHE INTERNAL "Biicode boost version")
-    endif()
-
-    string(REGEX REPLACE  "[.]" "_" __BII_BOOST_VERSION_LABEL ${BII_BOOST_VERSION})
-
-    #Download and install
-    set(BII_BOOST_INSTALL_DIR ${BIICODE_ENV_DIR}/boost/${BII_BOOST_VERSION}            CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} install directory")
-    set(BII_BOOST_DIR ${BII_BOOST_INSTALL_DIR}                                         CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} base directory")
-    set(__BII_BOOST_TMPDIR ${BIICODE_ENV_DIR}/tmp/boost/${BII_BOOST_VERSION}           CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} temporal directory used during install")
-    set(BII_BOOST_EXTRACT_DIR ${__BII_BOOST_TMPDIR}/boost_${__BII_BOOST_VERSION_LABEL} CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} package extraction directory")
-
-    if(NOT (EXISTS __BII_BOOST_TMPDIR))
-        file(MAKE_DIRECTORY "${__BII_BOOST_TMPDIR}")
-    endif()
-
-    if(NOT (EXISTS ${BIICODE_ENV_DIR}/boost/))
-        file(MAKE_DIRECTORY "${BIICODE_ENV_DIR}/boost/")
-    endif()
-
-    if(CMAKE_SYSTEM_NAME MATCHES "Windows")
-        set(__BII_BOOST_PACKAGE_TYPE zip)
-    else()
-        set(__BII_BOOST_PACKAGE_TYPE tar.gz)
-    endif()
-
-    set(BII_BOOST_PACKAGE boost_${__BII_BOOST_VERSION_LABEL}.${__BII_BOOST_PACKAGE_TYPE}                                     CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} package")
-    set(BII_BOOST_PACKAGE_PATH ${__BII_BOOST_TMPDIR}/${BII_BOOST_PACKAGE}                                                    CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} package download destination")
-    set(BII_BOOST_DOWNLOAD_URL "http://sourceforge.net/projects/boost/files/boost/${BII_BOOST_VERSION}/${BII_BOOST_PACKAGE}" CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} package upstream URL")
-
-    #Bootstrap
-    if(CMAKE_SYSTEM_NAME MATCHES "Windows")
-        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.bat CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} boostrap file")
-        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2.exe        CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build file")
-        set(__DYNLIB_EXTENSION     .dll                           CACHE INTERNAL "dynamic library extension")
-    elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.sh CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} boostrap file")
-        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2           CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build file")
-        set(__DYNLIB_EXTENSION     .dylib                        CACHE INTERNAL "dynamic library extension")
-    elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
-        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.sh CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} boostrap file")
-        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2           CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build file")
-        set(__DYNLIB_EXTENSION     .so                           CACHE INTERNAL "dynamic library extension")
-    else()
-        message(FATAL_ERROR "Unknown platform. Stopping Boost installation")
-    endif()
-
-    if(NOT (BII_BOOST_TOOLSET))
-        if(BII_BOOST_VERBOSE)
-            message(STATUS "BII_BOOST_TOOLSET not specified. Using ${CMAKE_CXX_COMPILER_ID} compiler")
-        endif()
-
-        BII_BOOST_COMPUTE_TOOLSET(__BII_BOOST_DEFAULT_TOOLSET)
-
-        set(BII_BOOST_TOOLSET ${__BII_BOOST_DEFAULT_TOOLSET} CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build toolset")
-    endif()
-
-    if(NOT (BII_BOOST_VARIANT))
-        if(NOT CMAKE_BUILD_TYPE)
-            set(CMAKE_BUILD_TYPE Release)
-        endif()
-
-        if(BII_BOOST_VERBOSE)
-            message(STATUS "BII_BOOST_VARIANT not specified. Using ${CMAKE_BUILD_TYPE} variant")
-        endif()
-
-        string(TOLOWER ${CMAKE_BUILD_TYPE} BII_BOOST_VARIANT)
-    endif()
-
-    #Build
-    if(NOT (BII_BOOST_BUILD_J))
-        if(BII_BOOST_VERBOSE)
-            message(STATUS "BII_BOOST_BUILD_J not specified. Parallel build disabled")
-        endif()
-
-        set(BII_BOOST_BUILD_J 1 CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build threads count")
-    endif()
-
-    set(__BII_BOOST_BOOTSTRAP_CALL ${__BII_BOOST_BOOSTRAPER} --prefix=${BII_BOOST_DIR}
-                                   CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} boostrap call")
-
-    set(__BII_BOOST_B2_CALL        ${__BII_BOOST_B2} --includedir=${BII_BOOST_DIR}
-                                                     --toolset=${BII_BOOST_TOOLSET}
-                                                     -j${BII_BOOST_BUILD_J}
-                                                     --layout=versioned
-                                                     --build-type=complete
-                                   CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} b2 call")
-endfunction()
-
-
-function(BII_BOOST_DOWNLOAD)
-    if(NOT (EXISTS ${BII_BOOST_PACKAGE_PATH}))
-        message(STATUS "Downloading Boost ${BII_BOOST_VERSION} from ${BII_BOOST_DOWNLOAD_URL}...")
-
-        file(DOWNLOAD "${BII_BOOST_DOWNLOAD_URL}" "${BII_BOOST_PACKAGE_PATH}" SHOW_PROGRESS STATUS RESULT)
-    else()
-        if(BII_BOOST_VERBOSE)
-            message(STATUS "Download aborted. ${BII_BOOST_PACKAGE} was downloaded previously")
-        endif()
-    endif()
-
-
-    if(NOT (EXISTS ${BII_BOOST_DIR}))
-        message(STATUS "Extracting Boost ${BII_BOOST_VERSION} (${BII_BOOST_PACKAGE} in ${BII_BOOST_PACKAGE_PATH})...")
-
-        execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf "${BII_BOOST_PACKAGE_PATH}" WORKING_DIRECTORY ${__BII_BOOST_TMPDIR})
-
-        file(RENAME "${BII_BOOST_EXTRACT_DIR}" "${BII_BOOST_INSTALL_DIR}")
-    endif()
-endfunction()
-
-function(BII_BOOST_BOOTSTRAP)
-    if((NOT (EXISTS ${__BII_BOOST_B2})) OR (${BII_BOOST_BOOTSTRAP_FORCE}))
-        message(STATUS "Bootstrapping Boost ${BII_BOOST_VERSION}...")
-
-        execute_process(COMMAND ${__BII_BOOST_BOOTSTRAP_CALL} WORKING_DIRECTORY ${BII_BOOST_DIR}
-                        RESULT_VARIABLE Result OUTPUT_VARIABLE Output ERROR_VARIABLE Error)
-        if(NOT Result EQUAL 0)
-            message(FATAL_ERROR "Failed running ${__BII_BOOST_BOOTSTRAP_CALL}:\n${Output}\n${Error}\n")
-        endif()
-    else()
-        if(BII_BOOST_VERBOSE)
-            message(STATUS "Boost bootstrapping aborted! b2 file already exists. Set BII_BOOST_BOOTSTRAP_FORCE to override")
-        endif()
-    endif()
-endfunction()
-
-function(BII_BOOST_BUILD)
-    if(BII_BOOST_LIBS)
-        message(STATUS "Building Boost ${BII_BOOST_VERSION} components with toolset ${BII_BOOST_TOOLSET}...")
-    endif()
-
-    foreach(lib ${BII_BOOST_LIBS})
-        message(STATUS "Building ${lib} library...")
-
-        set(__BII_BOOST_B2_CALL_EX ${__BII_BOOST_B2_CALL} --with-${lib})
-
-        execute_process(COMMAND ${__BII_BOOST_B2_CALL_EX} WORKING_DIRECTORY ${BII_BOOST_DIR}
-                        RESULT_VARIABLE Result OUTPUT_VARIABLE Output ERROR_VARIABLE Error)
-        if(NOT Result EQUAL 0)
-            message(FATAL_ERROR "Failed running ${__BII_BOOST_B2_CALL}:\n${Output}\n${Error}\n")
-        endif()
-
-        if(WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "Darwin"))
-            file(GLOB __dlls "${BII_BOOST_DIR}/stage/lib/*${__DYNLIB_EXTENSION}")
-
-            foreach(dll ${__dlls})
-                if(BII_BOOST_VERBOSE)
-                    message(STATUS "Copying ${dll} to project bin/ directory (${CMAKE_SOURCE_DIR}/../bin/)...")
-                endif()
-
-                file(COPY ${dll} DESTINATION ${CMAKE_SOURCE_DIR}/../bin/)
-            endforeach()
-        endif()
-    endforeach()
-endfunction()
-
-function(BII_BOOST_INSTALL)
-    BII_BOOST_INSTALL_SETUP()
-
-    if(BII_BOOST_VERBOSE)
-        BII_BOOST_PRINT_SETUP()
-    endif()
-
-    BII_BOOST_DOWNLOAD()
-    BII_BOOST_BOOTSTRAP()
-    BII_BOOST_BUILD()
-
-    set(BOOST_ROOT       "${BII_BOOST_DIR}"         CACHE INTERNAL "Boost root directory")
-    set(BOOST_INCLUDEDIR "${BOOST_ROOT}"            CACHE INTERNAL "Boost include directory")
-    set(BOOST_LIBRARYDIR "${BOOST_ROOT}/stage/lib/" CACHE INTERNAL "Boost library directory")
-
-
-    # CMake 3.1 on windows does not search for Boost 1.57.0 by default, this is a workaround
-    set(Boost_ADDITIONAL_VERSIONS ${BII_BOOST_VERSION} CACHE INTERNAL "")
-    # Disable searching on system Boost
-    set(Boost_NO_SYSTEM_PATHS TRUE CACHE INTERNAL "")
-
-    if(BII_BOOST_VERBOSE)
-        message(STATUS ">>>> Patching ${CMAKE_CXX_COMPILER_ID}...")
-        message(STATUS ">>>> ${CMAKE_SYSTEM_NAME}")
-    endif()
-
-    # FindBoost auto-compute does not care about Clang?
-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-        if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin"))
-            COMPILER_VERSION(__clang_version)
-            string(REGEX REPLACE "([0-9])\\.([0-9])" "\\1\\2" __clang_version ${__clang_version})
-
-            set(Boost_COMPILER "-clang${__clang_version}" CACHE INTERNAL "Boost library suffix")
-        else()
-            file(GLOB __clang_libs RELATIVE "${BII_BOOST_DIR}/stage/lib/" "${BII_BOOST_DIR}/stage/lib/*clang*")
-
-            if(__clang_libs)
-                list(GET __clang_libs 0 __clang_lib)
-
-                if(BII_BOOST_VERBOSE)
-                    foreach(lib ${__clang_libs})
-                        message(STATUS ">>>> ${lib}")
-                    endforeach()
-
-                    message(STATUS ">>> Suffix source: ${__clang_lib}")
-                endif()
-
-                string(REGEX REPLACE ".*(-clang-darwin[0-9]+).*" "\\1" __suffix ${__clang_lib})
-
-                if(BII_BOOST_VERBOSE)
-                    message(STATUS ">>>> Suffix: ${__suffix}")
-                endif()
-
-                set(Boost_COMPILER ${__suffix} CACHE INTERNAL "Boost library suffix")
-            else()
-                message(FATAL_ERROR "Unable to compute Boost compiler suffix from Clang libraries names")
-            endif()
-        endif()
-
-        if(BII_BOOST_VERBOSE)
-            message(STATUS ">>>> Setting Boost_COMPILER suffix manually for clang: ${Boost_COMPILER}")
-        endif()
-    endif()
-
-    find_package(Boost)
-    if(Boost_FOUND)
-        include_directories(${Boost_INCLUDE_DIR})
-
-        if(MSVC)
-            #Disable auto-linking with MSVC
-            add_definitions(-DBOOST_ALL_NO_LIB)
-        endif()
-
-        #Use static linking if not specified
-        if(NOT (DEFINED Boost_USE_STATIC_LIBS))
-            if(BII_BOOST_VERBOSE)
-                message(STATUS "Boost_USE_STATIC_LIBS not set. Setting static linking by default")
-            endif()
-
-            set(Boost_USE_STATIC_LIBS ON PARENT_SCOPE)
-        endif()
-
-        add_definitions( "-DHAS_BOOST" )
-    else()
-        message(FATAL_ERROR "Boost not found after biicode setup!")
-    endif()
-endfunction()
-
-function(BII_FIND_BOOST)
-    set(options REQUIRED)
-    set(oneValueArgs VERSION TOOLSET)
-    set(multiValueArgs COMPONENTS)
-    cmake_parse_arguments(BII_FIND_BOOST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-
-    if(BII_FIND_BOOST_VERSION)
-        set(BII_BOOST_VERSION ${BII_FIND_BOOST_VERSION})
-    endif()
-
-    if(BII_FIND_BOOST_TOOLSET)
-        set(BII_BOOST_TOOLSET ${BII_FIND_BOOST_TOOLSET})
-    endif()
-
-    set(BII_BOOST_LIBS ${BII_FIND_BOOST_COMPONENTS})
-
-    if(BII_FIND_BOOST_REQUIRED)
-        set(REQUIRED_FLAG "REQUIRED")
-    else()
-        set(REQUIRED_FLAG)
-    endif()
-
-    BII_BOOST_INSTALL()
-
-    if(BII_BOOST_VERBOSE)
-        message(STATUS "BOOST_ROOT       ${BOOST_ROOT}")
-        message(STATUS "BOOST_INCLUDEDIR ${BOOST_INCLUDEDIR}")
-        message(STATUS "BOOST_LIBRARYDIR ${BOOST_LIBRARYDIR}")
-    endif()
-
-    find_package(Boost COMPONENTS ${BII_FIND_BOOST_COMPONENTS} ${REQUIRED_FLAG})
-
-    set(Boost_LIBRARIES ${Boost_LIBRARIES} PARENT_SCOPE)
-endfunction()
+include(boost/install/utils)
+include(CMakeParseArguments)
+
+
+function(BII_BOOST_PRINT_SETUP)
+    message(STATUS "Boost version: ${BII_BOOST_VERSION}")
+    message(STATUS "Libraries: ${BII_BOOST_LIBS}")
+    message(STATUS "Upstream URL: ${BII_BOOST_DOWNLOAD_URL}")
+    message(STATUS "Package: ${BII_BOOST_PACKAGE}")
+    message(STATUS "Path to package: ${BII_BOOST_PACKAGE_PATH}")
+    message(STATUS "Boost directory: ${BII_BOOST_DIR}")
+    message(STATUS "Toolset: ${BII_BOOST_TOOLSET}")
+    message(STATUS "Bootstrapper: ${__BII_BOOST_BOOSTRAPER}")
+endfunction()
+
+function(BII_BOOST_INSTALL_SETUP)
+    #Misc
+    set(__BII_BOOST_VERSION_DEFAULT 1.57.0)
+
+    #Lets go!
+    message(STATUS "Setting up biicode Boost configuration...")
+
+    if(NOT (BII_BOOST_VERSION))
+        if(BII_BOOST_VERBOSE)
+            message(STATUS "BII_BOOST_VERSION not specified. Using Boost ${__BII_BOOST_VERSION_DEFAULT}")
+        endif()
+
+        set(BII_BOOST_VERSION ${__BII_BOOST_VERSION_DEFAULT} CACHE INTERNAL "Biicode boost version")
+    endif()
+
+    string(REGEX REPLACE  "[.]" "_" __BII_BOOST_VERSION_LABEL ${BII_BOOST_VERSION})
+
+    #Download and install
+    set(BII_BOOST_INSTALL_DIR ${BIICODE_ENV_DIR}/boost/${BII_BOOST_VERSION}            CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} install directory")
+    set(BII_BOOST_DIR ${BII_BOOST_INSTALL_DIR}                                         CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} base directory")
+    set(__BII_BOOST_TMPDIR ${BIICODE_ENV_DIR}/tmp/boost/${BII_BOOST_VERSION}           CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} temporal directory used during install")
+    set(BII_BOOST_EXTRACT_DIR ${__BII_BOOST_TMPDIR}/boost_${__BII_BOOST_VERSION_LABEL} CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} package extraction directory")
+
+    if(NOT (EXISTS __BII_BOOST_TMPDIR))
+        file(MAKE_DIRECTORY "${__BII_BOOST_TMPDIR}")
+    endif()
+
+    if(NOT (EXISTS ${BIICODE_ENV_DIR}/boost/))
+        file(MAKE_DIRECTORY "${BIICODE_ENV_DIR}/boost/")
+    endif()
+
+    if(CMAKE_SYSTEM_NAME MATCHES "Windows")
+        set(__BII_BOOST_PACKAGE_TYPE zip)
+    else()
+        set(__BII_BOOST_PACKAGE_TYPE tar.gz)
+    endif()
+
+    set(BII_BOOST_PACKAGE boost_${__BII_BOOST_VERSION_LABEL}.${__BII_BOOST_PACKAGE_TYPE}                                     CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} package")
+    set(BII_BOOST_PACKAGE_PATH ${__BII_BOOST_TMPDIR}/${BII_BOOST_PACKAGE}                                                    CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} package download destination")
+    set(BII_BOOST_DOWNLOAD_URL "http://sourceforge.net/projects/boost/files/boost/${BII_BOOST_VERSION}/${BII_BOOST_PACKAGE}" CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} package upstream URL")
+
+    #Bootstrap
+    if(CMAKE_SYSTEM_NAME MATCHES "Windows")
+        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.bat CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} boostrap file")
+        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2.exe        CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build file")
+        set(__DYNLIB_EXTENSION     .dll                           CACHE INTERNAL "dynamic library extension")
+    elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.sh CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} boostrap file")
+        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2           CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build file")
+        set(__DYNLIB_EXTENSION     .dylib                        CACHE INTERNAL "dynamic library extension")
+    elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
+        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.sh CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} boostrap file")
+        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2           CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build file")
+        set(__DYNLIB_EXTENSION     .so                           CACHE INTERNAL "dynamic library extension")
+    else()
+        message(FATAL_ERROR "Unknown platform. Stopping Boost installation")
+    endif()
+
+    if(NOT (BII_BOOST_TOOLSET))
+        if(BII_BOOST_VERBOSE)
+            message(STATUS "BII_BOOST_TOOLSET not specified. Using ${CMAKE_CXX_COMPILER_ID} compiler")
+        endif()
+
+        BII_BOOST_COMPUTE_TOOLSET(__BII_BOOST_DEFAULT_TOOLSET)
+
+        set(BII_BOOST_TOOLSET ${__BII_BOOST_DEFAULT_TOOLSET} CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build toolset")
+    endif()
+
+    if(NOT (BII_BOOST_VARIANT))
+        if(NOT CMAKE_BUILD_TYPE)
+            set(CMAKE_BUILD_TYPE Release)
+        endif()
+
+        if(BII_BOOST_VERBOSE)
+            message(STATUS "BII_BOOST_VARIANT not specified. Using ${CMAKE_BUILD_TYPE} variant")
+        endif()
+
+        string(TOLOWER ${CMAKE_BUILD_TYPE} BII_BOOST_VARIANT)
+    endif()
+
+    #Build
+    if(NOT (BII_BOOST_BUILD_J))
+        if(BII_BOOST_VERBOSE)
+            message(STATUS "BII_BOOST_BUILD_J not specified. Parallel build disabled")
+        endif()
+
+        set(BII_BOOST_BUILD_J 1 CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} build threads count")
+    endif()
+
+    set(__BII_BOOST_BOOTSTRAP_CALL ${__BII_BOOST_BOOSTRAPER} --prefix=${BII_BOOST_DIR}
+                                   CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} boostrap call")
+
+    set(__BII_BOOST_B2_CALL        ${__BII_BOOST_B2} --includedir=${BII_BOOST_DIR}
+                                                     --toolset=${BII_BOOST_TOOLSET}
+                                                     -j${BII_BOOST_BUILD_J}
+                                                     --layout=versioned
+                                                     --build-type=complete
+                                   CACHE INTERNAL "Biicode boost ${BII_BOOST_VERSION} b2 call")
+endfunction()
+
+
+function(BII_BOOST_DOWNLOAD)
+    if(NOT (EXISTS ${BII_BOOST_PACKAGE_PATH}))
+        message(STATUS "Downloading Boost ${BII_BOOST_VERSION} from ${BII_BOOST_DOWNLOAD_URL}...")
+
+        file(DOWNLOAD "${BII_BOOST_DOWNLOAD_URL}" "${BII_BOOST_PACKAGE_PATH}" SHOW_PROGRESS STATUS RESULT)
+    else()
+        if(BII_BOOST_VERBOSE)
+            message(STATUS "Download aborted. ${BII_BOOST_PACKAGE} was downloaded previously")
+        endif()
+    endif()
+
+
+    if(NOT (EXISTS ${BII_BOOST_DIR}))
+        message(STATUS "Extracting Boost ${BII_BOOST_VERSION} (${BII_BOOST_PACKAGE} in ${BII_BOOST_PACKAGE_PATH})...")
+
+        execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf "${BII_BOOST_PACKAGE_PATH}" WORKING_DIRECTORY ${__BII_BOOST_TMPDIR})
+
+        file(RENAME "${BII_BOOST_EXTRACT_DIR}" "${BII_BOOST_INSTALL_DIR}")
+    endif()
+endfunction()
+
+function(BII_BOOST_BOOTSTRAP)
+    if((NOT (EXISTS ${__BII_BOOST_B2})) OR (${BII_BOOST_BOOTSTRAP_FORCE}))
+        message(STATUS "Bootstrapping Boost ${BII_BOOST_VERSION}...")
+
+        execute_process(COMMAND ${__BII_BOOST_BOOTSTRAP_CALL} WORKING_DIRECTORY ${BII_BOOST_DIR}
+                        RESULT_VARIABLE Result OUTPUT_VARIABLE Output ERROR_VARIABLE Error)
+        if(NOT Result EQUAL 0)
+            message(FATAL_ERROR "Failed running ${__BII_BOOST_BOOTSTRAP_CALL}:\n${Output}\n${Error}\n")
+        endif()
+    else()
+        if(BII_BOOST_VERBOSE)
+            message(STATUS "Boost bootstrapping aborted! b2 file already exists. Set BII_BOOST_BOOTSTRAP_FORCE to override")
+        endif()
+    endif()
+endfunction()
+
+function(BII_BOOST_BUILD)
+    if(BII_BOOST_LIBS)
+        message(STATUS "Building Boost ${BII_BOOST_VERSION} components with toolset ${BII_BOOST_TOOLSET}...")
+    endif()
+
+    foreach(lib ${BII_BOOST_LIBS})
+        message(STATUS "Building ${lib} library...")
+
+        set(__BII_BOOST_B2_CALL_EX ${__BII_BOOST_B2_CALL} --with-${lib})
+
+        execute_process(COMMAND ${__BII_BOOST_B2_CALL_EX} WORKING_DIRECTORY ${BII_BOOST_DIR}
+                        RESULT_VARIABLE Result OUTPUT_VARIABLE Output ERROR_VARIABLE Error)
+        if(NOT Result EQUAL 0)
+            message(FATAL_ERROR "Failed running ${__BII_BOOST_B2_CALL}:\n${Output}\n${Error}\n")
+        endif()
+
+        if(WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "Darwin"))
+            file(GLOB __dlls "${BII_BOOST_DIR}/stage/lib/*${__DYNLIB_EXTENSION}")
+
+            foreach(dll ${__dlls})
+                if(BII_BOOST_VERBOSE)
+                    message(STATUS "Copying ${dll} to project bin/ directory (${CMAKE_SOURCE_DIR}/../bin/)...")
+                endif()
+
+                file(COPY ${dll} DESTINATION ${CMAKE_SOURCE_DIR}/../bin/)
+            endforeach()
+        endif()
+    endforeach()
+endfunction()
+
+function(BII_BOOST_INSTALL)
+    BII_BOOST_INSTALL_SETUP()
+
+    if(BII_BOOST_VERBOSE)
+        BII_BOOST_PRINT_SETUP()
+    endif()
+
+    BII_BOOST_DOWNLOAD()
+    BII_BOOST_BOOTSTRAP()
+    BII_BOOST_BUILD()
+
+    set(BOOST_ROOT       "${BII_BOOST_DIR}"         CACHE INTERNAL "Boost root directory")
+    set(BOOST_INCLUDEDIR "${BOOST_ROOT}"            CACHE INTERNAL "Boost include directory")
+    set(BOOST_LIBRARYDIR "${BOOST_ROOT}/stage/lib/" CACHE INTERNAL "Boost library directory")
+
+
+    # CMake 3.1 on windows does not search for Boost 1.57.0 by default, this is a workaround
+    set(Boost_ADDITIONAL_VERSIONS ${BII_BOOST_VERSION} CACHE INTERNAL "")
+    # Disable searching on system Boost
+    set(Boost_NO_SYSTEM_PATHS TRUE CACHE INTERNAL "")
+
+
+    # FindBoost auto-compute does not care about Clang?
+    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+        if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin"))
+            COMPILER_VERSION(__clang_version)
+            string(REGEX REPLACE "([0-9])\\.([0-9])" "\\1\\2" __clang_version ${__clang_version})
+
+            set(Boost_COMPILER "-clang${__clang_version}" CACHE INTERNAL "Boost library suffix")
+        else()
+            file(GLOB __clang_libs RELATIVE "${BII_BOOST_DIR}/stage/lib/" "${BII_BOOST_DIR}/stage/lib/*clang*")
+
+            if(__clang_libs)
+                list(GET __clang_libs 0 __clang_lib)
+
+                if(BII_BOOST_VERBOSE)
+                    message(STATUS ">>> Suffix source: ${__clang_lib}")
+                endif()
+
+                string(REGEX REPLACE ".*(-clang-darwin[0-9]+).*" "\\1" __suffix ${__clang_lib})
+
+                if(BII_BOOST_VERBOSE)
+                    message(STATUS ">>>> Suffix: ${__suffix}")
+                endif()
+
+                set(Boost_COMPILER ${__suffix} CACHE INTERNAL "Boost library suffix")
+            else()
+                message(FATAL_ERROR "Unable to compute Boost compiler suffix from Clang libraries names")
+            endif()
+        endif()
+
+        if(BII_BOOST_VERBOSE)
+            message(STATUS ">>>> Setting Boost_COMPILER suffix manually for clang: ${Boost_COMPILER}")
+        endif()
+    endif()
+
+    find_package(Boost)
+    if(Boost_FOUND)
+        include_directories(${Boost_INCLUDE_DIR})
+
+        if(MSVC)
+            #Disable auto-linking with MSVC
+            add_definitions(-DBOOST_ALL_NO_LIB)
+        endif()
+
+        if(BII_BOOST_VERBOSE)
+            message(STATUS ">>>> Boost_USE_STATIC_LIBS: ${Boost_USE_STATIC_LIBS}")
+        endif()
+
+        #Use static linking if not specified
+        if(NOT (DEFINED Boost_USE_STATIC_LIBS))
+            if(BII_BOOST_VERBOSE)
+                message(STATUS "Boost_USE_STATIC_LIBS not set. Setting static linking by default")
+            endif()
+
+            set(Boost_USE_STATIC_LIBS ON PARENT_SCOPE)
+        endif()
+
+        add_definitions( "-DHAS_BOOST" )
+    else()
+        message(FATAL_ERROR "Boost not found after biicode setup!")
+    endif()
+endfunction()
+
+function(BII_FIND_BOOST)
+    set(options REQUIRED)
+    set(oneValueArgs VERSION TOOLSET)
+    set(multiValueArgs COMPONENTS)
+    cmake_parse_arguments(BII_FIND_BOOST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+    if(BII_FIND_BOOST_VERSION)
+        set(BII_BOOST_VERSION ${BII_FIND_BOOST_VERSION})
+    endif()
+
+    if(BII_FIND_BOOST_TOOLSET)
+        set(BII_BOOST_TOOLSET ${BII_FIND_BOOST_TOOLSET})
+    endif()
+
+    set(BII_BOOST_LIBS ${BII_FIND_BOOST_COMPONENTS})
+
+    if(BII_FIND_BOOST_REQUIRED)
+        set(REQUIRED_FLAG "REQUIRED")
+    else()
+        set(REQUIRED_FLAG)
+    endif()
+
+    BII_BOOST_INSTALL()
+
+    if(BII_BOOST_VERBOSE)
+        message(STATUS "BOOST_ROOT       ${BOOST_ROOT}")
+        message(STATUS "BOOST_INCLUDEDIR ${BOOST_INCLUDEDIR}")
+        message(STATUS "BOOST_LIBRARYDIR ${BOOST_LIBRARYDIR}")
+    endif()
+
+    find_package(Boost COMPONENTS ${BII_FIND_BOOST_COMPONENTS} ${REQUIRED_FLAG})
+
+    set(Boost_LIBRARIES ${Boost_LIBRARIES} PARENT_SCOPE)
+endfunction()


nxp/fmuk66-v3: readd uavcan

nxp/fmuk66-v3: readd uavcan

 * this was accidentally dropped earlier this year

--- boards/nxp/fmuk66-v3/default.cmake
+++ boards/nxp/fmuk66-v3/default.cmake
@@ -48,6 +48,7 @@
 		telemetry # all available telemetry drivers
 		#test_ppm # NOT Portable YET
 		tone_alarm
+		uavcan

 	MODULES
 		attitude_estimator_q


cmake: Cleanup python install dir

cmake: Cleanup python install dir

--- cmake/DetectOptions.cmake
+++ cmake/DetectOptions.cmake
@@ -9,27 +9,62 @@
 # them, otherwise we disable it.  If explicitly ON then a failure to find
 # dependencies is an error,

-# Helper function to strip a common prefix off an input string
-function(string_strip_prefix in0 in1 outVar)
+# Helper function to extract a common prefix from two strings
+function(string_get_prefix in0 in1 outVar)
   string(LENGTH "${in0}" len0)
   string(LENGTH "${in1}" len1)
   set(lenMax ${len0})
   if(len1 LESS len0)
     set(lenMax ${len1})
   endif()
-  set(idxNoPfx 0)
+  set(lenPfx 0)
   if(lenMax GREATER 0)
     foreach(len RANGE 1 ${lenMax})
-      string(SUBSTRING "${in0}" 1 ${len} sub0)
-      string(SUBSTRING "${in1}" 1 ${len} sub1)
-      set(idxNoPfx ${len})
+      string(SUBSTRING "${in0}" 0 ${len} sub0)
+      string(SUBSTRING "${in1}" 0 ${len} sub1)
       if(NOT (sub0 STREQUAL sub1))
         break()
       endif()
+      set(lenPfx ${len})
     endforeach()
   endif()
-  string(SUBSTRING "${in0}" ${idxNoPfx} ${len0} outTmp)
+  string(SUBSTRING "${in0}" 0 ${lenPfx} outTmp)
   set(${outVar} "${outTmp}" PARENT_SCOPE)
+endfunction()
+
+# Helper function to strip a common prefix off an input string
+function(string_strip_prefix pfx in outVar)
+  string(LENGTH "${pfx}" lenPfx)
+  string(LENGTH "${in}" lenIn)
+  if(lenPfx GREATER lenIn)
+    set(${outVar} "" PARENT_SCOPE)
+    return()
+  endif()
+  string(SUBSTRING "${in}" 0 ${lenPfx} inPfx)
+  if(NOT pfx STREQUAL inPfx)
+    set(${outVar} "" PARENT_SCOPE)
+    return()
+  endif()
+  string(SUBSTRING "${in}" ${lenPfx} -1 outTmp)
+  set(${outVar} "${outTmp}" PARENT_SCOPE)
+endfunction()
+
+# Extract the common prefix from a collection of variables
+function(lists_get_prefix listVars outVar)
+  foreach(l IN LISTS listVars)
+    foreach(d IN LISTS ${l})
+      if(NOT prefix)
+        set(prefix "${d}")
+        continue()
+      endif()
+      string_get_prefix("${prefix}" "${d}" prefix)
+      if(NOT prefix)
+        set(${outVar} "" PARENT_SCOPE)
+        return()
+      endif()
+    endforeach()
+  endforeach()
+  set(${outVar} "${prefix}" PARENT_SCOPE)
 endfunction()

 # Blosc
@@ -239,8 +274,9 @@

 if(Python_Interpreter_FOUND)
   # Setup output directories
+  lists_get_prefix("Python_INCLUDE_DIRS;Python_LIBRARIES;Python_SITEARCH" _Python_DEVPREFIX)
   string_strip_prefix(
-    "${Python_SITEARCH}" "${Python_EXECUTABLE}" CMAKE_INSTALL_PYTHONDIR_DEFAULT
+    "${_Python_DEVPREFIX}" "${Python_SITEARCH}" CMAKE_INSTALL_PYTHONDIR_DEFAULT
   )
   set(CMAKE_INSTALL_PYTHONDIR "${CMAKE_INSTALL_PYTHONDIR_DEFAULT}"
     CACHE PATH "Install directory for python modules"


Add definition for SASL's callback_ft

Add definition for SASL's callback_ft

--- cmake/FindCyrusSASL.cmake
+++ cmake/FindCyrusSASL.cmake
@@ -48,6 +48,7 @@
     message(STATUS "Looking for sasl_callback_ft")
     try_compile(HAVE_SASL_CALLBACK_FT ${CMAKE_BINARY_DIR} "${CMAKE_SOURCE_DIR}/cmake/sasl_callback_ft.c")
     if (HAVE_SASL_CALLBACK_FT)
+        add_definitions("-DHAVE_SASL_CALLBACK_FT")
         message(STATUS "Looking for sasl_callback_ft.. Found")
     else()
         message(STATUS "Looking for sasl_callback_ft.. Not found")


set GSTREAMER_VERSION

set GSTREAMER_VERSION

svn path=/trunk/kdesupport/phonon/; revision=879853

--- cmake/FindGStreamer.cmake
+++ cmake/FindGStreamer.cmake
@@ -5,6 +5,7 @@
 #  GSTREAMER_INCLUDE_DIR - the GStreamer include directory
 #  GSTREAMER_LIBRARIES - the libraries needed to use GStreamer
 #  GSTREAMER_DEFINITIONS - Compiler switches required for using GStreamer
+#  GSTREAMER_VERSION - the version of GStreamer

 # Copyright (c) 2008 Helio Chissini de Castro, <helio@kde.org>
 #  (c)2006, Tim Beaulen <tbscope@gmail.com>
@@ -25,6 +26,7 @@
    # in the FIND_PATH() and FIND_LIBRARY() calls
    # don't make this check required - otherwise you can't use macro_optional_find_package on this one
    PKG_CHECK_MODULES(PKG_GSTREAMER gstreamer-0.10)
+   SET(GSTREAMER_VERSION ${PKG_GSTREAMER_VERSION})
    SET(GSTREAMER_DEFINITIONS ${PKG_GSTREAMER_CFLAGS})
 ENDIF (NOT WIN32)


CPack failsafe installation

CPack failsafe installation

--- cmake/MyPackagePack.cmake
+++ cmake/MyPackagePack.cmake
@@ -34,6 +34,47 @@
     #
     SET (CPACK_ARCHIVE_COMPONENT_INSTALL ON)
     #
+    # We want to recuperate some cmake variables to do a temporary install
+    # and the only way with via the CPackProperties.cmake file.
+    # This file must contain only CPack compatible commands -;
+    #
+    # Any variable starting with CPACK_ is exported to cpack...
+    #
+    SET (CPACK_PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR})
+    SET (CPACK_PROJECT_CONFIG_FILE "${PROJECT_SOURCE_DIR}/CPackCustomProjectConfig.cmake")
+    SET (CPACK_CMAKE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM})
+    SET (CPACK_TEMP_BASENAME "CpackTempDestdir")
+    SET (CPACK_TEMP_DIRNAME ${PROJECT_SOURCE_DIR})
+    SET (CPACK_TEMP_FULLPATH "${CPACK_TEMP_DIRNAME}/${CPACK_TEMP_BASENAME}")
+    #
+    # Generate CPACK_PROJECT_CONFIG_FILE
+    #
+    IF (EXISTS ${CPACK_PROJECT_CONFIG_FILE})
+      MESSAGE (STATUS "Removing ${CPACK_PROJECT_CONFIG_FILE}")
+      FILE (REMOVE ${CPACK_PROJECT_CONFIG_FILE})
+    ENDIF ()
+    MESSAGE (STATUS "Generating ${CPACK_PROJECT_CONFIG_FILE}")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "MESSAGE (STATUS \"Removing \${CPACK_TEMP_FULLPATH}\")\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "FILE (REMOVE_RECURSE \${CPACK_TEMP_FULLPATH})\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "MESSAGE (STATUS \"Installing to \${CPACK_TEMP_FULLPATH}\")\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "EXECUTE_PROCESS (COMMAND \${CPACK_CMAKE_MAKE_PROGRAM} install DESTDIR=\${CPACK_TEMP_BASENAME} WORKING_DIRECTORY \${CPACK_TEMP_DIRNAME})\n")
+    #
+    # Rework internal variables to avoid zombies
+    #
+    GET_CMAKE_PROPERTY(COMPONENTS _components)
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "SET (_component_ok_list)\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "FOREACH (_component IN LISTS CPACK_COMPONENTS_ALL)\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "  SET (_install_manifest__path \"\${CPACK_PROJECT_SOURCE_DIR}/install_manifest_\${_component}.txt\")\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "  IF (EXISTS \${_install_manifest__path})\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "    FILE( READ \${_install_manifest__path} _content HEX)\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "    STRING (LENGTH \"\${_content}\" _content_length)\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "    IF (\${_content_length} GREATER 0)\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "      LIST (APPEND _component_ok_list \${_component})\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "    ENDIF ()\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "  ENDIF ()\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "ENDFOREACH ()\n")
+    FILE (APPEND ${CPACK_PROJECT_CONFIG_FILE} "SET (CPACK_COMPONENTS_ALL \"\${_component_ok_list}\")\n")
+    #
     # Include CPack - from now on we will have access to CPACK own macros
     #
     INCLUDE (CPack)
@@ -191,6 +232,6 @@
       COMMENT "Packaging ${PROJECT_NAME}"
 	  DEPENDS man
       VERBATIM
-    )
+      )
   ENDIF ()
 ENDMACRO()


Fix linking problems.

Fix linking problems.

--- cmake/UseDOGeometry.cmake
+++ cmake/UseDOGeometry.cmake
@@ -9,9 +9,9 @@
 if (DO_USE_FROM_SOURCE)
   get_property(DO_Geometry_ADDED GLOBAL PROPERTY _DO_Geometry_INCLUDED)
   if (NOT DO_Geometry_ADDED)
+    do_glob_directory(${DO_SOURCE_DIR}/Geometry)
     do_create_common_variables("Geometry")
     do_set_internal_dependencies("Geometry" "Graphics")
-    do_glob_directory(${DO_SOURCE_DIR}/Geometry)
     do_generate_library("Geometry")
   endif ()
 endif ()


CMake: fix long lines

CMake: fix long lines

--- cmake/bitcode_rules.cmake
+++ cmake/bitcode_rules.cmake
@@ -41,7 +41,9 @@
         "${CMAKE_SOURCE_DIR}/include/pocl_types.h"
         "${CMAKE_SOURCE_DIR}/include/_kernel_c.h"
         ${KERNEL_DEPEND_HEADERS}
-        COMMAND "${CLANG}" ${CLANG_FLAGS} ${KERNEL_CL_FLAGS} ${DEVICE_CL_FLAGS} "-D__CBUILD__" "-o" "${BC_FILE}" "-c" "${FULL_F_PATH}" "-include" "${CMAKE_SOURCE_DIR}/include/_kernel_c.h"
+        COMMAND "${CLANG}" ${CLANG_FLAGS} ${KERNEL_CL_FLAGS} ${DEVICE_CL_FLAGS}
+        "-D__CBUILD__" "-o" "${BC_FILE}" "-c" "${FULL_F_PATH}"
+        "-include" "${CMAKE_SOURCE_DIR}/include/_kernel_c.h"
         COMMENT "Building C to LLVM bitcode ${BC_FILE}"
         VERBATIM)
 endfunction()
@@ -59,7 +61,8 @@
     add_custom_command(OUTPUT "${BC_FILE}"
         DEPENDS "${FULL_F_PATH}"
           ${KERNEL_DEPEND_HEADERS}
-        COMMAND  "${CLANGXX}" ${CLANG_FLAGS} ${KERNEL_CLANGXX_FLAGS} ${DEVICE_CL_FLAGS} "-o" "${BC_FILE}" "-c" "${FULL_F_PATH}"
+        COMMAND  "${CLANGXX}" ${CLANG_FLAGS} ${KERNEL_CLANGXX_FLAGS}
+        ${DEVICE_CL_FLAGS} "-o" "${BC_FILE}" "-c" "${FULL_F_PATH}"
         COMMENT "Building C++ to LLVM bitcode ${BC_FILE}"
         VERBATIM)
 endfunction()


Update script for resources export on exported targets.

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -153,6 +153,8 @@
             get_target_property(rscLocation ${lib} RADIUM_TARGET_INSTALLED_RESOURCES)
             message(STATUS " [configure_radium_app] Found lib ${lib} resources location to be : ${rscLocation} !" )
             list(APPEND depsRsc ${rscLocation})
+        else()
+            message(STATUS " [configure_radium_app] No resources for lib  ${lib} !" )
         endif ()
     endforeach()
     if (ARGS_USE_PLUGINS)
@@ -273,7 +275,51 @@
         )
     endforeach ()
 endfunction()
+
+
 # ------------------------------------------------------------------------------
+# Library configuration functions
+# ------------------------------------------------------------------------------
+
+# Add resources to an exported target
+# this will allow to access the resources in the installation tree of the exported target from any import of this target
+# To be called with
+# installTargetResources( TARGET theTarget
+#                  [PREFIX TargetResourcePathPrefix]
+# )
+#
+# The resources will be fetched from the target installation directory <prefix>/Resources
+# TODO modify the installation directory access to allow customisable install
+
+function(radium_exported_resources)
+    # parse and verify args
+    cmake_parse_arguments(
+        ARGS
+        ""  # no options
+        "TARGET;PREFIX;ACCESS_FROM_PACKAGE" # one value args
+        "" # no multivalued args
+        ${ARGN}
+    )
+    if (NOT ARGS_TARGET)
+        message(FATAL_ERROR " [radium_exported_resources] You must provide the target to configure")
+    endif ()
+    if (NOT ARGS_ACCESS_FROM_PACKAGE)
+        message(FATAL_ERROR " [radium_exported_resources] You must provide resource relative path access from the config package")
+    endif()
+    if (ARGS_PREFIX)
+        set(ARGS_PREFIX "${ARGS_PREFIX}")
+    else()
+        set(ARGS_PREFIX "")
+    endif ()
+    set_target_properties( ${ARGS_TARGET}
+        PROPERTIES
+        RADIUM_TARGET_RESOURCES_PREFIX ${ARGS_PREFIX}
+        )
+    set_target_properties( ${ARGS_TARGET}
+        PROPERTIES
+        RADIUM_TARGET_INSTALLED_RESOURCES "${CMAKE_CURRENT_LIST_DIR}/${ARGS_ACCESS_FROM_PACKAGE}/Resources/${ARGS_PREFIX}"
+        )
+endfunction()

 # Install resources for the target  theTarget:
 #    - Link( copy under window ) the resource dir DIRECTORY into the buildtree at the given BUILD_LOCATION
@@ -282,7 +328,7 @@
 # This function also define the custom properties RADIUM_RESOURCE_DIRECTORY and RADIUM_RESOURCE_FILES
 # for the given target with the corresponding value.
 # To be called with
-# installTargetResources( TARGET theTarget`
+# installTargetResources( TARGET theTarget
 #                  DIRECTORY theBaseResourceDirectory
 #                  [BUILD_LOCATION whereToLinkInTheBuildTree]
 #                  [PREFIX TargetResourcePathPrefix]
@@ -550,6 +596,43 @@

 include(CMakePackageConfigHelpers)
+
+# mandatory parameters :
+#   NAME : The name of the package to install
+#   PACKAGE_CONFIG : The package configuration file
+#
+# optional arguments
+#   PACKAGE_DIR : The directory in which the cmake package config file will be installed (default <prefix>/lib/cmake/Radium)
+function(configure_radium_package)
+    # parse and verify args
+    cmake_parse_arguments(
+        ARGS
+        ""  # no options
+        "NAME;PACKAGE_DIR;PACKAGE_CONFIG" # one value args
+        "" # no multivalued args
+        ${ARGN}
+    )
+    if (NOT ARGS_NAME)
+        message(FATAL_ERROR " [add_package] You must provide the package name")
+    endif ()
+    if (NOT ARGS_PACKAGE_DIR)
+        set(ARGS_PACKAGE_DIR lib/cmake/Radium)
+    endif ()
+    if (NOT ARGS_PACKAGE_CONFIG)
+        message(FATAL_ERROR " [add_package] You must provide the package config file")
+    endif ()
+    configure_file(${ARGS_PACKAGE_CONFIG}
+        "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_NAME}Config.cmake"
+        @ONLY
+        )
+    install(
+        FILES
+        "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_NAME}Config.cmake"
+        DESTINATION
+        ${ARGS_PACKAGE_DIR}
+    )
+endfunction()
+
 # mandatory parameters :
 #   TARGET : The name of the target to install
 #   FILES : The list of files (headers) to install
@@ -579,9 +662,6 @@
     if (NOT ARGS_NAMESPACE)
         set(ARGS_NAMESPACE "Radium")
     endif ()
-    if (NOT ARGS_PACKAGE_DIR)
-        set(ARGS_PACKAGE_DIR lib/cmake/Radium)
-    endif ()

     if (CMAKE_BUILD_TYPE STREQUAL "Debug")
         target_compile_definitions(${ARGS_TARGET}
@@ -604,7 +684,7 @@
         )
     message(STATUS " [configure_radium_library] Defining alias ${ARGS_NAMESPACE}::${ARGS_TARGET} for target ${ARGS_TARGET}")
     add_library(${ARGS_NAMESPACE}::${ARGS_TARGET} ALIAS ${ARGS_TARGET})
-    set(ConfigPackageLocation ${ARGS_PACKAGE_DIR})
+
     install(TARGETS ${ARGS_TARGET}
         EXPORT ${ARGS_TARGET}Targets
         CONFIGURATIONS ${CMAKE_BUILD_TYPE}
@@ -628,24 +708,23 @@
         "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TARGET}Targets.cmake"
         )
     # export for the installation tree
+    if (NOT ARGS_PACKAGE_DIR)
+        set(ARGS_PACKAGE_DIR lib/cmake/Radium)
+    endif ()
+
     install(EXPORT ${ARGS_TARGET}Targets
         FILE
         ${ARGS_TARGET}Targets.cmake
         NAMESPACE
         ${ARGS_NAMESPACE}::
         DESTINATION
-        ${ConfigPackageLocation}
+        ${ARGS_PACKAGE_DIR}
         )
     if (ARGS_PACKAGE_CONFIG)
-        configure_file(${ARGS_PACKAGE_CONFIG}
-            "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TARGET}Config.cmake"
-            @ONLY
-            )
-        install(
-            FILES
-            "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TARGET}Config.cmake"
-            DESTINATION
-            ${ConfigPackageLocation}
+        configure_radium_package(
+            NAME ${ARGS_TARGET}
+            PACKAGE_CONFIG ${ARGS_PACKAGE_CONFIG}
+            PACKAGE_DIR ${ARGS_PACKAGE_DIR}
         )
     endif ()
     foreach (file ${ARGS_FILES})
@@ -654,39 +733,3 @@
     endforeach ()
 endfunction()

-
-# mandatory parameters :
-#   NAME : The name of the package to install
-#   PACKAGE_CONFIG : The package configuration file
-#
-# optional arguments
-#   PACKAGE_DIR : The directory in which the cmake package config file will be installed (default <prefix>/lib/cmake/Radium)
-function(configure_radium_package)
-    # parse and verify args
-    cmake_parse_arguments(
-        ARGS
-        ""  # no options
-        "NAME;PACKAGE_DIR;PACKAGE_CONFIG" # one value args
-        "" # no multivalued args
-        ${ARGN}
-    )
-    if (NOT ARGS_NAME)
-        message(FATAL_ERROR " [add_package] You must provide the package name")
-    endif ()
-    if (NOT ARGS_PACKAGE_DIR)
-        set(ARGS_PACKAGE_DIR lib/cmake/Radium)
-    endif ()
-    if (NOT ARGS_PACKAGE_CONFIG)
-        message(FATAL_ERROR " [add_package] You must provide the package config file")
-    endif ()
-    configure_file(${ARGS_PACKAGE_CONFIG}
-        "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_NAME}Config.cmake"
-        @ONLY
-        )
-    install(
-        FILES
-        "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_NAME}Config.cmake"
-        DESTINATION
-        ${ARGS_PACKAGE_DIR}
-    )
-endfunction()


refs #5127 add a couple jemalloc opts

refs #5127 add a couple jemalloc opts

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@50828 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuThirdParty.cmake
+++ cmake_modules/TokuThirdParty.cmake
@@ -8,7 +8,7 @@
 if (NOT EXISTS "${JEMALLOC_SOURCE_DIR}/configure")
   message(FATAL_ERROR "Can't find jemalloc sources.  Please check them out to ${JEMALLOC_SOURCE_DIR} or modify TOKU_SVNROOT (${TOKU_SVNROOT}) or JEMALLOC_SOURCE_DIR.")
 endif ()
-set(jemalloc_configure_opts "CC=${CMAKE_C_COMPILER}" "--with-private-namespace=tokudb_jemalloc_internal_")
+set(jemalloc_configure_opts "CC=${CMAKE_C_COMPILER}" "--with-jemalloc-prefix=" "--with-private-namespace=tokudb_jemalloc_internal_" "--enable-cc-silence")
 if (NOT CMAKE_BUILD_TYPE MATCHES Release)
   list(APPEND jemalloc_configure_opts --enable-debug)
 endif ()


Use the new LLVM cmake paths

Use the new LLVM cmake paths

Update the paths that we look in for the cmake modules from LLVM which changed
recently on SVN trunk.  Check the old paths first, and if that fails, check the
new path.  This permits building against either layout.

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -147,11 +147,21 @@
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" "${${product}_NATIVE_LLVM_TOOLS_PATH}"
     NO_DEFAULT_PATH)

-  set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
-  list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
-
-  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
-  if(NOT EXISTS ${LLVMCONFIG_FILE})
+  set(LLVM_CMAKE_PATHS
+      "${LLVM_BINARY_DIR}/share/llvm/cmake"
+      "${LLVM_BINARY_DIR}/lib/cmake/llvm")
+
+  set(LLVMCONFIG_FILE)
+  foreach(CMAKE_PATH ${LLVM_CMAKE_PATHS})
+    list(APPEND CMAKE_MODULE_PATH "${CMAKE_PATH}")
+
+    if(EXISTS "${CMAKE_PATH}/LLVMConfig.cmake")
+      set(LLVMCONFIG_FILE "${CMAKE_PATH}/LLVMConfig.cmake")
+      break()
+    endif()
+  endforeach()
+
+  if(${LLVMCONFIG_FILE} STREQUAL "")
     message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
   endif()


Use find_package instead of include.

Use find_package instead of include.

rdar://27062396

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -34,7 +34,8 @@

   # Then we import LLVMConfig. This is going to override whatever cached value
   # we have for LLVM_ENABLE_ASSERTIONS.
-  include(LLVMConfig)
+  find_package(LLVM REQUIRED CONFIG
+    HINTS "${PATH_TO_LLVM_BUILD}" NO_DEFAULT_PATH)

   # If we did not have a cached value for LLVM_ENABLE_ASSERTIONS, set
   # LLVM_ENABLE_ASSERTIONS_saved to be the ENABLE_ASSERTIONS value from LLVM so
@@ -128,10 +129,9 @@
     list(APPEND CMAKE_MODULE_PATH ${path})
   endforeach()

-  # Then include ClangTargets.cmake. If Clang adds a ClangConfig.cmake, this is
-  # where it will be included. By including ClangTargets.cmake, we at least get
-  # the right dependency ordering for clang libraries.
-  include(ClangTargets)
+  # Then include Clang.
+  find_package(Clang REQUIRED CONFIG
+    HINTS "${PATH_TO_CLANG_BUILD}" NO_DEFAULT_PATH)

   if(NOT EXISTS "${PATH_TO_CLANG_SOURCE}/include/clang/AST/Decl.h")
     message(FATAL_ERROR "Please set ${product}_PATH_TO_CLANG_SOURCE to the root directory of Clang's source code.")


Added git details to coveralls upload

Added git details to coveralls upload

--- .cmake/Modules/CoverallsGenerateGcov.cmake
+++ .cmake/Modules/CoverallsGenerateGcov.cmake
@@ -90,7 +90,22 @@

 find_package(Git)

-# TODO: Add these git things to the coveralls json.
+set(JSON_REPO_TEMPLATE
+  "{
+    \"head\": {
+      \"id\": \"\@GIT_COMMIT_HASH\@\",
+      \"author_name\": \"\@GIT_AUTHOR_NAME\@\",
+      \"author_email\": \"\@GIT_AUTHOR_EMAIL\@\",
+      \"committer_name\": \"\@GIT_COMMITTER_NAME\@\",
+      \"committer_email\": \"\@GIT_COMMITTER_EMAIL\@\",
+      \"message\": \"\@GIT_COMMIT_MESSAGE\@\"
+    },
+    \"branch\": \"@GIT_BRANCH@\",
+    \"remotes\": []
+  }"
+)
+
+# TODO: Fill in git remote data
 if (GIT_FOUND)
 	# Branch.
 	execute_process(
@@ -114,6 +129,7 @@
 	git_log_format(cn GIT_COMMITTER_NAME)
 	git_log_format(ce GIT_COMMITTER_EMAIL)
 	git_log_format(B GIT_COMMIT_MESSAGE)
+	git_log_format(H GIT_COMMIT_HASH)

 	message("Git exe: ${GIT_EXECUTABLE}")
 	message("Git branch: ${GIT_BRANCH}")
@@ -121,8 +137,12 @@
 	message("Git e-mail: ${GIT_AUTHOR_EMAIL}")
 	message("Git commiter name: ${GIT_COMMITTER_NAME}")
 	message("Git commiter e-mail: ${GIT_COMMITTER_EMAIL}")
+	message("Git commit hash: ${GIT_COMMIT_HASH}")
 	message("Git commit message: ${GIT_COMMIT_MESSAGE}")

+	string(CONFIGURE ${JSON_REPO_TEMPLATE} JSON_REPO_DATA)
+else()
+	set(JSON_REPO_DATA "{}")
 endif()

 ############################# Macros #########################################
@@ -256,7 +276,8 @@
   \"repo_token\": \"\@JSON_REPO_TOKEN\@\",
   \"service_name\": \"\@JSON_SERVICE_NAME\@\",
   \"service_job_id\": \"\@JSON_SERVICE_JOB_ID\@\",
-  \"source_files\": \@JSON_GCOV_FILES\@
+  \"source_files\": \@JSON_GCOV_FILES\@,
+  \"git\": \@JSON_REPO_DATA\@
 }"
 )


neulib fix

neulib fix

--- neulib_com.cmake
+++ neulib_com.cmake
@@ -18,7 +18,7 @@
   message ("Configure args: ${config_args}")
   ExternalProject_Add(${libneurolabi_NAME}
     PREFIX              ${BUILDEM_DIR}
-    DEPENDS             depends_args
+    DEPENDS             ${depends_args}
     GIT_REPOSITORY      ${libneurolabi_URL}
     CONFIGURE_COMMAND   git checkout master
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} ${libneurolabi_SRC_DIR}/neurolabi/update_library ${config_args}


expat: update to 2.2.4

expat: update to 2.2.4

--- packages/expat.cmake
+++ packages/expat.cmake
@@ -1,7 +1,7 @@
 ExternalProject_Add(expat
     DEPENDS gcc
-    URL "http://download.sourceforge.net/expat/expat-2.2.3.tar.bz2"
-    URL_HASH SHA256=b31890fb02f85c002a67491923f89bda5028a880fd6c374f707193ad81aace5f
+    URL "http://download.sourceforge.net/expat/expat-2.2.4.tar.bz2"
+    URL_HASH SHA256=03ad85db965f8ab2d27328abcf0bc5571af6ec0a414874b2066ee3fdd372019e
     CONFIGURE_COMMAND ${EXEC} <SOURCE_DIR>/configure
         --host=${TARGET_ARCH}
         --prefix=${MINGW_INSTALL_PREFIX}


speex: update to 1.2.0

speex: update to 1.2.0

--- packages/speex.cmake
+++ packages/speex.cmake
@@ -1,7 +1,7 @@
 ExternalProject_Add(speex
     DEPENDS ogg
-    URL "http://downloads.xiph.org/releases/speex/speex-1.2rc2.tar.gz"
-    URL_HASH SHA256=caa27c7247ff15c8521c2ae0ea21987c9e9710a8f2d3448e8b79da9806bce891
+    URL "http://downloads.xiph.org/releases/speex/speex-1.2.0.tar.gz"
+    URL_HASH SHA256=eaae8af0ac742dc7d542c9439ac72f1f385ce838392dc849cae4536af9210094
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${EXEC}
         LIBS=-lwinmm


CMake: Target windows 7 by default.

CMake: Target windows 7 by default.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -62,6 +62,9 @@
 if (MSVC)
     set (DEST_BIN_DIR_CONFIG ${DEST_BIN_DIR_CONFIG}/$<CONFIG>)
     set (DEST_LIBRARY_DIR_CONFIG ${DEST_LIBRARY_DIR}/$<CONFIG>)
+endif ()
+if (WIN32)
+    add_definitions(-D_WIN32_WINNT=0x0601)
 endif ()

 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEST_BIN_DIR})


FindUmfPack: add AMD and COLAMD libraries only if they are found

--- cmake/FindUmfpack.cmake
+++ cmake/FindUmfpack.cmake
@@ -28,8 +28,8 @@
     find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
     if (AMD_LIBRARY)
       set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
-    else (AMD_LIBRARY)
-      set(UMFPACK_LIBRARIES FALSE)
+    #else (AMD_LIBRARY)
+    #  set(UMFPACK_LIBRARIES FALSE)
     endif (AMD_LIBRARY)

   endif(UMFPACK_LIBRARIES)
@@ -39,8 +39,8 @@
     find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
     if (COLAMD_LIBRARY)
       set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
-    else (COLAMD_LIBRARY)
-      set(UMFPACK_LIBRARIES FALSE)
+    #else (COLAMD_LIBRARY)
+    #  set(UMFPACK_LIBRARIES FALSE)
     endif (COLAMD_LIBRARY)

   endif(UMFPACK_LIBRARIES)


Fix FindUmfpack when specifying manually the related cmake variables.

--- cmake/FindUmfpack.cmake
+++ cmake/FindUmfpack.cmake
@@ -15,6 +15,8 @@
   suitesparse
   ufsparse
 )
+
+if(NOT UMFPACK_LIBRARIES)

 find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})

@@ -43,6 +45,7 @@

 endif(UMFPACK_LIBRARIES)

+endif()

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(UMFPACK DEFAULT_MSG


fixed unbound static lib on mingw as libunbound.dll.a

--- cmake/FindUnbound.cmake
+++ cmake/FindUnbound.cmake
@@ -38,7 +38,11 @@
 )

 if(STATIC)
-  find_library(UNBOUND_LIBRARIES libunbound.a)
+  if(MINGW)
+    find_library(UNBOUND_LIBRARIES libunbound.dll.a)
+  else()
+    find_library(UNBOUND_LIBRARIES libunbound.a)
+  endif()
 else()
   find_library(UNBOUND_LIBRARIES unbound)
 endif()


Fixed problem with backslashes in embedded build information.

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -108,9 +108,8 @@
 file(REMOVE "${OPENCV_BUILD_INFO_FILE}")
 function(ocv_output_status msg)
   message(STATUS "${msg}")
-  if(msg MATCHES "\"")
-    string(REPLACE "\"" "\\\"" msg "${msg}")
-  endif()
+  string(REPLACE "\\" "\\\\" msg "${msg}")
+  string(REPLACE "\"" "\\\"" msg "${msg}")
   file(APPEND "${OPENCV_BUILD_INFO_FILE}" "\"${msg}\\n\"\n")
 endfunction()


Small change, since addition of library flags is not platform dependent - test on Windows, should work on linux.

svn path=/trunk/; revision=7145

--- cmake/modules/cgm.cmake
+++ cmake/modules/cgm.cmake
@@ -37,7 +37,7 @@
   find_package(CD)
   if(CD_FOUND)
     set(cgm_COMPILE_FLAGS "-I${CD_INCLUDE_DIRS}")
-    set(cgm_LINK_FLAGS "-L${CD_LIBRARY_DIRS} -lcd")
+    set(cgm_LINK_FLAGS ${CD_LIBRARIES})
     set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${cgm_LINK_FLAGS})
   else(CD_FOUND)
     message(STATUS


Implement soft landing when PDL::GRAPHICS::PLplot is not installed.

svn path=/trunk/; revision=10359

--- cmake/modules/pdl.cmake
+++ cmake/modules/pdl.cmake
@@ -57,31 +57,44 @@
           "PDL version < 2.4.1. Disabling Perl/PDL examples in tests")
         set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
       else(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
-        message(STATUS
-	  "PDL version >= 2.4.1.  Enabling Perl/PDL examples in tests"
-	  )
         execute_process(
 	  COMMAND ${PERL_EXECUTABLE}
 	  -MPDL::Graphics::PLplot "-e print \"$PDL::Graphics::PLplot::VERSION\""
-          OUTPUT_VARIABLE PDL_PLPLOT_VERSION
-          ERROR_VARIABLE PDL_PLPLOT_VERSION
+	  RESULT_VARIABLE PDL_GRAPHICS_PLPLOT_RETURN_CODE
+          OUTPUT_QUIET
+          ERROR_QUIET
           )
-        message(STATUS "PDL_PLPLOT_VERSION = ${PDL_PLPLOT_VERSION}")
-        transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.47.0")
-        transform_version(NUMERICAL_PDL_PLPLOT_VERSION "${PDL_PLPLOT_VERSION}.0")
-	#message("NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION = ${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
-	#message("NUMERICAL_PDL_PLPLOT_VERSION = ${NUMERICAL_PDL_PLPLOT_VERSION}")
-        if(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
-          message(STATUS "WARNING: "
-            "perl PDL PLplot version < 0.47\n"
-            "   Using limited set of Perl/PDL examples that work with this old version")
-          set(HAVE_PDL_GRAPHICS_PLPLOT_40 OFF CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
-        else(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
-          message(STATUS
-            "perl PDL PLplot version >= 0.47\n"
-            "   Using full set of Perl/PDL examples that work with this version")
-          set(HAVE_PDL_GRAPHICS_PLPLOT_40 ON CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
-        endif(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+	if(NOT PDL_GRAPHICS_PLPLOT_RETURN_CODE)
+          message(STATUS
+	    "PDL version >= 2.4.1 and  PDL::Graphics::PLplot found."
+	    )
+          execute_process(
+	    COMMAND ${PERL_EXECUTABLE}
+	    -MPDL::Graphics::PLplot "-e print \"$PDL::Graphics::PLplot::VERSION\""
+            OUTPUT_VARIABLE PDL_PLPLOT_VERSION
+            ERROR_VARIABLE PDL_PLPLOT_VERSION
+            )
+          message(STATUS "PDL_PLPLOT_VERSION = ${PDL_PLPLOT_VERSION}")
+          transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.47.0")
+          transform_version(NUMERICAL_PDL_PLPLOT_VERSION "${PDL_PLPLOT_VERSION}.0")
+	  #message("NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION = ${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+	  #message("NUMERICAL_PDL_PLPLOT_VERSION = ${NUMERICAL_PDL_PLPLOT_VERSION}")
+          if(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+            message(STATUS "WARNING: "
+              "perl PDL PLplot version < 0.47\n"
+              "   Using limited set of Perl/PDL examples that work with this old version")
+            set(HAVE_PDL_GRAPHICS_PLPLOT_40 OFF CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
+          else(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+            message(STATUS
+              "perl PDL PLplot version >= 0.47\n"
+              "   Using full set of Perl/PDL examples that work with this version")
+            set(HAVE_PDL_GRAPHICS_PLPLOT_40 ON CACHE BOOL "PDL-Graphics-PLplot version is 0.47 or higher" FORCE)
+          endif(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+	else(NOT PDL_GRAPHICS_PLPLOT_RETURN_CODE)
+	  message(STATUS "WARNING: "
+	    "perl PDL::GRAPHICS_PLplot module not found. Disabling Perl/PDL examples")
+	  set(ENABLE_pdl OFF CACHE BOOL "Enable Perl/PDL examples in tests" FORCE)
+	endif(NOT PDL_GRAPHICS_PLPLOT_RETURN_CODE)
       endif(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
     else(NOT PDL_RETURNCODE)
       message(STATUS "WARNING: "


Fix issue 429

Fix issue 429

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@3411 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -530,7 +530,7 @@
             set(${SUBSYS_DEPENDS} ${DEPENDENCIES})
             foreach(dependee ${DEPENDENCIES})
                 string(TOUPPER "PCL_${dependee}_DEPENDIES" SUBSYS_DEPENDIES)
-                set(${SUBSYS_DEPENDIES} ${${SUBSYS_DEPENDIES}} ${subdir})
+                set(${SUBSYS_DEPENDIES} ${${SUBSYS_DEPENDIES}} ${name})
             endforeach(dependee)
         endif(NOT("${DEPENDENCIES}" STREQUAL ""))
     endforeach(subdir)


Use a full copy of FindICU.cmake to avoid symlink issues on Windows.

--- CoreFoundation/cmake/modules/FindICU.cmake
+++ CoreFoundation/cmake/modules/FindICU.cmake
@@ -0,0 +1,251 @@
+# Find libicu's libraries
+
+function(_icu_find)
+  set(icu_programs
+      gencnval icuinfo genbrk icu-config genrb gendict derb pkgdata uconv gencfu
+      makeconf gennorm2 genccode gensprep icupkg gencmn)
+  set(icu_data
+      Makefile.inc pkgdata.inc)
+
+  # Set up search paths, taking compiler into account.  Search ICU_ROOT, with
+  # ICU_ROOT in the environment as a fallback if unset.
+  if(ICU_ROOT)
+    list(APPEND icu_roots ${ICU_ROOT})
+  else()
+    if(NOT "$ENV{ICU_ROOT}" STREQUAL "")
+      file(TO_CMAKE_PATH "$ENV{ICU_ROOT}" NATIVE_PATH)
+      set(ICU_ROOT "${NATIVE_PATH}" CACHE PATH
+          "Location of the ICU installation" FORCE)
+      list(APPEND icu_roots ${NATIVE_PATH})
+    endif()
+  endif()
+
+  # Find the include directory.
+  list(APPEND icu_include_suffixes "include")
+  find_path(ICU_INCLUDE_DIR
+            NAMES "unicode/utypes.h"
+            HINTS ${icu_roots}
+            PATh_SUFFIXES ${icu_include_suffixes}
+            DOC "ICU include directory")
+  set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
+
+  # Get the version.
+  if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
+    file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
+         REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
+
+    string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
+          "\\1" icu_version_string "${icu_header_str}")
+    set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
+
+    unset(icu_header_str)
+    unset(icu_version_string)
+  endif()
+
+  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    set(_bin64 "bin64")
+    set(_lib64 "lib64")
+  endif()
+
+  # Find all ICU programs.
+  list(APPEND icu_binary_suffixes "${_bin64}" "bin" "sbin")
+  foreach(program ${icu_programs})
+    string(TOUPPER ${program} program_upcase)
+    set(cache_var "ICU_${program_upcase}_EXECUTABLE")
+    find_program(${cache_var} ${program}
+                 HINTS ${icu_roots}
+                 PATH_SUFFIXES ${icu_binary_suffixes}
+                 DOC "ICU ${program} executable")
+    mark_as_advanced(cache_var)
+    set(${cache_var} "${${cache_var}}" PARENT_SCOPE)
+  endforeach()
+
+  set(static_prefix )
+  if(MSVC)
+    set(static_prefix "s")
+  endif()
+
+  # Find all ICU libraries.
+  list(APPEND icu_library_suffixes "${_lib64}" "lib")
+  set(ICU_REQUIRED_LIBS_FOUND YES)
+  foreach(component ${ICU_FIND_COMPONENTS})
+    string(TOUPPER ${component} component_upcase)
+
+    set(component_cache "ICU_${component_upcase}_LIBRARY")
+    set(component_cache_release "${component_cache}_RELEASE")
+    set(component_cache_debug "${component_cache}_DEBUG")
+    set(component_found "${component_cache}_FOUND")
+
+    list(APPEND component_libnames "icu${component}")
+    list(APPEND component_debug_libnames "icu${component}d")
+    if(component STREQUAL data)
+      list(APPEND component_libnames icudt)
+      list(APPEND component_debug_libnames icudtd)
+    elseif(component STREQUAL dt)
+      list(APPEND component_libnames icudata)
+      list(APPEND component_debug_libnames icudatad)
+    elseif(component STREQUAL i18n)
+      list(APPEND component_libnames icuin)
+      list(APPEND component_debug_libnames icuind)
+    elseif(component STREQUAL in)
+      list(APPEND component_libnames icui18n)
+      list(APPEND component_debug_libnames icui18nd)
+    endif()
+
+    if(static_prefix)
+      unset(static_component_libnames)
+      foreach(component_libname ${component_libnames})
+        list(APPEND static_component_libnames
+             ${static_prefix}${component_libname})
+      endforeach()
+      list(APPEND component_libnames ${static_component_libnames})
+
+      unset(static_component_debug_libnames)
+      foreach(component_libname ${component_debug_libnames})
+        list(APPEND static_component_debug_libnames
+             ${static_prefix}${component_libname})
+      endforeach()
+      list(APPEND component_debug_libnames ${static_component_debug_libnames})
+    endif()
+
+    find_library(${component_cache_release} ${component_libnames}
+                 HINTS ${icu_roots}
+                 PATH_SUFFIXES ${icu_library_suffixes}
+                 DOC "ICU ${component} library (release)")
+    find_library(${component_cache_debug} ${component_debug_libnames}
+                 HINTS ${icu_roots}
+                 PATH_SUFFIXES ${icu_library_suffixes}
+                 DOC "ICU ${component} library (debug)")
+
+    include(SelectLibraryConfigurations)
+    select_library_configurations(ICU_${component_upcase})
+    mark_as_advanced(${component_cache_release} ${component_cache_debug})
+
+    if(${component_cache})
+      set(${component_found} YES)
+      list(APPEND ICU_LIBRARY ${${component_cache}})
+    endif()
+    mark_as_advanced(${component_found})
+
+    set(${component_cache} "${${component_cache}}" PARENT_SCOPE)
+    set(${component_found} "${${component_found}}" PARENT_SCOPE)
+    if(${component_found})
+      if(ICU_FIND_REQUIRED_${component})
+        list(APPEND ICU_LIBS_FOUND "${component} (required)")
+      else()
+        list(APPEND ICU_LIBS_FOUND "${component} (optional)")
+      endif()
+    else()
+      if(ICU_FIND_REQUIRED_${component})
+        list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
+      else()
+        list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
+      endif()
+    endif()
+
+    set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
+    set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
+  endforeach()
+
+  if(CMAKE_LIBRARY_ARCHITECTURE)
+    list(APPEND icu_data_suffixes
+         "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
+         "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
+         "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu"
+         "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu")
+  endif()
+  list(APPEND icu_data_suffixes
+       "${_lib64}/icu/${ICU_VERSION}"
+       "lib/icu/${ICU_VERSION}"
+       "${_lib64}/icu"
+       "lib/icu")
+  foreach(data ${icu_data})
+    string(TOUPPER ${data} data_upcase)
+    STRING(REPLACE "." "_" data_upcase ${data_upcase})
+
+    set(cache_var ICU_${data_upcase})
+    find_file(${cache_Var} ${data}
+              HINTS ${icu_roots}
+              PATH_SUFFIXES ${icu_data_suffixes}
+              DOC "ICU ${data} data file")
+    mark_as_advanced(cache_var)
+    set(${cache_var} "${${cache_var}}" PARENT_SCOPE)
+  endforeach()
+endfunction()
+
+_icu_find()
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ICU
+                                  FOUND_VAR
+                                    ICU_FOUND
+                                  REQUIRED_VARS
+                                    ICU_INCLUDE_DIR
+                                    ICU_LIBRARY
+                                    _ICU_REQUIRED_LIBS_FOUND
+                                  VERSION_VAR
+                                    ICU_VERSION
+                                  FAIL_MESSAGE
+                                    "Failed to find all ICU components")
+unset(_ICU_REQUIRED_LIBS_FOUND)
+
+if(ICU_FOUND)
+  set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
+  set(ICU_LIBRARIES "${ICU_LIBRARY}")
+  foreach(_ICU_component ${ICU_FIND_COMPONENTS})
+    string(TOUPPER ${_ICU_component} _ICU_component_upcase)
+
+    set(_ICU_component_cache "ICU_${_ICU_component_upcase}_LIBRARY")
+    set(_ICU_component_cache_release "ICU_${_ICU_component_upcase}_LIBRARY_RELEASE")
+    set(_ICU_component_cache_debug "ICU_${_ICU_component_upcase}_LIBRARY_DEBUG")
+    set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES")
+    set(_ICU_component_found "${_ICU_component_upcase}_FOUND")
+    set(_ICU_imported_target "ICU::${_ICU_component}")
+
+    if(${_ICU_component_found})
+      set(${_ICU_component_lib} "${${_ICU_component_cache}}")
+      if(NOT TARGET ${_ICU_imported_target})
+        add_library(${_ICU_imported_target} UNKNOWN IMPORTED)
+        if(ICU_INCLUDE_DIR)
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+                                INTERFACE_INCLUDE_DIRECTORIES
+                                  ${ICU_INCLUDE_DIR})
+        endif()
+        if(EXISTS ${${_ICU_component_cache}})
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+                                IMPORTED_LINK_INTERFACE_LANGUAGES
+                                  CXX
+                                IMPORTED_LOCATION
+                                  ${${_ICU_component_cache}})
+        endif()
+        if(EXISTS ${${_ICU_component_cache_release}})
+          set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
+                       IMPORTED_CONFIGURATIONS
+                         RELEASE)
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+                                IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE
+                                  CXX
+                                IMPORTED_LOCATION_RELEASE
+                                  ${${_ICU_component_cache_release}})
+        endif()
+        if(EXISTS ${${_ICU_component_cache_debug}})
+          set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
+                       IMPORTED_CONFIGURATIONS
+                         DEBUG)
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+                                IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG
+                                  CXX
+                                IMPORTED_LOCATION_DEBUG
+                                  ${${_ICU_component_cache_debug}})
+        endif()
+      endif()
+    endif()
+
+    unset(_ICU_imported_target)
+    unset(_ICU_component_found)
+    unset(_ICU_component_lib)
+    unset(_ICU_component_cache_debug)
+    unset(_ICU_component_cache_release)
+    unset(_ICU_component_cache)
+  endforeach()
+endif()
+


Revert change to use b2 as configuration tool instead of bootstrap

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -22,21 +22,14 @@

 SETUP_SUPERBUILD(BOOST)

-# set(_SB_BOOST_LIBRARYDIR ${SB_INSTALL_PREFIX}/lib)
-# Libraries we need from boost
-set( boost_libraries_to_build "system;serialization;filesystem;test;date_time;program_options;thread")

-# add libraries to bootstrap option
-set(BOOST_BOOTSTRAP_OPTIONS "--with-libraries=")
-foreach(lib ${boost_libraries_to_build})
-  set(BOOST_BOOTSTRAP_OPTIONS "${BOOST_BOOTSTRAP_OPTIONS}${lib},")
-endforeach(lib)

 if(UNIX)
   set(BOOST_BOOTSTRAP_FILE "./bootstrap.sh")
   set(BOOST_B2_EXE "./b2")
   if(NOT APPLE AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     set(BOOST_BOOTSTRAP_OPTIONS "${BOOST_BOOTSTRAP_OPTIONS} --with-toolset=clang")
+    set(BOOST_SB_CONFIG toolset=clang)
   endif()
 else()
   set(BOOST_BOOTSTRAP_FILE "bootstrap.bat")
@@ -50,8 +43,18 @@
   ${BOOST_BOOTSTRAP_FILE} ${BOOST_BOOTSTRAP_OPTIONS}
   )

+# We cannot configure and bootstrap boost properly. Every configuration stuff
+# must be passed to b2. Why? Windows... That is why...
+# Libraries we need from boost
+set( boost_libraries_to_build "system;serialization;filesystem;test;date_time;program_options;thread")
+
+# add libraries to bootstrap option
 set(BOOST_SB_CONFIG)
-
+foreach(lib ${boost_libraries_to_build})
+  set(BOOST_BOOTSTRAP_OPTIONS
+    ${BOOST_BOOTSTRAP_OPTIONS}
+    --with-${lib})
+endforeach(lib)
 # I think that this is already handled by boost.
 if(OTB_TARGET_SYSTEM_ARCH_IS_X64)
   set(BOOST_SB_CONFIG address-model=64)
@@ -65,6 +68,7 @@
   runtime-link=shared
   --prefix=${SB_INSTALL_PREFIX}
   )
+  # set(_SB_BOOST_LIBRARYDIR ${SB_INSTALL_PREFIX}/lib)
   # --includedir=${SB_INSTALL_PREFIX}/include #This is the default in boost
   # --libdir=${_SB_BOOST_LIBRARYDIR} # same here


Upgrade boost to 1.69

Upgrade boost to 1.69

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -79,8 +79,8 @@
 #NOTE: update _SB_Boost_INCLUDE_DIR below when you change version number
 ExternalProject_Add(BOOST
   PREFIX BOOST
-  URL "http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2"
-  URL_MD5 65a840e1a0b13a558ff19eeb2c4f0cbe
+  URL "http://downloads.sourceforge.net/project/boost/boost/1.69.0/boost_1_69_0.tar.bz2"
+  URL_MD5 a1332494397bf48332cb152abfefcec2
   BINARY_DIR ${BOOST_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
@@ -96,7 +96,7 @@
 #HINT: avoid all uses of  _SB_* in External_<project>.cmake
 # and depend on much saner CMAKE_PREFIX_PATH for cmake projects.
 if(MSVC)
-  set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include/boost-1_60)
+  set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include/boost-1_69)
 else()
   set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
 endif()


cmake: Add TOP_MODULE argument.

cmake: Add TOP_MODULE argument.

Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro>

--- v2x_tests.cmake
+++ v2x_tests.cmake
@@ -156,7 +156,7 @@

   v2x_test_generic(NAME ${NAME} TOP_MODULE ${MODULE} TYPE pb_type)
   v2x_test_generic(NAME ${NAME} TOP_MODULE ${TOP_MODULE} TYPE model)
-  vpr_test_pbtype(NAME ${NAME})
+  vpr_test_pb_type(NAME ${NAME} TOP_MODULE ${TOP_MODULE})
   add_dependencies(all_v2x_tests test_${NAME})

   add_custom_target(${NAME}_diff ALL DEPENDS ${NAME}_pb_type_diff ${NAME}_model_diff)


incompressible test case now has both posix and sync io files

--- phSolver/incompressible/test/testing.cmake
+++ phSolver/incompressible/test/testing.cmake
@@ -1,6 +1,8 @@
 set(CDIR ${CASES}/incompressible)
 add_test(copyInpCfg
   cp ${PHASTA_SOURCE_DIR}/phSolver/common/input.config ${CDIR})
+add_test(linkProcsDir
+  ln -s ${CDIR}/4-procs_case-SyncIO-2 ${CDIR}/4-procs_case)
 add_test(resetNumStart
   cp ${CDIR}/numstart.dat ${CDIR}/4-procs_case/numstart.dat)
 add_test(
@@ -9,11 +11,11 @@
   WORKING_DIRECTORY ${CASES}/incompressible
 )
 add_test(compareIncompressible
-  diff ${CDIR}/restart-dat.4.1.ref ${CDIR}/4-procs_case/restart-dat.4.1)
+  diff ${CDIR}/restart-dat.4.1.syncio.ref ${CDIR}/4-procs_case/restart-dat.4.1)
 add_test(
   NAME incompressibleRestart
   COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${PHASTA_BINARY_DIR}/bin/phastaIC.exe
   WORKING_DIRECTORY ${CASES}/incompressible
 )
 add_test(compareIncompressibleRestart
-  diff ${CDIR}/restart-dat.8.1.ref ${CDIR}/4-procs_case/restart-dat.8.1)
+  diff ${CDIR}/restart-dat.8.1.syncio.ref ${CDIR}/4-procs_case/restart-dat.8.1)


ENH: Enable MINC IO by default

ENH: Enable MINC IO by default

Recent runs of valgrind with MINC showed no defects.

Change-Id: Iae2d73207af66eea482dedd0161136736e53224d

--- Modules/IO/MINC/itk-module.cmake
+++ Modules/IO/MINC/itk-module.cmake
@@ -13,5 +13,4 @@
     ITKImageStatistics
   DESCRIPTION
     "${DOCUMENTATION}"
-  EXCLUDE_FROM_DEFAULT
 )


COMP: cannot run gdal formats test on gdal1.x and gdal2.x with same code

--- Modules/ThirdParty/GDAL/otb-module-init.cmake
+++ Modules/ThirdParty/GDAL/otb-module-init.cmake
@@ -135,10 +135,11 @@
 gdal_try_run(STATUS GDAL_HAS_HDF4 gdalFormatsTest.c HDF4)

 #check some vector formats
-gdal_try_run(FATAL_ERROR GDAL_HAS_SQLite gdalFormatsTest.c SQLite)
-gdal_try_run(FATAL_ERROR GDAL_HAS_VRT gdalFormatsTest.c VRT)
-gdal_try_run(FATAL_ERROR GDAL_HAS_KML gdalFormatsTest.c KML)
-gdal_try_run(STATUS GDAL_HAS_LIBKML gdalFormatsTest.c LIBKML)
+#TODO: fix gdalFormatsTest.c to work with gdal 1.x and 2.x
+# gdal_try_run(FATAL_ERROR GDAL_HAS_SQLite gdalFormatsTest.c SQLite)
+# gdal_try_run(FATAL_ERROR GDAL_HAS_VRT gdalFormatsTest.c VRT)
+# gdal_try_run(FATAL_ERROR GDAL_HAS_KML gdalFormatsTest.c KML)
+# gdal_try_run(STATUS GDAL_HAS_LIBKML gdalFormatsTest.c LIBKML)

 #------------------- TESTS (END)---------------------


Fix MinGW CMake toolchain to also work with Debian-based host system.

--- Source/CMake/Toolchains/mingw.toolchain.cmake
+++ Source/CMake/Toolchains/mingw.toolchain.cmake
@@ -46,7 +46,13 @@
     file (TO_CMAKE_PATH "$ENV{MINGW_ROOT}" MINGW_ROOT)
     if (NOT MINGW_ROOT)
         get_filename_component (MINGW_PREFIX ${MINGW_PREFIX} NAME)
-        set (MINGW_ROOT /usr/${MINGW_PREFIX}/sys-root)
+        if (EXISTS /usr/${MINGW_PREFIX}/sys-root)
+            # Redhat based system
+            set (MINGW_ROOT /usr/${MINGW_PREFIX}/sys-root)
+        else ()
+            # Debian based system
+            set (MINGW_ROOT /usr/${MINGW_PREFIX})
+        endif ()
     endif ()
     if (NOT EXISTS ${MINGW_ROOT})
         message (FATAL_ERROR "Could not find MinGW system root. "


Fix warning in cmake about concatenated string arguments

--- build/cmake/CondorPackageConfig.cmake
+++ build/cmake/CondorPackageConfig.cmake
@@ -215,7 +215,7 @@
 		set (VC_CRT_MSM Microsoft_VC90_CRT_x86.msm)
 		find_file( CPACK_VC_POLICY_MODULE
 			policy_9_0_Microsoft_VC90_CRT_x86.msm
-               		"C:/Program Files/Common Files/Merge Modules";"C:/Program Files (x86)/Common Files/Merge Modules" )
+               		"C:/Program Files/Common Files/Merge Modules;C:/Program Files (x86)/Common Files/Merge Modules" )
 		set (WIX_MERGE_MODLES "<Merge Id=\"VCPolicy\" Language=\"1033\" DiskId=\"1\" SourceFile=\"${CPACK_VC_POLICY_MODULE}\"/>")
 		set (WIX_MERGE_REFS "<MergeRef Id=\"VCPolicy\"/>")
 		set (MSVCVER vc90)
@@ -235,7 +235,7 @@
 	# look for the all important C-runtime
 	find_file( CPACK_VC_MERGE_MODULE
 		${VC_CRT_MSM}
-		"C:/Program Files/Common Files/Merge Modules";"C:/Program Files (x86)/Common Files/Merge Modules" )
+		"C:/Program Files/Common Files/Merge Modules;C:/Program Files (x86)/Common Files/Merge Modules" )

 	set (WIX_MERGE_MODLES "<Merge Id=\"VCCRT\" Language=\"1033\" DiskId=\"1\" SourceFile=\"${CPACK_VC_MERGE_MODULE}\"/>\n${WIX_MERGE_MODLES}")
 	set (WIX_MERGE_REFS "<MergeRef Id=\"VCCRT\"/>\n${WIX_MERGE_REFS}")


Make explicit dependency on zlib for openexr

--- openexr.cmake
+++ openexr.cmake
@@ -13,6 +13,7 @@
 include (PatchSupport)

 include (ilmbase)
+include (zlib)

 external_source (openexr
     1.6.1
@@ -22,7 +23,7 @@

 message ("Installing ${openexr_NAME} into FlyEM build area: ${FLYEM_BUILD_DIR} ...")
 ExternalProject_Add(${openexr_NAME}
-    DEPENDS             ${ilmbase_NAME}
+    DEPENDS             ${ilmbase_NAME} ${zlib_NAME}
     PREFIX              ${FLYEM_BUILD_DIR}
     URL                 ${openexr_URL}
     URL_MD5             ${openexr_MD5}


oss: FindLibEvent.cmake: workaround cmake POLICY annoyances

Summary:
When pulled in as an external project into an environment
that has changed the default cmake policy, the trick we're using
to extract the full library path errors out.  This works around
that issue by saving the policy settings and then setting them
how we need them before restoring them after we're done.

refs https://github.com/facebook/folly/issues/1100

Reviewed By: yfeldblum

Differential Revision: D14766991

fbshipit-source-id: e2506bc0aebd9e66bc70b12c4c538c9e034f9f73

--- build/fbcode_builder/CMake/FindLibEvent.cmake
+++ build/fbcode_builder/CMake/FindLibEvent.cmake
@@ -36,7 +36,13 @@
   # this results in linker errors.
   # To resolve this, we ask cmake to lookup the full path to the library
   # and use that instead.
+  cmake_policy(PUSH)
+  if(POLICY CMP0026)
+    # Allow reading the LOCATION property
+    cmake_policy(SET CMP0026 OLD)
+  endif()
   get_target_property(LIBEVENT_LIB event LOCATION)
+  cmake_policy(POP)

   set(LibEvent_FOUND ${Libevent_FOUND})
   if (NOT LibEvent_FIND_QUIETLY)


Update FindGraylogLogger.cmake

Update FindGraylogLogger.cmake

--- cmake/modules/FindGraylogLogger.cmake
+++ cmake/modules/FindGraylogLogger.cmake
@@ -5,6 +5,11 @@

 find_library(GraylogLogger_LIBRARIES
         NAMES graylog_logger
+        HINTS ${GraylogLogger_ROOT_DIR}/lib
+        )
+
+find_library(GraylogLogger_STATIC_LIBRARIES
+        NAMES graylog_logger_static
         HINTS ${GraylogLogger_ROOT_DIR}/lib
         )

@@ -16,11 +21,13 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(GraylogLogger FOUND_VAR GraylogLogger_FOUND REQUIRED_VARS
         GraylogLogger_LIBRARIES
+        GraylogLogger_STATIC_LIBRARIES
         GraylogLogger_INCLUDE_DIR
         )

 mark_as_advanced(
         GraylogLogger_ROOT_DIR
         GraylogLogger_LIBRARIES
+        GraylogLogger_STATIC_LIBRARIES
         GraylogLogger_INCLUDE_DIR
 )


Remove /Zc:sizedDealloc- from the MSVC build

According to the connect bug
(https://connect.microsoft.com/VisualStudio/feedback/details/1351894),
this was only necessary with pre-release versions of MSVC 2015.

Fixes PR23513

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -393,11 +393,6 @@
     endif()
   endif()

-  # Disable sized deallocation if the flag is supported. MSVC fails to compile
-  # the operator new overload in User otherwise.
-  check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC)
-  append_if(SUPPORTS_SIZED_DEALLOC "/Zc:sizedDealloc-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-
 elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
   if (LLVM_ENABLE_WARNINGS)
     append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)


Don't define NDEBUG on MSVC_IDE and XCode builds. Fixes PR9155.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -33,7 +33,9 @@
   endif()
 else()
   if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
-    add_definitions( -DNDEBUG )
+    if( NOT MSVC_IDE AND NOT XCODE )
+      add_definitions( -DNDEBUG )
+    endif()
   endif()
 endif()


[Build System: CMake] Cleanup the StandaloneOveraly CMake module.

Preconditions have been moved to the top of the file. All the variables set have been grouped by kind and a few converted to cache variables for better control when building. This should cut down on merge-conflicts as well."

--- cmake/modules/StandaloneOverlay.cmake
+++ cmake/modules/StandaloneOverlay.cmake
@@ -3,38 +3,90 @@
 # a top-level build of the CMAKE_SOURCE_DIR. Otherwise, define a guard variable
 # and return.
 if(DEFINED SWIFT_MASTER_LOADED
-  OR NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
+    OR NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   set(SWIFT_MASTER_LOADED TRUE)
   return()
 endif()

-set(CMAKE_INSTALL_PREFIX "${SWIFT_DEST_ROOT}${TOOLCHAIN_DIR}/usr")

-set(SWIFT_STDLIB_BUILD_TYPE "Release" CACHE STRING
-    "Build type for the Swift standard library and SDK overlays [Debug, RelWithDebInfo, Release, MinSizeRel]")
+# -----------------------------------------------------------------------------
+# Preconditions
+
+include(SwiftUtils)
+
+precondition(CMAKE_INSTALL_PREFIX)
+precondition(SWIFT_DEST_ROOT)
+precondition(SWIFT_HOST_VARIANT_SDK)
+precondition(SWIFT_SOURCE_ROOT)
+precondition(TOOLCHAIN_DIR)
+
+
+# -----------------------------------------------------------------------------
+# Cache Variables and Options
+
+set(SWIFT_SOURCE_DIR "${SWIFT_SOURCE_ROOT}/swift" CACHE PATH
+  "Path to the directory containing the Swift sources.")
+
+set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
+  "The name of the toolchain to pass to 'xcrun'.")
+
+set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.9" CACHE STRING
+    "Minimum deployment target version for macOS.")
+set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "7.0" CACHE STRING
+    "Minimum deployment target version for iOS.")
+set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "9.0" CACHE STRING
+    "Minimum deployment target version for tvOS.")
+set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "2.0" CACHE STRING
+    "Minimum deployment target version for watchOS.")
+
+set(SWIFT_INSTALL_COMPONENTS "sdk-overlay" CACHE STRING
+  "A semicolon-separated list of install components.")
+
+set(SWIFT_SDKS "${SWIFT_HOST_VARIANT_SDK}" CACHE STRING
+  "List of Swift SDKs to build.")
+
+set(SWIFT_NATIVE_LLVM_TOOLS_PATH "${TOOLCHAIN_DIR}/usr/bin" CACHE STRING
+  "Path to LLVM tools that are executable on the build machine.")
+set(SWIFT_NATIVE_CLANG_TOOLS_PATH "${TOOLCHAIN_DIR}/usr/bin" CACHE STRING
+  "Path to Clang tools that are executable on the build machine.")
+set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "${TOOLCHAIN_DIR}/usr/bin" CACHE STRING
+  "Path to Swift tools that are executable on the build machine.")
+
+option(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES
+  "Generate .swiftinterface files alongside .swiftmodule files."
+  TRUE)
+
+set(SWIFT_STDLIB_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
+  "Build type for the Swift standard library and SDK overlays.")
+
 set_property(CACHE SWIFT_STDLIB_BUILD_TYPE PROPERTY
-    STRINGS "Debug" "RelWithDebInfo" "Release" "MinSizeRel")
+  STRINGS
+    "Debug" "RelWithDebInfo" "Release" "MinSizeRel")

-# Only happens if it's called from a top-level cmake invocation.
-set(BUILD_STANDALONE TRUE)
-set(SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES "SHARED")
-set(SWIFT_INSTALL_COMPONENTS "sdk-overlay" CACHE STRING "")
-set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.9" CACHE STRING "")
-set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "7.0" CACHE STRING "")
-set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "9.0" CACHE STRING "")
-set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "2.0" CACHE STRING "")
-set(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES TRUE)
+# -----------------------------------------------------------------------------
+# Constants

-set(SWIFT_SOURCE_DIR "${SWIFT_SOURCE_ROOT}/swift" CACHE PATH "")
-set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "${TOOLCHAIN_DIR}/usr/bin" CACHE PATH "")
-set(SWIFT_SDKS ${SWIFT_HOST_VARIANT_SDK})
+set(CMAKE_INSTALL_PREFIX
+  "${SWIFT_DEST_ROOT}${TOOLCHAIN_DIR}/usr")

 list(APPEND CMAKE_MODULE_PATH
   "${SWIFT_SOURCE_ROOT}/llvm/cmake/modules"
-  "${PROJECT_SOURCE_DIR}/../../../../cmake/modules")
+  "${PROJECT_SOURCE_DIR}/../../../../cmake/modules"
+  "${PROJECT_SOURCE_DIR}/../../../cmake/modules")

-set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
-    "The name of the toolchain to pass to 'xcrun'")
+
+set(SWIFT_APPLE_PLATFORMS
+  OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR)
+
+# Flags used to indicate we are building a standalone overlay.
+# FIXME: We should cut this down to a single flag.
+set(BUILD_STANDALONE TRUE)
+set(SWIFT_BUILD_STANDALONE_OVERLAY TRUE)
+
+set(SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES "SHARED")
+
+
+# -----------------------------------------------------------------------------

 include(SwiftToolchainUtils)
 if(NOT SWIFT_LIPO)
@@ -42,7 +94,6 @@
 endif()

 include(AddLLVM)
-include(SwiftUtils)
 include(SwiftSharedCMakeConfig)
 include(AddSwift)
 include(SwiftHandleGybSources)
@@ -51,25 +102,22 @@
 include(SwiftComponents)
 include(DarwinSDKs)

-# These variables should be passed as -D variables to cmake.
-# e.g. cmake -G Ninja -DSWIFT_HOST_VARIANT_SDK=OSX ..
-precondition(CMAKE_INSTALL_PREFIX)
-precondition(SWIFT_SOURCE_ROOT)
-precondition(SWIFT_DEST_ROOT)
-precondition(SWIFT_HOST_VARIANT_SDK)
-precondition(TOOLCHAIN_DIR)

 # Without this line, installing components is broken. This needs refactoring.
 swift_configure_components()

-# Some overlays include the runtime's headers,
-# and some of those headers are generated at build time.
+
+list_subtract(
+  "${SWIFT_SDKS}"
+  "${SWIFT_CONFIGURED_SDKS}"
+  unknown_sdks)
+
+precondition(unknown_sdks NEGATE
+  MESSAGE
+    "Unknown SDKs: ${unknown_sdks}")
+
+
+# Some overlays include the runtime's headers, and some of those headers are
+# generated at build time.
 add_subdirectory("${SWIFT_SOURCE_DIR}/include" "${SWIFT_SOURCE_DIR}/include")
 add_subdirectory("${SWIFT_SOURCE_DIR}/apinotes" "${SWIFT_SOURCE_DIR}/apinotes")
-
-precondition(unknown_sdks NEGATE MESSAGE "Unknown SDKs: ${unknown_sdks}")
-precondition(SWIFT_CONFIGURED_SDKS MESSAGE "No SDKs selected.")
-precondition(SWIFT_HOST_VARIANT_SDK MESSAGE "No SDK for host tools.")
-
-# ARCH is set somewhere later.
-#precondition(SWIFT_HOST_VARIANT_ARCH MESSAGE "No arch for host tools")


refs #5672 switch around flags so we can override -O0 in debug builds (maybe speed up drd?)

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@51009 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -106,8 +106,8 @@
   )

 ## set extra debugging flags and preprocessor definitions
-set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -O0")
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -O0")
+set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 ${CMAKE_C_FLAGS_DEBUG}")
+set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0 ${CMAKE_CXX_FLAGS_DEBUG}")
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _FORTIFY_SOURCE=2)

 ## set extra release flags


consider clang 3.3 as non-experimental now, only few days remaining until release

--- test.cmake
+++ test.cmake
@@ -148,7 +148,7 @@
 elseif(COMPILER_VERSION MATCHES "Open64")
    set(compiler "Open64")
 endif()
-if(COMPILER_VERSION MATCHES "\\((experimental|prerelease)\\)" OR COMPILER_VERSION MATCHES "clang version 3.3")
+if(COMPILER_VERSION MATCHES "\\((experimental|prerelease)\\)" OR COMPILER_VERSION MATCHES "clang version 3.4")
    set(compiler "experimental")
 endif()


CTest: Find the right file if the branch name has a /

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

--- test.cmake
+++ test.cmake
@@ -62,7 +62,8 @@
 if(NOT git_branch MATCHES "^[0-9a-f]+$")                         # an actual branch name, not a hash
    # read the associated hash
    if(EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}")
-      file(READ "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}" git_hash LIMIT 7)
+      set(git_hash_file "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}")
+      file(READ "${git_hash_file}" git_hash LIMIT 7)
       string(STRIP "${git_hash}" git_hash)
    endif()
    string(REGEX REPLACE "^.*/" "" git_branch "${git_branch}")
@@ -285,8 +286,8 @@
    # nightly builds shouldn't contain the git hash, since it makes expected builds impossible
    string(STRIP "${git_hash} ${CTEST_BUILD_NAME}" CTEST_BUILD_NAME)
    # instead make sure the hash is included in the notes
-   if(EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}")
-      list(APPEND CTEST_NOTES_FILES "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}")
+   if(DEFINED git_hash_file)
+      list(APPEND CTEST_NOTES_FILES "${git_hash_file}")
    endif()
 endif()
 if(DEFINED subset)


Add missing dependency of uuid on Windows

--- project/cmake/ProjectBuildOption.cmake
+++ project/cmake/ProjectBuildOption.cmake
@@ -70,6 +70,7 @@
     unset(LIBATFRAME_UTILS_TEST_UUID_BACKUP_CMAKE_REQUIRED_LIBRARIES)
     if (LIBATFRAME_UTILS_TEST_UUID)
         set (LIBATFRAME_UTILS_ENABLE_UUID TRUE)
+        list(APPEND PROJECT_ATFRAME_UTILS_PUBLIC_LINK_NAMES Rpcrt4)
     else()
         set (LIBATFRAME_UTILS_ENABLE_UUID FALSE)
     endif()


POC: Feature tracker node

POC: Feature tracker node

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "33ff0b2b5287df25573690438374f44a59529429")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "a1021fee4d0c0d2e79007b0bbbb2ba4204aef96d")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Update FW: StereoDepth: fix RGB alignment when running at calib resolution (OAK-D with 800_P or OAK-D-Lite)

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "4959c559cf7979e1a1a5cbdd0f9a5cbd2299ecb2")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "32581ad0d1d86e743d011ef747d57a3f39bbc6d9")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


ARROW-8003: [C++] Use CMAKE_C_COMPILER when building bundled bzip2

This fixes `bzip2_ep` when building with clang

Closes #6539 from wesm/ARROW-8003 and squashes the following commits:

b5a6d5660 <Wes McKinney> Use CMAKE_C_COMPILER when building bundled bzip2

Authored-by: Wes McKinney <3be70eed0275ec2606f002bff3514252e145d204@apache.org>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1906,13 +1906,15 @@
     BZIP2_STATIC_LIB
     "${BZIP2_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}bz2${CMAKE_STATIC_LIBRARY_SUFFIX}")

+  set(BZIP2_EXTRA_ARGS "CC=${CMAKE_C_COMPILER}" "CFLAGS=${EP_C_FLAGS}")
+
   externalproject_add(bzip2_ep
                       ${EP_LOG_OPTIONS}
                       CONFIGURE_COMMAND ""
                       BUILD_IN_SOURCE 1
-                      BUILD_COMMAND ${MAKE} ${MAKE_BUILD_ARGS} CFLAGS=${EP_C_FLAGS}
+                      BUILD_COMMAND ${MAKE} ${MAKE_BUILD_ARGS} ${BZIP2_EXTRA_ARGS}
                       INSTALL_COMMAND ${MAKE} install PREFIX=${BZIP2_PREFIX}
-                                      CFLAGS=${EP_C_FLAGS}
+                                      ${BZIP2_EXTRA_ARGS}
                       INSTALL_DIR ${BZIP2_PREFIX}
                       URL ${BZIP2_SOURCE_URL}
                       BUILD_BYPRODUCTS "${BZIP2_STATIC_LIB}")


ARROW-16751: [C++] Fix ucx target error on cmake3.5 (#13389)

Authored-by: Yibo Cai <e732a3f0de35687e82bda0008a72e443d2f69704@arm.com>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -4718,8 +4718,15 @@
 if(ARROW_WITH_UCX)
   resolve_dependency(ucx PC_PACKAGE_NAMES ucx)
   add_library(ucx::ucx INTERFACE IMPORTED)
-  target_include_directories(ucx::ucx INTERFACE "${UCX_INCLUDE_DIRS}")
-  target_link_libraries(ucx::ucx INTERFACE ucx::ucp ucx::uct ucx::ucs)
+  if(CMAKE_VERSION VERSION_LESS 3.11)
+    set_target_properties(ucx::ucx PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+                                              "${UCX_INCLUDE_DIRS}")
+    set_property(TARGET ucx::ucx PROPERTY INTERFACE_LINK_LIBRARIES ucx::ucp ucx::uct
+                                          ucx::ucs)
+  else()
+    target_include_directories(ucx::ucx INTERFACE "${UCX_INCLUDE_DIRS}")
+    target_link_libraries(ucx::ucx INTERFACE ucx::ucp ucx::uct ucx::ucs)
+  endif()
 endif()

 message(STATUS "All bundled static libraries: ${ARROW_BUNDLED_STATIC_LIBS}")


ENH: simplify OSGeo4W discovery, no handled in respective find_package

--- CMake/FindOSGeo4W.cmake
+++ CMake/FindOSGeo4W.cmake
@@ -1,71 +1,16 @@

+SET(OSGEO4W_FOUND FALSE)
 IF(WIN32)
-    FIND_PATH(OSGEO4W_ROOT NAMES OSGeo4W.bat PATHS $ENV{OSGEO4W_ROOT} )
-	IF(OSGEO4W_ROOT)
-		MESSAGE(STATUS "Found OSGeo4W : ${OSGEO4W_ROOT}")
-		SET(OSGEO4W_FOUND TRUE)
-		SET(OSGEO4W_ROOT ${OSGEO4W_ROOT} )
-		SET(OSGEO4W_INCLUDE ${OSGEO4W_ROOT}/include )
-	    SET(OSGEO4W_LIB ${OSGEO4W_ROOT}/lib )
-
-		FIND_PATH(GDAL_INCLUDE_DIR NAMES gdal.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(GDAL_LIBRARY NAMES gdal_i PATHS ${OSGEO4W_LIB})
-		IF(NOT GDAL_INCLUDE_DIR OR NOT GDAL_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but GDAL is not found : Please install the 'gdal' package from the OSGeo4W Setup")
-		ENDIF()
-
-		FIND_PATH(GEOTIFF_INCLUDE_DIR NAMES geotiff.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(GEOTIFF_LIBRARY NAMES geotiff_i PATHS ${OSGEO4W_LIB})
-		IF(NOT GEOTIFF_INCLUDE_DIR OR NOT GEOTIFF_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but GeoTIFF is not found : Please install the 'libgeotiff' package from the OSGeo4W Setup")
-		ENDIF()
-
-		FIND_PATH(TIFF_INCLUDE_DIR NAMES tiffio.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(TIFF_LIBRARY NAMES libtiff_i PATHS ${OSGEO4W_LIB})
-		IF(NOT TIFF_INCLUDE_DIR OR NOT TIFF_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but TIFF is not found : Please install the 'libtiff' and 'libtiff-devel' package from the OSGeo4W Setup")
-		ENDIF()
-
-		FIND_PATH(JPEG_INCLUDE_DIRS NAMES jpeglib.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(JPEG_LIBRARY NAMES jpeg_i PATHS ${OSGEO4W_LIB})
-		IF(NOT JPEG_INCLUDE_DIRS OR NOT JPEG_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but JPEG is not found : Please install the 'libjpeg' package from the OSGeo4W Setup")
-		ENDIF()
-
-		FIND_PATH(PNG_PNG_INCLUDE_DIR NAMES png.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(PNG_LIBRARY NAMES libpng13 PATHS ${OSGEO4W_LIB})
-		IF(NOT PNG_PNG_INCLUDE_DIR OR NOT PNG_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but PNG is not found : Please install the 'libpng' and 'libpng-devel-vc' packages from the OSGeo4W Setup")
-		ENDIF()
-
-		FIND_PATH(ZLIB_INCLUDE_DIR NAMES zlib.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(ZLIB_LIBRARY NAMES zlib PATHS ${OSGEO4W_LIB})
-		IF(NOT ZLIB_INCLUDE_DIR OR NOT ZLIB_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but ZLIB is not found : Please install the 'zlib' and 'zlib-devel' packages from the OSGeo4W Setup")
-		ENDIF()
-
-		FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(EXPAT_LIBRARY NAMES libexpat PATHS ${OSGEO4W_LIB})
-		IF(NOT EXPAT_INCLUDE_DIR OR NOT EXPAT_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but Expat is not found : Please install the 'expat' package from the OSGeo4W Setup")
-		ENDIF()
-
-		FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(CURL_LIBRARY NAMES libcurl_imp PATHS ${OSGEO4W_LIB})
-		IF(NOT CURL_INCLUDE_DIR OR NOT CURL_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but Curl is not found : Please install the 'curl' package from the OSGeo4W Setup")
-		ENDIF()

-		FIND_PATH(LIBLAS_INCLUDE_DIR NAMES liblas/capi/liblas.h PATHS ${OSGEO4W_INCLUDE})
-		FIND_LIBRARY(LIBLAS_LIBRARY NAMES liblas_c PATHS ${OSGEO4W_LIB})
-		IF(NOT LIBLAS_INCLUDE_DIR OR NOT LIBLAS_LIBRARY)
-		  MESSAGE(WARNING "OSGeo4W found but LibLAS is not found : Please install the 'liblas' and 'liblas-devel' package from the OSGeo4W Setup")
-		ENDIF()
-
+  FIND_PATH(OSGEO4W_ROOT NAMES OSGeo4W.bat PATHS $ENV{OSGEO4W_ROOT} )
+
+  IF(OSGEO4W_ROOT)
+		SET(CMAKE_INCLUDE_PATH ${OSGEO4W_ROOT}/include;$ENV{CMAKE_INCLUDE_PATH})
+    SET(CMAKE_LIBRARY_PATH ${OSGEO4W_ROOT}/lib;$ENV{CMAKE_LIBRARY_PATH})
+    SET(OSGEO4W_FOUND TRUE)
+		MESSAGE(STATUS "Found OSGeo4W (${OSGEO4W_ROOT})")
 	ELSE(OSGEO4W_ROOT)
 		MESSAGE(STATUS "Could not find OSGeo4W")
-		SET(OSGEO4W_FOUND FALSE)
 	ENDIF(OSGEO4W_ROOT)
-ELSE(WIN32)
-	SET(OSGEO4W_FOUND FALSE)
-ENDIF(WIN32)+
+ENDIF(WIN32)


Fix some linking issues on g++, and fix a small apple ommission

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -328,14 +328,8 @@
             set_target_properties(${CEGUI_TARGET_NAME}_Static PROPERTIES LINK_FLAGS_DEBUG /NODEFAULTLIB:freeglut.lib)
         endif()

-        target_link_libraries(${CEGUI_TARGET_NAME}_Static
-            ${CEGUI_STATIC_XMLPARSER_MODULE}_Static
-            ${CEGUI_STATIC_IMAGECODEC_MODULE}_Static
-            ${CEGUI_FALAGARD_WR_LIBNAME}_Static
-        )
-
         if (APPLE)
-            cegui_apple_app_setup(${CEGUI_TARGET_NAME} TRUE)
+            cegui_apple_app_setup(${CEGUI_TARGET_NAME}_Static TRUE)
         endif()
     endif()

@@ -369,10 +363,22 @@
         cegui_apple_app_setup(${CEGUI_TARGET_NAME} FALSE)
     endif()

+
+    ###########################################################################
+    #                      LIBRARY LINK SETUP
+    ###########################################################################
     cegui_target_link_libraries(${CEGUI_TARGET_NAME}
         ${CEGUI_BASE_LIBNAME}
         ${CEGUI_SAMPLEHELPER_LIBNAME}
     )
+
+    if (CEGUI_BUILD_STATIC_CONFIGURATION)
+        target_link_libraries(${CEGUI_TARGET_NAME}_Static
+            ${CEGUI_STATIC_XMLPARSER_MODULE}_Static
+            ${CEGUI_STATIC_IMAGECODEC_MODULE}_Static
+            ${CEGUI_FALAGARD_WR_LIBNAME}_Static
+        )
+    endif()

     ###########################################################################
     #                           INSTALLATION


MAINT: use `add_definitions` for DO_STATIC/DO_EXPORT flags.

--- cmake/FindDO_Sara.cmake
+++ cmake/FindDO_Sara.cmake
@@ -66,11 +66,10 @@
 # List the compile flags needed by DO-CV.
 set(DO_DEFINITIONS "-DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR}")
 if (DO_BUILD_SHARED_LIBS)
-  set(DO_COMPILE_FLAGS "-DDO_EXPORTS")
+  add_definitions("-DDO_EXPORTS")
 elseif (DO_USE_FROM_SOURCE)
-  set(DO_COMPILE_FLAGS "-DDO_STATIC")
+  add_definitions("-DDO_STATIC")
 endif ()
-

 # 'find_package(DO_Sara COMPONENTS Core Graphics ... REQUIRED)' is called.