Skip to content

LLMMiscProject/make2cmake

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

make2cmake

Для работы над проектом необходимы git и CMake.

Как собрать проект:

  1. Установить папку с проектом
  2. В установленной папке октрыть git
  3. Прописать команды:

mkdir build

cd build/

cmake ..

В папке examples качестве примера предлагается конвертировать следующий makefile:

CC=g++
CFLAGS=-c -Wall
general : hello
hello: main.o factorial.o hello.o
	$(CC) main.o factorial.o hello.o -o hello
main.o: main.cpp 
	$(CC) $(CFLAGS) main.cpp
factorial.o: factorial.cpp 
	$(CC) $(CFLAGS) factorial.cpp
hello.o: hello.cpp 
	$(CC) $(CFLAGS) hello.cpp

Результатом работы конвертера является следующий файл CMakeLists.txt:

cmake_minimum_required(VERSION 3.02)
project(projectName)
set(CMAKE_C_COMPILER g++)
set(CMAKE_CPP_COMPILER g++)
set(CMAKE_C_FLAGS -c -Wall)
set(CMAKE_CXX_GLAGS -c -Wall)
set(CC g++)
set(CFLAGS -c -Wall )
add_library(hello.o OBJECT  hello.cpp )
target_compile_options(hello.o PUBLIC  -Wall -c)
add_library(factorial.o OBJECT  factorial.cpp )
target_compile_options(factorial.o PUBLIC  -Wall -c)
add_library(main.o OBJECT  main.cpp )
target_compile_options(main.o PUBLIC  -Wall -c)
add_library(hello $<TARGET_OBJECTS:main.o> $<TARGET_OBJECTS:factorial.o> 
$<TARGET_OBJECTS:hello.o> )
add_executable(general   hello)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.2%
  • Makefile 3.7%
  • CMake 2.3%
  • Python 1.8%