mdecmake/cmake/MDEBase.cmake
2025-11-26 07:03:34 +09:00

40 lines
458 B
CMake

include_guard(DIRECTORY)
include(GNUInstallDirs)
macro(setup_project name dir)
project(
${name}
)
file(
GLOB
${name}_SRC
*.c
)
add_executable(
${name}
${${name}_SRC}
)
target_link_libraries(
${name}
PRIVATE
MDECore Mw
)
install(
TARGETS ${name}
DESTINATION ${dir}
)
endmacro()
macro(math_add name)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(
${name}
PRIVATE
m
)
endif()
endmacro()