[cmake-developers] Canonical include pathes within ninja files

Peter Kümmel syntheticpp at gmx.net
Thu Jun 7 15:20:16 EDT 2012


On 07.06.2012 20:44, Claus Klein wrote:
> Hi Peter,
>
> It seem not so important, but is it wanted that ninja generator creates relative targets to PROJECT_BINARY_DIR?
>
> claus-kleins-macbook-pro:Example clausklein$ ninja -t query Hello/libHello.a
> Hello/libHello.a:
> input: CXX_STATIC_LIBRARY_LINKER
> Hello/CMakeFiles/Hello.dir/hello.o
> outputs:
> Demo/CMakeFiles/helloDemo.dir/demo.o
> Demo/CMakeFiles/helloDemo.dir/demo_b.o
> Demo/helloDemo
> Hello
> libHello.a
> all
> claus-kleins-macbook-pro:Example clausklein$

No, that looks like a bug.

>
> The phony targes are OK, but all libs, obj, deps, and exe files use relative paths.
> I had problems in eclipse with relative paths, you should know.
> It works as expected on shell.
>
> This patch fix the ninja call without path and prevents the use of std::ostringstream
> It include a test with realpath, but this is disabled for now.

Thanks, will have a look at it later, currently I try to fix the dep problem :)

Peter


>
>
>
>
> My other question about the not normalized include paths below could I solve.
> I had simply to change the CMakeLists.txt of a subproject:
>
> claus-kleins-macbook-pro:LMX clausklein$ bzr diff examples/properties/CMakeLists.txt
> === modified file 'examples/properties/CMakeLists.txt'
> --- examples/properties/CMakeLists.txt2011-05-10 06:13:29 +0000
> +++ examples/properties/CMakeLists.txt2012-06-07 18:00:26 +0000
> @@ -6,7 +6,8 @@
> set(LIBLMX Lmx)
> #FIXME find_library(LIBLMX Lmx ../../supporting-software/lib)
> -include_directories(../../supporting-software/include)
> +#XXX include_directories(../../supporting-software/include)
> +include_directories(${PRJECT_DIR}/supporting-software/include)
> # Tell CMake to build an executable
> add_executable(testlmx properties.2.2.2-test.cpp properties.2.2.2.cpp PropertyExtensions.cpp PropertyParser.cpp)
>
>
> //Regards
> Claus
>
>
>
> On 07.06.2012, at 12:15, Claus Klein wrote:
>
>> Hi Peter,
>>
>> I would like to know your opinion about Canonical path's
>>
>> While testing with ninja generator, I found same rules with non Canonical include pathes.
>>
>> a simple example from my test program:
>>
>> "/tmp/some/deep/application/folder/../configuration/instance/../instance/myfile.cfg"
>> "/tmp/some/deep/application/configuration/instance/myfile.cfg"
>> realpath -> /private/tmp/some/deep/application/configuration/instance/myfile.cfg (which does not yet exists!)
>>
>> see man realpath -- returns the canonicalized absolute pathname
>> http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.html
>>
>> Now the real questions:
>>
>> 1.) How can this done in a portable make insight cmake?
>> I know only boost!
>>
>> 2.) And should it done?
>> IMO yes! (It would be more clear and faster when we generate canonical path entries.)
>>
>>
>> //Regards
>> Claus Klein
>>
>>
>> <pathTricks.cpp>
>> --
>>
>> Powered by www.kitware.com <http://www.kitware.com>
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>



More information about the cmake-developers mailing list