Skip to content

Commit

Permalink
Add optional prefix to installation paths (#235)
Browse files Browse the repository at this point in the history
This allows another CMake project that includes mscclpp to change the
installation path.
  • Loading branch information
chhwang authored Dec 22, 2023
1 parent f1605b7 commit 413c9ad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,16 @@ set_target_properties(mscclpp_static PROPERTIES VERSION ${MSCCLPP_VERSION} SOVER
add_subdirectory(include)
add_subdirectory(src)

if("${INSTALL_PREFIX}" STREQUAL "")
set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
endif()

install(TARGETS mscclpp_obj
FILE_SET HEADERS DESTINATION include)
FILE_SET HEADERS DESTINATION ${INSTALL_PREFIX}/include)
install(TARGETS mscclpp
LIBRARY DESTINATION lib)
LIBRARY DESTINATION ${INSTALL_PREFIX}/lib)
install(TARGETS mscclpp_static
ARCHIVE DESTINATION lib)
ARCHIVE DESTINATION ${INSTALL_PREFIX}/lib)

# Tests
if(BUILD_TESTS)
Expand Down

0 comments on commit 413c9ad

Please sign in to comment.