[Cmake] Multiple Projects Produced in VS

William A. Hoffman billlist at nycap.rr.com
Fri Aug 6 11:43:13 EDT 2004


ALL_BUILD and INSTALL are always added by CMake.
ALL_BUILD is a custom target that depends on all of the
"buildable" targets in the workspace.   This is very useful
if you have extra targets like INSTALL and you just want to build
things.   The INSTALL is required because you are using the
INSTALL_FILES command.   The visual studio project on the 
left "what it should be", does not have an INSTALL target because
it can not install.  Perhaps the ALL_BUILD should be optional as
it seems to cause some confusion for smaller projects.

The other difference is your cmake list file creates an 
executable bit_streamer and a library bit_streamer_libs, so
you get two targets.   I think you may want this:

1. remove the ADD_LIBRARY command
2. move the TARGET_LINK_LIBRARIES to come after the ADD_EXECUTABLE
and look like this:

ADD_EXECUTABLE(bit_streamer ${SRC_FILES} ${LIBS} ${TXT_FILES} ${G_FILES})
TARGET_LINK_LIBRARIES(bit_streamer 
${LIB_PATH}bit_streamerd.lib ${OBJ_PATH}bit_streamer_libs.lib 
${ANTLR})


The other difference, looks like the .g files are in the Resource Files
explicitly in the Cmakelists.txt file, if you remove this:

SOURCE_GROUP("Resource Files" FILES ${G_FILES} ${TXT_FILES})

Then the .g files should be in the top.


Also, with CMake it is not really required to use an R: drive to
store all the third party software.  You can use the FIND_LIBRARY
and FIND_PATH command to locate those files.   You could use the r:/Software directory
as a default place to look.  

-Bill


At 11:15 AM 8/6/2004, Andrew Dupont wrote:

>Hello Again,
>
>        Sorry to make two emails from one problem. Here is a picture
>that shows both solution views from Visual Studio, Good and Bad. If you
>have any suggestions on how to make the project produced by CMake more
>like the original, I would be glad to hear them.
>
>Pic:
>
>http://rain.prohosting.com/ekaid/badproject.jpg
>
>Thanks,
>Andy
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake 



More information about the Cmake mailing list