[CMake] Help with libintl/configure tests

Bill Hoffman bill.hoffman at kitware.com
Thu Apr 24 09:38:19 EDT 2008


Tim Holy wrote:
> On Wednesday 23 April 2008, you wrote:
>>> So, I don't understand why this isn't discovering that these types have
>>> been declared. Can anyone offer some insight?
>> Best thing to do is to use --debug-trycompile. 
> 
> Thanks for the tip. The outcome, however, is not at all what I expected. Check 
> this out (sorry that the line wrapping will make the shell command look 
> weird):
> 

Not totally unexpected as we clean the directory for a reason...

So, what you want to try is this:

  tim at diva:/tmp/build-intl$ rm -r *
  tim at diva:/tmp/build-intl$ cmake  ~/src/tux4kids/tuxmath/trunk/intl/

Now, edit the CMakeCache.txt file and remove the references to uintmax 
in the cache.

Then do this:
  tim at diva:/tmp/build-intl$ cmake  --debug-trycompile 
~/src/tux4kids/tuxmath/trunk/intl/


This will cause cmake to only run the one test and it should leave the 
source code for the test in CMakeFiles/CMakeTmp.  You can then go look 
at the source code and try to compile it by hand.


But, actually, looking at your CMakeError.log I don't think you have to 
do that...

You have this:

Determining if the intmax_t exist failed with the following output:
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make 
CMakeFiles/cmTryCompileExec.dir/build
make[1]: Entering directory `/tmp/build-intl/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report 
/tmp/build-intl/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/CheckSymbolExists.o
/usr/bin/gcc   -o CMakeFiles/cmTryCompileExec.dir/CheckSymbolExists.o 
-c /tmp/build-intl/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/tmp/build-intl/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In 
function â€$(0ma(Binâ€$(1:
(B/tmp/build-intl/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8: error: 
expected expression before â€$(0in(Btmax_tâ€$(1
m(Bake[1]: *** [CMakeFiles/cmTryCompileExec.dir/CheckSymbolExists.o] 
Error 1
make[1]: Leaving directory `/tmp/build-intl/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec/fast] Error 2

File /tmp/build-intl/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <stdint.h>

void cmakeRequireSymbol(int dummy,...){(void)dummy;}
int main()
{
#ifndef intmax_t
   cmakeRequireSymbol(0,&intmax_t);
#endif
   return 0;
}


So, create your own file CheckSymbolExists.c with the above contents and 
  then compile it like this:

/usr/bin/gcc   -o foo.o -c CheckSymbolExists.c

-Bill


More information about the CMake mailing list