From: Michael Jeanson Date: Mon, 20 Feb 2017 21:48:56 +0000 (-0500) Subject: Fix: CMake examples integration X-Git-Tag: v2.9.1~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6989ac73d4aa0acd6339d3c00a80b78e96b934c6;p=lttng-ust.git Fix: CMake examples integration Fix multiple issues with the CMake examples integration with our build system. Fixes #1089 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/.gitignore b/.gitignore index 0d322b19..e35e5d52 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ doc/examples/gen-tp/sample doc/examples/gen-tp/sample_tracepoint.h doc/examples/demo-tracef/demo-tracef doc/examples/demo-tracelog/demo-tracelog +doc/examples/cmake-multiple-shared-libraries/build/ doc/man/*.xml doc/man/lttng-gen-tp.1 diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 5bc1f4c9..239046fd 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -135,26 +135,26 @@ all-local: done; \ if [ x"$(SUBDIRS_JUL)" != x"" ]; then \ for subdir in $(SUBDIRS_JUL); do \ - (cd $(SUBDIRS_JUL) && $(MAKE) JAVA_CLASSPATH_OVERRIDE_JUL="../../../liblttng-ust-java-agent/java/lttng-ust-agent-jul" JAVA_CLASSPATH_OVERRIDE_COMMON="../../../liblttng-ust-java-agent/java/lttng-ust-agent-common" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \ + (cd $$subdir && $(MAKE) JAVA_CLASSPATH_OVERRIDE_JUL="../../../liblttng-ust-java-agent/java/lttng-ust-agent-jul" JAVA_CLASSPATH_OVERRIDE_COMMON="../../../liblttng-ust-java-agent/java/lttng-ust-agent-common" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \ done; \ fi; \ if [ x"$(SUBDIRS_LOG4J)" != x"" ]; then \ for subdir in $(SUBDIRS_LOG4J); do \ - (cd $(SUBDIRS_LOG4J) && $(MAKE) JAVA_CLASSPATH_OVERRIDE_LOG4J="../../../liblttng-ust-java-agent/java/lttng-ust-agent-log4j" JAVA_CLASSPATH_OVERRIDE_COMMON="../../../liblttng-ust-java-agent/java/lttng-ust-agent-common" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \ + (cd $$subdir && $(MAKE) JAVA_CLASSPATH_OVERRIDE_LOG4J="../../../liblttng-ust-java-agent/java/lttng-ust-agent-log4j" JAVA_CLASSPATH_OVERRIDE_COMMON="../../../liblttng-ust-java-agent/java/lttng-ust-agent-common" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \ done; \ - fi; + fi; \ if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \ for subdir in $(SUBDIRS_CMAKE); do \ ( \ - cd $(SUBDIRS_CMAKE) && \ + cd $$subdir && \ $(MKDIR_P) build && \ cd build && \ + CC=$(CC) \ + CXX=$(CXX) \ cmake \ -DCMAKE_INCLUDE_PATH="$(abs_top_srcdir)/include;$(abs_top_builddir)/include" \ -DCMAKE_LIBRARY_PATH="$(abs_top_builddir)/liblttng-ust/.libs" \ - -DCMAKE_C_COMPILER="$(CC)" \ -DCMAKE_C_FLAGS="$(CFLAGS) $(CPPFLAGS)" \ - -DCMAKE_CXX_COMPILER="$(CXX)" \ -DCMAKE_CXX_FLAGS="$(CXXFLAGS) $(CPPFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" \ .. && \