Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 External libraries in "Open Folder" cmake project
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mfleisz
New Member

3 Posts

Posted - Feb 19 2019 :  05:14:39 AM  Show Profile  Reply with Quote
Hi!

I have a small project that uses OpenSSL. The cmake file looks like this:


find_package(OpenSSL REQUIRED)
add_executable(test test.cpp)
target_link_libraries(test OpenSSL::Crypto)


The problem I have is that VA does not show any auto-completion/type information for any of the OpenSSL functions/types. When I check C/C++ Directories in the VA options dialog there is no reference to the OpenSSL includes there so I guess this is the problem.

Is this currently not supported or is there any other way to tell VA where to look for the OpenSSL includes?

Thanks, Martin

feline
Whole Tomato Software

United Kingdom
16105 Posts

Posted - Feb 19 2019 :  06:14:59 AM  Show Profile  Reply with Quote
What are you opening in the IDE? Are you opening a solution? A folder? The cmake file somehow?

Cmake can be told to generate a visual studio solution, which you can then open directly in the IDE:

https://stackoverflow.com/questions/395169/using-cmake-to-generate-visual-studio-c-project-files?rq=1

I am hoping that the solution that CMake would generate would have the include directory paths for OpenSSL already in it, so that VA can pick these up.

Otherwise, yes, it sounds like VA is not aware of the location of the OpenSSL library.

zen is the art of being at one with the two'ness
Go to Top of Page

mfleisz
New Member

3 Posts

Posted - Feb 19 2019 :  06:54:32 AM  Show Profile  Reply with Quote
I'm using "Open Folder" in the IDE and I'd rather don't want to use a cmake generated solution.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16105 Posts

Posted - Feb 19 2019 :  12:28:42 PM  Show Profile  Reply with Quote
One approach would be to tell VA in its options dialog to use a custom list of include path's, and add the OpenSSL directory list to this list of path's, but this would effect all of your solutions.

Are you aware that the IDE supports a "CppProperties.json" file when you are opening a folder? This page explains about it:

https://docs.microsoft.com/en-us/cpp/ide/non-msbuild-projects?view=vs-2017

I have set up a simple test case here, and ended up with the "CppProperties.json" file:

{
  "configurations": [
    {
      "name": "Windows x64",
      "includePath": [
			"..\\library_files\\library_child1",
			"..\\library_files\\library_child1"
		]
    }
  ]
}

VA is picking up and parsing this file, since when I then have a #include line to a header inside one of these library directories, VA knows where to find the file, and is parsing it.

So long as the location of your OpenSSL library does not change to often, you can set up this file and just forget about it most of the time. Without needing to create a Visual Studio solution, you can use this JSON file to tell the IDE about the specific settings that it does need to know about.

zen is the art of being at one with the two'ness
Go to Top of Page

mfleisz
New Member

3 Posts

Posted - Feb 20 2019 :  01:45:47 AM  Show Profile  Reply with Quote
That was exactly what I was looking for! Thanks! :-)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16105 Posts

Posted - Feb 20 2019 :  11:30:52 AM  Show Profile  Reply with Quote
Thank you for the update, I hope that this is working very smoothly for you

If you want or need you can set additional information in this file as well, but I just focused on the include directories.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000