Responses inline...I'm reposting this to the CMake mailing list so someone can correct me if I'm wrong, it looks like your message went only to me.
John R. Cary wrote:
Will Dicharry wrote:John R. Cary wrote:which is basically Linux. Building a project with pgcc/pgCC. All flags are empty:CMAKE_CXX_COMPILER /opt/pgi/8.0.4/linux86-64/8.0-4/bin/pgCC CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASECMAKE_CXX_FLAGS_RELWITHDEBINFO Where should I add these?For the XT4, the CNL backend no longer requires a cross compile. We had a discussion on the list about this last month, and for setting the compilers I believe the consensus was to either:1. Set them as environment variables. CMake will check the value of the environment variables CC, CXX, and FC for the names of the C, C++, and Fortran compilers respectively.2. Use cmake -C toThanks, Will. I am getting the compiler set using 'CC=pgcc CXX=pgCC' in my environment, but then the FLAGS variables are empty.Another question: The default builds seem to be DEBUG, MINSIZEREL, RELEASE, RELWITHDEBINFO. Suppose I wanted to define a new kind of build, e.g., PERFORMANCE. How can I go about doing this?When using the makefile generator, you can define a new build type by setting it in the CMAKE_BUILD_TYPE variable and defining language flags for that type, so you could do something like:set( CMAKE_BUILD_TYPE PERFORMANCE ) set( CMAKE_C_FLAGS_PERFORMANCE "-O3" ) set( CMAKE_CXX_FLAGS_PERFORMANCE "-O3" )take a look at http://www.cmake.org/Wiki/CMake_Useful_Variables in the CMAKE_BUILD_TYPE section.Hope this helps,It helps alot! Perhaps I just need to be directed to some reading material, even thoughI have been googling quite a bit.I would like to reuse these flags over many projects, and so I am hoping I can put them in a file in my CMake subdir, which is actually an svn external, and be reusedacross multiple projects. From my short experience with CMake, it seems that once one has determinedan OS/Compiler option, cmake looks for <compiler>.cmake under Modules/Compiler,then for <os>-<compiler>.cmake under Modules/Platform, with each able to add to or overwrite the previous. Is that correct?
I /think/ that is correct, although someone more familiar with CMake's startup procedure may be able to correct me.
If I want to override, then I assume I could add a file <os>-<compiler>.cmake in a directory of my own choosing, but then I have to tell cmake where to look for my override files.Is that correct?
I think the best way to override flags is to do it from your CMakeLists.txt project files (or through files included by them so you can use your externals scheme). The <os>-<compiler> files are used to initialize the flags, you can modify them at configure time from your CMakeLists.txt files. If you want to override them completely, you can do something like
set( CMAKE_CXX_FLAGS_<CONFIG> "-f1 -f2..." )
If you want to append to what CMake starts off with, you can do
set( CMAKE_CXX_FLAGS_<CONFIG> "${CMAKE_CXX_FLAGS_<CONFIG>} -f1 -f2..." )
How to I tell cmake that I want it to look in another directory? Thanks.....John
-- Will Dicharry Software Developer Stellar Science Ltd Co
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
