Skip to content

Commit

Permalink
Merge pull request #85 from nhatdongdang/fix/dynamic-linking
Browse files Browse the repository at this point in the history
Fix dynamic linking on macos
  • Loading branch information
rozukke authored Sep 9, 2024
2 parents cfbf035 + a8e9704 commit 8a42341
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +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 ${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 8a42341

Please sign in to comment.