Merge pull request #5 from llyzs/cmake

Various cmake additions.
This commit is contained in:
Marc-André Moreau 2011-07-04 05:06:01 -07:00
commit fc41238752
11 changed files with 36 additions and 20 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
cmake_install.cmake cmake_install.cmake
CMakeFiles/ CMakeFiles/
CMakeCache.txt CMakeCache.txt
config.h
# Make # Make
Makefile Makefile

View File

@ -21,10 +21,16 @@ cmake_minimum_required(VERSION 2.8)
project(FreeRDP C) project(FreeRDP C)
set(CMAKE_COLOR_MAKEFILE ON) set(CMAKE_COLOR_MAKEFILE ON)
# Include cmake modules
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(TestBigEndian)
# Include our extra modules # Include our extra modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
include(AutoVersioning) include(AutoVersioning)
include(ConfigOptions)
# Soname versioning - 0.0.0 since it is not being managed yet # Soname versioning - 0.0.0 since it is not being managed yet
set(FREERDP_VERSION_MAJOR "0") set(FREERDP_VERSION_MAJOR "0")
@ -38,16 +44,32 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
endif() endif()
# Include files
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_files(netdb.h HAVE_NETDB_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
# Endian
test_big_endian(BIG_ENDIAN)
# Path to put keymaps # Path to put keymaps
set(FREERDP_KEYMAP_PATH "${CMAKE_INSTALL_PREFIX}/freerdp/keymaps") set(FREERDP_KEYMAP_PATH "${CMAKE_INSTALL_PREFIX}/freerdp/keymaps")
# Include directories
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/include)
# Configure files
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
# Build CUnit # Build CUnit
find_package(CUnit) find_package(CUnit)
if(CUNIT_FOUND) if(CUNIT_FOUND)
add_subdirectory(cunit) add_subdirectory(cunit)
endif() endif()
# Libraries # Sub-directories
add_subdirectory(include) add_subdirectory(include)
add_subdirectory(libfreerdp-asn1) add_subdirectory(libfreerdp-asn1)
add_subdirectory(libfreerdp-utils) add_subdirectory(libfreerdp-utils)

View File

@ -0,0 +1 @@
option(WITH_DEBUG_TRANSPORT "Print transport debug message." OFF)

11
config.h.in Normal file
View File

@ -0,0 +1,11 @@
/* Include files */
#cmakedefine HAVE_SYS_PARAM_H
#cmakedefine HAVE_SYS_SOCKET_H
#cmakedefine HAVE_NETDB_H
#cmakedefine HAVE_FCNTL_H
/* Endian */
#cmakedefine BIG_ENDIAN
/* Options */
#cmakedefine WITH_DEBUG_TRANSPORT

View File

@ -19,8 +19,6 @@
include_directories(${CUNIT_INCLUDE_DIRS}) include_directories(${CUNIT_INCLUDE_DIRS})
include_directories(.)
include_directories(../include)
include_directories(../libfreerdp-core) include_directories(../libfreerdp-core)
include_directories(../libfreerdp-gdi) include_directories(../libfreerdp-gdi)

View File

@ -17,8 +17,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
include_directories(.)
include_directories(../../include)
include_directories(../../libfreerdp-core) include_directories(../../libfreerdp-core)
add_executable(freerdp-test add_executable(freerdp-test

View File

@ -17,8 +17,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
include_directories(.)
set(COMMON_SRCS set(COMMON_SRCS
asn_application.h asn_application.h
asn_codecs.h asn_codecs.h

View File

@ -17,10 +17,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
include_directories(.)
include_directories(../include)
add_definitions(-DL_ENDIAN=1)
add_definitions(-DEXT_PATH="/usr/lib/freerdp/extensions") add_definitions(-DEXT_PATH="/usr/lib/freerdp/extensions")
set(LIBFREERDP_CORE_SRCS set(LIBFREERDP_CORE_SRCS

View File

@ -17,9 +17,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
include_directories(.)
include_directories(../include)
set(FREERDP_GDI_SRCS set(FREERDP_GDI_SRCS
color.c color.c
color.h color.h

View File

@ -17,9 +17,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
include_directories(.)
include_directories(../include)
set(FREERDP_KBD_SRCS set(FREERDP_KBD_SRCS
keyboard.h keyboard.h
locales.c locales.c

View File

@ -17,9 +17,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
include_directories(.)
include_directories(../include)
set(FREERDP_UTILS_SRCS set(FREERDP_UTILS_SRCS
datablob.c datablob.c
hexdump.c hexdump.c