Skip to content

Commit

Permalink
cache install prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Apr 22, 2024
1 parent b3b4e0b commit b3021f4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/lowtran/cmake/options.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
include(GNUInstallDirs)

# Rpath options necessary for shared library install to work correctly in user projects
set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)

# Necessary for shared library with Visual Studio / Windows oneAPI
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS true)

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# will not take effect without FORCE
# CMAKE_BINARY_DIR for use from FetchContent
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH "Install top-level directory" FORCE)
if(PROJECT_IS_TOP_LEVEL AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${PROJECT_BINARY_DIR}")
endif()

file(GENERATE OUTPUT .gitignore CONTENT "*")

0 comments on commit b3021f4

Please sign in to comment.