-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update top level CMake so UAMMD is not installed automatically when u…
…sing FetchContent
- Loading branch information
1 parent
3091718
commit e7dbc03
Showing
1 changed file
with
20 additions
and
12 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 |
---|---|---|
@@ -1,19 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(uammd) | ||
# Install headers | ||
file(GLOB_RECURSE headers src/*) | ||
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) | ||
set(UAMMD_MASTER_PROJECT ON) | ||
else() | ||
set(UAMMD_MASTER_PROJECT OFF) | ||
endif() | ||
if(UAMMD_MASTER_PROJECT) | ||
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() | ||
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) | ||
install(FILES | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindUAMMD.cmake" | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/UAMMD) | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/UAMMDSetup.cmake) | ||
install(FILES | ||
install(FILES | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/UAMMDSetup.cmake" | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/UAMMD | ||
) | ||
) | ||
endif() | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/UAMMDSetup.cmake) |