Here is the warning currently being produced:
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.19/Modules/GNUInstallDirs.cmake:223 (message):
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
target architecture is known. Please enable at least one language before
including GNUInstallDirs.
Call Stack (most recent call first):
cmake/guidelineSupportLibrary.cmake:20 (include)
CMakeLists.txt:4 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
I noted how I fixed the error. This is caused by GNUInstallDirs automatically executing code just by including it.
I also added -Werror=dev to the CI to ensure this never happens again.
Co-authored-by: Juan Ramos <juanr0911@gmail.com>
It's much nicer and less error prone to just use add_subdirectory to establish the include directory.
Hide the GNUInstallDirs module by placing it in the helper module. The intent being that the main CMakeLists.txt should have a little code as possible. So that readers can quickly understand the project.
Use include_guard() when available in cmake 3.10+
Co-authored-by: Juan Ramos <juanr0911@gmail.com>
* [cmake] Adding options for INSTALL and TEST (#964)
* [cmake] Adding GSL_INSTALL option
Not all consumers of GSL automatically want to have this install logic.
It's good practice to gate install logic behind an option.
For an example look at magic_enum:
https://github.com/Neargye/magic_enum/blob/master/CMakeLists.txt
If the client wants to install GSL they still can. But they should ask
for it by overriding GSL_INSTALL.
* Update cmake/guidelineSupportLibrary.cmake
added nl@eof
* Update CMakeLists.txt
* Update CMakeLists.txt
Co-authored-by: Juan Ramos <juanr0911@gmail.com>
Co-authored-by: Jordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com>
* missing config line restored by moving GNUInstallDirs back to main file
Co-authored-by: hdf89shfdfs <31327577+hdf89shfdfs@users.noreply.github.com>
Co-authored-by: Juan Ramos <juanr0911@gmail.com>
* [cmake] Adding GSL_INSTALL option
Not all consumers of GSL automatically want to have this install logic.
It's good practice to gate install logic behind an option.
For an example look at magic_enum:
https://github.com/Neargye/magic_enum/blob/master/CMakeLists.txt
If the client wants to install GSL they still can. But they should ask
for it by overriding GSL_INSTALL.
* Update cmake/guidelineSupportLibrary.cmake
added nl@eof
* Update CMakeLists.txt
* Update CMakeLists.txt
Co-authored-by: Juan Ramos <juanr0911@gmail.com>
Co-authored-by: Jordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com>
* Use CMAKE_CXX_STANDARD when available
If the use has provided the variable CMAKE_CXX_STANDARD use that instead of providing a default cache variable.
* Typo