-
Notifications
You must be signed in to change notification settings - Fork 54
Make lib and cmake target names the same as repository name, do NOT support cmake install multiple configurations simultaneously #812
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
Changes from 3 commits
f793ec8
72394ca
3bf5ae9
2ca67da
a84a983
67970a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -252,18 +252,17 @@ You can provide additional configuration options using the `-DVARIABLE=VALUE` sy | |||||
| Here are all the options that are supported: | ||||||
| * `WITH_OPENSSL` : Set to `ON` to build the library with SSL support. | ||||||
| This will require [OpenSSL](https://www.openssl.org) to be installed on your system. The default is `OFF`. | ||||||
| * `BUILD_STATIC_LIB` : Set to `ON` or `OFF` depending on whether you want the static library. The default is `OFF`. | ||||||
| * `BUILD_SHARED_LIB` : Set to `ON` or `OFF` depending on whether you want the shared library. The default is `ON`. | ||||||
| * `BUILD_SHARED_LIBS` : Set to `ON` or `OFF` depending on whether you want the shared(ON) or static(OFF) library. The default is `ON`. | ||||||
| * `DISABLE_LOGGING` : Setting this option to `ON` disables logging. The default is `OFF`. | ||||||
|
|
||||||
| ##### 1.1.5.2.1 Example Configuration Commands | ||||||
| Build only the static library with SSL support: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since building both is not supported anymore, we may drop "only".
Suggested change
|
||||||
| ```sh | ||||||
| cmake .. -DWITH_OPENSSL=ON -DBUILD_SHARED_LIB=OFF -DBUILD_STATIC_LIB=ON | ||||||
| cmake .. -DWITH_OPENSSL=ON -DBUILD_SHARED_LIBS=OFF | ||||||
| ``` | ||||||
| Build both the shared and static library without SSL support: | ||||||
| Build both the shared library without SSL support: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can delete this example, because it does the same with the default You may also consider removing the section header "1.1.5.2.1" completely, and put the above example under "1.1.5.2".
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deleted the line. Removed the section "1.1.5.2.1". |
||||||
| ```sh | ||||||
| cmake .. -DWITH_OPENSSL=OFF -DBUILD_SHARED_LIB=ON -DBUILD_STATIC_LIB=ON | ||||||
| cmake .. -DWITH_OPENSSL=OFF | ||||||
| ``` | ||||||
|
|
||||||
| ## 1.2. Starting Hazelcast IMDG Cluster | ||||||
|
|
@@ -354,22 +353,17 @@ If you are not, then read the instructions specific to your platform: | |||||
| A Hazelcast IMDG C++ client installation comes with package configuration files for CMake. | ||||||
| If your project is using CMake, you can easily find and link against the client library: | ||||||
| ```cmake | ||||||
| find_package(hazelcastcxx) | ||||||
| find_package(hazelcast-cpp-client CONFIG REQUIRED) | ||||||
|
|
||||||
| target_link_libraries(mytarget PUBLIC hazelcast::hazelcastcxx) | ||||||
| ``` | ||||||
|
|
||||||
| The package name depends on the specific library type you want to use. | ||||||
| Options are `hazelcastcxx`, `hazelcastcxx_ssl`, `hazelcastcxx_static`, and `hazelcastcxx_ssl_static`. | ||||||
| target_link_libraries(mytarget PRIVATE hazelcast-cpp-client) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. namespace is missing.
Suggested change
|
||||||
| ``` | ||||||
|
|
||||||
| Make sure you add the installation prefix of the client library to `CMAKE_PREFIX_PATH` | ||||||
| if you are using a custom installation location. | ||||||
|
|
||||||
| #### 1.3.2. Linux and MacOS Users | ||||||
| You can pass the `-lhazelcastcxx` or `-lhazelcastcxx_ssl` option to the compiler to link against | ||||||
| You can pass the `-lhazelcast-cpp-client` option to the compiler to link against | ||||||
| the client library. The name of library depends on how it was configured during build time. | ||||||
|
ihsandemir marked this conversation as resolved.
Outdated
|
||||||
| If the library was built with `-DWITH_OPENSSL=ON`, then the name is `hazelcastcxx_ssl`. | ||||||
| If it was built with `-DWITH_OPENSSL=OFF`, then the name is `hazelcastcxx`. | ||||||
|
|
||||||
| The client library depends on Boost.Thread and Boost.Chrono. | ||||||
| You should also link your program against these libraries using `-lboost_thread` and `-lboost_chrono`. | ||||||
|
|
@@ -381,7 +375,7 @@ Here is how you can compile an example from the examples directory: | |||||
| g++ -std=c++11 \ | ||||||
| examples/path/to/example.cpp \ | ||||||
| -DBOOST_THREAD_VERSION=5 \ | ||||||
| -lhazelcastcxx -lboost_thread -lboost_chrono | ||||||
| -lhazelcast-cpp-client -lboost_thread -lboost_chrono | ||||||
| ``` | ||||||
|
|
||||||
| If a custom installation directory was used during installation, then you may also need to use the `-L` and `-I` | ||||||
|
|
@@ -390,7 +384,7 @@ options to add the library and include paths to the compiler's search path. | |||||
| g++ -std=c++11 \ | ||||||
| examples/path/to/example.cpp \ | ||||||
| -I /path/to/install/include -L /path/to/install/lib \ | ||||||
| -lhazelcastcxx -lboost_thread -lboost_chrono | ||||||
| -lhazelcast-cpp-client -lboost_thread -lboost_chrono | ||||||
| ``` | ||||||
|
|
||||||
| #### 1.3.3. Windows Users | ||||||
|
|
@@ -402,7 +396,7 @@ for necessary features such as futures and future continuations to be enabled. | |||||
| The following is a command that can be used to compile an example from the examples directory. | ||||||
| ```bat | ||||||
| cl.exe path\to\example.cpp ^ | ||||||
| C:\path\to\hazelcast\lib\hazelcastcxx.lib ^ | ||||||
| C:\path\to\hazelcast\lib\hazelcast-cpp-client.lib ^ | ||||||
| C:\path\to\boost\lib\boost_thread.lib C:\path\to\boost\lib\boost_chrono.lib ^ | ||||||
| /EHsc /DBOOST_THREAD_VERSION=5 ^ | ||||||
| /I C:\path\to\hazelcast\include /I C:\path\to\boost\include | ||||||
|
|
@@ -596,7 +590,7 @@ Let's manipulate a distributed map on a cluster using the client. | |||||
| Save the following file as `IT.cpp` and compile it using a command similar to the following (Linux g++ compilation is used for demonstration): | ||||||
|
|
||||||
| ```C++ | ||||||
| g++ IT.cpp -o IT -lhazelcastcxx -lboost_thread -lboost_chrono -DBOOST_THREAD_VERSION=5 | ||||||
| g++ IT.cpp -o IT -lhazelcast-cpp-client -lboost_thread -lboost_chrono -DBOOST_THREAD_VERSION=5 | ||||||
| ``` | ||||||
| Then, you can run the application using the following command: | ||||||
|
|
||||||
|
|
@@ -651,7 +645,7 @@ Now create a `Sales.cpp` file, compile and run it as shown below. | |||||
| **Compile:** | ||||||
|
|
||||||
| ```C++ | ||||||
| g++ Sales.cpp -o Sales -lhazelcastcxx -lboost_thread -lboost_chrono -DBOOST_THREAD_VERSION=5 | ||||||
| g++ Sales.cpp -o Sales -lhazelcast-cpp-client -lboost_thread -lboost_chrono -DBOOST_THREAD_VERSION=5 | ||||||
| ``` | ||||||
| **Run** | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,10 +8,10 @@ if (@WITH_OPENSSL@) | |
| find_dependency(OpenSSL) | ||
| endif() | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/@name@-targets.cmake) | ||
| include(${CMAKE_CURRENT_LIST_DIR}/hazelcast-cpp-client-targets.cmake) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed. |
||
|
|
||
| set_and_check(@name@_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@) | ||
| set_and_check(@name@_LIBRARY_DIRS @PACKAGE_LIBRARY_INSTALL_DIR@) | ||
| set(@name@_LIBRARIES hazelcast::@name@) | ||
| set_and_check(hazelcast-cpp-client_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@) | ||
| set_and_check(hazelcast-cpp-client_LIBRARY_DIRS @PACKAGE_LIBRARY_INSTALL_DIR@) | ||
| set(hazelcast-cpp-client_LIBRARIES hazelcast-cpp-client::hazelcast-cpp-client) | ||
|
|
||
| check_required_components(@name@) | ||
| check_required_components(hazelcast-cpp-client) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess now that we work with a single type of library during the build, we can remove this function and put its contents in the global scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.