Brad King wrote:
Richard Fuchs wrote:
After hunting through CMakeJavaInformation.cmake, it doesn't seem to
have a CMAKE_Java_LINK_EXECUTABLE target/property (or whatever the
correct name for it is).  Does this mean that you can't call
ADD_EXECUTABLE with java files and I need to use ADD_LIBRARY or
something? CMakeLists.txt files below.
[snip]
# Compile the data model class generator
ADD_EXECUTABLE(./bin/dm_class_generator ${DATA_MODEL_CLASS_GENERATOR_SRCS})

Don't java programs have to be run using "java myprog"?  CMake has no
notion of a java executable.  Try ADD_LIBRARY to create a jar.

-Brad

So why when I have a simple CMakeLists.txt file like below am I getting this error? Why is it trying to put the .class files in some funky directory instead of just where the .java files are? Is there a way to set the OBJECT_DIR that's in the CMakeJavaInformation.cmake file?

Thanks

# Compile the OOS RDM to .xsd generator
SET(RDM_TO_XSD_GENERATOR_SRCS Declaration.java EmptyDataModelClass.java DataModelClass.java DataModelStructure.java GenerateVSADataModel.java JarfileClassLoader.java XSDSchema.java)

INCLUDE_DIRECTORIES(${SECORE_SOURCE_DIR}/common/vsa_data_model/rdm_to_xsd_generator)
# Compile the OOS RDM to .xsd generator
SET(RDM_TO_XSD_GENERATOR_SRCS Declaration.java EmptyDataModelClass.java DataModelClass.java DataModelStructure.java GenerateVSADataModel.java JarfileClassLoader.java XSDSchema.java)

INCLUDE_DIRECTORIES(${SECORE_SOURCE_DIR}/common/vsa_data_model/rdm_to_xsd_generator)

SET(RDM_OUTPUT_DIR ${SECORE_SOURCE_DIR}/common/vsa_data_model/rdm_to_xsd_generator)

# Compile the data model class generator
ADD_LIBRARY(rdm_to_xsd_generator ${RDM_TO_XSD_GENERATOR_SRCS}
SET(RDM_OUTPUT_DIR ${SECORE_SOURCE_DIR}/common/vsa_data_model/rdm_to_xsd_generator)

# Compile the data model class generator
ADD_LIBRARY(rdm_to_xsd_generator ${RDM_TO_XSD_GENERATOR_SRCS}

[EMAIL PROTECTED] secore]$ make
/usr/local/cmake/bin/cmake -H/work/secore-dev/secore -B/work/secore-dev/secore --check-build-system CMakeFiles/Makefile.cmake 0
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/work/secore-dev/secore'
make -f common/vsa_data_model/rdm_to_xsd_generator/CMakeFiles/rdm_to_xsd_generator.dir/build.make common/vsa_data_model/rdm_to_xsd_generator/CMakeFiles/rdm_to_xsd_generator.dir/depend
make[2]: Entering directory `/work/secore-dev/secore'
Scanning dependencies of target rdm_to_xsd_generator
cd /work/secore-dev/secore && /usr/local/cmake/bin/cmake -E cmake_depends "Unix Makefiles" /work/secore-dev/secore /work/secore-dev/secore/common/vsa_data_model/rdm_to_xsd_generator /work/secore-dev/secore/common/vsa_data_model/rdm_to_xsd_generator/CMakeFiles/rdm_to_xsd_generator.dir/DependInfo.cmake
make[2]: Leaving directory `/work/secore-dev/secore'
make -f common/vsa_data_model/rdm_to_xsd_generator/CMakeFiles/rdm_to_xsd_generator.dir/build.make common/vsa_data_model/rdm_to_xsd_generator/CMakeFiles/rdm_to_xsd_generator.dir/build
make[2]: Entering directory `/work/secore-dev/secore'
Building Java object common/vsa_data_model/rdm_to_xsd_generator/CMakeFiles/rdm_to_xsd_generator.dir/Declaration.class /usr/local/bin/javac -classpath /work/secore-dev/secore/common/vsa_data_model/rdm_to_xsd_generator /work/secore-dev/secore/common/vsa_data_model/rdm_to_xsd_generator/Declaration.java -d CMakeFiles/rdm_to_xsd_generator.dir /work/secore-dev/secore/common/vsa_data_model/rdm_to_xsd_generator/Declaration.java:3: error while writing VSADataModelGenerator.Declaration: CMakeFiles/rdm_to_xsd_generator.dir/VSADataModelGenerator/Declaration.class (No such file or directory)
public class Declaration {
      ^
1 error
make[2]: *** [common/vsa_data_model/rdm_to_xsd_generator/CMakeFiles/rdm_to_xsd_generator.dir/Declaration.class] Error 1
make[2]: Leaving directory `/work/secore-dev/secore'
make[1]: *** [common/vsa_data_model/rdm_to_xsd_generator/CMakeFiles/rdm_to_xsd_generator.dir/all] Error 2
make[1]: Leaving directory `/work/secore-dev/secore'
make: *** [all] Error 2

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to