Hello Folks!<div><br></div><div>I was having some troubles with FindPythonLibs, then I decided to debug it.</div><div>I&#39;ve found out that the <span class="GRcorrect" id="GRmark_bdf8fe601449220f878b269ddd148e3f4ba033c4_CMake:0">CMake</span> wasn&#39;t translating the registry string to a valid path:</div>


<div><br></div><div>FIND_LIBRARY<span style="background-color:transparent"><span class="GRcorrect" id="GRmark_4c0fdc8d4e5a47befd1acbafe27878586076ed28_(:0">(</span></span>PYTHON_LIBRARY</div><div><div>    NAMES python$<span><span class="GRcorrect" id="GRmark_5dfd5b01c7a80b8dadb1a96337f9079718f68954_{:0">{</span></span>_CURRENT_VERSION_NO_DOTS} python$<span><span class="GRcorrect" id="GRmark_5dfd5b01c7a80b8dadb1a96337f9079718f68954_{:1">{</span></span>_CURRENT_VERSION}</div>


<div>    PATHS</div><div>    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs</div><div>    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs</div>


<div>    # Avoid <span><span class="GRcorrect" id="GRmark_65cdff872a90037ab5f6b5128114b40f5e6efd70_finding:0">finding</span></span> the .<span><span class="GRcorrect" id="GRmark_65cdff872a90037ab5f6b5128114b40f5e6efd70_dll:1">dll</span></span> in the PATH.  We want the .<span><span class="GRcorrect" id="GRmark_395686925f6b42ac7d6b73875a3d78a426a3522b_lib:0">lib</span></span>.</div>


<div>    NO_SYSTEM_ENVIRONMENT_PATH</div><div>)</div></div><div><br></div><div><span style="white-space:nowrap">I did make the following changes and now it&#39;s working fine.</span></div><div><span style="white-space:nowrap"><br>


</span></div><div><span style="white-space:nowrap"><div>GET_FILENAME_COMPONENT<span><span class="GRcorrect" id="GRmark_56f7bbe69d141f7be066275819dee8ddbb1f1a8f_(:0">(</span></span>PYTHON_REGISTER_HLM [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] ABSOLUTE)</div>


<div>GET_FILENAME_COMPONENT<span><span class="GRcorrect" id="GRmark_d6d7e390b67a86e3ef950bb50d6383b0147a44ca_(:0">(</span></span>PYTHON_REGISTER_HCU [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] ABSOLUTE)</div>


<div><br></div><div><div>FIND_LIBRARY<span><span class="GRcorrect" id="GRmark_4c0fdc8d4e5a47befd1acbafe27878586076ed28_(:0">(</span></span>PYTHON_LIBRARY</div><div>    NAMES python$<span><span class="GRcorrect" id="GRmark_5dfd5b01c7a80b8dadb1a96337f9079718f68954_{:0">{</span></span>_CURRENT_VERSION_NO_DOTS} python$<span><span class="GRcorrect" id="GRmark_5dfd5b01c7a80b8dadb1a96337f9079718f68954_{:1">{</span></span>_CURRENT_VERSION}</div>


<div>    PATHS</div><div>    $<span><span class="GRcorrect" id="GRmark_2dbbbd747762bd99d92fa98495286fccbb6a7dc7_{:0">{</span></span>PYTHON_REGISTER_HLM<span><span class="GRcorrect" id="GRmark_2dbbbd747762bd99d92fa98495286fccbb6a7dc7_}:1">}</span></span>/<span><span class="GRcorrect" id="GRmark_2dbbbd747762bd99d92fa98495286fccbb6a7dc7_libs:2">libs</span></span></div>


<div>    $<span><span class="GRcorrect" id="GRmark_b320b8e8b6ba218c39786a06cef03d927cb789a8_{:0">{</span></span>PYTHON_REGISTER_HCU<span><span class="GRcorrect" id="GRmark_b320b8e8b6ba218c39786a06cef03d927cb789a8_}:1">}</span></span>/<span><span class="GRcorrect" id="GRmark_b320b8e8b6ba218c39786a06cef03d927cb789a8_libs:2">libs</span></span></div>


<div>    # Avoid <span><span class="GRcorrect" id="GRmark_65cdff872a90037ab5f6b5128114b40f5e6efd70_finding:0">finding</span></span> the .<span><span class="GRcorrect" id="GRmark_65cdff872a90037ab5f6b5128114b40f5e6efd70_dll:1">dll</span></span> in the PATH.  We want the .<span><span class="GRcorrect" id="GRmark_395686925f6b42ac7d6b73875a3d78a426a3522b_lib:0">lib</span></span>.</div>


<div>    NO_SYSTEM_ENVIRONMENT_PATH</div><div>)</div></div><div><br></div><div>Questions:</div><div>Are my changes right?</div><div>Why the original FindPythonLibs wasn&#39;t working for me?</div><div><br></div><div>Thanks,</div>


<div>Hugo.</div></span></div>