Commit 0598c62a authored by legoc's avatar legoc
Browse files

Added cmake makefile for building the core library

parent 947946c0
......@@ -11,3 +11,4 @@
/Makefile.in
/missing
/.settings/
/cmake-build/
cmake_minimum_required(VERSION 3.0)
# Project
project(lstdpp128)
# Current version
set(LSTDPP128_VERSION_MAJOR 1)
set(LSTDPP128_VERSION_MINOR 2)
set(LSTDPP128_VERSION_PATCH 0)
set(LSTDPP128_VERSION ${LSTDPP128_VERSION_MAJOR}.${LSTDPP128_VERSION_MINOR}.${LSTDPP128_VERSION_PATCH})
set(CMAKE_BUILD_TYPE Release)
# Includes
include_directories(
"${PROJECT_SOURCE_DIR}"
)
# Sources
set(lstdpp128_sources
src/lstdpp128/CrateBoard.cpp
src/lstdpp128/BaseAlgorithm.cpp
src/lstdpp128/Reader.cpp
src/lstdpp128/LiveReader.cpp
src/lstdpp128/EventBlockArray.cpp
src/lstdpp128/Event.cpp
src/lstdpp128/EventData.cpp
src/lstdpp128/BaseReader.cpp
src/lstdpp128/EventArray.cpp
src/lstdpp128/Insert.cpp
src/lstdpp128/Sort.cpp
src/lstdpp128/Check.cpp
)
# To compile the sources only once
add_library(objlib OBJECT ${lstdpp128_sources})
# Shared libraries need PIC
set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1)
# Define shared and static libraries
add_library(lstdpp128 SHARED $<TARGET_OBJECTS:objlib>)
add_library(lstdpp128_s STATIC $<TARGET_OBJECTS:objlib>)
# Set the version of the shared library
set_target_properties(lstdpp128 PROPERTIES VERSION ${LSTDPP128_VERSION}
SOVERSION ${LSTDPP128_VERSION_MAJOR})
# Install lib
install(TARGETS lstdpp128
DESTINATION lib
)
# Install include
install(DIRECTORY src/lstdpp128/
DESTINATION include
FILES_MATCHING PATTERN "*.h"
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment