kernel/eka/CMakeLists.txt
branchanywhere
changeset 24 18d195b75193
parent 23 9c130f173b89
child 25 57330c35d3d7
equal deleted inserted replaced
23:9c130f173b89 24:18d195b75193
     1 # Copyright (c) 2009 Stéphane Lenclud.
     1 # Copyright (c) 2009-2010 Stéphane Lenclud.
     2 # All rights reserved.
     2 # All rights reserved.
     3 # This component and the accompanying materials are made available
     3 # This component and the accompanying materials are made available
     4 # under the terms of the License "Eclipse Public License v1.0"
     4 # under the terms of the License "Eclipse Public License v1.0"
     5 # which accompanies this distribution, and is available
     5 # which accompanies this distribution, and is available
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
    11 
    11 
    12 project (eka)
    12 project (eka)
    13 
    13 
    14 cmake_minimum_required(VERSION 2.6)
    14 cmake_minimum_required(VERSION 2.6)
    15 
    15 
    16 #add_definitions(-DUNICODE)
       
    17 add_definitions(-D__VC32__)
       
    18 add_definitions(-D_UNICODE)
       
    19 add_definitions(-D__LEAVE_EQUALS_THROW__)
       
    20 add_definitions(-D__WINS__)
       
    21 #__CPU_X86 is declared by __WINS__ 
       
    22 #add_definitions(-D__CPU_X86)
       
    23 add_definitions(-D__DLL__)
       
    24 
       
    25 include_directories (./euser ./euser/unicode ./include)
       
    26 
       
    27 
       
    28 #Add the given source files to our source prepending the sourcepath
       
    29 macro(add_source)
       
    30 	foreach(mySource ${ARGV})
       
    31 		string(REGEX REPLACE "(^.+)" "${sourcepath}\\1" newsource ${mySource})
       
    32 		set(source ${source} ${newsource})
       
    33 	endforeach(mySource) 
       
    34 endmacro(add_source) 
       
    35 
       
    36 
       
    37 #Adding the sources from cbase
       
    38 set (sourcepath ./euser/cbase/)
       
    39 add_source(
       
    40 ub_act.cpp ub_array.cpp ub_bma.cpp ub_buf.cpp
       
    41 ub_circ.cpp ub_cln.cpp ub_cons.cpp ub_dtim.cpp
       
    42 ub_obj.cpp ub_svr.cpp ub_polsvr.cpp
       
    43 ub_tim.cpp ub_utl.cpp ub_tque.cpp
       
    44 )
       
    45 
       
    46 
       
    47 #Add euser sources
       
    48 set (sourcepath ./euser/)
       
    49 add_source(
       
    50 us_evnt.cpp locmapping.cpp us_exec.cpp us_func.cpp
       
    51 us_graph.cpp us_hand.cpp us_ksvr.cpp us_des.cpp
       
    52 us_lex16.cpp us_lex8.cpp us_loc.cpp us_mes.cpp
       
    53 us_parse.cpp us_power.cpp us_property.cpp us_que.cpp
       
    54 us_ref.cpp us_regn.cpp us_test.cpp us_time.cpp
       
    55 us_trp.cpp us_utl.cpp us_mqueue.cpp us_encode.cpp
       
    56 us_decode.cpp us_secure.cpp us_htab.cpp us_rwlock.cpp
       
    57 us_shbuf.cpp
       
    58 )
       
    59 
       
    60 
       
    61 #Adding the sources from common
       
    62 set (sourcepath ./common/)
       
    63 add_source(
       
    64 array.cpp des8.cpp des16.cpp alloc.cpp heap.cpp
       
    65 mem.cpp secure.cpp
       
    66 )
       
    67 
       
    68 #Adding the sources from common/win32
       
    69 set (sourcepath ./common/win32/)
       
    70 add_source(
       
    71 atomics.cpp
       
    72 )
       
    73 
       
    74 #Adding the sources from maths
       
    75 set (sourcepath ./euser/maths/)
       
    76 add_source(
       
    77 um_asin.cpp um_atan.cpp um_dtor.cpp um_exp.cpp
       
    78 um_frac.cpp um_int.cpp um_ln.cpp um_log.cpp
       
    79 um_mod.cpp um_pow.cpp um_pow10.cpp
       
    80 um_rand.cpp um_rtod.cpp um_sin.cpp um_spec.cpp
       
    81 um_sqrt.cpp um_tan.cpp um_utl.cpp
       
    82 )
       
    83 
       
    84 
       
    85 #Adding the sources from epoc/win32
       
    86 set (sourcepath ./euser/epoc/win32/)
       
    87 add_source(
       
    88 uc_i64.cpp uc_realx.cpp
       
    89 uc_trp.cpp uc_utl.cpp uc_exec.cpp
       
    90 uc_dll.cpp
       
    91 )
       
    92 
       
    93 #Adding the sources from epoc
       
    94 set (sourcepath ./euser/epoc/)
       
    95 add_source(
       
    96 up_lib.cpp up_utl.cpp
       
    97 )
       
    98 
       
    99 #Adding the sources from unicode
       
   100 set (sourcepath ./euser/unicode/)
       
   101 add_source(
       
   102 collate.cpp unicode.cpp unitable.cpp Compare.cpp
       
   103 )
       
   104 
       
   105 #define our library
       
   106 add_library (emulator SHARED ./euser/epoc/win32/emulator.cpp)
       
   107 target_link_libraries(emulator kernel32)
       
   108 
       
   109 add_library (euser SHARED ${source})
       
   110 target_link_libraries(euser emulator)
       
   111 
       
   112 add_library (estub ./euser/epoc/win32/uc_stub.cpp)
       
   113 
       
   114 #No need for emulator here
       
   115 #add_executable(epoc ./euser/epoc/win32/uc_epoc.cpp)
       
   116 #target_link_libraries(epoc estub euser)
       
   117 
       
   118 
       
   119 
       
   120 
       
   121 
       
   122 
       
   123 
       
   124 #define vs IDE folders
       
   125 source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$")
       
   126 source_group(Includes REGULAR_EXPRESSION ".+\\.h$") 	
       
   127 
    16 
   128 #Generate the exec enum using CMAKE custom command
    17 #Generate the exec enum using CMAKE custom command
   129 #perl genexec.pl -i execs.txt -e ../include/exec_enum.h -u ../include/exec_user.h -k ../include/exec_kernel.h
    18 #perl genexec.pl -i execs.txt -e ../include/exec_enum.h -u ../include/exec_user.h -k ../include/exec_kernel.h
   130 
       
   131 add_custom_command (
    19 add_custom_command (
   132  	TARGET euser
    20 	OUTPUT ./include/exec_enum.h ./include/exec_user.h ./include/kernel/exec_kernel.h
   133    	PRE_BUILD
    21    	COMMAND perl ./kernel/genexec.pl -i ./kernel/execs.txt -e ./include/exec_enum.h -u ./include/exec_user.h -k ./include/kernel/exec_kernel.h
   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
    22 	WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}	
   135 	WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 	
       
   136    	COMMENT "Generating exec headers..."
    23    	COMMENT "Generating exec headers..."
   137    	VERBATIM
    24    	VERBATIM
   138  	)
    25  	)
       
    26 	
       
    27 #Tell cmake those file won't be available until build time
       
    28 set_source_files_properties(./include/exec_enum.h PROPERTIES GENERATED 1)
       
    29 set_source_files_properties(./include/exec_user.h PROPERTIES GENERATED 1)
       
    30 set_source_files_properties(./include/kernel/exec_kernel.h PROPERTIES GENERATED 1)
       
    31 
       
    32 #Custom target that will generate our exec headers 
       
    33 add_custom_target(genexec DEPENDS ./include/exec_enum.h ./include/exec_user.h ./include/kernel/exec_kernel.h)
       
    34 
       
    35 add_subdirectory(./euser ./euser/bin)
       
    36 add_subdirectory(./kernel ./kernel/bin)
       
    37 
       
    38