• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Issues Compiling TFS 1.2

iNux

Well-Known Member
Joined
Jan 19, 2019
Messages
169
Reaction score
94
Hello!

I'm having an issue with compiling, i've tried on many TFS versions and it gives me the same issue so I thought to ask for help here since some of you probably have seen this and know the solution to it. It's about No SOURCES given to target: tfs which I have not encountered before.


Bash:
ubuntu@vps-ad999dd7:~/forgottenserver/build$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- cotire 1.7.6 loaded.
-- Performing Test COMPILER_KNOWS_CXX11
-- Performing Test COMPILER_KNOWS_CXX11 - Success
-- Performing Test COMPILER_KNOWS_STDLIB
-- Performing Test COMPILER_KNOWS_STDLIB - Failed
-- Performing Test COMPILER_KNOWS_LTO
-- Performing Test COMPILER_KNOWS_LTO - Success
-- Found Crypto++: /usr/include
-- Found PugiXML: /usr/include
-- MySQL Include dir: /usr/include/mysql  library dir: /usr/lib/x86_64-linux-gnu
-- MySQL client libraries: /usr/lib/x86_64-linux-gnu/libmysqlclient.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found LuaJIT: /usr/lib/x86_64-linux-gnu/libluajit-5.1.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "2.1.0-beta3")
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.53.0") found components: system filesystem iostreams
-- Target tfs cannot be cotired. No C or CXX source files.
-- Configuring done
CMake Error at CMakeLists.txt:49 (add_executable):
  No SOURCES given to target: tfs


CMake Generate step failed.  Build files cannot be regenerated correctly.
ubuntu@vps-ad999dd7:~/forgottenserver/build$
 
Solution
Change CMakeLists

Replace this:
Code:
add_subdirectory(src)
add_executable(tfs ${tfs_SRC})

To:
Code:
add_subdirectory(src)
include(src/CMakeLists.txt)
add_executable(tfs ${tfs_SRC})
Post your cmake file

I'm trying to compile this one with Ubuntu 23.04, but it seems to not work at all, the above issue is what I receive.
When compiling I follow this guide:


This is what I'm trying to Compile
 
Change CMakeLists

Replace this:
Code:
add_subdirectory(src)
add_executable(tfs ${tfs_SRC})

To:
Code:
add_subdirectory(src)
include(src/CMakeLists.txt)
add_executable(tfs ${tfs_SRC})
 
Last edited:
Solution
Change CMakeLists

Replace this:
Code:
add_subdirectory(src)
add_executable(tfs ${tfs_SRC})

To:
Code:
add_subdirectory(src)
include(src/CMakeLists.txt)
add_executable(tfs ${tfs_SRC})


Thank you very much! It worked
 
Back
Top