Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Building for Windows with CMake ExternalProject_Add

This thread is locked; no one can reply to it. rss feed Print
Building for Windows with CMake ExternalProject_Add
Matthew Dalrymple
Member #7,922
October 2006
avatar

Has anyone successfully included and built allegro 5.x with ExternalProject_Add() in their project's CMake file?

To build my project, I like the idea of being able to take a fresh platform and just install the generic build tools (msbuild, gcc, etc.). I would then run CMake against the project, have it pull all the libraries it depends on, build them, and then build my project.

However, for Windows I am facing issues when using Visual Studio build tools 14.0 (VS2015). I can clone build Allegro 5 alone using the same cmake/msbuild command that I build my project with, but once I add Allegro to my CMakeLists.txt file as an ExternalProject, I fail with errors below.

Building Allegro 5 repository:
mkdir _build
pushd _build
cmake.exe -G "Visual Studio 14" ..
msbuild allegro.sln
popd

My project command:
mkdir _build
pushd _build
cmake.exe -G "Visual Studio 14" ..
msbuild domingoclient.sln
popd

#SelectExpand
1ExternalProject_Add( 2 allegro 3 4 GIT_REPOSITORY "https://github.com/liballeg/allegro5.git" 5 GIT_TAG "5.2.2.0" 6 7 UPDATE_COMMAND "" 8 PATCH_COMMAND "" 9 TEST_COMMAND "" 10)

#SelectExpand
2"C:\Users\matthew\repos\domingo_build\domingoclient.sln" (default target) (1) -> 3"C:\Users\matthew\repos\domingo_build\allegro.vcxproj.metaproj" (default target) (3) ->"C:\Users\matthew\repos\domingo_build\allegro.vcxproj" (default target) (4) -> 4(CustomBuild target) -> 5 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting 6 the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\matthew\repos\domingo_build\allegro-prefix\src\allegro-build\ZERO_CHECK.vcxproj] [C:\Users\matthew\repos\domingo_build\allegro.vcxproj] 7 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please 8install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\matthew\repos\domingo_build\allegro-prefix\src\allegro-build\ZERO_CHECK.vcxproj][C:\Users\matthew\repos\domingo_build\allegro.vcxproj]

=-----===-----===-----=
I like signatures that only the signer would understand. Inside jokes are always the best, because they exclude everyone else.

SiegeLord
Member #7,827
October 2006
avatar

The error seems to suggest that it's defaulting to an older toolchain, so adding -T v140_xp alongside the generator option to the CMake invocation should fix things.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Matthew Dalrymple
Member #7,922
October 2006
avatar

It's weird that I can build it alone, just not through ExternalProject_Add().

I tried what you suggested, and that still didn't fix it.

I'll try and dive deep on this and figure it out; otherwise I'll just make a step that pulls the binaries on the github (I think that you maintain).

Thanks for the pointers though :).

=-----===-----===-----=
I like signatures that only the signer would understand. Inside jokes are always the best, because they exclude everyone else.

Go to: