Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove caching cmake vars #1313

Merged
merged 5 commits into from
Sep 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 12 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,21 @@ endif()
#
# temporary build directories
if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
CACHE PATH "Build directory for archives")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
endif()
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
CACHE PATH "Build directory for libraries")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
endif()
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
CACHE PATH "Build directory for binaries")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()
# install directories
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
include(GNUInstallDirs)
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/openPMD"
CACHE PATH "CMake config package location for installed targets")
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/openPMD")
if(WIN32)
set(CMAKE_INSTALL_LIBDIR Lib
CACHE PATH "Object code libraries")
set_property(CACHE CMAKE_INSTALL_CMAKEDIR PROPERTY VALUE "cmake")
set(CMAKE_INSTALL_LIBDIR Lib)
set(CMAKE_INSTALL_CMAKEDIR "cmake")
endif()
endif()

Expand Down Expand Up @@ -98,8 +93,7 @@ option(openPMD_USE_VERIFY "Enable internal VERIFY (assert) macro independent of

set(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the build type, e.g. Release or Debug." FORCE)
set(CMAKE_BUILD_TYPE "Release")
endif()

include(CMakeDependentOption)
Expand Down Expand Up @@ -746,20 +740,16 @@ if(openPMD_HAVE_PYTHON)

if(WIN32)
set(CMAKE_INSTALL_PYTHONDIR_DEFAULT
"${CMAKE_INSTALL_LIBDIR}/site-packages"
)
"${CMAKE_INSTALL_LIBDIR}/site-packages")
else()
set(CMAKE_INSTALL_PYTHONDIR_DEFAULT
"${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages"
)
endif()
set(CMAKE_INSTALL_PYTHONDIR "${CMAKE_INSTALL_PYTHONDIR_DEFAULT}"
CACHE STRING "Location for installed python package"
)
set(CMAKE_PYTHON_OUTPUT_DIRECTORY
"${openPMD_BINARY_DIR}/${CMAKE_INSTALL_PYTHONDIR}"
CACHE PATH "Build directory for python modules"
)
# Location for installed python package
set(CMAKE_INSTALL_PYTHONDIR "${CMAKE_INSTALL_PYTHONDIR_DEFAULT}")
# Build directory for python modules
set(CMAKE_PYTHON_OUTPUT_DIRECTORY "${openPMD_BINARY_DIR}/${CMAKE_INSTALL_PYTHONDIR}")
set_target_properties(openPMD.py PROPERTIES
ARCHIVE_OUTPUT_NAME openpmd_api_cxx
LIBRARY_OUTPUT_NAME openpmd_api_cxx
Expand Down