Yup, you nailed it. The module path was being set after the call to project() and not before.
Is there a naming convention for system names? I don't mind sending this upstream if there is interest. It's for Cray systems that use shared libraries (unlike Catamount which disables shared libraries). Makes building things like Paraview and Python much simpler on those platforms. I called it ModernCray since I have no idea what else it would be called. Thanks, Tim ----- Original Message ----- From: "Eric Noulard" <eric.noul...@gmail.com> To: "tim gallagher" <tim.gallag...@gatech.edu> Cc: "CMake List" <cmake@cmake.org> Sent: Saturday, December 15, 2012 4:46:36 AM Subject: Re: [CMake] Adding Platform files 2012/12/14 Tim Gallagher <tim.gallag...@gatech.edu>: > Hi, > > I have a folder inside my code repository we use to store custom modules and > that folder was added to the search path. Inside that folder I added one > called Platform/ and put a custom platform file in there. But CMake says it > can't find the platform file. How did you "add the folder to the search path" ? In order for this to work one should modify CMAKE_MODULE_PATH with something like: list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/MyCMakeModules") the "Platform" directory should be below this custom dir. **HOWEVER** you should be aware that platform files are read very early in the CMake process and in any case during the "project(...)" command processing. So the CMAKE_MODULE_PATH modifications should appear BEFORE any project(...) CMake command in order to be taken into account for that particular project. Usually you have something like: cmake_minimum_required(VERSION 2.8) # Update CMAKE_MODULE_PATH very soon # in order to have access to Platform/xxxx.cmake files # and avoid "unknown platform warning" list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/MyCMakeModules") project(MyProject C) .... With that it works for me. > Is it possible to add custom platforms without having to put them in the > CMake install tree? Yes definitely. I guess you may be modifying CMAKE_MODULE_PATH "too late"? -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake