Comments (11)
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.
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.
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.
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.
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.
@OpenSiege FindPackage is not deprecated. I've build with windows x64 (VS2017) and CMake 3.15.2.
from vsgexamples.
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.
@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.
from vsgexamples.
yes CMAKE_PREFIX_PATH
from vsgexamples.
@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)
- how to render models with tileData? HOT 1
- If vsgTransform is no command line parameter, it will crash. HOT 1
- vsgviewer render readymap.vsgt? HOT 5
- Wayland support HOT 2
- Compiling issues for vsgvolume example HOT 4
- vertex and fragment source for vert_PushConstants.spv and frag_PushConstants.spv HOT 5
- Checked-in code inconsistent with .clang-format HOT 4
- vsgshadow without shadows on MacOS HOT 16
- None of the example models are actually compatible with vsgclip example HOT 2
- vsgshadow has black patches flickering on the ground HOT 4
- No CMakeLists.txt file for vsgoffscreenshot HOT 2
- vsgscreenshot can produce strange output HOT 2
- vsgexecutecommands crashes on windows HOT 8
- VSG_INSTANCE_POSITIONS format change HOT 2
- Request for a hello-world example HOT 3
- How to display a point on the earth map? HOT 1
- vsgvolume is actually broken on Windows 11 and Ubuntu 22.4 HOT 3
- problem with overlay views using multiple render graphs in the same window HOT 3
- DescriptorPool warning when using compileManager with storage buffers HOT 2
- Examples abort on shutdown when run in Debug HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vsgexamples.