Skip to content

Commit

Permalink
feat: add basic add_commonlibsf_plugin command, add header-only fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee committed Sep 10, 2023
1 parent 54afd52 commit ed72849
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
CMakeUserPresets.json
CMakeFiles
CMakeCache.txt
*.cmake
/out*
/.vs*
/.vscode*
Expand Down
2 changes: 2 additions & 0 deletions CommonLibSF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
endif()

# dependencies
find_package(fmt CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(xbyak CONFIG REQUIRED)

Expand Down Expand Up @@ -112,6 +113,7 @@ target_include_directories(
target_link_libraries(
${PROJECT_NAME}
PUBLIC
fmt::fmt-header-only
spdlog::spdlog
xbyak::xbyak
Version.lib
Expand Down
12 changes: 12 additions & 0 deletions CommonLibSF/cmake/CommonLibSF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function(add_commonlibsf_plugin TARGET)
set(options OPTIONAL USE_SIGNATURE_SCANNING)
set(oneValueArgs AUTHOR)
set(multiValueArgs SOURCES)
cmake_parse_arguments(ADD_COMMONLIBSF_PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}")

add_library("${TARGET}" SHARED ${ADD_COMMONLIBSF_PLUGIN_SOURCES})

target_link_libraries(${TARGET}
PRIVATE
CommonLibSF::CommonLibSF)
endfunction()
2 changes: 2 additions & 0 deletions CommonLibSF/cmake/config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
include(CMakeFindDependencyMacro)

find_dependency(fmt CONFIG)
find_dependency(spdlog CONFIG)
find_dependency(xbyak CONFIG)

0 comments on commit ed72849

Please sign in to comment.