On Tue, Apr 15, 2008 at 12:14 PM, Philip Lowman <[EMAIL PROTECTED]> wrote:

> On Tue, Apr 15, 2008 at 11:47 AM, Jean-Sébastien Guay <
> [EMAIL PROTECTED]> wrote:
>
>> Just to make it clear, I agree, I was getting ahead of myself by getting
>> the CVS snapshot and assuming that CMake 2.6 was current. So we can
>> probably ignore what I said about the change in library directory
>> semantics in CMake for now, and only address it when CMake versions >=
>> 2.6 are officially released.
>
>
> The change in library directory semantics is fairly low-key.  You can see
> an example of the differences below.  The big difference is that DLLs will
> be placed in CMAKE_RUNTIME_OUTPUT_DIRECTORY.  I'm not sure how this affects
> the PREFIX target property that CMake uses now for DLL placement.  Someone
> would need to test this.
>
> I do know EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH are completely
> backwards compatible, merely deprecated in CMake 2.6.
>
> IF(CMAKE_MAJOR_VERSION EQUAL 2 AND
>    CMAKE_MINOR_VERSION GREATER 4)
>     SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
>         CACHE STRING "Where libraries go" FORCE)
>     SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
>         CACHE STRING "Where archives go" FORCE)
>     SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
>         CACHE STRING "Where binaries and .dll files go" FORCE)
> ELSE()
>     SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin
>         CACHE STRING "Where binaries go" FORCE)
>     SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib
>         CACHE STRING "Where libraries go" FORCE)
> ENDIF()
>


FYI: the above code is not right.  I misunderstood the way CMake 2.6.0 works
with respect to plugins (aka MODULE libraries).  The proper way to ensure
that plugins get dumped into a "lib" folder for Linux and the DLLs get
dumped into a "bin" folder for Windows (within the build tree) is to
manipulate CMAKE_LIBRARY_OUTPUT_DIRECTORY as follows:

    IF(WIN32)
       SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
            CACHE STRING "Where libraries go" FORCE)
    ELSE(WIN32)
       SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
            CACHE STRING "Where libraries go" FORCE)
    ENDIF(WIN32)
    SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
        CACHE STRING "Where archives go" FORCE)
    SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
        CACHE STRING "Where binaries and .dll files go" FORCE)

-- 
Philip Lowman
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to