Comments (4)
Not sure about autotools, but here is a cmake file that would greatly help cross-platform development. As you might be aware, cmake is cross-platform build tools that is capable of generating the project/solution files for almost all major IDEs such as eclipse, codeblocks and MSVC. The below cmake file was tested to be working correctly with MS Visual studio.
Please include it in the code. (copy everything between the ------- lines and save it as 'CMakeLists.txt' in the root directory (case sensitive). To use it,
- create a new directory called 'build'
- cd build
- cmake ..
That should generate the 'h3 static library' and target application 'h3-test' inside the 'build\debug' directory.
CMakeLists.txt content
cmake_minimum_required(VERSION 2.8)
PROJECT( h3 )
if(CMAKE_COMPILER_IS_GNUCC)
SET(TARGET_COMPILE_FLAGS "-std=gnu++11") # Add C++11 support for GCC
endif()
set(TARGET_COMPILE_DEFS "_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_BIND_TO_CURRENT_CRT_VERSION")
set(h3ProjDir ${CMAKE_CURRENT_SOURCE_DIR})
set(h3_Header_Files
${h3ProjDir}/include/h3.h
${h3ProjDir}/src/hash.h
${h3ProjDir}/src/mempool.h
${h3ProjDir}/src/scanner.h)
set(h3_Source_Files
${h3ProjDir}/src/hash.c
${h3ProjDir}/src/header_field.c
${h3ProjDir}/src/header_field_list.c
${h3ProjDir}/src/mempool.c
${h3ProjDir}/src/request_header.c
${h3ProjDir}/src/scanner.c)
set(h3_Data_Files
${h3ProjDir}/t/data/01-chrome-github.txt
${h3ProjDir}/t/data/02-chrome-github.txt
${h3ProjDir}/t/data/03-firefox.txt)
set_source_files_properties(${h3ProjDir}/src/scanner.c PROPERTIES LANGUAGE CXX)
set(h3_Compile_Flags ${TARGET_COMPILE_FLAGS})
set(h3_Compile_Defs ${TARGET_COMPILE_DEFS})
set(h3_Include_Dirs ${h3ProjDir}/include ${h3ProjDir}/src)
set(h3_Dependencies )
add_library(h3
${h3_Source_Files}
${h3_Header_Files}
${h3_Data_Files})
set_target_properties(h3 PROPERTIES
COMPILE_DEFINITIONS "${h3_Compile_Defs}"
COMPILE_FLAGS "${h3_Compile_Flags}"
INCLUDE_DIRECTORIES "${h3_Include_Dirs}"
LINKER_LANGUAGE CXX)
target_link_libraries(h3 ${h3_Dependencies})
set(h3_test_Source_Files
${h3ProjDir}/parser.c)
set(h3_test_Header_Files )
set(h3_test_Data_Files )
set(h3_test_Compile_Flags ${TARGET_COMPILE_FLAGS})
set(h3_test_Compile_Defs ${TARGET_COMPILE_DEFS})
set(h3_test_Include_Dirs ${h3_Include_Dirs})
set(h3_test_Dependencies h3)
add_executable(h3-test
${h3_test_Source_Files}
${h3_test_Header_Files}
${h3_test_Data_Files})
set_target_properties(h3-test PROPERTIES
COMPILE_DEFINITIONS "${h3_test_Compile_Defs}"
COMPILE_FLAGS "${h3_test_Compile_Flags}"
INCLUDE_DIRECTORIES "${h3_test_Include_Dirs}")
target_link_libraries(h3-test ${h3_test_Dependencies})
from h3.
Hi! I'm very glad to have that cmake file, could you send me a pull request of the cmakefile that can build the project? because I am too busy to work on this project.
from h3.
Thank you - created pull-request (issue 7)
from h3.
use cmake instead of autotools.
from h3.
Related Issues (11)
- Benchmark setup with pico http header parser
- Warning(s) during compile: statement with no effect HOT 2
- Why not parse cookie? HOT 1
- cmake results in error HOT 1
- Logodesign proposal
- Add pkg-config pc file.
- CMPH perfect hash for fast header field lookup
- h3_request_header_parse() should return on end-of-string also HOT 3
- Avoiding memory allocation inside the h3_request_header_parse HOT 2
- reserved identifier violation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h3.