Author: rharabien
Date: Sun Nov 27 19:45:41 2011
New Revision: 54513
URL:
http://svn.reactos.org/svn/reactos?rev=54513&view=rev
Log:
[CMAKE] - Add support for creating lnk files
Modified:
trunk/reactos/CMakeLists.txt
trunk/reactos/cmake/CMakeMacros.cmake
Modified: trunk/reactos/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=54513&a…
==============================================================================
--- trunk/reactos/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/CMakeLists.txt [iso-8859-1] Sun Nov 27 19:45:41 2011
@@ -61,9 +61,9 @@
add_subdirectory(lib)
if(NOT MSVC)
- export(TARGETS widl wrc gendib cabman cdmake mkhive obj2bin spec2def geninc rsym
FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
- else()
- export(TARGETS gendib cabman cdmake mkhive obj2bin spec2def geninc FILE
${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
+ export(TARGETS widl wrc gendib cabman cdmake mkhive obj2bin spec2def geninc rsym
mkshelllink FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
+ else()
+ export(TARGETS gendib cabman cdmake mkhive obj2bin spec2def geninc mkshelllink
FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
endif()
else()
Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Sun Nov 27 19:45:41 2011
@@ -54,6 +54,35 @@
PROPERTIES GENERATED TRUE)
add_custom_target(${FILE} ALL DEPENDS
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc)
endforeach()
+endfunction()
+
+function(add_link)
+ cmake_parse_arguments(_LINK "MINIMIZE"
"NAME;PATH;CMD_LINE_ARGS;ICON;GUID" "" ${ARGN})
+ if(NOT _LINK_NAME OR NOT _LINK_PATH)
+ message(FATAL_ERROR "You must provide name and path")
+ endif()
+
+ if(_LINK_CMD_LINE_ARGS)
+ set(_LINK_CMD_LINE_ARGS -c ${_LINK_CMD_LINE_ARGS})
+ endif()
+
+ if(_LINK_ICON)
+ set(_LINK_ICON -i ${_LINK_ICON})
+ endif()
+
+ if(_LINK_GUID)
+ set(_LINK_GUID -g ${_LINK_GUID})
+ endif()
+
+ if(_LINK_MINIMIZE)
+ set(_LINK_MINIMIZE "-m")
+ endif()
+
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_LINK_NAME}.lnk
+ COMMAND native-mkshelllink -o ${CMAKE_CURRENT_BINARY_DIR}/${_LINK_NAME}.lnk
${_LINK_CMD_LINE_ARGS} ${_LINK_ICON} ${_LINK_GUID} ${_LINK_MINIMIZE} ${_LINK_PATH}
+ DEPENDS native-mkshelllink)
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_LINK_NAME}.lnk PROPERTIES
GENERATED TRUE)
endfunction()
macro(dir_to_num dir var)