This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
412 additions
and
1,067 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
cmake_minimum_required(VERSION 3.5.0) | ||
project(phantomjs) | ||
|
||
set (CMAKE_CXX_STANDARD 11) | ||
|
||
find_package(Qt5 COMPONENTS Core Network WebKitWidgets REQUIRED) | ||
find_package(Threads REQUIRED) | ||
|
||
message("Using Qt version ${Qt5Core_VERSION}") | ||
if (Qt5Core_VERSION VERSION_LESS 5.5.0) | ||
message(FATAL_ERROR "This version of Qt is not supported. Please use Qt 5.5 or later") | ||
endif() | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
file(GLOB_RECURSE PHANTOMJS_SOURCES src/*.cpp) | ||
include_directories(src) | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(THIRDPARTY_SOURCES src/mongoose/mongoose.c src/qcommandline/qcommandline.cpp src/linenoise/src/linenoise.c) | ||
include_directories(src/linenoise/src) | ||
include_directories(src/mongoose) | ||
include_directories(src/qcommandline) | ||
|
||
set(EXTRA_LIBS dl) | ||
|
||
add_executable(${PROJECT_NAME} src/phantomjs.qrc src/ghostdriver/ghostdriver.qrc ${PHANTOMJS_SOURCES} ${THIRDPARTY_SOURCES}) | ||
target_link_libraries(${PROJECT_NAME} ${EXTRA_LIBS} Qt5::Core Qt5::Network Qt5::WebKitWidgets Threads::Threads) | ||
install(TARGETS ${PROJECT_NAME} DESTINATION bin) | ||
|
||
add_custom_target(check COMMAND python test/run-tests.py -v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Installation Instructions | ||
************************* | ||
|
||
System requirements: | ||
|
||
* C++ toolchain such as g++ 7 or later | ||
* CMake version 3.5 or later | ||
* Qt 5 toolkit | ||
* Python 2.7 (to run the tests) | ||
|
||
|
||
Installation on Linux | ||
--------------------- | ||
|
||
On Debian/Ubuntu, the requirements can be fulfilled by installing these packages: | ||
|
||
sudo apt install g++ cmake qt5-default libqt5webkit5-dev python | ||
|
||
After unpacking the source tarball or cloning the repository: | ||
|
||
./configure && make | ||
|
||
Do a quick sanity check: | ||
|
||
./bin/phantomjs --version | ||
|
||
Run the test suite: | ||
|
||
make check | ||
|
||
Install it (may require sudo): | ||
|
||
make install | ||
|
||
|
||
Installation on Windows | ||
----------------------- | ||
|
||
To be written. | ||
|
||
|
||
Installation on macOS | ||
--------------------- | ||
|
||
To be written. | ||
|
Oops, something went wrong.