More on removing cmake
This commit is contained in:
parent
3247e18798
commit
040823fdbb
29 changed files with 0 additions and 268 deletions
|
@ -1,34 +0,0 @@
|
||||||
project(cpplab)
|
|
||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
|
|
||||||
FIND_PACKAGE(GTK)
|
|
||||||
|
|
||||||
IF(GTK_FOUND)
|
|
||||||
INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIR})
|
|
||||||
ADD_EXECUTABLE(my_gtk_exe my_gtk_exe.cxx)
|
|
||||||
TARGET_LINK_LIBRARIES(my_gtk_exe ${GTK_LIBRARIES})
|
|
||||||
ENDIF(GTK_FOUND)
|
|
||||||
|
|
||||||
|
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
||||||
|
|
||||||
#Set c++ c11 version
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
|
||||||
|
|
||||||
add_subdirectory(src)
|
|
||||||
add_subdirectory(include)
|
|
||||||
#add_executable(c_time time.cpp)
|
|
||||||
|
|
||||||
#install(TARGETS cpplab RUNTIME DESTINATION bin)
|
|
||||||
|
|
||||||
|
|
||||||
# CPack instructions for bundling purposes
|
|
||||||
set(CPACK_PACKAGE_CONTACT "Balhau")
|
|
||||||
set(CPACK_GENERATOR "STGZ;TGZ;TZ;DEB")
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CppLab")
|
|
||||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
|
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
|
|
||||||
|
|
||||||
include(CPack)
|
|
|
@ -1,4 +0,0 @@
|
||||||
add_subdirectory(bmath)
|
|
||||||
add_subdirectory(cpu)
|
|
||||||
add_subdirectory(dstruct)
|
|
||||||
add_subdirectory(misc)
|
|
|
@ -1,126 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2017 Vitor Fernandes <email>
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <cstddef>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class blist
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef struct node
|
|
||||||
{
|
|
||||||
node(T v, node *p, node *n)
|
|
||||||
{
|
|
||||||
value = v;
|
|
||||||
next = n;
|
|
||||||
previous = p;
|
|
||||||
}
|
|
||||||
node(T v)
|
|
||||||
{
|
|
||||||
value = v;
|
|
||||||
next = NULL;
|
|
||||||
previous = NULL;
|
|
||||||
}
|
|
||||||
T value;
|
|
||||||
node *next;
|
|
||||||
node *previous;
|
|
||||||
} Node;
|
|
||||||
|
|
||||||
blist()
|
|
||||||
{
|
|
||||||
this->rootNode = NULL;
|
|
||||||
this->currentNode = this->rootNode;
|
|
||||||
size = 0;
|
|
||||||
};
|
|
||||||
blist(T value)
|
|
||||||
{
|
|
||||||
this->rootNode = new Node(value, NULL, NULL);
|
|
||||||
this->currentNode = this->rootNode;
|
|
||||||
size = 1;
|
|
||||||
};
|
|
||||||
blist(const blist<T> &other)
|
|
||||||
{
|
|
||||||
this->rootNode = other.root();
|
|
||||||
};
|
|
||||||
void add(T value)
|
|
||||||
{
|
|
||||||
if (this->rootNode == NULL)
|
|
||||||
{
|
|
||||||
this->rootNode = new Node(value, NULL, NULL);
|
|
||||||
this->currentNode = rootNode;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Node *newNode = new Node(value, currentNode, NULL);
|
|
||||||
this->currentNode->next = newNode;
|
|
||||||
currentNode = newNode;
|
|
||||||
}
|
|
||||||
size++;
|
|
||||||
};
|
|
||||||
~blist()
|
|
||||||
{
|
|
||||||
std::cout << "Destructing list" << std::endl;
|
|
||||||
Node *aux;
|
|
||||||
while (this->currentNode != this->rootNode)
|
|
||||||
{
|
|
||||||
aux = this->currentNode;
|
|
||||||
this->currentNode = this->currentNode->previous;
|
|
||||||
delete aux;
|
|
||||||
}
|
|
||||||
delete this->rootNode;
|
|
||||||
};
|
|
||||||
blist<T> &operator=(const blist &other)
|
|
||||||
{
|
|
||||||
this->rootNode = other.root();
|
|
||||||
};
|
|
||||||
bool operator==(const blist &other)
|
|
||||||
{
|
|
||||||
this->rootNode == other.root();
|
|
||||||
};
|
|
||||||
Node *root() const
|
|
||||||
{
|
|
||||||
return this->rootNode;
|
|
||||||
};
|
|
||||||
Node *current() const
|
|
||||||
{
|
|
||||||
return this->currentNode;
|
|
||||||
};
|
|
||||||
|
|
||||||
T *values()
|
|
||||||
{
|
|
||||||
T *aux = new T[size];
|
|
||||||
Node *naux = this->rootNode;
|
|
||||||
for (int i = 0; i < size; i++)
|
|
||||||
{
|
|
||||||
aux[i] = naux->value;
|
|
||||||
naux = naux->next;
|
|
||||||
}
|
|
||||||
return aux;
|
|
||||||
};
|
|
||||||
int getSize()
|
|
||||||
{
|
|
||||||
return size;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
|
||||||
Node *rootNode;
|
|
||||||
Node *currentNode;
|
|
||||||
int size;
|
|
||||||
};
|
|
|
@ -1,2 +0,0 @@
|
||||||
add_subdirectory(memory)
|
|
||||||
add_subdirectory(util)
|
|
|
@ -1,6 +0,0 @@
|
||||||
add_subdirectory(bmath)
|
|
||||||
add_subdirectory(cpu)
|
|
||||||
add_subdirectory(dtstruct)
|
|
||||||
add_subdirectory(opengl)
|
|
||||||
add_subdirectory(misc)
|
|
||||||
add_subdirectory(gui)
|
|
|
@ -1,26 +0,0 @@
|
||||||
add_library(
|
|
||||||
bmath SHARED
|
|
||||||
complex.cpp
|
|
||||||
math.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories( bmath
|
|
||||||
PUBLIC
|
|
||||||
"${CMAKE_SOURCE_DIR}/include"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(
|
|
||||||
complex
|
|
||||||
demos/complex.cpp
|
|
||||||
complex.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(
|
|
||||||
math
|
|
||||||
demos/math.cpp
|
|
||||||
math.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
install(TARGETS bmath
|
|
||||||
DESTINATION "/usr/lib/bmath"
|
|
||||||
)
|
|
|
@ -1,7 +0,0 @@
|
||||||
add_executable(
|
|
||||||
sse
|
|
||||||
demos/sse.cpp
|
|
||||||
sse.cpp
|
|
||||||
naive.cpp
|
|
||||||
avx2.cpp
|
|
||||||
)
|
|
|
@ -1,22 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2017 Vitor Fernandes <email>
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "blist.hpp"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
add_subdirectory(memory)
|
|
||||||
add_subdirectory(dec)
|
|
|
@ -1,2 +0,0 @@
|
||||||
add_executable(dec_ex1 ex1.cpp)
|
|
||||||
add_executable(dec_ex2 ex2.cpp)
|
|
|
@ -1,4 +0,0 @@
|
||||||
add_executable(memorymodel model.cpp)
|
|
||||||
add_executable(volatile volatile.cpp)
|
|
||||||
add_executable(cmem cmem.c)
|
|
||||||
add_executable(cautofree cautofree.c)
|
|
|
@ -1,33 +0,0 @@
|
||||||
# Search for glfw
|
|
||||||
find_package(glfw3 3.2 REQUIRED)
|
|
||||||
# Search for glew
|
|
||||||
find_package(GLEW REQUIRED)
|
|
||||||
find_package(OpenGL REQUIRED)
|
|
||||||
find_package(GLUT REQUIRED)
|
|
||||||
#add_compile_definitions(IS_DEBUG=1)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Add gl1 executable build from gl1.cpp, glew.c and Renderer.cpp
|
|
||||||
add_executable(
|
|
||||||
gl1
|
|
||||||
gl1.cpp
|
|
||||||
Shader.cpp
|
|
||||||
Renderer.cpp
|
|
||||||
VertexBuffer.cpp
|
|
||||||
IndexBuffer.cpp
|
|
||||||
VertexArray.cpp
|
|
||||||
VertexBufferLayout.cpp
|
|
||||||
utils.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(gl2 gl2.cpp)
|
|
||||||
target_link_libraries(gl2 ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} )
|
|
||||||
|
|
||||||
add_executable(gl3 gl3.cpp)
|
|
||||||
target_link_libraries(gl3 ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} )
|
|
||||||
|
|
||||||
# Link gl1 with glfw lib
|
|
||||||
target_link_libraries(gl1 glfw GLEW OpenGL::GL)
|
|
Loading…
Reference in a new issue