Skip to content

Instantly share code, notes, and snippets.

View quocle108's full-sized avatar

Sunday quocle108

View GitHub Profile
project( demo )
cmake_minimum_required( VERSION 2.8.9 )
add_subdirectory( helloworld )
add_subdirectory( staticlib )
add_subdirectory( dynamiclib )
add_subdirectory( phone )
cmake_minimum_required(VERSION 2.8.9)
project (phone)
#Define GNU standard installation directories
include( GNUInstallDirs )
#In case load library from system. For the static library and shared library:
#set ( PROJECT_LINK_LIBS libsoftware.a libhardware.dylib)
# link library from installed directory
#link_directories( ${CMAKE_INSTALL_FULL_LIBDIR} )
cmake_minimum_required(VERSION 2.8.9)
project(software)
#Define GNU standard installation directories
include( GNUInstallDirs )
#Bring the headers
include_directories(include/software)
#Can manually add the sources using the set command as follows:
cmake_minimum_required(VERSION 3.15)
project(hardware)
# Define GNU standard installation directories
include( GNUInstallDirs )
# Bring the headers
include_directories(include/hardware)
# Can manually add the sources using the set command as follows:
cmake_minimum_required(VERSION 2.8.9)
project (hello)
add_executable(hello helloworld.cpp)
# Specify the source files, target files, the build directories,
# and the install directory
EXECDIR = phone
STATICDIR = staticlib
DYNAMICDIR = dynamiclib
LIBS = $(STATICLIB) $(DYNAMICLIB)
# All the targets in this makefile are phony
.PHONY: all hardware software phone
# Specify the source files, target files, the build directories,
# and the install directory
SOURCES = phone.cpp
OBJECTS = $(SOURCES:.cpp=.o)
OUTPUTFILE = phone
LIBSTATIC = libhardware.a
LIBDYNAMIC = libsoftware.dylib
STATICDIR = ../staticlib
DYNAMICDIR = ../dynamiclib
INSTALLDIR = ../binaries
# Specify the source files, the target files,
# and the install directory
SOURCES = src/gmail.cpp src/googlemap.cpp src/software.cpp
OBJECTS = $(SOURCES:.cpp=.o)
OUTPUTFILE = libsoftware.dylib
INSTALLDIR = ../binaries
CFLAGS=-I include/software
.PHONY: all
all: $(OUTPUTFILE)
# Specify extensions of files to delete when cleaning
CLEANEXTS = o a
SOURCES = src/camera.cpp src/screen.cpp src/hardware.cpp
OBJECTS = $(SOURCES:.cpp=.o)
OUTPUTFILE=libhardware.a
INSTALLDIR = ../binaries
#
# Add the include path
#
# Specify the target file and the install directory
OUTPUTFILE=hello
INSTALLDIR=binaries
# Default target
.PHONY: all
all: $(OUTPUTFILE)
# This rule tells make how to build hello from hello.cpp
#OUTPUTFILE: helloworld.cpp