Patch #3270 2012-04-02 20:21

alpha0010

CMake lexer
Download
3270-CMake_lexer.patch (56.1 KB)
Category
Lexer
Status
Accepted
Close date
2012-06-04 14:17
Assigned to
mortenmacfly
Index: src/sdk/resources/lexers/lexer_cmake.sample
===================================================================
--- src/sdk/resources/lexers/lexer_cmake.sample    (revision 0)
+++ src/sdk/resources/lexers/lexer_cmake.sample    (working copy)
@@ -0,0 +1,60 @@
+cmake_minimum_required(VERSION 2.8)
+project(AnApp)
+
+if(CMAKE_BUILD_TYPE STREQUAL "")
+    set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
+endif()
+
+set(CMAKE_DEBUG_POSTFIX "_d")
+set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/dist")
+
+# Find Boost
+set(Boost_USE_STATIC_LIBS TRUE)
+if(MINGW)
+    # this is probably a bug in CMake: the boost find module tries to look for
+    # boost libraries with name libboost_*, but CMake already prefixes library
+    # search names with "lib". This is the workaround.
+    set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "")
+endif()
+set(Boost_ADDITIONAL_VERSIONS "1.49" "1.49.0" "1.48" "1.48.0" "1.47" "1.47.0" "1.46.1" "1.46" "1.46.0")
+find_package(Boost COMPONENTS thread date_time QUIET)
+if(NOT Boost_FOUND)
+    # Try again with the other type of libs
+    set(Boost_USE_STATIC_LIBS FALSE)
+    find_package(Boost COMPONENTS thread date_time QUIET)
+endif()
+find_package(Boost QUIET)
+include_directories(${Boost_INCLUDE_DIR})
+add_definitions(-DBOOST_ALL_NO_LIB)
+
+set(HDRS
+    ./BaseApplication.h
+    ./MainApplication.h
+)
+set(SRCS
+    ./BaseApplication.cpp
+    ./MainApplication.cpp
+)
+
+include_directories(${Boost_INCLUDE_DIRS})
+add_executable(AnApp ${HDRS} ${SRCS})
+set_target_properties(AnApp PROPERTIES DEBUG_POSTFIX _d)
+target_link_libraries(AnApp ${Boost_LIBRARIES})
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dist/bin)
+install(TARGETS AnApp
+    RUNTIME DESTINATION bin
+    CONFIGURATIONS All
+)
+if(WIN32 AND NOT Boost_USE_STATIC_LIBS)
+    install(FILES ${Boost_DATE_TIME_LIBRARY_RELEASE}
+        ${Boost_THREAD_LIBRARY_RELEASE}
+        DESTINATION bin
+        CONFIGURATIONS Release RelWithDebInfo
+    )
+    install(FILES ${Boost_DATE_TIME_LIBRARY_DEBUG}
+        ${Boost_THREAD_LIBRARY_DEBUG}
+        DESTINATION bin
+        CONFIGURATIONS Debug
+    )
+endif(WIN32)
Index: src/sdk/resources/lexers/lexer_cmake.xml
===================================================================
--- src/sdk/resources/lexers/lexer_cmake.xml    (revision 0)
+++ src/sdk/resources/lexers/lexer_cmake.xml    (working copy)
@@ -0,0 +1,546 @@
+<?xml version="1.0"?>
+<!DOCTYPE CodeBlocks_lexer_properties>
+<CodeBlocks_lexer_properties>
+        <Lexer name="CMake"
+               index="80"
+               filemasks="*CMakeLists.txt,*.cmake,*.cmake.in,*.ctest,*.ctest.in">
+                <Style name="Default"
+                       index="0"
+                       fg="0,0,0"
+                       bg="255,255,255"
+                       bold="0"
+                       italics="0"
+                       underlined="0"/>
+                <Style name="Comment"
+                       index="1"
+                       fg="160,160,160"/>
+                <Style name="String"
+                       index="2,3,4"
+                       fg="0,0,255"/>
+                <Style name="Commands"
+                       index="5"
+                       fg="0,0,160"
+                       bold="1"/>
+                <Style name="Parameters"
+                       index="6"
+                       fg="190,0,0"/>
+                <Style name="Variable"
+                       index="7"
+                       fg="230,100,5"/>
+                <Style name="User defined"
+                       index="8"
+                       fg="50,115,50"
+                       bold="1"/>
+                <Style name="Definitions"
+                       index="9,10,11,12"
+                       fg="100,0,100"
+                       bold="1"/>
+                <Style name="Variable within a string"
+                       index="13"
+                       fg="100,55,200"/>
+                <Style name="Number"
+                      index="14"
+                      fg="240,0,240"/>
+                <Style name="Selection"
+                       index="-99"
+                       bg="192,192,192"/>
+                <Style name="Active line"
+                       index="-98"
+                       bg="255,255,160"/>
+                <Style name="Breakpoint line"
+                       index="-2"
+                       bg="255,160,160"/>
+                <Style name="Debugger active line"
+                       index="-3"
+                       bg="160,160,255"/>
+                <Style name="Compiler error line"
+                       index="-4"
+                       bg="255,128,0"/>
+                <Style name="Matching brace highlight"
+                       index="34"
+                       bg="128,255,255"
+                       bold="1"/>
+
download for full patch...