CGAL, eigen, suitesparse, cmake tweaking

A very technical summary of the changes I had to introduce in CMakeLists.txt in order to include correctly the eigen libs, then the suitesparse libs.

# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.
project( embedded_ )
cmake_minimum_required(VERSION 2.6.2)
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3)
cmake_policy(VERSION 2.8.4)
else()
cmake_policy(VERSION 2.6)
endif()
endif()
find_package(CGAL QUIET COMPONENTS Core )
include( ${CGAL_USE_FILE} )
set(EIGEN3_INCLUDE_DIR "/usr/local/include/eigen")
find_package(Eigen3)
if(EIGEN3_FOUND)
message(STATUS "NOTICE: Eigen library found.")
include( ${EIGEN3_USE_FILE} )
else()
message(STATUS "NOTICE: Eigen library is not found.")
endif()
set(CMAKE_MODULE_PATH "/usr/local/include/eigen/cmake/;${CMAKE_MODULE_PATH}")
 #set(CHOLMOD_LIBRARIES "/usr/include/suitesparse/")
find_package( Cholmod )
find_library(LAPACK_LIB NAMES lapack)
find_library(BLAS_LIB NAMES blas)
find_library(SS_LIB NAMES suitesparseconfig)
include_directories( ${CHOLMOD_INCLUDES})
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program("main.cpp" "linear.cpp" "gradient.cpp" "nabla.cpp" "quad_coeffs.cpp" "periodic.cpp" "fields.cpp" "Delta.cpp" "move.cpp" "draw.cpp" "onto_from_mesh.cpp" )
target_link_libraries(main ${CHOLMOD_LIBRARIES} ${LAPACK_LIB} ${BLAS_LIB} ${SS_LIB})

#ADD_LIBRARY(${LAPACK_LIB} ${BLAS_LIB} ${CHOLMOD_LIBRARIES} )

Ok, in orange are the tweaked parts. I am a bit proud of the SS_LIB part, which I found out by myself🙂

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s