Hi Chris, Your suggestion to "generate testlist.cmake in your build directory and then re-run cmake" worked with some tweaking.
Thank you!! Neelima Message: 3 Date: Wed, 25 Aug 2010 18:31:46 -0700 From: Chris Hillery <chillery-cm...@lambda.nu> Subject: Re: [CMake] CMake and CTest for Google tests To: Neelima Mehdiratta <nmehdira...@decarta.com> Cc: cmake@cmake.org On Wed, Aug 25, 2010 at 3:17 PM, Neelima Mehdiratta <nmehdira...@decarta.com > wrote: > ADD_CUSTOM_COMMAND(TARGET ${BIN_NAME} > > POST_BUILD > > WORKING_DIRECTORY ${SRC_DIR} > > COMMAND bash ./addtestscrpt > > COMMAND ${CMAKE_COMMAND} ${SRC_DIR}/DDSCommonTests/CMakeLists.txt > > ) > > I'm not sure, but I think you're very close to the right answer here. The problem with the above COMMAND is that it doesn't quite make sense - you can't specify a CMakeLists.txt file as an argument to CMake; it's not a scripting language in that sense, at least when it's doing build-tree configuration. I think what you should do is the following. In your top-level CMakeLists.txt, have something like IF (EXISTS ${CMAKE_BINARY_DIR}/testlist.cmake) INCLUDE (${CMAKE_BINARY_DIR}/testlist.cmake) ENDIF (EXISTS ${CMAKE_BINARY_DIR}/testlist.cmake) and then change your custom to command to generate testlist.cmake in your build directory and then re-run cmake: ADD_CUSTOM_COMMAND(TARGET ${CMAKE_BINARY_DIR}/testlist.cmake POST_BUILD WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND bash addtestscript COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} ) You'll need to tweak the invocation of addtestscript to successfully generate testlist.cmake in the build directory, and then I think it'll all work. Ceej aka Chris Hillery _______________________________________________ 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