我尝试编译MEPP库。我创建了一个find模块" FindCGAL.cmake"如下:
IF(CGAL_INCLUDE_DIR AND CGAL_LIBRARIES)
SET(CGAL_FOUND TRUE)
ELSE(CGAL_INCLUDE_DIR AND CGAL_LIBRARIES)
FIND_PATH(CGAL_INCLUDE_DIR basic.h
/scratch/softs/cgal/4.3.0/64/sequential/gcc/4.4.7/include/CGAL
$ENV{ProgramFiles}/CGAL/*/include/CGAL
$ENV{SystemDrive}/CGAL/*/include/CGAL
)
FIND_LIBRARY(CGAL_LIBRARIES NAMES CGAL libCGAL
PATHS
/scratch/softs/cgal/4.3.0/64/sequential/gcc/4.4.7/lib
/scratch/softs/cgal/4.3.0/64/sequential/gcc/4.4.7/lib/CGAL
$ENV{ProgramFiles}/CGAL/*/lib/ms
$ENV{SystemDrive}/CGAL/*/lib/ms
)
IF(CGAL_INCLUDE_DIR AND CGAL_LIBRARIES)
SET(CGAL_FOUND TRUE)
MESSAGE(STATUS "Found CGAL. New Hossein: ${CGAL_INCLUDE_DIR}, ${CGAL_LIBRARIES}")
INCLUDE_DIRECTORIES(${CGAL_INCLUDE_DIR} $ENV{CGAL_CFG})
ELSE(CGAL_INCLUDE_DIR AND CGAL_LIBRARIES)
SET(CGAL_FOUND FALSE)
MESSAGE(STATUS "CGAL not found. New Hossein")
ENDIF(CGAL_INCLUDE_DIR AND CGAL_LIBRARIES)
ENDIF(CGAL_INCLUDE_DIR AND CGAL_LIBRARIES)
并在CMakeList.txt中:
# Find CGAL libraries
FIND_PACKAGE(CGAL COMPONENTS Core)
IF(CGAL_FOUND)
INCLUDE(${CGAL_USE_FILE})
MESSAGE(STATUS "Found CGAL: ${CGAL_LIBRARIES}")
MESSAGE(STATUS "Found CGAL 3RD PARTY LIBRARIES: ${CGAL_3RD_PARTY_LIBRARIES}")
ELSE(CGAL_FOUND)
MESSAGE(FATAL_ERROR "CGAL not found. Please set CGAL_DIR.")
ENDIF(CGAL_FOUND)
在编译期间,我收到以下CMakeError:
CMake Error at src/components/Analysis/Curvature/CMakeLists.txt:48 (INCLUDE):
include called with wrong number of arguments. Include only takes one
file.
任何帮助将不胜感激。
答案 0 :(得分:1)
您忘了设置“CGAL_USE_FILE”。