Created sln file from folder with CMakeLists.txt.
Here's a summary of the contents:
CMakeLists.txt
cmake_minimum_required (VERSION 3.0.0)
project(777VERSION 1.0.0)
include_directories (includes)
add_executable(777
Source/111.c
Source/222.c
Source/333.c
... (omitted) ...
Source/777.c
Source/888.c
Source/999.c
)
set(CPACK_PROJECT_NAME${PROJECT_NAME})
set(CPACK_PROJECT_VERSION${PROJECT_VERSION})
include (CPack)
From the folder where CMakeLists.txt is located for use with Visual Studio 2019
I created the sln file by entering the following command:
cmake-G "Visual Studio 16 2019" - Ax64.
The sln file was completed in the same folder, and the compilation was successful in Visual Studio 2019.
If you copy the complete set of folders to a different PC and compile them again with Visual Studio 2019, the path from the previous different PC will pass, resulting in a compilation error.
Is there a way to compile a different PC relatively?
c visual-studio cmake
Why don't we just start over from cmake on a different PC?
Visual Studio is cmake-enabled, so it is recommended that you run "Open a local folder" in your environment without generating sln files.
© 2024 OneMinuteCode. All rights reserved.