On Arch Linux, all of my <package>Config.cmake files, including CopperSpice, are installed into /usr/local/lib/cmake/ and everything works fine.
On Windows all of my <package>Config.cmake files, *except CopperSpice*, are installed into CMAKE_INSTALL_PREFIX/lib/cmake. CopperSpiceConfig.cmake is incorrectly installed into CMAKE_INSTALL_PREFIX/cmake. As a result, find_package (CopperSpice CONFIG COMPONENTS CsCore CsGui CsNetwork) fails.
CopperSpiceConfig.cmake wrong location on Windows
Re: CopperSpiceConfig.cmake wrong location on Windows
Can you let us know if you are using MSVC or MinGW on Windows. Also, which version of CMake are you using. Did you download CMake from Kitware or was this bundled with some other product.
Did you build CS or install our binary files? If you are building CS from source can you let us know what options you are passing.
What is the value for your CMAKE_PREFIX_PATH in the application which is trying to find the CopperSpice package?
Barbara
Did you build CS or install our binary files? If you are building CS from source can you let us know what options you are passing.
What is the value for your CMAKE_PREFIX_PATH in the application which is trying to find the CopperSpice package?
Barbara
Re: CopperSpiceConfig.cmake wrong location on Windows
HI Barbara, thanks for getting back to me! I just created a pull request on github for this issue and another small issue where the latest MSVC 19 flags a compiler error in qsslcertificate.h for a redundant declaration.
For the record, I am also building boost, nlohmann_json, openssl and Wt (emweb) and they all put their .cmake files in CMAKE_PREFIX_PATH/lib.
CMake was downloaded from Kitware, v 3.30.5. My local CMAKE_PREFIX_PATH is "d:\code\third_party\usr\local".
WIth the fixes in my pull request it seems to build and work properly.
For the record, I am also building boost, nlohmann_json, openssl and Wt (emweb) and they all put their .cmake files in CMAKE_PREFIX_PATH/lib.
CMake was downloaded from Kitware, v 3.30.5. My local CMAKE_PREFIX_PATH is "d:\code\third_party\usr\local".
WIth the fixes in my pull request it seems to build and work properly.
Re: CopperSpiceConfig.cmake wrong location on Windows
For reference, CopperSpice downstream projects on Windows using both MSVC and MinGW have been fully tested in our CI. Applications like KitchenSink, Diamond, and DoxyPress are all working with the current path structure.My local CMAKE_PREFIX_PATH is "d:\code\third_party\usr\local".
Your value is not consistent with our documentation for the CMake prefix path on Windows. Please have a look at the CS Overview documentation as follows:
https://www.copperspice.com/docs/cs_overview/demo-ks.html
We also have over 45 working examples in our CS Journal.
https://journal.copperspice.com/?page_id=932
Re: CopperSpiceConfig.cmake wrong location on Windows
When I build CopperSpice I specify CMAKE_INSTALL_PATH=d:\code\third_party\usr\local.
This means that when I build software that depends on CopperSpice I provide CMAKE_PREFIX_PATH=d:\code\third_party\usr\local.
CMake seems to search for .cmake "Config" files in CMAKE_PREFIX_PATH\lib. So all of my dependent CMake Config files (.cmake files) are correctly found except CopperSpice, which has installed its Config files in CMAKE_INSTALL_PATH, not CMAKE_INSTALL_PATH\lib as I think it should.
So my CMAKE_INSTALL_PATH & CMAKE_PREFIX_PATH do not have to be the same as yours. At that link you provided I find the following directory structures:
Unix Systems ~/cs_lib/lib/cmake/CopperSpice
Windows (MinGW) /c/cs_lib/cmake/CopperSpice
Windows (MSVC) c:\\cs_lib\\cmake\\CopperSpice
In my experience other software projects do not use this structure - they use the "Unix Systems" structure of <path>/lib/cmake when installing on Windows.
This means that when I build software that depends on CopperSpice I provide CMAKE_PREFIX_PATH=d:\code\third_party\usr\local.
CMake seems to search for .cmake "Config" files in CMAKE_PREFIX_PATH\lib. So all of my dependent CMake Config files (.cmake files) are correctly found except CopperSpice, which has installed its Config files in CMAKE_INSTALL_PATH, not CMAKE_INSTALL_PATH\lib as I think it should.
So my CMAKE_INSTALL_PATH & CMAKE_PREFIX_PATH do not have to be the same as yours. At that link you provided I find the following directory structures:
Unix Systems ~/cs_lib/lib/cmake/CopperSpice
Windows (MinGW) /c/cs_lib/cmake/CopperSpice
Windows (MSVC) c:\\cs_lib\\cmake\\CopperSpice
In my experience other software projects do not use this structure - they use the "Unix Systems" structure of <path>/lib/cmake when installing on Windows.
Re: CopperSpiceConfig.cmake wrong location on Windows
There is no standard structure for Windows and projects are free to set their own requirements. Windows developers generally expect a more flat directory structure than Unix developers. We have documented our file layout in the CS Overview documentation and our CS Journal. Just for reference, these are not simple choices to make for cross platform projects.
If you wish to use our set up then the CMAKE_PREFIX_PATH for MSVC is the following. The value for cs_lib is the location where you installed CopperSpice.
c:\\cs_lib\\cmake\\CopperSpice
Since CS is an open source project you are free to modify this for your own use. We can not modify this path in the CopperSpice project since we have an existing user base who are accustomed to the current setup.
Barbara
If you wish to use our set up then the CMAKE_PREFIX_PATH for MSVC is the following. The value for cs_lib is the location where you installed CopperSpice.
c:\\cs_lib\\cmake\\CopperSpice
Since CS is an open source project you are free to modify this for your own use. We can not modify this path in the CopperSpice project since we have an existing user base who are accustomed to the current setup.
Barbara