51
51
echo "" >> CMakeLists.txt
52
52
echo "############# $UpperName #################" >> CMakeLists.txt
53
echo "set (with_${LowerName} \"no\")" >> CMakeLists.txt
53
54
echo "if (\"\${enable-${LowerName}}\" STREQUAL \"yes\")" >> CMakeLists.txt
55
echo " message (STATUS \"> $AppletName:\")" >> CMakeLists.txt
54
56
echo " set (GETTEXT_$UpperName \${GETTEXT_PLUGINS})" >> CMakeLists.txt
55
57
echo " set (VERSION_$UpperName \"0.0.1\")" >> CMakeLists.txt
56
58
echo " set (PACKAGE_$UpperName \"cd-$AppletName\")" >> CMakeLists.txt
57
echo " set (${LowerName}datadir \"\${pluginsdatadir}/$AppletName\")" >> CMakeLists.txt
58
echo " configure_file ($AppletName/data/$AppletName.conf.in \${CMAKE_CURRENT_SOURCE_DIR}/$AppletName/data/$AppletName.conf)" >> CMakeLists.txt
59
echo " set (with_${LowerName} \"yes\")" >> CMakeLists.txt
60
echo " set (""${LowerName}""datadir \"\${pluginsdatadir}/$AppletName\")" >> CMakeLists.txt
61
echo " configure_file (\${CMAKE_CURRENT_SOURCE_DIR}/$AppletName/data/$AppletName.conf.in \${CMAKE_CURRENT_BINARY_DIR}/$AppletName/data/$AppletName.conf)" >> CMakeLists.txt
59
62
echo " add_subdirectory ($AppletName)" >> CMakeLists.txt
60
63
echo "endif()" >> CMakeLists.txt
64
echo "" >> CMakeLists.txt
65
echo "message (STATUS \" - with $AppletName applet: \${with_""${LowerName}""}\")" >> CMakeLists.txt
62
cmake -DCMAKE_INSTALL_PREFIX=/usr -D$AppletName=yes
67
echo "Compile it in the build directory" # not in the parent directory: it's cleaner to compile it there (yes I'm sure Fab ;) )
70
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -Denable-${LowerName}=yes
65
73
echo "Applet $AppletName has been generated."
66
74
echo "Now its' your turn ! type 'sudo make install' to install your applet."
75
echo "Use this command to compile it: mkdir -p build; cd build; cmake .. -DCMAKE_INSTALL_PREFIX=/usr -Denable-${LowerName}=yes; make"
76
echo "You can launch the 'make' commands only in this directory if you want: build/$AppletName"