cmake_minimum_required(VERSION 3.16) #J3.16 # Set your project name here project( {{project_name}} VERSION 0.1.0) # Set the C++ standard to use (change to your preferred version) set(CMAKE_CXX_STANDARD 17) set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) # Add your source files here (replace "main.cpp" with your actual source files) set(SOURCES src/mylibrary.cpp ) # Add headers, if any (replace "header.h" with your actual header files) set(HEADERS include/dummy.hpp ) # Build a static library ( *.a ) file # Add source files to the library for # Set the include directories (replace "include" with your actual include path) add_library("${PROJECT_NAME}_Static" STATIC ${SOURCES} ${HEADERS}) target_include_directories("${PROJECT_NAME}_Static" PUBLIC include ) # Set any additional compiler flags if needed target_compile_options("${PROJECT_NAME}_Static" PRIVATE -Wall -Werror -Wunused -Wextra -std=c++17) # Build a shared library ( *.so ) file # Add source files to the library for # Set the include directories (replace "include" with your actual include path) add_library("${PROJECT_NAME}_Shared" SHARED ${SOURCES} ${HEADERS}) target_include_directories("${PROJECT_NAME}_Shared" PUBLIC include ) # Set any additional compiler flags if needed target_compile_options("${PROJECT_NAME}_Shared" PRIVATE -Wall -Werror -Wunused -Wextra -std=c++17) # If you have any external libraries to link against, use the following format: # find_package(YourLibrary REQUIRED) # target_link_libraries(${PROJECT_NAME} PRIVATE YourLibrary::YourLibrary) # Optionally, you can enable testing with Google Test add_subdirectory(tests) enable_testing() # add_test(NAME MyTest COMMAND MyTestExecutable) # Optionally, set the output directory for the built binaries set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)