tag:help.appveyor.com,2012-11-13:/discussions/problems/4344-cmake-failing-to-generate-visual-studio-2015-projectAppVeyor: Discussion 2018-08-25T02:05:16Ztag:help.appveyor.com,2012-11-13:Comment/394526022016-03-21T18:04:57Z2016-03-21T18:04:57ZCMake failing to generate Visual Studio 2015 project.<div><p>Make sure the project builds on image with Visual Studio 2015 by
adding this to appveyor.yml:<br>
image: Visual Studio 2015</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/394526022016-03-21T19:05:31Z2016-03-21T19:09:14ZCMake failing to generate Visual Studio 2015 project.<div><p>Thanks Feodor, that solved the original issue. Now there's a new
error related to locating Boost, even though I am providing the
path to it in the CMake command line parameters which worked when I
had a Visual Studio 2013 image and I haven't changed anything else
besides switching to the Visual Studio 2015 image. There must be
some differences with this Visual Studio 2015 image vs. the Visual
Studio 2013 image besides Visual Studio.</p>
<p>Note: Boost is present in C:\Boost on the worker (I have a
custom script that downloads it, builds it and puts it there).
Libraries reside in C:\Boost\lib. Includes are in
C:/Boost/include/boost-1_55.</p>
<p>Here is the error:<br>
Generating Visual Studio solution and project files...<br>
-- The C compiler identification is MSVC 19.0.23506.0 -- The CXX
compiler identification is MSVC 19.0.23506.0 -- Check for working C
compiler using: Visual Studio 14 2015 Win64 -- Check for working C
compiler using: Visual Studio 14 2015 Win64 -- works -- Detecting C
compiler ABI info -- Detecting C compiler ABI info - done -- Check
for working CXX compiler using: Visual Studio 14 2015 Win64 --
Check for working CXX compiler using: Visual Studio 14 2015 Win64
-- works -- Detecting CXX compiler ABI info -- Detecting CXX
compiler ABI info - done -- Detecting CXX compile features --
Detecting CXX compile features - done -- not define build type, set
to release cmake.exe : CMake Error at C:/Program Files
(x86)/CMake/share/cmake-3.4/Modules/FindBoost.cmake:1247
(message):<br>
At C:\Projects\MyProject\cmake_generate.ps1:2 char:1<br>
+ & cmake -G "Visual Studio 14 2015 Win64"
-DBOOST_ROOT:STRING=C:\Boost -DBOOST_VE ... +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (CMake Error at ...1247
(message)::String) [], RemoteException + FullyQualifiedErrorId :
NativeCommandError</p>
<p>Unable to find the requested Boost libraries.</p>
<p>Boost version: 1.55.0</p>
<p>Boost include path: C:/Boost/include/boost-1_55</p>
<p>Could not find the following static Boost libraries:</p>
<pre>
<code> boost_system
boost_date_time
boost_random</code>
</pre>
<p>No Boost libraries were found. You may need to set
BOOST_LIBRARYDIR to the directory containing Boost libraries or
BOOST_ROOT to the location of Boost. Call Stack (most recent call
first):<br>
CMakeLists.txt:23 (find_package)</p>
<p>-- Found OpenSSL:
optimized;C:/OpenSSL-Win64/lib/VC/ssleay32MD.lib;debug;C:/OpenSSL-Win64/lib/VC/ssleay32MDd.lib;optimized;C:/OpenSSL-Win64/lib/VC/libeay32MD.lib;debug;C:/OpenSSL-Win64/lib/VC/libeay32MDd.lib
(found version "1.0.2 e")<br>
-- Configuring incomplete, errors occurred! See also
"C:/Projects/MyProject/CMakeFiles/CMakeOutput.log".</p></div>labstag:help.appveyor.com,2012-11-13:Comment/394526022016-03-21T19:14:47Z2016-03-21T19:14:47ZCMake failing to generate Visual Studio 2015 project.<div><p>What path to boost do you set? It should be similar to VS 2013
image but has you tried adding 'dir' command to check if the folder
exists?</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/394526022016-03-21T19:24:59Z2016-03-21T19:30:57ZCMake failing to generate Visual Studio 2015 project.<div><p>The path to boost is set in the cmake command:</p>
<p>cmake -G "Visual Studio 14 2015 Win64"
-DBOOST_ROOT:STRING=C:\Boost -DBOOST_VER:STRING=1.55.0 ./</p>
<p>I know your images already have boost in C:\Libraries\boost*,
but I do this because I need a specific version of boost (1.55) and
I have a script that downloads and installs it to the folder
specified.</p>
<p>C:\Boost folder does exist, as log shows it is building
successfully (and this same build script works with Visual Studio
2013 image selected). Here's an excerpt from the log:</p>
<p>common.copy C:\Boost\lib\libboost_system-vc120-mt-1_55.lib<br>
bin.v2\libs\system\build\msvc-12.0\release\address-model-64\link-static\threading-multi\libboost_system-vc120-mt-1_55.lib<br>
1 file(s) copied. ...updated 10832 targets...</p>
<p>Thanks for looking at this and for your very prompt replies.</p></div>labstag:help.appveyor.com,2012-11-13:Comment/394526022016-03-21T19:34:00Z2016-03-21T19:34:00ZCMake failing to generate Visual Studio 2015 project.<div><p>Is C:\boost the one you are installing yourself during the
build? I don't have much experience in C++, so if there is anything
missing on build worker - let me know.</p>
<p>-Feodor</p>
<pre>
<code>_____________________________</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/394526022016-03-21T21:27:03Z2016-03-21T21:27:22ZCMake failing to generate Visual Studio 2015 project.<div><p>Hi Feodor,</p>
<p>I figured it out. Boost was building for Visual Studio 12.0 /
2013 with the following command-line parameter passed to bjam:</p>
<p>--toolset=msvc-12.0</p>
<p>I had to edit my boost install scripts and change that parameter
to</p>
<p>--toolset=msvc-14.0</p>
<p>Thanks again for your help earlier!</p></div>labstag:help.appveyor.com,2012-11-13:Comment/394526022016-03-21T21:28:27Z2016-03-21T21:28:27ZCMake failing to generate Visual Studio 2015 project.<div><p>Cool, thanks for the update!</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/394526022016-03-22T00:43:32Z2016-03-22T00:43:32ZCMake failing to generate Visual Studio 2015 project.<div><p>Hi again Feodor,</p>
<p>I hate to bother you, but would you be able to update CMake on
build workers to v3.5.0?</p>
<p>I'm trying to update an old project to the latest and greatest
of everything, so I decided to change my script to download the
latest Boost (1.60.0) and build it, but CMake 3.4.0 cannot find
Boost 1.60.0 properly even when pointed to the right BOOST_ROOT
location.</p>
<p>I replicated the issue locally on my machine, and it was solved
by updating to CMake version 3.5.0.</p></div>labstag:help.appveyor.com,2012-11-13:Comment/394526022016-03-22T00:50:03Z2016-03-22T00:50:03ZCMake failing to generate Visual Studio 2015 project.<div><p>I've added a new issue to install CMake over this week: <a href="https://github.com/appveyor/ci/issues/706">https://github.com/appveyor/ci/issues/706</a></p>
<p>In the meantime, you can download it during the build, unpack
and modify PATH - it's available in the form of Zip archive:
<a href="https://cmake.org/download/">https://cmake.org/download/</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/394526022016-03-28T17:14:42Z2016-03-28T17:15:32ZCMake failing to generate Visual Studio 2015 project.<div><p>Thanks Feodor! I implemented your suggested stop-gap which
worked, but I see you've sinced upgraded CMake to 3.5.0 so I should
be able to remove it now. Wow, that was fast. You're really on top
of things!</p>
<p>Btw, this little adventure put the spotlight on potential
differences in my build scripts which would cause the build to fail
if I switch images from VS 2013 to VS 2015 and vice-versa. I was
thinking it might be a good idea to have an environment variable
that scripts can check to see what image / build environment is
configured in AppVeyor. Or is there something like this
already?</p></div>labstag:help.appveyor.com,2012-11-13:Comment/394526022016-03-28T17:25:15Z2016-03-28T17:25:15ZCMake failing to generate Visual Studio 2015 project.<div><p>Thanks for the update!</p>
<p>To detect if it's VS 2015 image you can just check for directory
<code>C:\Program Files (x86)\MSBuild\14.0</code> existence.</p>
<pre>
<code>IF EXIST "C:\Program Files (x86)\MSBuild\14.0" SET VS2015IMAGE=true</code>
</pre></div>Feodor Fitsner