parent
9fb6a9fcb3
commit
a83a21d7f3
@ -0,0 +1,47 @@
|
||||
function(createHeaderDirListProject _list _headersList)
|
||||
foreach(DIR IN LISTS _list)
|
||||
checkDirectory("${PROJECT_DIR}/${DIR}")
|
||||
list(APPEND _newheaderDirList ${PROJECT_DIR}/${DIR})
|
||||
message("${BoldMagenta} |-> Added : ${PROJECT_DIR}/${DIR}")
|
||||
endforeach()
|
||||
message("${ColourReset}")
|
||||
set(${_headersList} ${_newheaderDirList} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
####################################################################################################
|
||||
# SUBMODULE MANAGEMENT
|
||||
####################################################################################################
|
||||
function(makeSubmodulesProject _directoryList _aliasList _submoduleList)
|
||||
set(_newSubmoduleList)
|
||||
set(_headerLoc)
|
||||
|
||||
foreach(_dir IN LISTS _directoryList)
|
||||
checkDirectory("${PROJECT_DIR}/${_dir}") # Does the directory exists (If not fatal error)
|
||||
#For each alias of element present on the list that have been given as argument
|
||||
foreach(alias IN LISTS _aliasList)
|
||||
if(EXISTS ${PROJECT_DIR}/${_dir}/${alias})
|
||||
searchHeaderFile("${alias}" "_headerLoc") #Searches if there is an Header (if not it will not generate any error)
|
||||
message("${BoldCyan} |-> Target Found : ${alias} ${BoldYellow} ")
|
||||
message(" |-> Header : ${_headerLoc}")
|
||||
message(" |-> Source : ${_dir}/${alias}/${alias}")
|
||||
message(" |-> Name : sub::${alias}")
|
||||
|
||||
add_library(${alias}_submodule ${PROJECT_DIR}/${_dir}/${alias})
|
||||
target_compile_options(${alias}_submodule PRIVATE ${MAIN_FLAGS})
|
||||
target_compile_definitions(${alias}_submodule PRIVATE ${MAIN_DEFS})
|
||||
target_include_directories(${alias}_submodule PUBLIC ${COMMON_HEADERS})
|
||||
add_library(sub::${alias} ALIAS ${alias}_submodule)
|
||||
|
||||
#Append the internal submodule list with the newly compiled element
|
||||
list(APPEND _newSubmoduleList sub::${alias})
|
||||
|
||||
else() # When the element has no source file and is only a header.
|
||||
message("${BoldMagenta} |-> No Source file for target : ${alias}")
|
||||
message(" |-> Only headers will be added")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
message("${ColourReset}")
|
||||
#New submodule list with the names of the compiled elements
|
||||
set(${_submoduleList} ${_newSubmoduleList} PARENT_SCOPE)
|
||||
endfunction()
|
@ -0,0 +1,29 @@
|
||||
####################################################################################################
|
||||
# DOXYGEN
|
||||
####################################################################################################
|
||||
|
||||
function(generateDoxygen)
|
||||
if(OUTPUT_DOXYGEN)
|
||||
find_package(Doxygen)
|
||||
if (DOXYGEN_FOUND)
|
||||
set(DOXYGEN_IN ${CMAKE_CORE_DIR}/doxyfile.in)
|
||||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
|
||||
message("${Green}")
|
||||
message("+-------------------------------+")
|
||||
message("Generating Doxygen output")
|
||||
message("+-------------------------------+")
|
||||
message("${ColourReset}")
|
||||
|
||||
# request to configure the file
|
||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||
# note the option ALL which allows to build the docs together with the application
|
||||
add_custom_target( doc_doxygen ALL
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
WORKING_DIRECTORY ${DOXYGEN_OUTPUT_DIR}
|
||||
COMMENT "Generating API documentation with Doxygen"
|
||||
VERBATIM )
|
||||
else (DOXYGEN_FOUND)
|
||||
message("Doxygen need to be installed to generate the doxygen documentation")
|
||||
endif (DOXYGEN_FOUND)
|
||||
endif(OUTPUT_DOXYGEN)
|
||||
endfunction()
|
Loading…
Reference in new issue