compilescript allows you to execute files from compiled languages as scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. cmake_minimum_required (VERSION 3.2)
  2. project(compilescript
  3. VERSION 0.3.2
  4. LANGUAGES CXX
  5. )
  6. include(GNUInstallDirs)
  7. find_package(PkgConfig REQUIRED)
  8. pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
  9. pkg_check_modules(LIBCONFIG REQUIRED libconfig++)
  10. set(CMAKE_CXX_STANDARD 14)
  11. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  12. set(CMAKE_CXX_EXTENSIONS OFF)
  13. set(CMAKE_CXX_FLAGS_DEBUG
  14. "${CMAKE_CXX_FLAGS_DEBUG} -Wall -pedantic -Wextra -g -Og -fno-omit-frame-pointer")
  15. include_directories(${PROJECT_BINARY_DIR})
  16. include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
  17. include_directories(${LIBCONFIG_INCLUDE_DIRS})
  18. link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
  19. link_directories(${LIBCONFIG_LIBRARY_DIRS})
  20. # Write version in header
  21. configure_file(
  22. "${PROJECT_SOURCE_DIR}/src/version.hpp.in"
  23. "${PROJECT_BINARY_DIR}/version.hpp"
  24. )
  25. file(GLOB sources src/*.cpp)
  26. add_executable(${CMAKE_PROJECT_NAME} "${sources}")
  27. target_link_libraries(${CMAKE_PROJECT_NAME}
  28. "${LIBXDG_BASEDIR_LDFLAGS} ${LIBCONFIG_LDFLAGS}"
  29. "-lstdc++fs")
  30. install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
  31. install(FILES README.md DESTINATION ${CMAKE_INSTALL_DOCDIR})