Thanks, I’ll give that a try.
Mar
Sent from my iPhone
> On Jul 29, 2018, at 6:51 PM, Freddie Akeroyd - UKRI STFC <[email protected]> wrote:
>
> Hi Mark,
>
> If you don't need to worry about Visual Studio versions earlier than 2010 then you could use the VisualStudioVersion environment variable, this was introduced in Visual Studio 2012 so if the variable doesn't exist you could then assume 2010
>
>
> ifdef VisualStudioVersion
> VSNAME=v$(subst .,,$(VisualStudioVersion))
> else
> VSNAME=v100
> endif
>
>
> Regards,
>
> Freddie
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Johnson, Andrew N.
> Sent: 29 July 2018 18:50
> To: Rivers, Mark L.; EPICS Tech-Talk
> Subject: Re: Detect VC++ version in Makefile?
>
> 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
>
- References:
- Detect VC++ version in Makefile? Mark Rivers
- Re: Detect VC++ version in Makefile? Johnson, Andrew N.
- RE: Detect VC++ version in Makefile? Freddie Akeroyd - UKRI STFC
- Navigate by Date:
- Prev:
Aerotech Ensemble coordinated motion Douglas Henrique C . de Araújo
- Next:
Re: EtherCAT newbie question Jeong Han Lee
- 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
<2018>
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: Detect VC++ version in Makefile? Freddie Akeroyd - UKRI STFC
- Next:
Some questions from a first-time driver author Zik Saleeba
- 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
<2018>
2019
2020
2021
2022
2023
2024
|