Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) QmakeExample1

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppQmakeExample1/CppQmakeExample1.pro

 

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp

CONFIG(debug, debug|release) {
  message(Building debug version)

} else {
  DEFINES += NDEBUG
  message(Building release version)
}

# Note: when 'Build all' the following compiler output is generated:
#
# Project MESSAGE: Building debug version
# Project MESSAGE: Building debug version
# Project MESSAGE: Building release version
#
# This is because there are three makefiles generated:
# - A debug makefile
# - A release makefile
# - A makefile following the programmer's selected build, in this case a debug build

 

 

 

 

 

./CppQmakeExample1/main.cpp

 

#include <cassert>
#include <iostream>

int main()
{
  #ifndef NDEBUG
  assert(1 + 1 == 2);
  std::cout << "Debug mode\n";
  #else
  assert(1 == 2 && "assert must be removed by NDEBUG");
  std::cout << "Release mode\n";
  #endif
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml