Tag Archives: Visual Studio

Logitech Illuminated Keyboard

I guess you could call me a Logitech fan boy. I really love Logitech. They’ve always made peripherals that I’ve been impressed with. For many years I’ve been typing on a G15 (The older G15 with 18 macro keys, not the newer edition) or G11 keyboard. I’ve always loved the way they functioned and how smooth typing felt.

Logitech Illuminated Keyboard

At my new programming job I had to work on an iMac for the first few weeks. While I don’t like Macs that much, I do love the Apple keyboard. It has the feel of a laptop keyboard. Really, I think I loved it way too much because now I can’t go back to a G15/G11 keyboard. Typing on it feels too “bulky”. The keys are huge in comparison. This basically started a hugekeyboard battle. I started buying a lot of keyboards, trying to find one that wasn’t made by apple but had the “slim” keys that felt super nice to type on. I eventually came across the Logitech Illuminated Keyboard.

Coming from a G15 keyboard which is loaded with extra non-standard keys (media keys, macro keys, etc), you’d think that this keyboard wouldn’t be advanced enough. The thing is, it doesn’t have to be. It has all the features I need:

  • Media Keys: Pause/Play, Next, Previous (It is missing a ‘Stop’ key, but I can live without it).
  • Numpad (Yes, this is important. The diNovo Edge does not have one).
  • Volume control keys (Up, Down, Mute).

I never really used the G15/G11 macro keys for anything important. I used them for a few things in Visual Studio, but I can live without them. Anyway, if anyone is looking for a great and inexpensive keyboard, the Logitech Illuminated Keyboard is for you.

CMake

For many years after college, I was used to maintaining Visual Studio projects. Once I got into portable programming, it became pretty obvious that I wouldn’t be able to use Visual Studio on every platform, such as Linux or Mac. I began looking at more portable build systems, such as SCons. While these systems were indeed portable, they had one major downside. They required that you sacrifice what kind of editor or IDE you like to work in. For example, I would have to create a Visual Studio Makefile project and maintain that separately for Windows just so I could use Visual Studio + SCons. However, this defeated the purpose (i.e. I was still maintaining platform-specific projects).

In about 2006, I found out about a build system called CMake. I would describe it in my own words, but I think a quote from the CMake about page would explain it better:

CMake is an extensible, open-source system that manages the build process in an operating system and in a compiler-independent manner. Unlike many cross-platform systems, CMake is designed to be used in conjunction with the native build environment. Simple configuration files placed in each source directory (called CMakeLists.txt files) are used to generate standard build files (e.g., makefiles on Unix and projects/workspaces in Windows MSVC) which are used in the usual way. CMake can compile source code, create libraries, generate wrappers and build executables in arbitrary combinations. CMake supports in-place and out-of-place builds, and can therefore support multiple builds from a single source tree. CMake also supports static and dynamic library builds. Another nice feature of CMake is that it generates a cache file that is designed to be used with a graphical editor. For example, when CMake runs, it locates include files, libraries, and executables, and may encounter optional build directives. This information is gathered into the cache, which may be changed by the user prior to the generation of the native build files.

I’ve been using CMake ever since and I absolutely love it. It allows you to choose the IDE or build system you would like to use on that particular platform. So for example, on Windows I could have CMake generate Visual Studio projects for me. On Linux, I can have it generate Makefile projects. On Mac, I could have it generate XCode project files. It requires little configuration for simple setups, however when you get into cross-compiling (Such as generating XCode projects for iPhone development) it requires a little (or sometimes even a lot) more work to set things up, since CMake can’t assume as much about the target platform.

One thing that surprises people that I talk with about CMake is that it is actually quicker to setup a basic project (e.g. “Hello World”) using CMake than it is to do with Visual Studio. Literally, to setup a “Hello World” project in CMake, I would do something like this:

add_executable( helloworld main.cpp )

The CMake code above can be used to generate a Visual Studio project on Windows that has one source file, main.cpp. This is the minimum required, however to make the project generation a little bit better, you would do:

cmake_minimum_required( VERSION 2.6.4 )

project( helloworld )

add_executable( helloworld main.cpp )

The code above is improved in two ways:

  1. The function cmake_minimum_required() is used to ensure that the script is being parsed by the expected version range of CMake. Newer version of CMake might remove features, change syntax, or add new features. We want to make sure our script notifies the user if they are using an unexpected version.
  2. The project() function is basically Windows-specific. It is a way of telling CMake to create a solution file for Visual Studio. (extension .sln). This is useful to have, but obviously not a requirement.

CMake is definitely one of the most useful and amazing tools I’ve ever used. I’ll be recommending it wherever I go!