- fix FindOpenEXR to respect OPENEXR_ROOT

Signed-off-by: SSE4 <96590f2cd2f24822a7d8bd20596928fbcb06105f@gmail.com>

--- cmake/OpenCVFindOpenEXR.cmake
+++ cmake/OpenCVFindOpenEXR.cmake
@@ -20,55 +20,89 @@
     elseif(MSVC)
         SET(OPENEXR_LIBSEARCH_SUFFIXES Win32/Release Win32 Win32/Debug)
     endif()
-else()
-    set(OPENEXR_ROOT "")
 endif()

-SET(LIBRARY_PATHS
-    /usr/lib
-    /usr/local/lib
-    /sw/lib
-    /opt/local/lib
-    "${ProgramFiles_ENV_PATH}/OpenEXR/lib/static"
-    "${OPENEXR_ROOT}/lib")
+SET(SEARCH_PATHS
+    "${OPENEXR_ROOT}"
+    /usr
+    /usr/local
+    /sw
+    /opt
+    "${ProgramFiles_ENV_PATH}/OpenEXR")

-FIND_PATH(OPENEXR_INCLUDE_PATH ImfRgbaFile.h
-    PATH_SUFFIXES OpenEXR
-    PATHS
-    /usr/include
-    /usr/local/include
-    /sw/include
-    /opt/local/include
-    "${ProgramFiles_ENV_PATH}/OpenEXR/include"
-    "${OPENEXR_ROOT}/include")
+MACRO(FIND_OPENEXR_LIBRARY LIBRARY_NAME LIBRARY_SUFFIX)
+    string(TOUPPER "${LIBRARY_NAME}" LIBRARY_NAME_UPPER)
+    FIND_LIBRARY(OPENEXR_${LIBRARY_NAME_UPPER}_LIBRARY
+        NAMES ${LIBRARY_NAME}${LIBRARY_SUFFIX}
+        PATH_SUFFIXES ${OPENEXR_LIBSEARCH_SUFFIXES}
+        NO_DEFAULT_PATH
+        PATHS "${SEARCH_PATH}/lib" "${SEARCH_PATH}/lib/static")
+ENDMACRO()

-FIND_LIBRARY(OPENEXR_HALF_LIBRARY
-    NAMES Half
-    PATH_SUFFIXES ${OPENEXR_LIBSEARCH_SUFFIXES}
-    PATHS ${LIBRARY_PATHS})
+FOREACH(SEARCH_PATH ${SEARCH_PATHS})
+    FIND_PATH(OPENEXR_INCLUDE_PATH ImfRgbaFile.h
+        PATH_SUFFIXES OpenEXR
+        NO_DEFAULT_PATH
+        PATHS
+        "${SEARCH_PATH}/include")

-FIND_LIBRARY(OPENEXR_IEX_LIBRARY
-    NAMES Iex
-    PATH_SUFFIXES ${OPENEXR_LIBSEARCH_SUFFIXES}
-    PATHS ${LIBRARY_PATHS})
+    IF (OPENEXR_INCLUDE_PATH)
+        SET(OPENEXR_VERSION_FILE "${OPENEXR_INCLUDE_PATH}/OpenEXRConfig.h")
+        IF (EXISTS ${OPENEXR_VERSION_FILE})
+            FILE (STRINGS ${OPENEXR_VERSION_FILE} contents REGEX "#define OPENEXR_VERSION_MAJOR ")
+            IF (${contents} MATCHES "#define OPENEXR_VERSION_MAJOR ([0-9]+)")
+                SET(OPENEXR_VERSION_MAJOR "${CMAKE_MATCH_1}")
+            ENDIF ()
+            FILE (STRINGS ${OPENEXR_VERSION_FILE} contents REGEX "#define OPENEXR_VERSION_MINOR ")
+            IF (${contents} MATCHES "#define OPENEXR_VERSION_MINOR ([0-9]+)")
+                SET(OPENEXR_VERSION_MINOR "${CMAKE_MATCH_1}")
+            ENDIF ()
+        ENDIF ()
+    ENDIF ()

-FIND_LIBRARY(OPENEXR_IMATH_LIBRARY
-    NAMES Imath
-    PATH_SUFFIXES ${OPENEXR_LIBSEARCH_SUFFIXES}
-    PATHS ${LIBRARY_PATHS})
+    IF (OPENEXR_VERSION_MAJOR AND OPENEXR_VERSION_MINOR)
+        set(OPENEXR_VERSION "${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}")
+    ENDIF ()

-FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY
-    NAMES IlmImf
-    PATH_SUFFIXES ${OPENEXR_LIBSEARCH_SUFFIXES}
-    PATHS ${LIBRARY_PATHS})
+    SET(LIBRARY_SUFFIXES
+        "-${OPENEXR_VERSION}"
+        "-${OPENEXR_VERSION}_s"
+        "-${OPENEXR_VERSION}_d"
+        "-${OPEXEXR_VERSION}_s_d"
+        ""
+        "_s"
+        "_d"
+        "_s_d")

-FIND_LIBRARY(OPENEXR_ILMTHREAD_LIBRARY
-    NAMES IlmThread
-    PATH_SUFFIXES ${OPENEXR_LIBSEARCH_SUFFIXES}
-    PATHS ${LIBRARY_PATHS})
+    FOREACH(LIBRARY_SUFFIX ${LIBRARY_SUFFIXES})
+        FIND_OPENEXR_LIBRARY("Half" ${LIBRARY_SUFFIX})
+        FIND_OPENEXR_LIBRARY("Iex" ${LIBRARY_SUFFIX})
+        FIND_OPENEXR_LIBRARY("Imath" ${LIBRARY_SUFFIX})
+        FIND_OPENEXR_LIBRARY("IlmImf" ${LIBRARY_SUFFIX})
+        FIND_OPENEXR_LIBRARY("IlmThread" ${LIBRARY_SUFFIX})
+        IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
+            SET(OPENEXR_FOUND TRUE)
+            BREAK()
+        ENDIF()
+        UNSET(OPENEXR_IMATH_LIBRARY)
+        UNSET(OPENEXR_ILMIMF_LIBRARY)
+        UNSET(OPENEXR_IEX_LIBRARY)
+        UNSET(OPENEXR_ILMTHREAD_LIBRARY)
+        UNSET(OPENEXR_HALF_LIBRARY)
+    ENDFOREACH()

-IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
-    SET(OPENEXR_FOUND TRUE)
+    IF (OPENEXR_FOUND)
+        BREAK()
+    ENDIF()
+
+    UNSET(OPENEXR_INCLUDE_PATH)
+    UNSET(OPENEXR_VERSION_FILE)
+    UNSET(OPENEXR_VERSION_MAJOR)
+    UNSET(OPENEXR_VERSION_MINOR)
+    UNSET(OPENEXR_VERSION)
+ENDFOREACH()
+
+IF (OPENEXR_FOUND)
     SET(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATH} CACHE PATH "The include paths needed to use OpenEXR")
     SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR" FORCE)
 ENDIF ()


Hide GMock/GTest internals from cucumber-cpp dynamic symbol table

--- cmake/modules/FindGMock.cmake
+++ cmake/modules/FindGMock.cmake
@@ -261,7 +261,13 @@
     if(GTEST_USE_STATIC_LIBS)
         set(GTEST_CMAKE_ARGS -Dgtest_force_shared_crt:BOOL=ON -DBUILD_SHARED_LIBS=OFF)
         if(BUILD_SHARED_LIBS)
-            list(APPEND GTEST_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
+            list(APPEND GTEST_CMAKE_ARGS
+                -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+                -Dgtest_hide_internal_symbols=ON
+                -DCMAKE_CXX_VISIBILITY_PRESET=hidden
+                -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON
+                -DCMAKE_POLICY_DEFAULT_CMP0063=NEW
+            )
         endif()
         set(GTEST_LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
     else()


Applied a patch by Vadim Zeitlin: the wxWidgets driver and bindings need only the base and core component of wxWidgets.

svn path=/trunk/; revision=9558

--- cmake/modules/wxwidgets.cmake
+++ cmake/modules/wxwidgets.cmake
@@ -30,7 +30,7 @@

 # Find wxWidgets needed for driver and bindings
 if(PLD_wxwidgets OR PLD_wxpng)
-  find_package(wxWidgets QUIET)
+  find_package(wxWidgets COMPONENTS base core QUIET)
   if(NOT wxWidgets_FOUND)
     message(STATUS
       "WARNING: wxWidgets not found so "


Style.

Style.

--- cmake/scripts/buildinfo.cmake
+++ cmake/scripts/buildinfo.cmake
@@ -26,7 +26,7 @@
 	string(STRIP "${SOL_VERSION_PRERELEASE}" SOL_VERSION_PRERELEASE)
 else()
 	string(TIMESTAMP SOL_VERSION_PRERELEASE "develop.%Y.%m.%d" UTC)
-        string(REPLACE .0 . SOL_VERSION_PRERELEASE "${SOL_VERSION_PRERELEASE}")
+	string(REPLACE .0 . SOL_VERSION_PRERELEASE "${SOL_VERSION_PRERELEASE}")
 endif()

 if (EXISTS ${ETH_SOURCE_DIR}/commit_hash.txt)


Updating Superbuild ITK version along release toward 4.11.1

This update include update to MetaIO to address reported concurrence
bugs.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -45,7 +45,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG 046ede12fe47b90c13b4fcae98b61d8b775dc4ca ) # v4.11.0+ on release branch
+set(ITK_TAG_COMMAND GIT_TAG 207b64a99aeb62c79222f839ea1961e6aa94177b) # v4.11.0+ on release branch

 if( ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


Updating Superbuild ITK version to 4.10 rc 2

Change-Id: I60e1e76bbaa3b46391c8e5ed84007705a36c5fbc

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,7 @@
 set(ITK_REPOSITORY "${git_protocol}://itk.org/ITK.git")

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG  417d6a36d01aa3b835855349cc481a9b3dca8506 )
+set(ITK_TAG_COMMAND GIT_TAG  v4.10rc02 )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


Add ITK_GIT_TAG and ITK_GIT_REPOSITORY variables for Superbuild

Adding these advanced options to the SimpleITK Superbuild allows for
easy experimentation against development versions of ITK and usage of
faster repository. The ITK_REPOSITORY variable is now a legacy option
in favor of ITK_GIT_REPOSITORY.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -41,17 +41,22 @@

 set(proj ITK)  ## Use ITK convention of calling it ITK
-if(NOT DEFINED ITK_REPOSITORY)
-  set(ITK_REPOSITORY "${git_protocol}://itk.org/ITK.git")
-endif()
+
+
+set(ITK_GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git" CACHE STRING "URL of ITK Git repository")
+mark_as_advanced(ITK_GIT_REPOSITORY)
+sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)
+
+# NOTE: it is very important to update the ITK_DIR path with the ITK version
+set(ITK_GIT_TAG "v4.12.0" CACHE STRING "Tag in ITK git repo")
+mark_as_advanced(ITK_GIT_TAG)
+set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")

 set(ITK_USE_GIT_PROTOCOL 0)
 if("${git_protocol}" STREQUAL "git")
   set(ITK_USE_GIT_PROTOCOL 1)
 endif()

-# NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.12.0) # 4.12.0 tag

 if( ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )
@@ -66,7 +71,7 @@
 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_itk_cache}\n${ep_common_cache}" )

 ExternalProject_Add(${proj}
-  GIT_REPOSITORY ${ITK_REPOSITORY}
+  GIT_REPOSITORY ${ITK_GIT_REPOSITORY}
   ${ITK_TAG_COMMAND}
   UPDATE_COMMAND ""
   SOURCE_DIR ${proj}


Fix Clang build on Windows

Fix Clang build on Windows

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -17,7 +17,11 @@
   set(COMMON_DEFINITIONS "-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX")
   set(COMMON_WARNINGS "/W4 /WX")
 elseif (GCC OR CLANG)
-  set(COMMON_FLAGS "-march=native -mtune=native -pipe -fvisibility=hidden -pedantic -fstack-protector -fPIC")
+  set(COMMON_FLAGS "-march=native -mtune=native -pipe -fvisibility=hidden -pedantic -fstack-protector")
+  if (CLANG AND NOT WIN32)
+    set(COMMON_FLAGS "${COMMON_FLAGS} -fPIC")
+  endif ()
+
   set(COMMON_FLAGS_DEBUG "-g3 -ggdb3 -O0 -fno-inline -fno-omit-frame-pointer -fno-optimize-sibling-calls")
   set(COMMON_FLAGS_RELEASE "-O3 -flto -fuse-linker-plugin")
   set(COMMON_FLAGS_LINKER "-Wl,-O1 -Wl,--fatal-warnings -Wl,--discard-all -Wl,--build-id=sha1")
@@ -27,15 +31,12 @@
     set(COMMON_WARNINGS "")
   elseif (CLANG)
     set(COMMON_FLAGS_CXX "-stdlib=libc++")
-#    set(COMMON_WARNINGS "-Weverything -Werror -Wno-c++98-compat -Wno-padded -Wno-exit-time-destructors")
-#    set(COMMON_WARNINGS "${COMMON_WARNINGS} -Wno-weak-vtables -Wno-global-constructors")
+    set(COMMON_WARNINGS "-Weverything -Werror -Wno-c++98-compat -Wno-padded -Wno-exit-time-destructors")
+    set(COMMON_WARNINGS "${COMMON_WARNINGS} -Wno-weak-vtables -Wno-global-constructors")
   endif ()
 else ()
   message(FATAL_ERROR "Unknown compiler")
 endif ()
-
-#set(FLAGS_COMMON "${FLAGS_COMMON} -Weverything -Werror -Wno-c++98-compat -Wno-padded -Wno-exit-time-destructors")
-#set(FLAGS_COMMON "${FLAGS_COMMON} -Wno-weak-vtables")

 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} ${COMMON_FLAGS_C} ${COMMON_DEFINITIONS}")
 set(CMAKE_C_FLAGS_DEBUG " ${COMMON_FLAGS_DEBUG} ${COMMON_WARNINGS} ${COMMON_DEFINITIONS_DEBUG}")


COMP: Correctly propagate the -fPIC flag to nvcc's host compiler

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -75,6 +75,9 @@
      )
 endif()

+# Propagate some flags to the CUDA host compiler
+set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler ${CUDA_CXX_FLAGS}")
+
 if(CUDA_FOUND)
   try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
          ${CMAKE_BINARY_DIR}


Compile as no-rtti by default

Compile as no-rtti by default

--- cmake/compile_flags.cmake
+++ cmake/compile_flags.cmake
@@ -20,7 +20,7 @@

 # Set compiler flags:
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -pedantic -pedantic-errors") #  -fno-rtti
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -pedantic -pedantic-errors -fno-rtti")

 # TODO: Make this warning work too!
 #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion")


upgrade balboa

upgrade balboa

--- cmake/custom/balboa.cmake
+++ cmake/custom/balboa.cmake
@@ -4,7 +4,7 @@
     balboa
     PREFIX "${PROJECT_BINARY_DIR}/balboa"
     GIT_REPOSITORY https://github.com/bast/balboa.git
-    GIT_TAG 1b27595a32c8bbbd22b5a380056cce578ea3299a
+    GIT_TAG a4cbe0cf7d7f9e0c6e0c22644ea8a8010a33701a
     INSTALL_COMMAND true  # currently no install command
     )

@@ -23,3 +23,4 @@
     )

 include_directories(${PROJECT_BINARY_DIR}/balboa/src/balboa/api)
+include_directories(${PROJECT_BINARY_DIR}/balboa/src/balboa-build/include)


added NDEBUG when profiling

added NDEBUG when profiling

--- cmake/modes/profile.cmake
+++ cmake/modes/profile.cmake
@@ -1,4 +1,5 @@
 add_compile_options(-g1 -ggdb)
 add_compile_options(-O3)
 add_compile_options(-pg)
+add_definitions(-DNDEBUG)
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")


avoid building test libraries when QI_WITH_TEST=OFF

qi_create_test_lib is now no-op when QI_WITH_TESTS=OFF,
like qi_create_test_helper.

Change-Id: I7d1557faf9f7c37f45b6f0bb419f418849972939

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -70,6 +70,10 @@
 #
 # Arguments are the same as :cmake:function:`qi_create_lib`
 function(qi_create_test_lib target_name)
+  if(NOT QI_WITH_TESTS)
+    return()
+  endif()
+
   qi_create_lib(${target_name} ${ARGN} NO_INSTALL)

   if(WIN32)


Making rosbuild lite work without sourcing a setup.sh.

--- cmake/rosbuild_lite.cmake
+++ cmake/rosbuild_lite.cmake
@@ -1,16 +1,70 @@
-find_program(ROSPACK_EXECUTABLE rospack DOC "the rospack executable.")
 option(ROS_CONFIGURE_VERBOSE OFF)
+set(ROS_ROOT_DEFAULT /opt/ros/electric/ros CACHE PATH "The default ROS_ROOT")
+set(ROS_PACKAGE_PATH_DEFAULT /opt/ros/electric/stacks CACHE PATH "The default ROS_PACKAGE_PATH")
+
+if (NOT ROS_ROOT)
+  if ("$ENV{ROS_ROOT}" STREQUAL "")
+    message("*** ROS_ROOT is not set... is your environment set correctly? Setting to default: ${ROS_ROOT_DEFAULT}")
+    set(ROS_ROOT ${ROS_ROOT_DEFAULT} CACHE PATH  "ROS_ROOT path")
+  else()
+    set(ROS_ROOT "$ENV{ROS_ROOT}" CACHE PATH  "ROS_ROOT path")
+  endif()
+endif()
+
+if (NOT ROS_PACKAGE_PATH)
+  if ("$ENV{ROS_PACKAGE_PATH}" STREQUAL "")
+    message("*** ROS_ROOT is not set... is your environment set correctly? Setting to default: ${ROS_ROOT_DEFAULT}")
+    set(ROS_PACKAGE_PATH ${ROS_PACKAGE_PATH_DEFAULT} CACHE PATH "ROS_PACKAGE_PATH path")
+  else()
+    set(ROS_PACKAGE_PATH "$ENV{ROS_PACKAGE_PATH}" CACHE PATH "ROS_PACKAGE_PATH path")
+  endif()
+endif()
+
+find_program(ROSPACK_EXECUTABLE rospack PATHS ${ROS_ROOT}/bin DOC "the rospack executable.")
+find_program(ROSMSG_EXECUTABLE rosmsg PATHS ${ROS_ROOT}/bin DOC "rosmsg executable")
+
+if (ROSPACK_EXECUTABLE)
+  set(ROS_FOUND TRUE)
+else()
+  unset(ROS_FOUND)
+endif()
+
+macro (_set_ros_env)
+  set(ORIG_ROS_ROOT $ENV{ROS_ROOT})
+  set(ORIG_ROS_PACKAGE_PATH $ENV{ROS_PACKAGE_PATH})
+  set(ORIG_PATH $ENV{PATH})
+  set(ORIG_PYTHONPATH $ENV{PYTHONPATH})
+  set(ENV{ROS_ROOT} ${ROS_ROOT})
+  set(ENV{ROS_PACKAGE_PATH} ${ROS_PACKAGE_PATH})
+  set(ENV{PATH} "${ROS_ROOT}/bin:$ENV{PATH}")
+  set(ENV{PYTHONPATH} "${ROS_ROOT}/core/roslib/src:$ENV{PYTHONPATH}")
+endmacro()
+
+macro (_unset_ros_env)
+  set(ENV{ROS_ROOT} ${ORIG_ROS_ROOT})
+  set(ENV{ROS_PACKAGE_PATH} ${ORIG_ROS_PACKAGE_PATH})
+  set(ENV{PATH} "${ORIG_PATH}")
+  set(ENV{PYTHONPATH} "${ORIG_PYTHONPATH}")
+endmacro()
+
 macro (rospack VAR COMMAND PACKAGE)
   set(cachevar ROSPACK_${PACKAGE}_${COMMAND})
   set(${cachevar} "not-run-yet-NOTFOUND" CACHE INTERNAL "")
   if(NOT ${cachevar})
-    execute_process(COMMAND ${ROSPACK_EXECUTABLE} ${COMMAND} ${PACKAGE}
-      OUTPUT_VARIABLE ROSPACK_OUT
-      ERROR_VARIABLE rospack_error
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-      ERROR_STRIP_TRAILING_WHITESPACE
-      )
-
+    if (NOT ROSPACK_EXECUTABLE)
+      message(WARNING "*** rosmsg There is no rosmsg executable!")
+      set(rospack_error "ROSPACK_EXECUTABLE not found")
+    else()
+      _set_ros_env()
+      execute_process(COMMAND ${ROSPACK_EXECUTABLE} ${COMMAND} ${PACKAGE}
+        OUTPUT_VARIABLE ROSPACK_OUT
+        ERROR_VARIABLE rospack_error
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+        ERROR_STRIP_TRAILING_WHITESPACE
+        )
+      _unset_ros_env()
+    endif()
+
     if(rospack_error)
       message(STATUS "***")
       message(STATUS "*** rospack ${COMMAND} ${PACKAGE} failed: ${rospack_error}")
@@ -37,7 +91,7 @@
     message(STATUS "Could not find package ${PACKAGE} via rosmake")
   else()
     if(NOT ${PACKAGE}_FOUND)
-      message(STATUS "Finding ROS package ${PACKAGE} via rospack and ROS environment variables...")
+      message(STATUS "Finding ROS package: ${PACKAGE}")
       rospack(${PACKAGE}_INCLUDE_DIRS cflags-only-I ${PACKAGE})
       include_directories(${${PACKAGE}_INCLUDE_DIRS})
       rospack(${PACKAGE}_DEFINITIONS cflags-only-other ${PACKAGE})
@@ -87,22 +141,24 @@

 endmacro()

-
-find_program(ROSMSG_EXECUTABLE rosmsg DOC "rosmsg executable")
-
 macro(rosmsg VAR CMD PACKAGE)
-  execute_process(COMMAND ${ROSMSG_EXECUTABLE} ${CMD} ${PACKAGE}
-    OUTPUT_VARIABLE ROSMSG_OUT
-    ERROR_VARIABLE rosmsg_error
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-    ERROR_STRIP_TRAILING_WHITESPACE
-    )
-
+  if (NOT ROSMSG_EXECUTABLE)
+    set(rosmsg_error "rosmsg There is no rosmsg executable!")
+  else()
+    _set_ros_env()
+    execute_process(COMMAND ${ROSMSG_EXECUTABLE} ${CMD} ${PACKAGE}
+      OUTPUT_VARIABLE ROSMSG_OUT
+      ERROR_VARIABLE rosmsg_error
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      ERROR_STRIP_TRAILING_WHITESPACE
+      )
+    _unset_ros_env()
+  endif()
   if (rosmsg_error)
-    message(STATUS "*** rosmsg ${CMD} ${PACKAGE} failed: ${rosmsg_error}")
+    message(WARNING "*** rosmsg ${CMD} ${PACKAGE} failed: ${rosmsg_error}")
   else()
     separate_arguments(ROSPACK_SEPARATED UNIX_COMMAND ${ROSMSG_OUT})
     set(${VAR} ${ROSPACK_SEPARATED} CACHE INTERNAL "" FORCE)
     message("rosmsg ${VAR} == ${${VAR}}")
   endif()
-endmacro()+endmacro()


Add proper cmake PATHS when multiple NAMES. (#6558)

--- cmake/util/FindCUDA.cmake
+++ cmake/util/FindCUDA.cmake
@@ -93,6 +93,7 @@
         ${CUDA_TOOLKIT_ROOT_DIR}/lib)
       find_library(CUDA_CUBLASLT_LIBRARY
         NAMES cublaslt cublasLt
+        PATHS
         ${CUDA_TOOLKIT_ROOT_DIR}/lib64
         ${CUDA_TOOLKIT_ROOT_DIR}/lib)
     endif(MSVC)


ENH: Did #52 (Switch to github SuperElastix-elastix), including CMake quick-fix, "reverting moving project name to root directory". With Floris. Tested locally by running selxElastixComponentTest.

--- SuperBuild/ExternalElastix.cmake
+++ SuperBuild/ExternalElastix.cmake
@@ -19,8 +19,8 @@

 set( proj Elastix )

-set( ELASTIX_GIT_REPOSITORY http://github.com/mstaring/elastix )
-set( ELASTIX_GIT_TAG 67e87e57b0dc90ff838de1c0cd6126b950dc12a1 )
+set( ELASTIX_GIT_REPOSITORY https://github.com/SuperElastix/elastix )
+set( ELASTIX_GIT_TAG 522843d90ff586be051c480514cd14a88db45dbf )

 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}


cmake: Library cmake now uses new include structure

--- etc/library.cmake
+++ etc/library.cmake
@@ -42,10 +42,9 @@

 # includes
 include_directories(${LOCAL_INCLUDES})
+include_directories($ENV{INCLUDEOS_PREFIX}/includeos/api/posix)
 include_directories($ENV{INCLUDEOS_PREFIX}/includeos/include/libcxx)
-include_directories($ENV{INCLUDEOS_PREFIX}/includeos/api/sys)
 include_directories($ENV{INCLUDEOS_PREFIX}/includeos/include/newlib)
-include_directories($ENV{INCLUDEOS_PREFIX}/includeos/api/posix)
 include_directories($ENV{INCLUDEOS_PREFIX}/includeos/api)
 include_directories($ENV{INCLUDEOS_PREFIX}/includeos/include)
 include_directories($ENV{INCLUDEOS_PREFIX}/include)


mac osX -> find gfortran

mac osX -> find gfortran

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

--- Numerics/cmake/FortranLibraries.cmake
+++ Numerics/cmake/FortranLibraries.cmake
@@ -1,5 +1,7 @@
 # cache result to avoid re-running
 #
+
+message("###")
 if(NOT HAVE_FORTRAN_LIBRARIES)

 # search for libraries required to link with fortran
@@ -80,17 +82,16 @@
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testF77libs.c
       CMAKE_FLAGS
       -DLINK_LIBRARIES:STRING=${trial_libraries}
-      -DLINK_DIRECTORIES="${trial_lib_paths}"
+      -DLINK_DIRECTORIES=${trial_lib_paths}
       OUTPUT_VARIABLE FORT_LIBS_BUILD_OUT)
-    #MESSAGE(STATUS ${FORT_LIBS_BUILD_OUT})
+    MESSAGE(STATUS ${FORT_LIBS_BUILD_OUT})

     IF(NOT FORT_LIBS_WORK)
-      # let's find it in some potentiallink directories
+      # let's find it in some potential libraries directories
       FILE(GLOB _LIBDIRS_MAYBE
-        /lib /lib/*
-        /usr/lib /usr/*/lib /usr/lib/*
-        /usr/local/lib /usr/local/*/lib /usr/local/lib/*
-        /opt/lib /opt/*/lib /opt/lib/*)
+        /opt /opt/* /opt/lib/*
+        /usr/local/* /usr/local/lib/*
+        /usr/* /usr/lib/*)
       FOREACH(_F ${_LIBDIRS_MAYBE})
         IF(IS_DIRECTORY ${_F})
           LIST(APPEND _LIBDIRS ${_F})
@@ -100,22 +101,19 @@

       #string -> list
       SET(_libs ${trial_libraries})
-      FIND_LIBRARY(_LFIND NAMES ${_libs} PATHS "${_LIBDIRS}")

-      MESSAGE("LFIND = ${_LFIND}")
+      FIND_LIBRARY(_LFIND NAMES ${_libs} PATHS "${_LIBDIRS}" PATH_SUFFIXES lib)

       IF(_LFIND)
         GET_FILENAME_COMPONENT(_LFINDDIR ${_LFIND} PATH)
-        LIST(APPEND _LFINDDIRLIST ${_LFINDDIR})
-        LIST(APPEND _LFINDDIRLIST "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp")
         TRY_COMPILE(FORT_LIBS_WORK ${CMAKE_BINARY_DIR}
           ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testF77libs.c
           CMAKE_FLAGS
           -DLINK_LIBRARIES:STRING=${trial_libraries}
-          -DLINK_DIRECTORIES="${_LFINDDIRLIST}"
+          -DLINK_DIRECTORIES=${_LFINDDIR}\;${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
           OUTPUT_VARIABLE FORT_LIBS_BUILD_OUT
           )
-        #MESSAGE(STATUS ${FORT_LIBS_BUILD_OUT})
+        MESSAGE(STATUS ${FORT_LIBS_BUILD_OUT})
       ENDIF(_LFIND)
     ENDIF(NOT FORT_LIBS_WORK)


Changes from review

Changes from review

--- conan.cmake
+++ conan.cmake
@@ -349,8 +349,9 @@
     endforeach()
     if(ARGUMENTS_CONAN_COMMAND)
        set(CONAN_CMD ${ARGUMENTS_CONAN_COMMAND})
-    endif()
-    conan_check(REQUIRED)
+    else()
+        conan_check(REQUIRED)
+    endif()
     set(CONAN_OPTIONS "")
     if(ARGUMENTS_CONANFILE)
       set(CONANFILE ${CMAKE_CURRENT_SOURCE_DIR}/${ARGUMENTS_CONANFILE})
@@ -548,8 +549,9 @@
     endif()
     if(CONAN_COMMAND)
        set(CONAN_CMD ${CONAN_COMMAND})
-    endif()
-    conan_check(REQUIRED)
+    else()
+        conan_check(REQUIRED)
+    endif()
     message(STATUS "Conan: Adding ${CONAN_NAME} remote repository (${CONAN_URL})")
     execute_process(COMMAND ${CONAN_CMD} remote add ${CONAN_NAME} ${CONAN_URL}
       ${CONAN_INDEX_ARG} -f)


refine config.cmake

refine config.cmake

--- libzeug-config.cmake
+++ libzeug-config.cmake
@@ -2,13 +2,29 @@
 # LIBZEUG_FOUND
 # LIBZEUG_INCLUDE_DIR
 # LIBZEUG_SIGNAL_LIBRARY
+# LIBZEUG_SIGNAL_LIBRARY_DEBUG
+# LIBZEUG_SIGNAL_LIBRARIES
 # LIBZEUG_STAGE_LIBRARY
+# LIBZEUG_STAGE_LIBRARY_DEBUG
+# LIBZEUG_STAGE_LIBRARIES
 # LIBZEUG_TREE_LIBRARY
+# LIBZEUG_TREE_LIBRARY_DEBUG
+# LIBZEUG_TREE_LIBRARIES
 # LIBZEUG_TREEIMPORT_LIBRARY
+# LIBZEUG_TREEIMPORT_LIBRARY_DEBUG
+# LIBZEUG_TREEIMPORT_LIBRARIES
 # LIBZEUG_PROPERTY_LIBRARY
+# LIBZEUG_PROPERTY_LIBRARY_DEBUG
+# LIBZEUG_PROPERTY_LIBRARIES
 # LIBZEUG_PROPERTYGUI_LIBRARY
+# LIBZEUG_PROPERTYGUI_LIBRARY_DEBUG
+# LIBZEUG_PROPERTYGUI_LIBRARIES
 # LIBZEUG_IO_LIBRARY
+# LIBZEUG_IO_LIBRARY_DEBUG
+# LIBZEUG_IO_LIBRARIES
 # LIBZEUG_THREADING_LIBRARY
+# LIBZEUG_THREADING_LIBRARY_DEBUG
+# LIBZEUG_THREADING_LIBRARIES

 find_path(LIBZEUG_INCLUDE_DIR signalzeug/Signal.h
 	$ENV{LIBZEUG_DIR}/include
@@ -33,45 +49,30 @@
 	/opt/local/lib64
 )

-find_library(LIBZEUG_SIGNAL_LIBRARY
-	NAMES signalzeug
-	PATHS ${LIB_PATHS}
-	DOC "The signalzeug library")
+macro (find LIB_NAME HINT_PATHS)

-find_library(LIBZEUG_STAGE_LIBRARY
-	NAMES stagezeug
-	PATHS ${LIB_PATHS}
-	DOC "The stagezeug library")
+	string(TOUPPER LIBZEUG_${LIB_NAME} LIB_NAME_UPPER)
+	find_library(${LIB_NAME_UPPER}_LIBRARY
+		NAMES ${LIB_NAME}zeug
+		PATHS ${HINT_PATHS}
+		DOC "The ${LIB_NAME} library")
+	find_library(${LIB_NAME_UPPER}_LIBRARY_DEBUG
+		NAMES ${LIB_NAME}zeugd
+		PATHS ${HINT_PATHS}
+		DOC "The ${LIB_NAME} debug library")

-find_library(LIBZEUG_TREE_LIBRARY
-	NAMES treezeug
-	PATHS ${LIB_PATHS}
-	DOC "The treezeug library")
-
-find_library(LIBZEUG_TREEIMPORT_LIBRARY
-	NAMES treeimportzeug
-	PATHS ${LIB_PATHS}
-	DOC "The treeimportzeug library")
-
-find_library(LIBZEUG_PROPERTY_LIBRARY
-	NAMES propertyzeug
-	PATHS ${LIB_PATHS}
-	DOC "The propertyzeug library")
-
-find_library(LIBZEUG_PROPERTYGUI_LIBRARY
-	NAMES propertyguizeug
-	PATHS ${LIB_PATHS}
-	DOC "The propertyguizeug library")
+	set(${LIB_NAME}_LIBRARIES general ${${LIB_NAME_UPPER}_LIBRARY} debug ${${LIB_NAME_UPPER}_LIBRARY_DEBUG})

-find_library(LIBZEUG_IO_LIBRARY
-	NAMES iozeug
-	PATHS ${LIB_PATHS}
-	DOC "The iozeug library")
+endmacro()

-find_library(LIBZEUG_THREADING_LIBRARY
-	NAMES threadingzeug
-	PATHS ${LIB_PATHS}
-	DOC "The threadingzeug library")
+find(signal ${LIB_PATHS})
+find(stage ${LIB_PATHS})
+find(tree ${LIB_PATHS})
+find(treeimport ${LIB_PATHS})
+find(property ${LIB_PATHS})
+find(propertygui ${LIB_PATHS})
+find(io ${LIB_PATHS})
+find(threading ${LIB_PATHS})

 IF(LIBZEUG_INCLUDE_DIR AND LIBZEUG_SIGNAL_LIBRARY)
     SET(LIBZEUG_FOUND 1 CACHE STRING "Set to 1 if LIBZEUG is found, 0 otherwise")


Find binaries only on Windows

Find binaries only on Windows

--- libzeug-config.cmake
+++ libzeug-config.cmake
@@ -89,33 +89,33 @@
     endif()

     # find binaries
+    if (WIN32 AND ${LIB_NAME_UPPER}_LIBRARIES)
+        set(${LIB_NAME_UPPER}_BINARIES "")

-    set(${LIB_NAME_UPPER}_BINARIES "")
+        find_file(${LIB_NAME_UPPER}_BINARY_RELEASE
+            NAMES ${LIBNAME}.dll
+            PATHS
+            ${LIBZEUG_DIR}/bin
+            ${LIBZEUG_DIR}/build/Release
+            ${LIBZEUG_DIR}/build-release
+            DOC "The ${LIB_NAME_UPPER} binary")

-    find_file(${LIB_NAME_UPPER}_BINARY_RELEASE
-        NAMES ${LIBNAME}.dll
-        PATHS
-        ${LIBZEUG_DIR}/bin
-        ${LIBZEUG_DIR}/build/Release
-        ${LIBZEUG_DIR}/build-release
-        DOC "The ${LIB_NAME_UPPER} binary")
+        find_file(${LIB_NAME_UPPER}_BINARY_DEBUG
+            NAMES ${LIBNAME}d.dll
+            PATHS
+            ${LIBZEUG_DIR}/bin
+            ${LIBZEUG_DIR}/build/Debug
+            ${LIBZEUG_DIR}/build-debug
+            DOC "The ${LIB_NAME_UPPER} debug binary")

-    find_file(${LIB_NAME_UPPER}_BINARY_DEBUG
-        NAMES ${LIBNAME}d.dll
-        PATHS
-        ${LIBZEUG_DIR}/bin
-        ${LIBZEUG_DIR}/build/Debug
-        ${LIBZEUG_DIR}/build-debug
-        DOC "The ${LIB_NAME_UPPER} debug binary")
+        if(NOT ${LIB_NAME_UPPER}_BINARY_RELEASE STREQUAL "${LIB_NAME_UPPER}_BINARY_RELEASE-NOTFOUND")
+            list(APPEND ${LIB_NAME_UPPER}_BINARIES ${${LIB_NAME_UPPER}_BINARY_RELEASE})
+        endif()

-    if(NOT ${LIB_NAME_UPPER}_BINARY_RELEASE STREQUAL "${LIB_NAME_UPPER}_BINARY_RELEASE-NOTFOUND")
-        list(APPEND ${LIB_NAME_UPPER}_BINARIES ${${LIB_NAME_UPPER}_BINARY_RELEASE})
+        if(NOT ${LIB_NAME_UPPER}_BINARY_DEBUG STREQUAL "${LIB_NAME_UPPER}_BINARY_DEBUG-NOTFOUND")
+            list(APPEND ${LIB_NAME_UPPER}_BINARIES ${${LIB_NAME_UPPER}_BINARY_DEBUG})
+        endif()
     endif()
-
-    if(NOT ${LIB_NAME_UPPER}_BINARY_DEBUG STREQUAL "${LIB_NAME_UPPER}_BINARY_DEBUG-NOTFOUND")
-        list(APPEND ${LIB_NAME_UPPER}_BINARIES ${${LIB_NAME_UPPER}_BINARY_DEBUG})
-    endif()
-

     list(APPEND LIBZEUG_INCLUDES ${${LIB_NAME_UPPER}_INCLUDE_DIR})
     list(APPEND LIBZEUG_LIBRARIES ${${LIB_NAME_UPPER}_LIBRARIES})


Back to master for matviz

Back to master for matviz

The install target was merged.

--- versions.cmake
+++ versions.cmake
@@ -27,5 +27,5 @@
   GIT_TAG 4386042d5d7ef7b7cac12e96660a7dc5a6c5191a) # lookup_table_cleanup

 add_revision(matviz
-  GIT_REPOSITORY https://github.com/mathstuf/matviz
-  GIT_TAG dev/add-install-rules)
+  GIT_REPOSITORY https://github.com/cryos/matviz
+  GIT_TAG master)


Update to use the latest ParaView master

--- versions.cmake
+++ versions.cmake
@@ -92,7 +92,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "3c63addd2138300ea2a41b0960e8ce99989632e4")
+  set(_paraview_revision "03ef57b54c4caaf5ba5ca29b1ad3612fb87f475c")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Update FindGecode.cmake

Update FindGecode.cmake

--- Shared/CMake/modules/FindGecode.cmake
+++ Shared/CMake/modules/FindGecode.cmake
@@ -87,7 +87,7 @@
     message(STATUS "  float: ${GECODE_float}")
     list(APPEND GECODE_LIBRARIES ${GECODE_float})
 else()
-    message(FATAL_ERROR "  float not found")
+    message(STATUS "  float not found. We will try to build anyway.")
 endif()

 #message(STATUS "Gecode libraries: ${GECODE_LIBRARIES}")


Updated master version to 2012.09.99

Updated master version to 2012.09.99

--- CMake/mitkSetupVariables.cmake
+++ CMake/mitkSetupVariables.cmake
@@ -6,7 +6,7 @@

 # MITK_VERSION
 set(MITK_VERSION_MAJOR "2012")
-set(MITK_VERSION_MINOR "06")
+set(MITK_VERSION_MINOR "09")
 set(MITK_VERSION_PATCH "99")
 set(MITK_VERSION_STRING "${MITK_VERSION_MAJOR}.${MITK_VERSION_MINOR}.${MITK_VERSION_PATCH}")
 if(MITK_VERSION_PATCH STREQUAL "99")


removes commented code

removes commented code

--- src/cmakeFindModules/FindAlembic.cmake
+++ src/cmakeFindModules/FindAlembic.cmake
@@ -18,7 +18,8 @@
 ################################################################################
 # IlmBase include dir for half and ilm libraries used in alembic
 ################################################################################
-# Alembic includes half.h for a single function "half to float", this is sad
+
+# Alembic includes half.h for a single function "half to float", this is unfortunate
 FIND_PATH(ABC_HALF_INCLUDE_DIR half.h
     HINTS
     ${ALEMBIC_ILMBASE_ROOT}/include/OpenEXR
@@ -75,8 +76,7 @@
 )

 #
-# We force the use of dynamic libraries as using the static ones had caused some
-# initialization problems.
+# We force the use of dynamic libraries as with using the static ones we had initialization problems.
 FIND_PATH(ABC_LIBRARY_DIR libAlembicAbc.so
     PATHS
         ${ALEMBIC_ROOT}/lib
@@ -84,13 +84,6 @@
         $ENV{ALEMBIC_ROOT}/lib
         $ENV{ALEMBIC_ROOT}/lib64
     NO_DEFAULT_PATH)
-#FIND_LIBRARY(ABC_COLLECTION libAlembicAbcCollection.so PATHS ${ABC_LIBRARY_DIR})
-#FIND_LIBRARY(ABC_COREFACTORY libAlembicAbcCoreFactory.so PATHS ${ABC_LIBRARY_DIR})
-#FIND_LIBRARY(ABC_COREOGAWA libAlembicAbcCoreOgawa.so PATHS ${ABC_LIBRARY_DIR})
-#FIND_LIBRARY(ABC_MATERIAL libAlembicAbcMaterial.so PATHS ${ABC_LIBRARY_DIR})
-#FIND_LIBRARY(ABC_OGAWA libAlembicOgawa.so PATHS ${ABC_LIBRARY_DIR})
-#FIND_LIBRARY(ABC_OPENGL libAlembicAbcOpenGL.so PATHS ${ABC_LIBRARY_DIR})
-#FIND_LIBRARY(ABC_WFOBJCONVERT libAbcWFObjConvert.so PATHS ${ABC_LIBRARY_DIR})
 FIND_LIBRARY(ABC libAlembicAbc.so PATHS ${ABC_LIBRARY_DIR})
 FIND_LIBRARY(ABC_COREABSTRACT libAlembicAbcCoreAbstract.so PATHS ${ABC_LIBRARY_DIR})
 FIND_LIBRARY(ABC_COREHDF5 libAlembicAbcCoreHDF5.so PATHS ${ABC_LIBRARY_DIR})


SuperBuild: cmake status message using boost superbuild

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -8,19 +8,11 @@
 set(__EXTERNAL_BOOST__ 1)

 if(USE_SYSTEM_BOOST)
-  # Required
-  find_package ( Boost
-    1.35.0
-    )
-  # Optional components
-  find_package ( Boost
-    1.35.0
-    COMPONENTS unit_test_framework
-    )
-
   message(STATUS "  Using Boost system version")
 else()
   SETUP_SUPERBUILD(PROJECT BOOST)
+
+  message(STATUS "  Using Boost superbuild version")

   option(SUPERBUILD_BOOST_HEADER_ONLY "Only use Boost headers" ON)
   mark_as_advanced(SUPERBUILD_BOOST_HEADER_ONLY)


Fixed return values in CMake macros.

Fixed return values in CMake macros.

--- pkg/CMakeCommon.cmake
+++ pkg/CMakeCommon.cmake
@@ -34,69 +34,65 @@
 endfunction ()

 macro (add_deb_package)
-    if (NOT DPKG)
-        return()
-    endif ()
-
-    set(options "")
-    set(oneValueArgs NAME SUMMARY DESCRIPTION)
-    set(multiValueArgs INSTALL_LIBS INSTALL_BINS BREAKS CONFLICTS DEPENDS)
-    cmake_parse_arguments(PKG "${options}"
+    if (DPKG)
+        set(options "")
+        set(oneValueArgs NAME SUMMARY DESCRIPTION)
+        set(multiValueArgs INSTALL_LIBS INSTALL_BINS BREAKS CONFLICTS DEPENDS)
+        cmake_parse_arguments(PKG "${options}"
             "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

-    set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-deb)
+        set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-deb)

-    find_lib_files("${PKG_INSTALL_LIBS}" PKG_INSTALL_LIBS_FILES)
-    find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)
+        find_lib_files("${PKG_INSTALL_LIBS}" PKG_INSTALL_LIBS_FILES)
+        find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)

-    # Configure project for this package
-    configure_file(CMakeListsDpkg.txt.in
+        # Configure project for this package
+        configure_file(CMakeListsDpkg.txt.in
                 ${BUILD_DIR}/CMakeLists.txt @ONLY)

-    add_custom_target(
-        pkg-deb-${PKG_NAME}
-        rm -f ${BUILD_DIR}/CPackConfig.cmake
-        COMMAND ${CMAKE_COMMAND} .
-        COMMAND ${CMAKE_CPACK_COMMAND} --config CPackConfig.cmake
-        WORKING_DIRECTORY ${BUILD_DIR}
-    )
-    if (PKG_INSTALL_LIBS OR PKG_INSTALL_BINS)
-        add_dependencies(pkg-deb-${PKG_NAME}
-            ${PKG_INSTALL_LIBS} ${PKG_INSTALL_BINS})
+        add_custom_target(
+            pkg-deb-${PKG_NAME}
+            rm -f ${BUILD_DIR}/CPackConfig.cmake
+            COMMAND ${CMAKE_COMMAND} .
+            COMMAND ${CMAKE_CPACK_COMMAND} --config CPackConfig.cmake
+            WORKING_DIRECTORY ${BUILD_DIR}
+        )
+        if (PKG_INSTALL_LIBS OR PKG_INSTALL_BINS)
+            add_dependencies(pkg-deb-${PKG_NAME}
+                ${PKG_INSTALL_LIBS} ${PKG_INSTALL_BINS})
+        endif ()
+        add_dependencies(pkg-deb pkg-deb-${PKG_NAME})
     endif ()
-    add_dependencies(pkg-deb pkg-deb-${PKG_NAME})
 endmacro (add_deb_package)

 macro (add_rpm_package)
-    if (NOT RPMBUILD)
-        return()
-    endif ()
-
-    set(options "")
-    set(oneValueArgs NAME SUMMARY DESCRIPTION)
-    set(multiValueArgs INSTALL_LIBS INSTALL_BINS BREAKS CONFLICTS DEPENDS)
-    cmake_parse_arguments(PKG "${options}"
+    if (RPMBUILD)
+        set(options "")
+        set(oneValueArgs NAME SUMMARY DESCRIPTION)
+        set(multiValueArgs INSTALL_LIBS INSTALL_BINS BREAKS CONFLICTS DEPENDS)
+        cmake_parse_arguments(PKG "${options}"
             "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

-    set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-rpm)
+        set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-rpm)

-    find_lib_files("${PKG_INSTALL_LIBS}" PKG_INSTALL_LIBS_FILES)
-    find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)
+        find_lib_files("${PKG_INSTALL_LIBS}" PKG_INSTALL_LIBS_FILES)
+        find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)

-    configure_file(CMakeListsRpm.txt.in
+        configure_file(CMakeListsRpm.txt.in
                 ${BUILD_DIR}/CMakeLists.txt @ONLY)
-    add_custom_target(
-        pkg-rpm-${PKG_NAME}
-        rm -f ${BUILD_DIR}/CPackConfig.cmake
-        COMMAND ${CMAKE_COMMAND} .
-        COMMAND ${CMAKE_CPACK_COMMAND} --config CPackConfig.cmake
-        WORKING_DIRECTORY ${BUILD_DIR}
-    )
-    if (PKG_INSTALL_LIBS OR PKG_INSTALL_BINS)
-        add_dependencies(pkg-rpm-${PKG_NAME}
-            ${PKG_INSTALL_LIBS} ${PKG_INSTALL_BINS})
+        add_custom_target(
+            pkg-rpm-${PKG_NAME}
+            rm -f ${BUILD_DIR}/CPackConfig.cmake
+            COMMAND ${CMAKE_COMMAND} .
+            COMMAND ${CMAKE_CPACK_COMMAND} --config CPackConfig.cmake
+            WORKING_DIRECTORY ${BUILD_DIR}
+        )
+        if (PKG_INSTALL_LIBS OR PKG_INSTALL_BINS)
+            add_dependencies(pkg-rpm-${PKG_NAME}
+                ${PKG_INSTALL_LIBS} ${PKG_INSTALL_BINS})
+        endif ()
+        add_dependencies(pkg-rpm pkg-rpm-${PKG_NAME})
     endif ()
-    add_dependencies(pkg-rpm pkg-rpm-${PKG_NAME})
 endmacro (add_rpm_package)

 macro (add_tgz_package)
@@ -134,6 +130,7 @@
 find_program(DPKG "dpkg")
 mark_as_advanced(DPKG)
 find_program(DPKGSHLIBDEPS "dpkg-shlibdeps")
+mark_as_advanced(DPKGSHLIBDEPS)
 if (DPKG)
     if (NOT DPKGSHLIBDEPS)
         MESSAGE(FATAL_ERROR "dpkg-shlibdeps program not found but is required.")


fix typo (made setting env vars ineffective)

--- src/cake.cmake
+++ src/cake.cmake
@@ -251,7 +251,7 @@
 # load config from env vars
 foreach(i CAKE_BINARY_DIR_PREFIX CAKE_GENERATE_ALWAYS CAKE_LINK_BINARY_DIR)
 	if(NOT "$ENV{${i}}" STREQUAL "")
-		set(${i}, "$ENV{${i}}")
+		set(${i} "$ENV{${i}}")
 	endif()
 endforeach()


[CMake] Ensure that the SourceKit framework links Swift as needed

--- tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -361,6 +361,11 @@

   set(lib_dir ${SOURCEKIT_LIBRARY_OUTPUT_INTDIR})
   set(framework_location "${lib_dir}/${name}.framework")
+
+  # Once the new Swift parser is linked, everything has Swift modules.
+  if (SWIFT_SWIFT_PARSER)
+    set(SOURCEKITFW_HAS_SWIFT_MODULES ON)
+  endif()

   if (NOT SOURCEKIT_DEPLOYMENT_OS MATCHES "^macosx")
     set(FLAT_FRAMEWORK_NAME "${name}")


reverted using CMAKE_INSTALL_PREFIX for RTTR_RUNTIME_INSTALL_DIR

This lead to the effect that in the generated cmake install scripts
are absolute paths, instead of relative ones

--- CMake/config.cmake
+++ CMake/config.cmake
@@ -73,10 +73,10 @@
   set(RTTR_ADDITIONAL_FILES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/rttr")

 else(WINDOWS)
-  set(RTTR_RUNTIME_INSTALL_DIR   "${CMAKE_INSTALL_PREFIX}/bin")
-  set(RTTR_LIBRARY_INSTALL_DIR   "${CMAKE_INSTALL_PREFIX}/bin")
-  set(RTTR_ARCHIVE_INSTALL_DIR   "${CMAKE_INSTALL_PREFIX}/lib")
-  set(RTTR_FRAMEWORK_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+  set(RTTR_RUNTIME_INSTALL_DIR   "bin")
+  set(RTTR_LIBRARY_INSTALL_DIR   "bin")
+  set(RTTR_ARCHIVE_INSTALL_DIR   "lib")
+  set(RTTR_FRAMEWORK_INSTALL_DIR "bin")

   set(RTTR_CMAKE_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake")
   set(RTTR_ADDITIONAL_FILES_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")


honor CMake 3.5 target property IOS_INSTALL_COMBINED

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2976,7 +2976,8 @@
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
 		MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
-		OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST)
+		OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST
+		IOS_INSTALL_COMBINED)
 	# copy Windows platform specific stuff
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		GNUtoMS


simplify handling target’s language standard properties

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -455,15 +455,16 @@
 		if (_target)
 			get_target_property(_targetLanguageStandard ${_target} ${_language}_STANDARD)
 			if (_targetLanguageStandard)
-				get_target_property(_targetLanguageExtensions ${_target} ${_language}_EXTENSIONS)
-				if (_targetLanguageExtensions)
-					if (CMAKE_${_language}${_targetLanguageStandard}_EXTENSION_COMPILE_OPTION)
-						list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_EXTENSION_COMPILE_OPTION}")
+				set (_type "EXTENSION")
+				get_property(_isSet TARGET ${_target} PROPERTY ${_language}_EXTENSIONS SET)
+				if (_isSet)
+					get_target_property(_targetUseLanguageExtensions ${_target} ${_language}_EXTENSIONS)
+					if (NOT _targetUseLanguageExtensions)
+						set (_type "STANDARD")
 					endif()
-				else()
-					if (CMAKE_${_language}${_targetLanguageStandard}_STANDARD_COMPILE_OPTION)
-						list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_STANDARD_COMPILE_OPTION}")
-					endif()
+				endif()
+				if (CMAKE_${_language}${_targetLanguageStandard}_${_type}_COMPILE_OPTION)
+					list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_${_type}_COMPILE_OPTION}")
 				endif()
 			endif()
 		endif()


testing building as extension

testing building as extension

--- AutoTract.cmake
+++ AutoTract.cmake
@@ -56,6 +56,7 @@
 #Find SlicerExecutionModel
 FIND_PACKAGE(SlicerExecutionModel REQUIRED)
 INCLUDE(${SlicerExecutionModel_USE_FILE})
+
 #INCLUDE(${GenerateCLP_USE_FILE})

 find_package(QtToCppXML REQUIRED)
@@ -104,7 +105,6 @@

 if( ${LOCAL_PROJECT_NAME}_BUILD_SLICER_EXTENSION )
   message(STATUS "--------------------------------SETTING CPACK_INSTALL_CMAKE_PROJECTS----------------------------------")
-  configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ImportAutoTract.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ImportAutoTract.cmake)
   set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/")
   include(${Slicer_EXTENSION_CPACK})
 endif()


Be somewhat more verbose

Be somewhat more verbose

--- Buildyard.cmake
+++ Buildyard.cmake
@@ -31,3 +31,8 @@
 set(BUILDYARD_TARGETS ${CMAKE_PROJECT_NAME})
 add_subdirectory("${CMAKE_BINARY_DIR}/Buildyard" # source
   "${CMAKE_BINARY_DIR}/Buildyard.bin" )          # binary
+if(MSVC)
+  message(STATUS "Build 00_Main->${CMAKE_PROJECT_NAME} to bootstrap and TBD after bootstrap")
+else()
+  message(STATUS "Use 'make -jN' to bootstrap and 'make -jN buildall' after bootstrap")
+endif()


Removed debug output

Removed debug output

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -63,13 +63,6 @@
     oflog
     ofstd)

-  message("** \n\n\n\n I am looking for ${lib} in the following paths")
-  message("** ${DCMTK_DIR}/${lib}/libsrc")
-  message("** ${DCMTK_DIR}/${lib}/libsrc/Release")
-  message("** ${DCMTK_DIR}/${lib}/Release")
-  message("** ${DCMTK_DIR}/lib")
-  message("** ${DCMTK_DIR}/dcmjpeg/lib${lib}/Release")
-  message("** That be it \n\n\n\n\n")
   # Find Release libraries
   find_library(DCMTK_${lib}_LIBRARY
     ${lib}
@@ -85,7 +78,7 @@

   mark_as_advanced(DCMTK_${lib}_LIBRARY)

-  message("** DCMTKs ${lib} found at ${DCMTK_${lib}_LIBRARY}")
+  #message("** DCMTKs ${lib} found at ${DCMTK_${lib}_LIBRARY}")

   if(DCMTK_${lib}_LIBRARY)
     list(APPEND DCMTK_LIBRARIES_RELEASE optimized ${DCMTK_${lib}_LIBRARY})
@@ -104,8 +97,6 @@
     NO_DEFAULT_PATH
     )

-  message("** DCMTKs ${lib} in debug found at ${DCMTK_${lib}_LIBRARY_DEBUG}")
-
   mark_as_advanced(DCMTK_${lib}_LIBRARY_DEBUG)

   if(DCMTK_${lib}_LIBRARY_DEBUG)
@@ -116,8 +107,6 @@

 #depending on build type set debug or release
 list(APPEND DCMTK_LIBRARIES ${DCMTK_LIBRARIES_RELEASE} ${DCMTK_LIBRARIES_DEBUG} )
-
-message("** Overall there be the following libraries \n ${DCMTK_LIBRARIES}")

 set(DCMTK_config_TEST_HEADER osconfig.h)
 set(DCMTK_dcmdata_TEST_HEADER dctypes.h)
@@ -154,7 +143,7 @@
     ${DCMTK_DIR}/include/${dir})

   mark_as_advanced(DCMTK_${dir}_INCLUDE_DIR)
-  message("** DCMTKs ${dir} found at ${DCMTK_${dir}_INCLUDE_DIR}")
+  #message("** DCMTKs ${dir} found at ${DCMTK_${dir}_INCLUDE_DIR}")

   if(DCMTK_${dir}_INCLUDE_DIR)
     list(APPEND
@@ -178,15 +167,5 @@
   mark_as_advanced(DCMTK_dcmtk_INCLUDE_DIR)
 endif()

-#include(FindPackageHandleStandardArgs)
-#find_package_handle_standard_args(DCMTK DEFAULT_MSG
-#  DCMTK_config_INCLUDE_DIR
-#  DCMTK_ofstd_INCLUDE_DIR
-#  DCMTK_ofstd_LIBRARY
-#  DCMTK_dcmdata_INCLUDE_DIR
-#  DCMTK_dcmdata_LIBRARY
-#  DCMTK_dcmimgle_INCLUDE_DIR
-#  DCMTK_dcmimgle_LIBRARY)
-
 # Compatibility: This variable is deprecated
 set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})


Modify the ThirdParties.cmake for unix system compatibility

--- ThirdParties.cmake
+++ ThirdParties.cmake
@@ -2,7 +2,7 @@
   IF (WIN32)
     TARGET_LINK_LIBRARIES(${project} debug libFreeImage_d optimized libFreeImage)
   ELSE()
-    TARGET_LINK_LIBRARIES(${project} libFreeImage)
+    TARGET_LINK_LIBRARIES(${project} freeimage)
   ENDIF()
 ENDFUNCTION(LINK_THIRDPARTY_FREE_IMAGE)

@@ -10,7 +10,7 @@
   IF (WIN32)
     TARGET_LINK_LIBRARIES(${project} debug libgflags_d optimized libgflags)
   ELSE()
-    TARGET_LINK_LIBRARIES(${project} libgflags)
+    TARGET_LINK_LIBRARIES(${project} gflags)
   ENDIF()
 ENDFUNCTION(LINK_THIRDPARTY_GFLAGS)

@@ -18,7 +18,7 @@
   IF (WIN32)
     TARGET_LINK_LIBRARIES(${project} debug libglog_d optimized libglog)
   ELSE()
-    TARGET_LINK_LIBRARIES(${project} libglog)
+    TARGET_LINK_LIBRARIES(${project} glog)
   ENDIF()
 ENDFUNCTION(LINK_THIRDPARTY_GLOG)

@@ -30,7 +30,7 @@
   IF (WIN32)
     TARGET_LINK_LIBRARIES(${project} debug libgtest_d optimized libgtest)
   ELSE()
-    TARGET_LINK_LIBRARIES(${project} libgtest)
+    TARGET_LINK_LIBRARIES(${project} gtest)
   ENDIF()
 ENDFUNCTION(LINK_THIRDPARTY_GTEST)

@@ -38,7 +38,7 @@
   IF (WIN32)
     TARGET_LINK_LIBRARIES(${project} debug libgtest_main_d optimized libgtest_main)
   ELSE()
-    TARGET_LINK_LIBRARIES(${project} libgtest_main)
+    TARGET_LINK_LIBRARIES(${project} gtest_main)
   ENDIF()
 ENDFUNCTION(LINK_THIRDPARTY_GTEST_MAIN)

@@ -46,6 +46,6 @@
   IF (WIN32)
     TARGET_LINK_LIBRARIES(${project} debug libticpp_d optimized libticpp)
   ELSE()
-    TARGET_LINK_LIBRARIES(${project} libticpp)
+    TARGET_LINK_LIBRARIES(${project} ticpp)
   ENDIF()
 ENDFUNCTION(LINK_THIRDPARTY_TICPP)


renamed foundation => core

renamed foundation => core

--- VigraAddTest.cmake
+++ VigraAddTest.cmake
@@ -74,9 +74,9 @@

     ADD_DEPENDENCIES(check_cpp ${target})
     ADD_DEPENDENCIES(ctest ${target})
-    ADD_DEPENDENCIES(${target} foundation)
+    ADD_DEPENDENCIES(${target} core)

-    TARGET_LINK_LIBRARIES(${target} foundation)
+    TARGET_LINK_LIBRARIES(${target} core)
     if(AT_LIBRARIES)
         TARGET_LINK_LIBRARIES(${target} ${AT_LIBRARIES})
     endif()


Fix hwloc library finding

Fix hwloc library finding

--- FindHWLOC.cmake
+++ FindHWLOC.cmake
@@ -19,12 +19,13 @@
 pkg_check_modules(HWLOC hwloc)

 if(HWLOC_FOUND)
+  find_library(HWLOC_LIBRARY hwloc
+    PATHS ${HWLOC_ROOT} PATH_SUFFIXES lib NO_DEFAULT_PATH)
+  set(HWLOC_LIBRARIES ${HWLOC_LIBRARY})
+
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARIES
     HWLOC_INCLUDE_DIRS)
-
-  find_library(HWLOC_LIBRARIES hwloc
-    PATHS ${HWLOC_ROOT} PATH_SUFFIXES lib NO_DEFAULT_PATH)

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


Include optional sacctmgr program in FindSLURM output.

--- FindSLURM.cmake
+++ FindSLURM.cmake
@@ -1,11 +1,12 @@
 find_program(SLURM_SBATCH_COMMAND sbatch DOC "Path to the SLURM sbatch executable")
 find_program(SLURM_SRUN_COMMAND srun DOC "Path to the SLURM srun executable")
-mark_as_advanced(SLURM_SRUN_COMMAND SLURM_SBATCH_COMMAND)
+find_program(SLURM_SACCTMGR_COMMAND sacctmgr DOC "Path to the SLURM sacctmgr executable")
+mark_as_advanced(SLURM_SRUN_COMMAND SLURM_SBATCH_COMMAND SLURM_SACCTMGR_COMMAND)

 if(SLURM_SRUN_COMMAND AND SLURM_SBATCH_COMMAND)
   set(SLURM_FOUND true)
   if(NOT SLURM_FIND_QUIETLY)
-    message (STATUS "Found SLURM. SLURM_SBATCH_COMMAND: ${SLURM_SBATCH_COMMAND}, SLURM_SRUN_COMMAND: ${SLURM_SRUN_COMMAND}")
+    message (STATUS "Found SLURM. SLURM_SBATCH_COMMAND: ${SLURM_SBATCH_COMMAND}, SLURM_SRUN_COMMAND: ${SLURM_SRUN_COMMAND}, SLURM_SACCTMGR_COMMAND: ${SLURM_SACCTMGR_COMMAND}")
   endif()
 else()
   set(SLURM_FOUND false )


Add test for C++11 template aliases

Add test for C++11 template aliases

--- TestCPP11.cmake
+++ TestCPP11.cmake
@@ -1,7 +1,8 @@
 # Copyright (c) 2013 ahmet.bilgili@epfl.ch
 #               2013 Stefan.Eilemann@epfl.ch

-set(TESTS_CPP11 sharedptr tuple auto nullptr array final_override unordered_map)
+set(TESTS_CPP11 sharedptr tuple auto nullptr array final_override unordered_map
+  template_alias)

 file(WRITE ${CMAKE_BINARY_DIR}/cpp11_sharedptr.cpp
 "#include <memory>
@@ -71,6 +72,15 @@
    return 0;
 }")

+file(WRITE ${CMAKE_BINARY_DIR}/cpp11_template_alias.cpp
+"#include <vector>
+template <typename T> using FooVector = std::vector< T >;
+int main()
+{
+    FooVector< int > foo;
+    return 0;
+}")
+
 set(TEST_CPP11_PASSED)
 set(TEST_CPP11_FAILED)
 while(TESTS_CPP11)


build debug by default

build debug by default

* XP_BUILD_DEBUG and XP_BUILD_DEBUG_ALL both ON when XP_STEP is build
* issue https://github.com/smanders/externpro/issues/207#issuecomment-411873933
* need debug libraries for MSVC debug build
* will investigate whether we can get away with release libraries for gcc/linux debug build in the future

--- modules/macpro.cmake
+++ modules/macpro.cmake
@@ -72,8 +72,8 @@
   message(STATUS "           (suitable for debug, step into source)")
   message(STATUS "[build]    execute through step 3: build the platform-specific binaries")
   set(XP_BUILD_RELEASE ON) # release is *always* built, debug is optional
-  cmake_dependent_option(XP_BUILD_DEBUG "build debug" OFF "XP_STEP STREQUAL build" OFF)
-  cmake_dependent_option(XP_BUILD_DEBUG_ALL "build debug all (ON) or select (OFF) projects" OFF "XP_BUILD_DEBUG" OFF)
+  cmake_dependent_option(XP_BUILD_DEBUG "build debug" ON "XP_STEP STREQUAL build" OFF)
+  cmake_dependent_option(XP_BUILD_DEBUG_ALL "build debug all (ON) or select (OFF) projects" ON "XP_BUILD_DEBUG" OFF)
   if(CMAKE_SIZEOF_VOID_P EQUAL 8)
     set(XP_BUILD_64BIT ON)
     set(XP_BUILD_32BIT OFF)


Add environment information into api header tests.

--- tests/api_headers/api_header_test.in.cmake
+++ tests/api_headers/api_header_test.in.cmake
@@ -9,4 +9,15 @@

 add_test(NAME api_header_inclusion_${CURRENT_TEST} COMMAND ${CURRENT_TEST})

+if(MSVC)
+  if(HAVE_LIBXML2_CONFIG)
+	set_tests_properties(api_header_inclusion_${CURRENT_TEST}
+	PROPERTIES ENVIRONMENT "PATH=$<TARGET_FILE_DIR:cellml>\;$<TARGET_FILE_DIR:gtest_main>\;$<TARGET_FILE_DIR:xml2>")
+  else()
+	# The libxml2 dll must be on the path otherwise the tests will not be able to run.
+	set_tests_properties(api_header_inclusion_${CURRENT_TEST}
+	PROPERTIES ENVIRONMENT "PATH=$<TARGET_FILE_DIR:cellml>\;$<TARGET_FILE_DIR:gtest_main>")
+  endif()
+endif()
+
 list(APPEND TEST_LIST ${CURRENT_TEST})


COMP: Fixed VS2017 Boost link errors

COMP: Fixed VS2017 Boost link errors

Related SuperElastix ticket: #12 "Bump Boost version"

See also:

"[CMake] MSVC15 variable available for Visual Studio 2017"
http://public.kitware.com/pipermail/cmake/2017-January/064815.html

"Notes on Visual Studio 15"
https://build2.org/article/notes-visual-studio-15.xhtml

"Fix toolset version for VS2017 (should be 14.1)"
https://github.com/boostorg/build/pull/167

boost_1_65_0\boost\config\compiler\visualc.hpp, which says:
#   elif _MSC_VER < 1920
#     define BOOST_COMPILER_VERSION 14.1

C:\Program Files\CMake\share\cmake-3.9\Modules\FindBoost.cmake, which says:
    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
      list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.1)

--- SuperBuild/ExternalBoost.cmake
+++ SuperBuild/ExternalBoost.cmake
@@ -37,7 +37,12 @@
     elseif(MSVC12)
       set(B2_ARGS "--toolset=msvc-12.0" ${B2_ARGS})
     elseif(MSVC14)
-      set(B2_ARGS "--toolset=msvc-14.0" ${B2_ARGS})
+      # CMake defines MSVC14 for both VS2015 and VS2017!
+      if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
+        set(B2_ARGS "--toolset=msvc-14.0" ${B2_ARGS})
+      else()
+        set(B2_ARGS "--toolset=msvc-14.1" ${B2_ARGS})
+      endif()
     endif(MSVC11)
     set( BOOST_URL "http://dl.bintray.com/boostorg/release/1.65.0/source/boost_1_65_0.zip")
     set( BOOST_MD5 eb1e11262e0cfc6949d054f6d8d25dc6 )


Update External_STIR.cmake

Update External_STIR.cmake

Deleted an erroneous `-DDISABLE_ITK=On` (should be handled by the `USE_ITK` bool).

--- SuperBuild/External_STIR.cmake
+++ SuperBuild/External_STIR.cmake
@@ -54,7 +54,6 @@
         -DCMAKE_INSTALL_PREFIX=${STIR_Install_Dir}
         -DGRAPHICS=None
         -DCMAKE_CXX_STANDARD=11
-        -DDISABLE_ITK=On
         # Use 2 variables for ROOT to cover multiple STIR versions
         -DDISABLE_CERN_ROOT_SUPPORT=ON -DDISABLE_CERN_ROOT=ON
    )


Use more recent version of STIR to be compatible with CMAKE 3.9

Other changes in STIR should be beneficial anyway

--- SuperBuild/External_STIR.cmake
+++ SuperBuild/External_STIR.cmake
@@ -37,11 +37,13 @@
   ### --- Project specific additions here
   set(STIR_Install_Dir ${SUPERBUILD_INSTALL_DIR})

-  set(${proj}_URL https://github.com/CCPPETMR/STIR )
-
+  set(${proj}_URL https://github.com/UCL/STIR )
+  set(${proj}_GIT_TAG 753434bdc6ec3a5ab9c4bd89450cfde0fecc363b)
+
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY ${${proj}_URL}
+    GIT_TAG ${${proj}_GIT_TAG}
     SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/${proj}
     #BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}
     CMAKE_ARGS -DGRAPHICS=None


Update SWIG to 3.0.7

Update SWIG to 3.0.7

Change-Id: I19a8e159c890a930aba1fad2b60789903a13ba1e

--- SuperBuild/External_Swig.cmake
+++ SuperBuild/External_Swig.cmake
@@ -12,9 +12,9 @@

 if(NOT SWIG_DIR)

-  set(SWIG_TARGET_VERSION 3.0.5)
-  set(SWIG_DOWNLOAD_SOURCE_HASH "dcb9638324461b9baba8e044fe59031d")
-  set(SWIG_DOWNLOAD_WIN_HASH "fd2e050f29e2a00b2348f5f7d3476490")
+  set(SWIG_TARGET_VERSION 3.0.7)
+  set(SWIG_DOWNLOAD_SOURCE_HASH "7fff46c84b8c630ede5b0f0827e3d90a")
+  set(SWIG_DOWNLOAD_WIN_HASH "d8b5a9ce49c819cc1bfc1e797b85ba7a")

   if(WIN32)


Added checksum verification

Added checksum verification

--- portaudio-sys/download.cmake
+++ portaudio-sys/download.cmake
@@ -1,6 +1,7 @@
 set(url http://portaudio.com/archives/pa_stable_v190600_20161030.tgz)
 set(archive "$ENV{OUT_DIR}/portaudio.tgz")

-file(DOWNLOAD "${url}" "${archive}")
+file(DOWNLOAD "${url}" "${archive}"
+    EXPECTED_HASH MD5=4df8224e047529ca9ad42f0521bf81a8)
 execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xvf "${archive}"
     WORKING_DIRECTORY "$ENV{OUT_DIR}")


From what I just learned about curly braces, the additions in the previous commit should have fewer of them.

--- src/CMake/Findcycluscore.cmake
+++ src/CMake/Findcycluscore.cmake
@@ -13,9 +13,9 @@
   PATH_SUFFIXES cyclus/include)

 # Add the root dir to the hints
-IF(NOT DEFINED ${CYCLUS_ROOT_DIR})
+IF(NOT DEFINED CYCLUS_ROOT_DIR)
   SET(CYCLUS_ROOT_DIR "${CYCLUS_CORE_INCLUDE_DIR}/..")
-ENDIF(NOT DEFINED ${CYCLUS_ROOT_DIR})
+ENDIF(NOT DEFINED CYCLUS_ROOT_DIR)

 # Look for the header files
 FIND_PATH(CYCLUS_CORE_SHARE_DIR cyclus.rng.in


PolysquareCommon: Also add COMPILE_FLAGS to add_checked_sources

--- PolysquareCommon.cmake
+++ PolysquareCommon.cmake
@@ -610,6 +610,15 @@
     add_custom_target (${TARGET} ALL
                        DEPENDS ${SOURCES_SCANNED_STAMP})

+    get_property (PSQ_CXXFLAGS GLOBAL PROPERTY PSQ_CXXFLAGS)
+    get_property (PSQ_CFLAGS GLOBAL PROPERTY PSQ_CFLAGS)
+    set_property (TARGET ${TARGET}_scannable
+                  PROPERTY COMPILE_FLAGS
+                  "${PSQ_CFLAGS} ${PSQ_CXXFLAGS}")
+    get_property (COMPILE_FLAGS
+                  TARGET "${TARGET}_scannable"
+                  PROPERTY COMPILE_FLAGS)
+
     set_property (SOURCE ${SOURCES_SCANNED_STAMP}
                   PROPERTY OBJECT_DEPENDS
                   ${SOURCES_SOURCES})


Make sure the tomviz binary's RPATH is correctly set

--- projects/tomviz.cmake
+++ projects/tomviz.cmake
@@ -17,6 +17,12 @@
     -DPYBIND11_PYTHON_VERSION:STRING=3.6)
 endif()

+# The new fixup bundle correctly handles RPATHs... if the binary/module has them correctly set
+if (APPLE)
+  list(APPEND tomviz_extra_cmake_args
+    -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON)
+endif()
+
 add_external_project(tomviz
   DEPENDS paraview qt


CMake: do not warn about Vc supporting old version of CMake

--- cmake/Modules/CxxSwizzleSandbox.cmake
+++ cmake/Modules/CxxSwizzleSandbox.cmake
@@ -48,7 +48,11 @@
     find_package(imgui CONFIG REQUIRED)

     if (${setup} STREQUAL "simd_vc" OR ${setup} STREQUAL "simd_vc_with_masking")
+        set(CMAKE_WARN_DEPRECATED_PREV ${CMAKE_WARN_DEPRECATED})
+        set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
+        # Vc has some really outdated build scripts, supress the message
         find_package(Vc CONFIG REQUIRED)
+        set(CMAKE_WARN_DEPRECATED ${CMAKE_WARN_DEPRECATED_PREV} CACHE BOOL "" FORCE)
     endif()

 endmacro()


Added '++' to package name if building for C++

--- cmake/Modules/DefineCPackConfig.cmake
+++ cmake/Modules/DefineCPackConfig.cmake
@@ -39,7 +39,13 @@
 endif(WIN32)

 set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
-set(CPACK_PACKAGE_FILE_NAME ${APPLICATION_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME})
+
+if (WITH_CXX)
+   set(PACKAGE_NAME ${APPLICATION_NAME}++)
+else ()
+   set(PACKAGE_NAME ${APPLICATION_NAME})
+endif ()
+set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME})

 set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
 set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION


[CMake] Don't pass in MSVC warning flags as definitions

NFC currently but required as a prerequisite for using
the Microsoft resource compiler in conjunction with
CMake's ninja generator, which knows how to filter flags
appropriately, but not definitions.

Differential Revision: http://reviews.llvm.org/D8188

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -243,7 +243,7 @@
   if( MSVC11 )
     add_llvm_definitions(-D_VARIADIC_MAX=10)
   endif()
-
+
   # Add definitions that make MSVC much less annoying.
   add_llvm_definitions(
     # For some reason MS wants to deprecate a bunch of standard functions...
@@ -253,7 +253,9 @@
     -D_CRT_NONSTDC_NO_WARNINGS
     -D_SCL_SECURE_NO_DEPRECATE
     -D_SCL_SECURE_NO_WARNINGS
-
+    )
+
+  set(msvc_warning_flags
     # Disabled warnings.
     -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
     -wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored'
@@ -272,7 +274,7 @@
     -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible'
     -wd4722 # Suppress 'function' : destructor never returns, potential memory leak
     -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)'
-
+
     # Promoted warnings.
     -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.

@@ -282,14 +284,19 @@

   # Enable warnings
   if (LLVM_ENABLE_WARNINGS)
-    add_llvm_definitions( /W4 )
+    append("/W4" msvc_warning_flags)
     if (LLVM_ENABLE_PEDANTIC)
       # No MSVC equivalent available
     endif (LLVM_ENABLE_PEDANTIC)
   endif (LLVM_ENABLE_WARNINGS)
   if (LLVM_ENABLE_WERROR)
-    add_llvm_definitions( /WX )
+    append("/WX" msvc_warning_flags)
   endif (LLVM_ENABLE_WERROR)
+
+  foreach(flag ${msvc_warning_flags})
+    append("${flag}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  endforeach(flag)
+
 elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
   if (LLVM_ENABLE_WARNINGS)
     append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)


[CMake] Disable -Werror for CMake checks

-Werror may cause some of the CMake checks to fail, so we disable
it even if it's enabled for the build itself.

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -381,6 +381,7 @@

 elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
   append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  append_if(LLVM_ENABLE_WERROR "-Wno-error" CMAKE_REQUIRED_FLAGS)
   add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
   if (LLVM_ENABLE_CXX1Y)
     check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)


Refs #5622.  Undo unrelated change.

Refs #5622.  Undo unrelated change.

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -107,7 +107,7 @@
 ## set extra debugging flags and preprocessor definitions
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -O0")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -O0")
-# set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _FORTIFY_SOURCE=2)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _FORTIFY_SOURCE=2)

 ## set extra release flags
 if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)


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

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

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

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

 ## set extra release flags


update the version number

update the version number

--- superbuild/Projects/nuclearRGG.bundle.common.cmake
+++ superbuild/Projects/nuclearRGG.bundle.common.cmake
@@ -3,9 +3,9 @@
 # We hardcode the version numbers since we cannot determine versions during
 # configure stage.
 set (rgg_version_major 1)
-set (rgg_version_minor 1)
+set (rgg_version_minor 2)
 set (rgg_version_patch 0)
-set (rgg_version_suffix)
+set (rgg_version_suffix "Devel")
 set (rgg_version "${rgg_version_major}.${rgg_version_minor}")

 include (paraview_version)


stb: Update referenced commit

stb: Update referenced commit

--- CMake/InstallSTB.cmake
+++ CMake/InstallSTB.cmake
@@ -1,7 +1,7 @@
 FetchContent_Declare (
 	stb
 	GIT_REPOSITORY [[https://github.com/nothings/stb]]
-	GIT_TAG [[b42009b3b9d4ca35bc703f5310eedc74f584be58]]
+	GIT_TAG [[c0c982601f40183e74d84a61237e968dca08380e]]
 )

 FetchContent_GetProperties (stb)


COMP: Bump ImageViewer to fix shadow warning.

Change-Id: I916873a4aeff94ffc642b0f6f4ee5929d7def590

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -368,7 +368,7 @@
 set( proj ImageViewer )
 ExternalProject_Add( ImageViewer
   GIT_REPOSITORY "${GIT_PROTOCOL}://github.com/TubeTK/ImageViewer.git"
-  GIT_TAG "c8d2f3c9d148824dc3d0f05d37bbb7e141651b6f"
+  GIT_TAG "b2ac8ef25da64f17b1e2e08ddb5415ec95783515"
   SOURCE_DIR "${CMAKE_BINARY_DIR}/ImageViewer"
   BINARY_DIR ImageViewer-Build
   CMAKE_GENERATOR ${gen}


Fixes #42

Fixes #42

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -626,6 +626,9 @@
 if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH CACHE STRING "" ${FORCE_CACHE})
 endif()
+if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE)
+  set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH CACHE STRING "" ${FORCE_CACHE})
+endif()

 #
 # Some helper-macros below to simplify and beautify the CMakeFile
@@ -647,10 +650,12 @@
   set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
   set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
+  set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
   set(IOS FALSE)
   find_package(${ARGN})
   set(IOS TRUE)
-  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
-  set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-  set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+  set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
+  set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
+  set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
 endmacro(find_host_package)


[CMake] Temporary workaround to support building builtins on darwin with a toolchain that may not support all x86 and arm architectures.

This is at least a little better than my first attempt. We still really need a way to do compile checks without linking.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@252572 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -344,6 +344,24 @@
 endmacro()

 function(darwin_add_embedded_builtin_libraries)
+  # this is a hacky opt-out. If you can't target both intel and arm
+  # architectures we bail here.
+  set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7)
+  set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7)
+  if(NOT COMPILER_RT_SUPPORTED_ARCH MATCHES ".*armv.*")
+    return()
+  endif()
+
+  list(FIND COMPILER_RT_SUPPORTED_ARCH i386 i386_idx)
+  if(i386_idx GREATER -1)
+    list(APPEND DARWIN_HARD_FLOAT_ARCHS i386)
+  endif()
+
+  list(FIND COMPILER_RT_SUPPORTED_ARCH x86_64 x86_64_idx)
+  if(x86_64_idx GREATER -1)
+    list(APPEND DARWIN_HARD_FLOAT_ARCHS x86_64)
+  endif()
+
   set(MACHO_SYM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/macho_embedded)
   if(CMAKE_CONFIGURATION_TYPES)
     foreach(type ${CMAKE_CONFIGURATION_TYPES})
@@ -375,9 +393,6 @@
   set(CFLAGS_armv7em "-target thumbv7-apple-darwin-eabi")
   set(CFLAGS_armv7m "-target thumbv7-apple-darwin-eabi")
   set(CFLAGS_i386 "-march=pentium")
-
-  set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7)
-  set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7 i386 x86_64)

   darwin_read_list_from_file(common_FUNCTIONS ${MACHO_SYM_DIR}/common.txt)
   darwin_read_list_from_file(thumb2_FUNCTIONS ${MACHO_SYM_DIR}/thumb2.txt)


Don't emit compiler warnings for unused function parameters

--- cmake/modules/ReleaseDebugAutoFlags.cmake
+++ cmake/modules/ReleaseDebugAutoFlags.cmake
@@ -10,11 +10,11 @@
     set(CMAKE_CXX_FLAGS_DEBUG  "-Wall")
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -Wall")
 else()
-    set(CMAKE_C_FLAGS_RELEASE  "-O2")
-    set(CMAKE_C_FLAGS_DEBUG  "-g -Wall -Wextra -pedantic -fstack-protector-all")
+    set(CMAKE_C_FLAGS_RELEASE  "-O2 -Wno-unused-parameter")
+    set(CMAKE_C_FLAGS_DEBUG  "-g -Wall -Wextra -pedantic -fstack-protector-all -Wno-unused-parameter")
     set(CMAKE_C_FLAGS_RELWITHDEBINFO " -Wall -g -O2")

-    set(CMAKE_CXX_FLAGS_RELEASE  "-O2")
-    set(CMAKE_CXX_FLAGS_DEBUG  "-g -Wall -Wextra  -fstack-protector-all ")
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -Wall -g -O2")
+    set(CMAKE_CXX_FLAGS_RELEASE  "-Wall -Wextra -Wno-unused-parameter -O2")
+    set(CMAKE_CXX_FLAGS_DEBUG  "-g -Wall -Wextra -Wno-unused-parameter -fstack-protector-all")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -Wall -Wextra -Wno-unused-parameter -g -O2")
 endif()


cmake fix

cmake fix

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@9002 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/AddCXXCompileOptions.cmake
+++ cmake/AddCXXCompileOptions.cmake
@@ -226,4 +226,7 @@

   endif()

-endif()+else() # MSVC or others
+     set(CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION "")
+     set(CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION "")
+endif()


Changed FindLibreSSL.cmake to find .so instead of .a libs

--- cmake/Modules/FindLibreSSL.cmake
+++ cmake/Modules/FindLibreSSL.cmake
@@ -5,17 +5,17 @@
 )

 find_library(LibreSSL_crypto
-  NAMES libcrypto.dylib libcrypto.a crypto-38.lib crypto.lib
+  NAMES libcrypto.dylib libcrypto.so crypto-38.lib crypto.lib
   HINTS /usr/local/opt/libressl/lib
 )

 find_library(LibreSSL_ssl
-NAMES libssl.dylib libssl.a ssl-39.lib ssl.lib
+NAMES libssl.dylib libssl.so ssl-39.lib ssl.lib
   HINTS /usr/local/opt/libressl/lib
 )

 find_library(LibreSSL_tls
-NAMES libtls.dylib libtls.a tls-11.lib tls.lib
+NAMES libtls.dylib libtls.so tls-11.lib tls.lib
   HINTS /usr/local/opt/libressl/lib
 )


Fix Visual Studio 2013 linker error

Fix Visual Studio 2013 linker error

--- cmake/Qt5Core_HunterPlugin.cmake
+++ cmake/Qt5Core_HunterPlugin.cmake
@@ -78,6 +78,7 @@

   # defined: '_GetFileVersionInfoSizeW'
   _qt_cmake_extra_helpers_add_interface(Qt5::Core Mincore)
+  _qt_cmake_extra_helpers_add_interface(Qt5::Core Version)

   # defined: '__imp__timeSetEvent'
   _qt_cmake_extra_helpers_add_interface(Qt5::Core Winmm)


Use CMake FindBoost module to check that the version is at least 1.62.0

--- cmake/TPLs/FindTPLBoostOrg.cmake
+++ cmake/TPLs/FindTPLBoostOrg.cmake
@@ -6,3 +6,8 @@
   REQUIRED_HEADERS boost/version.hpp boost/mpl/at.hpp
   REQUIRED_LIBS_NAMES boost_mpi boost_serialization
   )
+
+# Use CMake FindBoost module to check version is sufficient
+SET(BOOST_INCLUDEDIR "${BoostOrg_INCLUDE_DIRS}")
+SET(Boost_NO_SYSTEM_PATHS ON)
+FIND_PACKAGE(Boost 1.62.0 REQUIRED)


Ensure NuttX build depends on defconfig

Ensure NuttX build depends on defconfig

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -226,7 +226,7 @@
 		#COMMAND ${ECHO} Exporting NuttX for ${CONFIG}
 		COMMAND ${MAKE} --no-print-directory --quiet -C ${nuttx_src}/nuttx -j${THREADS} -r CONFIG_ARCH_BOARD=${CONFIG} export > nuttx_build.log
 		COMMAND ${CP} -r ${nuttx_src}/nuttx/nuttx-export.zip ${PX4_BINARY_DIR}/${CONFIG}.export
-		DEPENDS ${config_files} ${DEPENDS}
+		DEPENDS ${config_files} "${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/nsh/defconfig" ${DEPENDS}
 		WORKING_DIRECTORY ${PX4_BINARY_DIR}
 		COMMENT "Building NuttX for ${CONFIG}")


Revert "Remove rsync dependency"

Revert "Remove rsync dependency"

This reverts commit 5b9a19aa65c3e27fe979181ea9817ec7347c4fbf.

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -213,8 +213,7 @@
 	# copy
 	add_custom_command(OUTPUT nuttx_copy_${CONFIG}.stamp
 		COMMAND ${MKDIR} -p ${CMAKE_BINARY_DIR}/${CONFIG}
-		COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/NuttX ${nuttx_src}
-		COMMAND ${RM} -rf ${nuttx_src}/.git
+		COMMAND rsync -a --exclude=.git ${CMAKE_SOURCE_DIR}/NuttX/ ${nuttx_src}/
 		COMMAND ${TOUCH} nuttx_copy_${CONFIG}.stamp
 		DEPENDS ${DEPENDS})
 	add_custom_target(__nuttx_copy_${CONFIG}


add version number

add version number

--- cmake_includes/pkg_windows.cmake
+++ cmake_includes/pkg_windows.cmake
@@ -1,3 +1,5 @@
+include(${SDK_DIR}/CMakeVersion)
+
 set(SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}/${SDK_DIR}/src/)
 set(RELEASE_DIRS ${SRC_DIR}/cameras/playback/Release/ ${SRC_DIR}/cameras/record/Release/ ${SRC_DIR}/cameras/compression/Release/ ${SRC_DIR}/core/image/Release/
 			${SRC_DIR}/core/pipeline/Release/ ${SRC_DIR}/core/projection/Release/ ${SRC_DIR}/cv_modules/max_depth_value_module/Release/ ${SRC_DIR}/utilities/command_line/Release/
@@ -9,15 +11,8 @@
 DIRECTORY ${RELEASE_DIRS}
 DESTINATION Libraries/
 COMPONENT LIBS
-FILES_MATCHING PATTERN "*.dll"
+FILES_MATCHING PATTERN "*.dll" PATTERN "*.lib"
 )
-
-install(
-DIRECTORY ${RELEASE_DIRS}
-DESTINATION Libraries/
-COMPONENT LIBS
-FILES_MATCHING PATTERN "*.lib"
-)

 install(
 DIRECTORY ${EXE_DIRS}
@@ -37,13 +32,6 @@
 DIRECTORY ${LIBREALSENSE_DIR}/bin/x64/
 DESTINATION 3rdparty/
 COMPONENT LIBREALSENSE
-FILES_MATCHING PATTERN "*.dll"
-)
-
-install(
-DIRECTORY ${OPENCV_DIR}/bin/Release/
-DESTINATION 3rdparty/
-COMPONENT OPENCV
 FILES_MATCHING PATTERN "*.dll"
 )

@@ -78,11 +66,11 @@
 # CPack configuration
 ##########################################

-set(CPACK_PACKAGE_FILE_NAME "realsense_sdk")
+set(CPACK_PACKAGE_VERSION "${SDK_VERSION_MAJOR}.${SDK_VERSION_MINOR}.${SDK_VERSION_PATCH}")
+set(CPACK_PACKAGE_FILE_NAME "realsense_sdk.${CPACK_PACKAGE_VERSION}")
 set(CPACK_PACKAGE_VENDOR "Intel")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "RealSense SDK Installer")
 set(CPACK_PACKAGE_INSTALL_DIRECTORY "Intel\\\\RealSense")
-set(CPACK_PACKAGE_VERSION "")

 set(CPACK_COMPONENTS_ALL LIBS TOOLS HEADERS LIBREALSENSE OPENCV GTEST LZ4 DOCS)
 set(CPACK_COMPONENT_LIBREALSENSE_GROUP "3rdparty")


Added 4.0 to LIBCLANG_KNOWN_LLVM_VERSIONS

--- cmake_modules/FindLibClang.cmake
+++ cmake_modules/FindLibClang.cmake
@@ -14,7 +14,9 @@
 #               Known LLVM release numbers.

 # most recent versions come first
-set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.9.0
+set(LIBCLANG_KNOWN_LLVM_VERSIONS 4.0.0
+  4.0
+  3.9.0
   3.9
   3.8.1
   3.8.0


Fix bug in setting VS compiler flags.

Fix bug in setting VS compiler flags.

--- src/unit_VEHICLE/cmake/FindChronoEngine.cmake
+++ src/unit_VEHICLE/cmake/FindChronoEngine.cmake
@@ -72,11 +72,11 @@
         ADD_DEFINITIONS( "-D_SCL_SECURE_NO_DEPRECATE" )  # avoids deprecation warnings
     ENDIF(MSVC)
     IF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC")
-        SET (CH_BUILDFLAGS "-DWIN32; -DNOMINMAX; -MP")
+        SET (CH_BUILDFLAGS "-DWIN32 -DNOMINMAX -MP")
         SET (CH_LINKERFLAG_SHARED "/FORCE:MULTIPLE")
         SET(CPACK_SYSTEM_NAME "Win-x86")
     ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC_X64")
-        SET (CH_BUILDFLAGS "-DWIN64; -D_WIN64; -DNOMINMAX; -MP")
+        SET (CH_BUILDFLAGS "-DWIN64 -D_WIN64 -DNOMINMAX -MP")
         SET (CH_LINKERFLAG_SHARED "/FORCE:MULTIPLE")
         SET(CPACK_SYSTEM_NAME "Win-x64")
     ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_GCC")


BUG: Restore list of headers generation for swig.

--- Code/BasicFilters/SourceCodeGenerator.cmake
+++ Code/BasicFilters/SourceCodeGenerator.cmake
@@ -28,9 +28,9 @@
 endforeach()

 # clear the include files
-# file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "" )
-# file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "" )
-# foreach ( filter ${GENERATED_FILTER_LIST} )
-#   file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#include \"sitk${filter}ImageFilter.h\"\n" )
-#   file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "%include \"sitk${filter}ImageFilter.h\"\n" )
-# endforeach()
+file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "" )
+file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "" )
+foreach ( filter ${GENERATED_FILTER_LIST} )
+  file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#include \"sitk${filter}ImageFilter.h\"\n" )
+  file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "%include \"sitk${filter}ImageFilter.h\"\n" )
+endforeach()


remove /bigobj for msvc

remove /bigobj for msvc

--- cmake/PlatformWindowsMSVC.cmake
+++ cmake/PlatformWindowsMSVC.cmake
@@ -47,7 +47,7 @@
     # /MD           # -> runtime library: multithreaded dll
     # /MDd          # -> Runtime Library: Multithreaded Debug DLL

-      /bigobj       # -> an object file can hold up to 65,536 (2^16) addressable sections,
+    # /bigobj       # -> an object file can hold up to 65,536 (2^16) addressable sections,
                     #    /bigobj increases that address capacity to 4,294,967,296 (2^32).
 )


docstring

docstring

--- cmake/catkin_python_setup.cmake
+++ cmake/catkin_python_setup.cmake
@@ -1,5 +1,5 @@
 #
-# Create forwarding Python :term:`pkgutil` infrastructure in
+# Creates forwarding Python :term:`pkgutil` infrastructure in
 # buildspace that enables mixing :term:`generated code` in buildspace
 # with :term:`static code` from sourcespace within a single Python
 # package.
@@ -10,6 +10,7 @@
 #
 # .. note:: If the project also uses message generation via
 #   ``generate_messages()`` this function must be called before.
+#
 #
 # @public
 #


[cmake] serach FastCGI includes also in include/fastcgi directory

Used in OpenSUSE

--- cmake/modules/FindFastCGI.cmake
+++ cmake/modules/FindFastCGI.cmake
@@ -10,7 +10,7 @@
 #  FASTCGI_LIBRARY     - library when using FastCGI.
 #  FASTCGI_FOUND       - true if FASTCGI found.

-find_path(FASTCGI_INCLUDE_DIR NAME fcgiapp.h PATH_SUFFIXES include)
+find_path(FASTCGI_INCLUDE_DIR NAME fcgiapp.h PATH_SUFFIXES include/fastcgi include)

 if(NOT FASTCGI_LIBRARY)
    find_library(FASTCGI_LIBRARY NAMES fcgi PATHS PATH_SUFFIXES lib)


updated paths in install scripts

updated paths in install scripts

--- cmake/ospray_cmake_config.cmake
+++ cmake/ospray_cmake_config.cmake
@@ -54,13 +54,13 @@

 INSTALL(FILES
   ${ospray_MODULE_INSTALL_FILES}
-  ${CMAKE_SOURCE_DIR}/cmake/clang.cmake
-  ${CMAKE_SOURCE_DIR}/cmake/icc.cmake
-  ${CMAKE_SOURCE_DIR}/cmake/icc_xeonphi.cmake
-  ${CMAKE_SOURCE_DIR}/cmake/ispc.cmake
-  ${CMAKE_SOURCE_DIR}/cmake/gcc.cmake
-  ${CMAKE_SOURCE_DIR}/cmake/msvc.cmake
-  ${CMAKE_SOURCE_DIR}/ospcommon/cmake/macros.cmake#NOTE(jda) - hack!
+  ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/clang.cmake
+  ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/icc.cmake
+  ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/icc_xeonphi.cmake
+  ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/ispc.cmake
+  ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/gcc.cmake
+  ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/msvc.cmake
+  ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/macros.cmake#NOTE(jda) - hack!
   DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ospray-${OSPRAY_VERSION}"
   COMPONENT devel
 )


Another fix in xqdoc for external modules that work with installed zorba.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -578,8 +578,7 @@
   MESSAGE(STATUS "ADD_XQDOC_TARGETS for project ${PROJECT_NAME}")

   # Add the xqdoc command for which a working zorba cmd is required.
-  GET_TARGET_PROPERTY(ZORBA_EXE_LOCATION "zorba" LOCATION)
-  SET(ZORBA_EXE_SCRIPT ${ZORBA_EXE_LOCATION} CACHE PATH "Path to installed zorba.exe")
+  SET(ZORBA_EXE_SCRIPT  ${Zorba_DIR}/bin/zorba CACHE PATH "Path to installed zorba.exe")

   FILE(GLOB_RECURSE LOCAL_MODULES  ${PROJECT_SOURCE_DIR}/src/*.xq)
   SET(ZORBA_XQDOC_MAIN_EXTMODULES_XML_XQ  ${Zorba_DIR}/xqdoc/generator/xqdoc-main-extmodules-xml.xq CACHE PATH "The xqdoc xml generator for external modules")


Added EXTRA_SOURCES arg to DECLARE_ZORBA_MODULE(); use it in image module.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -122,8 +122,8 @@
 # file enough to deduce the URI and version?
 MACRO (DECLARE_ZORBA_MODULE)
   # Parse and validate arguments
-  PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES" "URI;FILE;VERSION;OUTPUT_DIRECTORY"
-    "" ${ARGN})
+  PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES"
+    "URI;FILE;VERSION;OUTPUT_DIRECTORY" "" ${ARGN})
   IF (NOT MODULE_FILE)
     MESSAGE (FATAL_ERROR "'FILE' argument is required for ZORBA_DECLARE_MODULE()")
   ENDIF (NOT MODULE_FILE)
@@ -182,12 +182,19 @@

   # Now, deal with associated C++ source for external functions.

-  IF(EXISTS "${SOURCE_FILE}.src/")
-    # all the cpp files found in the ${module_name}.xq.src
-    # directory are added to the sources list
+  IF(MODULE_EXTRA_SOURCES OR EXISTS "${SOURCE_FILE}.src/")
+    # all the cpp files found in the ${module_name}.xq.src directory
+    # are added to the sources list, as are any cpp files found in any
+    # directory in EXTRA_SOURCES
     SET (SRC_FILES)
-    FILE(GLOB_RECURSE SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-      "${SOURCE_FILE}.src/*.cpp")
+    FOREACH (_src_dir "${SOURCE_FILE}.src" ${MODULE_EXTRA_SOURCES})
+      IF (NOT IS_ABSOLUTE "${_src_dir}")
+        SET (_src_dir "${CMAKE_CURRENT_SOURCE_DIR}/${_src_dir}")
+      ENDIF (NOT IS_ABSOLUTE "${_src_dir}")
+      FILE(GLOB_RECURSE _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+        "${_src_dir}/*.cpp")
+      LIST (APPEND SRC_FILES ${_srcs})
+    ENDFOREACH (_src_dir)

     MESSAGE(STATUS "Add library " ${module_name})
     SET(SUFFIX)
@@ -251,8 +258,7 @@
     TARGET_LINK_LIBRARIES(${module_lib_target}
       zorba_${ZORBA_STORE_NAME} ${MODULE_LINK_LIBRARIES})

-  ENDIF(EXISTS "${SOURCE_FILE}.src/")
-
+  ENDIF(MODULE_EXTRA_SOURCES OR EXISTS "${SOURCE_FILE}.src/")

   # Done dealing with C++. Now, set up rules which will copy the
   # module source file and dynamic library to each target filename in


Allow generated IDL files (#45)

Allow generated IDL files (#45)

--- rosidl_generator_dds_idl/cmake/rosidl_generate_dds_interfaces.cmake
+++ rosidl_generator_dds_idl/cmake/rosidl_generate_dds_interfaces.cmake
@@ -92,7 +92,10 @@
     ${_dependency_files})
   foreach(dep ${target_dependencies})
     if(NOT EXISTS "${dep}")
-      message(FATAL_ERROR "Target dependency '${dep}' does not exist")
+      get_property(is_generated SOURCE "${dep}" PROPERTY GENERATED)
+      if(NOT ${_is_generated})
+        message(FATAL_ERROR "Target dependency '${dep}' does not exist")
+      endif()
     endif()
   endforeach()


fix external process execution and variable setting

--- skeleton-opt-pass/cmake/modules/FindPythonModule.cmake
+++ skeleton-opt-pass/cmake/modules/FindPythonModule.cmake
@@ -15,8 +15,7 @@
   print re.compile('/__init__.py.*').sub('',${name}.__file__)")

   if(PYTHONINTERP_FOUND)
-    execute_process(COMMAND
-      ${PYTHON_EXECUTABLE} "-c" "${prg_str}"
+    execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "${prg_str}"
       RESULT_VARIABLE result
       OUTPUT_VARIABLE location
       ERROR_QUIET
@@ -26,7 +25,8 @@
   endif()

   if(NOT result)
-    message(STATUS "location ${location} of Python module: ${module}")
+    message(STATUS "location '${location}' of Python module: ${module}")
+    set(${module} ${location})
     set(${module} ${location} CACHE STRING "Location of Python module: ${name}")
   endif()


enhanced cmscopyfilemd5.cmake

enhanced cmscopyfilemd5.cmake

* adds multiple tries at making destination directory
* remove smbget --dots and --quiet options and commented-out code
* https://isrhub.usurf.usu.edu/petemace/VantageMedia/commit/505f7f360c44d21da676669274ce412e10208418
  * see commit comment: "the new cpfilemd5.cmake is a modified copy of externpro's cmscopyfilemd5.cmake and the changes could go back there in the next release of externpro"

issue https://github.com/smanders/externpro/issues/180

--- modules/cmscopyfilemd5.cmake
+++ modules/cmscopyfilemd5.cmake
@@ -2,25 +2,26 @@
 # @param[in] dst : destination
 # @param[in] md5 : MD5 hash (or checksum)
 # @param[in] wg : workgroup
+while(NOT EXISTS ${dst})
+  execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${dst})
+  if(NOT EXISTS ${dst})
+    execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5)
+  endif()
+endwhile()
 get_filename_component(fn ${src} NAME)
 string(REGEX MATCH "^//" uncpath ${src})
 if((NOT WIN32) AND (NOT ${uncpath} STREQUAL ""))
-  if(NOT EXISTS ${dst})
-    execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${dst})
-  endif()
   if(NOT EXISTS ${dst}/${fn})
     # smbget - wget-like utility for download files over SMB
-    set(smbget_cmd smbget --dots --keep-permissions --quiet
+    set(smbget_cmd smbget --keep-permissions
       --username=$ENV{USER} --workgroup=${wg} #--password=
       )
     execute_process(COMMAND ${smbget_cmd} smb:${src} WORKING_DIRECTORY ${dst})
-    #execute_process(COMMAND ${CMAKE_COMMAND} -E chdir ${dst} ${smbget_cmd})
   endif()
 else()
   file(COPY ${src} DESTINATION ${dst} USE_SOURCE_PERMISSIONS)
 endif()
 file(MD5 ${dst}/${fn} md5sum)
-#execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum ${dst}/${fn})
 if(NOT ${md5sum} STREQUAL ${md5})
   message(FATAL_ERROR
     "* MD5 mismatch: ${fn}\n"


update cpack settings

update cpack settings

--- CMakeModules/CPackSettings.cmake
+++ CMakeModules/CPackSettings.cmake
@@ -26,6 +26,8 @@
     "ompl.pc$"
     "installPyPlusPlus.bat$"
     "installPyPlusPlus.sh$"
+    "create_symlinks.sh$"
+    "uninstall_symlinks.sh$"
     "config.h$")
 set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
 set(CPACK_GENERATOR "TGZ")


fix installation of PDB files from the examples.

--- CMakeModules/OsgMacroUtils.cmake
+++ CMakeModules/OsgMacroUtils.cmake
@@ -491,8 +491,8 @@
         ELSE(APPLE)
             INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
             IF(MSVC)
-                INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
-                INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
+                INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${EXAMPLE_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
+                INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${EXAMPLE_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
             ENDIF(MSVC)
         ENDIF(APPLE)


Update CLBlast version to 1.5.1

Update CLBlast version to 1.5.1

--- CMakeModules/build_CLBlast.cmake
+++ CMakeModules/build_CLBlast.cmake
@@ -52,7 +52,7 @@
 ExternalProject_Add(
     CLBlast-ext
     GIT_REPOSITORY https://github.com/cnugteren/CLBlast.git
-    GIT_TAG 1.5.0
+    GIT_TAG 1.5.1
     PREFIX "${prefix}"
     INSTALL_DIR "${prefix}"
     UPDATE_COMMAND ""


CFlags

CFlags

--- cmake/CFlags.cmake
+++ cmake/CFlags.cmake
@@ -1,4 +1,4 @@
-set(CMAKE_CXX_FLAGS "-std=c++0x -ftemplate-depth=500 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall ${CMAKE_CXX_FLAGS}")
+set(CMAKE_CXX_FLAGS "-std=c++0x -ftemplate-depth=500 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wdelete-non-virtual-dtor${CMAKE_CXX_FLAGS}")
 set(CMAKE_C_FLAGS "-std=c11 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -pedantic ${CMAKE_C_FLAGS}")

 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lprotobuf -lz -lpthread")


Some work towards supporting building OpenCOR with Ninja (#364) [ci skip].

Not only does this work with Ninja (on Linux and OS X since it was
already working fine on Windows), but it’s also neater.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -697,15 +697,15 @@

     SET(PLUGIN_FILENAME ${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})

-    ADD_CUSTOM_TARGET(${PLUGIN_NAME}_COPY_PLUGIN_TO_PLUGINS_DIRECTORY ALL
-                      COMMAND ${CMAKE_COMMAND} -E copy ${PLUGIN_BINARY_DIR}/${PLUGIN_FILENAME}
-                                                       ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})
+    ADD_CUSTOM_COMMAND(OUTPUT ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME}
+                       COMMAND ${CMAKE_COMMAND} -E copy ${PLUGIN_BINARY_DIR}/${PLUGIN_FILENAME}
+                                                        ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})

     # Make a copy of the plugin to our main build directory

-    ADD_CUSTOM_TARGET(${PLUGIN_NAME}_COPY_PLUGIN_TO_BUILD_DIRECTORY ALL
-                      COMMAND ${CMAKE_COMMAND} -E copy ${PLUGIN_BINARY_DIR}/${PLUGIN_FILENAME}
-                                                       ${PROJECT_BUILD_DIR}/${PLUGIN_FILENAME})
+    ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BUILD_DIR}/${PLUGIN_FILENAME}
+                       COMMAND ${CMAKE_COMMAND} -E copy ${PLUGIN_BINARY_DIR}/${PLUGIN_FILENAME}
+                                                        ${PROJECT_BUILD_DIR}/${PLUGIN_FILENAME})

     # A few OS X specific things

@@ -718,7 +718,7 @@
         IF(NOT "$ENV{PACKAGE_OPENCOR}" STREQUAL "True")
             FOREACH(QT_LIBRARY ${QT_LIBRARIES})
                 ADD_CUSTOM_TARGET(${PLUGIN_NAME}_${QT_LIBRARY}_UPDATE_OS_X_QT_REFERENCE_IN_BUNDLE ALL
-                                  DEPENDS ${PLUGIN_NAME}_COPY_PLUGIN_TO_BUILD_DIRECTORY
+                                  DEPENDS ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME}
                                   COMMAND install_name_tool -change @executable_path/../Frameworks/${QT_LIBRARY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_LIBRARY}
                                                                     ${QT_LIBRARY_DIR}/${QT_LIBRARY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_LIBRARY}
                                                                     ${DEST_PLUGINS_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
@@ -733,7 +733,7 @@

         FOREACH(QT_LIBRARY ${QT_LIBRARIES})
             ADD_CUSTOM_TARGET(${PLUGIN_NAME}_${QT_LIBRARY}_UPDATE_OS_X_QT_REFERENCE_IN_BUILD_DIRECTORY ALL
-                              DEPENDS ${PLUGIN_NAME}_COPY_PLUGIN_TO_BUILD_DIRECTORY
+                              DEPENDS ${PROJECT_BUILD_DIR}/${PLUGIN_FILENAME}
                               COMMAND install_name_tool -change @executable_path/../Frameworks/${QT_LIBRARY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_LIBRARY}
                                                                 ${QT_LIBRARY_DIR}/${QT_LIBRARY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_LIBRARY}
                                                                 ${PROJECT_BUILD_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})


Swapped libprotoc and libprotobuf

Swapped libprotoc and libprotobuf

libprotobuf being targed before libprotoc was causing Visual Studio to fail in linking protoc.

--- cmake/protoc.cmake
+++ cmake/protoc.cmake
@@ -9,7 +9,7 @@
 endif()

 add_executable(protoc ${protoc_files} ${protoc_rc_files})
-target_link_libraries(protoc libprotobuf libprotoc)
+target_link_libraries(protoc libprotoc libprotobuf)
 add_executable(protobuf::protoc ALIAS protoc)

 set_target_properties(protoc PROPERTIES


Using full path to library in cmake

Using full path to library in cmake

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -1,4 +1,4 @@
 find_package(Python)
-set(python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
-set(python_LIBRARY_DIRS ${PYTHON_LIBRARY_DIRS})
-set(python_LIBRARIES ${PYTHON_LIBRARIES})
+set(python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
+get_filename_component(python_LIBRARY_DIRS ${PYTHON_LIBRARY} PATH)
+set(python_LIBRARIES ${PYTHON_LIBRARY})


Add comments and CMAKE_SYSTEM_NAME

Add comments and CMAKE_SYSTEM_NAME

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -11,6 +11,14 @@
 # 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.
+
+# Detects the OS and sets appropriate variables.
+# CMAKE_SYSTEM_NAME only give us a coarse-grained name,
+# but the name like centos is necessary in some scenes
+# to distinguish system for customization.
+#
+# for instance, protobuf libs path is <install_dir>/lib64
+# on CentOS, but <install_dir>/lib on other systems.

 IF(WIN32)
     SET(HOST_SYSTEM "win32")
@@ -45,7 +53,7 @@
         ENDIF(EXISTS "/etc/redhat-release")

         IF(NOT HOST_SYSTEM)
-            SET(HOST_SYSTEM "unknown")
+            SET(HOST_SYSTEM ${CMAKE_SYSTEM_NAME})
         ENDIF()

     ENDIF(APPLE)


msvc: disable /EHsc compile flag.

msvc: disable /EHsc compile flag.

--- cmake/CompillerSettings.cmake
+++ cmake/CompillerSettings.cmake
@@ -45,7 +45,7 @@
   add_definitions(-DMSVC)
   add_definitions(-D_ENABLE_ATOMIC_ALIGNMENT_FIX)

-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501 /EHsc")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501")
   set(CMAKE_CXX_FLAGS_RELEASE "/Ox /GT /Ot -DNDEBUG")
   set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oy") #-fno-omit-frame-pointer analog
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")


FindLua52.cmake: Cosmetic improvements.

FindLua52.cmake: Cosmetic improvements.

Mark _LUA_MATH_LIBRARY as advanced.
Display include directory in the "found" message instead of the longer library
string.

--- cmake/Modules/FindLua52.cmake
+++ cmake/Modules/FindLua52.cmake
@@ -100,6 +100,7 @@

   IF(UNIX AND NOT APPLE)
     FIND_LIBRARY(_LUA_MATH_LIBRARY m)
+    mark_as_advanced(_LUA_MATH_LIBRARY)
   ENDIF(UNIX AND NOT APPLE)
    # For Windows and Mac, don't need to explicitly include the math library
 ENDIF()
@@ -121,7 +122,7 @@
 # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
-                                  REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
+                                  REQUIRED_VARS LUA_INCLUDE_DIR LUA_LIBRARIES
                                   VERSION_VAR LUA_VERSION_STRING)

 MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY


Added some more paths to DRAKE_INCLUDE_DIRS as a quick build fix for Drake master.

--- cmake/modules/FindDrake.cmake
+++ cmake/modules/FindDrake.cmake
@@ -15,7 +15,9 @@
   )

 set(DRAKE_INCLUDE_DIRS
+  ${DRAKE_SOURCE_DIR}/util
   ${DRAKE_SOURCE_DIR}/systems/plants
+  ${DRAKE_SOURCE_DIR}/systems/plants/joints
   ${DRAKE_SOURCE_DIR}/systems/plants/tinyxml
   )


No need to dereference the variable

No need to dereference the variable

--- cmake/modules/FindNumPy.cmake
+++ cmake/modules/FindNumPy.cmake
@@ -16,7 +16,7 @@
     OUTPUT_VARIABLE __numpy_include_dir
     ERROR_QUIET)

-  if (${__numpy_include_dir_res} EQUAL 0)
+  if (NOT __numpy_include_dir_res)
     set(NUMPY_INCLUDE_DIR "${__numpy_include_dir}"
       CACHE PATH "Include directory for NumPy headers")
   endif ()


Missing build dependency for gdbus-codegen on input .xml file

Related to https://gitlab.gnome.org/GNOME/evolution-data-server/issues/7

--- cmake/modules/GLibTools.cmake
+++ cmake/modules/GLibTools.cmake
@@ -175,6 +175,7 @@
 			--generate-docbook ${_files_prefix}
 			${_args}
 			${CMAKE_CURRENT_SOURCE_DIR}/${_xml}
+		MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${_xml}
 		VERBATIM
 	)
 endfunction(gdbus_codegen_custom)


Fixing gflags static link

Fixing gflags static link

Former-commit-id: 7521a9733459293e40a070b889299187dd421ee1

--- cmake-modules/Fetch_Glog.cmake
+++ cmake-modules/Fetch_Glog.cmake
@@ -50,10 +50,12 @@

     ExternalProject_Get_Property(external_GLOG INSTALL_DIR)
     add_library(glog INTERFACE)
-    set(GLOG_INCLUDE_DIR ${INSTALL_DIR}/include)
-    set(glog_DIR ${INSTALL_DIR}/lib/cmake/glog)
+    include(GNUInstallDirs)
+    set(GLOG_INCLUDE_DIR ${INSTALL_DIR}/${CMAKE_INSTALL_INCLUDEDIR})
+    set(GLOG_LIBRARIES   ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libglog${CUSTOM_SUFFIX})
+    set(glog_DIR ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/glog)
     add_dependencies(glog external_GLOG gflags)
-    target_link_libraries(glog INTERFACE gflags ${INSTALL_DIR}/lib/libglog${CUSTOM_SUFFIX}  Threads::Threads)
+    target_link_libraries(glog INTERFACE ${GLOG_LIBRARIES} gflags   Threads::Threads)
     target_include_directories(glog INTERFACE ${GLOG_INCLUDE_DIR})
 endif()


[CMake] improve precondition error message when negative precondition fails

--- cmake/modules/SwiftUtils.cmake
+++ cmake/modules/SwiftUtils.cmake
@@ -13,7 +13,7 @@
       if (PRECONDITION_MESSAGE)
         message(FATAL_ERROR "Error! ${PRECONDITION_MESSAGE}")
       else()
-        message(FATAL_ERROR "Error! Variable ${var} is true.")
+        message(FATAL_ERROR "Error! Variable ${var} is true or not empty. The value of ${var} is ${${var}}.")
       endif()
     endif()
   else()


need to specify ZLIB_BINARY

need to specify ZLIB_BINARY

--- projects/boost.cmake
+++ projects/boost.cmake
@@ -265,7 +265,7 @@
     )
   #list(APPEND boost_BUILD --without-locale --without-mpi)
   list(APPEND boost_BUILD --with-iostreams)
-  list(APPEND boost_BUILD -s ZLIB_INCLUDE=${STAGE_DIR}/include/zlib -s ZLIB_LIBPATH=${STAGE_DIR}/lib)
+  list(APPEND boost_BUILD -s ZLIB_BINARY=zlibstatic-s -s ZLIB_INCLUDE=${STAGE_DIR}/include/zlib -s ZLIB_LIBPATH=${STAGE_DIR}/lib)
   if(${CMAKE_SYSTEM_NAME} STREQUAL SunOS)
     # Memory exhausted errors (/opt/csw/i386-pc-solaris2.10/bin/ranlib)
     # wave/build/gcc-4.8.0/debug/address-model-64/link-static/runtime-link-static/threading-multi/


fix for 4.2 preview build

fix for 4.2 preview build

--- microservices/landing_zone_microservices/landing_zone_microservices.cmake
+++ microservices/landing_zone_microservices/landing_zone_microservices.cmake
@@ -32,7 +32,7 @@
     ${MICROSERVICE}
     PRIVATE
     irods_server
-    irods_clerver
+    irods_client
     irods_common
     #/usr/local/lib/libMagick++-7.Q16HDRI.so.0.0.0
     ${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so


Change if cmake version

Change if cmake version

--- source/cmake_modules/ThirdParty.cmake
+++ source/cmake_modules/ThirdParty.cmake
@@ -35,7 +35,7 @@
 # prometheus-cpp
 #
 # We want to deactivate prometheus lib if CMake version < 2.8.12.2
-if(("${CMAKE_VERSION}" VERSION_GREATER 2.8.12.2) OR ("${CMAKE_VERSION}" VERSION_EQUAL 2.8.12.2))
+if("${CMAKE_VERSION}" VERSION_GREATER 2.8.12.1)

     include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third_party/prometheus-cpp/include/"
                         "${CMAKE_BINARY_DIR}/third_party/prometheus-cpp/lib/cpp")
@@ -48,9 +48,9 @@

     set(ENABLE_PROMETHEUS ON)
     # Flag activation for code define
-    add_definitions(-DENABLE_PROMETHEUS)
+    add_definitions(-DENABLE_PROMETHEUS=1)

-else(("${CMAKE_VERSION}" VERSION_GREATER 2.8.12.2) OR ("${CMAKE_VERSION}" VERSION_EQUAL 2.8.12.2))
+else()
     message("-- CMake version < 2.8.12.2, Skip prometheus in third party")
     message(DEPRECATION " ${CMAKE_OS_NAME} ${CMAKE_OS_VERSION} is no longer maintained for navitia project")

@@ -58,7 +58,7 @@
     # Flag activation for code define (=0)
     add_definitions(-DENABLE_PROMETHEUS=0)

-endif(("${CMAKE_VERSION}" VERSION_GREATER 2.8.12.2) OR ("${CMAKE_VERSION}" VERSION_EQUAL 2.8.12.2))
+endif()

 # Reactivate warnings flags
 set(CMAKE_CXX_FLAGS ${TMP_FLAG})


opengm: Build without CPLEX if it can't be found.

--- opengm.cmake
+++ opengm.cmake
@@ -21,6 +21,9 @@

 if(CPLEX_ROOT_DIR)
     set(CMAKE_CPLEX_ROOT_DIR "-DCPLEX_ROOT_DIR=${CPLEX_ROOT_DIR}")
+    set(WITH_CPLEX ON)
+else()
+    set(WITH_CPLEX OFF)
 endif()

 message ("Installing ${opengm_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
@@ -35,7 +38,7 @@
     CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${opengm_SRC_DIR}
         -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR}
         -DCMAKE_PREFIX_PATH=${BUILDEM_DIR}
-        -DWITH_CPLEX=ON
+        -DWITH_CPLEX=${WITH_CPLEX}
         -DWITH_BOOST=ON
         -DWITH_HDF5=ON
         -DBUILD_PYTHON_WRAPPER=ON


icc options for optimization and analysis

- more debug info
- core-avx2 optimization target (check INTEL_OPTIMIZATION_FLAGS!)

--- cmake/icc.cmake
+++ cmake/icc.cmake
@@ -10,11 +10,11 @@
 else()

     set(COMMON_CXX_FLAGS "/Gm /DNOMINMAX /W3 /Qopenmp /MP /GR")
-    set(INTEL_OPTIMIZATION_FLAGS "/Ob2 /O3 /Oi /Qparallel /GA")
+    set(INTEL_OPTIMIZATION_FLAGS "/Ob2 /O3 /Oi /Qparallel /GA /QaxSSE3,CORE-AVX2" CACHE STRING "icc-specific optimization options - check your architecture!")

-    set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS} /MDd /Od /DDEBUG /D_DEBUG /Zi" CACHE STRING "" FORCE)
+    set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS} /MDd /Od /DDEBUG /D_DEBUG /Zi /Zo /debug /debug:inline-debug-info" CACHE STRING "" FORCE)
     set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_CXX_FLAGS} /MD /DNDEBUG /D_NDEBUG ${INTEL_OPTIMIZATION_FLAGS}" CACHE STRING "" FORCE)
     # /Qguide:1 generates no result file for vislibversioninfo?
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${COMMON_CXX_FLAGS} /MD /DNDEBUG /D_NDEBUG ${INTEL_OPTIMIZATION_FLAGS} /Zi /Qopt-report:2" CACHE STRING "" FORCE)
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${COMMON_CXX_FLAGS} /MD /DNDEBUG /D_NDEBUG ${INTEL_OPTIMIZATION_FLAGS} /Zi /Zo /debug /debug:inline-debug-info /Qopt-report:2" CACHE STRING "" FORCE)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox /Gm /MP /W3 /std=c99 /Qopenmp" CACHE STRING "" FORCE)
 endif()


Fix double lib prefix in CMake MinGW builds.

--- cmake/src.cmake
+++ cmake/src.cmake
@@ -60,7 +60,7 @@
     target_link_libraries(${PROJECT_NAME} PUBLIC m)
 endif()

-if(WIN32)
+if(MSVC)
     set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME lib${PROJECT_NAME})
 endif()