I am just starting with CMake. I have successfully configured the most minimal Hello, World! A C ++ application is possible for Visual Studio 2012 on Windows 7, but I have one more nasty thing that is not entirely true, and I cannot understand why :(
My folder structure:
[cmakeTest] - [build] - [source] - [helloWorld] - main.cpp - CMakeLists.txt - CMakeLists.txt
My main.cpp file is simple:
#include <iostream> int main() { std::cout << "Hello World!"; }
source/CMakeLists.txt is:
cmake_minimum_required (VERSION 3.0.1)
source/helloWorld/CMakeLists.txt is:
# Set Properties->General->Configuration Type to Application (.exe)
What works:
It creates a solution for a Visual Studio / project solution in the assembly directory
The project is assembled and launched in debug and release mode
It creates exe files in /build/helloWorld/Debug/ and /build/helloWorld/Release (which work)
What does not work:
- Visual Studio reports that it copied the EXE file to
/bin/helloWorld.exe , but does not have> :-(
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------ 2>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------ 2> Build all projects 3>------ Build started: Project: INSTALL, Configuration: Release Win32 ------ 3> -- Install configuration: "Release" 3> -- Up-to-date: /bin/helloWorld.exe ========== Build: 3 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
I know this seems fussy, but I'm trying to make sure that I understand everything that happens before moving on to more complex things (PS I use the CMake client, not the command line).
source share