From a6e8afe23f78716724d75965271b93316503081d Mon Sep 17 00:00:00 2001 From: Philip Top Date: Fri, 20 Dec 2024 06:50:59 -0800 Subject: [PATCH] clean up install for SKBUILD and check naming --- python/units_python.cpp | 2 +- units/CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/units_python.cpp b/python/units_python.cpp index 1c1165de..13810ea7 100644 --- a/python/units_python.cpp +++ b/python/units_python.cpp @@ -13,7 +13,7 @@ namespace nb = nanobind; using namespace nb::literals; -NB_MODULE(units_llnl, mod) +NB_MODULE(units_llnl_ext, mod) { mod.doc() = "A minimal Python extension for the llnl/units C++ library.\n" diff --git a/units/CMakeLists.txt b/units/CMakeLists.txt index 2b34baeb..41c1abcb 100644 --- a/units/CMakeLists.txt +++ b/units/CMakeLists.txt @@ -83,7 +83,7 @@ if(UNITS_BUILD_SHARED_LIBRARY) if(CMAKE_CXX_STANDARD GREATER 16) target_compile_definitions(units PRIVATE -DUNITS_CONSTEXPR_IF_SUPPORTED=1) endif() - if(UNITS_INSTALL) + if(UNITS_INSTALL AND NOT SKBUILD) install( TARGETS units ${UNITS_LIBRARY_EXPORT_COMMAND} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -156,7 +156,7 @@ elseif(UNITS_BUILD_STATIC_LIBRARY) if(CMAKE_CXX_STANDARD GREATER 16) target_compile_definitions(units PRIVATE -DUNITS_CONSTEXPR_IF_SUPPORTED=1) endif() - if(UNITS_INSTALL AND NOT UNITS_BINARY_ONLY_INSTALL) + if(UNITS_INSTALL AND NOT UNITS_BINARY_ONLY_INSTALL AND NOT SKBUILD) install(TARGETS units ${UNITS_LIBRARY_EXPORT_COMMAND} DESTINATION ${CMAKE_INSTALL_LIBDIR} # INCLUDES DESTINATION # include/${PROJECT_NAME} @@ -179,7 +179,7 @@ target_include_directories( $ ) target_compile_definitions(header_only INTERFACE UNITS_HEADER_ONLY) -if(UNITS_INSTALL AND NOT UNITS_BINARY_ONLY_INSTALL) +if(UNITS_INSTALL AND NOT UNITS_BINARY_ONLY_ AND NOT SKBUILD) install(TARGETS header_only ${UNITS_LIBRARY_EXPORT_COMMAND}) endif() if(UNITS_NAMESPACE) @@ -194,7 +194,7 @@ if(UNITS_BASE_TYPE) endif() add_library(${UNITS_LC_PROJECT_NAME}::header_only ALIAS header_only) -if(UNITS_INSTALL AND NOT UNITS_BINARY_ONLY_INSTALL) +if(UNITS_INSTALL AND NOT UNITS_BINARY_ONLY_INSTALL AND NOT SKBUILD) install(FILES ${units_header_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${UNITS_LC_PROJECT_NAME} )