pacman/lib/CMakeLists.txt

24 lines
729 B
CMake
Raw Normal View History

2021-06-22 07:43:00 +00:00
find_package(SFML COMPONENTS COMPONENTS window graphics system CONFIG REQUIRED)
find_package(fmt REQUIRED)
2021-06-22 08:16:16 +00:00
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
find_package(OpenGL REQUIRED COMPONENTS OpenGL GLX)
endif ()
2021-06-22 07:43:00 +00:00
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "*.cpp")
2021-06-22 07:45:19 +00:00
add_library(libpacman ${sources})
2021-06-22 07:43:00 +00:00
2021-07-05 10:02:26 +00:00
target_include_directories(libpacman PUBLIC include)
2021-06-22 07:45:19 +00:00
target_link_libraries(libpacman PUBLIC fmt::fmt sfml-graphics)
2021-06-22 08:16:16 +00:00
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_link_libraries(libpacman PUBLIC OpenGL::OpenGL OpenGL::GLX)
2021-07-05 10:02:26 +00:00
endif ()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
target_sources(libpacman PRIVATE Scaling.mm)
else()
target_sources(libpacman PRIVATE Scaling.cpp)
endif ()