-
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
[liblas] Fix missing dependency to boost-foreach #30950
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/cmake/liblas-config-version.cmake.in b/cmake/liblas-config-version.cmake.in | ||
index f9b7c7cb..5dd2aba1 100644 | ||
--- a/cmake/liblas-config-version.cmake.in | ||
+++ b/cmake/liblas-config-version.cmake.in | ||
@@ -22,7 +22,7 @@ elseif (MSVC AND NOT MSVC_VERSION STREQUAL "@MSVC_VERSION@") | ||
# Reject if there's a mismatch in MSVC compiler versions | ||
set (REASON "_MSC_VER = @MSVC_VERSION@") | ||
set (PACKAGE_VERSION_UNSUITABLE TRUE) | ||
-elseif (NOT CMAKE_CROSSCOMPILING STREQUAL "@CMAKE_CROSSCOMPILING@") | ||
+elseif (0) | ||
# Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING} | ||
set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@") | ||
set (PACKAGE_VERSION_UNSUITABLE TRUE) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index d246a88d..634157c0 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -190,11 +190,13 @@ if(WIN32) | ||
endif(WIN32) | ||
|
||
find_package(Threads) | ||
-find_package(Boost 1.42 COMPONENTS program_options thread system iostreams filesystem REQUIRED) | ||
+find_package(Boost 1.42 COMPONENTS iostreams program_options serialization thread REQUIRED) | ||
+ | ||
+# The following header-only and their dependencies are additionally required, | ||
+# but cannot be explicitly requested via find_package, so make sure they exists: | ||
+# - foreach interprocess lambda property_tree uuid | ||
|
||
-if(Boost_FOUND AND Boost_PROGRAM_OPTIONS_FOUND) | ||
- include_directories(${Boost_INCLUDE_DIRS}) | ||
-endif() | ||
+include_directories(${Boost_INCLUDE_DIRS}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is certainly wrong, it should be added by a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. libLAS requires still just CMake 2.8.12, so you imported targets are still not supported (requires CMake 3.5). They are doing later As the change related There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally for the patch we are tracking we should be making the minimum change that makes it work inside vcpkg, unless we are applying an exact change upstream did. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is the same patch as I commited here: libLAS/libLAS#221 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Upstream seems responsive so going to give them some time to consider/merge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is merged there. |
||
|
||
# make these available for the user to set. | ||
mark_as_advanced(CLEAR Boost_INCLUDE_DIR) |
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 you explain where this change came from?
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.
See this entry: #30950 (comment), where I have also noted from where I copied this solution.
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.
FALSE and OFF are both 'falsy' as far as CMake is concerned. It looks like this config is just broken by trying to use STREQUAL for a boolean test.
Importantly, this patch breaks what upstream is trying to do, since if CMAKE_CROSSCOMPILING is true when building the thing, the test is damaged.
It seems the correct fix is:
and the line below should not be messed with at all since it's just logging output and it should record the real values?
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.
Alternately, if
EQUAL
does not work becuase that wants them to be numbers it needs to be built out of boolean tests, like: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.
EQUAL
works indeed not (like expected):Returned:
Btw: Die real fix would be to fix vcpkg, as :
Returns
FALSE
and notOFF
, but somehow vcpkg sets this variable toOFF
. So we wouldn't need a fix here, when vcpkg would do it correct.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.
IMO this particular
elseif
can be simplified toelseif(0)
. Its benefit is close to zero in a vcpkg triplet universe.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.
@BillyONeal I created a separate issue for this, as I think it is better, when this issue is fixed in vcpkg #31209
@dg0yt: As I have not set up cross compilation locally, I can't say anything about it since I can't really test it and have no experience with it.
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.
CMAKE_CROSSCOMPILING
is documented as being 'boolish' so all of0
,OFF
,NO
,FALSE
,N
, andIGNORE
are acceptable and equivalent, see https://cmake.org/cmake/help/latest/command/if.html#basic-expressionsThere 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 agree with @dg0yt in that making this
elseif(0)
could be fine. Just acting like CMAKE_CROSSCOMPILING is always false, even when it is actually true as in e.g. x64-uwp, is not the correct fix)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.
Changed to the
elseif(0)
patch