From ddbbe3b47cda2488f768e59c768b7db2142342c2 Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Thu, 11 Feb 2016 13:38:02 +0100 Subject: [PATCH] Problem: cmake fails with #error None of the ZMQ_USE_* macros defined This happens if you first configure with autotools, and then run cmake. The problem is that the compiler finds the old src/platform.hpp before looking for the one generated by CMake. Further, there are a set of macros that configure passes via the command line, yet CMake passes via platform.hpp. (HAVE_xxx for pollers, at least.) This means you can't do a CMake build using the autotools platform.hpp. Solution: remove any src/platform.hpp when running cmake. This is a workaround. I'll fix the inconsistent macros separately. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 291440b1..6180ee57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -552,6 +552,9 @@ foreach (source ${rc-sources}) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/${source}.in ${CMAKE_CURRENT_BINARY_DIR}/${source}) endforeach () +# Delete any src/platform.hpp left by configure +file (REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/src/platform.hpp) + configure_file (${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/platform.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/platform.hpp) list (APPEND sources ${CMAKE_CURRENT_BINARY_DIR}/platform.hpp)