Skip to content

Commit c4ce0be

Browse files
committed
[CMake] Simplify ROOTTEST_COMPILE_MACRO a bit more
1 parent 3fedb5e commit c4ce0be

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

cmake/modules/RootMacros.cmake

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,17 +2315,14 @@ macro(ROOTTEST_COMPILE_MACRO filename)
23152315
list(APPEND RootMacroDirDefines "-e;#define ${d}")
23162316
endforeach()
23172317

2318-
set(RootMacroBuildDefines
2319-
-e "#define CMakeEnvironment"
2320-
-e "#define CMakeBuildDir \"${CMAKE_CURRENT_BINARY_DIR}\""
2321-
-e "gSystem->AddDynamicPath(\"${CMAKE_CURRENT_BINARY_DIR}\")"
2322-
-e "gROOT->SetMacroPath(\"${CMAKE_CURRENT_SOURCE_DIR}\")"
2323-
-e "gInterpreter->AddIncludePath(\"-I${CMAKE_CURRENT_BINARY_DIR}\")"
2324-
-e "gSystem->AddIncludePath(\"-I${CMAKE_CURRENT_BINARY_DIR}\")"
2325-
-e "gSystem->SetBuildDir(\"${CMAKE_CURRENT_BINARY_DIR}\", true)"
2326-
${RootMacroDirDefines})
2327-
2328-
set(root_compile_macro ${ROOT_root_CMD} ${RootMacroBuildDefines} -q -l -b)
2318+
set(root_compile_macro ${CMAKE_COMMAND} -E env
2319+
ROOT_LIBRARY_PATH="${CMAKE_CURRENT_BINARY_DIR}"
2320+
ROOT_INCLUDE_PATH="${CMAKE_CURRENT_BINARY_DIR}"
2321+
${ROOT_root_CMD}
2322+
-e "gSystem->SetBuildDir(\"${CMAKE_CURRENT_BINARY_DIR}\", true)"
2323+
${RootMacroDirDefines}
2324+
-q -l -b
2325+
)
23292326

23302327
get_filename_component(realfp ${filename} ABSOLUTE)
23312328
if(MSVC)

roottest/scripts/build.C

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ void build(const char *filename, const char *lib = 0, const char *obj = 0, const
7575
}
7676
// fprintf(stderr,"from %s to %s\n",filename,fname.Data());
7777
int result = gSystem->CompileMacro(fname,"kc");
78-
#elif defined(CMakeEnvironment) && defined(CMakeBuildDir)
79-
// fprintf(stderr,"CmakeBuildDir: %s filename: %s", CMakeBuildDir, filename);
80-
int result = gSystem->CompileMacro(filename,"kc-", libname, CMakeBuildDir);
8178
#else
8279
int result = gSystem->CompileMacro(filename,"kc", libname);
8380
#endif

0 commit comments

Comments
 (0)