This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

(missing: POWERSHELL_EXECUTABLE) in cmake

0

Hi, i don't understand why and how but without any reasons my wireshark solution for creating a new heuristic dissector fails building. Build error is Error 1 error MSB6006: "cmd.exe" exited with code 9009. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 170 5 copy_data_files

Cmake is a bit weird because it says:

Generating build using CMake 3.5.2 -- Could NOT find POWERSHELL (missing: POWERSHELL_EXECUTABLE) . . . . -- The following REQUIRED packages have not been found:

  • PowerShell

-- Configuring done -- Generating done -- Build files have been written to: C:/Development/wsbuild64

I'm tilting. Suggestions? Thanks in advance

asked 22 Jun '16, 08:17

kenhero's gravatar image

kenhero
6568
accept rate: 0%

What version of Windows ate you building on?

(22 Jun '16, 08:52) Anders ♦

the version is windows 8

(22 Jun '16, 08:59) kenhero

Could it be an environment issue?

(22 Jun '16, 09:00) kenhero

The Output of VS2013 is :

"POWERSHELL_COMMAND-NOTFOUND" non è riconosciuto come comando interno o esterno,un programma eseguibile o un file batch. (italian language)

(22 Jun '16, 09:02) kenhero

What happens if you type 'powershell' in a standard Windows command line? Do you get power shell prompt?

If yes, what's the output of the '$PSVersionTable' command?

If no, do you have in your PATH environment variable "C:/Windows/System32/WindowsPowerShell/v1.0/"? Does this folder even exist on your machine?

(23 Jun '16, 01:54) Pascal Quantin

omg i try to compile my wireshark dissector on my home pc and i still have powershell issue. is it normal this?

alt text

-- Generating build using CMake 3.5.2
-- Could NOT find POWERSHELL (missing:  POWERSHELL_EXECUTABLE) 
-- Building for win64 using Visual Studio 12 2013 Win64
-- No custom file found in C:/development2/wireshark
-- Configuration types: Debug;Release;MinSizeRel;RelWithDebInfo
-- CMAKE_C_FLAGS_RELWITHDEBINFO: /MD /Zi /O2 /Ob1 /D NDEBUG
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: /MD /Zi /O2 /Ob1 /D NDEBUG
-- V: 2.1.1-git, MaV: 2, MiV: 1, PL: 1, EV: -git.
-- Checking for c-compiler flag: /MP
-- Checking for c-compiler flag: /Zo
-- Checking for c-compiler flag: /w34295 /w34189
-- Checking for c++-compiler flag: /MP
-- Checking for c++-compiler flag: /Zo
-- Checking for c++-compiler flag: /w34295 /w34189
-- Packagelist: AIRPCAP;CAP;CARES;GCRYPT;GEOIP;GLIB2;GMODULE2;GNUTLS;GTHREAD2;GTK2;Gettext;Git;KERBEROS;LEX;LIBSSH;LUA;M;PCAP;POD;PORTAUDIO;Perl;PythonInterp;Qt5Core;Qt5LinguistTools;Qt5Multimedia;Qt5PrintSupport;Qt5Svg;Qt5Widgets;Qt5WinExtras;SBC;SED;SETCAP;SH;SMI;WINSPARKLE;YACC;YAPP;ZLIB
-- Could NOT find AIRPCAP (missing:  AIRPCAP_INCLUDE_DIR AIRPCAP_LIBRARY) 
-- AIRPCAP NOT FOUND
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
-- Checking for one of the modules 'libcap'
-- Could NOT find CAP (missing:  CAP_LIBRARY CAP_INCLUDE_DIR) 
-- CAP NOT FOUND
-- Could NOT find CARES (missing:  CARES_LIBRARY CARES_INCLUDE_DIR) 
-- CARES NOT FOUND
-- Could NOT find GCRYPT (missing:  GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR) (Required is at least version "1.4.2")
-- GCRYPT NOT FOUND
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
-- Checking for one of the modules 'geoip'
-- Could NOT find GEOIP (missing:  GEOIP_LIBRARY GEOIP_INCLUDE_DIR) 
-- GEOIP NOT FOUND
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
-- Checking for one of the modules 'glib-2.0>=2.14.0'
-- Configuring incomplete, errors occurred!
(04 Jul '16, 07:17) kenhero

The instruction from @Pascal Quantin to type $PSversionTable was to be run in a PowerShell prompt.

It looks as though Powershell isn't installed\enabled on that system.

Note that PowerShell is installed and enabled by default in Windows >= Vista. Someone must have manually disabled it on your systems.

(04 Jul '16, 07:47) grahamb ♦

what should i do?

(04 Jul '16, 08:09) kenhero

alt text

it seems it's installed

(04 Jul '16, 08:11) kenhero

CMake expects Powershell.exe to be on your path, usually with something such as C:\WINDOWS\System32\WindowsPowerShell\v1.0\. Is it on your path?

(04 Jul '16, 09:42) grahamb ♦

yes! Is it possible a wrong git installation?

(04 Jul '16, 09:54) kenhero

i found this on cmakecache.txt

//Command suitable for running PowerShell scripts. POWERSHELL_COMMAND:STRING=POWERSHELL_COMMAND-NOTFOUND

//PowerShell command POWERSHELL_EXECUTABLE:FILEPATH=POWERSHELL_EXECUTABLE-NOTFOUND

(04 Jul '16, 10:03) kenhero

Unlikely to be git. In your build directory, in the file CMakeCache.txt, what is recorded for the lines beginning with:

POWERSHELL_COMMAND:STRING=
POWERSHELL_EXECUTABLE:FILEPATH=
(04 Jul '16, 10:04) grahamb ♦

i solved ,error was on cmakechache.txt but i don't understand why

(04 Jul '16, 10:54) kenhero

What was the error?

(04 Jul '16, 11:23) grahamb ♦

In cmakecache.txt i have replaced

//Command suitable for running PowerShell scripts. POWERSHELL_COMMAND:STRING=POWERSHELL_COMMAND-NOTFOUND

//PowerShell command POWERSHELL_EXECUTABLE:FILEPATH=POWERSHELL_EXECUTABLE-NOTFOUND

with :

//Command suitable for running PowerShell scripts. POWERSHELL_COMMAND:STRING=C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe;-NoProfile;-NonInteractive;-executionpolicy;bypass;.

//PowerShell command POWERSHELL_EXECUTABLE:FILEPATH=C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe

found on my 32bit cmakecache.txt version . The point is :why there were POWERSHELL_COMMAND-NOTFOUND/POWERSHELL_EXECUTABLE-NOTFOUND ???

(04 Jul '16, 11:47) kenhero
1

The CMake module FindPowerShell.cmake (in the source tree in cmake\modules) locates PowerShell for the build. The module uses the standard CMake command find_program() looking for powershell.exe on the path. Yours is the first reported failure of this detection, so I think it's something local to your system.

(04 Jul '16, 11:59) grahamb ♦
showing 5 of 17 show 12 more comments

One Answer:

0

ok,i solved. I had obv in path environment var the correct path and the version was until 4 but i solved going on windows control panel -> program -> enable/disable windows functionality and activate windows power shell there. Btw cmake actually has no error,build has the same error but i can debug my dissector on vs2013. Really weird issue

answered 23 Jun '16, 02:54

kenhero's gravatar image

kenhero
6568
accept rate: 0%

edited 23 Jun '16, 02:55