[CMake] CMake Visual Studio generator not producing "Output Directory" property in VS

Perkins, Jim R CIV NSWC, PCD james.r.perkins at navy.mil
Thu Mar 20 18:19:26 EDT 2014


Hey everyone,

I am using CMake 2.8.12.2 to create a Visual Studio 12 (2013) project that builds a library (C++).  In my CMake file (an example project for simplicity), I have:
  
PROJECT (testcmake)
set(CMAKE_BUILD_TYPE Debug)
set(SRC
src/testcmake.cpp
)
include_directories(
include/
)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})

ADD_LIBRARY(testcmake SHARED ${SRC})

The only thing I cannot get to work is the CMAKE_LIBRARY_OUTPUT_DIRECTORY variable.  No matter what I try (including other possible CMake variables), it does not get translated to the "Output Directory" field in Visual Studio when building a project.  My library is always placed inside of testcmake\build\Debug, when I want it in ${CMAKE_CURRENT_LIST_DIR}.  I can manually change the "Output Directory" inside Visual Studio and the library outputs to the wanted location, but if I ever modify the CMakeLists file it breaks again, so that is not a solution.

Note that I have no problems getting this to work on Linux with CMake/Make.

Thanks for the help!

Jim


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5619 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140320/d4a0aec3/attachment.bin>


More information about the CMake mailing list