2008-11-10 10:39:32 UTC
there is the following situation: I use CMake as build control system (Windows platform, MS Visual Studio) for my own project (A). A depends on a second project (B). The project-files of B are pre generated and not covered by my CMake-Scripts. I use 'INCLUDE_EXTERNAL_MSPROJECT' to integrate B into my solution.
Until this point everything works fine. But is there any way to address included external projects (like B) as a target in a CMake script. I would need this to add dependencies between A and B (e.g. ADD_DEPENDENCIES(A B)), so that B would also be build when I want to build A.
In the documentation and the mailing list I have found no information how to do this. And it seems that INCLUDE_EXTERNAL_MSPROJECT has no possibilities to introduce a Target identifier (like ADD_CUSTOM_TARGET).
I am thankful for any clues or tips that could help me to represent the project dependency in my CMake scripts.
Kind regards,
Ralf Floca
Ralf Floca
German Cancer Research Center (Deutsches Krebsforschungszentrum)
Member of the Helmholtz Association
E071 Research Group
Software Development for Integrated Diagnostics and Therapy (SIDT)
Im Neuenheimer Feld 280
D-69120 Heidelberg
Telefon: +49 (6221) 42 3021
E-Mail: ***
Include_external_msproject cmakeThanks for the info. I've verified that the revision you pointed me to (24b6e4830d9027e63db7dfafa500aaeb652d3a4c) is where the behavior broke (I built CMake using the revision directly before this one and
  1. $ cmake -help-command-list addcustomcommand enablelanguage getcmakeproperty addcustomtarget enabletesting getdirectoryproperty adddefinitions endforeach getfilenamecomponent adddependencies endfunction getproperty addexecutable endif getsourcefileproperty addlibrary endmacro gettargetproperty addsubdirectory endwhile get.
  2. Include an external Microsoft project file in a workspace. Includeexternalmsproject(projectname location dep1 dep2.) Includes an external Microsoft project in the generated workspace file. Currently does nothing on UNIX. This will create a target named projectname.
  3. Hi list, I'm on my wits end with includeexternalmsproject, adddependencies and build type. This is the situation: I have a CMake project with an external static library A which is included in the build via includeexternalmsproject, a static library B and a binary C. B is depemding on A C is depending on B My upper (above the directories for B and C) CMakeLists.txt looks like this: include.
Include_external_msprojecteverything still works fine). I'm no expert with CMake development -

It seems that includeexternalmsproject makes a utility (addcustomtarget-like) target internally. There seems to be some magic internally about how these things get linked to (and I don’t see a specific.lib path from CMake; VS may be making that assumption somewhere), but I can’t decipher it right now.

could someone chime in on whether what I am seeing is expected or whether something has inadvertently been broken?Testing this is actually quite simple. There is no need to even have valid external vcproj files on the file system - CMake does not appear to care if they exist or not when generating the solution. The most trivial test I can give to reproduce the behavior is:add_subdirectory(deps '${CMAKE_CURRENT_BINARY_DIR}/ext_deps' EXCLUDE_FROM_ALL)set_property(TARGET foo1_cmake PROPERTY IMPORTED_LOCATION_DEBUG 'foo1.lib')set_property(TARGET foo2_cmake PROPERTY IMPORTED_LOCATION_DEBUG 'foo2.lib')Invoking CMake before revision 24b6e4830d9027e63db7dfafa500aaeb652d3a4c and opening the solution will show that Visual Studio would like to open foo1_cmake_extern (and it will show as unavailable in the solution

Include_external_msproject Ninja

explorer on account of the file not actually existing).Invoking CMake at or after revision

Include_external_msproject Cmake

24b6e4830d9027e63db7dfafa500aaeb652d3a4c and opening the solution will Include_external_msprojectshow that Visual Studio would like to open foo1_cmake_extern AND foo2_cmake_extern (and both will show as unavailable in the solution explorer on account of the file not actually existing).Just as an FYI for the mailing list (I don't actually care about this): I needed to update on my machine CMake (I was previously running version Include_external_msproject

Include_external_msproject Dependencies

3.6) to build CMake. This might be acceptable - but I figured that CMake should have used cmake_version_minimum to indicate the version I was using was not new enough. I did not investigate, but 3.6 bombed out with the following: '(' 'CMAKE_CXX_COMPILER_VERSION' 'VERSION_GREATER_EQUAL' Include_external_msproject'19.0.24215.1' 'AND' 'CMAKE_CXX_COMPILER_VERSION' 'VERSION_LESS' '19.10' ')' 'OR' 'CMAKE_CXX_COMPILER_VERSION' 'VERSION_GREATER_EQUAL'

Include_external_msproject Cmake