11cmake_minimum_required (VERSION 3.16 )
22
3- project (lexer
3+ project (merve
44 DESCRIPTION "Fast lexer to extract named exports via analysis from CommonJS modules"
55 LANGUAGES C CXX
66 VERSION 1.0.0
77)
88
9- set (LEXER_LIB_VERSION "1.0.0" CACHE STRING "lexer library version" )
10- set (LEXER_LIB_SOVERSION "1" CACHE STRING "lexer library soversion" )
9+ set (MERVE_LIB_VERSION "1.0.0" CACHE STRING "lexer library version" )
10+ set (MERVE_LIB_SOVERSION "1" CACHE STRING "lexer library soversion" )
1111
1212include (GNUInstallDirs )
1313
1414# Optional simdutf support for optimized string operations
15- if (LEXER_USE_SIMDUTF )
15+ if (MERVE_USE_SIMDUTF )
1616 # Try to find simdutf system package first
1717 find_package (simdutf QUIET )
1818 if (NOT simdutf_FOUND)
@@ -32,35 +32,35 @@ if(LEXER_USE_SIMDUTF)
3232 message (STATUS "simdutf enabled for optimized string operations" )
3333 else ()
3434 message (WARNING "simdutf requested but not found, building without it" )
35- set (LEXER_USE_SIMDUTF OFF )
35+ set (MERVE_USE_SIMDUTF OFF )
3636 endif ()
3737endif ()
3838
3939include (CTest )
4040include (cmake/lexer-flags.cmake )
4141
42- set (LEXER_SOURCE_DIR src)
42+ set (MERVE_SOURCE_DIR src)
4343
4444add_subdirectory (src )
4545
4646set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /scripts/cmake)
4747
48- option (LEXER_BENCHMARKS "Build benchmarks" OFF )
49- option (LEXER_TESTING "Build tests" ${BUILD_TESTING} )
48+ option (MERVE_BENCHMARKS "Build benchmarks" OFF )
49+ option (MERVE_TESTING "Build tests" ${BUILD_TESTING} )
5050
5151# There are cases where when embedding lexer as a dependency for other CMake
5252# projects as submodules or subdirectories (via FetchContent) can lead to
5353# errors due to CPM, so this is here to support disabling all the testing
5454# for lexer if one only wishes to use the lexer library.
55- if (LEXER_TESTING OR LEXER_BENCHMARKS )
55+ if (MERVE_TESTING OR MERVE_BENCHMARKS )
5656 # Try to find GTest system package first
5757 find_package (GTest QUIET )
5858 if (NOT GTest_FOUND)
5959 include (cmake/CPM.cmake )
6060 # CPM requires git as an implicit dependency
6161 find_package (Git QUIET )
6262 # We use googletest in the tests
63- if (Git_FOUND AND LEXER_TESTING )
63+ if (Git_FOUND AND MERVE_TESTING )
6464 CPMAddPackage (
6565 NAME GTest
6666 GITHUB_REPOSITORY google/googletest
@@ -70,7 +70,7 @@ if(LEXER_TESTING OR LEXER_BENCHMARKS)
7070 endif ()
7171 endif ()
7272 # We use Google Benchmark, but it does not build under several 32-bit systems.
73- if (Git_FOUND AND LEXER_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
73+ if (Git_FOUND AND MERVE_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
7474 CPMAddPackage (
7575 NAME benchmark
7676 GITHUB_REPOSITORY google/benchmark
@@ -82,7 +82,7 @@ if(LEXER_TESTING OR LEXER_BENCHMARKS)
8282 )
8383 endif ()
8484
85- if (LEXER_TESTING AND NOT EMSCRIPTEN)
85+ if (MERVE_TESTING AND NOT EMSCRIPTEN)
8686 if (Git_FOUND)
8787 message (STATUS "The tests are enabled." )
8888 add_subdirectory (tests )
@@ -93,102 +93,102 @@ if(LEXER_TESTING OR LEXER_BENCHMARKS)
9393 if (is_top_project)
9494 message (STATUS "The tests are disabled." )
9595 endif ()
96- endif (LEXER_TESTING AND NOT EMSCRIPTEN )
96+ endif (MERVE_TESTING AND NOT EMSCRIPTEN )
9797
98- If (LEXER_BENCHMARKS AND NOT EMSCRIPTEN)
98+ If (MERVE_BENCHMARKS AND NOT EMSCRIPTEN)
9999 if (Git_FOUND)
100100 message (STATUS "Lexer benchmarks enabled." )
101101 add_subdirectory (benchmarks )
102102 else ()
103103 message (STATUS "The benchmarks are disabled because git was not found." )
104104 endif ()
105- else (LEXER_BENCHMARKS AND NOT EMSCRIPTEN )
105+ else (MERVE_BENCHMARKS AND NOT EMSCRIPTEN )
106106 if (is_top_project)
107- message (STATUS "Lexer benchmarks disabled. Set LEXER_BENCHMARKS =ON to enable them." )
107+ message (STATUS "Lexer benchmarks disabled. Set MERVE_BENCHMARKS =ON to enable them." )
108108 endif ()
109- endif (LEXER_BENCHMARKS AND NOT EMSCRIPTEN )
109+ endif (MERVE_BENCHMARKS AND NOT EMSCRIPTEN )
110110
111- if (LEXER_TESTING AND EMSCRIPTEN)
111+ if (MERVE_TESTING AND EMSCRIPTEN)
112112 add_subdirectory (tests/wasm )
113- endif (LEXER_TESTING AND EMSCRIPTEN )
113+ endif (MERVE_TESTING AND EMSCRIPTEN )
114114endif ()
115115
116116
117- add_library (lexer::lexer ALIAS lexer )
117+ add_library (merve::merve ALIAS merve )
118118
119119set_target_properties (
120- lexer PROPERTIES
121- VERSION "${LEXER_LIB_VERSION } "
122- SOVERSION "${LEXER_LIB_SOVERSION } "
120+ merve PROPERTIES
121+ VERSION "${MERVE_LIB_VERSION } "
122+ SOVERSION "${MERVE_LIB_SOVERSION } "
123123 WINDOWS_EXPORT_ALL_SYMBOLS YES
124124)
125125
126126include (CMakePackageConfigHelpers )
127127include (GNUInstallDirs )
128128
129- if (NOT LEXER_COVERAGE AND NOT EMSCRIPTEN)
129+ if (NOT MERVE_COVERAGE AND NOT EMSCRIPTEN)
130130 add_subdirectory (singleheader )
131131endif ()
132132
133133install (
134134 FILES include/lexer.h
135135 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} "
136- COMPONENT lexer_development
136+ COMPONENT merve_development
137137)
138138
139139install (
140140 DIRECTORY include/lexer
141141 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} "
142- COMPONENT lexer_development
142+ COMPONENT merve_development
143143)
144144
145145install (
146- TARGETS lexer
147- EXPORT lexer_targets
148- RUNTIME COMPONENT lexer_runtime
149- LIBRARY COMPONENT lexer_runtime
150- NAMELINK_COMPONENT lexer_development
151- ARCHIVE COMPONENT lexer_development
146+ TARGETS merve
147+ EXPORT merve_targets
148+ RUNTIME COMPONENT merve_runtime
149+ LIBRARY COMPONENT merve_runtime
150+ NAMELINK_COMPONENT merve_development
151+ ARCHIVE COMPONENT merve_development
152152 INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} "
153153)
154154
155- configure_file (cmake/lexer -config.cmake.in lexer -config.cmake @ONLY )
155+ configure_file (cmake/merve -config.cmake.in merve -config.cmake @ONLY )
156156
157157write_basic_package_version_file (
158- lexer -config-version.cmake
158+ merve -config-version.cmake
159159 COMPATIBILITY SameMinorVersion
160160)
161161
162162set (
163- LEXER_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR} /cmake/lexer "
163+ MERVE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR} /cmake/merve "
164164 CACHE STRING "CMake package config location relative to the install prefix"
165165)
166- mark_as_advanced (LEXER_INSTALL_CMAKEDIR )
166+ mark_as_advanced (MERVE_INSTALL_CMAKEDIR )
167167
168168install (
169169 FILES
170- "${PROJECT_BINARY_DIR} /lexer -config.cmake"
171- "${PROJECT_BINARY_DIR} /lexer -config-version.cmake"
172- DESTINATION "${LEXER_INSTALL_CMAKEDIR } "
173- COMPONENT lexer_development
170+ "${PROJECT_BINARY_DIR} /merve -config.cmake"
171+ "${PROJECT_BINARY_DIR} /merve -config-version.cmake"
172+ DESTINATION "${MERVE_INSTALL_CMAKEDIR } "
173+ COMPONENT merve_development
174174)
175175
176176install (
177- EXPORT lexer_targets
178- NAMESPACE lexer ::
179- DESTINATION "${LEXER_INSTALL_CMAKEDIR } "
180- COMPONENT lexer_development
177+ EXPORT merve_targets
178+ NAMESPACE merve ::
179+ DESTINATION "${MERVE_INSTALL_CMAKEDIR } "
180+ COMPONENT merve_development
181181)
182182
183183install (
184- EXPORT lexer_targets
185- NAMESPACE lexer ::
186- DESTINATION "${LEXER_INSTALL_CMAKEDIR } "
184+ EXPORT merve_targets
185+ NAMESPACE merve ::
186+ DESTINATION "${MERVE_INSTALL_CMAKEDIR } "
187187 COMPONENT example_development
188188)
189189
190190if (is_top_project)
191- set (CPACK_PACKAGE_VENDOR "Lexer Authors" )
191+ set (CPACK_PACKAGE_VENDOR "Merve Authors" )
192192 set (CPACK_PACKAGE_CONTACT "yagiz@nizipli.com" )
193193 set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR} /LICENSE-MIT" )
194194 set (CPACK_RPM_PACKAGE_LICENSE "${PROJECT_SOURCE_DIR} /LICENSE-MIT" )
0 commit comments