OS specific instructions in CMAKE: How to?

The Solution to OS specific instructions in CMAKE: How to? is


Use

if (WIN32)
    #do something
endif (WIN32)

or

if (UNIX)
    #do something
endif (UNIX)

or

if (MSVC)
    #do something
endif (MSVC)

or similar

see CMake Useful Variables and CMake Checking Platform

~ Answered on 2012-02-06 12:57:00


Most Viewed Questions: