I’m just starting out on setting up VCMI and can’t get a solution to build.
My setup: Windows 10 64bit with Visual Studio 2017 community
I have set up both the vcpg and vcmi folders on the root folder of my F: drive
I am following the instructions at https://wiki.vcmi.eu/How_to_build_VCMI_(Windows/Vcpkg) to set up for VS 2017 and have gotten to “Generate Solution for VCMI” with the cmake command line
"cmake …/source -DCMAKE_TOOLCHAIN_FILE=[VCPKG_DIR]/scripts/buildsystems/vcpkg.cmake -G “Visual Studio 15 2017 Win64"”
I get the error
F:\VCMI\build>cmake …/source -DCMAKE_TOOLCHAIN_FILE=[VCPKG_DIR]/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 15 2017 Win64"
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/CMakeDetermineSystem.cmake:100 (message):
Could not find toolchain file: [VCPKG_DIR]/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
– Configuring incomplete, errors occurred!
I have been working on this for a few hours now and can’t get past this point.
Does anyone know why this is happening? Any help would be much appreciated.
Hello!
You need to replace [VCPKG_DIR] with full or relative path to directory where you unpacked Vcpkg libraries package. So on my machine it’s for instance:
cmake ../source -DCMAKE_TOOLCHAIN_FILE=D:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 15 2017 Win64"
Keep in mind that ../source should be valid path to VCMI source code you cloned from git.
The updated instructions have cleared up where I was going wrong (thanks) but it appears the pre built package is missing some files as the build is failing due to some missing boost libraries.
F:\VCMI\build>cmake F:/VCMI/source -DCMAKE_TOOLCHAIN_FILE=F:/VCMI/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 15 2017 Win64"
-- The C compiler identification is MSVC 19.11.25507.1
-- The CXX compiler identification is MSVC 19.11.25507.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1879 (message):
Unable to find the requested Boost libraries.
Boost version: 1.64.0
Boost include path: F:/VCMI/vcpkg/installed/x64-windows/include
Could not find the following static Boost libraries:
boost_date_time
boost_filesystem
boost_locale
boost_program_options
boost_system
boost_thread
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Very interesting, might be related to recent CMake or something, I’ll test it today.
Probably I should add some debug output in our CMakeLists so it’s at least report CMake version.
Ok first of all while I suppose you just used latest CMake I updated our CMakeLists slightly. Now it’s should print more debug information so it’s easier to debug problems like that.
I have not used boost before this attempting to install the VCMI package and there are no system environment variables that mention boost.
I deleted and reloaded the source files.
I created and ran the debug.bat file and got the following result when run.
Running with trace output on.
Running with expanded trace output on.
CMake Error: The source directory “F:/VCMI/source” does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
I checked and there is no CMakeLists.txt in the F:/VCMI/source root folder.
Thanks. I’ll check the log now. Please try second instruction and see if workaround of adding set above find_package let you configure it successfully.
Problem is that SourceTree if you using it likely cloned master branch of VCMI that isn’t used for development, but for stable versions. For daily development we’re using another branch called develop and you need to switch your copy of repository to use it in order to build latest version.
So you need to:
Google for “SourceTree change branch” and learn how to do that.
Clone it again using proper command line Git and it’s will use proper branch by default.
I’ll certainly correct guide and I guess I’ll just remove that GUI tool recommendation because it’s certainly only make it harder to clone source code. E.g master is not even our default branch and standard command line git client obviously checkout develop by default.
In the CMakeLists.txt file from VCMI/source folder there are 2 lines that have find_package(Boost 1.48.0
at line 118 and line 153.CMakeLists.txt (12.4 KB)
You may want to leave the cmake gui instructions, just add to go to advanced options and select “develop” branch and I’m not sure but i also checked the box for recursive. I now have the correct files and will try to build.