[Cmake] include external msproject

William A. Hoffman billlist at nycap.rr.com
Tue Sep 14 09:25:16 EDT 2004


Thanks for the fix, looks like the bug was in the 7 and 71 generators, 
I have fixed both.  Here is the commit:

$ cvs commit -m "BUG: fix include external project bug" cmGlobalVisualStudio71G
enerator.cxx cmGlobalVisualStudio7Generator.cxx
/cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v  <--  cmGlobal
VisualStudio71Generator.cxx
new revision: 1.13; previous revision: 1.12
/cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v  <--  cmGlobalV
isualStudio7Generator.cxx
new revision: 1.34; previous revision: 1.33


As for the test, it would have to be part of the cmake test suite.
Once you build cmake, you and run ctest  in the build tree and
it will run all the tests.  The tests are added in Source/CMakeLists.txt, and
the source for them is in Tests/[testname].  So, if you could create a test, something
like this:

Tests/VSExternalInclude/

It should have all the stuff it needs to run the test, and the external project will
have to work from any directory.   That will be the tricky part.  I suppose you will
have to use cmake to generate the external project to include, perhaps with an
EXEC_PROGRAM call??  I am not sure.  I suppose you could also just check in a dsp and
proj to include, and then use CONFIGURE_FILE to copy them from the source tree to the
build tree.  That may be the best approach.   

You add the test in Source/CMakeLists.txt like this:


 ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND}
    --build-and-test 
    "${CMake_SOURCE_DIR}/Tests/VSExternalInclude"
    "${CMake_BINARY_DIR}/Tests/VSExternalInclude"
    --build-two-config
    --build-generator ${CMAKE_GENERATOR}
    --build-project VSExternalInclude
    --build-makeprogram ${MAKEPROGRAM}
    --test-command VSExternalInclude)

-Bill



At 05:57 PM 9/13/2004, Clinton Stimpson wrote:
>I've attached a patch file that'll fix this problem.  It changes just one line of code in cmGlobalVisualStudio71Generator.cxx and I used the VS 6.0 code for comparison.
>
>I can make a simple test case to make sure this command works with VC 6.0 and 7.1.  Who do I give this test case to?
>Are you just looking for a simple set of code, project files, and CMakeLists.txt files to build a hello world or something?
>
>Clint



More information about the Cmake mailing list