mirror of
https://github.com/Hizenberg469/GitMap.git
synced 2026-04-19 17:52:24 +03:00
Implementing XML
This commit is contained in:
39
cmake/AddGitSubmodule.cmake
Normal file
39
cmake/AddGitSubmodule.cmake
Normal file
@@ -0,0 +1,39 @@
|
||||
function(add_git_submodule relative_dir lib link)
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
set(FULL_DIR ${CMAKE_SOURCE_DIR}/${relative_dir})
|
||||
|
||||
#For intializing git if not already initialized.
|
||||
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
# If .git directory does not exist, execute git init
|
||||
execute_process(
|
||||
COMMAND git init
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
|
||||
if(result)
|
||||
message(FATAL_ERROR "Failed to initialize git repository.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#For adding the external deps if not added yet
|
||||
if (NOT EXISTS ${FULL_DIR}/${lib})
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE}
|
||||
submodule add -- ${link}
|
||||
WORKING_DIRECTORY ${FULL_DIR}
|
||||
)
|
||||
elseif (NOT EXISTS ${FULL_DIR}/CMakeLists.txt)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE}
|
||||
submodule update --init -- ${relative_dir}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
if (EXISTS ${FULL_DIR}/CMakeLists.txt)
|
||||
message("Submodule is CMake Project: ${FULL_DIR}/CMakeLists.txt")
|
||||
add_subdirectory(${FULL_DIR})
|
||||
else()
|
||||
message("Submodule is NO CMake Project: ${FULL_DIR}")
|
||||
endif()
|
||||
endfunction(add_git_submodule)
|
||||
41
cmake/Findmxml.cmake
Normal file
41
cmake/Findmxml.cmake
Normal file
@@ -0,0 +1,41 @@
|
||||
# Findmxml.cmake
|
||||
|
||||
|
||||
# Locate the mxml library
|
||||
message(STATUS "Searching for mxml library")
|
||||
find_library(MXML_LIBRARY_STATIC
|
||||
NAMES libmxml4.a
|
||||
HINTS
|
||||
${CMAKE_SOURCE_DIR}/utils/mxml/lib
|
||||
${CMAKE_SOURCE_DIR}/utils/mxml
|
||||
PATH_SUFFIXES lib
|
||||
DOC "Path to the mxml library"
|
||||
)
|
||||
|
||||
message(STATUS "MXML_LIBRARY: ${MXML_LIBRARY_STATIC}")
|
||||
|
||||
|
||||
# Locate the directory containing mxml.h
|
||||
message(STATUS "Searching for mxml.h")
|
||||
find_path(MXML_INCLUDE_DIR
|
||||
NAMES mxml.h
|
||||
HINTS
|
||||
${CMAKE_SOURCE_DIR}/utils/mxml/include
|
||||
${CMAKE_SOURCE_DIR}/utils/mxml
|
||||
PATH_SUFFIXES include
|
||||
DOC "Path to the mxml.h file"
|
||||
)
|
||||
message(STATUS "MXML_INCLUDE_DIR: ${MXML_INCLUDE_DIR}")
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(mxml REQUIRED_VARS MXML_LIBRARY_STATIC MXML_INCLUDE_DIR
|
||||
HANDLE_COMPONENTS)
|
||||
|
||||
if(MXML_FOUND)
|
||||
set(MXML_LIBRARIES ${MXML_LIBRARY_STATIC})
|
||||
set(MXML_INCLUDE_DIRS ${MXML_INCLUDE_DIR})
|
||||
else()
|
||||
set(MXML_LIBRARIES)
|
||||
set(MXML_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MXML_INCLUDE_DIR MXML_LIBRARY_STATIC)
|
||||
Reference in New Issue
Block a user