This commit is contained in:
Nishi 2025-11-18 19:16:29 +09:00
commit 89165c9baa
Signed by: nishi
GPG key ID: 27EF69B208EB9343
2 changed files with 50 additions and 0 deletions

29
Base.cmake Normal file
View file

@ -0,0 +1,29 @@
include(GNUInstallDirs)
macro(setup_project name dir)
project(
${name}
)
file(
GLOB
${name}_SRC
*.c
)
add_executable(
${name}
${${name}_SRC}
)
target_link_libraries(
${name}
PRIVATE
MDELib Mw
)
install(
TARGETS ${name}
DESTINATION ${dir}
)
endmacro()

21
PkgConfig.cmake Normal file
View file

@ -0,0 +1,21 @@
find_package(PkgConfig)
macro(pkg_config_add dest name)
pkg_check_modules(${name} REQUIRED ${name})
target_include_directories(
${dest}
PRIVATE
${${name}_INCLUDE_DIRS}
)
target_link_directories(
${dest}
PRIVATE
${${name}_LIBRARY_DIRS}
)
target_link_libraries(
${dest}
PRIVATE
${${name}_LIBRARIES}
)
endmacro()