For Macos, I'd like to link to some framework. In windows, I would like to link to some library.
For example, OpenGL Framework, how to express this requirement using cmake?
For Macos, I'd like to link to some framework. In windows, I would like to link to some library.
For example, OpenGL Framework, how to express this requirement using cmake?
You could try the following code:
You could try the following macro code:
Example
You can find this example code here
To tell CMake that you want to link to OpenGL, add the following to your
CMakeLists.txt
:find_package
will look for OpenGL and tell the rest of the script where OpenGL is by setting some OPENGL* variables.include_directories
tells your compiler where to find OpenGL headers.target_link_libraries
instructs CMake to link in OpenGL.The following code will do different actions based on the operating system: