[CMAKE]
[reactos.git] / base / applications / rapps / CMakeLists.txt
1
2 set_unicode()
3
4 list(APPEND SOURCE
5 aboutdlg.c
6 available.c
7 installdlg.c
8 installed.c
9 listview.c
10 loaddlg.c
11 misc.c
12 parser.c
13 richedit.c
14 settingsdlg.c
15 splitter.c
16 statusbar.c
17 toolbar.c
18 treeview.c
19 winmain.c
20 rapps.rc)
21
22 include_directories(${CMAKE_CURRENT_BINARY_DIR})
23 include_directories(${REACTOS_BINARY_DIR}/include/reactos)
24 set_rc_compiler()
25
26 add_executable(rapps ${SOURCE})
27 target_link_libraries(rapps uuid)
28
29 add_importlibs(rapps advapi32 comctl32 gdi32 urlmon user32 shell32 shlwapi kernel32 ntdll)
30 add_dependencies(rapps rappsmsg)
31
32 #FIXME : move this to cmakemacros + gcc/msvc.cmake
33
34 if(MSVC)
35 MACRO(MACRO_MC FILE)
36 set (COMMAND_MC mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc)
37 ENDMACRO()
38 else()
39 MACRO(MACRO_MC FILE)
40 set(COMMAND_MC ${MINGW_PREFIX}windmc -A -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos)
41 ENDMACRO()
42 endif()
43
44 MACRO (MACRO_ADD_MESSAGE_HEADERS)
45
46 FOREACH(_in_FILE ${ARGN})
47
48 get_filename_component(FILE ${_in_FILE} NAME_WE)
49 MACRO_MC(${FILE})
50 add_custom_command(
51 OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
52 COMMAND ${COMMAND_MC}
53 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc
54 )
55 set_source_files_properties(
56 ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc
57 PROPERTIES GENERATED TRUE
58 )
59 add_custom_target(${FILE} ALL DEPENDS ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc)
60
61 ENDFOREACH(_in_FILE ${ARGN})
62
63 ENDMACRO (MACRO_ADD_MESSAGE_HEADERS)
64
65 MACRO_ADD_MESSAGE_HEADERS(rappsmsg.mc)
66
67 add_cab_target(rapps 1)