Skip to content

Commit 0ce4d20

Browse files
committed
[rootx] Turn root executable into symbolic link to root.exe
There is no need to two separate executables anymore, but for backwards compatibility we keep `root.exe` and then `root` is a symbolic link to it.
1 parent f8c8813 commit 0ce4d20

File tree

4 files changed

+20
-211
lines changed

4 files changed

+20
-211
lines changed

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,6 @@ add_subdirectory (montecarlo)
433433
if(geom)
434434
add_subdirectory (geom)
435435
endif()
436-
if(NOT WIN32)
437-
add_subdirectory (rootx)
438-
endif()
439436
add_subdirectory (misc)
440437
add_subdirectory (main)
441438
add_subdirectory (bindings)

main/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,27 @@ if(NOT WIN32)
1616
endif()
1717
ROOT_EXECUTABLE(roots.exe roots.cxx LIBRARIES Core MathCore CMAKENOEXPORT)
1818
endif()
19+
1920
ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES Core Rint)
21+
22+
if(NOT MSVC)
23+
24+
set_target_properties(root.exe PROPERTIES OUTPUT_NAME "root")
25+
26+
# Create a symlink in the build tree
27+
add_custom_command(TARGET root.exe POST_BUILD
28+
COMMAND ${CMAKE_COMMAND} -E create_symlink "root" ${CMAKE_BINARY_DIR}/bin/root.exe
29+
)
30+
# Create symlink in the install tree
31+
install(CODE "
32+
execute_process(COMMAND
33+
\"${CMAKE_COMMAND}\" -E create_symlink
34+
root
35+
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/root.exe\")
36+
")
37+
endif()
38+
39+
2040
if(MSVC)
2141
set(root_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch \
2242
/EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index \

rootx/CMakeLists.txt

Lines changed: 0 additions & 29 deletions
This file was deleted.

rootx/src/rootx.cxx

Lines changed: 0 additions & 179 deletions
This file was deleted.

0 commit comments

Comments
 (0)