Skip to content

ITK_DIR avoid override #134

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 9 additions & 4 deletions GenerateCLP/GenerateCLP.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,12 @@ void GenerateDeSerialization( std::ostream & sout,
| " return EXIT_FAILURE;"
| " }"
| " Json::Value root;"
| " Json::Reader reader;"
| " reader.parse( fStream, root );"
| " Json::CharReaderBuilder builder;"
| " JSONCPP_STRING errs;"
| " if (!parseFromStream(builder, fStream, &root, &errs)) {"
| " std::cout << errs << std::endl;"
| " return EXIT_FAILURE;"
| " }"
| " const Json::Value & parameters = root[\"Parameters\"];";

typedef std::vector<ModuleParameterGroup> ModuleParameterGroupsType;
Expand Down Expand Up @@ -686,8 +690,9 @@ void GenerateSerialization( std::ostream & sout,
| " std::cerr << \"Could not open file: \" << parametersSerializeArg.getValue() << \" for writing.\" << std::endl;"
| " return EXIT_FAILURE;"
| " }"
| " Json::StyledStreamWriter writer;"
| " writer.write( fStream, root );"
| " Json::StreamWriterBuilder builder;"
| " const std::unique_ptr<Json::StreamWriter> writer(builder.newStreamWriter());"
| " writer->write( root, &fStream );"
| " fStream.close();"
| " }";
}
Expand Down
4 changes: 3 additions & 1 deletion GenerateCLP/GenerateCLPConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ set(SlicerExecutionModel_USE_UTF8 "@SlicerExecutionModel_USE_UTF8@")
set(SlicerExecutionModel_CMAKE_DIR "@SlicerExecutionModel_CMAKE_DIR@")
set(TCLAP_DIR "@TCLAP_DIR@")
set(ModuleDescriptionParser_DIR "@ModuleDescriptionParser_DIR@")
set(ITK_DIR "@ITK_DIR_CONFIG@")
if (NOT DEFINED ITK_DIR)
set(ITK_DIR "@ITK_DIR_CONFIG@")
endif()

set(GenerateCLP_JsonCpp_INCLUDE_DIR "@JsonCpp_INCLUDE_DIR@")
if(NOT "${GenerateCLP_JsonCpp_INCLUDE_DIR}" STREQUAL "")
Expand Down
5 changes: 3 additions & 2 deletions GenerateCLP/GenerateCLPInstallConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ set(GENERATECLP_EXE "${GENERATECLP_EXE}${__EXE_EXT}")
get_filename_component(GENERATECLP_EXE "${GENERATECLP_EXE}" ABSOLUTE)
set(TCLAP_DIR "@TCLAP_DIR@")
set(ModuleDescriptionParser_DIR "@ModuleDescriptionParser_DIR@")
set(ITK_DIR "@ITK_DIR@")

if (NOT DEFINED ITK_DIR)
set(ITK_DIR "@ITK_DIR@")
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ set(ModuleDescriptionParser_USE_FILE
"@ModuleDescriptionParser_USE_FILE_CONFIG@"
)

set(ITK_DIR "@ITK_DIR_CONFIG@")
if (NOT DEFINED ITK_DIR)
set(ITK_DIR "@ITK_DIR_CONFIG@")
endif()

set(ModuleDescriptionParser_ITK_COMPONENTS "@ModuleDescriptionParser_ITK_COMPONENTS@")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ set(ModuleDescriptionParser_USE_FILE
"${ModuleDescriptionParser_CONFIG_DIR}/UseModuleDescriptionParser.cmake"
)

set(ITK_DIR "@ITK_DIR@")
if (NOT DEFINED ITK_DIR)
set(ITK_DIR "@ITK_DIR@")
endif()