Code Monkey home page Code Monkey logo

Comments (2)

Togtja avatar Togtja commented on September 19, 2024 1

So my problem was the ${CMAKE_SOURCE_DIR} used in the pbrt-v4 cmake. As this did not represent the path where I had put the project.

https://github.com/mmp/pbrt-v4/blob/2b5837a862d7f79f4c2dd48acb2038e737b019a7/CMakeLists.txt#L800C1-L808

add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pbrt_soa.h
    COMMAND soac ${CMAKE_SOURCE_DIR}/src/pbrt/pbrt.soa > ${CMAKE_CURRENT_BINARY_DIR}/pbrt_soa.h
    DEPENDS soac ${CMAKE_SOURCE_DIR}/src/pbrt/pbrt.soa)
set (PBRT_SOA_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/pbrt_soa.h)

add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wavefront_workitems_soa.h
    COMMAND soac ${CMAKE_SOURCE_DIR}/src/pbrt/wavefront/workitems.soa > ${CMAKE_CURRENT_BINARY_DIR}/wavefront_workitems_soa.h
    DEPENDS soac ${CMAKE_SOURCE_DIR}/src/pbrt/wavefront/workitems.soa)
set (PBRT_SOA_GENERATED ${PBRT_SOA_GENERATED} ${CMAKE_CURRENT_BINARY_DIR}/wavefront_workitems_soa.h)

So I used edited the cmake to use PROJECT_SOURCE_CODE https://cmake.org/cmake/help/v2.8.12/cmake.html#variable%3aPROJECT_SOURCE_DIR

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pbrt_soa.h
  COMMAND soac ${PBRT_SOURCE_DIR}/src/pbrt/pbrt.soa > ${CMAKE_CURRENT_BINARY_DIR}/pbrt_soa.h
  DEPENDS soac ${PBRT_SOURCE_DIR}/src/pbrt/pbrt.soa)
set(PBRT_SOA_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/pbrt_soa.h)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wavefront_workitems_soa.h
  COMMAND soac ${PBRT_SOURCE_DIR}/src/pbrt/wavefront/workitems.soa > ${CMAKE_CURRENT_BINARY_DIR}/wavefront_workitems_soa.h
  DEPENDS soac ${PBRT_SOURCE_DIR}/src/pbrt/wavefront/workitems.soa)
set(PBRT_SOA_GENERATED ${PBRT_SOA_GENERATED} ${CMAKE_CURRENT_BINARY_DIR}/wavefront_workitems_soa.h)

And as such I got further.
So my case it was set(PBRT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/pbrt-v4)

I think that you should use the PROJECT_SOURCE_CODE and if it is not set, default to CMAKE_SOURCE_DIR

from pbrt-v4.

snps-jfaust avatar snps-jfaust commented on September 19, 2024 1

@Togtja, this is a good solution. I would argue that CMAKE_CURRENT_SOURCE_DIR is a little more appropriate here since it works independent of project().

Also, thanks for fixing the other places where CMAKE_SOURCE_DIR was used. The other build failure was related to FindSanitizers.cmake.

from pbrt-v4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.