Skip to content

Commit

Permalink
Made soil be findable on unix
Browse files Browse the repository at this point in the history
  • Loading branch information
cdgiessen committed Nov 12, 2018
1 parent 66b9b75 commit d8c4e6f
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,30 @@ project(GraphicsProject4 VERSION 0.0.1 LANGUAGES CXX)

find_package (OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(SOIL CONFIG REQUIRED)
#find_package(SOIL CONFIG REQUIRED)
find_package(glfw3 REQUIRED)
find_package(glm REQUIRED)

IF (SOIL_INCLUDE_DIR)
# Already in cache, be silent
SET(SOIL_FIND_QUIETLY TRUE)
ENDIF (SOIL_INCLUDE_DIR)

FIND_PATH(SOIL_INCLUDE_DIR SOIL.h PATH_SUFFIXES include/SOIL include)

SET(SOIL_NAMES SOIL Soil soil)
FIND_LIBRARY(SOIL_LIBRARY NAMES ${SOIL_NAMES} )
MARK_AS_ADVANCED( SOIL_LIBRARY SOIL_INCLUDE_DIR )

# Per-recommendation
SET(SOIL_INCLUDE_DIRS "${SOIL_INCLUDE_DIR}")
SET(SOIL_LIBRARIES "${SOIL_LIBRARY}")

# handle the QUIETLY and REQUIRED arguments and set SOIL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SOIL DEFAULT_MSG SOIL_LIBRARIES SOIL_INCLUDE_DIRS)

add_executable(main

src/TerrainFPS.cpp
Expand All @@ -19,7 +39,7 @@ target_link_libraries(main PRIVATE ${OPENGL_LIBRARIES})
target_include_directories(main PRIVATE GLEW)
target_link_libraries(main PRIVATE GLEW::GLEW)

target_link_libraries(main PRIVATE SOIL)
target_link_libraries(main PRIVATE ${SOIL_LIBRARY})

target_link_libraries(main PUBLIC glm)

Expand All @@ -30,4 +50,4 @@ target_include_directories(main PRIVATE ${CMAKE_SOURCE_DIR}/src)

add_custom_command(TARGET main POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/Resources $<TARGET_FILE_DIR:main>)
${PROJECT_SOURCE_DIR}/Resources $<TARGET_FILE_DIR:main>)

0 comments on commit d8c4e6f

Please sign in to comment.