Skip to content

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

Merged
ihsandemir merged 6 commits intohazelcast:masterfrom
ihsandemir:fix_cmake_targets
Feb 19, 2021
Merged

Make lib and cmake target names the same as repository name, do NOT support cmake install multiple configurations simultaneously#812
ihsandemir merged 6 commits intohazelcast:masterfrom
ihsandemir:fix_cmake_targets

Conversation

@ihsandemir
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Linux test FAILed.

@devOpsHazelcast
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Windows test FAILed.

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Linux test FAILed.

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Windows test FAILed.

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Linux test PASSed.

ihsandemir added a commit to ihsandemir/vcpkg that referenced this pull request Feb 17, 2021
CMakeLists.txt Outdated


function(add_hazelcast_library name type)
function(add_hazelcast_library type)
Copy link
Copy Markdown
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
Copy Markdown
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
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:
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
* `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
Copy Markdown
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:

endif()

include(${CMAKE_CURRENT_LIST_DIR}/@name@-targets.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/hazelcast-cpp-client-targets.cmake)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Linux test PASSed.

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Windows test PASSed.

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Linux test PASSed.

1 similar comment
@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Linux test PASSed.

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Windows test PASSed.

@devOpsHazelcast
Copy link
Copy Markdown
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