Kylin/Universal/CMakeLists.txt

47 lines
1.3 KiB
CMake
Raw Normal View History

2023-07-25 10:40:14 +08:00
find_package(Boost REQUIRED COMPONENTS log log_setup program_options)
2023-07-21 10:47:31 +08:00
add_library(Universal
2024-01-21 18:08:16 +08:00
ApplicationSettings.h
2023-07-21 10:47:31 +08:00
BoostLog.h BoostLog.inl BoostLog.cpp
2023-07-25 10:40:14 +08:00
BufferUtility.h BufferUtility.cpp
2023-07-21 11:53:19 +08:00
DateTime.h DateTime.cpp
FunctionTraits.h
2023-07-21 11:21:16 +08:00
IoContext.h IoContext.cpp
MessageManager.h MessageManager.inl MessageManager.cpp
2023-07-25 10:40:14 +08:00
ProcessUtility.h ProcessUtility.inl ProcessUtility.cpp
2023-07-21 11:21:16 +08:00
Singleton.h
2023-07-25 10:40:14 +08:00
SingletonProcess.h SingletonProcess.cpp
2023-07-21 10:47:31 +08:00
StreamFormat.h StreamFormat.inl StreamFormat.cpp
2023-07-21 15:46:12 +08:00
StringUtility.h StringUtility.cpp
2023-07-21 10:47:31 +08:00
)
2024-01-17 11:56:24 +08:00
set_property(TARGET Universal
PROPERTY POSITION_INDEPENDENT_CODE ON
)
2023-12-27 19:42:12 +08:00
if(CMAKE_VERSION VERSION_LESS 3.20)
get_filename_component(KYLIN_CORE_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
if(NOT Boost_USE_STATIC_LIBS)
target_compile_definitions(Universal
PUBLIC BOOST_LOG_DYN_LINK
)
endif()
2023-12-27 19:42:12 +08:00
else()
cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH KYLIN_CORE_INCLUDE_PATH)
endif()
2023-12-25 16:31:42 +08:00
2024-09-16 01:32:40 +08:00
if(DISABLE_LOG)
target_compile_definitions(Universal
PUBLIC DISABLE_LOG
)
endif()
2023-07-21 11:21:16 +08:00
target_include_directories(Universal
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
2023-12-25 16:31:42 +08:00
INTERFACE ${KYLIN_CORE_INCLUDE_PATH}
2023-12-27 19:42:12 +08:00
PUBLIC ${Boost_INCLUDE_DIRS}
2023-07-21 11:21:16 +08:00
)
2023-07-21 10:47:31 +08:00
target_link_libraries(Universal
2023-07-21 11:21:16 +08:00
PUBLIC ${Boost_LIBRARIES}
2023-07-21 10:47:31 +08:00
)