How to Install IntWars
Step 1: Download IntWars and extract it to your desktop.
Step 2: Download MinGW.
Step 3: Download CMake
Step 4: Go to your Control Panel > System and Security > System > Advanced System Settings > Environment Variables... > System variables.
Alternatively, you can go to the Start menu > right click Computer > Properties > Advanced System Settings > Environment Variables... > System variables.
Find the "Path" variable and click "Edit..." Scroll to the very right of the text and add ";C:\Windows\System32" if it is not already in the "Path" variable.
Step 5: Install CMake and make sure to choose "Add CMake to the system PATH for current user."
Step 6: Install MinGW installer (I know, sounds weird). Then open the MinGW installer (it should be on your desktop). Click "Basic Setup" and mark both "mingw32-base" and "mingw32-gcc-g++" for installation. Then apply changes. Then you add "C:\MinGW\bin" to your "Path" variable in the same way as Step 3.
Step 7: Now, go to "IntWars-master\Intwars-master" from your desktop and open "GenerateMakeFiles.bat."
When that's done, open "CompileServer.bat."
And, when that's done, go to "build\gamed" and open "intwars.exe." Leave the command prompt window open.
Now go back to "IntWars-master\Intwars-master." Run "StartClient.bat."
P.S. If any firewall warnings appear, allow the program to use all types of networks.
EDIT: Would anybody be interested in a video tutorial?
Thanks for pointing out the resources and for designing CMake and writing the documentation. But speaking as someone who wanted to learn Modern CMake I found it difficult to find the material.
If you go to http://isocpp.org you see Get Started which points to stuff like A Tour of C++ or Elements of Modern C++ style. In fact, you would have to be a C++ programmer living under a rock, not to at least have heard about C++11/14 and all the benefits it brings.
When I go to CMake.org and go to documentation I see Training Materials including a CMake Tutorial. Clicking on the Tutorial, I am instructed about cmake_minimum_required 2.6. There is no good starting point that leads a beginner towards Modern CMake. I actually did not see your nice overview at http://www.cmake.org/cmake/help/v3.4/manual/cmake-buildsystem.7.html because it was in the Reference Manual section of the documentation, and I was looking more for a tutorial or overview.
Up until a few months ago, I really did not know about modern CMake, and learned about it from a fellow programmer. When I asked him if he knew a good overview of Modern CMake, he said he did not and had picked up most of his knowledge over time from bits and pieces of stack overflow answers.
I think Modern CMake is the perfect complement to Modern C++. However, as is evident just in this discussion, there are a lot of people in C++ who despise CMake because all they know is the old style CMake, and when they are exposed to Modern CMake are pleasantly surprised (see the reply of u/sazzer to u/doom_Oo7 for an example from this discussion).
Thanks again for making CMake a whole lot better.
Make sure you're using latest CMake version so that you'll know it has proper Visual Studio 2015 support. Same for GLFW, I just tested it with v3.1.1 source package and it works.
If you don't already have latest CMake version installed, uninstall old version and then install v3.3.1 (at the time of this post). Then extract glfw-3.1.1.zip archive, run CMake GUI, follow the directions in your linked tutorial about choosing source directory followed by picking a build directory, and then when you get to the CMake GUI Configure stage then you'll get a wizard starting off what project type to generator for, in this case you'll want just "Visual Studio 14 2015", keep using "Use default native compilers", hit Finish. The wizard dialog will close and a lot of entries in the listbox will be red. Just press Configure again and then press Generate which should be really fast.
Afterward browse to the glfw-3.1.1\build directory and open the GLFW.sln visual studio solution file. From there you should just build it and it then you can continue on from the tutorial.
Hopefully that works and the problem was that you previously chose the wrong generator during the first Configure CMake GUI stage.
Edit: If you made a mistake on choosing the generator you'll need to delete the CMake cache by going to File menu, selecting Delete Cache, and Yes for cache deletion confirmation prompt. Then press Configure button again to get the project generator wizard dialog again.
This will be the second time this week I mention CMake, because I'm a huge fan of it and it's made my life significantly easier. :)
Use whatever IDE (or lack thereof) you prefer on each platform. If CMake generates for it, then you should be able to get going on any platform pretty easily just by creating the meta-Makefile that it needs.
In general, if you use MSVC on your Windows box, there are probably ways to get GCC in there. If you stick with the MSVC compiler though, be aware that there are some things that MS will compile that GCC may not; be vigilant and test on both with each major check-in.
> I’d settle for a big list of all the CMakeLists.txt commands with explanations and when you’d want to use each
Might be biting off more than you can chew here, but here you go.
Unfortunately, I don't know of any such resources off the top of my head. Have you looked through the documentation and wiki at all? You may find something there. Apart from that, all I can really recommend is looking at some existing projects' CMakeLists and googling specific issues until you get more familiar with it.
WriteCompilerDetectionHeader depends on the CMake compile-features system. It is basically a database where they manually save which compiler supports which features. This has the drawback that they need to manually keep it up-to-date. For example, I am currently on Windows with cmake 3.3 and clang 3.6.2. But their database only works up to clang 3.4 or so, meaning that my compiler doesn't support any features at all, which is obviously not true (it supports at least all the features from 3.4). I got aware of this problem because I have used target_compile_features to activate C++11. Since clang 3.6 isn't supported, I couldn't enable C++11!
So I wrote this library yesterday in a couple of hours. It is based on CheckCXXSourceCompiles and CheckCXXCompilerFlag. This means that it automatically extends for any compiler. It detects the library based on whether or not a small code snippet containing the feature compiles. It thus works with any compiler on any system (except from the workarounds based on compiler extensions, of course).
Before you decide on a directory layout, you'll want to decide on your build system. I strongly recommend cmake. It's very popular, so you'll be able to find lots of examples of how to use it, and it's cross-platform, so you don't need to worry about platform incompatibility.
If you decide to use cmake, you'll be able to Google examples of how different people layout their directories. There are lots of different choices out there, so you'll just have to pick one that feels good to you.
Edit: Additionally, some people might say it's okay to start out with just manually writing a Makefile instead of using a build system. Personally, I don't recommend this, because I find that manually writing Makefiles offers nothing but needless suffering. Different people are going to have different opinions about the matter. My opinion is that a good build system will always save you an immeasurable amount of time and frustration over using raw Makefiles.
I have a search engine shortcut, using Chromium but I think other browsers support the same feature:
I have cmake-doc
set to:
- http://www.cmake.org/cmake/help/v3.1/search.html?q=%s&check_keywords=yes&area=default
And for cppreference.com I have cpp
set to:
- http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=%s&go=Go
I use these shortcuts very often.
Tutorial with screenshot: http://www.wordreference.com/tools/Chrome-search-shortcut.aspx
CMake also supports globbing for grabbing a list of files that match a specific pattern. This, in combination with CMake's foreach helped me out when I had similar pre-processing demands.
CPack (part of CMake) has supported WiX since 2.10. I don't think you get the kind of fine-grained control you'd get with a custom generator like you mentioned, but the upside is that your package-building scripts are relatively agnostic so it's easier to target multiple platforms.
In theory if they are doing CMake inspection they should grab the SOURCES property from each target to build up what files to reference. This should allow support for globs.
The best reference for global CMake variables is: http://www.cmake.org/cmake/help/v3.0/manual/cmake-variables.7.html
CMake is a build tool, they have a download link here: http://www.cmake.org/
Qmake is a tool that comes with Qt, which is a big GUI library. There's some instructions here: http://qt-project.org/doc/qt-4.8/install-win.html
They don't mention it, but you'll also need a C++ compiler. On Windows you can choose between Visual Studio (made by Microsoft), and MinGW, an open source port of GCC which comes from the Linux community. I'm not sure which compiler will be easier for you but I'd guess Visual Studio. Google for Express Edition (aka the free edition) and you'll find instructions.
When downloading Qt you get to choose between the binary version (precompiled) and open source- I haven't used Qt in a while but I would recommend binary version, it will be much faster to install, and it has better support.
Hopefully that gives you enough to get started. Sadly, setting up a dev environment on Windows tends to be a pain.
Check under Help -> Documentation.
Here's an example CMakeLists.txt from one of my personal projects:
cmake_minimum_required (VERSION 2.6) project (nbt)
find_package(Boost COMPONENTS iostreams REQUIRED)
link_directories ( ${Boost_LIBRARY_DIRS} ) include_directories ( ${Boost_INCLUDE_DIRS} )
add_executable (nbt nbt.cpp tags.cpp read.cpp write.cpp common.cpp text-write.cpp text-read.cpp )
target_link_libraries(nbt ${Boost_LIBRARIES} )
Running "cmake .." from inside my build folder sets up the Makefiles, so then I can just type make to build the project from in the build folder after that to build it. I don't have much experience in building VS projects with cmake but I imagine it's similar.
CMake sounds like something that you'd find useful. You make a simple CMake project file, and then on linux you can generate Makefiles from it, and on Windows you can generate a VS project from it.
As a former Dev-C++ lover, I would actually highly caution against it. The project hasn't moved in quite some time, and has extremely limited support for a lot of features that most IDEs have standard. There is zero support for refactoring (even renaming), you can't "Find Declaration/Definition", and you can't "Find References" and more. And until they start working on version 5 again (unlikely after so many years of silence), those features aren't going to come about easily.
Since the development of Dev C++ has stalled, a lot of open source libs have stopped making DevPaks, which were a particularly awesome killer app for the Bloodshed team.
I moved off Dev and started using Visual C++ Express about 2 years ago. I simply avoid features that would lock me to Windows, and double-check myself by default by coding in multiple platforms (this is made extremely easy with CMake, which generates .sln, XCode projects, Makefiles, and a bunch of other kinds of project files).
Ok, I have gotten it to work. And I have made a short guide. Forgive me if there are any errors, as I am not that adept with Visual Studio or compiling in general.
These directions work so that you do not need to modify the compile.m file. If you used different installation directories than the default, you will need to edit this file. Im using Visual Studio 2008 on a Windows 7 x64 machine.
Hope this works for you guys.
EDIT: Disregard the above guide. I am having trouble run_TLD.m to run now. The error message I am getting is that the compiled mex files are not valid Win32 applications. If anyone can get this running on a 64-Bit Windows, machine please let me know.
I don't have a Windows machine handy here.
The build system uses CMake. CMake can make Visual Studio project files, among others.
Here's some info on how that works: https://cognitivewaves.wordpress.com/cmake-and-visual-studio/
CodeLite has a CMake plugin which allows you to generate CMakeLists.txt files for your project(s).
But more important, CMake supports CodeLite (i.e. you cn geneate CodeLite workspace / projects from CMakeLists.txt file(s)) : http://www.cmake.org/cmake/help/v3.0/generator/CodeLite.html
Your CMake comments tell me that you haven't reviewed the system recently.
CMake 3.1 introduced C++11/14 support for clang and gcc, and 3.2 will include MSVC.
The configure_file or file commands can be used to copy files from source to build directory. This goes for the majority of commands that cmake -e provides.
CMake 2.8.X series did away with the requirement for endif/else/etc parentheses to have content. Just leave them blank, all modern CMake code does that.
A good review of the abilities of CMake 3.X is the new build system documentation. http://www.cmake.org/cmake/help/v3.1/manual/cmake-buildsystem.7.html
(I think) he meant that the wallpaper resemembles the logo of the CMake program (a software developer tool). The colors are even at the right sides of the triangle, only yellow is not used in the CMake logo.
If your library is on your link path, you can link to it just by name, otherwise you can hard-code the full path (if you only care about it working locally, that is).
add_executable(foo ...) target_link_libraries(foo my_local_lib.a) include_directories(/path/to/header/files)
To get this working in a more robust (i.e. work on other machines besides your own) way, you'd want to use at least the find_library command. Hopefully this helps with your question; if not, let me know what is still unclear.
GNU Global Because being able to call up a function's source with one keystroke is a great learning tool. CMake CMake takes a little learning but it is great to just have make files generated as well as to have lib's just found for you on each platform
Emacs/VIM/Code::Blocks
There are projects that do it both ways. SFML includes it's libraries in it's source control, while The Mana World requires that people assemble the required dependencies themselves.
It really depends on several different factors. If the libraries you use can be included as their source (not the compiled library) and their license allows redistribution, then it's probably not a bad idea to include them. That way you can ensure that everyone is using the same version of the library, and makes it easier to compile the project. On the other hand, if you have a lot of different libraries, it might make it tougher to manage them all in your source control. Then there's the question about whether you really should keep other projects source code in your repository.
I would definitely not include any binaries in source control, so if it's a compiled library I would automatically not include it. Also, as I mentioned before, be sure the license of the dependency allows for redistribution.
EDIT: As pnpbios said, running ./configure is suppose to check and make sure if the users have the libraries installed and the Makefile does all the work linking the libraries. I started using CMake for my project and it makes it really easy to build a system to ensure users have the proper dependencies and then linking them (although, learning how to write cmake scripts has a learning curve).
> I thought visual studio was a compiler?
Visual Studio is an IDE that comes with a compiler.
The way I would attempt this is to have one location for all your project files that is visible to both Windows and Ubuntu. It will have to be on an NTFS formatted drive/partition. Use CMake to manage the build process. I suggest having separate build directories for Windows and Linux, but make sure to use the same source directories.
On Windows, use CMake to create a VS solution directly. On Ubuntu, use CMake to create a Makefile, then create a NetBeans project from the existing source and have it use that Makefile.
That should allow you to code in Visual Studio on Windows, in NetBeans on Linux, and have the changes you make in one visible in the other. Make sure to normalize line endings to either the Windows standard or the Linux standard else you may have formatting issues with vertical whitespace. There should be a setting in the IDE somewhere or at least a plugin that can handle it.
If you really want to use NetBeans on both Windows and Linux, you will need to install Cygwin or MinGW on Windows so that you can use the GNU toolchain. This doesn't prevent you from doing the above as well. I would still advise using CMake to manage everything.
Im sure what you are looking for is a kind of make system. Take a look at CMake which builds your project using the system's native compiler. If you are on Unix (Linux/Mac) it will use Make and if you are using Windows it will actually generate the Visual Studio project files for you.
You could also set up a build automation tool like BuildBot which compiles your software at a given time (e.g. every day) or every time you make changes.
Take a look at this list for more tools.
If the project uses cmake instead, you have two options.
From the command line, the steps are:
You can write it on any platform as long as it's compiled individually for each target platform. Just use standard C++ and cross-platform libraries and avoid compiler- and platform-specific extensions. While compiling on one platform for another is possible, I think it's easier to copy the code and compile on Windows for Windows and compile on Linux for Linux, regardless of the platform on which the code was written. CMake can help manage that.
Seems like your issue isn't so much how to compile as much as how to use external code from inside Visual Studio. All you should need to do is add the source files from the library into the project. Just right click on the project then go to Add->Add Existing Item. It would probably be a good idea to keep the library files in their own folder too. Then you just #include
them where you need them.
Outside of VS is essentially the same thing, you just need to make sure all the implementation files are passed to compiler and linked properly. When using libraries and many source files, it's often easier to use a build system, like CMake, to get the job done.
The website has examples and documentation.
Ah ha, OK, much better. Sounds like you haven't installed cmake... it's not a part of windows, but it's a quick download and install. Once complete, open a new command window, get back to the build dir, and try the command again.
Edit: http://www.cmake.org
Edit 2: You do have Visual Studio 2017 installed, right? If not, that's required as well, get Community Edition, it's free... you don't need all of it, but you need stuff related to C and C++
> cmake (written in C++) - so huge and bloated, compilation takes longer than compiling GCC (!). It's not even possible to create freestanding Makefiles, since the generated Makefiles call back into the cmake binary itself. Usage of cmake requires learning a new custom scripting language with very limited expressiveness. Its major selling point is the existence of a clicky-click GUI for windows users.
I tried all I could but failed anyways, I guess you could say that I'm a linux noob.
This is the code I tried to use
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-6 g++-6 make
sudo apt-get install git libcurl4-openssl-dev build-essential libjansson-dev autotools-dev automake
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1 --slave /usr/bin/g++ g++ /usr/bin/g++-5
curl -L http://www.cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xvzf - -C /tmp/
cd /tmp/cmake-3.4.1/ && ./configure && make && sudo make install && cd -
sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
sudo apt install libmicrohttpd-dev libssl-dev libhwloc-dev
git clone https://github.com/fireice-uk/xmr-stak.git
cd xmr-stak/build
cmake ..
make install
However when I tried to do cmake and make install at the end I just got error messages so I didn't even get to start the miner.
CMake (Kitware) could have a website where one could see which projects could be used by External Project
CMake already shipps lots of Find Package *.cmake files.
Having only CMake doing this would be great.
BiiCode needed setup, needed Python, needed hacking existing CMake files. I tried to reuse OpenSSL biicode cmake files, I gave up and used OpenSSL perl build system instead.
For my own project I use CMake with ExternalProject for handling dependencies. Using this setup still has a lot of problems but almost every single library that uses CMake can be setup with ExternalProject in about 10 lines of CMake.
ld.exe: cannot find -lglew
Well then it looks like you have to find glew! Usually when you are trying to link to an external library, you will use CMake's module system to locate them.
> I have tried CMake, but I have never met a software so badly documented. Really, I can't understand how CMake works. From what I have read, I am not alone. At the moment, I am trying to make things work with a generic Makefile.
If Makefile is OK for you, you should stick to it.
Cmake is good for large, cross-platform application development.
In Emacs, you can install cmake-mode and cmake-help-command
to read the manual.
You can also install company-mode which support out of the box (online doc, auto-completion).
It's documentation is actually fine. If I have any questions I just contact the cmake developers who are very responsive and helpful.
check http://www.cmake.org/Wiki/CMake/Editors/Emacs for more details.
> And you'd never know there was such a PREFIX_PATH if you weren't inclined to read through the list of hundreds of cmake variables.
> I have no clue how do I install CMake.
On Linux, apt-get install cmake
, for everything have a look at http://www.cmake.org/
> Also, is It supposed to be c++11 ?
The code itself, yes, that looks like C++11. As for cmake, git and Co. those don't really have anything directly to do with C++ or C++11, that are just programming tools that are commonly used.
Disclaimer: I am a Linux-user and haven't done much on Windows in ages.
GCC is really a good compiler and in the latest versions even the error-messages tend to be somewhat readable; it is basically the default on Linux and 5.0 (awaited this spring) will finally provide complete support for the latest versions of the standard. Which means that it is clearly ahead of Visual Studio.
Concerning the Windows-version (=mingw): It apparently has a few issues because the companies that invest in GCC aren't interested that much concerning Windows. One thing that I know to be bad is that a certain random-number-generator creates predictable output on Windows even though it shouldn't.
Concerning /u/STL: He is a member of the standards-committee and the maintainer of Microsofts standard-library, so he probably knows what he is doing. IIRC he said that he doesn't fix bugs in mingw though, but only packages it. (This is pure speculation on my side, but I assume that he wants to avoid getting into trouble with his employer. @Stephan: Please tell me if I am completely wrong here.)
So, keep the problem with random numbers in the bag of your head and go for it. If you need a good text-editor, you can take Notepad++ or, if you are willing to put effort into learning it, Vim. Once you get to the point that you have many files that you don't want to compile by hand anymore, take a look at cmake; it isn't particularly great, but it is what most people know these days and the alternatives aren't that much better.
No extension. This is relatively normal from what I've read.
Got them from the website
there are instructions for building and installing from source but not what to do with the prebuilt binaries.
I believe the current cleanest way is: http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
In theory I could see CMake adding a target level property to enable mt/d, but no developer has pushed/added that feature, presumably because it isn't a common use case for them.
I use:
I do this all on Mac OS X. If you use homebrew
you can pickup openocd and cmake from it, but gcc-arm-embedded is only from their site I believe.
For editors, you can pretty much use anything you want. CMake supports Eclipse, Code::Blocks and Sublime Text out of the box (among a ton of others.) I usually just use vim.
For bonus points, I construct my projects like this:
By doing your project this way, you can develop your tests, etc. all on your host with only a thin layer of target (ARM) implementation as needed.
It is a bit of a pain to upload really. By the time I've done it you'll have it built in cmake.
At this s age, for me, it looks like:
Source: C:\Source\IntWars\
Build: C:\Source\IntWars\Build
Build is an empty folder.
Then click on configure, and choose Microsoft Visual Studio 12 as the Generator, and make sure "Use default native compilers" is checked.When that's done, click configure again, and then click generate.
This should give you all the solution files in the build folder.
> I'm looking at Make from the point of a build tool
Make is not a build tool. It is an utility which processes dependencies. The build process is not handled by make. The build process is handled by other tools which, among other things, generate makefiles. The GNU build system does that, and so does cmake.
That's all the make routine does: read a list, define a dependency tree, check which branch needs to be updated, run the commands to update those branches. That's all.
It is patently clear that you are completely clueless about Make and makefiles. And still, you bitch about them.
I suggest you spend less time complaining and more time getting an idea what you are talking about. Until then, this discussion is pointless.
Most projects I've seen use GNU autotools: http://en.wikipedia.org/wiki/GNU_build_system#GNU_Automake
More infrequently I see people using CMake: http://www.cmake.org/
I briefly used autotools a few years ago to set up the project I've been working on for a while and I remember it being fairly easy to setup.
Alternatives? Umm, I'd vote for CMake or plain make + pkg-config. IMO, CMake's only sin is that it uses arcane, custom-built language when it could have used, e.g., Lua instead. (To be fair, Kitware is experimenting with this -- see http://www.cmake.org/Wiki/CMake:Experiments_With_Lua)
As for "understanding" -- it's not hard to understand to how to write a basic AC/AM-based project... what IS hard to understand, though, is the MESS ./configure generates. And if it breaks in the process (as it often does on non-GNU systems like Solaris), it's a hell to make it work.
Furthermore, POSIX is pretty much the standard where configure is used, and all of that crap it's checking for is totally unnecessary. Setting the compiler, etc. can be done by tweaking few variables in a plain Makefile.
Also, it generates recursive makefiles. There's a paper called "Recursive make considered harmful" (http://miller.emu.id.au/pmiller/books/rmch/) -- read it.
Finally, if you want to "understand" autocrap, do the following project: take an installation of Solaris for Intel, and try to build a few non-trivial configure-based packages and solve the problems you've encountered. Also, do it by using "cc" (Solaris studio), instead of "gcc". For bonus points, do NOT run the package-provided ./configure script, but try to regenerate it with autoconf and automake. Then write about that.
Most of the trouble you're going to encounter is because most of the configure-based projects out there are written by incompetent people who thought they "understood" configure, with the end result being that it kinda works on Linux, but not anything else a bit exotic. Which kinda defeats the point of configure...
> I decided already a while ago to write a replacement for all of these but to have it integrated in one project.
What about CMake ? It seems to be what you are looking for, and it's already used by big projects like KDE.
I was in a similar boat. SDL is pretty good for graphics (and SDL_Mixer for audio), but I've heard that SFML is worth looking into as a point of comparison.
Now, as for cross-platform development toolchains: CMake is amazing and everyone should use it for this purpose. It processes a meta-Makefile of your creation, and then outputs a Makefile or an IDE project (Visual Studio solution, Xcode Project, etc.). You can imagine how much easier cross-platform dev becomes when you can use CMake to generate whatever you need for development on your platform. :)
I'd recommend trying out CMake. I switched and never went back. The config files are much cleaner and cross compiling is simple. That combined with CPack makes packaging your builds easy. http://www.cmake.org/
It's Cocoa native.
Calligra is not available via macports yet but KDE Mac developers told me it should build out-of-the box, no special configuration needed.
You may want to try getting kdelibs4 from macports, then downloading the source code from https://projects.kde.org/projects/calligra . It requires XCode, CMake (which you can download from http://www.cmake.org) and a few other dependencies. CMake will tell you which dependencies are required and usually they are available from Macports too.
There is an IRC channel where you can get more help (#kde-mac, Freenode).
As a tip, if you're coding standard C++ and want interchangeability between G++ and Visual Studio, use CMake. It's a great little tool that takes a meta-makefile and outputs a Makefile for your 'make' environments (Linux, OS/X terminal), and outputs a Visual Studio .sln on Windows if you specify Visual Studio as the environment. I've been able to seamlessly transition between OS/X and Windows C++ dev with it. :)
Usually you use tools to manage the projects for you, and organize within those tools. Eclipse and Visual Studio projects do just that. If you're looking to stay out of IDE's, you can use a build system like Autotools or CMake. I'd recommend the latter of the two, though the former is very widely used.
As to versioning, I'd suggest Git, which comes with a pretty good tutorial built in. Searching Google for "git tutorial" will give you plenty of results as well.
Since your question has already been answered, I just want to point you to a cross-platform tool to help manage your software projects: CMake. It can generate Visual Studio projects, or generate Makefiles in Unix, all from the same source.
Cmake does have a function/tool for fetching and building dependencies:
Granted it is much, much easier to get this working right if the external project is a CMake project, but it does build other types of projects as well.