<br>Hi all,<br><br>Hi all. First time posting. Before I start I'd like to thank all the Kitware guys for a very nice and useful tool. I did a fair bit of searching to try to avoid asking duplicate questions, but did not find answer to my problem.<br>
<br>I am trying to make a private build of some dependencies, ogg and vorbis in this case. The initial problem is that second library make is not finding first, due to pkg-config not finding output files from the first library. OK, I said, and did PKG_CONFIG_PATH=... and export PKG_CONFIG_PATH before executing cmake build. And this fixed the problem.<br>
<br>However then I tried to ease the job of whoever might be using this, and tried setting the PKG_CONFIG_PATH inside the cmake script. But this does not work. I did some tests, and indeed, configure executed as part of ExternalProject does not see environmental variables set by cmake.<br>
<br>So, the question is, am I doing something wrong or is this cmake limitation?<br><br>Miki.<br><br>P.S. I am doing this on a Mac OSX Lion, but I expect it to work on Linux without modifications.<br><br>=== CMakeLists.txt ===<br>
<br>cmake_minimum_required(VERSION 2.8) <br><br>set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH "Path where to install.")<br><br>project(dependecies)<br><br>include(ExternalProject)<br><br>set(ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/:$ENV{PKG_CONFIG_PATH}")<br>
message(STATUS "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH}")<br><br>ExternalProject_Add(<br> libogg<br> PREFIX libogg<br> URL <a href="http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz">http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz</a><br>
URL_MD5 0a7eb40b86ac050db3a789ab65fe21c2<br> UPDATE_COMMAND set<br> CONFIGURE_COMMAND ./configure --prefix=${CMAKE_INSTALL_PREFIX}<br> BUILD_COMMAND make<br> # INSTALL_COMMAND make install<br> BUILD_IN_SOURCE 1<br>
)<br><br>ExternalProject_Add(<br> libvorbis<br> DEPENDS libogg<br> PREFIX libvorbis<br> URL <a href="http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.bz2">http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.bz2</a> <br>
URL_MD5 798a4211221073c1409f26eac4567e8b<br> UPDATE_COMMAND set<br> CONFIGURE_COMMAND PKG_CONFIG_PATH=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig && export PKG_CONFIG_PATH && set && ./configure --prefix=${CMAKE_INSTALL_PREFIX} --with-ogg=${CMAKE_INSTALL_PREFIX}<br>
BUILD_COMMAND make<br> # INSTALL_COMMAND make install<br> BUILD_IN_SOURCE 1<br> )<br><br>