annotate maintainers_refactor_the_build_system_to_allow_standalone_rathaxes_projects_with_cmake.patch @ 55:b2fe898b6957

Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
author Louis Opter <kalessin@kalessin.fr>
date Fri, 27 Jan 2012 20:12:21 +0100
parents 1f78508dbaa2
children 37d5953fc236
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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)
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
50 @@ -60,7 +50,6 @@
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
51 MESSAGE(STATUS "ps2pdf (shipped with ghostscript) and pdflatex needed to generate documentation.")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
52 ENDIF (PDFLATEX_COMPILER AND PS2PDF_CONVERTER)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
53
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
54 -ADD_SUBDIRECTORY(maintainers)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
55 ADD_SUBDIRECTORY(rathaxes)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
56
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
57 # Install rules ################################################################
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
58 @@ -87,7 +76,7 @@
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
59 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
60 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
61 "/\\\\.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
62 - ".*\\\\.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
63 + ".*\\\\.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
64 "/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
65 "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
66 ".*install.*\\\\.(cmake|txt)$"
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
67 @@ -95,6 +84,8 @@
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
68 ".*CPack.*([^t][^x][^t])$"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
69 "/Test_.*/"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
70 "/build/"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
71 + ".*\\\\.r?tree$"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
72 + ".*\\\\.pp$"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
73 # delete some legacy stuff and save some space:
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
74 "/management/"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
75 "/epitech/2009/"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
76 @@ -110,7 +101,7 @@
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
77 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${RATHAXES_SOURCE_DIR}/maintainers/CMakeScripts/CPackDescription.txt")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
78 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Rathaxes, the cross-platform driver generator.")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
79 SET(CPACK_PACKAGE_INSTALL_DIRECTORY ${PACKAGE_FILE_NAME})
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
80 -SET(CPACK_PACKAGE_VENDOR "Rathaxes Team")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
81 +SET(CPACK_PACKAGE_VENDOR "Rathaxes")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
82
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
83 SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_SOURCE_FILE_NAME})
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
84 SET(CPACK_SOURCE_IGNORE_FILES ${IGNORE_PATTERNS})
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
85 @@ -125,9 +116,11 @@
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
86 ENDIF (UNIX)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
87
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
88 IF (WIN32)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
89 - SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Rathaxes.lnk' '%comspec%' '/k bin\\\\rathaxesvars.bat'")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
90 SET(CPACK_GENERATOR "NSIS")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
91 SET(CPACK_SOURCE_GENERATOR "ZIP")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
92 + SET(CPACK_NSIS_MODIFY_PATH ON)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
93 ENDIF (WIN32)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
94
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
95 +ADD_SUBDIRECTORY(maintainers)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
96 +
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
97 INCLUDE(CPack)
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
98 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
99 --- 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
100 +++ 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
101 @@ -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
102 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
103 DESTINATION lib/rathaxes/)
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
104
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
105 -# 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
106 +# 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
107
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
108 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
109 +
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 +# 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
111 +
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
112 +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
113 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
114 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
115 --- /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
116 +++ 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
117 @@ -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
118 +# 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
119 +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
120 + 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
121 + 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
122 + 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
123 + 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
124 +
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
125 +# 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
126 +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
127 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
128 --- 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
129 +++ 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
130 @@ -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
131 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
132 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
133 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
134 - 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
135 + 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
136 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
137 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
138 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
139 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
140 --- 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
141 +++ 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
142 @@ -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
143 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
144 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
145 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
146 +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
147 + 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
148 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
149
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
150 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
151 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
152 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
153 --- /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
154 +++ 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
155 @@ -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
156 +# 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
157 +#
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 +# 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
159 +# 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
160 +#
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 +# 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
162 +
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 +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
164 + 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
165 + 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
166 + 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
167 + 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
168 +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
169 + 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
170 +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
171 +
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 +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
173 +
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 +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
175 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
176 --- 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
177 +++ 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
178 @@ -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
179 +# 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
180 +#
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
181 +# 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
182 +# 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
183 +# 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
184 +
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
185 +# Functions ####################################################################
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
186 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
187 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
188 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
189 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
190 @@ -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
191 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
192 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
193 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
194 - "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
195 + "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
196 "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
197 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
198
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
199 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
200 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
201 - "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
202 + "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
203 "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
204 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
205
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
206 @@ -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
207 # 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
208 # 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
209 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
210 - 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
211 + 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
212 "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
213 "${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
214 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
215 @@ -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
216 # 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
217 # 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
218 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
219 - 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
220 - ${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
221 - "-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
222 - "-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
223 - "-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
224 - "-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
225 -
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
226 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
227
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
228 # 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
229 @@ -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
230 # 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
231 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
232 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
233 - 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
234 + 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
235 ${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
236 ${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
237 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
238 @@ -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
239 # 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
240 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
241 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
242 - 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
243 - "${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
244 + 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
245
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
246 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
247 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
248 @@ -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
249 # 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
250 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
251 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
252 - 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
253 - "${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
254 + 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
255
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
256 - 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
257 - "${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
258 + 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
259
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
260 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
261 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
262 @@ -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
263 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
264 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
265 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
266 +
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
267 +# 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
268 +#
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
269 +# 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
270 +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
271 + # 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
272 + 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
273 + 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
274 + 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
275 + 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
276 +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
277 +
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
278 +# Code #########################################################################
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
279 +
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
280 +# 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
281 +# 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
282 +# 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
283 +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
284 +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
285 +
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
286 +# Find additional dependencies:
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
287 +
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
288 +# 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
289 +# 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
290 +# 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
291 +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
292 + 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
293 +
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
294 + 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
295 + ${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
296 + "-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
297 + "-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
298 + "-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
299 + "-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
300 + 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
301 +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
302 + 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
303 +
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 + 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
305 +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
306 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
307 +# 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
308 +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
309 + 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
310 + 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
311 + 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
312 + 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
313 +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
314 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
315 +# 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
316 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
317 +# 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
318 +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
319 + 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
320 +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
321 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
322 --- 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
323 +++ b/maintainers/bin/CMakeLists.txt
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
324 @@ -10,16 +10,14 @@
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
325 # On windows you have to use relative paths and install the proper
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
326 # shortcut using nsis.
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
327 SET(PATH_PREFIX "")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
328 - SET(RATHAXES_SCRIPT_NAME "rathaxesvars.bat")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
329 -
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
330 - INSTALL(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/rathaxes.bat" DESTINATION bin)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
331 + SET(RATHAXES_SCRIPT_NAME "rathaxes.bat")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
332 ELSE (WIN32)
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
333 SET(PATH_PREFIX "${CMAKE_INSTALL_PREFIX}")
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
334 SET(RATHAXES_SCRIPT_NAME "rathaxes")
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 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
336
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
337 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
338 -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
339 +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
340 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
341
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
342 CONFIGURE_FILE("${RATHAXES_SCRIPT_NAME}.in" "${RATHAXES_SCRIPT_NAME}" @ONLY)
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
343 diff --git a/maintainers/bin/rathaxes.bat b/maintainers/bin/rathaxes.bat.in
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
344 rename from maintainers/bin/rathaxes.bat
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
345 rename to maintainers/bin/rathaxes.bat.in
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
346 --- a/maintainers/bin/rathaxes.bat
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
347 +++ b/maintainers/bin/rathaxes.bat.in
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
348 @@ -1,6 +1,18 @@
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
349 @echo off
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
350
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
351 -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
352 -rem Windows.
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
353 +for /f "tokens=2,*" %%a in ('reg query HKLM\Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_NAME@ /ve ^| findstr "(Default)"') do set RATHAXES_PATH=%%b
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
354
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
355 -%CODEWORKER% --quiet %INCLUDE_PATHS% -script %COMPILER_PATH%/rathaxes.cws -args %COMPILER_PATH%/rathaxes.cws %LOCAL_CACHE_PATH% %*
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
356 +rem This variable is simply used as a shortcut to the Rathaxes install
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
357 +rem directory (since we never know where it can be on Windows). Useful to
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
358 +rem specify some paths in the documentation. This is also used by the
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
359 +rem FindCodeWorker CMake finder.
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
360 +set CNORM_PATH="%RATHAXES_PATH%@CNORM_PATH@"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
361 +set RATHAXES_LIB="%RATHAXES_PATH%@RATHAXES_LIB@"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
362 +set COMPILER_PATH="%RATHAXES_PATH%@RATHAXES_LIB@/compiler"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
363 +set LOCAL_CACHE_PATH="%LOCALAPPDATA%\\Rathaxes\\cache\\"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
364 +
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
365 +set INCLUDE_PATHS=-I %CNORM_PATH% -I %COMPILER_PATH%
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
366 +
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
367 +set CODEWORKER="%RATHAXES_PATH%@CODEWORKER_PATH@"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
368 +
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
369 +%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
370 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
371 --- 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
372 +++ 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
373 @@ -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
374 #!/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
375
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
376 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
377 -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
378 +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
379 +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
380 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
381
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
382 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
383
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
384 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
385 - -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
386 + -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
387 diff --git a/maintainers/bin/rathaxesvars.bat.in b/maintainers/bin/rathaxesvars.bat.in
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
388 deleted file mode 100644
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
389 --- a/maintainers/bin/rathaxesvars.bat.in
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
390 +++ /dev/null
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
391 @@ -1,15 +0,0 @@
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
392 -@echo off
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
393 -
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
394 -echo -- Setting up the Rathaxes environment
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
395 -
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
396 -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
397 -set COMPILER_PATH="%CD%@COMPILER_PATH@"
55
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
398 -set LOCAL_CACHE_PATH="%LOCALAPPDATA%\\Rathaxes\\cache\\"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
399 -
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
400 -set INCLUDE_PATHS=-I %CNORM_PATH% -I %COMPILER_PATH%
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
401 -
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
402 -set CODEWORKER="%CD%@CODEWORKER_PATH@"
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
403 -
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
404 -echo -- Adding Rathaxes to the search path
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
405 -
b2fe898b6957 Get RATHAXES_PATH from the registry and allow the installer to add rathaxes in the PATH
Louis Opter <kalessin@kalessin.fr>
parents: 54
diff changeset
406 -set PATH=%CD%/bin;%PATH%
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
407 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
408 --- 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
409 +++ 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
410 @@ -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
411
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
412 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
413 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
414 -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
415 +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
416 + 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
417 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
418 +# 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
419 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
420 +# 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
421 +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
422 + 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
423 + 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
424 +
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
425 +# UseRathaxes.cmake
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
426 +INSTALL(FILES
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
427 + ${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
428 + 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
429 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
430 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
431 --- /dev/null
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
432 +++ 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
433 @@ -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
434 +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
435 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
436 +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
437 +
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
438 +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
439 +
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
440 +INCLUDE(UseRathaxes)
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
441 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
442 +ENABLE_TESTING()
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
443 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
444 +ADD_SUBDIRECTORY(helloworld)
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
445 +ADD_SUBDIRECTORY(syntax)
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
446 +ADD_SUBDIRECTORY(e1000)
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
447 +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
448 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
449 --- 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
450 +++ 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
451 @@ -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
452 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
453
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
454 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
455 - 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
456 + 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
457 + 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
458 + 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
459 + 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
460 + 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
461 ENDIF (WIN32)