Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the way FindBump.cmake returns libraries #19

Open
jholub15 opened this issue Oct 15, 2013 · 1 comment
Open

Changing the way FindBump.cmake returns libraries #19

jholub15 opened this issue Oct 15, 2013 · 1 comment
Labels

Comments

@jholub15
Copy link
Contributor

Right now, FindBump.cmake returns a couple of variables to be used by other people (BUMP_DIR, BUMP_LIBRARIES, BUMP_INCLUDE_DIR). What these actually return is different from what seems to be traditionally returned by the find scripts in cmake. For example, BUMP_LIBRARIES returns the path to the libraries, but not a list of libraries that can directly be added in someone's project to the linker. Boost on the other hand returns a list of the libs that can directly be added to the linker without any additional steps.

Should the FindBump.cmake script be changed to follow the bump convention or is there a reason it works the way it does?

@cnoon
Copy link
Contributor

cnoon commented Oct 15, 2013

Here's what I'm doing in VIPRE and it works fine for me for any kind of build...

# Only compile if we found all the necessary libraries
if (Boost_FOUND AND BUMP_FOUND AND OSG_FOUND)

    # Add the library headers
    INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR} ${BUMP_INCLUDE_DIR} ${OSG_INCLUDE_DIR})

    # Add the libraries
    SET (TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ${Boost_LIBRARIES} ${BUMP_LIBRARIES} ${OSG_LIBRARIES})

    # Add the OpenGL library
    SET (TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ${OPENGL_gl_LIBRARY})

    # Add each of the libraries to the build
    FOREACH (VIPRE_LIB
            vipre
            vipreDICOM
            vipreOTS
            vipreViewer
        )

        MESSAGE("Configuring Library: " ${VIPRE_LIB})
        ADD_SUBDIRECTORY (${VIPRE_LIB})

    ENDFOREACH ()

    # Add the plugins and wrappers
    ADD_SUBDIRECTORY (vipreWrappers)

ENDIF ()

You can find that file at $VIPRE_HOME/src/CMakeLists.txt path. Take a look at how this works and see if you can figure out what you've got wrong. The Bump system works the same way as OSG if I remember right and it does work like the other libraries. The BUMP_LIBRARIES variable should return the full path to the bump lib file. It would return a list, but there's only a single lib in Bump, hence the one path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants