kernel/eka/CMakeLists.txt
author Slion
Wed, 06 Jan 2010 16:05:22 +0100
branchanywhere
changeset 23 9c130f173b89
parent 22 5c5219488d00
child 24 18d195b75193
permissions -rw-r--r--
Making our cmake file look a lot better using cmake macro.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     1
# Copyright (c) 2009 Stéphane Lenclud.
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     2
# All rights reserved.
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     3
# This component and the accompanying materials are made available
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     5
# which accompanies this distribution, and is available
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     7
#
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     8
# Initial Contributors:
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
     9
# Stéphane Lenclud.
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    10
#
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    11
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    12
project (eka)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    13
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    14
cmake_minimum_required(VERSION 2.6)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    15
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    16
#add_definitions(-DUNICODE)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    17
add_definitions(-D__VC32__)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    18
add_definitions(-D_UNICODE)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    24
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    25
include_directories (./euser ./euser/unicode ./include)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    37
#Adding the sources from cbase
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    44
)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    45
23
9c130f173b89 Making our cmake file look a lot better using cmake macro.
Slion
parents: 22
diff changeset
    46
18
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    47
#Add euser sources
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    58
)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    59
23
9c130f173b89 Making our cmake file look a lot better using cmake macro.
Slion
parents: 22
diff changeset
    60
18
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    61
#Adding the sources from common
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    66
)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    74
#Adding the sources from maths
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    82
)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    83
22
5c5219488d00 Fixing linkage error. First successful euser build.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 21
diff changeset
    84
18
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    85
#Adding the sources from epoc/win32
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    91
)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    92
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    93
#Adding the sources from epoc
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    97
)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    98
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
    99
#Adding the sources from unicode
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
   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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
   103
)
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
   104
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
   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
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
   123
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
   124
#define vs IDE folders
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
   125
source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$")
1ff3ff4e270f Basic kernel cmake file. Not yet compiling.
Slion
parents:
diff changeset
   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
 	)