elena-lang
elena-lang copied to clipboard
Create a CMake files to each C++ project
closing after merge
Hi, I saw on todo about using Cmake to build the compiler on Linux... well, the current cmake works only for windows... It's necessary to 'recreate' the current cmake script to work for windows, and linux ( x86-x64, ppc64, arm ... )
My proposal would be something: on root folder:
cmake_minimum_required(VERSION 3.16)
project(elena)
add_subdirectory("${PROJECT_SOURCE_DIR}/elenasrc2/elenasm/cmake" "${PROJECT_SOURCE_DIR}/bin")
add_subdirectory("${PROJECT_SOURCE_DIR}/elenasrc2/elc/cmake" "${PROJECT_SOURCE_DIR}/bin")
.....
The elenasm/cmake/CMakeLists.txt ( example only )
cmake_minimum_required(VERSION 3.16)
project(elenasm)
if(UNIX)
EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE )
message( STATUS "Architecture: ${ARCHITECTURE}" )
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
if(UNIX)
# some includes and lib samples....
if( ${ARCHITECTURE} STREQUAL "ppc64" )
include_directories("./libs/chilkat-9.5.0-ppc64-linux/include")
link_directories("./libs/chilkat-9.5.0-ppc64-linux/lib")
elseif( ${ARCHITECTURE} STREQUAL "ppc64le" )
include_directories("./libs/chilkat-9.5.0-ppc64le-linux/include")
link_directories("./libs/chilkat-9.5.0-ppc64le-linux/lib")
endif()
endif()
add_executable(elenasm ../cfparser.cpp ../inlineparser.cpp ../session.cpp)
if(UNIX)
target_link_libraries(elenasm resolv pthread)
endif()
if(MINGW)
target_link_libraries(elenasm -static-libgcc -static-libstdc++)
else(MSVC)
endif()
Hi, I will try to import make file from codeblocks to simplify the matter
I'm not familiar with make syntax, I always prefer UI to do the stuff :)
I don't think it's possible to convert the codeblocks project to CMake ... anyway, I'm going to write the cmake script for Linux and Windows
You will probably have to make some modifications to the script for Linux, to adjust the correct files
There is a tool cbp2make. I will try to use it.
I generated make files for codeblocks. In general I would prefer to use make over cmake. We could of course support both
the cbp2make works well..., I saw the make files.... About use visual tools, that ppc64le VM that I created for you, has support for XForwarding, so, you can install and use graphical programs on it, you just need to use some other SSH terminal, like this one, https://mobaxterm.mobatek.net/ , so, when you connect to the terminal, you can install codeblocks and open it....
Well, anyway, I will create CMakes for the project as well, so that it is possible to use the CLion IDE ... and do remote debugging
👍