50 lines
No EOL
1.3 KiB
CMake
50 lines
No EOL
1.3 KiB
CMake
# Project
|
|
project(
|
|
rmlui_test
|
|
VERSION 1.0.0
|
|
DESCRIPTION "rmlui_test"
|
|
LANGUAGES CXX C
|
|
)
|
|
|
|
# Dependencies
|
|
set(CMAKE_TLS_VERIFY FALSE) # Custom TLS/Proxy sometimes does not enable download
|
|
include(dependencies.cmake)
|
|
|
|
# Source files
|
|
set(TARGET rmlui_test)
|
|
set(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
add_executable(${TARGET}
|
|
${SOURCES}/main.cpp
|
|
)
|
|
|
|
# Include folders
|
|
target_include_directories(${TARGET} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
|
target_include_directories(${TARGET} PRIVATE "${RMLUI_INCLUDE_DIRS}")
|
|
|
|
# Libraries
|
|
target_link_libraries(
|
|
${TARGET} PRIVATE
|
|
rmlui_debugger
|
|
rmlui_core
|
|
)
|
|
|
|
# Compilation depending on the platform
|
|
if(MSVC)
|
|
# Build the program as a window-only (no cmd)
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
target_link_options(${TARGET} PRIVATE "/SUBSYSTEM:WINDOWS")
|
|
target_compile_options(${TARGET} PRIVATE /W3 /WX )
|
|
else()
|
|
target_compile_options(${TARGET} PRIVATE /W3 /WX /DEBUG )
|
|
endif()
|
|
else()
|
|
target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
|
endif()
|
|
|
|
# Output folder
|
|
set_target_properties(${TARGET}
|
|
PROPERTIES
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
|
) |