I have a problem while compiling CGAL I followed the steps here : http://www.cse.msu.edu/~ytong/CGAL_installation.ppt
I'm using VS2013 , cgal 4.9.1 , BOOST 1.59.0 ,Qt5.7.1
but when I reach at building INSTALL .sln step it show the following error:
Error 1 error MSB3073: The command "setlocal
"C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 132 5 INSTALL
output message :
file INSTALL cannot find
1> "C:/dev/CGAL-4.9.1/build/bin/Debug/CGAL-vc120-mt-gd-4.9.1.dll".
1> Call Stack (most recent call first):
1> src/cmake_install.cmake:32 (include)
1> cmake_install.cmake:91 (include)
any help please?
Please use CGAL 4.12 and use installation instructions given on www.cgal.org
Related
I have a simple batch file foo.bat:
#ECHO OFF
setlocal
echo %PATH%
WHERE /Q wsl.exe
if %ERRORLEVEL%% NEQ 0 (
echo No find wsl.exe %ERRORLEVEL%
exit /B
)
When I just run it in cmd or explicitly with cmd.exe /C foo.bat I have no problems. But if I put it into a nmake.exe Makefile:
all:
call foo.bat
.PHONY : all
and call it with nmake.exe /f Makefile all it will fail:
C:\cmder_mini\bin;C:\cmder_mini\vendor\bin;C:\cmder_mini\vendor\conemu-maximus5\ConEmu\Scripts;C:\cmder_mini\vendor\conemu-maximus5;C:\cmder_mini\vendor\conemu-maximus5\ConEmu;E:\VisualStudio\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;E:\VisualStudio\VC\Tools\MSVC\14.30.30705\bin\HostX86\x86;E:\VisualStudio\Common7\IDE\VC\VCPackages;E:\VisualStudio\Common7\IDE\CommonExtensions\Microsoft\TestWindow;E:\VisualStudio\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;E:\VisualStudio\MSBuild\Current\bin\Roslyn;E:\VisualStudio\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\\x86;C:\Program Files (x86)\Windows Kits\10\bin\\x86;E:\VisualStudio\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework\v4.0.30319;E:\VisualStudio\Common7\IDE\;E:\VisualStudio\Common7\Tools\;C:\Program Files\CMake\bin;C:\Program Files\Python310\Scripts\;C:\Program Files\Python310\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;E:\home\nat\mulle-clang-project\13.0.0.1\bin;C:\Users\nat\AppData\Local\Microsoft\WindowsApps;E:\VisualStudio\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;E:\VisualStudio\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;E:\VisualStudio\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\cmder_mini
No find wsl.exe 1
NMAKE : fatal error U1077: 'call' : return code '0x1'
When I diff the output of the working script and the failing nmake run I get
1,5d0
<
< Microsoft (R) Program Maintenance Utility Version 14.30.30709.0
< Copyright (C) Microsoft Corporation. All rights reserved.
<
< call foo.bat
7,9d1
< No find wsl.exe 1
< NMAKE : fatal error U1077: 'call' : return code '0x1'
< Stop.
So the PATH is identical. Once it finds "wsl.exe" in PATH and once it doesn't ? I have no clue here...
Summary:
How to generate Wix installer with CMake/CPack?
Details:
I am trying to generate an installer out from a project that uses Wix, but apparently, cmake/cpack insist to use nsis, for example, from the repo https://github.com/ngladitz/cmake-wix-testsuite
I picked the first example "basic" folder with the following contents for CMakeLists.txt
add_executable(hw hw.cpp)
install(TARGETS hw DESTINATION bin)
install(FILES hw.cpp DESTINATION src)
set(CPACK_WIX_UPGRADE_GUID "F9AAAAE2-D6AF-4EA4-BF46-B3E265400CC7")
include(CPack)
After generating the cmake:
cd <basic-root-folder>
mkdir MY_BUILD
cd MY_BUILD
cmake ..
I tried to run the package.vcxproj generated with
msbuild package.vcxproj
and got the error
"C:\src\Samples\CPack\cmake-wix-testsuite-master\basic\MY_BUILD\PACKAGE.vcxproj
" (default target) (1) ->
(PostBuildEvent target) ->
EXEC : CPack error : Cannot find NSIS compiler makensis: likely it is not ins
talled, or not in your PATH [C:\src\Samples\CPack\cmake-wix-testsuite-master\ba
sic\MY_BUILD\PACKAGE.vcxproj]
So it looks like it insist in using the NSIS generator.
Simply add following line before include(CPack)
set(CPACK_GENERATOR WIX)
You can also do this:
cmake ..
cpack -G WIX
By default, CPack uses the NSIS Generator on Windows.
Ok, I found how
By specifying the CPack generator like
cmake -DCPACK_GENERATOR=WIX ..
Then running
msbuild package.vcxproj
Invokes wix like this extract from the log (and a bunch of .wixobj files)
PostBuildEvent:
setlocal
cd C:\src\Samples\CPack\cmake-wix-testsuite-master\basic\MY_BUILD.wix
if %errorlevel% neq 0 goto :cmEnd
C:
if %errorlevel% neq 0 goto :cmEnd
"C:\Program Files (x86)\CMake 3.1.3\bin\cpack.exe" -C Debug --config ./CPackC
onfig.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd
CPack: Create package using WIX
CPack: Install projects
CPack: - Install project: Project
CPack: Create package
CPack: - package: C:/src/Samples/CPack/cmake-wix-testsuite-master/basic/MY_BU
ILD.wix/Project-0.1.1-win32.msi generated.
FinalizeBuildStatus:
Deleting file "Win32\Debug\PACKAGE\PACKAGE.tlog\unsuccessfulbuild".
Touching "Win32\Debug\PACKAGE\PACKAGE.tlog\PACKAGE.lastbuildstate".
Done Building Project "C:\src\Samples\CPack\cmake-wix-testsuite-master\basic\MY
_BUILD.wix\PACKAGE.vcxproj" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Also the .wix source files are generated at C:\src\Samples\CPack\cmake-wix-testsuite-master\basic\MY_BUILD.wix\\_CPack_Packages\win32\WIX
I found out about this arg (CPACK_GENERATOR) by inspecting CPackConfig.cmake generated by the original cmake.
I have a build step in my build configuration thats runner type "Command Line", running a custom script.
The script is executing Robocopy:
robocopy "%teamcity.build.workingDir%\Code" "\\target\d$\Web\Target Sites" /E /NP /LOG:robocopy.log
if ERRORLEVEL GEQ 4 (
"D:\blat.exe" "robocopy.log" -to me#me.com -f me#me.com -subject "Error during robocopy on TEAMCITY" -server mail.me.com
)
exit /B 0
The Robocopy command is working fine but I keep getting an email and in the build log I keep seeing:
GEQ was unexpected at this time.
The ERRORLEVEL check isn't working for some reason?
I tried IF %ERRORLEVEL% GEQ but this breaks my build has TeamCity expects me to pass a build parameter.
Does this only work as an "Executable with parameters"?
Neil, you might try escaping the percent sign.
Try IF %%ERRORLEVEL%% GEQ ...
I've just run into this problem, and appreciate #John's answer.
Here is what I came up with:
robocopy [from] [to] /MIR
REM http://ss64.com/nt/robocopy-exit.html
IF %%ERRORLEVEL%% EQU 0 (
ECHO No errors occurred, and no copying was done; The source and destination directory trees are completely synchronized.
EXIT 0
)
IF %%ERRORLEVEL%% EQU 1 (
ECHO One or more files were copied successfully, new files have arrived.
EXIT 0
)
IF %%ERRORLEVEL%% EQU 2 (
ECHO Some Extra files or directories were detected. No files were copied.
EXIT 0
)
IF %%ERRORLEVEL%% GEQ 3 (
ECHO Robocopy Exit Codes: http://ss64.com/nt/robocopy-exit.html
EXIT %%ERRORLEVEL%%
)
I have a batch file in which I execute the following line to list the contents of an archive:
"\Program Files\7-Zip\7z.exe" l "\Backup Google Docs.7z"
The archive is intentionally corrupted.
cmd.exe displays this:
How can I catch this error in my code?
Any program's exit code is stored in the %ERRORLEVEL% variable in a batch script.
From the 7-zip manual:
7-Zip returns the following exit codes:
Code Meaning
0 No error
1 Warning (Non fatal error(s)). For example, one or more files were locked by some other application, so they were not compressed.
2 Fatal error
7 Command line error
8 Not enough memory for operation
255 User stopped the process
So: you can do:
"\Program Files\7-Zip\7z.exe" l "\Backup Google Docs.7z"
if errorlevel 255 goto:user_stopped_the_process
if errorlevel 8 goto:not_enough_memory
if errorlevel 7 goto:command_line_error
if errorlevel 2 goto:fatal_error
if errorlevel 1 goto:ok_warnings
Caution, if errorlevel N checks that %ERRORLEVEL% is greater or equal than N, therefore you should put them in descending order.
Check if the ERRORLEVEL is set to 1 just after the call to 7z.exe and react appropriately. The ERRORLEVEL is the exit code from the last program that was run. An exit code of 1 or more indicates an error while zero indicates success. The IF ERRORLEVEL command checks if the exit is greater than or equal to the argument so IF ERRORLEVEL checks for an error level of one or more.
Here is an example:
"\Program Files\7-Zip\7z.exe" l "\Backup Google Docs.7z" > nul
IF ERRORLEVEL 1 goto ziperror
#echo 7-Zip worked
goto :eof
:ziperror
#echo 7-Zip failed
goto :eof
We have a Team City Build Server running and want to compile a Visual C++ project. So far this would be easy, since I've setup our Windows Build Agent with the Windows SDK, but we don't have a solution / project file.
The project files are instead created with CMake. CMake seems to be a little bit dumb (can't generate Solution when Visual Studio is not installed), but with some tricks, I could get it to do it. The solution can then be built with MSBuild.
And here comes the problem. For this to work automatically, I need to call the Windows SDK's SetEnv.cmd. And I can't seem to find it automatically. It's in the bin sub directory of the Windows SDK, but neither bin nor the root are in the path, and the %mssdk% environment variable is set by the SetEnv.cmd and is not available beforehand!
Adding the Windows SDK\bin dir to the PATH leads to SetEnv.cmd no longer working (exits with a message like The x86 compilers are not currently installed and Jump target Set_x86 not found.
The start menu link is calling the SetEnv.cmd with the Windows SDK dir as working directory instead. But if I add the root directory to the PATH, Bin\SetEnv.cmd is not available.
How can I find SetEnv.cmd automatically? Even setting an environment variable to the full path of the setenv.cmd doesn't work, and when I define %mssdk% as the sdk dir, then call %mssdk%\bin\SetEnv doesn't work as well. I also tried to define %mssdk%, then cd %mssdk%, then calling bin\SetEnv. Also compilers not found in all these cases. It also doesn't work if I manually cd to the root or bin dir on a command line and then call SetEnv.cmd...
The start menu link works fine though.
For the record, my solution for now, as strange as this is, is the following:
I created a MSBuild file that creates the solution file with CMake on the command line, then invokes the created solution with a MSBuild task. The MSBuild file can be easily built from TeamCity, though I needed some additional tricks to satisfy CMake's stupid looking for the compiler, though I won't invoke it thing. Not really satisfying, but it works.
My solution (sets %WindowsSdkPath%, so that SetEnv.cmd could be found under %WindowsSdkPath%Bin\):
#ECHO OFF
IF "%WindowsSdkVersion%"=="" (
CALL :SetWindowsSdkVersionHelper HKCU > nul 2>&1
IF ERRORLEVEL 1 CALL :SetWindowsSdkVersionHelper HKLM > nul 2>&1
IF ERRORLEVEL 1 GOTO ERROR_NOWSDK
)
CALL :SetWindowsSdkPathHelper > nul 2>&1
IF ERRORLEVEL 1 GOTO ERROR_NOWSDK
GOTO END
:SetWindowsSdkPathHelper
SET WindowsSdkPath=
FOR /F "tokens=1,2*" %%i in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\%WindowsSdkVersion%" /V InstallationFolder') DO (
IF "%%i"=="InstallationFolder" (
SET "WindowsSdkPath=%%k"
)
)
IF "%WindowsSdkPath%"=="" EXIT /B 1
EXIT /B 0
:SetWindowsSdkVersion
CALL :GetWindowsSdkVersionHelper HKCU > nul 2>&1
IF ERRORLEVEL 1 CALL :GetWindowsSdkVersionHelper HKLM > nul 2>&1
IF ERRORLEVEL 1 EXIT /B 1
EXIT /B 0
:SetWindowsSdkVersionHelper
SET WindowsSdkVersion=
FOR /F "tokens=1,2*" %%i in ('REG QUERY "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows" /V "CurrentVersion"') DO (
IF "%%i"=="CurrentVersion" (
SET "WindowsSdkVersion=%%k"
)
)
IF "%WindowsSdkVersion%"=="" EXIT /B 1
EXIT /B 0
:ERROR_NOWSDK
ECHO The Windows SDK %WindowsSdkVersion% could not be found.
EXIT /B 1
:END
I was inspired for this by the SetEnv.cmd itself...
Mac, nice answer!
Now I would like to run msbuild with my project file. But before I should run SetEnv.Cmd - right?
So, here we go:
run_Macs_code.bat REM see above
call "%WindowsSdkPath%\bin\Setenv.cmd" /Release /x86 /xp
cd E:\client
msbuild client.proj
Now it's working :)