Fix CMakeLists for the right CMAKE versions.

This commit is contained in:
Maxime Gimeno 2019-06-26 10:04:03 +02:00
parent 90662e6b43
commit f31e0bee83
8 changed files with 23 additions and 21 deletions

View File

@ -4,14 +4,14 @@
project( Polygonal_surface_reconstruction_Examples )
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.1...3.15)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )
if ( NOT CGAL_FOUND )
message(STATUS "This project requires the CGAL library, and will not be compiled.")
message(STATUS "NOTICE: This project requires the CGAL library, and will not be compiled.")
return()
endif()
@ -25,7 +25,7 @@ find_package( Boost REQUIRED )
if ( NOT Boost_FOUND )
message(STATUS "This project requires the Boost library, and will not be compiled.")
message(STATUS "NOTICE: This project requires the Boost library, and will not be compiled.")
return()
@ -49,10 +49,10 @@ if ( NOT SCIP_FOUND )
find_package( GLPK )
if ( NOT GLPK_FOUND )
message(STATUS "This project requires either SCIP or GLPK, and will not be compiled. "
message(STATUS "NOTICE: This project requires either SCIP or GLPK, and will not be compiled. "
"Please proivde either 'SCIP_DIR' or 'GLPK_INCLUDE_DIR' and 'GLPK_LIBRARIES'")
else()
add_compile_definitions(CGAL_USE_GLPK)
add_definitions(-DCGAL_USE_GLPK)
include_directories( BEFORE ${GLPK_INCLUDE_DIR} )
@ -66,7 +66,7 @@ if ( NOT SCIP_FOUND )
else()
add_compile_definitions(CGAL_USE_SCIP)
add_definitions(-DCGAL_USE_SCIP)
include_directories( BEFORE ${SCIP_INCLUDE_DIRS} )

View File

@ -147,7 +147,7 @@ int main()
int main(int argc, char* argv[])
{
std::cerr << "This test requires either GLPK or SCIP.\n";
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
#endif // defined(CGAL_USE_GLPK) || defined(CGAL_USE_SCIP)

View File

@ -110,7 +110,7 @@ int main()
int main(int argc, char* argv[])
{
std::cerr << "This test requires either GLPK or SCIP.\n";
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
#endif // defined(CGAL_USE_GLPK) || defined(CGAL_USE_SCIP)

View File

@ -155,7 +155,7 @@ int main()
int main(int argc, char* argv[])
{
std::cerr << "This test requires either GLPK or SCIP.\n";
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
#endif // defined(CGAL_USE_GLPK) || defined(CGAL_USE_SCIP)

View File

@ -4,7 +4,7 @@
project( Polygonal_surface_reconstruction_Tests )
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.1...3.15)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )
@ -53,7 +53,7 @@ if (SCIP_FOUND)
target_link_libraries( polygonal_surface_reconstruction_test PRIVATE ${SCIP_LIBRARIES} )
add_compile_definitions(CGAL_USE_SCIP)
add_definitions(-DCGAL_USE_SCIP)
message("SCIP found and used")
@ -68,7 +68,7 @@ find_package( GLPK )
target_link_libraries( polygonal_surface_reconstruction_test PRIVATE ${GLPK_LIBRARIES} )
add_compile_definitions(CGAL_USE_GLPK)
add_definitions(-DCGAL_USE_GLPK)
message("GLPK found and used")

View File

@ -43,7 +43,6 @@ int main(int argc, char* argv[])
//argv[1] = "data/house.ply";
//argv[1] = "data/chair.ply";
//argv[1] = "data/square.ply";
#endif
// usage
if (argc - 1 == 0) {
@ -53,8 +52,11 @@ int main(int argc, char* argv[])
std::cerr << "Input file formats are \'pwn\' and \'ply\'. No output.\n";
return EXIT_FAILURE;
}
#endif
char* input_file = argv[1];
const char* input_file =
(argc > 1) ? argv[1]
: "data/icosahedron.pwn";
//---------------------------------------------------------------------
@ -116,7 +118,7 @@ int main(int argc, char* argv[])
int main(int argc, char* argv[])
{
std::cerr << "This test requires either GLPK or SCIP.\n";
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
#endif // defined(CGAL_USE_GLPK) || defined(CGAL_USE_SCIP)

View File

@ -4,7 +4,7 @@
project( Solver_interface_Examples )
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.1...3.15)
find_package(CGAL QUIET)
@ -30,7 +30,7 @@ if ( CGAL_FOUND )
target_link_libraries( mixed_integer_program PRIVATE ${SCIP_LIBRARIES} )
add_compile_definitions(CGAL_USE_SCIP)
add_definitions(-DCGAL_USE_SCIP)
message("SCIP found and used")
@ -44,13 +44,13 @@ if ( CGAL_FOUND )
target_link_libraries( mixed_integer_program PRIVATE ${GLPK_LIBRARIES} )
add_compile_definitions(CGAL_USE_GLPK)
add_definitions(-DCGAL_USE_GLPK)
message("GLPK found and used")
else()
message(STATUS "This project requires either SCIP or GLPK, and will not be compiled. "
message(STATUS "NOTICE: This project requires either SCIP or GLPK, and will not be compiled. "
"Please proivde either 'SCIP_DIR' or 'GLPK_INCLUDE_DIR' and 'GLPK_LIBRARIES'")
endif()
@ -59,7 +59,7 @@ if ( CGAL_FOUND )
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -106,7 +106,7 @@ int main()
int main(int argc, char* argv[])
{
std::cerr << "This test requires either GLPK or SCIP.\n";
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
#endif // defined(CGAL_USE_GLPK) || defined(CGAL_USE_SCIP)