cmake - CMakeLists.txt is not in root folder (but is included in source)

狂风中的少年 提交于 2019-12-04 04:10:33

The INSTALL file explicitely says:

If you want to use "cmake" (see www.cmake.org), copy CMakeLists.txt
from the "scripts" directory to this directory and type

   cmake . [-DPNG_MMX=YES] -DCMAKE_INSTALL_PREFIX=/path
   make
   make install

And as a side note, before this it says that the classic way to install it is:

On Unix/Linux and similar systems, you can simply type

    ./configure [--prefix=/path]
    make check
    make install

It sounds like you did right with 3), however you forgot to cleanup the build dir before trying again.

If it's library which you use in your project you can build it automatically via technique called 'superbuild' (use ExternalProject_Add). By specifying SOURCE_SUBDIR as is described here to subdirectory with CMakeLists.txt you can do something like this

  ExternalProject_Add(libpng
  GIT_REPOSITORY    url-to-your-repository.git
  GIT_TAG           v1.2.37
  SOURCE_SUBDIR     "scripts"
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!