- remove the debug_test_* targets from "all"   (otherwise they are compiled when you simply run    make in test/ or when enforcing "test" to be part of "all") - add linking libraries to the debug_test_* targets

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -45,7 +45,7 @@
   set(filename ${testname}.cpp)
   add_executable(${targetname} ${filename})
   add_dependencies(btest ${targetname})
-  add_executable(${debug_targetname} ${filename})
+  add_executable(${debug_targetname} EXCLUDE_FROM_ALL ${filename})

   if(NOT EIGEN_NO_ASSERTION_CHECKING)

@@ -92,6 +92,7 @@
     string(LENGTH "${ARGV2_stripped}" ARGV2_stripped_length)
     if(${ARGV2_stripped_length} GREATER 0)
       target_link_libraries(${targetname} ${ARGV2})
+      target_link_libraries(${debug_targetname} ${ARGV2})
     endif(${ARGV2_stripped_length} GREATER 0)
   endif(${ARGC} GREATER 2)


add constants plugin

add constants plugin

--- cmake/ElektraCache.cmake
+++ cmake/ElektraCache.cmake
@@ -1,7 +1,12 @@
 #
 # CACHE
 #
-# Here the cache variables are set
+# Here all cache variables are set
+#
+#
+# If you add something here, make sure to also add it in
+# src/include/kdbversion.h.in
+

 #
 # the default list of plugins
@@ -34,13 +39,13 @@
 # Should compile on every system where elektra compiles.
 #
 set (PLUGINS_LIST_NODEP
-	resolver_c_b_b  # needed for tests
 	ccode
 	error  fstab
 	hexcode  hidden
 	ni  null
 	struct  success
 	tracer  type  validation
+	constants
 	)

 #
@@ -54,6 +59,7 @@
 	timeofday
 	simpleini
 	line
+	resolver_c_b_b  # needed for tests
 	)

 #


fix arch detection

fix arch detection

--- cmake/FindCudaArch.cmake
+++ cmake/FindCudaArch.cmake
@@ -42,6 +42,7 @@
       "}\n")

     EXECUTE_PROCESS(COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${__cufile}"
+                    "-ccbin" ${CMAKE_CXX_COMPILER}
                     WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                     RESULT_VARIABLE __nvcc_res OUTPUT_VARIABLE __nvcc_out
                     ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)


some gtest setting for windows; updates #203'

--- cmake/FindGTestFix.cmake
+++ cmake/FindGTestFix.cmake
@@ -1,44 +1,50 @@
+# Prevent overriding the parent project's compiler/linker settings on Windows
+set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+
 find_package(Threads REQUIRED)
 find_package(GTest)

-if (NOT GTest_FOUND)
-	if (CMAKE_SYSTEM_NAME MATCHES Linux AND NOT WITH_CONAN)
+if(NOT GTest_FOUND)
+  if(CMAKE_SYSTEM_NAME MATCHES Linux AND NOT WITH_CONAN)

-		find_program(LSB_RELEASE lsb_release)
-		execute_process(COMMAND ${LSB_RELEASE} -is
-			OUTPUT_VARIABLE LINUX_DISTRIBUTION
-			OUTPUT_STRIP_TRAILING_WHITESPACE)
+    find_program(LSB_RELEASE lsb_release)
+    execute_process(COMMAND ${LSB_RELEASE} -is
+        OUTPUT_VARIABLE LINUX_DISTRIBUTION
+        OUTPUT_STRIP_TRAILING_WHITESPACE)

-		if (LINUX_DISTRIBUTION MATCHES "Debian" OR LINUX_DISTRIBUTION MATCHES "Ubuntu")
-			message(STATUS "Attempting to apply Debian fix for googletest")
+    if(LINUX_DISTRIBUTION MATCHES "Debian" OR LINUX_DISTRIBUTION MATCHES "Ubuntu")
+      message(STATUS "Attempting to apply Debian fix for googletest")

-			include(ExternalProject)
+      include(ExternalProject)

-			execute_process(COMMAND ${LSB_RELEASE} -cs
-				OUTPUT_VARIABLE LSB_CODENAME
-				OUTPUT_STRIP_TRAILING_WHITESPACE)
+      execute_process(COMMAND ${LSB_RELEASE} -cs
+          OUTPUT_VARIABLE LSB_CODENAME
+          OUTPUT_STRIP_TRAILING_WHITESPACE)

-			if(LSB_CODENAME MATCHES stretch)
-				set(GTEST_SOURCE_DIR /usr/src/googletest/googletest)
-			elseif(LSB_CODENAME MATCHES jessie OR LSB_CODENAME MATCHES xenial)
-				set(GTEST_SOURCE_DIR /usr/src/gtest)
-			endif()
+      if(LSB_CODENAME MATCHES stretch)
+        set(GTEST_SOURCE_DIR /usr/src/googletest/googletest)
+      elseif(LSB_CODENAME MATCHES jessie OR LSB_CODENAME MATCHES xenial)
+        set(GTEST_SOURCE_DIR /usr/src/gtest)
+      endif()

-			if(EXISTS ${GTEST_SOURCE_DIR} AND IS_DIRECTORY ${GTEST_SOURCE_DIR})
-				#if the source directory exists and is indeed a directory we build the
-				#gtest code
-				set(GTEST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build)
-				add_subdirectory(${GTEST_SOURCE_DIR} ${GTEST_BINARY_DIR})
-				set(GTEST_INCLUDE_DIRS ${GTEST_SOURCE_DIR}/include)
-				set(GTEST_LIBRARIES gtest gtest_main)
-				set(GTest_FOUND 1)
-			endif()
+      if(EXISTS ${GTEST_SOURCE_DIR} AND IS_DIRECTORY ${GTEST_SOURCE_DIR})
+        #if the source directory exists and is indeed a directory we build the
+        #gtest code
+        set(GTEST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build)
+        add_subdirectory(${GTEST_SOURCE_DIR} ${GTEST_BINARY_DIR})
+        set(GTEST_INCLUDE_DIRS ${GTEST_SOURCE_DIR}/include)
+        set(GTEST_LIBRARIES gtest gtest_main)
+        set(GTest_FOUND 1)
+      endif()

-		else ()
-			message(WARNING "GTest not found and no fix available")
-		endif ()
+    else()
+      message(WARNING "GTest not found and no fix available")
+    endif()

-	else ()
-		message(WARNING "GTest not found and no fix available")
-	endif ()
-endif ()
+  else()
+    message(WARNING "GTest not found and no fix available")
+  endif()
+endif()
+
+# Prevent overriding the parent project's compiler/linker settings on Windows
+set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)


updated FindPrimitiv.cmake.

updated FindPrimitiv.cmake.

--- cmake/FindPrimitiv.cmake
+++ cmake/FindPrimitiv.cmake
@@ -37,11 +37,11 @@
 )

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


fix pkgconfig path

fix pkgconfig path

--- cmake/InstallFolly.cmake
+++ cmake/InstallFolly.cmake
@@ -2,7 +2,14 @@
     DOWNLOAD_NAME       folly-${FOLLY_VERSION}.tar.gz
     URL                 https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz
     URL_MD5             ${FOLLY_URL_MD5}
-    CONFIGURE_COMMAND   cd <SOURCE_DIR>/folly && autoreconf -vi && CXXFLAGS=-I<INSTALL_DIR>/include LDFLAGS=-L<INSTALL_DIR>/lib/pkgconfig PKG_CONFIG_PATH=<INSTALL_DIR>/lib <SOURCE_DIR>/folly/configure --prefix=<INSTALL_DIR> ${WITH_OPENSSL} --with-boost=${BOOST_ROOT}
+    CONFIGURE_COMMAND   cd <SOURCE_DIR>/folly &&
+                        autoreconf -vi &&
+                        CXXFLAGS=-I<INSTALL_DIR>/include
+                        LDFLAGS=-L<INSTALL_DIR>/lib
+                        PKG_CONFIG_PATH=<INSTALL_DIR>/lib/pkgconfig
+                        <SOURCE_DIR>/folly/configure
+                        --prefix=<INSTALL_DIR> ${WITH_OPENSSL}
+                        --with-boost=${BOOST_ROOT}
     BUILD_COMMAND       cd <SOURCE_DIR>/folly && make
     INSTALL_COMMAND     cd <SOURCE_DIR>/folly && make install
 )


seemingly not working

seemingly not working

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -123,8 +123,8 @@
   ctest_submit(PARTS Update Notes Configure)
   ctest_build()
   ctest_submit(PARTS Build)
-  #ctest_build(TARGET doc-snippets APPEND) # TODO: they are not built by default!
-  #ctest_submit(PARTS Build)
+  ctest_build(TARGET doc-snippets APPEND)
+  ctest_submit(PARTS Build)
   ctest_test()
   ctest_submit(PARTS Test)


Disable BOOST_PP for jenkins testing

Disable BOOST_PP for jenkins testing

--- Testing/jenkins_mercury.cmake
+++ Testing/jenkins_mercury.cmake
@@ -80,10 +80,10 @@
 BUILD_SHARED_LIBS:BOOL=${mercury_build_shared}
 BUILD_TESTING:BOOL=ON

-MERCURY_USE_BOOST_PP:BOOL=ON
+MERCURY_USE_BOOST_PP:BOOL=OFF
 MERCURY_USE_XDR:BOOL=OFF
-NA_USE_BMI:BOOL=OFF
-NA_USE_MPI:BOOL=OFF
+NA_USE_BMI:BOOL=OFF
+NA_USE_MPI:BOOL=OFF
 MPIEXEC_MAX_NUMPROCS:STRING=2
 ")


update

update

Change-Id: I120ae7710b9e5e70a3e113b951c7bc3f58cb9abf

--- VAD_target_properties.cmake
+++ VAD_target_properties.cmake
@@ -161,7 +161,8 @@
   STATIC_LIBRARY_FLAGS_RELEASE
   STATIC_LIBRARY_FLAGS
   SUFFIX
-  TYPE
+  # NOTE: the "TYPE" property is read-only, and it cannot be copied.
+  # TYPE
   VERSION
   VISIBILITY_INLINES_HIDDEN
   VS_DOTNET_REFERENCES


Bump to 1.3.0

Bump to 1.3.0

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(LIBREPO_MAJOR "1")
-SET(LIBREPO_MINOR "2")
-SET(LIBREPO_PATCH "1")
+SET(LIBREPO_MINOR "3")
+SET(LIBREPO_PATCH "0")


Update version to 1.2.2

Update version to 1.2.2

--- Version.cmake
+++ Version.cmake
@@ -10,7 +10,7 @@

 set(SimpleITK_VERSION_MAJOR 1)
 set(SimpleITK_VERSION_MINOR 2)
-set(SimpleITK_VERSION_PATCH 0)
+set(SimpleITK_VERSION_PATCH 2)
 #set(SimpleITK_VERSION_TWEAK "")


fix: Build with VTK 7

fix: Build with VTK 7

--- BasisProject.cmake
+++ BasisProject.cmake
@@ -57,7 +57,7 @@
   # dependencies
   DEPENDS
     MIRTK{Common,Numerics,Image,Transformation,PointSet}
-    "VTK-6{
+    "VTK-7|6{
       vtkCommonCore,
       vtkCommonDataModel,
       vtkFiltersCore,


set float point abi to 'hard'

set float point abi to 'hard'

--- platform/android/public.cmake
+++ platform/android/public.cmake
@@ -1,2 +1,2 @@
 #list(APPEND LOCAL_COMPILE_OPTIONS "-std=gnu++11")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -mfloat-abi=hard")


added "add_dependencies" command to the win32 section. Somehow it got disappeared. Becuase of fields' location in the build hieararchy, this was never a problem when building 'all'. probably would have been had one tried to build fields from a clean state.

--- fields/component_definitions.cmake
+++ fields/component_definitions.cmake
@@ -102,7 +102,8 @@
         link_directories(${${COMPONENT}_OUTPUT_DIR})

         add_library(${${COMPONENT}_DYNAMIC_LIB} SHARED ${${COMPONENT}_SRCS})
-
+        add_dependencies(${${COMPONENT}_DYNAMIC_LIB} ${GEOMETRY_IMPORT_LIBS})
+
         if(${USE_VTK})
             target_link_libraries(${${COMPONENT}_DYNAMIC_LIB} ${GEOMETRY_IMPORT_LIBS})
             target_link_libraries(${${COMPONENT}_DYNAMIC_LIB} LINK_PRIVATE ${VTK_LIBS})


Drop executable deps from CTS tests that don't use executables. (#8359)

Now tests like `allocator_test` just depend on the runtime, even when other tests in the suite use executables (and thus depend on `iree-translate` and the compiler build). I noticed this when rebuilding pure-HAL tests was taking a while after an LLVM update :)

--- build_tools/cmake/iree_hal_cts_test_suite.cmake
+++ build_tools/cmake/iree_hal_cts_test_suite.cmake
@@ -80,8 +80,8 @@
   endif()

   # Generate testdata if executable tests are enabled.
+  set(_EXECUTABLE_DEPS "")
   if(_ENABLE_EXECUTABLE_TESTS)
-
     set(_EXECUTABLES_TESTDATA_NAME "${_RULE_COMPILER_TARGET_BACKEND}_executables")

     set(_TRANSLATE_FLAGS
@@ -136,7 +136,7 @@

     endif()

-    list(APPEND _RULE_DEPS
+    list(APPEND _EXECUTABLE_DEPS
       ::${_EXECUTABLES_TESTDATA_NAME}_c
     )
   endif()
@@ -146,8 +146,22 @@
       continue()
     endif()

-    if("${_TEST_NAME}" IN_LIST IREE_EXECUTABLE_CTS_TESTS AND NOT _ENABLE_EXECUTABLE_TESTS)
-      continue()
+    # Set vars (and possibly skip) based on if this test uses executables.
+    if("${_TEST_NAME}" IN_LIST IREE_EXECUTABLE_CTS_TESTS)
+      if(NOT _ENABLE_EXECUTABLE_TESTS)
+        continue()
+      endif()
+
+      set(_TEST_DEPS
+        "${_RULE_DEPS}"
+        "${_EXECUTABLE_DEPS}"
+      )
+      set(IREE_CTS_EXECUTABLE_FORMAT "${_RULE_EXECUTABLE_FORMAT}")
+      set(IREE_CTS_EXECUTABLES_TESTDATA_HDR "${_EXECUTABLES_TESTDATA_NAME}_c.h")
+    else()
+      set(_TEST_DEPS "${_RULE_DEPS}" )
+      set(IREE_CTS_EXECUTABLE_FORMAT "")
+      set(IREE_CTS_EXECUTABLES_TESTDATA_HDR "")
     endif()

     # Note: driver names may contain dashes and other special characters. We
@@ -163,10 +177,6 @@
     set(IREE_CTS_DRIVER_REGISTRATION_FN "${_RULE_DRIVER_REGISTRATION_FN}")
     set(IREE_CTS_TEST_CLASS_NAME "${_TEST_NAME}_test")
     set(IREE_CTS_DRIVER_NAME "${_RULE_DRIVER_NAME}")
-    set(IREE_CTS_EXECUTABLE_FORMAT "${_RULE_EXECUTABLE_FORMAT}")
-    if(_ENABLE_EXECUTABLE_TESTS)
-      set(IREE_CTS_EXECUTABLES_TESTDATA_HDR "${_EXECUTABLES_TESTDATA_NAME}_c.h")
-    endif()

     configure_file(
       "${IREE_ROOT_DIR}/iree/hal/cts/cts_test_template.cc.in"
@@ -179,7 +189,7 @@
       SRCS
         "${CMAKE_CURRENT_BINARY_DIR}/${_TEST_SOURCE_NAME}"
       DEPS
-        ${_RULE_DEPS}
+        ${_TEST_DEPS}
         ${_TEST_LIBRARY_DEP}
         iree::base
         iree::hal


Updated FindSFNUL.cmake.

Updated FindSFNUL.cmake.

--- cmake/FindSFNUL.cmake
+++ cmake/FindSFNUL.cmake
@@ -221,7 +221,7 @@
 	set( SFNUL_DEPENDENCIES ${SFNUL_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT} )

 	if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
-		set( SFNUL_DEPENDENCIES ${SFNUL_DEPENDENCIES} "ws2_32 mswsock" )
+		set( SFNUL_DEPENDENCIES ${SFNUL_DEPENDENCIES} "ws2_32" )
 	elseif( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
 		find_library( COREFOUNDATION_LIBRARY CoreFoundation )


simplify cmake logic for finding clang

simplify cmake logic for finding clang

which fixes the build on windows

--- cmake/Findclang.cmake
+++ cmake/Findclang.cmake
@@ -7,83 +7,53 @@
 # CLANG_LIBRARIES
 # CLANG_LIBDIRS

-if(MSVC)
-  find_package(CLANG REQUIRED CONFIG)
+find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
+    PATHS
+        /usr/lib/llvm/10/include
+        /usr/lib/llvm-10/include
+        /usr/lib/llvm-10.0/include
+        /usr/local/llvm100/include
+        /mingw64/include)

-  set(CLANG_LIBRARIES
-      clangFrontendTool
-      clangCodeGen
-      clangFrontend
-      clangDriver
-      clangSerialization
-      clangSema
-      clangStaticAnalyzerFrontend
-      clangStaticAnalyzerCheckers
-      clangStaticAnalyzerCore
-      clangAnalysis
-      clangASTMatchers
-      clangAST
-      clangParse
-      clangSema
-      clangBasic
-      clangEdit
-      clangLex
-      clangARCMigrate
-      clangRewriteFrontend
-      clangRewrite
-      clangCrossTU
-      clangIndex
-  )
+macro(FIND_AND_ADD_CLANG_LIB _libname_)
+    string(TOUPPER ${_libname_} _prettylibname_)
+    find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
+        PATHS
+            ${CLANG_LIBDIRS}
+            /usr/lib/llvm/10/lib
+            /usr/lib/llvm-10/lib
+            /usr/lib/llvm-10.0/lib
+            /usr/local/llvm100/lib
+            /mingw64/lib
+            /c/msys64/mingw64/lib
+            c:\\msys64\\mingw64\\lib)
+    if(CLANG_${_prettylibname_}_LIB)
+        set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_${_prettylibname_}_LIB})
+    endif()
+endmacro(FIND_AND_ADD_CLANG_LIB)

-else()
-  find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
-      PATHS
-          /usr/lib/llvm/10/include
-          /usr/lib/llvm-10/include
-          /usr/lib/llvm-10.0/include
-          /usr/local/llvm100/include
-          /mingw64/include)
-
-  macro(FIND_AND_ADD_CLANG_LIB _libname_)
-      string(TOUPPER ${_libname_} _prettylibname_)
-      find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
-          PATHS
-              ${CLANG_LIBDIRS}
-              /usr/lib/llvm/10/lib
-              /usr/lib/llvm-10/lib
-              /usr/lib/llvm-10.0/lib
-              /usr/local/llvm100/lib
-              /mingw64/lib
-              /c/msys64/mingw64/lib
-              c:\\msys64\\mingw64\\lib)
-      if(CLANG_${_prettylibname_}_LIB)
-          set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_${_prettylibname_}_LIB})
-      endif()
-  endmacro(FIND_AND_ADD_CLANG_LIB)
-
-  FIND_AND_ADD_CLANG_LIB(clangFrontendTool)
-  FIND_AND_ADD_CLANG_LIB(clangCodeGen)
-  FIND_AND_ADD_CLANG_LIB(clangFrontend)
-  FIND_AND_ADD_CLANG_LIB(clangDriver)
-  FIND_AND_ADD_CLANG_LIB(clangSerialization)
-  FIND_AND_ADD_CLANG_LIB(clangSema)
-  FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerFrontend)
-  FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCheckers)
-  FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCore)
-  FIND_AND_ADD_CLANG_LIB(clangAnalysis)
-  FIND_AND_ADD_CLANG_LIB(clangASTMatchers)
-  FIND_AND_ADD_CLANG_LIB(clangAST)
-  FIND_AND_ADD_CLANG_LIB(clangParse)
-  FIND_AND_ADD_CLANG_LIB(clangSema)
-  FIND_AND_ADD_CLANG_LIB(clangBasic)
-  FIND_AND_ADD_CLANG_LIB(clangEdit)
-  FIND_AND_ADD_CLANG_LIB(clangLex)
-  FIND_AND_ADD_CLANG_LIB(clangARCMigrate)
-  FIND_AND_ADD_CLANG_LIB(clangRewriteFrontend)
-  FIND_AND_ADD_CLANG_LIB(clangRewrite)
-  FIND_AND_ADD_CLANG_LIB(clangCrossTU)
-  FIND_AND_ADD_CLANG_LIB(clangIndex)
-endif()
+FIND_AND_ADD_CLANG_LIB(clangFrontendTool)
+FIND_AND_ADD_CLANG_LIB(clangCodeGen)
+FIND_AND_ADD_CLANG_LIB(clangFrontend)
+FIND_AND_ADD_CLANG_LIB(clangDriver)
+FIND_AND_ADD_CLANG_LIB(clangSerialization)
+FIND_AND_ADD_CLANG_LIB(clangSema)
+FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerFrontend)
+FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCheckers)
+FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCore)
+FIND_AND_ADD_CLANG_LIB(clangAnalysis)
+FIND_AND_ADD_CLANG_LIB(clangASTMatchers)
+FIND_AND_ADD_CLANG_LIB(clangAST)
+FIND_AND_ADD_CLANG_LIB(clangParse)
+FIND_AND_ADD_CLANG_LIB(clangSema)
+FIND_AND_ADD_CLANG_LIB(clangBasic)
+FIND_AND_ADD_CLANG_LIB(clangEdit)
+FIND_AND_ADD_CLANG_LIB(clangLex)
+FIND_AND_ADD_CLANG_LIB(clangARCMigrate)
+FIND_AND_ADD_CLANG_LIB(clangRewriteFrontend)
+FIND_AND_ADD_CLANG_LIB(clangRewrite)
+FIND_AND_ADD_CLANG_LIB(clangCrossTU)
+FIND_AND_ADD_CLANG_LIB(clangIndex)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(CLANG DEFAULT_MSG CLANG_LIBRARIES CLANG_INCLUDE_DIRS)


CMake: Remove unnecessary `unset' which was not supported by old cmake
releases.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -136,7 +136,6 @@
     mark_as_advanced(HAVE_${NAME})
   else(LLVM_PATH_${NAME})
     set(HAVE_${NAME} "" CACHE INTERNAL "Is ${name} available ?")
-    unset(LLVM_PATH_${NAME} CACHE)
   endif(LLVM_PATH_${NAME})
 endfunction()


FIX: case where SofaQtQuickGUI is stored in applications-dev

Former-commit-id: 0b45f91427bfae0cba0c0c3e8ea26ef321d2adca

--- cmake/externals.cmake
+++ cmake/externals.cmake
@@ -17,6 +17,8 @@
 list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_MODULES_DIR}")
 list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_APPLICATIONS_DIR}")
 list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_APPLICATIONS_PLUGINS_DIR}")
+list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_APPLICATIONS_DEV_DIR}")
+list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_APPLICATIONS_DEV_PLUGINS_DIR}")
 list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_EXTLIBS_DIR}")
 list(APPEND GLOBAL_INCLUDE_DIRECTORIES "${SOFA_BUILD_DIR}/misc/include") # Generated files


Fix: add double qutoes around string else MacOS cries

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@108 a9d63959-f2ad-4865-b262-bf0e56cfafb6


CMake: Unittest fix

CMake: Unittest fix

--- cmake/unittests.cmake
+++ cmake/unittests.cmake
@@ -62,8 +62,8 @@
     #--------------------------------------------------------------------
     # Create application
     add_executable(${test_name} MACOSX_BUNDLE WIN32 ${SOURCE_FILES})
-    target_link_libraries(${test_name} gtest)
-    target_link_libraries(${test_name} ${target})
+    target_link_libraries(${test_name} PUBLIC gtest)
+    target_link_libraries(${test_name} PUBLIC ${target})
     set_target_properties(${test_name} PROPERTIES FOLDER unittests)

     #--------------------------------------------------------------------


use custom schema generator

use custom schema generator

--- cmake/FindHoudiniUsd.cmake
+++ cmake/FindHoudiniUsd.cmake
@@ -110,23 +110,34 @@
 endforeach()

 # Find Usd Schema Generator
+if (NOT USD_SCHEMA_GENERATOR)
+    find_program(USD_SCHEMA_GENERATOR
+            NAMES
+            usdGenSchema
+            usdGenSchema.py
+            PATHS
+            ${HOUDINI_ROOT}/bin
+            ${HOUDINI_ROOT}/Resources/bin
+            REQUIRED
+            NO_DEFAULT_PATH
+            )

-if(APPLE)
-        set(HOUDINI_BIN ${HOUDINI_ROOT}/Resources/bin)
-else()
-        set(HOUDINI_BIN ${HOUDINI_ROOT}/bin)
-endif()
+    get_filename_component(USD_SCHEMA_GENERATOR_EXT
+            ${USD_SCHEMA_GENERATOR}
+            EXT
+            )

-if (NOT USD_SCHEMA_GENERATOR)
-        find_program(USD_SCHEMA_GENERATOR
+    if("${USD_SCHEMA_GENERATOR_EXT}" STREQUAL ".py")
+        find_program(HYTHON_EXECUTABLE
                 NAMES
-                usdGenSchema.py
-                usdGenSchema
+                hython
                 PATHS
-                ${HOUDINI_BIN}
+                ${HOUDINI_ROOT}/bin
+                ${HOUDINI_ROOT}/Resources/bin
                 REQUIRED
                 NO_DEFAULT_PATH
                 )
-        list(PREPEND USD_SCHEMA_GENERATOR ${HOUDINI_BIN}/hython)
+        list(PREPEND USD_SCHEMA_GENERATOR ${HYTHON_EXECUTABLE})
         set(USD_SCHEMA_GENERATOR ${USD_SCHEMA_GENERATOR} CACHE STRING "" FORCE)
+    endif()
 endif()


God damnit

God damnit

--- cmake/FindQScintilla.cmake
+++ cmake/FindQScintilla.cmake
@@ -71,8 +71,8 @@
   PATHS "${Qt5Core_LIBRARIES}" "${PC_QSCINTILLA_LIBRARY_DIRS}" "${QSCINTILLA_BREW_LIBRARY}"
 )

-set(QSCINTILLA_PROCESS_LIBRARIES QSCINTILLA_LIBRARY QSCINTILLA_LIBRARIES)
-set(QSCINTILLA_PROCESS_INCLUDE_DIRS QSCINTILLA_INCLUDE_DIR QSCINTILLA_INCLUDE_DIRS)
+set(QSCINTILLA_LIBRARY "${QSCINTILLA_LIBRARIES}")
+set(QSCINTILLA_INCLUDE_DIR "${QSCINTILLA_INCLUDE_DIRS}")

 find_package_handle_standard_args(QScintilla
   FOUND_VAR QSCINTILLA_FOUND


Also search for visionaray_common

Also search for visionaray_common

--- cmake/FindVisionaray.cmake
+++ cmake/FindVisionaray.cmake
@@ -42,8 +42,18 @@
         lib
 )

+find_library(VISIONARAY_COMMON_LIBRARY
+    NAMES
+        visionaray_common
+    PATHS
+        ${paths}
+    PATH_SUFFIXES
+        lib64
+        lib
+)
+
 set(VISIONARAY_INCLUDE_DIRS ${VISIONARAY_INCLUDE_DIR})
-set(VISIONARAY_LIBRARIES ${VISIONARAY_LIBRARY})
+set(VISIONARAY_LIBRARIES ${VISIONARAY_LIBRARY} ${VISIONARAY_COMMON_LIBRARY})

 find_package_handle_standard_args(Visionaray
     DEFAULT_MSG


cmake: stop build if compiler doesn't support flag -std=c++14

--- cmake/HextForceCPP14.cmake
+++ cmake/HextForceCPP14.cmake
@@ -3,7 +3,7 @@
 IF(COMPILER_SUPPORTS_CPP14)
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
 ELSE(COMPILER_SUPPORTS_CPP14)
-  MESSAGE(STATUS "${CMAKE_CXX_COMPILER} does not support the flag -std=c++14.")
-  MESSAGE(STATUS "C++14 is required.")
+  MESSAGE(SEND_ERROR "${CMAKE_CXX_COMPILER} does not support the flag -std=c++14.")
+  MESSAGE(FATAL_ERROR "C++14 is required.")
 ENDIF(COMPILER_SUPPORTS_CPP14)


updated messages and comments only

updated messages and comments only

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -115,7 +115,7 @@
     string(REPLACE " " ";" depend_list ${depend})
     list(GET depend_list 0 depend_name)
     if(NOT ${depend_name}_FOUND)
-      message(WARNING "catkin_package(${PROJECT_NAME}) depends on '${depend_name}' which has not been find_package()-ed before")
+      message(WARNING "catkin_package() depends on '${depend_name}' which has not been find_package()-ed before")
       list(REMOVE_ITEM PROJECT_DEPENDENCIES ${depend})
     endif()
   endforeach()
@@ -133,11 +133,11 @@
       # verify that all catkin dependencies are listed as build- and runtime dependencies
       list(FIND ${PROJECT_NAME}_BUILD_DEPENDS ${depend_name} _index)
       if(_index EQUAL -1)
-        message(FATAL_ERROR "catkin_package(${PROJECT_NAME}) depends on catkin package '${depend_name}' which must therefore be listed as a build dependency in the package.xml")
+        message(FATAL_ERROR "catkin_package() depends on catkin package '${depend_name}' which must therefore be listed as a build dependency in the package.xml")
       endif()
       list(FIND ${PROJECT_NAME}_RUN_DEPENDS ${depend_name} _index)
       if(_index EQUAL -1)
-        message(FATAL_ERROR "catkin_package(${PROJECT_NAME}) depends on catkin package '${depend_name}' which must therefore be listed as a run dependency in the package.xml")
+        message(FATAL_ERROR "catkin_package() depends on catkin package '${depend_name}' which must therefore be listed as a run dependency in the package.xml")
       endif()
     elseif(${${depend_name}_FOUND})
       list(APPEND PROJECT_NON_CATKIN_DEPENDS_INCLUDE_DIRS ${${depend_name}_INCLUDE_DIRS})
@@ -167,6 +167,7 @@
   # BUILDSPACE
   #

+  # used in the cmake extra files
   set(BUILDSPACE TRUE)
   set(INSTALLSPACE FALSE)

@@ -181,7 +182,7 @@
     elseif(IS_DIRECTORY ${PKG_INCLUDE_PREFIX}/${idir})
       set(include ${PKG_INCLUDE_PREFIX}/${idir})
     else()
-      message(FATAL_ERROR "catkin_package include dir '${idir}' is neither an absolute directory nor exists relative to '${CMAKE_CURRENT_SOURCE_DIR}'")
+      message(FATAL_ERROR "catkin_package() include dir '${idir}' is neither an absolute directory nor exists relative to '${CMAKE_CURRENT_SOURCE_DIR}'")
     endif()
     list(APPEND PROJECT_ABSOLUTE_INCLUDE_DIRS ${include})
   endforeach()
@@ -235,6 +236,7 @@
   # INSTALLSPACE
   #

+  # used in the cmake extra files
   set(BUILDSPACE FALSE)
   set(INSTALLSPACE TRUE)


fix handling include directories for generated header in devel space (#600)

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -391,6 +391,17 @@
   set(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "")
   set(PROJECT_PKG_CONFIG_INCLUDE_DIRS "")
   foreach(idir ${PROJECT_INCLUDE_DIRS})
+    # include folders in devel space are handled like relative ones
+    # since these files are supposed to be installed to the include folder in install space
+    string(LENGTH "${CATKIN_DEVEL_PREFIX}/" devel_length)
+    string(LENGTH "${idir}/" idir_length)
+    if(NOT ${idir_length} LESS ${devel_length})
+      string(SUBSTRING "${idir}" 0 ${devel_length} idir_prefix)
+      if("${idir_prefix}" STREQUAL "${CATKIN_DEVEL_PREFIX}/")
+        # the value doesn't matter as long as it doesn't match IS_ABSOLUTE
+        set(idir "${CATKIN_GLOBAL_INCLUDE_DESTINATION}")
+      endif()
+    endif()
     if(IS_ABSOLUTE ${idir})
       list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "${idir}")
       list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS "${idir}")


readded installing package.xml

readded installing package.xml

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -288,5 +288,9 @@
     DESTINATION share/${PROJECT_NAME}/cmake
   )

+  # install package.xml
+  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/package.xml
+    DESTINATION share/${_CATKIN_CURRENT_PACKAGE})
+
   # XXXX generate manifest.xml for backward compatibility
 endfunction()


fix install directory name. not sure why it worked on osx, but who really cares

--- cmake/external_eigen.cmake
+++ cmake/external_eigen.cmake
@@ -10,8 +10,6 @@
 # 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.
-
-cmake_minimum_required(VERSION 3.7)

 # Enable ExternalProject CMake module
 include(ExternalProject)
@@ -36,4 +34,4 @@

 ExternalProject_Get_Property(eigen source_dir binary_dir)

-set(EIGEN_INCLUDE_DIR "${EXTERNAL_INSTALL_LOCATION}/include/Eigen3" PARENT_SCOPE)
+set(EIGEN_INCLUDE_DIR "${EXTERNAL_INSTALL_LOCATION}/include/eigen3" PARENT_SCOPE)


downgrade openal-soft on windows to 1.18.2 because of build problem with 1.19.1

--- cmake/get-openalsoft.cmake
+++ cmake/get-openalsoft.cmake
@@ -10,7 +10,7 @@

 INCLUDE(ExternalProject)

-set(OPENALSOFT_VERSION "1.19.1")
+set(OPENALSOFT_VERSION "1.18.2")

 # For win32 it's faster to download the pre-compiled development binaries.
 if (WIN32)
@@ -20,7 +20,7 @@
         PREFIX ${DEPENDENCY_EXTRACT_DIR}
         DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
         URL http://kcat.strangesoft.net/openal-binaries/openal-soft-${OPENALSOFT_VERSION}-bin.zip
-        URL_MD5 b78ef1ba26f7108e763f92df6bbc3fa5
+        URL_MD5 03cf7160ca84c36c2e6560fb278308fc
         INSTALL_DIR ${DEPENDENCY_INSTALL_DIR}
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""
@@ -53,7 +53,7 @@
         PREFIX ${DEPENDENCY_EXTRACT_DIR}
         DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
         URL http://kcat.strangesoft.net/openal-releases/openal-soft-${OPENALSOFT_VERSION}.tar.bz2
-        URL_MD5 af6f148c342276a51ea9c33ebd303f78
+        URL_MD5 d4eeb0889812e2fdeaa1843523d76190
         INSTALL_DIR ${DEPENDENCY_INSTALL_DIR}
         CMAKE_ARGS ${OPENALSOFT_CMAKE_ARGS}
     )


removed debug mode from FindVW

removed debug mode from FindVW

--- cmake/modules/FindVW.cmake
+++ cmake/modules/FindVW.cmake
@@ -34,8 +34,6 @@
     endif()
   endif()
 endmacro()
-
-set(VW_DEBUG true)

 set(VW_ROOT $ENV{VW_ROOT})


bump version number

bump version number

[ci skip]

--- cmake/ospray_options.cmake
+++ cmake/ospray_options.cmake
@@ -19,7 +19,7 @@
 ##############################################################

 SET(OSPRAY_VERSION_MAJOR 1)
-SET(OSPRAY_VERSION_MINOR 2)
+SET(OSPRAY_VERSION_MINOR 3)
 SET(OSPRAY_VERSION_PATCH 0)
 SET(OSPRAY_VERSION_GITHASH 0)
 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)


fixes for tgz under MacOSX

fixes for tgz under MacOSX

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -16,12 +16,17 @@

 OPTION(ENABLE_INSTALLER "Switches between installer or ZIP file creation for 'make package'" ON)

-#SET(CMAKE_MACOSX_RPATH ON)
-#SET(CMAKE_SKIP_INSTALL_RPATH OFF)
-#SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
-#SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-#SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
+IF (ENABLE_INSTALLER)
+  #SET(CMAKE_MACOSX_RPATH ON)
+  #SET(CMAKE_SKIP_INSTALL_RPATH OFF)
+  #SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+  SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+  SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
+  #SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+  #SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
+ELSE()
+  SET(CMAKE_SKIP_INSTALL_RPATH ON)
+ENDIF()

 IF (NOT ENABLE_INSTALLER)
   SET(DOC_INSTALL_DIR doc)
@@ -108,8 +113,6 @@
 SET(CPACK_PACKAGE_NAME Embree)
 SET(CPACK_PACKAGE_FILE_NAME "embree-${EMBREE_VERSION}")
 #SET(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/embree-doc/images/icon.png)
-
-SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
 #SET(CPACK_PACKAGE_RELOCATABLE TRUE)

 SET(CPACK_PACKAGE_VERSION_MAJOR ${EMBREE_VERSION_MAJOR})


fix cmake macro add_backward; just use variable BACKWARD_INCLUDE_DIRS instead of _BACKWARD_INCLUDE_DIRS

--- BackwardConfig.cmake
+++ BackwardConfig.cmake
@@ -133,7 +133,7 @@
 list(APPEND _BACKWARD_INCLUDE_DIRS ${BACKWARD_INCLUDE_DIR})

 macro(add_backward target)
-	target_include_directories(${target} PRIVATE ${_BACKWARD_INCLUDE_DIRS})
+	target_include_directories(${target} PRIVATE ${BACKWARD_INCLUDE_DIRS})
 	set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS ${BACKWARD_DEFINITIONS})
 	set_property(TARGET ${target} APPEND PROPERTY LINK_LIBRARIES ${BACKWARD_LIBRARIES})
 endmacro()


don't use cache to store TEST_ENABLE_BOOST_HEADER

* but keep behavior of default to on, for backwards compatibility

--- CommonCPPCTest.cmake
+++ CommonCPPCTest.cmake
@@ -48,9 +48,11 @@
 set(ALL_CPP_TESTS)
 set(ALL_CPP_PERF_TESTS)

-set(TEST_ENABLE_BOOST_HEADER "Add -DBOOST_TEST_DYN_LINK to tests" CACHE BOOL ON)
 # backwards compat: generate main() for unit tests
 #  should really #define BOOST_TEST_DYN_LINK if using boost
+if(NOT DEFINED TEST_ENABLE_BOOST_HEADER)
+  set(TEST_ENABLE_BOOST_HEADER ON)
+endif()
 if(NOT Boost_USE_STATIC_LIBS AND TEST_ENABLE_BOOST_HEADER)
   add_definitions(-DBOOST_TEST_DYN_LINK)
 endif()


Added missing proto files to scan_for_protos.

--- cmake/Modules/UseProtoc.cmake
+++ cmake/Modules/UseProtoc.cmake
@@ -39,6 +39,7 @@
     if(FORCING_GLOB OR NOT EXISTS ${proto_cmake})
         file(GLOB_RECURSE all_protos RELATIVE ${CMAKE_SOURCE_DIR}
             "${CMAKE_SOURCE_DIR}/core/*.proto"
+            "${CMAKE_SOURCE_DIR}/core/os/device/*.proto"
             "${CMAKE_SOURCE_DIR}/gapic/*.proto"
             "${CMAKE_SOURCE_DIR}/gapis/*.proto"
             "${CMAKE_SOURCE_DIR}/gapidapk/*.proto"


Fix bug in FindClang

Fix bug in FindClang

--- cmake/modules/FindClang.cmake
+++ cmake/modules/FindClang.cmake
@@ -75,15 +75,15 @@

   # Add a clang library to CLANG_LIBS and resolve dependencies
   macro(add_clang_lib)
-    cmake_parse_arguments(ARG "" "NAME" "DEPENDS" ${ARGN})
+    cmake_parse_arguments(__ARG "" "NAME" "DEPENDS" ${ARGN})

-    find_clang_lib(${ARG_NAME})
+    find_clang_lib(${_ARG_NAME})

-    string(TOUPPER ${ARG_NAME} prettylibname)
+    string(TOUPPER ${_ARG_NAME} prettylibname)
     if(CLANG_${prettylibname}_LIB)
       list(APPEND CLANG_LIBS ${CLANG_${prettylibname}_LIB})

-      foreach(dependency ${ARG_DEPENDS})
+      foreach(dependency ${_ARG_DEPENDS})
         string(TOUPPER ${dependency} prettylibname)
         find_clang_lib(${dependency})
         if(CLANG_${prettylibname}_LIB)


build_type && build_platform unknown by default

--- cmake/scripts/buildinfo.cmake
+++ cmake/scripts/buildinfo.cmake
@@ -8,6 +8,14 @@
 #
 # example usage:
 # cmake -DETH_SOURCE_DIR=. -DETH_DST_DIR=build -DETH_BUILD_TYPE=Debug -DETH_BUILD_PLATFORM=mac -P scripts/buildinfo.cmake
+
+if (NOT ETH_BUILD_TYPE)
+    set(ETH_BUILD_TYPE "unknown")
+endif()
+
+if (NOT ETH_BUILD_PLATFORM)
+    set(ETH_BUILD_PLATFORM "unknown")
+endif()

 execute_process(
 	COMMAND git --git-dir=${ETH_SOURCE_DIR}/.git --work-tree=${ETH_SOURCE_DIR} rev-parse HEAD


Fix Mac build.

Fix Mac build.

--- cmake/toolchain_options.cmake
+++ cmake/toolchain_options.cmake
@@ -49,10 +49,10 @@
   if(MINGW OR UNIX AND NOT APPLE)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
+
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
   endif()
-
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
 endif()

 if(SPLIT_DEBUG)


Added comment

Added comment

--- src/CombineUnixArchives.cmake
+++ src/CombineUnixArchives.cmake
@@ -76,9 +76,10 @@

     # Accumulate objects
     if(UNIX)
+      # Linux or OS X
       set(globbing_ext "o")
     else()
-      # i.e., Windows
+      # i.e., Windows with MINGW toolchain
       set(globbing_ext "obj")
     endif()


CMake: Fix Microlib selection (#13871)

CMake: Fix Microlib selection (#13871)

As the assembler does not seem to recognise the request to the
linker to use microlib, remove that instruction.
Microlib is still used as the linker selects microlib as a result
of being explicitly asked to do so.

--- tools/cmake/toolchains/ARM.cmake
+++ tools/cmake/toolchains/ARM.cmake
@@ -80,11 +80,6 @@
                 __MICROLIB
         )

-        target_compile_options(${target}
-            INTERFACE
-                $<$<COMPILE_LANGUAGE:ASM>:"--library_type=microlib">
-        )
-
         target_link_options(${target}
             INTERFACE
                 "--library_type=microlib"


Append _REENTRANT to list of required definitions.

This is consistent to what's done with autoconf.

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -150,7 +150,7 @@
   set(CMAKE_HAVE_PTHREAD_H ${HAVE_PTHREAD_H}) # Skip checking for header a second time.
   find_package(Threads)
   if(CMAKE_HAVE_LIBC_CREATE)
-    set(_REENTRANT 1)
+    set_required_def(_REENTRANT 1)
   endif()
 endif()


ubuntu cmake fixes

ubuntu cmake fixes

--- cmake/EthDependencies.cmake
+++ cmake/EthDependencies.cmake
@@ -5,7 +5,7 @@
 # this must be set to point to the same directory as $ETH_DEPENDENCY_INSTALL_DIR in /extdep directory
 string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name)
 set (CMAKE_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extdep/install/${_system_name}")
-set (CMAKE_PREFIX_PATH ${CMAKE_DEPENDENCY_INSTALL_DIR})
+set (CMAKE_PREFIX_PATH ${CMAKE_DEPENDENCY_INSTALL_DIR} ";/usr")

 # Qt5 requires opengl
 # TODO use proper version of windows SDK (32 vs 64)
@@ -73,13 +73,13 @@

 # curl is only requried for tests
 # TODO specify min curl version, on windows we are currenly using 7.29
-find_package (curl)
+find_package (CURL)
 message(" - curl header: ${CURL_INCLUDE_DIR}")
 message(" - curl lib   : ${CURL_LIBRARY}")

 # TODO make headless client optional
-find_package (QT5Core REQUIRED)
-find_package (QT5Gui REQUIRED)
+find_package (Qt5Core REQUIRED)
+find_package (Qt5Gui REQUIRED)
 find_package (Qt5Quick REQUIRED)
 find_package (Qt5Qml REQUIRED)
 find_package (Qt5Network REQUIRED)
@@ -87,16 +87,20 @@
 find_package (Qt5WebKit REQUIRED)
 find_package (Qt5WebKitWidgets REQUIRED)

-# we have to specify here if we want static and boost version, that is really important
-set(Boost_USE_STATIC_LIBS ON)
-set(Boost_USE_MULTITHREADED ON)
-
-# TODO hanlde other msvc versions or it will fail find them
 if (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
+	# TODO hanlde other msvc versions or it will fail find them
 	set(Boost_COMPILER -vc120)
+	set(Boost_USE_STATIC_LIBS ON)
+	set(Boost_USE_MULTITHREADED ON)
+elseif(APPLE)
+	set(Boost_USE_STATIC_LIBS ON)
+	set(Boost_USE_MULTITHREADED ON)
+elseif(UNIX)
+	set(Boost_USE_STATIC_LIBS OFF)
+	set(Boost_USE_MULTITHREADED ON)
 endif()

-find_package(Boost 1.55.0 REQUIRED COMPONENTS thread date_time system regex chrono filesystem unit_test_framework)
+find_package(Boost 1.54.0 REQUIRED COMPONENTS thread date_time system regex chrono filesystem unit_test_framework)

 message(" - boost header: ${Boost_INCLUDE_DIRS}")
 message(" - boost lib   : ${Boost_LIBRARIES}")


Remove useless CPACK_*_COMPONENT_INSTALL variables

They don't actually do anything. And even if they did, all components are
enabled by default, anyway.

(cherry picked from commit 49fe496914cca93f19dd61aa7b1c120037d65282)

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -126,15 +126,6 @@
   set(CPACK_COMPONENT_tests_SECTION "misc")
 endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)

-if(NOT OPENCV_CUSTOM_PACKAGE_LAYOUT)
-  set(CPACK_libs_COMPONENT_INSTALL TRUE)
-  set(CPACK_dev_COMPONENT_INSTALL TRUE)
-  set(CPACK_docs_COMPONENT_INSTALL TRUE)
-  set(CPACK_python_COMPONENT_INSTALL TRUE)
-  set(CPACK_java_COMPONENT_INSTALL TRUE)
-  set(CPACK_samples_COMPONENT_INSTALL TRUE)
-endif(NOT OPENCV_CUSTOM_PACKAGE_LAYOUT)
-
 if(CPACK_GENERATOR STREQUAL "DEB")
   find_program(GZIP_TOOL NAMES "gzip" PATHS "/bin" "/usr/bin" "/usr/local/bin")
   if(NOT GZIP_TOOL)


Finish resolving the previous conflict on cmake/dtkDependencies.cmake. Add just one blank line.

--- cmake/dtkDependencies.cmake
+++ cmake/dtkDependencies.cmake
@@ -221,6 +221,7 @@
 ## #################################################################

 find_package(Qwt QUIET)
+
 if(QWT_FOUND)
   include_directories(${QWT_INCLUDE_DIR})
 endif(QWT_FOUND)


[cmake] Added warnings when compiling in debug

--- cmake/iDynTreeOptions.cmake
+++ cmake/iDynTreeOptions.cmake
@@ -89,3 +89,26 @@
 # sanitizers. Imported from http://api.kde.org/ecm/module/ECMEnableSanitizers.html
 include(ECMEnableSanitizers)

+# Enable warnings on Debug builds
+if(MSVC)
+    ###
+else()
+    ##Other systems
+    if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+        SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Weverything -pedantic -Wnon-virtual-dtor -Woverloaded-virtual")
+        #disable padding alignment warnings. Cast align is more subtle. On X86 it should not create any problem but for different architecture we should handle this warning better.
+        SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-padded -Wno-cast-align")
+        if (CODYCO_TRAVIS_CI)
+            #disable documentation warnings and sign comparison. This is for Travis-CI
+            MESSAGE(STATUS "Disabling some warning for Travis-CI")
+            SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-documentation -Wno-documentation-unknown-command -Wno-sign-conversion")
+        endif()
+        MESSAGE(STATUS "Clang compiler - Debug configuration flags: -Weverything -pedantic -Wnon-virtual-dtor -Woverloaded-virtual")
+    elseif(${CMAKE_COMPILER_IS_GNUCC})
+        SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra")
+        if (NOT CODYCO_TRAVIS_CI)
+            MESSAGE(STATUS "Gcc compiler - Debug configuration flags: -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual")
+            SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pedantic -Weffc++ -Woverloaded-virtual")
+        endif()
+    endif()
+endif()


[CMake] Removing duplicates from the list of test suites to generate targets for.

Not doing this causes some headaches for users migrating from autoconf to CMake.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -803,8 +803,13 @@
   if (NOT CMAKE_CONFIGURATION_TYPES)
     parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
     file(GLOB_RECURSE litCfg ${directory}/lit*.cfg)
+    set(lit_suites)
     foreach(f ${litCfg})
       get_filename_component(dir ${f} DIRECTORY)
+      set(lit_suites ${lit_suites} ${dir})
+    endforeach()
+    list(REMOVE_DUPLICATES lit_suites)
+    foreach(dir ${lit_suites})
       string(REPLACE ${directory} "" name_slash ${dir})
       if (name_slash)
         string(REPLACE "/" "-" name_slash ${name_slash})


MAINT: reorganize project.

MAINT: reorganize project.

--- cmake/sara_use_halide.cmake
+++ cmake/sara_use_halide.cmake
@@ -51,7 +51,7 @@
     if (TARGET ${_source_filename}${suffix})
       set_target_properties(${_source_filename}${suffix}
         PROPERTIES
-        FOLDER "Halide/${_source_filename}")
+        FOLDER "Libraries/Shakti/Halide/${_source_filename}")
     endif ()
   endforeach ()
 endfunction ()
@@ -86,7 +86,7 @@
     if (TARGET ${_source_filename}${suffix})
       set_target_properties(${_source_filename}${suffix}
         PROPERTIES
-        FOLDER "Halide/${_source_filename}")
+        FOLDER "Libraries/Shakti/Halide/${_source_filename}")
     endif ()
   endforeach ()
 endfunction ()
@@ -126,7 +126,7 @@
     if (TARGET ${generator_NAME}${suffix})
       set_target_properties(${generator_NAME}${suffix}
         PROPERTIES
-        FOLDER "Halide/${generator_NAME}")
+        FOLDER "Libraries/Shakti/Halide/${generator_NAME}")
     endif ()
   endforeach ()


Minor stylistic changes.

Minor stylistic changes.

--- toolchains/android/armv7-vfp3d16.arch.cmake
+++ toolchains/android/armv7-vfp3d16.arch.cmake
@@ -14,21 +14,21 @@
 list( APPEND TNUN_compiler_optimize_for_size  -mthumb )
 list( APPEND TNUN_compiler_optimize_for_speed -marm   )

-##
 # Implementation note:
 #
 # Official ndk-build script removed support for armeabi-v7a-hardfloat because
-# Google does not want to support that anymore - they say that performance benefits
-# by using this is not big. However, if all dependencies can be built with hardfloat,
-# we can use it. Why not benefit where possible?
-# We'll keep this disabled by default because using hardfloat ABI requires that all
-# other dependencies (including 3rd party binaries) are using hardfloat ABI, which is
-# not so common.
+# Google does not want to support that anymore - they say that performance
+# benefits by using this are not big and that it is not tested anyway. However,
+# if all dependencies can be built with hardfloat, we can use it. Why not
+# benefit where possible?
+# We'll keep this disabled by default because using hardfloat ABI requires that
+# all other dependencies (including 3rd party binaries) are using hardfloat ABI,
+# which is not so common.
 #
 # https://stackoverflow.com/questions/32046055/is-it-safe-to-replace-armeabi-v7a-with-armeabi-v7a-hard
 # http://blog.alexrp.com/2014/02/18/android-hard-float-support/
 #
-#                                         ( 01.09.2016. Nenad Miksa )
+#                                             (01.09.2016. Nenad Miksa)

 option( TNUN_ANDROID_ARM7_HARDFLOAT_ABI "Use hardfloat ABI for armv7 binaries" false )
 if( ${TNUN_ANDROID_ARM7_HARDFLOAT_ABI} )


ignore tag check if we haven't pulled tags

Signed-off-by: Riccardo Spagni <ff4dc518fb3d5d20a81fd1c6faff577641edf4b9@spagni.net>

--- src/version.cmake
+++ src/version.cmake
@@ -7,7 +7,7 @@
 else()
 	message(STATUS "You are currently on commit ${COMMIT}")
 	execute_process(COMMAND "${GIT}" show-ref --tags -d --abbrev COMMAND awk "END{print $1}" RESULT_VARIABLE RET OUTPUT_VARIABLE TAGGEDCOMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
-	if(RET AND NOT ${TAGGEDCOMMIT} STREQUAL "")
+	if(RET AND NOT TAGGEDCOMMIT)
 	    message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.")
 	    set(VERSIONTAG "${COMMIT}")
 	else()


ENH: added include dirs for PQXX

ENH: added include dirs for PQXX

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -106,6 +106,14 @@
 ENDIF(OTB_USE_MAPNIK)

 #-----------------------------------------------------------------------------
+# Include directories from the PQXX build tree.
+IF(OTB_USE_PQXX)
+  SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
+  	${PQXX_INCLUDE_DIR}
+ENDIF(OTB_USE_PQXX)
+
+
+#-----------------------------------------------------------------------------
 # Include directories from the ITK build tree.
 IF(OTB_USE_EXTERNAL_ITK)
 #        INCLUDE(${ITK_SOURCE_DIR}/Utilities/itkThirdParty.cmake)


优化加密库查找

优化加密库查找

--- 3rd_party/ssl/port.cmake
+++ 3rd_party/ssl/port.cmake
@@ -21,7 +21,7 @@
     endif()
 elseif (NOT CRYPTO_DISABLED)
     # try to find openssl or mbedtls
-    find_package(OpenSSL)
+    find_package(OpenSSL QUIET)
     if(NOT OPENSSL_FOUND)
         include("${CMAKE_CURRENT_LIST_DIR}/openssl/openssl.cmake")
     endif ()
@@ -45,7 +45,7 @@
 endif()

 if (NOT CRYPTO_DISABLED)
-    find_package(Libsodium)
+    find_package(Libsodium QUIET)
     if (Libsodium_FOUND)
         list(APPEND 3RD_PARTY_PUBLIC_LINK_NAMES ${Libsodium_LIBRARIES})
         list(APPEND 3RD_PARTY_CRYPT_LINK_NAME ${Libsodium_LIBRARIES})