<div dir="ltr">Steve, <div><br></div><div>That's giving me an error. I understood the workflow, Here is the main thing that I've to look at :[line 36]  POSTGRESQL_PG_CONFIG = "/usr/bin/pg_config" and that is of version 8.4.22. From this the variable POSTGRESQL_VERSION_STRING is set which makes all the variables in CMakeLists.txt to 8.4. This makes the whole POSTGRESQL variables in CMakeLists.txt to 8.4. We can see that from cmake log. </div><div><br></div><div>So if we can control this line 36 to the PG_VERSION we specify, then everything works fine. I will let you know if I got something interesting. I'd be highly thankful if you suggest something at this point.  </div><div><br></div><div>- Mani </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 23, 2015 at 3:16 AM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Try changing it to this:<br>
<br>
# Checking POSTGRESQL_PG_CONFIG<br>
    find_program(POSTGRESQL_PG_CONFIG NAMES pg_config<br>
        PATHS<br>
        /usr/lib/postgresql/${PG_VERSION}/bin/<br>
        NO_DEFAULT_PATH<br>
        )<br>
<br>
also read this:<br>
<br>
cmake --help-command FIND_PROGRAM<br>
<br>
-Steve<span class=""><br>
<br>
On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Steve,<br>
<br>
Thanks for the steps. I am thinking in a  different method. I just<br>
pushed a branch cmake-postgres. In File FindPostgreSQL.cmake on line no:<br>
19, PG_VERSION is a argument passed while running cmake. ( cmake<br>
-DPG_VERSION=9.* ).<br>
<br>
* Take an argument from  command line.<br>
*  Modify the present FindPostgreSQL.cmake, build it until it is working<br>
properly.<br>
<br>
I am stuck here at this point.  See line no:  43 (<br></span>
COMMAND${POSTGRESQL_PG_CONFIG}--version)  this is giving 8.4 as<span class=""><br>
defaults. Therefore variables after this are set with 8.4, I need to<br>
somehow understand and change it.<br>
<br>
If you are free now we can discuss this.<br>
- Mani<br>
<br>
On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge<br></span><div><div class="h5">
<<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>>> wrote:<br>
<br>
    Mani wrote:<br>
<br>
        I'm working on this already. Since this is my first time on<br>
        cmake and<br>
        dependencies I might need some help from you guys.<br>
<br>
        I'll try my best to make it working.<br>
<br>
<br>
    Start with the message below and ask where you get stuck. The steps are:<br>
<br>
    1. copy the FindPostgreSQL.cmake linked below to the pgrouting/cmake<br>
<br>
    2. this will break the build stuff because this new script sets<br>
    different variables than the existing build expects.<br>
<br>
    3. sort this out and get it to build like it did before using the<br>
    new script<br>
<br>
    4. when it is building like before, add the variable to set the<br>
    version in the commandline and and use that to set<br>
    PostgreSQL_ADDITIONAL_VERSIONS  and it should work.<br>
<br>
    Ask specific questions if you get stuck, check in your code where I<br>
    can look at it.<br>
<br>
    There is a ticket for this:<br>
    <a href="https://github.com/pgRouting/pgrouting/issues/301" rel="noreferrer" target="_blank">https://github.com/pgRouting/pgrouting/issues/301</a><br>
<br>
    -Steve<br>
<br>
<br>
    On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:<br>
<br>
        Mani,<br>
<br>
        You probably want to start with this version of FindPostgreSQL.cmake<br>
<br>
        <a href="https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake" rel="noreferrer" target="_blank">https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake</a><br>
<br>
          It lets you specify PostgreSQL_ADDITIONAL_VERSIONS  variable<br>
        and if<br>
        this is set to the version you want it will use this version if<br>
        found.<br>
<br>
        I think that the return variables that this script sets are<br>
        different<br>
          from what we expect in pgrouting so you might need to set the<br>
        expected variables with the correct values also.<br>
<br>
        So, I would replace the existing FindPostgreSQL.cmake with this<br>
        script and then try to make it work with the existing build system,<br>
        then look at reading a command line version and setting the variable<br>
        above before calling find postgresql.<br>
<br>
        -Steve<br>
<br>
        On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:<br>
<br>
            Hi Steve,<br>
<br>
            I've tried my best to update cmake/FindPostgreSQL.cmake  and<br>
            CMakeLists.txt, but the build was not successful. I've<br>
            changed all<br>
            the POSTGRES variables to 9.4, cmake executed properly, but<br>
            while<br>
            compiling(make) there is a error saying "Postgres.h" not<br>
            found. Can<br>
            you share your CMakeLists.txt and<br>
            cmake/FindPostgresql..cmake. I am<br>
            on the version 9.4.<br>
<br>
            I think this needs to be solved for the next release. We need to<br>
            the pass the postgresql version to build,  like the option you<br>
            said "DUSE_PG=9.x". But unfortunately it is not working<br>
            right now.<br>
            I'll try to read about cmake and see what I can do. I will<br>
            update<br>
            you.<br>
<br>
            Thank you, Mani<br>
<br>
            On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge<br>
            <<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>><br></div></div>
            <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a><div><div class="h5"><br>
            <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>>>> wrote:<br>
<br>
            On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:<br>
<br>
            Hi,<br>
<br>
            I am facing an error while building from source. This is that<br>
            issue: <a href="https://github.com/pgRouting/pgrouting/issues/109" rel="noreferrer" target="_blank">https://github.com/pgRouting/pgrouting/issues/109</a><br>
<br>
            How to resolve that?  Changing Pg version to 9.1 in<br>
            CMakeLists.txt<br>
            is not working. I have 9.1 and 9.4 postgresql versions<br>
            installed in<br>
            my system. Help me out in resolving this.<br>
<br>
<br>
            Mani,<br>
<br>
            Sorry, the CMakeLists.txt files built for pgrouting 2.x were not<br>
            designed for support multiple versions installed on the same<br>
            system. This is a problem for me because I have 9.2, 9.3,<br>
            and 9.4<br>
            installed and I can only build and install on 9.4.<br>
<br>
            The solution id to update the CMakeLists.txt and specifically<br>
            cmake/FindPostgreSQL.cmake which so you can do something like<br>
<br>
            cd build cmake -DUSE_PG=9.x ..<br>
<br>
            I took a quick look at doing this a while back but<br>
            cmake/FindPostgreSQL.cmake needs to be replaced and other<br>
            changes<br>
            are needed and I didn't have time to make the changes and get it<br>
            working.<br>
<br>
            tools/<a href="http://test-runner.pl" rel="noreferrer" target="_blank">test-runner.pl</a> <<a href="http://test-runner.pl" rel="noreferrer" target="_blank">http://test-runner.pl</a>><br>
            <<a href="http://test-runner.pl" rel="noreferrer" target="_blank">http://test-runner.pl</a>> already support<br>
            options for pg versions and ports so only the build system is<br>
            broken in this regard.<br>
<br>
            If you want to read up on CMake and get this working a pull<br>
            request would be great!<br>
<br>
            -Steve<br>
<br>
            _______________________________________________ pgrouting-dev<br>
            mailing list <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
            <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br></div></div>
            <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><span class=""><br>
            <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>>><br>
            <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
<br>
<br>
            _______________________________________________ pgrouting-dev<br>
            mailing list <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
            <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
            <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
        _______________________________________________ pgrouting-dev<br>
        mailing<br>
        list <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
        <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
        <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
    _______________________________________________<br>
    pgrouting-dev mailing list<br></span>
    <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a> <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><span class=""><br>
    <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
<br>
_______________________________________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
</div></div></blockquote></div><br></div>