Query/CMakeLists.txt

32 lines
994 B
CMake

cmake_minimum_required(VERSION 3.16)
project(CMakeSFMLProject LANGUAGES CXX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x)
FetchContent_MakeAvailable(SFML)
FetchContent_Declare(
xlnt
GIT_REPOSITORY https://github.com/pointertobios/xlnt.git
GIT_TAG master)
FetchContent_MakeAvailable(xlnt)
add_executable(main src/main.cpp)
target_link_libraries(main PRIVATE sfml-graphics xlnt)
target_compile_features(main PRIVATE cxx_std_17)
target_include_directories(main PRIVATE include)
if(WIN32)
add_custom_command(
TARGET main
COMMENT "Copy OpenAL DLL"
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,x64,x86>/openal32.dll $<TARGET_FILE_DIR:main>
VERBATIM)
endif()