GithubHelp home page GithubHelp logo

Findvsg.cmake not exists about vsgexamples HOT 11 CLOSED

vsg-dev avatar vsg-dev commented on September 27, 2024
Findvsg.cmake not exists

from vsgexamples.

Comments (11)

vsg-dev avatar vsg-dev commented on September 27, 2024

The VSG installs the cmake configuration file along with the that cmake can find all the settings it needs from this config file. It's the way that CMake team bow recommend over using a dedicated find script. When running cmake in vsgExamples you should just need to set a VSG_DIR to the place you have installed the VSG. If you have installed to system directories then even this should not be required.

from vsgexamples.

remoe avatar remoe commented on September 27, 2024

Thanks, but this works only when one set this (CMake 3.15.2):

-Dvsg_DIR:PATH=<vsg_install_path>/lib/cmake/vsg

CMake doc:

https://cmake.org/cmake/help/v3.15/command/find_package.html#search-procedure

It should work without "lib/cmake/vsg", because it append it. But it doesn't work on my windows system.
I never install on system path.

from vsgexamples.

vsg-dev avatar vsg-dev commented on September 27, 2024

I don't install to system paths either, I just use vsg_DIR to set the path. You should be able to use vsg_DIR env path.

The approach we've taken we config installation follows the modern cmake recommendations. There is an excellent video on youtube about this approach:

https://www.youtube.com/watch?v=bsXLMQ6WgIk&t=7s

from vsgexamples.

remoe avatar remoe commented on September 27, 2024

Yes, it works with an Env var "vsg_DIR" but not with "-Dvsg_Dir ...". I never had such issues with Find<package>.cmake. Normally one don't need any environment variable if one correctly use:

CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH

from vsgexamples.

OpenSiege avatar OpenSiege commented on September 27, 2024

I agree with Robert on this. Supporting deprecated CMake isn't optimal and should be avoided as much as possible. What platform are you building on? I don't have to set my environmental variables at all.

from vsgexamples.

remoe avatar remoe commented on September 27, 2024

@OpenSiege FindPackage is not deprecated. I've build with windows x64 (VS2017) and CMake 3.15.2.

from vsgexamples.

vsg-dev avatar vsg-dev commented on September 27, 2024

The CMake package config scheme works with findpackage, but instead of you needing a findvsg.cmake the configuration is all placed in the lib directory. It's a far better scheme as you can have multiple installs all with different settings that you should build with and those settings are picked up from the install config file. It's really powerful so I recommend you learn about it.

I have done some experiments on my system and by putting the install location on my PATH env variable CMake is able to pick up the install location and all the libs and settings required.

This is the approach I use, install locally built libs into my home directories Install directory.

When building the VSG I set the install path via :

cmake -DCMAKE_INSTALL_PREFIX=~/Install
make -j 16
make install

To my env var I also set the PATH to pick up on installed binaries:

export PATH=~/Install:${PATH}

Then when I do any builds cmake finds the VSG, osg2vsg etc. simply for the PATH variable.

If I don't set this, or install into system directories, then I can use vsg_DIR to set the path i.e.

cmake . -Dvsg_DIR=~/Install

I will have think about adding further notes the INSTALL.md on this topic.

from vsgexamples.

remoe avatar remoe commented on September 27, 2024

@vsg-dev ok. I use CMAKE_INSTALL_PREFIX to install any library of a specific version to a specific folder like "vsg-master" or "vsg-1.0.0" as well. All libraries are on a platform specific sub-folder. Then one can use CMAKE_FIND_ROOT_PATH to set a root SDK folder for all libraries. One can use CMAKE_PREFIX_PATH to set all used libraries: -DMAKE_PREFIX_PATH=/a-3.6.2;/b-7.58.0;/c-3.5.2;/d-4.0.9;...". CMake should find all this specific versions. I build ~60 libraries/frameworks on four (windows,macosx,linux,wasm) different platforms and it works very well.

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

remoe avatar remoe commented on September 27, 2024

yes CMAKE_PREFIX_PATH

from vsgexamples.

remoe avatar remoe commented on September 27, 2024

@robertosfield, sorry, I found my approach works stable with SDK's, but it doesn't really work with "out-of-tree" projects.

The search path can be debug with -DCMAKE_FIND_DEBUG_MODE=ON.

UPDATE: when CMAKE_FIND_ROOT_PATH is not on the same drive as the project, then cmake doesn't find the SDK on Windows.

from vsgexamples.

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.