annotate maintainers_refactor_the_build_system_to_allow_standalone_rathaxes_projects_with_cmake.patch @ 56:37d5953fc236

start to update the buildbot configuration
author Louis Opter <louis@lse.epitech.net>
date Thu, 02 Feb 2012 12:26:48 +0100
parents b2fe898b6957
children
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})
56
37d5953fc236 start to update the buildbot configuration
Louis Opter <louis@lse.epitech.net>
parents: 55
diff changeset
85 @@ -125,9 +116,12 @@
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
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")
56
37d5953fc236 start to update the buildbot configuration
Louis Opter <louis@lse.epitech.net>
parents: 55
diff changeset
92 + # Add a page in the installer wizard that ask to put rathaxes in the 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
93 + 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
94 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
95
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 +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
97 +
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
98 INCLUDE(CPack)
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
99 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
100 --- 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
101 +++ 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
102 @@ -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
103 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
104 DESTINATION lib/rathaxes/)
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
105
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 +# 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
108
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
109 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
110 +
92b87bf82dd8 WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents: 52
diff changeset
111 +# 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
112 +
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 +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
114 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
115 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
116 --- /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
117 +++ 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
118 @@ -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
119 +# 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
120 +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
121 + 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
122 + 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
123 + 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
124 + 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
125 +
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 +# 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
127 +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
128 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
129 --- 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
130 +++ 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
131 @@ -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
132 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
133 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
134 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
135 - 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
136 + 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
137 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
138 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
139 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
140 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
141 --- 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
142 +++ 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
143 @@ -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
144 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
145 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
146 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
147 +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
148 + 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
149 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
150
92b87bf82dd8 WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents: 52
diff changeset
151 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
152 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
153 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
154 --- /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
155 +++ 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
156 @@ -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
157 +# 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
158 +#
0ca794649028 Wip on the build system 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 +# 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
160 +# 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
161 +#
0ca794649028 Wip on the build system 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 +# 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
163 +
0ca794649028 Wip on the build system 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 +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
165 + 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
166 + 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
167 + 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
168 + 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
169 +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
170 + 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
171 +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
172 +
0ca794649028 Wip on the build system 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 +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
174 +
0ca794649028 Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents: 51
diff changeset
175 +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
176 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
177 --- 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
178 +++ 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
179 @@ -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
180 +# 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
181 +#
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
182 +# 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
183 +# 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
184 +# 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
185 +
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
186 +# Functions ####################################################################
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
187 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
188 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
189 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
190 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
191 @@ -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
192 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
193 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
194 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
195 - "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
196 + "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
197 "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
198 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
199
0ca794649028 Wip on the build system 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 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
201 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
202 - "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
203 + "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
204 "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
205 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
206
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
207 @@ -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
208 # 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
209 # 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
210 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
211 - 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
212 + 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
213 "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
214 "${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
215 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
216 @@ -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
217 # 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
218 # 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
219 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
220 - 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
221 - ${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
222 - "-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
223 - "-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
224 - "-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
225 - "-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
226 -
0ca794649028 Wip on the build system 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 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
228
0ca794649028 Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents: 51
diff changeset
229 # 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
230 @@ -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
231 # 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
232 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
233 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
234 - 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
235 + 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
236 ${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
237 ${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
238 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
239 @@ -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
240 # 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
241 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
242 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
243 - 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
244 - "${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
245 + 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
246
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
247 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
248 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
249 @@ -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
250 # 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
251 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
252 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
253 - 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
254 - "${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
255 + 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
256
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
257 - 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
258 - "${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
259 + 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
260
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
261 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
262 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
263 @@ -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
264 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
265 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
266 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
267 +
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
268 +# 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
269 +#
92b87bf82dd8 WIP on the build system, everything seems to work, need to check Windows now
Louis Opter <louis@lse.epitech.net>
parents: 52
diff changeset
270 +# FIND_RATHAXES_PACKAGE(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
271 +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
272 + # 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
273 + 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
274 + 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
275 + 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
276 + 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
277 +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
278 +
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
279 +# Code #########################################################################
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
280 +
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
281 +# 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
282 +# 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
283 +# 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
284 +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
285 +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
286 +
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
287 +# Find additional dependencies:
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
288 +
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
289 +# 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
290 +# 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
291 +# 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
292 +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
293 + 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
294 +
0ca794649028 Wip on the build system 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 + 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
296 + ${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
297 + "-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
298 + "-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
299 + "-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
300 + "-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
301 + 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
302 +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
303 + 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
304 +
0ca794649028 Wip on the build system 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 + 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
306 +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
307 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
308 +# 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
309 +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
310 + 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
311 + 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
312 + 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
313 + 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
314 +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
315 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
316 +# 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
317 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
318 +# 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
319 +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
320 + 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
321 +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
322 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
323 --- 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
324 +++ 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
325 @@ -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
326 # 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
327 # 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
328 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
329 - 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
330 -
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 - 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
332 + 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
333 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
334 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
335 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
336 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
337
0ca794649028 Wip on the build system 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(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
339 -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
340 +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
341 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
342
0ca794649028 Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents: 51
diff changeset
343 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
344 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
345 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
346 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
347 --- 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
348 +++ 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
349 @@ -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
350 @echo off
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
351
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
352 -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
353 -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
354 +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
355
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
356 -%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
357 +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
358 +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
359 +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
360 +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
361 +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
362 +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
363 +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
364 +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
365 +
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 +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
367 +
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 +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
369 +
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
370 +%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
371 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
372 --- 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
373 +++ 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
374 @@ -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
375 #!/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
376
0ca794649028 Wip on the build system 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 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
378 -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
379 +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
380 +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
381 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
382
0ca794649028 Wip on the build system 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 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
384
0ca794649028 Wip on the build system 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 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
386 - -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
387 + -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
388 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
389 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
390 --- 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
391 +++ /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
392 @@ -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
393 -@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
394 -
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 -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
396 -
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
397 -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
398 -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
399 -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
400 -
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 -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
402 -
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 -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
404 -
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 -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
406 -
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
407 -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
408 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
409 --- 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
410 +++ 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
411 @@ -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
412
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
413 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
414 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
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 +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
417 + 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
418 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
419 +# 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
420 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
421 +# 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
422 +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
423 + 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
424 + 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
425 +
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
426 +# UseRathaxes.cmake
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
427 +INSTALL(FILES
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
428 + ${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
429 + 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
430 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
431 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
432 --- /dev/null
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
433 +++ 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
434 @@ -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
435 +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
436 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
437 +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
438 +
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
439 +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
440 +
0ca794649028 Wip on the build system patch, use a FindRathaxes CMake finder, fix some paths in the installed rathaxes binaries
Louis Opter <louis@lse.epitech.net>
parents: 51
diff changeset
441 +INCLUDE(UseRathaxes)
51
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
442 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
443 +ENABLE_TESTING()
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
444 +
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
445 +ADD_SUBDIRECTORY(helloworld)
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
446 +ADD_SUBDIRECTORY(syntax)
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
447 +ADD_SUBDIRECTORY(e1000)
b109c72d897b Start a series to fix a bit the build system
Louis Opter <louis@lse.epitech.net>
parents: 46
diff changeset
448 +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
449 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
450 --- 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
451 +++ 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
452 @@ -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
453 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
454
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 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
456 - 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
457 + 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
458 + 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
459 + 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
460 + 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
461 + 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
462 ENDIF (WIN32)