diff --git a/cmake/git-version.cmake b/cmake/git-version.cmake index f79f5fc3e..1ca57b960 100644 --- a/cmake/git-version.cmake +++ b/cmake/git-version.cmake @@ -67,6 +67,6 @@ endif() message("Building ${PROJECT_NAME} ${${PROJECT_NAME}_VRSN_MAJOR}.${${PROJECT_NAME}_VRSN_MINOR}.${${PROJECT_NAME}_VRSN_PATCH}${${PROJECT_NAME}_VRSN_META}") configure_file( - "${PROJECT_SOURCE_DIR}/src/HPWH.in.hh" - "${PROJECT_BINARY_DIR}/src/HPWH.hh" + "${PROJECT_SOURCE_DIR}/src/HPWHversion.in.hh" + "${PROJECT_BINARY_DIR}/src/HPWHversion.hh" ) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3ad5a6295..b1de19e1a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ # Set HPWHsim Version add_custom_target(${PROJECT_NAME}_version_header - DEPENDS ${PROJECT_SOURCE_DIR}/src/HPWH.in.hh + DEPENDS ${PROJECT_SOURCE_DIR}/src/HPWHversion.in.hh COMMAND ${CMAKE_COMMAND} ARGS -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} @@ -10,10 +10,11 @@ add_custom_target(${PROJECT_NAME}_version_header ) set_target_properties(${PROJECT_NAME}_version_header PROPERTIES FOLDER Dependencies/HPWHsim) -include_directories("${PROJECT_BINARY_DIR}/src") +include_directories("${PROJECT_BINARY_DIR}/src" "${PROJECT_SOURCE_DIR}/src") set(headers - HPWH.in.hh + HPWHversion.in.hh + HPWH.hh ) set(source diff --git a/src/HPWH.in.hh b/src/HPWH.hh similarity index 99% rename from src/HPWH.in.hh rename to src/HPWH.hh index a13723c75..69898a8b0 100644 --- a/src/HPWH.in.hh +++ b/src/HPWH.hh @@ -20,10 +20,7 @@ namespace Btwxt { class RegularGridInterpolator; }; * excluded from compiling. This is done in order to reduce the size of the * final compiled code. */ -#define HPWHVRSN_MAJOR @HPWHsim_VRSN_MAJOR@ -#define HPWHVRSN_MINOR @HPWHsim_VRSN_MINOR@ -#define HPWHVRSN_PATCH @HPWHsim_VRSN_PATCH@ -#define HPWHVRSN_META "@HPWHsim_VRSN_META@" +#include "HPWHversion.hh" class HPWH { public: diff --git a/src/HPWHversion.in.hh b/src/HPWHversion.in.hh new file mode 100644 index 000000000..ab5bcbb46 --- /dev/null +++ b/src/HPWHversion.in.hh @@ -0,0 +1,21 @@ +#ifndef HPWHversion_hh +#define HPWHversion_hh + +#include +#include +#include +#include +#include +#include +#include + +#include +#include //for exit +#include + +#define HPWHVRSN_MAJOR @HPWHsim_VRSN_MAJOR@ +#define HPWHVRSN_MINOR @HPWHsim_VRSN_MINOR@ +#define HPWHVRSN_PATCH @HPWHsim_VRSN_PATCH@ +#define HPWHVRSN_META "@HPWHsim_VRSN_META@" + +#endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 523b56cf2..08be04451 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ # Build test tool -include_directories("${PROJECT_BINARY_DIR}/src") +include_directories("${PROJECT_SOURCE_DIR}/src" "${PROJECT_BINARY_DIR}/src") add_executable(testTool main.cc ) add_executable(testTankSizeFixed testTankSizeFixed.cc)