Hi,

Why are the CMAKE_C_FLAGS reset to the empty string when calling cmake
as shown below? (Using cmake 2.6.4 on Linux). When I later call ccmake
in the top-level build directory, the CMAKE_C_FLAGS variable does not
contain the value specified in the toolchain file but is instead
empty. The specified flags are not used for compilation of C sources.
No other cmake related file in my sources explicitly modifies that
variable.

Kind regards
Ingolf

########################################################
Invocation:
cmake -DCMAKE_MODULE_PATH="./cmake"
-DCMAKE_TOOLCHAIN_FILE="./cmake/toolchain.cmake"
-DCMAKE_BUILD_TYPE=Debug
########################################################
./cmake/toolchain.cmake:
set(CMAKE_SYSTEM_NAME foo)
set(CMAKE_SYSTEM_VERSION 3.1.4)
set(CMAKE_SYSTEM_PROCESSOR bar)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_VERBOSE_MAKEFILE ON)

set(CMAKE_FIND_ROOT_PATH /opt/foo)
set(CMAKE_C_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/bar-foo-gcc)

set(CMAKE_C_FLAGS "-Wall -W -mcpu=bar")
########################################################
./cmake/Platform/foo.cmake:
set(UNIX 1)

set(CMAKE_C_OUTPUT_EXTENSION .o)

set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS OFF)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to