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

Support for projects requiring out of source cmake builds #84

Open
Smarre opened this issue Oct 16, 2017 · 5 comments
Open

Support for projects requiring out of source cmake builds #84

Smarre opened this issue Oct 16, 2017 · 5 comments

Comments

@Smarre
Copy link

Smarre commented Oct 16, 2017

Some projects (in my case OSRM) has prevented in-source builds. Some projects do it in order to avoid conflicts with files and otherwise keep the build data separate from source files.

It seems that mini_portile does in-source builds only. Would it be possible to at least allow configuration of the build dir?

@flavorjones
Copy link
Owner

Hi @Smarre, thanks for asking this question.

I'd like to better understand what you're asking for. Can you give me an example of a mini_portile recipe that demonstrates the problem you're describing?

@Smarre
Copy link
Author

Smarre commented Nov 28, 2017

Hi,

cmake has builtin support for configuring the build directory. For example considering the shorthands ”cmake .” and ”cmake ..”, former would configure the build using data from current directory and latter would be configuring with CMakeLists.txt from parent directory.

This allows a common workflow used in CMake projects:

mkdir build
cd build
cmake ..
make

This way the build files do not pollute the project directory, and also possible namespace collisions shouldn’t happen, as they may happen if built in the project tree. It also allows easy cleanup of build data: rm -r build

Due to these reasons, some projects forbids building in-source. I’ve also seen a project that only allows in-source builds for some strange reason, which is why the build type needs to be configurable in some way.

Specifically, this line

execute('configure', %w(cmake) + computed_options + ["."])
is saying to build the cmake project in-source, with ”cmake .”.

@flavorjones
Copy link
Owner

Hi @Smarre,

I'm familiar with cmake allowing builds in a separate directory. I'm asking these questions to better understand your particular issue, though. Can you help me understand by providing a mini_portile recipe that demonstrates the issue you're trying to solve?

@Smarre
Copy link
Author

Smarre commented Feb 5, 2018

Well, the whole thing is visible here: https://github.com/Smarre/ruby-libosrm/blob/master/ext/libosrm/extconf.rb

@flavorjones
Copy link
Owner

@Smarre It looks like MiniPortile has been patched in that project. I haven't looked at the details, but I was wondering if you wanted to open a PR for the fix?

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

2 participants