portability/CMakeLists.txt

25 lines
902 B
CMake
Raw Normal View History

2017-12-08 08:29:14 +11:00
cmake_minimum_required (VERSION 2.6)
project (portability)
include_directories("modules/vulkan-docs/src")
add_executable(native_test native/test.cpp native/window.cpp)
2018-01-02 10:47:47 +11:00
# That's quite a mess, cleanup if possible..
2017-12-08 08:29:14 +11:00
if (WIN32)
2018-01-02 10:47:47 +11:00
# TODO: can we use `find_library`? It seemed to search for `portability.lib` always..
target_link_libraries(native_test "../target/debug/portability.dll")
2017-12-08 08:29:14 +11:00
target_link_libraries(native_test Dwmapi Userenv ws2_32)
2018-01-02 10:47:47 +11:00
# Copy dll over to build directory
add_custom_command(TARGET native_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/target/debug/portability.dll"
$<TARGET_FILE_DIR:native_test>)
2017-12-08 08:29:14 +11:00
else (WIN32)
2018-01-02 10:47:47 +11:00
find_library(PORTABILITY_LIB portability "target/debug")
target_link_libraries(native_test ${PORTABILITY_LIB})
2017-12-08 08:29:14 +11:00
target_link_libraries(native_test pthread dl m X11 xcb)
2018-01-02 10:47:47 +11:00
2017-12-08 08:29:14 +11:00
endif (WIN32)