Skip to content
Snippets Groups Projects
Commit 2c0011f8 authored by Stéphane Poirier's avatar Stéphane Poirier
Browse files

Merge branch 'hdf5_1_14_3' of...

Merge branch 'hdf5_1_14_3' of gitlab.synchrotron-soleil.fr:software-control-system/libraries/nexuscpp into hdf5_1_14_3
parents 719d54e2 572b63ad
No related branches found
No related tags found
1 merge request!2HDF5 1.14.3
* text=auto eol=lf
\ No newline at end of file
......@@ -7,6 +7,7 @@ pom_win.xml
pom_dev_win.xml
test/datastreamer/pom_dev.xml
CMakeFiles
test_package
build
CMakeUserPresets.json
**/target/
cmake_minimum_required(VERSION 3.15)
project (nexuscpp)
cmake_minimum_required (VERSION 2.6)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
set(MAJOR_VERSION "3")
set(MINOR_VERSION "5")
set(PATCH_VERSION "3")
set(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
find_package(yat CONFIG REQUIRED)
find_package(HDF5 CONFIG REQUIRED)
if (NOT DEFINED CMAKE_INSTALL_PREFIX AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(LIB_INSTALL_DIR "lib64")
else()
set(LIB_INSTALL_DIR "lib")
endif()
add_compile_definitions(PROJECT_NAME=${PROJECT_NAME})
add_compile_definitions(PROJECT_VERSION=${VERSION})
find_package(PkgConfig)
pkg_check_modules(YAT yat>=1.18.7)
pkg_check_modules(HDF5 hdf5>=1.8.16)
add_compile_definitions(HDF_PROJECT_NAME=HDF5)
add_compile_definitions(HDF_PROJECT_VERSION=${HDF_PROJECT_VERSION})
add_compile_definitions(NEXUSCPP_HAVE_LZ4_FILTER)
if (UNIX)
set(CPP_FLAGS "-O2 -g -gstabs+ -std=c++0x -Wall -Wno-unused-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP_FLAGS}")
add_definitions(-DLinux -DGNU_GCC -D_REENTRANT)
add_definitions(-DPROJECT_NAME=NexusCPP -DPROJECT_VERSION=${VERSION} -DNEXUSCPP_HAVE_LZ4_FILTER -DNEXUSCPP_HAVE_BSLZ4_FILTER -DHDF_PROJECT_NAME=HDF5 -DHDF_PROJECT_VERSION=1.8.18)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,defs")
add_definitions(-std=c++0x)
add_compile_definitions(Linux)
add_compile_definitions(GNU_GCC)
add_compile_definitions(_REENTRANT)
add_compile_definitions(NEXUSCPP_HAVE_BSLZ4_FILTER)
endif()
include_directories(SYSTEM ${YAT_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS})
link_directories(${YAT_LIBRARY_DIRS} ${HDF5_LIBRARY_DIRS})
if (WIN32)
add_compile_definitions(_HDF5USEDLL_)
add_compile_definitions(WITH_HDF5)
if (BUILD_SHARED_LIBS MATCHES "ON")
add_compile_definitions(NEXUSCPP_DLL)
add_compile_definitions(NEXUSCPP_BUILD)
endif()
endif()
add_subdirectory (src)
set(prefix ${CMAKE_INSTALL_PREFIX})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nexuscpp.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/nexuscpp.pc" @ONLY IMMEDIATE)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nexuscpp.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
if (UNIX AND EXISTS ${CMAKE_SOURCE_DIR}/nexuscpp.pc.in)
configure_file("${CMAKE_SOURCE_DIR}/nexuscpp.pc.in"
"${CMAKE_BINARY_DIR}/nexuscpp.pc" @ONLY IMMEDIATE)
install(FILES ${CMAKE_BINARY_DIR}/nexuscpp.pc DESTINATION lib/pkgconfig)
endif()
\ No newline at end of file
conan.create(['el6-gcc44-x86_64-shared', 'el6-gcc44-x86_64-static', 'el6-gcc44-x86-shared', 'el6-gcc44-x86-static', 'el7-gcc48-x86_64-shared', 'el7-gcc48-x86_64-static', 'win10-msvc14-x86-shared', 'win10-msvc14-x86-static', 'win10-msvc14-x86_64-shared', 'win10-msvc14-x86_64-static'])
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps
class nexuscppRecipe(ConanFile):
name = "nexuscpp"
version = "4.0.0"
package_type = "library"
user = "soleil"
# Optional metadata
license = "GPL-2"
author = "stephane.poirier@synchrotron-soleil.fr"
url = "https://gitlab.synchrotron-soleil.fr/software-control-system/libraries/nexuscpp"
description = "NexusCPP library"
topics = ("utility", "control-system")
# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
# Sources are located in the same place as this recipe, copy them to the recipe
exports_sources = "CMakeLists.txt", "src/**", "include/**"
def requirements(self):
self.requires("yat/[>=1.0]@soleil/stable", transitive_headers=True, transitive_libs=True)
self.requires("hdf5/1.14.3@soleil/stable")
def config_options(self):
if self.settings.os == "Windows":
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
major, minor, patch = map(int, self.version.split('.'))
tc.variables["VERSION"] = self.version
tc.variables["MAJOR_VERSION"] = major
tc.variables["MINOR_VERSION"] = minor
tc.variables["PATCH_VERSION"] = patch
tc.variables["HDF_PROJECT_VERSION"] = self.dependencies["hdf5"].ref.version
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.libs = ["nexuscpp"]
if self.settings.os == "Windows":
self.cpp_info.system_libs += [ "WS2_32"]
if self.options.shared:
self.cpp_info.defines += ["NEXUSCPP_DLL"]
......@@ -14,18 +14,15 @@ set (source_files
bslz4/iochain.c
)
include_directories(
../include
../src/bslz4
)
add_library (nexuscpp SHARED ${source_files})
target_link_libraries(nexuscpp ${YAT_LIBRARIES} ${HDF5_LIBRARIES})
add_library (nexuscpp ${source_files})
target_include_directories(nexuscpp PUBLIC ${CMAKE_SOURCE_DIR}/include ../src/bslz4)
target_link_libraries(nexuscpp ${yat_LIBRARIES} ${HDF5_LIBRARIES})
if(MAJOR_VERSION)
set_target_properties (nexuscpp PROPERTIES VERSION ${VERSION} SOVERSION ${MAJOR_VERSION})
endif()
install (DIRECTORY ../include/nexuscpp DESTINATION include/
install (DIRECTORY ${CMAKE_SOURCE_DIR}/include/nexuscpp DESTINATION include
FILES_MATCHING PATTERN "*.h"
PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE
......
cmake_minimum_required(VERSION 3.15)
project(PackageTest CXX)
find_package(nexuscpp CONFIG REQUIRED)
add_executable(test_package src/test_package.cpp)
target_link_libraries(test_package ${nexuscpp_LIBRARIES})
import os
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
from conan.tools.build import can_run
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps", "CMakeToolchain"
def requirements(self):
self.requires(self.tested_reference_str)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def layout(self):
cmake_layout(self)
def test(self):
cmd = os.path.join(self.cpp.build.bindir, "test_package")
self.run(cmd, env="conanrun")
#include <iostream>
#include <nexuscpp/nexuscpp.h>
int main(int argc, char* argv[]) {
std::cout << nxcpp::get_version() << std::endl;
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment