[CMake] Calling NMake from CMake

Brian J. Davis bitminer at gmail.com
Sat Jun 16 17:11:06 EDT 2012


Since I do not see a FindNmake or the likes, is there a way to call 
Nmake from a CMakeLists.txt file?

The root CMakeList.txt file contains:

set( LIBTIFF_CONFIGURE_FILE ${TOP}/CMake/libtiff/CMakeLists.txt.config )
configure_file( ${LIBTIFF_CONFIGURE_FILE} 
${SOURCE_DIR}/libtiff/CMakeLists.txt.config )

externalproject_add(
   libtiff
   URL http://download.osgeo.org/libtiff/tiff-4.0.2.zip
   DOWNLOAD_DIR ${DOWNLOAD_DIR}
   SOURCE_DIR ${SOURCE_DIR}/libtiff
   INSTALL_DIR ${INSTALL_DIR}

)

Where the configure_file dumps a CMakeLists.txt file wich is generated 
form CMakeLists.txt.config into the libtiff source directory so that 
ExternalProject_Add has a CMakeLIsts.txt file.  It is in this 
CMakeLists.txt file that I need to spawn the build for libtiff such as:

nmake /f makefile.vc

Though CMake does not seem to support nmake calls from CMakeLists.txt 
files configured to generate VisualStudio Build Files.  Basically I want 
a visual studio target to build libtiff using nmake.  How does one do this?

I have been able to do this for zlib, and libpng

There are a myriad of projects all with their each flavor of building 
their source which I need to build.  it's a regular potpourii of source 
build scents and not in a good way.



More information about the CMake mailing list