[jira] [Commented] (XERCESC-2236) Dependencies aren't loaded when using provided CMake config package

2022-10-05 Thread Roger Leigh (Jira)


[ 
https://issues.apache.org/jira/browse/XERCESC-2236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17613131#comment-17613131
 ] 

Roger Leigh commented on XERCESC-2236:
--

The change looks fine to me, and I've applied it to master.

> Dependencies aren't loaded when using provided CMake config package
> ---
>
> Key: XERCESC-2236
> URL: https://issues.apache.org/jira/browse/XERCESC-2236
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: Ubuntu 18.04, CMake 3.22.2
>Reporter: Fred Hornsey
>Assignee: Roger Leigh
>Priority: Major
> Fix For: 3.2.4
>
> Attachments: xercesc-2236-fix.patch
>
>
> We have a CMake config package for our libraries that tries to load Xerces 
> support like so:
> {code:java}
> find_package(XercesC PATHS "${OPENDDS_XERCES3}" NO_DEFAULT_PATH)
> if (NOT XercesC_FOUND)
>   find_package(XercesC)
> endif(){code}
> Where {{OPENDDS_XERCES3}} is the path to the Xerces our libraries were built 
> with. This works on Windows and Linux when using system-provided package. 
> When building and installing from source on Linux it seem this doesn't work. 
> In this case it's trying to use the CMake package provided by Xerces instead 
> of the one builtin to CMake.
> I've created an example to demonstrate this. Xerces is built and installed to 
> a location on Linux using CMake. Then we create a {{{}CMakeLists.txt{}}}:
> {code:java}
> cmake_minimum_required(VERSION 3.12.0)
> project(xerces_cmake_config_pkg_test)
> find_package(XercesC PATHS "${THE_XERCES_ROOT}" NO_DEFAULT_PATH)
> add_executable(testexe test.cpp)
> target_link_libraries(testexe XercesC::XercesC)
> {code}
> {{test.cpp}} has to be created, but it doesn't matter what it contains 
> because CMake doesn't get far enough to allow us to attempt to build. When 
> configuring, setting {{THE_XERCES_ROOT}} to the installed Xerces, CMake gives 
> these errors:
> {code:java}
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "ICU::uc" but the target was not found.
>   Perhaps a find_package() call is missing for an IMPORTED target, or an
>   ALIAS target is missing?
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "ICU::data" but the target was not found.
>   Perhaps a find_package() call is missing for an IMPORTED target, or an
>   ALIAS target is missing?
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "Threads::Threads" but the target was not
>   found.  Perhaps a find_package() call is missing for an IMPORTED target, or 
> an ALIAS target is missing? {code}
>  
> This seems to be caused by the packages being specified by Xerces during its 
> configure ([like 
> ICU|https://github.com/apache/xerces-c/blob/045bdf8ac7755e1ce2735d5ef3f6741ec4718df9/src/CMakeLists.txt#L1113])
>  being referenced in the Config package, but not being loaded for the using 
> {{find_package}} or equivalent. [CMake 
> documenation|https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-a-package-configuration-file]
>  suggests that this should be done in somewhere in the [config 
> file|https://github.com/apache/xerces-c/blob/master/src/xercesc/util/XercesVersion.hpp.in].
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Commented] (XERCESC-2236) Dependencies aren't loaded when using provided CMake config package

2022-10-05 Thread Scott Cantor (Jira)


[ 
https://issues.apache.org/jira/browse/XERCESC-2236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17613121#comment-17613121
 ] 

Scott Cantor commented on XERCESC-2236:
---

I don't use CMake so I would not be comfortable applying this, but will leave 
for possible review if it's done in time for a 3.2.4.

> Dependencies aren't loaded when using provided CMake config package
> ---
>
> Key: XERCESC-2236
> URL: https://issues.apache.org/jira/browse/XERCESC-2236
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: Ubuntu 18.04, CMake 3.22.2
>Reporter: Fred Hornsey
>Assignee: Roger Leigh
>Priority: Major
> Fix For: 3.2.4
>
> Attachments: xercesc-2236-fix.patch
>
>
> We have a CMake config package for our libraries that tries to load Xerces 
> support like so:
> {code:java}
> find_package(XercesC PATHS "${OPENDDS_XERCES3}" NO_DEFAULT_PATH)
> if (NOT XercesC_FOUND)
>   find_package(XercesC)
> endif(){code}
> Where {{OPENDDS_XERCES3}} is the path to the Xerces our libraries were built 
> with. This works on Windows and Linux when using system-provided package. 
> When building and installing from source on Linux it seem this doesn't work. 
> In this case it's trying to use the CMake package provided by Xerces instead 
> of the one builtin to CMake.
> I've created an example to demonstrate this. Xerces is built and installed to 
> a location on Linux using CMake. Then we create a {{{}CMakeLists.txt{}}}:
> {code:java}
> cmake_minimum_required(VERSION 3.12.0)
> project(xerces_cmake_config_pkg_test)
> find_package(XercesC PATHS "${THE_XERCES_ROOT}" NO_DEFAULT_PATH)
> add_executable(testexe test.cpp)
> target_link_libraries(testexe XercesC::XercesC)
> {code}
> {{test.cpp}} has to be created, but it doesn't matter what it contains 
> because CMake doesn't get far enough to allow us to attempt to build. When 
> configuring, setting {{THE_XERCES_ROOT}} to the installed Xerces, CMake gives 
> these errors:
> {code:java}
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "ICU::uc" but the target was not found.
>   Perhaps a find_package() call is missing for an IMPORTED target, or an
>   ALIAS target is missing?
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "ICU::data" but the target was not found.
>   Perhaps a find_package() call is missing for an IMPORTED target, or an
>   ALIAS target is missing?
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "Threads::Threads" but the target was not
>   found.  Perhaps a find_package() call is missing for an IMPORTED target, or 
> an ALIAS target is missing? {code}
>  
> This seems to be caused by the packages being specified by Xerces during its 
> configure ([like 
> ICU|https://github.com/apache/xerces-c/blob/045bdf8ac7755e1ce2735d5ef3f6741ec4718df9/src/CMakeLists.txt#L1113])
>  being referenced in the Config package, but not being loaded for the using 
> {{find_package}} or equivalent. [CMake 
> documenation|https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-a-package-configuration-file]
>  suggests that this should be done in somewhere in the [config 
> file|https://github.com/apache/xerces-c/blob/master/src/xercesc/util/XercesVersion.hpp.in].
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Commented] (XERCESC-2236) Dependencies aren't loaded when using provided CMake config package

2022-05-17 Thread Fred Hornsey (Jira)


[ 
https://issues.apache.org/jira/browse/XERCESC-2236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17538502#comment-17538502
 ] 

Fred Hornsey commented on XERCESC-2236:
---

I took that change, added a fix for a test, and created this PR: 
https://github.com/apache/xerces-c/pull/49

> Dependencies aren't loaded when using provided CMake config package
> ---
>
> Key: XERCESC-2236
> URL: https://issues.apache.org/jira/browse/XERCESC-2236
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: Ubuntu 18.04, CMake 3.22.2
>Reporter: Fred Hornsey
>Priority: Major
> Attachments: xercesc-2236-fix.patch
>
>
> We have a CMake config package for our libraries that tries to load Xerces 
> support like so:
> {code:java}
> find_package(XercesC PATHS "${OPENDDS_XERCES3}" NO_DEFAULT_PATH)
> if (NOT XercesC_FOUND)
>   find_package(XercesC)
> endif(){code}
> Where {{OPENDDS_XERCES3}} is the path to the Xerces our libraries were built 
> with. This works on Windows and Linux when using system-provided package. 
> When building and installing from source on Linux it seem this doesn't work. 
> In this case it's trying to use the CMake package provided by Xerces instead 
> of the one builtin to CMake.
> I've created an example to demonstrate this. Xerces is built and installed to 
> a location on Linux using CMake. Then we create a {{{}CMakeLists.txt{}}}:
> {code:java}
> cmake_minimum_required(VERSION 3.12.0)
> project(xerces_cmake_config_pkg_test)
> find_package(XercesC PATHS "${THE_XERCES_ROOT}" NO_DEFAULT_PATH)
> add_executable(testexe test.cpp)
> target_link_libraries(testexe XercesC::XercesC)
> {code}
> {{test.cpp}} has to be created, but it doesn't matter what it contains 
> because CMake doesn't get far enough to allow us to attempt to build. When 
> configuring, setting {{THE_XERCES_ROOT}} to the installed Xerces, CMake gives 
> these errors:
> {code:java}
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "ICU::uc" but the target was not found.
>   Perhaps a find_package() call is missing for an IMPORTED target, or an
>   ALIAS target is missing?
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "ICU::data" but the target was not found.
>   Perhaps a find_package() call is missing for an IMPORTED target, or an
>   ALIAS target is missing?
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "Threads::Threads" but the target was not
>   found.  Perhaps a find_package() call is missing for an IMPORTED target, or 
> an ALIAS target is missing? {code}
>  
> This seems to be caused by the packages being specified by Xerces during its 
> configure ([like 
> ICU|https://github.com/apache/xerces-c/blob/045bdf8ac7755e1ce2735d5ef3f6741ec4718df9/src/CMakeLists.txt#L1113])
>  being referenced in the Config package, but not being loaded for the using 
> {{find_package}} or equivalent. [CMake 
> documenation|https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-a-package-configuration-file]
>  suggests that this should be done in somewhere in the [config 
> file|https://github.com/apache/xerces-c/blob/master/src/xercesc/util/XercesVersion.hpp.in].
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Commented] (XERCESC-2236) Dependencies aren't loaded when using provided CMake config package

2022-05-17 Thread Fred Hornsey (Jira)


[ 
https://issues.apache.org/jira/browse/XERCESC-2236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17538414#comment-17538414
 ] 

Fred Hornsey commented on XERCESC-2236:
---

I've attached a patch that seems to fix the issue, at least for the example I 
gave. It changes the linked dependencies to {{PRIVATE}} so it doesn't matter if 
{{find_package}} is called or not.

> Dependencies aren't loaded when using provided CMake config package
> ---
>
> Key: XERCESC-2236
> URL: https://issues.apache.org/jira/browse/XERCESC-2236
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: Ubuntu 18.04, CMake 3.22.2
>Reporter: Fred Hornsey
>Priority: Major
> Attachments: xercesc-2236-fix.patch
>
>
> We have a CMake config package for our libraries that tries to load Xerces 
> support like so:
> {code:java}
> find_package(XercesC PATHS "${OPENDDS_XERCES3}" NO_DEFAULT_PATH)
> if (NOT XercesC_FOUND)
>   find_package(XercesC)
> endif(){code}
> Where {{OPENDDS_XERCES3}} is the path to the Xerces our libraries were built 
> with. This works on Windows and Linux when using system-provided package. 
> When building and installing from source on Linux it seem this doesn't work. 
> In this case it's trying to use the CMake package provided by Xerces instead 
> of the one builtin to CMake.
> I've created an example to demonstrate this. Xerces is built and installed to 
> a location on Linux using CMake. Then we create a {{{}CMakeLists.txt{}}}:
> {code:java}
> cmake_minimum_required(VERSION 3.12.0)
> project(xerces_cmake_config_pkg_test)
> find_package(XercesC PATHS "${THE_XERCES_ROOT}" NO_DEFAULT_PATH)
> add_executable(testexe test.cpp)
> target_link_libraries(testexe XercesC::XercesC)
> {code}
> {{test.cpp}} has to be created, but it doesn't matter what it contains 
> because CMake doesn't get far enough to allow us to attempt to build. When 
> configuring, setting {{THE_XERCES_ROOT}} to the installed Xerces, CMake gives 
> these errors:
> {code:java}
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "ICU::uc" but the target was not found.
>   Perhaps a find_package() call is missing for an IMPORTED target, or an
>   ALIAS target is missing?
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "ICU::data" but the target was not found.
>   Perhaps a find_package() call is missing for an IMPORTED target, or an
>   ALIAS target is missing?
> CMake Error at CMakeLists.txt:10 (add_executable):
>   Target "testexe" links to target "Threads::Threads" but the target was not
>   found.  Perhaps a find_package() call is missing for an IMPORTED target, or 
> an ALIAS target is missing? {code}
>  
> This seems to be caused by the packages being specified by Xerces during its 
> configure ([like 
> ICU|https://github.com/apache/xerces-c/blob/045bdf8ac7755e1ce2735d5ef3f6741ec4718df9/src/CMakeLists.txt#L1113])
>  being referenced in the Config package, but not being loaded for the using 
> {{find_package}} or equivalent. [CMake 
> documenation|https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-a-package-configuration-file]
>  suggests that this should be done in somewhere in the [config 
> file|https://github.com/apache/xerces-c/blob/master/src/xercesc/util/XercesVersion.hpp.in].
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org