mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-02 21:54:14 +02:00
Rework build system
This commit is contained in:
@@ -3,10 +3,16 @@ file(GLOB SOURCES
|
||||
src/compression/*.cpp
|
||||
src/compression/*.c)
|
||||
|
||||
|
||||
|
||||
add_library(core-writer ${SOURCES})
|
||||
include_directories(core-writer external/)
|
||||
|
||||
target_include_directories(core-writer PUBLIC src/)
|
||||
target_include_directories(core-writer PUBLIC src/compression)
|
||||
target_include_directories(core-writer PUBLIC
|
||||
src/
|
||||
src/compression)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
target_compile_definitions(core-writer PRIVATE DEBUG_OUTPUT)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
SRC_DIR = ./src
|
||||
OBJ_DIR = ./obj
|
||||
BIN_DIR = ./bin
|
||||
MKDIR = mkdir -p
|
||||
|
||||
CC = g++
|
||||
CFLAGS = -Wall -Wfatal-errors -fPIC -pthread -std=c++11 -I./include -I${CONDA_PREFIX}/include
|
||||
LDFLAGS = -L${CONDA_PREFIX}/lib -L/usr/lib64 -lzmq -lhdf5 -lhdf5_hl -lhdf5_cpp -lhdf5_hl_cpp -lboost_system -lboost_regex -lboost_thread -lpthread
|
||||
|
||||
UNAME := $(shell uname)
|
||||
ifeq ($(UNAME), Linux)
|
||||
SOFLAGS += -shared -Wl,-soname,libcpp_h5_writer.so
|
||||
endif
|
||||
ifeq ($(UNAME), Darwin)
|
||||
SOFLAGS += -shared -Wl,-install_name,libcpp_h5_writer.so
|
||||
endif
|
||||
|
||||
HEADERS = $(wildcard $(SRC_DIR)/*.hpp)
|
||||
SRCS = $(wildcard $(SRC_DIR)/*.cpp)
|
||||
OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRCS))
|
||||
|
||||
libcpp_h5_writer: build_dirs $(OBJS)
|
||||
$(CC) $(SOFLAGS) -o $(BIN_DIR)/libcpp_h5_writer.so $(OBJS) $(LDFLAGS)
|
||||
|
||||
debug: CFLAGS += -DDEBUG_OUTPUT
|
||||
debug: libcpp_h5_writer
|
||||
|
||||
perf: CFLAGS += -DPERF_OUTPUT
|
||||
perf: libcpp_h5_writer
|
||||
|
||||
deploy: libcpp_h5_writer
|
||||
cp bin/* ${CONDA_PREFIX}/lib
|
||||
mkdir -p ${CONDA_PREFIX}/include/cpp_h5_writer
|
||||
cp src/*.hpp ${CONDA_PREFIX}/include/cpp_h5_writer
|
||||
cp include/date.h ${CONDA_PREFIX}/include/cpp_h5_writer
|
||||
mkdir -p ${CONDA_PREFIX}/include/cpp_h5_writer/compression
|
||||
cp src/compression/*.h ${CONDA_PREFIX}/include/cpp_h5_writer/compression
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -c -o $@ $<
|
||||
|
||||
build_dirs:
|
||||
$(MKDIR) $(OBJ_DIR) $(BIN_DIR)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJ_DIR) $(BIN_DIR)
|
||||
|
||||
test: build_dirs $(OBJS)
|
||||
$(CC) $(CFLAGS) test/test_main.cpp $(OBJS) $(LDFLAGS) -lgtest_main -lgtest -o $(BIN_DIR)/execute_tests
|
||||
@@ -1,7 +0,0 @@
|
||||
make
|
||||
|
||||
cp bin/* ${PREFIX}/lib
|
||||
|
||||
mkdir -p ${PREFIX}/include/cpp_h5_writer
|
||||
cp src/*.hpp ${PREFIX}/include/cpp_h5_writer
|
||||
cp include/date.h ${CONDA_PREFIX}/include/cpp_h5_writer
|
||||
@@ -1,27 +0,0 @@
|
||||
package:
|
||||
name: lib_cpp_h5_writer
|
||||
version: 0.1.0
|
||||
|
||||
build:
|
||||
number: 0
|
||||
|
||||
source:
|
||||
path: ..
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- make
|
||||
- gcc
|
||||
- cppzmq ==4.2.1
|
||||
- hdf5 ==1.10.1
|
||||
- boost ==1.61.0
|
||||
|
||||
run:
|
||||
- cppzmq ==4.2.1
|
||||
- hdf5 ==1.10.1
|
||||
- boost ==1.61.0
|
||||
|
||||
|
||||
about:
|
||||
summary: "C++ library for a ZMQ to H5 writer."
|
||||
|
||||
Reference in New Issue
Block a user