This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "Hello World!" << endl; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project(FirstProject) | |
cmake_minimum_required(VERSION 2.8) | |
aux_source_directory(. SRC_LIST) | |
add_executable(${PROJECT_NAME} ${SRC_LIST}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.11) | |
#----------------------------- | |
# Project Settings | |
#----------------------------- | |
SET(PROJECTNAME "ModernCpp") | |
PROJECT(${PROJECTNAME} CXX) | |
SET( ${PROJECT_NAME}_MAJOR_VERSION 0 ) | |
SET( ${PROJECT_NAME}_MINOR_VERSION 1 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.11) | |
add_subdirectory(Module1) | |
add_subdirectory(Module2) | |
add_subdirectory(Module3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message( STATUS "-------------------------------------------------------------------------------" ) | |
message( STATUS "Software configuration") | |
message( STATUS "-------------------------------------------------------------------------------" ) | |
add_subdirectory(DemoApp1) | |
add_subdirectory(DemoApp2) | |
add_subdirectory(DemoApp3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.11) | |
set(APPLICATION_NAME "${PROJECT_PREFIX_NAME}_demoapp_one") | |
project(${APPLICATION_NAME} CXX) | |
#Suppressing CMAKE 3.0 warnings | |
if(POLICY CMP0043) | |
cmake_policy(SET CMP0043 OLD) | |
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
std::cout << "Hello world - DemoApp 1" << std::endl; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Michele Adduci <[email protected]> | |
*/ | |
#include <iostream> | |
#include <cmath> | |
int main() | |
{ | |
std::cout << "The result of 3*3 is " << 3*3 << std::endl; | |
int var_a = 3*3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Enables C++11 features | |
IF(CMAKE_COMPILER_IS_GNUCXX) | |
SET(CMAKE_CXX_FLAGS "-std=gnu++11") | |
ENDIF() | |
SET(CMAKE_COLOR_MAKEFILE ON) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
int main() | |
{ | |
std::vector<int> int_array; //array of integers, empty | |
std::vector<double> double_array_1; //array of doubles, empty | |
std::vector<double> double_array_2(10); //array of doubles, containing 10 elements initialized with 0.0 | |
std::vector<double> double_array_3(10, 2.5f);//array of doubles, containing 10 elements initialized with 2.5 | |
std::vector<double> double_array_4 {1.0, 2.0, 3.0, 4.0, 5.0}; //array initialized with some values |
OlderNewer