Skip to content
Snippets Groups Projects
Commit 3ad1c02e authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[CMake] Exports

parent 35b9c689
No related branches found
No related tags found
No related merge requests found
#
# Copyright (c) 2014 CNRS
# Authors: Joseph Mirabel
# Copyright (c) 2014, 2020 CNRS
# Authors: Joseph Mirabel, Guilhem Saurel
#
#
# This file is part of hpp-statistics
......@@ -17,11 +17,13 @@
# hpp-statistics If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
SET(PROJECT_NAME hpp-statistics)
SET(PROJECT_DESCRIPTION "Classes for doing statistics.")
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
INCLUDE(cmake/hpp.cmake)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
......@@ -33,16 +35,26 @@ IF (HPP_DEBUG)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHPP_DEBUG")
ENDIF()
SET (${PROJECT_NAME}_HEADERS
ADD_PROJECT_DEPENDENCY(hpp-util REQUIRED)
SET(${PROJECT_NAME}_HEADERS
include/hpp/statistics/fwd.hh
include/hpp/statistics/bin.hh
include/hpp/statistics/success-bin.hh
include/hpp/statistics/distribution.hh
)
ADD_REQUIRED_DEPENDENCY("hpp-util >= 3.2")
SET(${PROJECT_NAME}_SOURCES
src/success-bin.cc
)
ADD_LIBRARY(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} hpp-util::hpp-util)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
# Add dependency toward hpp-statistics library in pkg-config file.
......
Subproject commit 7eca9ee6c9d1c4ee20eb82272e94f9d11642053a
Subproject commit 7ab756beff8729739c45731dfc1edb6f88d2dbc8
#
# Copyright (c) 2014 CNRS
# Authors: Joseph Mirabel
#
#
# This file is part of hpp-statistics
# hpp-statistics is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# hpp-statistics is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# hpp-statistics If not, see
# <http://www.gnu.org/licenses/>.
SET(LIBRARY_NAME ${PROJECT_NAME})
ADD_LIBRARY(${LIBRARY_NAME} SHARED
success-bin.cc
)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} "hpp-util")
INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION lib)
......@@ -23,20 +23,11 @@
# This macro will create a binary from `NAME.cc', link it against
# Boost and add it to the test suite.
#
MACRO(ADD_TESTCASE NAME GENERATED)
IF (${GENERATED} STREQUAL TRUE)
ADD_EXECUTABLE(${NAME} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.cc)
ELSE()
ADD_EXECUTABLE(${NAME} ${NAME}.cc)
ENDIF()
ADD_TEST(${NAME} ${RUNTIME_OUTPUT_DIRECTORY}/${NAME})
# Link against Boost and project library.
MACRO(ADD_TESTCASE NAME)
ADD_UNIT_TEST(${NAME} ${NAME}.cc)
TARGET_LINK_LIBRARIES(${NAME} ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(${NAME} "hpp-util")
ENDMACRO(ADD_TESTCASE)
ADD_TESTCASE (test-successstatistics FALSE)
ADD_TESTCASE (test-distribution FALSE)
ADD_TESTCASE (test-statistics FALSE)
ADD_TESTCASE(test-successstatistics)
ADD_TESTCASE(test-distribution)
ADD_TESTCASE(test-statistics)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment