-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(uammd) | ||
# Install headers | ||
file(GLOB_RECURSE headers src/*) | ||
|
||
foreach(header ${headers}) | ||
get_filename_component(header_path ${header} PATH) | ||
file(RELATIVE_PATH header_path_rel ${CMAKE_CURRENT_SOURCE_DIR}/src ${header_path}) | ||
install(FILES ${header} DESTINATION include/uammd/${header_path_rel}) | ||
endforeach() | ||
|
||
# Install FindUAMMD.cmake | ||
install(FILES cmake/FindUAMMD.cmake DESTINATION share/cmake/Modules) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Looks for the uammd include folder in the system and sets the UAMMD_INCLUDE_DIRS variable. | ||
# Usage: | ||
# find_package(UAMMD REQUIRED) | ||
# include_directories(${UAMMD_INCLUDE_DIRS}) | ||
# The include folder can be in the following locations: | ||
# 1. In the system include folder: /usr/include/uammd | ||
# 2. In the user's home folder: ~/uammd/include/uammd | ||
# 3. In the conda environment: $ENV{CONDA_PREFIX}/include/uammd | ||
|
||
# First, look for the include folder in the system. | ||
find_path(UAMMD_INCLUDE_DIRS uammd.cuh HINTS /usr/include/uammd) | ||
|
||
# If the include folder is not found, look for it in the user's home folder. | ||
if(NOT UAMMD_INCLUDE_DIRS) | ||
find_path(UAMMD_INCLUDE_DIRS uammd.cuh HINTS $ENV{HOME}/uammd/include/uammd) | ||
endif() | ||
|
||
# If the include folder is not found, look for it in the conda environment. | ||
if(NOT UAMMD_INCLUDE_DIRS) | ||
find_path(UAMMD_INCLUDE_DIRS uammd.cuh HINTS $ENV{CONDA_PREFIX}/include/uammd) | ||
endif() | ||
|
||
# Add also the folder UAMMD_INCLUDE_DIRS/third_party to the include directories. | ||
if(UAMMD_INCLUDE_DIRS) | ||
set(UAMMD_INCLUDE_DIRS ${UAMMD_INCLUDE_DIRS} ${UAMMD_INCLUDE_DIRS}/third_party) | ||
endif() |