Jump to content

  • Log In with Google      Sign In   
  • Create Account

Supporting multiple IDE's, Os's, etc...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 NiteLordz   Members   -  Reputation: 423

Like
0Likes
Like

Posted 11 February 2013 - 03:59 PM

Currently i have my engine that supports Win 7, linux, iOS, and Android.  I use eclipse, xcode and visual studio 2010.  However, now i want to integrate windows 8 and visual studio 2012.

 

My problem is, that project files have the same file extension between VS2010 and VS2012.  This is nice for a few reasons, but not nice for some reasons.

When i check my code in via VS2010, and want to work on the code in VS2012, the project files get upgraded, and then they can not be checked back in.

 

I have checked into CMake, and it is nice, as then the project files are not part of source control, instead then would be built upon source checkout.

 

I like this, however, i am not very good with CMake.  Does anyone have any experience with it?  I use Property Sheets to setup my libraries and sample applications.  

 

1) How do you incorporate Property Sheets into CMake

 

my next issue with CMake is that the projects that it creates, sets a bunch of default values inside of the project properties.

 

2) How can i set the values to be "Inherit From Parent" 

 

3) Is there a better solution then using CMake

 

Thanks much for any help

 

 

 


Code makes the man

Sponsor:

#2 Hodgman   Moderators   -  Reputation: 30432

Like
0Likes
Like

Posted 11 February 2013 - 07:14 PM

1) I'm not sure. You only seem to be able to set values directly, so you might have to port the values from your property sheets into the CMake config.
2) I'm not sure, you only seem to be able to set concrete values... For example, I set the compiler and linker settings via their command-line options, and then this is recognised inside the MSVC config screen so that the correct drop-down values appear.
  set( CMAKE_CXX_FLAGS_RETAIL        "/EHsc- /GR- /GS- /arch:SSE2 /fp:fast /W3 /WX /Oi /Ob2 /O2 /Zi /GL /Oy /GF /MT" )
  set( CMAKE_EXE_LINKER_FLAGS_RETAIL "/MANIFEST:NO /INCREMENTAL:NO /LTCG /OPT:REF" )
3) There are alternative "meta-build systems", such as Premake. I haven't gotten around to testing out others yet.
CMake has served me well so far, and has really proved to me that "meta-build systems" are a great idea (not committing the solution/project files to source control is really handy)... but over time my CMake scripts have gotten more and more complex, and figuring out how to set certain compiler options sometimes takes me a lot longer than I'd like... So I want to try out Premake and other alternatives some time.

Edited by Hodgman, 11 February 2013 - 07:15 PM.


#3 AllEightUp   Moderators   -  Reputation: 4217

Like
1Likes
Like

Posted 11 February 2013 - 08:14 PM

Currently i have my engine that supports Win 7, linux, iOS, and Android.  I use eclipse, xcode and visual studio 2010.  However, now i want to integrate windows 8 and visual studio 2012.

 

My problem is, that project files have the same file extension between VS2010 and VS2012.  This is nice for a few reasons, but not nice for some reasons.

When i check my code in via VS2010, and want to work on the code in VS2012, the project files get upgraded, and then they can not be checked back in.

 

I have checked into CMake, and it is nice, as then the project files are not part of source control, instead then would be built upon source checkout.

 

I like this, however, i am not very good with CMake.  Does anyone have any experience with it?  I use Property Sheets to setup my libraries and sample applications.  

 

1) How do you incorporate Property Sheets into CMake

 

You don't use CMake to generate property sheets as the reason for them is redundant with the problems CMake solves.  The general reason for property sheets is to insert include paths, libraries, preproc defines etc into the build so you don't have to constantly add all those things to individual derivative projects.  CMake solves this problem in a different way which removes the need for property sheets.

 

The concept which is missed very often is that the output solutions/projects/makefiles/whatever are supposed to be used for a single type of build.  What I mean is that you might make a "XCode" directory, cd into it and then type in "CMake ./" to build your solution on an OsX box, but that will be building a target "for" XCode and OsX by default.  If you want to target the same code for some other thing (the purpose of property sheets, kinda), you need to add a target designation and put all that property sheet work into the CMake files so the generated output builds against the intended SDK (OsX versus Ios) and all the other variations.  It is a pain in the ass in general but once done, it's easy to just reuse, much like the property sheets.  Unfortunately I don't have an active example of this way of using CMake I can post but I will post a fairly detailed and complete (though missing all the porting items you are asking about) link to a project using CMake below.

 

my next issue with CMake is that the projects that it creates, sets a bunch of default values inside of the project properties.

 

2) How can i set the values to be "Inherit From Parent" 

You can't directly.  Again, CMake's purpose replaces this functionality and you need to use CMake to work around it.

3) Is there a better solution then using CMake

I wish.  I both love and hate CMake.  The abilities it supplies are wonderful. but the "language" sucks hairy donkey nuts.  There is Premake which is quite nice except it lacks the maturity of CMake and as such misses integration with QT, *nix replacement of autoconf, etc which limits it's usability.  Not to mention XCode updates tend to lag behind hugely.

Thanks much for any help

 

As a possible suggestion for figuring out CMake and how to inherit setup, I'll post a link to my recent rewrite of my game object system.  Please keep in mind this is only a couple days old and is a complete rewrite, so if you go poking about the actual code you'll likely notice plenty of issues.  But the CMake portion is fairly solid for showing how to inherit things from section to section.  https://github.com/All8Up/libgo.git

 

I haven't fully cleaned up the CMake stuff but the general idea should be usable.  I break things into little tiny libraries each with it's own CMakeLists.txt, export the information required to include/link/define needed items for inheritors etc.  This is basically the concept of property sheets used in CMake.



#4 Shannon Barber   Moderators   -  Reputation: 1362

Like
0Likes
Like

Posted 11 February 2013 - 10:56 PM

If you want to support 2 IDE's, you need 2 sets of project files.

 

e.g. make a sub-dir msvc10 & msvc11 and keep the respective project files under each.

 

If you go the make route and want to be portable and cross-platform, then one way is to use cygwin on Windows and GNU utilities directly on other platforms and you can use GNU make.  This can be particular useful because then you have a shell on Windows and can use perl/awk/sed etc... to build source files on-demand.  For example one of my rules creates a version.h file by pulling the Mercurial ID & hashes into variables (and then it's compiled into the code and can never be wrong.)


Edited by Shannon Barber, 11 February 2013 - 10:57 PM.

- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS