| 1 | #------------------------------------------------------------------------------ |
|---|
| 2 | # Desc: |
|---|
| 3 | # Tabs: 3 |
|---|
| 4 | # |
|---|
| 5 | # Copyright (c) 2007-2008 Novell, Inc. All Rights Reserved. |
|---|
| 6 | # |
|---|
| 7 | # This program and the accompanying materials are made available |
|---|
| 8 | # under, alternatively, the terms of: a) the Eclipse Public License v1.0 |
|---|
| 9 | # which accompanies this distribution, and is available at |
|---|
| 10 | # http://www.eclipse.org/legal/epl-v10.html; or, b) the Apache License, |
|---|
| 11 | # Version 2.0 which accompanies this distribution and is available at |
|---|
| 12 | # www.opensource.org/licenses/apache2.0.php. |
|---|
| 13 | # |
|---|
| 14 | # To contact Novell about this file by physical or electronic mail, |
|---|
| 15 | # you may find current contact information at www.novell.com. |
|---|
| 16 | # |
|---|
| 17 | # Author: Andrew Hodgkinson <ahodgkinson@novell.com> |
|---|
| 18 | #------------------------------------------------------------------------------ |
|---|
| 19 | |
|---|
| 20 | # Policy |
|---|
| 21 | |
|---|
| 22 | cmake_minimum_required( VERSION 2.4) |
|---|
| 23 | |
|---|
| 24 | # Project name |
|---|
| 25 | |
|---|
| 26 | project( DigitalMeJava Java) |
|---|
| 27 | |
|---|
| 28 | # Project version |
|---|
| 29 | |
|---|
| 30 | set( PROJECT_MAJOR_VERSION 0) |
|---|
| 31 | set( PROJECT_MINOR_VERSION 5) |
|---|
| 32 | |
|---|
| 33 | # Component paths |
|---|
| 34 | |
|---|
| 35 | if( NOT FTK_DIR) |
|---|
| 36 | set( FTK_DIR |
|---|
| 37 | "${CMAKE_SOURCE_DIR}/../../ftk") |
|---|
| 38 | endif( NOT FTK_DIR) |
|---|
| 39 | |
|---|
| 40 | # Java |
|---|
| 41 | |
|---|
| 42 | find_package( Java) |
|---|
| 43 | set( NON_NATIVE_TARGET TRUE) |
|---|
| 44 | |
|---|
| 45 | # Include the local modules directory |
|---|
| 46 | |
|---|
| 47 | set( CMAKE_MODULE_PATH "${FTK_DIR}/CMakeModules") |
|---|
| 48 | |
|---|
| 49 | # Common configuration |
|---|
| 50 | |
|---|
| 51 | include( CommonConfig) |
|---|
| 52 | |
|---|
| 53 | # Verbose makefile |
|---|
| 54 | |
|---|
| 55 | # set( CMAKE_VERBOSE_MAKEFILE TRUE) |
|---|
| 56 | |
|---|
| 57 | # Directories |
|---|
| 58 | |
|---|
| 59 | set( CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src) |
|---|
| 60 | |
|---|
| 61 | # Source files |
|---|
| 62 | |
|---|
| 63 | set( JAVA_SOURCE_FILES |
|---|
| 64 | CardSelector.java |
|---|
| 65 | TestSelector.java |
|---|
| 66 | ) |
|---|
| 67 | |
|---|
| 68 | # Targets |
|---|
| 69 | |
|---|
| 70 | add_custom_target( ${PROJECT_NAME}.jar.classes |
|---|
| 71 | COMMAND ${JAVA_COMPILE} -d ${CMAKE_BINARY_DIR} |
|---|
| 72 | ${JAVA_SOURCE_FILES} |
|---|
| 73 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/com/novell/identityselector) |
|---|
| 74 | |
|---|
| 75 | add_custom_target( ${PROJECT_NAME}-${PROJECT_VERSION}.jar ALL |
|---|
| 76 | COMMAND ${JAVA_ARCHIVE} cvfm ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.jar |
|---|
| 77 | ${CMAKE_SOURCE_DIR}/manifest -C ${CMAKE_BINARY_DIR} com |
|---|
| 78 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
|---|
| 79 | |
|---|
| 80 | # Dependencies |
|---|
| 81 | |
|---|
| 82 | add_dependencies( ${PROJECT_NAME}-${PROJECT_VERSION}.jar |
|---|
| 83 | ${PROJECT_NAME}.jar.classes) |
|---|