From 06205e789e2bedcb947cb3b0b5a2338ca8db393d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Miku=C4=8Dionis?= Date: Mon, 11 Sep 2023 11:34:39 +0200 Subject: [PATCH 1/2] Simplify cmake library exports --- cmake/benchmark.cmake | 2 +- cmake/boost.cmake | 2 +- cmake/doctest.cmake | 2 +- cmake/xxhash.cmake | 2 +- src/base/CMakeLists.txt | 11 ++++------- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake index dc063fa..7994a66 100644 --- a/cmake/benchmark.cmake +++ b/cmake/benchmark.cmake @@ -5,7 +5,7 @@ if (benchmark_FOUND) else(benchmark_FOUND) message(STATUS "Failed to find benchmark, going to compile from source.") if (FIND_FATAL) - message(FATAL_ERROR "Failed to find with CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") + message(FATAL_ERROR "Failed to find benchmark with CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") endif(FIND_FATAL) set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Enable tests") set(BENCHMARK_ENABLE_EXCEPTIONS ON CACHE BOOL "Enable the use of exceptions in the benchmark library. Default ON") diff --git a/cmake/boost.cmake b/cmake/boost.cmake index 057b3e3..d2b389a 100644 --- a/cmake/boost.cmake +++ b/cmake/boost.cmake @@ -20,7 +20,7 @@ if (Boost_FOUND) else(Boost_FOUND) message(STATUS "Failed to find Boost (${BOOST_INCLUDE_LIBRARIES}), going to compile from source") if (FIND_FATAL) - message(FATAL_ERROR "Failed to find with CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") + message(FATAL_ERROR "Failed to find Boost with CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") endif(FIND_FATAL) set(BOOST_ENABLE_CMAKE ON) FetchContent_Declare( diff --git a/cmake/doctest.cmake b/cmake/doctest.cmake index 0d8acf8..69f801f 100644 --- a/cmake/doctest.cmake +++ b/cmake/doctest.cmake @@ -15,7 +15,7 @@ if (doctest_FOUND) else(doctest_FOUND) message(STATUS "Failed to find doctest, going to compile from source.") if (FIND_FATAL) - message(FATAL_ERROR "Failed to find ${FIND_FATAL} with CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") + message(FATAL_ERROR "Failed to find doctest with CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") endif(FIND_FATAL) set(DOCTEST_WITH_TESTS OFF CACHE BOOL "doctest tests and examples") set(DOCTEST_WITH_MAIN_IN_STATIC_LIB ON CACHE BOOL "static lib (cmake target) with a default main entry point") diff --git a/cmake/xxhash.cmake b/cmake/xxhash.cmake index b7903ba..46940eb 100644 --- a/cmake/xxhash.cmake +++ b/cmake/xxhash.cmake @@ -31,7 +31,7 @@ if (xxHash_FOUND) else(xxHash_FOUND) message(STATUS "Failed to find xxHash, going to compile from source.") if (FIND_FATAL) - message(FATAL_ERROR "Failed to find with CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") + message(FATAL_ERROR "Failed to find xxHash with CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") endif(FIND_FATAL) include(ExternalProject) set(XXHASH_BUILD_ENABLE_INLINE_API ON CACHE BOOL "adds xxhash.c for the -DXXH_INLINE_ALL api. Default ON") diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index 028b1e2..b87223b 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -1,13 +1,10 @@ -add_library(random OBJECT random.cpp) -target_link_libraries(random PRIVATE Boost::headers Boost::math) - add_library(base STATIC bitstring.c c_allocator.c doubles.c platform.c DataAllocator.cpp Enumerator.cpp exceptions.cpp - intutils.cpp property.cpp stats.cpp Timer.cpp) + intutils.cpp property.cpp stats.cpp Timer.cpp random.cpp) if (CMAKE_SYSTEM_NAME STREQUAL Windows) - target_link_libraries(base PUBLIC hash PRIVATE udebug random xxHash Boost::headers iphlpapi psapi) + target_link_libraries(base PUBLIC hash PRIVATE udebug xxHash Boost::headers Boost::math iphlpapi psapi) else() - target_link_libraries(base PUBLIC hash PRIVATE udebug random xxHash Boost::headers) + target_link_libraries(base PUBLIC hash PRIVATE udebug xxHash Boost::headers Boost::math) endif() target_include_directories(base @@ -16,5 +13,5 @@ target_include_directories(base $ ) -install(TARGETS base random EXPORT UUtilsConfig DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT base) +install(TARGETS base EXPORT UUtilsConfig DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT base) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../../include/base DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT base) From 53558dce195df1aa6f4889e1215f01df66565320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Miku=C4=8Dionis?= Date: Mon, 11 Sep 2023 11:35:48 +0200 Subject: [PATCH 2/2] Version increment to 2.0.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dab347f..844f7fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) cmake_policy(SET CMP0048 NEW) # project() command manages VERSION variables -project(UUtils VERSION 2.0.1 HOMEPAGE_URL "https://github.com/UPPAALModelChecker/UUtils" LANGUAGES CXX C) +project(UUtils VERSION 2.0.2 HOMEPAGE_URL "https://github.com/UPPAALModelChecker/UUtils" LANGUAGES CXX C) include(CMakePackageConfigHelpers) include(GNUInstallDirs) include(FetchContent)