-
Notifications
You must be signed in to change notification settings - Fork 72
Build with CMake #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- script: echo Hello, world! | ||
displayName: 'Run a one-line script' | ||
- powershell: "& vcpkg.exe install cpprestsdk cpprestsdk:x64-windows --vcpkg-root ./submodules/vcpkg" | ||
displayName: vcpkg install dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include this beforeBuild steps, extra cMakeRunArgs and the like for each OS in the README.md?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also be good to include instructions to run git submodule update --init
and whatever build scripts we decide to add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh duh, I meant to add a readme...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y'know what's even better than a README (though there should be one as well)? build.cmd
;)
Added @aspnet/build since they should have some awareness of what's going on here ;). As a reminder, this client does not ship in binary form so the only thing we need here is a public PR/ |
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_LDFLAGS}") | ||
|
||
find_package(cpprestsdk CONFIG REQUIRED) | ||
set(CPPREST_LIB "cpprestsdk::cpprest") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent 24 minutes building/installing the cpprestsdk on my mac using ./submodules/vcpkg/vcpkg install cpprestsdk
(thanks C++/Boost), but when I run cmake, I get the following error:
shalter@halter73-mbp build.Release (brecon/cmake% u=)$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../submodules/vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_TESTING=1 -DCMAKE_BUILD_TYPE=Release
CMake Error at CMakeLists.txt:18 (find_package):
Could not find a package configuration file provided by "cpprestsdk" with
any of the following names:
cpprestsdkConfig.cmake
cpprestsdk-config.cmake
Add the installation prefix of "cpprestsdk" to CMAKE_PREFIX_PATH or set
"cpprestsdk_DIR" to a directory containing one of the above files. If
"cpprestsdk" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
See also "/Users/shalter/source/aspnet/SignalR-Client-Cpp/CMakeFiles/CMakeOutput.log".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same problem :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see the vcpkg folder on either (or both) of your machines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in the submodules/vcpkg directory? Mine is just what's in https://github.com/Microsoft/vcpkg/tree/d1110ceb7feb527ac58f274239d435e32dca4b84 without changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a bare minimum you should have a new file vcpkg
that's runnable on your machine. But more importantly I'm looking for the submodules/vcpkg/installed folder.
@@ -0,0 +1,201 @@ | |||
Apache License |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pilchie Could you verify that this is the correct License file?
Copied it from https://github.com/aspnet/AspNetCore
@halter73 @anurse @mikaelm12 |
@@ -3,3 +3,41 @@ | |||
This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at https://github.com/aspnet/AspNetCore. | |||
|
|||
Use https://github.com/aspnet/AspNetCore/issues for issues with this project. | |||
|
|||
### Build on Windows ### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should mention dependencies that need to be installed on non-macOs platform like cmake for Windows and cmake/"build-essentials"/gcc/g++ on linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to gather that info and improve the readme at a later time.
I wanted to approve this last night, but I couldn't get the cpprestsdk installed on my Windows machine. Here's the output:
And here's the contents of boost-system\build-x86-windows-rel-out.log:
I don't have VS 2017 installed. Do you think that's the problem? I do have VS 2019 RTM and Preview installed. Now they're both even on the system/C drive. |
I installed VS 2017 and still see the same issue. |
I tried this on another Windows PC with VS 2017 and 2019. I was able to install the cpprestsdk (don't know why though), but I got stuck on the first cmake command:
Maybe we should try building this repo on a fresh VM (could this would be a good use for the new windows 10 sandbox?), so we know what the actual dependency. Building worked fine on my macOS and linux machines though. |
It looks like the issue with installing the cpprestsdk on windows can be fixed by updating vcpkg. |
I don't think VS2017 is required, however if you have 2019 you might need to install the v141 toolset. When you installed VS2017 did you follow the message from the warning? "warning: Did not find command for MSVC toolset. If you have Visual Studio 2017 installed you will need to specify the full path to the command, set VS150COMNTOOLS for your installation, or build from the 'Visual Studio Command Prompt for VS 2017'." |
No, because I was hoping VS2017 wouldn't be necessary. I can try it, but maybe we should just upgrade vcpkg instead. |
Fixes dotnet/aspnetcore#8723