Permalink
Browse files

Problem: examples/chat is not built

Solution: fix autoconf and CMake with local project-specific targets
to build it again
  • Loading branch information...
1 parent ad700b3 commit 1aa80a884829e1906a0083c4b86e082487749620 @bluca bluca committed Jan 2, 2017
Showing with 42 additions and 13 deletions.
  1. +2 −0 CMakeLists.txt
  2. +2 −0 Makefile.am
  3. +10 −0 acinclude.m4
  4. +3 −0 configure.ac
  5. +0 −13 examples/chat/Makefile.am
  6. +15 −0 src/CMakeLists-local.txt
  7. +10 −0 src/Makemodule-local.am
View
@@ -166,6 +166,8 @@ install(TARGETS zyre
RUNTIME DESTINATION bin # .dll file
)
+include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists-local.txt) # Optional project-local hook
+
########################################################################
# pkgconfig
########################################################################
View
@@ -30,6 +30,7 @@ if ENABLE_DIST_CMAKEFILES
EXTRA_DIST += \
Findlibzmq.cmake \
Findczmq.cmake \
+ src/CMakeLists-local.txt \
CMakeLists.txt
endif
@@ -45,6 +46,7 @@ EXTRA_DIST += \
src/zyre_classes.h
include $(srcdir)/src/Makemodule.am
+include $(srcdir)/src/Makemodule-local.am # Optional project-local hook
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
View
@@ -0,0 +1,10 @@
+AC_DEFUN([AX_PROJECT_LOCAL_HOOK], [
+ # Check for examples/chat intent
+ AC_ARG_ENABLE([examples_chat],
+ AS_HELP_STRING([--enable-examples-chat],
+ [Compile 'chat' in examples/chat [default=no]]),
+ [enable_examples_chat=$enableval],
+ [enable_examples_chat=no])
+ AM_CONDITIONAL([ENABLE_EXAMPLES_CHAT], [test x$enable_examples_chat != xno])
+ AM_COND_IF([ENABLE_EXAMPLES_CHAT], [AC_MSG_NOTICE([ENABLE_EXAMPLES_CHAT defined])])
+])
View
@@ -52,6 +52,9 @@ AC_PROG_SED
AC_PROG_AWK
PKG_PROG_PKG_CONFIG
+# Optional project-local hook (acinclude.m4, add AC_DEFUN([AX_PROJECT_LOCAL_HOOK], [whatever]) )
+AX_PROJECT_LOCAL_HOOK
+
# Code coverage
AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
[With GCC Code Coverage reporting])],
@@ -1,13 +0,0 @@
-EXTRA_DIST = chat.c
-
-AM_CPPFLAGS = \
- ${libsodium_CFLAGS} \
- ${libzmq_CFLAGS} \
- ${czmq_CFLAGS} \
- -I$(srcdir)/include \
- -DZYRE_BUILD_DRAFT_API=1
-
-bin_PROGRAMS = chat
-
-chat_LDADD = $(top_builddir)/src/libzyre.la ${libsodium_LIBS} ${libzmq_LIBS} ${czmq_LIBS}
-chat_SOURCES = chat.c
@@ -0,0 +1,15 @@
+add_executable(
+ chat
+ "${SOURCE_DIR}/examples/chat/chat.c"
+)
+target_link_libraries(
+ chat
+ zyre
+ ${LIBZMQ_LIBRARIES}
+ ${CZMQ_LIBRARIES}
+ ${OPTIONAL_LIBRARIES}
+)
+set_target_properties(
+ chat
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SOURCE_DIR}/examples/chat"
+)
@@ -0,0 +1,10 @@
+# Project-local changes to auto-generated content
+
+if ENABLE_EXAMPLES_CHAT
+EXTRA_DIST += examples/LICENSE
+
+noinst_PROGRAMS += examples/chat/chat
+examples_chat_chat_SOURCES = examples/chat/chat.c
+examples_chat_chat_CPPFLAGS = ${AM_CPPFLAGS}
+examples_chat_chat_LDADD = ${program_libs}
+endif #ENABLE_EXAMPLES_CHAT

0 comments on commit 1aa80a8

Please sign in to comment.