[cmake-developers] [CMake 0014702]: PREFIX property is ignored for Visual Studio 2010+ generators

Mantis Bug Tracker mantis at public.kitware.com
Thu Jan 16 06:39:48 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14702 
====================================================================== 
Reported By:                Mattes D
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14702
Category:                   (No Category)
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-01-16 06:39 EST
Last Modified:              2014-01-16 06:39 EST
====================================================================== 
Summary:                    PREFIX property is ignored for Visual Studio 2010+
generators
Description: 
The Visual Studio 2010+ generator, as implemented in
cmVistualStudio10Target.cpp, seems to half-ignore the setting of the PREFIX
property. The executable is built without this prefix, although the PDB files do
contain the prefix.

The Visual Studio 2008 and lower generators do handle the property as expected,
which brings even more chaos.

Steps to Reproduce: 
We use the following code in our CMakeLists.txt:

```
add_executable(${EXECUTABLE} ${SOURCE})

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
set_target_properties(${EXECUTABLE} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_SOURCE_DIR}/bin)

if (MSVC)
	# MSVC generator adds a "Debug" or "Release" postfixes to the
EXECUTABLE_OUTPUT_PATH, we need to cancel them:
	SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES PREFIX "../")
	SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES IMPORT_PREFIX "../")
endif()
```

In the MSVC2008 generator the executable correctly generates in the $/bin/
folder; MSVC2010+ generators generate the executable in $/bin/<configuration>/
folder instead.

Additional Information: 
The full CMakeLists.txt is available at
https://github.com/mc-server/MCServer/blob/d67cd8dafc9d87fc5f26fd40c965e4234ac0f3b1/CMakeLists.txt

The project using this file is at GitHub: https://github.com/mc-server/MCServer

We actually test on MSVC2013, but this part of the projectfile generation seems
to be shared among 2010, 2012 and 2013 in CMake sources.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-01-16 06:39 Mattes D       New Issue                                    
======================================================================



More information about the cmake-developers mailing list