Git Product home page Git Product logo

Comments (3)

memsharded avatar memsharded commented on July 18, 2024

Hi @lambtonr

Thanks for your question.

Yes, the test_package_folder is read at export time, very early, so changing it in any method will have no effect.

Have you considered doing different logic in the test_package folder based on the self.tested_reference_str value, that will contain the tested version too?

from conan.

lambtonr avatar lambtonr commented on July 18, 2024

Hi @memsharded

Thanks for the advice.

i have added the following logic to my test package i dont know if this is what you intended, but it works.

conanfile.py

def generate(self):
        tc = CMakeToolchain(self)
        tc.variables["PACKAGE_V1"] = Version(self.tested_reference_str.split('/')[1].split('@')[0]) < "2.0.0"
        tc.generate()

CMakeLists.txt

if (PACKAGE_V1)
    add_executable(${PROJECT_NAME} test_v1_package.cpp)
else ()
    add_executable(${PROJECT_NAME} test_package.cpp)
endif()

Looking at this now i think it is may be better to specify a different `build_script_folder' in the 'cmake.configure()'

from conan.

memsharded avatar memsharded commented on July 18, 2024

yes, exactly something like that, using the tested_reference_str extract its version, and use it to decide what to do differently in the test_package/conanfile.py. Looks good enough to me. Depending on the amount of changes, you could do that, selecting one or other folder, sounds good too if there are too many changes in the CMakeLists.txt

from conan.

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.