Is there anyway to set the VC++ Directories at project level in VS2008 as in VS2010? - visual-c++

In VS2010 the VC++ Directories editing in Tools > Options has been deprecated. VC++ Directories are now available as a user property sheet, which is very convenient to keep the include/lib directories depending on different projects. Is there any way to do the similar thing in VS2008?

After digging around, I figured out a way to partially do it: still with the property sheet.
we can create a new property sheet and set following items:
C/C++->additional include directories
linker->additional lib directories
linker->additional dependencies
...
This will do most of the VC++ directories.
However, the executable directories is still missing. There are two parts need to be done.
the executable path while building, this can be set via add user macros:PATH (for example: c:\sss;%PATH%), then check the box on the bottom to expose this variable to the building environment.
However, while debugging the DLL directories may still missing. We can then set this in project properties->debugging->environment:PATH=%DLLPATH%;%PATH% which will allow the debugger add the DLLPATH to the environment PATH.

Related

Set up CMakeLists to not change the include statements from TFS project in Android Studio

From a previous question a new one have arisen. I want to include 2 native TFS project libraries stored in two different folders, dependant from each other in my Android Studio project (stored in another folder). If i not specify "../my_lib_path/libFile.h" instead of simply the "libFile.h" i get the error the file is not found. But i dont want to change all includes since it is a TFS project and there are lots of file contained in the libraries!
Your help is highly appreciated!
Add the given directories to those the compiler uses to search for include files. Relative paths are interpreted as relative to the current source directory. So you have to specify "../my_lib_path/libFile.h", that means you need to change all includes, otherwise it will not work.
#Andy Li-MSFT is absolutely right! Though what worked for me in a similar project now was to set a different relative CMakeLists.txt path in the app .gradle file outside the specific Android Studio Project directory:
externalNativeBuild {
cmake {
path "../../whatever_path/my_C_files/CMakeLists.txt"
}
}
After that i was able to compile my C sources flawlessly without changing the include paths of the C project!

Setting Visual C++ Executable Directories (PATH env variable) for a project in CMake

On the project property pages there is a VC++ Directories tab, on that tab there is an "Executable Directories" option which is basically there to set the PATH variable when building the project.
I need to add the path to a Python interpreter there, which I know about and can infer beforehand by means of the ${CMAKE_SOURCE_DIR} variable.
Is there currently way to set it in CMakeLists.txt?
Thanks.
Now 4 years later with CMake 3.12 you can finally do this by overriding variables:
CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES
As a matter of fact, you can modify all of those entries you see in the VC++ Directories tab: CMAKE_VS_SDK_EXCLUDE_DIRECTORIES CMAKE_VS_SDK_INCLUDE_DIRECTORIES CMAKE_VS_SDK_LIBRARY_DIRECTORIES CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES CMAKE_VS_SDK_REFERENCE_DIRECTORIES CMAKE_VS_SDK_SOURCE_DIRECTORIES
However, be careful: this a write-only variable. The best thing you can do right now not to lose the directories that are there by default is this:
set( CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);WhateverElseYouNeed )

How do you specify include directory path in F#?

I am using F# in Visual Studio 2012 and this may seem like a dumb question but I cannot figure out how to specify include directories, specifically for binaries. I see how to do it for F# interactive using the #I directive and it works there, but the #I option is not available in the non-interactive form. The compiler error message says to use the -I compiler option. I have looked under Project Properties, where the only subsections visible are Application, Build, Build Events, Debug, and Reference Paths none of which provides any obivous way to specify an include directory path. The help system isnt much help as it seems to reference sections that are unavailable.
Well i still have the problem with VS12 but at least i have a workaround, by calling the compiler from the command line. You have to use the -r option to specify the location of the dll:
fsc -r:<complete path to dll> <fname>
However when i try the corresponding step in VS (by trying to set one of the Reference Paths) it says there are no items found in the DLL folder. So perhaps someone familiar with CS can help out

Adding CORE PLOT HEADER to the XCODE PROJECT

I can't seem to make Xcode find the Core Plot header. I've done the following:
Clone the hg repo;
Drag the CorePlot-CocoaTouch.xcodeproj file into my project;
Opened the CP project and compiled it successfully;
Dragged the lib file into the target's static link list;
Added CorePlot-CocoaTouch as a direct dependency for the target.
But I'm still getting the "CorePlot-CocoaTouch.h: No such file or directory" error on compile. I've been googling around trying to find an answer, but only seem to find a few people having the same problem but no clear solution. What have I missed?
Please help me getting out of it.....
Thanks
Make sure your header search paths contain a reference to the core-plot source directory.
In your targets Build Settings set Header Search Paths to the core-plot/framework directory. For example when your core-plot directory is placed next to your project directoy the search path would contain a value of ../core-plot/framework/** (I'm using a recursive reference here, thus the ** at the end).
Do not miss :-
1-Do not forget to add the library to Target dependance under the "Targets" source list that appears. Click on the "Build Phases" tab and expand the "Target Dependencies" group. Click on the plus button, select the CorePlot-CocoaTouch library, and click Add. This should ensure that the Core Plot library will be built with your application.
2- Core Plot is built as a static library for iPhone, so you'll need to drag the libCorePlot-CocoaTouch.a static library from under the CorePlot-CocoaTouch.xcodeproj group to the "Link Binaries With Libraries" group within the application target's "Build Phases" group you were just in.
3 Under your Build settings, set the Header Search Paths to the relative path from your application to the framework/ subdirectory within the Core Plot source tree. Make sure to make this header search path recursive. You need to add -ObjC to Other Linker Flags as well (as of Xcode 4.2, -all_load does not seem to be needed, but it may be required for older Xcode versions). -Header Search Paths : you must put the relative path for libCorePlot-CocoaTouch.a and it is too much important to check the recursive check-box.
Finally the following link may can help you...
http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications
maybe this blog might help more than the google source page of CorePlot.
For newbies it might be helpful to use the mac shell to get the relative path of the libCorePlot-CocoaTouch.a. Just open the Terminal and insert following line:
mdfind -name libCorePlot-CocoaTouch.a
you will get listed all paths that contain the file named "libCorePlot-CocoaTouch.a"

Organizing a CMake project so that sources can be easily browsed in Visual C++

(I'm new to CMake and I am not so familiar with Visual Studio.)
I need to implement a relatively big library the solution/project files will be generated by CMake, and my problem is that I would like the organization of the files in VC GUI to reflect the directory structure on the disk.
Basically, the library is split into different parts. For instance one of them is called "common" and will implement some headers used by the library. On the disk it will be in a specific "common" directory, which may have one or more subdirectory.
src/
common/
...
portfolio/
...
asset/
contracts/
physical_assets/
...
mathutils/
...
I'd like to have the see the same thing within Visual Studio's Solution Explorer,
but I only know how to split the solution into different projects.
How can I do that?
You can do that using SOURCE_GROUP, the CMake FAQ covers that.
I don't think you can. If you use "Show All Files" you will get what you want, but only at the project level. Creating a VS project at the root may give you the possiblity of viewing all your files, but you will still need separate projects for each exe/dll/etc. you want to build. Remember that a solution in VS terms is a set of projects, not a directory tree.
Not sure if this is what you're after, but: first make sure you have "Tools->Options->Projects and Solutions->Solution Explorer Mode" set to "Show All Files". Then if you create a VS project in the root source directory (probably the same as where your CMakeLists.txt goes), VS will show all files in that directory and all it's subirectories.

Resources