# List all required files here (cmake best practice to NOT automate this step!) add_library(pls STATIC src/library.cpp include/pls/library.h src/internal/base/thread.cpp include/pls/internal/base/thread.h) # Settings for our project... # ...pthreads or C++ 11 threads option(USING_PTHREADS "Build the tests" ON) if(USING_PTHREADS) target_compile_definitions(pls PUBLIC PLS_USING_PTHREADS) else() target_compile_definitions(pls PUBLIC PLS_USING_CPP_THREADS) endif() # Add everything in `./include` to be in the include path of this project target_include_directories(pls PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src # TODO: Set this up when we require private headers ) # Add cmake dependencies here if needed target_link_libraries(pls Threads::Threads # pthread support ) # Rules for istalling the library on a system # ...binaries install(TARGETS pls LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) # ...all headers in `include` INSTALL ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include FILES_MATCHING PATTERN "*.h*" ) # Enable warnings/tidy code checking from our compiler target_compile_options(pls PRIVATE $<$,$,$>: -Wall> $<$: -W4>)