EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Detect VC++ version in Makefile?
From: "Johnson, Andrew N." <[email protected]>
To: "Rivers, Mark L." <[email protected]>, EPICS Tech-Talk <[email protected]>
Date: Sun, 29 Jul 2018 17:50:25 +0000
Hi Mark,

There are several ways you could do this directly using GNUmake:
1. Use '$(shell cl -help)' and extract the version number that is included in the compiler's help message, although that's a bit messy since there is lots of other stuff in it too. See Torsten's message for ideas there.

2. Look at the $(VSINSTALLDIR) variable set by the vcvarsall.bat file, which (assuming it's still present in the later versions than I checked) ends with the version of Visual Studio (10.0 etc.). This isn't quite as hard as #1 but there is still other stuff in the string.

3. As part of the build process, compile and run a short C program that prints the desired v100/v120/v140 string (or better still the complete library name) that you're looking for based on the value of _MSC_VER, then have GNUmake use $(shell ...) to run that program and provide the name of the library to be linked with:
    PROD_LIBS_WIN32 += $(shell flyCaptureLibs.exe)
See https://sourceforge.net/p/predef/wiki/Compilers/ for the different _MSC_VER macro values.

I think #3 may be the simplest to understand; you have to provide a dependency rule to ensure the program has been built before GNUmake links your PROD. I can help you with this next week if necessary, but it should just be something like:
    $(PROD): flyCaptureLibs.exe

You shouldn't have to specify flyCaptureLibs.exe as build target, the above dependency should be enough to build it on demand as long as the source filename is included in SRCS.

HTH,

- Andrew

________________________________________
From: [email protected] <[email protected]> on behalf of Mark Rivers <[email protected]>
Sent: Sunday, July 29, 2018 9:00:04 AM
To: EPICS Tech-Talk
Subject: Detect VC++ version in Makefile?

Folks,

I have a vendor Windows SDK where the required name of the library depends on the version of VC++.

I am currently requiring manual edits of the EPICS Makefile to change the name of the LIB file depending on VS version.

# Add locally compiled object code
PROD_LIBS += pointGrey
# Use this line for Visual Studio 2010
#PROD_LIBS_WIN32 += FlyCapture2_v100
# Use this line for Visual Studio 2013
#PROD_LIBS_WIN32 += FlyCapture2_v120
# Use this line for Visual Studio 2015
PROD_LIBS_WIN32 += FlyCapture2_v140

Does anyone have a mechanism to detect this automatically in the Makefile so this manual editing is not needed?

Thanks,
Mark


Replies:
RE: Detect VC++ version in Makefile? Freddie Akeroyd - UKRI STFC
References:
Detect VC++ version in Makefile? Mark Rivers

Navigate by Date:
Prev: Re: Detect VC++ version in Makefile? Torsten Bögershausen
Next: RE: Detect VC++ version in Makefile? Freddie Akeroyd - UKRI STFC
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Detect VC++ version in Makefile? Torsten Bögershausen
Next: RE: Detect VC++ version in Makefile? Freddie Akeroyd - UKRI STFC
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
ANJ, 29 Jul 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·