Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

lve-gh/make2cmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

154 Commits

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

AltStyle によって変換されたページ (->オリジナル) /