I am using ExternalProject_add on windows 7 and I am having difficulty passing in some arguments. I have mocked up an example showing my problem. To summarise:

When I pass a path e.g. "D:/somehere/cool" through with the CMAKE_ARGS args I get out just "D:".

has anyone else come across this?

My example:
[directory layout]
-foo_master
\-CMakeLists.txt <- see Appendix 1.
 |-foo_project
   \-foo_project.tar.gz <- see Appendix 2.

-foo_master-build

From foo_master-build I run (in a visual studio command window)
 cmake -G "NMake Makefiles"  ..\foo_master
 nmake

The undersirable thing is my foo_it application is installed into
 d:\bin\foo_it.exe
rather than
 d:\develoopment\foo_install_here\bin\foo_it.exe

Appendix 1. - CMakeList.txt
=============================================
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

PROJECT( foo_master )

INCLUDE( ExternalProject )

SET( PLATFORM_BUILD_COMMAND nmake )
SET( PLATFORM_INSTALL_COMMAND nmake install )

# Define FOO_INSTALL_PREFIX somewhere useful
SET( FOO_CMAKE_ARGS -DFOO_INSTALL_PREFIX=D:/development/foo_install_here )
SET( FOO_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/foo_project )

ExternalProject_Add( build_foo
   PREFIX ${CMAKE_CURRENT_BINARY_DIR}
   #--Download step--------------
   URL ${FOO_SOURCE_DIR}/foo_project.tar.gz
   #--Update/Patch step----------
   #--Configure step-------------
   CMAKE_ARGS ${FOO_CMAKE_ARGS}
   #--Build step-----------------
   BUILD_COMMAND ${PLATFORM_BUILD_COMMAND}
   #--Install step---------------
   INSTALL_COMMAND ${PLATFORM_INSTALL_COMMAND} )

=============================================

Appendix 2: - Contents of foo_project.tar.gz, CMakeLists.txt and main.cpp
=============================================

CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

PROJECT( foo )

MESSAGE( STATUS "FOO INSTALL PREFIX: ${FOO_INSTALL_PREFIX}" )
SET( FOO_INSTALL_PREFIX ${FOO_INSTALL_PREFIX} CACHE PATH "Foo install dir" )

ADD_EXECUTABLE( foo_it main.cpp )

INSTALL( TARGETS foo_it DESTINATION ${FOO_INSTALL_PREFIX}/bin )

=============================================

#include <stdio.h>

int main()
{
   printf( "\nExternalProject_Add text parsing test.\n" );
   return 0;
}

=============================================

I have attached the tar.gz file in case anybody wants to try it out.

Cheers,
Hugh.



Attachment: foo_project.tar.gz
Description: application/gzip

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to