[CMake] Howto create a ProjectConfig.cmake tutorial

Michael Wild themiwi at gmail.com
Wed Aug 8 12:49:39 EDT 2012


Oops, my bad. Apologies. Fixed now.

Michael

On 08/08/2012 01:04 PM, Eric Noulard wrote:
> 2012/8/8 Nico Schlömer <nico.schloemer at gmail.com>:
>> Hi,
>>
>> I just looked at
>> http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
>> to learn about exporting build information to the installation, and
>> started off by copying-and-pasting the contents of the tutorial to my
>> own project. It doesn't quite run through since there's this one
>> undefined variable ${INSTALL_DATA_DIR}. I have no idea what this is
>> actually supposed to be.
> 
> Usually this is the install prefix location of the "data" of your project.
> Like some dictionaries, or template files for something, may be CMake script
> files as well or ....
> 
> You can have a look  at GNUInstallDirs.cmake module to chekcout various
> "standard" directories.
> 
> cmake --help-module GNUInstallDirs
> 
> 
>> Anyone?
> 
> The example is buggy, if you take the FooBar.zip "as-is" it can be configured
> but trying to install gives you:
> 
> -- Install configuration: ""
> CMake Error at cmake_install.cmake:56 (FILE):
>   file cannot create directory: /FooBar/CMake.  Maybe need administrative
>   privileges.
> 
> telling you that "INSTALL_DATA_DIR" has not been defined in the project.
> I guess you get similar error?
> 
> Concerning ProjectConfig file you should have a look at the helper module:
> CMakePackageConfigHelpers.cmake
> 
> see:
> cmake --help-module CMakePackageConfigHelpers
> 
> it provides macros which "helps" to produce package config files.
> 



More information about the CMake mailing list