CMakeLists.txt 683 B

1234567891011121314151617181920212223242526272829303132
  1. project(pystring
  2. LANGUAGES CXX
  3. )
  4. cmake_minimum_required(VERSION 3.0)
  5. set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2 ${CMAKE_CXX_FLAGS}")
  6. include(GNUInstallDirs)
  7. mark_as_advanced(CLEAR CMAKE_INSTALL_LIBDIR
  8. CMAKE_INSTALL_INCLUDEDIR
  9. )
  10. add_library(pystring SHARED
  11. pystring.cpp
  12. )
  13. set_target_properties(pystring PROPERTIES
  14. SOVERSION 0.0
  15. )
  16. install(TARGETS pystring
  17. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  18. )
  19. install(FILES pystring.h
  20. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pystring
  21. )
  22. add_executable(test pystring.cpp test.cpp)
  23. target_compile_definitions(test PRIVATE PYSTRING_UNITTEST=1)