Fixing cmake developer warning (#274)
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): 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>
This commit is contained in:
parent
c55726ee29
commit
dc9a7728c0
@ -61,7 +61,7 @@ matrix:
|
|||||||
- g++-5
|
- g++-5
|
||||||
sources: *sources
|
sources: *sources
|
||||||
script: >
|
script: >
|
||||||
cmake -DCXXOPTS_BUILD_TESTS=ON -DCMAKE_CXX_COMPILER=$COMPILER
|
cmake -Werror=dev -DCXXOPTS_BUILD_TESTS=ON -DCMAKE_CXX_COMPILER=$COMPILER
|
||||||
-DCMAKE_CXX_FLAGS=$CXXFLAGS $UNICODE_OPTIONS $CMAKE_OPTIONS .
|
-DCMAKE_CXX_FLAGS=$CXXFLAGS $UNICODE_OPTIONS $CMAKE_OPTIONS .
|
||||||
&& make && make ARGS=--output-on-failure test
|
&& make && make ARGS=--output-on-failure test
|
||||||
|
|
||||||
|
@ -30,6 +30,9 @@ project(cxxopts
|
|||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Must include after the project call due to GNUInstallDirs requiring a language be enabled (IE. CXX)
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
# Determine whether this is a standalone project or included by other projects
|
# Determine whether this is a standalone project or included by other projects
|
||||||
set(CXXOPTS_STANDALONE_PROJECT OFF)
|
set(CXXOPTS_STANDALONE_PROJECT OFF)
|
||||||
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||||
|
@ -22,7 +22,6 @@ if (CMAKE_VERSION VERSION_GREATER 3.10 OR CMAKE_VERSION VERSION_EQUAL 3.10)
|
|||||||
include_guard()
|
include_guard()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
function(cxxopts_getversion version_arg)
|
function(cxxopts_getversion version_arg)
|
||||||
|
Loading…
Reference in New Issue
Block a user