Radu,

Thanks for pointing to the workaround. It worked for me.

Sincerely,
Shubhankar

On Sunday, June 26, 2022 at 4:06:04 AM UTC-4 Radu Serban wrote:

> Shubhankar,
>
>  
>
> The mention of CHRONO_DATA_DIR indicates that your situation is not the 
> same as the one I discussed in that reply back in 2017.
>
>  
>
> You are building a separate project and link to the Chrono libraries.  
> Based on what you get for CHRONO_DATA_DIR, I take it you are linking 
> against the Chrono build directory, as opposed to an install directory.  In 
> this case, it is indeed intended to point to the data/ directory in the 
> Chrono source tree.
>
>  
>
> You must make an explicit call to the function chrono::SetChronoDataPath() 
> and pass it the path contained in that CMake variable.  See my_example.cpp 
> in the Chrono distribution (under “template_project”).
>
>  
>
> If you already do this, there must be some other problem.  You mention 
> “some parsing issues while building”.  Could you provide more details?  
> Maybe it has to do with the space in this path, within “Chrono Workspace”.
>
>  
>
> --Radu
>
>  
>
>  
>
> *From:* [email protected] <[email protected]> *On 
> Behalf Of *Shubhankar Kulkarni
> *Sent:* Saturday, June 25, 2022 1:08 AM
> *To:* ProjectChrono <[email protected]>
> *Subject:* Re: [chrono] Re: how to configure data dir
>
>  
>
> I was looking through my build output, I'm seeing the CHRONO_DATA_DIR to 
> be pointing to the chrono src even though I've built my folder to be 
> outside the default src in a seperate directory
>
> CHRONO_DATA_DIR          (Path to Chrono data folder): C:/Chrono 
> Workspace/chrono-develop-SRC/data/
>
> My other includes from the chrono src are getting picked except this one 
> directory.
>
> On Friday, June 24, 2022 at 6:33:37 PM UTC-4 Shubhankar Kulkarni wrote:
>
> Hello Radu,
>
>  
>
> While working on a project generated on my own that uses chrono api, I'm 
> facing the same issue as Chris.
>
> I'm using VS 2022 on Windows to build the project and have modified the 
> "Working Directory" as you mentioned above to $(OutDir) and have my data 
> folder in the directory of .exe as well as in my src.
>
> I'm right now trying to set the absolute path in the 
> target_compile_definitions of CMakeLists.txt for "CHRONO_DATA_DIR" but 
> running into some parsing issues while building.
>
> What approach should I take?
>
>  
>
> Thanks,
>
> Shubhankar
>
> On Friday, May 26, 2017 at 8:56:56 AM UTC-4 Radu Serban wrote:
>
> When you run from *within *Visual Studio, you must properly set the 
> "Working Directory"  which is by default $(ProjectDir):
>
>    - right click on your project (the demo you want to debug/run using F5 
>    or Ctrl+F5) in the Solution Explorer, select Properties
>    - go to 'Configuration Properties->Debugging'
>    - change 'Working Directory' to $(OutDir)
>
> Unfortunately, this property is not stored in the Visual Studio project 
> files, so there is no way to set it through CMake.
>
> --Radu
>
>  
>
> On 5/26/2017 2:13 PM, lz shu wrote:
>
> Hi Radu, 
>
>  
>
> Thanks for your timely reply and exhaustive explanation. First of all, 
> what I'm talking about are the demos provided with Chrono. 
>
>  
>
> After CMake configuration,  I compiled Chrono(ALL_BUILD) on Visual Studio 
> 2013 on both debug mode and release mode without any change. And actually, 
>  the data files were automatically copied under <chrono_build>/bin/data/. 
> However, when I used debug mode(F5) to run a specific demos on Visual 
> Studio, it told me those warnings just like Chris'. 
>
>  
>
> So, I thought the data files must be lost on the relative path, and when I 
> copied the data files on those two paths(<chrono_build>/src/demos/data
>  and <chrono_build>/src/demos/data/vehicle/data), it loaded fonts and 
> texture successfully, and demos that the files' name beginning with 
> demo_IRR or demo_VEH could display normally. 
>
>  
>
> Still, I don't know why it works.
>
>  
>
> So, I'd appreciate any information you could give me.
>
>  
>
> Sincerely,
>
> LZ Shu
>
>
>
> 在 2017年5月26日星期五 UTC+8下午5:11:01,Radu Serban写道: 
>
> Hi LZ,
>
> The Chrono data directory should be copied automatically at CMake 
> configuration time from the source tree into the build tree, under 
> <chrono_build>/bin/data/ (Windows) and <chrono_build>/data/  (Linux).   
> What you did works because the default is for all Chrono demos to look for 
> data files with a relative path ../data/ (and, on Windows binaries are 
> created in <chrono_build>/bin/Release/, <chrono_build>/bin/Debug/, etc., 
> depending on the build type, while on Linux all binaries are created in 
> <chrono_build>/bin/).
>
> Can you check if the data files are in the above location in the build 
> tree?
>
> One last question: are you talking about the demos provided with Chrono 
> not being able to find the data files?  Or are you talking about your own 
> project that links to Chrono?
>
> --Radu
>
> On 5/26/2017 3:20 AM, lz shu wrote:
>
> Hi Chris, 
>
> I had the same problem on windows, and a forcible way for solving this is 
> put the data dir on the following directories:
>
> 1.  Chrono_build/src/demos/vehicle
>
> 2. Chrono_build/src/demos
>
> This may not be the best way but the simplest one. And it works. I think 
> it is the same on linux.
>
> Thanks,
>
> lz
>
>
> 在 2016年11月20日星期日 UTC+8上午2:46:58,Chris Kees写道: 
>
> Hi,
>
> I always get these sorts of warnings when running the demos:
>
> Could not load font because the file does not exist: 
> ../data/fonts/arial8.xml
> Could not open file of texture: ../data/logo_chronoengine_alpha.png
> Could not open file of texture: ../data/skybox/sky_lf.jpg
> Could not open file of texture: ../data/skybox/sky_dn.jpg
> Could not open file of texture: ../data/skybox/sky_up.jpg
> -
>
> I hacked my tutorial setup to properly find the data dir, but I'm 
> wondering if there's a way to fix this at the cmake configuration phase or 
> with an environment variable. My install root is  ./linux2 so the demos are 
> in ./linux2/bin and the data is in ./linux2/share/data.
>
> Thanks,
> Chris
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ProjectChrono" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
>  
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ProjectChrono" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
>  
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ProjectChrono" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/projectchrono/b53fac39-0dcf-4e48-8106-0cbee5730f2cn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/projectchrono/b53fac39-0dcf-4e48-8106-0cbee5730f2cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/1f166846-afa0-4ae8-98f6-8357da85b797n%40googlegroups.com.

Reply via email to