project(moduleA)
file(GLOB_RECURSE SOURCES ./src/*.cpp)
file(GLOB_RECURSE PUBLIC ./include/*.hpp)
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${PUBLIC})
include_directories(include)
target_sources(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include/moduleA.hpp)
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
project(moduleB)
file(GLOB_RECURSE SOURCES ./src/*.cpp)
include_directories(include)
add_library(${PROJECT_NAME} STATIC ${SOURCES})
target_sources(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(${PROJECT_NAME} PRIVATE moduleA)
cmake_minimum_required (VERSION 3.8)
project(main)
add_subdirectory(moduleA)
add_subdirectory(moduleB)
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} moduleA moduleB)
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
let a = m::new(...);
let b = m::new(...);
let c = a + (a + b);
println!(“{}”, a);
($t: ty, $({$($el:expr ),*}),*)