1
0
Files
BasaltMeter/BasaltPresenter/Shared/CMakeLists.txt

58 lines
1.5 KiB
CMake
Raw Normal View History

2025-11-27 14:15:20 +08:00
add_library(BasaltShared STATIC "")
target_sources(BasaltShared
PRIVATE
2026-01-04 16:12:36 +08:00
# Sources
2025-11-27 20:48:35 +08:00
pipe_operator.cpp
2026-01-04 16:12:36 +08:00
engine.cpp
deliver.cpp
2026-01-05 16:51:58 +08:00
2025-11-27 14:15:20 +08:00
)
target_sources(BasaltShared
PUBLIC
FILE_SET HEADERS
FILES
# Headers
basalt_char.hpp
2026-01-04 16:12:36 +08:00
basalt_export.hpp
2025-11-27 20:48:35 +08:00
pipe_operator.hpp
2026-01-04 16:12:36 +08:00
engine.hpp
deliver.hpp
2025-11-27 14:15:20 +08:00
)
target_include_directories(BasaltShared
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_definitions(BasaltShared
PUBLIC
$<$<PLATFORM_ID:Windows>:BASALT_OS_WINDOWS>
$<$<NOT:$<PLATFORM_ID:Windows>>:BASALT_OS_POSIX>
PUBLIC
# Use Unicode charset on MSVC
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
# Fix MSVC shit
$<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>
$<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_DEPRECATE>
$<$<CXX_COMPILER_ID:MSVC>:_CRT_NONSTDC_NO_WARNINGS>
$<$<CXX_COMPILER_ID:MSVC>:_CRT_NONSTDC_NO_DEPRECATE>
# Fix Windows header file shit
$<$<BOOL:${WIN32}>:WIN32_LEAN_AND_MEAN>
$<$<BOOL:${WIN32}>:NOMINMAX>
)
target_compile_options(BasaltShared
PUBLIC
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
$<$<CXX_COMPILER_ID:MSVC>:/Zc:preprocessor>
$<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>
)
install(TARGETS BasaltShared
EXPORT BasaltSharedTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)