[CMake] Cmake issue regarding conversion of existing Visual Studio .targets files to cmake

Ravi Raman ravi.raman at Xoriant.Com
Thu Jul 31 05:46:43 EDT 2014


Hi David,



Thanks.



Background of our project:

In our project there are many modules. The existing build system is using Microsoft Visual Studio. Each module has a Microsoft Visual Studio project (.vcxproj) file and in some of the project files, Microsoft Visual Studio targets (.targets) file is included using the import statement.



As an example, let us take a module with the name "module1". It will have a Visual Studio project with the name "module1.vcxproj". The file "module1.vcxproj" file will include the Microsoft Visual Studio targets file "target1.targets" as follows:



<Import Project="target1.targets" />



Attaching a sample "target1.targets" file for your reference. In that, there are many entries as follows (for each target) and there are certain steps that get executed within the Target block.



  <Target Name="Target_1" ....>

      ....

  </Target>



Requirement:

The requirement is to convert the existing Microsoft Visual Studio built system to cmake built system.



As per cmake requirement, we have created CMakeLists.txt file for module "module1". Cmake does not understand or include .targets file directly. So, there is a need to put the equivalent logic of whatever steps are executed within the <Target> blocks in .targets file into the corresponding cmake statements in CMakeLists.txt file of module "module1".

So, is there any mechanism that cmake provides for doing that ?

Are there any examples of such work being done in the past, which we can refer to ?



Thanks & Regards



Ravi Raman

Xoriant Solutions Pvt. Ltd

4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA.

Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip Extn:1178| Fax: +91 22 30511111

ravi.raman at xoriant.com| http://www.xoriant.com





-----Original Message-----
From: David Cole [mailto:dlrdave at aol.com]
Sent: Wednesday, July 30, 2014 9:22 PM
To: Ravi Raman
Cc: cmake at cmake.org
Subject: Re: [CMake] Cmake issue regarding conversion of existing Visual Studio .targets files to cmake



To the best of my knowledge, CMake does not do anything with ".targets"

files. It doesn't know what they are, and it doesn't generate any of

them...



What is the function of the .targets files in your non-CMake build

system?



Perhaps somebody else who is more familiar with .targets files is

listening and can chime in. I'm not sure what to recommend for you.

add_custom_target and add_custom_command are commands you can use to

organize and execute custom build steps (as opposed to compiling source

files as part of an add_library or add_executable)



Maybe.... with the build system you can generate using CMake, you won't

even need the .targets files anymore. If you do need them, I'd be

curious to learn what it is your .targets file do and why you still

need them.





HTH,

David C.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140731/f95c8d2e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: target1.targets
Type: application/octet-stream
Size: 2140 bytes
Desc: target1.targets
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140731/f95c8d2e/attachment.obj>


More information about the CMake mailing list