[CMake] cmake and dependencies

schoappied schoappied at gmail.com
Fri Jul 24 09:13:41 EDT 2009


schoappied wrote:
> schoappied wrote:
>> Tyler Roscoe wrote:
>>> On Thu, Jul 23, 2009 at 10:05:35PM +0200, schoappied wrote:
>>>  
>>>> The part in the source looks like:
>>>>
>>>> # check for libsndfile
>>>> PKG_CHECK_MODULES(SNDFILE REQUIRED sndfile>=1.0.11)
>>>> IF(NOT SNDFILE_FOUND)
>>>>    MESSAGE(FATAL_ERROR "LMMS requires libsndfile1 and 
>>>> libsndfile1-dev   
>>>>> = 1.0.11 - please install, remove CMakeCache.txt and try again!")
>>>>>       
>>>> ENDIF(NOT SNDFILE_FOUND)
>>>>     
>>>
>>> I've never used pkg_check_modules. What exactly are you trying to 
>>> do? If
>>> you're just trying to use the sndfile library, find_library() is
>>> probably easier to use:
>>>
>>> http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_library
>>>
>>> The docs go into detail about how to insure that CMake finds your
>>> library.
>>>
> Such a command, should it look something like this?
>
> find_library(<VAR> libsndfile-1.dll [C:\Program Files\libsndfile])
>
> What is <VAR> ? Should I give it a name, or leave it this way?
>
> You put this in CMakeLists right?
>
>
> When looking into the source (I'm not a developer) I find on this 
> location:
> lmms\cmake\modules
>
> these files. It looks like the files are meant for finding stuff
>
> BuildPlugin.cmake
> ChecksForLibSamplerate.cmake
> DetectMachine.cmake
> FindAlsa.cmake
> FindOggVorbis.cmake
> FindPkgConfig.cmake
> FindPortaudio.cmake
> FindPulseAudio.cmake
> FindSTK.cmake
> InstallHelpers.cmake
> Win32Toolchain.cmake
> Win64Toolchain.cmake
> cmakefiles
> config-alsa.h.cmake
>
>
>>> No, I meant your system PATH variable. CMake Find modules use your PATH
>>> to help locate specific libraries.
>>>
>>>
>>>   
>> I mostly work on Linux, so I'm not experienced on Windows, but this 
>> is how my PATH looks like now:
>>
>> %GTK_BASEPATH%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\MinGW\bin;C:\Program 
>> Files\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files\libsndfile
>>
>>
>> Thanks for your help.
>>
>> Regards,
>>
>> ~D
>>
>>
>
Explored some more, to solve the issue:

First maybe this is interesting:

$ pkg-config --libs sndfile
Package sndfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `sndfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sndfile' found


Besides that, I found a FindSndfile.cmake file on the internet (see 
attachment)

I put it in lmms\cmake\modules

And added these entries in the cmake gui:

SNDFILE_INCLUDE_DIR               C:/Program 
Files/Mega-Nerd/libsndfile/include
SNDFILE_LIBRARY                         C:/Program 
Files/Mega-Nerd/libsndfile

But same error:

Found Qt-Version 4.5.2
checking for module 'sndfile>=1.0.11'
  package 'sndfile>=1.0.11' not found
CMake Error at cmake/modules/FindPkgConfig.cmake:270 (message):
  A required package was not found
Call Stack (most recent call first):
  cmake/modules/FindPkgConfig.cmake:322 (_pkg_check_modules_internal)
  CMakeLists.txt:116 (PKG_CHECK_MODULES)


CMake Error at CMakeLists.txt:118 (MESSAGE):
  LMMS requires libsndfile1 and libsndfile1-dev >= 1.0.11 - please install,
  remove CMakeCache.txt and try again!


Configuring incomplete, errors occurred!


I don't know if I have to change something to CMakeLists



Regards,

~D

-------------- next part --------------
A non-text attachment was scrubbed...
Name: FindSndfile.cmake
Type: text/x-cmake
Size: 876 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090724/1cc111e8/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090724/1cc111e8/attachment-0001.txt>


More information about the CMake mailing list