Skip to content

Commit

Permalink
Add install dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatdongdang committed Sep 9, 2024
1 parent af8b0ca commit a8e9704
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@ file(GLOB_RECURSE MCPP_SOURCE_FILES ${MCPP_SRC_DIR}/*.cpp)
# Library build
add_library(${PROJECT_NAME} SHARED ${MCPP_INCLUDE_FILES} ${MCPP_SOURCE_FILES})

set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
set(HEADER_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})

set_target_properties(${PROJECT_NAME}
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
PUBLIC_HEADER "${MCPP_INCLUDE_FILES}"
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
INSTALL_NAME_DIR ${LIB_INSTALL_DIR}
)

install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include/${PROJECT_NAME}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
PUBLIC_HEADER DESTINATION ${HEADER_INSTALL_DIR}
)

# CPack setup
Expand Down

0 comments on commit a8e9704

Please sign in to comment.