[CMake] My definitions are written into codeblocks project file but they can't be shown in CodeBloks IDE

yaoyansi yaoyansi at aliyun.com
Sun Sep 7 10:23:45 EDT 2014


I use cmake 2.8.11 on CentOS 7 x64.

My cmake files and the generated CodeBlocks project files are attached, and here is a code section of my CMakeLists.txtset(MAYA_COMPILE_DEFINITIONS 
    REQUIRE_IOSTREAM _BOOL LINUX _LINUX LINUX_64)

set(MAYA_COMPILE_FLAGS
    "-m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords" )

set(MAYA_LINK_FLAGS
    "-shared -m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords -Wl,-Bsymbolic" )

SET_TARGET_PROPERTIES( ${MY_PROJECT_NAME}
    PROPERTIES 
        COMPILE_DEFINITIONS        "${MAYA_COMPILE_DEFINITIONS}"
        COMPILE_FLAGS            "${MAYA_COMPILE_FLAGS}"
        LINK_FLAGS            "${MAYA_LINK_FLAGS}"
        PREFIX                ""
        SUFFIX                ${MAYA_EXTENSION}

        OUTPUT_NAME            ${MY_PROJECT_NAME}
        LIBRARY_OUTPUT_DIRECTORY    ${CMAKE_CURRENT_SOURCE_DIR}/../../plug-ins
)When I open the generated CodeBlocks project file dynamic_enum.cbp, I can't find any definitions in Project's build options window. My screenshot is attached either.
But, when I open dynamic_enum.cbp with gedit, I can find these definitions. here it is:         <Compiler>
            <Add option="-DREQUIRE_IOSTREAM" />
            <Add option="-D_BOOL" />
            <Add option="-DLINUX" />
            <Add option="-D_LINUX" />
            <Add option="-DLINUX_64" />I don't know how to deal with it now. Is there any thing wrong in my CMakeLists.txt?Could you give me any help? Thank you in advance.Cheersyaoyansi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140907/80e053eb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dynamic_enum_cmake.zip
Type: application/octet-stream
Size: 40600 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140907/80e053eb/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2014-09-07 22_12_38.png
Type: application/octet-stream
Size: 97008 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140907/80e053eb/attachment-0003.obj>


More information about the CMake mailing list