[CMake] VisualStudio 7.1 projects

Bojan Resnik resnikb at swissinfo.org
Sun Sep 26 11:32:21 EDT 2004


  My apologies to Kris, I have inadvertently hit the 'Reply' button,
  and sent this message to his private email.
  
DK> Hi,

DK> - The answer may depend on what you want to achieve. The output directory is
DK> what you specify as LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH.
DK> CMake/MsDev puts the build type dir after it to allows for multiple build
DK> types to coexist. If that's not ok for you, you can always move or copy the
DK> generated target in a POST_BUILD ADD_CUSTOM_COMMAND. But make sure the next
DK> targets to build can still find the targets it depends on.

   Actually, I thought there might be an option that directly maps
into VS's IntermediateDirectory and OutputDirectory project settings.

DK> - Yes, we had the exactly the same problem. For link libraries, CMake
DK> provides the debug/optimized option to TARGET_LINK_LIBRARIES and that works
DK> fine. Unfortunately there is no such option for LINK_DIRECTORIES and
DK> INCLUDE_DIRECTORIES. You can solve the LINK_DIRECTORIES problem by adding
DK> the full path to the library name in TARGET_LINK_LIBRARIES. I could not find
DK> any way to solve the INCLUDE_DIRECTORIES problem than to create single-build
DK> MsDev projects. I have added a FAQ for this to the CMake Wiki pages. It's
DK> for VS6 and requires some effort. For VS7 it should be as easy as setting
DK> the CMAKE_CONFIGURATION_TYPES to a single value(Debug/Release/...). This
DK> means that you will have a separate build tree for each single configuration
DK> type - exactly like what you would do with Makefile based builds.

  If I understand correctly, this means that I would have a different
workspace (or VS 7 solution) for each configuration?
  
DK> - ADD_DEPENDENCIES should only be used for exceptions. Use
DK> TARGET_LINK_LIBRARIES instead.

  Yes, this does work, however it does not add a VS dependency to the
workspace (solution).

  Thanks for your help,
     Bojan Resnik




More information about the CMake mailing list