Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compile vterm-module and change reques for cmake 3.10 and target_include_directories(vterm-module ...) #701

Open
bigopensky opened this issue Feb 19, 2024 · 0 comments

Comments

@bigopensky
Copy link

vterm-module does not compile on Ubuntu 18.04 cmake version 3.10.2

Analysis

/home/i4w/.emacs.d/elpa/vterm-20240102.1640
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.11 or higher is required.  You are running version 3.10.2

Changing CMakeLists.txt:1 to cmake_minimum_required(VERSION 3.10) leads to

/home/i4w/.emacs.d/elpa/vterm-20240102.1640
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- No build type selected, defaulting to RelWithDebInfo
-- System libvterm detected
CMake Error at CMakeLists.txt:95 (target_include_directories):
  Cannot specify include directories for imported target "vterm"-- System libvterm detected

Configuration CMakeLists.txt:95 shows:

95:target_include_directories(vterm INTERFACE ${LIBVTERM_INCLUDE_DIR})

The target properties are set in CMakeLists.txt:13-18

set_target_properties(vterm-module PROPERTIES
  C_STANDARD 99
  C_VISIBILITY_PRESET "hidden"
  POSITION_INDEPENDENT_CODE ON
  PREFIX ""
  LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}
  )

and line CMakeLists.txt:94.

set_target_properties(vterm PROPERTIES IMPORTED_LOCATION ${LIBVTERM_LIBRARY})

The subsequent line

target_include_directories(vterm INTERFACE ${LIBVTERM_INCLUDE_DIR})

is not accepted by cmake and causing the error:.

CMake Error at CMakeLists.txt:95 (target_include_directories):
  Cannot specify include directories for imported target "vterm"-- System libvterm detected

Solution

Changing the target in line CMakeLists.txt:95 to vterm-module solves the problem.

target_include_directories(vterm-module INTERFACE ${LIBVTERM_INCLUDE_DIR})
/home/i4w/.emacs.d/elpa/vterm-20240102.1640
-- System libvterm detected
-- Configuring done
-- Generating done
-- Build files have been written to: /home/i4w/.emacs.d/elpa/vterm-20240102.1640/build
Scanning dependencies of target vterm-module
[ 25%] Building C object CMakeFiles/vterm-module.dir/vterm-module.c.o
[ 50%] Building C object CMakeFiles/vterm-module.dir/utf8.c.o
[ 75%] Building C object CMakeFiles/vterm-module.dir/elisp.c.o
[100%] Linking C shared module ../vterm-module.so
[100%] Built target vterm-module

I'm not a Crack in term of cmake, but is it possible to use cmake version 3.10? Is the successful running target vterm-module the right one?

Best regards Bigopensky

@bigopensky bigopensky changed the title Request change Cmake version 3.10 and CMakeLists.txt:95 (target_include_directories) Error compile vterm-module and change reques for cmake 3.10 and target_include_directories(vterm-module ...) Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant