@@ -9,29 +9,7 @@ add_library(lsl ${LSL_LIB_TYPE} src/buildinfo.cpp)
99
1010# Configure main library
1111
12- # Set compile definitions for lsl
13- target_compile_definitions (lsl
14- PUBLIC
15- # defines for LSL_CPP_API export header (shared: dllimport/dllexport)
16- $<IF:$<BOOL :${LSL_BUILD_STATIC} >,LIBLSL_STATIC,LIBLSL_EXPORTS>
17- # don't use #pragma(lib) in MSVC builds. TODO: Maybe this can be inherited from lslobj or removed on lslobj?
18- $<$<CXX_COMPILER_ID:MSVC >:LSLNOAUTOLINK>
19- )
20-
21- target_link_libraries (lsl
22- PRIVATE
23- lslobj # TODO: If this is public, does that improve inheritance of includes and compile definitions?
24- lslboost # TODO: Shouldn't be needed -- lslobj already links it
25- ${PUGIXML_LIBRARIES}
26- )
27-
28- # Includes. TODO: Can we not inherit these from lslobj?
29- target_include_directories (lsl
30- INTERFACE
31- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
32- $<INSTALL_INTERFACE:include >
33- )
34-
12+ # Some naming metadata for export
3513set_target_properties (lsl PROPERTIES
3614 VERSION ${liblsl_VERSION_MAJOR} .${liblsl_VERSION_MINOR} .${liblsl_VERSION_PATCH}
3715 SOVERSION ${LSL_ABI_VERSION}
@@ -44,3 +22,27 @@ if(LSL_FORCE_FANCY_LIBNAME)
4422 DEBUG_POSTFIX "-debug"
4523 )
4624endif ()
25+
26+ # Includes. TODO: Can we not inherit these from lslobj?
27+ target_include_directories (lsl
28+ INTERFACE
29+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
30+ $<INSTALL_INTERFACE:include >
31+ )
32+
33+ # Link dependencies. The biggest dependency is lslobj, which contains the bulk of the library code.
34+ target_link_libraries (lsl
35+ PRIVATE
36+ lslobj # TODO: If this is public, does that improve inheritance of includes and compile definitions?
37+ lslboost # TODO: Shouldn't be needed -- lslobj already links it
38+ ${PUGIXML_LIBRARIES}
39+ )
40+
41+ # Set compile definitions for lsl
42+ target_compile_definitions (lsl
43+ PUBLIC
44+ # defines for LSL_CPP_API export header (shared: dllimport/dllexport)
45+ $<IF:$<BOOL :${LSL_BUILD_STATIC} >,LIBLSL_STATIC,LIBLSL_EXPORTS>
46+ # don't use #pragma(lib) in MSVC builds. TODO: Maybe this can be inherited from lslobj or removed on lslobj?
47+ $<$<CXX_COMPILER_ID:MSVC >:LSLNOAUTOLINK>
48+ )
0 commit comments