mirror of https://github.com/CGAL/cgal
Don't build the programs if boost_program_options is not found
This commit is contained in:
parent
1a693828e1
commit
1f7b43d141
|
|
@ -14,14 +14,18 @@ if(TARGET CGAL::Eigen3_support)
|
|||
find_package(Boost QUIET COMPONENTS program_options)
|
||||
|
||||
create_single_source_cgal_program("Mesh_estimation.cpp")
|
||||
target_link_libraries(Mesh_estimation PUBLIC CGAL::Eigen3_support)
|
||||
if(Boost_PROGRAM_OPTIONS_FOUND)
|
||||
target_compile_definitions(Mesh_estimation PRIVATE "CGAL_USE_BOOST_PROGRAM_OPTIONS")
|
||||
target_link_libraries(Mesh_estimation PUBLIC CGAL::Eigen3_support)
|
||||
if(TARGET Boost::filesystem)
|
||||
target_link_libraries(Mesh_estimation PRIVATE Boost::program_options)
|
||||
else()
|
||||
target_link_libraries(Mesh_estimation PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
endif()
|
||||
else()
|
||||
message(
|
||||
STATUS
|
||||
"NOTICE: This program requires Boost Program Options and will not be compiled."
|
||||
)
|
||||
endif()
|
||||
|
||||
create_single_source_cgal_program("Single_estimation.cpp")
|
||||
|
|
|
|||
|
|
@ -6,10 +6,8 @@
|
|||
|
||||
#include <CGAL/property_map.h>
|
||||
|
||||
#if defined(CGAL_USE_BOOST_PROGRAM_OPTIONS) && ! defined(DONT_USE_BOOST_PROGRAM_OPTIONS)
|
||||
#include <boost/program_options.hpp>
|
||||
namespace po = boost::program_options;
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,18 +12,14 @@ if(TARGET CGAL::Eigen3_support)
|
|||
# Link with Boost.ProgramOptions (optional)
|
||||
find_package(Boost QUIET COMPONENTS program_options)
|
||||
|
||||
if(Boost_PROGRAM_OPTIONS_FOUND)
|
||||
create_single_source_cgal_program(Compute_Ridges_Umbilics.cpp)
|
||||
target_link_libraries(Compute_Ridges_Umbilics PUBLIC CGAL::Eigen3_support)
|
||||
create_single_source_cgal_program(Ridges_Umbilics_SM.cpp)
|
||||
target_link_libraries(Ridges_Umbilics_SM PUBLIC CGAL::Eigen3_support)
|
||||
create_single_source_cgal_program(Ridges_Umbilics_LCC.cpp)
|
||||
target_link_libraries(Ridges_Umbilics_LCC PUBLIC CGAL::Eigen3_support)
|
||||
|
||||
if(Boost_PROGRAM_OPTIONS_FOUND)
|
||||
target_compile_definitions(Compute_Ridges_Umbilics PRIVATE "CGAL_USE_BOOST_PROGRAM_OPTIONS")
|
||||
target_compile_definitions(Ridges_Umbilics_SM PRIVATE "CGAL_USE_BOOST_PROGRAM_OPTIONS")
|
||||
target_compile_definitions(Ridges_Umbilics_LCC PRIVATE "CGAL_USE_BOOST_PROGRAM_OPTIONS")
|
||||
if(TARGET Boost::filesystem)
|
||||
if(TARGET Boost::program_options)
|
||||
target_link_libraries(Compute_Ridges_Umbilics PRIVATE Boost::program_options)
|
||||
target_link_libraries(Ridges_Umbilics_SM PRIVATE Boost::program_options)
|
||||
target_link_libraries(Ridges_Umbilics_LCC PRIVATE Boost::program_options)
|
||||
|
|
@ -32,12 +28,15 @@ if(TARGET CGAL::Eigen3_support)
|
|||
target_link_libraries(Ridges_Umbilics_SM PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(Ridges_Umbilics_LCC PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
endif()
|
||||
else()
|
||||
message(
|
||||
STATUS
|
||||
"NOTICE: This programs require Boost Program Options and will not be compiled."
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
|
||||
message(
|
||||
STATUS
|
||||
"NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled."
|
||||
)
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -9,13 +9,9 @@
|
|||
#include <CGAL/Monge_via_jet_fitting.h>
|
||||
#include <fstream>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
|
||||
#if defined(CGAL_USE_BOOST_PROGRAM_OPTIONS) && ! defined(DONT_USE_BOOST_PROGRAM_OPTIONS)
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
namespace po = boost::program_options;
|
||||
#endif
|
||||
|
||||
|
||||
typedef PolyhedralSurf::Traits Kernel;
|
||||
|
|
|
|||
|
|
@ -11,10 +11,8 @@
|
|||
#include <cassert>
|
||||
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
|
||||
|
||||
#if defined(CGAL_USE_BOOST_PROGRAM_OPTIONS) && ! defined(DONT_USE_BOOST_PROGRAM_OPTIONS)
|
||||
#include <boost/program_options.hpp>
|
||||
namespace po = boost::program_options;
|
||||
#endif
|
||||
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
|
|
|
|||
|
|
@ -8,10 +8,8 @@
|
|||
#include <fstream>
|
||||
#include <cassert>
|
||||
|
||||
#if defined(CGAL_USE_BOOST_PROGRAM_OPTIONS) && ! defined(DONT_USE_BOOST_PROGRAM_OPTIONS)
|
||||
#include <boost/program_options.hpp>
|
||||
namespace po = boost::program_options;
|
||||
#endif
|
||||
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ find_package(Boost QUIET COMPONENTS program_options)
|
|||
if(Boost_PROGRAM_OPTIONS_FOUND)
|
||||
if(CGAL_Core_FOUND OR LEDA_FOUND)
|
||||
create_single_source_cgal_program("TestMesh.cpp")
|
||||
target_compile_definitions(TestMesh PRIVATE "CGAL_USE_BOOST_PROGRAM_OPTIONS")
|
||||
if(TARGET Boost::filesystem)
|
||||
target_link_libraries(TestMesh PRIVATE Boost::program_options)
|
||||
else()
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
#include <CGAL/config.h>
|
||||
#include <iostream>
|
||||
|
||||
#if defined(CGAL_USE_BOOST_PROGRAM_OPTIONS) && ! defined(DONT_USE_BOOST_PROGRAM_OPTIONS)
|
||||
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
#include <utility>
|
||||
|
|
@ -350,12 +347,3 @@ int main(int argc, char** argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
int main()
|
||||
{
|
||||
std::cout << "TestMesh.cpp needs Boost Program Options" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue