Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use C library GR on Windows via Visual Studio 2019? #127

Open
xiangong-code opened this issue Sep 4, 2020 · 1 comment
Open

Comments

@xiangong-code
Copy link

In the documentation on the GR Home Page, there is only the tutorial of how to compile and link C language source file on Linux or macOS. However, I want to use it on Windows10 via Visual Studio 2019. So what should I do to link my source file to the GR library?
Thanks.

@IngoMeyer441
Copy link
Member

IngoMeyer441 commented Sep 7, 2020

We don't have any developers who use Visual Studio on Windows, so I don't know any Visual Studio specific solution to this. But if you use CMake with Visual Studio and you compiled and installed GR with CMake as well, you can use our GRConfig.cmake file to include GR in your project. A simple CMakeLists.txt of your project could look like this:

cmake_minimum_required(VERSION 3.1...3.18)

project(GR_TEST LANGUAGES C)

list(APPEND CMAKE_PREFIX_PATH "<PATH-TO-GR-INSTALLATION>")
find_package(GR NO_MODULE)

add_executable(main main.c)
target_link_libraries(main PRIVATE GR::GR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants