From 152933721748dcae96649de32dac18462d792306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Tue, 10 May 2022 10:14:31 +0200 Subject: [PATCH 1/3] Move generated files into buildtree instead of the source tree. `source/MaterialXCore/.gitignore` is this not needed anymore. This leads to more reliable and reproducible results. I have ran into issues while developing materialx vcpkg port (cf. microsft/vcpkg#24614) --- source/MaterialXCore/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/MaterialXCore/CMakeLists.txt b/source/MaterialXCore/CMakeLists.txt index aa30945186..9ace40b592 100644 --- a/source/MaterialXCore/CMakeLists.txt +++ b/source/MaterialXCore/CMakeLists.txt @@ -1,7 +1,7 @@ -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Generated.h.in ${CMAKE_CURRENT_SOURCE_DIR}/Generated.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Generated.h.in ${CMAKE_CURRENT_BINARY_DIR}/Generated.h) file(GLOB materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") -file(GLOB materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h") +file(GLOB materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_BINARY_DIR}/*.h") add_library(MaterialXCore ${materialx_source} ${materialx_headers}) @@ -26,6 +26,7 @@ target_link_libraries( target_include_directories(MaterialXCore PUBLIC $ + $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) From 8e9895f072eddeef573a8cae255155ed714ed89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Mon, 9 May 2022 09:24:48 +0200 Subject: [PATCH 2/3] Configure cppcheck to use CMake exported compile commands --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7acaa7dfd..50055a80cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -173,7 +173,7 @@ jobs: run: | mkdir build cd build - cmake -DMATERIALX_BUILD_PYTHON=ON -DMATERIALX_BUILD_VIEWER=ON -DMATERIALX_TEST_RENDER=OFF -DMATERIALX_WARNINGS_AS_ERRORS=ON ${{matrix.cmake_config}} .. + cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DMATERIALX_BUILD_PYTHON=ON -DMATERIALX_BUILD_VIEWER=ON -DMATERIALX_TEST_RENDER=OFF -DMATERIALX_WARNINGS_AS_ERRORS=ON ${{matrix.cmake_config}} .. - name: CMake Build run: cmake --build . --target install --config Release --parallel 2 @@ -208,8 +208,7 @@ jobs: if: matrix.static_analysis == 'ON' && runner.os == 'macOS' run: | brew install cppcheck - cppcheck --max-configs=1 --error-exitcode=1 --suppress=*:*/Catch/* --suppress=*:*/External/* --suppress=*:*JsMaterialX/* --suppress=*:*/NanoGUI/* --suppress=*:*/PugiXML/* --suppress=*:*/PyBind11/* --suppress=toomanyconfigs -I. . - working-directory: source + cppcheck --project=build/compile_commands.json --max-configs=1 --error-exitcode=1 --suppress=*:*/Catch/* --suppress=*:*/External/* --suppress=*:*JsMaterialX/* --suppress=*:*/NanoGUI/* --suppress=*:*/PugiXML/* --suppress=*:*/PyBind11/* --suppress=toomanyconfigs - name: Initialize Virtual Framebuffer if: matrix.test_render == 'ON' && runner.os == 'Linux' From fc3667e30690514d0936f3c87bdda77eb15a168a Mon Sep 17 00:00:00 2001 From: Jonathan Stone Date: Mon, 9 May 2022 17:42:56 -0700 Subject: [PATCH 3/3] Minor reorder for consistency --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50055a80cc..3ca24a02a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -173,7 +173,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DMATERIALX_BUILD_PYTHON=ON -DMATERIALX_BUILD_VIEWER=ON -DMATERIALX_TEST_RENDER=OFF -DMATERIALX_WARNINGS_AS_ERRORS=ON ${{matrix.cmake_config}} .. + cmake -DMATERIALX_BUILD_PYTHON=ON -DMATERIALX_BUILD_VIEWER=ON -DMATERIALX_TEST_RENDER=OFF -DMATERIALX_WARNINGS_AS_ERRORS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ${{matrix.cmake_config}} .. - name: CMake Build run: cmake --build . --target install --config Release --parallel 2