On Thu, Mar 24, 2011 at 11:31 AM, Yuri Timenkov <[email protected]> wrote:
> Use COMPILE_FLAGS target property. Like this:
>
> set_target_properties(Exec2 PROPERTIES COMPILE_FLAGS "/flag1 /flag2")
>
> You can see full list of properties in CMake documentation. Note that
> compiler flags may be also set for particular source file with
> set_source_files_properties command.

Hi Yuri,

I tried a CMakeLists.txt file like this:

cmake_minimum_required(VERSION 2.6)
PROJECT(SetTargetProperties)
ADD_EXECUTABLE(SetTargetProperties SetTargetProperties.cxx)
set_target_properties(SetTargetProperties PROPERTIES COMPILE_FLAGS "-DUNIX")

Then I ran:

make VERBOSE=1

and I don't see anything in the output that indicates that this flag
was passed, but I also don't see the call to g++ at all. How would I
check that this worked correctly?

Thanks for your help so far,

David
_______________________________________________
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