Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Looking for include file CommonCrypto/CommonCrypto.h - not found Looking for include file CommonCrypto/CommonCrypto.h but CMake generates it automatically in the build directory. to 'zconf.h.included' because this file is included with zlib ![]() Z:/ProjectFolder/cmake-build-debug/_deps/zlib-src/zconf.h suffix to tellĬMake that the project does not need compatibility with older versions. Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/3/bin/Host圆4/圆4/cl.exe - skippedĬMake Deprecation Warning at cmake-build-debug/_deps/zlib-src/CMakeLists.txt:1 (cmake_minimum_required):Ĭompatibility with CMake value or use a. Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/3/bin/Host圆4/圆4/cl.exe - skipped The CXX compiler identification is MSVC 7.0 The C compiler identification is MSVC 7.0 However, the first time I run cmake (without any cmake cache), cmake fails with the following output: "C:\Program Files\JetBrains\CLion 2022.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=C:/Program Files/JetBrains/CLion 2022.1/bin/ninja/win/ninja.exe" -G Ninja -S Z:\ProjectFolder -B Z:\ProjectFolder\cmake-build-debug The compilation works fine, but the linker fails because the linker cannot find the zlib. The dependencies are added in the ExampleProject cmake file via FetchContent_Declare.ĮxampleProject-cmake-file: cmake_minimum_required(VERSION 3.22)Īdd_library($ Catch2::Catch2 ExampleProject) Libzippp depends on libzip and libzip on zlib. The first is a library project called ExampleProject. The setup: There are two C++ cmake projects. This method of saving the state between between runs of the CMake command comes from the CMake-git-version-tracking repository.I'm having strange behavior when trying to build and link libzippp (and zlib) with a library project on Windows. We can write the git commit hash using the file(WRITE) command and then we can file(STRINGS) command to read the content of the file back into CMake. Since we don’t have access to the CMake cache when running in CMake’s script mode, we have to save this information into an external file called git-state.txt. We only want to regenerate the git_version.cpp if the git hash has actually changed. The only thing left is that we want to reduce the amount of work done. We almost have all of the pieces together. This allows the byproducts to be used in other parts of the CMake script otherwise there would be an error indicating that the file is missing, but in reality the file has just not been generated yet, which isn’t a problem. We also have to specify the BYPRODUCTS of the command. These must be passed along since a CMake script file does not have access to the cache so we must pass these values along. ![]() The -Dpre_configure_file and -Dpost_configure_file include the directories that the configuration files are from and the generated data should go. the -DRUN_CHECK_GIT_VERSION=1 tells the script that we should run the CheckGitVersion function. We must also pass any variables we want the script to have access through the -D arguments. ![]() The -P indicates that we should run cmake in a script mode which means that it will run the cmake file, not modify the cache at all. # Get the latest abbreviated commit hash of the working branchĬOMMAND git log -1 -format=%h WORKING_DIRECTORY $ indicates that we should run the cmake executable for this command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |