diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-11 16:26:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-11 16:26:43 +0400 |
commit | 5f341a846b78df701686a56da7caf61c087a716f (patch) | |
tree | 902eb747ce8d0f186f146a966be6f5231271156e /build_files | |
parent | 51182bc78d993126645b20e38349760f1a697966 (diff) |
startup.blend and preview.blend are now converted to C at build time.
made some changes to startup.c
- change default player to internal since its working now.
- added new screen for full screen 3d viewport (nice for demo's and navigating)
- disable cursor depth option (was enabled by default because of re-used flag)
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/macros.cmake | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 50bbab9eed9..5a5f02b41fa 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -638,7 +638,7 @@ macro(blender_project_hack_post) # -------------- # MINGW HACK END if (_reset_standard_libraries) - # Must come after project(...) + # Must come after projecINCt(...) # # MINGW workaround for -ladvapi32 being included which surprisingly causes # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender @@ -727,29 +727,20 @@ macro(set_lib_path endmacro() -# not highly optimal, may replace with generated C program like makesdna -function(data_to_c - file_from file_to var_name) +# TODO, create a C binary and call it instead!, doing this in cmake its slow +macro(data_to_c + file_from file_to var_name + list_to_add) - file(READ ${file_from} file_from_string HEX) - string(LENGTH ${file_from_string} _max_index) - math(EXPR size_on_disk ${_max_index}/2) + list(APPEND ${list_to_add} ${file_to}) - file(REMOVE ${file_to}) - - file(APPEND ${file_to} "int ${var_name}_size = ${size_on_disk};\n") - file(APPEND ${file_to} "char ${var_name}[] = {") - - set(_index 0) - - while(NOT _index EQUAL _max_index) - string(SUBSTRING "${file_from_string}" ${_index} 2 _pair) - file(APPEND ${file_to} "0x${_pair},") - math(EXPR _index ${_index}+2) - endwhile() - file(APPEND ${file_to} "};\n") -endfunction() - -# eg -# data_to_c("/home/guest/test.txt" "/home/guest/test.txt.h" "this_is_data") + add_custom_command( + OUTPUT ${file_to} + COMMAND ${CMAKE_COMMAND} + -DFILE_FROM=${file_from} + -DFILE_TO=${file_to} + -DVAR_NAME=${var_name} + -P ${CMAKE_SOURCE_DIR}/build_files/cmake/data_to_c.cmake + DEPENDS ${file_from}) +endmacro() |