Skip to content

Commit

Permalink
clean up install for SKBUILD and check naming
Browse files Browse the repository at this point in the history
  • Loading branch information
phlptp committed Dec 20, 2024
1 parent 3d25411 commit a6e8afe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/units_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions units/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -179,7 +179,7 @@ target_include_directories(
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
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)
Expand All @@ -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}
)
Expand Down

0 comments on commit a6e8afe

Please sign in to comment.