Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pftruth-standalone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alessandro Brusamolino
pftruth-standalone
Commits
ef437634
Commit
ef437634
authored
3 months ago
by
brusale
Browse files
Options
Downloads
Patches
Plain Diff
move building to CMake
parent
ba1e1c15
Branches
cmake-build
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+35
-0
35 additions, 0 deletions
CMakeLists.txt
Makefile
+0
-38
0 additions, 38 deletions
Makefile
with
35 additions
and
38 deletions
CMakeLists.txt
0 → 100644
+
35
−
0
View file @
ef437634
cmake_minimum_required
(
VERSION 3.10
)
# Project name
project
(
COCOATruth
)
# Set C++ standard
set
(
CMAKE_CXX_STANDARD 17
)
set
(
CMAKE_CXX_STANDARD_REQUIRED True
)
# Compiler flags
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall -Wextra -g -O3"
)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -static-libasan")
# Include directories
include_directories
(
interface
)
# Find all source files
file
(
GLOB SRCS
"src/*.cc"
)
file
(
GLOB HEADERS
"interface/*.h"
)
# Add library
add_library
(
PFTruth STATIC
${
SRCS
}
)
# Find ROOT package
find_package
(
ROOT REQUIRED
)
include_directories
(
${
ROOT_INCLUDE_DIRS
}
)
link_directories
(
${
ROOT_LIBRARY_DIRS
}
)
add_definitions
(
${
ROOT_CXX_FLAGS
}
)
# Add executable
add_executable
(
COCOATruth COCOATruth.cc
)
target_link_libraries
(
COCOATruth PFTruth
${
ROOT_LIBRARIES
}
)
# Clean up
set_directory_properties
(
PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"
${
CMAKE_BINARY_DIR
}
"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Makefile
deleted
100644 → 0
+
0
−
38
View file @
ba1e1c15
# Variables
CC
:=
g++
CFLAGS
:=
-Wall
-Wextra
-g
-O3
-std
=
c++17
ASANFLAGS
:=
-fsanitize
=
address
-static-libasan
ROOTFLAGS
:=
`
root-config
--glibs
--cflags
`
INCLUDES
:=
-Iinterface
LIBS
:=
libPFTruth.a
#EXECUTABLE := pftruth
EXECUTABLE
:=
COCOATruth
# Find all source files
SRCS
:=
$(
wildcard src/
*
.cc
)
OBJS
:=
$(
SRCS:.cc
=
.o
)
HEADERS
:=
$(
wildcard interface/
*
.h
)
# Default target
all
:
$(LIBS) $(EXECUTABLE)
# Compile .cc files into .o files
%.o
:
%.cc $(HEADERS)
$(
CC
)
$(
CFLAGS
)
$(
INCLUDES
)
-c
$<
-o
$@
# Archive .o files into a static library
$(LIBS)
:
$(OBJS)
ar rcs
$@
$^
# Compile pftruth.cc into an executable
#$(EXECUTABLE): pftruth.cc $(LIBS)
# $(CC) $(CFLAGS) $(ROOTFLAGS) $< $(INCLUDES) $(LIBS) -o $@
#
$(EXECUTABLE)
:
COCOATruth.cc $(LIBS)
$(
CC
)
$(
CFLAGS
)
$(
ROOTFLAGS
)
$<
$(
INCLUDES
)
$(
LIBS
)
-o
$@
# Clean up
clean
:
rm
-f
$(
OBJS
)
$(
LIBS
)
$(
EXECUTABLE
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment