<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
pre
{mso-style-priority:99;
mso-style-link:"HTML con formato previo Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-language:CA;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;
mso-fareast-language:CA;}
span.HTMLconformatoprevioCar
{mso-style-name:"HTML con formato previo Car";
mso-style-priority:99;
mso-style-link:"HTML con formato previo";
font-family:Consolas;
mso-fareast-language:EN-US;}
span.EstiloCorreo21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EstiloCorreo22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EstiloCorreo23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="ES" style="color:#1F497D">Even,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="ES" style="color:#1F497D">thanks a lot.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="ES" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I moved the file to {my GitHubDir}\GDAL\ogr\ogrsf_frmts\miramon\data\MM_m_idofic.csv<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I changed my CMakeLists.txt (see it below) as you indicated. And I deleted from gdal.cmake than now has only 5 files in there)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I rebased, deleted my gdal\build directory created the project again and built this.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">An when I debug it seems that
</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">CPLFindFile(</span><span style="font-size:9.5pt;font-family:Consolas;color:#A31515;mso-fareast-language:CA">"gdal"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">,
</span><span style="font-size:9.5pt;font-family:Consolas;color:#A31515;mso-fareast-language:CA">"MM_m_idofic.csv"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">);</span><span lang="EN-US" style="color:#1F497D">
returns NULL. If I see inside it has only one locator and it seems that should be more, now...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I am missing something?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">The CMakeLists<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">add_gdal_driver(<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">TARGET</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> ogr_MiraMon<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">SOURCES</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> ogrmiramondatasource.cpp ogrmiramondriver.cpp ogrmiramonlayer.cpp
mm_wrlayr.c mm_gdal_functions.c mmrdlayr.c<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> BUILTIN)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">gdal_standard_includes(ogr_MiraMon)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">target_include_directories</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">(ogr_MiraMon
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">PRIVATE</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> $<TARGET_PROPERTY:ogrsf_generic,SOURCE_DIR>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">set</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">(GDAL_DATA_FILES<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><b><span style="font-size:9.5pt;font-family:Consolas;color:#008800;mso-fareast-language:CA">${CMAKE_CURRENT_SOURCE_DIR}</span></b><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">/data/MM_m_idofic.csv<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">set_property</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">(<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">TARGET</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><b><span style="font-size:9.5pt;font-family:Consolas;color:#008800;mso-fareast-language:CA">${GDAL_LIB_TARGET_NAME}</span></b><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">APPEND</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> PROPERTY
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">RESOURCE</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#A31515;mso-fareast-language:CA">"</span><b><span style="font-size:9.5pt;font-family:Consolas;color:#008800;mso-fareast-language:CA">${GDAL_DATA_FILES}</span></b><span style="font-size:9.5pt;font-family:Consolas;color:#A31515;mso-fareast-language:CA">"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks again<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="ES" style="mso-fareast-language:CA">De:</span></b><span lang="ES" style="mso-fareast-language:CA"> Even Rouault <even.rouault@spatialys.com>
<br>
<b>Enviado el:</b> dimecres, 17 de gener de 2024 17:13<br>
<b>Para:</b> Abel Pau <a.pau@creaf.uab.cat>; gdal-dev@lists.osgeo.org<br>
<b>Asunto:</b> Re: [gdal-dev] Where to fins my own files<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Abel,<span style="font-size:12.0pt;mso-fareast-language:CA"><o:p></o:p></span></p>
<div>
<p class="MsoNormal">Le 17/01/2024 à 15:50, Abel Pau a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">ok Even,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">so, as my driver is not already online I have to do some changes at this part of the code, don’t I?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">At this moment I have the file in the folder GDAL\data (my GDAL_DATA environment variable).</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I call it like that.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">aMMIDDBFFile=CPLFindFile(</span><span style="font-size:9.5pt;font-family:Consolas;color:#A31515;mso-fareast-language:CA">"gdal"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">,
</span><span style="font-size:9.5pt;font-family:Consolas;color:#A31515;mso-fareast-language:CA">"MM_m_idofic.csv"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">);</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Do I have to move the file to somewhere? where?</span><o:p></o:p></p>
</blockquote>
<p>I've merged the PR, so you can rebase on top of latest master<o:p></o:p></p>
<p>No change required in your .cpp file<o:p></o:p></p>
<p>The only change is to move the resource file into a data/ subdirectory within your ogr/ogrsf_frmts/XXXX driver directory<o:p></o:p></p>
<p>and add in ogr/ogrsf_frmts/XXX/CMakeLists.txt <o:p></o:p></p>
<p style="margin-bottom:12.0pt"><br>
set(GDAL_DATA_FILES<br>
${CMAKE_CURRENT_SOURCE_DIR}/data/<span style="font-size:9.5pt;font-family:Consolas;color:#A31515;mso-fareast-language:CA">MM_m_idofic.csv</span><br>
)<br>
set_property(<br>
TARGET ${GDAL_LIB_TARGET_NAME}<br>
APPEND<br>
PROPERTY RESOURCE "${GDAL_DATA_FILES}")<o:p></o:p></p>
<p>Even<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:CA"><br>
<br>
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</body>
</html>