Building hello world at the command line using Cmake and Visual Studio Express 2010 - cmake

I'm new to CMake. I am trying to build a very simple program (hello world) using Visual Studio 2010 Express. In the Visual Studio 2010 Command Prompt I ran the command:
cmake -g "NMake Makefiles" .
This appeared to work.
C:\Users\david\dev\cmake\hello_world>cmake -g "NMake Makefiles" .
-- Building for: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/david/dev/cmake/hello_world
Next, I tried to run nmake, which produced the following error:
C:\Users\david\dev\cmake\hello_world>nmake
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.
I cannot see a Makefile inside the project directory, so I guess that's why it is not working, or perhaps CMake uses a non standard name for Makefile's? I'm unsure. I've pasted the contents of the project directory below.
C:\Users\david\dev\cmake\hello_world>dir
Volume in drive C has no label.
Volume Serial Number is 4000-10E9
Directory of C:\Users\david\dev\cmake\hello_world
08/05/2012 01:38 PM <DIR> .
08/05/2012 01:38 PM <DIR> ..
08/05/2012 01:38 PM 28,584 ALL_BUILD.vcxproj
08/05/2012 01:38 PM 735 ALL_BUILD.vcxproj.filters
08/05/2012 01:38 PM 12,871 CMakeCache.txt
08/05/2012 01:38 PM <DIR> CMakeFiles
08/05/2012 01:34 PM 151 CMakeLists.txt
08/05/2012 01:38 PM 1,514 cmake_install.cmake
08/05/2012 01:38 PM 3,150 hello_world.sln
08/05/2012 01:38 PM 36,618 hello_world.vcxproj
08/05/2012 01:38 PM 671 hello_world.vcxproj.filters
08/05/2012 01:37 PM 2,213 hello_world.vpj
08/05/2012 01:37 PM 206 hello_world.vpw
08/05/2012 01:37 PM 134 hello_world.vpwhist
08/05/2012 01:37 PM 106,496 hello_world.vtg
08/05/2012 07:14 AM 118 main.cpp
08/05/2012 01:38 PM 23,914 ZERO_CHECK.vcxproj
08/05/2012 01:38 PM 807 ZERO_CHECK.vcxproj.filters
15 File(s) 218,182 bytes
3 Dir(s) 134,161,678,336 bytes free
The source for my program is:
#include <iostream>
int main(int argc, char* argv[])
{
std::cout << *argv << std::endl;
return 0;
}
My CMakeLists.txt is:
# CMakeLists.txt
# $ cmake -g "NMake Makefiles" .
cmake_minimum_required(VERSION 2.8)
project(hello_world)
add_executable(hello_world main.cpp)
Thanks,

Related

Compiler can't find ZLIB even though it is present

I have the following settings in CLion 2020.1:
I have the following lines in my CMakeLists.txt file:
set(ZLIB_LIBRARY "C:\\Program Files (x86)\\GnuWin32")
set(ZLIB_INCLUDE_DIR "C:\\Program Files (x86)\\GnuWin32\\include")
find_package(ZLIB REQUIRED)
find_package (ZLIB)
if (ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR})
endif (ZLIB_FOUND)
And, the compiler generates the following error:
C:\Users\pc\CLionProjects\myproject\src\utils/io_utils.hh(8,10): fatal error: 'zlib.h' file not found
#include <zlib.h>
^~~~~~~~
11 warnings and 1 error generated.
NMAKE : fatal error U1077: 'C:\PROGRA~1\LLVM\bin\clang-cl.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
How can I correct this?
You only need the following line:
find_package(ZLIB REQUIRED)
# To use zlib:
add_executable(main main.cpp)
target_link_libraries(main PRIVATE ZLIB::ZLIB)
Then, at the command line, pass "-DCMAKE_PREFIX_PATH=C:/Program Files (x86)/GnuWin32" as an argument to the CMake configure step. CMAKE_PREFIX_PATH may also be set as an environment variable and is formatted like your system's PATH env-var (so ; separators on Windows and : elsewhere).
The variable CMAKE_PREFIX_PATH is consulted for a list of sysroots by the find_* commands. The directories in this variable should contain subdirectories like include, lib, bin, etc. Read more about the CMake search procedure here: https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure
So you can see exactly what I did from the x64 Native Tools Command Prompt for VS 2019:
D:\>dir "C:\Program Files (x86)\GnuWin32"
Volume in drive C has no label.
Volume Serial Number is B854-7CB4
Directory of C:\Program Files (x86)\GnuWin32
05/26/2021 11:40 AM <DIR> .
05/26/2021 11:40 AM <DIR> ..
05/26/2021 11:40 AM <DIR> bin
05/26/2021 11:40 AM <DIR> contrib
05/26/2021 11:40 AM <DIR> doc
05/26/2021 11:40 AM <DIR> include
05/26/2021 11:40 AM <DIR> lib
05/26/2021 11:40 AM <DIR> man
05/26/2021 11:40 AM <DIR> manifest
05/26/2021 11:40 AM <DIR> uninstall
0 File(s) 0 bytes
10 Dir(s) 204,769,185,792 bytes free
D:\>dir "C:\Program Files (x86)\GnuWin32\lib"
Volume in drive C has no label.
Volume Serial Number is B854-7CB4
Directory of C:\Program Files (x86)\GnuWin32\lib
05/26/2021 11:40 AM <DIR> .
05/26/2021 11:40 AM <DIR> ..
07/20/2005 08:52 AM 77,534 libz.a
07/20/2005 08:50 AM 43,738 libz.dll.a
07/20/2005 08:50 AM 6,656 zlib-bcc.lib
07/20/2005 08:46 AM 1,868 zlib.def
07/20/2005 08:50 AM 14,778 zlib.lib
5 File(s) 144,574 bytes
2 Dir(s) 204,769,185,792 bytes free
D:\>mkdir test
D:\>cd test
D:\test>notepad CMakeLists.txt
D:\test>type CMakeLists.txt
cmake_minimum_required(VERSION 3.20)
project(test)
find_package(ZLIB REQUIRED)
D:\test>cmake -S . -B build "-DCMAKE_PREFIX_PATH=C:/Program Files (x86)/GnuWin32"
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.28.29915.0
-- The CXX compiler identification is MSVC 19.28.29915.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: C:/Program Files (x86)/GnuWin32/lib/zlib.lib (found version "1.2.3")
-- Configuring done
-- Generating done
-- Build files have been written to: D:/test/build
It absolutely does find ZLIB like this.

CMake INSTALL and RENAME cannot find file

I'm trying to make and install a config.cmake file for the project that I'm building, and the install part isn't working because apparently it can't find the file. I was originally using the INSTALL command from cmake, and when that didn't work I tried file( RENAME ... ) because I have a little more experience with it - neither seem to work. I've verified that the file is being made in the correct location and with the expected filename.
This is the relevant part of the CMakeLists.txt:
################################################################################
# Build the config.cmake file for finding project information
################################################################################
file(WRITE ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake "set(${PROJECT_NAME}_PROTO_DIR ${PROTO_MAIN_DIR})\n")
file(APPEND ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake "set(${PROJECT_NAME}_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/include/;${PROTO_GEN_DIR})\n")
file(APPEND ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake "set(${PROJECT_NAME}_LIBRARY_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/)\n")
file(APPEND ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake "set(${PROJECT_NAME}_LIBRARIES ${PROJECT_LIBRARIES})\n")
message( "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} )
message( "PROJECT_NAME: " ${PROJECT_NAME} )
#INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake DESTINATION ~/CMake/Modules/)
file(RENAME ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake ~/CMake/Modules/${PROJECT_NAME}Config.cmake)
Here's the relevant output when I try to rune cmake:
CMAKE_BINARY_DIR: /home/ava/workspace/frontseat_drivers/build
PROJECT_NAME: frontseat
CMake Error at src/frontseat/CMakeLists.txt:47 (file):
file RENAME failed to rename
/home/ava/workspace/frontseat_drivers/build/frontseatConfig.cmake
to
~/CMake/Modules/frontseatConfig.cmake
because: No such file or directory
and here's output confirming that the file is where I expect with the name that I expect:
ava#3b97b310abf0:~/workspace/frontseat_drivers/build$ ls -l
total 32
-rw-rw-r--. 1 ava ava 12219 Jun 13 19:04 CMakeCache.txt
drwxrwxr-x. 5 ava ava 4096 Jun 13 18:48 CMakeFiles
-rw-rw-r--. 1 ava ava 2250 Jun 13 15:41 cmake_install.cmake
-rw-rw-r--. 1 ava ava 315 Jun 14 12:30 frontseatConfig.cmake
-rw-rw-r--. 1 ava ava 6397 Jun 13 18:48 Makefile
drwxrwxr-x. 5 ava ava 98 Jun 13 18:48 src
What would cause CMake not to be able to see the file?
The error is probably about destination file ~/CMake/Modules/frontseatConfig.cmake. It is because CMake doesn't interpret ~ part, so it cannot resolve the path correctly.
Instead of ~ use $ENV{HOME} for point to the user's home directory.

CMake define new target by string processing existing $<TARGET_FILE>

I"m trying to modernize an older CMake script that essentially does the following to generate a libtool file:
get_target_property(target_location ${target} LOCATION)
get_filename_component(target_we ${target_location} NAME_WE)
get_target_property(target_deps ${target} LT_DEPENDENCY_LIBS)
# ...
# Get a bunch more properties...
# ...
set(la_target ${PROJECT_BINARY_DIR}/${target_we}.la)
# ...
# Do a bunch of file(WRITE...) file(APPEND...) etc
# ...
install(FILES ${la_target} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
You cannot get the LOCATION property from a target in modern cmake, and I can't figure out how to do get_filename_component() on a $ generator.
Using the generator in an add_custom_command() COMMAND statement only allows one line, so I can't set variables to do all the necessary get_target_property()/file(WRITE...) processing.
Alternatively I can add a COMMAND cmake -P script.cmake to run a script which can do all the string processing but can't define or reference targets, so I appear to be stuck.
EDIT: I'm using the Makefile generator, on macOS, the target in question is a shared library that's generated in the same project.
EDIT2: The error is:
The LOCATION property may not be read from target "mytarget".
Use the target name directly with add_custom_command, or use
the generator expression $<TARGET_FILE>, as appropriate.
You can to it like this:
first use file command to expand generator expressions and render a level-2 template
... which is going to be rendered at build time by configure_file
Here is a sample project:
cmake_minimum_required(VERSION 3.10)
project(location-test VERSION 0.0.1 LANGUAGES CXX)
add_executable(foo foo.cc)
file(GENERATE OUTPUT blah.la.in INPUT blah.la.in.in)
configure_file(render-variables.cmake.in render-variables.cmake #ONLY)
add_custom_command(
OUTPUT "${PROJECT_BINARY_DIR}/blah.la"
COMMAND "${CMAKE_COMMAND}"
-DPROJECT_BINARY_DIR="${PROJECT_BINARY_DIR}"
-DPROJECT_NAME="${PROJECT_NAME}"
-DPROJECT_VERSION="${PROJECT_VERSION}"
-P "${PROJECT_BINARY_DIR}/render-variables.cmake"
MAIN_DEPENDENCY "${PROJECT_BINARY_DIR}/blah.la.in"
DEPENDS "${PROJECT_BINARY_DIR}/render-variables.cmake"
)
add_custom_target(
make-la-la-la ALL
DEPENDS "${PROJECT_BINARY_DIR}/blah.la"
)
blah.la.in.in (2-levels of tempaltes %):
# This file going to be rendered by the following pipeline:
# - at CMake execution time it'll expand all generator expressions
# (e.g. $<TARGET_FILE:foo>)
# - at build time, the `render-variables.cmake` script will substitute
# CMake variables (like #PROJECT_NAME# or #PROJECT_VERSION#)
write the template for your real .la file... render-variables.cmake.in is trivial as :
configure_file("${PROJECT_BINARY_DIR}/blah.la.in" "${PROJECT_BINARY_DIR}/blah.la" #ONLY)
And finally a dummy C++ file foo.cc:
#include <iostream>
int main()
{
std::cout << "Hello Africa!\n";
}
Build it!
localtion-sample$ mkdir build/
localtion-sample$ cd build/
localtion-sample/build$ cmake ..
-- The CXX compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0/c++ -- works
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/localtion-sample/build
localtion-sample/build$ make
Scanning dependencies of target foo
[ 33%] Building CXX object CMakeFiles/foo.dir/foo.cc.o
[ 66%] Linking CXX executable foo
[ 66%] Built target foo
Scanning dependencies of target make-la-la-la
[100%] Generating blah.la
[100%] Built target make-la-la-la
localtion-sample/build$ ll
total 52K
drwxr-xr-x 6 zaufi zaufi 320 Feb 9 22:35 CMakeFiles/
-rw-r--r-- 1 zaufi zaufi 287 Feb 9 22:35 blah.la
-rw-r--r-- 1 zaufi zaufi 300 Feb 9 22:35 blah.la.in
-rw-r--r-- 1 zaufi zaufi 11K Feb 9 22:35 CMakeCache.txt
-rw-r--r-- 1 zaufi zaufi 1.5K Feb 9 22:35 cmake_install.cmake
-rwxr-xr-x 1 zaufi zaufi 14K Feb 9 22:35 foo
-rw-r--r-- 1 zaufi zaufi 5.0K Feb 9 22:35 Makefile
-rw-r--r-- 1 zaufi zaufi 89 Feb 9 22:35 render-variables.cmake
localtion-sample/build$ cat blah.la
# This file going to be rendered by the following pipeline:
# - at CMake execution time it'll expand all generator expressions
# (e.g. /tmp/localtion-sample/build/foo)
# - at build time, the `render-variables.cmake` script will substitute
# CMake variables (like location-test or 0.0.1)

ExternalProject_Add_Step ERROR add_custom_command given APPEND option with output

Using cmake version 3.7.0-rc3 on Win7, I can run the below code using ExternalProject_Add_Step no problem. But using cmake version 3.7.0 on Ubuntu16, I get the error:
add_custom_command given APPEND option with output "ExternalProjects/Stamp/boost/boost-CONFIGURE" which is not already a custom command output.
Here's simplified code that reproduces the issue.
ExternalProject_Add(
boost
URL https://sourceforge.net/projects/boost/files/boost/1.62.0/boost_1_62_0.tar.gz/download
URL_HASH MD5=6f4571e7c5a66ccc3323da6c24be8f05
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Add_Step(
boost UNIX_CONFIGURE DEPENDEES DOWNLOAD DEPENDERS CONFIGURE
WORKING_DIRECTORY "<SOURCE_DIR>" COMMAND ./bootstrap.sh
)
The culprit seems to be DEPENDERS CONFIGURE. If I take that out, then it works fine. But... I'd like to be able to specify that the step CONFIGURE depends on this custom step, and on Windows I can, but on Ubuntu I can't. Any ideas why?
I don't see it in the documentation, but you've just simply run into a case sensitivity issue. Modifying your CMakeLists.txt to:
❯ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.7)
include(ExternalProject)
ExternalProject_Add(
boost
URL https://sourceforge.net/projects/boost/files/boost/1.62.0/boost_1_62_0.tar.gz/download
URL_HASH MD5=6f4571e7c5a66ccc3323da6c24be8f05
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Add_Step(
boost UNIX_CONFIGURE DEPENDEES download DEPENDERS configure
WORKING_DIRECTORY "boost-prefix/src/boost/" COMMAND ./bootstrap.sh
)
Notice that "download" and "configure" in ExternalProject_Add_Step() are now downcased. Now, cmake and make complete successfully.
❯ cmake ..
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/nega/foo/build
❯ make
Scanning dependencies of target boost
[ 11%] Creating directories for 'boost'
[ 22%] Performing download step (download, verify and extract) for 'boost'
-- verifying file...
file='/Users/nega/foo/build/boost-prefix/src/boost_1_62_0.tar.gz'
-- File already exists and hash match (skip download):
file='/Users/nega/foo/build/boost-prefix/src/boost_1_62_0.tar.gz'
MD5='6f4571e7c5a66ccc3323da6c24be8f05'
-- extracting...
src='/Users/nega/foo/build/boost-prefix/src/boost_1_62_0.tar.gz'
dst='/Users/nega/foo/build/boost-prefix/src/boost'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] Performing UNIX_CONFIGURE step for 'boost'
Building Boost.Build engine with toolset darwin... tools/build/src/engine/bin.macosxx86_64/b2
Detecting Python version... 2.7
Detecting Python root... /Users/nega/i3/virtenv
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...
Bootstrapping is done. To build, run:
./b2
To adjust configuration, edit 'project-config.jam'.
Further information:
- Command line help:
./b2 --help
- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html
- Boost.Build documentation:
http://www.boost.org/build/doc/html/index.html
[ 44%] No update step for 'boost'
[ 55%] No patch step for 'boost'
[ 66%] No configure step for 'boost'
[ 77%] No build step for 'boost'
[ 88%] No install step for 'boost'
[100%] Completed 'boost'
[100%] Built target boost
Now, look in boost-prefix/src/boost-stamp of your build directory:
❯ v boost-prefix/src/boost-stamp
total 32
drwxr-xr-x 15 nega staff 510 Dec 20 12:29 ./
drwxr-xr-x 6 nega staff 204 Dec 20 12:28 ../
-rw-r--r-- 1 nega staff 0 Dec 20 12:29 boost-UNIX_CONFIGURE
-rw-r--r-- 1 nega staff 0 Dec 20 12:29 boost-build
-rw-r--r-- 1 nega staff 0 Dec 20 12:29 boost-configure
-rw-r--r-- 1 nega staff 0 Dec 20 12:29 boost-done
-rw-r--r-- 1 nega staff 0 Dec 20 12:28 boost-download
-rw-r--r-- 1 nega staff 0 Dec 20 12:29 boost-install
-rw-r--r-- 1 nega staff 0 Dec 20 12:28 boost-mkdir
-rw-r--r-- 1 nega staff 0 Dec 20 12:29 boost-patch
-rw-r--r-- 1 nega staff 0 Dec 20 12:29 boost-update
-rw-r--r-- 1 nega staff 173 Dec 20 12:18 boost-urlinfo.txt
-rw-r--r-- 1 nega staff 4424 Dec 20 12:18 download-boost.cmake
-rw-r--r-- 1 nega staff 1611 Dec 20 12:28 extract-boost.cmake
-rw-r--r-- 1 nega staff 0 Dec 20 12:28 verify-boost.cmake
You'll notice at each step has a "file stamp" named after it. The default steps are all in lowercase, and your custom step "UNIX_CONFIGURE" is uppercase, just as you defined it. If you mix case your custom step, you'll get that as output.
❯ grep -i unix ../CMakeLists.txt
boost uNiX_CoNFiGuRe DEPENDEES download DEPENDERS configure
❯ make | grep -i unix
[ 33%] Performing uNiX_CoNFiGuRe step for 'boost'
❯ find boost-prefix/src/boost-stamp | grep -i unix
boost-prefix/src/boost-stamp/boost-uNiX_CoNFiGuRe
Also, look at the make output.
[ 22%] Performing download step (download, verify and extract) for 'boost'
[....]
[ 33%] Performing uNiX_CoNFiGuRe step for 'boost'
[....]
[ 44%] No update step for 'boost'
[ 55%] No patch step for 'boost'
[ 66%] No configure step for 'boost'
[ 77%] No build step for 'boost'
[ 88%] No install step for 'boost'
[100%] Completed 'boost'
[100%] Built target boost
All the default steps are referred to in lowercase.
Summary
In CMake's ExternalProject module, refer to default steps in lowercase.

Error with cmake when trying to build wt?

Check for working C compiler: cl
Check for working C compiler: cl -- broken
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:32
(MESSAGE):The C compiler "cl" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Gilg/Documents/Projects/builds/CMakeFiles/CMakeTmp
Run Build Command:C:\PROGRA~1\MI30EB~1\Common7\IDE\devenv.com
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
Microsoft (R) Visual Studio Version 8.0.50727.762.
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
1>------ Build started: Project: cmTryCompileExec, Configuration: Debug
Win32 ------
1>Compiling...
1>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762
for 80x86
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>cl /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "CMAKE_INTDIR=\"Debug\""
/D "_MBCS" /FD /RTCs /MDd /Fo"cmTryCompileExec.dir\Debug\"
/Fd"C:/Users/Gilg/Documents/Projects/builds/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.pdb"
/W3 /c /Zi /TC /Zm1000
1> .\testCCompiler.c
1>testCCompiler.c
1>.\testCCompiler.c : fatal error C1033: cannot open program database
1>Build log was saved at
"file://c:\Users\Gilg\Documents\Projects\builds\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm"
1>cmTryCompileExec - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have added the paths, $(SystemRoot), $(SystemRoot)\System32,$(SystemRoot)\System32\wbem to the vc++ directories in MCVS 2005 and yet I still get this problem. Im not sure what else to do. Any help is greatly appreciated, Thanks.
Looks like something is wrong with how you ran cmake. Erase your entire project, restart from scracth by following the wt on windows installation instructions
I have worked a similar problem recently and it was due to cygwin being in path before the VC200x binary. Solved by placing \cygwin\bin at the very last in C++ Directories->Executables Directories and took it completely out of the system environment path.