Hi J-S,
I think the easy solution is to set:
CMAKE_ARCHIVE_OUTPUT_DIRECTORY, CMAKE_RUNTIME_OUTPUT_DIRECTORY and
CMAKE_LIBRARY_OUTPUT_DIRECTORY properly. That is all I do on my
personal projects and it it what is done in the OSG toplevel
CMakeLists.txt. However this requires cmake-2.6.0. cmake-2.8.1
expanded this to have a set per configuration, so you would have
CMAKE_<ARCHIVE|RUNTIME|LIBRARY>_OUTPUT_DIRECTORY_<CONF>
My life is easy because I don't have the userbase of a large community
as OpenSceneGraph's, so I can just require cmake > 2.8.0 from myself
and my internal customers :). The osg build system is getting pretty
clogged with fixes and macros to find out cmake version, emulate newer
cmake functions on older versions of cmake and choosing different code
paths given to found version. It is frankly quite hard to follow.
Have a look at osg's CMakeLists.txt at line 635 where the above
mentioned variables are set (for cmake >= 2.6.0). Also - in
CMakeModules/OsgMacroUtils.cmake there's a macro
SET_OUTPUT_DIR_PROPERTY(...) that is used to "fix" the output paths
for plugins primarily (since they go under bin/osgPlugins-xyz).
Here's my macro for setting this up. Works with msvc8, msvc10, rhel5,
ubuntu all with cmake version > 2.8.1:
macro(sbd_setup_output_dirs)
set(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
set(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
if(WIN32)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
endif()
# For each configuration (Debug, Release, MinSizeRel... and/or
anything the user chooses)
foreach(CONF ${CMAKE_CONFIGURATION_TYPES})
# Go uppercase (DEBUG, RELEASE...)
STRING(TOUPPER "${CONF}" CONF)
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
if(WIN32)
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
else()
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
endif()
endforeach()
endmacro()
cheers
Mattias
On Mon, Oct 3, 2011 at 8:48 PM, Jean-Sébastien Guay
<[email protected]> wrote:
> Hi all,
>
> I vaguely remember there being a discussion about this when vc10 came out,
> but I don't remember the conclusion or what fixed it for OSG, so...
>
> I'm trying to compile osgPPU for vc10, and I'm getting this error when
> building the INSTALL target:
>
> 2> -- Installing:
> C:/Dev/OSG_Nodekits/osgPPU/install_vc10sp1_osg283/lib/osgPPUd.lib
> 2> CMake Error at src/osgPPU/cmake_install.cmake:47 (FILE):
> 2> file INSTALL cannot find
> 2>
> "C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283/lib/Debug/../../bin/osgPPUd.dll".
>
> The problem is that osgPPUd.dll is not in
> lib/Debug/../../bin/osgPPUd.dll
> but in
> lib/Debug/../../bin/Debug/osgPPUd.dll
>
> As I said, I'm pretty sure I saw people reporting this for OSG on vc10 when
> it came out, but I wasn't using vc10 back then so I don't remember what the
> solution was... Can anyone refresh my memory please? :-)
>
> Thanks in advance,
>
> J-S
> --
> ______________________________________________________
> Jean-Sébastien Guay [email protected]
> http://www.cm-labs.com/
> http://whitestar02.dyndns-web.com/
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org