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

Allow CMake to search shared libraries with find_package #274

Closed
sayerhs opened this issue Dec 12, 2017 · 5 comments
Closed

Allow CMake to search shared libraries with find_package #274

sayerhs opened this issue Dec 12, 2017 · 5 comments

Comments

@sayerhs
Copy link
Contributor

sayerhs commented Dec 12, 2017

Currently, Nalu's top-level CMakeLists.txt sets

SET(CMAKE_FIND_LIBRARY_PREFIXES lib)
SET(CMAKE_FIND_LIBRARY_SUFFIXES a)

which forces CMake to only look for static libraries with find_package directives. Is there a use case where this is explicitly needed and why CMake's platform specific defaults are not appropriate? If this is explicitly needed can we change the second line to

SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .so .dylib)

so that it can accept shared libraries if static libraries are unavailable on the user's system?

Cc: @spdomin @jrood-nrel

@jrood-nrel
Copy link
Contributor

jrood-nrel commented Dec 12, 2017

I would prefer to go further and remove those two lines and let CMake find any type according to the machine type it's on. Then I would change:

find_library(YAML_LIBRARY NAMES libyaml-cpp.a PATHS ${YAML_DIR}/lib )

to

find_library(YAML_LIBRARY NAMES yaml-cpp PATHS ${YAML_DIR}/lib)

@jrood-nrel
Copy link
Contributor

I'm happy to address this stuff since this is one of the things I addressed when I was working to reorganize CMakelists a while ago but had to revert because I messed up the location of PROJECT(Nalu) which caused problems.

@sayerhs
Copy link
Contributor Author

sayerhs commented Dec 13, 2017

@jrood-nrel Yes, the preference would be to not explicitly list suffixes in the Nalu CMakeLists.txt file.

Would also be good to move YAML-cpp stuff into a cmake/FindYAML.cmake along with package helpers.

@spdomin
Copy link
Contributor

spdomin commented Dec 18, 2017

Dealing with finding yaml would be a good change:)

@jrood-nrel
Copy link
Contributor

This is resolved by #299 .

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

No branches or pull requests

3 participants