Skip to content

Commit

Permalink
Merge pull request #8474 from soesau/PSP3-LAStools_msvc2017-GF
Browse files Browse the repository at this point in the history
[LASlib] Prevent usage of LASlib with msvc 2017
  • Loading branch information
sloriot committed Sep 9, 2024
2 parents 2672006 + 19372fe commit 9472bf4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,23 @@ foreach(
target_link_libraries(${target} PRIVATE ${CGAL_libs})
endforeach()

find_package(LASLIB)
include(CGAL_LASLIB_support)
if(TARGET CGAL::LASLIB_support)
create_single_source_cgal_program("read_las_example.cpp")
create_single_source_cgal_program("write_las_example.cpp")
target_link_libraries(read_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
target_link_libraries(write_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support)

#disable if MSVC 2017
if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910)
find_package(LASLIB)
include(CGAL_LASLIB_support)
if (TARGET CGAL::LASLIB_support)
create_single_source_cgal_program("read_las_example.cpp")
create_single_source_cgal_program("write_las_example.cpp")
target_link_libraries(read_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
target_link_libraries(write_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
else()
message(
STATUS
"NOTICE : the LAS reader test requires LASlib and will not be compiled.")
endif()
else()
message(
STATUS
"NOTICE : the LAS reader test requires LASlib and will not be compiled.")
message(STATUS "NOTICE : the LAS reader does not work with your version of Visual Studio 2017.")
endif()

# Use Eigen
Expand Down
16 changes: 10 additions & 6 deletions Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
include(polyhedron_demo_macros)

find_package(LASLIB)
set_package_properties(
LASLIB PROPERTIES
DESCRIPTION "A library for some I/O."
PURPOSE "Requiered for reading or writing LAS files.")
if (NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910)
find_package(LASLIB)
set_package_properties(
LASLIB PROPERTIES
DESCRIPTION "A library for some I/O."
PURPOSE "Requiered for reading or writing LAS files.")
include(CGAL_LASLIB_support)
else()
message(STATUS "NOTICE : the LAS reader does not work with your version of Visual Studio 2017.")
endif()

include(CGAL_LASLIB_support)

polyhedron_demo_plugin(gocad_plugin GOCAD_io_plugin KEYWORDS Viewer)
target_link_libraries(gocad_plugin PUBLIC scene_surface_mesh_item)
Expand Down
8 changes: 6 additions & 2 deletions Stream_support/test/Stream_support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ find_library(
NAMES 3MF
DOC "Path to the lib3MF library")

find_package(LASLIB QUIET)
include(CGAL_LASLIB_support)
if (NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910)
find_package(LASLIB QUIET)
include(CGAL_LASLIB_support)
else()
message(STATUS "NOTICE : the LAS reader does not work with your version of Visual Studio 2017.")
endif()

# create a target per cppfile
file(
Expand Down

0 comments on commit 9472bf4

Please sign in to comment.