Hi All,

We build on an IBM AIX system with the VisualAge compilers. We have some Fortran code that depends on being preprocessed by the C preprocessor. Like most Fortran compilers, IBM's Fortran compiler automatically runs cpp on *.F files.

It appears that add_definitions() places -DWHATEVER in the compile command line on all Unix variants. Unfortunately, IBM's Fortran compiler uses -D as a compile flag for something other than adding a preprocessor definition. In order to pass a preprocessor definition, you have to use -WF,-DWHATEVER. So, if you call add_definitions() anywhere in the tree above a Fortran target, you end up with a compile error since CMake adds -D to the compile line and IBM expects this to mean something else.

I'm trying to figure out the best way to deal with this problem, and whether or not this is a bug in CMake's implementation on VisualAge compilers.

Does anyone have a suggestion? If it is a bug, is there a workaround that we can use in the interim? Also, if it is a bug, what would be involved in fixing it, and is there any way we can assist in either fixing it or testing a possible fix?

Thanks,
Will

--
Will Dicharry
Software Developer
Stellar Science Ltd Co

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to