Message: Re: cmake additional compiler flags Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Re: cmake additional compiler flags 

Forum: Installation and Configuration
Re: None cmake additional compiler flags (Tom Roberts)
Date: 22 Feb, 2012
From: Ben Morgan <Ben Morgan>

Hi Tom

On Wed, 22 Feb 2012 17:56:14 GMT, Tom Roberts wrote:
> I am building Geant.9.5 using cmake -G "Unix Makefiles" on Windows Xp
> and Cygwin. I want to build via make, just as on Linux and Mac; this
> program builds and runs fine on both Linux and Mac.
> 
> Without visualization, and with the edits described in Problem 1283, it
> passes all my regression tests. The compiler is VC++ express edition
> 2008 (just as I have been building earlier releases).
> 
> In order to build the Open Inventor driver using Coin3D, I need to pass
> these options to the VC++ compiler (cl): -DCOIN_NOT_DLL -DSOWIN_NOT_DLL
> 
> Unfortunately, neither CPPFLAGS nor CXXFLAGS does this when passed to
> make.
> 
> How can I pass additional flags to the compiler, while using the cmake
> system? During either cmake or make will do.
> 
> (For now I have edited the Coin3D source to define them, but that is not
> a viable long-term option.)
> 

In CMake, CXXFLAGS and others are only used at configuration time, so running CMake as:

CXXFLAGS="-DCOIN_NOT_DLL -DSOWIN_NOT_DLL" cmake OTHERARGS

Should prepend the flags to the others used. Note that this will only work the first time you run, so if you have already run CMake you will need to either remove the CMakeCache.txt file and reconfigure, create a new build directory and start from scratch, or run ccmake/cmake-gui, make the advanced options visible (press 't' in ccmake, tick the 'Advanced tickbox in cmake-gui) and then edit the CMAKE_CXX_FLAGS variable.

Just to also note that the Cygwin plus MSVC combination is not tested or supported at the moment, though obviously we'd be interested to hear if you get it working and any issues like this.

Cheers,

Ben.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: cmake additional compiler flags   (Tom Roberts - 24 Feb, 2012)
(_ Question: Re: cmake additional compiler flags   (Ben Morgan - 24 Feb, 2012)
(_ None: Re: cmake additional compiler flags   (Tom Roberts - 27 Feb, 2012)
 Add Message Add Message
to: "Re: cmake additional compiler flags"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]