Hello guys,

I use multi-configuration generator (MSVC 2008) and I need to create
one solution containing two configurations for one library target N:

For build type Debug target N is compiled as static library
For build type Release target N is compiled as shared library

Something like this, but I know that I can't use CMAKE_BUILD_TYPE
variable when I use multi-configuration generator:

cmake_minimum_required (VERSION 2.8.11)
project (hello)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
    add_library(hello STATIC main.cpp)
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
    add_library(hello SHARED main.cpp)
endif()

I already used CMAKE_CXX_FLAGS_DEBUG and CMAKE_CXX_FLAGS_RELEASE
to distinguish some attributes between Debug and Release, but I can't
figure it out in case of the library type (SHARED vs STATIC).

Any ideas how to achieve it?

Thanks
Lukas
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to