Skip to content

Commit

Permalink
Add variable for 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 2ff061d
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 @@ -33,17 +33,21 @@ 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/${PROJECT_NAME})
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 2ff061d

Please sign in to comment.