[cmake-developers] flags if target is add_executable( WIN32 )

David Cole david.cole at kitware.com
Tue Aug 7 14:23:28 EDT 2012


No, but it's easy to do the inverse:

if(is_win32)
  set(exe_type WIN32)
  // flag adjustment either here...
else()
  set(exe_type "")
  ...
endif()

add_executable(myExe ${exe_type} ${source_files})

if(is_win32)
  // or here with setting target properties...
else()
  ...
endif()


On Fri, Aug 3, 2012 at 9:41 PM, J Decker <d3ck0r at gmail.com> wrote:
> There's no way to set additional flags to compile if the
> add_exectuable is WIN32 or console?
> --
>
> 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



More information about the cmake-developers mailing list