12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- cmake_minimum_required(VERSION 3.10)
- project(MyProject)
- ###########
- # Debug or Release
- ###########
- if (NOT CMAKE_BUILD_TYPE)
- ## set default to Debug
- set(CMAKE_BUILD_TYPE Debug) # override with -DCMAKE_BUILD_TYPE=Release
- message("==> CMAKE_BUILD_TYPE empty. Changing it to Debug.")
- else()
- message("==> CMAKE_BUILD_TYPE == ${CMAKE_BUILD_TYPE}.")
- endif()
- ## https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
- ## During Debug, use debug version of libstdc++ (asserts on access to invalid iterators, etc!)
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
- ###########
- # Suppress certain warnings
- ###########
- # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
- ##############
- # C++ Standard
- ##############
- set(CMAKE_CXX_STANDARD 14)
- set(CMAKE_CXX_EXTENSIONS OFF)
- # Enable testing
- # set(BUILD_TESTING ON)
- # include(CTest)
- # Example for how to define a test which uses gtest_gmock
- # add_executable(mytest tester.cpp)
- # target_link_libraries(mytest gmock_main)
- add_executable(mystic mystic.c)
- target_link_libraries(mystic util)
- add_executable(try-re try-re.c)
|