21 lines
588 B
CMake
21 lines
588 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(hello-cmake LANGUAGES CXX)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE})
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE})
|
|
|
|
find_package(cxxLibrary CONFIG REQUIRED)
|
|
|
|
if (MSVC)
|
|
add_compile_options(/utf-8)
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
endif()
|
|
|
|
add_executable(hello-cmake main.cpp)
|
|
target_link_libraries(hello-cmake PRIVATE cxxLibrary::cxxLibrary)
|
|
|
|
install(TARGETS hello-cmake DESTINATION bin)
|
|
install(DIRECTORY template DESTINATION bin)
|