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

Update CMakeLists.txt [Optional Installation] #14

Merged
merged 4 commits into from
Oct 12, 2019
Merged

Conversation

kenkit
Copy link
Contributor

@kenkit kenkit commented Sep 10, 2019

Optional Install.
This was was adding header files to my msi package

Optional Install.
This was was adding header files to my msi package
@vasild
Copy link
Owner

vasild commented Sep 25, 2019

Hello,

Isn't not running make install sufficient? Why do you need to disable the install() CMake instructions?

https://cmake.org/cmake/help/latest/command/install.html

Rules specified by calls to this command within a source directory are executed in order during installation

Thanks!

@kenkit
Copy link
Contributor Author

kenkit commented Sep 26, 2019

Sorry I couldn't respond sooner.
The install option is ambiguous in windows platform since it ends up adding the headers to cpack installation.
I found that most people make it optional or disabled on windows platform.
EDIT:I didn't disable it, I just made it optional

@vasild
Copy link
Owner

vasild commented Sep 27, 2019

The install option is ambiguous in windows platform since it ends up adding the headers to cpack installation.

How do you install on Windows? Do you run cmake --install? What is puzzling me is that you disabled all install instructions and that is equivalent to just not running the install step, i.e. not installing, i.e. not running make install, cmake --install or whatever you do on Windows.

EDIT:I didn't disable it, I just made it optional

By default it gets disabled. I would merge this change, even though I do not understand the mechanics of installation on Windows (you help me understand that!). But can you revert the logic so that if you do nothing then, by default, the install works as before. And only if you define a variable (in the environment or on the cmake command line), then the install is skipped.

PS for consistency with the rest of the CMakeLists.txt use lowercase if() and endif().

Thanks!

@kenkit
Copy link
Contributor Author

kenkit commented Sep 27, 2019

No. I use this package as a dependency in one of my projects.
My projects uses add_subdirectory in cmake and also uses the install option to install my projects files.
Since cpp-ipfs also calls install cmake will assume that the files in cpp-ipfs should also be installed.
Atleast two other projects I use have made the install optional e.g

https://github.com/libarchive/libarchive/blob/2f3033ca23f8c21160506c3c7ac8a0df0d3fde42/CMakeLists.txt#L224

I had made the pull request below,we removed the install option completely from windows as a result.

rikyoz/bit7z#27 (comment)

@kenkit
Copy link
Contributor Author

kenkit commented Sep 27, 2019

Ok let me update the CMakeLists.txt

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@kenkit
Copy link
Contributor Author

kenkit commented Oct 1, 2019

Hi the failed test is not as a result of my changes.
All other tests seem to be fine.

@vasild vasild merged commit d2227b0 into vasild:master Oct 12, 2019
@vasild
Copy link
Owner

vasild commented Oct 12, 2019

Merged, thanks!

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

Successfully merging this pull request may close these issues.

2 participants