From 4c9c6aa2edad7cf0a3b9fb74b1f293283715be5c Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 15 Feb 2008 20:01:53 +0000
Subject: [PATCH] move the release/debug test in variables.msvc (+ rewrote in a
 different way)

---
 Makefile       |  9 ++-------
 variables.msvc | 21 +++++++++++++--------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index a39a236198..fe5b9f78df 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.466 2008-02-15 15:33:31 miegroet Exp $
+# $Id: Makefile,v 1.467 2008-02-15 20:01:53 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -84,12 +84,7 @@ install-lib: lib
 	rm -f ${includedir}/gmsh/*
 	cp -f ${GMSH_API} ${includedir}/gmsh
 	mkdir -p ${libdir}
-ifeq ($(OPTION),/EHsc /nologo /GR /MTd)
-	cp -f bin/libGmsh${LIBEXT} ${libdir}/libGmsh${LIBEXTDEBUG}
-endif
-ifeq (${OPTION},/EHsc /nologo /GR /MT)
-	cp -f bin/libGmsh${LIBEXT} ${libdir}/libGmsh${LIBEXTRELEASE}
-endif
+	cp -f bin/libGmsh${LIBEXT} ${libdir}/libGmsh${LIBSUFFIX}${LIBEXT}
 
 embed:
 	@if [ -r ../getdp2/contrib/gmsh/Makefile ]; then \
diff --git a/variables.msvc b/variables.msvc
index fbd59e7a70..8fe71f794a 100644
--- a/variables.msvc
+++ b/variables.msvc
@@ -1,8 +1,8 @@
 # This is a pre-filled variables file for building a blackbox version
-# of Gmsh with Microsoft Visual C++ (MSVC). 
+# of Gmsh with Microsoft Visual C++ (MSVC).
 #
-# This has been tested with MSVC 2003.NET and MSVC 2008. 
-# See doc/README.msvc for building instructions.
+# This has been tested with MSVC 2003 and MSVC 2008.  See
+# doc/README.msvc for building instructions.
 
 # OS and host
 UNAME=WIN32MSVC
@@ -10,11 +10,18 @@ HOSTNAME=localhost
 
 # The names of the C and C++ compilers
 CC=cl
-OPTION=/EHsc /nologo /GR /MT
-# Add /MLd for single-thread debug mode
+CXX=/EHsc /nologo /GR /MT
+
+# Use /MLd for single-thread debug mode
 #     /MTd for multi-thread debug mode
+#     /MT for multi-thread release mode
 
-CXX=${CC} ${OPTION}
+# append different suffix for release or debug version of library
+ifneq (,${findstring MTd,${CXX}})
+  LIBSUFFIX=_d
+else
+  LIBSUFFIX=_r
+endif
 
 # increase stack size to 16Mb to avoid stack overflows in recursive 
 # tet classification for large 3D Delaunay grids
@@ -47,8 +54,6 @@ DASH=/
 # The extension to use for object files, libraries and executables
 OBJEXT=.obj
 LIBEXT=.lib
-LIBEXTRELEASE=_r.lib
-LIBEXTDEBUG=_d.lib
 EXEEXT=.exe
 
 # Installation directories
-- 
GitLab