Use
if (WIN32)
#do something
endif (WIN32)
or
if (UNIX)
#do something
endif (UNIX)
or
if (MSVC)
#do something
endif (MSVC)
or similar
More Related Contents:
- Possible causes for Boost not being found by CMake in certain situations?
- How to add “-l” (ell) compiler flag in CMake
- to_string is not a member of std, says g++ (mingw)
- How do I output coloured text to a Linux terminal?
- How do I make CMake output into a ‘bin’ dir?
- C++ : Catch a divide by zero error
- Cmake cannot find library using “link_directories”
- Define preprocessor macro through CMake?
- Getting started with OpenCV 2.4 and MinGW on Windows 7
- DSO missing from command line [duplicate]
- What is difference between sjlj vs dwarf vs seh?
- What is the idiomatic way in CMAKE to add the -fPIC compiler option?
- Detailed guide on using gcov with CMake/CDash?
- What is the difference between MinGW, MinGW-w64 and MinGW-builds?
- CMake: failed to run MSBuild command: MSBuild.exe
- Using CMake to generate Visual Studio C++ project files
- how to do static linking of libwinpthread-1.dll in mingw?
- Detect Windows or Linux in C, C++ [duplicate]
- What are good practices regarding shared libraries on Linux?
- How do I find the current system timezone?
- C++ Boost: undefined reference to boost::system::generic_category()
- Linking different libraries for Debug and Release builds in Cmake on windows?
- How to make reading from `std::cin` timeout after a particular amount of time
- How to detect IP address change programmatically in Linux?
- What is Linux’s native GUI API?
- c++ how to use select to see if a socket has closed
- C++ Class wrapper around fundamental types
- Check keypress in C++ on Linux
- How to get the username in C/C++ in Linux?
- How to assert if a std::mutex is locked?