Is find_package(glog) not needed in cmake compiling?

89 Views Asked by At

I'm now trying to use glog in my project. By following the rules in google/glog, I designed a log system.

In the compiling stage, I wrote down my CMakeLists.txt as below:

    cmake_minimum_required(VERSION 3.0.2)
    project(glog_system)
    add_compile_options(-std=c++11)
    add_executable(glog_example
        example/example1.cpp
        example/g_logger.cpp
    )
    target_include_directories(glog_example PUBLIC
      example
    )
    target_link_libraries(glog_example
        glog
        stdc++fs
    )

What confused me is if find_package(glog) is not added in the CMakeLists.txt, I can still build the log system, and run the executable file successfully. But why?

I think this is related to cmake, can anyone give me some hints? Thanks.

UPDATE:

- build/
- example/
  - example1.cpp
  - g_logger.cpp
  - g_logger.h
CMakeLists.txt
0

There are 0 best solutions below