Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
- Consolidate UPSP_INSTALL_* vars down to 3
- Bindings-only install now doesn't double-install upsp_kdtree
- Fix app-only install (no pybind11, still need raycast)
  • Loading branch information
ixjlyons committed Jul 25, 2023
1 parent 92a70f3 commit bc3bfcc
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ if (DEFINED SKBUILD)
endif()

set(UPSP_INSTALL_BIN_DIR ${SKBUILD_SCRIPTS_DIR})
set(UPSP_INSTALL_LIB_DIR ${SKBUILD_PROJECT_NAME})
set(UPSP_CPP_INSTALL_BIN_DIR ${SKBUILD_DATA_DIR}/bin)
set(UPSP_CPP_INSTALL_LIB_DIR ${SKBUILD_DATA_DIR}/lib)
set(UPSP_INSTALL_EXT_LIB_DIR ${SKBUILD_PROJECT_NAME})
set(UPSP_INSTALL_APP_LIB_DIR ${SKBUILD_DATA_DIR}/lib)
else()
set(UPSP_INSTALL_BIN_DIR "bin")
set(UPSP_INSTALL_LIB_DIR "lib")
set(UPSP_CPP_INSTALL_BIN_DIR "bin")
set(UPSP_CPP_INSTALL_LIB_DIR "lib")
set(UPSP_INSTALL_EXT_LIB_DIR "lib")
set(UPSP_INSTALL_APP_LIB_DIR "lib")
endif()

add_subdirectory(cpp)
Expand Down
5 changes: 4 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ if (UPSP_BUILD_APPLICATIONS)
add_subdirectory(exec)
add_subdirectory(lib)
add_subdirectory(utils)
add_subdirectory(raycast)
endif()

if (UPSP_BUILD_PYBIND11)
add_subdirectory(raycast)
if (NOT UPSP_BUILD_APPLICATIONS)
add_subdirectory(raycast)
endif()
add_subdirectory(pybind11)
endif()

Expand Down
4 changes: 2 additions & 2 deletions cpp/exec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ install(
psp_process
upsp-extract-frames
xyz_scalar_to_tbl
LIBRARY DESTINATION ${UPSP_CPP_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${UPSP_CPP_INSTALL_BIN_DIR}
LIBRARY DESTINATION ${UPSP_INSTALL_APP_LIB_DIR}
RUNTIME DESTINATION ${UPSP_INSTALL_BIN_DIR}
)
4 changes: 2 additions & 2 deletions cpp/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ install(
TARGETS
upsp
upsp_video
LIBRARY DESTINATION ${UPSP_CPP_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${UPSP_CPP_INSTALL_BIN_DIR}
LIBRARY DESTINATION ${UPSP_INSTALL_APP_LIB_DIR}
RUNTIME DESTINATION ${UPSP_INSTALL_BIN_DIR}
)
8 changes: 4 additions & 4 deletions cpp/pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ target_compile_definitions(raycast PRIVATE VERSION_INFO=${PROJECT_VERSION})

install(
TARGETS
# cine
raycast
LIBRARY DESTINATION ${UPSP_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${UPSP_INSTALL_LIB_DIR}
)
upsp_kdtree
LIBRARY DESTINATION ${UPSP_INSTALL_EXT_LIB_DIR}
RUNTIME DESTINATION ${UPSP_INSTALL_EXT_LIB_DIR}
)
17 changes: 7 additions & 10 deletions cpp/raycast/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ add_library(
)
target_link_libraries(upsp_kdtree PUBLIC IlmBase::Imath)

install(
# raycast extension module handles installation to site-packages
if(UPSP_BUILD_APPLICATIONS)
install(
TARGETS upsp_kdtree
LIBRARY DESTINATION ${UPSP_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${UPSP_INSTALL_LIB_DIR}
)

install(
TARGETS upsp_kdtree
LIBRARY DESTINATION ${UPSP_CPP_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${UPSP_CPP_INSTALL_BIN_DIR}
)
LIBRARY DESTINATION ${UPSP_INSTALL_APP_LIB_DIR}
RUNTIME DESTINATION ${UPSP_INSTALL_BIN_DIR}
)
endif()
4 changes: 2 additions & 2 deletions cpp/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ target_link_libraries(upsp_utils PUBLIC ${LIBRT})

install(
TARGETS upsp_utils
LIBRARY DESTINATION ${UPSP_CPP_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${UPSP_CPP_INSTALL_BIN_DIR}
LIBRARY DESTINATION ${UPSP_INSTALL_APP_LIB_DIR}
RUNTIME DESTINATION ${UPSP_INSTALL_BIN_DIR}
)

0 comments on commit bc3bfcc

Please sign in to comment.