summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <g-gregory@gmx.fr>2018-12-06 13:26:10 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-12-10 18:57:12 +0100
commit5fc3ae36c8e07ed7157b04ce25b7339a119be471 (patch)
treec1d9dad1c508b8309e3ad6981dfe8a58b4131368
parentfa5aeda68e606323acd442b6bef99f35a687c2a3 (diff)
downloadkpicosim-5fc3ae36c8e07ed7157b04ce25b7339a119be471.tar.gz
kpicosim-5fc3ae36c8e07ed7157b04ce25b7339a119be471.zip
conversion to the cmake building system
Signed-off-by: gregory guy <g-gregory@gmx.fr>
-rw-r--r--CMakeLists.txt75
-rw-r--r--ConfigureChecks.cmake29
-rw-r--r--config.h.cmake8
-rw-r--r--doc/CMakeLists.txt1
-rw-r--r--doc/en/CMakeLists.txt1
-rw-r--r--doc/man/CMakeLists.txt5
-rw-r--r--doc/man/kpicosim.151
-rw-r--r--src/CMakeLists.txt69
-rw-r--r--src/cinstruction.cpp2
-rw-r--r--src/jtagprogrammer.cpp1
-rw-r--r--src/jtagprogrammer.h2
-rw-r--r--src/kjtagdialog.cpp2
-rw-r--r--src/kport.cpp2
-rw-r--r--src/kprocessorview.cpp2
-rw-r--r--src/kserialview.cpp2
-rw-r--r--src/pics/CMakeLists.txt4
16 files changed, 251 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..ee3b515
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,75 @@
+############################################
+# #
+# Improvements and feedbacks are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+############################################
+
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+#### general package setup
+
+project( kpicosim )
+set( VERSION R14.1.0 )
+
+
+#### include essential cmake modules
+
+include( FindPkgConfig )
+include( CheckFunctionExists )
+include( CheckIncludeFile )
+include( CheckLibraryExists )
+include( CheckCSourceCompiles )
+include( CheckCXXSourceCompiles )
+
+
+#### include our cmake modules
+
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+include( TDEMacros )
+
+
+##### setup install paths
+
+include( TDESetupPaths )
+tde_setup_paths( )
+
+
+##### optional stuff
+
+option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
+
+
+##### user requested modules
+
+option( BUILD_ALL "Build all" ON )
+option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
+
+
+##### configure checks
+
+include( ConfigureChecks.cmake )
+
+
+###### global compiler settings
+
+add_definitions( -DHAVE_CONFIG_H )
+
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
+set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
+set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
+
+
+##### directories
+
+add_subdirectory( src )
+tde_conditional_add_subdirectory( BUILD_DOC doc )
+
+
+##### write configure files
+
+configure_file( config.h.cmake config.h @ONLY )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..fbc879f
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,29 @@
+###########################################
+# #
+# Improvements and feedback are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+###########################################
+
+
+# required stuff
+find_package( TQt )
+find_package( TDE )
+
+tde_setup_architecture_flags( )
+
+include(TestBigEndian)
+test_big_endian(WORDS_BIGENDIAN)
+
+
+##### check for gcc visibility support
+
+if( WITH_GCC_VISIBILITY )
+ if( NOT UNIX )
+ tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" )
+ endif( NOT UNIX )
+ set( __KDE_HAVE_GCC_VISIBILITY 1 )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
+endif( WITH_GCC_VISIBILITY )
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..61ede3a
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,8 @@
+#define VERSION "@VERSION@"
+
+// Defined if you have fvisibility and fvisibility-inlines-hidden support.
+#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..6d0aa9f
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1 @@
+tde_auto_add_subdirectories( )
diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt
new file mode 100644
index 0000000..ba3ef3e
--- /dev/null
+++ b/doc/en/CMakeLists.txt
@@ -0,0 +1 @@
+tde_create_handbook( DESTINATION ${PROJECT_NAME} )
diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt
new file mode 100644
index 0000000..8512250
--- /dev/null
+++ b/doc/man/CMakeLists.txt
@@ -0,0 +1,5 @@
+INSTALL(
+ FILES ${PROJECT_NAME}.1
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kpicosim.1 b/doc/man/kpicosim.1
new file mode 100644
index 0000000..0348ae8
--- /dev/null
+++ b/doc/man/kpicosim.1
@@ -0,0 +1,51 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH KPICOSIM 1 "November 12, 2005"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+kpicosim \- IDE and simulator for the Xilinx PicoBlaze-3
+.SH SYNOPSIS
+.B kpicosim
+.SH DESCRIPTION
+.B kpicosim
+is a development environment for the Xilinx
+PicoBlaze-3 soft-core processor for the Trinity Desktop (Linux).
+The environment has an editor with syntax highlighting, compiler,
+simulator and export functions to VHDL, HEX and MEM files.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+.\"\fBkpicosim\fP is a program that...
+.SH OPTIONS
+Currently, there are no options. Perhaps, one day there will be
+some more.
+.SP 1
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+For a complete description, see the Info files.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.SH AUTHOR
+kpicosim was written by Mark Six <m6@xs4all.nl>.
+.PP
+This manual page was written by Adrian Knoth <adi@thur.de>
+for the Debian project (but may be used by others).
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..467a30b
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,69 @@
+add_subdirectory( pics )
+
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/debian
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+ ${TDE_LIB_DIR}
+)
+
+
+##### kpicosim (executable)
+
+tde_add_executable( ${PROJECT_NAME} AUTOMOC
+
+ SOURCES
+ main.cpp
+ kpicosim.cpp
+ codeeditor.cpp
+ ksimulator.cpp
+ kprocessorview.cpp
+ kserialview.cpp
+ kportview.cpp
+ kscratchpadview.cpp
+ kport.cpp
+ kexportdialog.cpp
+ cassembler.cpp
+ cinstruction.cpp
+ cpicoblaze.cpp
+ jtagdevice.cpp
+ kjtagdialog.cpp
+ jtag.cpp
+ jtagprogrammer.cpp
+ LINK
+ tdecore-shared
+ tdeui-shared
+ tdeio-shared
+
+ DESTINATION ${BIN_INSTALL_DIR}
+)
+
+
+##### icons
+
+tde_install_icons( ${PROJECT_NAME} )
+
+
+##### other data
+
+install(
+ FILES kpicosimui.rc
+ DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
+)
+
+install(
+ FILES psm.xml
+ DESTINATION ${DATA_INSTALL_DIR}/katepart/syntax
+)
+
+install(
+ FILES ${PROJECT_NAME}.desktop
+ DESTINATION ${APPS_INSTALL_DIR}/Development
+)
diff --git a/src/cinstruction.cpp b/src/cinstruction.cpp
index 9c6fba8..93765db 100644
--- a/src/cinstruction.cpp
+++ b/src/cinstruction.cpp
@@ -1,6 +1,6 @@
#include "cinstruction.h"
-#include "iostream"
+#include <iostream>
using namespace std ;
diff --git a/src/jtagprogrammer.cpp b/src/jtagprogrammer.cpp
index d40e19c..7060ee0 100644
--- a/src/jtagprogrammer.cpp
+++ b/src/jtagprogrammer.cpp
@@ -231,3 +231,4 @@ void JTAGProgrammer::setBitFile( std::string filename )
m_bitFilename = filename ;
}
+#include "jtagprogrammer.moc"
diff --git a/src/jtagprogrammer.h b/src/jtagprogrammer.h
index d5ad78c..0930a7a 100644
--- a/src/jtagprogrammer.h
+++ b/src/jtagprogrammer.h
@@ -21,7 +21,7 @@
#define JTAGPROGRAMMER_H
#include <tqobject.h>
-#include <string.h>
+#include <string>
#include "jtag.h"
class JTAGProgrammer : public TQObject
{
diff --git a/src/kjtagdialog.cpp b/src/kjtagdialog.cpp
index 9122cf9..e8b092b 100644
--- a/src/kjtagdialog.cpp
+++ b/src/kjtagdialog.cpp
@@ -114,4 +114,4 @@ void KJTAGDialog::addMessage( const char *msg )
m_debug->insert( msg ) ;
}
-
+#include "kjtagdialog.moc"
diff --git a/src/kport.cpp b/src/kport.cpp
index d158cfd..4fb3b58 100644
--- a/src/kport.cpp
+++ b/src/kport.cpp
@@ -45,4 +45,4 @@ void KPort::setReadValue( uint8_t value ) {
m_readValue = value ;
}
-
+#include "kport.moc"
diff --git a/src/kprocessorview.cpp b/src/kprocessorview.cpp
index 0bc27b5..c483681 100644
--- a/src/kprocessorview.cpp
+++ b/src/kprocessorview.cpp
@@ -204,5 +204,5 @@ TDEProcessorView::~TDEProcessorView()
delete view ;
}
-
+#include "kprocessorview.moc"
diff --git a/src/kserialview.cpp b/src/kserialview.cpp
index ae2ef4d..b2f5a58 100644
--- a/src/kserialview.cpp
+++ b/src/kserialview.cpp
@@ -319,3 +319,5 @@ void KSerialView::setStatusBits( unsigned char value )
m_statusBits[ 4 ]->setChecked( (value & 0x08) != 0 ) ;
m_statusBits[ 5 ]->setChecked( (value & 0x04) != 0 ) ;
}
+
+#include "kserialview.moc"
diff --git a/src/pics/CMakeLists.txt b/src/pics/CMakeLists.txt
new file mode 100644
index 0000000..8593cb4
--- /dev/null
+++ b/src/pics/CMakeLists.txt
@@ -0,0 +1,4 @@
+install(
+ FILES continue.png interrupt.png next.png rebuild.png reset.png
+ DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/pics
+)