How to use the configure command within Xcode? - xcode

I'm trying to customize the compilation of curl-7.60.0 with Xcode.
I added it as an External Build System target. There is no problem if I build it as is, but I would like to change the --prefix option from the ./configure command.
Need some help here please

For my case, I just ran the ./configure on the command prompt to generate the Makefile then go back to Xcode to build

Related

ERROR: Current directory is not a meson build directory

I have been trying to install gtk4 on Windows 10, following the instructions from this site: https://www.collabora.com/news-and-blog/blog/2021/03/18/build-and-run-gtk-4-applications-with-visual-studio/.
After setting up the meson build with the command:
C:\src\gtk>meson setup build --prefix C:/gnome
it shows the build directory at the very beginning of the build system
(see picture).
I tried to compile the meson build with the following instruction:
C:\src\gtk>meson compile -C build
However, I get this error note:
ERROR: Current directory is not a meson build directory: C:\src\gtk\build.
Please specify a valid build dir or change the working directory to it.
It is also possible that the build directory was generated with an old
meson version. Please regenerate it in this case.
Is there a way to fix this problem?
Thanks in advance!
I ran into a similar issue with pulseaudio.
Here running simply
meson build
creates the correct build directory. It was complaining about lots of missing libraries for developers (libsndfile-dev and so on) but after installing it, I was able to compile with
meson compile -C build
So did you check, that you work with the correct meson version of your tutorial link? Is the build directory correctly build? Does it even exist, are there any warnings left, when conifguring it?

CLion build process does not start make install [duplicate]

I'm evaluating CLion 1.2.1 on an existing project which is already using CMake. The project is made up of a few library modules and a single executable.
I have an install target which I use to collect the executable and a configuration file together in a bin folder for debugging:
...
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_BINARY_DIR}/bin/)
install(FILES config.xml DESTINATION ${CMAKE_BINARY_DIR}/bin/)
When building on the command line I'd just run:
make install
which as expected builds the binaries and if successful then runs the above install commands.
My problem is that I can't get CLion to run the 'install' target. I expected to be able to create a new Run/Debug configuration but the Target: dropdown only contains those targets added using add_executable() and add_library().
I also tried adding 'install' to the Build options in the Settings dialog. That however runs install for every target now including 'clean' which is not right.
UPDATE: As of 2018.1 EAP, build 181.3741.16, CLion supports running cmake install if your project defines install targets:
(source: cloudfront.net)
Original Answer:
I don't think that CLion implements this feature yet. However, you can work around this limitation by adding a CMake "custom target" (using add_custom_target()) that will execute the make install command:
add_custom_target(install_${PROJECT_NAME}
$(MAKE) install
DEPENDS ${PROJECT_NAME}
COMMENT "Installing ${PROJECT_NAME}")
Now, all you have to do is "build" the install_YOUR_PROJECT_NAME target from the "targets" menu in CLion.
Update:
A more cross-platform technique might be the following:
add_custom_target(install_${PROJECT_NAME}
"${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target install
DEPENDS ${PROJECT_NAME}
COMMENT "Installing ${PROJECT_NAME}")
#maddouri 's comment already addresses your question. Alternatively, Under Settings -> Build, Execution, Deployment -> CMake, you can also set Build Option for Debug or Release build type to something like -j 2 install. With this setting, whenever CLion builds the code, it will install your targets, too!

Configuring Xcode project to be built with specific build tools version

In my build system, I am using xcodebuild to build multiple projects.
I want to configure different Xcode installation to be used per project.
I know about sudo xcode-select --switch <path>, but:
This option is system-wide, and might mess up with other parallel
builds.
It requires root, which I prefer to avoid (since it's an automatic build system).
It is not configured internally in the project.
Is there a way to specify the build tools path to use per project?
From the output of xcrun:
The active developer directory can be set using xcode-select, or via the DEVELOPER_DIR environment variable. See the xcrun and xcode-select manual
pages for more information.
E.g. to run xcodebuild with a specific Xcode-installation:
$ DEVELOPER_DIR=/path/to/my/Xcode.app/Contents/Developer xcodebuild
In a bash script:
export DEVELOPER_DIR=/path/to/my/Xcode.app/Contents/Developer
xcodebuild
You can probably launch xcodebuild directly from Applications/Xcode.app/Contents/Developer/usr/bin, so modifying the path you will use different Xcode version.

How to pass MonoDevelop build configuration to Makefile?

MonoDevelop supports Makefile integration.
But how do I know current build configuration (Debug/Release) from inside of Makefile?
Yes you can you need to go to your project, right click OPTIONS under BUILD choose CUSTOM COMMANDS and then add a Build command "make"
You can do the same for a "make clean"
Apparently, you can't do that. Um, okay.

Cmake: How to hold off finding libraries?

I have a Cmake project where I use static libraries from another project (which uses its own unique build system).
I have a bash script set up which compiles the libraries.
The problem arises when a new user checkouts both project. The new user cannot do cmake until the libaries are properly compiled in the other project, and the cmake command find_libarary cant find them.
I made the bash script part of cmake by using the command add_custom_target. But the issue is that it only execute if you do a "make".
Is there a way I can make CMake execute a command while its generating a build system. Or a better way would be to have it ignore the find command until the actual make?
Thanks
Why not LINK_DIRECTORIES(xxx) to the library folder and don't use find_library at all.
Sure, execute_process() function.

Resources