Files
cgal/Installation/cmake/modules/UseCGAL.cmake
T
Eric Berberich 357d6258f5 cmake's link_libraries is deprecated
removed almost all occurenced (missing UseFiles). While
doing so, some CMakeLists.txt could also be simplified. In fact
many more CMakeLists.txt can be simplified, in one of two ways:
1) add external libs to CGAL_3RD_PARTY_LIBRARIES and
2) call cgal_create_single_source_program
2012-08-03 22:32:39 +00:00

49 lines
1.3 KiB
CMake

#
# UseCGAL.cmake can be included in a project to set the needed compiler and linker
# settings to use CGAL in a program.
#
# The variables used here are defined in the CGALConfig.cmake generated when CGAL was installed.
#
#
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
cgal_setup_module_path()
if(NOT USE_CGAL_FILE_INCLUDED)
set(USE_CGAL_FILE_INCLUDED 1)
include(CGAL_Common)
include(CGAL_SetupFlags)
include(CGAL_GeneratorSpecificSettings)
include(CGAL_TweakFindBoost)
set( CGAL_LIBRARIES )
foreach ( component ${CGAL_REQUESTED_COMPONENTS} )
use_component( ${component} )
endforeach()
use_essential_libs()
include_directories( "${CMAKE_CURRENT_BINARY_DIR}" )
# need to get variable from cache while compiling CGAL, while in a demo it is set in CGALConfig.cmake
if ( NOT CGAL_LIBRARY )
cache_get(CGAL_LIBRARY)
endif()
add_to_list( CGAL_LIBRARIES ${CGAL_LIBRARY} )
#message (STATUS "LIB: ${CGAL_LIBRARY}")
#message (STATUS "LIBS: ${CGAL_LIBRARIES}")
include_directories ( ${CGAL_INCLUDE_DIRS})
include_directories ( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} )
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_DEFINITIONS} )
link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} )
endif()