From 9f4e90845efee274d9347137cf723e8a6080aef0 Mon Sep 17 00:00:00 2001 From: Cameron Smith Date: Tue, 5 Mar 2024 14:50:04 -0500 Subject: [PATCH] use apf_simConfig.h to access sim version Installing apf_simConfig.h as it is used in tests and could be helpful for others. I can't think of a good reason not to install it. --- apf_sim/CMakeLists.txt | 28 ++++++++++++++++------------ phasta/phAttrib.cc | 2 +- phasta/phMeshQuality.cc | 1 - test/generate.cc | 1 + test/rm_extrusion.cc | 2 +- test/simTranslate.cc | 3 +-- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/apf_sim/CMakeLists.txt b/apf_sim/CMakeLists.txt index 496fefed1..2f4fe5fdc 100644 --- a/apf_sim/CMakeLists.txt +++ b/apf_sim/CMakeLists.txt @@ -7,6 +7,20 @@ if(NOT ENABLE_SIMMETRIX) return() endif() +option(ENABLE_FIELDSIM "Enable use of FieldSim from Simmetrix SimModSuite" FALSE) +message(STATUS "ENABLE_FIELDSIM: ${ENABLE_FIELDSIM}") +set(USE_FIELDSIM FALSE) +if( ${SIMMODSUITE_SimField_FOUND} AND ENABLE_FIELDSIM ) + set(USE_FIELDSIM TRUE) +endif() +set(USE_SIM_ADVMESHING ${HAVE_SIMADVMESHING}) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/apf_simConfig.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/apf_simConfig.h") +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/apf_simConfig.h + DESTINATION include) + #Sources & Headers set(SOURCES apfSIM.cc) set(HEADERS apfSIM.h) @@ -21,21 +35,11 @@ target_include_directories(apf_sim PUBLIC $ ) -option(ENABLE_FIELDSIM "Enable use of FieldSim from Simmetrix SimModSuite" FALSE) -message(STATUS "ENABLE_FIELDSIM: ${ENABLE_FIELDSIM}") -set(USE_FIELDSIM FALSE) -if( ${SIMMODSUITE_SimField_FOUND} AND ENABLE_FIELDSIM ) - set(USE_FIELDSIM TRUE) -endif() -set(USE_SIM_ADVMESHING ${HAVE_SIMADVMESHING}) - -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/apf_simConfig.h.in" - "${CMAKE_CURRENT_BINARY_DIR}/apf_simConfig.h") #directory containing apf_simConfig.h -target_include_directories(apf_sim PRIVATE +target_include_directories(apf_sim PUBLIC $) + scorec_export_library(apf_sim) bob_end_subdir() diff --git a/phasta/phAttrib.cc b/phasta/phAttrib.cc index 55172b0a1..2c7d6bd21 100644 --- a/phasta/phAttrib.cc +++ b/phasta/phAttrib.cc @@ -6,7 +6,7 @@ #include #include #include - +#include "apf_simConfig.h" typedef ph::BC* (*BCFactory)(pAttribute a, pGEntity ge); typedef std::map BCFactories; diff --git a/phasta/phMeshQuality.cc b/phasta/phMeshQuality.cc index f23afa217..3a21e315c 100644 --- a/phasta/phMeshQuality.cc +++ b/phasta/phMeshQuality.cc @@ -8,7 +8,6 @@ #include #include #include -//#include "apf_simConfig.h" #ifdef HAVE_SIMMETRIX #include diff --git a/test/generate.cc b/test/generate.cc index 4a66f8af9..4e17b4d0a 100644 --- a/test/generate.cc +++ b/test/generate.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include "gmi_sim_config.h" #include #include diff --git a/test/rm_extrusion.cc b/test/rm_extrusion.cc index a21133b8b..dcb9f2e86 100644 --- a/test/rm_extrusion.cc +++ b/test/rm_extrusion.cc @@ -4,7 +4,7 @@ #include #include #include -#include <../apf_sim/apf_simConfig.h> +#include #include #include #include diff --git a/test/simTranslate.cc b/test/simTranslate.cc index 017a506f9..c40b7e484 100644 --- a/test/simTranslate.cc +++ b/test/simTranslate.cc @@ -18,8 +18,7 @@ #include #include -/* hack to get SIMMODSUITE_MAJOR_VERSION and SIMMODSUITE_MINOR_VERSION */ -#include "../apf_sim/apf_simConfig.h" +#include /* cheap hackish way to get SIM_PARASOLID and SIM_ACIS */ #include "gmi_sim_config.h" #include