diff --git a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt index dbbfd1efe86..85e72510b3b 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt @@ -8,9 +8,6 @@ find_package(CGAL REQUIRED) # VisualC++ optimization for applications dealing with large data if(MSVC) - # Quit warning in the lasreader - add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) - if(CMAKE_SIZEOF_VOID_P EQUAL 4) # Allow Windows 32bit applications to use up to 3GB of RAM set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") @@ -63,6 +60,10 @@ if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910 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) + + target_compile_definitions(read_las_example PRIVATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) + target_compile_definitions(write_las_example PRIVATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) + else() message(STATUS "NOTICE : the LAS reader test requires LASlib and will not be compiled.") endif()