update
This commit is contained in:
parent
7004ef076b
commit
89165c9baa
2 changed files with 50 additions and 0 deletions
29
Base.cmake
Normal file
29
Base.cmake
Normal 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
21
PkgConfig.cmake
Normal 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()
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue