Hello, 

I try to create my first FindXXX.cmake and use find_package inside. 
My goal is to check that a repository exists: it's always the same because it 
come from the ExternalProject_add command. 
However, I don't manage to write a first very simple version. 
I can't find the path I want. 
I would like to check that 
/usr/local/bibliotheques/eigen/3.2.4/include/eigen3/Eigen/Core exists. 

My file organization is the following: 
project/ 
CMakeLists.txt 
build/ 
modules/ 
FindEigen.cmake 

The CMakeLists.txt contains the following lines: 
## 
cmake_minimum_required (VERSION 2.6) 
project (example CXX) 
set(CMAKE_VERBOSE_MAKEFILE ON) 
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/modules) 
find_package(Eigen) 
## 

The FindEigen.cmake file contains these lines: 
## 
find_path(EIGEN_INCLUDE_DIR Eigen/Core 
HINTS "/usr/local/bibliotheques/eigen/3.2.4/include/eigen3/" 
NO_DEFAULT_PATH) 
if(EIGEN_FOUND) 
message(STATUS "Eigen found (include: ${EIGEN_INCLUDE_DIRS})") 
else(EIGEN_FOUND) 
message(STATUS "Eigen NOT found (include: ${EIGEN_INCLUDE_DIRS})") 
endif(EIGEN_FOUND) 
## 

>From the "build" directory, I type "cmake .." in a terminal and get: 

-- Eigen NOT found (include: ) 
-- Configuring done 
-- Generating done 
-- Build files have been written to: project/find_package/build 

Could explain me what I am doing wrong? 

Thank you very much! 

Cédric 




-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to