CMake: fixed misspellings

CMake: fixed misspellings

--- cmake/FindROOT.cmake
+++ cmake/FindROOT.cmake
@@ -83,7 +83,7 @@
     if(error)
         message(FATAL_ERROR "Error retrieving ROOT features : ${error}")
     else()
-        message(STATUS "ROOT was build with the following features: ${ROOT_FEATURES}")
+        message(STATUS "ROOT was built with the following features: ${ROOT_FEATURES}")
     endif(error)
     string(STRIP "${ROOT_FEATURES}" ROOT_FEATURES)

@@ -138,40 +138,40 @@
     # If AliEn support is enabled we need to point to AliEn
     execute_process(COMMAND ${ROOT_CONFIG} --has-alien OUTPUT_VARIABLE ROOT_HASALIEN ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
     if(error)
-        message(FATAL_ERROR "Error checking if ROOT was build with AliEn support: ${error}")
+        message(FATAL_ERROR "Error checking if ROOT was built with AliEn support: ${error}")
     endif(error)

     #if defined
     if(ROOT_HASALIEN)
         string(STRIP "${ROOT_HASALIEN}" ROOT_HASALIEN)
         if(ROOT_HASALIEN STREQUAL "yes")
-    	    if(ALIEN)
-        	add_definitions(-DWITHALIEN)
-
-        	# AliEn might bring some system libraries, we need to use them
-        	if(EXISTS "${ALIEN}/lib")
-        	    link_directories(${ALIEN}/lib)
-        	endif()
-
-        	# api/lib should always exists
-        	if(EXISTS "${ALIEN}/api/lib")
-        	    link_directories(${ALIEN}/api/lib)
-        	endif()
-
-        	# include for AliEn
-        	if(EXISTS "${ALIEN}/include")
-        	    include_directories(SYSTEM ${ALIEN}/include)
-        	endif()
-
-        	# api/include always exists
-        	if(EXISTS "${ALIEN}/api/include")
-        	    include_directories(SYSTEM ${ALIEN}/api/include)
-        	endif()
-
-        	set(ROOT_HASALIEN TRUE)
-    	    else(ALIEN)
-    		message(FATAL_ERROR "ROOT was build with AliEn support but no AliEn installation found. Please set \"ALIEN\" to point to your AliEn installation.")
-    	    endif(ALIEN)
+            if(ALIEN)
+            add_definitions(-DWITHALIEN)
+
+            # AliEn might bring some system libraries, we need to use them
+            if(EXISTS "${ALIEN}/lib")
+                link_directories(${ALIEN}/lib)
+            endif()
+
+            # api/lib should always exists
+            if(EXISTS "${ALIEN}/api/lib")
+                link_directories(${ALIEN}/api/lib)
+            endif()
+
+            # include for AliEn
+            if(EXISTS "${ALIEN}/include")
+                include_directories(SYSTEM ${ALIEN}/include)
+            endif()
+
+            # api/include always exists
+            if(EXISTS "${ALIEN}/api/include")
+                include_directories(SYSTEM ${ALIEN}/api/include)
+            endif()
+
+            set(ROOT_HASALIEN TRUE)
+            else(ALIEN)
+            message(FATAL_ERROR "ROOT was built with AliEn support but no AliEn installation found. Please set \"ALIEN\" to point to your AliEn installation.")
+            endif(ALIEN)
         else()
             set(ROOT_HASALIEN FALSE)
         endif()
@@ -180,7 +180,7 @@
     # Checking for xml support
     execute_process(COMMAND ${ROOT_CONFIG} --has-xml OUTPUT_VARIABLE ROOT_HASXML ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
     if(error)
-        message(FATAL_ERROR "Error checking if ROOT was build with xml support: ${error}")
+        message(FATAL_ERROR "Error checking if ROOT was built with xml support: ${error}")
     endif(error)

     # if defined
@@ -197,7 +197,7 @@
     # Checking for OpenGL support
     execute_process(COMMAND ${ROOT_CONFIG} --has-opengl OUTPUT_VARIABLE ROOT_HASOPENGL ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
     if(error)
-        message(FATAL_ERROR "Error checking if ROOT was build with OpenGL support: ${error}")
+        message(FATAL_ERROR "Error checking if ROOT was built with OpenGL support: ${error}")
     endif(error)

     if(ROOT_HASOPENGL)
@@ -228,7 +228,7 @@
     if(ALIROOT_STATIC)
         message(WARNING "AliRoot static build enabled! libRootExtra.a will be created.\nPlease remove when ROOT https://sft.its.cern.ch/jira/browse/ROOT-6904 issue is fixed")

-        # ROOT needs xml2 but it is not build with the static version so we have to add it
+        # ROOT needs xml2 but it is not built with the static version so we have to add it
         find_package(LibXml2)

         if(LIBXML2_FOUND)


syntax

syntax

--- cmake/FindZSTD.cmake
+++ cmake/FindZSTD.cmake
@@ -28,9 +28,11 @@

 set(zstd_incl_dirs "/usr/include" "/usr/local/include")
 if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+    set(_ZSTD_x86 "(x86)")
     set(zstd_incl_dirs ${zstd_incl_dirs} "$ENV{PROGRAMFILES}/zstd/include")
-    set(zstd_incl_dirs ${zstd_incl_dirs} "$ENV{PROGRAMFILES(x86)}/zstd/include")
+    set(zstd_incl_dirs ${zstd_incl_dirs} "$ENV{PROGRAMFILES${_ZSTD_x86}}/zstd/include")
     set(zstd_incl_dirs ${zstd_incl_dirs} "$ENV{PROGRAMDATA}/chocolatey/lib/zstandard/tools/include")
+    unset(_ZSTD_x86)
 endif()

 if(ZSTD_INCLUDEDIR)
@@ -45,9 +47,11 @@

 set(zstd_lib_dirs "/usr/lib" "/usr/local/lib")
 if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+    set(_ZSTD_x86 "(x86)")
     set(zstd_lib_dirs ${zstd_lib_dirs} "$ENV{PROGRAMFILES}/zstd/lib")
-    set(zstd_lib_dirs ${zstd_lib_dirs} "$ENV{PROGRAMFILES(x86)}/zstd/lib")
+    set(zstd_lib_dirs ${zstd_lib_dirs} "$ENV{PROGRAMFILES${_ZSTD_x86}}/zstd/lib")
     set(zstd_lib_dirs ${zstd_lib_dirs} "$ENV{PROGRAMDATA}/chocolatey/lib/zstandard/tools/dll")
+    unset(_ZSTD_x86)
 endif()

 if(ZSTD_LIBRARYDIR)


Fix for setting default UFID. (#95)

Fix for setting default UFID. (#95)

--- cmake/bde_ufid.cmake
+++ cmake/bde_ufid.cmake
@@ -609,26 +609,27 @@
         if(CMAKE_BUILD_TYPE)
             if(CMAKE_BUILD_TYPE STREQUAL "Release")
                 message(STATUS  "Setting 'Release' to UFID to 'opt_exc_mt'.")
-                set(UFID "opt_exc_mt" CACHE STRING "UFID for the project")
+                set(defUFID "opt_exc_mt")
             endif()
             if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
                 message(STATUS  "Setting 'RelWithDebInfo' to UFID to 'opt_dbg_exc_mt'.")
-                set(UFID "opt_dbg_exc_mt" CACHE STRING "UFID for the project")
+                set(defUFID "opt_dbg_exc_mt")
             endif()
             if(CMAKE_BUILD_TYPE STREQUAL "Debug")
                 message(STATUS  "Setting 'Debug' to UFID to 'dbg_exc_mt'.")
-                set(UFID "dbg_exc_mt" CACHE STRING "UFID for the project")
+                set(defUFID "dbg_exc_mt")
             endif()
         else()
             message(WARNING "Nor CMAKE_BUILD_TYPE nor UFID is defined.")
             message(STATUS  "Setting default UFID to 'opt_exc_mt'.")
-            set(UFID "opt_exc_mt" CACHE STRING "UFID for the project")
+            set(defUFID "opt_exc_mt")
         endif()
         if(BUILD_BITNESS)
             if (BUILD_BITNESS EQUAL "64")
-                STRING(APPEND UFID "_64")
+                STRING(APPEND defUFID "_64")
             endif()
         endif()
+        set(UFID ${defUFID} CACHE STRING "UFID for the project")
     endif()

     bde_parse_ufid(${UFID})


Now a common platform file is taken into account

--- cmake/platform.cmake
+++ cmake/platform.cmake
@@ -3,6 +3,9 @@
 macro( vq_platform_classes )
     foreach( CLASS ${ARGV} )
         vq_headers( ${CLASS}.h )
+        if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${CLASS}.cpp )
+            vq_sources( ${CLASS}.cpp )
+        endif()
         if( UNIX )
             if( APPLE )
                 set( SOURCE "apple/${CLASS}.cpp" )


COMP: Fixed CMake warning and zmq dependency in Python VirtEnv

--- CMake/TubeTKVirtualEnvSetup.cmake
+++ CMake/TubeTKVirtualEnvSetup.cmake
@@ -11,7 +11,7 @@
     set( virtualenv_script "${VIRTUALENV}" )
   else( VIRTUALENV )
     set( virtualenv_script
-      "@TubeTK_SOURCE_DIR@/Utilities/Python/virtualenv/virtualenv.py" )
+      "${TubeTK_SOURCE_DIR}/Utilities/Python/virtualenv/virtualenv.py" )
   endif( VIRTUALENV )
   # Create the virtual environment.
   execute_process( COMMAND "${PYTHON_EXECUTABLE}"
@@ -44,9 +44,10 @@
   list( APPEND PYTHON_TESTING_MODULES
     tornado
     pyzmq
-    ipython[zmq]
+    ipython
     jinja2
     matplotlib )
+    # ipython[zmq]
 endif( TubeTK_USE_IPYTHON_NOTEBOOKS )

 if( TubeTK_USE_PYQTGRAPH )


As explained in https://stackoverflow.com/a/32649327, we need to link against rt on linux machines, such as centos 6, that are before glibc 2.17 (#2284)

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -100,6 +100,11 @@
                   COMPONENTS ${Boost_COMPONENTS})
 endif ()

+# On Linux, Boost 1.55 and higher seems to need to link against -lrt
+if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND ${Boost_VERSION} GREATER 105499)
+    list (APPEND Boost_LIBRARIES "rt")
+endif ()
+
 message (STATUS "Boost version ${Boost_VERSION}")
 if (NOT Boost_FIND_QUIETLY)
     message (STATUS "Boost found        ${Boost_FOUND} ")


Add clangSupport as dependency to fix linker error (#1613)

Signed-off-by: Dieter De Baets <156577b38e69eef4f296686eaea35495089c8daa@unity3d.com>

--- src/cmake/modules/FindLLVM.cmake
+++ src/cmake/modules/FindLLVM.cmake
@@ -121,7 +121,7 @@

 foreach (COMPONENT clangFrontend clangDriver clangSerialization
                    clangParse clangSema clangAnalysis clangAST clangBasic
-                   clangEdit clangLex)
+                   clangEdit clangLex clangSupport)
     find_library ( _CLANG_${COMPONENT}_LIBRARY
                   NAMES ${COMPONENT}
                   PATHS ${LLVM_LIB_DIR})


fixed changed cmake modules path

fixed changed cmake modules path

--- dist/WkFind.cmake
+++ dist/WkFind.cmake
@@ -40,13 +40,13 @@
 	ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${PROJECT_BINARY_DIR}/CMake/
 													COMMENT "Creating ${PROJECT_BINARY_DIR}/CMake/" )

-	ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/CMake/ext/LibFindMacros.cmake ${PROJECT_BINARY_DIR}/CMake/
-													COMMENT "Copying ${PROJECT_SOURCE_DIR}/CMake/ext/LibFindMacros.cmake to ${PROJECT_BINARY_DIR}/CMake/" )
+	ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/CMake/Modules/LibFindMacros.cmake ${PROJECT_BINARY_DIR}/CMake/
+													COMMENT "Copying ${PROJECT_SOURCE_DIR}/CMake/Modules/LibFindMacros.cmake to ${PROJECT_BINARY_DIR}/CMake/" )

 	#
 	#start of the file + looking for dependencies
 	#
-	file( WRITE ${PROJECT_SOURCE_DIR}/CMake/ext/Find${PROJECT_NAME}.cmake "
+	file( WRITE ${PROJECT_SOURCE_DIR}/CMake/Modules/Find${PROJECT_NAME}.cmake "
 # - Try to find ${PROJECT_NAME}
 # Once done, this will define
 #
@@ -62,7 +62,7 @@
 	# finding dependencies
 	#
 	if ( ${PROJECT_NAME}_bin_depends )
-	file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/ext/Find${PROJECT_NAME}.cmake "
+	file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/Modules/Find${PROJECT_NAME}.cmake "

 # Dependencies
 libfind_package(${PROJECT_NAME} ${${PROJECT_NAME}_bin_depends})
@@ -73,7 +73,7 @@
 	#
 	#using pkg_config
 	#
-	file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/ext/Find${PROJECT_NAME}.cmake "
+	file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/Modules/Find${PROJECT_NAME}.cmake "

 # Use pkg-config to get hints about paths
 libfind_pkg_check_modules(${PROJECT_NAME}_PKGCONF ${PROJECT_NAME})
@@ -94,7 +94,7 @@
 	#
 	# setting up variables
 	#
-	file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/ext/Find${PROJECT_NAME}.cmake "
+	file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/Modules/Find${PROJECT_NAME}.cmake "
 # Set the include dir variables and the libraries and let libfind_process do the rest.
 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
 set(${PROJECT_NAME}_PROCESS_INCLUDES ${PROJECT_NAME}_INCLUDE_DIR )
@@ -105,23 +105,24 @@
 	# Adding dependencies
 	#
 	foreach ( looparg ${${PROJECT_NAME}_bin_depends} )
-		file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/ext/Find${PROJECT_NAME}.cmake "
+		file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/Modules/Find${PROJECT_NAME}.cmake "
 	set(${PROJECT_NAME}_PROCESS_INCLUDES ${PROJECT_NAME}_PROCESS_INCLUDES ${looparg}_INCLUDE_DIRS)
 	set(${PROJECT_NAME}_PROCESS_LIBS ${PROJECT_NAME}_PROCESS_LIBS ${looparg}_LIBRARIES)
+	#TODO : Add support for ${looparg}_RUN_LIBRARIES
 		")
 	endforeach ( looparg ${${PROJECT_NAME}_bin_depends} )

 	#
 	# Finalising
 	#
-	file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/ext/Find${PROJECT_NAME}.cmake "
+	file ( APPEND ${PROJECT_SOURCE_DIR}/CMake/Modules/Find${PROJECT_NAME}.cmake "

 libfind_process(${PROJECT_NAME})

 	")

-	ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/CMake/ext/Find${PROJECT_NAME}.cmake ${PROJECT_BINARY_DIR}/CMake/
-													COMMENT "Copying ${PROJECT_SOURCE_DIR}/CMake/ext/LibFindMacros.cmake to ${PROJECT_BINARY_DIR}/CMake/" )
+	ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/CMake/Modules/Find${PROJECT_NAME}.cmake ${PROJECT_BINARY_DIR}/CMake/
+													COMMENT "Copying ${PROJECT_SOURCE_DIR}/CMake/Modules/LibFindMacros.cmake to ${PROJECT_BINARY_DIR}/CMake/" )

 endmacro ( WkGenFind )


libbacktrace: Package license.

libbacktrace: Package license.

--- thirdparty/libbacktrace.cmake
+++ thirdparty/libbacktrace.cmake
@@ -191,3 +191,9 @@
 target_link_libraries (stest backtrace)
 add_dependencies (check stest)
 add_test (NAME libbacktrace_stest COMMAND stest)
+
+install (
+    FILES libbacktrace/LICENSE
+    DESTINATION ${DOC_INSTALL_DIR}
+    RENAME LICENSE-libbacktrace.txt
+)


cmake: set CMAKE_CXX_FLAGS in FBCompilerSettingsUnix.cmake

Summary:
It looks like the various CMAKE_CXX_FLAGS_* are simply ineffective, and I'm not
sure why, setting CMAKE_CXX_FLAGS does work though, and CMake appears to add
some release/debug flags to it when generating Ninja files.

Reviewed By: fanzeyi

Differential Revision: D27862117

fbshipit-source-id: a89f6182b5bae9a087f8fcfd4c5f9526f91e2adf

--- build/fbcode_builder/CMake/FBCompilerSettingsUnix.cmake
+++ build/fbcode_builder/CMake/FBCompilerSettingsUnix.cmake
@@ -6,6 +6,4 @@
 # to these shared compiler settings in order to avoid accidentally
 # breaking a build in another project!

-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations")
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations")


Fixed ifort CFLAGS

Fixed ifort CFLAGS

--- cmake/Fortran-helper.cmake
+++ cmake/Fortran-helper.cmake
@@ -22,7 +22,7 @@
 elseif (Fortran_COMPILER_NAME STREQUAL "ifort")
   # ifort
   set (CMAKE_Fortran_FLAGS_RELEASE "-O3")
-  set (CMAKE_Fortran_FLAGS_DEBUG   "-O0 -ggdb -Wall -Werror")
+  set (CMAKE_Fortran_FLAGS_DEBUG   "-O0 -ggdb -warn all")
 elseif (Fortran_COMPILER_NAME STREQUAL "g95")
   # g95
   set (CMAKE_Fortran_FLAGS_RELEASE "")


Disable non-portable compiler extensions.

--- cmake/SetCXXStandard.cmake
+++ cmake/SetCXXStandard.cmake
@@ -10,5 +10,5 @@
 if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
   ### Even though CMAKE_CXX_STANDARD_REQUIRED is supported since CMake 3.1, it doesn't work for Emscripten em++ together with
   ### Cmake 3.6.
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++${CMAKE_CXX_STANDARD}")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CMAKE_CXX_STANDARD}")
 endif()


Corrected search patch in Tudat Core CMake module.

git-svn-id: 4d207786bcfdcf18f314dcbc6ac3fbe5f8a98c88@482 ac7aa084-b6da-11df-bf42-7fac39f0224f

--- Tudat/External/CMake/FindTudatCore.cmake
+++ Tudat/External/CMake/FindTudatCore.cmake
@@ -88,7 +88,7 @@
       ${PROJECT_SOURCE_DIR}/External
       ${PROJECT_SOURCE_DIR}/../../../tudatCore/trunk
       ${PROJECT_SOURCE_DIR}/../../tudatCore/trunk
-      ${PROJECT_SOURCE_DIR}/../tudatCore/
+      ${PROJECT_SOURCE_DIR}/../../tudatCore/
       ${CMAKE_INSTALL_PREFIX}/include
       PATH_SUFFIXES TudatCore
     )


Squashed '3rdparty/github/cmake-utils/' changes from 6aca3dc..c219386

c219386 Specify component for every library type

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: c219386d72567732aebb128e297393fc3ed59857

--- cmake/MyPackageLibrary.cmake
+++ cmake/MyPackageLibrary.cmake
@@ -84,8 +84,16 @@
       TARGET_INCLUDE_DIRECTORIES(${_target} ${_include_directory_scope} ${_include_directory})
     ENDFOREACH ()
   ENDFOREACH ()
-  INSTALL (TARGETS ${PROJECT_NAME}        RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT DynamicLibraryComponent)
-  INSTALL (TARGETS ${PROJECT_NAME}_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT StaticLibraryComponent)
+  INSTALL (TARGETS ${PROJECT_NAME}
+    RUNTIME DESTINATION bin COMPONENT DynamicLibraryComponent
+    LIBRARY DESTINATION lib COMPONENT DynamicLibraryComponent
+    ARCHIVE DESTINATION lib COMPONENT DynamicLibraryComponent
+    )
+  INSTALL (TARGETS ${PROJECT_NAME}_static
+    RUNTIME DESTINATION bin COMPONENT StaticLibraryComponent
+    LIBRARY DESTINATION lib COMPONENT StaticLibraryComponent
+    ARCHIVE DESTINATION lib COMPONENT StaticLibraryComponent
+    )
   SET (_HAVE_DYNAMICLIBRARYCOMPONENT TRUE CACHE INTERNAL "Have DynamicLibraryComponent" FORCE)
   SET (_HAVE_STATICLIBRARYCOMPONENT TRUE CACHE INTERNAL "Have StaticLibraryComponent" FORCE)
   #


CMake: check for ClangFormat version4 exactly

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -7,13 +7,14 @@
 ENDIF()

 # Adding clang-format check and formatter if found
-FIND_PROGRAM(CLANG_FORMAT NAMES "clang-format-6.0" "clang-format-5.0" "clang-format-4.0" "clang-format")
+FIND_PROGRAM(CLANG_FORMAT NAMES "clang-format-4.0" "clang-format")
 IF(CLANG_FORMAT)
     EXEC_PROGRAM(${CLANG_FORMAT} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION)
     STRING(REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CLANG_MAJOR_VERSION ${CLANG_VERSION})

-    IF((${CLANG_MAJOR_VERSION} GREATER "4") OR (${CLANG_MAJOR_VERSION} EQUAL "4"))
-        MESSAGE(STATUS "Found ${CLANG_FORMAT}, adding formatting targets")
+    # We currently require version 4
+    IF(${CLANG_MAJOR_VERSION} EQUAL "4")
+        MESSAGE(STATUS "Found ${CLANG_FORMAT} version 4, adding formatting targets")
         ADD_CUSTOM_TARGET(
             format
             COMMAND
@@ -40,7 +41,7 @@
             COMMENT "Checking format compliance"
         )
     ELSE()
-        MESSAGE(STATUS "Could only find version ${CLANG_MAJOR_VERSION} of clang-format, but version >= 4 is required.")
+        MESSAGE(STATUS "Could only find version ${CLANG_MAJOR_VERSION} of clang-format, but version 4 is required.")
     ENDIF()
 ELSE()
     MESSAGE(STATUS "Could NOT find clang-format")


Option to control colorful output

Option to control colorful output

changes:
- added option to enable/disable colorful output - ON by default
- if colorful output is OFF, cmessage passes arguments to cmake message

--- cmake/colorful-message.cmake
+++ cmake/colorful-message.cmake
@@ -1,4 +1,6 @@
 include_guard()
+
+option(COLORFUL_OUTPUT "Enable/disable colorful output" ON)

 # cmake-format: off
 #https://stackoverflow.com/a/19578320/6367382
@@ -25,19 +27,39 @@

 function(cmessage)
   list(GET ARGV 0 MessageType)
-  if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
-    list(REMOVE_AT ARGV 0)
-    message(${MessageType} "${BoldRed}${ARGV}${ColourReset}")
-  elseif(MessageType STREQUAL WARNING OR MessageType STREQUAL NOTICE)
-    list(REMOVE_AT ARGV 0)
-    message(${MessageType} "${BoldYellow}${ARGV}${ColourReset}")
-  elseif(MessageType STREQUAL AUTHOR_WARNING)
-    list(REMOVE_AT ARGV 0)
-    message(${MessageType} "${BoldCyan}${ARGV}${ColourReset}")
-  elseif(MessageType STREQUAL STATUS)
-    list(REMOVE_AT ARGV 0)
-    message(${MessageType} "${Green}${ARGV}${ColourReset}")
+  if(COLORFUL_OUTPUT)
+    if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
+      list(REMOVE_AT ARGV 0)
+      message(${MessageType} "${BoldRed}${ARGV}${ColourReset}")
+    elseif(MessageType STREQUAL WARNING OR MessageType STREQUAL NOTICE)
+      list(REMOVE_AT ARGV 0)
+      message(${MessageType} "${BoldYellow}${ARGV}${ColourReset}")
+    elseif(MessageType STREQUAL AUTHOR_WARNING)
+      list(REMOVE_AT ARGV 0)
+      message(${MessageType} "${BoldCyan}${ARGV}${ColourReset}")
+    elseif(MessageType STREQUAL STATUS)
+      list(REMOVE_AT ARGV 0)
+      message(${MessageType} "${Green}${ARGV}${ColourReset}")
+    else()
+      message("${ARGV}")
+    endif()
   else()
-    message("${ARGV}")
+    set(CMAKE_DEFAULT_MESSAGE_TYPES
+        FATAL_ERROR
+        SEND_ERROR
+        WARNING
+        AUTHOR_WARNING
+        DEPRECATION
+        NOTICE
+        STATUS
+        VERBOSE
+        DEBUG
+        TRACE)
+    if(MessageType IN_LIST CMAKE_DEFAULT_MESSAGE_TYPES)
+      list(REMOVE_AT ARGV 0)
+      message(${MessageType} "${ARGV}")
+    else()
+      message("${ARGV}")
+    endif()
   endif()
 endfunction()


[cmake] Create exports for umbrella library targets

When using the umbrella llvm-libraries and clang-libraries targets, we
should export all library targets, otherwise they'll be part of our
distribution but not usable from the CMake package.

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

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

--- cmake/modules/AddClang.cmake
+++ cmake/modules/AddClang.cmake
@@ -91,6 +91,7 @@
     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")

       if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
+          "clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
           NOT LLVM_DISTRIBUTION_COMPONENTS)
         set(export_to_clangtargets EXPORT ClangTargets)
         set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True)


build: use `-isystem` rather than `-I` for C++ headers

The system headers should be given lower priority than the user
specified headers.  This requires that we include the system C++ headers
as `-isystem`.  Without this, it is not possible to use a custom
toolchain to replace the clang compiler for building the android
runtime.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -327,7 +327,7 @@
     swift_android_libcxx_include_paths(CFLAGS_CXX_INCLUDES)
     swift_android_include_for_arch("${CFLAGS_ARCH}" "${CFLAGS_ARCH}_INCLUDE")
     foreach(path IN LISTS CFLAGS_CXX_INCLUDES ${CFLAGS_ARCH}_INCLUDE)
-      list(APPEND result "\"${CMAKE_INCLUDE_FLAG_C}${path}\"")
+      list(APPEND result -isystem;${path})
     endforeach()
     list(APPEND result "-D__ANDROID_API__=${SWIFT_ANDROID_API_LEVEL}")
   elseif(CFLAGS_SDK STREQUAL WINDOWS)


Update qpp_dependencies.cmake

Update qpp_dependencies.cmake

--- cmake/qpp_dependencies.cmake
+++ cmake/qpp_dependencies.cmake
@@ -154,6 +154,7 @@
     # Disable spurious Eigen warnings with MSVC (warning STL4007)
     add_compile_definitions(_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING)
     add_compile_options(-bigobj)
+    add_definitions(-DNOMINMAX)
 endif ()

 #### MinGW or Cygwin have issues with object files that are too large


Update compiler.cmake

Update compiler.cmake

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -62,6 +62,9 @@
  # Set the compile flags
  if (TUDAT_BUILD_CLANG)
      add_compile_definitions(TUDAT_BUILD_CLANG)
+     if(WIN32)
+      add_definitions("-D_ENABLE_EXTENDED_ALIGNED_STORAGE")
+     endif()
      message(STATUS "Using clang compiler.")
      set(CMAKE_C_FLAGS "-Wall -std=c11")
      set(CMAKE_C_FLAGS_DEBUG "-g")


- Fix Emscripten build

- Fix Emscripten build

--- toolchain/cmake/Toolchains/js-emscripten.toolchain.cmake
+++ toolchain/cmake/Toolchains/js-emscripten.toolchain.cmake
@@ -28,6 +28,8 @@
     "Generate WASM version of code, not asm.js" OFF )

 set ( EM_COMMON "-s DISABLE_EXCEPTION_CATCHING=0 -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy -s USE_SDL=2 -s USE_ZLIB=1 -O2" )
+
+set ( SHELL_FILE "${CMAKE_SOURCE_DIR}/toolchain/desktop/emscripten/template.html" )

 if(COFFEE_GENERATE_WASM)
     message ( STATUS "Generating WASM assembly" )
@@ -36,7 +38,7 @@
     set ( CMAKE_C_FLAGS
         "${CMAKE_C_FLAGS} ${EM_COMMON} -s WASM=1" CACHE STRING "" )
     set ( CMAKE_EXE_LINKER_FLAGS
-        "${CMAKE_EXE_LINKER_FLAGS} ${EM_COMMON} -s WASM=1 --shell-file ${CMAKE_SOURCE_DIR}/desktop/emscripten/template.html" CACHE STRING "" )
+        "${CMAKE_EXE_LINKER_FLAGS} ${EM_COMMON} -s WASM=1 --shell-file ${SHELL_FILE}" CACHE STRING "" )
 else()
     message ( STATUS "Generating asm.js assembly" )
     set ( CMAKE_CXX_FLAGS
@@ -44,7 +46,7 @@
     set ( CMAKE_C_FLAGS
         "${CMAKE_C_FLAGS} ${EM_COMMON}" CACHE STRING "" )
     set ( CMAKE_EXE_LINKER_FLAGS
-        "${CMAKE_EXE_LINKER_FLAGS} ${EM_COMMON} --shell-file ${CMAKE_SOURCE_DIR}/desktop/emscripten/template.html" CACHE STRING "" )
+        "${CMAKE_EXE_LINKER_FLAGS} ${EM_COMMON} --shell-file ${SHELL_FILE}" CACHE STRING "" )
 endif()

 set(CMAKE_CROSSCOMPILING TRUE)


Fix MacOS error messages.

Fix MacOS error messages.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -350,7 +350,7 @@

 function(has_sanitizer has_sanitizer_arg has_sanitizer_retval)
     set(retval 0)
-    if(UNIX)
+    if(UNIX AND NOT APPLE)
         set(CI_ALPINE 0)
         execute_process(COMMAND cat /etc/os-release COMMAND grep -c Alpine OUTPUT_VARIABLE CI_ALPINE)
         if(CI_ALPINE EQUAL 0)


Squashed 'cmake/common/' changes from 0612519..9e7f35b

9e7f35b Merge branch 'hotfix/enable_languages' into 'master'
c4a3de2 Merge commit '5e926c428a5c97c9458cf69b0ba48db9ef2b23ab' into hotfix/enable_languages
562d44a Fixed error in cmake script with CXX language.
a7a12f3 Merge branch 'feature/common_compile_opts' into 'master'
dd2546f Hardening the warnings.
3f8331a Merge commit '1e27bfc7d3f03d0e0fd6a6f88a1f0a6cfba61377' as 'cmake/common'
d91ddbd Removing wrong cmake/common.
a4f9b91 Merge branch 'feature/common_compile_opts' into 'master'
268fe23 Fixing compilation errors on Windows.
4a0f1b4 Add size function. Added some const modifier.
e29e223 Refs #3243. Fixed error with CMake 3.5
c8b3675 Refs #3243. Increasing warnings level and fixing new warnings.
df48e52 Removed some inline modifiers
c77a49f indent
4f659ab Removed unused images.
d3a5b4a Removed old files.
890b118 Ref #3185. Improves sequences tests.
aacc7b2 Ref #3185. Fixes PX4 warnings due to aligment conversion issues. Removes inline methods and change sequence API. Adds missing bracers. Adapts tests to new api.
2c57da5 Cleans unused makefiles
02cd30d Ref #3185. Fixes endianness checks issues when no endinanness check is done
17e21e6 Merge branch 'feature/vs2017' into 'master'
7547975 Updated cmake/common
1a597d2 Refactoring on cmake files
04623b5 Fix bug in align_to function.
3dcb096 Added micro buffer remaining length function.
d9d655d Added micro buffer length function utility.
c8951b7 Refs #2884. Changed config.h.in
acf934a Refs #2886. Change cmake configuration endian behavior.
2d929b3 Merge branch 'master' into develop
987e799 Refs #2883. Setup subtree for cmake macros.
2047be9 Adds C99 requirement.
0061c9a Refs #2870. Fixed shared libs bugs on Windows.
70ad72b Refs #2870. Fixed Windows warning.
12a1ea1 Refs #2866. Fixed Windows bugs.
766474a Refs #2866. Moved gtest.cmake to project folder.
cedc95c Refs #2866. Added merger request advices.
4a795f7 Refs #2866. Removed string templates.
6d4361c Refs #2854. Fixed Windows CMake bugs.
4a14375 Refs #2838. Changed CMake tests architecture.
004cfbd Refs #2838. Checked installation on Linux.
4b40d88 Refs #2838. Checked installation on Windows.
f339b30 Refs #2838. Remodeled CMake.
69fa53b Refs #2832. Changed versioning in CMake.
78d34ed Refs #2801. Changed templates to avoid warning on Windows.
b0a2bfd Refs #2801. Compiling without warning on Windows.
4c02033 Refs #2810. Changed autogenerated header.
cf29fa8 Refs #2773. Changed header string template.
7b0bea6 Fix endianness bug.
ae461d6 Added init and reset function with offset.
e756e38 Refs #2785. Remove jump functionality.
b058623 Refs #2773. Modified string templates for MicroRTPSGen.
54aded8 Refs #2773. Added get_alignment functionality.
60d140f Minor change at reset buffer.
104096c Refs #2785. Added sizeof functions. Removed old examples. Added new example.
d96bad7 Added new init_micro_buffer function for endian
1c23671 Refs #2662. Changes for accept merge request
dca24be Refs #2662. Fix bug with the itetator position in arrays. All tests for sequences
92d2eba 2662 Added sequence functions.
01bc8b7 Refs #2662. Change api
84f0685 Refs #2662. Added funcionality (without test)
1c4c101 Refs #2583. Change examples and README format to markdown
fdb15a2 Refs #2583. Change tests.
13c2574 Refs #2583. Removed resize funcionality
ad1b9e2 Merge branch 'feature/windows' into 'develop'
1e1f10a Refs #2287. Fixed CMake Linux error.
f91f259 Refs #2287. Fixed Windows test linking error.
febd3ab Refs #2287. Fixed Windows compilation errors.
45e8c6a Refs:#2429, #2430. Adds returns and error flag. Adds tests.
9efc81d Merge branch 'develop' into feature/micrortpsgen
910c920 Refs #2391. Added new deallocate function to header and modified deserialization function.
5d95295 Merge branch 'develop' of git.sambaserver.eprosima.com:fastcdr/nanocdr into develop
f3d78a1 Uses cmake old policy for version numbers
309c5ce Refs #2393. Adds missing line on deserialization
c3eef39 Refs #2383. Added client.h to header file.
fbecfae Refs #2381. .stg cleanning for c types
f401638 Refs #2381. Avoid double \nin auto generated lines
9767808 Refs #2381. Adds simple IDL C types
6e65c09 Refs #2381. Added C Bacics Types.
edcddfc Refs #2381. Change stg file from FastCdrCommon.stg to MicroCdrCommon.stg
922ea32 Creates branch for micrortpsgen related code
cf0fd98 Refs #2375. Adds licenses
afc70df Removes extern warning
a4a754f Refs 2362. Extern Endianness check result
e56a5cb Fixes Nuttx compilation. Fixeds endianness detection
04cc754 [fix bug]: serialization arrays with units with bytes 2,4,8 count their size bad
e41b726 [fix bug]: alignment after arrays doesnt work
fda82f0 MACHINNE_ENDIANNESS definition is public now
e65c0db fix deserialize limit buffer bug
69f059f fix bug at array with elements higher than a byte
014b4ca fix endianness bug
5fe50b9 sequences removed
213736f fix endianness setup
bbe0322 removed some code comments
d8a95f6 added MicroState
1a34ba0 minor changes
bdacfaf Remove examples/performance_cmp_versions
4a91c2a add to .gitignore
3986ff6 Actualizacion de README.rst
06ba6bd Release version 2.0.0
3e57dab Release version 2.0.0
e92a78e add basics tests
b19d6a8 performance test. dynamic buffers. doc
8005b76 New API (definition and implementation) done (no tested).
334ad53 initial structure for the new changes
2ea6a1c initial structure for the new changes
4872048 Merge pull request #5 from dagar/pr-cmake_typo
54c5fec cmake fix message typo
50776f4 Merge pull request #4 from PeterDuerr/fix-memory-leaks
9b7fb94 Fix memory leaks indicated by cppcheck
74b2ed4 Code style: indirection operator attached to types
7cd4143 Code style: statement should be inside braces
98fd2cd Fixing code style
240a3cb Merge pull request #2 from dagar/pr-clang-tidy
8084fc6 readability add braces
f219395 Refs #1960. Added new interface for static user buffers and its reuse
5cc9dcb Refs #1960. Add bool and bool array support
bbca0a2 Refs #1960. Added extern 'C' to correct linkage in C++ projects
9eb3045 Refs #1960. Some changes to work with PX4 Firmware
7b2942c Refs #1960. Avoid double compilation for PX4/Firmware
fdad641 Refs #1960. Some changes
df2bf30 Merge pull request #1 from JavierIH/feature/refactor_micro
e3555ac Refs #1960. replaced nano for micro
313ddf3 Refs #1960. fix cmakelists and added options for testing
2f8cec8 Refs #1960. Adding PX4 support
74454c5 Refs #1960. added changes to compile on stm32
6820b69 add table with nanoCDR implemented types
ed3ab92 Add readme with minimal examples code
f9baf1a fix typos on some comments
16f1c6e Update documentation
c7224cc No memory leaks
5784178 repair memory leak
1b1159a Refs 1885 Buffer de lectura
0bc96f2 Refs 1885 Aligned and Non Aligned buffer
ce51288 Refs 1885 nanoBuffer - nanoCDR
bbf3551 Refs 1885 Alignment on write
4aa2738 Refs 1885 long to int64_t
ea64d07 Refs 1885 Multithread
6c2cd6b Refs 1885 Change Unsigned long to uint64_t
0a4dc42 Refs 1885 Change Int to int32_t
a608976 Refs 1875 Images to document
acc383d Warnings StaticTest
b73ab41 FAST to NANO
29ef95b Compile Windows
1eba3e9 Casting size_t to unisgned int
65e1b61 Casting size_t to unisgned int
492c43b Windows packaging
f237bc7 Test endianness
d996bd5 String Array and String Sequence
24325a9 GTest dynamic
4b6648f GTest dynamic and static
0b2d51c GTest static and dynamic
bb4d1fb CMake conf
b7a0de1 Document
bdd7e5c Initial commit

git-subtree-dir: cmake/common
git-subtree-split: 9e7f35b10b011618c60ebc103970dda6ca22d636

--- check_configuration.cmake
+++ check_configuration.cmake
@@ -79,25 +79,63 @@
 endmacro()

 macro(check_msvc_arch)
-    if(MSVC11)
+    if(MSVC_VERSION EQUAL 1700)
         if(CMAKE_CL_64)
             set(MSVC_ARCH "x64Win64VS2012")
         else()
             set(MSVC_ARCH "i86Win32VS2012")
         endif()
-    elseif(MSVC12)
+    elseif(MSVC_VERSION EQUAL 1800)
         if(CMAKE_CL_64)
             set(MSVC_ARCH "x64Win64VS2013")
         else()
             set(MSVC_ARCH "i86Win32VS2013")
         endif()
-    elseif(MSVC14)
+    elseif(MSVC_VERSION EQUAL 1900)
         if(CMAKE_CL_64)
             set(MSVC_ARCH "x64Win64VS2015")
         else()
             set(MSVC_ARCH "i86Win32VS2015")
         endif()
+    elseif(MSVC_VERSION GREATER 1900)
+        if(CMAKE_CL_64)
+            set(MSVC_ARCH "x64Win64VS2017")
+        else()
+            set(MSVC_ARCH "i86Win32VS2017")
+        endif()
     else()
-        message(FATAL_ERROR "Not supported version of Visual Studio")
+        if(CMAKE_CL_64)
+            set(MSVC_ARCH "x64Win64VSUnknown")
+        else()
+            set(MSVC_ARCH "i86Win32VSUnknown")
+        endif()
     endif()
 endmacro()
+
+function(set_common_compile_options target)
+    enable_language(C)
+    enable_language(CXX)
+    if(MSVC OR MSVC_IDE)
+        target_compile_options(${target} PRIVATE /W4)
+    else()
+        target_compile_options(${target} PRIVATE -Wall
+            -Wextra
+            -Wshadow
+            $<$<COMPILE_LANGUAGE:CXX>:-Wnon-virtual-dtor>
+            -pedantic
+            -Wcast-align
+            -Wunused
+            $<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>
+            -Wconversion
+            -Wsign-conversion
+            -Wlogical-op
+            $<$<COMPILE_LANGUAGE:CXX>:-Wuseless-cast>
+            -Wdouble-promotion
+            $<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
+            $<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6.0.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,6.0.0>>>>:-Wnull-dereference>
+            $<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,7.0.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,7.0.0>>>>:-Wduplicated-branches>
+            $<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6.0.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,6.0.0>>>>:-Wduplicated-cond>
+            $<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,7.0.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,7.0.0>>>>:-Wrestrict>
+            )
+    endif()
+endfunction()


fpta-cmake: don't treat warnings as errors for old MSVC.

--- cmake.fpta/compiler.cmake
+++ cmake.fpta/compiler.cmake
@@ -529,7 +529,9 @@
   # Release builds should not cause extra trouble.
   if(CC_HAS_WERROR AND (CI OR CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "Debug"))
     if(MSVC)
-      add_compile_flags("C;CXX" "/WX")
+      if(NOT MSVC_VERSION LESS 1910)
+        add_compile_flags("C;CXX" "/WX")
+      endif()
     elseif(HAVE_STD_C11 AND HAVE_STD_CXX11)
       add_compile_flags("C;CXX" "-Werror")
     endif()


Fix emscripten build

Fix emscripten build

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -73,6 +73,11 @@

     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EMCC_FLAGS}")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EMCC_FLAGS}")
+
+    find_program(NODE_JS_EXECUTABLE NAMES nodejs node)
+    if(NODE_JS_EXECUTABLE)
+        set(CMAKE_CROSSCOMPILING_EMULATOR ${NODE_JS_EXECUTABLE})
+    endif()
 endif()

 if(${CMAKE_CXX_COMPILER_ID} MATCHES "PGI")


Fix filename capitalization, add license info

--- cmake/EngineSrcList.cmake
+++ cmake/EngineSrcList.cmake
@@ -1,19 +1,34 @@
+#   Copyright 2017 James Fong
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
 # This file contains a listing of all of the source files used in the engine
 # build target. Populates a list called PGLOCAL_SOURCES_LIST
-# Prefer to not use GLOB, since that causes headaches

-# This function automatically appends the source directory to the given list
+# Preferred method of adding source items is through the Python script in:
+# `tool/GenerateEngineSrcList.py`
+
+# This function appends the provided string list to PGLOCAL_SOURCES_LIST
 set(PGLOCAL_SOURCES_LIST "")
 foreach(fname
-### ADD SOURCE FILES BELOW ###

 "Addons.cpp"
 "Camera.cpp"
 "Engine.cpp"
 "Events.cpp"
 "FontResource.cpp"
-"Gamelayer.cpp"
-"GamelayerMachine.cpp"
+"GameLayer.cpp"
+"GameLayerMachine.cpp"
 "Geometry.cpp"
 "GeometryResourceOpenGL.cpp"
 "GeometryResourceVulkan.cpp"
@@ -25,7 +40,7 @@
 "MaterialResource.cpp"
 "MathUtil.cpp"
 "MiscResource.cpp"
-"MissionGamelayer.cpp"
+"MissionGameLayer.cpp"
 "Model.cpp"
 "ModelInstance.cpp"
 "ModelResource.cpp"
@@ -60,7 +75,6 @@
 "Video.cpp"
 "VulkanUtils.cpp"

-### END SOURCE FILE LIST ###
 )
 list(APPEND PGLOCAL_SOURCES_LIST "${PGLOCAL_SOURCE_DIR}/${fname}")
 endforeach()


doctest 2.4.4 --> 2.4.6

doctest 2.4.4 --> 2.4.6

--- cmake/ExternalTools.cmake
+++ cmake/ExternalTools.cmake
@@ -263,8 +263,8 @@

 FetchContent_Declare(
     doctest
-    URL "https://github.com/onqtam/doctest/archive/2.4.4.tar.gz"
-    URL_HASH SHA256=3bcb62ad316bf4230873a336fcc6eb6292116568a6e19ab8cdd37a1610773d70)
+    URL "https://github.com/onqtam/doctest/archive/2.4.6.tar.gz"
+    URL_HASH SHA256=39110778e6baf373ef04342d7cb3fe35da104cb40769103e8a2f0035f5a5f1cb)
 FetchContent_GetProperties(doctest)
 if(NOT doctest_POPULATED)
     FetchContent_Populate(doctest)


Correct the install command, static library name and typo in nccl.cmake. (#5048)

--- cmake/external/nccl.cmake
+++ cmake/external/nccl.cmake
@@ -1,9 +1,8 @@
-INCLUDE(ExternalProject)
+include(ExternalProject)

-SET(NCCL_SOURCE_DIR ${THIRD_PARTY_PATH}/nccl)
+set(NCCL_SOURCE_DIR ${THIRD_PARTY_PATH}/nccl)

-INCLUDE_DIRECTORIES(${NCCL_SOURCE_DIR}/src/extern_nccl/src)
-
+include_directories(${NCCL_SOURCE_DIR}/src/extern_nccl/src)

 if(WITH_DSO)
   # If we use DSO, we do not build nccl, just download the dependencies
@@ -12,39 +11,39 @@
   set(NCCL_INSTALL_DIR "")
 else()
   # otherwise, we build nccl and link it.
+  set(NCCL_INSTALL_DIR ${THIRD_PARTY_PATH}/install/nccl)
+  # Note: cuda 8.0 is needed to make nccl
+  # When cuda is not installed on the system directory, need to set CUDA_HOME to your cuda root
   set(NCCL_BUILD_COMMAND "make -j 8")
-  set(NCCL_INSTALL_COMMAND  "make install")
-  SET(NCCL_INSTALL_DIR ${THIRD_PARTY_PATH}/install/nccl)
+  set(NCCL_INSTALL_COMMAND  "make install PREFIX=${NCCL_INSTALL_DIR}")
 endif()

 ExternalProject_Add(
-        extern_nccl
-        ${EXTERNAL_PROJECT_LOG_ARGS}
-        GIT_REPOSITORY  "https://github.com/NVIDIA/nccl.git"
-        GIT_TAG         "v1.3.4-1"
-        PREFIX          "${NCCL_SOURCE_DIR}"
-        UPDATE_COMMAND  ""
-        CONFIGURE_COMMAND ""
-        BUILD_COMMAND     "${NCCL_BUILD_COMMAND}"
-        INSTALL_COMMAND   "${NCCL_INSTALL_COMMAND}"
-        INSTALL_DIR       "${NCCL_INSTALL_DIR}"
-        TEST_COMMAND      ""
+    extern_nccl
+    ${EXTERNAL_PROJECT_LOG_ARGS}
+    GIT_REPOSITORY  "https://github.com/NVIDIA/nccl.git"
+    GIT_TAG         "v1.3.4-1"
+    PREFIX          "${NCCL_SOURCE_DIR}"
+    UPDATE_COMMAND  ""
+    CONFIGURE_COMMAND ""
+    BUILD_COMMAND     "${NCCL_BUILD_COMMAND}"
+    INSTALL_COMMAND   "${NCCL_INSTALL_COMMAND}"
+    INSTALL_DIR       "${NCCL_INSTALL_DIR}"
+    TEST_COMMAND      ""
 )

-if (WITH_DSO)
-  if (${CMAKE_VERSION} VERSION_LESS "3.3.0")
-    set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/lib_any_dummy.c)
-    file(WRITE ${dummyfile} "const char * dummy_any = \"${dummyfile}\";")
+if(WITH_DSO)
+  if(${CMAKE_VERSION} VERSION_LESS "3.3.0")
+    set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/lib_nccl_dummy.c)
+    file(WRITE ${dummyfile} "const char * dummy_nccl = \"${dummyfile}\";")
     add_library(nccl STATIC ${dummyfile})
   else()
     add_library(nccl INTERFACE)
   endif()
 else()
-  ADD_LIBRARY(nccl STATIC IMPORTED GLOBAL)
-  SET_PROPERTY(TARGET nccl PROPERTY IMPORTED_LOCATION
-          ${NCCL_INSTALL_DIR}/lib/libnccl.a)
+  add_library(nccl STATIC IMPORTED GLOBAL)
+  set_property(TARGET nccl PROPERTY IMPORTED_LOCATION
+               ${NCCL_INSTALL_DIR}/lib/libnccl_static.a)
 endif()

 add_dependencies(nccl extern_nccl)
-
-LIST(APPEND external_project_dependencies nccl)


* Possibly linking to the correct vulkan lib on linux

--- cmake/setup_configs.cmake
+++ cmake/setup_configs.cmake
@@ -8,15 +8,17 @@
 	target_compile_definitions(${target} PUBLIC -DTZ_VULKAN=1 -DTZ_OGL=0)

 	message(STATUS "configure_vulkan(${target}): $VULKAN_SDK == $ENV{VULKAN_SDK}")
-	target_link_directories(${target} PUBLIC "$ENV{VULKAN_SDK}/Lib")
+	if(WIN32)
+		target_link_directories(${target} PUBLIC "$ENV{VULKAN_SDK}/Lib")
+	elseif(UNIX)
+		target_link_directories(${target} PUBLIC "$ENV{VULKAN_SDK}/lib")
+	endif()
 	target_include_directories(${target} PUBLIC "$ENV{VULKAN_SDK}/include")
-	# This is absurd
 	if(WIN32)
 		target_link_libraries(${target} PUBLIC vulkan-1 vma)
 	elseif(UNIX)
-		target_link_libraries(${target} PUBLIC libvulkan.so.1 vma)
+		target_link_libraries(${target} PUBLIC vulkan vma)
 	endif()
-
 endfunction()

 function(configure_debug target)


COMP: fix the IOFDF module name used in wrapping

The name was still ITKIOFDF, preventing cmake to properly discover the
dependencies

Also avoid enabling this module by default (Brad Lowekamp)

Change-Id: If1962de5ac35f72afa052ffae549417dab7eb28b

--- Modules/Remote/IOFDF.remote.cmake
+++ Modules/Remote/IOFDF.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(IOFDF
   "FDFImageIO plugin for ITK. Authors Gleen Pierce/Nick Tustison/Kent Williams"
   GIT_REPOSITORY http://github.com/InsightSoftwareConsortium/itkFDFImageIO.git
-  GIT_TAG  e7b0fb56e504c7aff84eb61850de761ea307964c
+  GIT_TAG  eb9c5e6f5dc8e3f4ec58a327bb84fb97df870b15
   )


OSX: remove 2 typos in specialized config

--- cmake/SpecializedConfig/Config_OSX.cmake
+++ cmake/SpecializedConfig/Config_OSX.cmake
@@ -26,8 +26,8 @@
 #set(OPENCL_LIBRARYDIR         "${OPENCL_SEARCH_PATH}")

 set(GLEW_SEARCH_PATH          "${OSX_SEARCH_PATH}")
-find_path(GLEW_INCLUDE_DIR glew.h PATHS ${OSX_SEARCH_PATH}//include/GL )
-find_library(GLEW_LIBRARY libGLEW.a PATHS ${OSX_SEARCH_PATH}//lib )
+find_path(GLEW_INCLUDE_DIR glew.h PATHS ${OSX_SEARCH_PATH}/include/GL )
+find_library(GLEW_LIBRARY libGLEW.a PATHS ${OSX_SEARCH_PATH}/lib )
 set(GLEW_FOUND 1)

 set(GLUT_SEARCH_PATH          "${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/glut.framework")


Compile fix

Compile fix

--- cmake/modules/VisionarayHCCSupport.cmake
+++ cmake/modules/VisionarayHCCSupport.cmake
@@ -15,7 +15,7 @@
         OUTPUT_VARIABLE output
         )

-    if(${output} MATCHES ".*HCC.*")
+    if("${output}" MATCHES ".*HCC.*")

         # invoke hcc-config


CMAKE: Remove duplicated code after merge

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -1,8 +1,6 @@
 set( proj elastix )

-get_cmake_property( _varNames VARIABLES )#
-
-if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
+if( ${BUILD_SHARED_LIBS} )
   set( ELASTIX_BUILD_SHARED_LIBS ON )
 else()
   set( ELASTIX_BUILD_SHARED_LIBS OFF )
@@ -12,13 +10,6 @@

 set( ELASTIX_GIT_REPOSITORY ${git_protocol}://github.com/mstaring/elastix )
 set( ELASTIX_GIT_TAG 617b0729fb6200fce279f7e6388967c6315ddc90 )
-
-if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
-  set( ELASTIX_BUILD_SHARED_LIBS ON )
-else()
-  set( ELASTIX_BUILD_SHARED_LIBS OFF )
-  list( APPEND ep_itk_args"-DCMAKE_C_VISIBILITY_PRESET:BOOL=hidden" "-DCMAKE_CXX_VISIBILITY_PRESET:BOOL=hidden" )
-endif()

 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}


Add fallback method for downloading eigen3

Support for https may be disabled on some distributions of CMake.

--- cppcore/cmake/FindEigen3orDownload.cmake
+++ cppcore/cmake/FindEigen3orDownload.cmake
@@ -21,10 +21,14 @@

     if(NOT EXISTS ${EIGEN3_INCLUDE_DIR})
         message(STATUS "Downloading Eigen3...")
+        set(url "https://bitbucket.org/eigen/eigen/get/${EIGEN3_VERSION}.tar.gz")
         set(tmp_dir "${dependencies_dir}/tmp")
         set(tar_file "${tmp_dir}/eigen.tar.gz")
-        file(DOWNLOAD "https://bitbucket.org/eigen/eigen/get/${EIGEN3_VERSION}.tar.gz"
-             ${tar_file})
+        file(DOWNLOAD ${url} ${tar_file} STATUS status)
+
+    	if(status)
+    		execute_process(COMMAND wget -q -O ${tar_file} ${url})
+    	endif()

         # extract downloaded tar file
         execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${tar_file}


Cmake: Bugfix

Cmake: Bugfix

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@28867 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/modules/FindTRILINOS.cmake
+++ deal.II/cmake/modules/FindTRILINOS.cmake
@@ -127,11 +127,8 @@

 ELSE()

-  IF(TRILINOS_DIR MATCHES "-NOTFOUND")
-    SET(TRILINOS_DIR "" CACHE STRING
-      "A hint to a Trilinos installation"
-      FORCE
-      )
-  ENDIF()
+  SET(TRILINOS_DIR "" CACHE STRING
+    "An optional hint to a Trilinos installation"
+    )
 ENDIF()


Downgraded to gdal 1.10.0, because of compilation bug on Mac with 1.10.1

--- external/UseGDAL.cmake
+++ external/UseGDAL.cmake
@@ -24,7 +24,7 @@
 ExternalProject_Add(
     gdal
     DEPENDS netcdf
-    URL "http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz"
+    URL "http://download.osgeo.org/gdal/1.10.0/gdal-1.10.0.tar.gz"
     CONFIGURE_COMMAND <SOURCE_DIR>/configure --with-netcdf=${SOURCE_DIR} --prefix=${CMAKE_BINARY_DIR}/modules/omegaOsgEarth/gdal-prefix/src/gdal-install
     BUILD_IN_SOURCE 1
     #    BUILD_COMMAND make


lemon.cmake: Use correct variable name for source tag verison.

--- lemon.cmake
+++ lemon.cmake
@@ -38,7 +38,7 @@
     #URL                 ${lemon_URL}
     #URL_MD5             ${lemon_MD5}
     HG_REPOSITORY        ${lemon_URL}
-    HG_TAG               ${lemon_VERSION}
+    HG_TAG               ${lemon_TAG}
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ${BUILDEM_ENV_STRING} ${PATCH_EXE}
     	${lemon_SRC_DIR}/lemon/CMakeLists.txt ${PATCH_DIR}/lemon.patch


exclude build directory from coverage tests

--- cmake/modules/CodeCoverage.cmake
+++ cmake/modules/CodeCoverage.cmake
@@ -113,7 +113,7 @@

 		# Capturing lcov counters and generating report
 		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
-		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'build/*' 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
 		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned
 		COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned

@@ -150,7 +150,7 @@
 		${_testrunner} ${ARGV3}

 		# Running gcovr
-		COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/'  -o ${_outputname}.xml
+		COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -e '${CMAKE_SOURCE_DIR}/build/'  -o ${_outputname}.xml
 		WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
 		COMMENT "Running gcovr to produce Cobertura code coverage report."
 	)


Fixed romfs dependency.

Fixed romfs dependency.

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -301,20 +301,22 @@
 			-s rc.autostart
 		)

+
+	set(io_bin_image
+		${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}_${LABEL}.bin)
+
 	add_custom_command(OUTPUT romfs.bin
 		COMMAND cmake -E remove_directory ${romfs_temp_dir}
 		COMMAND cmake -E copy_directory ${romfs_src_dir} ${romfs_temp_dir}
 		COMMAND cmake -E copy rc.autostart ${romfs_temp_dir}/init.d
 		COMMAND cmake -E make_directory ${romfs_temp_dir}/extras
-		COMMAND cmake -E copy
-			${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}_${LABEL}.bin
-			${romfs_temp_dir}/extras
+		COMMAND cmake -E copy ${io_bin_image} ${romfs_temp_dir}/extras
 		#TODO add romfs cleanup of temp file .~, .swp etc
 		COMMAND ${PYTHON_EXECUTABLE} ${romfs_pruner}
 			--folder ${romfs_temp_dir}
 		COMMAND ${GENROMFS} -f ${CMAKE_CURRENT_BINARY_DIR}/romfs.bin
 			-d ${romfs_temp_dir} -V "NSHInitVol"
-		DEPENDS ${romfs_files} rc.autostart
+		DEPENDS ${romfs_files} rc.autostart ${io_bin_image}
 		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 		)


test for freeglut fix

test for freeglut fix

--- cmake_modules/FindFREEGLUT.cmake
+++ cmake_modules/FindFREEGLUT.cmake
@@ -18,7 +18,7 @@

 FIND_LIBRARY(
   FREEGLUT_LIBRARY
-  NAMES freeglut_static freeglut
+  NAMES freeglut_static freeglut glut
   PATH
     /opt/local/lib
     ${CMAKE_LIBRARY_PATH}


simplify geotrans use script: geotrans TARGET obsolete

* palam::geotranslate uses xpro::geotrans now
* reverts https://github.com/smanders/externpro/commit/50856c8d6f2c3c4ef98f23caf7598d7d9dc1b782
* issue https://github.com/smanders/externpro/issues/264


Update CppUTestConfigurationOptions.cmake

Add cxx flags for Borland 5.4 compiler to not report warnings  W8008 (if condition always false) and 8066 (unreachable code)

--- cmake/Modules/CppUTestConfigurationOptions.cmake
+++ cmake/Modules/CppUTestConfigurationOptions.cmake
@@ -16,6 +16,7 @@
 elseif (BORLAND)
     set(CPP_PLATFORM Borland)
     set(MEMORY_LEAK_DETECTION False)
+    set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -w-8008 -w-8066")
 elseif (STD_C)
     if(NOT CPP_PLATFORM)
         set(CPP_PLATFORM Gcc)


Rename "strip-comments" to "strip_comments" to make it consistent with "edit_cache"

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@28017 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
+++ deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
@@ -87,10 +87,13 @@
       )

     # Define a strip-comments target:
-    ADD_CUSTOM_TARGET(strip-comments
-      COMMAND perl -pi -e 's\#^[ \\t]*//.*\\n\#\#g;' ${TARGET_SRC}
-      COMMENT "strip comments"
-      )
+    FIND_PACKAGE(Perl QUIET)
+    IF(PERL_FOUND)
+      ADD_CUSTOM_TARGET(strip_comments
+        COMMAND ${PERL_EXECUTABLE} -pi -e 's\#^[ \\t]*//.*\\n\#\#g;' ${TARGET_SRC}
+        COMMENT "strip comments"
+        )
+    ENDIF()

     # Print out some usage information:
     MESSAGE(
@@ -108,19 +111,17 @@
 #
 #      $ make debug          - to switch the build type to \"Debug\"
 #      $ make release        - to switch the build type to \"Release\"
+#      $ make edit_cache     - to change (cached) configuration variables
+#                              and rerun the configure and generate phases of CMake
 #
-#      $ make strip-comments - strip the source files in this
+#      $ make strip_comments - strip the source files in this
 #                              directory off the documentation comments
-#
 #      $ make clean          - to remove the generated executable as well as
 #                              all intermediate compilation files
 #      $ make runclean       - to remove all output generated by the program
 #      $ make distclean      - to clean the directory from _all_ generated
 #                              files (includes clean, runclean and the removal
 #                              of the generated build system)
-#
-#      $ make edit_cache     - to change (cached) configuration variables
-#                              and rerun the configure and generate phases of CMake
 #
 #  Have a nice day!
 #


Improve emscripten support.

Improve emscripten support.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -33,9 +33,8 @@
             set(CC_PLATFORM "linux")
         elseif(CC STREQUAL "emcc")
             set(CC_NAME "emscripten")
-            exec_program($ENV{CC} ARGS --version OUTPUT_VARIABLE CC_VERSION_VERBOSE)
-            string(REGEX REPLACE ".*gcc\\/clang\\-like replacement\\) ([0-9]+\\.[0-9]+).*" "\\1" CC_VERSION ${CC_VERSION_VERBOSE})
-            set(CC_ARCH "asmjs")
+            exec_program($ENV{CC} ARGS -dumpversion OUTPUT_VARIABLE CC_VERSION)
+            set(CC_ARCH "wasm")
             set(CC_PLATFORM "web")
         else()
             string(FIND "${CC}" "gcc" CC_GCC)
@@ -499,6 +498,11 @@
         endif()
     endif()
 endif()
+if(CC_NAME STREQUAL "emscripten")
+    if(CC_VERSION VERSION_GREATER 1.38.34 OR CC_VERSION VERSION_EQUAL 1.38.34)
+        set(CTEST_MEMORYCHECK_TYPE "UndefinedBehaviorSanitizer")
+    endif()
+endif()
 if(CTEST_MEMORYCHECK_TYPE STREQUAL "UndefinedBehaviorSanitizer")
     set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "verbosity=1 print_stacktrace=1")
     set(CTEST_BUILD_NAME "${CI_BUILD_NAME}-ubsan")


Fixed more catkinization issues.

Fixed more catkinization issues.

--- catkin.cmake
+++ catkin.cmake
@@ -4,13 +4,15 @@
   std_msgs
   sensor_msgs
   image_transport
-  roscpp)
+  roscpp
+)
 find_package(OpenCV REQUIRED)
 find_package(Eigen REQUIRED)

 # Set up the ROS Catkin package settings.
-catkin_package()
+catkin_package() # TODO: is this correct?

+# Import the yaml-cpp libraries.
 include(FindPkgConfig)
 pkg_check_modules(Yaml REQUIRED yaml-cpp)

@@ -20,9 +22,9 @@
 # Download the external Swatbotics repository.
 include(ExternalProject)
 ExternalProject_Add(apriltags_swatbotics_EXTERNAL
-    PREFIX ${PROJECT_SOURCE_DIR}/build/apriltags
     GIT_REPOSITORY https://github.com/personalrobotics/apriltags-cpp
     INSTALL_COMMAND ""
+    BUILD_COMMAND "make" # I don't know why this works...
     CMAKE_ARGS -DCMAKE_CXX_FLAGS=-frounding-math -DBUILD_SHARED_LIBS:BOOL=ON
 )

@@ -31,7 +33,9 @@
   SOURCE_DIR BINARY_DIR INSTALL_DIR)
 set(apriltags_swatbotics_INCLUDE_DIRS
   "${SOURCE_DIR}"
-  CACHE INTERNAL "" FORCE
+)
+set(apriltags_swatbotics_LIBRARIES
+  "${BINARY_DIR}/libapriltags.so"
 )

 # Tell CMake that the external project generated a library so we
@@ -39,7 +43,8 @@
 add_library(apriltags_swatbotics UNKNOWN IMPORTED)
 set_property(TARGET apriltags_swatbotics
   PROPERTY IMPORTED_LOCATION
-  ${BINARY_DIR}/libapriltags.so)
+  ${apriltags_swatbotics_LIBRARIES}
+)
 add_dependencies(apriltags_swatbotics apriltags_swatbotics_EXTERNAL)

 include_directories(
@@ -48,7 +53,8 @@
     ${Eigen_INCLUDE_DIRS}
     ${OpenCV_INCLUDE_DIRS}
     ${Yaml_INCLUDE_DIRS}
-    ${apriltags_swatbotics_INCLUDE_DIRS})
+    ${apriltags_swatbotics_INCLUDE_DIRS}
+)

 add_executable(apriltags src/apriltags.cpp)
 target_link_libraries(apriltags ${catkin_LIBRARIES})
@@ -58,5 +64,10 @@
 target_link_libraries(apriltags apriltags_swatbotics)

 install(TARGETS apriltags
-    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
+  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
+  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
+  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
+)
+install(FILES ${apriltags_swatbotics_LIBRARIES}
+  DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
+)


Mathematica 10.1 related changes

Mathematica 10.1 related changes

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -101,7 +101,7 @@
 include(CMakeFindFrameworks)

 set (Mathematica_CMAKE_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-set (Mathematica_CMAKE_MODULE_VERSION "3.1.0")
+set (Mathematica_CMAKE_MODULE_VERSION "3.1.1")

 # internal function to convert Windows path to Cygwin workable CMake path
 # E.g., "C:\Program Files" is converted to "/cygdrive/c/Program Files"
@@ -166,12 +166,32 @@

 # internal macro to compute kernel paths (relative to installation directory)
 macro (_get_host_kernel_names _outKernelNames)
-	if (CMAKE_HOST_WIN32 OR CYGWIN)
-		set (${_outKernelNames} "wolfram.exe" "math.exe")
-	elseif (CMAKE_HOST_APPLE)
-		set (${_outKernelNames} "Contents/MacOS/WolframKernel" "Contents/MacOS/MathKernel")
-	elseif (CMAKE_HOST_UNIX)
-		set (${_outKernelNames} "Executables/WolframKernel" "Executables/MathKernel" "Executables/math")
+	if (Mathematica_FIND_VERSION AND Mathematica_FIND_VERSION_EXACT)
+		if (Mathematica_FIND_VERSION VERSION_LESS "10.0.0")
+			if (CMAKE_HOST_WIN32 OR CYGWIN)
+				set (${_outKernelNames} "math.exe")
+			elseif (CMAKE_HOST_APPLE)
+				set (${_outKernelNames} "Contents/MacOS/MathKernel")
+			elseif (CMAKE_HOST_UNIX)
+				set (${_outKernelNames} "Executables/MathKernel" "Executables/math")
+			endif()
+		else()
+			if (CMAKE_HOST_WIN32 OR CYGWIN)
+				set (${_outKernelNames} "wolfram.exe")
+			elseif (CMAKE_HOST_APPLE)
+				set (${_outKernelNames} "Contents/MacOS/WolframKernel")
+			elseif (CMAKE_HOST_UNIX)
+				set (${_outKernelNames} "Executables/WolframKernel")
+			endif()
+		endif()
+	else()
+		if (CMAKE_HOST_WIN32 OR CYGWIN)
+			set (${_outKernelNames} "wolfram.exe" "math.exe")
+		elseif (CMAKE_HOST_APPLE)
+			set (${_outKernelNames} "Contents/MacOS/WolframKernel" "Contents/MacOS/MathKernel")
+		elseif (CMAKE_HOST_UNIX)
+			set (${_outKernelNames} "Executables/WolframKernel" "Executables/MathKernel" "Executables/math")
+		endif()
 	endif()
 endmacro()

@@ -280,11 +300,12 @@
 function (_add_registry_search_paths _outSearchPaths)
 	if (CMAKE_HOST_WIN32)
 		foreach (_registryKey IN ITEMS ${ARGN})
-			# use 64-bit reg.exe under WoW64 to make sure we search all keys
-			set (_regExe "$ENV{windir}/sysnative/reg.exe")
-			if (NOT EXISTS "${_regExe}")
-				# use default reg.exe
-				set (_regExe "reg.exe")
+			set (_regExe "reg.exe")
+			if (DEFINED ENV{windir})
+				# use 64-bit reg.exe under WoW64 to make sure we search all keys
+				if (EXISTS "$ENV{windir}/sysnative/reg.exe")
+					set (_regExe "$ENV{windir}/sysnative/reg.exe")
+				endif()
 			endif()
 			execute_process(
 				COMMAND "${_regExe}" query "${_registryKey}" "/s"
@@ -372,7 +393,10 @@

 # internal macro to determine default Mathematica installation (the one which is on the system search path)
 macro (_add_default_search_path _outSearchPaths)
-	file (TO_CMAKE_PATH "$ENV{PATH}" _searchPaths)
+	set (_searchPaths "")
+	if (DEFINED ENV{PATH})
+		file (TO_CMAKE_PATH "$ENV{PATH}" _searchPaths)
+	endif()
 	_get_host_kernel_names(_kernelNames)
 	foreach (_searchPath IN LISTS _searchPaths)
 		if (CMAKE_HOST_WIN32 OR CYGWIN)
@@ -415,7 +439,7 @@
 		endif()
 		# add standard Mathematica Windows installation paths
 		foreach (_envVar IN LISTS _WindowsProgramFilesEnvVars)
-			if ("$ENV{${_envVar}}" MATCHES ".+")
+			if (DEFINED ENV{${_envVar})
 				_to_cmake_path("$ENV{${_envVar}}" _unixPath)
 				list (APPEND ${_outSearchPaths} "${_unixPath}/Wolfram Research" )
 			endif()
@@ -575,12 +599,17 @@
 # internal macro to compute host Mathematica SystemIDs
 macro (_get_host_system_IDs _outSystemIDs)
 	if (CMAKE_HOST_WIN32)
-		if ("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "AMD64" OR
-			"$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "AMD64")
-			# host is native 64-bit Windows
-			set (${_outSystemIDs} "Windows-x86-64")
-		else()
-			set (${_outSystemIDs} "Windows")
+		set (${_outSystemIDs} "Windows")
+		if (DEFINED ENV{PROCESSOR_ARCHITEW6432})
+			if ("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "AMD64")
+				# running of WoW64, host is native 64-bit Windows
+				set (${_outSystemIDs} "Windows-x86-64")
+			endif()
+		elseif (DEFINED ENV{PROCESSOR_ARCHITECTURE})
+			if ("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "AMD64")
+				# host is native 64-bit Windows
+				set (${_outSystemIDs} "Windows-x86-64")
+			endif()
 		endif()
 	else()
 		# always determine host system ID from
@@ -787,12 +816,17 @@
 	if (CYGWIN)
 		set (${_outFlavor} "cygwin")
 	elseif (CMAKE_HOST_WIN32)
-		if ("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "AMD64" OR
-			"$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "AMD64")
-			# host is native 64-bit Windows
-			set (${_outFlavor} "mldev64")
-		else()
-			set (${_outFlavor} "mldev32")
+		set (${_outFlavor} "mldev32")
+		if (DEFINED ENV{PROCESSOR_ARCHITEW6432})
+			if ("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "AMD64")
+				# running of WoW64, host is native 64-bit Windows
+				set (${_outFlavor} "mldev64")
+			endif()
+		elseif (DEFINED ENV{PROCESSOR_ARCHITECTURE})
+			if ("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "AMD64")
+				# host is native 64-bit Windows
+				set (${_outFlavor} "mldev64")
+			endif()
 		endif()
 	elseif (CMAKE_HOST_APPLE)
 		if (Mathematica_VERSION)
@@ -1235,16 +1269,16 @@
 		# guess Mathematica_BASE_DIR from environment
 		# environment variable MATHEMATICA_BASE may override default
 		# $BaseDirectory, see http://reference.wolfram.com/language/tutorial/ConfigurationFiles.html
-		if ("$ENV{MATHEMATICA_BASE}" MATCHES ".+")
+		if (DEFINED ENV{MATHEMATICA_BASE})
 			set (Mathematica_BASE_DIR "$ENV{MATHEMATICA_BASE}")
 		elseif (CMAKE_HOST_WIN32 OR CYGWIN)
-			if ("$ENV{ALLUSERSAPPDATA}" MATCHES ".+")
+			if (DEFINED $ENV{PROGRAMDATA})
+				set (Mathematica_BASE_DIR "$ENV{PROGRAMDATA}\\Mathematica")
+			elseif (DEFINED ENV{ALLUSERSAPPDATA})
 				set (Mathematica_BASE_DIR "$ENV{ALLUSERSAPPDATA}\\Mathematica")
-			elseif ("$ENV{PROGRAMDATA}" MATCHES ".+")
-				set (Mathematica_BASE_DIR "$ENV{PROGRAMDATA}\\Mathematica")
-			elseif ("$ENV{USERPROFILE}" MATCHES ".+" AND
-					"$ENV{ALLUSERSPROFILE}" MATCHES ".+" AND
-					"$ENV{APPDATA}" MATCHES ".+")
+			elseif (DEFINED ENV{USERPROFILE} AND
+					DEFINED ENV{ALLUSERSPROFILE} AND
+					DEFINED ENV{APPDATA})
 				string (REPLACE "$ENV{USERPROFILE}" "$ENV{ALLUSERSPROFILE}"
 					Mathematica_BASE_DIR "$ENV{APPDATA}\\Mathematica")
 			endif()
@@ -1286,18 +1320,18 @@
 		# guess Mathematica_USERBASE_DIR from environment
 		# environment variable MATHEMATICA_USERBASE may override default
 		# $UserBaseDirectory, see http://reference.wolfram.com/language/tutorial/ConfigurationFiles.html
-		if ("$ENV{MATHEMATICA_USERBASE}" MATCHES ".+")
+		if (DEFINED ENV{MATHEMATICA_USERBASE})
 			set (Mathematica_USERBASE_DIR "$ENV{MATHEMATICA_USERBASE}")
 		elseif (CMAKE_HOST_WIN32 OR CYGWIN)
-			if ("$ENV{APPDATA}" MATCHES ".+")
+			if (DEFINED ENV{APPDATA})
 				set (Mathematica_USERBASE_DIR "$ENV{APPDATA}\\Mathematica")
 			endif()
 		elseif (CMAKE_HOST_APPLE)
-			if ("$ENV{HOME}" MATCHES ".+")
+			if (DEFINED ENV{HOME})
 				set (Mathematica_USERBASE_DIR "$ENV{HOME}/Library/Mathematica")
 			endif()
 		elseif (CMAKE_HOST_UNIX)
-			if ("$ENV{HOME}" MATCHES ".+")
+			if (DEFINED ENV{HOME})
 				set (Mathematica_USERBASE_DIR "$ENV{HOME}/.Mathematica")
 			endif()
 		endif()
@@ -1795,6 +1829,20 @@
 	endif()
 	if (NOT DEFINED Mathematica_MUnit_PACKAGE_DIR)
 		set (Mathematica_MUnit_PACKAGE_DIR "Mathematica_MUnit_PACKAGE_DIR-NOTFOUND")
+	endif()
+endmacro()
+
+# internal macro to find LibaryLink package
+macro (_find_librarylink_package)
+	if (COMMAND Mathematica_FIND_PACKAGE)
+		Mathematica_FIND_PACKAGE(Mathematica_LibraryLink_PACKAGE_FILE "LibraryLink`LibraryLink`")
+		# determine enclosing LibraryLink package directory
+		if (Mathematica_LibraryLink_PACKAGE_FILE)
+			Mathematica_GET_PACKAGE_DIR(Mathematica_LibraryLink_PACKAGE_DIR "${Mathematica_LibraryLink_PACKAGE_FILE}")
+		endif()
+	endif()
+	if (NOT DEFINED Mathematica_LibraryLink_PACKAGE_DIR)
+		set (Mathematica_LibraryLink_PACKAGE_DIR "Mathematica_LibraryLink_PACKAGE_DIR-NOTFOUND")
 	endif()
 endmacro()

@@ -2203,6 +2251,7 @@
 			message (STATUS "WolframLibrary include dir ${Mathematica_WolframLibrary_INCLUDE_DIR}")
 			message (STATUS "WolframLibrary library ${Mathematica_WolframLibrary_LIBRARY}")
 			message (STATUS "WolframLibrary libraries ${Mathematica_WolframLibrary_LIBRARIES}")
+			message (STATUS "LibraryLink package dir ${Mathematica_LibraryLink_PACKAGE_DIR}")
 		else()
 			message (STATUS "WolframLibrary not found")
 		endif()
@@ -2288,6 +2337,7 @@
 		Mathematica_WSTP_HOST_ROOT_DIR
 		Mathematica_JLink_PACKAGE_DIR
 		Mathematica_MUnit_PACKAGE_FILE
+		Mathematica_LibraryLink_PACKAGE_FILE
 		Mathematica_CMAKE_MODULE_VERSION)
 endmacro()

@@ -2336,6 +2386,7 @@
 			Mathematica_KERNEL_USERBASE_DIR
 			Mathematica_JLink_PACKAGE_DIR
 			Mathematica_MUnit_PACKAGE_FILE
+			Mathematica_LibraryLink_PACKAGE_FILE
 			Mathematica_JLink_JAVA_EXECUTABLE)
 		_get_dependent_cache_variables("Mathematica_MathLink_HOST_ROOT_DIR" ${_outDependentVars})
 		_get_dependent_cache_variables("Mathematica_WSTP_HOST_ROOT_DIR" ${_outDependentVars})
@@ -2470,6 +2521,7 @@
 		Mathematica_KERNEL_BASE_DIR
 		Mathematica_KERNEL_USERBASE_DIR
 		Mathematica_MUnit_PACKAGE_FILE
+		Mathematica_LibraryLink_PACKAGE_FILE
 		Mathematica_JLink_LIBRARY
 		Mathematica_JLink_JAVA_EXECUTABLE
 	)
@@ -2577,6 +2629,7 @@
 			_find_wolframlibrary()
 			_setup_wolframlibrary_version_variables()
 			_setup_wolframlibrary_library_variables()
+			_find_librarylink_package()
 		elseif ("${_component}" STREQUAL "JLink")
 			_find_jlink()
 			_setup_jlink_version_variables()
@@ -2705,9 +2758,13 @@
 	_select_configuration_run_time_dirs(_configRuntimeDirs)
 	_get_host_library_search_path_envvars(_envVars)
 	foreach (_envVar IN LISTS _envVars)
-		file(TO_CMAKE_PATH "$ENV{${_envVar}}" _envRuntimeDirs)
-		# prepend Mathematica runtime directories to system ones
-		set (_runtimeDirs ${_configRuntimeDirs} ${_envRuntimeDirs})
+		if (DEFINED ENV{${_envVar}})
+			file (TO_CMAKE_PATH "$ENV{${_envVar}}" _envRuntimeDirs)
+			# prepend Mathematica runtime directories to system ones
+			set (_runtimeDirs ${_configRuntimeDirs} ${_envRuntimeDirs})
+		else()
+			set (_runtimeDirs ${_configRuntimeDirs})
+		endif()
 		if (_runtimeDirs)
 			list (REMOVE_DUPLICATES _runtimeDirs)
 			if (CYGWIN)
@@ -2962,9 +3019,12 @@
 			if (NOT _lastStatement MATCHES "^(Quit|Exit)\\[")
 				list (APPEND _code "Quit[]")
 			endif()
-		elseif ("${Mathematica_VERSION}" VERSION_LESS "8.0")
-			# -script option requires at least Mathematica 8, thus process the given script with Get function instead
-			# according to http://reference.wolfram.com/language/tutorial/WolframLanguageScripts.html
+		elseif ("${Mathematica_VERSION}" VERSION_LESS "10.0")
+			# Although the -script option is supported since Mathematica 8, under Mathematica 9
+			# using the -script option does not work as expected, if it is preceded by multiple inline
+			# Mathematica commands using the -run option.
+			# Thus we use the Get function instead, which should work with all versions.
+			# According to http://reference.wolfram.com/language/tutorial/WolframLanguageScripts.html
 			# running the kernel with the -script option is equivalent to reading the file using the Get function
 			# with a single difference: after the last command in the file is evaluated, the kernel terminates
 			Mathematica_TO_NATIVE_PATH("${_scriptFileAbs}" _scriptFileMma)
@@ -2980,9 +3040,9 @@
 			_code_segments_to_compound_expressions(_code _codeSegments)
 			list (APPEND ${_cmdVar} ${_codeSegments})
 		endif()
-		# finally, run given script with -script option if using Mathematica 8 or later
+		# finally, run given script with -script option if using Mathematica 10 or later
 		if (DEFINED ${_scriptVar})
-			if (NOT "${Mathematica_VERSION}" VERSION_LESS "8.0")
+			if (NOT "${Mathematica_VERSION}" VERSION_LESS "10.0")
 				list (APPEND ${_cmdVar} "-script" "${_scriptFileAbs}")
 				# after the last command in the script file is evaluated, the kernel terminates automatically
 			endif()
@@ -3456,9 +3516,9 @@
 		foreach(_target ${ARGV})
 			get_target_property(_targetType ${_target} TYPE)
 			if (_targetType MATCHES "MODULE_LIBRARY|SHARED_LIBRARY|EXECUTABLE")
-				foreach(_library "${Mathematica_WolframLibrary_LIBRARY}" "${Mathematica_MathLink_LIBRARY}" "${Mathematica_WSTP_LIBRARY}")
-					if (_library)
-						_get_install_name("${_library}" _libraryInstallName _libraryAbsPath)
+				foreach(_library Mathematica_WolframLibrary_LIBRARY Mathematica_MathLink_LIBRARY Mathematica_WSTP_LIBRARY)
+					if (DEFINED ${_library})
+						_get_install_name("${${_library}}" _libraryInstallName _libraryAbsPath)
 						if (_libraryInstallName)
 							add_custom_command (TARGET ${_target}
 								POST_BUILD COMMAND "${CMAKE_INSTALL_NAME_TOOL}"


COMP: MSVC: turn off manifest file generation

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -209,6 +209,9 @@
         set(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import")
       endif()
     else()
+      if(MSVC)
+        set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} /MANIFEST:NO")
+      endif()
       # if CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is on, then
       # BUILD_SHARED_LIBS works as it would on other systems
       if(NOT CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS)
@@ -349,4 +352,4 @@
   elseif(MINGW)
     set_target_properties(${exe_target} PROPERTIES LINK_FLAGS "-Wl,--stack,${requested_stack_size}")
   endif()
-endmacro()+endmacro()


Revert "COMP: hide deprecated warnings on dashboard"

This reverts commit f72c58b75fee62239251c71d8ac9189a300b02bd.

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -313,16 +313,3 @@
 #-----------------------------------------------------------------------------
 #Check the set of platform flags the compiler supports
 check_compiler_platform_flags()
-
-
-# dashboard build
-if(NOT "$ENV{DASHBOARD_TEST_FROM_CTEST}" STREQUAL "")
-  if(UNIX)
-    if(CMAKE_COMPILER_IS_GNUCXX)
-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cpp")
-    else()
-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-#warnings")
-    endif() #CMAKE_COMPILER_IS_GNUCXX
-  endif() #UNIX
-
-endif()


Fix embedded scons reference

Fix embedded scons reference

--- jsoncpp.cmake
+++ jsoncpp.cmake
@@ -13,7 +13,7 @@

 include (python)

-external_source (scons_embeded
+external_source (scons_embedded
     1.2.0
     scons-local-1.2.0.tar.gz
     aa92aff8b285ad992c2bf436dae72536
@@ -32,10 +32,10 @@

 # Download required scons local package
 message ("Installing scons-local 1.2.0 needed to build jsoncpp...")
-ExternalProject_Add(${scons_embeded_NAME}
+ExternalProject_Add(${scons_embedded_NAME}
     PREFIX              ${BUILDEM_DIR}
-    URL                 ${scons_embeded_URL}
-    URL_MD5             ${scons_embeded_MD5}
+    URL                 ${scons_embedded_URL}
+    URL_MD5             ${scons_embedded_MD5}
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ""
     CONFIGURE_COMMAND   ""
@@ -43,7 +43,7 @@
     INSTALL_COMMAND     ""
 )

-set_target_properties(${scons_embeded_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
+set_target_properties(${scons_embedded_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)

 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     set (jsoncpp_PATCH ${BUILDEM_ENV_STRING} ${PATCH_EXE}
@@ -57,11 +57,11 @@
 message ("Installing ${jsoncpp_NAME} ...")
 ExternalProject_Add(${jsoncpp_NAME}
     PREFIX              ${BUILDEM_DIR}
-    DEPENDS             ${scons_embeded_NAME} ${python_NAME}
+    DEPENDS             ${scons_embedded_NAME} ${python_NAME}
     URL                 ${jsoncpp_URL}
     URL_MD5             ${jsoncpp_MD5}
     UPDATE_COMMAND      ${BUILDEM_ENV_STRING} ${PYTHON_EXE}
-        ${COPY_SCRIPT} "${scons_SRC_DIR}/*" ${jsoncpp_SRC_DIR}
+        ${COPY_SCRIPT} "${scons_embedded_SRC_DIR}/*" ${jsoncpp_SRC_DIR}
     PATCH_COMMAND       ${jsoncpp_PATCH}
     CONFIGURE_COMMAND   ""
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} ${PYTHON_EXE} scons.py platform=linux-gcc
@@ -85,4 +85,4 @@

 message ("Including JSON include files from here: ${json_INCLUDES}")

-endif (NOT jsoncpp_NAME)+endif (NOT jsoncpp_NAME)


Flag -DWPADDED added to CmakeLists.txt

Flag -DWPADDED added to CmakeLists.txt

--- environment.cmake
+++ environment.cmake
@@ -49,6 +49,13 @@
 	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /DNDEBUG /MD")
 else (MSVC)
 	set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++98 -fno-rtti -fno-exceptions")
+
+	if (ENABLE_WPADDED)
+		set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS} -Wpadded")
+	else (ENABLE_WPADDED)
+		message(STATUS "Use -DENABLE_WPADDED=1 to enable padding messages")
+	endif (ENABLE_WPADDED)
+
 	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} -O0 -Wextra -Wno-unused-parameter -Wno-variadic-macros")


BUG:0010205:  Avoiding compile time failure caused by attempting to instantiate invalid template combinations.

--- Wrapping/WrapITK/Modules/SegmentationAndThreshold/wrap_itkBayesianClassifierImageFilter.cmake
+++ Wrapping/WrapITK/Modules/SegmentationAndThreshold/wrap_itkBayesianClassifierImageFilter.cmake
@@ -1,11 +1,14 @@
+### NOTE:  This assumes taht the 3rd and 4th template arguments are both the same floating point type.
+### NOTE:  Removed scalar types for the vector image type, because it must match the 3rd lement type.
+### NOTE:  This change was necessary to avoid itk BUG number 0010205 that demonstrates that the only valid
+###        vector type is one that has floating point voxel elements that are same as the PriorType.
+###        To preserve backwards compatibility, the types are re-used multiple times in an unconventional way.
 WRAP_CLASS("itk::BayesianClassifierImageFilter" POINTER)
   FOREACH(d ${WRAP_ITK_DIMS})
-    FOREACH(t ${WRAP_ITK_SCALAR})
       FOREACH(t2 ${WRAP_ITK_INT})
         FOREACH(t3 ${WRAP_ITK_REAL})
-          WRAP_TEMPLATE("${ITKM_VI${t}${d}}${ITKM_${t2}}${ITKM_${t3}}" "${ITKT_VI${t}${d}}, ${ITKT_${t2}}, ${ITKT_${t3}}")
+          WRAP_TEMPLATE("${ITKM_VI${t3}${d}}${ITKM_${t2}}${ITKM_${t3}}" "${ITKT_VI${t3}${d}}, ${ITKT_${t2}}, ${ITKT_${t3}}, ${ITKT_${t3}}")
         ENDFOREACH(t3)
       ENDFOREACH(t2)
-    ENDFOREACH(t)
   ENDFOREACH(d)
 END_WRAP_CLASS()


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 03)

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


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 09)

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


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 08)

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


implements pods bashrc logic

implements pods bashrc logic

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

--- cmake/pods.cmake
+++ cmake/pods.cmake
@@ -165,6 +165,19 @@
   file(WRITE ${filename} ${ARGV} )

   install(FILES ${filename} DESTINATION config)
+#  execute_process(COMMAND chmod +x ${CMAKE_INSTALL_PREFIX}/config/${package}_setup.sh)
+
+  set(filename ${CMAKE_BINARY_DIR}/config/pods_setup_all.sh)
+  file(WRITE ${filename}
+    "# THIS FILE IS AUTOMATICALLY GENERATED.  ANY EDITS YOU MAKE WILL LIKELY BE OVERWRITTEN.\n"
+    "for i in ${CMAKE_INSTALL_PREFIX}/config/*_setup.sh; do\n"
+    "  echo sourcing $i;\n"
+    "  source $i;\n"
+    "done\n"
+  )
+  install(FILES ${filename} DESTINATION config)
+#  execute_process(COMMAND chmod +x ${CMAKE_INSTALL_PREFIX}/config/pods_setup_all.sh)
+
 endfunction()

 # pods_install_python_script(<script_name> <python_module_or_file>)


Improve ctkMacroCompilePythonScript

Improve ctkMacroCompilePythonScript

To ease understanding of the parameters passed the the macro, it
now use ctkMacroParseArguments

Concept of Resources has been introduced, a python resources is a file
that will be installed along the python script without being compiled.

Using a configured script and a CustomCommand, LIBRARY_PATH is now
set before invoking python executable to compile the scripts.

--- CMake/ctkMacroCompilePythonScript.cmake
+++ CMake/ctkMacroCompilePythonScript.cmake
@@ -5,49 +5,111 @@
 #          ParaView/VTK/Wrapping/Python/CMakeLists.txt
 #

-MACRO(ctkMacroCompilePythonScript kit_name python_source_files dest_dir)
+MACRO(ctkMacroCompilePythonScript)
+  ctkMacroParseArguments(MY
+    "TARGET_NAME;SCRIPTS;RESOURCES;DESTINATION_DIR;INSTALL_DIR"
+    ""
+    ${ARGN}
+    )
+
+  FIND_PACKAGE(PythonInterp REQUIRED)
+  FIND_PACKAGE(PythonLibs REQUIRED)

-  FIND_PACKAGE(PythonInterp REQUIRED)
+  # Extract python lib path
+  get_filename_component(PYTHON_LIBRARY_PATH ${PYTHON_LIBRARY} PATH)

-  SET(copied_python_files)
+  # Sanity checks
+  FOREACH(varname TARGET_NAME SCRIPTS DESTINATION_DIR;INSTALL_DIR)
+    IF(NOT DEFINED MY_${varname})
+      MESSAGE(SEND_ERROR "${varname} is mandatory")
+    ENDIF()
+  ENDFOREACH()

-  FOREACH(file ${python_source_files})
-    GET_FILENAME_COMPONENT(file_we "${CMAKE_CURRENT_SOURCE_DIR}/${file}" NAME_WE)
-    SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${file_we}.py")
-    SET(tgt "${dest_dir}/${file_we}.py")
+  set(copied_files)
+  set(copied_python_files)
+  FOREACH(file ${MY_SCRIPTS})
+    SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}.py")
+    SET(tgt "${MY_DESTINATION_DIR}/${file}.py")
     SET(copied_python_files ${copied_python_files} ${tgt})
+    SET(copied_files ${copied_files} ${tgt})
     ADD_CUSTOM_COMMAND(DEPENDS ${src}
                         COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
                         OUTPUT ${tgt}
-                        COMMENT "Copying ${file_we}")
+                        COMMENT "Copying python script: ${file}.py")
   ENDFOREACH()
+
+  IF(DEFINED MY_RESOURCES)
+    FOREACH(file ${MY_RESOURCES})
+      SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
+      SET(tgt "${MY_DESTINATION_DIR}/${file}")
+      SET(copied_files ${copied_files} ${tgt})
+      ADD_CUSTOM_COMMAND(DEPENDS ${src}
+                          COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
+                          OUTPUT ${tgt}
+                          COMMENT "Copying python resource: ${file}")
+    ENDFOREACH()
+
+    ADD_CUSTOM_TARGET(Copy${MY_TARGET_NAME}PythonFiles
+                      ALL
+                      DEPENDS ${copied_files})
+  ENDIF()
+

   # Byte compile the Python files.
-  SET(compile_all_script "${CMAKE_CURRENT_BINARY_DIR}/compile_all_${kit_name}.py")
+  SET(compile_all_script "${CMAKE_CURRENT_BINARY_DIR}/compile_${MY_TARGET_NAME}_python_scripts.py")

-  # Based on paraview/VTK/Wrapping/Python/compile_all_vtk.py.in
+  # Generate compile_${MY_TARGET_NAME}_python_scripts.py
   FILE(WRITE ${compile_all_script} "
-\# Auto-generated
+#
+# Generated by ctkMacroCompilePythonScript CMAKE macro
+#
+
+# Based on paraview/VTK/Wrapping/Python/compile_all_vtk.py.in
+
 import compileall
-compileall.compile_dir('${dest_dir}')
-file = open('${CMAKE_CURRENT_BINARY_DIR}/${kit_name}_python_compile_complete', 'w')
+compileall.compile_dir('@MY_DESTINATION_DIR@')
+file = open('@CMAKE_CURRENT_BINARY_DIR@/python_compile_@MY_TARGET_NAME@_complete', 'w')
 file.write('Done')
 ")

+  # Configure cmake script associated with the custom command
+  # required to properly update the library path with PYTHON_LIBRARY_PATH
+  SET(compile_all_cmake_script "${CMAKE_CURRENT_BINARY_DIR}/compile_${MY_TARGET_NAME}_python_scripts.cmake")
+  FILE(WRITE ${compile_all_cmake_script} "
+#
+# Generated by ctkMacroCompilePythonScript CMAKE macro
+#
+
+IF(WIN32)
+    SET(ENV{PATH} \"@PYTHON_LIBRARY_PATH@;\$ENV{PATH}\")
+ELSEIF(APPLE)
+  SET(ENV{DYLD_LIBRARY_PATH} \"@PYTHON_LIBRARY_PATH@:\$ENV{DYLD_LIBRARY_PATH}\")
+ELSE()
+  SET(ENV{LD_LIBRARY_PATH} \"@PYTHON_LIBRARY_PATH@:\$ENV{LD_LIBRARY_PATH}\")
+ENDIF()
+
+EXECUTE_PROCESS(
+  COMMAND \"@PYTHON_EXECUTABLE@\" \"@compile_all_script@\"
+  )
+")
+
   ADD_CUSTOM_COMMAND(
-    COMMAND ${PYTHON_EXECUTABLE} ${compile_all_script}
+    COMMAND ${CMAKE_COMMAND} -P ${compile_all_cmake_script}
     DEPENDS ${copied_python_files}  ${compile_all_script}
-    OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${kit_name}_python_compile_complete"
-    COMMENT "Compiling ${kit_name} python files"
+    OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/python_compile_${MY_TARGET_NAME}_complete"
+    COMMENT "Compiling python scripts: ${MY_TARGET_NAME}"
     )
+
+  ADD_CUSTOM_TARGET(Compile${MY_TARGET_NAME}PythonFiles ALL
+    DEPENDS
+      ${CMAKE_CURRENT_BINARY_DIR}/python_compile_${MY_TARGET_NAME}_complete
+      ${compile_all_script}
+      )

-  ADD_CUSTOM_TARGET(${kit_name}_pyc ALL
-    DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${kit_name}_python_compile_complete")
+  # Install python module directory
+  INSTALL(DIRECTORY "${MY_DESTINATION_DIR}"
+    DESTINATION "${MY_INSTALL_DIR}" COMPONENT Runtime
+    USE_SOURCE_PERMISSIONS)
+
+ENDMACRO()

-
-  # Install the slicer python module directory
-  #INSTALL(DIRECTORY "${Slicer3_BINARY_DIR}/bin/Python"
-  #  DESTINATION "${Slicer3_INSTALL_BIN_DIR}" COMPONENT Runtime
-  #  USE_SOURCE_PERMISSIONS)
-
-ENDMACRO()


ctkMacroCompilePythonScript - Fix typo error in Foreach loop

--- CMake/ctkMacroCompilePythonScript.cmake
+++ CMake/ctkMacroCompilePythonScript.cmake
@@ -21,7 +21,7 @@
   get_filename_component(PYTHON_LIBRARY_PATH ${PYTHON_LIBRARY} PATH)

   # Sanity checks
-  FOREACH(varname TARGET_NAME SCRIPTS DESTINATION_DIR;INSTALL_DIR)
+  FOREACH(varname TARGET_NAME SCRIPTS DESTINATION_DIR INSTALL_DIR)
     IF(NOT DEFINED MY_${varname})
       MESSAGE(SEND_ERROR "${varname} is mandatory")
     ENDIF()


remove c++11 requirement

remove c++11 requirement

--- common.cmake
+++ common.cmake
@@ -12,7 +12,7 @@
     add_definitions("/W2")
 else()
     add_definitions("-Wall -Wextra")
-    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 -stdlib=libc++")
+#    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 -stdlib=libc++")
 endif()

 if(TODO MATCHES "ON")


cmake: Improved FindOpenSSL based on CMake ones.

--- cmake/Modules/FindOpenSSL.cmake
+++ cmake/Modules/FindOpenSSL.cmake
@@ -1,12 +1,18 @@
 # - Try to find OpenSSL
 # Once done this will define
 #
+#  OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
+#
+# Read-Only variables:
 #  OPENSSL_FOUND - system has OpenSSL
 #  OPENSSL_INCLUDE_DIRS - the OpenSSL include directory
 #  OPENSSL_LIBRARIES - Link these to use OpenSSL
 #  OPENSSL_DEFINITIONS - Compiler switches required for using OpenSSL
 #
-#  Copyright (c) 2009-2010 Andreas Schneider <mail@cynapses.org>
+#  Copyright (c) 2006-2009 Kitware, Inc.
+#  Copyright (c) 2006      Alexander Neundorf <neundorf@kde.org>
+#  Copyright (c) 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+#  Copyright (c) 2011      Andreas Schneider <asn@cryptomilk.org>
 #
 #  Redistribution and use is allowed according to the terms of the New
 #  BSD license.
@@ -14,144 +20,184 @@
 #

 if (OPENSSL_LIBRARIES AND OPENSSL_INCLUDE_DIRS)
-  # in cache already
-  set(OPENSSL_FOUND TRUE)
+    # in cache already
+    set(OPENSSL_FOUND TRUE)
 else (OPENSSL_LIBRARIES AND OPENSSL_INCLUDE_DIRS)

-  find_package(PkgConfig)
-  if (PKG_CONFIG_FOUND)
-    pkg_check_modules(_OPENSSL openssl)
-  endif (PKG_CONFIG_FOUND)
-
-  find_path(OPENSSL_INCLUDE_DIR
-    NAMES
-      openssl/ssl.h
-    PATHS
-      ${_OPENSSL_DIR}/include
-      ${_OPENSSL_INCLUDEDIR}
-      /usr/include
-      /usr/local/include
-      /opt/local/include
-      /sw/include
-      /usr/lib/sfw/include
-      C:/OpenSSL/include
-      $ENV{PROGRAMFILES}/OpenSSL/include
-      $ENV{PROGRAMFILES}/OpenSSL-Win32/include
-  )
-
-  find_library(SSL_LIBRARY
-    NAMES
-      ssl
-      ssl_dl
-      libssl
-    PATHS
-      ${_OPENSSL_DIR}/lib
-      ${_OPENSSL_LIBDIR}
-      /usr/lib
-      /usr/local/lib
-      /opt/local/lib
-      /sw/lib
-      /usr/sfw/lib/64
-      /usr/sfw/lib
-      C:/OpenSSL/lib
-      $ENV{PROGRAMFILES}/OpenSSL/lib
-      $ENV{PROGRAMFILES}/OpenSSL-Win32/lib
-  )
-
-  find_library(SSLEAY32_LIBRARY
-    NAMES
-      ssleay32
-    PATHS
-      ${_OPENSSL_DIR}/lib
-      ${_OPENSSL_LIBDIR}
-      /usr/lib
-      /usr/local/lib
-      /opt/local/lib
-      /sw/lib
-      /usr/sfw/lib/64
-      /usr/sfw/lib
-      C:/OpenSSL/lib
-      $ENV{PROGRAMFILES}/OpenSSL/lib
-      $ENV{PROGRAMFILES}/OpenSSL-Win32/lib
-  )
-
-  find_library(SSLEAY32MD_LIBRARY
-    NAMES
-      ssleay32MD
-    PATHS
-      ${_OPENSSL_DIR}/lib
-      ${_OPENSSL_LIBDIR}
-      /usr/lib
-      /usr/local/lib
-      /opt/local/lib
-      /sw/lib
-      /usr/sfw/lib/64
-      /usr/sfw/lib
-      C:/OpenSSL/lib
-      $ENV{PROGRAMFILES}/OpenSSL/lib
-      $ENV{PROGRAMFILES}/OpenSSL-Win32/lib
-  )
-
-  find_library(CRYPTO_LIBRARY
-    NAMES
-      crypto
-      crypto_dl
-      libcrypto
-      eay
-      eay32
-      libeay
-      libeay32
-    PATHS
-      ${_OPENSSL_DIR}/lib
-      ${_OPENSSL_LIBDIR}
-      /usr/lib
-      /usr/local/lib
-      /opt/local/lib
-      /sw/lib
-      /usr/sfw/lib/64
-      /usr/sfw/lib
-      C:/OpenSSL/lib
-      $ENV{PROGRAMFILES}/OpenSSL/lib
-      $ENV{PROGRAMFILES}/OpenSSL-Win32/lib
-  )
-
-  set(OPENSSL_INCLUDE_DIRS
-    ${OPENSSL_INCLUDE_DIR}
-  )
-
-  if (SSL_LIBRARY)
-    set(OPENSSL_LIBRARIES
-        ${OPENSSL_LIBRARIES}
-        ${SSL_LIBRARY}
-    )
-  endif (SSL_LIBRARY)
-
-  if (SSLEAY32_LIBRARY)
-    set(OPENSSL_LIBRARIES
-        ${OPENSSL_LIBRARIES}
-        ${SSLEAY32_LIBRARY}
-    )
-  endif (SSLEAY32_LIBRARY)
-
-  if (SSLEAY32MD_LIBRARY)
-    set(OPENSSL_LIBRARIES
-        ${OPENSSL_LIBRARIES}
-        ${SSLEAY32MD_LIBRARY}
-    )
-  endif (SSLEAY32MD_LIBRARY)
-
-  if (CRYPTO_LIBRARY)
-    set(OPENSSL_LIBRARIES
-        ${OPENSSL_LIBRARIES}
-        ${CRYPTO_LIBRARY}
-    )
-  endif (CRYPTO_LIBRARY)
-
-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(OpenSSL DEFAULT_MSG OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIRS)
-
-  # show the OPENSSL_INCLUDE_DIRS and OPENSSL_LIBRARIES variables only in the advanced view
-  mark_as_advanced(OPENSSL_INCLUDE_DIRS OPENSSL_LIBRARIES)
+    if (UNIX)
+        find_package(PkgConfig)
+        if (PKG_CONFIG_FOUND)
+            pkg_check_modules(_OPENSSL openssl)
+        endif (PKG_CONFIG_FOUND)
+    endif (UNIX)
+
+    # http://www.slproweb.com/products/Win32OpenSSL.html
+    set(_OPENSSL_ROOT_HINTS
+        "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
+        "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
+    )
+
+    set(_OPENSSL_ROOT_PATHS
+        "C:/OpenSSL/"
+        "C:/OpenSSL-Win32/"
+        "C:/OpenSSL-Win64/"
+        "$ENV{PROGRAMFILES}/OpenSSL"
+        "$ENV{PROGRAMFILES}/OpenSSL-Win32"
+        "$ENV{PROGRAMFILES}/OpenSSL-Win64"
+    )
+
+    find_path(OPENSSL_ROOT_DIR
+        NAMES
+            include/openssl/ssl.h
+        HINTS
+            ${_OPENSSL_ROOT_HINTS}
+        PATHS
+            ${_OPENSSL_ROOT_PATHS}
+    )
+    mark_as_advanced(OPENSSL_ROOT_DIR)
+
+    find_path(OPENSSL_INCLUDE_DIR
+        NAMES
+            openssl/ssl.h
+        PATHS
+            /usr/local/include
+            /opt/local/include
+            /sw/include
+            /usr/lib/sfw/include
+            ${OPENSSL_ROOT_DIR}/include
+    )
+
+    set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
+    mark_as_advanced(OPENSSL_INCLUDE_DIRS)
+
+    if (WIN32 AND NOT CYGWIN)
+        # MINGW should go here too
+        if (MSVC)
+            # /MD and /MDd are the standard values - if someone wants to use
+            # others, the libnames have to change here too
+            # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
+            # TODO: handle /MT and static lib
+            # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
+            #   * MD for dynamic-release
+            #   * MDd for dynamic-debug
+            #   * MT for static-release
+            #   * MTd for static-debug
+
+            # Implementation details:
+            # We are using the libraries located in the VC subdir instead of the parent directory eventhough :
+            # libeay32MD.lib is identical to ../libeay32.lib, and
+            # ssleay32MD.lib is identical to ../ssleay32.lib
+            find_library(LIB_EAY_DEBUG
+                NAMES
+                    libeay32MDd
+                    libeay32
+                PATHS
+                    ${OPENSSL_ROOT_DIR}/lib/VC
+            )
+
+            find_library(LIB_EAY_RELEASE
+                NAMES
+                    libeay32MD
+                    libeay32
+                PATHS
+                    ${OPENSSL_ROOT_DIR}/lib/VC
+            )
+
+            find_library(SSL_EAY_DEBUG
+                NAMES
+                    ssleay32MDd
+                    ssleay32
+                    ssl
+                PATHS ${OPENSSL_ROOT_DIR}/lib/VC
+            )
+
+            find_library(SSL_EAY_RELEASE
+                NAMES
+                    ssleay32MD
+                    ssleay32
+                    ssl
+                PATHS
+                    ${OPENSSL_ROOT_DIR}/lib/VC
+            )
+
+            if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+                set(OPENSSL_LIBRARIES
+                    optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG}
+                    optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG}
+                )
+            else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+                set( OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} )
+            endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+
+            mark_as_advanced(SSL_EAY_DEBUG SSL_EAY_RELEASE)
+            mark_as_advanced(LIB_EAY_DEBUG LIB_EAY_RELEASE)
+        elseif (MINGW)
+            # same player, for MingW
+            find_library(LIB_EAY
+                NAMES
+                    libeay32
+                PATHS
+                    ${OPENSSL_ROOT_DIR}/lib/MinGW
+            )
+
+            find_library(SSL_EAY
+                NAMES
+                    ssleay32
+                PATHS
+                    ${OPENSSL_ROOT_DIR}/lib/MinGW
+            )
+
+            mark_as_advanced(SSL_EAY LIB_EAY)
+            set(OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY})
+        else(MSVC)
+            # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
+            find_library(LIB_EAY
+                NAMES
+                    libeay32
+                PATHS
+                    ${OPENSSL_ROOT_DIR}/lib
+            )
+
+            find_library(SSL_EAY
+                NAMES
+                    ssleay32
+                PATHS
+                    ${OPENSSL_ROOT_DIR}/lib
+            )
+
+            mark_as_advanced(SSL_EAY LIB_EAY)
+            set(OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY})
+        endif(MSVC)
+    else (WIN32 AND NOT CYGWIN)
+        find_library(OPENSSL_SSL_LIBRARIES
+            NAMES
+                ssl
+                ssleay32
+                ssleay32MD
+            PATHS
+                ${_OPENSSL_LIBDIR}
+                /opt/local/lib
+                /sw/lib
+                /usr/sfw/lib/64
+                /usr/sfw/lib
+        )
+
+        find_library(OPENSSL_CRYPTO_LIBRARIES
+            NAMES
+                crypto
+            PATHS
+                ${_OPENSSL_LIBDIR}
+                /opt/local/lib
+                /sw/lib
+                /usr/sfw/lib/64
+                /usr/sfw/lib
+        )
+
+        mark_as_advanced(OPENSSL_CRYPTO_LIBRARIES OPENSSL_SSL_LIBRARIES)
+        set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
+    endif (WIN32 AND NOT CYGWIN)
+
+    include(FindPackageHandleStandardArgs)
+    find_package_handle_standard_args(OpenSSL DEFAULT_MSG OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIRS)

 endif (OPENSSL_LIBRARIES AND OPENSSL_INCLUDE_DIRS)
-


A STATIC package dependency implies PRIVATE scope on compile definitions, link libraries and include directories

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -61,6 +61,14 @@
   ENDIF ()
   IF (MYPACKAGE_DEBUG)
     MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency scopes are: ALL=${_ALL} TEST=${_TESTS} LIBS=${_LIBS} EXES=${_EXES}")
+  ENDIF ()
+  #
+  # Set dependency scope: PUBLIC or PRIVATE depending on _STATIC
+  #
+  IF (_STATIC)
+    SET (_package_dependency_scope "PRIVATE")
+  ELSE ()
+    SET (_package_dependency_scope "PUBLIC")
   ENDIF ()
   #
   # Check if inclusion was already done - via us or another mechanism... guessed with TARGET check
@@ -162,7 +170,7 @@
         IF (MYPACKAGE_DEBUG)
           MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding -D${packageDepend}_STATIC compile definition to target ${_target}")
         ENDIF ()
-        TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC -D${packageDepend}_STATIC)
+        TARGET_COMPILE_DEFINITIONS(${_target} ${_package_dependency_scope} -D${packageDepend}_STATIC)
         IF (MYPACKAGE_DEBUG)
           MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency becomes ${packageDepend}_static for target ${_target}")
         ENDIF ()
@@ -178,7 +186,7 @@
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding target ${realPackageDepend} dependency to target ${_target}")
           ENDIF ()
-          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${realPackageDepend})
+          TARGET_LINK_LIBRARIES(${_target} ${_package_dependency_scope} ${realPackageDepend})
           IF (_TESTS)
             #
             # A bit painful but the target locations are not known at this time.
@@ -229,7 +237,7 @@
             IF (MYPACKAGE_DEBUG)
               MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} directory to ${_target}'s include directories")
             ENDIF ()
-            TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
+            TARGET_INCLUDE_DIRECTORIES(${_target} ${_package_dependency_scope} ${_include_directory})
             #
             # Add eventually this to our project's default include directories
             #
@@ -252,7 +260,7 @@
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} directory to ${_target}'s include directories")
           ENDIF ()
-          TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
+          TARGET_INCLUDE_DIRECTORIES(${_target} ${_package_dependency_scope} ${_include_directory})
         ENDFOREACH ()
         #
         # Library dependency
@@ -262,7 +270,7 @@
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library to ${_target}")
           ENDIF ()
-          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${_library})
+          TARGET_LINK_LIBRARIES(${_target} ${_package_dependency_scope} ${_library})
         ENDFOREACH ()
         #
         # Compile definitions
@@ -272,7 +280,7 @@
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile flag to ${_target}")
           ENDIF ()
-          TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC ${_library})
+          TARGET_COMPILE_DEFINITIONS(${_target} ${_package_dependency_scope} ${_library})
         ENDFOREACH ()
         #
         # Link flags


cmake/MyPackageDependency.cmake and test path

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -175,25 +175,27 @@
     SET (_test_path "")
   ENDIF ()

-  SET (_dependLibraryRuntimeDirectory "${packageDependSourceDirAbsolute}/output/lib")
-  IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
-    STRING(REGEX REPLACE "/" "\\\\"  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
-  ELSE ()
-    STRING(REGEX REPLACE " " "\\\\ "  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
-  ENDIF ()
-  SET(${_PACKAGEDEPEND}_RUNTIME_DIRECTORY "${_dependLibraryRuntimeDirectory}")
-  IF ("${_test_path}" STREQUAL "")
-    MESSAGE(STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initializing TEST_PATH with PATH")
-    SET (_test_path "$ENV{PATH}" )
-  ENDIF ()
-  IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
-    SET (SEP "\\;")
-  ELSE ()
-    SET (SEP ":")
-  ENDIF ()
-  SET (_test_path "${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY}${SEP}${_test_path}")
-  IF (MYPACKAGE_DEBUG)
-    MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Prepended ${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY} to TEST_PATH")
-  ENDIF ()
-  SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_TEST_PATH "${_test_path}")
+  IF (ALL_IN_ONE)
+    SET (_dependLibraryRuntimeDirectory "${packageDependSourceDirAbsolute}/output/lib")
+    IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
+      STRING(REGEX REPLACE "/" "\\\\"  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
+    ELSE ()
+      STRING(REGEX REPLACE " " "\\\\ "  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
+    ENDIF ()
+    SET(${_PACKAGEDEPEND}_RUNTIME_DIRECTORY "${_dependLibraryRuntimeDirectory}")
+    IF ("${_test_path}" STREQUAL "")
+      MESSAGE(STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initializing TEST_PATH with PATH")
+      SET (_test_path "$ENV{PATH}" )
+    ENDIF ()
+    IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
+      SET (SEP "\\;")
+    ELSE ()
+      SET (SEP ":")
+    ENDIF ()
+    SET (_test_path "${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY}${SEP}${_test_path}")
+    IF (MYPACKAGE_DEBUG)
+      MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Prepended ${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY} to TEST_PATH")
+    ENDIF ()
+    SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_TEST_PATH "${_test_path}")
+  ENDIF ()
 ENDMACRO()