[Cmake] Newbie Questions
Bill Hoffman
bill.hoffman at kitware.com
Fri Jan 17 09:42:49 EST 2003
You can specify the compiler and flags with environment variables:
CXX=cxx-compiler
CC=c-compiler
CFLAGS=default-c-flags
CXXFLAGS=default-cxx-flags
This will seed the cache with those values.
We do not directly support asm files, but you could do it with a custom command
and some macros. Java is supported in this way right now.
It is a bit complicated, but the example is in Modules/CMakeJavaCompiler.cmake.in
Basically, for each .s file you will need an ADD_CUSTOM_COMMAND.
You can do this in a FOREACH, and a MACRO that takes the list of .s files.
-Bill
At 11:05 PM 1/15/2003 -0500, Matthew Gilbert wrote:
>All,
>
>I have a few questions on getting started with cmake.
>
>First, is there an easy way to have a compiler prefix? Right now I'm overwriting CMAKE_C_COMPILER and family in my lists file. However, these of course don't show up in ccmake. Is there an easy way to do this? I am trying to support cross compiling easily (without having to edit every executable line in the cache file). A related question is how can I set some default compiler flags depending on my architecture. I'd like to set defaults for CMAKE_C_FLAGS but these end up being ignored (or at least don't show up in ccmake, I can't remember which). I'd much rather have some basic defaults as opposed to distributing a bunch of cache files. I'd also like these defaults to show up in ccmake so that a user can see what I've set.
>
>Also, how can I support assembly files? In 1.4.6 cmake treats my .s files in my ADD_EXECUTABLE line just like my .c files. But in 1.6beta1 it complains about an unknown extension. I've tried setting up a custom target and custom build commands but I can't figure out how to get my custom target to depend on any of my objects. Again, what should I do here and what is going to be the behavior in the future (1.4.6 vs. 1.6beta1).
>
>I appreciate any help. Thanks in advance. -Matt Gilbert
>
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake
More information about the CMake
mailing list