All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [lttng-ust GIT PULL] Doc: add a CMake example
       [not found] <576377E3.8040401@gydle.com>
@ 2016-06-17 14:25 ` Philippe Proulx
       [not found] ` <CAB4xu_0rqy-OKa5ctWr6+pjWB-n_UZWH7-RHn9HGsWy-8QxW5A@mail.gmail.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Philippe Proulx @ 2016-06-17 14:25 UTC (permalink / raw)
  To: Sebastien Boisvert; +Cc: lttng-dev

On Fri, Jun 17, 2016 at 12:09 AM, Sebastien Boisvert
<sboisvert@gydle.com> wrote:
> Hi Mathieu,
>
> Please pull 7 commits for a new example in the documentation:

Isn't the "standard" way to use CMake this, in terms of directories:

    mkdir build
    cd build
    cmake ..
    make

?

Also, just a note: CMake 3.6 will have a FindLTTngUST [1] module which defines
an `LTTng::UST` imported target. This should be more robust than just:

    target_link_libraries(tracepoint-provider dl lttng-ust)

About this line, by the way, you should at least use `${CMAKE_DL_LIBS}` instead
of `dl`.

Phil

>
>
> The following changes since commit 01f0e40ce5b0c30c7c0706b63532049b311c83cf
> are available in the git repository at
>
> https://github.com/sebhtml/lttng-ust.git
> tags/cmake-multiple-shared-libraries.2016-06-17
>
>
> Sebastien Boisvert (7):
>       Doc: add CMake example
>       Doc: clean up cmake example
>       Doc: add a trace.sh script in the cmake example
>       Doc: clean up cmake file
>       Doc: fix English issue
>       Doc: rename cmake example
>       Doc: ship cmake example with 'make distcheck'
>
>
>
>  doc/examples/Makefile.am                                             | 15
> +++++++++++++
>  doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt          | 20
> +++++++++++++++++
>  doc/examples/cmake-multiple-shared-libraries/README.md               | 52
> +++++++++++++++++++++++++++++++++++++++++++++
>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp         | 16
> ++++++++++++++
>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.h           |  7
> ++++++
>  doc/examples/cmake-multiple-shared-libraries/aligner.cpp             | 10
> +++++++++
>  doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp          | 16
> ++++++++++++++
>  doc/examples/cmake-multiple-shared-libraries/tester-lib.h            |  7
> ++++++
>  doc/examples/cmake-multiple-shared-libraries/tester.cpp              | 15
> +++++++++++++
>  doc/examples/cmake-multiple-shared-libraries/trace.sh                |  9
> ++++++++
>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp |  6
> ++++++
>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27
> +++++++++++++++++++++++
>  12 files changed, 200 insertions(+)
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [lttng-ust GIT PULL] Doc: add a CMake example
       [not found] ` <CAB4xu_0rqy-OKa5ctWr6+pjWB-n_UZWH7-RHn9HGsWy-8QxW5A@mail.gmail.com>
@ 2016-06-17 14:45   ` Philippe Proulx
  2016-06-17 14:52   ` Sebastien Boisvert
       [not found]   ` <57640E96.6070800@gydle.com>
  2 siblings, 0 replies; 8+ messages in thread
From: Philippe Proulx @ 2016-06-17 14:45 UTC (permalink / raw)
  To: Sebastien Boisvert; +Cc: lttng-dev

On Fri, Jun 17, 2016 at 10:25 AM, Philippe Proulx
<eeppeliteloop@gmail.com> wrote:
> On Fri, Jun 17, 2016 at 12:09 AM, Sebastien Boisvert
> <sboisvert@gydle.com> wrote:
>> Hi Mathieu,
>>
>> Please pull 7 commits for a new example in the documentation:
>
> Isn't the "standard" way to use CMake this, in terms of directories:
>
>     mkdir build
>     cd build
>     cmake ..
>     make
>
> ?
>
> Also, just a note: CMake 3.6 will have a FindLTTngUST [1] module which defines

[1] https://github.com/Kitware/CMake/blob/master/Modules/FindLTTngUST.cmake

> an `LTTng::UST` imported target. This should be more robust than just:
>
>     target_link_libraries(tracepoint-provider dl lttng-ust)
>
> About this line, by the way, you should at least use `${CMAKE_DL_LIBS}` instead
> of `dl`.
>
> Phil
>
>>
>>
>> The following changes since commit 01f0e40ce5b0c30c7c0706b63532049b311c83cf
>> are available in the git repository at
>>
>> https://github.com/sebhtml/lttng-ust.git
>> tags/cmake-multiple-shared-libraries.2016-06-17
>>
>>
>> Sebastien Boisvert (7):
>>       Doc: add CMake example
>>       Doc: clean up cmake example
>>       Doc: add a trace.sh script in the cmake example
>>       Doc: clean up cmake file
>>       Doc: fix English issue
>>       Doc: rename cmake example
>>       Doc: ship cmake example with 'make distcheck'
>>
>>
>>
>>  doc/examples/Makefile.am                                             | 15
>> +++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt          | 20
>> +++++++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/README.md               | 52
>> +++++++++++++++++++++++++++++++++++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp         | 16
>> ++++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.h           |  7
>> ++++++
>>  doc/examples/cmake-multiple-shared-libraries/aligner.cpp             | 10
>> +++++++++
>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp          | 16
>> ++++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.h            |  7
>> ++++++
>>  doc/examples/cmake-multiple-shared-libraries/tester.cpp              | 15
>> +++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/trace.sh                |  9
>> ++++++++
>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp |  6
>> ++++++
>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27
>> +++++++++++++++++++++++
>>  12 files changed, 200 insertions(+)
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [lttng-ust GIT PULL] Doc: add a CMake example
       [not found] ` <CAB4xu_0rqy-OKa5ctWr6+pjWB-n_UZWH7-RHn9HGsWy-8QxW5A@mail.gmail.com>
  2016-06-17 14:45   ` Philippe Proulx
@ 2016-06-17 14:52   ` Sebastien Boisvert
       [not found]   ` <57640E96.6070800@gydle.com>
  2 siblings, 0 replies; 8+ messages in thread
From: Sebastien Boisvert @ 2016-06-17 14:52 UTC (permalink / raw)
  To: Philippe Proulx; +Cc: lttng-dev

Hi Phil,

On 06/17/2016 10:25 AM, Philippe Proulx wrote:
> On Fri, Jun 17, 2016 at 12:09 AM, Sebastien Boisvert
> <sboisvert@gydle.com> wrote:
>> Hi Mathieu,
>>
>> Please pull 7 commits for a new example in the documentation:
> 
> Isn't the "standard" way to use CMake this, in terms of directories:
> 
>     mkdir build
>     cd build
>     cmake ..
>     make
> 
> ?

I can rename the directory from cmake-multiple-shared-libraries.build to build.

I don't know if it is standard to create the build directory inside the source tree.
I always do out-of-tree builds, but I don't know if it is incoherent with the standard way.

Either way, I will make the changes you think are required.

> 
> Also, just a note: CMake 3.6 will have a FindLTTngUST [1] module which defines
> an `LTTng::UST` imported target. This should be more robust than just:
> 

I will add a check to detect CMake >= 3.6 and use find_package(LTTngUST) in that case.

>     target_link_libraries(tracepoint-provider dl lttng-ust)
> 
> About this line, by the way, you should at least use `${CMAKE_DL_LIBS}` instead
> of `dl`.
> 

I will do this.


Thanks



> Phil
> 
>>
>>
>> The following changes since commit 01f0e40ce5b0c30c7c0706b63532049b311c83cf
>> are available in the git repository at
>>
>> https://github.com/sebhtml/lttng-ust.git
>> tags/cmake-multiple-shared-libraries.2016-06-17
>>
>>
>> Sebastien Boisvert (7):
>>       Doc: add CMake example
>>       Doc: clean up cmake example
>>       Doc: add a trace.sh script in the cmake example
>>       Doc: clean up cmake file
>>       Doc: fix English issue
>>       Doc: rename cmake example
>>       Doc: ship cmake example with 'make distcheck'
>>
>>
>>
>>  doc/examples/Makefile.am                                             | 15
>> +++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt          | 20
>> +++++++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/README.md               | 52
>> +++++++++++++++++++++++++++++++++++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp         | 16
>> ++++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.h           |  7
>> ++++++
>>  doc/examples/cmake-multiple-shared-libraries/aligner.cpp             | 10
>> +++++++++
>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp          | 16
>> ++++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.h            |  7
>> ++++++
>>  doc/examples/cmake-multiple-shared-libraries/tester.cpp              | 15
>> +++++++++++++
>>  doc/examples/cmake-multiple-shared-libraries/trace.sh                |  9
>> ++++++++
>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp |  6
>> ++++++
>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27
>> +++++++++++++++++++++++
>>  12 files changed, 200 insertions(+)
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [lttng-ust GIT PULL] Doc: add a CMake example
       [not found]   ` <57640E96.6070800@gydle.com>
@ 2016-06-17 15:00     ` Philippe Proulx
       [not found]     ` <CAB4xu_3ZC=EfGdmeL_RE5iFEp83pUZtVr_ev2oWAjD5t20QmKw@mail.gmail.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Philippe Proulx @ 2016-06-17 15:00 UTC (permalink / raw)
  To: Sebastien Boisvert; +Cc: lttng-dev

On Fri, Jun 17, 2016 at 10:52 AM, Sebastien Boisvert
<sboisvert@gydle.com> wrote:
> Hi Phil,
>
> On 06/17/2016 10:25 AM, Philippe Proulx wrote:
>> On Fri, Jun 17, 2016 at 12:09 AM, Sebastien Boisvert
>> <sboisvert@gydle.com> wrote:
>>> Hi Mathieu,
>>>
>>> Please pull 7 commits for a new example in the documentation:
>>
>> Isn't the "standard" way to use CMake this, in terms of directories:
>>
>>     mkdir build
>>     cd build
>>     cmake ..
>>     make
>>
>> ?
>
> I can rename the directory from cmake-multiple-shared-libraries.build to build.
>
> I don't know if it is standard to create the build directory inside the source tree.
> I always do out-of-tree builds, but I don't know if it is incoherent with the standard way.
>
> Either way, I will make the changes you think are required.

It's just something that I see often in simple examples, so it might be
a good idea to conform to this.

>
>>
>> Also, just a note: CMake 3.6 will have a FindLTTngUST [1] module which defines
>> an `LTTng::UST` imported target. This should be more robust than just:
>>
>
> I will add a check to detect CMake >= 3.6 and use find_package(LTTngUST) in that case.

CMake 3.6 is not released yet, and when it does, few people will have
access to it
in the beginning I guess. You could include the whole module in the
example directory
(in a `CMake/modules` directory, for example), and still require CMake
2.8.11. Eventually
when CMake 3.6 is available on all major distributions then we can switch to a
requirement of CMake 3.6 and use the built-in module. What do you think?

>
>>     target_link_libraries(tracepoint-provider dl lttng-ust)
>>
>> About this line, by the way, you should at least use `${CMAKE_DL_LIBS}` instead
>> of `dl`.
>>
>
> I will do this.

Note however that the LTTng::UST imported target is linked with
`${CMAKE_DL_LIBS}` already.

Phil

>
>
> Thanks
>
>
>
>> Phil
>>
>>>
>>>
>>> The following changes since commit 01f0e40ce5b0c30c7c0706b63532049b311c83cf
>>> are available in the git repository at
>>>
>>> https://github.com/sebhtml/lttng-ust.git
>>> tags/cmake-multiple-shared-libraries.2016-06-17
>>>
>>>
>>> Sebastien Boisvert (7):
>>>       Doc: add CMake example
>>>       Doc: clean up cmake example
>>>       Doc: add a trace.sh script in the cmake example
>>>       Doc: clean up cmake file
>>>       Doc: fix English issue
>>>       Doc: rename cmake example
>>>       Doc: ship cmake example with 'make distcheck'
>>>
>>>
>>>
>>>  doc/examples/Makefile.am                                             | 15
>>> +++++++++++++
>>>  doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt          | 20
>>> +++++++++++++++++
>>>  doc/examples/cmake-multiple-shared-libraries/README.md               | 52
>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp         | 16
>>> ++++++++++++++
>>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.h           |  7
>>> ++++++
>>>  doc/examples/cmake-multiple-shared-libraries/aligner.cpp             | 10
>>> +++++++++
>>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp          | 16
>>> ++++++++++++++
>>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.h            |  7
>>> ++++++
>>>  doc/examples/cmake-multiple-shared-libraries/tester.cpp              | 15
>>> +++++++++++++
>>>  doc/examples/cmake-multiple-shared-libraries/trace.sh                |  9
>>> ++++++++
>>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp |  6
>>> ++++++
>>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27
>>> +++++++++++++++++++++++
>>>  12 files changed, 200 insertions(+)
>>> _______________________________________________
>>> lttng-dev mailing list
>>> lttng-dev@lists.lttng.org
>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [lttng-ust GIT PULL] Doc: add a CMake example
       [not found]     ` <CAB4xu_3ZC=EfGdmeL_RE5iFEp83pUZtVr_ev2oWAjD5t20QmKw@mail.gmail.com>
@ 2016-06-17 15:13       ` Sebastien Boisvert
       [not found]       ` <576413AB.3030301@gydle.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Sebastien Boisvert @ 2016-06-17 15:13 UTC (permalink / raw)
  To: Philippe Proulx; +Cc: lttng-dev



On 06/17/2016 11:00 AM, Philippe Proulx wrote:
> On Fri, Jun 17, 2016 at 10:52 AM, Sebastien Boisvert
> <sboisvert@gydle.com> wrote:
>> Hi Phil,
>>
>> On 06/17/2016 10:25 AM, Philippe Proulx wrote:
>>> On Fri, Jun 17, 2016 at 12:09 AM, Sebastien Boisvert
>>> <sboisvert@gydle.com> wrote:
>>>> Hi Mathieu,
>>>>
>>>> Please pull 7 commits for a new example in the documentation:
>>>
>>> Isn't the "standard" way to use CMake this, in terms of directories:
>>>
>>>     mkdir build
>>>     cd build
>>>     cmake ..
>>>     make
>>>
>>> ?
>>
>> I can rename the directory from cmake-multiple-shared-libraries.build to build.
>>
>> I don't know if it is standard to create the build directory inside the source tree.
>> I always do out-of-tree builds, but I don't know if it is incoherent with the standard way.
>>
>> Either way, I will make the changes you think are required.
> 
> It's just something that I see often in simple examples, so it might be
> a good idea to conform to this.

I'll make the change.

> 
>>
>>>
>>> Also, just a note: CMake 3.6 will have a FindLTTngUST [1] module which defines
>>> an `LTTng::UST` imported target. This should be more robust than just:
>>>
>>
>> I will add a check to detect CMake >= 3.6 and use find_package(LTTngUST) in that case.
> 
> CMake 3.6 is not released yet, and when it does, few people will have
> access to it
> in the beginning I guess. You could include the whole module in the
> example directory
> (in a `CMake/modules` directory, for example), and still require CMake
> 2.8.11. Eventually
> when CMake 3.6 is available on all major distributions then we can switch to a
> requirement of CMake 3.6 and use the built-in module. What do you think?

I vote in favor of your solution that ships with the FindLTTngUST.cmake file and cake >= 2.8.11.

Would CMake/modules be at the root of lttng-ust/ or in lttng-ust/doc/examples ?

If this solution is chosen, I suppose that the -ldl will be taken care of by FindLTTngUST.

> 
>>
>>>     target_link_libraries(tracepoint-provider dl lttng-ust)
>>>
>>> About this line, by the way, you should at least use `${CMAKE_DL_LIBS}` instead
>>> of `dl`.
>>>
>>
>> I will do this.
> 
> Note however that the LTTng::UST imported target is linked with
> `${CMAKE_DL_LIBS}` already.
> 
> Phil
> 
>>
>>
>> Thanks
>>
>>
>>
>>> Phil
>>>
>>>>
>>>>
>>>> The following changes since commit 01f0e40ce5b0c30c7c0706b63532049b311c83cf
>>>> are available in the git repository at
>>>>
>>>> https://github.com/sebhtml/lttng-ust.git
>>>> tags/cmake-multiple-shared-libraries.2016-06-17
>>>>
>>>>
>>>> Sebastien Boisvert (7):
>>>>       Doc: add CMake example
>>>>       Doc: clean up cmake example
>>>>       Doc: add a trace.sh script in the cmake example
>>>>       Doc: clean up cmake file
>>>>       Doc: fix English issue
>>>>       Doc: rename cmake example
>>>>       Doc: ship cmake example with 'make distcheck'
>>>>
>>>>
>>>>
>>>>  doc/examples/Makefile.am                                             | 15
>>>> +++++++++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt          | 20
>>>> +++++++++++++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/README.md               | 52
>>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp         | 16
>>>> ++++++++++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.h           |  7
>>>> ++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/aligner.cpp             | 10
>>>> +++++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp          | 16
>>>> ++++++++++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.h            |  7
>>>> ++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/tester.cpp              | 15
>>>> +++++++++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/trace.sh                |  9
>>>> ++++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp |  6
>>>> ++++++
>>>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27
>>>> +++++++++++++++++++++++
>>>>  12 files changed, 200 insertions(+)
>>>> _______________________________________________
>>>> lttng-dev mailing list
>>>> lttng-dev@lists.lttng.org
>>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [lttng-ust GIT PULL] Doc: add a CMake example
       [not found]       ` <576413AB.3030301@gydle.com>
@ 2016-06-17 18:19         ` Philippe Proulx
       [not found]         ` <CAB4xu_3gm_eu=CxbJOiSyD0_qKx+oB+aBEAdwmbfmcZZ1E6DuA@mail.gmail.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Philippe Proulx @ 2016-06-17 18:19 UTC (permalink / raw)
  To: Sebastien Boisvert; +Cc: lttng-dev

On Fri, Jun 17, 2016 at 11:13 AM, Sebastien Boisvert
<sboisvert@gydle.com> wrote:
>
>
> On 06/17/2016 11:00 AM, Philippe Proulx wrote:
>> On Fri, Jun 17, 2016 at 10:52 AM, Sebastien Boisvert
>> <sboisvert@gydle.com> wrote:
>>> Hi Phil,
>>>
>>> On 06/17/2016 10:25 AM, Philippe Proulx wrote:
>>>> On Fri, Jun 17, 2016 at 12:09 AM, Sebastien Boisvert
>>>> <sboisvert@gydle.com> wrote:
>>>>> Hi Mathieu,
>>>>>
>>>>> Please pull 7 commits for a new example in the documentation:
>>>>
>>>> Isn't the "standard" way to use CMake this, in terms of directories:
>>>>
>>>>     mkdir build
>>>>     cd build
>>>>     cmake ..
>>>>     make
>>>>
>>>> ?
>>>
>>> I can rename the directory from cmake-multiple-shared-libraries.build to build.
>>>
>>> I don't know if it is standard to create the build directory inside the source tree.
>>> I always do out-of-tree builds, but I don't know if it is incoherent with the standard way.
>>>
>>> Either way, I will make the changes you think are required.
>>
>> It's just something that I see often in simple examples, so it might be
>> a good idea to conform to this.
>
> I'll make the change.
>
>>
>>>
>>>>
>>>> Also, just a note: CMake 3.6 will have a FindLTTngUST [1] module which defines
>>>> an `LTTng::UST` imported target. This should be more robust than just:
>>>>
>>>
>>> I will add a check to detect CMake >= 3.6 and use find_package(LTTngUST) in that case.
>>
>> CMake 3.6 is not released yet, and when it does, few people will have
>> access to it
>> in the beginning I guess. You could include the whole module in the
>> example directory
>> (in a `CMake/modules` directory, for example), and still require CMake
>> 2.8.11. Eventually
>> when CMake 3.6 is available on all major distributions then we can switch to a
>> requirement of CMake 3.6 and use the built-in module. What do you think?
>
> I vote in favor of your solution that ships with the FindLTTngUST.cmake file and cake >= 2.8.11.
>
> Would CMake/modules be at the root of lttng-ust/ or in lttng-ust/doc/examples ?
>
> If this solution is chosen, I suppose that the -ldl will be taken care of by FindLTTngUST.

1. Use this CMakeLists.txt:

    cmake_minimum_required(VERSION 2.8.11)
    project(ALIGNER)
    list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

    include_directories(.)

    include (FindLTTngUST REQUIRED)

    add_library(tracepoint-provider SHARED tracepoint-provider.cpp)
    target_link_libraries(tracepoint-provider LTTng::UST)

    add_library(aligner-lib SHARED aligner-lib.cpp)
    target_link_libraries(aligner-lib tracepoint-provider)

    add_library(tester-lib SHARED tester-lib.cpp)
    target_link_libraries(tester-lib tracepoint-provider)

    link_libraries(aligner-lib)

    add_executable(aligner aligner.cpp)

    add_executable(tester tester.cpp)
    target_link_libraries(tester tester-lib)

2. In the "cmake" directory, relative to this CMakeLists.txt file, put
   FindLTTngUST.cmake, but you need to replace the
   FindPackageHandleStandardArgs include line because we're not in
   CMake's source tree, so this is your file: <https://www.pastery.net/fvanfh/>.

Works for me:

    -- Found LTTngUST: /usr/local/lib/liblttng-ust.so;dl (found version "2.8.0")

Phil

>
>>
>>>
>>>>     target_link_libraries(tracepoint-provider dl lttng-ust)
>>>>
>>>> About this line, by the way, you should at least use `${CMAKE_DL_LIBS}` instead
>>>> of `dl`.
>>>>
>>>
>>> I will do this.
>>
>> Note however that the LTTng::UST imported target is linked with
>> `${CMAKE_DL_LIBS}` already.
>>
>> Phil
>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>>> Phil
>>>>
>>>>>
>>>>>
>>>>> The following changes since commit 01f0e40ce5b0c30c7c0706b63532049b311c83cf
>>>>> are available in the git repository at
>>>>>
>>>>> https://github.com/sebhtml/lttng-ust.git
>>>>> tags/cmake-multiple-shared-libraries.2016-06-17
>>>>>
>>>>>
>>>>> Sebastien Boisvert (7):
>>>>>       Doc: add CMake example
>>>>>       Doc: clean up cmake example
>>>>>       Doc: add a trace.sh script in the cmake example
>>>>>       Doc: clean up cmake file
>>>>>       Doc: fix English issue
>>>>>       Doc: rename cmake example
>>>>>       Doc: ship cmake example with 'make distcheck'
>>>>>
>>>>>
>>>>>
>>>>>  doc/examples/Makefile.am                                             | 15
>>>>> +++++++++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt          | 20
>>>>> +++++++++++++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/README.md               | 52
>>>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp         | 16
>>>>> ++++++++++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.h           |  7
>>>>> ++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/aligner.cpp             | 10
>>>>> +++++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp          | 16
>>>>> ++++++++++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.h            |  7
>>>>> ++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/tester.cpp              | 15
>>>>> +++++++++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/trace.sh                |  9
>>>>> ++++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp |  6
>>>>> ++++++
>>>>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27
>>>>> +++++++++++++++++++++++
>>>>>  12 files changed, 200 insertions(+)
>>>>> _______________________________________________
>>>>> lttng-dev mailing list
>>>>> lttng-dev@lists.lttng.org
>>>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [lttng-ust GIT PULL] Doc: add a CMake example
       [not found]         ` <CAB4xu_3gm_eu=CxbJOiSyD0_qKx+oB+aBEAdwmbfmcZZ1E6DuA@mail.gmail.com>
@ 2016-06-18  2:20           ` Sebastien Boisvert
  0 siblings, 0 replies; 8+ messages in thread
From: Sebastien Boisvert @ 2016-06-18  2:20 UTC (permalink / raw)
  To: Philippe Proulx; +Cc: lttng-dev

Hi Phil,

I implemented all your suggestions.

I have 10 commits that are sitting on top of 21ddb8ec9689e02944dae9cd4e5aba1ca2ab0d5b .

You can pull from

    https://github.com/sebhtml/lttng-ust.git  tags/for-phil-cmake-example-2016-06-17.003


To see the changes in a web browser: https://github.com/sebhtml/lttng-ust/commits/for-phil-cmake-example-2016-06-17.003

Sebastien Boisvert (10):
      Doc: add CMake example
      Doc: clean up cmake example
      Doc: add a trace.sh script in the cmake example
      Doc: clean up cmake file
      Doc: fix English issue
      Doc: rename cmake example
      Doc: ship cmake example with 'make distcheck'
      Doc: add FindLTTngUST CMake module
      Doc: use standard way for building with CMake
      Doc: use the FindLTTngUST CMake module

 doc/examples/Makefile.am                           |  15 +++
 .../cmake-multiple-shared-libraries/CMakeLists.txt |  23 +++++
 .../cmake-multiple-shared-libraries/README.md      |  52 ++++++++++
 .../aligner-lib.cpp                                |  16 +++
 .../cmake-multiple-shared-libraries/aligner-lib.h  |   7 ++
 .../cmake-multiple-shared-libraries/aligner.cpp    |  10 ++
 .../cmake/FindLTTngUST.cmake                       | 111 +++++++++++++++++++++
 .../cmake-multiple-shared-libraries/tester-lib.cpp |  16 +++
 .../cmake-multiple-shared-libraries/tester-lib.h   |   7 ++
 .../cmake-multiple-shared-libraries/tester.cpp     |  15 +++
 .../cmake-multiple-shared-libraries/trace.sh       |   9 ++
 .../tracepoint-provider.cpp                        |   6 ++
 .../tracepoint-provider.h                          |  27 +++++
 13 files changed, 314 insertions(+)



Have a good one.

On 16-06-17 02:19 PM, Philippe Proulx wrote:
> On Fri, Jun 17, 2016 at 11:13 AM, Sebastien Boisvert
> <sboisvert@gydle.com> wrote:
>>
>>
>> On 06/17/2016 11:00 AM, Philippe Proulx wrote:
>>> On Fri, Jun 17, 2016 at 10:52 AM, Sebastien Boisvert
>>> <sboisvert@gydle.com> wrote:
>>>> Hi Phil,
>>>>
>>>> On 06/17/2016 10:25 AM, Philippe Proulx wrote:
>>>>> On Fri, Jun 17, 2016 at 12:09 AM, Sebastien Boisvert
>>>>> <sboisvert@gydle.com> wrote:
>>>>>> Hi Mathieu,
>>>>>>
>>>>>> Please pull 7 commits for a new example in the documentation:
>>>>>
>>>>> Isn't the "standard" way to use CMake this, in terms of directories:
>>>>>
>>>>>     mkdir build
>>>>>     cd build
>>>>>     cmake ..
>>>>>     make
>>>>>
>>>>> ?
>>>>
>>>> I can rename the directory from cmake-multiple-shared-libraries.build to build.
>>>>
>>>> I don't know if it is standard to create the build directory inside the source tree.
>>>> I always do out-of-tree builds, but I don't know if it is incoherent with the standard way.
>>>>
>>>> Either way, I will make the changes you think are required.
>>>
>>> It's just something that I see often in simple examples, so it might be
>>> a good idea to conform to this.
>>
>> I'll make the change.
>>
>>>
>>>>
>>>>>
>>>>> Also, just a note: CMake 3.6 will have a FindLTTngUST [1] module which defines
>>>>> an `LTTng::UST` imported target. This should be more robust than just:
>>>>>
>>>>
>>>> I will add a check to detect CMake >= 3.6 and use find_package(LTTngUST) in that case.
>>>
>>> CMake 3.6 is not released yet, and when it does, few people will have
>>> access to it
>>> in the beginning I guess. You could include the whole module in the
>>> example directory
>>> (in a `CMake/modules` directory, for example), and still require CMake
>>> 2.8.11. Eventually
>>> when CMake 3.6 is available on all major distributions then we can switch to a
>>> requirement of CMake 3.6 and use the built-in module. What do you think?
>>
>> I vote in favor of your solution that ships with the FindLTTngUST.cmake file and cake >= 2.8.11.
>>
>> Would CMake/modules be at the root of lttng-ust/ or in lttng-ust/doc/examples ?
>>
>> If this solution is chosen, I suppose that the -ldl will be taken care of by FindLTTngUST.
> 
> 1. Use this CMakeLists.txt:
> 
>     cmake_minimum_required(VERSION 2.8.11)
>     project(ALIGNER)
>     list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
> 
>     include_directories(.)
> 
>     include (FindLTTngUST REQUIRED)
> 
>     add_library(tracepoint-provider SHARED tracepoint-provider.cpp)
>     target_link_libraries(tracepoint-provider LTTng::UST)
> 
>     add_library(aligner-lib SHARED aligner-lib.cpp)
>     target_link_libraries(aligner-lib tracepoint-provider)
> 
>     add_library(tester-lib SHARED tester-lib.cpp)
>     target_link_libraries(tester-lib tracepoint-provider)
> 
>     link_libraries(aligner-lib)
> 
>     add_executable(aligner aligner.cpp)
> 
>     add_executable(tester tester.cpp)
>     target_link_libraries(tester tester-lib)
> 
> 2. In the "cmake" directory, relative to this CMakeLists.txt file, put
>    FindLTTngUST.cmake, but you need to replace the
>    FindPackageHandleStandardArgs include line because we're not in
>    CMake's source tree, so this is your file: <https://www.pastery.net/fvanfh/>.
> 
> Works for me:
> 
>     -- Found LTTngUST: /usr/local/lib/liblttng-ust.so;dl (found version "2.8.0")
> 
> Phil
> 
>>
>>>
>>>>
>>>>>     target_link_libraries(tracepoint-provider dl lttng-ust)
>>>>>
>>>>> About this line, by the way, you should at least use `${CMAKE_DL_LIBS}` instead
>>>>> of `dl`.
>>>>>
>>>>
>>>> I will do this.
>>>
>>> Note however that the LTTng::UST imported target is linked with
>>> `${CMAKE_DL_LIBS}` already.
>>>
>>> Phil
>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>>> Phil
>>>>>
>>>>>>
>>>>>>
>>>>>> The following changes since commit 01f0e40ce5b0c30c7c0706b63532049b311c83cf
>>>>>> are available in the git repository at
>>>>>>
>>>>>> https://github.com/sebhtml/lttng-ust.git
>>>>>> tags/cmake-multiple-shared-libraries.2016-06-17
>>>>>>
>>>>>>
>>>>>> Sebastien Boisvert (7):
>>>>>>       Doc: add CMake example
>>>>>>       Doc: clean up cmake example
>>>>>>       Doc: add a trace.sh script in the cmake example
>>>>>>       Doc: clean up cmake file
>>>>>>       Doc: fix English issue
>>>>>>       Doc: rename cmake example
>>>>>>       Doc: ship cmake example with 'make distcheck'
>>>>>>
>>>>>>
>>>>>>
>>>>>>  doc/examples/Makefile.am                                             | 15
>>>>>> +++++++++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt          | 20
>>>>>> +++++++++++++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/README.md               | 52
>>>>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp         | 16
>>>>>> ++++++++++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/aligner-lib.h           |  7
>>>>>> ++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/aligner.cpp             | 10
>>>>>> +++++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp          | 16
>>>>>> ++++++++++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/tester-lib.h            |  7
>>>>>> ++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/tester.cpp              | 15
>>>>>> +++++++++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/trace.sh                |  9
>>>>>> ++++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp |  6
>>>>>> ++++++
>>>>>>  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27
>>>>>> +++++++++++++++++++++++
>>>>>>  12 files changed, 200 insertions(+)
>>>>>> _______________________________________________
>>>>>> lttng-dev mailing list
>>>>>> lttng-dev@lists.lttng.org
>>>>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [lttng-ust GIT PULL] Doc: add a CMake example
@ 2016-06-17  4:09 Sebastien Boisvert
  0 siblings, 0 replies; 8+ messages in thread
From: Sebastien Boisvert @ 2016-06-17  4:09 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: lttng-dev

Hi Mathieu,

Please pull 7 commits for a new example in the documentation:


The following changes since commit 01f0e40ce5b0c30c7c0706b63532049b311c83cf
are available in the git repository at

https://github.com/sebhtml/lttng-ust.git tags/cmake-multiple-shared-libraries.2016-06-17


Sebastien Boisvert (7):
       Doc: add CMake example
       Doc: clean up cmake example
       Doc: add a trace.sh script in the cmake example
       Doc: clean up cmake file
       Doc: fix English issue
       Doc: rename cmake example
       Doc: ship cmake example with 'make distcheck'



  doc/examples/Makefile.am                                             | 15 +++++++++++++
  doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt          | 20 +++++++++++++++++
  doc/examples/cmake-multiple-shared-libraries/README.md               | 52 +++++++++++++++++++++++++++++++++++++++++++++
  doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp         | 16 ++++++++++++++
  doc/examples/cmake-multiple-shared-libraries/aligner-lib.h           |  7 ++++++
  doc/examples/cmake-multiple-shared-libraries/aligner.cpp             | 10 +++++++++
  doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp          | 16 ++++++++++++++
  doc/examples/cmake-multiple-shared-libraries/tester-lib.h            |  7 ++++++
  doc/examples/cmake-multiple-shared-libraries/tester.cpp              | 15 +++++++++++++
  doc/examples/cmake-multiple-shared-libraries/trace.sh                |  9 ++++++++
  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp |  6 ++++++
  doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27 +++++++++++++++++++++++
  12 files changed, 200 insertions(+)
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-18  2:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <576377E3.8040401@gydle.com>
2016-06-17 14:25 ` [lttng-ust GIT PULL] Doc: add a CMake example Philippe Proulx
     [not found] ` <CAB4xu_0rqy-OKa5ctWr6+pjWB-n_UZWH7-RHn9HGsWy-8QxW5A@mail.gmail.com>
2016-06-17 14:45   ` Philippe Proulx
2016-06-17 14:52   ` Sebastien Boisvert
     [not found]   ` <57640E96.6070800@gydle.com>
2016-06-17 15:00     ` Philippe Proulx
     [not found]     ` <CAB4xu_3ZC=EfGdmeL_RE5iFEp83pUZtVr_ev2oWAjD5t20QmKw@mail.gmail.com>
2016-06-17 15:13       ` Sebastien Boisvert
     [not found]       ` <576413AB.3030301@gydle.com>
2016-06-17 18:19         ` Philippe Proulx
     [not found]         ` <CAB4xu_3gm_eu=CxbJOiSyD0_qKx+oB+aBEAdwmbfmcZZ1E6DuA@mail.gmail.com>
2016-06-18  2:20           ` Sebastien Boisvert
2016-06-17  4:09 Sebastien Boisvert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.