66609 - prime code/__MACOSX/._Lab2
66609 - prime code/__MACOSX/Lab2/._CMakeLists.txt
66609 - prime code/__MACOSX/Lab2/._include
66609 - prime code/__MACOSX/Lab2/._src
66609 - prime code/__MACOSX/Lab2/include/._std_lib_facilities.h
66609 - prime code/__MACOSX/Lab2/src/._main.cpp
66609 - prime code/Lab2/CMakeLists.txt
### CMake Version #############################################################
cmake_minimum_required(VERSION 3.10)
### Project Configuration #####################################################
get_filename_component(PROJECT_DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
string(REPLACE " " "_" PROJECT_DIR_NAME ${PROJECT_DIR_NAME})
project(${PROJECT_DIR_NAME}
VERSION 1.0.0.0 #
.
.
. LANGUAGES CXX)
### List of Files #############################################################
set(INCLUDE
${PROJECT_SOURCE_DIR}/include/std_lib_facilities.h
)
set(SRC
${PROJECT_SOURCE_DIR}/src/main.cpp
)
### Compiler Flags ############################################################
# UNIX only
if(NOT WIN32)
# C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Common Flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -pedantic-e
ors")
# Debug Flags
set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG")
# Release Flags
# -O2 instead of -O3
# -ftlo stands for Link Time Optimization (LTO)
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -flto")
# GCC (Ubuntu 18.04 LTS Bionic Beaver)
if(UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif(UNIX AND NOT APPLE)
# Clang (macOS Mojave 10.14)
# -Wno-tautological-compare is required when using std_lib_facilities on macOS
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-tautological-compare")
endif(APPLE)
endif(NOT WIN32)
### Build Types ###############################################################
# UNIX only
if(NOT WIN32)
# if no build type is set, the default is Debug
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
endif(NOT WIN32)
### Build Configuration #######################################################
add_executable(${PROJECT_NAME}
${INCLUDE} ${SRC})
target_include_directories(${PROJECT_NAME}
PRIVATE ${PROJECT_SOURCE_DIR}/include)
###############################################################################
66609 - prime code/Lab2/include/std_lib_facilities.h
*
std_lib_facilities.h
*
*
Simple "Programming: Principles and Practice using C++ (second edition)" course header to
be used for the first few weeks.
It provides the most common standard headers (in the global namespace)
and minimal exception/e
or support.
Students: please don't try to understand the details of headers just yet.
All will be explained. This header is primarily used so that you don't have
to understand every concept all at once.
By Chapter 10, you don't need this file and after Chapter 21, you'll understand it
Revised April 25, 2010: simple_e
or() added
Revised November 25 2013: remove support for pre-C++11 compilers, use C++11: Revised November 28 2013: add a few container algorithms
Revised June 8 2014: added #ifndef to workaround Microsoft C++11 weakness
*
#pragma once
#include #include ay
#include #include...