--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,7 +46,7 @@
 set(MathGL_INSTALL_LIB_DIR "lib" CACHE PATH "Installation directory for libraries")
 set(MathGL_INSTALL_BIN_DIR "bin" CACHE PATH "Installation directory for executables")
 set(MathGL_INSTALL_INCLUDE_DIR "include" CACHE PATH "Installation directory for headers")
-if(WIN32 AND NOT CYGWIN)
+if(MSVC)
 	set(DEF_INSTALL_CMAKE_DIR cmake)
 else()
 	set(DEF_INSTALL_CMAKE_DIR lib/cmake/mathgl2)
@@ -316,11 +316,11 @@
 	set(MGL_DOC_PATH "${CMAKE_INSTALL_PREFIX}/share/doc/mathgl")
 	set(MGL_MAN_PATH "${CMAKE_INSTALL_PREFIX}/share/man")
 	set(MGL_INFO_PATH "${CMAKE_INSTALL_PREFIX}/share/info")
-if(NOT WIN32)
+if(NOT MSVC)
 	set(MGL_FONT_PATH "${MGL_DATA_PATH}/fonts")
-else(NOT WIN32)
+else()
 	set(MGL_FONT_PATH "${CMAKE_INSTALL_PREFIX}/fonts")
-endif(NOT WIN32)
+endif()
 
 include(CheckFunctionExists)
 include(CMakePushCheckState)
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -4,13 +4,13 @@ if(enable-dep-dll)
 	install(SCRIPT install-deps.cmake)
 endif(enable-dep-dll)
 
-if(WIN32)
+if(MSVC)
    set(dest ${CMAKE_INSTALL_PREFIX})
 	install(FILES ${CMAKE_SOURCE_DIR}/scripts/FindMathGL2.cmake DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME mathgl2-config.cmake)
-else(WIN32)
+else(MSVC)
    set(dest ${MathGL_INSTALL_LIB_DIR}/cmake/mathgl2/)
 	install(FILES ${CMAKE_SOURCE_DIR}/scripts/FindMathGL2.cmake DESTINATION ${MathGL_INSTALL_LIB_DIR}/cmake/mathgl2/ RENAME mathgl2-config.cmake)
-endif(WIN32)
+endif(MSVC)
 
 #export(TARGETS MathGLTargets FILE "${PROJECT_BINARY_DIR}/MathGL2Targets.cmake")
 export(PACKAGE MathGL2)
