forked from SFTtech/openage
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stdout of configure and cmake has been beautified build system has been refactored further fixed minor bug after minor bug...
- Loading branch information
Showing
11 changed files
with
250 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
set(CODEGEN_INVOCATION ${PYTHON_INVOCATION} -m openage.codegen --target-cache=${CMAKE_BINARY_DIR}/codegen_target_cache --depend-cache=${CMAKE_BINARY_DIR}/codegen_depend_cache --cpp-src-dir=${CPP_SOURCE_DIR}) | ||
|
||
execute_process(COMMAND | ||
${CODEGEN_INVOCATION} | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
RESULT_VARIABLE COMMAND_RESULT | ||
) | ||
|
||
if(NOT ${COMMAND_RESULT} EQUAL 0) | ||
message(FATAL_ERROR "failed to get codegen filelist via convert script invocation") | ||
endif() | ||
|
||
|
||
FILE(READ "${CMAKE_BINARY_DIR}/codegen_target_cache" CODEGEN_TARGETS) | ||
FILE(READ "${CMAKE_BINARY_DIR}/codegen_depend_cache" CODEGEN_DEPENDS) | ||
STRING(REGEX REPLACE "\n" ";" CODEGEN_TARGETS "${CODEGEN_TARGETS}") | ||
STRING(REGEX REPLACE "\n" ";" CODEGEN_DEPENDS "${CODEGEN_DEPENDS}") | ||
|
||
add_custom_command(OUTPUT ${CODEGEN_TARGETS} | ||
COMMAND ${CODEGEN_INVOCATION} --write-to-sourcedir --touch-file-on-cache-change=${CMAKE_BINARY_DIR} --force-rerun-on-targetcache-change | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
DEPENDS ${CODEGEN_DEPENDS} | ||
COMMENT running code generation | ||
PRE_BUILD | ||
) | ||
|
||
foreach(target ${CODEGEN_TARGETS}) | ||
if(${target} MATCHES \\.cpp$) | ||
add_sources_absolute(${PROJECT_NAME} ${target}) | ||
function(codegen_init) | ||
set(CODEGEN_INVOCATION ${PYTHON_INVOCATION} -m openage.codegen --target-cache=${CMAKE_BINARY_DIR}/codegen_target_cache --depend-cache=${CMAKE_BINARY_DIR}/codegen_depend_cache --cpp-src-dir=${CPP_SOURCE_DIR}) | ||
|
||
execute_process(COMMAND | ||
${CODEGEN_INVOCATION} | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
RESULT_VARIABLE COMMAND_RESULT | ||
) | ||
|
||
if(NOT ${COMMAND_RESULT} EQUAL 0) | ||
message(FATAL_ERROR "failed to get codegen filelist via convert script invocation") | ||
endif() | ||
endforeach() | ||
|
||
add_custom_target(codegen ALL DEPENDS ${CODEGEN_TARGETS}) | ||
|
||
FILE(READ "${CMAKE_BINARY_DIR}/codegen_target_cache" CODEGEN_TARGET_FILES) | ||
FILE(READ "${CMAKE_BINARY_DIR}/codegen_depend_cache" CODEGEN_DEPENDS) | ||
STRING(REGEX REPLACE "\n" ";" CODEGEN_TARGET_FILES "${CODEGEN_TARGET_FILES}") | ||
STRING(REGEX REPLACE "\n" ";" CODEGEN_DEPENDS "${CODEGEN_DEPENDS}") | ||
|
||
add_custom_command(OUTPUT ${CODEGEN_TARGET_FILES} | ||
COMMAND ${CODEGEN_INVOCATION} --write-to-sourcedir --touch-file-on-cache-change=${CMAKE_CURRENT_LIST_FILE} --force-rerun-on-targetcache-change | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
DEPENDS ${CODEGEN_DEPENDS} | ||
COMMENT running code generation | ||
) | ||
|
||
set(CODEGEN_TARGET_TUS) | ||
foreach(target ${CODEGEN_TARGET_FILES}) | ||
if(${target} MATCHES \\.cpp$) | ||
list(APPEND CODEGEN_TARGET_TUS ${target}) | ||
endif() | ||
endforeach() | ||
|
||
add_custom_target(codegen ALL DEPENDS ${CODEGEN_TARGET_FILES}) | ||
|
||
set(CODEGEN_TARGET_TUS ${CODEGEN_TARGET_TUS} PARENT_SCOPE) | ||
endfunction() | ||
|
||
codegen_init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
# Doxygen integration | ||
|
||
find_package(Doxygen) | ||
if(DOXYGEN_FOUND) | ||
find_file(DOT dot HINTS /usr/bin/dot) | ||
function(doxygen_init) | ||
find_package(Doxygen) | ||
if(DOXYGEN_FOUND) | ||
find_file(DOT dot HINTS /usr/bin/dot) | ||
|
||
set(DOT_EXECUTABLE "/bin/false") | ||
set(HAVE_DOT "NO") | ||
set(DOT_EXECUTABLE "/bin/false") | ||
set(HAVE_DOT "NO") | ||
|
||
if(NOT ${DOT} STREQUAL "DOT-NOTFOUND") | ||
set(DOT_EXECUTABLE "${DOT}") | ||
set(HAVE_DOT "YES") | ||
message("found dot: ${DOT_EXECUTABLE}") | ||
if(NOT ${DOT} STREQUAL "DOT-NOTFOUND") | ||
set(DOT_EXECUTABLE "${DOT}") | ||
set(HAVE_DOT "YES") | ||
else() | ||
message(WARNING "graphviz dot couldn't be found, you won't have cool graphs in the docs.") | ||
endif() | ||
|
||
# adapt doxygen config | ||
configure_file(${BUILDSYSTEM_DIR}/templates/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY) | ||
|
||
# add doc target | ||
add_custom_target(doc | ||
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
COMMENT "generating docs with Doxygen" VERBATIM | ||
) | ||
else() | ||
message(WARNING "graphviz dot couldn't be found, you won't have cool graphs in the docs.") | ||
message(WARNING "doxygen couldn't be found, you won't be able to generate docs") | ||
endif() | ||
endfunction() | ||
|
||
# adapt doxygen config | ||
configure_file(${BUILDSYSTEM_DIR}/templates/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY) | ||
|
||
# add doc target | ||
add_custom_target(doc | ||
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
COMMENT "generating docs with Doxygen" VERBATIM | ||
) | ||
endif() | ||
doxygen_init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.