CMakeLists.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. cmake_minimum_required(VERSION 3.10)
  2. project(MyProject)
  3. ###########
  4. # Debug or Release
  5. ###########
  6. if (NOT CMAKE_BUILD_TYPE)
  7. ## set default to Debug
  8. set(CMAKE_BUILD_TYPE Debug) # override with -DCMAKE_BUILD_TYPE=Release
  9. message("==> CMAKE_BUILD_TYPE empty. Changing it to Debug.")
  10. else()
  11. message("==> CMAKE_BUILD_TYPE == ${CMAKE_BUILD_TYPE}.")
  12. endif()
  13. ## https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
  14. ## During Debug, use debug version of libstdc++ (asserts on access to invalid iterators, etc!)
  15. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
  16. ###########
  17. # Suppress certain warnings
  18. ###########
  19. # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
  20. ##############
  21. # C++ Standard
  22. ##############
  23. set(CMAKE_CXX_STANDARD 14)
  24. set(CMAKE_CXX_EXTENSIONS OFF)
  25. # Enable testing
  26. # set(BUILD_TESTING ON)
  27. # include(CTest)
  28. # Example for how to define a test which uses gtest_gmock
  29. # add_executable(mytest tester.cpp)
  30. # target_link_libraries(mytest gmock_main)
  31. add_executable(mystic mystic.c)
  32. target_link_libraries(mystic util)
  33. add_executable(try-re try-re.c)