No such file or directory -- Building an RPM with CPACK using custom spec file - cmake

I'm trying to build an RPM with CPACK using my own .spec file. In following the tutorial from here.
I'm getting an error when building the RPM:
No such file or directory
It has to do with the Source0 line in the .spec file
I've got this in my CMakeLists.txt file:
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/my_project.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/my_project.spec" #ONLY IMMEDIATE)
SET(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/my_project.spec")
SET(CPACK_PACKAGE_RELEASE 2)
INCLUDE(CPack)
This works and generates a .spec file. In my .spec.in file, it's got:
Buildroot: #CMAKE_CURRENT_BINARY_DIR#/_CPack_Packages/Linux/RPM/#CPACK_PACKAGE_FILE_NAME#
Name: #CPACK_PACKAGE_NAME#
Version: #CPACK_PACKAGE_VERSION#
Release: #CPACK_PACKAGE_RELEASE#%{dist}
Summary: Blah blah
Vendor: #CPACK_PACKAGE_VENDOR#
License: MIT
Source0: https://github.com/me/%{name}/archive/%{version}.tar.gz
BuildRequires: gcc, make, cmake
BuildRequires: doxygen, graphviz, doxygen-latex
%description
<SNIPPED>
Then I get rhe error
CPackRPM:Debug: *** error: File /home/me/projects/my_project/build/_CPack_Packages/Linux/RPM/SOURCES/1.0.0.0.tar.gz: No such file or directory
That error is due to the Source0 line I imagine.
If I do this instead, I get a little different error:
CPackRPM:Debug: *** error: File /home/me/projects/my_project/build/_CPack_Packages/Linux/RPM/SOURCES/my_project: No such file or directory
And somewhat related, this doesn't seem to generate an SRPM either. I need one of those to submit to Fedora for inclusion in package db.

Related

Errors during installing Geant4 in CentOS7

I'm trying to install Geant4 (version is 4.10.07.p01) and I got error refering to expat library priorities. I find a similar problem here Geant4 does not find Expat library and I followed the advice given. Since it's the first time I get into non-Windows OS, it is hard for me to understand some things. I changed the value to OFF but now I get the errors:
CMake Error at analysis/g4tools/CMakeLists.txt:36 (install):
install FILES given no DESTINATION
#but there is no CMakeLists.txt file in analysis/g4tools
CMake Error at analysis/CMakeLists.txt:36 (include):
include could not find load file:
Geant4MacroLibraryTargets
#but there is no CMakeLists.txt file in analysis
CMake Error at analysis/CMakeLists.txt:51 (GEANT_GLOBAL_LIBRARY_TARGET):
Unknown CMake command "GEANT4_GLOBAL_LIBRARY_TARGET"
#but there is no CMakeLists.txt file in analysis
Any help is welcome

meson.build: ERROR: File does not exist, while in reality it does

From a trivial meson.build file, I get the following error:
meson.build:27:0: ERROR: File dataStructures.hpp does not exist.
dataStructures.hpp,
The meson.build file is:
headers += [
'dataStructures.hpp',
'interface.hpp',
'platform.hpp',
'progArgs.hpp',
]
The file reported as missing is present and it is in the same directory the meson.build file is.
If I remove the 'dataStructures.hpp' string from the list, I get the same error for the second file 'interface.hpp'.
What am I doing wrong?
More details follow.
> CC=clang CXX=clang++ meson /dev/shm/test-build
The Meson build system
Version: 0.52.0
Source dir: /home/pietrom/myProgs/test
Build dir: /dev/shm/test-build
Build type: native build
Project name: test
Project version: 0.0.1
C++ compiler for the host machine: clang++ (clang 8.0.1 "clang version 8.0.1 (tags/RELEASE_801/final)")
C++ linker for the host machine: GNU ld.bfd 2.32
Host machine cpu family: x86_64
Host machine cpu: x86_64
src/meson.build:27:0: ERROR: File dataStructures.hpp does not exist.
A full log can be found at /dev/shm/test-build/meson-logs/meson-log.txt
In the full log there is no much more than what already reported.
This is the project directory structure:
test/
meson.build
src/
meson.build
sources
config/
meson.build
sources
testers/
meson.build
sources
utilities/
meson.build
sources
As you don't provide all meson.build file contents, and most importantly the place where it happens - meson.build:27:0: ERROR: File dataStructures.hpp does not exist. - points at line 27 in some meson.build file, I'll try to make a guess that you build executable in root meson.build file, i.e. in test/meson.build however your headers are inside test/src. If that's the case, you don't need to have this array of headers at all, just add
inc = include_directories('./src')
some_test_exe = executable('mytest',
test_sources,
...
include_directories : inc
)
include_directories function creates include object with path relative to your source root.

Why does the CMake command show "The source directory "/home/shubham" does not appear to contain CMakeLists.txt."?

I am installing libfreenect2 on Linux.
I am following the steps given in https://github.com/OpenKinect/libfreenect2.
Command
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2"
gives me an error:
"CMake Error: The source directory "/home/shubham" does not appear to contain CMakeLists.txt.
When I searched for "CMakeLists.txt" file, it is in the libfreenect2 folder.

cmake build and INCLUDE_PATH

I am trying to build a project through a cmake generated make, where one necessary header file is /usr/local/include/poppler/poppler-config.h. However
export INCLUDE_PATH=/usr/local/include/poppler/
nor
export INCLUDE_PATH=/usr/local/include/ help, and I still get:
fatal error: poppler-config.h: No such file or directory.
What could I be missing?
I already have a pkg-config file for this dependency, which looks okay:
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: poppler
Description: PDF rendering library
Version: 0.33.0
Libs: -L${libdir} -lpoppler
Cflags: -I${includedir}/poppler
But adding it to a PKG_CONFIG_PATH environment variable doesn't help either.
Is there some cmake cache to reset for this? what should be an elegant solution?

How do I set up wxWidgets for Windows and CodeLite?

I'm trying out a new setup. I'm on a 32-bit Windows 8 Pro laptop. I've downloaded MinGW-builds' GCC 4.8.1. I used it to compile LLVM & CLang (3.4+ from a SVN copy of the trunk). Both of those are in my PATH.
I've downloaded CodeLite 5.2, which came with a copy of MinGW/GCC 4.7.1. I got the pure console tutorial example working, but I can't get the wxWidgets example working. (It's the Quick Start.) I downloaded & installed wxWidgets. (Always a good first step.) I built it with MinGW-4.8.1. I've read the error notes and added two (first local, now system) environment variables: WXWIN at "C:\wxWidgets-2.9.5" and WXCFG at "..\build\msw\gcc_mswud". (I initially thought WXCFG would be an absolute path, but it's based off of "%WXWIN%\lib\".) I moved my MinGW and LLVM builds out of "C:\Program Files" to "C:\" to avoid having a space in their paths.
Here's the (still) error output when I build with F7:
C:\WINDOWS\system32\cmd.exe /c "mingw32-make.exe -j 2 -e -f Makefile"
"----------Building project:[ Test1_2 - Debug ]----------"
Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll\mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll\mswud)
to specify which configuration exactly you want to use.
Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll\mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll\mswud)
to specify which configuration exactly you want to use.
Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll\mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll\mswud)
to specify which configuration exactly you want to use.
Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll\mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll\mswud)
to specify which configuration exactly you want to use.
mingw32-make.exe[1]: Entering directory `C:/Users/Daryle/Documents/CodeLite/Test1/Test1_2'
g++: error: wx-config: No such file or directory
g++: error: Error:: Invalid argument
g++: error: No: No such file or directory
g++: error: valid: No such file or directory
g++: error: setup.h: No such file or directory
g++: error: of: No such file or directory
g++: error: wxWidgets: No such file or directory
g++: error: has: No such file or directory
g++: error: been: No such file or directory
g++: error: found: No such file or directory
g++: error: at: No such file or directory
g++: error: location:: Invalid argument
g++: error: C:\wxWidgets-2.9.5\lib\..\build\msw\gcc_mswud\wx\setup.h: No such file or directory
g++: error: wx-config: No such file or directory
g++: error: Error:: Invalid argument
g++: error: No: No such file or directory
g++: error: valid: No such file or directory
g++: error: setup.h: No such file or directory
g++: error: of: No such file or directory
g++: error: wxWidgets: No such file or directory
g++: error: has: No such file or directory
g++: error: been: No such file or directory
g++: error: found: No such file or directory
g++: error: at: No such file or directory
g++: error: location:: Invalid argument
g++: error: C:\wxWidgets-2.9.5\lib\..\build\msw\gcc_mswud\wx\setup.h: No such file or directory
mingw32-make.exe[1]: *** [Debug/test1_2_frame.o.d] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
mingw32-make.exe[1]: *** [Debug/test1_2_app.o.d] Error 1
Test1_2.mk:102: recipe for target `Debug/test1_2_frame.o.d' failed
Test1_2.mk:94: recipe for target `Debug/test1_2_app.o.d' failed
mingw32-make.exe[1]: Leaving directory `C:/Users/Daryle/Documents/CodeLite/Test1/Test1_2'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target `All' failed
0 errors, 0 warnings
At some point, a compiler step spewed out an error message and the next step interpreted it as actual parameters! (Should have sent the error on stderr instead of stdout?)
Update
After moving on to my actual work, I got errors and noticed that CodeLite is still using the MinGW 4.7.1 that came with the CodeLite download instead of using the 4.8.1 I downloaded. I probably messed things up by changing the search directories to my 4.8.1. I think I'm going to erase everything and start over....
wx-config.exe tool for Windows uses 2 environment variables:
WXCFG and WXWIN
You need to provide them so wx-config.exe will be able to locate wx-config files.
The recommended way is to set them within the IDE and not system wide.
To do this, from within the main menu, go to:
Settings -> Environment Variables
and add 2 entries:
WXWIN=\Path\to\wxWidgets\Folder
WXCFG=gcc_dll\mswu
Also, you mentioned that codelite is using GCC4.7.1 and not your 4.8.1. You should know that when working with GCC on Windows you should have all your components built with the same GCC version. so make sure that you don't use wxWidgets that we (codelite team) provide
since it was built with GCC4.7.1 or you might get some weird crashes.
To force codelite to use another GCC, simply alter the PATH from within codelite:
Settings -> Environment variables
PATH=\Path\To\MinGW-4.8.1\bin;$PATH
Eran
The error message seems to indicate that WXCFG environment variable is not set, did you relaunch the IDE after setting it? Remember that editing environment variables doesn't change them for the already running processes.