-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[suitesparse] Fixing SuiteSparse_INCLUDE_DIRS
is not usable from the port.
#11945
Conversation
This is ready for review and merge. |
Hi @seanyen, in vcpkg, the cmake files generated by ports should be installed in VCPKG_PATH/installed/${TRIPLET}/share/${PORT} so that users can use the vcpkg toolchain to find them, which is by design. And by using vcpkg toolchain, I can use the port correctly. So I don't think we should |
@JackBoosY This is really interesting. What's your test case? I am using the I can share my setup for repro. Here is the # CMakeList.txt : CMake project for CMakeProject2, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.8)
project ("CMakeProject2")
find_package(suitesparse REQUIRED)
include_directories(${SuiteSparse_INCLUDE_DIRS})
add_executable (CMakeProject2 "CMakeProject2.cpp" "CMakeProject2.h")
target_link_libraries(CMakeProject2 ${SuiteSparse_LIBRARIES}) And here is the // CMakeProject2.cpp : Defines the entry point for the application.
//
#include <iostream>
#include "suitesparse/cs.h"
using namespace std;
int main()
{
cs_spfree(nullptr);
cout << "Hello CMake." << endl;
return 0;
} Without the fix, the Let me know if you see otherwise. |
I think you need to use |
My test case is:
Configure log:
|
@JackBoosY Thanks. You are talking about And I would say Vcpkg port should try best to keep the behavior supported by the upstream, instead of breaking it. |
@seanyen In general, the use of macros(such as So I don’t know where |
And that's what I patched. |
@seanyen If the suitesparese official does not accept this modification, I think it is difficult for us to accept this PR. |
Thanks. I think the main point is that some CMake variable ( The issue doesn't exist if I skip If you agree with me that And just for your information, we are the Microsoft Edge Robotics team (https://aka.ms/ros) and we are helping bootstrap the dependencies for ROS community on Windows ( |
SuiteSparse_INCLUDE_DIRS
is not usable from the port.
@vicroms Could you please review this PR? Thanks. |
@vicroms friendly ping. Any feedback? |
Thanks for the PR! |
The
suitesparse
exports a CMake variableSuiteSparse_INCLUDE_DIRS
, which is pointing to a non-existing location from this Vcpkg port. However this doesn't repro if I skip using Vcpkg and go directly build it from the upstream. There are some delta between Vcpkg port and the upstream.It turned out, in this
suitesparse
Vcpkg port, it moves itsCMake
config files intoshare/suitesparse/
fromlib/cmake/suitesparse-xxx
byvcpkg_fixup_cmake_targets
. However, the config file computes the installed root by assuming it is underlib/cmake/suitesparse-xxx
, and this produces an unusable CMake config file in Vcpkg port.This pull request is to fix up the computation logic to accommodate the new location (
share/suitesparse/
) by Vcpkg port.