I have some projects in a specific folder that have no reference to the main project.
I'm trying to build all of them in the dockerfile like below:
RUN for p in $(find ./FolderName -name *.csproj); do dotnet build -o ../Distination $p; done
The thing I want to do is just stop the build whenever the first project build is failing!
Right now it is trying to build all projects!
Related
I cloned a git repository from github (a project called plumed) and in order to install it I used to execute the following commands from the terminal:
> ./configure --enable-debug
> make -j 4
> make install
After that checking that everything was ok I used to execute the command
> which plumed
> /usr/local/plumed
How can I do the same from Eclipse?
Building from eclipse looks like to execute the command "make all" that returns errors.
Here is what I do, hope it helps.
I make a build directory, cd into that and run configure from there. That will produce a Makefile in the build directory. Then I create a Makefile project in eclipse. Open the Makefile. Then, on the right hand side, in the Outline window you can select the make targets you want to use (all, clean, install, uninstall ...).
You can make several build directories for different configurations (build-debug, build-release etc...).
In fact I have a script for each build type that sets various build flags and calls configure with the relevant flags:
#!/bin/bash
top_dir=$(pwd)
PREFIX=${PREFIX:-$HOME/dev}
LIBDIR=$PREFIX/lib
WITH="$WITH --with-mysql=yes"
WITH="$WITH --with-speller=yes"
export PKG_CONFIG_PATH="$LIBDIR/pkgconfig"
export CXXFLAGS="-g3 -O0 -D DEBUG"
rm -fr $top_dir/build-debug
mkdir -p $top_dir/build-debug
cd $top_dir/build-debug
$top_dir/configure $WITH --prefix=$PREFIX
In eclipse I always make the --prefix point to install within the $HOME folders so you don't need root privilege to install everything.
I am working on a c++ project and I am using cmake as the build system, so my workflow here is make changes to code. then,
rm -r build
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make
Now I added glew as a dependency to the project, so whenever I try to run make I get an error saying SDL.h not found(this was working before).After sometime I decided to check CMakeCache.txt.opened it using vim then :wq that's all I did now if I run make, my project is building successfully, I am not sure why this is happening, Can anyone tell me why?
ps: added gif of this event, check it out to get a clear picture
(the code i am working on is linked as well, this exact issue is in this commit "dd4452b45c733e0612bc5f3c632e9d1a08be8072")
link to gif
link to code
variables in cmake are limited to the scope of the directory they are in plus their subdirectories.
This, calling find_module() in the gamelib subdirectory does not find that module for use in the main directory.
The preferred way to propagate include directory dependencies is to add them to the target (in the gamelib directory), like this:
target_include_directories(gamelib BEFORE PRIVATE
$<BUILD_INTERFACE:${SDL2_INCLUDE_DIR}>
$<BUILD_INTERFACE:${GLEW_INCLUDE_DIR}>
)
target_include_directories(gamelib SYSTEM BEFORE PUBLIC
$<BUILD_INTERFACE:${SDL2_INCLUDE_DIR}>
$<BUILD_INTERFACE:${GLEW_INCLUDE_DIR}>
)
then you don't need to even mention them in any executable that uses gamelib.
I am doing this Tutorial
http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation
But I got confused. I stopped at building the OpenCV from source.
I already created an File called Workspace where I made the cmake_binary_dir (named release). I downloaded the sourcefile (which is in my home directory and named: opencv-2.3.1), and now I want to run this
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
where I use:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/markus/opencv-2.3.1
But the Terminal keeps telling me, that this source directory does not exist!?
So what I am doing wrong?
CMAKE_INSTALL_PREFIX defines where to distribute the binary to after its compiled and linked, it defaults to good place (/usr/local/) so avoid defining it
You are leaving out the trailing .. in your cmake command which tells it where to get the source code hence the error message
Here are the typical steps when installing from source code any project which uses cmake
if you see a file :
CMakeLists.txt
in the src directory this indicates it wants you to use cmake
0 cd into dir where your expanded source code lives
1 mkdir build # make a build dir (initially empty)
2 cd build
3 cmake .. # NOTE those little .. which declares relative path to src dir
which says populate current dir (build) with compiled code
and get the source code and configs from parent directory (..)
4 examine the output, if it looks successful go to step 5
if it has errors you may need to install upstream dependent
libraries then try cmake again
5 make -j4 # compile source, -j speeds up by using multicore
6 sudo make install <-- only if above step 4 and 5 are OK
You can do everything cmake related from command line, yet its GUI can be quite handy especially with an unfamiliar project. In above instead of typing :
cmake ..
its GUI version is :
cmake-gui ..
in the GUI its easy to toggle on/off settings like to build examples or not ... the values column on the right is editable ... if you changed settings in the gui at bottom hit button Configure then when its done hit Generate to perform same as the normal cmake .. now return to step 4 above to do the compile
I am using gradle 1.4, and renamed a build.gradle to buildExpr.gradle and settings.gradle to settingExpr.gradle, both files are in the project root, and I am using following command to run gradle build.
'gradle C:\myProject>gradle -i -b buildExpr.gradle -c settingsExpr.gradle project'
it seems command line option '-c' is not being honored and gradle is not picking settingsExpr.gradle file, hence it is not able to display all modules defined in settings.gradle file while executing project task.
I am getting following log
-------------------------------------LOG----------------------------------------------------
C:\ASM\asm_workspace\asm71\AutoLab>gradle -i -c settingsExpr.gradle -b buildExpr.gradle project
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using build file 'C:\ASM\asm_workspace\asm71\AutoLab\buildExpr.gradle'.
Included projects: [root project 'AutoLab']
Evaluating root project 'AutoLab' using build file 'C:\ASM\asm_workspace\asm71\AutoLab\buildExpr.gradle'.
All projects evaluated.
Selected primary task 'projects'
Tasks to be executed: [task ':projects']
:projects
Root project
Root project 'AutoLab'
No sub-projects
it is very strange behavior by gradle command line shows. but if I change buildExpr.gradle to build.gradle and settingsExpr.gradle to settings.gradle, it executes normally and shows all sub-modules in log
-b and -c can't be used together. When using a settings file, everything else (e.g. the locations of build files) is determined from the settings file.
I just want to know what do I need to write in the Makefile.am to create a directory called build in the same directory where Makefile.am is.
Think about your question carefully: Do you really want to create build in the same directory as Makefile.am, or in the current working directory when configure is called? These are not always the same thing: the GNU build system is meant to support out-of-tree builds (with a potentially read-only $srcdir), so the end user should expect the following to work:
$ tar xf autofoo-1.2.tar.gz
$ mkdir autofoo-build
$ cd autofoo-build
$ ../autofoo-1.2/configure
$ make
$ sudo make install
Now, the easiest way I have found to create a directory is not to use Makefile.am at all, but instead to make config.status do it (which is the shell script that does all of the template substitutions at the end of configure, turning Makefile.in into Makefile, config.h.in into config.h and so on). In configure.ac, put the following:
AC_CONFIG_COMMANDS([mkdir], [$MKDIR_P build])
You would need to write:
build:
test -d ${srcdir}/build || mkdir ${srcdir}/build
but you really do not want to do that. The source directory should be considered read-only. If you simply want to create a directory named build in the build directory, just do
build:
test -d build || mkdir build