Default values for CMAKE_FIND_LIBRARY_PREFIXES/CMAKE_FIND_LIBRARY_SUFFIXES

后端 未结 2 690
梦毁少年i
梦毁少年i 2021-01-19 02:06

i guess i\'m missing something very obvious here, but it seems to me that the cmake variables CMAKE_FIND_LIBRARY_PREFIXES/CMAKE_FIND_LIBRARY_SUFFIXES are not se

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-19 02:25

    cmake variables CMAKE_FIND_LIBRARY_PREFIXES/CMAKE_FIND_LIBRARY_SUFFIXES are not set to any "decent" default value

    Why do you think so? For instance:

    cmake_minimum_required(VERSION 3.1)
    project(Foo)
    
    message("prefix: ${CMAKE_FIND_LIBRARY_PREFIXES}")
    message("suffix: ${CMAKE_FIND_LIBRARY_SUFFIXES}")
    

    Linux (Ubuntu):

    prefix: lib
    suffix: .so;.a
    

    Mac:

    prefix: lib
    suffix: .dylib;.so;.a
    

    Windows (Visual Studio):

    prefix:
    suffix: .lib
    

    calling find_package(OpenSSL REQUIRED) will break unless you set the variables in your main file

    Just tested, works fine for me. Ubuntu 14.04. CMake 2.8.12.2 and CMake 3.1.0-rc2.

提交回复
热议问题