Including this library in your project: Difference between revisions
From Medusa: Coordinate Free Meshless Method implementation
More actions
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
<syntaxhighlight lang="cmake"> | <syntaxhighlight lang="cmake"> | ||
project(your_project_name) | project(your_project_name) | ||
# add our library as a subfolder | # add our library's CMakeLists.txt as a subfolder | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/path/to/our/root/folder/ | add_subdirectory(${CMAKE_SOURCE_DIR}/path/to/our/root/folder/ medusa) | ||
include_directories(${CMAKE_SOURCE_DIR}/medusa/include/) # include medusa headers directory | |||
include_directories(${CMAKE_SOURCE_DIR}/ | |||
# | |||
# define your own executables below | # define your own executables below | ||
add_executable(my_name my_name.cpp) | add_executable(my_name my_name.cpp) | ||
target_link_libraries(my_name | target_link_libraries(my_name medusa) # link to our library | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 23:50, 31 May 2018
Integration with our library is very simple if you are using cmake.
Your basic CMakeLists.txt file should look something like this:
project(your_project_name)
# add our library's CMakeLists.txt as a subfolder
add_subdirectory(${CMAKE_SOURCE_DIR}/path/to/our/root/folder/ medusa)
include_directories(${CMAKE_SOURCE_DIR}/medusa/include/) # include medusa headers directory
# define your own executables below
add_executable(my_name my_name.cpp)
target_link_libraries(my_name medusa) # link to our library