forgot if i changed anything

This commit is contained in:
malloc 2018-08-14 16:44:37 -05:00
parent 5427b589ae
commit 0369add339

View file

@ -1,42 +1,48 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
project(sockscape) project(sockscape)
file(GLOB_RECURSE server_src
"src/*.hpp"
"src/*.cpp"
"src/*.c"
"src/*.h"
)
file(GLOB_RECURSE client_src
"client/src/*.hpp"
"clientsrc/*.cpp"
)
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
## CLIENT BUILD ##
find_package(OPENGL REQUIRED) find_package(OPENGL REQUIRED)
find_package(GLEW REQUIRED) find_package(GLEW REQUIRED)
find_package(SDL2 REQUIRED) find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED) find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED) find_package(SDL2_ttf REQUIRED)
add_executable(client client_src) file(GLOB_RECURSE client_src
target_include_directories(client ${PROJECT_SOURCE_DIR}/include "src/client/*.hpp"
${OPENGL_INCLUDE_DIR} "src/client/*.cpp"
${GLEW_INCLUDE_DIR} )
${SDL2_INCLUDE_DIR}
${SDL2_IMAGE_INCLUDE_DIR} add_executable(client ${client_src})
${SDL2_TTF_INCLUDE_DIR}) target_include_directories(client
target_link_libraries(client ${OPENGL_LIBRARIES} PRIVATE ${PROJECT_SOURCE_DIR}/include/client
${GLEW_LIBRARY} PRIVATE ${OPENGL_INCLUDE_DIR}
${SDL2_LIBRARY} PRIVATE ${GLEW_INCLUDE_DIR}
${SDL2_IMAGE_LIBRARIES} PRIVATE ${SDL2_INCLUDE_DIR}
${SDL2_TTF_LIBRARIES}) PRIVATE ${SDL2_IMAGE_INCLUDE_DIR}
PRIVATE ${SDL2_TTF_INCLUDE_DIR})
target_link_libraries(client
${OPENGL_LIBRARIES}
${GLEW_LIBRARY}
${SDL2_LIBRARY}
${SDL2_IMAGE_LIBRARIES}
${SDL2_TTF_LIBRARIES})
install(TARGETS client RUNTIME DESTINATION bin/client) install(TARGETS client RUNTIME DESTINATION bin/client)
add_executable(server server_src) ## SERVER BUILD ##
file(GLOB_RECURSE server_src
"src/server/*.hpp"
"src/server/*.cpp"
"src/server/*.c"
"src/server/*.h"
)
add_executable(server ${server_src})
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(server wsock32 ws2_32) target_link_libraries(server wsock32 ws2_32)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")