Mercurial > archived > louis > epitech > mq > rathaxes
annotate maintainers_refactor_the_build_system_to_allow_standalone_rathaxes_projects_with_cmake.patch @ 54:1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
author | Louis Opter <louis@lse.epitech.net> |
---|---|
date | Thu, 26 Jan 2012 21:40:22 +0100 |
parents | 92b87bf82dd8 |
children | b2fe898b6957 |
rev | line source |
---|---|
46
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
1 # HG changeset patch |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
2 # Parent 0861918d54e44cb25af0153bcac15647351ef6b1 |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
3 maintainers: make UseRathaxes.cmake usable in standalone projects |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
4 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
5 - UseRathaxes now does more Rathaxes related things (like search for |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
6 Codeworker); |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
7 - UseRathaxes (as well as FindCodeWorker, FindRathaxes...) could be distributed |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
8 with Rathaxes (i.e installed when you install Rathaxes) but then you have the |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
9 problem of finding the CMakeLists files from your (separate) project. That's |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
10 why I think it's simpler to just copy the CMakeLists each time in each |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
11 project (for now); |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
12 - Currently used by the examples; |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
13 - Should make the first steps guide really usable now; |
46
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
14 |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
15 diff --git a/CMakeLists.txt b/CMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
16 --- a/CMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
17 +++ b/CMakeLists.txt |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
18 @@ -25,29 +25,19 @@ |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
19 # FILE(REMOVE "CMakeCache.txt") doesn't work so include it into the snippet. |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
20 ENDIF (${RATHAXES_SOURCE_DIR} STREQUAL ${RATHAXES_BINARY_DIR}) |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
21 |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
22 -SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RATHAXES_SOURCE_DIR}/maintainers/CMakeScripts) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
23 +LIST(APPEND CMAKE_MODULE_PATH ${RATHAXES_SOURCE_DIR}/maintainers/CMakeScripts) |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
24 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
25 +INCLUDE(UseRathaxes) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
26 FIND_PACKAGE(LATEX) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
27 -FIND_PACKAGE(CodeWorker REQUIRED) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
28 -FIND_PACKAGE(LinuxKBuildDir) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
29 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
30 INCLUDE(AddFileDependencies) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
31 INCLUDE(FileCopy) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
32 INCLUDE(RathaxesCopyLatexClasses) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
33 -INCLUDE(UseRathaxes) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
34 - |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
35 -IF (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT LINUX_KBUILD_DIR) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
36 - MESSAGE(STATUS "No valid Linux build tree found, kernel modules will not be built") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
37 -ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT LINUX_KBUILD_DIR) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
38 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
39 # Global definitions ########################################################### |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
40 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
41 ENABLE_TESTING() |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
42 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
43 -IF (CMAKE_COMPILER_IS_GNUCC) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
44 - SET(CMAKE_C_FLAGS "-pipe -Wextra -Wall -std=c99") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
45 -ENDIF (CMAKE_COMPILER_IS_GNUCC) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
46 - |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
47 # Subdirectories ############################################################### |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
48 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
49 IF (PDFLATEX_COMPILER AND PS2PDF_CONVERTER) |
54
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
50 @@ -87,7 +77,7 @@ |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
51 SET(PACKAGE_NAME "rathaxes") |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
52 SET(IGNORE_PATTERNS |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
53 "/\\\\.hg.*" |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
54 - ".*\\\\.sw.?$" |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
55 + ".*\\\\.sw.$" |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
56 "/CMakeFiles/" |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
57 "CMakeCache.txt" |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
58 ".*install.*\\\\.(cmake|txt)$" |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
59 diff --git a/maintainers/CMakeLists.txt b/maintainers/CMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
60 --- a/maintainers/CMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
61 +++ b/maintainers/CMakeLists.txt |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
62 @@ -10,6 +10,10 @@ |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
63 INSTALL(PROGRAMS ${CODEWORKER_BINARY_PATH} |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
64 DESTINATION lib/rathaxes/) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
65 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
66 -# Generate the install rules for the rathaxes binaries: |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
67 +# Generate the install rules for the rathaxes binaries |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
68 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
69 ADD_SUBDIRECTORY(bin) |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
70 + |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
71 +# Install the Rathaxes CMakeScripts library |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
72 + |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
73 +ADD_SUBDIRECTORY(CMakeScripts) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
74 diff --git a/maintainers/CMakeScripts/CMakeLists.txt b/maintainers/CMakeScripts/CMakeLists.txt |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
75 new file mode 100644 |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
76 --- /dev/null |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
77 +++ b/maintainers/CMakeScripts/CMakeLists.txt |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
78 @@ -0,0 +1,9 @@ |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
79 +# CMakeScripts |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
80 +INSTALL(FILES |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
81 + FindCodeWorker.cmake |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
82 + FindRathaxes.cmake |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
83 + FindLinuxKBuildDir.cmake |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
84 + DESTINATION share/rathaxes/CMakeScripts/) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
85 + |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
86 +# Templates used by the CMakeScripts |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
87 +INSTALL(DIRECTORY Templates DESTINATION share/rathaxes/CMakeScripts/) |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
88 diff --git a/maintainers/CMakeScripts/FindCodeWorker.cmake b/maintainers/CMakeScripts/FindCodeWorker.cmake |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
89 --- a/maintainers/CMakeScripts/FindCodeWorker.cmake |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
90 +++ b/maintainers/CMakeScripts/FindCodeWorker.cmake |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
91 @@ -50,7 +50,7 @@ |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
92 IF (UNIX) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
93 EXECUTE_PROCESS(COMMAND "chmod" "+x" "${CODEWORKER_BINARY_PATH}") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
94 IF (CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
95 - MESSAGE(STATUS "CodeWorker needs the 32bit compatability libraries (ia32-libs), make sure you have them!") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
96 + MESSAGE(STATUS "CodeWorker needs the 32bit compatibility libraries (ia32-libs), make sure you have them!") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
97 ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
98 ENDIF (UNIX) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
99 ELSE (${CODEWORKER_DL_RETURN} EQUAL 0) |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
100 diff --git a/maintainers/CMakeScripts/FindLinuxKBuildDir.cmake b/maintainers/CMakeScripts/FindLinuxKBuildDir.cmake |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
101 --- a/maintainers/CMakeScripts/FindLinuxKBuildDir.cmake |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
102 +++ b/maintainers/CMakeScripts/FindLinuxKBuildDir.cmake |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
103 @@ -34,6 +34,8 @@ |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
104 SET(LINUX_KBUILD_DIR "${KDIR}" CACHE PATH "Path to the Linux KBuild directory (usually /lib/modules/`uname -r`/build/)") |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
105 ENDIF (LINUX_KBUILD_DIR_MAKEFILE) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
106 ENDIF (IS_DIRECTORY "${KDIR}") |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
107 +ELSE (NOT LINUX_KBUILD_DIR) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
108 + SET(LINUXKBUILDDIR_FIND_QUIETLY TRUE) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
109 ENDIF (NOT LINUX_KBUILD_DIR) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
110 |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
111 INCLUDE(FindPackageHandleStandardArgs) |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
112 diff --git a/maintainers/CMakeScripts/FindRathaxes.cmake b/maintainers/CMakeScripts/FindRathaxes.cmake |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
113 new file mode 100644 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
114 --- /dev/null |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
115 +++ b/maintainers/CMakeScripts/FindRathaxes.cmake |
54
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
116 @@ -0,0 +1,19 @@ |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
117 +# Package Finder for Rathaxes and CMake. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
118 +# |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
119 +# This finder simply seek for the rathaxes compiler and stores its path in the |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
120 +# variable RATHAXES_BINARY_PATH, if rathaxes is found. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
121 +# |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
122 +# This finder is used internally by UseRathaxes. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
123 + |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
124 +IF (NOT RATHAXES_BINARY_PATH) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
125 + FIND_PROGRAM(RATHAXES_BINARY_PATH |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
126 + NAMES |
54
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
127 + rathaxes |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
128 + rathaxes.bat) |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
129 +ELSE (NOT RATHAXES_BINARY_PATH) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
130 + SET(RATHAXES_FIND_QUIETLY TRUE) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
131 +ENDIF (NOT RATHAXES_BINARY_PATH) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
132 + |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
133 +INCLUDE(FindPackageHandleStandardArgs) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
134 + |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
135 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Rathaxes DEFAULT_MSG RATHAXES_BINARY_PATH) |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
136 diff --git a/maintainers/CMakeScripts/UseRathaxes.cmake b/maintainers/CMakeScripts/UseRathaxes.cmake |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
137 --- a/maintainers/CMakeScripts/UseRathaxes.cmake |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
138 +++ b/maintainers/CMakeScripts/UseRathaxes.cmake |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
139 @@ -1,3 +1,11 @@ |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
140 +# CMake library to easily work on Rathaxes projects. |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
141 +# |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
142 +# Simply INCLUDE() it in your Rathaxes project. Obviously you need to have |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
143 +# Rathaxes installed to use it (unless you are a Rathaxes developer and |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
144 +# directly working on Rathaxes itself). |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
145 + |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
146 +# Functions #################################################################### |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
147 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
148 FUNCTION(_RTX_PARSE_OPTIONS ARGS RTI_OUT BLT_OUT SYSTEM_OUT) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
149 SET(OPTIONS "RTI" "BLT" "SYSTEM") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
150 SET(FILE_LISTS ${RTI_OUT} ${BLT_OUT} ${SYSTEM_OUT}) |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
151 @@ -38,13 +46,13 @@ |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
152 SYSTEMS) # [in] name of each target system |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
153 FOREACH(RTI ${RTI_FILES}) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
154 LIST(APPEND ${REGISTER_COMMANDS_OUT} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
155 - "COMMAND" ${_RTX_CODEWORKER_COMMAND} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
156 + "COMMAND" ${_USE_RATHAXES_CODEWORKER_COMMAND} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
157 "rti-register" "${CMAKE_CURRENT_SOURCE_DIR}/${RTI}") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
158 ENDFOREACH(RTI ${RTI_FILES}) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
159 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
160 FOREACH(BLT ${BLT_FILES}) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
161 LIST(APPEND ${REGISTER_COMMANDS_OUT} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
162 - "COMMAND" ${_RTX_CODEWORKER_COMMAND} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
163 + "COMMAND" ${_USE_RATHAXES_CODEWORKER_COMMAND} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
164 "blt-register" "${CMAKE_CURRENT_SOURCE_DIR}/${BLT}") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
165 ENDFOREACH(BLT ${BLT_FILES}) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
166 |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
167 @@ -53,7 +61,7 @@ |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
168 # At some point I guess we will use different directories instead of |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
169 # different file names. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
170 LIST(APPEND ${GENERATE_COMMANDS_OUT} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
171 - COMMAND ${_RTX_CODEWORKER_COMMAND} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
172 + COMMAND ${_USE_RATHAXES_CODEWORKER_COMMAND} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
173 "generate" "/o" "${OUT_NAME}_${OS}.c" "${OS}" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
174 "${CMAKE_CURRENT_SOURCE_DIR}/${RTX_FILE}") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
175 ENDFOREACH(OS ${SYSTEMS}) |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
176 @@ -85,13 +93,6 @@ |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
177 # At some point we will certainly have our own language definition for CMake |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
178 # but let's start with simpler things. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
179 FUNCTION(ADD_RATHAXES_SOURCES OUT_NAME RTX_FILE) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
180 - SET(_RTX_CODEWORKER_COMMAND |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
181 - ${CODEWORKER_BINARY_PATH} "-nologo" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
182 - "-I" "${RATHAXES_SOURCE_DIR}/maintainers/cnorm/src" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
183 - "-I" "${RATHAXES_SOURCE_DIR}/rathaxes/compiler/" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
184 - "-script" "${CMAKE_SOURCE_DIR}/rathaxes/compiler/rathaxes.cws" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
185 - "-args" "${CMAKE_SOURCE_DIR}/rathaxes/" "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/RathaxesCache/") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
186 - |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
187 LIST(REMOVE_ITEM ARGV ${OUT_NAME} ${RTX_FILE}) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
188 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
189 # We have to expand ARGV inside quotes, so it expand as a single LIST |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
190 @@ -118,7 +119,7 @@ |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
191 # that should be rebuilt automatically when its sources change. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
192 STRING(REPLACE ";" ", " SYSTEMS "${SYSTEMS}") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
193 ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUTS} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
194 - COMMAND ${_RTX_CODEWORKER_COMMAND} "cache" "clear" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
195 + COMMAND ${_USE_RATHAXES_CODEWORKER_COMMAND} "cache" "clear" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
196 ${REGISTER_COMMANDS} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
197 ${GENERATE_COMMANDS} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
198 COMMENT "Building Rathaxes target ${OUT_NAME} for ${SYSTEMS}" |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
199 @@ -188,8 +189,7 @@ |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
200 # Generate the Linux Makefile to build a Linux kernel module |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
201 SET(MODULE_MAKEFILE "${MODULE_BUILD_DIR}/Makefile") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
202 SET(LKM_OBJECTS "${RATHAXES_SOURCE}_${SYSTEM}.o") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
203 - CONFIGURE_FILE("${RATHAXES_SOURCE_DIR}/maintainers/CMakeScripts/Templates/MakefileLKM.in" |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
204 - "${MODULE_MAKEFILE}") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
205 + CONFIGURE_FILE("${_USE_RATHAXES_LIST_DIR}/Templates/MakefileLKM.in" "${MODULE_MAKEFILE}") |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
206 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
207 SET(KERNEL_OBJECT_NAME "${RATHAXES_SOURCE}_${SYSTEM}.ko") |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
208 ADD_CUSTOM_COMMAND(OUTPUT "${KERNEL_OBJECT_NAME}" |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
209 @@ -216,11 +216,9 @@ |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
210 # Generate the Windows Makefile to build a Windows kernel module |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
211 SET(MODULE_SOURCES "${MODULE_BUILD_DIR}/sources") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
212 SET(LKM_SOURCES "${RATHAXES_SOURCE}_${SYSTEM}.c") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
213 - CONFIGURE_FILE("${RATHAXES_SOURCE_DIR}/maintainers/CMakeScripts/Templates/sources.in" |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
214 - "${MODULE_SOURCES}") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
215 + CONFIGURE_FILE("${_USE_RATHAXES_LIST_DIR}/Templates/sources.in" "${MODULE_SOURCES}") |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
216 |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
217 - SET(WINDOWS_MAKEFILE |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
218 - "${RATHAXES_SOURCE_DIR}/maintainers/CMakeScripts/Templates/Windows_Makefile") |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
219 + SET(WINDOWS_MAKEFILE "${_USE_RATHAXES_LIST_DIR}/Templates/Windows_Makefile") |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
220 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
221 SET(KERNEL_OBJECT_NAME "${RATHAXES_SOURCE}_${SYSTEM}.sys") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
222 ADD_CUSTOM_COMMAND(OUTPUT "${KERNEL_OBJECT_NAME}" |
54
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
223 @@ -237,3 +235,58 @@ |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
224 MESSAGE(STATUS "Don't know how to build kernel modules for ${SYSTEM} (yet)") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
225 ENDIF (${SYSTEM} MATCHES "Linux") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
226 ENDFUNCTION(ADD_RATHAXES_LKM NAME RATHAXES_SOURCE) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
227 + |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
228 +# Like FIND_PACKAGE but also search in the Rathaxes directories. Usage: |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
229 +# |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
230 +# FIND_RATHAXES_PACKAGE(PACKAGE [REQUIRED]) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
231 +FUNCTION(FIND_RATHAXES_PACKAGE NAME) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
232 + # The environment variable is set by rathaxesvars.bat on Windows |
54
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
233 + FOREACH(I ${CMAKE_SYSTEM_PREFIX_PATH} $ENV{RATHAXES_PATH}) |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
234 + LIST(APPEND CMAKE_MODULE_PATH "${I}/share/rathaxes/CMakeScripts") |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
235 + ENDFOREACH(I ${CMAKE_SYSTEM_PREFIX_PATH} $ENV{RATHAXES_PATH}) |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
236 + FIND_PACKAGE(${NAME} ${ARGV2}) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
237 +ENDFUNCTION(FIND_RATHAXES_PACKAGE NAME) |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
238 + |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
239 +# Code ######################################################################### |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
240 + |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
241 +# Inside a FUNCTION OR MACRO CMAKE_CURRENT_LIST_{DIR,FILE} return the path of |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
242 +# the caller CMakeLists.txt. Additionaly, CMAKE_CURRENT_LIST_DIR is a feature |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
243 +# of CMake >= 2.8.3. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
244 +GET_FILENAME_COMPONENT(_USE_RATHAXES_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH CACHE) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
245 +MARK_AS_ADVANCED(_USE_RATHAXES_LIST_DIR) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
246 + |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
247 +# Find additional dependencies: |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
248 + |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
249 +# If we are within the Rathaxes project directly use CodeWorker and directly |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
250 +# point to the compiler files within the repository. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
251 +# Else use the "system" rathaxes binary. |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
252 +IF (${PROJECT_NAME} STREQUAL RATHAXES) |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
253 + FIND_RATHAXES_PACKAGE(CodeWorker REQUIRED) |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
254 + |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
255 + SET(_USE_RATHAXES_CODEWORKER_COMMAND |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
256 + ${CODEWORKER_BINARY_PATH} "-nologo" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
257 + "-I" "${RATHAXES_SOURCE_DIR}/maintainers/cnorm/src" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
258 + "-I" "${RATHAXES_SOURCE_DIR}/rathaxes/compiler/" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
259 + "-script" "${CMAKE_SOURCE_DIR}/rathaxes/compiler/rathaxes.cws" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
260 + "-args" "${CMAKE_SOURCE_DIR}/rathaxes/" "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/RathaxesCache/" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
261 + CACHE INTERNAL "CodeWorker command to -manually- invoke the Rathaxes compiler") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
262 +ELSE (${PROJECT_NAME} STREQUAL RATHAXES) |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
263 + FIND_RATHAXES_PACKAGE(Rathaxes REQUIRED) |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
264 + |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
265 + SET(_USE_RATHAXES_CODEWORKER_COMMAND ${RATHAXES_BINARY_PATH} CACHE INTERNAL "Rathaxes command") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
266 +ENDIF (${PROJECT_NAME} STREQUAL RATHAXES) |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
267 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
268 +# Only do this on Linux, as far as I know nobody compiles Linux from another OS. |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
269 +IF (CMAKE_SYSTEM_NAME MATCHES "Linux") |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
270 + FIND_RATHAXES_PACKAGE(LinuxKBuildDir) |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
271 + IF (LINUX_KBUILD_DIR) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
272 + MESSAGE(STATUS "No valid Linux build tree found, Linux kernel modules will not be built") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
273 + ENDIF (LINUX_KBUILD_DIR) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
274 +ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
275 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
276 +# Set some compiler options: |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
277 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
278 +# Set some sane flags that should be used in every project made with Rathaxes |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
279 +IF (CMAKE_COMPILER_IS_GNUCC) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
280 + SET(CMAKE_C_FLAGS "-pipe -Wextra -Wall -std=c99") |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
281 +ENDIF (CMAKE_COMPILER_IS_GNUCC) |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
282 diff --git a/maintainers/bin/CMakeLists.txt b/maintainers/bin/CMakeLists.txt |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
283 --- a/maintainers/bin/CMakeLists.txt |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
284 +++ b/maintainers/bin/CMakeLists.txt |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
285 @@ -19,7 +19,7 @@ |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
286 ENDIF (WIN32) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
287 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
288 SET(CNORM_PATH "${PATH_PREFIX}/lib/rathaxes/cnorm/") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
289 -SET(COMPILER_PATH "${PATH_PREFIX}/lib/rathaxes/compiler/") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
290 +SET(RATHAXES_LIB "${PATH_PREFIX}/lib/rathaxes") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
291 SET(CODEWORKER_PATH "${PATH_PREFIX}/lib/rathaxes/codeworker${CMAKE_EXECUTABLE_SUFFIX}") |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
292 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
293 CONFIGURE_FILE("${RATHAXES_SCRIPT_NAME}.in" "${RATHAXES_SCRIPT_NAME}" @ONLY) |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
294 diff --git a/maintainers/bin/rathaxes.bat b/maintainers/bin/rathaxes.bat |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
295 --- a/maintainers/bin/rathaxes.bat |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
296 +++ b/maintainers/bin/rathaxes.bat |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
297 @@ -1,6 +1,3 @@ |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
298 @echo off |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
299 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
300 -rem We have to explicitely give the path of the script as the first argument on |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
301 -rem Windows. |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
302 - |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
303 -%CODEWORKER% --quiet %INCLUDE_PATHS% -script %COMPILER_PATH%/rathaxes.cws -args %COMPILER_PATH%/rathaxes.cws %LOCAL_CACHE_PATH% %* |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
304 +%CODEWORKER% --quiet %INCLUDE_PATHS% -script %COMPILER_PATH%/rathaxes.cws -args %RATHAXES_LIB% %LOCAL_CACHE_PATH% %* |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
305 diff --git a/maintainers/bin/rathaxes.in b/maintainers/bin/rathaxes.in |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
306 --- a/maintainers/bin/rathaxes.in |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
307 +++ b/maintainers/bin/rathaxes.in |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
308 @@ -1,10 +1,11 @@ |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
309 #!/bin/sh |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
310 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
311 CNORM_PATH="@CNORM_PATH@" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
312 -COMPILER_PATH="@COMPILER_PATH@" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
313 +RATHAXES_LIB="@RATHAXES_LIB@" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
314 +COMPILER_PATH="$RATHAXES_LIB/compiler" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
315 LOCAL_CACHE_PATH=${LOCAL_CACHE_PATH:-~/.rathaxes/cache} |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
316 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
317 INCLUDE_PATHS="-I $CNORM_PATH -I $COMPILER_PATH" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
318 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
319 exec @CODEWORKER_PATH@ --quiet $INCLUDE_PATHS \ |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
320 - -script $COMPILER_PATH/rathaxes.cws -args $COMPILER_PATH $LOCAL_CACHE_PATH $* |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
321 + -script $COMPILER_PATH/rathaxes.cws -args $RATHAXES_LIB $LOCAL_CACHE_PATH $* |
46
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
322 diff --git a/maintainers/bin/rathaxesvars.bat.in b/maintainers/bin/rathaxesvars.bat.in |
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
323 --- a/maintainers/bin/rathaxesvars.bat.in |
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
324 +++ b/maintainers/bin/rathaxesvars.bat.in |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
325 @@ -2,8 +2,14 @@ |
46
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
326 |
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
327 echo -- Setting up the Rathaxes environment |
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
328 |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
329 +rem This variable is simply used as a shortcut to the Rathaxes install |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
330 +rem directory (since we never know where it can be on Windows). Useful to |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
331 +rem specify some paths in the documentation. This is also used by the |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
332 +rem FindCodeWorker CMake finder. |
54
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
333 +set RATHAXES_PATH=%CD% |
46
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
334 set CNORM_PATH="%CD%@CNORM_PATH@" |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
335 -set COMPILER_PATH="%CD%@COMPILER_PATH@" |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
336 +set RATHAXES_LIB="%CD%@RATHAXES_LIB@" |
54
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
337 +set COMPILER_PATH="%CD%@RATHAXES_LIB@/compiler" |
46
1cf60e316d19
Finish the patch on the doc and start a patch to fix the "rathaxes" binaries
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
338 set LOCAL_CACHE_PATH="%LOCALAPPDATA%\\Rathaxes\\cache\\" |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
339 |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
340 set INCLUDE_PATHS=-I %CNORM_PATH% -I %COMPILER_PATH% |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
341 diff --git a/rathaxes/CMakeLists.txt b/rathaxes/CMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
342 --- a/rathaxes/CMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
343 +++ b/rathaxes/CMakeLists.txt |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
344 @@ -26,4 +26,17 @@ |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
345 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
346 INSTALL(DIRECTORY compiler DESTINATION lib/rathaxes |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
347 PATTERN compiler/tests EXCLUDE) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
348 -INSTALL(DIRECTORY samples DESTINATION share/doc/rathaxes) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
349 +INSTALL(DIRECTORY samples DESTINATION share/doc/rathaxes |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
350 + PATTERN "SamplesCMakeLists.txt" EXCLUDE) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
351 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
352 +# Install rules for the "standalone" build system to generate the examples: |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
353 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
354 +# Top-level CMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
355 +INSTALL(FILES samples/SamplesCMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
356 + DESTINATION share/doc/rathaxes/samples |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
357 + RENAME CMakeLists.txt) |
53
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
358 + |
92b87bf82dd8
WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents:
52
diff
changeset
|
359 +# UseRathaxes.cmake |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
360 +INSTALL(FILES |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
361 + ${RATHAXES_SOURCE_DIR}/maintainers/CMakeScripts/UseRathaxes.cmake |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
362 + DESTINATION share/doc/rathaxes/samples/CMakeScripts/) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
363 diff --git a/rathaxes/samples/SamplesCMakeLists.txt b/rathaxes/samples/SamplesCMakeLists.txt |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
364 new file mode 100644 |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
365 --- /dev/null |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
366 +++ b/rathaxes/samples/SamplesCMakeLists.txt |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
367 @@ -0,0 +1,14 @@ |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
368 +PROJECT(RTX_SAMPLES C) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
369 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
370 +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
371 + |
52
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
372 +LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeScripts) |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
373 + |
0ca794649028
Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents:
51
diff
changeset
|
374 +INCLUDE(UseRathaxes) |
51
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
375 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
376 +ENABLE_TESTING() |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
377 + |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
378 +ADD_SUBDIRECTORY(helloworld) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
379 +ADD_SUBDIRECTORY(syntax) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
380 +ADD_SUBDIRECTORY(e1000) |
b109c72d897b
Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents:
46
diff
changeset
|
381 +ADD_SUBDIRECTORY(windows_minimal_lkm) |
54
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
382 diff --git a/rathaxes/samples/windows_minimal_lkm/CMakeLists.txt b/rathaxes/samples/windows_minimal_lkm/CMakeLists.txt |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
383 --- a/rathaxes/samples/windows_minimal_lkm/CMakeLists.txt |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
384 +++ b/rathaxes/samples/windows_minimal_lkm/CMakeLists.txt |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
385 @@ -3,5 +3,9 @@ |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
386 BLT log.blt lkm.blt) |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
387 |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
388 IF (WIN32) |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
389 - ADD_RATHAXES_LKM(minimal_lkm minimal_lkm_src) |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
390 + IF ("_not_a_var_$ENV{DDKBUILDENV}" STREQUAL "_not_a_var_chk") |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
391 + ADD_RATHAXES_LKM(minimal_lkm minimal_lkm_src) |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
392 + ELSE ("_not_a_var_$ENV{DDKBUILDENV}" STREQUAL "_not_a_var_chk") |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
393 + MESSAGE(STATUS "Not in the Checked Windows Driver Development Kit environment, not building the Windows LKM") |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
394 + ENDIF ("_not_a_var_$ENV{DDKBUILDENV}" STREQUAL "_not_a_var_chk") |
1f78508dbaa2
Wip on the build system, windows fixes (todo: put RATHAXES_PATH in the registry)
Louis Opter <louis@lse.epitech.net>
parents:
53
diff
changeset
|
395 ENDIF (WIN32) |