On 2006-10-08 12:13+0200 Werner Smekal wrote:
> Hi,
>
> I wanted to add qhull library support for windows. To compile the qhull
> library in windows was easy, no problem here. Problem is, that cmake doesn't
> find the qhull_a.h header file. I set the CMAKE_INCLUDE_PATH correctly, but
> the checkincludefiles module doesn't use this variable - it only looks in
> standard locations (at least I think so).
>
> Anyway, I propose that we do the same as for the cd library (FindCD.cmake),
> this should be straight forward. But I'm not sure what to do with the
> QHULL_LIBRARY_PATH and QHULL_INCLUDE_PATH than, since in the moment
> csiro.cmake the library is found but the library never added (at least I find
> no code for that).
On your Linux box, find and xargs really are quite helpful at answering
such questions:
[EMAIL PROTECTED]> find -name CMakeLists.txt|xargs grep QHULL_LIB
./lib/nn/CMakeLists.txt:target_link_libraries(csironn ${QHULL_LIB})
>
> Before I invest more time here I wanted to know how I should proceed here?
I think your proposed change is a good idea since it will help both Unix and
windows users who have qhull installed in a non-standard location.
Here is how I suggest you organize it:
* I agree you should have a separate FindQHULL.cmake module that is in the
standard "find_package" form of modules. I took some pains to make sure
FindCD.cmake is in standard form so it should be a good template to
follow, but if you want to double-check the documentation of the
find_package form of modules it is in
$YOUR_INSTALL_PREFIX/share/CMake/Modules/readme.txt, where
YOUR_INSTALL_PREFIX is the install prefix for your cmake installation. In
particular FindQHULL.cmake should define the following:
# QHULL_FOUND, if false, do not try to use QHULL.
# QHULL_INCLUDE_DIRS, where to find qhull/qhull_a.h.
# QHULL_LIBRARIES, the libraries to link against to use libqhull.
# QHULL_LIBRARY_DIRS, the directory where libqhull is found.
N.B. use qhull/qhull_a.h consistently, not qhull_a.h.
* Reorganize csiro.cmake. Invoke find_package(QHULL) there. Use
QHULL_FOUND to control Boolean logic there. Change QHULL_LIB ==>
QHULL_LIBRARIES (see above for what variables are defined in
FindQHULL.cmake) there. Continue to use
check_function_exists(qh_new_qhull QH_NEW_VARIABLE)
and change from
check_include_file("qhull/qhull_a.h" QHULL_INCLUDE)
to the following:
set(CMAKE_REQUIRED_INCLUDES ${QHULL_INCLUDE_DIRS})
check_include_file("qhull/qhull_a.h" QHULL_A_VARIABLE)
set(CMAKE_REQUIRED_INCLUDES)
* Change QHULL_LIB ==> QHULL_LIBRARIES in lib/nn/CMakeLists.txt (see above
command where are searched for all instances of QHULL_LIB in CMakeLists.txt
files.
* Note above we replaced QHULL_INCLUDE by QHULL_A_VARIABLE in csiro.cmake.
QHULL_INCLUDE was never used in any of the CMakeLists.txt files, but we
have renamed it to make that more clear. The actual variable meant to
transmit the header file location to the CMakeLists.txt files is
QHULL_INCLUDE_DIRS (see above). Thus you will have to change
lib/nn/CMakeLists.txt to compile with the -I${QHULL_INCLUDE_DIRS} option
for the case of non-standard QHULL installation location.
Werner, the new capability of using a qhull that is installed in a
non-standard location is well worth having for our CBS, and I appreciate you
implementing and testing it. I hope I have gotten all the above details
right, but in any case you should check what I have said by looking at
http://www.cmake.org/HTML/Documentation.html and also by checking other
"find_package" modules in $YOUR_INSTALL_PREFIX/share/CMake/Modules/
Good luck with the implementation.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel