summary refs log tree commit diff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 14 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b2f0f90..25abc3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,11 +4,18 @@ project(meowcraft)
 set(CMAKE_CXX_STANDARD 17)
 
 find_package(glfw3 3.3 REQUIRED)
-find_package(OpenGL REQUIRED)
 find_package(GLEW REQUIRED)
 
-add_executable(meowcraft src/main.cpp src/Window.cpp src/Window.hpp src/Mesh.cpp src/Mesh.hpp src/Math/Vector.hpp src/Math/Math.hpp src/Binder.cpp src/Binder.hpp src/Shader/ShaderSources.hpp src/Shader/Shader.cpp src/Shader/Shader.hpp src/Shader/ShaderProgram.cpp src/Shader/ShaderProgram.hpp src/Math/Matrix.hpp src/Math/MVP.cpp src/Math/MVP.hpp src/Camera.cpp src/Camera.hpp src/Math/Rotation.hpp src/Shader/Uniform.cpp src/Shader/Uniform.hpp src/Mouse.cpp src/Mouse.hpp src/Math/Trig.hpp)
-target_link_libraries(meowcraft glfw GLEW::GLEW OpenGL)
+if (LINUX)
+    find_package(OpenGL REQUIRED)
+endif (LINUX)
+
+add_executable(meowcraft src/main.cpp src/Window.cpp src/Window.hpp src/Mesh.cpp src/Mesh.hpp src/Math/Vector.hpp src/Math/Math.hpp src/Binder.cpp src/Binder.hpp src/Shader/Shader.cpp src/Shader/Shader.hpp src/Shader/ShaderProgram.cpp src/Shader/ShaderProgram.hpp src/Math/Matrix.hpp src/Math/MVP.cpp src/Math/MVP.hpp src/Camera.cpp src/Camera.hpp src/Math/Rotation.hpp src/Shader/Uniform.cpp src/Shader/Uniform.hpp src/Mouse.cpp src/Mouse.hpp src/Math/Trig.hpp src/Texture.cpp src/Texture.hpp src/Assets.cpp src/Assets.hpp src/Image/RawImage.cpp src/Image/RawImage.hpp src/Image/PPMParser.cpp src/Image/PPMParser.hpp)
+target_link_libraries(meowcraft glfw GLEW::GLEW)
+
+if (LINUX)
+    target_link_libraries(meowcraft OpenGL)
+endif (LINUX)
 
 function(make_includable input_file output_file)
     file(READ ${input_file} content)
@@ -17,5 +24,7 @@ function(make_includable input_file output_file)
     file(WRITE ${output_file} "${content}")
 endfunction(make_includable)
 
-make_includable(src/Shader/fragment.glsl src/Shader/Generated/fragment.glsl.includable)
-make_includable(src/Shader/vertex.glsl src/Shader/Generated/vertex.glsl.includable)
\ No newline at end of file
+make_includable(assets/shaders/fragment.glsl assets/generated/shaders/fragment.glsl.includable)
+make_includable(assets/shaders/vertex.glsl assets/generated/shaders/vertex.glsl.includable)
+
+make_includable(assets/images/atlas.ppm assets/generated/images/atlas.ppm.includable)
\ No newline at end of file