Skip to content

Commit f6228f9

Browse files
committed
Cmake does not support bundling convenience libraries within a shared library without jumping through hoops. Just list the sources twice for the static and shared libs.
1 parent d0cc710 commit f6228f9

File tree

2 files changed

+6
-28
lines changed

2 files changed

+6
-28
lines changed

src/libaatm/ATM.cpp

-26
This file was deleted.

src/libaatm/CMakeLists.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ target_include_directories(${AATM_LIB} PUBLIC
4141

4242
# Now define rules for the shared library
4343

44-
add_library(${AATM_MOD} SHARED ATM.cpp)
44+
add_library(${AATM_MOD} SHARED ${AATM_SOURCES})
4545

46-
target_link_libraries(${AATM_MOD} PRIVATE ${AATM_LIB})
46+
target_include_directories(${AATM_MOD} PUBLIC
47+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
48+
$<INSTALL_INTERFACE:include>
49+
PRIVATE .
50+
)
4751

4852
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
4953

0 commit comments

Comments
 (0)