[cmake-developers] adding FindJsonCpp

Farbos a farbos.arnaud at gmail.com
Thu Jun 30 04:24:01 EDT 2016


Hi,

2016-06-29 19:31 GMT+02:00 Ben Boeckel <ben.boeckel at kitware.com>:
> On Wed, Jun 29, 2016 at 17:36:45 +0200, Farbos a wrote:
>> I have a concern with generating package configs:
>>
>> 1 It seems to contain absolute path, so not really portable with git.
>
> The actual config files are generated at build time, not committed to
> the source control (template files with @variable@ spots to insert
> values are committed).

I am not sure to understand what you are saying, did they do something
wrong or could we add some stuff in order to make in work with a
source control software. Just to be sure we are talking about these
lines: https://github.com/open-source-parsers/jsoncpp/blob/master/CMakeLists.txt#L144

>> 2 It does not respect the naming of imported targets with `::`. As you
>> can see here: https://cmake.org/cmake/help/git-master/manual/cmake-developer.7.html#a-sample-find-module
>> The fact that it produces an appropriate diagnostic messages if that
>> target does not exist is really helpful.
>
> Not sure exactly what you mean when the config file approach "does not
> respect" imported target names, but the file that CMake generates is not
> the direct config file, but is usually included (I have CMake generate
> ${pkg}-targets.cmake). Checking for targets in the top-level script is
> certainly possible.

When I look at the generated file here jsoncppConfig.cmake, you find
these lines:
```
# Create imported target jsoncpp_lib
add_library(jsoncpp_lib SHARED IMPORTED)

set_target_properties(jsoncpp_lib PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "/home/hevy/jsoncpp/0.10.5/include"
)
...
```

The thing here is the library name is jsoncpp_lib and not something
like jsoncpp::jsoncpp_lib. And like I said earlier the name "::" is a
lot more helpful.

Thanks,

-- 
Arnaud FARBOS


More information about the cmake-developers mailing list