mason/CMakeLists.txt

58 lines
1.7 KiB
CMake
Raw Normal View History

2023-08-30 20:54:59 +00:00
cmake_minimum_required(VERSION 3.5)
2023-08-27 17:55:04 +00:00
project(mason
VERSION 0.0.1
DESCRIPTION "Javascript application project build tool"
LANGUAGES CXX
)
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0077 NEW)
cmake_policy(SET CMP0079 NEW)
set(CMAKE_CXX_STANDARD 17)
include(GNUInstallDirs)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
list(APPEND COMPILE_OPTIONS -O3)
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND COMPILE_OPTIONS -g)
list(APPEND COMPILE_OPTIONS -Wall)
list(APPEND COMPILE_OPTIONS -Wextra)
endif()
2023-08-30 20:54:59 +00:00
find_package(nlohmann_json REQUIRED)
2023-09-01 21:39:24 +00:00
find_package(CURL REQUIRED)
2023-09-04 21:45:01 +00:00
find_package(LibArchive REQUIRED)
2023-08-30 20:54:59 +00:00
2023-08-27 17:55:04 +00:00
add_executable(${PROJECT_NAME})
target_compile_options(${PROJECT_NAME} PRIVATE ${COMPILE_OPTIONS})
set_property(TARGET ${PROJECT_NAME} PROPERTY VERSION ${version})
set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION 1)
set_property(TARGET ${PROJECT_NAME} PROPERTY
INTERFACE_${PROJECT_NAME}_MAJOR_VERSION 1)
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION
)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
2023-09-18 18:59:43 +00:00
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src2)
2023-08-27 17:55:04 +00:00
add_subdirectory(src)
2023-09-17 19:34:00 +00:00
add_subdirectory(src2)
2023-08-30 20:54:59 +00:00
add_subdirectory(test)
target_link_libraries(${PROJECT_NAME} PRIVATE nlohmann_json::nlohmann_json)
2023-09-01 21:39:24 +00:00
target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)
2023-09-04 21:45:01 +00:00
target_link_libraries(${PROJECT_NAME} PRIVATE LibArchive::LibArchive)
2023-08-27 17:55:04 +00:00
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
)