Hello,

What about replacing FileToString.c with pure-CMake code?

FOREACH( file ${filelist} )
  FILE( STRINGS ${file} _file )
  STRING( REGEX REPLACE \\" \\\\"_file_after_the_regexes ${_file} )
  ... (more regexes)
  FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${file} ${_file_after_the_regexes} )
ENDFOREACH(file)

(I've not tested the above code but it should be more or less like that)

Building Wt would take maybe 1 more minute but it would be easier,
particularly in cross-platform environments.

On Thu, Feb 12, 2009 at 9:36 PM, Wim Dumon <[email protected]> wrote:
> Hi James,
>
> That is indeed an issue we have to solve one day. The filetostring
> binary is cross-compiled like all the rest, but it should be compiled
> for the host machine. There is an easy work-around: just copy the
> binary from your native build tree and overwrite the cross-compiled
> one; the build shall then continue.
>
> Regards,
> Wim.
>
> 2009/2/12 James Bewley <[email protected]>:
>> Hi all,
>>
>> I'm new to WT, I was very impressed with the information I've read about its
>> features and the examples I've compiled on my host machine seem very good.
>> I am however currently having a problem trying to cross-compile it for my
>> ARM single board computer.
>>
>> There doesn't seem to be any information in the docs about this, has anyone
>> had a successful experience with cross toolchains and WT?
>>
>> I've followed the guide on the cmake website which basicly tells you to
>> setup some cmake environment variables with the paths to your cross
>> compiler, libraries and header files.  It's pretty straight forward, but
>> when I come to run make in the wt directory I encounter some issues.  make
>> appears to start building WT with the correct compiler settings but then
>> attempts to execute one of the files it just compiled.  This obviously isn't
>> going to work as my host machine is x86 and the compiled binary is ARM.
>>
>> $ cmake ../
>> -DCMAKE_TOOLCHAIN_FILE="~/Project/Downloads/wt-2.2.3/build_target/toolchain_file"
>> -DBOOST_DIR="~/Project/sandbox/GatewayDevice/toolchain/boost_target/"
>> -DBOOST_COMPILER="gcc" -DBOOST_VERSION="1_38" -DCONNECTOR_HTTP="ON"
>> -DEXAMPLES_CONNECTOR="wthttp" -DMULTI_THREADED="ON" -DHTTP_WITH_SSL="ON"
>> -DCMAKE_INSTALL_PREFIX="/homejbewley/Project/sandbox/GatewayDevice/toolchain/wt_target"
>>
>> $ make
>> Scanning dependencies of target filetostring
>> [  0%] Building CXX object
>> src/CMakeFiles/filetostring.dir/web/skeleton/FileToString.o
>> Linking CXX executable filetostring
>> [  0%] Built target filetostring
>> [  0%] Generating CommScript_js.C
>> /bin/sh: ./filetostring: cannot execute binary file
>> make[2]: *** [src/CommScript_js.C] Error 126
>> make[1]: *** [src/CMakeFiles/wt.dir/all] Error 2
>> make: *** [all] Error 2
>>
>> $ file src/filetostring
>> src/filetostring: ELF 32-bit LSB executable, ARM, version 1 (SYSV),
>> dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
>>
>>
>>
>> If anyone has any advice I'd be extreemly greatful.
>>
>> Regards,
>>
>>
>> James
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> witty-interest mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>
>>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

------------------------------------------------------------------------------
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to