I noticed that with recent beta, the file Geant4Config.cmake is installed in "prefix"/lib/Geant4-<version>/ However, this file is not found by cmake if I try to use "find_package(Geant4 REQUIRED)" Two reasons I believe (and I could very well be wrong!): - The file should be named either GEANT4Config.cmake or geant4-config.cmake according to the error output - The folder location should be one of the options as explained here: http://www.cmake.org/pipermail/cmake/2010-January/034821.html A workaround is to manually rename the file and set the folder in CMAKE_MODULE_PATH.
Hmm, what error do you see (and are you on Unix?)? I have installed to +- /tmp/geant4/09-05-00b/ +- lib64/ +- Geant4-9.5.0 If I have a CMakeLists.txt which reads cmake_minimum_required(VERSION 2.6.4) project(foo) set(CMAKE_PREFIX_PATH "/tmp/geant4/09-05-00b") find_package(Geant4 REQUIRED) and run cmake, I don't see an error - it finds Geant4 fine (using either CMake 2.6.4 or 2.8) Now I can see from that post on the CMake list that we'll have to look at this for Windows, but on Unix platforms it should work fine (well, it appears to for me anyway....) Note that you can always point CMake directly to Geant4Config.cmake by doing cmake -DGeant4_DIR=/tmp/geant4/09-05-00b/lib64/Geant4-9.5.0 <other-options> to use the example install location above.
Huh, that is strange. I thought I'd tried both GEANT4 and Geant4. However, in the latter case I do actually find Geant4 without the need to set the module path. I do get an error though (perhaps that's why I thought it didn't work): ... -- Looking for CLHEP... - found -- Looking for GEANT4... CMake Error: An attempt was made to access a variable: GEANT4_DIR that has not been defined. This variable is created by the FIND_PACKAGE command. CMake version 1.6 always converted the variable name to upper-case, but this behavior is no longer the case. To fix this you might need to set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.6 or less. If you are writing a CMake listfile, you should change the variable reference to use the case of the argument to FIND_PACKAGE. -- Looking for GEANT4... - found ... I am using 2.8.4 on Arch Linux 64bit. Case closed then, this was clearly my wrongdoing.
Hmm, just one thing I noticed on the output you're seeing - as far as I know, there shouldn't be an output of -- Looking for GEANT4... - found when using the config mode of find_package. Have you tried cleaning the CMakeCache.txt file in your build directory? I'm just wondering if you've used a FindGeant4.cmake or similar in the past and that might be interfering/being used in preference/cached?
You are right. I had previously a FindGEANT4.cmake which I used. Deleting that one + cleaning cache and the messages all went away.