| ------------------------------------------------------------------------ | r57847 | lrineau | 2010-08-06 14:11:31 +0200 (Fri, 06 Aug 2010) | 4 lines | | Turn cgal_setup_module_path into a CMake function. | Fix the CMake errors with CMake-2.6.0 and CMake-2.6.1 (VERSION_LESS if IF | has been introduced in CMake-2.6.2). | ------------------------------------------------------------------------ | r57816 | lrineau | 2010-08-05 15:56:57 +0200 (Thu, 05 Aug 2010) | 17 lines | | Clean the CMake configuration: | | - CGALConfig_install.cmake.source.in is removed. The variable | SOURCE_INSTALL/CGAL_SOURCE_INSTALL were unused, and probably not tested | for a long time (I found errors in | CGALConfig_install.cmake.source.in). This has been cleaned. | | - CGALConfig_install.cmake.fhs.in is renamed (no .fhs. in it). | | - The module path is now modified in a macro (defined in | CGAL_Macros.cmake), and the variable CGAL_CMAKE_MODULE_PATH is no | longer stored or used in CGALConfig.cmake (the reason is that is was | used as a path, where it is actually a list of paths). | | - The UseCGAL.cmake file only link with CGAL libraries that has been | configured. | | ------------------------------------------------------------------------
46 lines
1.6 KiB
CMake
46 lines
1.6 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)
|
|
|
|
set( CGAL_LIBRARIES )
|
|
|
|
foreach ( CGAL_COMPONENT ${CGAL_REQUESTED_COMPONENTS} )
|
|
if(WITH_CGAL_${CGAL_COMPONENT})
|
|
add_to_list( CGAL_LIBRARIES ${CGAL_${CGAL_COMPONENT}_LIBRARY} )
|
|
add_to_list( CGAL_3RD_PARTY_LIBRARIES ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES} )
|
|
|
|
add_to_list( CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_INCLUDE_DIRS} )
|
|
add_to_list( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_DEFINITIONS} )
|
|
add_to_list( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES_DIRS} )
|
|
endif()
|
|
endforeach()
|
|
|
|
include_directories( "${CMAKE_CURRENT_BINARY_DIR}" )
|
|
|
|
add_to_list( CGAL_LIBRARIES ${CGAL_LIBRARY} )
|
|
|
|
include_directories ( ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_INCLUDE_DIRS} )
|
|
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_DEFINITIONS} )
|
|
|
|
link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} )
|
|
link_libraries ( ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
|
|
|
|
|
|
endif()
|