cmake - Cross-compiling - retrieve target CPU and version -
i'm cross-compiling vxworks using cmake. when run cmake first time have provide informations compiler, target os etc..
in cross-compile dialogue there 3 target system settings set:
- operating system
- version
- processor
(followed compiler etc.)
while can retrieve first 1 using cmake_system_name
, can't version , processor. both return empty string.
here's example:
message("cmake_system_processor: ${cmake_system_processor}") message("cmake_system_version: ${cmake_system_version}")
output:
cmake_system_processor: cmake_system_version:
my cmake version 2.8.10.2 , target os vxworks (if matters - compiler windriver gnu).
how can version , processor i've set in beginning? or impossible if cross-compile os that's unknown cmake?
(btw. compiling works fine)
it seems not possible far. i'm getting empty strings time.
however, there's working solution, , guess it's better way:
before:
i specified cross-compile settings (compiler , target system, see question), runs on vxworks specific parts in cmake list (checked if( vxworks )
ensure it's not executed when other systems used).
now (solution):
i wrote toolchain file , platform files vxworks , required processors.
cons:
- i have write files:
- toolchain file
- platform file vxworks
- further platform files each processor (and processor type, gnu , diab)
pros:
- cmake list cleaner now
- separate project , target settings
- separate system , processor settings - easy add new processors in clear way keep system settings
- i write settings in toolchain file , cmake loads related system / processor settings
- ...
Comments
Post a Comment