Perlmint / glew-cmake

GLEW(https://github.com/nigels-com/glew, source updated nightly) with Cmake and pre-generated sources
Other
234 stars 95 forks source link

cmake: "install TARGETS given no LIBRARY DESTINATION for shared library target" on LINUX #38

Closed requizm closed 3 years ago

requizm commented 3 years ago

I'm trying to build on linux with travis or appveyor. Windows builds perfectly working but linux not fine. -arch: linux/amd64 -dist: ubuntu 14.04 -codename: trusty

error lines:

CMake Error at deps/glew/CMakeLists.txt:135 (install):
  install TARGETS given no LIBRARY DESTINATION for shared library target
  "libglew_shared".

My CMakeList file: (just glew parts)

execute_process(COMMAND git submodule update --init WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_definitions(-DGLEW_STATIC)
add_subdirectory(${CMAKE_SOURCE_DIR}/deps/glew EXCLUDE_FROM_ALL)
target_link_libraries(${PROJECT_NAME} PRIVATE libglew_static)

travis script:

cmake -E make_directory Build
cmake -E chdir Build cmake .. //error is happening in this command
cd Build
make

I saw #17 but doesn't affect me.

Edit: Working on github actions. I do not know what should i say. yml file:

ubuntu:
    strategy:
      matrix:
        include:
          - compiler: gcc
            cxxcompiler: g++
    # The CMake configure and build commands are platform agnostic and should work equally
    # well on Windows or Mac.  You can convert this to a matrix build if you need
    # cross-platform coverage.
    # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
          submodules: true
    - name: install packages and build
      shell: bash
      run: |
        sudo apt-get install cmake libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev
        cmake -BBuild -G "Unix Makefiles"
        cd Build
        make
Perlmint commented 3 years ago

I found some cmake command not supported in the old version. I'll fix the script soon.

However, if you want to make it works right now, Please, use newer cmake - at least 3.14. The version of cmake apt package for ubuntu 14.04 is 2.8. You can use newer ubuntu or install cmake via PyPI

requizm commented 3 years ago

I found some cmake command not supported in the old version. I'll fix the script soon.

However, if you want to make it works right now, Please, use newer cmake - at least 3.14. The version of cmake apt package for ubuntu 14.04 is 2.8. You can use newer ubuntu or install cmake via PyPI

Thank you for answer. If you want, you can close this issue.

Perlmint commented 3 years ago

I created PR fixing this. It'll work with cmake 2.8. If you don't mind can you test it works?

requizm commented 3 years ago

Its working. Thank you for that. By the way, my ubuntu 14.04 cmake version was 3.9.2. Because that yml line:

addons:
  apt:
    update: true
Perlmint commented 3 years ago

Its working. Thank you for that. By the way, my ubuntu 14.04 cmake version was 3.9.2. Because that yml line:

addons:
  apt:
    update: true

Thanks for the fast response! Actually, I just noticed cmake 2.8 emit 2 errors - the error you reported one and another one.