12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- 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)
- ### ADD gtest
- add_subdirectory(googletest)
- add_executable(test_lastseen test_lastseen.cpp lastseen.cpp)
- add_dependencies(test_lastseen gtest)
- target_link_libraries(test_lastseen gtest_main)
- enable_testing()
- add_test(NAME test_lastseen
- COMMAND test_lastseen)
- # include(FetchContent)
- #
- # FetchContent_Populate(
- # zf_log
- # GIT_REPOSITORY https://github.com/wonder-mice/zf_log.git
- # SOURCE_DIR zf_log
- # )
- # add_subdirectory(${zf_log_SOURCE_DIR}/src zf_log)
- # This works, if zf_log is pulled in.
- add_subdirectory(zf_log)
- # Example for how to define a test which uses gtest_gmock
- # add_executable(mytest tester.cpp)
- # target_link_libraries(mytest gmock_main)
- # Here's how to add all *.h and *.cpp files
- # to a project:
- #
- # file(GLOB SOURCES
- # header-folder/*.h
- # source-folder/*.cpp
- # )
- # add_executable(yourProj ${SOURCES})
- add_executable(mystic mystic.cpp lastseen.cpp terminal.cpp render.cpp utils.cpp)
- target_link_libraries(mystic util)
- target_link_libraries(mystic zf_log)
- target_link_libraries(mystic efence)
- target_compile_definitions(mystic PUBLIC ZF_LOG_DEF_LEVEL=ZF_LOG_VERBOSE)
- add_executable(try-re try-re.c)
- add_executable(ansi-color ansi-color.c)
- add_executable(ansi-to-src ansi-to-src.cpp utils.cpp)
- add_executable(images images.cpp utils.cpp)
- target_link_libraries(images zf_log)
|