Skip to contentSkip to conversation

Doc: add a CMake example

GIT PULL Philippe Proulx 2 participants 7 messages Jun 17, 2016 – Jun 18, 2016 6 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Sebastien Boisvert

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

Quoted 45 lines

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(+)
Quoted 4 lines

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): CAB4xu_0rqy-OKa5ctWr6+pjWB-n_UZWH7-RHn9HGsWy-8QxW5A@mail.gmail.com

#3 lore raw
Quoted 8 lines · Philippe Proulx
Quoted 3 lines · Sebastien Boisvert

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:

Quoted 8 lines

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

Quoted 58 lines

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

Quoted 49 lines

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
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

#4 lore raw
In reply to a message not in the archive

Hi Phil,

Quoted 6 lines · Philippe Proulx
Quoted 3 lines · Sebastien Boisvert

Hi Mathieu,

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

Quoted 8 lines

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.

Quoted 4 lines

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.

Quoted 5 lines

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

Quoted 51 lines

Phil

Quoted 49 lines

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
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 16 lines · Sebastien Boisvert

Hi Phil,

Quoted 13 lines · Philippe Proulx
Quoted 3 lines · Sebastien Boisvert

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

Quoted 8 lines
Quoted 1 line

?

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.

Quoted 7 lines
Quoted 5 lines

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?

Quoted 8 lines
Quoted 6 lines

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

Quoted 57 lines

Thanks

Quoted 51 lines

Phil

Quoted 49 lines

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
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): CAB4xu_3ZC=EfGdmeL_RE5iFEp83pUZtVr_ev2oWAjD5t20QmKw@mail.gmail.com

#8 lore raw
Quoted 22 lines · Philippe Proulx
Quoted 20 lines · Sebastien Boisvert

Hi Phil,

Quoted 6 lines · Philippe Proulx
Quoted 3 lines · Sebastien Boisvert

Hi Mathieu,

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

Quoted 8 lines

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.

Quoted 7 lines
Quoted 4 lines

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.

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines

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.

Quoted 8 lines

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.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

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.

Quoted 64 lines
Quoted 1 line

I will do this.

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

Phil

Quoted 57 lines

Thanks

Quoted 51 lines

Phil

Quoted 49 lines

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
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 53 lines · Sebastien Boisvert
Quoted 22 lines · Philippe Proulx
Quoted 20 lines · Sebastien Boisvert

Hi Phil,

Quoted 6 lines · Philippe Proulx
Quoted 3 lines · Sebastien Boisvert

Hi Mathieu,

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

Quoted 8 lines

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.

Quoted 7 lines
Quoted 4 lines

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.

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines

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.

Quoted 8 lines

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?

Quoted 5 lines

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

Quoted 65 lines
Quoted 65 lines
Quoted 10 lines
Quoted 8 lines

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

Quoted 49 lines

Thanks

Quoted 43 lines

Phil

Quoted 41 lines

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
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

++++++

 doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h   | 27
+++++++++++++++++++++++
 12 files changed, 200 insertions(+)

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): CAB4xu_3gm_eu=CxbJOiSyD0_qKx+oB+aBEAdwmbfmcZZ1E6DuA@mail.gmail.com

#12 lore raw

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.

Quoted 92 lines · Philippe Proulx
Quoted 53 lines · Sebastien Boisvert
Quoted 22 lines · Philippe Proulx
Quoted 20 lines · Sebastien Boisvert

Hi Phil,

Quoted 6 lines · Philippe Proulx
Quoted 3 lines · Sebastien Boisvert

Hi Mathieu,

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

Quoted 8 lines

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.

Quoted 7 lines
Quoted 4 lines

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.

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines

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.

Quoted 8 lines

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?

Quoted 5 lines

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/>.

Quoted 79 lines

Works for me:

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

Phil

Quoted 73 lines
Quoted 73 lines
Quoted 10 lines
Quoted 8 lines

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

Quoted 57 lines

Thanks

Quoted 51 lines

Phil

Quoted 49 lines

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
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev