[CMake] Testing for SSE and adding appropriate Compile options

Michael Jackson mike.jackson at bluequartz.net
Fri Sep 25 16:51:21 EDT 2009


Nope.
    I get something like
  /G";"/arch:SSE2  as part of the command line options that are set in  
the MSVC solution.


_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio

On Sep 25, 2009, at 4:30 PM, Tyler Roscoe wrote:

> On Fri, Sep 25, 2009 at 01:57:26PM -0400, Michael Jackson wrote:
>> set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-msse3")
>> set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-msse3")
>>
>> for NON MSVC compilers and
>>
>> set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:SSE2")
>> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
>>
>> for MSVC compilers. The problem seems to be that, at least on windows
>> that an extra ";" is also added, which makes sense as that is how
>> CMake handles the concatenation of lists. So how best to append to  
>> the
>> CMAKE_C_FLAGS?
>
> Does it work if you just drop the quotes from the second half of the
> set()?
>
>> set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} /arch:SSE2)
>
> or, slightly more pedantically:
>
>> set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "/arch:SSE2")
>
> ?
>
> tyler



More information about the CMake mailing list