From 5cdcf1c53e6b158d3619a71903b4476a9d20164a Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 17 Apr 2018 11:53:37 +0300 Subject: [PATCH 1/3] Eliminated spurious "resolved_item" warnings in CMake Previously, building the project produced many warnings with this message: "resolved_item == resolved_embedded_item - not copying..." These warnings are distracting as they make it difficult to see actual warnings. This commit changes the warnings to status messages. This fix was copied from: https://github.com/jherico/OculusMinimalExample/blob/master/cmake/templates/FixupBundlePostBuild.cmake.in --- cmake/templates/FixupBundlePostBuild.cmake.in | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cmake/templates/FixupBundlePostBuild.cmake.in b/cmake/templates/FixupBundlePostBuild.cmake.in index 57379bb48b..4ebb0ea1a6 100644 --- a/cmake/templates/FixupBundlePostBuild.cmake.in +++ b/cmake/templates/FixupBundlePostBuild.cmake.in @@ -11,6 +11,36 @@ include(BundleUtilities) +# replace copy_resolved_item_into_bundle +# +# The official version of copy_resolved_item_into_bundle will print out a "warning:" when +# the resolved item matches the resolved embedded item. This not not really an issue that +# should rise to the level of a "warning" so we replace this message with a "status:" +# +# Source: https://github.com/jherico/OculusMinimalExample/blob/master/cmake/templates/FixupBundlePostBuild.cmake.in +# +function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item) + if (WIN32) + # ignore case on Windows + string(TOLOWER "${resolved_item}" resolved_item_compare) + string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare) + else() + set(resolved_item_compare "${resolved_item}") + set(resolved_embedded_item_compare "${resolved_embedded_item}") + endif() + + if ("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}") + # this is our only change from the original version + message(STATUS "status: resolved_item == resolved_embedded_item - not copying...") + else() + #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}") + if(UNIX AND NOT APPLE) + file(RPATH_REMOVE FILE "${resolved_embedded_item}") + endif() + endif() +endfunction() + function(gp_resolved_file_type_override resolved_file type_var) if( file MATCHES ".*VCRUNTIME140.*" ) set(type "system" PARENT_SCOPE) From 50eaf3e166bbe76cac76214788be2c4120cd1e9b Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 17 Apr 2018 12:14:45 +0300 Subject: [PATCH 2/3] Fixed CMakeLists.txt for 'oven' to work in Linux --- tools/oven/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/oven/CMakeLists.txt b/tools/oven/CMakeLists.txt index 71bb997303..1b77a2585f 100644 --- a/tools/oven/CMakeLists.txt +++ b/tools/oven/CMakeLists.txt @@ -11,7 +11,7 @@ if (WIN32) elseif (UNIX AND NOT APPLE) find_package(Threads REQUIRED) if(THREADS_HAVE_PTHREAD_ARG) - target_compile_options(PUBLIC oven "-pthread") + target_compile_options(oven PUBLIC "-pthread") endif() elseif (APPLE) # Fix up the rpath so macdeployqt works From cd06067030ad1d7ab791361df35aa41fd456bf11 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 18 Apr 2018 10:18:29 +0300 Subject: [PATCH 3/3] Fixed based on PR review --- cmake/templates/FixupBundlePostBuild.cmake.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/templates/FixupBundlePostBuild.cmake.in b/cmake/templates/FixupBundlePostBuild.cmake.in index 4ebb0ea1a6..bb96fe49f3 100644 --- a/cmake/templates/FixupBundlePostBuild.cmake.in +++ b/cmake/templates/FixupBundlePostBuild.cmake.in @@ -33,10 +33,9 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item) # this is our only change from the original version message(STATUS "status: resolved_item == resolved_embedded_item - not copying...") else() - #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}") execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}") - if(UNIX AND NOT APPLE) - file(RPATH_REMOVE FILE "${resolved_embedded_item}") + if (UNIX AND NOT APPLE) + file(RPATH_REMOVE FILE "${resolved_embedded_item}") endif() endif() endfunction()