[Cmake] three questions: CMAKE_BUILD_TYPE, BUILD_SHARED_LIBS, SEND_ERROR in MESSAGE

William A. Hoffman bill.hoffman at kitware.com
Sun May 11 21:39:59 EDT 2003


At 06:55 PM 5/8/2003 +0200, Jan Woetzel wrote:
>Hi,
>
>first of all some flowers to the cmake developers:
>I like cmake, it is very useful to me for developing under Linux with gcc 
>and porting my projects to MS Windows (.Net).
>
>
>Three questions arised:
>
>(1)
>I can switch between static and shared build with BUILD_SHARED_LIBS
>or adding STATIC/SHARED to ADD_LIBRARY.
>Then one of tehm is built.
>But I want to build both, static and shared library.
>I tried:
>
>ADD_LIBRARY( MYLIB STATIC MY_SRC)
>ADD_LIBRARY( MYLIB SHARED MY_SRC)
>
>But only one one is generated.
>--What's the right way to go?
>

1.  The only way to do this would be to put each library in a separate 
SUBDIR directory.



>(2)
>I want to set my CMAKE_BUILD_TYPE to some default which is not 'None',
>but for example "Debug"
>
>I tried:
>SET(CMAKE_BUILD_TYPE "Debug")
>(with and without quotes around Debug).
>
>But nothing changes running ccmake (version 1.6 patch5 under Linux).
>I can 'manually' enter the value Debug, but the *_DEBUG flags are not 
>used. The *_RELEASE flags are used.
>
>--How do I set the default build in my CMakeLists.txt ?
The SET command will work, but your cache will still not have the value.
You can use a SET(CACHE FORCE) to change the cache.



>(3)
>I want to echo some info (for my own debugging).which shouldn'f affect teh 
>build process.
>Any MESSAGE, e.g. like
>   MESSAGE ("hello")
>is treated as ERROR - although I didn't add SEND_ERROR.
>I expected this behaviour just for
>MESSGAE (SEND_ERROR "something is wrong")
>
>--Is this a (known) bug in MESSAGE, exists a workaround?

MESSAGE is not treated as an error.  ccmake currently reports it as an error
but does not treat it like an error.   SEND_ERROR causes ccmake and CMakeSetup
to not go on to the generate stage.

-Bill




>Best regards,
>Jan.
>
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake






More information about the CMake mailing list