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

How to specify location of nana library when building demos? #8

Open
steveking-gh opened this issue Feb 25, 2016 · 5 comments
Open

Comments

@steveking-gh
Copy link

Hi, using CMake and gcc 5.3 on Fedora 23 64-bit - In the CMakeLists.txt file for the demos, I did not see a way to specify the location of the nana build directory in order to find the libarry file. The linker fails with missing -lnana. How should I specify the location of the nana build?

@qPCR4vir
Copy link
Owner

Well, from:
install in cmake
Install
Specify rules to run at install time.

This command generates installation rules for a project. Rules specified by calls to this command within a source directory are executed in order during installation. The order across directories is not defined.

There are multiple signatures for this command. Some of them define installation options for files and targets. Options common to multiple signatures are covered here but they are valid only for signatures that specify them. The common options are:

DESTINATION
Specify the directory on disk to which a file will be installed. If a full path (with a leading slash or drive letter) is given it is used directly. If a relative path is given it is interpreted relative to the value of the CMAKE_INSTALL_PREFIX variable. The prefix can be relocated at install time using the DESTDIR mechanism explained in the CMAKE_INSTALL_PREFIX variable documentation.

Static libraries are always treated as ARCHIVE targets.

I think in my case all of this is managed by CLion or by travis some how. But it works.

@qPCR4vir
Copy link
Owner

In fact what we need is to actualize the CMakeFile in the nana-demo repo. I don't whant to introduce too much spurious commits into the nana repo that actually belong to the nana-demo repo. But I know very little about cmake, sorry. I'm learning now.

@steveking-gh
Copy link
Author

The long term solution is to write a CMake find_package() module for nana, then use that find_package in the CMakeLists.txt of the demos repo. There are examples of doing this in the CMake documentation. In my case, I'd need to keep the nana library installation path in a project directory, not in /usr/lib. I used CMAKE_INSTALL_PREFIX, but demos of course does not find my weird location. So, some -DNANA_INSTALL_DIR override would help.
Thanks for the excellent support by the way. I'm encouraged about using nana.

@steveking-gh
Copy link
Author

Directory assumptions like this (from demos CMakeLists.txt) are trouble:
include_directories(${CMAKE_SOURCE_DIR}/../nana/include)
link_directories(${CMAKE_SOURCE_DIR}/../nana/ShadowBuild)

@liubenyuan
Copy link

@steve6390 I think this assumption is ok for this demo and learning nana.

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

No branches or pull requests

3 participants