cmake update

This commit is contained in:
Nishi 2025-12-17 19:24:52 +09:00
commit caf262f1a2
Signed by: nishi
GPG key ID: 27EF69B208EB9343
3 changed files with 12 additions and 12 deletions

View file

@ -1,7 +1,7 @@
include_guard(DIRECTORY) include_guard(DIRECTORY)
include(GNUInstallDirs) include(GNUInstallDirs)
macro(setup_base type name dir) macro(mde_setup_base type name dir)
project( project(
${name} ${name}
) )
@ -43,15 +43,15 @@ macro(setup_base type name dir)
) )
endmacro() endmacro()
macro(setup_project name dir) macro(mde_setup_project name dir)
setup_base(project ${name} ${dir}) mde_setup_base(project ${name} ${dir})
endmacro() endmacro()
macro(setup_library name) macro(mde_setup_library name)
if(ARGV2) if(ARGV2)
setup_base(library ${name} ARGV2) mde_setup_base(library ${name} ARGV2)
else() else()
setup_base(library ${name} ${CMAKE_INSTALL_LIBDIR}) mde_setup_base(library ${name} ${CMAKE_INSTALL_LIBDIR})
endif() endif()
if(EXISTS "../include") if(EXISTS "../include")
@ -63,7 +63,7 @@ macro(setup_library name)
endif() endif()
endmacro() endmacro()
macro(math_add name) macro(mde_math_add name)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries( target_link_libraries(
${name} ${name}

View file

@ -1,7 +1,7 @@
include_guard(DIRECTORY) include_guard(DIRECTORY)
include(MDEPkgConfig) include(MDEPkgConfig)
macro(opengl_add name) macro(mde_opengl_add name)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries( target_link_libraries(
${name} ${name}
@ -9,11 +9,11 @@ macro(opengl_add name)
opengl32 opengl32
) )
else() else()
pkg_config_add(${name} gl) mde_pkg_config_add(${name} gl)
endif() endif()
endmacro() endmacro()
macro(glu_add name) macro(mde_glu_add name)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries( target_link_libraries(
${name} ${name}
@ -21,6 +21,6 @@ macro(glu_add name)
glu32 glu32
) )
else() else()
pkg_config_add(${name} glu) mde_pkg_config_add(${name} glu)
endif() endif()
endmacro() endmacro()

View file

@ -1,7 +1,7 @@
include_guard(DIRECTORY) include_guard(DIRECTORY)
find_package(PkgConfig) find_package(PkgConfig)
macro(pkg_config_add dest name) macro(mde_pkg_config_add dest name)
pkg_check_modules(${name} REQUIRED ${name}) pkg_check_modules(${name} REQUIRED ${name})
target_include_directories( target_include_directories(
${dest} ${dest}