From 3c2a54be9ceb9b7bb3b60987a22498527a494083 Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Tue, 30 May 2023 01:20:56 +0200 Subject: [PATCH 1/2] refactored cmake for proper export of the grapher library --- cmake/install.cmake | 28 +++++++++++++++++++++------- grapher/cmake/grapher-target.cmake | 20 +++++++++++++++----- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/cmake/install.cmake b/cmake/install.cmake index a06b371..13565b5 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -2,8 +2,18 @@ include(CMakePackageConfigHelpers) set(ConfigPackageLocation lib/cmake/${PROJECT_NAME}) -install(TARGETS ctbench-grapher-plot ctbench-grapher-utils ctbench-compiler-launcher - EXPORT ctbench-targets) +install( + DIRECTORY grapher/include/grapher + TYPE INCLUDE) + +install( + TARGETS + grapher + ctbench-compile-opts + ctbench-grapher-plot + ctbench-grapher-utils + ctbench-compiler-launcher + EXPORT ctbench-targets) export(EXPORT ctbench-targets FILE ctbench-targets.cmake) @@ -16,14 +26,18 @@ install(FILES cmake/ctbench-api.cmake DESTINATION ${ConfigPackageLocation}) # CMake package config files -configure_package_config_file(cmake/ctbench-config.cmake.in ctbench-config.cmake - INSTALL_DESTINATION ${ConfigPackageLocation}) +configure_package_config_file( + cmake/ctbench-config.cmake.in + ctbench-config.cmake + INSTALL_DESTINATION ${ConfigPackageLocation}) write_basic_package_version_file( ctbench-config-version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) -install(FILES ${CMAKE_BINARY_DIR}/ctbench-config.cmake - ${CMAKE_BINARY_DIR}/ctbench-config-version.cmake - DESTINATION ${ConfigPackageLocation}) +install( + FILES + ${CMAKE_BINARY_DIR}/ctbench-config.cmake + ${CMAKE_BINARY_DIR}/ctbench-config-version.cmake + DESTINATION ${ConfigPackageLocation}) diff --git a/grapher/cmake/grapher-target.cmake b/grapher/cmake/grapher-target.cmake index 0a8fd4a..33df21d 100644 --- a/grapher/cmake/grapher-target.cmake +++ b/grapher/cmake/grapher-target.cmake @@ -1,13 +1,23 @@ # Declaring the grapher library file(GLOB_RECURSE GRAPHER_SOURCES lib/*.cpp) -add_library(grapher STATIC ${GRAPHER_SOURCES}) +add_library(grapher SHARED ${GRAPHER_SOURCES}) -target_include_directories(grapher PUBLIC include) +target_include_directories(grapher + PUBLIC + "$/include" + "$" +) llvm_map_components_to_libnames(llvm_libs support) -target_link_libraries( - grapher PUBLIC ctbench-compile-opts nlohmann_json::nlohmann_json - sciplot::sciplot fmt::fmt stdc++fs tbb ${llvm_libs}) +target_link_libraries(grapher + PUBLIC + ctbench-compile-opts + nlohmann_json::nlohmann_json + sciplot::sciplot + fmt::fmt + stdc++fs + tbb + ${llvm_libs}) target_compile_options(grapher PUBLIC -DJSON_NOEXCEPTION) From 7809dfc41cc4b8d46ec7a2cb52a2f37d76c57ff9 Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Tue, 30 May 2023 01:33:19 +0200 Subject: [PATCH 2/2] going back to a static library at least for now --- grapher/cmake/grapher-target.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grapher/cmake/grapher-target.cmake b/grapher/cmake/grapher-target.cmake index 33df21d..dbbe55c 100644 --- a/grapher/cmake/grapher-target.cmake +++ b/grapher/cmake/grapher-target.cmake @@ -1,6 +1,6 @@ # Declaring the grapher library file(GLOB_RECURSE GRAPHER_SOURCES lib/*.cpp) -add_library(grapher SHARED ${GRAPHER_SOURCES}) +add_library(grapher STATIC ${GRAPHER_SOURCES}) target_include_directories(grapher PUBLIC