From e5b701c85783b6c19ddf39601e8beba3766417a8 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 20 Feb 2017 16:48:56 -0500 Subject: [PATCH] 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 --- .gitignore | 1 + doc/examples/Makefile.am | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) 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)" \ .. && \ -- 2.34.1