Build UI in a new generated dir
This commit is contained in:
@ -22,6 +22,7 @@ set(DAWN_BUILD_DIR "${CMAKE_BINARY_DIR}")
|
|||||||
set(DAWN_TOOLS_DIR "${DAWN_ROOT_DIR}/tools")
|
set(DAWN_TOOLS_DIR "${DAWN_ROOT_DIR}/tools")
|
||||||
set(DAWN_ASSETS_SOURCE_DIR "${DAWN_ROOT_DIR}/assets")
|
set(DAWN_ASSETS_SOURCE_DIR "${DAWN_ROOT_DIR}/assets")
|
||||||
set(DAWN_ASSETS_BUILD_DIR "${DAWN_BUILD_DIR}/assets")
|
set(DAWN_ASSETS_BUILD_DIR "${DAWN_BUILD_DIR}/assets")
|
||||||
|
set(DAWN_GENERATED_DIR "${DAWN_BUILD_DIR}/generated")
|
||||||
set(DAWN_TEMP_DIR "${DAWN_BUILD_DIR}/temp")
|
set(DAWN_TEMP_DIR "${DAWN_BUILD_DIR}/temp")
|
||||||
|
|
||||||
# Variable Caches
|
# Variable Caches
|
||||||
|
@ -39,12 +39,12 @@ endfunction()
|
|||||||
# UI Tool
|
# UI Tool
|
||||||
function(tool_ui target in)
|
function(tool_ui target in)
|
||||||
add_custom_target(${target}
|
add_custom_target(${target}
|
||||||
COMMAND uigen "${DAWN_ASSETS_SOURCE_DIR}/${in}" "${DAWN_ASSETS_BUILD_DIR}/${target}"
|
COMMAND uigen "${DAWN_ASSETS_SOURCE_DIR}/${in}" "${DAWN_GENERATED_DIR}/ui/${target}"
|
||||||
COMMENT "Generating ui ${target} from ${in}"
|
COMMENT "Generating ui ${target} from ${in}"
|
||||||
DEPENDS uigen
|
DEPENDS uigen
|
||||||
)
|
)
|
||||||
target_include_directories(${DAWN_TARGET_NAME}
|
target_include_directories(${DAWN_TARGET_NAME}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${DAWN_ASSETS_BUILD_DIR}
|
${DAWN_GENERATED_DIR}/ui
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
@ -187,15 +187,10 @@ int main(int argc, char *args[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char fileIn[FILENAME_MAX];
|
|
||||||
char fileOut[FILENAME_MAX];
|
|
||||||
|
|
||||||
sprintf(fileIn, "%s", args[1]);
|
|
||||||
sprintf(fileOut, "%s.hpp", args[2]);
|
|
||||||
fileNormalizeSlashes(args[1]);
|
|
||||||
fileNormalizeSlashes(args[2]);
|
|
||||||
|
|
||||||
// Open input file.
|
// Open input file.
|
||||||
|
char fileIn[FILENAME_MAX];
|
||||||
|
fileNormalizeSlashes(args[1]);
|
||||||
|
sprintf(fileIn, "%s", args[1]);
|
||||||
FILE *fin = fopen(fileIn, "rb");
|
FILE *fin = fopen(fileIn, "rb");
|
||||||
if(fin == NULL) {
|
if(fin == NULL) {
|
||||||
std::cout << "Failed to open input file " << fileIn << std::endl;
|
std::cout << "Failed to open input file " << fileIn << std::endl;
|
||||||
@ -327,9 +322,13 @@ int main(int argc, char *args[]) {
|
|||||||
bufferOut += " };\n";
|
bufferOut += " };\n";
|
||||||
bufferOut += "}";
|
bufferOut += "}";
|
||||||
|
|
||||||
// Finished with XML data, now we can write data out.
|
|
||||||
xmlDispose(&xml);
|
xmlDispose(&xml);
|
||||||
|
|
||||||
|
// Finished with XML data, now we can write data out.
|
||||||
|
char fileOut[FILENAME_MAX];
|
||||||
|
fileNormalizeSlashes(args[2]);
|
||||||
|
sprintf(fileOut, "%s.hpp", args[2]);
|
||||||
|
fileMkdirp(fileOut);
|
||||||
FILE *fout = fopen(fileOut, "wb");
|
FILE *fout = fopen(fileOut, "wb");
|
||||||
if(fout == NULL) {
|
if(fout == NULL) {
|
||||||
std::cout << "Failed to open output file." << std::endl;
|
std::cout << "Failed to open output file." << std::endl;
|
||||||
|
Reference in New Issue
Block a user