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

Jan Woetzel jw at mip.informatik.uni-kiel.de
Thu May 8 12:55:52 EDT 2003


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?




(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 ?



(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?



Best regards,
Jan.




More information about the CMake mailing list