[CMake] Calling NMake from CMake

Brian Davis bitminer at gmail.com
Thu Aug 23 14:16:05 EDT 2012


Thanks for the response on this, I was able to get this to work (to
degrees) with libtiff and Jasper as well as other non CMake-a-fied
projects.  I have run into another issue where I wish to use configure_file
to generate a CMakeLists.txt file in the directory where
ExternalProject_add dumps the source and looks for the CMakeLists.txt
file.

The problem is that I cannot configure_file at CMakeLists.txt.config file
into a CMakeLists.txt file in the source directory where
ExternalProject_Add will later look for it as ExternalProject_Add removes
the file and generates the error:

CMake Error: The source directory
"D:/projects/glade/branches/glade_win_x64/source/libtiff" does not appear
to contain CMakeLists.txt.

Clicking the Generate button in CMake creates the CMakeLists.txt file and
the ExternalProject_Add works just fine, but requires going back and
clicking generate in CMake

I think my options are currently to run patch (not as powerful as
configure_file) using PATCH_COMMAND which as I recall is not in on Win
boxes and for which I have used GNUWin32 or possibly the
CONFIGURE_COMMAND.  Maybe I should recursively call CMake to configure_file
the CMakeLists.txt file?

Thanks,

Brian

On Sun, Jun 17, 2012 at 2:10 PM, David Cole <david.cole at kitware.com> wrote:

> You could use:
>
>   BUILD_COMMAND nmake /f makefile.vc
>   BUILD_IN_SOURCE 1
>
> in your ExternalProject_Add call.
>
> "nmake" is already available from within the Visual Studio environment.
>
> Of course, if your project is cross-platform, you'll have to
> conditionalize this so that it only happens when using a Visual Studio or
> NMake generator.
>
>
> HTH,
> David
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120823/74a3c493/attachment-0001.htm>


More information about the CMake mailing list