First public contribution.
1 # Copyright (c) 2009 Stéphane Lenclud.
3 # This component and the accompanying materials are made available
4 # under the terms of the License "Eclipse Public License v1.0"
5 # which accompanies this distribution, and is available
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 # Initial Contributors:
14 #----------------------------------------------------------------
15 #Add current file to our source tree
17 #Make sure all the output from all projects will go in one place
18 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
19 #Visual Studio IDE folders
20 source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$")
21 source_group(Includes REGULAR_EXPRESSION ".+\\.h$")
22 source_group(Def REGULAR_EXPRESSION ".+\\.def$")
23 #----------------------------------------------------------------
26 include_directories (../euser ../euser/unicode ../include
27 ../include/nkern ../include/nkern/win32 ../include/kernel ../include/kernel/win32 ../include/memmodel/emul/win32 ../include/memmodel/emul)
29 #Define source for ekern
30 set (sourcepath ../nkern/)
32 nkern.cpp nkerns.cpp sched.cpp dfcs.cpp nk_timer.cpp
36 set (sourcepath ../common/win32/)
41 set (sourcepath ../nkern/win32/)
43 vectors.cpp ncsched.cpp nctimer.cpp ncutilf.cpp ncutils.cpp
47 set (sourcepath ../common/win32/)
52 #UID data seg. TODO: generate that?
53 set (sourcepath ./win32/)
58 set (sourcepath ../kernel/win32/)
61 cglobals.cpp cexec.cpp cinit.cpp
62 ckernel.cpp csched.cpp
64 k_entry.cpp #originally from kc_exe.mmp
65 #TODO: add our own entry point?
69 set (sourcepath ../kernel/)
71 sglobals.cpp device.cpp eventq.cpp
72 sexec.cpp sinit.cpp skernel.cpp
73 scodeseg.cpp sipc.cpp notifier.cpp
74 object.cpp power.cpp server.cpp
75 stimer.cpp sutils.cpp random.cpp
76 sprocess.cpp sthread.cpp
88 set (sourcepath ../klib/)
95 set (sourcepath ../common/)
97 alloc.cpp array.cpp des8.cpp heap.cpp mem.cpp
101 set (sourcepath ../memmodel/emul/)
108 set (sourcepath ../memmodel/emul/win32/)
111 mchunk.cpp mglobals.cpp minit.cpp mkernel.cpp
112 mcodeseg.cpp mprocess.cpp mutils.cpp mshbuf.cpp
116 set (sourcepath ../blike/)
121 #------------------------------------------------------------------------------------
123 #------------------------------------------------------------------------------------
124 #It looks like exes on wins are still DLL but with a .exe extension
126 add_library(ekern SHARED ${source})
127 set_target_properties(ekern PROPERTIES SUFFIX ".exe")
128 #add_executable(ekern ${source})
129 target_link_libraries(ekern kernel32 emulator scppnwdl_kern)
130 #------------------------------------------------------------------------------------
132 #add_dependencies(ekern genexec)
133 #set_target_properties(ekern PROPERTIES LINK_FLAGS "/ENTRY:KernelMain /NODEFAULTLIB")
134 #target_link_libraries(ekern kernel32 msvcrt)
135 #set_target_properties(ekern PROPERTIES COMPILE_FLAGS "/Zl")
136 #install(TARGETS ekern DESTINATION ./symbian/bin)
138 add_define(__EXPORT_MEMCPY__)
139 add_define(__IN_KERNEL__)
140 add_define(__KERNEL_MODE__)
141 add_define(__MEMMODEL_EMUL_SINGLE_HOST_PROCESS__)
142 #__CPU_X86 is declared by __WINS__
143 #add_define(__CPU_X86)
148 ##Copy ekern.dll to be next to epoc.exe
151 #get_target_property(LIB_NAME ekern LOCATION)
152 #get_target_property(DEST_NAME epoc LOCATION)
153 #set(target_suffix .dll)
154 #Extract path from full filename
155 #string(REGEX REPLACE "(^.+)/epoc.exe" "\\1" DEST_NAME ${DEST_NAME})
156 #set(DEST_NAME ${DEST_NAME}/ekern${target_suffix})
158 #message(${DEST_NAME})
160 #add_custom_command (
163 # COMMAND ${CMAKE_COMMAND} -E copy ${LIB_NAME} ${DEST_NAME}
166 ######################