-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
373a4d3
commit c142075
Showing
5 changed files
with
103 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,50 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
option(BUILD_TESTS "BuildTests" ON) | ||
option(BUILD_BENCHMARK "BuildBenchmark" OFF) | ||
set(PROJECT_VERSION "0.0.3" CACHE INTERNAL "Version") | ||
project (allocator VERSION ${PROJECT_VERSION}) | ||
|
||
cmake_minimum_required (VERSION 3.25) | ||
# Enable Hot Reload for MSVC compilers if supported. | ||
if (POLICY CMP0141) | ||
cmake_policy(SET CMP0141 NEW) | ||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>") | ||
endif() | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "$<0:>${CMAKE_BINARY_DIR}/bin") | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "$<0:>${CMAKE_BINARY_DIR}/lib") | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "$<0:>${CMAKE_BINARY_DIR}/lib") | ||
option(BUILD_TESTS "Build tests" ON) | ||
option(CONFIGURE_DEB_PACKAGE "Configure .deb package" OFF) | ||
option(BUILD_BENCHMARK "Build benchmark" OFF) | ||
|
||
set(TARGET_NAME allocator_driver CACHE INTERNAL "Target name") | ||
set(PROJECT_VERSION "0.0.1" CACHE INTERNAL "Version") | ||
|
||
add_subdirectory(allocator_driver) | ||
project (${TARGET_NAME} VERSION ${PROJECT_VERSION}) | ||
add_executable (${TARGET_NAME} "src/main.cpp") | ||
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD 20) | ||
set_target_properties(${TARGET_NAME} | ||
PROPERTIES | ||
ARCHIVE_OUTPUT_DIRECTORY "$<0:>${CMAKE_BINARY_DIR}/bin" | ||
LIBRARY_OUTPUT_DIRECTORY "$<0:>${CMAKE_BINARY_DIR}/lib" | ||
RUNTIME_OUTPUT_DIRECTORY "$<0:>${CMAKE_BINARY_DIR}/lib" | ||
) | ||
|
||
target_link_libraries(${TARGET_NAME} allocator_lib cc_lib) | ||
add_subdirectory(allocator_lib) | ||
add_subdirectory(cc_lib) | ||
|
||
# deb-package. | ||
set(CPACK_GENERATOR DEB) | ||
set(CPACK_PACKAGE_NAME "allocator_driver") | ||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") | ||
set(CPACK_PACKAGE_ARCHITECTURE "amd64") | ||
set(CPACK_PACKAGE_CONTACT [email protected]) | ||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/deb") | ||
include(CPack) | ||
# .deb package. | ||
if(CONFIGURE_DEB_PACKAGE) | ||
set(CPACK_GENERATOR DEB) | ||
set(CPACK_PACKAGE_NAME ${TARGET_NAME}) | ||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") | ||
set(CPACK_PACKAGE_ARCHITECTURE "amd64") | ||
set(CPACK_PACKAGE_CONTACT "[email protected]") | ||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/deb") | ||
include(CPack) | ||
endif() | ||
|
||
# Tests. | ||
enable_testing() | ||
add_subdirectory(tests) | ||
if(BUILD_TESTS) | ||
enable_testing() | ||
add_subdirectory(tests) | ||
endif() | ||
|
||
if(BuildBenchmark) | ||
# Benchmark. | ||
if(BUILD_BENCHMARK) | ||
add_subdirectory(benchmark) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters