[CMake] Set output path without additional Debug/Release at the end

Luigi Calori l.calori at cineca.it
Fri Apr 24 08:37:01 EDT 2009


I use a hack like this:

   SET_TARGET_PROPERTIES(<target>  PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
<your_exe_dir> )
   SET_TARGET_PROPERTIES(<target> PROPERTIES LIBRARY_OUTPUT_DIRECTORY 
<your_lib_dir> )

   IF(MSVC_IDE)
       SET_TARGET_PROPERTIES(<target>  PROPERTIES PREFIX "../")

           or if you prefer

        SET_TARGET_PROPERTIES(<target> PROPERTIES RELEASE_OUTPUT_NAME 
"../${TARGET_NAME}")
        SET_TARGET_PROPERTIES(<target> PROPERTIES DEBUG_OUTPUT_NAME 
"../${TARGET_NAME}D")


   ENDIF(MSVC_IDE)

Not sure if you can use ${CMAKE_CFG_INTDIR} in SET commands though

Hope it helps


Andreas ha scritto:
> Dear CMake users,
>  
> I would like to set the output path of my library to
> C:/name1/Debug/name2/      (debug configuration) and
> C:/name1/Release/name2/      (release configuration).
>  
> If I use
> SET(LIBRARY_OUTPUT_PATH  D:/name1/${CMAKE_CFG_INTDIR}/name2/)
> an additional Debug / Release is added at the end of the path (--> 
> C:/name1/Debug/name2/Debug).
>  
> Is there any way *not to add an additional* Debug / Release at the end?
>  
> Thanks,
> Andreas
> ------------------------------------------------------------------------
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list