[CMake] How to invoke a separate build with CMAKE_CUSTOM_TARGET?

Heine, Christian (EXTERN: VWGEDS) extern.christian.heine at volkswagen.de
Thu May 12 04:49:24 EDT 2011


Hi,

I'm not sure that I'm on the right path, therfore I will explain what I will do. I'm migrating our Linux project to Windows plattforms. Our project is build on several modules, which have to create and installed as libraries with cmake, some modules have dependencies to other modules. So far so good. This works fine on linux and windows.

Now I've implemented several demos for one of those modules. On Linux there is no problem, if I've installed the dependencies correctly I could build my demo executables and run them directly. But on windows platfforms I'm struggling. To run the executables it's required to place the required libraries besides the executable or in system32 folder ...

If I install the module dependencies with a cutstom install target to system32 folder I could ensure that those libraries could be linked by the executable at runtime. So I've got a behaviour like on Linux plattform for the module dependencies. But what is the best way to handling the library of the actual build? This file is placed to a lib subfolder which is differend from the demo executalbes (bin subfolder). 

First I've thought I could solve this problem if I copy the resulting dll to the demo executables folder with FILE COPY command. But this fails when I clean my build, while those dll doesn't exists after a clean. If i now run CMake again I got a file not found error ...

So I've thougt I could solve this problem with a CREATE_CUSTOM_TARGET command, i.e. make demo, which builds the demo sources separatelly and finally copy the dll from lib folder to executable folder. But how I could invoke a new make of my demo CMakeLists.txt with CREATE_CUSTOM_TARGET? 
I've tried several combinations but i fail.

What is the best way to solve this requirements? Or I'm completly on wrong path?

> Mit freundlichen Grüßen
> 
Christian Heine

T-Systems on site services GmbH
Procurement Systems

> E-Mail: extern.christian.heine at volkswagen.de
> 
--------------------------------------------------------------------------------

Christian Heine
Consultant
Alessandro-Volta-Straße 11, 38440 Wolfsburg
+49-5361-464 78-x (Tel.)
+49-5361-464 78-10 (Fax)
E-Mail: christian.heine at t-systems.com
Internet: http://www.t-systems-onsite.de 

Geschäftsführung: Stefan Kappe, Georg Rätker
Handelsregister: Amtsgericht Berlin HRB 51336
Sitz der Gesellschaft: Berlin
Ust.-Id Nr. DE 181 120 485

--------------------------------------------------------------------------------

Notice: This transmittal and/or attachments may be privileged or confidential. If you are not the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, or copying is strictly prohibited. If you received this transmittal in error, please notify us immediately by reply and immediately delete this message and all its attachments. Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110512/768bbf82/attachment.htm>


More information about the CMake mailing list