building multiple targets

72 views
Skip to first unread message

laforesp...@gmail.com

unread,
Jun 28, 2018, 2:41:01 PM6/28/18
to cmake4eclipse user mailing list
Hello everyone,

I would like to know if there is a mechanism to build more than one target other than having to hard-code a TARGET_IS_X or TARGET_IS_Y in a CMakeLists.txt ?

Here are some details about my problem : our project consists of three modules (targets) and each of them has a CMakeLists.txt file. Is there an easy way to compile them individually ?

Thank you,

Pierre-Marc

Martin Weber

unread,
Jun 28, 2018, 2:51:18 PM6/28/18
to cmake4ecl...@googlegroups.com
Am Donnerstag, 28. Juni 2018, 20:41:01 CEST schrieb
laforesp...@gmail.com:
Is this a question on cmake? I can't see how it is related to the
cmake4eclipse plugin?

Martin

--
Cd wrttn wtht vwls s mch trsr.


Message has been deleted

laforesp...@gmail.com

unread,
Jun 28, 2018, 7:32:53 PM6/28/18
to cmake4eclipse user mailing list
Hum maybe, maybe not. From what I understand, the plugin generates a cmake command like the following :

cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON -G Ninja -DCMAKE_TOOLCHAIN_FILE:STRING=toolchain.cmake "C:\\Users\\cmgpml\\Documents\\projets\\CMake_WS\\other_attempt".

Is is possible to somehow specify a build target to the plugin ? Is there a variable for this ? Sorry if its a dumb question or even unrelated to the plugin.

Pierre-Marc

Mads Andreasen

unread,
Jun 29, 2018, 2:30:46 AM6/29/18
to laforesp...@gmail.com, cmake4ecl...@googlegroups.com
If I understand you correctly - It's actually the next step you are looking for.
cmake doesn't actually make anything, it only generates the makefiles. 

In the properties for the eclipse project - c++ build section, there is a setting on what make target is to be called. Default is "all" but you can configure it to whatever target you want.


What would be nice is if the cmake4eclipse plugin could generate a list of targets and let you easily choose between them.

Venlig hilsen
Mads


--
You received this message because you are subscribed to the Google Groups "cmake4eclipse user mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cmake4eclipse-u...@googlegroups.com.
To post to this group, send email to cmake4ecl...@googlegroups.com.
Visit this group at https://groups.google.com/group/cmake4eclipse-users.
For more options, visit https://groups.google.com/d/optout.

Martin Weber

unread,
Jun 29, 2018, 2:46:31 PM6/29/18
to cmake4ecl...@googlegroups.com
Am Freitag, 29. Juni 2018, 08:30:31 CEST schrieb Mads Andreasen:
...
> What would be nice is if the cmake4eclipse plugin could generate a list of
> targets and let you easily choose between them.

Not easy to accomplish, since the available targets differ depending on the
generator and the CMakeLists.txt. For example, unless you add a
enable_testing() command, you won't get a 'test' target.

Mads Andreasen

unread,
Jun 30, 2018, 3:03:48 AM6/30/18
to fifteen...@gmail.com, cmake4ecl...@googlegroups.com
cmake can generate a list of targets, once cmake has been run on a cmakelists. Based on that it should be possible to generate build configurations?


Venlig hilsen
Mads


Reply all
Reply to author
Forward
0 new messages