Cmake "Unknown arguments specified" during REcompile

Have previously compiled manticore from github checkout source. After some false starts it worked.

How trying to compile latest version. Did a “git pull” on source directory, which I think worked.

But change to build directory (following recommdnedation on Manticore Search Manual: Installation
), but running cmake now gives strange error

# cmake -D WITH_MYSQL=1 ../
-- Checking for endianess
-- Checking for gcc version
-- Storing compiler version
-- Compiler is 4.8.2
-- Storing system name
-- Looking for threads library
-- Checking for standard header files
-- ANSI C header files - found
-- Checking if mincore has unsigned 3-rd param
-- Checking for specific headers
-- Checking for library functions
CMake Error at cmake/helpers.cmake:209 (if):
  if given arguments:

    "AND" "LIB_LOGF"

  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:242 (ac_search_libs)


-- Configuring incomplete, errors occurred!

No idea how to debug that. ack LIB_LOGF ../ doesnt even find anything!)

(running make directly anyway, gives exact same message, must be running cmake anyway)

Well managed to ‘avoid’ the issue, by simply creating a new build2 directory and compiling there.

It compiled just fine.

I also tried running cmake a second time, after the compile, and it worked. I guess something has changed in the source. between versions.

it might be better to remove build directory, create it again then cmake into this new empty directory, like

cd manticore
rm -fr build
mkdir build
cd build
cmake ..

to clean up previous cmake settings rather than checking out what cmake options got changed and what got such conflict. That is why we suggest to use a folder outside the sources to keep them clean.

If build directory contains nothing specific, you can issue rm -r * in it each time on build (btw, ensure that you’re in right place invoking it!).

That is the simplest step, it works always.
In general it is enough to delete CMakeCache.txt in build folder (and it is also cure if you once made in-source build, and so it is no more possibly to make build in another place because of this file created in sources).

ok thanks both.

Will use a fresh build directory in future. With the old ./configure method, never had a problem reusing the directory.

That is just a bit essential changes which in similar case would affect any configuration tools, not only cmake-based (say, as if you flip behaviour of an option - you have to reconfigure with new value in any case).

Here it was issue with iconv/libiconv, which arises in BSD builds, and were finally perfectly resolved with cmake (don’t know, how easy it would be with autotools).
Some aside things which evolutionary moved from autotools into cmake were also fixed, and this old artifact affected previously configured folder.