[CMake] cmakelists.txt

2012-06-24 Thread Heena Mahur
 Hey,I need to that what should i do in 
cmakelists.txt http://pastebin.com/raw.php?i=BGV9NAmQ since i am getting this 
error  (target_link_libraries):   Cannot specify link libraries for target 
ptedit_1 which is not built by   this project.

Please suggest the errors and the suggested commands in detail .I am a beginer
Reagards
Bye--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] cmake

2012-06-24 Thread Heena Mahur
project( ptedit_1 )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
find_package( KDE4 REQUIRED )
SET( MAIN_PROJECT_NAME ${PROJECT_NAME})
INCLUDE_DIRECTORIES( ${KDE4_INCLUDES}  )
SET(CPACK_SET_DESTDIR ON)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include_directories( ${KDE4_INCLUDE_DIRS} ${libkdepim_INCLUDES})
add_definitions( ${KDE4_DEFINITIONS} )
set( SOURCES src/ptedit_1.cpp )
kde4_add_ui_files( ptedit_1 ${CMAKE_SOURCE_DIR} ptedit_1.ui )
kde4_add_executable( ptedit_1 ${ptedit_1Sources}  ${CMAKE_SOURCE_DIR})
target_link_libraries( ptedit_1 ${KDE4_KDEUI_LIBS} )
install(TARGETS ptedit_1 ${INSTALL_TARGETS_DEFAULT_ARGS})


I am getting error-CMake Error: CMake can not determine linker language for 
target:ptedit_1
CMake Error: Cannot determine link language for target ptedit_1.
Please suggest what should I modify in this file and how? I tried hard but 
unable to find what is wrong please help--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] cmake

2012-06-24 Thread Rolf Eike Beer
 project( ptedit_1 )
 CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
 find_package( KDE4 REQUIRED )
 SET( MAIN_PROJECT_NAME ${PROJECT_NAME})
 INCLUDE_DIRECTORIES( ${KDE4_INCLUDES}  )
 SET(CPACK_SET_DESTDIR ON)
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
 include_directories( ${KDE4_INCLUDE_DIRS} ${libkdepim_INCLUDES})
 add_definitions( ${KDE4_DEFINITIONS} )
 set( SOURCES src/ptedit_1.cpp )
 kde4_add_ui_files( ptedit_1 ${CMAKE_SOURCE_DIR} ptedit_1.ui )
 kde4_add_executable( ptedit_1 ${ptedit_1Sources}  ${CMAKE_SOURCE_DIR})
 target_link_libraries( ptedit_1 ${KDE4_KDEUI_LIBS} )
 install(TARGETS ptedit_1 ${INSTALL_TARGETS_DEFAULT_ARGS})


 I am getting error-CMake Error: CMake can not determine linker language
 for target:ptedit_1
 CMake Error: Cannot determine link language for target ptedit_1.
 Please suggest what should I modify in this file and how? I tried hard but
 unable to find what is wrong please help--

You are adding an executable without files, so CMake can't determine which
language (C or C++) to use. You do

 set( SOURCES src/ptedit_1.cpp )

but then

 kde4_add_executable( ptedit_1 ${ptedit_1Sources}  ${CMAKE_SOURCE_DIR})

Adding the source dir there is totally wrong, and ptedit_1Sources has
never been set before.

Since I see you struggle with this stuff for some days: put message(STATUS
${myvar}) at different places in your CMakeLists.txt to see the contents
of the variables. Check if they make any sense. Hint: myvar is again a
placeholder.

Take a working project (KDE has many of them) and modify the
CMakeLists.txt to fit your need, i.e. replace the values of the variables
with your files.

Eike
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmakelists.txt

2012-06-24 Thread John Drescher
On Sun, Jun 24, 2012 at 5:57 AM, Heena Mahur hen...@rocketmail.com wrote:
  Hey,I need to that what should i do in
 cmakelists.txt http://pastebin.com/raw.php?i=BGV9NAmQ since i am getting
 this error  (target_link_libraries):   Cannot specify link libraries for
 target ptedit_1 which is not built by   this project.
 Please suggest the errors and the suggested commands in detail .I am a
 beginer
 Reagards
 Bye

put the kde4_add_executable line before the target_link_libraries line.

John
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] SHARED library containing OBJECT library: Missing -fPIC

2012-06-24 Thread Benjamin Eikel
Hello Leif,

Am Freitag, 22. Juni 2012 um 15:55:55 schrieb Leif Walsh:
 I tried this in my project. I added -fPIC to the COMPILE_FLAGS property of
 the object library and it worked, but then you also get PIC static
 libraries (which isn't that big of a deal). But time your compiles.
 Usually the compilation of individual c files is well dominated by the
 linking time, especially with optimization. So to reduce technical risk, I
 opted just to build each library the old fashioned way and compile objects
 twice. I saw pretty much no compile time difference. But maybe you have
 other reasons.

maybe I did not make things clear enough. I do not want to build the same 
library twice (static and dynamic). I just wanted to know if it is really 
required to add the compiler specific compile flag -fPIC manually when using 
object libraries for building a shared library. I know that there will be a 
compiler independent target property in CMake 2.8.9. But nevertheless, being 
forced to add this flags seems somehow cumbersome to me. When building a normal 
shared library composed only of source files, I do not have to add the flag, 
but 
it is automatically added by CMake.

Kind regards
Benjamin

 
 Sent from my iPhone
 
 On Jun 22, 2012, at 5:46, Andreas Naumann andreas-naum...@gmx.net wrote:
  I think the latter is the case. It should not be allowed to compose a
  shared library from OBJECT libraries. What does the cmake developer
  think about this problem?
  
  Regards,
  Andreas
  
  Am 22.06.2012 11:14, schrieb Benjamin Eikel:
  Hello Andreas,
  
  Am Freitag, 22. Juni 2012, 11:09:36 schrieb Andreas Naumann:
  Hello Benjamin,
  
  if you wants to use an object file for a shared library, this object
  file has to be compiled with -fPIC. I don't think, that it is possible
  to create a shared library from such object files.
  
  I know that this is the case. My question is not directed to -fPIC in
  general, but to CMake's handling of these files. I want to use CMake's
  new OBJECT library feature to structure the build of a library. The
  library is built statically as well as dynamically. When building
  statically, there is no problem in using the OBJECT libraries of CMake.
  But when building dynamically, the problem described in my original
  e-mail arises. CMake's documentation does not say that it is not
  allowed to use OBJECT libraries to compose shared libraries.
  
  Kind regards
  Benjamin
  
  Regards,
  Andreas
  
  Am 22.06.2012 09:50, schrieb Benjamin Eikel:
  Hello,
  
  I have a problem using an OBJECT library that I want to compile into a
  SHARED library using CMake version 2.8.8.
  
  Here is a small example that demonstrates my problem:
  
  # --- CMakeLists.txt ---
  cmake_minimum_required(VERSION 2.8.8)
  project(CMakeTest CXX)
  add_library(MyLibSub OBJECT
  
   ClassA.cpp
  
  )
  add_library(MyLib SHARED
  
   $TARGET_OBJECTS:MyLibSub
   ClassB.cpp
  
  )
  
  The content of the other four files is more or less irrelevant. To
  make the example complete, I added them at the end of this e-mail.
  
  When I want to build this example, I get the following error:
  
  $ mkdir build   cd build   cmake ..   make
  -- The CXX compiler identification is GNU 4.7.0
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/benjamin/Desktop/CMake
  test/build Scanning dependencies of target MyLibSub
  [ 50%] Building CXX object CMakeFiles/MyLibSub.dir/ClassA.cpp.o
  [ 50%] Built target MyLibSub
  Scanning dependencies of target MyLib
  [100%] Building CXX object CMakeFiles/MyLib.dir/ClassB.cpp.o
  Linking CXX shared library libMyLib.so
  /usr/bin/ld: CMakeFiles/MyLibSub.dir/ClassA.cpp.o: relocation
  R_X86_64_32 against `.rodata' can not be used when making a shared
  object; recompile with -fPIC
  CMakeFiles/MyLibSub.dir/ClassA.cpp.o: could not read symbols: Bad
  value collect2: error: ld returned 1 exit status
  make[2]: *** [libMyLib.so] Error 1
  make[1]: *** [CMakeFiles/MyLib.dir/all] Error 2
  make: *** [all] Error 2
  
  When I add the line
  set_target_properties(MyLibSub PROPERTIES COMPILE_FLAGS -fPIC)
  to the CMakeLists.txt, everything works fine. Am I doing something
  wrong? Should CMake add -fPIC automatically in this case? Your
  feedback is greatly appreciated.
  
  Kind regards
  Benjamin
  
  
  
  // --- ClassA.cpp ---
  #include ClassA.h
  #includeiostream
  
  void ClassA::printName() {
  
   std::cout   ClassA   std::endl;
  
  }
  // --- ClassA.h ---
  #ifndef CLASSA_H
  #define CLASSA_H
  
  struct ClassA {
  
   void printName();
  
  };
  
  #endif /* CLASSA_H */
  // --- ClassB.cpp ---
  #include ClassB.h
  

Re: [CMake] visual studio development setup

2012-06-24 Thread J Decker
pick one of the projects, right click, edit properties, set the debug
command line and working directory. There are browse buttons.  This
gets set as part of the user settings.  The default is usually
ALL_BUILD target, and that works fine once you set the debug
properties.

On Sat, Jun 23, 2012 at 12:12 PM, Totte Karlsson
to...@dunescientific.com wrote:
 Hi,
 I'm using CMake on a fairly large project involving building several DLL's
 and multiple applications and test programs. The current setup creates a
 visual studio sln file with about 10 individual projects. It has a install
 target and I can run apps that are built in the install folder, meaning
 running them outside the IDE.

 However, to run an individual project application from within the IDE don't
 work because at run time they will not find the necessary DLL's (unless I
 put the install's bin folder on the system path, which I don't want, for
 various reasons).  What is 'best practice' here? Obviously this setup is not
 optimal because it don't allow the user to run and debug individual projects
 in the VS IDE.

 One way making sense to me would be to have all individual projects output
 path to be the same.
 Is there a way in CMake to configure such a thing? That way all individual
 apps would find needed dll's when debugged from within the VS ide.

 Thanks,
 Totte


 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at
 http://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[Cmake-commits] CMake branch, master, updated. v2.8.8-415-geb0922a

2012-06-24 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, master has been updated
   via  eb0922a90c783ad3546ec8f43cc54864fae1ef1f (commit)
  from  2fdc5517b16b5ebe88475d4011be215cc7d1dbf9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb0922a90c783ad3546ec8f43cc54864fae1ef1f
commit eb0922a90c783ad3546ec8f43cc54864fae1ef1f
Author: Kitware Robot kwro...@kitware.com
AuthorDate: Mon Jun 25 00:01:02 2012 -0400
Commit: Kitware Robot kwro...@kitware.com
CommitDate: Mon Jun 25 00:01:02 2012 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 913bb82..11074f0 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
 SET(CMake_VERSION_MAJOR 2)
 SET(CMake_VERSION_MINOR 8)
 SET(CMake_VERSION_PATCH 8)
-SET(CMake_VERSION_TWEAK 20120624)
+SET(CMake_VERSION_TWEAK 20120625)
 #SET(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits