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

Make lib and cmake target names the same as repository name, do NOT support cmake install multiple configurations simultaneously #812

Merged
merged 6 commits into from
Feb 19, 2021

Conversation

ihsandemir
Copy link
Collaborator

It is a problem for users when out library and github name is different from the cmake find_package name and library names. It becomes too confusing to the users and it is NOT recommended by package managers such as conan and vcpkg. Also, supporting different targets for ssl and static was not a good idea and source of confusion. The user configures it anyway when using cmake or package managers, hence, deleted those options.

Eliminated the generation of different targets for static and ssl and it will be only controlled by cmake options. Only a single type is supported per installation. The library and target names are also changed to the same name as the project hazelcast-cpp-client.

…nt from the cmake find_package name and library names. It becomes too confusing to the users and it is NOT recommended by package managers such as conan and vcpkg. Also, supporting different targets for ssl and static was not a good idea and source of confusion. The user configures it anyway when using cmake or package managers, hence, deleted those options.

Eliminated the generation of different targets for static and ssl and it will be only controlled by cmake options. Only a single type is supported per installation. The library and target names are also changed to the same name as the project `hazelcast-cpp-client`.
@ihsandemir ihsandemir added this to the 4.1 milestone Feb 15, 2021
@ihsandemir ihsandemir self-assigned this Feb 15, 2021
@devOpsHazelcast
Copy link
Contributor

Linux test FAILed.

@devOpsHazelcast
Copy link
Contributor

Windows test FAILed.

sancar
sancar previously approved these changes Feb 16, 2021
…s is the standard recommended option name https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html

Removed all the `BUILD_STATIC_LIB` flags and related documentation.

Updated the scripts to work with the latest changes.

Minor fixes for the copy ellision warning of std::move statements.
@devOpsHazelcast
Copy link
Contributor

Windows test FAILed.

@devOpsHazelcast
Copy link
Contributor

Linux test FAILed.

@devOpsHazelcast
Copy link
Contributor

Windows test FAILed.

@devOpsHazelcast
Copy link
Contributor

Linux test PASSed.

ihsandemir added a commit to ihsandemir/vcpkg that referenced this pull request Feb 17, 2021
CMakeLists.txt Outdated
@@ -103,66 +93,66 @@ if (WITH_OPENSSL)
endif ()


function(add_hazelcast_library name type)
function(add_hazelcast_library type)
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

README.md Outdated
```
Build both the shared and static library without SSL support:
Build both the shared library without SSL support:
Copy link
Contributor

@yemreinci yemreinci Feb 18, 2021

Choose a reason for hiding this comment

The 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 cmake .. (SSL is off by default).
The above example alone is explanatory enough.

You may also consider removing the section header "1.1.5.2.1" completely, and put the above example under "1.1.5.2".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted the line. Removed the section "1.1.5.2.1".

README.md Outdated

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namespace is missing.

Suggested change
target_link_libraries(mytarget PRIVATE hazelcast-cpp-client)
target_link_libraries(mytarget PRIVATE hazelcast-cpp-client::hazelcast-cpp-client)

README.md Outdated Show resolved Hide resolved
README.md Outdated
@@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Build only the static library with SSL support:
Build the static library with SSL support:

scripts/do-all-unix.sh Outdated Show resolved Hide resolved
scripts/do-all-windows.bat Outdated Show resolved Hide resolved
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PROJECT_NAME@ can be used in this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed.

ihsandemir and others added 3 commits February 18, 2021 17:12
…indows test so that gtest.dll can be found during running the test executable.
Co-authored-by: yemreinci <18687880+yemreinci@users.noreply.github.com>
@devOpsHazelcast
Copy link
Contributor

Linux test PASSed.

@devOpsHazelcast
Copy link
Contributor

Windows test PASSed.

@devOpsHazelcast
Copy link
Contributor

Linux test PASSed.

1 similar comment
@devOpsHazelcast
Copy link
Contributor

Linux test PASSed.

@devOpsHazelcast
Copy link
Contributor

Windows test PASSed.

@devOpsHazelcast
Copy link
Contributor

Windows test PASSed.

@ihsandemir ihsandemir merged commit 691238b into hazelcast:master Feb 19, 2021
@ihsandemir ihsandemir deleted the fix_cmake_targets branch February 19, 2021 08:33
ras0219-msft added a commit to microsoft/vcpkg that referenced this pull request Feb 24, 2021
* Added Hazelcast C++ client (https://github.com/hazelcast/hazelcast-cpp-client) port for Hazelcast in-memory database.

* Fixed the patch (The generated cmake files destination is corrected.)

* Updated the patch. see hazelcast/hazelcast-cpp-client#812

* Disable uwp support.

* Added the missing version file for hazelcast-cpp-client.

* [hazelcast-cpp-client] Avoid checking in large patch file

* Format vcpkg.json

* Updated the version for the latest commit using the command `./vcpkg x-add-version --overwrite-version hazelcast-cpp-client`.

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: NancyLi1013 <lirui09@beyondsoft.com>
@ihsandemir ihsandemir modified the milestones: 4.1, 4.0.1 Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants