Skip to content

Commit a540f6b

Browse files
conej730bovine
authored andcommitted
Create static and dynamic libraries during build (#4)
* Change CMAKE_SOURCE_DIR to cpptcl_SOURCE_DIR * Convert cpptcl to static library * Set property POSITION_INDEPENDENT_CODE to ON * Generate dynamic and static libraries
1 parent 89c2618 commit a540f6b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ list(APPEND HDRS_DETAILS ${cpptcl_SOURCE_DIR}/cpptcl/details/methods.h)
5252
list(APPEND HDRS_DETAILS ${cpptcl_SOURCE_DIR}/cpptcl/details/methods_v.h)
5353
list(APPEND HDRS_DETAILS ${cpptcl_SOURCE_DIR}/cpptcl/details/bind.h)
5454

55-
add_library(cpptcl STATIC ${SRCS} ${HDRS} ${HDRS_DETAILS})
56-
set_property(TARGET cpptcl PROPERTY POSITION_INDEPENDENT_CODE ON)
55+
add_library(cpptcl SHARED ${SRCS} ${HDRS} ${HDRS_DETAILS})
56+
add_library(cpptcl_static STATIC ${SRCS} ${HDRS} ${HDRS_DETAILS})
57+
set_property(TARGET cpptcl_static PROPERTY POSITION_INDEPENDENT_CODE ON)
5758
target_link_libraries(cpptcl ${TCL_STUB_LIBRARY})
58-
install(TARGETS cpptcl ARCHIVE DESTINATION lib)
59+
install(TARGETS cpptcl LIBRARY DESTINATION lib)
60+
install(TARGETS cpptcl_static ARCHIVE DESTINATION lib)
5961
install(FILES ${HDRS} DESTINATION include/cpptcl)
6062
install(FILES ${HDRS_DETAILS} DESTINATION include/cpptcl/details)
6163

0 commit comments

Comments
 (0)