[Vm-dev] A quick overview of Ian's CMakeLists.txt/cmake process and encouraging progress on generating config.h in CMakeVMMaker(Squeak)

gettimothy gettimothy at zoho.com
Sat Jul 5 18:07:33 UTC 2014


Hi All.



I am tackling the "cmake must generate config.h" problem now. In doing so, I had to study Ian's code to see how he did it and this is what I learned.*


In Ian's CMake code (svn co http://squeakvm.org/svn/squeak/trunk), the overview I see is as follows.




platforms/unix/cmake/configure script collects some shell variables and invokes cmake with some arguments collected from the shell script.
This runs cmake which uses the platforms/unix/CMakeLists.txt file as its commands.
The structure of this file is (broadly)
      1 outer global structure/variables.
      2. INCLUDE (in place substitution) of platforms/unix/vm/build.cmake Which is basically what is done in the current CMakeVMMaker
      3. INCLUDE (in place substitution) of platforms/unix/vm/config.cmake. This handles testing the system and generating the config.h files on *nix.
      4. other stuff (packaging and stuff I glossed over)
There are ancilliary files used for testing and Macros, but that is the overall structure.


Now, the encouraging part is that I am porting 3 above into the CMakeVMMaker(Squeak) stuff and it is going through the config routine and giving me output (:
      

........
-- Check size of void *
-- Check size of void * - done
CMake Error: The source directory "CMAKE_BINARY_DIR/CMakeFiles/CMakeTmp" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error: The source directory "CMAKE_BINARY_DIR/CMakeFiles/CMakeTmp" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/filio.h
-- Looking for sys/filio.h - not found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for iconv.h
-- Looking for iconv.h - found
-- Looking for langinfo.h
-- Looking for langinfo.h - found
CMake Error at config.cmake:147 (TRY_COMPILE):
 try_compile unknown error.
Call Stack (most recent call first):
 CMakeLists.txt:88 (include)


-- Looking for libiconv_open in iconv
-- Looking for libiconv_open in iconv - not found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for _dyld_present
-- Looking for _dyld_present - not found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for __snprintf
-- Looking for __snprintf - not found
-- Looking for tzset
-- Looking for tzset - found
-- Looking for timezone
-- Looking for timezone - found
-- Performing Test HAVE_TM_GMTOFF
-- Performing Test HAVE_TM_GMTOFF - Success
-- Looking for mmap
-- Looking for mmap - found
-- Configuring incomplete, errors occurred!
 
Which is good. I will be getting this cleaned and ported, but the gist is it is looking good for the requirements.



Then comes modifying the plugin generation such that each plugin contributes its own config.h (this is what Ian's code does. you do a find for cmake.config in the trunk directory and you will see the individual config inputs for the plugins)


Its getting close. If this goes well, I should have something releasable/repeatable and documented for people to poke around in next week.


cheers.


tty




*yes, I "should" have studied it earlier, but frankly, I did not have a good feel for CMake syntax or methods, so it was all greek to me. I have a better handle on CMake now.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20140705/af7c3838/attachment.htm


More information about the Vm-dev mailing list