From 6456c2b89a04a8b5493e0e5dafcfa36833115b9b Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Fri, 30 Jan 2015 14:16:57 -0800 Subject: [PATCH] feat(CMakeLists.txt): add leanemacs.bat for Windows Signed-off-by: Leonardo de Moura --- bin/leanemacs.bat.in | 4 ++++ src/CMakeLists.txt | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 bin/leanemacs.bat.in diff --git a/bin/leanemacs.bat.in b/bin/leanemacs.bat.in new file mode 100644 index 000000000..229370621 --- /dev/null +++ b/bin/leanemacs.bat.in @@ -0,0 +1,4 @@ +SET MY_PATH=%~dp0 +SET LEAN_ROOTDIR=%MY_PATH%/.. +SET LEAN_EMACS_PATH=%MY_PATH%/../@EMACS_LISP_DIR@ +emacs -load %LEAN_EMACS_PATH%/load-lean.el diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 62581af56..76cd69fd0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -295,6 +295,7 @@ configure_file("${LEAN_SOURCE_DIR}/version.h.in" "${LEAN_BINARY_DIR}/version.h") # leanemacs file configure_file("${LEAN_SOURCE_DIR}/../bin/leanemacs.in" "${LEAN_SOURCE_DIR}/../bin/leanemacs") +configure_file("${LEAN_SOURCE_DIR}/../bin/leanemacs.bat.in" "${LEAN_SOURCE_DIR}/../bin/leanemacs.bat") include_directories("${LEAN_BINARY_DIR}") add_subdirectory(util) @@ -405,9 +406,15 @@ install(FILES ${CMAKE_SOURCE_DIR}/../bin/linja ${CMAKE_SOURCE_DIR}/../bin/leanta DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -install(FILES ${CMAKE_SOURCE_DIR}/../bin/leanemacs ${CMAKE_SOURCE_DIR}/../bin/leanemacs - DESTINATION bin - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + install(FILES ${CMAKE_SOURCE_DIR}/../bin/leanemacs.bat ${CMAKE_SOURCE_DIR}/../bin/leanemacs.bat + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +else() + install(FILES ${CMAKE_SOURCE_DIR}/../bin/leanemacs ${CMAKE_SOURCE_DIR}/../bin/leanemacs + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +endif() install(DIRECTORY ${CMAKE_SOURCE_DIR}/../library DESTINATION ${LIBRARY_DIR} FILES_MATCHING PATTERN "*.lean")