From 66852f791d71a4b315565b487b6d7f754d712afe Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Mon, 23 May 2022 12:37:40 +0000 Subject: [PATCH] fix cmake installation --- .spack/repo/packages/csg-eb/package.py | 2 +- CMakeLists.txt | 2 +- Dockerfile | 1 + src/csg/CMakeLists.txt | 13 +++++++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.spack/repo/packages/csg-eb/package.py b/.spack/repo/packages/csg-eb/package.py index 5667497..b90897b 100644 --- a/.spack/repo/packages/csg-eb/package.py +++ b/.spack/repo/packages/csg-eb/package.py @@ -20,7 +20,7 @@ class CsgEb(CMakePackage): depends_on("pegtl") depends_on("catch2") - depends_on("cgal", when="+cgal") + depends_on("cgal header_only=True", when="+cgal") def cmake_args(self): return [ diff --git a/CMakeLists.txt b/CMakeLists.txt index e845572..dc67843 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ install(TARGETS csg-eb LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -export(TARGETS csg-eb +export(TARGETS csg-eb csg-eb-pi NAMESPACE CsgEb:: FILE "${CMAKE_CURRENT_BINARY_DIR}/CsgEbConfig.cmake" ) diff --git a/Dockerfile b/Dockerfile index 7266b82..993fcdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get -qq update \ && apt-get -qq -y install --no-install-recommends \ build-essential=12.* \ git=1:2.* \ + file=1:5.* \ openscad=2019.* \ pkg-config=0.29.* \ python3-pip=20.* \ diff --git a/src/csg/CMakeLists.txt b/src/csg/CMakeLists.txt index 4990c8b..a76a7a9 100644 --- a/src/csg/CMakeLists.txt +++ b/src/csg/CMakeLists.txt @@ -19,17 +19,22 @@ if (CSG_CGAL_ENABLED) ) endif() -add_library(csg-eb ${csg-eb_SOURCES}) -add_library(CsgEb::csg-eb ALIAS csg-eb) +## Create a private interface library +add_library(csg-eb-pi INTERFACE) -target_link_libraries(csg-eb PRIVATE +target_link_libraries(csg-eb-pi INTERFACE stdc++fs taocpp::pegtl ) if (CSG_CGAL_ENABLED) - target_link_libraries(csg-eb PRIVATE CGAL::CGAL) + target_link_libraries(csg-eb-pi INTERFACE CGAL::CGAL) endif() +# Create a static library +add_library(csg-eb ${csg-eb_SOURCES}) +add_library(CsgEb::csg-eb ALIAS csg-eb) +target_link_libraries(csg-eb PRIVATE "$") + if (BUILD_TESTING) add_subdirectory(tests) endif() -- GitLab