2014-09-22 41 views
1

我試圖編譯MEPP庫。我創建了一個查找模塊 「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. 

任何幫助將不勝感激。

回答

1

你忘了設置「CGAL_USE_FILE」。

+0

我應該將它設置爲CGAL_INCLUDE_DIR還是CGAL_LIBRARIES? – 2014-09-22 09:28:05

相關問題