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:
16 #-------------------------------------------------------------------
17 #Add this *.cmake file to our source tree
18 #-------------------------------------------------------------------
20 #Make sure all the output from all projects will go in one place
21 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
22 #Visual Studio IDE folders
23 source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$")
24 source_group(Includes REGULAR_EXPRESSION ".+\\.h$")
25 source_group(Def REGULAR_EXPRESSION ".+\\.def$")
26 #-------------------------------------------------------------------
30 #-------------------------------------------------------------------
31 #Add custom commands to generate config.cpp and values.cpp
32 #-------------------------------------------------------------------
33 #perl halcfg.pl hal_data.h values.hda values.cpp
35 OUTPUT ${PROJECT_SOURCE_DIR}/os/boardsupport/emulator/emulatorbsp/hal/values.cpp
36 COMMAND perl ./os/kernelhwsrv/halservices/hal/halcfg.pl ./os/kernelhwsrv/halservices/hal/inc/hal_data.h ./os/boardsupport/emulator/emulatorbsp/hal/values.hda ./os/boardsupport/emulator/emulatorbsp/hal/values.cpp
37 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
38 COMMENT "Generating HAL values..."
39 DEPENDS ./os/kernelhwsrv/halservices/hal/halcfg.pl ./os/kernelhwsrv/halservices/hal/inc/hal_data.h ./os/boardsupport/emulator/emulatorbsp/hal/values.hda
43 #perl halcfg.pl -x hal_data.h config.hcf config.cpp
45 OUTPUT ${PROJECT_SOURCE_DIR}/os/boardsupport/emulator/emulatorbsp/hal/config.cpp
46 COMMAND perl ./os/kernelhwsrv/halservices/hal/halcfg.pl -x ./os/kernelhwsrv/halservices/hal/inc/hal_data.h ./os/boardsupport/emulator/emulatorbsp/hal/config.hcf ./os/boardsupport/emulator/emulatorbsp/hal/config.cpp
47 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
48 COMMENT "Generating HAL config..."
49 DEPENDS ./os/kernelhwsrv/halservices/hal/halcfg.pl ./os/kernelhwsrv/halservices/hal/inc/hal_data.h ./os/boardsupport/emulator/emulatorbsp/hal/config.hcf
53 #Tell cmake those files won't be available until build time
54 set_source_files_properties(${PROJECT_SOURCE_DIR}/os/boardsupport/emulator/emulatorbsp/hal/values.cpp PROPERTIES GENERATED 1)
55 set_source_files_properties(${PROJECT_SOURCE_DIR}/os/boardsupport/emulator/emulatorbsp/hal/config.cpp PROPERTIES GENERATED 1)
56 #-------------------------------------------------------------------
60 #-------------------------------------------------------------------
61 #Define our source and target
62 #-------------------------------------------------------------------
64 set (sourcepath ../../../../kernelhwsrv/halservices/hal/src/)
65 add_source(hal_main.cpp userhal.cpp)
67 #Hoping we include the right entry point
68 set (sourcepath ../../../../kernelhwsrv/kernel/eka/euser/epoc/win32/)
69 #add_source(uc_dll.cpp) #uc_atx.cpp
73 #TODO: add the generated CPPs
76 add_library (hal SHARED ${source}
77 ${PROJECT_SOURCE_DIR}/os/boardsupport/emulator/emulatorbsp/hal/config.cpp
78 ${PROJECT_SOURCE_DIR}/os/boardsupport/emulator/emulatorbsp/hal/values.cpp
80 #set_target_properties(hal PROPERTIES LINK_FLAGS "/ENTRY:_Win32DllMain") #Change the entry point
81 #set_target_properties(hal PROPERTIES COMPILE_FLAGS "/Zl") #No default library
82 set_target_properties(hal PROPERTIES LINK_FLAGS "/INCLUDE:__E32Dll")
83 #set_target_properties(hal PROPERTIES LINK_FLAGS "/INCLUDE:_DllMain")
84 target_link_libraries(hal edll euser)
85 #-------------------------------------------------------------------
87 #-------------------------------------------------------------------
88 #Fix up include directories
89 #-------------------------------------------------------------------
90 system_include(/epoc32/include)
91 system_include(/epoc32/include/platform)
92 user_include(../../../../kernelhwsrv/kernel/eka/include)
93 #-------------------------------------------------------------------
95 #-------------------------------------------------------------------
96 #Fix up compiler defines
97 #-------------------------------------------------------------------
99 #-------------------------------------------------------------------
102 #-------------------------------------------------------------------
104 #-------------------------------------------------------------------
106 public_export(${PROJECT_SOURCE_DIR}/os/kernelhwsrv/halservices/hal/inc/hal_int.h /kernel)
107 public_export(${PROJECT_SOURCE_DIR}/os/kernelhwsrv/halservices/hal/inc/hal_data.h /)
108 public_export(${PROJECT_SOURCE_DIR}/os/kernelhwsrv/halservices/hal/inc/hal.h /)
110 #-------------------------------------------------------------------