friendlyanon / cmake-init

The missing CMake project initializer
GNU General Public License v3.0
2.03k stars 77 forks source link

Not Compatible with Conan 1.51.x #67

Closed xrloong closed 2 years ago

xrloong commented 2 years ago

Environment: Platform: Mac mini (M1, 2020) OS: macOS 12.4 CMake version: 3.24.0 cmake-init version: 0.31.2 conan version: 1.51.2

If I use Conan 1.50.2, it works.

error message for cmake-init with Conan 1.51.2: $ cmake --preset=dev

-- Using Conan toolchain: /Users/xanaduw/tmp/greatness/conan/conan_toolchain.cmake -- Conan: Component target declared 'fmt::fmt' CMake Error (dev) at conan/fmt-Target-debug.cmake:5 (set): uninitialized variable 'fmt_COMPILE_OPTIONS_CXX_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:5 (set):
uninitialized variable 'fmt_COMPILE_OPTIONS_C_DEBUG'
Call Stack (most recent call first):
conan/fmtTargets.cmake:26 (include)
conan/fmt-config.cmake:10 (include)
CMakeLists.txt:31 (find_package)
This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:9 (set):
uninitialized variable 'fmt_SHARED_LINK_FLAGS_DEBUG'
Call Stack (most recent call first):
conan/fmtTargets.cmake:26 (include)
conan/fmt-config.cmake:10 (include)
CMakeLists.txt:31 (find_package)
This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:9 (set):
uninitialized variable 'fmt_SHARED_LINK_FLAGS_DEBUG'
Call Stack (most recent call first):
conan/fmtTargets.cmake:26 (include)
conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:9 (set): uninitialized variable 'fmt_EXE_LINK_FLAGS_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:15 (conan_find_apple_frameworks): uninitialized variable 'fmt_FRAMEWORKS_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:15 (conan_find_apple_frameworks): [155/1907] uninitialized variable 'fmt_FRAMEWORK_DIRS_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:25 (set_property): uninitialized variable 'fmt_SYSTEM_LIBS_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:34 (conan_package_library_targets): uninitialized variable 'fmt_LIBS_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:34 (conan_package_library_targets): uninitialized variable 'fmt_LIB_DIRS_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:42 (set): uninitialized variable 'fmt_BUILD_DIRS_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-Target-debug.cmake:43 (set): uninitialized variable 'fmt_BUILD_DIRS_DEBUG' Call Stack (most recent call first): conan/fmtTargets.cmake:26 (include) conan/fmt-config.cmake:10 (include) CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-config.cmake:23 (set): [107/1907] uninitialized variable 'fmt_INCLUDE_DIRS_DEBUG' Call Stack (most recent call first): CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-config.cmake:24 (set): uninitialized variable 'fmt_INCLUDE_DIRS_DEBUG' Call Stack (most recent call first): CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/fmt-config.cmake:26 (set): uninitialized variable 'fmt_DEFINITIONS_DEBUG' Call Stack (most recent call first): CMakeLists.txt:31 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

-- Conan: Component target declared 'Catch2::Catch2' -- Conan: Component target declared 'Catch2::Catch2WithMain' CMake Error (dev) at conan/Catch2-Target-debug.cmake:5 (set): uninitialized variable 'catch2_COMPILE_OPTIONS_CXX_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it. CMake Error (dev) at conan/Catch2-Target-debug.cmake:5 (set): uninitialized variable 'catch2_COMPILE_OPTIONS_C_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:9 (set): uninitialized variable 'catch2_SHARED_LINK_FLAGS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:9 (set): uninitialized variable 'catch2_SHARED_LINK_FLAGS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:9 (set): uninitialized variable 'catch2_EXE_LINK_FLAGS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:15 (conan_find_apple_frameworks): uninitialized variable 'catch2_FRAMEWORKS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:15 (conan_find_apple_frameworks): uninitialized variable 'catch2_FRAMEWORK_DIRS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:25 (set_property): uninitialized variable 'catch2_SYSTEM_LIBS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:34 (conan_package_library_targets): uninitialized variable 'catch2_LIBS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:34 (conan_package_library_targets): uninitialized variable 'catch2_LIB_DIRS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:42 (set): uninitialized variable 'catch2_BUILD_DIRS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2-Target-debug.cmake:43 (set): uninitialized variable 'catch2_BUILD_DIRS_DEBUG' Call Stack (most recent call first): conan/Catch2Targets.cmake:26 (include) conan/Catch2Config.cmake:10 (include) test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2Config.cmake:23 (set): uninitialized variable 'catch2_INCLUDE_DIRS_DEBUG' Call Stack (most recent call first): test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2Config.cmake:24 (set): uninitialized variable 'catch2_INCLUDE_DIRS_DEBUG' Call Stack (most recent call first): test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

CMake Error (dev) at conan/Catch2Config.cmake:26 (set): uninitialized variable 'catch2_DEFINITIONS_DEBUG' Call Stack (most recent call first): test/CMakeLists.txt:9 (find_package) This error is for project developers. Use -Wno-error=dev to suppress it.

friendlyanon commented 2 years ago

I have reported an issue about Conan not generating "clean" scripts before: https://github.com/conan-io/conan/issues/10288

I'm not sure what exactly changed. Worst case scenario, I remove the cmake-pedantic preset for Conan as well, like for vcpkg.
The quick fix in the meantime is to do just that, i.e. remove the preset:

    {
      "name": "cmake-pedantic",
      "hidden": true,
      "warnings": {
        "dev": true,
        "deprecated": true,
        "uninitialized": true,
        "unusedCli": true,
        "systemVars": false
      },
      "errors": {
        "dev": true,
        "deprecated": true
      }
    },

and the references to it.

friendlyanon commented 2 years ago

Okay, the Conan people released 1.51.3 just after I filed the issue and it fixes this regression. I'll close this for now. Thanks for the report!