commit 34f2cf51f2805b346652f1549c537885909c5d64
parent f372c6167c45cd7d32534097302362f4657ce059
Author: Matt Keeter <matt.j.keeter@gmail.com>
Date: Fri, 30 Jun 2017 07:57:51 -0400
Merge pull request #20 from senttech/master
Fixed CMake Linux build and added Linux build instructions
Diffstat:
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -42,6 +42,7 @@ set(Icon_Resource exe/fstl.rc)
#find required packages.
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets OpenGL)
find_package(OpenGL REQUIRED)
+find_package(Threads REQUIRED)
#add resources to RCC
qt5_add_resources(Project_Resources_RCC ${Project_Resources})
@@ -50,9 +51,11 @@ qt5_add_resources(Project_Resources_RCC ${Project_Resources})
include_directories(${QT_QTOPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} )
add_executable(fstl WIN32 ${Project_Sources} ${Project_Headers} ${Project_Resources_RCC} ${Icon_Resource})
-target_link_libraries(fstl Qt5::Widgets Qt5::Core Qt5::Gui Qt5::OpenGL ${OPENGL_LIBRARIES})
-set(Fstl_LINK_FLAGS ${CMAKE_CURRENT_SOURCE_DIR}/${Icon_Resource})
-set_target_properties(fstl PROPERTIES LINK_FLAGS ${Fstl_LINK_FLAGS})
+target_link_libraries(fstl Qt5::Widgets Qt5::Core Qt5::Gui Qt5::OpenGL ${OPENGL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+if(WIN32)
+ set(Fstl_LINK_FLAGS ${CMAKE_CURRENT_SOURCE_DIR}/${Icon_Resource})
+ set_target_properties(fstl PROPERTIES LINK_FLAGS ${Fstl_LINK_FLAGS})
+endif(WIN32)
# Add version definitions to use within the code.
target_compile_definitions(fstl PRIVATE -DFSTL_VERSION="${PROJECT_VERSION}")
diff --git a/README.md b/README.md
@@ -11,7 +11,7 @@ Issues and minor pull requests are welcome;
the project is under 1K lines of code and should be fairly approachable.
## Screenshot
-![Eiffel tower](http://mattkeeter.com/projects/fstl/eiffel.png)
+![Eiffel tower](http://mattkeeter.com/projects/fstl/eiffel.png)
(credit to [Pranav Panchal](https://grabcad.com/pranav.panchal))
## Building
@@ -45,6 +45,25 @@ This should produce two new files in the root directory:
- `fstl.app` is a standalone application that can be copied to `/Applications`
- `fstl.dmg` is a disk image that can be given to a friend
+### Linux
+
+Install Qt with your distro's package manager (required libraries are Core, Gui,
+Widgets and OpenGL).
+
+You can build fstl with qmake (in some distros qmake-qt5) or with CMake:
+```
+git clone https://github.com/mkeeter/fstl
+cd fstl
+mkdir build
+cd build
+
+qmake ../qt/fstl.pro # For qmake build
+cmake .. # For CMake build
+
+make -j8
+./fstl
+```
+
--------------------------------------------------------------------------------
# License