How could I control generated object files name?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How could I control generated object files name?

huaiguang ye
hi,

How could I control my generated object files name? Because I found in my cmake project, *.c/*.cc/*.cpp will generated to object *.c.o/*.cc.o/*.cpp.o, but I really want to get *.o. Such as:
$ find . -name "*.o"
./src/CMakeFiles/RSLcommon.dir/BasicDdm.cc.o
./src/CMakeFiles/RSLcommon.dir/DoubleArray.cc.o
./src/CMakeFiles/RSLcommon.dir/RslBoardInfo.cc.o
./src/CMakeFiles/RSLcommon.dir/RslMath.cc.o
./src/CMakeFiles/RSLcommon.dir/RslRebootReasons.cc.o
./src/CMakeFiles/RSLcommon.dir/RslStatusCode.cc.o
./src/CMakeFiles/RSLcommon.dir/RslSubsystemState.cc.o
./src/CMakeFiles/RSLcommon.dir/defstr.cc.o
./src/CMakeFiles/RSLcommon.dir/test1.c.o
./src/CMakeFiles/RSLcommon.dir/test2.cpp.o


And my CMakeLists.txt in src is below:

add_library(RSLcommon STATIC
           BasicDdm.cc
           DoubleArray.cc
       RslBoardInfo.cc
       RslMath.cc
       RslRebootReasons.cc
       RslStatusCode.cc
       RslSubsystemState.cc
       defstr.cc
       test1.c
       test2.cpp)

I don't know where is the wrong. And my cmake version is 2.6.4.

Another question is if I don't want to generated static or shared library neither, I only want to compiling source code(*.cc) to object files(*.o), what should I do?

Thanks in advance.


If you know the means of @, then you know the means of Internet.
http://hgye.blogspot.com


好玩贺卡等你发,邮箱贺卡全新上线!
_______________________________________________
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 | Threaded
Open this post in threaded view
|

Re: How could I control generated object files name?

Alexander Neundorf-3
On Friday 07 August 2009, huaiguang ye wrote:

> hi,
>
> How could I control my generated object files name? Because I found in my
> cmake project, *.c/*.cc/*.cpp will generated to object
> *.c.o/*.cc.o/*.cpp.o, but I really want to get *.o. Such as: $ find . -name
> "*.o"
> ./src/CMakeFiles/RSLcommon.dir/BasicDdm.cc.o
> ./src/CMakeFiles/RSLcommon.dir/DoubleArray.cc.o
> ./src/CMakeFiles/RSLcommon.dir/RslBoardInfo.cc.o
> ./src/CMakeFiles/RSLcommon.dir/RslMath.cc.o
> ./src/CMakeFiles/RSLcommon.dir/RslRebootReasons.cc.o
> ./src/CMakeFiles/RSLcommon.dir/RslStatusCode.cc.o
> ./src/CMakeFiles/RSLcommon.dir/RslSubsystemState.cc.o
> ./src/CMakeFiles/RSLcommon.dir/defstr.cc.o
> ./src/CMakeFiles/RSLcommon.dir/test1.c.o
> ./src/CMakeFiles/RSLcommon.dir/test2.cpp.o
>
>
> And my CMakeLists.txt in src is below:
>
> add_library(RSLcommon STATIC
>            BasicDdm.cc
>            DoubleArray.cc
>        RslBoardInfo.cc
>        RslMath.cc
>        RslRebootReasons.cc
>        RslStatusCode.cc
>        RslSubsystemState.cc
>        defstr.cc
>        test1.c
>        test2.cpp)
>
> I don't know where is the wrong. And my cmake version is 2.6.4.
>
> Another question is if I don't want to generated static or shared library
> neither, I only want to compiling source code(*.cc) to object files(*.o),
> what should I do?

Why do you want that ?
There is a cmake variable for that...

Alex
_______________________________________________
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