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

[C++] Fix Version.h not found when CMake binary directory is customized #13324

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Dec 15, 2021

Motivation

When I build C++ tests on my local env, the following error happened.

tests/VersionTest.cc:19:10: fatal error: 'pulsar/Version.h' file not found
#include <pulsar/Version.h>

It's because I specified another directory as CMake directory.

mkdir _builds && cd _builds && cmake ..

After #12769, the Version.h is generated under ${CMAKE_BINARY_DIR}/include/pulsar directory but it's not included in CMakeLists.txt. CI works well because it's built in the default CMake directory so that CMAKE_BINARY_DIR is the same with CMAKE_SOURCE_DIR, which is included.

Modifications

Add the ${CMAKE_BINARY_DIR}/include to included_directories.

@BewareMyPower BewareMyPower merged commit ca37e67 into apache:master Dec 15, 2021
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-cmake-version-file branch December 15, 2021 09:11
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
…ache#13324)

### Motivation

When I build C++ tests on my local env, the following error happened.

```
tests/VersionTest.cc:19:10: fatal error: 'pulsar/Version.h' file not found
#include <pulsar/Version.h>
```

It's because I specified another directory as CMake directory.

```bash
mkdir _builds && cd _builds && cmake ..
```

After apache#12769, the `Version.h` is generated under `${CMAKE_BINARY_DIR}/include/pulsar` directory but it's not included in `CMakeLists.txt`. CI works well because it's built in the default CMake directory so that `CMAKE_BINARY_DIR` is the same with `CMAKE_SOURCE_DIR`, which is included.

### Modifications

Add the `${CMAKE_BINARY_DIR}/include` to `included_directories`.
codelipenghui pushed a commit that referenced this pull request Dec 21, 2021
…3324)

### Motivation

When I build C++ tests on my local env, the following error happened.

```
tests/VersionTest.cc:19:10: fatal error: 'pulsar/Version.h' file not found
#include <pulsar/Version.h>
```

It's because I specified another directory as CMake directory.

```bash
mkdir _builds && cd _builds && cmake ..
```

After #12769, the `Version.h` is generated under `${CMAKE_BINARY_DIR}/include/pulsar` directory but it's not included in `CMakeLists.txt`. CI works well because it's built in the default CMake directory so that `CMAKE_BINARY_DIR` is the same with `CMAKE_SOURCE_DIR`, which is included.

### Modifications

Add the `${CMAKE_BINARY_DIR}/include` to `included_directories`.

(cherry picked from commit ca37e67)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Dec 21, 2021
zymap pushed a commit that referenced this pull request Dec 23, 2021
…3324)

### Motivation

When I build C++ tests on my local env, the following error happened.

```
tests/VersionTest.cc:19:10: fatal error: 'pulsar/Version.h' file not found
#include <pulsar/Version.h>
```

It's because I specified another directory as CMake directory.

```bash
mkdir _builds && cd _builds && cmake ..
```

After #12769, the `Version.h` is generated under `${CMAKE_BINARY_DIR}/include/pulsar` directory but it's not included in `CMakeLists.txt`. CI works well because it's built in the default CMake directory so that `CMAKE_BINARY_DIR` is the same with `CMAKE_SOURCE_DIR`, which is included.

### Modifications

Add the `${CMAKE_BINARY_DIR}/include` to `included_directories`.

(cherry picked from commit ca37e67)
@zymap zymap added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.3 release/2.9.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants