author | Slion |
Wed, 06 Jan 2010 16:05:22 +0100 | |
branch | anywhere |
changeset 23 | 9c130f173b89 |
parent 22 | 5c5219488d00 |
child 24 | 18d195b75193 |
permissions | -rw-r--r-- |
18 | 1 |
# Copyright (c) 2009 Stéphane Lenclud. |
2 |
# All rights reserved. |
|
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". |
|
7 |
# |
|
8 |
# Initial Contributors: |
|
9 |
# Stéphane Lenclud. |
|
10 |
# |
|
11 |
||
12 |
project (eka) |
|
13 |
||
14 |
cmake_minimum_required(VERSION 2.6) |
|
15 |
||
16 |
#add_definitions(-DUNICODE) |
|
17 |
add_definitions(-D__VC32__) |
|
18 |
add_definitions(-D_UNICODE) |
|
19 |
add_definitions(-D__LEAVE_EQUALS_THROW__) |
|
19
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
20 |
add_definitions(-D__WINS__) |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
21 |
#__CPU_X86 is declared by __WINS__ |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
22 |
#add_definitions(-D__CPU_X86) |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
23 |
add_definitions(-D__DLL__) |
18 | 24 |
|
25 |
include_directories (./euser ./euser/unicode ./include) |
|
26 |
||
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
27 |
|
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
28 |
#Add the given source files to our source prepending the sourcepath |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
29 |
macro(add_source) |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
30 |
foreach(mySource ${ARGV}) |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
31 |
string(REGEX REPLACE "(^.+)" "${sourcepath}\\1" newsource ${mySource}) |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
32 |
set(source ${source} ${newsource}) |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
33 |
endforeach(mySource) |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
34 |
endmacro(add_source) |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
35 |
|
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
36 |
|
18 | 37 |
#Adding the sources from cbase |
38 |
set (sourcepath ./euser/cbase/) |
|
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
39 |
add_source( |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
40 |
ub_act.cpp ub_array.cpp ub_bma.cpp ub_buf.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
41 |
ub_circ.cpp ub_cln.cpp ub_cons.cpp ub_dtim.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
42 |
ub_obj.cpp ub_svr.cpp ub_polsvr.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
43 |
ub_tim.cpp ub_utl.cpp ub_tque.cpp |
18 | 44 |
) |
45 |
||
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
46 |
|
18 | 47 |
#Add euser sources |
48 |
set (sourcepath ./euser/) |
|
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
49 |
add_source( |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
50 |
us_evnt.cpp locmapping.cpp us_exec.cpp us_func.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
51 |
us_graph.cpp us_hand.cpp us_ksvr.cpp us_des.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
52 |
us_lex16.cpp us_lex8.cpp us_loc.cpp us_mes.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
53 |
us_parse.cpp us_power.cpp us_property.cpp us_que.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
54 |
us_ref.cpp us_regn.cpp us_test.cpp us_time.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
55 |
us_trp.cpp us_utl.cpp us_mqueue.cpp us_encode.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
56 |
us_decode.cpp us_secure.cpp us_htab.cpp us_rwlock.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
57 |
us_shbuf.cpp |
18 | 58 |
) |
59 |
||
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
60 |
|
18 | 61 |
#Adding the sources from common |
62 |
set (sourcepath ./common/) |
|
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
63 |
add_source( |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
64 |
array.cpp des8.cpp des16.cpp alloc.cpp heap.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
65 |
mem.cpp secure.cpp |
18 | 66 |
) |
67 |
||
19
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
68 |
#Adding the sources from common/win32 |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
69 |
set (sourcepath ./common/win32/) |
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
70 |
add_source( |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
71 |
atomics.cpp |
19
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
72 |
) |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
73 |
|
18 | 74 |
#Adding the sources from maths |
75 |
set (sourcepath ./euser/maths/) |
|
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
76 |
add_source( |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
77 |
um_asin.cpp um_atan.cpp um_dtor.cpp um_exp.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
78 |
um_frac.cpp um_int.cpp um_ln.cpp um_log.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
79 |
um_mod.cpp um_pow.cpp um_pow10.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
80 |
um_rand.cpp um_rtod.cpp um_sin.cpp um_spec.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
81 |
um_sqrt.cpp um_tan.cpp um_utl.cpp |
18 | 82 |
) |
83 |
||
22
5c5219488d00
Fixing linkage error. First successful euser build.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
21
diff
changeset
|
84 |
|
18 | 85 |
#Adding the sources from epoc/win32 |
86 |
set (sourcepath ./euser/epoc/win32/) |
|
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
87 |
add_source( |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
88 |
uc_i64.cpp uc_realx.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
89 |
uc_trp.cpp uc_utl.cpp uc_exec.cpp |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
90 |
uc_dll.cpp |
18 | 91 |
) |
92 |
||
93 |
#Adding the sources from epoc |
|
94 |
set (sourcepath ./euser/epoc/) |
|
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
95 |
add_source( |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
96 |
up_lib.cpp up_utl.cpp |
18 | 97 |
) |
98 |
||
99 |
#Adding the sources from unicode |
|
100 |
set (sourcepath ./euser/unicode/) |
|
23
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
101 |
add_source( |
9c130f173b89
Making our cmake file look a lot better using cmake macro.
Slion
parents:
22
diff
changeset
|
102 |
collate.cpp unicode.cpp unitable.cpp Compare.cpp |
18 | 103 |
) |
104 |
||
105 |
#define our library |
|
19
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
106 |
add_library (emulator SHARED ./euser/epoc/win32/emulator.cpp) |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
107 |
target_link_libraries(emulator kernel32) |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
108 |
|
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
109 |
add_library (euser SHARED ${source}) |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
110 |
target_link_libraries(euser emulator) |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
111 |
|
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
112 |
add_library (estub ./euser/epoc/win32/uc_stub.cpp) |
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
113 |
|
22
5c5219488d00
Fixing linkage error. First successful euser build.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
21
diff
changeset
|
114 |
#No need for emulator here |
5c5219488d00
Fixing linkage error. First successful euser build.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
21
diff
changeset
|
115 |
#add_executable(epoc ./euser/epoc/win32/uc_epoc.cpp) |
5c5219488d00
Fixing linkage error. First successful euser build.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
21
diff
changeset
|
116 |
#target_link_libraries(epoc estub euser) |
19
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
117 |
|
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
118 |
|
21
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
119 |
|
19
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
120 |
|
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
121 |
|
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
122 |
|
18 | 123 |
|
124 |
#define vs IDE folders |
|
125 |
source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$") |
|
126 |
source_group(Includes REGULAR_EXPRESSION ".+\\.h$") |
|
19
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
127 |
|
21
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
128 |
#Generate the exec enum using CMAKE custom command |
19
f6d3d9676ee4
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
Slion
parents:
18
diff
changeset
|
129 |
#perl genexec.pl -i execs.txt -e ../include/exec_enum.h -u ../include/exec_user.h -k ../include/exec_kernel.h |
21
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
130 |
|
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
131 |
add_custom_command ( |
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
132 |
TARGET euser |
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
133 |
PRE_BUILD |
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
134 |
COMMAND perl ./kernel/genexec.pl -i ./kernel/execs.txt -e ./include/exec_enum.h -u ./include/exec_user.h -k ./include/exec_kernel.h |
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
135 |
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
136 |
COMMENT "Generating exec headers..." |
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
137 |
VERBATIM |
af091391d962
Adding support for exec enum generation using CMake custom command.
Stephane Lenclud <tortoisehg@lenclud.com>
parents:
19
diff
changeset
|
138 |
) |