Prevent usage of LASlib with msvc 2017

This commit is contained in:
Sven Oesau 2024-09-09 16:17:40 +02:00
parent a27d129698
commit cc2bec0a96
3 changed files with 34 additions and 18 deletions

View File

@ -67,17 +67,23 @@ foreach(
target_link_libraries(${target} PRIVATE ${CGAL_libs}) target_link_libraries(${target} PRIVATE ${CGAL_libs})
endforeach() endforeach()
find_package(LASLIB)
include(CGAL_LASLIB_support) #disable if MSVC 2017
if(TARGET CGAL::LASLIB_support) if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910)
create_single_source_cgal_program("read_las_example.cpp") find_package(LASLIB)
create_single_source_cgal_program("write_las_example.cpp") include(CGAL_LASLIB_support)
target_link_libraries(read_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support) if (TARGET CGAL::LASLIB_support)
target_link_libraries(write_las_example PRIVATE ${CGAL_libs} 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() else()
message( message(STATUS "NOTICE : the LAS reader does not work with your version of Visual Studio 2017.")
STATUS
"NOTICE : the LAS reader test requires LASlib and will not be compiled.")
endif() endif()
# Use Eigen # Use Eigen

View File

@ -1,12 +1,16 @@
include(polyhedron_demo_macros) include(polyhedron_demo_macros)
find_package(LASLIB) if (NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910)
set_package_properties( find_package(LASLIB)
LASLIB PROPERTIES set_package_properties(
DESCRIPTION "A library for some I/O." LASLIB PROPERTIES
PURPOSE "Requiered for reading or writing LAS files.") 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) polyhedron_demo_plugin(gocad_plugin GOCAD_io_plugin KEYWORDS Viewer)
target_link_libraries(gocad_plugin PUBLIC scene_surface_mesh_item) target_link_libraries(gocad_plugin PUBLIC scene_surface_mesh_item)
@ -103,6 +107,7 @@ else()
target_link_libraries(ply_plugin PUBLIC scene_points_with_normal_item scene_polygon_soup_item scene_surface_mesh_item scene_textured_item) target_link_libraries(ply_plugin PUBLIC scene_points_with_normal_item scene_polygon_soup_item scene_surface_mesh_item scene_textured_item)
target_compile_features(ply_plugin PRIVATE ${needed_cxx_features}) target_compile_features(ply_plugin PRIVATE ${needed_cxx_features})
#disable if MSVC 2017
if (TARGET CGAL::LASLIB_support) if (TARGET CGAL::LASLIB_support)
polyhedron_demo_plugin(las_plugin LAS_io_plugin KEYWORDS Viewer PointSetProcessing Classification) polyhedron_demo_plugin(las_plugin LAS_io_plugin KEYWORDS Viewer PointSetProcessing Classification)
target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item CGAL::LASLIB_support) target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item CGAL::LASLIB_support)

View File

@ -13,8 +13,12 @@ find_library(
NAMES 3MF NAMES 3MF
DOC "Path to the lib3MF library") DOC "Path to the lib3MF library")
find_package(LASLIB QUIET) if (NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910)
include(CGAL_LASLIB_support) 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 # create a target per cppfile
file( file(
@ -37,6 +41,7 @@ foreach(cppfile ${cppfiles})
endif() endif()
else() else()
if("${cppfile}" STREQUAL "test_LAS.cpp") if("${cppfile}" STREQUAL "test_LAS.cpp")
#disable if MSVC 2017
if(TARGET CGAL::LASLIB_support) if(TARGET CGAL::LASLIB_support)
create_single_source_cgal_program("test_LAS.cpp") create_single_source_cgal_program("test_LAS.cpp")
target_link_libraries(test_LAS PRIVATE CGAL::LASLIB_support) target_link_libraries(test_LAS PRIVATE CGAL::LASLIB_support)