mirror of https://github.com/CGAL/cgal
Replace that hacky CMakeLists by a standard one
This commit is contained in:
parent
bf8c3701b3
commit
9a6d8c6adb
|
|
@ -1,58 +1,47 @@
|
||||||
# cd debug; cmake .. -DCMAKE_BUILD_TYPE=Debug
|
# Created by the script cgal_create_CMakeLists
|
||||||
# cd release; cmake .. -DCMAKE_BUILD_TYPE=Release
|
# This is the CMake script for compiling a set of CGAL applications.
|
||||||
|
|
||||||
project( Generalized_map_Tests )
|
project( Generalized_map_Tests )
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
|
||||||
|
|
||||||
if ( COMMAND cmake_policy )
|
# CGAL and its components
|
||||||
cmake_policy( SET CMP0003 NEW )
|
find_package( CGAL QUIET COMPONENTS )
|
||||||
endif()
|
|
||||||
|
|
||||||
####################################################################################
|
|
||||||
OPTION(BUILD_TESTS "Build tests." ON)
|
|
||||||
|
|
||||||
if (BUILD_TESTS)
|
|
||||||
ENABLE_TESTING()
|
|
||||||
INCLUDE(CTest)
|
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs -ftest-coverage -frounding-math")
|
|
||||||
endif (CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCC)
|
|
||||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0 -Wall -W -fprofile-arcs -ftest-coverage -frounding-math")
|
|
||||||
endif (CMAKE_COMPILER_IS_GNUCC)
|
|
||||||
endif (BUILD_TESTS)
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
find_package(CGAL QUIET COMPONENTS Core )
|
|
||||||
|
|
||||||
if ( NOT CGAL_FOUND )
|
if ( NOT CGAL_FOUND )
|
||||||
message(FATAL_ERROR "This program requires the CGAL library, and will not be compiled.")
|
|
||||||
endif ( NOT CGAL_FOUND )
|
|
||||||
|
|
||||||
|
message(STATUS "This project requires the CGAL library, and will not be compiled.")
|
||||||
|
return()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# include helper file
|
||||||
include( ${CGAL_USE_FILE} )
|
include( ${CGAL_USE_FILE} )
|
||||||
|
|
||||||
# Try to use gcov but does not work... TODO
|
|
||||||
#set(CMAKE_CXX_FLAGS "-g -frounding-math")
|
|
||||||
#set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS})
|
|
||||||
#add_definitions(-fprofile-arcs -ftest-coverage)
|
|
||||||
|
|
||||||
#include( CGAL_CreateSingleSourceCGALProgram )
|
# Boost and its components
|
||||||
include_directories(BEFORE ../../include)
|
find_package( Boost REQUIRED )
|
||||||
add_executable(Generalized_map_test
|
|
||||||
GMap_test_insertions.h
|
if ( NOT Boost_FOUND )
|
||||||
Generalized_map_2_test.h
|
|
||||||
Generalized_map_3_test.h
|
message(STATUS "This project requires the Boost library, and will not be compiled.")
|
||||||
Generalized_map_4_test.h
|
|
||||||
Generalized_map_test.cpp)
|
return()
|
||||||
#create_single_source_cgal_program( "Generalized_map_test.cpp" )
|
|
||||||
target_link_libraries(Generalized_map_test ${CGAL_LIBRARIES}
|
endif()
|
||||||
${CGAL_3RD_PARTY_LIBRARIES} )
|
|
||||||
|
# include for local directory
|
||||||
|
|
||||||
|
# include for local package
|
||||||
|
include_directories( BEFORE ../../include )
|
||||||
|
|
||||||
|
|
||||||
|
# Creating entries for all C++ files with "main" routine
|
||||||
|
# ##########################################################
|
||||||
|
|
||||||
|
include( CGAL_CreateSingleSourceCGALProgram )
|
||||||
|
|
||||||
|
create_single_source_cgal_program( "Generalized_map_test.cpp" )
|
||||||
|
|
||||||
|
|
||||||
if (BUILD_TESTS)
|
|
||||||
ADD_TEST(Generalized_map_test "./Generalized_map_test")
|
|
||||||
endif (BUILD_TESTS)
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue