Hi!
I've started to use the marvelous CMake (http://www.cmake.org) for generating makefiles.
The files you create for telling CMake how to generate the makefiles are all called "CMakeLists.txt".
To make it a little easier for me to edit these files, i made a syntax highlighting file for textpad and a new document class for "CMakeLists.txt"-files.
The problem is (of course) that textpad will never use this document class. Whenever i open a CMakeLists.txt file, textpad uses the "Text" document class, since this document class is used for all filenames on the form "*.txt" - including CMakeLists.txt!
So is there a way to syntax highlight CMakeLists.txt files differently than other txt-files?
Thanx for any help!
(i currently use textpad 4.7.3 if that makes any difference)
CMake syntax highlighting
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
Make a class for CmakeList files, perhaps use "cma" for the extension.
Make a syntax file for the "cma" class
Now, load the CmakeList.txt file,
Click on File/Rename to CmakeList.cma
Use the syntax file for cma class
Do the work.
Rename the file back to CMakeList.txt, save and exit.
You could make a macro to the rename from .txt to .cma and another macro to rename from .cma to .txt.
Make a syntax file for the "cma" class
Now, load the CmakeList.txt file,
Click on File/Rename to CmakeList.cma
Use the syntax file for cma class
Do the work.
Rename the file back to CMakeList.txt, save and exit.
You could make a macro to the rename from .txt to .cma and another macro to rename from .cma to .txt.
Hope this was helpful.............good luck,
Bob
Bob
Re: CMake syntax highlighting
Zaippa wrote: The files you create for telling CMake how to generate the makefiles are all called "CMakeLists.txt".
To make it a little easier for me to edit these files, i made a syntax highlighting file for textpad and a new document class for "CMakeLists.txt"-files.
The problem is (of course) that textpad will never use this document class. Whenever i open a CMakeLists.txt file, textpad uses the "Text" document class, since this document class is used for all filenames on the form "*.txt" - including CMakeLists.txt!
So is there a way to syntax highlight CMakeLists.txt files differently than other txt-files?
Yes, there is a way.
When Textpad tries to find a document class for a file, it tries all document classes - in reverse alphabetic order (don't ask me why, it is just like that).
So create your document class with a name, that comes alphabetically after the "Text" class, e.g. "ZMake", and as a file filter, use "CMakeLists.txt" (or whatever pattern that matches your files but not generally all txt files)