www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - CMake for D

reply Kai Meyer <kai unixlords.com> writes:
I have some D code that I would like to integrate into an existing CMake 
infrastructure. I've seen these two projects:
http://www.dsource.org/projects/cmaked
http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/cmake/modules/language_support/cmake/Platform/

Both are quite old. Can anybody comment on the usability of either of 
these projects? Or perhaps point me to another project that will work?
Feb 13 2012
parent reply Gour <gour atmarama.net> writes:
On Mon, 13 Feb 2012 12:15:23 -0700
Kai Meyer <kai unixlords.com> wrote:

 Both are quite old. Can anybody comment on the usability of either of=20
 these projects? Or perhaps point me to another project that will work?
Try with newer: http://code.google.com/p/cmaked2/ Sincerely, Gour --=20 The working senses are superior to dull matter; mind is higher=20 than the senses; intelligence is still higher than the mind;=20 and he [the soul] is even higher than the intelligence. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
Feb 13 2012
parent reply bioinfornatics <bioinfornatics fedoraproject.org> writes:
Le lundi 13 f=C3=A9vrier 2012 =C3=A0 20:45 +0100, Gour a =C3=A9crit :
 On Mon, 13 Feb 2012 12:15:23 -0700
 Kai Meyer <kai unixlords.com> wrote:
=20
 Both are quite old. Can anybody comment on the usability of either of=
=20
 these projects? Or perhaps point me to another project that will work?
=20 Try with newer: http://code.google.com/p/cmaked2/ =20 =20 Sincerely, Gour =20
Maybe send a pull request to main cmake repo will be better. It is always better to put code to upstream
Feb 13 2012
parent reply Gour <gour atmarama.net> writes:
On Tue, 14 Feb 2012 01:37:20 +0100
bioinfornatics <bioinfornatics fedoraproject.org> wrote:

 Maybe send a pull request to main cmake repo will be better. It is
 always better to put code to upstream
I did ask in the mailing list (sometime ago) about the procedure to include it to upstream, but got no replies and then have become interested for premake which is getting D support. Sincerely, Gour =20 --=20 The devotees of the Lord are released from all kinds of sins=20 because they eat food which is offered first for sacrifice.=20 Others, who prepare food for personal sense enjoyment,=20 verily eat only sin. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
Feb 13 2012
parent reply "Igor" <igor prettysin.info> writes:
On Tuesday, 14 February 2012 at 07:35:26 UTC, Gour wrote:
 On Tue, 14 Feb 2012 01:37:20 +0100
 bioinfornatics <bioinfornatics fedoraproject.org> wrote:

 Maybe send a pull request to main cmake repo will be better. 
 It is
 always better to put code to upstream
I did ask in the mailing list (sometime ago) about the procedure to include it to upstream, but got no replies and then have become interested for premake which is getting D support. Sincerely, Gour
Project (https://code.google.com/p/cmaked2/) seems to be dead :( Any alternatives??
Mar 23 2014
next sibling parent "ed" <sillymongrel gmail.com> writes:
On Monday, 24 March 2014 at 05:44:37 UTC, Igor wrote:
 On Tuesday, 14 February 2012 at 07:35:26 UTC, Gour wrote:
 On Tue, 14 Feb 2012 01:37:20 +0100
 bioinfornatics <bioinfornatics fedoraproject.org> wrote:

 Maybe send a pull request to main cmake repo will be better. 
 It is
 always better to put code to upstream
I did ask in the mailing list (sometime ago) about the procedure to include it to upstream, but got no replies and then have become interested for premake which is getting D support. Sincerely, Gour
Project (https://code.google.com/p/cmaked2/) seems to be dead :( Any alternatives??
I'm using CMaked2. When I upgraded to cmake 2.8.10 I had to patch it, very simple sed, due to a breaking change in CMake itself. See this link: http://public.kitware.com/pipermail/cmake-developers/2012-October/005535.html In summary: --- * Replace CMAKE_PLATFORM_ROOT_BIN by CMAKE_PLATFORM_INFO_DIR everywhere * Replace ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY} by ${CMAKE_PLATFORM_INFO_DIR} in just the few places which involve a *.cmake file. --- All I did was sed the above for all *.cmake and *.in files in cmaked2 then make/install cmaked2. The LDC guys use CMake and may have a better option for CMake+D also. Cheers, ed
Mar 23 2014
prev sibling parent reply "Dragos Carp" <dragoscarp gmail.com> writes:
 Any alternatives??
I moved cmaked2 to github [1], updated and simplified the usage a little (system cmake patch not necessary anymore). You can give it a try. Dub registry support is also on the way. Regards Dragos [1] - https://github.com/dcarp/cmake-d
Mar 24 2014
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 3/24/14, 4:55 PM, Dragos Carp wrote:
 Any alternatives??
I moved cmaked2 to github [1], updated and simplified the usage a little (system cmake patch not necessary anymore). You can give it a try. Dub registry support is also on the way. Regards Dragos [1] - https://github.com/dcarp/cmake-d
Fantastic, thanks Dragos!! A fellow Romanian it seems :o) -- Andrei
Mar 24 2014
prev sibling next sibling parent reply "Trent Forkert" <trentforkert gmail.com> writes:
On Monday, 24 March 2014 at 23:55:14 UTC, Dragos Carp wrote:
 Any alternatives??
I moved cmaked2 to github [1], updated and simplified the usage a little (system cmake patch not necessary anymore). You can give it a try. Dub registry support is also on the way. Regards Dragos [1] - https://github.com/dcarp/cmake-d
Heh, seems I waited a bit too long, eh? I've been gearing up to do an initial release of some modifications to CMake that give better D support. (To clarify: this isn't being merged upstream yet, but hopefully that'll happen eventually) While the approach taken by CMakeD2 and cmake-d gets a good amount of the way there, it lacks key CMake features. Namely: Visual Studio support, which unfortunately requires patching the C++ source. The module-only approach also cannot support LDC (save via ldmd, which is not ideal), as CMake will think it is a linker. There were other problems I encountered that required changes to the C++ code as well, though I don't recall what they were off the top of my head. I'm curious to see how you intend to do dub support, though. - Trent
Mar 24 2014
parent "Trent Forkert" <trentforkert gmail.com> writes:
On Tuesday, 25 March 2014 at 01:15:10 UTC, Trent Forkert wrote:
 On Monday, 24 March 2014 at 23:55:14 UTC, Dragos Carp wrote:
 Any alternatives??
I moved cmaked2 to github [1], updated and simplified the usage a little (system cmake patch not necessary anymore). You can give it a try. Dub registry support is also on the way. Regards Dragos [1] - https://github.com/dcarp/cmake-d
Heh, seems I waited a bit too long, eh? I've been gearing up to do an initial release of some modifications to CMake that give better D support. (To clarify: this isn't being merged upstream yet, but hopefully that'll happen eventually) While the approach taken by CMakeD2 and cmake-d gets a good amount of the way there, it lacks key CMake features. Namely: Visual Studio support, which unfortunately requires patching the C++ source. The module-only approach also cannot support LDC (save via ldmd, which is not ideal), as CMake will think it is a linker. There were other problems I encountered that required changes to the C++ code as well, though I don't recall what they were off the top of my head.
Realized late last night that I misspoke. LDC and LDMD will both be detected as a linker, and the change to fix that doesn't touch the C++ source, but it does need to be done in CMake's internal modules. - Trent
 I'm curious to see how you intend to do dub support, though.

  - Trent
Mar 25 2014
prev sibling next sibling parent "ed" <sillymongrel gmail.com> writes:
On Monday, 24 March 2014 at 23:55:14 UTC, Dragos Carp wrote:
 Any alternatives??
I moved cmaked2 to github [1], updated and simplified the usage a little (system cmake patch not necessary anymore). You can give it a try. Dub registry support is also on the way. Regards Dragos [1] - https://github.com/dcarp/cmake-d
You beat me to it :) I was going to github my version today at work but I'll drop it now and work from your repo. Thanks setting it up! Cheers, ed
Mar 24 2014
prev sibling next sibling parent "Chris Piker" <chris hoopjump.com> writes:
On Monday, 24 March 2014 at 23:55:14 UTC, Dragos Carp wrote:
 I moved cmaked2 to github [1], updated and simplified the usage 
 a
 little (system cmake patch not necessary anymore). You can give
 it a try. Dub registry support is also on the way.

 [1] - https://github.com/dcarp/cmake-d
Verified tested and working on CentOS 6.5 with cmake28 package from epel repository. Thanks! -- Chris
May 08 2014
prev sibling parent reply "Chris Piker" <chris hoopjump.com> writes:
On Monday, 24 March 2014 at 23:55:14 UTC, Dragos Carp wrote:
 I moved cmaked2 to github [1], updated and simplified the usage 
 a little (system cmake patch not necessary anymore). You can 
 give
 it a try. Dub registry support is also on the way.

 Dragos
What is the best way to specify a mixin include directory for dmd under CMake? I can arbitarily add a -J option to the compiler flags but should the cmake-d module include a variable that should be set? -- Chris
May 09 2014
parent reply "Trent Forkert" <trentforkert gmail.com> writes:
On Friday, 9 May 2014 at 21:11:54 UTC, Chris Piker wrote:
 On Monday, 24 March 2014 at 23:55:14 UTC, Dragos Carp wrote:
 I moved cmaked2 to github [1], updated and simplified the 
 usage a little (system cmake patch not necessary anymore). You 
 can give
 it a try. Dub registry support is also on the way.

 Dragos
What is the best way to specify a mixin include directory for dmd under CMake? I can arbitarily add a -J option to the compiler flags but should the cmake-d module include a variable that should be set? -- Chris
The way I've tackled that in my (still work-in-progress) CMake fork[1] is to add an `include_directories(TEXT ...)` signature. Unfortunately, you'll need to build my CMake from source, though that isn't difficult. Also, while I am hopeful about getting my changes merged upstream, there is no guarantee of that, so proceed with caution. Do note that my CMake work is independent of CMakeD2 and its forks. See my project wiki for more info. - Trent [1] https://github.com/trentforkert/cmake
May 09 2014
parent "Chris Piker" <chris hoopjump.com> writes:
On Friday, 9 May 2014 at 21:43:04 UTC, Trent Forkert wrote:

 The way I've tackled that in my (still work-in-progress) CMake 
 fork[1] is to add an `include_directories(TEXT ...)` signature.
I like that, it seems clean.
 Unfortunately, you'll need to build my CMake from source, 
 though that isn't difficult. Also, while I am hopeful about
The standard CMake build instructions just don't work on the CentOS 6.5 systems we are currently using at work. I gave up after 2 hours. Since CMakeD2 is working for me I'm sticking with it for now but...
 getting my changes merged upstream, there is no guarantee of 
 that, so proceed with caution.
... it would be great to have better D support in CMake, I really hope your changes do get committed upstream. I plan on using D somewhat quitely for about a year and after I've worked out the gotcha's start talking to my programming friends. An upstream merge would get used.
 Do note that my CMake work is independent of CMakeD2 and its 
 forks. See my project wiki for more info.

 [1] https://github.com/trentforkert/cmake
Thanks, I'll check it out. -- Chris
May 09 2014