custom siconos doxygen setup

custom siconos doxygen setup

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@982 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/TargetDoc.cmake
+++ Numerics/cmake/TargetDoc.cmake
@@ -1,4 +1,4 @@
- -helper macro to add a "doc" target with CMake build system.
+# -helper macro to add a "doc" target with CMake build system.
 # and configure doxy.config.in to doxy.config
 #
 # target "doc" allows building the documentation with doxygen/dot on WIN32 and Linux
@@ -41,36 +41,52 @@
   IF    (NOT DVIPS_CONVERTER)
     MESSAGE(STATUS "dvips command DVIPS_CONVERTER not found but usually required.")
   ENDIF (NOT DVIPS_CONVERTER)
+
+  FIND_FILE(DOXY_CONFIG_IN
+    NAMES doxy.config.in
+    PATHS ${CMAKE_CURRENT_SOURCE_DIR}
+    PATH_SUFFIXES . config doc etc doxygen)

-  IF   (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in")
-    MESSAGE(STATUS "configured ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in --> ${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
-    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in
-      ${CMAKE_CURRENT_BINARY_DIR}/doxy.config
-      @ONLY )
-    # use (configured) doxy.config from (out of place) BUILD tree:
-    SET(DOXY_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
-  ELSE (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in")
-    # use static hand-edited doxy.config from SOURCE tree:
-    SET(DOXY_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config")
-    IF   (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config")
-      MESSAGE(STATUS "WARNING: using existing ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config instead of configuring from doxy.config.in file.")
-    ELSE (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config")
-      IF   (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
-        # using template doxy.config.in
-        MESSAGE(STATUS "configured ${CMAKE_CMAKE_MODULE_PATH}/doxy.config.in --> ${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
-        CONFIGURE_FILE(${CMAKE_MODULE_PATH}/doxy.config.in
-          ${CMAKE_CURRENT_BINARY_DIR}/doxy.config
-          @ONLY )
-        SET(DOXY_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
-      ELSE (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
-        # failed completely...
-        MESSAGE(SEND_ERROR "Please create ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in (or doxy.config as fallback)")
-      ENDIF(EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
-
-    ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config")
-  ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in")
+  IF(DOXY_CONFIG_IN)
+    GET_FILENAME_COMPONENT(PDOXY_CONFIG_IN ${DOXY_CONFIG_IN} PATH)
+
+    FILE(RELATIVE_PATH RDOXY_CONFIG ${CMAKE_SOURCE_DIR} ${PDOXY_CONFIG_IN})
+    CONFIGURE_FILE(${DOXY_CONFIG_IN}
+      ${CMAKE_CURRENT_BINARY_DIR}/${RDOXY_CONFIG}/doxy.config
+      @ONLY)
+    SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/${RDOXY_CONFIG}/doxy.config)
+  ELSE(DOXY_CONFIG_IN)
+    IF   (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in")
+      MESSAGE(STATUS "configured ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in --> ${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
+      CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in
+        ${CMAKE_CURRENT_BINARY_DIR}/doxy.config
+        @ONLY )
+      # use (configured) doxy.config from (out of place) BUILD tree:
+      SET(DOXY_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
+    ELSE (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in")
+      # use static hand-edited doxy.config from SOURCE tree:
+      SET(DOXY_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config")
+      IF   (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config")
+        MESSAGE(STATUS "WARNING: using existing ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config instead of configuring from doxy.config.in file.")
+      ELSE (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config")
+        IF   (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
+          # using template doxy.config.in
+          MESSAGE(STATUS "configured ${CMAKE_CMAKE_MODULE_PATH}/doxy.config.in --> ${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
+          CONFIGURE_FILE(${CMAKE_MODULE_PATH}/doxy.config.in
+            ${CMAKE_CURRENT_BINARY_DIR}/doxy.config
+            @ONLY )
+          SET(DOXY_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
+        ELSE (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
+          # failed completely...
+          MESSAGE(SEND_ERROR "Please create ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in (or doxy.config as fallback)")
+        ENDIF(EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
+
+      ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config")
+    ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in")
+
+  ENDIF(DOXY_CONFIG_IN)

-  ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG})
+  ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${RDOXY_CONFIG})

   # create a windows help .chm file using hhc.exe
   # HTMLHelp DLL must be in path!


one more try

one more try

--- cmake/modules/AddSwiftUnittests.cmake
+++ cmake/modules/AddSwiftUnittests.cmake
@@ -49,7 +49,9 @@
     set_property(TARGET "${test_dirname}" APPEND PROPERTY LINK_LIBRARIES "log")
   elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
     set_property(TARGET "${test_dirname}" APPEND PROPERTY COMPILE_FLAGS
-      "-Xcc -march=core2")
+      " -march=core2")
+    set_property(TARGET "${test_dirname}" APPEND PROPERTY LINK_FLAGS
+      " -march=core2")
   endif()

   find_program(LDLLD_PATH "ld.lld")


[CMake] Enable '-index-store-path' compiler option on a Debug build, if the compiler supports it and for non-IDE generators

It can also be explicitely disabled via `LLVM_DISABLE_INDEX_STORE`.

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -669,6 +669,17 @@
   append("-w" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 endif()

+# Enable '-index-store-path' on a Debug build, if the compiler supports it and for non-IDE generators.
+set(LLVM_DISABLE_INDEX_STORE OFF CACHE BOOL "Disable '-index-store-path' flag" FORCE)
+if (NOT LLVM_DISABLE_INDEX_STORE AND NOT XCODE AND NOT MSVC_IDE AND uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+  set(INDEX_DATA_STORE_PATH "${PROJECT_BINARY_DIR}/IndexStore" CACHE STRING "Index store path" FORCE)
+
+  check_c_compiler_flag("-Werror -index-store-path \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/IndexStore\"" "C_SUPPORTS_INDEX_STORE")
+  append_if("C_SUPPORTS_INDEX_STORE" "-index-store-path \"${INDEX_DATA_STORE_PATH}\"" CMAKE_C_FLAGS)
+  check_cxx_compiler_flag("-Werror -index-store-path \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/IndexStore\"" "CXX_SUPPORTS_INDEX_STORE")
+  append_if("CXX_SUPPORTS_INDEX_STORE" "-index-store-path \"${INDEX_DATA_STORE_PATH}\"" CMAKE_CXX_FLAGS)
+endif()
+
 macro(append_common_sanitizer_flags)
   if (NOT MSVC)
     # Append -fno-omit-frame-pointer and turn on debug info to get better


COMP: Proper dependencies for Documentation target

now depends on all SimpleITK libraries

--- Utilities/Doxygen/Doxygen.cmake
+++ Utilities/Doxygen/Doxygen.cmake
@@ -17,6 +17,7 @@
   add_custom_target(Documentation ALL
     COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Utilities/Doxygen/doxygen.config
     MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/Utilities/Doxygen/doxygen.config
+    DEPENDS SimpleITKCommon SimpleITKBasicFilters SimpleITKIO
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Utilities/Doxygen
     )


Enable -Wimplicit-fallthrough for clang as well as GCC

All instances of this warning should already be fixed across all LLVM
subprojects, at least on Linux.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -580,6 +580,7 @@
     append("-Wno-long-long" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   endif()

+  add_flag_if_supported("-Wimplicit-fallthrough" IMPLICIT_FALLTHROUGH_FLAG)
   add_flag_if_supported("-Wcovered-switch-default" COVERED_SWITCH_DEFAULT_FLAG)
   append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
   append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)


fixed cmake policy CMP0022:

fixed cmake policy CMP0022:

either use all-plain or all-keyword style of target_link_libraries

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -215,7 +215,7 @@
     foreach(lib ${ARGN})
       add_space_separated_property(TARGET ${lib} COMPILE_FLAGS --coverage)
       add_space_separated_property(TARGET ${lib} LINK_FLAGS --coverage)
-      target_link_libraries(${lib} gcov)
+      target_link_libraries(${lib} LINK_PRIVATE gcov)
     endforeach(lib)
   endif (USE_GCOV)
 endfunction(maybe_add_gcov_to_libraries)


rcc include fix.

rcc include fix.

--- Plugins/PluginTemplate.cmake
+++ Plugins/PluginTemplate.cmake
@@ -23,6 +23,12 @@
     )
     set_target_properties(${tgt} PROPERTIES LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/Plugins)
     INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/src)
+	target_include_directories(${tgt}
+        PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src/>
+    )
+	target_include_directories(${tgt}
+        PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Plugins/${tgt}/>
+    )
     RCC_TARGET_CONFIG(${tgt} plugin_libraries_debug plugin_libraries_release)
     ocv_add_precompiled_header_to_target(${tgt} src/precompiled.hpp)

@@ -46,9 +52,6 @@
     set(LINK_LIBS_DEBUG ${plugin_libraries_debug})

     set(${tgt}_PLUGIN_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/src/" CACHE PATH "" FORCE)
-    target_include_directories(${tgt}
-        PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src/>
-    )

     set(PLUGIN_NAME ${tgt})
     string(TIMESTAMP BUILD_DATE "%Y-%m-%d %H:%M")
@@ -155,9 +158,7 @@
 		endif()
     ENDIF(NOT ${IS_GIT_REPO} AND NOT ${aquila_declare_plugin_SVN})
     CONFIGURE_FILE(${plugin_export_template_path} "${CMAKE_BINARY_DIR}/Plugins/${tgt}/${tgt}Export.hpp" @ONLY)
-    target_include_directories(${tgt}
-        PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Plugins/${tgt}/>
-    )
+
     CONFIGURE_FILE("../plugin_config.cpp.in" "${CMAKE_BINARY_DIR}/Plugins/${tgt}/plugin_config.cpp" @ONLY)

     set_property(TARGET ${tgt} APPEND PROPERTY SOURCES "${CMAKE_BINARY_DIR}/Plugins/${tgt}/plugin_config.cpp")
@@ -169,33 +170,40 @@

     # ============= Write out a file containing external include info

-    set(external_include_file "#pragma once\n\n#include \"RuntimeObjectSystem/RuntimeLinkLibrary.h\"\n\n#ifdef _MSC_VER\n")
+    set(external_include_file "#pragma once\n\n#include \"RuntimeObjectSystem/RuntimeLinkLibrary.h\"\n\n")
     # wndows link libs
     if(LINK_LIBS_RELEASE)
       LIST(REMOVE_DUPLICATES LINK_LIBS_RELEASE)
+	  list(SORT LINK_LIBS_RELEASE)
     endif()
     if(LINK_LIBS_DEBUG)
       LIST(REMOVE_DUPLICATES LINK_LIBS_DEBUG)
-    endif()
-    set(external_include_file "${external_include_file}\n#else\n\n  #ifdef NDEBUG\n")
-
+	  list(SORT LINK_LIBS_DEBUG)
+    endif()
+    set(external_include_file "${external_include_file}\n#if defined(NDEBUG) && !defined(_DEBUG)\n\n")
+	if(WIN32)
+		set(prefix "")
+		set(postfix ".lib")
+	else(WIN32)
+		set(prefix "-l")
+		set(postfix "")
+	endif(WIN32)
     foreach(lib ${LINK_LIBS_RELEASE})
         string(LENGTH ${lib} len)
         if(len GREATER 3)
             string(SUBSTRING "${lib}" 0 3 sub)
             if(${sub} STREQUAL lib)
               string(SUBSTRING "${lib}" 3 -1 lib)
-              set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"-l${lib}\")\n")
+              set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"${prefix}${lib}${postfix}\")\n")
             else()
-              set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"-l${lib}\")\n")
+              set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"${prefix}${lib}${postfix}\")\n")
             endif()
         else()
-            set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"-l${lib}\")\n")
+            set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"${prefix}${lib}${postfix}\")\n")
         endif()
-
     endforeach()

-    set(external_include_file "${external_include_file}\n  #else\n")
+    set(external_include_file "${external_include_file}\n  #else\n\n")

     foreach(lib ${LINK_LIBS_DEBUG})
         string(LENGTH ${lib} len)
@@ -203,18 +211,18 @@
             string(SUBSTRING "${lib}" 0 3 sub)
             if(${sub} STREQUAL lib)
                 string(SUBSTRING "${lib}" 3 -1 lib)
-                set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"-l${lib}\")\n")
+                set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"${prefix}${lib}${postfix}\")\n")
             else()
-                set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"-l${lib}\")\n")
+                set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"${prefix}${lib}${postfix}\")\n")
             endif()
         else()
-            set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"-l${lib}\")\n")
+            set(external_include_file "${external_include_file}    RUNTIME_COMPILER_LINKLIBRARY(\"${prefix}${lib}${postfix}\")\n")
         endif()
     endforeach()

     set(external_include_file "${external_include_file}\n  #endif // NDEBUG\n")

-    set(external_include_file "${external_include_file}\n#endif // _MSC_VER")
+    set(external_include_file "${external_include_file}\n")
     set(link_file_path "${CMAKE_BINARY_DIR}/Plugins/${tgt}/Aquila/rcc/external_includes/${tgt}_link_libs.hpp")

     if(EXISTS ${link_file_path})


www: debian tarantool-common package link added

--- doc/www-data.in/download.cmake
+++ doc/www-data.in/download.cmake
@@ -38,7 +38,7 @@

-        Debian software package (.deb)
+        Debian (.deb)

@@ -52,7 +52,7 @@

-        Debian software package (.deb), with debug info
+        Debian (.deb), with debug info

         32-bit
@@ -60,6 +60,13 @@

         64-bit
+
+

+
+

+    &nbsp
+
+        common


Added additional libraries to the search.

git-svn-id: b7791fb0f5d07d96612766859ad70a13be88ea96@118 305cdda6-5ce1-45b3-a98d-dfc68c8b3305

--- library/FindBoost.cmake
+++ library/FindBoost.cmake
@@ -1,15 +1,71 @@
+SET(BOOST_INCLUDE_SEARCH_PATH /usr/include /usr/local/include)

-FIND_PATH(BOOST_INCLUDE_DIR boost/weak_ptr.hpp /usr/include /usr/local/include
+IF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 7 .NET 2003" )
+	SET(BOOST_INCLUDE_SEARCH_PATH ${BOOST_INCLUDE_SEARCH_PATH}
 	"C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include"
 	c:\\Boost\\include )
+ENDIF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 7 .NET 2003" )

-#FIND_LIBRARY( BOOST_UNIT_TEST_LIB NAMES boost_unit_test_framework
-#	      PATHS /usr/lib /usr/local/lib C:\\Boost\\lib )
-#FIND_LIBRARY( BOOST_PROGRAM_OPTIONS_LIB NAMES boost_program_options
-#	      PATHS /usr/lib /usr/local/lib C:\\Boost\\lib )
-#FIND_LIBRARY( BOOST_FILESYSTEM_LIB NAMES boost_filesystem
-#	      PATHS /usr/lib /usr/local/lib C:\\Boost\\lib )
+IF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005" )
+	SET(BOOST_INCLUDE_SEARCH_PATH ${BOOST_INCLUDE_SEARCH_PATH}
+		"C:\\Program Files (x86)\\Microsoft Visual Studio 8\\VC\\include"
+		"C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include"
+		c:\\Boost\\include)
+ENDIF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005" )

+FIND_PATH(BOOST_INCLUDE_DIR boost/weak_ptr.hpp ${BOOST_INCLUDE_SEARCH_PATH} )
+
+SET(BoostFileSystemName "")
+SET(BoostFileSystemDebugName "")
+
+IF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 7 .NET 2003" )
+	SET(BoostFileSystemName "libboost_filesystem-vc71-mt")
+	SET(BoostFileSystemDebugName "libboost_filesystem-vc71-mt-gd")
+	SET(BoostThreadName "boost_thread-vc71-mt")
+	SET(BoostThreadDebugName "boost_thread-vc71-mt-gd")
+ENDIF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 7 .NET 2003" )
+
+IF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005" )
+	SET(BoostFileSystemName "libboost_filesystem-vc80-mt")
+	SET(BoostFileSystemDebugName "libboost_filesystem-vc80-mt-gd")
+ENDIF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005" )
+
+IF( ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" )
+	IF( ${CMAKE_COMPILER_IS_GNUCXX} )
+		SET(BoostFileSystemName "boost_filesystem-gcc-mt")
+		SET(BoostFileSystemDebugName "boost_filesystem-gcc-mt-d")
+	ENDIF( ${CMAKE_COMPILER_IS_GNUCXX} )
+ENDIF( ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" )
+
+
+FIND_LIBRARY( BOOST_FILESYSTEM_LIB NAMES ${BoostFileSystemName}
+	      PATHS
+	      ${BOOST_INCLUDE_DIR}/../lib
+	      /usr/local/lib
+	      /usr/lib
+	      C:\\Boost\\lib )
+
+FIND_LIBRARY( BOOST_FILESYSTEM_DEBUG_LIB NAMES ${BoostFileSystemDebugName}
+	      PATHS
+	      ${BOOST_INCLUDE_DIR}/../lib
+	      /usr/local/lib
+	      /usr/lib
+	      C:\\Boost\\lib )
+
+FIND_LIBRARY( BOOST_THREAD_LIB NAMES ${BoostThreadName}
+	      PATHS
+	      ${BOOST_INCLUDE_DIR}/../lib
+	      /usr/local/lib
+	      /usr/lib
+	      C:\\Boost\\lib )
+
+FIND_LIBRARY( BOOST_THREAD_DEBUG_LIB NAMES ${BoostThreadDebugName}
+	      PATHS
+	      ${BOOST_INCLUDE_DIR}/../lib
+	      /usr/local/lib
+	      /usr/lib
+	      C:\\Boost\\lib )
+
 IF (BOOST_INCLUDE_DIR)
   SET(BOOST_FOUND TRUE)
 ENDIF (BOOST_INCLUDE_DIR)


fix bug in apf_stk TriBITS build

fix bug in apf_stk TriBITS build

--- stk/pkg_tribits.cmake
+++ stk/pkg_tribits.cmake
@@ -1,12 +1,12 @@
-# determine if Trilinos has been configured with stk
+tribits_package(SCORECapf_stk)
+
+# determine if configured with stk
 SET(ENABLE_STK_MESH OFF)
-if(Trilinos_ENABLE_STKIO AND
-   Trilinos_ENABLE_STKMesh AND
-   Trilinos_ENABLE_SEACASIoss)
+if(SCORECapf_stk_ENABLE_STKIO AND
+   SCORECapf_stk_ENABLE_STKMesh AND
+   SCORECapf_stk_ENABLE_SEACASIoss)
   SET(ENABLE_STK_MESH ON)
 endif()
-
-tribits_package(SCORECapf_stk)

 include_directories(${CMAKE_CURRENT_SOURCE_DIR})

@@ -21,7 +21,7 @@
   apfSTK.cc)
 set(HEADERS apfAlbany.h)

-if(HAS_STK)
+if(ENABLE_STK_MESH)
   set(HEADERS ${HEADERS} apfSTK.h)
   set(SOURCES ${SOURCES} apfExodusOutput.cc)
 endif()


ARROW-18256: [C++][Windows] Use IMPORTED_IMPLIB for external shared Thrift (#14595)

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

--- cpp/cmake_modules/FindThriftAlt.cmake
+++ cpp/cmake_modules/FindThriftAlt.cmake
@@ -99,26 +99,24 @@
 set(ThriftAlt_LIB_NAME_BASE "thrift${THRIFT_MSVC_LIB_SUFFIX}")

 if(ARROW_THRIFT_USE_SHARED)
-  set(ThriftAlt_LIB_NAMES thrift)
   if(CMAKE_IMPORT_LIBRARY_SUFFIX)
-    list(APPEND
-         ThriftAlt_LIB_NAMES
-         "${CMAKE_IMPORT_LIBRARY_PREFIX}${ThriftAlt_LIB_NAME_BASE}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
+    set(ThriftAlt_LIB_NAME
+        "${CMAKE_IMPORT_LIBRARY_PREFIX}${ThriftAlt_LIB_NAME_BASE}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
     )
-  endif()
-  list(APPEND
-       ThriftAlt_LIB_NAMES
-       "${CMAKE_SHARED_LIBRARY_PREFIX}${ThriftAlt_LIB_NAME_BASE}${CMAKE_SHARED_LIBRARY_SUFFIX}"
-  )
+  else()
+    set(ThriftAlt_LIB_NAME
+        "${CMAKE_SHARED_LIBRARY_PREFIX}${ThriftAlt_LIB_NAME_BASE}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+    )
+  endif()
 else()
-  set(ThriftAlt_LIB_NAMES
+  set(ThriftAlt_LIB_NAME
       "${CMAKE_STATIC_LIBRARY_PREFIX}${ThriftAlt_LIB_NAME_BASE}${CMAKE_STATIC_LIBRARY_SUFFIX}"
   )
 endif()

 if(Thrift_ROOT)
   find_library(ThriftAlt_LIB
-               NAMES ${ThriftAlt_LIB_NAMES}
+               NAMES ${ThriftAlt_LIB_NAME}
                PATHS ${Thrift_ROOT}
                PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib")
   find_path(ThriftAlt_INCLUDE_DIR thrift/Thrift.h
@@ -139,7 +137,7 @@
     list(APPEND THRIFT_PC_LIBRARY_DIRS "${THRIFT_PC_LIBDIR}")

     find_library(ThriftAlt_LIB
-                 NAMES ${ThriftAlt_LIB_NAMES}
+                 NAMES ${ThriftAlt_LIB_NAME}
                  PATHS ${THRIFT_PC_LIBRARY_DIRS}
                  NO_DEFAULT_PATH)
     find_program(THRIFT_COMPILER thrift
@@ -149,7 +147,7 @@
     set(ThriftAlt_VERSION ${THRIFT_PC_VERSION})
   else()
     find_library(ThriftAlt_LIB
-                 NAMES ${ThriftAlt_LIB_NAMES}
+                 NAMES ${ThriftAlt_LIB_NAME}
                  PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib")
     find_path(ThriftAlt_INCLUDE_DIR thrift/Thrift.h PATH_SUFFIXES "include")
     find_program(THRIFT_COMPILER thrift PATH_SUFFIXES "bin")
@@ -171,16 +169,20 @@

 if(ThriftAlt_FOUND)
   set(Thrift_VERSION ${ThriftAlt_VERSION})
+  set(ThriftAlt_IMPORTED_PROPERTY_NAME IMPORTED_LOCATION)
   # Reuse partially defined thrift::thrift by ThriftConfig.cmake.
   if(NOT TARGET thrift::thrift)
     if(ARROW_THRIFT_USE_SHARED)
       add_library(thrift::thrift SHARED IMPORTED)
+      if(CMAKE_IMPORT_LIBRARY_SUFFIX)
+        set(ThriftAlt_IMPORTED_PROPERTY_NAME IMPORTED_IMPLIB)
+      endif()
     else()
       add_library(thrift::thrift STATIC IMPORTED)
     endif()
   endif()
   set_target_properties(thrift::thrift
-                        PROPERTIES IMPORTED_LOCATION "${ThriftAlt_LIB}"
+                        PROPERTIES ${ThriftAlt_IMPORTED_PROPERTY_NAME} "${ThriftAlt_LIB}"
                                    INTERFACE_INCLUDE_DIRECTORIES
                                    "${ThriftAlt_INCLUDE_DIR}")
   if(WIN32 AND NOT MSVC_TOOLCHAIN)


X11: treat missing "return" as error

X11: treat missing "return" as error

--- src/X11/projectDef.cmake
+++ src/X11/projectDef.cmake
@@ -16,7 +16,7 @@
 SOURCE_GROUP(X11 FILES ${PLATFORM})

 # use this to add preprocessor definitions
-add_definitions( -std=c++11 )
+add_definitions( -std=c++11 -Werror=return-type )

 set (SOURCES
     ${SOURCES}
@@ -31,4 +31,5 @@
 target_link_libraries(${PROJECT_NAME}
     ${PLUGIN_INTERNAL_DEPS}
     vlc
+    GL
     )


COMP: Update VMTK to fix Visual Studio build

This commit updates VMTK to fix a regression introduced in be5ac3a (COMP: Fix
build against VTK8 specifying VMTK_USE_VTK9 build option)

List of changes:

$ git shortlog bdddd70..671b54d --no-merges
Jean-Christophe Fillion-Robin (2):
      COMP: Update pragma use in vtkvmtkSimplifyVoronoiDiagram to Fix Visual Studio build
      COMP: Fix Visual Studio build of vtkvmtkRBFInterpolation when VTK_LEGACY_REMOVE is ON

--- SuperBuild/External_VMTK.cmake
+++ SuperBuild/External_VMTK.cmake
@@ -50,7 +50,7 @@

   ExternalProject_SetIfNotDefined(
     ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG
-    "bdddd70cc2ed40a10ba85bff1279d910db31fc1e"
+    "671b54d7b3b243d3d2ce662ffa7f678f53ee18a1"
     QUIET
     )


icv: enable public IPPICV packages

icv: enable public IPPICV packages

--- 3rdparty/ippicv/downloader.cmake
+++ 3rdparty/ippicv/downloader.cmake
@@ -59,12 +59,11 @@

   if(NOT EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
     if(NOT DEFINED OPENCV_ICV_URL)
-      if(NOT DEFINED ENV{OPENCV_ICV_URL})
-        # TODO Specify default URL after ICV publishing
-        message(STATUS "ICV: downloading URL is not specified, skip downloading")
-        return()
+      if(DEFINED ENV{OPENCV_ICV_URL})
+        set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL})
+      else()
+        set(OPENCV_ICV_URL "http://sourceforge.net/projects/opencvlibrary/files/3rdparty/ippicv")
       endif()
-      set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL})
     endif()

     file(MAKE_DIRECTORY ${OPENCV_ICV_PACKAGE_ARCHIVE_DIR})


fixed: make .h/.inl/.ins files show up in MS project files

       Thanks to Christoph Sch"afer for the hint.

git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@1719 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/BuildFunctions.cmake
+++ CMake/BuildFunctions.cmake
@@ -448,7 +448,10 @@
     ENDFOREACH(LIBDIR)

-    ADD_LIBRARY(${PROJECT_NAME} ${${PROJECT_NAME}_SRC})
+    ADD_LIBRARY(${PROJECT_NAME} ${${PROJECT_NAME}_SRC}
+                                ${${PROJECT_NAME}_HDR}
+                                ${${PROJECT_NAME}_INL}
+                                ${${PROJECT_NAME}_INS})

     INCLUDE_DIRECTORIES(${${PROJECT_NAME}_INC})


[UPD] FindQtMobility is now useable under Windows and deal with debug/release library names, like FindQt4.

git-svn-id: ed06c97986a68fa016311908f99ed1538fbb9b5d@956 93be6e1e-6fcc-11de-baec-69240fdc299a

--- CMake/FindQtMobility.cmake
+++ CMake/FindQtMobility.cmake
@@ -25,9 +25,13 @@
 # Copyright (c) 2011 Arjen Hiemstra <ahiemstra@heimr.nl>
 # Redistribution and use is allowed according to the terms of the BSD license.
 #
-# Modified by Arnaud Barré to test if QtMobility is included into Qt (when configured with the option -mac-deploy)
-
-set(QTMOBILITY_COMPONENTS
+# Modified by Arnaud Barré:
+#  - New internal macro to merge release and debug libraries of the same component
+#    (based on macro _QT4_ADJUST_LIB_VARS from FindQt4).
+#  - MacOS X: Test if included into Qt (configured with the option -mac-deploy).
+#  - Windows: Try to be more robust (look for more folder starting from c:\Qt*).
+
+SET(QTMOBILITY_COMPONENTS
     Bearer
     Connectivity
     Contacts
@@ -44,30 +48,138 @@
     Versit
 )

-if (QtMobility_FIND_COMPONENTS)
-  foreach (component ${QtMobility_FIND_COMPONENTS})
-    string(TOUPPER ${component} _COMPONENT)
-    set(QTMOBILITY_USE_${_COMPONENT} 1)
-  endforeach (component)
-endif (QtMobility_FIND_COMPONENTS)
-
-find_path(QTMOBILITY_INCLUDE_DIR qmobilityglobal.h PATH_SUFFIXES QtMobility)
-if (NOT QTMOBILITY_INCLUDE_DIR AND QT4_FOUND)
-  find_path(QTMOBILITY_INCLUDE_DIR qmobilityglobal.h PATH_SUFFIXES QtMobility PATHS ${QT_INCLUDE_DIR})
-endif (NOT QTMOBILITY_INCLUDE_DIR AND QT4_FOUND)
+IF (QtMobility_FIND_COMPONENTS)
+  FOREACH (component ${QtMobility_FIND_COMPONENTS})
+    STRING(TOUPPER ${component} _COMPONENT)
+    SET(QTMOBILITY_USE_${_COMPONENT} 1)
+  ENDFOREACH (component)
+ENDIF (QtMobility_FIND_COMPONENTS)
+
+# convenience macro for dealing with debug/release library names
+# Adapted from the macro _QT4_ADJUST_LIB_VARS found in FindQt4.cmake
+# Updated to use the major revision number found in QtMobility
+MACRO (_QTMOBILITY_ADJUST_LIB_VARS _camelCaseBasename _mr)
+
+  STRING(TOUPPER "${_camelCaseBasename}" basename)
+
+  IF (QTMOBILITY_${basename}_LIBRARY_RELEASE OR QTMOBILITY_${basename}_LIBRARY_DEBUG)
+
+    IF (NOT TARGET QtMobility${_mr}::${_camelCaseBasename})
+      ADD_LIBRARY(QtMobility${_mr}::${_camelCaseBasename} UNKNOWN IMPORTED )
+
+      IF (QTMOBILITY_${basename}_LIBRARY_RELEASE)
+        SET_PROPERTY(TARGET QtMobility${_mr}::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+        IF (QTMOBILITY_USE_FRAMEWORKS)
+          SET_PROPERTY(TARGET QtMobility${_mr}::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_RELEASE "${QTMOBILITY_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" )
+        else()
+          SET_PROPERTY(TARGET QtMobility${_mr}::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_RELEASE "${QTMOBILITY_${basename}_LIBRARY_RELEASE}" )
+        ENDIF ()
+      ENDIF (QTMOBILITY_${basename}_LIBRARY_RELEASE)
+
+      IF (QTMOBILITY_${basename}_LIBRARY_DEBUG)
+        SET_PROPERTY(TARGET QtMobility${_mr}::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+        IF (QTMOBILITY_USE_FRAMEWORKS)
+          SET_PROPERTY(TARGET QtMobility${_mr}::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_DEBUG "${QTMOBILITY_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" )
+        else()
+          SET_PROPERTY(TARGET QtMobility${_mr}::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_DEBUG "${QTMOBILITY_${basename}_LIBRARY_DEBUG}" )
+        ENDIF ()
+      ENDIF (QTMOBILITY_${basename}_LIBRARY_DEBUG)
+    ENDIF (NOT TARGET QtMobility${_mr}::${_camelCaseBasename})
+
+    IF (QTMOBILITY_USE_IMPORTED_TARGETS)
+        SET(QTMOBILITY_${basename}_LIBRARY       QtMobility${_mr}::${_camelCaseBasename} )
+        SET(QTMOBILITY_${basename}_LIBRARIES     QtMobility${_mr}::${_camelCaseBasename} )
+    ELSE(QTMOBILITY_USE_IMPORTED_TARGETS)
+      # If the release- as well as the debug-version of the library have been found:
+      IF (QTMOBILITY_${basename}_LIBRARY_DEBUG AND QTMOBILITY_${basename}_LIBRARY_RELEASE)
+        # If the generator supports configuration types then set
+        # optimized and debug libraries, or IF the CMAKE_BUILD_TYPE has a value
+        IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+          SET(QTMOBILITY_${basename}_LIBRARY       optimized ${QTMOBILITY_${basename}_LIBRARY_RELEASE} debug ${QTMOBILITY_${basename}_LIBRARY_DEBUG})
+        ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+          # If there are no configuration types and CMAKE_BUILD_TYPE has no value
+          # then just use the release libraries
+          SET(QTMOBILITY_${basename}_LIBRARY       ${QTMOBILITY_${basename}_LIBRARY_RELEASE} )
+        ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+        SET(QTMOBILITY_${basename}_LIBRARIES       optimized ${QTMOBILITY_${basename}_LIBRARY_RELEASE} debug ${QTMOBILITY_${basename}_LIBRARY_DEBUG})
+      ENDIF (QTMOBILITY_${basename}_LIBRARY_DEBUG AND QTMOBILITY_${basename}_LIBRARY_RELEASE)
+
+      # If only the release version was found, set the debug variable also to the release version
+      IF (QTMOBILITY_${basename}_LIBRARY_RELEASE AND NOT QTMOBILITY_${basename}_LIBRARY_DEBUG)
+        SET(QTMOBILITY_${basename}_LIBRARY_DEBUG ${QTMOBILITY_${basename}_LIBRARY_RELEASE})
+        SET(QTMOBILITY_${basename}_LIBRARY       ${QTMOBILITY_${basename}_LIBRARY_RELEASE})
+        SET(QTMOBILITY_${basename}_LIBRARIES     ${QTMOBILITY_${basename}_LIBRARY_RELEASE})
+      ENDIF (QTMOBILITY_${basename}_LIBRARY_RELEASE AND NOT QTMOBILITY_${basename}_LIBRARY_DEBUG)
+
+      # If only the debug version was found, set the release variable also to the debug version
+      IF (QTMOBILITY_${basename}_LIBRARY_DEBUG AND NOT QTMOBILITY_${basename}_LIBRARY_RELEASE)
+        SET(QTMOBILITY_${basename}_LIBRARY_RELEASE ${QTMOBILITY_${basename}_LIBRARY_DEBUG})
+        SET(QTMOBILITY_${basename}_LIBRARY         ${QTMOBILITY_${basename}_LIBRARY_DEBUG})
+        SET(QTMOBILITY_${basename}_LIBRARIES       ${QTMOBILITY_${basename}_LIBRARY_DEBUG})
+      ENDIF (QTMOBILITY_${basename}_LIBRARY_DEBUG AND NOT QTMOBILITY_${basename}_LIBRARY_RELEASE)
+
+      # put the value in the cache:
+      SET(QTMOBILITY_${basename}_LIBRARY ${QTMOBILITY_${basename}_LIBRARY} CACHE STRING "The Qt${_camelCaseBasename} library" FORCE)
+
+    ENDIF (QTMOBILITY_USE_IMPORTED_TARGETS)
+
+    SET(QTMOBILITY_${basename}_FOUND 1)
+
+  ELSE (QTMOBILITY_${basename}_LIBRARY_RELEASE OR QTMOBILITY_${basename}_LIBRARY_DEBUG)
+
+    SET(QTMOBILITY_${basename}_LIBRARY "" CACHE STRING "The Qt${_camelCaseBasename} library" FORCE)
+
+  ENDIF (QTMOBILITY_${basename}_LIBRARY_RELEASE OR QTMOBILITY_${basename}_LIBRARY_DEBUG)
+
+  IF (QTMOBILITY_${basename}_INCLUDE_DIR)
+    #add the include directory to QTMOBILITY_INCLUDE_DIRS
+    SET(QTMOBILITY_INCLUDE_DIRS "${QTMOBILITY_${basename}_INCLUDE_DIR}" ${QTMOBILITY_INCLUDE_DIRS})
+  ENDIF (QTMOBILITY_${basename}_INCLUDE_DIR)
+
+  # Make variables changeble to the advanced user
+  MARK_AS_ADVANCED(QTMOBILITY_${basename}_LIBRARY QTMOBILITY_${basename}_LIBRARY_RELEASE QTMOBILITY_${basename}_LIBRARY_DEBUG QTMOBILITY_${basename}_INCLUDE_DIR)
+ENDMACRO (_QTMOBILITY_ADJUST_LIB_VARS)
+
+# Give some possible paths under Windows
+IF (WIN32)
+  SET(QTMOBILITY_PATHS_L1 )
+  SET(QTMOBILITY_PATHS_L2 )
+  # Level 0
+  FILE(GLOB QTMOBILITY_PATHS_L0 "c:/Qt*")
+  # Level 1
+  FOREACH(_file_ ${QTMOBILITY_PATHS_L0})
+    FILE(GLOB QTMOBILITY_PATHS_TEMP "${_file_}/*")
+    SET(QTMOBILITY_PATHS_L1 ${QTMOBILITY_PATHS_L1} ${QTMOBILITY_PATHS_TEMP})
+  ENDFOREACH(_file_ QTMOBILITY_PATHS_L0)
+  # Level 2
+  FOREACH(_file_ ${QTMOBILITY_PATHS_L1})
+    FILE(GLOB QTMOBILITY_PATHS_TEMP "${_file_}/*")
+    SET(QTMOBILITY_PATHS_L2 ${QTMOBILITY_PATHS_L2} ${QTMOBILITY_PATHS_TEMP})
+  ENDFOREACH(_file_ QTMOBILITY_PATHS_L1)
+  # Merge levels
+  SET(QTMOBILITY_PATHS ${QTMOBILITY_PATHS_L0} ${QTMOBILITY_PATHS_L1} ${QTMOBILITY_PATHS_L2})
+ENDIF (WIN32)
+
+FIND_PATH(QTMOBILITY_ROOT "include/QtMobility/qmobilityglobal.h" PATHS ${QTMOBILITY_PATHS})
+IF (NOT QTMOBILITY_ROOT AND QT4_FOUND)
+  FIND_PATH(QTMOBILITY_ROOT "include/QtMobility/qmobilityglobal.h" PATH_SUFFIXES ".." PATHS ${QT_INCLUDE_DIR})
+ENDIF (NOT QTMOBILITY_ROOT AND QT4_FOUND)
+
+FIND_PATH(QTMOBILITY_INCLUDE_DIR qmobilityglobal.h PATH_SUFFIXES "include/QtMobility" PATHS ${QTMOBILITY_ROOT})

 #Find the mobility version
-if(QTMOBILITY_INCLUDE_DIR)
-    file(READ "${QTMOBILITY_INCLUDE_DIR}/qmobilityglobal.h" _qtmobility_global_header LIMIT 5000)
-    string(REGEX MATCH "#define QTM_VERSION_STR \"([0-9.]*)\"" _qtmobility_version_match  "${_qtmobility_global_header}")
-    set(QTMOBILITY_VERSION "${CMAKE_MATCH_1}")
-endif(QTMOBILITY_INCLUDE_DIR)
-
-set(QTMOBILITY_VARIABLES "QTMOBILITY_INCLUDE_DIR")
+IF (QTMOBILITY_INCLUDE_DIR)
+    FILE(READ "${QTMOBILITY_INCLUDE_DIR}/qmobilityglobal.h" _qtmobility_global_header LIMIT 5000)
+    STRING(REGEX MATCH "#define QTM_VERSION_STR \"([0-9.]*)\"" _qtmobility_version_match  "${_qtmobility_global_header}")
+    SET(QTMOBILITY_VERSION "${CMAKE_MATCH_1}")
+    STRING(SUBSTRING ${QTMOBILITY_VERSION} 0 1 QTMOBILITY_VERSION_MAJOR)
+ENDIF (QTMOBILITY_INCLUDE_DIR)
+
+SET(QTMOBILITY_VARIABLES "QTMOBILITY_ROOT;QTMOBILITY_INCLUDE_DIR")
 set(QTMOBILITY_INCLUDE_DIRS ${QTMOBILITY_INCLUDE_DIR})

 #A list of files to find for specific components
-set(QTMOBILITY_FIND_FILES
+SET(QTMOBILITY_FIND_FILES
     QNetworkConfiguration #Bearer
     QBluetoothSocket #Connectivity
     QContact #Contacts
@@ -84,26 +196,24 @@
     QVersitDocument #Versit
 )

-list(LENGTH QTMOBILITY_COMPONENTS _component_count)
-math(EXPR _component_count "${_component_count} - 1")
-foreach (index RANGE ${_component_count})
-    list(GET QTMOBILITY_COMPONENTS ${index} component)
-    list(GET QTMOBILITY_FIND_FILES ${index} file)
-    string(TOUPPER ${component} _COMPONENT)
-
-    if (NOT QtMobility_FIND_COMPONENTS OR QTMOBILITY_USE_${_COMPONENT})
-        find_path(QTMOBILITY_${_COMPONENT}_INCLUDE_DIR ${file} PATH_SUFFIXES Qt${component} qt4/Qt${component})
-        find_library(QTMOBILITY_${_COMPONENT}_LIBRARY NAMES Qt${component})
-
-        list(APPEND QTMOBILITY_VARIABLES "QTMOBILITY_${_COMPONENT}_INCLUDE_DIR" "QTMOBILITY_${_COMPONENT}_LIBRARY")
-        list(APPEND QTMOBILITY_INCLUDE_DIRS ${QTMOBILITY_${_COMPONENT}_INCLUDE_DIR})
-        list(APPEND QTMOBILITY_LIBRARIES ${QTMOBILITY_${_COMPONENT}_LIBRARY})
-    endif (NOT QtMobility_FIND_COMPONENTS OR QTMOBILITY_USE_${_COMPONENT})
-endforeach (index)
-
-
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(QtMobility REQUIRED_VARS ${QTMOBILITY_VARIABLES} VERSION_VAR QTMOBILITY_VERSION)
-
-mark_as_advanced(${QTMOBILITY_VARIABLES})
+LIST(LENGTH QTMOBILITY_COMPONENTS _component_count)
+MATH(EXPR _component_count "${_component_count} - 1")
+FOREACH (index RANGE ${_component_count})
+    LIST(GET QTMOBILITY_COMPONENTS ${index} component)
+    LIST(GET QTMOBILITY_FIND_FILES ${index} file)
+    STRING(TOUPPER ${component} _COMPONENT)
+
+    IF (NOT QtMobility_FIND_COMPONENTS OR QTMOBILITY_USE_${_COMPONENT})
+        FIND_PATH(QTMOBILITY_${_COMPONENT}_INCLUDE_DIR ${file} PATH_SUFFIXES Qt${component} qt4/Qt${component} PATHS "${QTMOBILITY_ROOT}/include")
+        FIND_LIBRARY(QTMOBILITY_${_COMPONENT}_LIBRARY_RELEASE NAMES Qt${component} Qt${component}${QTMOBILITY_VERSION_MAJOR} PATHS "${QTMOBILITY_ROOT}/lib")
+        FIND_LIBRARY(QTMOBILITY_${_COMPONENT}_LIBRARY_DEBUG NAMES Qt${component} Qt${component}d${QTMOBILITY_VERSION_MAJOR} PATHS "${QTMOBILITY_ROOT}/lib")
+        _QTMOBILITY_ADJUST_LIB_VARS(${component} ${QTMOBILITY_VERSION_MAJOR})
+        LIST(APPEND QTMOBILITY_VARIABLES "QTMOBILITY_${_COMPONENT}_INCLUDE_DIR" "QTMOBILITY_${_COMPONENT}_LIBRARY")
+        LIST(APPEND QTMOBILITY_LIBRARIES ${QTMOBILITY_${_COMPONENT}_LIBRARY})
+    ENDIF (NOT QtMobility_FIND_COMPONENTS OR QTMOBILITY_USE_${_COMPONENT})
+ENDFOREACH (index)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(QtMobility REQUIRED_VARS ${QTMOBILITY_VARIABLES} VERSION_VAR QTMOBILITY_VERSION)
+
+MARK_AS_ADVANCED(${QTMOBILITY_VARIABLES})


COMP: fixed test driver path

COMP: fixed test driver path

--- CMake/TestingHelpers.cmake
+++ CMake/TestingHelpers.cmake
@@ -32,7 +32,7 @@
   #
   FOREACH( test ${${KITNAME}_TESTS} )
     GET_FILENAME_COMPONENT(TName ${test} NAME_WE)
-    ADD_TEST(${TName} ${EXECUTABLE_OUTPUT_PATH}/${KITNAME}TestDriver ${TName})
+    ADD_TEST(${TName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KITNAME}TestDriver ${TName})
   ENDFOREACH( test )

   FOREACH(image ${${KITNAME}_TESTIMAGES} ${ADDITIONAL_TEST_IMAGES} )
@@ -48,7 +48,7 @@
     FOREACH( test ${${KITNAME}_IMAGE_TESTS} )
       GET_FILENAME_COMPONENT(TName ${test} NAME_WE)
       GET_FILENAME_COMPONENT(ImageName ${IMAGE_FULL_PATH} NAME)
-      ADD_TEST(${TName}_${ImageName} ${EXECUTABLE_OUTPUT_PATH}/${KITNAME}TestDriver ${TName} ${IMAGE_FULL_PATH})
+      ADD_TEST(${TName}_${ImageName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KITNAME}TestDriver ${TName} ${IMAGE_FULL_PATH})
     ENDFOREACH( test )
     ELSE(EXISTS ${IMAGE_FULL_PATH})
       MESSAGE("!!!!! No such file: ${IMAGE_FULL_PATH} !!!!!")


STYLE: Remove unused CMake module "sparselibSetup"

Initially introduced in 112fe4c (ENH : version 1.0.0 commit), it was
never used.

--- CMake/sparselibSetup.cmake
+++ CMake/sparselibSetup.cmake
@@ -1,27 +0,0 @@
-
-include_directories(${SPHARMPDM_SOURCE_DIR}/Libraries/SparseLibMVIml)
-link_directories(${SPHARMP_BINARY_DIR}/bin)
-
-# here prepared only for ISO C++ compatibles compilers
-
-# IBM xlC  v. 1.1
-# CCCFLAGS        = -DCOMPLEX=complex
-# LDFLAGS         = -lm -lcomplex
-
-# Sun C++ 4.0.1
-# CCCFLAGS        = -DMV_VECTOR_BOUNDS_CHECK -g -DCOMPLEX_OSTREAM -DCOMPLEX=complex
-# LDFLAGS         =   -lm -lcomplex
-
-# g++ v. 2.6.3
-# CCCFLAGS                =   -O5 '-DCOMPLEX=std::complex<double>'
-# LDFLAGS                 =   -lm
-
-
-if(WIN32)
-add_definitions("-DCOMPLEX=std::complex<double>")
-else()
-add_definitions('-DCOMPLEX=std::complex<double>')
-endif()
-
-link_libraries(SparseMatrixLib)
-


Fixed wrong install name of libboost_thread for Mac OS X. This is done by invoking the install_name_tool via cmake

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -42,6 +42,11 @@
       set(_boost_build_cmd )
     endif()

+    set(POST_BUILD "")
+    if(APPLE)
+      set(POST_BUILD install_name_tool -id ${CMAKE_CURRENT_BINARY_DIR}/${proj}-install/lib/libboost_thread.dylib ${CMAKE_CURRENT_BINARY_DIR}/${proj}-install/lib/libboost_thread.dylib)
+    endif()
+
     ExternalProject_Add(${proj}
       SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
       # Boost needs in-source builds
@@ -53,6 +58,7 @@
       CONFIGURE_COMMAND "${_boost_cfg_cmd}"
       BUILD_COMMAND "${_boost_build_cmd}"
       INSTALL_COMMAND ""
+      ${POST_BUILD}
       DEPENDS ${proj_DEPENDENCIES}
       )


Fix sos on window's build.

Fix sos on window's build.

--- dac.cmake
+++ dac.cmake
@@ -1,7 +1,8 @@
 # Contains the dac build specific definitions. Included by the leaf dac cmake files.

-remove_definitions(-DPROFILING_SUPPORTED)
 add_definitions(-DDACCESS_COMPILE)
 if(WIN32)
+    remove_definitions(-DPROFILING_SUPPORTED)
+    add_definitions(-DPROFILING_SUPPORTED_DATA)
     add_definitions(-MT)
-endif(WIN32)+endif(WIN32)


activate testing, OTB_DATA_ROOT for Monteverdi2


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

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


Make sure the Armadillo header is included correctly.

--- fastlib/branches/fastlib-stl/CMake/FindArmadillo.cmake
+++ fastlib/branches/fastlib-stl/CMake/FindArmadillo.cmake
@@ -57,6 +57,8 @@
   PATH_SUFFIXES armadillo armadillo_bits
   )

+
+
 ## -----------------------------------------------------------------------------
 ## Check for the library

@@ -175,6 +177,11 @@
   endif()
 endif()

+# The header files will be in armadillo_bits/ but we also want to include the
+# parent of that directory, which will include the armadillo header itself.
+string(REGEX REPLACE "/armadillo_bits" "" ARMADILLO_EXTRA_INCLUDE ${ARMADILLO_INCLUDES})
+set (ARMADILLO_INCLUDES ${ARMADILLO_INCLUDES} ${ARMADILLO_EXTRA_INCLUDE})
+
 ## -----------------------------------------------------------------------------
 ## Report status


Added the option to prepend a header to the root Android.mk file.

--- generators/android/android-generator.cmake
+++ generators/android/android-generator.cmake
@@ -1,10 +1,10 @@

 #  message("a ${quartz_sources}")
+set(android_includes "${ANDROID_MK_HEADER}")
 if (ANDROID_DEPENENCIES)
-  set(android_includes "include ${ANDROID_DEPENENCIES}/Android.mk")
-else ()
-  set(android_includes "")
-endif ()
+  set(android_includes "${android_includes}include ${ANDROID_DEPENENCIES}/Android.mk")
+endif()
+
 set(all_resources "")

 macro(list_to_string variable list)


build: Lookup the Sun Wireless Toolkit via the preverify path

--- build/CMakeCibylToolchain.cmake
+++ build/CMakeCibylToolchain.cmake
@@ -15,3 +15,24 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

 set(CMAKE_ASM_FLAGS "-c")
+
+
+
+
+execute_process(COMMAND which preverify
+  OUTPUT_VARIABLE WTK_PREVERIFY_PATH
+  RESULT_VARIABLE which_RES)
+
+if (which_RES)
+  message("*** WARNING: Can't find Sun preverify command (for J2ME)\n"
+"*** Add it to your PATH, or Cibyl won't be able to build J2ME programs.")
+  set (WTK_PATH /)
+else (which_RES)
+  execute_process(COMMAND readlink -f ${WTK_PREVERIFY_PATH}
+    OUTPUT_VARIABLE WTK_PREVERIFY_READLINK)
+  execute_process(COMMAND dirname ${WTK_PREVERIFY_READLINK}
+    OUTPUT_VARIABLE WTK_PREVERIFY_PATH)
+  string(STRIP ${WTK_PREVERIFY_PATH} WTK_PREVERIFY_PATH)
+  set (WTK_PATH ${WTK_PREVERIFY_PATH}/../)
+endif (which_RES)
+


missing \"

missing \"

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@2419 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/Pipol.cmake
+++ Numerics/cmake/Pipol.cmake
@@ -97,7 +97,7 @@
         \"sudo mkdir -p \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
           sudo chown ${PIPOL_USER} \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
           cd \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
-          ${PIPOL_MAKE_COMMAND} \;
+          ${PIPOL_MAKE_COMMAND} \"
         )

       ADD_CUSTOM_TARGET(


- Removed/reordered flags for Devel build

--- environment.cmake
+++ environment.cmake
@@ -47,10 +47,9 @@
 	set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++98 -fno-rtti -fno-exceptions")
 	set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG} -fno-inline -ggdb -D_DEBUG -DCLEVER_DEBUG")
 	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG")
-	set(CMAKE_CXX_FLAGS_DEVEL   "${CMAKE_CXX_FLAGS_DEBUG} -Wno-unused-parameter -O0")
-	set(CMAKE_CXX_FLAGS_DEVEL   "${CMAKE_CXX_FLAGS_DEVEL} -ftrapv -fverbose-asm -finstrument-functions")
+	set(CMAKE_CXX_FLAGS_DEVEL   "${CMAKE_CXX_FLAGS_DEBUG} -O0 -Wextra -Wno-unused-parameter")
+	set(CMAKE_CXX_FLAGS_DEVEL   "${CMAKE_CXX_FLAGS_DEVEL} -fverbose-asm -finstrument-functions")
 	set(CMAKE_CXX_FLAGS_DEVEL   "${CMAKE_CXX_FLAGS_DEVEL} -fno-delete-null-pointer-checks -fno-omit-frame-pointer")
 	set(CMAKE_CXX_FLAGS_DEVEL   "${CMAKE_CXX_FLAGS_DEVEL} -fstack-check -fstack-protector")
-	set(CMAKE_CXX_FLAGS_DEVEL   "${CMAKE_CXX_FLAGS_DEVEL} -Wstack-protector -Wextra")
 endif (MSVC)


Fix support VS toolset for host-compiler x64

--- conan.cmake
+++ conan.cmake
@@ -191,7 +191,7 @@
         set(_SETTINGS ${_SETTINGS} -s compiler.runtime=${_vs_runtime})

         if (CMAKE_GENERATOR_TOOLSET)
-            set(_SETTINGS ${_SETTINGS} -s compiler.toolset=${CMAKE_GENERATOR_TOOLSET})
+            set(_SETTINGS ${_SETTINGS} -s compiler.toolset=${CMAKE_VS_PLATFORM_TOOLSET})
         elseif(CMAKE_VS_PLATFORM_TOOLSET AND (CMAKE_GENERATOR STREQUAL "Ninja"))
             set(_SETTINGS ${_SETTINGS} -s compiler.toolset=${CMAKE_VS_PLATFORM_TOOLSET})
         endif()


Remove old conan 0.18 workaround (#14)

Remove old conan 0.18 workaround (#14)

--- conan.cmake
+++ conan.cmake
@@ -233,11 +233,6 @@
 macro(conan_cmake_run)
     parse_arguments(${ARGV})

-    # TODO: Better detection
-    if(CONAN_EXPORTED OR CONAN_COMPILER)
-        set(CONAN_EXPORTED ON)
-    endif()
-
     if(CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE AND NOT CONAN_EXPORTED)
         set(CONAN_CMAKE_MULTI ON)
         message(STATUS "Conan: Using cmake-multi generator")


use the CMake way of retrieving the CL version (value of _MSC_VER)

--- test.cmake
+++ test.cmake
@@ -14,7 +14,9 @@
 execute_process(COMMAND uname -m OUTPUT_VARIABLE chip OUTPUT_STRIP_TRAILING_WHITESPACE)
 string(TOLOWER "${chip}" chip)
 if(arch MATCHES "mingw")
-   execute_process(COMMAND cl COMMAND awk "/Version/ { print $8 }" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
+   execute_process(COMMAND cl /nologo -EP "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
+   string(REPLACE "VERSION=" "" COMPILER_VERSION "${COMPILER_VERSION}")
+   string(STRIP "${COMPILER_VERSION}" COMPILER_VERSION)
    set(COMPILER_VERSION "MSVC ${COMPILER_VERSION}")
    execute_process(COMMAND reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor" COMMAND grep -c CentralProcessor OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
 else()


Always link plugins against libvlc.

Always link plugins against libvlc.

--- extras/buildsystem/cmake/include/vlc_module_funcs.cmake
+++ extras/buildsystem/cmake/include/vlc_module_funcs.cmake
@@ -3,10 +3,7 @@
 MACRO(vlc_add_module module_name)
     if(ENABLE_VLC_MODULE_${module_name})
         add_library( ${module_name}_plugin MODULE ${ARGN} )
-        # On win32 we need to have all the symbol resolved at link time
-        if(WIN32)
-            set(VLC_${module_name}_LINK_LIBRARIES "VLC_${module_name}_LINK_LIBRARIES libvlc")
-        endif(WIN32)
+        set(VLC_${module_name}_LINK_LIBRARIES "VLC_${module_name}_LINK_LIBRARIES libvlc")
         set_target_properties( ${module_name}_plugin PROPERTIES COMPILE_FLAGS
                 "-D__PLUGIN__ -DMODULE_NAME=${module_name} -DMODULE_NAME_IS_${module_name} -I${CMAKE_CURRENT_SOURCE_DIR} ${VLC_${module_name}_COMPILE_FLAG}" )
         if (VLC_${module_name}_LINK_LIBRARIES)


CMake: turn mbed_greentea_add_test() into a function

Unlike a macro, a function is more self-contained and can return
early if necessary.

--- tools/cmake/mbed_greentea.cmake
+++ tools/cmake/mbed_greentea.cmake
@@ -30,7 +30,7 @@
 #    HOST_TESTS_DIR ${CMAKE_CURRENT_LIST_DIR}/host_tests
 # )

-macro(mbed_greentea_add_test)
+function(mbed_greentea_add_test)
     set(options)
     set(singleValueArgs TEST_NAME)
     set(multipleValueArgs
@@ -119,4 +119,4 @@
         set(CMAKE_VERBOSE_MAKEFILE ON)
     endif()

-endmacro()
+endfunction()


[appveyor] formatting fix: space->tab

[appveyor] formatting fix: space->tab

--- ci/appveyor/md-to-mt.cmake
+++ ci/appveyor/md-to-mt.cmake
@@ -11,17 +11,17 @@

 foreach (
 	_FLAG
-    CMAKE_C_FLAGS
-    CMAKE_C_FLAGS_DEBUG
-    CMAKE_C_FLAGS_RELEASE
-    CMAKE_C_FLAGS_MINSIZEREL
-    CMAKE_C_FLAGS_RELWITHDEBINFO
-    CMAKE_CXX_FLAGS
-    CMAKE_CXX_FLAGS_DEBUG
-    CMAKE_CXX_FLAGS_RELEASE
-    CMAKE_CXX_FLAGS_MINSIZEREL
-    CMAKE_CXX_FLAGS_RELWITHDEBINFO
-    )
+	CMAKE_C_FLAGS
+	CMAKE_C_FLAGS_DEBUG
+	CMAKE_C_FLAGS_RELEASE
+	CMAKE_C_FLAGS_MINSIZEREL
+	CMAKE_C_FLAGS_RELWITHDEBINFO
+	CMAKE_CXX_FLAGS
+	CMAKE_CXX_FLAGS_DEBUG
+	CMAKE_CXX_FLAGS_RELEASE
+	CMAKE_CXX_FLAGS_MINSIZEREL
+	CMAKE_CXX_FLAGS_RELWITHDEBINFO
+	)

 	if (${${_FLAG}} MATCHES "/MD")
 		string(REGEX REPLACE "/MD" "/MT" ${_FLAG} "${${_FLAG}}")


Fix bug in cmake -- wasn't finding ilmbase and openexr include files properly
when using THIRD_PARTY_TOOLS_HOME.

git-svn-id: c3edda122e248ef33995da003806c930f62b9468@726 31904243-a364-42ac-a3db-9305396518ba

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -46,7 +46,8 @@
             "Location of the ILMBase library install")
 mark_as_advanced (ILMBASE_HOME)
 find_path (ILMBASE_INCLUDE_AREA half.h
-           ${ILMBASE_HOME}/include
+           ${ILMBASE_HOME}/include/ilmbase-${ILMBASE_VERSION}
+           ${ILMBASE_HOME}/include/ilmbase-${ILMBASE_VERSION}/OpenEXR
            ${ILMBASE_HOME}/include/OpenEXR
            /usr/include/OpenEXR
            /usr/local/include/OpenEXR
@@ -86,6 +87,8 @@
 find_path (OPENEXR_INCLUDE_AREA OpenEXRConfig.h
            ${OPENEXR_HOME}/include
            ${OPENEXR_HOME}/include/OpenEXR
+           ${ILMBASE_HOME}/include/openexr-${OPENEXR_VERSION}
+           ${ILMBASE_HOME}/include/openexr-${OPENEXR_VERSION}/OpenEXR
            /usr/include/OpenEXR
            /usr/local/include/OpenEXR
            /opt/local/include/OpenEXR )


Fixed typo x86 -> x64

Fixed typo x86 -> x64

--- tools/cmake/helpers/platform.cmake
+++ tools/cmake/helpers/platform.cmake
@@ -76,7 +76,7 @@
 function(get_arch ARCH)
   if( CMAKE_SIZEOF_VOID_P MATCHES 8 )
     # void ptr = 8 byte --> x86_64
-    set(${ARCH} "x86" PARENT_SCOPE)
+    set(${ARCH} "x64" PARENT_SCOPE)
   elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 )
     # void ptr = 4 byte --> x86
     set(${ARCH} "x86" PARENT_SCOPE)


Fix copy-paste typo

Fix copy-paste typo

--- cmake/DetectCxxFilesystem.cmake
+++ cmake/DetectCxxFilesystem.cmake
@@ -16,7 +16,7 @@
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeTemp/HaveCxxFilesystem
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeTemp/test_cxx_filesystem.cc
   CXX_STANDARD 17
-  CXX_STANDARD_REQUIRED 17
+  CXX_STANDARD_REQUIRED ON
   OUTPUT_VARIABLE OUTPUT
 )
 if (HAVE_CXX_FILESYSTEM)
@@ -42,7 +42,7 @@
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeTemp/HaveCxxExperimentalFilesystem
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeTemp/test_cxx_experimental_filesystem.cc
     CXX_STANDARD 17
-    CXX_STANDARD_REQUIRED 17
+    CXX_STANDARD_REQUIRED ON
     LINK_LIBRARIES ${TEMP_FILESYSTEM_LIBS}
     OUTPUT_VARIABLE OUTPUT
   )


Clean up path overriding for finding cfitsio and ccfits

--- cmake/Modules/FindCfitsio.cmake
+++ cmake/Modules/FindCfitsio.cmake
@@ -13,10 +13,15 @@
 #  CCFITS_LIBRARY
 #
 # Hints for non-standard locations:
-# CFITSIO_ROOT_DIR
-# CCFITS_ROOT_DIR
 #
-#   Copyright 2011  Jacek Becla, Daniel Liwei Wang
+#   CFITSIO_ROOT_DIR  (used for finding cfitsio only)
+#   CCFITS_ROOT_DIR (used for finding CCfits only)
+#   BASE_DIR (used for both, and other dependencies as well)
+#
+# These directories can be the --prefix=<dir> directory or the
+# individual source directories for cfitsio or ccfits.
+#
+#   Copyright 2012  Jacek Becla, Daniel Liwei Wang
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -35,21 +40,34 @@
 # Look for includes and libraries
 find_path(CFITSIO_INCLUDE_DIR
   NAMES fitsio.h
-  HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include include/cfitsio
+  HINTS ${CFITSIO_ROOT_DIR} ${BASE_DIR}
+  PATH_SUFFIXES include include/cfitsio
   )
 find_library(CFITSIO_LIBRARY  cfitsio
-  HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES lib)
+  HINTS ${CFITSIO_ROOT_DIR} ${BASE_DIR}
+  PATH_SUFFIXES lib)

 find_package_handle_standard_args(CFITSIO  DEFAULT_MSG
   CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY)
+if(NOT CFITSIO_FOUND)
+  message("Can't find CCfits. You can specify a non-standard (e.g., from source) installation using CFITSIO_ROOT_DIR")
+endif(NOT CFITSIO_FOUND)
+

 find_path(CCFITS_INCLUDE_DIR  CCfits/CCfits
-  HINTS ${CCFITS_ROOT_DIR} PATH_SUFFIXES include)
+  HINTS ${CCFITS_ROOT_DIR} ${BASE_DIR}
+  PATH_SUFFIXES include)
 find_library(CCFITS_LIBRARY  CCfits
-  HINTS ${CCFITS_ROOT_DIR} PATH_SUFFIXES lib)
+  HINTS ${CCFITS_ROOT_DIR} ${BASE_DIR}
+  PATH_SUFFIXES lib)
 find_package_handle_standard_args(CCFITS  DEFAULT_MSG
   CCFITS_INCLUDE_DIR CCFITS_LIBRARY)
+
+if(NOT CCFITS_FOUND)
+  message("Can't find CCfits. You can specify a non-standard (e.g., from source) installation using CCFITS_ROOT_DIR")
+endif(NOT CCFITS_FOUND)
+
 #find_package_handle_standard_args(LIBSZ  DEFAULT_MSG  SZ_LIB)

 mark_as_advanced(CFITSIO_LIBRARY CFITSIO_INCLUDE_DIR


Changed the library search order in the FindCClient.cmake module. It used to search dynamic libraries before static ones. Now, it does it the other way round because of http://www.washington.edu/imap/IMAP-FAQs/index.html#6.3.

--- cmake_modules/FindCClient.cmake
+++ cmake_modules/FindCClient.cmake
@@ -50,7 +50,7 @@
 # Look for the library.
 FIND_LIBRARY(
   CCLIENT_LIBRARY
-  NAMES c-client c-client4 cclient.lib c-client/cclient.lib c-client/Release/cclient.lib
+  NAMES libc-client.a c-client libc-client4.a c-client4 cclient.lib c-client/cclient.lib c-client/Release/cclient.lib
   PATHS ${CCLIENT_LIBRARY_DIR} /usr/local/lib /opt/local/lib /usr/lib
   DOC "Library to link against for the email support (c-client, libc-client or cclient.lib)")


#62 adapt cmake to new scriptzeug version

--- cmake/FindScriptzeug.cmake
+++ cmake/FindScriptzeug.cmake
@@ -10,11 +10,11 @@
 #  SCRIPTZEUG_LIBRARIES

-FIND_PATH(SCRIPTZEUG_INCLUDE_DIR
-  NAMES scriptzeug
-  PATHS
-    ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include
-    /usr/local/include/Scriptzeug/
+set(SCRIPTZEUG_INCLUDE_DIR
+  ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include/scriptzeug/include
+  ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include/reflectionzeug/
+  ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include/signalzeug/include
+  ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include/propertyzeug/include
 )

 FIND_LIBRARY(SCRIPTZEUG_SCRIPTZEUG_LIBRARY
@@ -38,6 +38,13 @@
     /usr/local/lib
 )

+FIND_LIBRARY(SCRIPTZEUG_REFLECTIONZEUG_LIBRARY
+  NAMES reflectionzeug
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/lib
+    /usr/local/lib
+)
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Scriptzeug
 	DEFAULT_MSG
@@ -51,6 +58,14 @@
     ${SCRIPTZEUG_SCRIPTZEUG_LIBRARY}
     ${SCRIPTZEUG_PROPERTYZEUG_LIBRARY}
     ${SCRIPTZEUG_SIGNALZEUG_LIBRARY}
+    ${SCRIPTZEUG_REFLECTIONZEUG_LIBRARY}
   )
-	set(SCRIPTZEUG_INCLUDE_DIRS "${SCRIPTZEUG_INCLUDE_DIR}")
+
+  set(SCRIPTZEUG_INCLUDE_DIRS
+    ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include/scriptzeug/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include/reflectionzeug/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include/signalzeug/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/scriptzeug/include/propertyzeug/include
+  )
+
 endif()


A few new warnings for gcc

A few new warnings for gcc

--- cmake/compiler-flags.cmake
+++ cmake/compiler-flags.cmake
@@ -5,10 +5,12 @@
   logical-op
   noexcept
   strict-null-sentinel
+  suggest-attribute=cold
   suggest-attribute=const
   suggest-attribute=format
   suggest-attribute=noreturn
   suggest-attribute=pure
+  suggest-attribute=malloc
   trampolines
   unsafe-loop-optimizations
   useless-cast


Updates to find SPICE correctly

Updates to find SPICE correctly

--- cmake/External-Spice.cmake
+++ cmake/External-Spice.cmake
@@ -1,16 +1,21 @@
 message( "External project - Spice" )

-# This is hard coded for linux 64 right now, but should be generalized for all OSes.
+IF(APPLE)
+  SET(SPICE_URL "http://naif.jpl.nasa.gov/pub/naif/toolkit/C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z")
+ELSEIF(UNIX)
+  SET(SPICE_URL "http://naif.jpl.nasa.gov/pub/naif/toolkit//C/PC_Linux_GCC_64bit/packages/cspice.tar.Z")
+ENDIF()
+
 ExternalProject_Add( Spice
-  URL "http://naif.jpl.nasa.gov/pub/naif/toolkit//C/PC_Linux_GCC_64bit/packages/cspice.tar.Z"
+  URL "${SPICE_URL}"
   DOWNLOAD_NAME cspice.tar.gz
   UPDATE_COMMAND ""
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ""
   INSTALL_COMMAND
     ${CMAKE_COMMAND} -E copy
-      ${CMAKE_BINARY_DIR}/Spice-prefix/src/Spice/lib/cspice.a
-      ${CMAKE_BINARY_DIR}/Spice-prefix/src/Spice/lib/libcspice.a &&
+      ${CMAKE_BINARY_DIR}/Spice-prefix/src/lib/cspice.a
+      ${CMAKE_BINARY_DIR}/Spice-prefix/src/lib/libcspice.a &&
     ${CMAKE_COMMAND} -E copy_directory
       ${CMAKE_BINARY_DIR}/Spice-prefix/src/Spice/
       ${INSTALL_DEPENDENCIES_DIR}/cspice


find jsonrpccpp debug libraries

find jsonrpccpp debug libraries

--- cmake/FindJsonRpcCpp.cmake
+++ cmake/FindJsonRpcCpp.cmake
@@ -43,6 +43,53 @@
 set (JSON_RPC_CPP_SERVER_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_SERVER_LIBRARY})
 set (JSON_RPC_CPP_CLIENT_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_CLIENT_LIBRARY})

+# debug library on windows
+# same naming convention as in qt (appending debug library with d)
+# boost is using the same "hack" as us with "optimized" and "debug"
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+	find_library(
+		JSON_RPC_CPP_COMMON_LIBRARY_DEBUG
+		NAMES jsonrpccpp-commond
+		DOC "json-rpc-cpp common debug library"
+	)
+
+	find_library(
+		JSON_RPC_CPP_SERVER_LIBRARY_DEBUG
+		NAMES jsonrpccpp-serverd
+		DOC "json-rpc-cpp server debug library"
+	)
+
+	find_library(
+		JSON_RPC_CPP_CLIENT_LIBRARY_DEBUG
+		NAMES jsonrpccpp-clientd
+		DOC "json-rpc-cpp client debug library"
+	)
+
+	set (JSON_RPC_CPP_LIBRARIES
+		optimized ${JSON_RPC_CPP_COMMON_LIBRARY}
+		optimized ${JSON_RPC_CPP_SERVER_LIBRARY}
+		optimized ${JSON_RPC_CPP_CLIENT_LIBRARY}
+		debug ${JSON_RPC_CPP_COMMON_LIBRARY_DEBUG}
+		debug ${JSON_RPC_CPP_SERVER_LIBRARY_DEBUG}
+		debug ${JSON_RPC_CPP_CLIENT_LIBRARY_DEBUG}
+	)
+
+	set (JSON_RPC_CPP_SERVER_LIBRARIES
+		optimized ${JSON_RPC_CPP_COMMON_LIBRARY}
+		optimized ${JSON_RPC_CPP_SERVER_LIBRARY}
+		debug ${JSON_RPC_CPP_COMMON_LIBRARY_DEBUG}
+		debug ${JSON_RPC_CPP_SERVER_LIBRARY_DEBUG}
+	)
+
+	set (JSON_RPC_CPP_CLIENT_LIBRARIES
+		optimized ${JSON_RPC_CPP_COMMON_LIBRARY}
+		optimized ${JSON_RPC_CPP_CLIENT_LIBRARY}
+		debug ${JSON_RPC_CPP_COMMON_LIBRARY_DEBUG}
+		debug ${JSON_RPC_CPP_CLIENT_LIBRARY_DEBUG}
+	)
+
+endif()
+
 # handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE
 # if all listed variables are TRUE, hide their existence from configuration view
 include(FindPackageHandleStandardArgs)


Squashed '3rdparty/github/cmake-utils-remote/' changes from f60f488..4522e8e

4522e8e Fix CMAKE_MODULE_PATH

git-subtree-dir: 3rdparty/github/cmake-utils-remote
git-subtree-split: 4522e8ea91899a6bae2837cd7f7830e13003aa42

--- cmake/MyPackageStart.cmake
+++ cmake/MyPackageStart.cmake
@@ -34,11 +34,11 @@
   #
   # Paths
   #
-  SET (CMAKE_MODULE_PATH      "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/3rdparty/github/cmake-utils/cmake") # General module search path
-  SET (INCLUDE_OUTPUT_PATH    "${PROJECT_SOURCE_DIR}/output/include")                                                  # General include output path
-  SET (LIBRARY_OUTPUT_PATH    "${PROJECT_SOURCE_DIR}/output/lib")                                                      # General library output path
-  SET (BINARY_OUTPUT_PATH     "${PROJECT_SOURCE_DIR}/output/bin")                                                      # General binary output path
-  SET (3RDPARTY_OUTPUT_PATH   "${PROJECT_SOURCE_DIR}/output/3rdparty")                                                 # General 3rdparty output path
+  SET (CMAKE_MODULE_PATH      "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/3rdparty/github/cmake-utils-remote/cmake") # General module search path
+  SET (INCLUDE_OUTPUT_PATH    "${PROJECT_SOURCE_DIR}/output/include")                                                         # General include output path
+  SET (LIBRARY_OUTPUT_PATH    "${PROJECT_SOURCE_DIR}/output/lib")                                                             # General library output path
+  SET (BINARY_OUTPUT_PATH     "${PROJECT_SOURCE_DIR}/output/bin")                                                             # General binary output path
+  SET (3RDPARTY_OUTPUT_PATH   "${PROJECT_SOURCE_DIR}/output/3rdparty")                                                        # General 3rdparty output path
   #
   # Output directories
   # C.f. http://stackoverflow.com/questions/7747857/in-cmake-how-do-i-work-around-the-debug-and-release-directories-visual-studio-2


Different version is needed for MacOsX

Different version is needed for MacOsX

--HG--
branch : correct_czmq_version

--- cmake/SearchForStuff.cmake
+++ cmake/SearchForStuff.cmake
@@ -69,8 +69,14 @@
 endif()

 #################################################
-# Find czmq.:
-pkg_check_modules(czmq libczmq>=2.0.0)
+# Find czmq
+# Seems to work fine with 2.2.0 version of czmq in linux but MacOsX needs 3.0.0
+# See: https://bitbucket.org/ignitionrobotics/ign-transport/commits/73be1b2
+if(APPLE)
+  pkg_check_modules(czmq libczmq>=3.0.0)
+else()
+  pkg_check_modules(czmq libczmq>=2.0.0)
+endif()

 if (NOT czmq_FOUND)
   message (STATUS "Looking for czmq pkgconfig file - not found")


[CMake][Fuchsia] Use libc++ ABIv2 for the first stage build

This also unifies flags between macOS and Linux builds.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@362585 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia.cmake
+++ cmake/caches/Fuchsia.cmake
@@ -29,19 +29,20 @@
   set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
   set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
   set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
-elseif(UNIX)
-  set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
-  set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
-  set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
-  set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
-  set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
-  set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
-  set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
-  set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
-  set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
-  set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
-  set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
 endif()
+
+set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
+set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
+set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
+set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
+set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
+set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")

 if(BOOTSTRAP_CMAKE_SYSTEM_NAME)
   set(target "${BOOTSTRAP_CMAKE_CXX_COMPILER_TARGET}")


add build configuration keyword support for libraries (fix #253)

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -162,13 +162,45 @@
   endforeach()

   # merge explicitly listed libraries and libraries from non-catkin but find_package()-ed packages
+  set(_PKG_CONFIG_LIBRARIES "")
+  if(PROJECT_LIBRARIES)
+    list(APPEND _PKG_CONFIG_LIBRARIES ${PROJECT_LIBRARIES})
+  endif()
+  if(PROJECT_DEPENDENCIES_LIBRARIES)
+    list(APPEND _PKG_CONFIG_LIBRARIES ${PROJECT_DEPENDENCIES_LIBRARIES})
+  endif()
+
+  # filter out build configuration keywords and non-matching libraries
   set(PKG_CONFIG_LIBRARIES "")
-  if(PROJECT_LIBRARIES)
-    list(APPEND PKG_CONFIG_LIBRARIES ${PROJECT_LIBRARIES})
-  endif()
-  if(PROJECT_DEPENDENCIES_LIBRARIES)
-    list(APPEND PKG_CONFIG_LIBRARIES ${PROJECT_DEPENDENCIES_LIBRARIES})
-  endif()
+  list(LENGTH _PKG_CONFIG_LIBRARIES _count)
+  set(_index 0)
+  while(${_index} LESS ${_count})
+    list(GET _PKG_CONFIG_LIBRARIES ${_index} library)
+    if("${library}" STREQUAL "debug")
+      if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+        # skip keyword and debug library for non-debug builds
+        math(EXPR _index "${_index} + 1")
+        if(${_index} EQUAL ${_count})
+          message(FATAL_ERROR "catkin_package() the list of libraries '${_PKG_CONFIG_LIBRARIES}' ends with '${library}' which is a build configuration keyword and must be followed by a library")
+        endif()
+      endif()
+    elseif("${library}" STREQUAL "optimized")
+      if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+        # skip keyword and non-debug library for debug builds
+        math(EXPR _index "${_index} + 1")
+        if(${_index} EQUAL ${_count})
+          message(FATAL_ERROR "catkin_package() the list of libraries '${_PKG_CONFIG_LIBRARIES}' ends with '${library}' which is a build configuration keyword and must be followed by a library")
+        endif()
+      endif()
+    elseif("${library}" STREQUAL "general")
+      if(${_index} EQUAL ${_count})
+        message(FATAL_ERROR "catkin_package() the list of libraries '${_PKG_CONFIG_LIBRARIES}' ends with '${library}' which is a build configuration keyword and must be followed by a library")
+      endif()
+    else()
+      list(APPEND PKG_CONFIG_LIBRARIES ${library})
+    endif()
+    math(EXPR _index "${_index} + 1")
+  endwhile()

   #
   # DEVEL SPACE


Corrects test binary paths in the CMake build script.

--- cmake/internal_utils.cmake
+++ cmake/internal_utils.cmake
@@ -184,7 +184,7 @@
     # only at ctest runtime (by calling ctest -c <Configuration>), so
     # we have to escape $ to delay variable substitution here.
     add_test(${name}
-      ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/test/${name}.py
-          --build_dir=${CMAKE_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
+      ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
+          --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
   endif()
 endfunction()


Simplified includes and install locations

--- eigen.cmake
+++ eigen.cmake
@@ -1,27 +1,22 @@
 include(ExternalProject)
 include(eigen_VERSION)

+set(eigen_INSTALL ${PROJECT_SOURCE_DIR}/external/eigen/eigen-eigen-${eigen_archive_hash})
+
 set(eigen_INCLUDE_DIRS
-        ${PROJECT_SOURCE_DIR}/external/eigen-archive
-        ${PROJECT_SOURCE_DIR}/external/eigen-archive/${eigen_dir}
-        ${PROJECT_SOURCE_DIR}/external/third_party
-        ${PROJECT_SOURCE_DIR}/external)
+        ${PROJECT_SOURCE_DIR}/external/eigen
+        ${eigen_INSTALL})

-set(eigen_BUILD ${PROJECT_SOURCE_DIR}/external/third_party/eigen/src/eigen)
-set(eigen_INSTALL ${PROJECT_SOURCE_DIR}/external/third_party/eigen/install)
-
-ExternalProject_Add(protobuf
-        PREFIX ${PROJECT_SOURCE_DIR}/external/protobuf
+ExternalProject_Add(eigen
+        PREFIX ${PROJECT_SOURCE_DIR}/external/eigen
         URL ${eigen_URL}
         URL_HASH ${eigen_HASH}
         DOWNLOAD_DIR "${DOWNLOAD_LOCATION}"
-        INSTALL_DIR "${eigen_INSTALL}"
-        BINARY_DIR "${eigen_INSTALL}"
-
+
         CMAKE_ARGS
         -DCMAKE_BUILD_TYPE:STRING=Release
         -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
         -DCMAKE_INSTALL_PREFIX:STRING=${eigen_INSTALL}
-        -DINCLUDE_INSTALL_DIR:STRING=${PROJECT_SOURCE_DIR}/external/eigen-archive/${eigen_dir}
-
+        -DINCLUDE_INSTALL_DIR:STRING=${eigen_INSTALL})
+
 include_directories(${eigen_INCLUDE_DIRS})


More robust FindTBB

More robust FindTBB

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -14,13 +14,36 @@
 ## limitations under the License.                                           ##
 ## ======================================================================== ##

+IF (NOT TBB_ROOT)
+  SET(TBB_ROOT $ENV{TBB_ROOT})
+ENDIF()
+IF (NOT TBB_ROOT)
+  SET(TBB_ROOT $ENV{TBBROOT})
+ENDIF()
+
 IF (WIN32)
+  # workaround for parentheses in variable name / CMP0053
+  SET(PROGRAMFILESx86 "PROGRAMFILES(x86)")
+  SET(PROGRAMFILES32 "$ENV{${PROGRAMFILESx86}}")
+  IF (NOT PROGRAMFILES32)
+    SET(PROGRAMFILES32 "$ENV{PROGRAMFILES}")
+  ENDIF()
+  IF (NOT PROGRAMFILES32)
+    SET(PROGRAMFILES32 "C:/Program Files (x86)")
+  ENDIF()
   FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
     DOC "Root of TBB installation"
-    PATHS ${PROJECT_SOURCE_DIR}/tbb "C:/Program Files (x86)/Intel/Composer XE/tbb"
+    PATHS ${PROJECT_SOURCE_DIR}/tbb
     NO_DEFAULT_PATH
   )
-  FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h)
+  FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
+    HINTS ${TBB_ROOT}
+    PATHS
+      ${PROJECT_SOURCE_DIR}/../tbb
+      "${PROGRAMFILES32}/IntelSWTools/compilers_and_libraries/windows/tbb"
+      "${PROGRAMFILES32}/Intel/Composer XE/tbb"
+      "${PROGRAMFILES32}/Intel/compilers_and_libraries/windows/tbb"
+  )

   IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
     SET(TBB_ARCH intel64)
@@ -32,8 +55,10 @@
     SET(TBB_VCVER vc10)
   ELSEIF (MSVC11)
     SET(TBB_VCVER vc11)
+  ELSEIF (MSVC12)
+    SET(TBB_VCVER vc12)
   ELSE()
-    SET(TBB_VCVER vc12)
+    SET(TBB_VCVER vc14)
   ENDIF()

   SET(TBB_LIBDIR ${EMBREE_TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
@@ -56,10 +81,18 @@

   FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
     DOC "Root of TBB installation"
-    PATHS ${PROJECT_SOURCE_DIR}/tbb /opt/intel/tbb
+    PATHS ${PROJECT_SOURCE_DIR}/tbb
     NO_DEFAULT_PATH
   )
-  FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h)
+  FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
+    DOC "Root of TBB installation"
+    HINTS ${TBB_ROOT}
+    PATHS
+      ${PROJECT_SOURCE_DIR}/tbb
+      /opt/intel/composerxe/tbb
+      /opt/intel/compilers_and_libraries/tbb
+      /opt/intel/tbb
+  )

   IF (EMBREE_TBB_ROOT STREQUAL "")
     FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h)
@@ -92,8 +125,9 @@
       FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
     ELSE()
       FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${EMBREE_TBB_ROOT}/include NO_DEFAULT_PATH)
-      FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64  /usr/libx86_64-linux-gnu/ NO_DEFAULT_PATH)
-      FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64  /usr/libx86_64-linux-gnu/ NO_DEFAULT_PATH)
+      SET(TBB_HINTS HINTS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64 PATHS /usr/libx86_64-linux-gnu/)
+      FIND_LIBRARY(TBB_LIBRARY tbb ${TBB_HINTS})
+      FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc ${TBB_HINTS})
     ENDIF()
   ENDIF()