Merge pull request #2063 from HunterBelanger/fix_version_header_fetch_content

Fixes missing version.h when getting OpenMC through FetchContent
This commit is contained in:
Paul Romano 2022-05-10 07:15:08 -05:00 committed by GitHub
commit 1be02f90bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -394,7 +394,8 @@ target_include_directories(libopenmc
target_compile_options(libopenmc PRIVATE ${cxxflags})
# Add include directory for configured version file
target_include_directories(libopenmc PRIVATE ${CMAKE_BINARY_DIR}/include)
target_include_directories(libopenmc
PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
if (HDF5_IS_PARALLEL)
target_compile_definitions(libopenmc PRIVATE -DPHDF5)

View file

@ -1,3 +1,6 @@
#ifndef OPENMC_VERSION_H
#define OPENMC_VERSION_H
#include "openmc/array.h"
namespace openmc {
@ -12,3 +15,5 @@ constexpr std::array<int, 3> VERSION {VERSION_MAJOR, VERSION_MINOR, VERSION_RELE
// clang-format on
} // namespace openmc
#endif // OPENMC_VERSION_H