Skip to content

Conversation

@BewareMyPower
Copy link
Contributor

Motivation

Currently, the pulsarStaticWithDeps target (libpulsarwithdeps.a) is generated under the ./lib directory relative to the project root path. However, if the cmake build directory is customized, e.g. cmake -B build, the libpulsarwithdeps.a is still generated under lib/, not build/lib.

In addition, the install target doesn't install the libpulsarwithdeps.a except for MSVC build.

Modification

Modify the lib/CMakeLists.txt to:

  • generate libpulsarwithdeps.a under the CMake build directory
  • add libpulsarwithdeps.a to the install target

Verification

Run the following commands:

cmake -DLINK_STATIC=ON -DCMAKE_INSTALL_PREFIX=/tmp/pulsar-cpp -B build cmake --build build --target install

We can see the following files generated and installed:

$ ls -1 build/lib/libpulsar* build/lib/libpulsar.a build/lib/libpulsar.dylib build/lib/libpulsarnossl.dylib build/lib/libpulsarwithdeps.a $ ls -1 /tmp/pulsar-cpp/lib libpulsar.a libpulsar.dylib libpulsarnossl.dylib libpulsarwithdeps.a

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

### Motivation Currently, the `pulsarStaticWithDeps` target (`libpulsarwithdeps.a`) is generated under the `./lib` directory relative to the project root path. However, if the cmake build directory is customized, e.g. `cmake -B build`, the `libpulsarwithdeps.a` is still generated under `lib/`, not `build/lib`. In addition, the install target doesn't install the `libpulsarwithdeps.a` except for MSVC build. ### Modification Modify the `lib/CMakeLists.txt` to: - generate `libpulsarwithdeps.a` under the CMake build directory - add `libpulsarwithdeps.a` to the install target ### Verification Run the following commands: ```bash cmake -DLINK_STATIC=ON -DCMAKE_INSTALL_PREFIX=/tmp/pulsar-cpp -B build cmake --build build --target install ``` We can see the following files generated and installed: ```bash $ ls -1 build/lib/libpulsar* build/lib/libpulsar.a build/lib/libpulsar.dylib build/lib/libpulsarnossl.dylib build/lib/libpulsarwithdeps.a $ ls -1 /tmp/pulsar-cpp/lib libpulsar.a libpulsar.dylib libpulsarnossl.dylib libpulsarwithdeps.a ```
@Demogorgon314 Demogorgon314 merged commit 5fc6979 into apache:main Oct 8, 2022
@BewareMyPower BewareMyPower deleted the bewaremypower/install-pulsar-with-deps branch October 10, 2022 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants